X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2Fx86-linux-os.c;h=5b55fdc3792c1e779d1aace0adf5878716635bac;hb=5e92e9ed61903658015c2a75c79a32ad41dbd29d;hp=336dc5ba5b5593e60d9fdfeb8e7d41ee562b461a;hpb=79cc569a97e444389350ea3f5b1017374fe16bec;p=sbcl.git diff --git a/src/runtime/x86-linux-os.c b/src/runtime/x86-linux-os.c index 336dc5b..5b55fdc 100644 --- a/src/runtime/x86-linux-os.c +++ b/src/runtime/x86-linux-os.c @@ -40,7 +40,7 @@ #include #include #include -#include +#include #include #include #include "thread.h" /* dynamic_values_bytes */ @@ -49,7 +49,11 @@ #define user_desc modify_ldt_ldt_s #endif -_syscall3(int, modify_ldt, int, func, void *, ptr, unsigned long, bytecount ); +#define modify_ldt sbcl_modify_ldt +static inline int modify_ldt (int func, void *ptr, unsigned long bytecount) +{ + return syscall (SYS_modify_ldt, func, ptr, bytecount); +} #include "validate.h" size_t os_vm_page_size; @@ -94,7 +98,7 @@ int arch_os_thread_init(struct thread *thread) { if (modify_ldt (1, &ldt_entry, sizeof (ldt_entry)) != 0) { modify_ldt_lock=0; /* modify_ldt call failed: something magical is not happening */ - return -1; + return 0; } __asm__ __volatile__ ("movw %w0, %%fs" : : "q" ((n << 3) /* selector number */ @@ -113,10 +117,8 @@ int arch_os_thread_init(struct thread *thread) { sigstack.ss_sp=((void *) thread)+dynamic_values_bytes; sigstack.ss_flags=0; sigstack.ss_size = 32*SIGSTKSZ; - sigaltstack(&sigstack,0); - if(sigaltstack(&sigstack,0)<0) { + if(sigaltstack(&sigstack,0)<0) lose("Cannot sigaltstack: %s\n",strerror(errno)); - } #endif return 1; } @@ -124,7 +126,7 @@ int arch_os_thread_init(struct thread *thread) { struct thread *debug_get_fs() { register u32 fs; __asm__ __volatile__ ("movl %%fs,%0" : "=r" (fs) : ); - return fs; + return (struct thread *)fs; } /* free any arch/os-specific resources used by thread, which is now @@ -213,4 +215,3 @@ void os_flush_icache(os_vm_address_t address, os_vm_size_t length) { } -