ARMops 3.15 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
; Copyright 2000 Pace Micro Technology plc
;
; Licensed under the Apache License, Version 2.0 (the "License");
; you may not use this file except in compliance with the License.
; You may obtain a copy of the License at
;
;     http://www.apache.org/licenses/LICENSE-2.0
;
; Unless required by applicable law or agreed to in writing, software
; distributed under the License is distributed on an "AS IS" BASIS,
; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
; See the License for the specific language governing permissions and
; limitations under the License.
;

16 17 18 19 20 21 22 23
ARMv3    *       0
ARMv4    *       1
ARMv4T   *       2
ARMv5    *       3
ARMv5T   *       4
ARMv5TE  *       5
ARMv5TEJ *       6
ARMv6    *       7
24 25 26
ARMvF		*	&F ; 'Fancy' ARM that describes its features in the feature registers.
; Generally this implies ARMv7+, but there are also a few ARMv6 CPUs with this value
; (e.g. ARM1176JZF-S)
27 28 29 30 31 32 33

                ^       0
ARM600          #       1
ARM610          #       1
ARM700          #       1
ARM710          #       1
ARM710a         #       1
34
SA110_preRevT   #       1
35 36 37 38 39 40 41 42 43
SA110           #       1
ARM7500         #       1
ARM7500FE       #       1
SA1100          #       1
SA1110          #       1
ARM720T         #       1
ARM920T         #       1
ARM922T         #       1
X80200          #       1
Kevin Bracey's avatar
Kevin Bracey committed
44
X80321          #       1
45
ARM1176JZF_S    #       1
46 47 48 49 50 51 52
Cortex_A5       #       1
Cortex_A7       #       1
Cortex_A8       #       1
Cortex_A9       #       1
Cortex_A12      #       1
Cortex_A15      #       1
Cortex_A17      #       1
Ben Avison's avatar
Ben Avison committed
53 54 55
Cortex_A53      #       1
Cortex_A57      #       1
Cortex_A72      #       1
56 57
ARMunk          *       255

58 59
; The macro to do an ARM operation. All ARM operations are expected
; to corrupt a1 only
Jeffrey Lee's avatar
Jeffrey Lee committed
60
; This macro corrupts ip unless $zeropage reg is supplied
61 62

        MACRO
Jeffrey Lee's avatar
Jeffrey Lee committed
63 64 65
        ARMop   $op, $cond, $tailcall, $zeropage
 [ "$zeropage" = ""
        LDR$cond ip, =ZeroPage
66
 ]
67 68 69
 [ "$tailcall" = ""
        MOV$cond lr, pc
 ]
Jeffrey Lee's avatar
Jeffrey Lee committed
70
 [ "$zeropage" = ""
71 72
        LDR$cond pc, [ip, #Proc_$op]
 |
Jeffrey Lee's avatar
Jeffrey Lee committed
73
        LDR$cond pc, [$zeropage, #Proc_$op]
74
 ]
75 76
        MEND

Kevin Bracey's avatar
Kevin Bracey committed
77 78 79
        MACRO
        ChangedProcVecs $tmp
 [ XScaleJTAGDebug
Jeffrey Lee's avatar
Jeffrey Lee committed
80
        LDR     $tmp, =ZeroPage
Kevin Bracey's avatar
Kevin Bracey committed
81 82 83 84 85 86 87 88
        LDR     $tmp, [$tmp, #ProcessorFlags]
        TST     $tmp, #CPUFlag_XScaleJTAGconnected
        BEQ     %FT01
        BKPT    &2000
01
 ]
        MEND

89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121
; Call pagetable operation routine
        GBLS    pt
        MACRO
        PTOp$cc $op
 [ "$pt" <> ""                          ; Scoped to just one type?
        BL$cc   $op._$pt
 ELIF LongDesc :LAND: ShortDesc
   [ "$cc"<>"" :LAND: "$cc"<>"AL"
        LCLS    rcc
rcc     SETS    :REVERSE_CC:"$cc"
        B$rcc   %FT90
   ]
        MRC     p15, 0, lr, c2, c0, 2   ; Read TTBCR (yuck)
        TST     lr, #&80000000          ; Long descriptors enabled?
        ADR     lr, %FT90
        BNE     $op._LongDesc
        B       $op._ShortDesc
90
 ELIF LongDesc
        BL$cc   $op._LongDesc
 |
        BL$cc   $op._ShortDesc
 ]
        MEND

 [ LongDesc :LAND: ShortDesc
        ; NE if LongDesc, EQ if ShortDesc
        MACRO
        PTWhich $temp
        MRC     p15, 0, $temp, c2, c0, 2
        TST     $temp, #&80000000
        MEND
 ]
Kevin Bracey's avatar
Kevin Bracey committed
122

123
        END