Add x86bios_set_intr() to set interrupt vectors for real mode and simplify

x86bios_get_intr() a little.
This commit is contained in:
Jung-uk Kim 2010-08-25 21:03:50 +00:00
parent bc339276fb
commit 97e6525d6a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=211824
2 changed files with 15 additions and 3 deletions

View File

@ -203,6 +203,13 @@ x86bios_get_intr(int intno)
return (readl(BIOS_PADDRTOVADDR(intno * 4)));
}
void
x86bios_set_intr(int intno, uint32_t saddr)
{
writel(BIOS_PADDRTOVADDR(intno * 4), saddr);
}
void
x86bios_intr(struct x86regs *regs, int intno)
{
@ -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)));
}
return (le32toh(*iv));
void
x86bios_set_intr(int intno, uint32_t saddr)
{
*((uint32_t *)x86bios_ivt + intno) = htole32(saddr);
}
void

View File

@ -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_ */