Skip to content
Snippets Groups Projects
Commit 923afb7d authored by Armin Luntzer's avatar Armin Luntzer
Browse files

add kernel/types.h for less cooperative compilers

parent d2df6047
No related branches found
No related tags found
No related merge requests found
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#ifndef _ARCH_SPARC_ASM_IO_H_ #ifndef _ARCH_SPARC_ASM_IO_H_
#define _ARCH_SPARC_ASM_IO_H_ #define _ARCH_SPARC_ASM_IO_H_
#include <stdint.h> #include <kernel/types.h>
#include <uapi/asi.h> #include <uapi/asi.h>
/* /*
......
#ifndef _SPARC_STACK_H_ #ifndef _SPARC_STACK_H_
#define _SPARC_STACK_H_ #define _SPARC_STACK_H_
#include <stdint.h> #include <kernel/types.h>
/* reg window offset */ /* reg window offset */
#define RW_L0 0x00 #define RW_L0 0x00
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#ifndef _SPARC_STACKTRACE_H_ #ifndef _SPARC_STACKTRACE_H_
#define _SPARC_STACKTRACE_H_ #define _SPARC_STACKTRACE_H_
#include <stdint.h> #include <kernel/types.h>
#include <stack.h> #include <stack.h>
struct stack_trace { struct stack_trace {
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#ifndef _ARCH_SPARC_TRAPS_H_ #ifndef _ARCH_SPARC_TRAPS_H_
#define _ARCH_SPARC_TRAPS_H_ #define _ARCH_SPARC_TRAPS_H_
#include <stdint.h> #include <kernel/types.h>
void trap_handler_install(uint32_t trap, void (*handler)(void)); void trap_handler_install(uint32_t trap, void (*handler)(void));
......
#ifndef _KERNEL_AR_H_ #ifndef _KERNEL_AR_H_
#define _KERNEL_AR_H_ #define _KERNEL_AR_H_
#include <stdint.h> #include <kernel/types.h>
#define AR_MAG "!<arch>\n" /* AR MAGIC ID */ #define AR_MAG "!<arch>\n" /* AR MAGIC ID */
#define AR_FMAG "`\n" /* AR HDR END MAGIC */ #define AR_FMAG "`\n" /* AR HDR END MAGIC */
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#ifndef _KERNEL_BITOPS_H_ #ifndef _KERNEL_BITOPS_H_
#define _KERNEL_BITOPS_H_ #define _KERNEL_BITOPS_H_
#include <kernel/types.h>
#ifndef __WORDSIZE #ifndef __WORDSIZE
#define __WORDSIZE (__SIZEOF_LONG__ * 8) #define __WORDSIZE (__SIZEOF_LONG__ * 8)
......
...@@ -2,8 +2,7 @@ ...@@ -2,8 +2,7 @@
#define _KERNEL_ELF_H_ #define _KERNEL_ELF_H_
#include <stdint.h> #include <kernel/types.h>
#include <stddef.h>
/* some ELF constants&stuff ripped from include/uapi/linux/elf.h */ /* some ELF constants&stuff ripped from include/uapi/linux/elf.h */
......
...@@ -16,8 +16,7 @@ ...@@ -16,8 +16,7 @@
#ifndef _KERNEL_LOG2_H_ #ifndef _KERNEL_LOG2_H_
#define _KERNEL_LOG2_H_ #define _KERNEL_LOG2_H_
#include <stdint.h> #include <kernel/types.h>
#include <stdbool.h>
/** /**
* fls - find last (most-significant) bit set * fls - find last (most-significant) bit set
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#ifndef _KERNEL_SBRK_H_ #ifndef _KERNEL_SBRK_H_
#define _KERNEL_SBRK_H_ #define _KERNEL_SBRK_H_
#include <stdint.h> #include <kernel/types.h>
void *kernel_sbrk(intptr_t increment); void *kernel_sbrk(intptr_t increment);
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#ifndef _KERNEL_SYSCTL_H_ #ifndef _KERNEL_SYSCTL_H_
#define _KERNEL_SYSCTL_H_ #define _KERNEL_SYSCTL_H_
#include <sys/types.h> #include <kernel/types.h>
#include <list.h> #include <list.h>
#include <kernel/kernel.h> #include <kernel/kernel.h>
......
/**
* @file include/kernel/types.h
*/
#ifndef _KERNEL_TYPES_H_
#define _KERNEL_TYPES_H_
#include <stddef.h>
#include <stdbool.h>
#ifdef __GNUC__
#define GCC_VERSION (__GNUC__ * 10000 \
+ __GNUC_MINOR__ * 100 \
+ __GNUC_PATCHLEVEL__)
#endif
/* BCC is at least 4.4.2 */
#if defined(GCC_VERSION) && (GCC_VERSION >= 404020)
#include <stdint.h>
#else
/* this must do... */
typedef unsigned long uintptr_t;
typedef signed long intptr_t;
typedef unsigned long long uint64_t;
typedef signed long long int64_t;
typedef unsigned long uint32_t;
typedef signed long int32_t;
typedef unsigned short uint16_t;
typedef signed short int16_t;
typedef unsigned char uint8_t;
typedef signed char int8_t;
#endif
#ifndef __SIZEOF_LONG__
#define __SIZEOF_LONG__ (sizeof(long))
#endif
#endif /* _KERNEL_TYPES_H_ */
...@@ -50,7 +50,6 @@ ...@@ -50,7 +50,6 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdint.h>
#include <string.h> #include <string.h>
#include <errno.h> #include <errno.h>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment