diff options
author | jkim <jkim@FreeBSD.org> | 2010-08-25 21:03:50 +0000 |
---|---|---|
committer | jkim <jkim@FreeBSD.org> | 2010-08-25 21:03:50 +0000 |
commit | 0117aaf57421a0f4cb653cd2474fef6d2ad17f64 (patch) | |
tree | dcad636f2640e20c81cbebb8f067658f9f494eb4 /sys | |
parent | 8c8d33fe9f90723b010ccc4aa9dc9c2c42f7d85a (diff) | |
download | FreeBSD-src-0117aaf57421a0f4cb653cd2474fef6d2ad17f64.zip FreeBSD-src-0117aaf57421a0f4cb653cd2474fef6d2ad17f64.tar.gz |
Add x86bios_set_intr() to set interrupt vectors for real mode and simplify
x86bios_get_intr() a little.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/compat/x86bios/x86bios.c | 17 | ||||
-rw-r--r-- | sys/compat/x86bios/x86bios.h | 1 |
2 files changed, 15 insertions, 3 deletions
diff --git a/sys/compat/x86bios/x86bios.c b/sys/compat/x86bios/x86bios.c index a8bd69a..465a076 100644 --- a/sys/compat/x86bios/x86bios.c +++ b/sys/compat/x86bios/x86bios.c @@ -204,6 +204,13 @@ x86bios_get_intr(int intno) } void +x86bios_set_intr(int intno, uint32_t saddr) +{ + + writel(BIOS_PADDRTOVADDR(intno * 4), saddr); +} + +void x86bios_intr(struct x86regs *regs, int intno) { struct vm86frame vmf; @@ -619,11 +626,15 @@ x86bios_call(struct x86regs *regs, uint16_t seg, uint16_t off) uint32_t x86bios_get_intr(int intno) { - uint32_t *iv; - iv = (uint32_t *)((vm_offset_t)x86bios_ivt + intno * 4); + return (le32toh(*((uint32_t *)x86bios_ivt + intno))); +} + +void +x86bios_set_intr(int intno, uint32_t saddr) +{ - return (le32toh(*iv)); + *((uint32_t *)x86bios_ivt + intno) = htole32(saddr); } void diff --git a/sys/compat/x86bios/x86bios.h b/sys/compat/x86bios/x86bios.h index f474932..491367d 100644 --- a/sys/compat/x86bios/x86bios.h +++ b/sys/compat/x86bios/x86bios.h @@ -151,6 +151,7 @@ void x86bios_init_regs(struct x86regs *regs); void x86bios_intr(struct x86regs *regs, int intno); int x86bios_match_device(uint32_t offset, device_t dev); void *x86bios_offset(uint32_t offset); +void x86bios_set_intr(int intno, uint32_t saddr); __END_DECLS #endif /* !_X86BIOS_H_ */ |