diff options
-rw-r--r-- | init.c | 2 | ||||
-rw-r--r-- | memcpy.c | 2 | ||||
-rw-r--r-- | memset.c | 2 | ||||
-rw-r--r-- | printf.c | 4 | ||||
-rw-r--r-- | protos.h | 30 |
5 files changed, 28 insertions, 12 deletions
@@ -18,8 +18,6 @@ along with this program; see the file COPYING. If not see <http://www.gnu.org/licenses/>. */ -#include <string.h> -#include <stddef.h> #include "hwrpb.h" #include "osf.h" #include "ioport.h" @@ -8,7 +8,7 @@ * This is a reasonably optimized memcpy() routine. */ -#include <string.h> +#include "protos.h" /* * Note that the C code is written to be optimized into good assembly. However, @@ -19,7 +19,7 @@ <http://www.gnu.org/licenses/>. */ -#include <string.h> +#include "protos.h" void *memset(void *optr, int ival, unsigned long size) { @@ -18,10 +18,8 @@ along with this program; see the file COPYING. If not see <http://www.gnu.org/licenses/>. */ -#include <stdarg.h> -#include <stdbool.h> -#include <string.h> #include "console.h" +#include "protos.h" static int print_buf_pad(char *buf, int buflen, char *p, int width, int pad) { @@ -21,11 +21,31 @@ #ifndef PROTOS_H #define PROTOS_H 1 -#include <stdint.h> -#include <stdbool.h> -#include <stddef.h> -#include <string.h> - +/* Stand-alone definitions for various types, compatible with + the Alpha Linux ABI and GCC. This eliminates dependencies + on external headers. */ +typedef unsigned char uint8_t; +typedef unsigned short uint16_t; +typedef unsigned int uint32_t; +typedef unsigned long uint64_t; +typedef unsigned long size_t; + +#define bool _Bool +#define true 1 +#define false 0 + +#define offsetof(type, member) __builtin_offsetof(type, member) + +typedef __builtin_va_list va_list; +#define va_start(ap, last) __builtin_va_start((ap), (last)) +#define va_arg __builtin_va_arg +#define va_end(ap) __builtin_va_end(ap) + +#define NULL ((void *)0) + +extern void *memset(void *, int, size_t); +extern void *memcpy(void *, const void *, size_t); +extern size_t strlen(const char *); /* * Call_Pal functions. |