diff options
author | peter <peter@FreeBSD.org> | 2002-05-11 21:49:39 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 2002-05-11 21:49:39 +0000 |
commit | 4daf43a4a40405027bad81aa4cfe171ef365f208 (patch) | |
tree | 6cdf22c07e19229b63e67cf46545aa064a825eaa /sys | |
parent | b47f03e300e268504944e1af297a63e640e20cbd (diff) | |
download | FreeBSD-src-4daf43a4a40405027bad81aa4cfe171ef365f208.zip FreeBSD-src-4daf43a4a40405027bad81aa4cfe171ef365f208.tar.gz |
Save about 60 bytes by #define memcpy __builtin_memcpy and removing
the function we provided. Restore the Keyboard: yes/no printf for the
probe diagnostics. We end up with 40 bytes free.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/boot/i386/boot2/boot2.c | 16 | ||||
-rw-r--r-- | sys/boot/i386/gptboot/gptboot.c | 16 |
2 files changed, 6 insertions, 26 deletions
diff --git a/sys/boot/i386/boot2/boot2.c b/sys/boot/i386/boot2/boot2.c index 849bd22..d025e80 100644 --- a/sys/boot/i386/boot2/boot2.c +++ b/sys/boot/i386/boot2/boot2.c @@ -154,7 +154,6 @@ static ssize_t fsread(ino_t, void *, size_t); static int dskread(void *, unsigned, unsigned); static int printf(const char *,...); static int putchar(int); -static void *memcpy(void *, const void *, size_t); static uint32_t memsize(int); static int drvread(void *, unsigned, unsigned); static int keyhit(unsigned); @@ -162,6 +161,8 @@ static int xputc(int); static int xgetc(int); static int getc(int); +#define memcpy __builtin_memcpy + static inline void readfile(const char *fname, void *buf, size_t size) { @@ -456,7 +457,7 @@ parse(char *arg) } if (opts & 1 << RBX_PROBEKBD) { i = *(uint8_t *)PTOV(0x496) & 0x10; - /* printf("Keyboard: %s\n", i ? "yes" : "no"); XXX GCC31 size */ + printf("Keyboard: %s\n", i ? "yes" : "no"); if (!i) opts |= 1 << RBX_DUAL | 1 << RBX_SERIAL; opts &= ~(1 << RBX_PROBEKBD); @@ -743,17 +744,6 @@ putchar(int c) return xputc(c); } -static void * -memcpy(void *dst, const void *src, size_t size) -{ - const char *s; - char *d; - - for (d = dst, s = src; size; size--) - *d++ = *s++; - return dst; -} - static uint32_t memsize(int type) { diff --git a/sys/boot/i386/gptboot/gptboot.c b/sys/boot/i386/gptboot/gptboot.c index 849bd22..d025e80 100644 --- a/sys/boot/i386/gptboot/gptboot.c +++ b/sys/boot/i386/gptboot/gptboot.c @@ -154,7 +154,6 @@ static ssize_t fsread(ino_t, void *, size_t); static int dskread(void *, unsigned, unsigned); static int printf(const char *,...); static int putchar(int); -static void *memcpy(void *, const void *, size_t); static uint32_t memsize(int); static int drvread(void *, unsigned, unsigned); static int keyhit(unsigned); @@ -162,6 +161,8 @@ static int xputc(int); static int xgetc(int); static int getc(int); +#define memcpy __builtin_memcpy + static inline void readfile(const char *fname, void *buf, size_t size) { @@ -456,7 +457,7 @@ parse(char *arg) } if (opts & 1 << RBX_PROBEKBD) { i = *(uint8_t *)PTOV(0x496) & 0x10; - /* printf("Keyboard: %s\n", i ? "yes" : "no"); XXX GCC31 size */ + printf("Keyboard: %s\n", i ? "yes" : "no"); if (!i) opts |= 1 << RBX_DUAL | 1 << RBX_SERIAL; opts &= ~(1 << RBX_PROBEKBD); @@ -743,17 +744,6 @@ putchar(int c) return xputc(c); } -static void * -memcpy(void *dst, const void *src, size_t size) -{ - const char *s; - char *d; - - for (d = dst, s = src; size; size--) - *d++ = *s++; - return dst; -} - static uint32_t memsize(int type) { |