Adding upstream version 6.01~pre5+dfsg.
[syslinux-debian/hramrach.git] / core / include / core.h
blob127ac6561009acb43029b523ac085d2dd48824f7
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 #define __lowmem __attribute__((nocommon,section(".lowmem")))
96 #define __bss16 __attribute__((nocommon,section(".bss16")))
99 * Helper routine to return a specific set of flags
101 static inline void set_flags(com32sys_t *regs, uint32_t flags)
103 uint32_t eflags;
105 eflags = regs->eflags.l;
106 eflags &= ~(EFLAGS_CF|EFLAGS_PF|EFLAGS_AF|EFLAGS_ZF|EFLAGS_SF|EFLAGS_OF);
107 eflags |= flags;
108 regs->eflags.l = eflags;
111 extern int start_ldlinux(int argc, char **argv);
112 extern int create_args_and_load(char *);
114 extern void write_serial(char data);
115 extern void writestr(char *str);
116 extern void writechr(char data);
117 extern void crlf(void);
118 extern int pollchar(void);
119 extern char getchar(char *hi);
121 extern void cleanup_hardware(void);
122 extern void sirq_cleanup(void);
123 extern void adjust_screen(void);
125 extern void execute(const char *cmdline, uint32_t type, bool sysappend);
126 extern void load_kernel(const char *cmdline);
128 extern void dmi_init(void);
130 extern void do_sysappend(char *buf);
132 extern void load_env32(com32sys_t *regs);
134 #endif /* CORE_H */