Changeset 10969


Ignore:
Timestamp:
Oct 4, 2008, 12:36:44 AM (11 years ago)
Author:
gb
Message:

If LOWMEM_BIAS isn't defined (via -D) on the C/m4 command-line, default it
to 0. Try to ensure that all constants that define addresses relative
to NIL (nil/t/lisp-globals/nrs/spjump) are defined in terms of LOWMEM_BIAS.

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

Legend:

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

    r10565 r10969  
    2121
    2222#include "lisptypes.h"
     23#ifndef LOWMEM_BIAS
     24#define LOWMEM_BIAS 0
     25#endif
    2326
    2427#ifdef PPC
  • trunk/source/lisp-kernel/lisp.s

    r4315 r10969  
    1414
    1515        include(m4macros.m4)
     16        ifdef([LOWMEM_BIAS],[
     17[LOWMEM_BIAS] = LOWMEM_BIAS
     18],[
     19[LOWMEM_BIAS] = 0
     20])
     21        undefine([LOWMEM_BIAS])                               
    1622        ifdef([PPC],[
    1723         include(ppc-constants.s)
  • trunk/source/lisp-kernel/lisp_globals.h

    r10084 r10969  
    7474#ifdef PPC
    7575#ifdef PPC64
    76 #define lisp_global(g) (((LispObj *) 0x3000)[(g)])
    77 #define nrs_symbol(s) (((lispsymbol *) 0x3000)[(s)])
     76#define lisp_global(g) (((LispObj *) (0x3000+(LOWMEM_BIAS)))[(g)])
     77#define nrs_symbol(s) (((lispsymbol *) (0x3000+(LOWMEM_BIAS)))[(s)])
    7878#else
    7979#define lisp_global(g) (((LispObj *) (nil_value-fulltag_nil))[(g)])
     
    8383
    8484#ifdef X8664
    85 #define lisp_global(g) (((LispObj *) 0x13000)[(g)])
    86 #define nrs_symbol(s) (((lispsymbol *) 0x13020)[(s)])
     85#define lisp_global(g) (((LispObj *) (0x13000+(LOWMEM_BIAS)))[(g)])
     86#define nrs_symbol(s) (((lispsymbol *) (0x13020+(LOWMEM_BIAS)))[(s)])
    8787#endif
    8888
    8989#ifdef X8632
    90 #define lisp_global(g) (((LispObj *) 0x13000)[(g)])
    91 #define nrs_symbol(s) (((lispsymbol *) 0x13008)[(s)])
     90#define lisp_global(g) (((LispObj *) (0x13000+(LOWMEM_BIAS)))[(g)])
     91#define nrs_symbol(s) (((lispsymbol *) (0x13008+(LOWMEM_BIAS)))[(s)])
    9292#endif
    9393
  • trunk/source/lisp-kernel/ppc-constants32.h

    r10731 r10969  
    422422
    423423
    424 #define nil_value 0x00003015
     424#define nil_value (0x00003015+(LOWMEM_BIAS))
    425425
    426426#define TCR_BIAS (0)
  • trunk/source/lisp-kernel/ppc-constants32.s

    r7624 r10969  
    7676fulltag_immheader = 7   /* Header of heap-allocated object that contains unboxed data. */
    7777
    78 nil_value = 0x00003015
     78nil_value = 0x00003015+LOWMEM_BIAS
    7979misc_bias = fulltag_misc
    8080cons_bias = tag_list       
     
    682682define([RESERVATION_DISCHARGE],0x2004)
    683683
    684 lisp_globals_limit = 0x3010
     684lisp_globals_limit = (0x3010+(LOWMEM_BIAS))
    685685       
    686686INTERRUPT_LEVEL_BINDING_INDEX = fixnumone
  • trunk/source/lisp-kernel/ppc-constants64.h

    r10731 r10969  
    133133
    134134
    135 #define nil_value (0x3000+fulltag_misc+sizeof(struct lispsymbol))
    136 #define t_value (0x3000+fulltag_misc)   
     135#define nil_value (0x3000+fulltag_misc+sizeof(struct lispsymbol)+(LOWMEM_BIAS))
     136#define t_value (0x3000+fulltag_misc+(LOWMEM_BIAS))     
    137137#define misc_bias fulltag_misc
    138138#define cons_bias fulltag_cons
  • trunk/source/lisp-kernel/ppc-constants64.s

    r7624 r10969  
    334334
    335335       
    336         _struct(nrs,0x3000)
     336        _struct(nrs,(0x3000+(LOWMEM_BIAS)))
    337337         _struct_pad(fulltag_misc)
    338338         _struct_label(tsym)
     
    586586
    587587
    588 nil_value = 0x3000+symbol.size+fulltag_misc       
     588nil_value = (0x3000+symbol.size+fulltag_misc+(LOWMEM_BIAS))
    589589               
    590 define([RESERVATION_DISCHARGE],0x2008)
    591 
    592 lisp_globals_limit = 0x3000
     590define([RESERVATION_DISCHARGE],(0x2008+(LOWMEM_BIAS))
     591
     592lisp_globals_limit = (0x3000+(LOWMEM_BIAS))
    593593       
    594594INTERRUPT_LEVEL_BINDING_INDEX = fixnumone
  • trunk/source/lisp-kernel/x86-constants32.h

    r10931 r10969  
    458458} TCR;
    459459
    460 #define nil_value (0x13000 + (fulltag_cons))
    461 #define t_value (0x13008 + (fulltag_misc))
     460#define nil_value ((0x13000 + (fulltag_cons))+(LOWMEM_BIAS))
     461#define t_value ((0x13008 + (fulltag_misc))+(LOWMEM_BIAS))
    462462#define t_offset (t_value-nil_value)
    463463#define misc_header_offset -fulltag_misc
  • trunk/source/lisp-kernel/x86-constants32.s

    r10932 r10969  
    202202misc_dfloat_offset = misc_header_offset+8
    203203
    204 nil_value = (0x13000 + fulltag_cons)
    205 t_value = (0x13008 + fulltag_misc)
     204nil_value = ((0x13000 + fulltag_cons)+(LOWMEM_BIAS))
     205t_value = ((0x13008 + fulltag_misc)+(LOWMEM_BIAS))
    206206t_offset = (t_value-nil_value)
    207207misc_bias = fulltag_misc
     
    309309symbol_extra = symbol.size-fulltag_misc
    310310
    311         _struct(nrs,0x13008)
     311        _struct(nrs,(0x13008+(LOWMEM_BIAS)))
    312312         _struct_pad(fulltag_misc)
    313313         _struct_label(tsym)
     
    613613call_arguments_limit = 8192
    614614
    615 lisp_globals_limit = 0x13000
     615lisp_globals_limit = (0x13000+(LOWMEM_BIAS))
    616616       
    617617INTERRUPT_LEVEL_BINDING_INDEX = fixnumone
  • trunk/source/lisp-kernel/x86-constants64.h

    r10731 r10969  
    219219
    220220
    221 #define nil_value (0x13000+fulltag_nil)
    222 #define t_value (0x13020+fulltag_symbol)       
     221#define nil_value ((0x13000+fulltag_nil)+(LOWMEM_BIAS))
     222#define t_value ((0x13020+fulltag_symbol)+(LOWMEM_BIAS))
    223223#define misc_bias fulltag_misc
    224224#define cons_bias fulltag_cons
  • trunk/source/lisp-kernel/x86-exceptions.c

    r10935 r10969  
    792792#endif
    793793
     794
    794795  if (addr && (addr == tcr->safe_ref_address)) {
    795796    xpGPR(xp,Iimm0) = 0;
     
    817818    if ((fulltag_of(cmain) == fulltag_misc) &&
    818819      (header_subtag(header_of(cmain)) == subtag_macptr)) {
     820      Bug(xp,"fault");
    819821      xcf = create_exception_callback_frame(xp, tcr);
    820822      callback_to_lisp(tcr, cmain, xp, xcf, SIGBUS, is_write_fault(xp,info), (natural)addr, 0);
Note: See TracChangeset for help on using the changeset viewer.