diff options
author | peter <peter@FreeBSD.org> | 2002-09-22 04:45:21 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 2002-09-22 04:45:21 +0000 |
commit | e8f9ac26c88b71174cb2ec87c856bbf2da81f7c2 (patch) | |
tree | 336b9c28a5372b15800f7164f37383e1df6435de /sys/amd64 | |
parent | 8dcc127f8742522e0fd59452b76ce27383488a90 (diff) | |
download | FreeBSD-src-e8f9ac26c88b71174cb2ec87c856bbf2da81f7c2.zip FreeBSD-src-e8f9ac26c88b71174cb2ec87c856bbf2da81f7c2.tar.gz |
Create inlines for ltr(sel), lldt(sel), lidt(addr) rather than
functions that have one instruction.
Diffstat (limited to 'sys/amd64')
-rw-r--r-- | sys/amd64/amd64/support.S | 22 | ||||
-rw-r--r-- | sys/amd64/amd64/support.s | 22 | ||||
-rw-r--r-- | sys/amd64/include/cpufunc.h | 27 | ||||
-rw-r--r-- | sys/amd64/include/segments.h | 2 |
4 files changed, 26 insertions, 47 deletions
diff --git a/sys/amd64/amd64/support.S b/sys/amd64/amd64/support.S index 6e3286e..5e57315 100644 --- a/sys/amd64/amd64/support.S +++ b/sys/amd64/amd64/support.S @@ -1553,28 +1553,6 @@ ENTRY(lgdt) movl $KCSEL,4(%esp) lret -/* - * void lidt(struct region_descriptor *rdp); - */ -ENTRY(lidt) - movl 4(%esp),%eax - lidt (%eax) - ret - -/* - * void lldt(u_short sel) - */ -ENTRY(lldt) - lldt 4(%esp) - ret - -/* - * void ltr(u_short sel) - */ -ENTRY(ltr) - ltr 4(%esp) - ret - /* ssdtosd(*ssdp,*sdp) */ ENTRY(ssdtosd) pushl %ebx diff --git a/sys/amd64/amd64/support.s b/sys/amd64/amd64/support.s index 6e3286e..5e57315 100644 --- a/sys/amd64/amd64/support.s +++ b/sys/amd64/amd64/support.s @@ -1553,28 +1553,6 @@ ENTRY(lgdt) movl $KCSEL,4(%esp) lret -/* - * void lidt(struct region_descriptor *rdp); - */ -ENTRY(lidt) - movl 4(%esp),%eax - lidt (%eax) - ret - -/* - * void lldt(u_short sel) - */ -ENTRY(lldt) - lldt 4(%esp) - ret - -/* - * void ltr(u_short sel) - */ -ENTRY(ltr) - ltr 4(%esp) - ret - /* ssdtosd(*ssdp,*sdp) */ ENTRY(ssdtosd) pushl %ebx diff --git a/sys/amd64/include/cpufunc.h b/sys/amd64/include/cpufunc.h index 1c4806f..c7f9ace 100644 --- a/sys/amd64/include/cpufunc.h +++ b/sys/amd64/include/cpufunc.h @@ -46,6 +46,7 @@ #include <machine/psl.h> struct thread; +struct region_descriptor; __BEGIN_DECLS #define readb(va) (*(volatile u_int8_t *) (va)) @@ -468,6 +469,27 @@ load_gs(u_int sel) __asm __volatile("movl %0,%%gs" : : "rm" (sel)); } +/* void lidt(struct region_descriptor *addr); */ +static __inline void +lidt(struct region_descriptor *addr) +{ + __asm __volatile("lidt (%0)" : : "r" (addr)); +} + +/* void lldt(u_short sel); */ +static __inline void +lldt(u_short sel) +{ + __asm __volatile("lldt %0" : : "r" (sel)); +} + +/* void ltr(u_short sel); */ +static __inline void +ltr(u_short sel) +{ + __asm __volatile("ltr %0" : : "r" (sel)); +} + static __inline u_int rdr0(void) { @@ -622,6 +644,10 @@ void load_cr3(u_int cr3); void load_cr4(u_int cr4); void load_fs(u_int sel); void load_gs(u_int sel); +struct region_descriptor; +void lidt(struct region_descriptor *addr); +void lldt(u_short sel); +void ltr(u_short sel); void outb(u_int port, u_char data); void outl(u_int port, u_int data); void outsb(u_int port, void *addr, size_t cnt); @@ -663,7 +689,6 @@ void intr_restore(register_t ef); #endif /* __GNUC__ */ -void ltr(u_short sel); void reset_dbregs(void); __END_DECLS diff --git a/sys/amd64/include/segments.h b/sys/amd64/include/segments.h index fb5f76c..9f1f638 100644 --- a/sys/amd64/include/segments.h +++ b/sys/amd64/include/segments.h @@ -248,8 +248,6 @@ extern struct gate_descriptor *idt; extern union descriptor ldt[NLDT]; void lgdt(struct region_descriptor *rdp); -void lidt(struct region_descriptor *rdp); -void lldt(u_short sel); void sdtossd(struct segment_descriptor *sdp, struct soft_segment_descriptor *ssdp); void ssdtosd(struct soft_segment_descriptor *ssdp, |