diff options
author | Jason Thorpe <thorpej@me.com> | 2021-06-02 20:53:10 -0700 |
---|---|---|
committer | Richard Henderson <richard.henderson@linaro.org> | 2021-06-05 17:26:13 -0700 |
commit | 394234f7d7fb737198783ce6340873858aa939f9 (patch) | |
tree | 3d21a052fc5994965cd355afaee9bdcdeacb8528 /protos.h | |
parent | bf0e13698872450164fa7040da36a95d2d4b326f (diff) | |
download | qemu-palcode-394234f7d7fb737198783ce6340873858aa939f9.zip qemu-palcode-394234f7d7fb737198783ce6340873858aa939f9.tar.gz qemu-palcode-394234f7d7fb737198783ce6340873858aa939f9.tar.bz2 |
Make qemu-palcode build environment standalone. NFC.
Don't include system headers. Instead, provide standalone definitions
and declarations of types needed and functions used by the PALcode that
are compatible with the standard Alpha / GCC ABI.
Signed-off-by: Jason Thorpe <thorpej@me.com>
Message-Id: <20210603035317.6814-2-thorpej@me.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'protos.h')
-rw-r--r-- | protos.h | 30 |
1 files changed, 25 insertions, 5 deletions
@@ -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. |