return stack_hop((u32)op, GET_SEG(SS), __send_disk_op);
}
-
-
-/****************************************************************
- * Setup
- ****************************************************************/
-
-void
-drive_setup(void)
-{
- memset(&Drives, 0, sizeof(Drives));
-}
{
if (!CONFIG_CDROM_EMU)
return;
- cdemu_drive_gf = NULL;
- cdemu_buf_fl = NULL;
if (!Drives.cdcount)
return;
u32 ticks = (hours * 60 + minutes) * 60 + seconds;
ticks = ((u64)ticks * PIT_TICK_RATE) / PIT_TICK_INTERVAL;
SET_BDA(timer_counter, ticks);
- SET_BDA(timer_rollover, 0);
enable_hwirq(0, FUNC16(entry_08));
enable_hwirq(8, FUNC16(entry_70));
{
dprintf(3, "Attempting to find coreboot table\n");
- CBMemTable = NULL;
-
// Find coreboot table.
struct cb_header *cbh = find_cb_header(0, 0x1000);
if (!cbh)
dprintf(3, "Relocating coreboot bios tables\n");
- // Init variables set in coreboot table memory scan.
- PirOffset = 0;
- RsdpAddr = 0;
-
// Scan CB_MEM_TABLE areas for bios tables.
int i, count = MEM_RANGE_COUNT(cbm);
for (i=0; i<count; i++) {
void map_cd_drive(struct drive_s *drive_g);
int process_op(struct disk_op_s *op);
int send_disk_op(struct disk_op_s *op);
-void drive_setup(void);
// floppy.c
extern struct floppy_ext_dbt_s diskette_param_table2;
//dump_map();
}
-// Prep for memmap stuff - init bios table locations.
-void
-memmap_setup(void)
-{
- e820_count = 0;
-}
-
// Report on final memory locations.
void
memmap_finalize(void)
};
void add_e820(u64 start, u64 size, u32 type);
-void memmap_setup(void);
void memmap_finalize(void);
// A typical OS page size
#define PCIROM_CODETYPE_X86 0
// The end of the last deployed rom.
-u32 RomEnd;
+u32 RomEnd = BUILD_ROM_START;
/****************************************************************
void
vga_setup(void)
{
- VGAbdf = -1;
- RomEnd = BUILD_ROM_START;
-
if (! CONFIG_OPTIONROMS)
return;
ASSERT32FLAT();
dprintf(3, "malloc setup\n");
- ZoneLow.info = ZoneHigh.info = ZoneFSeg.info = NULL;
- ZoneTmpLow.info = ZoneTmpHigh.info = NULL;
-
- // Clear memory in 0xf0000 area.
- memset(BiosTableSpace, 0, CONFIG_MAX_BIOSTABLE);
-
// Populate temp high ram
u32 highram = 0;
int i;
init_bda();
// Init base pc hardware.
- thread_setup();
pic_setup();
timer_setup();
mathcp_setup();
// Initialize mtrr
- smp_probe_setup();
mtrr_setup();
// Initialize pci
// Initialize internal tables
boot_setup();
- drive_setup();
// Start hardware initialization (if optionrom threading)
if (CONFIG_THREADS && CONFIG_THREAD_OPTIONROMS)
post(void)
{
// Detect ram and setup internal malloc.
- memmap_setup();
qemu_cfg_port_probe();
ram_probe();
malloc_setup();
dprintf(1, "Found %d cpu(s) max supported %d cpu(s)\n", readl(&CountCPUs),
MaxCountCPUs);
}
-
-// Reset variables to zero
-void
-smp_probe_setup(void)
-{
- CountCPUs = 0;
- smp_mtrr_count = 0;
-}
void *stackpos;
struct thread_info **pprev;
};
-struct thread_info VAR16VISIBLE MainThread;
+struct thread_info VAR32FLATVISIBLE MainThread = {
+ &MainThread, NULL, &MainThread.next
+};
/****************************************************************
#define THREADSTACKSIZE 4096
int VAR16VISIBLE CanPreempt;
-void
-thread_setup(void)
-{
- MainThread.next = &MainThread;
- MainThread.pprev = &MainThread.next;
- MainThread.stackpos = NULL;
- CanPreempt = 0;
-}
-
// Return the 'struct thread_info' for the currently running thread.
struct thread_info *
getCurThread(void)
{
if (! CONFIG_THREADS || ! CONFIG_THREAD_OPTIONROMS
|| !GET_GLOBAL(CanPreempt)
- || GET_GLOBAL(MainThread.next) == &MainThread)
+ || GET_FLATPTR(MainThread.next) == &MainThread)
return;
call32(yield_preempt);
return -1;
}
-void
-usb_hid_setup(void)
-{
- if (CONFIG_USB_KEYBOARD)
- keyboard_pipe = NULL;
- if (CONFIG_USB_MOUSE)
- mouse_pipe = NULL;
-}
-
/****************************************************************
* Keyboard events
struct usb_pipe;
int usb_hid_init(struct usb_pipe *pipe
, struct usb_interface_descriptor *iface, int imax);
-void usb_hid_setup(void);
inline int usb_kbd_active(void);
inline int usb_kbd_command(int command, u8 *param);
inline int usb_mouse_active(void);
dprintf(3, "init usb\n");
- usb_hid_setup();
-
// Look for USB controllers
int ehcibdf = -1;
int count = 0;
// stacks.c
inline u32 stack_hop(u32 eax, u32 edx, void *func);
extern struct thread_info MainThread;
-void thread_setup(void);
struct thread_info *getCurThread(void);
void yield(void);
void wait_irq(void);
extern u32 MaxCountCPUs;
void wrmsr_smp(u32 index, u64 val);
void smp_probe(void);
-void smp_probe_setup(void);
// coreboot.c
struct cbfs_file;
#include "config.h" // CONFIG_*
// The Bus/Dev/Fn of the primary VGA device.
-int VGAbdf VAR16VISIBLE;
+int VGAbdf VAR16VISIBLE = -1;
// Coreboot board detected.
int CBmainboard VAR16VISIBLE;
if (! CONFIG_VGAHOOKS)
return;
- CBmainboard = 0;
for (i=0; i<(sizeof(mainboard_list) / sizeof(mainboard_list[0])); i++) {
if (!strcmp(vendor, mainboard_list[i].vendor) &&
!strcmp(part, mainboard_list[i].device)) {
- printf("Found mainboard %s %s\n", vendor, part);
+ printf("Found mainboard %s %s\n", vendor, part);
CBmainboard = mainboard_list[i].type;
break;
}