Changeset 11015


Ignore:
Timestamp:
Oct 8, 2008, 9:51:36 AM (12 years ago)
Author:
gb
Message:

FreeBSD x8632 changes.

Location:
trunk/source/lisp-kernel
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/lisp-kernel/area.h

    r10970 r11015  
    160160#endif
    161161#ifdef FREEBSD
     162#ifdef X8664
    162163#define IMAGE_BASE_ADDRESS 0x300000000000L /* 0x100000000L */
     164#else
     165#define IMAGE_BASE_ADDRESS 0x10000000
     166#endif
    163167#endif
    164168#ifdef SOLARIS
  • trunk/source/lisp-kernel/lisp-debug.c

    r10886 r11015  
    164164char *Iregnames[] = {"edi", "esi", "ebx", "edx", "ecx", "eax",
    165165                     "ebp", "eip", "???", "efl", "esp"};
     166#endif
     167#ifdef FREEBSD
     168char *Iregnames[] = {"???", "???", "???", "???", "???"
     169                     "edi", "esi", "ebp", "ebx", "edx",
     170                     "ecx", "eax", "???", "???", "eip",
     171                     "???", "efl", "esp"};
    166172#endif
    167173#endif
  • trunk/source/lisp-kernel/pmcl-kernel.c

    r11012 r11015  
    408408#endif
    409409#ifdef WINDOWS
     410#define MAXIMUM_MAPPABLE_MEMORY (1U<<30)
     411#endif
     412#ifdef FREEBSD
    410413#define MAXIMUM_MAPPABLE_MEMORY (1U<<30)
    411414#endif
  • trunk/source/lisp-kernel/thread_manager.c

    r10953 r11015  
    857857
    858858#ifdef X8632
     859
    859860#ifdef DARWIN
    860861#include <architecture/i386/table.h>
     
    974975
    975976  pthread_mutex_lock(&ldt_lock);
    976   /* load %fs with null segement selector */
     977  /* load %fs with null segment selector */
    977978  __asm__ volatile ("mov %0,%%fs" : : "r"(0));
    978979  tcr->ldt_selector = 0;
     
    10961097}
    10971098
     1099#endif
     1100#ifdef FREEBSD
     1101#include <machine/segments.h>
     1102#include <machine/sysarch.h>
     1103
     1104/* It'd be tempting to use i386_set_fsbase() here, but there doesn't
     1105   seem to be any way to free the GDT entry it creates. */
     1106void
     1107setup_tcr_extra_segment(TCR *tcr)
     1108{
     1109  struct segment_descriptor sd;
     1110  uintptr_t addr = (uintptr_t)tcr;
     1111  unsigned int size = sizeof(*tcr);
     1112  int i;
     1113
     1114  sd.sd_lolimit = (size - 1) & 0xffff;
     1115  sd.sd_hilimit = ((size - 1) >> 16) & 0xf;
     1116  sd.sd_lobase = addr & ((1<<24)-1);
     1117  sd.sd_type = 18;
     1118  sd.sd_dpl = SEL_UPL;
     1119  sd.sd_p = 1;
     1120  sd.sd_def32 = 1;
     1121  sd.sd_gran = 0;
     1122
     1123  i = i386_set_ldt(LDT_AUTO_ALLOC, (union descriptor *)&sd, 1);
     1124
     1125  if (i < 0) {
     1126    perror("i386_set_ldt");
     1127  } else {
     1128    tcr->ldt_selector = LSEL(i,SEL_UPL);
     1129  }
     1130}
     1131
     1132void
     1133free_tcr_extra_segment(TCR *tcr)
     1134{
     1135  int idx = tcr->ldt_selector >> 3;
     1136  /* load %fs with null segment selector */
     1137  __asm__ volatile ("mov %0,%%fs" : : "r"(0));
     1138  if (i386_set_ldt(idx, NULL, 1) < 0)
     1139    perror("i386_set_ldt");
     1140  tcr->ldt_selector = 0;
     1141}
    10981142#endif
    10991143#endif
  • trunk/source/lisp-kernel/x86-asmutils32.s

    r11010 r11015  
    170170_endfn
    171171
     172_exportfn(C(freebsd_sigreturn))
     173        __(movl $417,%eax)      /* SYS_sigreturn */
     174        __(int $80)                             
     175_endfn
     176               
    172177_exportfn(C(get_vector_registers))
    173178        __(ret)
  • trunk/source/lisp-kernel/x86-constants32.h

    r10969 r11015  
    2525#define REG_EFL 9
    2626#define REG_ESP 10
     27#endif
     28
     29#ifdef FREEBSD
     30#define REG_EDI 5
     31#define REG_ESI 6
     32#define REG_EBP 7
     33#define REG_ISP 8
     34#define REG_EBX 9
     35#define REG_EDX 10
     36#define REG_ECX 11
     37#define REG_EAX 12
     38#define REG_EIP 15
     39#define REG_EFL 17
     40#define REG_ESP 19
    2741#endif
    2842
  • trunk/source/lisp-kernel/x86-exceptions.c

    r11008 r11015  
    783783{
    784784#ifdef FREEBSD
     785#ifdef X8664
    785786  BytePtr addr = (BytePtr) xp->uc_mcontext.mc_addr;
     787#else
     788  BytePtr addr = (BytePtr) info->si_addr;
     789#endif
    786790#else
    787791#ifdef WINDOWS
     
    922926{
    923927  if (info->si_code == 0) {
     928#ifdef X8664
    924929    struct savefpu *fpu = (struct savefpu *) &(xp->uc_mcontext.mc_fpstate);
     930#else
     931    struct savexmm *fpu = (struct savexmm *) &(xp->uc_mcontext.mc_fpstate);
     932#endif
    925933    uint32_t mxcsr = fpu->sv_env.en_mxcsr;
    926934
  • trunk/source/lisp-kernel/x86-exceptions.h

    r10955 r11015  
    5555#ifdef X8664
    5656#include <machine/fpu.h>
     57#else
     58#include <machine/npx.h>
     59#endif
    5760#define xpGPRvector(x) ((natural *)(&((x)->uc_mcontext)))
    5861#define xpGPR(x,gprno) (xpGPRvector(x)[gprno])
     
    6063#define eflags_register(xp) xpGPR(xp,Iflags)
    6164#define xpPC(x) xpGPR(x,Iip)
     65#ifdef X8664
    6266#define xpMMXreg(x,n) *((natural *)(&(((struct savefpu *)(&(x)->uc_mcontext.mc_fpstate))->sv_fp[n])))
    6367#define xpXMMregs(x)(&(((struct savefpu *)(&(x)->uc_mcontext.mc_fpstate))->sv_xmm[0]))
     68#else
     69#define xpMMXreg(x,n) *((natural *)(&(((struct savexmm *)(&(x)->uc_mcontext.mc_fpstate))->sv_fp[n])))
     70#define xpXMMregs(x)(&(((struct savexmm *)(&(x)->uc_mcontext.mc_fpstate))->sv_xmm[0]))
    6471#endif
    6572#endif
Note: See TracChangeset for help on using the changeset viewer.