home *** CD-ROM | disk | FTP | other *** search
/ Team Palmtops 7 / Palmtops_numero07.iso / WinCE / SDKWindowsCE / HandHeldPCPro30 / sdk.exe / Jupiter SDK / data1.cab / Emulation_Include_Files / kxshx.h < prev    next >
Encoding:
Text File  |  1999-02-19  |  2.6 KB  |  116 lines

  1.     .HEADING "Hitachi SH-3 Calling Convention Macros"
  2.     .FORM LINES=55
  3. ;++
  4. ;
  5. ; Copyright (c) 1995-1998 Microsoft Corporation
  6. ;
  7. ; Module Name:
  8. ;
  9. ;    kxsh3.h
  10. ;
  11. ; Abstract:
  12. ;
  13. ;    This is an implementation of Appendix A of WINCE/SH3 Calling Sequence
  14. ;    Specification_.
  15. ;
  16. ;
  17. ; Environment:
  18. ;
  19. ;    Kernel mode or User mode.
  20. ;
  21. ;
  22. ;--
  23.  
  24.     .macro    START_REGION    NameBegin
  25.     .global    \NameBegin
  26. \NameBegin:
  27.     .endm
  28.  
  29.     .macro    END_REGION        NameEnd
  30.     .global    \NameEnd
  31. \NameEnd:
  32.     .endm
  33.  
  34.     .macro    NESTED_ENTRY    Name,Section=.text
  35.     .section \Section,code
  36.     .align    4
  37.     .global    \Name
  38. \Name:    .entry
  39.     .endm
  40.  
  41.     .macro    PROLOG_END
  42.     .prolog
  43.     .endm
  44.  
  45.     .macro    LEAF_ENTRY    Name,Section=.text
  46.     NESTED_ENTRY    \Name,\Section
  47.     PROLOG_END
  48.     .endm
  49.  
  50.     .macro    ALTERNATE_ENTRY    Name,Section=.text
  51.     .global    \Name
  52. \Name:
  53.     .endm
  54.  
  55.     .macro    ENTRY_END    Name=
  56.     .endf
  57.     .endm
  58.  
  59.     .macro    EXCEPTION_HANDLER    Handler
  60.     .pdata    \Handler
  61.     .endm
  62.  
  63.     .macro    EXCEPTION_HANDLER_DATA    Handler,HandlerData
  64.     .pdata    \Handler,\HandlerData
  65.     .endm
  66.  
  67.         .macro  ERRNZ   Expr
  68.         .aif    \Expr NE 0
  69.         mov error,r0
  70.         .aendi
  71.         .endm
  72.         
  73. STATUS_LONGJUMP: .equ H'80000026
  74.  
  75. ; Some register aliases that have documentation value.
  76.  
  77. arg1reg:    .reg    (r4)    ; first argument register
  78. arg2reg:    .reg    (r5)    ; second argument register
  79. arg3reg:    .reg    (r6)    ; third argument register
  80. arg4reg:    .reg    (r7)    ; fourth argument register
  81.  
  82. ; Offsets into (and length of) the jump buffer.
  83. ; Note that we currently save just about everything (though we don't
  84. ; quite go to the length of extracting the T, S, M, and Q bits from
  85. ; the status register so that we can save and restore them :-).
  86. ; Once we know for sure whether or not the compiler might ever want
  87. ; MACL, MACH, and/or PR to be callee-save, we can clean this up a
  88. ; little (if they turn out to be caller-save).
  89.  
  90. JBr8:   .equ    H'00
  91. JBr9:   .equ    H'04
  92. JBr10:  .equ    H'08
  93. JBr11:  .equ    H'0C
  94. JBr12:  .equ    H'10
  95. JBr13:  .equ    H'14
  96. JBfp:   .equ    H'18
  97. JBsp:   .equ    H'1C
  98. JBmach: .equ    H'20
  99. JBmacl: .equ    H'24
  100. JBpr:   .equ    H'28
  101. JBtype: .equ    H'2C        ; has virtual frame pointer for unwind
  102.  
  103. JBLength:   .equ    H'30    ; Note: if this changes, fix setjmp.asm!!!
  104.  
  105. ;  SH3 Revisions up to 7 have a bug in the handling of a TLB miss
  106. ;   when certain delayed branch/rts sequences occur.  This macro is used
  107. ;   to conditionally insert a nop between the preceeding instruction and
  108. ;   the delayed branch/rts.
  109.     .macro  DELAYNOPBUG
  110.     .aif _M_SH == 3 && _M_SH_REV < 8
  111.     .aif ($ - .text) & 2
  112.     nop
  113.     .aendi
  114.     .aendi
  115.     .endm
  116.