From 3bbf3512ad7013aa2d4ddefeb15597aa5771ccc8 Mon Sep 17 00:00:00 2001 From: Peter Wemm Date: Tue, 26 Apr 2005 20:51:15 +0000 Subject: [PATCH] Provide stub functions for i386_set_ldt() and i386_get_ldt() even when compiling as an amd64 support binary. They will return EINVAL on an amd64 kernel, but this simplifies other #ifdefs that were getting a bit nasty. --- lib/libc/i386/gen/_set_tp.c | 4 ---- lib/libc/i386/sys/Makefile.inc | 7 ++++--- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/lib/libc/i386/gen/_set_tp.c b/lib/libc/i386/gen/_set_tp.c index a9fdae81c38..9b76fa20aec 100644 --- a/lib/libc/i386/gen/_set_tp.c +++ b/lib/libc/i386/gen/_set_tp.c @@ -34,7 +34,6 @@ void _set_tp(void *tp) { -#ifndef COMPAT_32BIT union descriptor ldt; int error, sel; @@ -53,7 +52,4 @@ _set_tp(void *tp) ldt.sd.sd_hibase = (((uintptr_t)tp) >> 24) & 0xff; sel = i386_set_ldt(LDT_AUTO_ALLOC, &ldt, 1); __asm __volatile("movl %0,%%gs" : : "rm" ((sel << 3) | 7)); -#else - i386_set_gsbase(tp); -#endif } diff --git a/lib/libc/i386/sys/Makefile.inc b/lib/libc/i386/sys/Makefile.inc index fbd3b55b936..ca487a6d311 100644 --- a/lib/libc/i386/sys/Makefile.inc +++ b/lib/libc/i386/sys/Makefile.inc @@ -2,10 +2,11 @@ # $FreeBSD$ .if !defined(COMPAT_32BIT) -SRCS+= i386_clr_watch.c i386_get_ioperm.c i386_get_ldt.c i386_set_ioperm.c \ - i386_set_ldt.c i386_set_watch.c i386_vm86.c +SRCS+= i386_clr_watch.c i386_get_ioperm.c \ + i386_set_ioperm.c i386_set_watch.c i386_vm86.c .endif -SRCS+= i386_get_fsbase.c i386_get_gsbase.c i386_set_fsbase.c i386_set_gsbase.c +SRCS+= i386_get_fsbase.c i386_get_gsbase.c i386_get_ldt.c \ + i386_set_fsbase.c i386_set_gsbase.c i386_set_ldt.c MDASM= Ovfork.S brk.S cerror.S exect.S getcontext.S pipe.S ptrace.S \ reboot.S sbrk.S setlogin.S sigreturn.S syscall.S