x86bios.c (197444) | x86bios.c (197466) |
---|---|
1/*- 2 * Written by paradox <ddkprog@yahoo.com> 3 * Public domain. 4 */ 5 6#include <sys/cdefs.h> | 1/*- 2 * Written by paradox <ddkprog@yahoo.com> 3 * Public domain. 4 */ 5 6#include <sys/cdefs.h> |
7__FBSDID("$FreeBSD: head/sys/compat/x86bios/x86bios.c 197444 2009-09-23 20:49:14Z jkim $"); | 7__FBSDID("$FreeBSD: head/sys/compat/x86bios/x86bios.c 197466 2009-09-24 19:24:42Z jkim $"); |
8 9#include "opt_x86bios.h" 10 11#include <sys/param.h> 12#include <sys/kernel.h> 13#include <sys/lock.h> 14#include <sys/module.h> 15#include <sys/mutex.h> --- 70 unchanged lines hidden (view full) --- 86{ 87 88 if (port >= 0x80 && port < 0x88) /* POST status register */ 89 return; 90 outl(port, val); 91} 92 93void | 8 9#include "opt_x86bios.h" 10 11#include <sys/param.h> 12#include <sys/kernel.h> 13#include <sys/lock.h> 14#include <sys/module.h> 15#include <sys/mutex.h> --- 70 unchanged lines hidden (view full) --- 86{ 87 88 if (port >= 0x80 && port < 0x88) /* POST status register */ 89 return; 90 outl(port, val); 91} 92 93void |
94x86biosCall(struct x86regs *regs, int intno) | 94x86bios_intr(struct x86regs *regs, int intno) |
95{ 96 97 if (intno < 0 || intno > 255) 98 return; 99 100 mtx_lock_spin(&x86bios_lock); 101 102 memcpy(&x86bios_emu.x86, regs, sizeof(*regs)); 103 x86emu_exec_intr(&x86bios_emu, intno); 104 memcpy(regs, &x86bios_emu.x86, sizeof(*regs)); 105 106 mtx_unlock_spin(&x86bios_lock); 107} 108 109void * | 95{ 96 97 if (intno < 0 || intno > 255) 98 return; 99 100 mtx_lock_spin(&x86bios_lock); 101 102 memcpy(&x86bios_emu.x86, regs, sizeof(*regs)); 103 x86emu_exec_intr(&x86bios_emu, intno); 104 memcpy(regs, &x86bios_emu.x86, sizeof(*regs)); 105 106 mtx_unlock_spin(&x86bios_lock); 107} 108 109void * |
110x86biosOffs(uint32_t offs) | 110x86bios_offset(uint32_t offs) |
111{ 112 113 return (pbiosMem + offs); 114} 115 116static void 117x86bios_init(void *arg __unused) 118{ --- 14 unchanged lines hidden (view full) --- 133 x86bios_emu.emu_outw = x86bios_emu_outw; 134 x86bios_emu.emu_outl = x86bios_emu_outl; 135 136 x86bios_emu.mem_base = (char *)pbiosMem; 137 x86bios_emu.mem_size = 1024 * 1024; 138 139 memset(busySegMap, 0, sizeof(busySegMap)); 140 | 111{ 112 113 return (pbiosMem + offs); 114} 115 116static void 117x86bios_init(void *arg __unused) 118{ --- 14 unchanged lines hidden (view full) --- 133 x86bios_emu.emu_outw = x86bios_emu_outw; 134 x86bios_emu.emu_outl = x86bios_emu_outl; 135 136 x86bios_emu.mem_base = (char *)pbiosMem; 137 x86bios_emu.mem_size = 1024 * 1024; 138 139 memset(busySegMap, 0, sizeof(busySegMap)); 140 |
141 pbiosStack = x86biosAlloc(1, &offs); | 141 pbiosStack = x86bios_alloc(1, &offs); |
142} 143 144static void 145x86bios_uninit(void *arg __unused) 146{ 147 | 142} 143 144static void 145x86bios_uninit(void *arg __unused) 146{ 147 |
148 x86biosFree(pbiosStack, 1); | 148 x86bios_free(pbiosStack, 1); |
149 150 if (pbiosMem) 151 pmap_unmapdev((vm_offset_t)pbiosMem, 152 MAPPED_MEMORY_SIZE); 153 154 mtx_destroy(&x86bios_lock); 155} 156 --- 28 unchanged lines hidden --- | 149 150 if (pbiosMem) 151 pmap_unmapdev((vm_offset_t)pbiosMem, 152 MAPPED_MEMORY_SIZE); 153 154 mtx_destroy(&x86bios_lock); 155} 156 --- 28 unchanged lines hidden --- |