Add memtest support.
[syslinux-debian/hramrach.git] / core / include / core.h
blob1fd283e30bfcb516a369ed6ca4ecac23c951ed03
1 #ifndef CORE_H
2 #define CORE_H
4 #include <klibc/compiler.h>
5 #include <stddef.h>
6 #include <stdlib.h>
7 #include <stdbool.h>
8 #include <inttypes.h>
9 #include <stdio.h>
10 #include <dprintf.h>
11 #include <com32.h>
12 #include <errno.h>
13 #include <syslinux/pmapi.h>
14 #include <syslinux/sysappend.h>
15 #include <kaboom.h>
16 #include <timer.h>
18 extern char core_xfer_buf[65536];
19 extern char core_cache_buf[65536];
20 extern char trackbuf[];
21 extern char CurrentDirName[];
22 extern char SubvolName[];
23 extern char ConfigName[];
24 extern char config_cwd[];
25 extern char cmd_line[];
26 extern char ConfigFile[];
27 extern char syslinux_banner[];
28 extern char copyright_str[];
29 extern unsigned int __bcopyxx_len;
32 * Mark symbols that are only used by BIOS as __weak until we can move
33 * all references out of the generic (EFI + BIOS) code and into
34 * BIOS-specific code.
36 extern __weak uint16_t BIOSName;
37 extern __weak char KernelName[];
38 extern __weak char StackBuf[];
40 extern uint8_t KbdMap[256];
42 extern const uint16_t IPAppends[];
43 extern size_t numIPAppends;
45 extern uint16_t SerialPort;
46 extern uint16_t BaudDivisor;
47 extern uint8_t FlowOutput;
48 extern uint8_t FlowInput;
49 extern uint8_t FlowIgnore;
51 extern uint8_t ScrollAttribute;
52 extern uint16_t DisplayCon;
54 /* diskstart.inc isolinux.asm*/
55 extern void getlinsec(void);
57 /* pm.inc */
58 void core_pm_null_hook(void);
59 extern void (*core_pm_hook)(void);
61 /* getc.inc */
62 extern void core_open(void);
64 /* hello.c */
65 extern void myputs(const char*);
67 /* idle.c */
68 extern int (*idle_hook_func)(void);
69 extern void __idle(void);
70 extern void reset_idle(void);
72 /* mem/malloc.c, mem/free.c, mem/init.c */
73 extern void *lmalloc(size_t);
74 extern void *pmapi_lmalloc(size_t);
75 extern void *zalloc(size_t);
76 extern void free(void *);
77 extern void mem_init(void);
79 /* sysappend.c */
80 extern void print_sysappend(void);
81 extern const char *sysappend_strings[SYSAPPEND_MAX];
82 extern uint32_t SysAppends;
83 extern void sysappend_set_uuid(const uint8_t *uuid);
85 void __cdecl core_intcall(uint8_t, const com32sys_t *, com32sys_t *);
86 void __cdecl core_farcall(uint32_t, const com32sys_t *, com32sys_t *);
87 int __cdecl core_cfarcall(uint32_t, const void *, uint32_t);
89 extern const com32sys_t zero_regs;
90 void call16(void (*)(void), const com32sys_t *, com32sys_t *);
93 * __lowmem is in the low 1 MB; __bss16 in the low 64K
95 #ifdef __SYSLINUX_CORE__ /* Not supported in modules */
96 # define __lowmem __attribute__((nocommon,section(".lowmem")))
97 # define __bss16 __attribute__((nocommon,section(".bss16")))
98 #endif
101 * Helper routine to return a specific set of flags
103 static inline void set_flags(com32sys_t *regs, uint32_t flags)
105 uint32_t eflags;
107 eflags = regs->eflags.l;
108 eflags &= ~(EFLAGS_CF|EFLAGS_PF|EFLAGS_AF|EFLAGS_ZF|EFLAGS_SF|EFLAGS_OF);
109 eflags |= flags;
110 regs->eflags.l = eflags;
113 extern int start_ldlinux(int argc, char **argv);
114 extern int create_args_and_load(char *);
116 extern void write_serial(char data);
117 extern void writestr(char *str);
118 extern void writechr(char data);
119 extern void crlf(void);
120 extern int pollchar(void);
121 extern char getchar(char *hi);
123 extern void cleanup_hardware(void);
124 extern void sirq_cleanup(void);
125 extern void adjust_screen(void);
127 extern void execute(const char *cmdline, uint32_t type, bool sysappend);
128 extern void load_kernel(const char *cmdline);
130 extern void dmi_init(void);
132 extern void do_sysappend(char *buf);
134 extern void load_env32(com32sys_t *regs);
136 #endif /* CORE_H */