voron

experimental ARM OS
git clone git://git.2f30.org/voron
Log | Files | Refs | README | LICENSE

kernel.h (554B)


      1 #ifndef __KERNEL_H
      2 #define __KERNEL_H
      3 
      4 #include <inttypes.h>
      5 #include <stddef.h>
      6 #include <string.h>
      7 #include <print.h>
      8 #include <io.h>
      9 #include <errno.h>
     10 #include <varg.h>
     11 #include <regs.h>
     12 #include <alloc.h>
     13 #include <debug.h>
     14 #include <atomic.h>
     15 #include <panic.h>
     16 
     17 #define __unused	__attribute__((__unused__))
     18 
     19 #define container_of(ptr, type, member) ({		\
     20 	const typeof(((type*)0)->member) *__mptr = (ptr);	\
     21 	(type*)((uintptr_t)__mptr - offsetof(type, member));	\
     22 })
     23 
     24 #define ARRAY_SIZE(arr)	(sizeof(arr)/sizeof((arr)[0]))
     25 
     26 #endif	/* __KERNEL_H */