2 * (C) Copyright 2007-2019 Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
4 * This file is released under the GPLv2. See the COPYING file for more
16 #include <binfmt_elf.h>
20 extern volatile u64 ticks
;
22 extern struct datetime ipltime
;
24 /* The beginning of it all... */
25 extern void start(u64 __memsize
, u32 __iplsch
, Elf64_Ehdr
*__symtab
);
27 /* borrowed from Linux */
28 #define container_of(ptr, type, member) ({ \
29 const typeof( ((type *)0)->member ) *__mptr = (ptr); \
30 (type *)( (char *)__mptr - offsetof(type,member) );})
32 /* borrowed from Linux */
33 #define offsetof(type, member) __builtin_offsetof(type,member)
36 asm volatile(".byte 0x00,0x00,0x00,0x00" : : : "memory"); \
38 #define BUG_ON(cond) do { \
42 #define assert(cond) do { \
43 if (unlikely(!(cond))) \
46 #define assert(cond) do { \
47 if (unlikely(!(cond))) \
51 #define FIXME(fmt, ...) sclp_msg("FIXME @ " __FILE__ ":%d: " fmt, __LINE__, ##__VA_ARGS__)
60 extern int con_printf(struct virt_cons
*con
, const char *fmt
, ...)
61 __attribute__ ((format (printf
, 2, 3)));
62 extern int con_vprintf(struct virt_cons
*con
, const char *fmt
, va_list args
)
63 __attribute__ ((format (printf
, 2, 0)));