📄 register.lst
字号:
GAS LISTING /tmp/ccOm8T7z.s page 1 1 .section .mdebug.abi32 2 .previous 3 .section .debug_abbrev,"",@progbits 4 $Ldebug_abbrev0: 5 .section .debug_info,"",@progbits 6 $Ldebug_info0: 7 .section .debug_line,"",@progbits 8 $Ldebug_line0: 9 0000 14010000 .text 9 0200A900 9 00000101 9 FB0E0A00 9 01010101 10 $Ltext0: 11 .rdata 12 .align 2 13 .type undefined, @object 14 .size undefined, 10 15 undefined: 16 0000 556E6465 .ascii "Undefined\000" 16 66696E65 16 6400 17 000a 0000 .align 2 18 .type read_write, @object 19 .size read_write, 4 20 read_write: 21 000c 522F5700 .ascii "R/W\000" 22 .align 2 23 .type write_only, @object 24 .size write_only, 3 25 write_only: 26 0010 574F00 .ascii "WO\000" 27 0013 00 .align 2 28 .type read_only, @object 29 .size read_only, 3 30 read_only: 31 0014 524F00 .ascii "RO\000" 32 0017 00 .align 2 33 .type reserved, @object 34 .size reserved, 9 35 reserved: 36 0018 52657365 .ascii "Reserved\000" 36 72766564 36 00 37 0021 00000000 .text 37 00000000 37 00000000 37 000000 38 .align 2 39 .ent register_get_pretty 40 .type register_get_pretty, @function 41 register_get_pretty: 42 $LFB2: 43 .file 1 "/mnt/hgfs/boot/booter/include/register.h" 1:/mnt/hgfs/boot/booter/include/register.h **** #define REG_ALL_PREDICTABLE "--------------------------------" 2:/mnt/hgfs/boot/booter/include/register.h **** #define REG_ALL_UNPREDICTABLE "UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU" 3:/mnt/hgfs/boot/booter/include/register.h **** GAS LISTING /tmp/ccOm8T7z.s page 2 4:/mnt/hgfs/boot/booter/include/register.h **** #define REG_RO 'R' 5:/mnt/hgfs/boot/booter/include/register.h **** #define REG_WO 'W' 6:/mnt/hgfs/boot/booter/include/register.h **** #define REG_RW 'B' 7:/mnt/hgfs/boot/booter/include/register.h **** #define REG_RES '-' 8:/mnt/hgfs/boot/booter/include/register.h **** #define REG_UNPRED 'U' 9:/mnt/hgfs/boot/booter/include/register.h **** 10:/mnt/hgfs/boot/booter/include/register.h **** static const char read_write[] = "R/W"; 11:/mnt/hgfs/boot/booter/include/register.h **** static const char read_only[] = "RO"; 12:/mnt/hgfs/boot/booter/include/register.h **** static const char write_only[] = "WO"; 13:/mnt/hgfs/boot/booter/include/register.h **** static const char reserved[] = "Reserved"; 14:/mnt/hgfs/boot/booter/include/register.h **** static const char undefined[] = "Undefined"; 15:/mnt/hgfs/boot/booter/include/register.h **** 16:/mnt/hgfs/boot/booter/include/register.h **** static const char* register_get_pretty(char setting) 17:/mnt/hgfs/boot/booter/include/register.h **** { 44 .loc 1 17 0 45 .frame $sp,0,$31 # vars= 0, regs= 0/0, args= 0, gp= 0 46 .mask 0x00000000,0 47 .fmask 0x00000000,0 48 .set noreorder 49 .set nomacro 50 51 .loc 1 17 0 52 0000 00260400 sll $4,$4,24 53 0004 03260400 sra $4,$4,24 18:/mnt/hgfs/boot/booter/include/register.h **** switch(setting) 54 .loc 1 18 0 55 0008 52000224 li $2,82 # 0x52 19:/mnt/hgfs/boot/booter/include/register.h **** { 20:/mnt/hgfs/boot/booter/include/register.h **** case REG_RES : return reserved; 21:/mnt/hgfs/boot/booter/include/register.h **** case REG_RO : return read_only; 56 .loc 1 21 0 57 .loc 1 18 0 58 000c 12008210 beq $4,$2,$L4 59 0010 0000023C lui $2,%hi(read_only) 60 61 0014 53008228 slt $2,$4,83 62 0018 0A004010 beq $2,$0,$L8 63 001c 57000224 li $2,87 # 0x57 64 65 0020 2D000224 li $2,45 # 0x2d 66 .loc 1 20 0 67 .loc 1 18 0 68 0024 11008210 beq $4,$2,$L3 69 0028 0000023C lui $2,%hi(reserved) 70 71 002c 42000224 li $2,66 # 0x42 72 0030 0B008210 beq $4,$2,$L6 73 0034 00000000 nop 74 75 $L7: 22:/mnt/hgfs/boot/booter/include/register.h **** case REG_WO : return write_only; 23:/mnt/hgfs/boot/booter/include/register.h **** case REG_RW : return read_write; 24:/mnt/hgfs/boot/booter/include/register.h **** default: return undefined; 76 .loc 1 24 0 77 0038 0000023C lui $2,%hi(undefined) 25:/mnt/hgfs/boot/booter/include/register.h **** } 26:/mnt/hgfs/boot/booter/include/register.h **** }GAS LISTING /tmp/ccOm8T7z.s page 3 78 .loc 1 26 0 79 003c 0800E003 j $31 80 0040 00004224 addiu $2,$2,%lo(undefined) 81 82 $L8: 83 .loc 1 18 0 84 0044 FCFF8214 bne $4,$2,$L7 85 0048 00000000 nop 86 87 .loc 1 22 0 88 004c 0000023C lui $2,%hi(write_only) 89 0050 0800E003 j $31 90 0054 10004224 addiu $2,$2,%lo(write_only) 91 92 $L4: 93 .loc 1 21 0 94 0058 0800E003 j $31 95 005c 14004224 addiu $2,$2,%lo(read_only) 96 97 $L6: 98 .loc 1 23 0 99 0060 0000023C lui $2,%hi(read_write) 100 0064 0800E003 j $31 101 0068 0C004224 addiu $2,$2,%lo(read_write) 102 103 $L3: 104 .loc 1 20 0 105 006c 0800E003 j $31 106 0070 18004224 addiu $2,$2,%lo(reserved) 107 108 .set macro 109 .set reorder 110 $LFE2: 111 .end register_get_pretty 112 .align 2 113 .globl bit_test 114 .ent bit_test 115 .type bit_test, @function 116 bit_test: 117 $LFB3: 118 .file 2 "/mnt/hgfs/boot/booter/source/register.c" 1:/mnt/hgfs/boot/booter/source/register.c **** #include "example.h" 2:/mnt/hgfs/boot/booter/source/register.c **** #include "register.h" 3:/mnt/hgfs/boot/booter/source/register.c **** 4:/mnt/hgfs/boot/booter/source/register.c **** char bit_test(volatile uint32* reg, int bit) 5:/mnt/hgfs/boot/booter/source/register.c **** { 119 .loc 2 5 0 120 .frame $sp,0,$31 # vars= 0, regs= 0/0, args= 0, gp= 0 121 .mask 0x00000000,0 122 .fmask 0x00000000,0 123 .set noreorder 124 .set nomacro 125 6:/mnt/hgfs/boot/booter/source/register.c **** char result = 'R'; 7:/mnt/hgfs/boot/booter/source/register.c **** int current = *reg; 126 .loc 2 7 0 127 0074 0000868C lw $6,0($4)GAS LISTING /tmp/ccOm8T7z.s page 4 8:/mnt/hgfs/boot/booter/source/register.c **** 9:/mnt/hgfs/boot/booter/source/register.c **** *reg = current & ~(0x01 << bit); //Clear the bit 128 .loc 2 9 0 129 0078 01000224 li $2,1 # 0x1 130 007c 0428A200 sll $5,$2,$5 131 0080 27180500 nor $3,$0,$5 132 0084 24186600 and $3,$3,$6 133 0088 000083AC sw $3,0($4) 10:/mnt/hgfs/boot/booter/source/register.c **** 11:/mnt/hgfs/boot/booter/source/register.c **** if((*reg & (0x01 << bit)) == 0x0) //Did the bit clear? 134 .loc 2 11 0 135 008c 0000828C lw $2,0($4) 12:/mnt/hgfs/boot/booter/source/register.c **** { 13:/mnt/hgfs/boot/booter/source/register.c **** *reg = current | (0x01 << bit); //Set the bit 136 .loc 2 13 0 137 0090 2540A600 or $8,$5,$6 138 .loc 2 11 0 139 0094 24104500 and $2,$2,$5 140 .loc 2 6 0 141 .loc 2 11 0 142 0098 08004014 bne $2,$0,$L11 143 009c 52000724 li $7,82 # 0x52 144 145 .loc 2 13 0 146 00a0 000088AC sw $8,0($4) 14:/mnt/hgfs/boot/booter/source/register.c **** if((*reg & (0x01 << bit)) == (0x01 << bit)) //Did the bit set? 147 .loc 2 14 0 148 00a4 0000838C lw $3,0($4) 15:/mnt/hgfs/boot/booter/source/register.c **** result = 'B'; //This bit is read/write 149 .loc 2 15 0 150 00a8 42000224 li $2,66 # 0x42 16:/mnt/hgfs/boot/booter/source/register.c **** 17:/mnt/hgfs/boot/booter/source/register.c **** *reg = current; //Reset register 151 .loc 2 17 0 152 00ac 000086AC sw $6,0($4) 153 .loc 2 14 0 154 00b0 24186500 and $3,$3,$5 155 .loc 2 15 0 156 00b4 26186500 xor $3,$3,$5 157 00b8 0A384300 movz $7,$2,$3 158 $L11: 18:/mnt/hgfs/boot/booter/source/register.c **** } 19:/mnt/hgfs/boot/booter/source/register.c **** 20:/mnt/hgfs/boot/booter/source/register.c **** return result; 21:/mnt/hgfs/boot/booter/source/register.c **** } 159 .loc 2 21 0 160 00bc 0800E003 j $31 161 00c0 2110E000 move $2,$7 162 163 .set macro 164 .set reorder 165 $LFE3: 166 .end bit_test 167 .align 2 168 .globl register_get_default_mask 169 .ent register_get_default_mask 170 .type register_get_default_mask, @functionGAS LISTING /tmp/ccOm8T7z.s page 5 171 register_get_default_mask: 172 $LFB4: 22:/mnt/hgfs/boot/booter/source/register.c **** 23:/mnt/hgfs/boot/booter/source/register.c **** int register_get_default_mask(char reg_config[32], char default_config[32]) 24:/mnt/hgfs/boot/booter/source/register.c **** { 173 .loc 2 24 0 174 .frame $sp,0,$31 # vars= 0, regs= 0/0, args= 0, gp= 0 175 .mask 0x00000000,0 176 .fmask 0x00000000,0 177 .set noreorder 178 .set nomacro 179 25:/mnt/hgfs/boot/booter/source/register.c **** int i; 26:/mnt/hgfs/boot/booter/source/register.c **** uint32 mask = 0; 180 .loc 2 26 0 181 00c4 21380000 move $7,$0 27:/mnt/hgfs/boot/booter/source/register.c **** 28:/mnt/hgfs/boot/booter/source/register.c **** for(i = 0; i < 32; ++i) //Each bit that is readable and predictable at reset will be included in 182 .loc 2 28 0 183 00c8 21300000 move $6,$0 184 00cc 52000824 li $8,82 # 0x52 185 00d0 42000924 li $9,66 # 0x42 186 00d4 55000C24 li $12,85 # 0x55 187 00d8 1F000B24 li $11,31 # 0x1f 188 00dc 3F000008 j $L19 189 00e0 01000A24 li $10,1 # 0x1 190 191 $L23: 29:/mnt/hgfs/boot/booter/source/register.c **** if((reg_config[i] == REG_RO || reg_config[i] == REG_RW) && default_config[i] != REG_UNPRED) 192 .loc 2 29 0 193 00e4 09004910 beq $2,$9,$L18 194 00e8 00000000 nop 195 196 $L16: 197 .loc 2 28 0 198 00ec 0100C624 addiu $6,$6,1 199 00f0 2000C228 slt $2,$6,32 200 00f4 0E004010 beq $2,$0,$L22 201 00f8 00000000 nop 202 203 $L19: 204 .loc 2 29 0 205 00fc 21108600 addu $2,$4,$6 206 0100 00004280 lb $2,0($2) 207 0104 F7FF4814 bne $2,$8,$L23 208 0108 2118A600 addu $3,$5,$6 209 210 $L18: 211 010c 00006380 lb $3,0($3) 30:/mnt/hgfs/boot/booter/source/register.c **** mask |= (0x01 << (31-i)); 212 .loc 2 30 0 213 0110 23106601 subu $2,$11,$6 214 .loc 2 29 0 215 0114 F5FF6C10 beq $3,$12,$L16 216 0118 04104A00 sll $2,$10,$2 217 218 .loc 2 28 0GAS LISTING /tmp/ccOm8T7z.s page 6 219 011c 0100C624 addiu $6,$6,1 220 .loc 2 30 0 221 0120 2538E200 or $7,$7,$2 222 .loc 2 28 0 223 0124 2000C228 slt $2,$6,32 224 0128 F4FF4014 bne $2,$0,$L19 225 012c 00000000 nop 226 227 $L22: 31:/mnt/hgfs/boot/booter/source/register.c **** 32:/mnt/hgfs/boot/booter/source/register.c **** return mask; 33:/mnt/hgfs/boot/booter/source/register.c **** } 228 .loc 2 33 0 229 0130 0800E003 j $31 230 0134 2110E000 move $2,$7 231 232 .set macro 233 .set reorder 234 $LFE4: 235 .end register_get_default_mask 236 .section .rodata.str1.4,"aMS",@progbits,1 237 .align 2 238 $LC0: 239 0000 09546573 .ascii "\tTesting Register: %X\n\000" 239 74696E67 239 20526567 239 69737465 239 723A2025 240 0017 00 .align 2 241 $LC1: 242 0018 09094465 .ascii "\t\tDefault Value Error. Expected: %8X, Actual: %8X\n\000" 242 6661756C 242 74205661 242 6C756520 242 4572726F 243 004b 00 .align 2 244 $LC2: 245 004c 09094269 .ascii "\t\tBit %2d Error. Expected: %s, Actual: %s\n\000" 245 74202532 245 64204572 245 726F722E 245 20457870 246 0077 00 .text 247 .align 2 248 .globl register_test 249 .ent register_test 250 .type register_test, @function 251 register_test: 252 $LFB5: 34:/mnt/hgfs/boot/booter/source/register.c **** 35:/mnt/hgfs/boot/booter/source/register.c **** int register_test(volatile uint32* reg, char reg_config[32], uint32 default_value, char default_con 36:/mnt/hgfs/boot/booter/source/register.c **** { 253 .loc 2 36 0 254 .frame $sp,96,$31 # vars= 40, regs= 10/0, args= 16, gp= 0 255 .mask 0xc0ff0000,-4 256 .fmask 0x00000000,0 257 .set noreorderGAS LISTING /tmp/ccOm8T7z.s page 7
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -