Mercurial > ecos
annotate packages/hal/powerpc/arch/current/include/ppc.inc @ 16:4f2df4ab82c8 ecos-sw-1999-06-18
Merge from eCos master repository on 1999-06-18-15:25:04-BST
| author | jlarmour |
|---|---|
| date | Fri, 18 Jun 1999 07:59:09 +0000 |
| parents | 443894e2e912 |
| children | c38311975d4f |
| rev | line source |
|---|---|
| 0 | 1 ##============================================================================= |
| 2 ## | |
| 3 ## ppc.inc | |
| 4 ## | |
| 5 ## PowerPC assembler header file | |
| 6 ## | |
| 7 ##============================================================================= | |
| 8 #####COPYRIGHTBEGIN#### | |
| 9 # | |
| 10 # ------------------------------------------- | |
| 11 # The contents of this file are subject to the Cygnus eCos Public License | |
| 12 # Version 1.0 (the "License"); you may not use this file except in | |
| 13 # compliance with the License. You may obtain a copy of the License at | |
| 14 # http://sourceware.cygnus.com/ecos | |
| 15 # | |
| 16 # Software distributed under the License is distributed on an "AS IS" | |
| 17 # basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the | |
| 18 # License for the specific language governing rights and limitations under | |
| 19 # the License. | |
| 20 # | |
| 21 # The Original Code is eCos - Embedded Cygnus Operating System, released | |
| 22 # September 30, 1998. | |
| 23 # | |
| 24 # The Initial Developer of the Original Code is Cygnus. Portions created | |
| 2 | 25 # by Cygnus are Copyright (C) 1998,1999 Cygnus Solutions. All Rights Reserved. |
| 0 | 26 # ------------------------------------------- |
| 27 # | |
| 28 #####COPYRIGHTEND#### | |
| 29 ##============================================================================= | |
| 30 #######DESCRIPTIONBEGIN#### | |
| 31 ## | |
| 32 ## Author(s): nickg | |
| 33 ## Contributors: nickg | |
| 34 ## Date: 1997-10-16 | |
| 35 ## Purpose: PowerPC definitions. | |
| 36 ## Description: This file contains various definitions and macros that are | |
| 37 ## useful for writing assembly code for the PowerPC | |
| 38 ## Usage: | |
| 39 ## #include <cyg/hal/ppc.inc> | |
| 40 ## ... | |
| 41 ## | |
| 42 ## | |
| 43 ######DESCRIPTIONEND#### | |
| 44 ## | |
| 45 ##============================================================================= | |
| 46 | |
| 47 #------------------------------------------------------------------------------ | |
| 48 # Easier to read names for the registers | |
| 49 | |
| 50 .equ r0, 0 | |
| 51 .equ r1, 1 | |
| 52 .equ r2, 2 | |
| 53 .equ r3, 3 | |
| 54 .equ r4, 4 | |
| 55 .equ r5, 5 | |
| 56 .equ r6, 6 | |
| 57 .equ r7, 7 | |
| 58 .equ r8, 8 | |
| 59 .equ r9, 9 | |
| 60 .equ r10, 10 | |
| 61 .equ r11, 11 | |
| 62 .equ r12, 12 | |
| 63 .equ r13, 13 | |
| 64 .equ r14, 14 | |
| 65 .equ r15, 15 | |
| 66 .equ r16, 16 | |
| 67 .equ r17, 17 | |
| 68 .equ r18, 18 | |
| 69 .equ r19, 19 | |
| 70 .equ r20, 20 | |
| 71 .equ r21, 21 | |
| 72 .equ r22, 22 | |
| 73 .equ r23, 23 | |
| 74 .equ r24, 24 | |
| 75 .equ r25, 25 | |
| 76 .equ r26, 26 | |
| 77 .equ r27, 27 | |
| 78 .equ r28, 28 | |
| 79 .equ r29, 29 | |
| 80 .equ r30, 30 | |
| 81 .equ r31, 31 | |
| 82 | |
| 83 .equ sp, r1 | |
| 84 | |
| 85 #------------------------------------------------------------------------------ | |
| 86 # Some useful coding macros | |
| 87 | |
| 88 # Load immediate word, has to be done with 2 instructions | |
| 89 .macro lwi reg,val | |
| 90 lis \reg,\val@H | |
| 91 ori \reg,\reg,\val@L | |
| 92 .endm | |
| 93 | |
| 2 | 94 #ifdef CYG_HAL_POWERPC_MPC603 |
| 0 | 95 # Move from HID0 hw control register |
| 96 .macro mfhid0 reg | |
| 2 | 97 mfspr \reg,HID0 |
| 0 | 98 .endm |
| 2 | 99 #endif |
| 0 | 100 |
|
16
4f2df4ab82c8
Merge from eCos master repository on 1999-06-18-15:25:04-BST
jlarmour
parents:
2
diff
changeset
|
101 #define FUNC_START(name) \ |
|
4f2df4ab82c8
Merge from eCos master repository on 1999-06-18-15:25:04-BST
jlarmour
parents:
2
diff
changeset
|
102 .type name,@function; \ |
|
4f2df4ab82c8
Merge from eCos master repository on 1999-06-18-15:25:04-BST
jlarmour
parents:
2
diff
changeset
|
103 .globl name; \ |
|
4f2df4ab82c8
Merge from eCos master repository on 1999-06-18-15:25:04-BST
jlarmour
parents:
2
diff
changeset
|
104 name: |
|
4f2df4ab82c8
Merge from eCos master repository on 1999-06-18-15:25:04-BST
jlarmour
parents:
2
diff
changeset
|
105 |
|
4f2df4ab82c8
Merge from eCos master repository on 1999-06-18-15:25:04-BST
jlarmour
parents:
2
diff
changeset
|
106 #define FUNC_END(name) \ |
|
4f2df4ab82c8
Merge from eCos master repository on 1999-06-18-15:25:04-BST
jlarmour
parents:
2
diff
changeset
|
107 /* nothing for now */ |
|
4f2df4ab82c8
Merge from eCos master repository on 1999-06-18-15:25:04-BST
jlarmour
parents:
2
diff
changeset
|
108 |
| 0 | 109 #------------------------------------------------------------------------------ |
| 110 # Exception, interrupt and thread context save area layout | |
| 2 | 111 # The layout of this structure is also defined in "hal_arch.h", for C |
| 112 # code. Do not change this without changing that (or vice versa). | |
| 0 | 113 |
| 2 | 114 # These first 39 words are common to all saved states |
| 0 | 115 .equ ppcreg_regs, 0 # 32 integer registers |
| 116 .equ ppcreg_cr, 32*4 | |
| 117 .equ ppcreg_xer, 33*4 | |
| 118 .equ ppcreg_lr, 34*4 | |
| 119 .equ ppcreg_ctr, 35*4 | |
| 2 | 120 .equ ppcreg_msr, 36*4 # MSR at time of exception |
| 121 .equ ppcreg_pc, 37*4 # PC at time of exception | |
| 122 .equ ppcreg_context_size, 38*4 | |
| 0 | 123 |
| 124 # The following are only saved on exceptions and interrupts | |
| 2 | 125 .equ ppcreg_vector, 38*4 # exception vector |
| 0 | 126 |
| 127 # The following are only saved on exceptions, and are for information | |
| 128 # only. They are not restored with the rest of the state. | |
| 129 .equ ppcreg_hid0, 39*4 # HID0 HW control register | |
| 130 .equ ppcreg_dar, 40*4 # data address register | |
| 131 .equ ppcreg_dsisr, 41*4 # DSI status register | |
| 132 .equ ppcreg_pvr, 42*4 # processor version | |
| 133 .equ ppcreg_exception_size, 43*4 | |
| 134 | |
| 2 | 135 # Eventually add BATs, SRs and FP registers too. |
| 0 | 136 |
| 137 .equ ppc_stack_frame_size, 56 # size of a stack frame | |
| 138 | |
| 2 | 139 .equ ppc_exception_decrement, ppcreg_exception_size |
| 0 | 140 |
| 141 | |
| 142 #------------------------------------------------------------------------------ | |
| 143 # end of ppc.inc |
