tinyx-devel Mailing List for Tinyx RTOS (Page 3)
Status: Planning
Brought to you by:
davidcohen
You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
(4) |
Nov
|
Dec
(106) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(69) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: David C. <da...@gm...> - 2008-01-10 04:22:33
|
Adding size_t and ssize_t for ARM7 arch. Signed-off-by: David Cohen <da...@gm...> --- include/asm-arm7/stddef.h | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/include/asm-arm7/stddef.h b/include/asm-arm7/stddef.h index b81eee9..2a489bb 100644 --- a/include/asm-arm7/stddef.h +++ b/include/asm-arm7/stddef.h @@ -24,4 +24,7 @@ #define NULL ((void *)0) +typedef unsigned int size_t; +typedef int ssize_t; + #endif /* __ASM_STDDEF_H */ -- 1.5.3.7 |
From: David C. <da...@gm...> - 2008-01-10 04:22:30
|
This patch fixes warnings and missing semi-colons and adds stddef.h header, needed by size_t type, on string.c's functions. Signed-off-by: David Cohen <da...@gm...> --- include/libc/string.h | 6 ++++-- lib/libc/string.c | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/include/libc/string.h b/include/libc/string.h index ce7c7db..c97a83e 100644 --- a/include/libc/string.h +++ b/include/libc/string.h @@ -22,8 +22,10 @@ #ifndef __TINYX_LIBC_STRING_H #define __TINYX_LIBC_STRING_H -void *memset(void *mem, int data, size_t count) -void *memcpy(void *dest, const void *src, size_t count) +#include <asm/stddef.h> + +void *memset(void *mem, int data, size_t count); +void *memcpy(void *dest, const void *src, size_t count); char *strcat(char *str1, const char *str2); char *strchr(const char *str, int ch); int strcoll(const char *str1, const char *str2); diff --git a/lib/libc/string.c b/lib/libc/string.c index 0b9be1c..1a26851 100644 --- a/lib/libc/string.c +++ b/lib/libc/string.c @@ -75,7 +75,7 @@ char *strcat(char *str1, const char *str2) */ char *strchr(const char *str, int ch) { - for (; *str != (char)ch; ++s) + for (; *str != (char)ch; ++str) if (*str == '\0') return NULL; return (char *)str; @@ -123,7 +123,7 @@ char *strcpy(char *str1, const char *str2) { char *tmp = str1; - while ((*str1++ = *str2++) != '\0') + while ((*str1++ = *str2++) != '\0'); return tmp; } @@ -172,7 +172,7 @@ char *strncat(char *str1, const char *str2, size_t count) */ int strncmp(const char *str1, const char *str2, size_t count) { - signed char ret; + signed char ret = 0; while (count) { if ((ret = *str1 - *str2++) != 0 || !*str1++) -- 1.5.3.7 |
From: David C. <da...@gm...> - 2008-01-10 03:51:46
|
I have some patches for clock subsystem. I'll include it also with the static modifiers. Regards, David On Jan 8, 2008 4:35 PM, David Cohen <da...@gm...> wrote: > Hi, > > On Jan 8, 2008 2:07 PM, Felipe Balbi <me...@fe...> wrote: > > Neve use extern here since we're always building > > a single binary to flash on a device. There are no > > modules at all. > > > > Signed-off-by: Felipe Balbi <me...@fe...> > > --- > > arch/arm7/mach-lpc21xx/clock.h | 6 +++--- > > include/asm-generic/clock.h | 6 +++--- > > 2 files changed, 6 insertions(+), 6 deletions(-) > > > > diff --git a/arch/arm7/mach-lpc21xx/clock.h b/arch/arm7/mach-lpc21xx/clock.h > > index 214fd62..17ab17b 100644 > > --- a/arch/arm7/mach-lpc21xx/clock.h > > +++ b/arch/arm7/mach-lpc21xx/clock.h > > @@ -25,8 +25,8 @@ > > #include <asm/arch-lpc2xxx/clock.h> > > #include <tinyx/kernel.h> > > > > -extern unsigned int cclk_set_rate(struct clock *clk, unsigned int rate); > > -extern unsigned int pclk_set_rate(struct clock *clk, unsigned int rate); > > -extern void pclk_propagate(struct clock *clk, struct clock *parent); > > +unsigned int cclk_set_rate(struct clock *clk, unsigned int rate); > > +unsigned int pclk_set_rate(struct clock *clk, unsigned int rate); > > +void pclk_propagate(struct clock *clk, struct clock *parent); > > These functions are static also. > > Br, > > David > > > > > > #endif /* __ARCH_MACH_LPC2XXX_CLOCK_H */ > > diff --git a/include/asm-generic/clock.h b/include/asm-generic/clock.h > > index 4ac8e7c..28561ea 100644 > > --- a/include/asm-generic/clock.h > > +++ b/include/asm-generic/clock.h > > @@ -34,8 +34,8 @@ struct clock { > > > > #define clk_get_rate(clk) (clk)->rate > > > > -extern void clk_set_list(struct clock *list, unsigned int num); > > -extern void clk_propagate(struct clock *clk, struct clock *parent); > > -extern unsigned int clk_set_rate(struct clock *clk, unsigned int rate); > > +void clk_set_list(struct clock *list, unsigned int num); > > +void clk_propagate(struct clock *clk, struct clock *parent); > > +unsigned int clk_set_rate(struct clock *clk, unsigned int rate); > > > > #endif /* __ASM_GENERIC_CLOCK_H */ > > -- > > 1.5.3.7.1157.gbf82a > > > > > > ------------------------------------------------------------------------- > > Check out the new SourceForge.net Marketplace. > > It's the best place to buy or sell services for > > just about anything Open Source. > > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > > _______________________________________________ > > Tinyx-devel mailing list > > Tin...@li... > > https://lists.sourceforge.net/lists/listinfo/tinyx-devel > > > > > > -- > David Cohen > Instituto Nokia de Tecnologia - INdT > Manaus - Brazil > -- David Cohen Instituto Nokia de Tecnologia - INdT Manaus - Brazil |
From: David C. <da...@gm...> - 2008-01-10 03:49:44
|
Hi, I shall add the Clock and Device Driver subsystem to feature schedule, also. I'll do it tomorrow. Br, David Cohen On Jan 9, 2008 2:49 PM, Felipe Balbi <me...@fe...> wrote: > This will help us keeping track of what to do. > Whenever we finish a "milestone" we should provide > a patch removing that feature from this new file. > > Signed-off-by: Felipe Balbi <me...@fe...> > --- > docs/feature-schedule.txt | 19 +++++++++++++++++++ > 1 files changed, 19 insertions(+), 0 deletions(-) > create mode 100644 docs/feature-schedule.txt > > diff --git a/docs/feature-schedule.txt b/docs/feature-schedule.txt > new file mode 100644 > index 0000000..7f13885 > --- /dev/null > +++ b/docs/feature-schedule.txt > @@ -0,0 +1,19 @@ > +The following is to help us keeping track of what to do > +and which features to implement. > + > +------------------------------------------------------------------------------- > + > +What: LIBC implementation > +When: January 31st > +Why: We will need it during the project > +Who: Felipe Balbi > + > +------------------------------------------------------------------------------- > + > +What: Serial API > +When: January 31st > +Why: Needed primarily on debugging purposes > +Who: David Cohen > + > +------------------------------------------------------------------------------- > + > -- > 1.5.4.rc1.21.g0e545-dirty > > > ------------------------------------------------------------------------- > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > _______________________________________________ > Tinyx-devel mailing list > Tin...@li... > https://lists.sourceforge.net/lists/listinfo/tinyx-devel > -- David Cohen Instituto Nokia de Tecnologia - INdT Manaus - Brazil |
From: David C. <da...@gm...> - 2008-01-10 01:28:07
|
I'll push it too. Br, David On Jan 9, 2008 2:49 PM, Felipe Balbi <me...@fe...> wrote: > This will help us keeping track of what to do. > Whenever we finish a "milestone" we should provide > a patch removing that feature from this new file. > > Signed-off-by: Felipe Balbi <me...@fe...> > --- > docs/feature-schedule.txt | 19 +++++++++++++++++++ > 1 files changed, 19 insertions(+), 0 deletions(-) > create mode 100644 docs/feature-schedule.txt > > diff --git a/docs/feature-schedule.txt b/docs/feature-schedule.txt > new file mode 100644 > index 0000000..7f13885 > --- /dev/null > +++ b/docs/feature-schedule.txt > @@ -0,0 +1,19 @@ > +The following is to help us keeping track of what to do > +and which features to implement. > + > +------------------------------------------------------------------------------- > + > +What: LIBC implementation > +When: January 31st > +Why: We will need it during the project > +Who: Felipe Balbi > + > +------------------------------------------------------------------------------- > + > +What: Serial API > +When: January 31st > +Why: Needed primarily on debugging purposes > +Who: David Cohen > + > +------------------------------------------------------------------------------- > + > -- > 1.5.4.rc1.21.g0e545-dirty > > > ------------------------------------------------------------------------- > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > _______________________________________________ > Tinyx-devel mailing list > Tin...@li... > https://lists.sourceforge.net/lists/listinfo/tinyx-devel > -- David Cohen Instituto Nokia de Tecnologia - INdT Manaus - Brazil |
From: David C. <da...@gm...> - 2008-01-10 01:27:10
|
I'll push it today. Br, David On Jan 9, 2008 2:46 PM, Felipe Balbi <me...@fe...> wrote: > For now, we have to forcefully #define DEBUG > in strerror.c for this function to be compiled, > later on we should be able to make config and > choose if this will or won't be built. > > Signed-off-by: Felipe Balbi <me...@fe...> > --- > include/libc/string.h | 1 + > lib/libc/Makefile | 1 + > lib/libc/strerror.c | 170 +++++++++++++++++++++++++++++++++++++++++++++++++ > 3 files changed, 172 insertions(+), 0 deletions(-) > create mode 100644 lib/libc/strerror.c > > diff --git a/include/libc/string.h b/include/libc/string.h > index 8a53d41..ce7c7db 100644 > --- a/include/libc/string.h > +++ b/include/libc/string.h > @@ -29,6 +29,7 @@ char *strchr(const char *str, int ch); > int strcoll(const char *str1, const char *str2); > int strcmp(const char *str1, const char *str2); > char *strcpy(char *str1, const char *str2); > +char *strerror(int errnum); > size_t strlen(const char *str); > char *strncat(char *str1, const char *str2, size_t count); > int strncmp(const char *str1, const char *str2, size_t count); > diff --git a/lib/libc/Makefile b/lib/libc/Makefile > index f6fde72..f694056 100644 > --- a/lib/libc/Makefile > +++ b/lib/libc/Makefile > @@ -1 +1,2 @@ > obj-y += string.o > +obj-y += strerror.o > diff --git a/lib/libc/strerror.c b/lib/libc/strerror.c > new file mode 100644 > index 0000000..31f3301 > --- /dev/null > +++ b/lib/libc/strerror.c > @@ -0,0 +1,170 @@ > +/* lib/libc/strerror.c > + * > + * Copyright (C) 2007 David Cohen <da...@gm...> > + * Copyright (C) 2007 Felipe Balbi <me...@fe...> > + * > + * This file is part of Tinyx Nanokernel Project. > + * > + * Tinyx is free software: you can redistribute it and/or modify > + * it under the terms of the GNU General Public License as published by > + * the Free Software Foundation, either version 3 of the License, or > + * (at your option) any later version. > + * > + * Tinyx is distributed in the hope that it will be useful, > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + * GNU General Public License for more details. > + * > + * You should have received a copy of the GNU General Public License > + * along with Tinyx. If not, see <http://www.gnu.org/licenses/>. > + */ > + > +#include <libc/string.h> > +#include <tinyx/errno.h> > + > +#ifdef DEBUG > +/** > + * sterror - Gets errnum message and returns error message > + * @errnum: Error number > + */ > +char *strerror(int errnum) > +{ > + switch (errnum) { > + case -EPERM: return "Operation not permitted\n"; > + case -ENOENT: return "No such file or directory\n"; > + case -ESRCH: return "No such process\n"; > + case -EINTR: return "Interrupted system call\n"; > + case -EIO: return "I/O error\n"; > + case -ENXIO: return "No such device or address\n"; > + case -E2BIG: return "Argument list too long\n"; > + case -ENOEXEC: return "Exec format error\n"; > + case -EBADF: return "Bad file number\n"; > + case -ECHILD: return "No child processes\n"; > + case -EAGAIN: return "Try again\n"; > + case -ENOMEM: return "Out of memory\n"; > + case -EACCES: return "Permission denied\n"; > + case -EFAULT: return "Bad address\n"; > + case -ENOTBLK: return "Block device required\n"; > + case -EBUSY: return "Device or resource busy\n"; > + case -EEXIST: return "File exists\n"; > + case -EXDEV: return "Cross-device link\n"; > + case -ENODEV: return "No such device\n"; > + case -ENOTDIR: return "Not a directory\n"; > + case -EISDIR: return "Is a directory\n"; > + case -EINVAL: return "Invalid argument\n"; > + case -ENFILE: return "File table overflow\n"; > + case -EMFILE: return "Too many open files\n"; > + case -ENOTTY: return "Not a typewriter\n"; > + case -ETXTBSY: return "Text file busy\n"; > + case -EFBIG: return "File too large\n"; > + case -ENOSPC: return "No space left on device\n"; > + case -ESPIPE: return "Illegal seek\n"; > + case -EROFS: return "Read-only file system\n"; > + case -EMLINK: return "Too many links\n"; > + case -EPIPE: return "Broken pipe\n"; > + case -EDOM: return "Math argument out of domain of func\n"; > + case -ERANGE: return "Math result not representable\n"; > + case -EDEADLK: return "Resource deadlock would occur\n"; > + case -ENAMETOOLONG: return "File name too long\n"; > + case -ENOLCK: return "No record locks available\n"; > + case -ENOSYS: return "Function not implemented\n"; > + case -ENOTEMPTY: return "Directory not empty\n"; > + case -ELOOP: return "Too many symbolic links encountered\n"; > + case -EWOULDBLOCK: return "Operation would block\n"; > + case -ENOMSG: return "No message of desired type\n"; > + case -EIDRM: return "Identifier removed\n"; > + case -ECHRNG: return "Channel number out of range\n"; > + case -EL2NSYNC: return "Level 2 not synchronized\n"; > + case -EL3HLT: return "Level 3 halted\n"; > + case -EL3RST: return "Level 3 reset\n"; > + case -ELNRNG: return "Link number out of range\n"; > + case -EUNATCH: return "Protocol driver not attached\n"; > + case -ENOCSI: return "No CSI structure available\n"; > + case -EL2HLT: return "Level 2 halted\n"; > + case -EBADE: return "Invalid exchange\n"; > + case -EBADR: return "Invalid request descriptor\n"; > + case -EXFULL: return "Exchange full\n"; > + case -ENOANO: return "No anode\n"; > + case -EBADRQC: return "Invalid request code\n"; > + case -EBADSLT: return "Invalid slot\n"; > + case -EDEADLOCK: return "Bad font file format\n"; > + case -EBFONT: return "Bad font file format\n"; > + case -ENOSTR: return "Device not a stream\n"; > + case -ENODATA: return "No data available\n"; > + case -ETIME: return "Timer expired\n"; > + case -ENOSR: return "Out of streams resources\n"; > + case -ENONET: return "Machine is not on the network\n"; > + case -ENOPKG: return "Package not installed\n"; > + case -EREMOTE: return "Object is remote\n"; > + case -ENOLINK: return "Link has been severed\n"; > + case -EADV: return "Advertise error\n"; > + case -ESRMNT: return "Srmount error\n"; > + case -ECOMM: return "Communication error on send\n"; > + case -EPROTO: return "Protocol error\n"; > + case -EMULTIHOP: return "Multihop attempted\n"; > + case -EDOTDOT: return "RFS specific error\n"; > + case -EBADMSG: return "Not a data message\n"; > + case -EOVERFLOW: return "Value too large for defined data type\n"; > + case -ENOTUNIQ: return "Name not unique on network\n"; > + case -EBADFD: return "File descriptor in bad state\n"; > + case -EREMCHG: return "Remote address changed\n"; > + case -ELIBACC: return "Can not access a needed shared library\n"; > + case -ELIBBAD: return "Accessing a corrupted shared library\n"; > + case -ELIBSCN: return ".lib section in a.out corrupted\n"; > + case -ELIBMAX: return "Attempting to link in too many shared libraries\n"; > + case -ELIBEXEC: return "Cannot exec a shared library directly\n"; > + case -EILSEQ: return "Illegal byte sequence\n"; > + case -ERESTART: return "Interrupted system call should be restarted\n"; > + case -ESTRPIPE: return "Streams pipe error\n"; > + case -EUSERS: return "Too many users\n"; > + case -ENOTSOCK: return "Socket operation on non-socket\n"; > + case -EDESTADDRREQ: return "Destination address required\n"; > + case -EMSGSIZE: return "Message too long\n"; > + case -EPROTOTYPE: return "Protocol wrong type for socket\n"; > + case -ENOPROTOOPT: return "Protocol not available\n"; > + case -EPROTONOSUPPORT: return "Protocol not supported\n"; > + case -ESOCKTNOSUPPORT: return "Socket type not supported\n"; > + case -EOPNOTSUPP: return "Operation not supported on transport endpoint\n"; > + case -EPFNOSUPPORT: return "Protocol family not supported\n"; > + case -EAFNOSUPPORT: return "Address family not supported by protocol\n"; > + case -EADDRINUSE: return "Address already in use\n"; > + case -EADDRNOTAVAIL: return "Cannot assign requested address\n"; > + case -ENETDOWN: return "Network is down\n"; > + case -ENETUNREACH: return "Network is unreachable\n"; > + case -ENETRESET: return "Network dropped connection because of reset\n"; > + case -ECONNABORTED: return "Software caused connection abort\n"; > + case -ECONNRESET: return "Connection reset by peer\n"; > + case -ENOBUFS: return "No buffer space available\n"; > + case -EISCONN: return "Transport endpoint is already connected\n"; > + case -ENOTCONN: return "Transport endpoint is not connected\n"; > + case -ESHUTDOWN: return "Cannot send after transport endpoint shutdown\n"; > + case -ETOOMANYREFS: return "Too many references: cannot splice\n"; > + case -ETIMEDOUT: return "Connection timed out\n"; > + case -ECONNREFUSED: return "Connection refused\n"; > + case -EHOSTDOWN: return "Host is down\n"; > + case -EHOSTUNREACH: return "No route to host\n"; > + case -EALREADY: return "Operation already in progress\n"; > + case -EINPROGRESS: return "Operation now in progress\n"; > + case -ESTALE: return "Stale NFS file handle\n"; > + case -EUCLEAN: return "Structure needs cleaning\n"; > + case -ENOTNAM: return "Not a XENIX named type file\n"; > + case -ENAVAIL: return "No XENIX semaphores available\n"; > + case -EISNAM: return "Is a named type file\n"; > + case -EREMOTEIO: return "Remote I/O error\n"; > + case -EDQUOT: return "Quota exceeded\n"; > + case -ENOMEDIUM: return "No medium found\n"; > + case -EMEDIUMTYPE: return "Wrong medium type\n"; > + case -ECANCELED: return "Operation Canceled\n"; > + case -ENOKEY: return "Required key not available\n"; > + case -EKEYEXPIRED: return "Key has expired\n"; > + case -EKEYREVOKED: return "Key has been revoked\n"; > + case -EKEYREJECTED: return "Key was rejected by service\n"; > + case -EOWNERDEAD: return "Owner died\n"; > + case -ENOTRECOVERABLE: return "State not recoverable\n"; > + > + default: return "Unkown error\n"; > + } > +} > +#else > +inline char *strerror(int errnum) { return 0; } > +#endif > -- > 1.5.4.rc1.21.g0e545-dirty > > > ------------------------------------------------------------------------- > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > _______________________________________________ > Tinyx-devel mailing list > Tin...@li... > https://lists.sourceforge.net/lists/listinfo/tinyx-devel > -- David Cohen Instituto Nokia de Tecnologia - INdT Manaus - Brazil |
From: David C. <da...@gm...> - 2008-01-10 01:25:59
|
On Jan 9, 2008 11:40 AM, Felipe Balbi <me...@fe...> wrote: > string.c is mostly complete now, we shall need strerror though > during debugging but this can be done in a separate file. > > Signed-off-by: Felipe Balbi <me...@fe...> Acked. Br, David > --- > include/libc/string.h | 2 ++ > lib/libc/string.c | 31 +++++++++++++++++++++++++++++++ > 2 files changed, 33 insertions(+), 0 deletions(-) > > diff --git a/include/libc/string.h b/include/libc/string.h > index 9106e7a..8a53d41 100644 > --- a/include/libc/string.h > +++ b/include/libc/string.h > @@ -22,6 +22,8 @@ > #ifndef __TINYX_LIBC_STRING_H > #define __TINYX_LIBC_STRING_H > > +void *memset(void *mem, int data, size_t count) > +void *memcpy(void *dest, const void *src, size_t count) > char *strcat(char *str1, const char *str2); > char *strchr(const char *str, int ch); > int strcoll(const char *str1, const char *str2); > diff --git a/lib/libc/string.c b/lib/libc/string.c > index f54a876..0b9be1c 100644 > --- a/lib/libc/string.c > +++ b/lib/libc/string.c > @@ -22,6 +22,37 @@ > #include <libc/string.h> > > /** > + * memset - Fill a memory region with data > + * @mem: Pointer to the start of the area. > + * @data: The byte to fill the area with > + * @count: The size of the area. > + */ > +void *memset(void *mem, int data, size_t count) > +{ > + char *tmp = mem; > + > + while (count--) > + *tmp++ = data; > + return mem; > +} > + > +/** > + * memcpy - Copy memory areas > + * @dest: Destination of copy task > + * @src: Where the data to copy from is > + * @count: The size of the area. > + */ > +void *memcpy(void *dest, const void *src, size_t count) > +{ > + char *tmp = dest; > + const char *s = src; > + > + while (count--) > + *tmp++ = *s++; > + return dest; > +} > + > +/** > * strcat - Apend one string to another > * @str1: The destination string > * @str2: The source string > -- > 1.5.4.rc1.21.g0e545-dirty > > > ------------------------------------------------------------------------- > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > _______________________________________________ > Tinyx-devel mailing list > Tin...@li... > https://lists.sourceforge.net/lists/listinfo/tinyx-devel > -- David Cohen Instituto Nokia de Tecnologia - INdT Manaus - Brazil |
From: Felipe B. <me...@fe...> - 2008-01-09 18:47:54
|
This will help us keeping track of what to do. Whenever we finish a "milestone" we should provide a patch removing that feature from this new file. Signed-off-by: Felipe Balbi <me...@fe...> --- docs/feature-schedule.txt | 19 +++++++++++++++++++ 1 files changed, 19 insertions(+), 0 deletions(-) create mode 100644 docs/feature-schedule.txt diff --git a/docs/feature-schedule.txt b/docs/feature-schedule.txt new file mode 100644 index 0000000..7f13885 --- /dev/null +++ b/docs/feature-schedule.txt @@ -0,0 +1,19 @@ +The following is to help us keeping track of what to do +and which features to implement. + +------------------------------------------------------------------------------- + +What: LIBC implementation +When: January 31st +Why: We will need it during the project +Who: Felipe Balbi + +------------------------------------------------------------------------------- + +What: Serial API +When: January 31st +Why: Needed primarily on debugging purposes +Who: David Cohen + +------------------------------------------------------------------------------- + -- 1.5.4.rc1.21.g0e545-dirty |
From: Felipe B. <me...@fe...> - 2008-01-09 18:44:24
|
For now, we have to forcefully #define DEBUG in strerror.c for this function to be compiled, later on we should be able to make config and choose if this will or won't be built. Signed-off-by: Felipe Balbi <me...@fe...> --- include/libc/string.h | 1 + lib/libc/Makefile | 1 + lib/libc/strerror.c | 170 +++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 172 insertions(+), 0 deletions(-) create mode 100644 lib/libc/strerror.c diff --git a/include/libc/string.h b/include/libc/string.h index 8a53d41..ce7c7db 100644 --- a/include/libc/string.h +++ b/include/libc/string.h @@ -29,6 +29,7 @@ char *strchr(const char *str, int ch); int strcoll(const char *str1, const char *str2); int strcmp(const char *str1, const char *str2); char *strcpy(char *str1, const char *str2); +char *strerror(int errnum); size_t strlen(const char *str); char *strncat(char *str1, const char *str2, size_t count); int strncmp(const char *str1, const char *str2, size_t count); diff --git a/lib/libc/Makefile b/lib/libc/Makefile index f6fde72..f694056 100644 --- a/lib/libc/Makefile +++ b/lib/libc/Makefile @@ -1 +1,2 @@ obj-y += string.o +obj-y += strerror.o diff --git a/lib/libc/strerror.c b/lib/libc/strerror.c new file mode 100644 index 0000000..31f3301 --- /dev/null +++ b/lib/libc/strerror.c @@ -0,0 +1,170 @@ +/* lib/libc/strerror.c + * + * Copyright (C) 2007 David Cohen <da...@gm...> + * Copyright (C) 2007 Felipe Balbi <me...@fe...> + * + * This file is part of Tinyx Nanokernel Project. + * + * Tinyx is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Tinyx is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Tinyx. If not, see <http://www.gnu.org/licenses/>. + */ + +#include <libc/string.h> +#include <tinyx/errno.h> + +#ifdef DEBUG +/** + * sterror - Gets errnum message and returns error message + * @errnum: Error number + */ +char *strerror(int errnum) +{ + switch (errnum) { + case -EPERM: return "Operation not permitted\n"; + case -ENOENT: return "No such file or directory\n"; + case -ESRCH: return "No such process\n"; + case -EINTR: return "Interrupted system call\n"; + case -EIO: return "I/O error\n"; + case -ENXIO: return "No such device or address\n"; + case -E2BIG: return "Argument list too long\n"; + case -ENOEXEC: return "Exec format error\n"; + case -EBADF: return "Bad file number\n"; + case -ECHILD: return "No child processes\n"; + case -EAGAIN: return "Try again\n"; + case -ENOMEM: return "Out of memory\n"; + case -EACCES: return "Permission denied\n"; + case -EFAULT: return "Bad address\n"; + case -ENOTBLK: return "Block device required\n"; + case -EBUSY: return "Device or resource busy\n"; + case -EEXIST: return "File exists\n"; + case -EXDEV: return "Cross-device link\n"; + case -ENODEV: return "No such device\n"; + case -ENOTDIR: return "Not a directory\n"; + case -EISDIR: return "Is a directory\n"; + case -EINVAL: return "Invalid argument\n"; + case -ENFILE: return "File table overflow\n"; + case -EMFILE: return "Too many open files\n"; + case -ENOTTY: return "Not a typewriter\n"; + case -ETXTBSY: return "Text file busy\n"; + case -EFBIG: return "File too large\n"; + case -ENOSPC: return "No space left on device\n"; + case -ESPIPE: return "Illegal seek\n"; + case -EROFS: return "Read-only file system\n"; + case -EMLINK: return "Too many links\n"; + case -EPIPE: return "Broken pipe\n"; + case -EDOM: return "Math argument out of domain of func\n"; + case -ERANGE: return "Math result not representable\n"; + case -EDEADLK: return "Resource deadlock would occur\n"; + case -ENAMETOOLONG: return "File name too long\n"; + case -ENOLCK: return "No record locks available\n"; + case -ENOSYS: return "Function not implemented\n"; + case -ENOTEMPTY: return "Directory not empty\n"; + case -ELOOP: return "Too many symbolic links encountered\n"; + case -EWOULDBLOCK: return "Operation would block\n"; + case -ENOMSG: return "No message of desired type\n"; + case -EIDRM: return "Identifier removed\n"; + case -ECHRNG: return "Channel number out of range\n"; + case -EL2NSYNC: return "Level 2 not synchronized\n"; + case -EL3HLT: return "Level 3 halted\n"; + case -EL3RST: return "Level 3 reset\n"; + case -ELNRNG: return "Link number out of range\n"; + case -EUNATCH: return "Protocol driver not attached\n"; + case -ENOCSI: return "No CSI structure available\n"; + case -EL2HLT: return "Level 2 halted\n"; + case -EBADE: return "Invalid exchange\n"; + case -EBADR: return "Invalid request descriptor\n"; + case -EXFULL: return "Exchange full\n"; + case -ENOANO: return "No anode\n"; + case -EBADRQC: return "Invalid request code\n"; + case -EBADSLT: return "Invalid slot\n"; + case -EDEADLOCK: return "Bad font file format\n"; + case -EBFONT: return "Bad font file format\n"; + case -ENOSTR: return "Device not a stream\n"; + case -ENODATA: return "No data available\n"; + case -ETIME: return "Timer expired\n"; + case -ENOSR: return "Out of streams resources\n"; + case -ENONET: return "Machine is not on the network\n"; + case -ENOPKG: return "Package not installed\n"; + case -EREMOTE: return "Object is remote\n"; + case -ENOLINK: return "Link has been severed\n"; + case -EADV: return "Advertise error\n"; + case -ESRMNT: return "Srmount error\n"; + case -ECOMM: return "Communication error on send\n"; + case -EPROTO: return "Protocol error\n"; + case -EMULTIHOP: return "Multihop attempted\n"; + case -EDOTDOT: return "RFS specific error\n"; + case -EBADMSG: return "Not a data message\n"; + case -EOVERFLOW: return "Value too large for defined data type\n"; + case -ENOTUNIQ: return "Name not unique on network\n"; + case -EBADFD: return "File descriptor in bad state\n"; + case -EREMCHG: return "Remote address changed\n"; + case -ELIBACC: return "Can not access a needed shared library\n"; + case -ELIBBAD: return "Accessing a corrupted shared library\n"; + case -ELIBSCN: return ".lib section in a.out corrupted\n"; + case -ELIBMAX: return "Attempting to link in too many shared libraries\n"; + case -ELIBEXEC: return "Cannot exec a shared library directly\n"; + case -EILSEQ: return "Illegal byte sequence\n"; + case -ERESTART: return "Interrupted system call should be restarted\n"; + case -ESTRPIPE: return "Streams pipe error\n"; + case -EUSERS: return "Too many users\n"; + case -ENOTSOCK: return "Socket operation on non-socket\n"; + case -EDESTADDRREQ: return "Destination address required\n"; + case -EMSGSIZE: return "Message too long\n"; + case -EPROTOTYPE: return "Protocol wrong type for socket\n"; + case -ENOPROTOOPT: return "Protocol not available\n"; + case -EPROTONOSUPPORT: return "Protocol not supported\n"; + case -ESOCKTNOSUPPORT: return "Socket type not supported\n"; + case -EOPNOTSUPP: return "Operation not supported on transport endpoint\n"; + case -EPFNOSUPPORT: return "Protocol family not supported\n"; + case -EAFNOSUPPORT: return "Address family not supported by protocol\n"; + case -EADDRINUSE: return "Address already in use\n"; + case -EADDRNOTAVAIL: return "Cannot assign requested address\n"; + case -ENETDOWN: return "Network is down\n"; + case -ENETUNREACH: return "Network is unreachable\n"; + case -ENETRESET: return "Network dropped connection because of reset\n"; + case -ECONNABORTED: return "Software caused connection abort\n"; + case -ECONNRESET: return "Connection reset by peer\n"; + case -ENOBUFS: return "No buffer space available\n"; + case -EISCONN: return "Transport endpoint is already connected\n"; + case -ENOTCONN: return "Transport endpoint is not connected\n"; + case -ESHUTDOWN: return "Cannot send after transport endpoint shutdown\n"; + case -ETOOMANYREFS: return "Too many references: cannot splice\n"; + case -ETIMEDOUT: return "Connection timed out\n"; + case -ECONNREFUSED: return "Connection refused\n"; + case -EHOSTDOWN: return "Host is down\n"; + case -EHOSTUNREACH: return "No route to host\n"; + case -EALREADY: return "Operation already in progress\n"; + case -EINPROGRESS: return "Operation now in progress\n"; + case -ESTALE: return "Stale NFS file handle\n"; + case -EUCLEAN: return "Structure needs cleaning\n"; + case -ENOTNAM: return "Not a XENIX named type file\n"; + case -ENAVAIL: return "No XENIX semaphores available\n"; + case -EISNAM: return "Is a named type file\n"; + case -EREMOTEIO: return "Remote I/O error\n"; + case -EDQUOT: return "Quota exceeded\n"; + case -ENOMEDIUM: return "No medium found\n"; + case -EMEDIUMTYPE: return "Wrong medium type\n"; + case -ECANCELED: return "Operation Canceled\n"; + case -ENOKEY: return "Required key not available\n"; + case -EKEYEXPIRED: return "Key has expired\n"; + case -EKEYREVOKED: return "Key has been revoked\n"; + case -EKEYREJECTED: return "Key was rejected by service\n"; + case -EOWNERDEAD: return "Owner died\n"; + case -ENOTRECOVERABLE: return "State not recoverable\n"; + + default: return "Unkown error\n"; + } +} +#else +inline char *strerror(int errnum) { return 0; } +#endif -- 1.5.4.rc1.21.g0e545-dirty |
From: Felipe B. <me...@fe...> - 2008-01-09 15:38:39
|
string.c is mostly complete now, we shall need strerror though during debugging but this can be done in a separate file. Signed-off-by: Felipe Balbi <me...@fe...> --- include/libc/string.h | 2 ++ lib/libc/string.c | 31 +++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 0 deletions(-) diff --git a/include/libc/string.h b/include/libc/string.h index 9106e7a..8a53d41 100644 --- a/include/libc/string.h +++ b/include/libc/string.h @@ -22,6 +22,8 @@ #ifndef __TINYX_LIBC_STRING_H #define __TINYX_LIBC_STRING_H +void *memset(void *mem, int data, size_t count) +void *memcpy(void *dest, const void *src, size_t count) char *strcat(char *str1, const char *str2); char *strchr(const char *str, int ch); int strcoll(const char *str1, const char *str2); diff --git a/lib/libc/string.c b/lib/libc/string.c index f54a876..0b9be1c 100644 --- a/lib/libc/string.c +++ b/lib/libc/string.c @@ -22,6 +22,37 @@ #include <libc/string.h> /** + * memset - Fill a memory region with data + * @mem: Pointer to the start of the area. + * @data: The byte to fill the area with + * @count: The size of the area. + */ +void *memset(void *mem, int data, size_t count) +{ + char *tmp = mem; + + while (count--) + *tmp++ = data; + return mem; +} + +/** + * memcpy - Copy memory areas + * @dest: Destination of copy task + * @src: Where the data to copy from is + * @count: The size of the area. + */ +void *memcpy(void *dest, const void *src, size_t count) +{ + char *tmp = dest; + const char *s = src; + + while (count--) + *tmp++ = *s++; + return dest; +} + +/** * strcat - Apend one string to another * @str1: The destination string * @str2: The source string -- 1.5.4.rc1.21.g0e545-dirty |
From: Felipe B. <me...@fe...> - 2008-01-08 22:54:25
|
On Tue, Jan 08, 2008 at 04:40:23PM -0400, David Cohen wrote: > Hi, > > On Jan 8, 2008 1:47 PM, Felipe Balbi <me...@fe...> wrote: > > On Tue, Jan 08, 2008 at 01:23:48PM -0400, David Cohen wrote: > > > I agree with this change. But "include/libc" should be added to the > > > default include PATH. So, we can include <string.h>, instead of > > > <libc/string.h>. > > > > Good catch. Can you do it, or should I send a patch ?? > > > > > > btw, I was thinking on trying to use kbuild as our build system. It's a > > debian package and we can embed it on tinyx and use it to, for example, > > make config tinyx. This way we would be able, for example, to choose > > which parts of libc we want to build this "version" of tinyx with. > > Remember tinyx will be used on arm7 and another really "resource-less" > > systems and printf (for instance) would be useful only on debugging > > builds, also, depending on the use of tinyx, we won't need strcoll, > > strcmp, strcpy, etc. > > > > What do you think ?? > > I agree. But it's better to not make dependences from tinyx to any > system's lib. We can put kbuild on Tinyx just basing on kbuild from > Debian, but not using the Debina's lib. gotcha... that's what I was thinking of. > > Regards, > > David > > > > > > > > > > > Br, > > > > > > David > > > > > > On Jan 8, 2008 12:52 PM, Felipe Balbi <me...@fe...> wrote: > > > > Cosmetic. No functional changes. > > > > > > > > Signed-off-by: Felipe Balbi <me...@fe...> > > > > --- > > > > include/libc/string.h | 27 +++++++++++++++++++++++++++ > > > > include/tinyx/libc/string.h | 27 --------------------------- > > > > lib/libc/string.c | 2 +- > > > > 3 files changed, 28 insertions(+), 28 deletions(-) > > > > create mode 100644 include/libc/string.h > > > > delete mode 100644 include/tinyx/libc/string.h > > > > > > > > diff --git a/include/libc/string.h b/include/libc/string.h > > > > new file mode 100644 > > > > index 0000000..8815a86 > > > > --- /dev/null > > > > +++ b/include/libc/string.h > > > > @@ -0,0 +1,27 @@ > > > > +/* include/libc/string.h > > > > + * > > > > + * Copyright (C) 2007 David Cohen <da...@gm...> > > > > + * Copyright (C) 2007 Felipe Balbi <me...@fe...> > > > > + * > > > > + * This file is part of Tinyx Nanokernel Project. > > > > + * > > > > + * Tinyx is free software: you can redistribute it and/or modify > > > > + * it under the terms of the GNU General Public License as published by > > > > + * the Free Software Foundation, either version 3 of the License, or > > > > + * (at your option) any later version. > > > > + * > > > > + * Tinyx is distributed in the hope that it will be useful, > > > > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > > > > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > > > > + * GNU General Public License for more details. > > > > + * > > > > + * You should have received a copy of the GNU General Public License > > > > + * along with Tinyx. If not, see <http://www.gnu.org/licenses/>. > > > > + */ > > > > + > > > > +#ifndef __TINYX_LIBC_STRING_H > > > > +#define __TINYX_LIBC_STRING_H > > > > + > > > > +int strcmp(const char *str1, const char *str2); > > > > + > > > > +#endif /* __TINYX_LIBC_STRING_H */ > > > > diff --git a/include/tinyx/libc/string.h b/include/tinyx/libc/string.h > > > > deleted file mode 100644 > > > > index 4ff2b08..0000000 > > > > --- a/include/tinyx/libc/string.h > > > > +++ /dev/null > > > > @@ -1,27 +0,0 @@ > > > > -/* include/tinyx/libc/string.h > > > > - * > > > > - * Copyright (C) 2007 David Cohen <da...@gm...> > > > > - * Copyright (C) 2007 Felipe Balbi <me...@fe...> > > > > - * > > > > - * This file is part of Tinyx Nanokernel Project. > > > > - * > > > > - * Tinyx is free software: you can redistribute it and/or modify > > > > - * it under the terms of the GNU General Public License as published by > > > > - * the Free Software Foundation, either version 3 of the License, or > > > > - * (at your option) any later version. > > > > - * > > > > - * Tinyx is distributed in the hope that it will be useful, > > > > - * but WITHOUT ANY WARRANTY; without even the implied warranty of > > > > - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > > > > - * GNU General Public License for more details. > > > > - * > > > > - * You should have received a copy of the GNU General Public License > > > > - * along with Tinyx. If not, see <http://www.gnu.org/licenses/>. > > > > - */ > > > > - > > > > -#ifndef __TINYX_LIBC_STRING_H > > > > -#define __TINYX_LIBC_STRING_H > > > > - > > > > -int strcmp(const char *str1, const char *str2); > > > > - > > > > -#endif /* __TINYX_LIBC_STRING_H */ > > > > diff --git a/lib/libc/string.c b/lib/libc/string.c > > > > index 11c651b..d2e41a0 100644 > > > > --- a/lib/libc/string.c > > > > +++ b/lib/libc/string.c > > > > @@ -19,7 +19,7 @@ > > > > * along with Tinyx. If not, see <http://www.gnu.org/licenses/>. > > > > */ > > > > > > > > -#include <tinyx/libc/string.h> > > > > +#include <libc/string.h> > > > > > > > > int strcmp(const char *str1, const char *str2) > > > > { > > > > -- > > > > 1.5.4.rc1.21.g0e545-dirty > > > > > > > > > > > > ------------------------------------------------------------------------- > > > > Check out the new SourceForge.net Marketplace. > > > > It's the best place to buy or sell services for > > > > just about anything Open Source. > > > > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > > > > _______________________________________________ > > > > Tinyx-devel mailing list > > > > Tin...@li... > > > > https://lists.sourceforge.net/lists/listinfo/tinyx-devel > > > > > > > > > > > > > > > > -- > > > David Cohen > > > Instituto Nokia de Tecnologia - INdT > > > Manaus - Brazil > > > > -- > > Best Regards, > > > > Felipe Balbi > > me...@fe... > > http://blog.felipebalbi.com > > > > > > -- > David Cohen > Instituto Nokia de Tecnologia - INdT > Manaus - Brazil -- Best Regards, Felipe Balbi me...@fe... http://blog.felipebalbi.com |
From: David C. <da...@gm...> - 2008-01-08 20:40:21
|
Hi, On Jan 8, 2008 1:47 PM, Felipe Balbi <me...@fe...> wrote: > On Tue, Jan 08, 2008 at 01:23:48PM -0400, David Cohen wrote: > > I agree with this change. But "include/libc" should be added to the > > default include PATH. So, we can include <string.h>, instead of > > <libc/string.h>. > > Good catch. Can you do it, or should I send a patch ?? > > > btw, I was thinking on trying to use kbuild as our build system. It's a > debian package and we can embed it on tinyx and use it to, for example, > make config tinyx. This way we would be able, for example, to choose > which parts of libc we want to build this "version" of tinyx with. > Remember tinyx will be used on arm7 and another really "resource-less" > systems and printf (for instance) would be useful only on debugging > builds, also, depending on the use of tinyx, we won't need strcoll, > strcmp, strcpy, etc. > > What do you think ?? I agree. But it's better to not make dependences from tinyx to any system's lib. We can put kbuild on Tinyx just basing on kbuild from Debian, but not using the Debina's lib. Regards, David > > > > > > Br, > > > > David > > > > On Jan 8, 2008 12:52 PM, Felipe Balbi <me...@fe...> wrote: > > > Cosmetic. No functional changes. > > > > > > Signed-off-by: Felipe Balbi <me...@fe...> > > > --- > > > include/libc/string.h | 27 +++++++++++++++++++++++++++ > > > include/tinyx/libc/string.h | 27 --------------------------- > > > lib/libc/string.c | 2 +- > > > 3 files changed, 28 insertions(+), 28 deletions(-) > > > create mode 100644 include/libc/string.h > > > delete mode 100644 include/tinyx/libc/string.h > > > > > > diff --git a/include/libc/string.h b/include/libc/string.h > > > new file mode 100644 > > > index 0000000..8815a86 > > > --- /dev/null > > > +++ b/include/libc/string.h > > > @@ -0,0 +1,27 @@ > > > +/* include/libc/string.h > > > + * > > > + * Copyright (C) 2007 David Cohen <da...@gm...> > > > + * Copyright (C) 2007 Felipe Balbi <me...@fe...> > > > + * > > > + * This file is part of Tinyx Nanokernel Project. > > > + * > > > + * Tinyx is free software: you can redistribute it and/or modify > > > + * it under the terms of the GNU General Public License as published by > > > + * the Free Software Foundation, either version 3 of the License, or > > > + * (at your option) any later version. > > > + * > > > + * Tinyx is distributed in the hope that it will be useful, > > > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > > > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > > > + * GNU General Public License for more details. > > > + * > > > + * You should have received a copy of the GNU General Public License > > > + * along with Tinyx. If not, see <http://www.gnu.org/licenses/>. > > > + */ > > > + > > > +#ifndef __TINYX_LIBC_STRING_H > > > +#define __TINYX_LIBC_STRING_H > > > + > > > +int strcmp(const char *str1, const char *str2); > > > + > > > +#endif /* __TINYX_LIBC_STRING_H */ > > > diff --git a/include/tinyx/libc/string.h b/include/tinyx/libc/string.h > > > deleted file mode 100644 > > > index 4ff2b08..0000000 > > > --- a/include/tinyx/libc/string.h > > > +++ /dev/null > > > @@ -1,27 +0,0 @@ > > > -/* include/tinyx/libc/string.h > > > - * > > > - * Copyright (C) 2007 David Cohen <da...@gm...> > > > - * Copyright (C) 2007 Felipe Balbi <me...@fe...> > > > - * > > > - * This file is part of Tinyx Nanokernel Project. > > > - * > > > - * Tinyx is free software: you can redistribute it and/or modify > > > - * it under the terms of the GNU General Public License as published by > > > - * the Free Software Foundation, either version 3 of the License, or > > > - * (at your option) any later version. > > > - * > > > - * Tinyx is distributed in the hope that it will be useful, > > > - * but WITHOUT ANY WARRANTY; without even the implied warranty of > > > - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > > > - * GNU General Public License for more details. > > > - * > > > - * You should have received a copy of the GNU General Public License > > > - * along with Tinyx. If not, see <http://www.gnu.org/licenses/>. > > > - */ > > > - > > > -#ifndef __TINYX_LIBC_STRING_H > > > -#define __TINYX_LIBC_STRING_H > > > - > > > -int strcmp(const char *str1, const char *str2); > > > - > > > -#endif /* __TINYX_LIBC_STRING_H */ > > > diff --git a/lib/libc/string.c b/lib/libc/string.c > > > index 11c651b..d2e41a0 100644 > > > --- a/lib/libc/string.c > > > +++ b/lib/libc/string.c > > > @@ -19,7 +19,7 @@ > > > * along with Tinyx. If not, see <http://www.gnu.org/licenses/>. > > > */ > > > > > > -#include <tinyx/libc/string.h> > > > +#include <libc/string.h> > > > > > > int strcmp(const char *str1, const char *str2) > > > { > > > -- > > > 1.5.4.rc1.21.g0e545-dirty > > > > > > > > > ------------------------------------------------------------------------- > > > Check out the new SourceForge.net Marketplace. > > > It's the best place to buy or sell services for > > > just about anything Open Source. > > > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > > > _______________________________________________ > > > Tinyx-devel mailing list > > > Tin...@li... > > > https://lists.sourceforge.net/lists/listinfo/tinyx-devel > > > > > > > > > > > -- > > David Cohen > > Instituto Nokia de Tecnologia - INdT > > Manaus - Brazil > > -- > Best Regards, > > Felipe Balbi > me...@fe... > http://blog.felipebalbi.com > -- David Cohen Instituto Nokia de Tecnologia - INdT Manaus - Brazil |
From: David C. <da...@gm...> - 2008-01-08 20:34:58
|
Hi, On Jan 8, 2008 2:07 PM, Felipe Balbi <me...@fe...> wrote: > Neve use extern here since we're always building > a single binary to flash on a device. There are no > modules at all. > > Signed-off-by: Felipe Balbi <me...@fe...> > --- > arch/arm7/mach-lpc21xx/clock.h | 6 +++--- > include/asm-generic/clock.h | 6 +++--- > 2 files changed, 6 insertions(+), 6 deletions(-) > > diff --git a/arch/arm7/mach-lpc21xx/clock.h b/arch/arm7/mach-lpc21xx/clock.h > index 214fd62..17ab17b 100644 > --- a/arch/arm7/mach-lpc21xx/clock.h > +++ b/arch/arm7/mach-lpc21xx/clock.h > @@ -25,8 +25,8 @@ > #include <asm/arch-lpc2xxx/clock.h> > #include <tinyx/kernel.h> > > -extern unsigned int cclk_set_rate(struct clock *clk, unsigned int rate); > -extern unsigned int pclk_set_rate(struct clock *clk, unsigned int rate); > -extern void pclk_propagate(struct clock *clk, struct clock *parent); > +unsigned int cclk_set_rate(struct clock *clk, unsigned int rate); > +unsigned int pclk_set_rate(struct clock *clk, unsigned int rate); > +void pclk_propagate(struct clock *clk, struct clock *parent); These functions are static also. Br, David > > #endif /* __ARCH_MACH_LPC2XXX_CLOCK_H */ > diff --git a/include/asm-generic/clock.h b/include/asm-generic/clock.h > index 4ac8e7c..28561ea 100644 > --- a/include/asm-generic/clock.h > +++ b/include/asm-generic/clock.h > @@ -34,8 +34,8 @@ struct clock { > > #define clk_get_rate(clk) (clk)->rate > > -extern void clk_set_list(struct clock *list, unsigned int num); > -extern void clk_propagate(struct clock *clk, struct clock *parent); > -extern unsigned int clk_set_rate(struct clock *clk, unsigned int rate); > +void clk_set_list(struct clock *list, unsigned int num); > +void clk_propagate(struct clock *clk, struct clock *parent); > +unsigned int clk_set_rate(struct clock *clk, unsigned int rate); > > #endif /* __ASM_GENERIC_CLOCK_H */ > -- > 1.5.3.7.1157.gbf82a > > > ------------------------------------------------------------------------- > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > _______________________________________________ > Tinyx-devel mailing list > Tin...@li... > https://lists.sourceforge.net/lists/listinfo/tinyx-devel > -- David Cohen Instituto Nokia de Tecnologia - INdT Manaus - Brazil |
From: Felipe B. <me...@fe...> - 2008-01-08 18:05:37
|
Neve use extern here since we're always building a single binary to flash on a device. There are no modules at all. Signed-off-by: Felipe Balbi <me...@fe...> --- arch/arm7/mach-lpc21xx/clock.h | 6 +++--- include/asm-generic/clock.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/arm7/mach-lpc21xx/clock.h b/arch/arm7/mach-lpc21xx/clock.h index 214fd62..17ab17b 100644 --- a/arch/arm7/mach-lpc21xx/clock.h +++ b/arch/arm7/mach-lpc21xx/clock.h @@ -25,8 +25,8 @@ #include <asm/arch-lpc2xxx/clock.h> #include <tinyx/kernel.h> -extern unsigned int cclk_set_rate(struct clock *clk, unsigned int rate); -extern unsigned int pclk_set_rate(struct clock *clk, unsigned int rate); -extern void pclk_propagate(struct clock *clk, struct clock *parent); +unsigned int cclk_set_rate(struct clock *clk, unsigned int rate); +unsigned int pclk_set_rate(struct clock *clk, unsigned int rate); +void pclk_propagate(struct clock *clk, struct clock *parent); #endif /* __ARCH_MACH_LPC2XXX_CLOCK_H */ diff --git a/include/asm-generic/clock.h b/include/asm-generic/clock.h index 4ac8e7c..28561ea 100644 --- a/include/asm-generic/clock.h +++ b/include/asm-generic/clock.h @@ -34,8 +34,8 @@ struct clock { #define clk_get_rate(clk) (clk)->rate -extern void clk_set_list(struct clock *list, unsigned int num); -extern void clk_propagate(struct clock *clk, struct clock *parent); -extern unsigned int clk_set_rate(struct clock *clk, unsigned int rate); +void clk_set_list(struct clock *list, unsigned int num); +void clk_propagate(struct clock *clk, struct clock *parent); +unsigned int clk_set_rate(struct clock *clk, unsigned int rate); #endif /* __ASM_GENERIC_CLOCK_H */ -- 1.5.3.7.1157.gbf82a |
From: Felipe B. <me...@fe...> - 2008-01-08 17:48:14
|
On Tue, Jan 08, 2008 at 01:23:48PM -0400, David Cohen wrote: > I agree with this change. But "include/libc" should be added to the > default include PATH. So, we can include <string.h>, instead of > <libc/string.h>. Good catch. Can you do it, or should I send a patch ?? btw, I was thinking on trying to use kbuild as our build system. It's a debian package and we can embed it on tinyx and use it to, for example, make config tinyx. This way we would be able, for example, to choose which parts of libc we want to build this "version" of tinyx with. Remember tinyx will be used on arm7 and another really "resource-less" systems and printf (for instance) would be useful only on debugging builds, also, depending on the use of tinyx, we won't need strcoll, strcmp, strcpy, etc. What do you think ?? > > Br, > > David > > On Jan 8, 2008 12:52 PM, Felipe Balbi <me...@fe...> wrote: > > Cosmetic. No functional changes. > > > > Signed-off-by: Felipe Balbi <me...@fe...> > > --- > > include/libc/string.h | 27 +++++++++++++++++++++++++++ > > include/tinyx/libc/string.h | 27 --------------------------- > > lib/libc/string.c | 2 +- > > 3 files changed, 28 insertions(+), 28 deletions(-) > > create mode 100644 include/libc/string.h > > delete mode 100644 include/tinyx/libc/string.h > > > > diff --git a/include/libc/string.h b/include/libc/string.h > > new file mode 100644 > > index 0000000..8815a86 > > --- /dev/null > > +++ b/include/libc/string.h > > @@ -0,0 +1,27 @@ > > +/* include/libc/string.h > > + * > > + * Copyright (C) 2007 David Cohen <da...@gm...> > > + * Copyright (C) 2007 Felipe Balbi <me...@fe...> > > + * > > + * This file is part of Tinyx Nanokernel Project. > > + * > > + * Tinyx is free software: you can redistribute it and/or modify > > + * it under the terms of the GNU General Public License as published by > > + * the Free Software Foundation, either version 3 of the License, or > > + * (at your option) any later version. > > + * > > + * Tinyx is distributed in the hope that it will be useful, > > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > > + * GNU General Public License for more details. > > + * > > + * You should have received a copy of the GNU General Public License > > + * along with Tinyx. If not, see <http://www.gnu.org/licenses/>. > > + */ > > + > > +#ifndef __TINYX_LIBC_STRING_H > > +#define __TINYX_LIBC_STRING_H > > + > > +int strcmp(const char *str1, const char *str2); > > + > > +#endif /* __TINYX_LIBC_STRING_H */ > > diff --git a/include/tinyx/libc/string.h b/include/tinyx/libc/string.h > > deleted file mode 100644 > > index 4ff2b08..0000000 > > --- a/include/tinyx/libc/string.h > > +++ /dev/null > > @@ -1,27 +0,0 @@ > > -/* include/tinyx/libc/string.h > > - * > > - * Copyright (C) 2007 David Cohen <da...@gm...> > > - * Copyright (C) 2007 Felipe Balbi <me...@fe...> > > - * > > - * This file is part of Tinyx Nanokernel Project. > > - * > > - * Tinyx is free software: you can redistribute it and/or modify > > - * it under the terms of the GNU General Public License as published by > > - * the Free Software Foundation, either version 3 of the License, or > > - * (at your option) any later version. > > - * > > - * Tinyx is distributed in the hope that it will be useful, > > - * but WITHOUT ANY WARRANTY; without even the implied warranty of > > - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > > - * GNU General Public License for more details. > > - * > > - * You should have received a copy of the GNU General Public License > > - * along with Tinyx. If not, see <http://www.gnu.org/licenses/>. > > - */ > > - > > -#ifndef __TINYX_LIBC_STRING_H > > -#define __TINYX_LIBC_STRING_H > > - > > -int strcmp(const char *str1, const char *str2); > > - > > -#endif /* __TINYX_LIBC_STRING_H */ > > diff --git a/lib/libc/string.c b/lib/libc/string.c > > index 11c651b..d2e41a0 100644 > > --- a/lib/libc/string.c > > +++ b/lib/libc/string.c > > @@ -19,7 +19,7 @@ > > * along with Tinyx. If not, see <http://www.gnu.org/licenses/>. > > */ > > > > -#include <tinyx/libc/string.h> > > +#include <libc/string.h> > > > > int strcmp(const char *str1, const char *str2) > > { > > -- > > 1.5.4.rc1.21.g0e545-dirty > > > > > > ------------------------------------------------------------------------- > > Check out the new SourceForge.net Marketplace. > > It's the best place to buy or sell services for > > just about anything Open Source. > > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > > _______________________________________________ > > Tinyx-devel mailing list > > Tin...@li... > > https://lists.sourceforge.net/lists/listinfo/tinyx-devel > > > > > > -- > David Cohen > Instituto Nokia de Tecnologia - INdT > Manaus - Brazil -- Best Regards, Felipe Balbi me...@fe... http://blog.felipebalbi.com |
From: David C. <da...@gm...> - 2008-01-08 17:24:06
|
I agree with this change. But "include/libc" should be added to the default include PATH. So, we can include <string.h>, instead of <libc/string.h>. Br, David On Jan 8, 2008 12:52 PM, Felipe Balbi <me...@fe...> wrote: > Cosmetic. No functional changes. > > Signed-off-by: Felipe Balbi <me...@fe...> > --- > include/libc/string.h | 27 +++++++++++++++++++++++++++ > include/tinyx/libc/string.h | 27 --------------------------- > lib/libc/string.c | 2 +- > 3 files changed, 28 insertions(+), 28 deletions(-) > create mode 100644 include/libc/string.h > delete mode 100644 include/tinyx/libc/string.h > > diff --git a/include/libc/string.h b/include/libc/string.h > new file mode 100644 > index 0000000..8815a86 > --- /dev/null > +++ b/include/libc/string.h > @@ -0,0 +1,27 @@ > +/* include/libc/string.h > + * > + * Copyright (C) 2007 David Cohen <da...@gm...> > + * Copyright (C) 2007 Felipe Balbi <me...@fe...> > + * > + * This file is part of Tinyx Nanokernel Project. > + * > + * Tinyx is free software: you can redistribute it and/or modify > + * it under the terms of the GNU General Public License as published by > + * the Free Software Foundation, either version 3 of the License, or > + * (at your option) any later version. > + * > + * Tinyx is distributed in the hope that it will be useful, > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + * GNU General Public License for more details. > + * > + * You should have received a copy of the GNU General Public License > + * along with Tinyx. If not, see <http://www.gnu.org/licenses/>. > + */ > + > +#ifndef __TINYX_LIBC_STRING_H > +#define __TINYX_LIBC_STRING_H > + > +int strcmp(const char *str1, const char *str2); > + > +#endif /* __TINYX_LIBC_STRING_H */ > diff --git a/include/tinyx/libc/string.h b/include/tinyx/libc/string.h > deleted file mode 100644 > index 4ff2b08..0000000 > --- a/include/tinyx/libc/string.h > +++ /dev/null > @@ -1,27 +0,0 @@ > -/* include/tinyx/libc/string.h > - * > - * Copyright (C) 2007 David Cohen <da...@gm...> > - * Copyright (C) 2007 Felipe Balbi <me...@fe...> > - * > - * This file is part of Tinyx Nanokernel Project. > - * > - * Tinyx is free software: you can redistribute it and/or modify > - * it under the terms of the GNU General Public License as published by > - * the Free Software Foundation, either version 3 of the License, or > - * (at your option) any later version. > - * > - * Tinyx is distributed in the hope that it will be useful, > - * but WITHOUT ANY WARRANTY; without even the implied warranty of > - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > - * GNU General Public License for more details. > - * > - * You should have received a copy of the GNU General Public License > - * along with Tinyx. If not, see <http://www.gnu.org/licenses/>. > - */ > - > -#ifndef __TINYX_LIBC_STRING_H > -#define __TINYX_LIBC_STRING_H > - > -int strcmp(const char *str1, const char *str2); > - > -#endif /* __TINYX_LIBC_STRING_H */ > diff --git a/lib/libc/string.c b/lib/libc/string.c > index 11c651b..d2e41a0 100644 > --- a/lib/libc/string.c > +++ b/lib/libc/string.c > @@ -19,7 +19,7 @@ > * along with Tinyx. If not, see <http://www.gnu.org/licenses/>. > */ > > -#include <tinyx/libc/string.h> > +#include <libc/string.h> > > int strcmp(const char *str1, const char *str2) > { > -- > 1.5.4.rc1.21.g0e545-dirty > > > ------------------------------------------------------------------------- > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > _______________________________________________ > Tinyx-devel mailing list > Tin...@li... > https://lists.sourceforge.net/lists/listinfo/tinyx-devel > -- David Cohen Instituto Nokia de Tecnologia - INdT Manaus - Brazil |
From: David C. <da...@gm...> - 2008-01-08 17:19:32
|
Hum, very small and simple implementation. I'll push it today. Br, David Cohen On Jan 8, 2008 12:52 PM, Felipe Balbi <me...@fe...> wrote: > Missing only mem*() functions. > > Signed-off-by: Felipe Balbi <me...@fe...> > --- > include/libc/string.h | 8 +++ > lib/libc/string.c | 141 ++++++++++++++++++++++++++++++++++++++++++++++++- > 2 files changed, 148 insertions(+), 1 deletions(-) > > diff --git a/include/libc/string.h b/include/libc/string.h > index 8815a86..9106e7a 100644 > --- a/include/libc/string.h > +++ b/include/libc/string.h > @@ -22,6 +22,14 @@ > #ifndef __TINYX_LIBC_STRING_H > #define __TINYX_LIBC_STRING_H > > +char *strcat(char *str1, const char *str2); > +char *strchr(const char *str, int ch); > +int strcoll(const char *str1, const char *str2); > int strcmp(const char *str1, const char *str2); > +char *strcpy(char *str1, const char *str2); > +size_t strlen(const char *str); > +char *strncat(char *str1, const char *str2, size_t count); > +int strncmp(const char *str1, const char *str2, size_t count); > +char *strncpy(char *str1, const char *str2, size_t count); > > #endif /* __TINYX_LIBC_STRING_H */ > diff --git a/lib/libc/string.c b/lib/libc/string.c > index d2e41a0..f54a876 100644 > --- a/lib/libc/string.c > +++ b/lib/libc/string.c > @@ -21,7 +21,41 @@ > > #include <libc/string.h> > > -int strcmp(const char *str1, const char *str2) > +/** > + * strcat - Apend one string to another > + * @str1: The destination string > + * @str2: The source string > + */ > +char *strcat(char *str1, const char *str2) > +{ > + char *tmp = str1; > + > + while (*str1) > + str1++; > + while ((*str1++ = *str2++) != '\0') > + ; > + return tmp; > +} > + > +/** > + * strchr - Find the first ocurrence of a character in a string > + * @str: The string to search into > + * @ch: The character to find > + */ > +char *strchr(const char *str, int ch) > +{ > + for (; *str != (char)ch; ++s) > + if (*str == '\0') > + return NULL; > + return (char *)str; > +} > + > +/** > + * strcoll - Compare two strings > + * @str1: First string > + * @str2: Second string > + */ > +int strcoll(const char *str1, const char *str2) > { > while ((*str1) == (*str2)) { > if (!*str1++) > @@ -32,3 +66,108 @@ int strcmp(const char *str1, const char *str2) > > return (*str1) ? 1 : -1; > } > + > +/** > + * strcmp - Lex comparation of two strings > + * @str1: First string > + * @str2: Second string > + */ > +int strcmp(const char *str1, const char *str2) > +{ > + signed char ret; > + > + while (1) { > + if ((ret = *str1 - *str2++) != 0 || !*str1++) > + break; > + } > + return ret; > +} > + > +/** > + * strcpy - Copy the contents of str2 into str1 > + * @str1: The destination string > + * @str2: The source string > + */ > +char *strcpy(char *str1, const char *str2) > +{ > + char *tmp = str1; > + > + while ((*str1++ = *str2++) != '\0') > + > + return tmp; > +} > + > +/** > + * strlen - Find the length of a string > + * @str: The string to be sized > + */ > +size_t strlen(const char *str) > +{ > + const char *tmp; > + > + for (tmp = str; *tmp != '\0'; ++tmp); > + > + return tmp - str; > +} > + > +/** > + * strncat - Append count characters of str2 into str1 > + * @str1: The destination string > + * @str2: The source string > + * @count: The number of characters to append > + */ > +char *strncat(char *str1, const char *str2, size_t count) > +{ > + char *tmp = str1; > + > + if (count) { > + while (*str1) > + str1++; > + while ((*str1++ = *str2++) != 0) { > + if (--count == 0) { > + *str1 = '\0'; > + break; > + } > + } > + } > + return tmp; > +} > + > +/** > + * strncmp - Comparison of count characters > + * @str1: The destination string > + * @str2: The source string > + * @count: The number of characters > + */ > +int strncmp(const char *str1, const char *str2, size_t count) > +{ > + signed char ret; > + > + while (count) { > + if ((ret = *str1 - *str2++) != 0 || !*str1++) > + break; > + count--; > + } > + return ret; > +} > + > +/** > + * strncpy - Copy count characters from str2 into str1 > + * @str1: The destination string > + * @str2: The source string > + * @count: The number of characters > + */ > +char *strncpy(char *str1, const char *str2, size_t count) > +{ > + char *tmp = str1; > + > + while (count) { > + if ((*tmp = *str2) != 0) > + str2++; > + tmp++; > + count--; > + } > + > + return str1; > +} > + > -- > 1.5.4.rc1.21.g0e545-dirty > > > ------------------------------------------------------------------------- > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > _______________________________________________ > Tinyx-devel mailing list > Tin...@li... > https://lists.sourceforge.net/lists/listinfo/tinyx-devel > -- David Cohen Instituto Nokia de Tecnologia - INdT Manaus - Brazil |
From: Felipe B. <me...@fe...> - 2008-01-08 16:50:35
|
Missing only mem*() functions. Signed-off-by: Felipe Balbi <me...@fe...> --- include/libc/string.h | 8 +++ lib/libc/string.c | 141 ++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 148 insertions(+), 1 deletions(-) diff --git a/include/libc/string.h b/include/libc/string.h index 8815a86..9106e7a 100644 --- a/include/libc/string.h +++ b/include/libc/string.h @@ -22,6 +22,14 @@ #ifndef __TINYX_LIBC_STRING_H #define __TINYX_LIBC_STRING_H +char *strcat(char *str1, const char *str2); +char *strchr(const char *str, int ch); +int strcoll(const char *str1, const char *str2); int strcmp(const char *str1, const char *str2); +char *strcpy(char *str1, const char *str2); +size_t strlen(const char *str); +char *strncat(char *str1, const char *str2, size_t count); +int strncmp(const char *str1, const char *str2, size_t count); +char *strncpy(char *str1, const char *str2, size_t count); #endif /* __TINYX_LIBC_STRING_H */ diff --git a/lib/libc/string.c b/lib/libc/string.c index d2e41a0..f54a876 100644 --- a/lib/libc/string.c +++ b/lib/libc/string.c @@ -21,7 +21,41 @@ #include <libc/string.h> -int strcmp(const char *str1, const char *str2) +/** + * strcat - Apend one string to another + * @str1: The destination string + * @str2: The source string + */ +char *strcat(char *str1, const char *str2) +{ + char *tmp = str1; + + while (*str1) + str1++; + while ((*str1++ = *str2++) != '\0') + ; + return tmp; +} + +/** + * strchr - Find the first ocurrence of a character in a string + * @str: The string to search into + * @ch: The character to find + */ +char *strchr(const char *str, int ch) +{ + for (; *str != (char)ch; ++s) + if (*str == '\0') + return NULL; + return (char *)str; +} + +/** + * strcoll - Compare two strings + * @str1: First string + * @str2: Second string + */ +int strcoll(const char *str1, const char *str2) { while ((*str1) == (*str2)) { if (!*str1++) @@ -32,3 +66,108 @@ int strcmp(const char *str1, const char *str2) return (*str1) ? 1 : -1; } + +/** + * strcmp - Lex comparation of two strings + * @str1: First string + * @str2: Second string + */ +int strcmp(const char *str1, const char *str2) +{ + signed char ret; + + while (1) { + if ((ret = *str1 - *str2++) != 0 || !*str1++) + break; + } + return ret; +} + +/** + * strcpy - Copy the contents of str2 into str1 + * @str1: The destination string + * @str2: The source string + */ +char *strcpy(char *str1, const char *str2) +{ + char *tmp = str1; + + while ((*str1++ = *str2++) != '\0') + + return tmp; +} + +/** + * strlen - Find the length of a string + * @str: The string to be sized + */ +size_t strlen(const char *str) +{ + const char *tmp; + + for (tmp = str; *tmp != '\0'; ++tmp); + + return tmp - str; +} + +/** + * strncat - Append count characters of str2 into str1 + * @str1: The destination string + * @str2: The source string + * @count: The number of characters to append + */ +char *strncat(char *str1, const char *str2, size_t count) +{ + char *tmp = str1; + + if (count) { + while (*str1) + str1++; + while ((*str1++ = *str2++) != 0) { + if (--count == 0) { + *str1 = '\0'; + break; + } + } + } + return tmp; +} + +/** + * strncmp - Comparison of count characters + * @str1: The destination string + * @str2: The source string + * @count: The number of characters + */ +int strncmp(const char *str1, const char *str2, size_t count) +{ + signed char ret; + + while (count) { + if ((ret = *str1 - *str2++) != 0 || !*str1++) + break; + count--; + } + return ret; +} + +/** + * strncpy - Copy count characters from str2 into str1 + * @str1: The destination string + * @str2: The source string + * @count: The number of characters + */ +char *strncpy(char *str1, const char *str2, size_t count) +{ + char *tmp = str1; + + while (count) { + if ((*tmp = *str2) != 0) + str2++; + tmp++; + count--; + } + + return str1; +} + -- 1.5.4.rc1.21.g0e545-dirty |
From: Felipe B. <me...@fe...> - 2008-01-08 16:50:34
|
Cosmetic. No functional changes. Signed-off-by: Felipe Balbi <me...@fe...> --- include/libc/string.h | 27 +++++++++++++++++++++++++++ include/tinyx/libc/string.h | 27 --------------------------- lib/libc/string.c | 2 +- 3 files changed, 28 insertions(+), 28 deletions(-) create mode 100644 include/libc/string.h delete mode 100644 include/tinyx/libc/string.h diff --git a/include/libc/string.h b/include/libc/string.h new file mode 100644 index 0000000..8815a86 --- /dev/null +++ b/include/libc/string.h @@ -0,0 +1,27 @@ +/* include/libc/string.h + * + * Copyright (C) 2007 David Cohen <da...@gm...> + * Copyright (C) 2007 Felipe Balbi <me...@fe...> + * + * This file is part of Tinyx Nanokernel Project. + * + * Tinyx is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Tinyx is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Tinyx. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef __TINYX_LIBC_STRING_H +#define __TINYX_LIBC_STRING_H + +int strcmp(const char *str1, const char *str2); + +#endif /* __TINYX_LIBC_STRING_H */ diff --git a/include/tinyx/libc/string.h b/include/tinyx/libc/string.h deleted file mode 100644 index 4ff2b08..0000000 --- a/include/tinyx/libc/string.h +++ /dev/null @@ -1,27 +0,0 @@ -/* include/tinyx/libc/string.h - * - * Copyright (C) 2007 David Cohen <da...@gm...> - * Copyright (C) 2007 Felipe Balbi <me...@fe...> - * - * This file is part of Tinyx Nanokernel Project. - * - * Tinyx is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Tinyx is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Tinyx. If not, see <http://www.gnu.org/licenses/>. - */ - -#ifndef __TINYX_LIBC_STRING_H -#define __TINYX_LIBC_STRING_H - -int strcmp(const char *str1, const char *str2); - -#endif /* __TINYX_LIBC_STRING_H */ diff --git a/lib/libc/string.c b/lib/libc/string.c index 11c651b..d2e41a0 100644 --- a/lib/libc/string.c +++ b/lib/libc/string.c @@ -19,7 +19,7 @@ * along with Tinyx. If not, see <http://www.gnu.org/licenses/>. */ -#include <tinyx/libc/string.h> +#include <libc/string.h> int strcmp(const char *str1, const char *str2) { -- 1.5.4.rc1.21.g0e545-dirty |
From: Felipe B. <me...@fe...> - 2007-12-12 20:54:51
|
Signed-off-by: Felipe Balbi <me...@fe...> --- arch/arm7/common/platform_device.c | 21 +++++++++++++++++++++ 1 files changed, 21 insertions(+), 0 deletions(-) diff --git a/arch/arm7/common/platform_device.c b/arch/arm7/common/platform_device.c index a2b1a47..0bd086d 100644 --- a/arch/arm7/common/platform_device.c +++ b/arch/arm7/common/platform_device.c @@ -1,3 +1,24 @@ +/* arch/arm7/common/platform_device.c + * + * Copyright (C) 2007 David Cohen <da...@gm...> + * Copyright (C) 2007 Felipe Balbi <me...@fe...> + * + * This file is part of Tinyx Nanokernel Project. + * + * Tinyx is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Tinyx is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Tinyx. If not, see <http://www.gnu.org/licenses/>. + */ + #include <tinyx/device.h> #include <tinyx/kernel.h> #include <asm/io.h> -- 1.5.3.7.1157.gbf82a |
From: Felipe B. <me...@fe...> - 2007-12-12 20:23:52
|
Signed-off-by: Felipe Balbi <me...@fe...> --- arch/arm7/mach-lpc21xx/clock.h | 21 +++++++++++++++++++++ 1 files changed, 21 insertions(+), 0 deletions(-) diff --git a/arch/arm7/mach-lpc21xx/clock.h b/arch/arm7/mach-lpc21xx/clock.h index 2d3c010..9fb8cbb 100644 --- a/arch/arm7/mach-lpc21xx/clock.h +++ b/arch/arm7/mach-lpc21xx/clock.h @@ -1,3 +1,24 @@ +/* arch/arm7/mach-lpc21xx/clock.h + * + * Copyright (C) 2007 David Cohen <da...@gm...> + * Copyright (C) 2007 Felipe Balbi <me...@fe...> + * + * This file is part of Tinyx Nanokernel Project. + * + * Tinyx is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Foobar is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Tinyx. If not, see <http://www.gnu.org/licenses/>. + */ + #ifndef __ARCH_MACH_LPC2XXX_CLOCK_H #define __ARCH_MACH_LPC2XXX_CLOCK_H -- 1.5.3.7.1157.gbf82a |
From: Felipe B. <me...@fe...> - 2007-12-12 18:45:50
|
Signed-off-by: Felipe Balbi <me...@fe...> --- include/asm-arm7/arch-lpc2xxx/start_lpc2148.h | 21 +++++++++++++++++++++ 1 files changed, 21 insertions(+), 0 deletions(-) diff --git a/include/asm-arm7/arch-lpc2xxx/start_lpc2148.h b/include/asm-arm7/arch-lpc2xxx/start_lpc2148.h index de65669..28f9e30 100644 --- a/include/asm-arm7/arch-lpc2xxx/start_lpc2148.h +++ b/include/asm-arm7/arch-lpc2xxx/start_lpc2148.h @@ -1,3 +1,24 @@ +/* include/asm-arm7/arch-lpc2xxx/start_lcp2148.h + * + * Copyright (C) 2007 David Cohen <da...@gm...> + * Copyright (C) 2007 Felipe Balbi <me...@fe...> + * + * This file is part of Tinyx Nanokernel Project. + * + * Tinyx is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Tinyx is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Tinyx. If not, see <http://www.gnu.org/licenses/>. + */ + #ifndef __STARTUP_H #define __STARTUP_H -- 1.5.3.7.1157.gbf82a |
From: Felipe B. <me...@fe...> - 2007-12-12 18:35:54
|
Signed-off-by: Felipe Balbi <me...@fe...> --- kernel/main.c | 21 +++++++++++++++++++++ 1 files changed, 21 insertions(+), 0 deletions(-) diff --git a/kernel/main.c b/kernel/main.c index d960a2b..50d9f77 100644 --- a/kernel/main.c +++ b/kernel/main.c @@ -1,3 +1,24 @@ +/* kernel/main.c + * + * Copyright (C) 2007 David Cohen <da...@gm...> + * Copyright (C) 2007 Felipe Balbi <me...@fe...> + * + * This file is part of Tinyx Nanokernel Project. + * + * Tinyx is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Foobar is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Tinyx. If not, see <http://www.gnu.org/licenses/>. + */ + #include <asm/arch-lpc2xxx/lpc2xxx.h> #include <asm/arch-lpc2xxx/start_lpc2148.h> #include <asm/io.h> -- 1.5.3.7.1157.gbf82a |
From: Felipe B. <me...@fe...> - 2007-12-12 18:27:53
|
Change space to tab when using '=' operator. Signed-off-by: Felipe Balbi <me...@fe...> --- arch/arm7/mach-lpc21xx/uart.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm7/mach-lpc21xx/uart.c b/arch/arm7/mach-lpc21xx/uart.c index fcaeecb..430f8ce 100644 --- a/arch/arm7/mach-lpc21xx/uart.c +++ b/arch/arm7/mach-lpc21xx/uart.c @@ -11,8 +11,8 @@ static int lpc2xxx_uart_probe(struct device *dev) } static struct device_driver lpc2xxx_uart_driver = { - .name = DRIVER_NAME, - .probe = lpc2xxx_uart_probe, + .name = DRIVER_NAME, + .probe = lpc2xxx_uart_probe, }; static int __init lpc2xxx_uart_init(void) -- 1.5.3.7.1157.gbf82a |
From: David C. <da...@gm...> - 2007-12-12 18:23:14
|
Acked. BR, David Cohen On Dec 12, 2007 11:21 AM, Felipe Balbi <me...@fe...> wrote: > Miscelanous fixes on clock subsystem. > > Signed-off-by: Felipe Balbi <me...@fe...> > --- > arch/arm7/mach-lpc21xx/clock.c | 25 ++++++++++++++++++++++--- > arch/arm7/mach-lpc21xx/clock.h | 24 +++--------------------- > arch/common/clock.c | 6 +++--- > include/asm-generic/clock.h | 6 +++--- > 4 files changed, 31 insertions(+), 30 deletions(-) > > diff --git a/arch/arm7/mach-lpc21xx/clock.c > b/arch/arm7/mach-lpc21xx/clock.c > index 3695c46..61b00e3 100644 > --- a/arch/arm7/mach-lpc21xx/clock.c > +++ b/arch/arm7/mach-lpc21xx/clock.c > @@ -21,16 +21,35 @@ > > #include "clock.h" > > -static unsigned int cclk_set_rate(struct clock *clk, unsigned int rate) > +unsigned int cclk_set_rate(struct clock *clk, unsigned int rate) > { > return 0; > } > > -static unsigned int pclk_set_rate(struct clock *clk, unsigned int rate) > +unsigned int pclk_set_rate(struct clock *clk, unsigned int rate) > { > return 0; > } > > -static void pclk_propagate(struct clock *clk, struct clock *parent) > +void pclk_propagate(struct clock *clk, struct clock *parent) > { > } > + > +static struct clock pclk = { > + .id = PCLK, > + .num_child = 0, > + .child = NULL, > + .set_rate = pclk_set_rate, > + .propagate = pclk_propagate, > +}; > + > +static struct clock cclk = { > + .id = CCLK, > + .num_child = 1, > + .child = &pclk, > + .set_rate = cclk_set_rate, > + .propagate = NULL, > +}; > + > +struct clock *lpc2xxx_clk_list[] = { &cclk, &pclk }; > + > diff --git a/arch/arm7/mach-lpc21xx/clock.h > b/arch/arm7/mach-lpc21xx/clock.h > index fa5d69a..214fd62 100644 > --- a/arch/arm7/mach-lpc21xx/clock.h > +++ b/arch/arm7/mach-lpc21xx/clock.h > @@ -25,26 +25,8 @@ > #include <asm/arch-lpc2xxx/clock.h> > #include <tinyx/kernel.h> > > -static unsigned int cclk_set_rate(struct clock *clk, unsigned int rate); > -static unsigned int pclk_set_rate(struct clock *clk, unsigned int rate); > -static void pclk_propagate(struct clock *clk, struct clock *parent); > - > -static struct clock pclk = { > - .id = PCLK, > - .num_child = 0, > - .child = NULL, > - .set_rate = pclk_set_rate, > - .propagate = pclk_propagate, > -}; > - > -static struct clock cclk = { > - .id = CCLK, > - .num_child = 1, > - .child = &pclk, > - .set_rate = cclk_set_rate, > - .propagate = NULL, > -}; > - > -struct clock *lpc2xxx_clk_list[] = { &cclk, &pclk }; > +extern unsigned int cclk_set_rate(struct clock *clk, unsigned int rate); > +extern unsigned int pclk_set_rate(struct clock *clk, unsigned int rate); > +extern void pclk_propagate(struct clock *clk, struct clock *parent); > > #endif /* __ARCH_MACH_LPC2XXX_CLOCK_H */ > diff --git a/arch/common/clock.c b/arch/common/clock.c > index 12c3551..d92f09e 100644 > --- a/arch/common/clock.c > +++ b/arch/common/clock.c > @@ -25,13 +25,13 @@ > static struct clock *clk_list; > static unsigned int num_clk; > > -static void clk_set_list(struct clock *list, unsigned int num) > +void clk_set_list(struct clock *list, unsigned int num) > { > clk_list = list; > num_clk = num; > } > > -static void clk_propagate(struct clock *clk, struct clock *parent) > +void clk_propagate(struct clock *clk, struct clock *parent) > { > unsigned int c; > struct clock *child; > @@ -52,7 +52,7 @@ static void clk_propagate(struct clock *clk, struct > clock *parent) > } > } > > -static unsigned int clk_set_rate(struct clock *clk, unsigned int rate) > +unsigned int clk_set_rate(struct clock *clk, unsigned int rate) > { > unsigned int clk_rate = rate; > unsigned int c; > diff --git a/include/asm-generic/clock.h b/include/asm-generic/clock.h > index 92e397d..4ac8e7c 100644 > --- a/include/asm-generic/clock.h > +++ b/include/asm-generic/clock.h > @@ -34,8 +34,8 @@ struct clock { > > #define clk_get_rate(clk) (clk)->rate > > -static void clk_set_list(struct clock *list, unsigned int num); > -static void clk_propagate(struct clock *clk, struct clock *parent); > -static unsigned int clk_set_rate(struct clock *clk, unsigned int rate); > +extern void clk_set_list(struct clock *list, unsigned int num); > +extern void clk_propagate(struct clock *clk, struct clock *parent); > +extern unsigned int clk_set_rate(struct clock *clk, unsigned int rate); > > #endif /* __ASM_GENERIC_CLOCK_H */ > -- > 1.5.3.7.1157.gbf82a > > > ------------------------------------------------------------------------- > SF.Net email is sponsored by: > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > http://sourceforge.net/services/buy/index.php > _______________________________________________ > Tinyx-devel mailing list > Tin...@li... > https://lists.sourceforge.net/lists/listinfo/tinyx-devel > |