PERFORCE change 29477 for review
Peter Wemm
peter at FreeBSD.org
Tue Apr 22 20:13:49 PDT 2003
http://perforce.freebsd.org/chv.cgi?CH=29477
Change 29477 by peter at peter_overcee on 2003/04/22 20:13:44
make syscalls reachable from userland. doh!
Affected files ...
.. //depot/projects/hammer/sys/x86_64/include/md_var.h#17 edit
.. //depot/projects/hammer/sys/x86_64/isa/intr_machdep.c#12 edit
.. //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#72 edit
Differences ...
==== //depot/projects/hammer/sys/x86_64/include/md_var.h#17 (text+ko) ====
@@ -68,7 +68,7 @@
void fillw(int /*u_short*/ pat, void *base, size_t cnt);
void pagezero(void *addr);
int is_physical_memory(vm_offset_t addr);
-void setidt(int idx, alias_for_inthand_t *func, int typ, int ist);
+void setidt(int idx, alias_for_inthand_t *func, int typ, int dpl, int ist);
void swi_vm(void *);
#endif /* !_MACHINE_MD_VAR_H_ */
==== //depot/projects/hammer/sys/x86_64/isa/intr_machdep.c#12 (text+ko) ====
@@ -375,7 +375,7 @@
intr_unit[intr] = arg;
setidt(ICU_OFFSET + intr,
flags & INTR_FAST ? fastintr[intr] : slowintr[intr],
- SDT_SYSIGT, 0);
+ SDT_SYSIGT, SEL_KPL, 0);
INTREN(1 << intr);
mtx_unlock_spin(&icu_lock);
intr_restore(crit);
@@ -403,7 +403,7 @@
intr_countp[intr] = &intrcnt[1 + intr];
intr_handler[intr] = isa_strayintr;
intr_unit[intr] = &intr_unit[intr];
- setidt(ICU_OFFSET + intr, slowintr[intr], SDT_SYSIGT, 0);
+ setidt(ICU_OFFSET + intr, slowintr[intr], SDT_SYSIGT, SEL_KPL, 0);
mtx_unlock_spin(&icu_lock);
intr_restore(crit);
return (0);
==== //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#72 (text+ko) ====
@@ -625,10 +625,11 @@
};
void
-setidt(idx, func, typ, ist)
+setidt(idx, func, typ, int dpl, ist)
int idx;
inthand_t *func;
int typ;
+ int dpl;
int ist;
{
struct gate_descriptor *ip;
@@ -639,7 +640,7 @@
ip->gd_ist = ist;
ip->gd_xx = 0;
ip->gd_type = typ;
- ip->gd_dpl = SEL_KPL;
+ ip->gd_dpl = dpl;
ip->gd_p = 1;
ip->gd_hioffset = ((uintptr_t)func)>>16 ;
}
@@ -1193,28 +1194,28 @@
/* exceptions */
for (x = 0; x < NIDT; x++)
- setidt(x, &IDTVEC(rsvd), SDT_SYSTGT, 0);
- setidt(0, &IDTVEC(div), SDT_SYSTGT, 0);
- setidt(1, &IDTVEC(dbg), SDT_SYSIGT, 0);
- setidt(2, &IDTVEC(nmi), SDT_SYSTGT, 0);
- setidt(3, &IDTVEC(bpt), SDT_SYSIGT, 0);
- setidt(4, &IDTVEC(ofl), SDT_SYSTGT, 0);
- setidt(5, &IDTVEC(bnd), SDT_SYSTGT, 0);
- setidt(6, &IDTVEC(ill), SDT_SYSTGT, 0);
- setidt(7, &IDTVEC(dna), SDT_SYSTGT, 0);
- setidt(8, (inthand_t *)dblfault_handler, SDT_SYSIGT, 1);
- setidt(9, &IDTVEC(fpusegm), SDT_SYSTGT, 0);
- setidt(10, &IDTVEC(tss), SDT_SYSTGT, 0);
- setidt(11, &IDTVEC(missing), SDT_SYSTGT, 0);
- setidt(12, &IDTVEC(stk), SDT_SYSTGT, 0);
- setidt(13, &IDTVEC(prot), SDT_SYSTGT, 0);
- setidt(14, &IDTVEC(page), SDT_SYSTGT, 0);
- setidt(15, &IDTVEC(rsvd), SDT_SYSTGT, 0);
- setidt(16, &IDTVEC(fpu), SDT_SYSTGT, 0);
- setidt(17, &IDTVEC(align), SDT_SYSTGT, 0);
- setidt(18, &IDTVEC(mchk), SDT_SYSTGT, 0);
- setidt(19, &IDTVEC(xmm), SDT_SYSTGT, 0);
- setidt(0x80, &IDTVEC(int0x80_syscall), SDT_SYSTGT, 0);
+ setidt(x, &IDTVEC(rsvd), SDT_SYSTGT, SEL_KPL, 0);
+ setidt(0, &IDTVEC(div), SDT_SYSTGT, SEL_KPL, 0);
+ setidt(1, &IDTVEC(dbg), SDT_SYSIGT, SEL_KPL, 0);
+ setidt(2, &IDTVEC(nmi), SDT_SYSTGT, SEL_KPL, 0);
+ setidt(3, &IDTVEC(bpt), SDT_SYSIGT, SEL_KPL, 0);
+ setidt(4, &IDTVEC(ofl), SDT_SYSTGT, SEL_KPL, 0);
+ setidt(5, &IDTVEC(bnd), SDT_SYSTGT, SEL_KPL, 0);
+ setidt(6, &IDTVEC(ill), SDT_SYSTGT, SEL_KPL, 0);
+ setidt(7, &IDTVEC(dna), SDT_SYSTGT, SEL_KPL, 0);
+ setidt(8, (inthand_t *)dblfault_handler, SDT_SYSIGT, SEL_KPL, 1);
+ setidt(9, &IDTVEC(fpusegm), SDT_SYSTGT, SEL_KPL, 0);
+ setidt(10, &IDTVEC(tss), SDT_SYSTGT, SEL_KPL, 0);
+ setidt(11, &IDTVEC(missing), SDT_SYSTGT, SEL_KPL, 0);
+ setidt(12, &IDTVEC(stk), SDT_SYSTGT, SEL_KPL, 0);
+ setidt(13, &IDTVEC(prot), SDT_SYSTGT, SEL_KPL, 0);
+ setidt(14, &IDTVEC(page), SDT_SYSTGT, SEL_KPL, 0);
+ setidt(15, &IDTVEC(rsvd), SDT_SYSTGT, SEL_KPL, 0);
+ setidt(16, &IDTVEC(fpu), SDT_SYSTGT, SEL_KPL, 0);
+ setidt(17, &IDTVEC(align), SDT_SYSTGT, SEL_KPL, 0);
+ setidt(18, &IDTVEC(mchk), SDT_SYSTGT, SEL_KPL, 0);
+ setidt(19, &IDTVEC(xmm), SDT_SYSTGT, SEL_KPL, 0);
+ setidt(0x80, &IDTVEC(int0x80_syscall), SDT_SYSTGT, SEL_UPL, 0);
r_idt.rd_limit = sizeof(idt0) - 1;
r_idt.rd_base = (long) idt;
More information about the p4-projects
mailing list