📄 aes.lst
字号:
GAS LISTING /tmp/ccZgMeXN.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 28010000 .text 9 0200A200 9 00000101 9 FB0E0A00 9 01010101 10 $Ltext0: 11 .align 2 12 .globl AES_Read_Initial_Value_Check 13 .ent AES_Read_Initial_Value_Check 14 .type AES_Read_Initial_Value_Check, @function 15 AES_Read_Initial_Value_Check: 16 $LFB3: 17 .file 1 "/mnt/hgfs/boot/booter/source/aes.c" 1:/mnt/hgfs/boot/booter/source/aes.c **** #include "example.h" 2:/mnt/hgfs/boot/booter/source/aes.c **** #include "test.h" 3:/mnt/hgfs/boot/booter/source/aes.c **** 4:/mnt/hgfs/boot/booter/source/aes.c **** //#define DEBUG_MESSAGES 5:/mnt/hgfs/boot/booter/source/aes.c **** 6:/mnt/hgfs/boot/booter/source/aes.c **** #define WAIT_FOR_STATUS(x) \ 7:/mnt/hgfs/boot/booter/source/aes.c **** while(!(aes->status & x)) 8:/mnt/hgfs/boot/booter/source/aes.c **** 9:/mnt/hgfs/boot/booter/source/aes.c **** #ifdef DEBUG_MESSAGES 10:/mnt/hgfs/boot/booter/source/aes.c **** #define PRINT_AES_REG \ 11:/mnt/hgfs/boot/booter/source/aes.c **** printf("\nThe value of AES is:");\ 12:/mnt/hgfs/boot/booter/source/aes.c **** printf("\nconfig reg :0x%X", aes->config); \ 13:/mnt/hgfs/boot/booter/source/aes.c **** printf("\nstatus reg :0x%X", aes->status); \ 14:/mnt/hgfs/boot/booter/source/aes.c **** printf("\ninterrupt reg: 0x%X", aes->intcause); 15:/mnt/hgfs/boot/booter/source/aes.c **** 16:/mnt/hgfs/boot/booter/source/aes.c **** #define PRINT_AES_TC_REG \ 17:/mnt/hgfs/boot/booter/source/aes.c **** printf("\nThe value of AES_TC is:");\ 18:/mnt/hgfs/boot/booter/source/aes.c **** printf("\nconfig reg :0x%X", aes_tc.config); \ 19:/mnt/hgfs/boot/booter/source/aes.c **** printf("\nstatus reg :0x%X", aes_tc.status); \ 20:/mnt/hgfs/boot/booter/source/aes.c **** printf("\ninterrupt reg: 0x%X", aes_tc.intcause); 21:/mnt/hgfs/boot/booter/source/aes.c **** 22:/mnt/hgfs/boot/booter/source/aes.c **** #define PRINT_LINE_NUM(x) \ 23:/mnt/hgfs/boot/booter/source/aes.c **** printf("\nExecuting line # %d %s", __LINE__, x); \ 24:/mnt/hgfs/boot/booter/source/aes.c **** x; 25:/mnt/hgfs/boot/booter/source/aes.c **** #define PRINT_DATA_BLOCK(x, array) \ 26:/mnt/hgfs/boot/booter/source/aes.c **** printf("\n%s", x); \ 27:/mnt/hgfs/boot/booter/source/aes.c **** printf("\n0x%X", array[0]); \ 28:/mnt/hgfs/boot/booter/source/aes.c **** printf("\n0x%X", array[1]); \ 29:/mnt/hgfs/boot/booter/source/aes.c **** printf("\n0x%X", array[2]); \ 30:/mnt/hgfs/boot/booter/source/aes.c **** printf("\n0x%X", array[3]); \ 31:/mnt/hgfs/boot/booter/source/aes.c **** printf("\n0x%X", array[4]); \ 32:/mnt/hgfs/boot/booter/source/aes.c **** printf("\n0x%X", array[5]); \ 33:/mnt/hgfs/boot/booter/source/aes.c **** printf("\n0x%X", array[6]); \ 34:/mnt/hgfs/boot/booter/source/aes.c **** printf("\n0x%X", array[7]); \ 35:/mnt/hgfs/boot/booter/source/aes.c **** printf("\n0x%X", array[8]); \ 36:/mnt/hgfs/boot/booter/source/aes.c **** printf("\n0x%X", array[9]); \GAS LISTING /tmp/ccZgMeXN.s page 2 37:/mnt/hgfs/boot/booter/source/aes.c **** printf("\n0x%X", array[10]); \ 38:/mnt/hgfs/boot/booter/source/aes.c **** printf("\n0x%X", array[11]); \ 39:/mnt/hgfs/boot/booter/source/aes.c **** printf("\n0x%X", array[12]); \ 40:/mnt/hgfs/boot/booter/source/aes.c **** printf("\n0x%X", array[13]); \ 41:/mnt/hgfs/boot/booter/source/aes.c **** printf("\n0x%X", array[14]); \ 42:/mnt/hgfs/boot/booter/source/aes.c **** printf("\n0x%X", array[15]); 43:/mnt/hgfs/boot/booter/source/aes.c **** 44:/mnt/hgfs/boot/booter/source/aes.c **** #define WRITE_REG(reg,x) \ 45:/mnt/hgfs/boot/booter/source/aes.c **** reg = x; \ 46:/mnt/hgfs/boot/booter/source/aes.c **** printf("\nWrite address 0x%X, Data 0x%X", ®, x); 47:/mnt/hgfs/boot/booter/source/aes.c **** 48:/mnt/hgfs/boot/booter/source/aes.c **** #define READ_REG(x,reg) \ 49:/mnt/hgfs/boot/booter/source/aes.c **** x = reg; \ 50:/mnt/hgfs/boot/booter/source/aes.c **** printf("\nRead address 0x%X, Data 0x%X", ®, x); 51:/mnt/hgfs/boot/booter/source/aes.c **** #else 52:/mnt/hgfs/boot/booter/source/aes.c **** #define PRINT_AES_REG \ 53:/mnt/hgfs/boot/booter/source/aes.c **** 54:/mnt/hgfs/boot/booter/source/aes.c **** #define PRINT_AES_TC_REG \ 55:/mnt/hgfs/boot/booter/source/aes.c **** 56:/mnt/hgfs/boot/booter/source/aes.c **** #define PRINT_LINE_NUM(x) \ 57:/mnt/hgfs/boot/booter/source/aes.c **** x; 58:/mnt/hgfs/boot/booter/source/aes.c **** #define PRINT_DATA_BLOCK(x, array) \ 59:/mnt/hgfs/boot/booter/source/aes.c **** 60:/mnt/hgfs/boot/booter/source/aes.c **** #define WRITE_REG(reg,x) \ 61:/mnt/hgfs/boot/booter/source/aes.c **** reg = x; \ 62:/mnt/hgfs/boot/booter/source/aes.c **** 63:/mnt/hgfs/boot/booter/source/aes.c **** #define READ_REG(x,reg) \ 64:/mnt/hgfs/boot/booter/source/aes.c **** x = reg; \ 65:/mnt/hgfs/boot/booter/source/aes.c **** 66:/mnt/hgfs/boot/booter/source/aes.c **** #endif 67:/mnt/hgfs/boot/booter/source/aes.c **** int AES_Read_Initial_Value_Check() 68:/mnt/hgfs/boot/booter/source/aes.c **** { 18 .loc 1 68 0 19 .frame $sp,0,$31 # vars= 0, regs= 0/0, args= 0, gp= 0 20 .mask 0x00000000,0 21 .fmask 0x00000000,0 22 .set noreorder 23 .set nomacro 24 69:/mnt/hgfs/boot/booter/source/aes.c **** AU1200_AES* aes = (AU1200_AES*)KSEG1(AES_PHYS_ADDR); 25 .loc 1 69 0 26 0000 30B0033C li $3,-1339031552 # 0xffffffffb0300000 70:/mnt/hgfs/boot/booter/source/aes.c **** 71:/mnt/hgfs/boot/booter/source/aes.c **** DPRINTF("Reset Value Check\n"); 72:/mnt/hgfs/boot/booter/source/aes.c **** PRINT_AES_REG; 73:/mnt/hgfs/boot/booter/source/aes.c **** 74:/mnt/hgfs/boot/booter/source/aes.c **** // after reset value is all Zero 75:/mnt/hgfs/boot/booter/source/aes.c **** if(((aes->config) & 0x0000007F != 0) || 27 .loc 1 75 0 28 0004 1000628C lw $2,16($3) 29 0008 01004230 andi $2,$2,0x1 76:/mnt/hgfs/boot/booter/source/aes.c **** ((aes->status) & 0x0000003F != 0) || 77:/mnt/hgfs/boot/booter/source/aes.c **** ((aes->intcause) & 0x00000007 != 0)) 78:/mnt/hgfs/boot/booter/source/aes.c **** { 79:/mnt/hgfs/boot/booter/source/aes.c **** //printf("\t Test Fail!"); 80:/mnt/hgfs/boot/booter/source/aes.c **** return TEST_FAILED; 30 .loc 1 80 0GAS LISTING /tmp/ccZgMeXN.s page 3 31 .loc 1 75 0 32 000c 0A004014 bne $2,$0,$L6 33 0010 21200000 move $4,$0 34 35 0014 0000628C lw $2,0($3) 36 0018 01004230 andi $2,$2,0x1 81:/mnt/hgfs/boot/booter/source/aes.c **** } 82:/mnt/hgfs/boot/booter/source/aes.c **** else 83:/mnt/hgfs/boot/booter/source/aes.c **** { 84:/mnt/hgfs/boot/booter/source/aes.c **** //printf("\t Test Pass!"); 85:/mnt/hgfs/boot/booter/source/aes.c **** return TEST_PASSED; 37 .loc 1 85 0 38 .loc 1 75 0 39 001c 05004014 bne $2,$0,$L3 40 0020 01000424 li $4,1 # 0x1 41 42 0024 0C00628C lw $2,12($3) 43 0028 01004230 andi $2,$2,0x1 44 002c 02004010 beq $2,$0,$L1 45 0030 00000000 nop 46 47 $L3: 48 .loc 1 80 0 49 0034 21200000 move $4,$0 50 $L1: 51 $L6: 86:/mnt/hgfs/boot/booter/source/aes.c **** } 87:/mnt/hgfs/boot/booter/source/aes.c **** } 52 .loc 1 87 0 53 0038 0800E003 j $31 54 003c 21108000 move $2,$4 55 56 .set macro 57 .set reorder 58 $LFE3: 59 .end AES_Read_Initial_Value_Check 60 .align 2 61 .globl AES_Reg_Scan 62 .ent AES_Reg_Scan 63 .type AES_Reg_Scan, @function 64 AES_Reg_Scan: 65 $LFB4: 88:/mnt/hgfs/boot/booter/source/aes.c **** 89:/mnt/hgfs/boot/booter/source/aes.c **** 90:/mnt/hgfs/boot/booter/source/aes.c **** int AES_Reg_Scan(AU1200_AES aes_tc) 91:/mnt/hgfs/boot/booter/source/aes.c **** { 66 .loc 1 91 0 67 .frame $sp,0,$31 # vars= 0, regs= 0/0, args= 0, gp= 0 68 .mask 0x00000000,0 69 .fmask 0x00000000,0 70 .set noreorder 71 .set nomacro 72 73 .loc 1 91 0 74 0040 0000A4AF sw $4,0($sp) 75 0044 0400A5AF sw $5,4($sp) 76 0048 0800A6AF sw $6,8($sp)GAS LISTING /tmp/ccZgMeXN.s page 4 77 004c 0C00A7AF sw $7,12($sp) 92:/mnt/hgfs/boot/booter/source/aes.c **** int i=0; 93:/mnt/hgfs/boot/booter/source/aes.c **** // reset the register, default value is all zero for the registers 94:/mnt/hgfs/boot/booter/source/aes.c **** AU1200_AES* aes = (AU1200_AES*)KSEG1(AES_PHYS_ADDR); 95:/mnt/hgfs/boot/booter/source/aes.c **** 96:/mnt/hgfs/boot/booter/source/aes.c **** DPRINTF("Inside AES_Reg_Scan function\n"); 97:/mnt/hgfs/boot/booter/source/aes.c **** 98:/mnt/hgfs/boot/booter/source/aes.c **** //PRINT_AES_REG; 99:/mnt/hgfs/boot/booter/source/aes.c **** //memset(aes, 0, sizeof(AU1200_AES)); 100:/mnt/hgfs/boot/booter/source/aes.c **** //PRINT_AES_REG; 101:/mnt/hgfs/boot/booter/source/aes.c **** 102:/mnt/hgfs/boot/booter/source/aes.c **** aes->config = aes_tc.config; 78 .loc 1 102 0 79 0050 1000A38F lw $3,16($sp) 80 .loc 1 94 0 81 0054 30B0053C li $5,-1339031552 # 0xffffffffb0300000 103:/mnt/hgfs/boot/booter/source/aes.c **** aes->status = aes_tc.status; 104:/mnt/hgfs/boot/booter/source/aes.c **** aes->intcause = aes_tc.intcause; 105:/mnt/hgfs/boot/booter/source/aes.c **** 106:/mnt/hgfs/boot/booter/source/aes.c **** PRINT_AES_TC_REG; 107:/mnt/hgfs/boot/booter/source/aes.c **** PRINT_AES_REG; 108:/mnt/hgfs/boot/booter/source/aes.c **** 109:/mnt/hgfs/boot/booter/source/aes.c **** // Note: PS bit can not be set if do not have proper configuration 110:/mnt/hgfs/boot/booter/source/aes.c **** // write Zero to intcause bit only 111:/mnt/hgfs/boot/booter/source/aes.c **** if((aes->config != aes_tc.config) || 112:/mnt/hgfs/boot/booter/source/aes.c **** (aes->status != (aes_tc.status & 0x0000003E))) 113:/mnt/hgfs/boot/booter/source/aes.c **** // (aes->intcause != aes_tc.intcause)) 114:/mnt/hgfs/boot/booter/source/aes.c **** { 115:/mnt/hgfs/boot/booter/source/aes.c **** //printf("\t Test Fail!"); 116:/mnt/hgfs/boot/booter/source/aes.c **** return TEST_FAILED; 117:/mnt/hgfs/boot/booter/source/aes.c **** } 118:/mnt/hgfs/boot/booter/source/aes.c **** else 119:/mnt/hgfs/boot/booter/source/aes.c **** { 120:/mnt/hgfs/boot/booter/source/aes.c **** //printf("\t Test Pass!"); 121:/mnt/hgfs/boot/booter/source/aes.c **** return TEST_PASSED; 82 .loc 1 121 0 83 0058 01000624 li $6,1 # 0x1 84 .loc 1 102 0 85 005c 1000A3AC sw $3,16($5) 86 .loc 1 103 0 87 0060 0000A28F lw $2,0($sp) 88 0064 0000A2AC sw $2,0($5) 89 .loc 1 104 0 90 0068 0C00A38F lw $3,12($sp) 91 006c 0C00A3AC sw $3,12($5) 92 .loc 1 111 0 93 0070 1000A48C lw $4,16($5) 94 0074 1000A28F lw $2,16($sp) 95 0078 04008210 beq $4,$2,$L11 96 007c 00000000 nop 97 98 .loc 1 116 0 99 0080 21300000 move $6,$0 100 $L7: 122:/mnt/hgfs/boot/booter/source/aes.c **** } 123:/mnt/hgfs/boot/booter/source/aes.c **** } 101 .loc 1 123 0GAS LISTING /tmp/ccZgMeXN.s page 5 102 0084 0800E003 j $31 103 0088 2110C000 move $2,$6 104 105 $L11: 106 .loc 1 111 0 107 008c 0000A28F lw $2,0($sp) 108 0090 0000A38C lw $3,0($5) 109 0094 3E004230 andi $2,$2,0x3e 110 0098 FAFF6210 beq $3,$2,$L7 111 009c 00000000 nop 112 113 .loc 1 116 0 114 00a0 21000008 j $L7 115 00a4 21300000 move $6,$0 116 117 .set macro 118 .set reorder 119 $LFE4: 120 .end AES_Reg_Scan 121 .align 2 122 .globl AES_driver 123 .ent AES_driver 124 .type AES_driver, @function 125 AES_driver: 126 $LFB5: 124:/mnt/hgfs/boot/booter/source/aes.c **** 125:/mnt/hgfs/boot/booter/source/aes.c **** /* 126:/mnt/hgfs/boot/booter/source/aes.c **** AU1200_AES aes_tc, 127:/mnt/hgfs/boot/booter/source/aes.c **** 128:/mnt/hgfs/boot/booter/source/aes.c **** char scheme, char mode, char undef_block_count, long number_of_blocks, 129:/mnt/hgfs/boot/booter/source/aes.c **** long* key, long* IV, long* input_data_block, // input 130:/mnt/hgfs/boot/booter/source/aes.c **** char reuse_key, char replay_key, char IKG, // tentative input 131:/mnt/hgfs/boot/booter/source/aes.c **** char sys_clock_divider, char interrupt_en, 132:/mnt/hgfs/boot/booter/source/aes.c **** 133:/mnt/hgfs/boot/booter/source/aes.c **** long *replaykey, long* output_data_block // output 134:/mnt/hgfs/boot/booter/source/aes.c **** 135:/mnt/hgfs/boot/booter/source/aes.c **** */ 136:/mnt/hgfs/boot/booter/source/aes.c **** 137:/mnt/hgfs/boot/booter/source/aes.c **** 138:/mnt/hgfs/boot/booter/source/aes.c **** int AES_driver 139:/mnt/hgfs/boot/booter/source/aes.c **** ( 140:/mnt/hgfs/boot/booter/source/aes.c **** AU1200_AES aes_tc, 141:/mnt/hgfs/boot/booter/source/aes.c **** long *input_data_block, //input 142:/mnt/hgfs/boot/booter/source/aes.c **** unsigned long number_of_blocks, // input 143:/mnt/hgfs/boot/booter/source/aes.c **** long* key, long* IV, // input 144:/mnt/hgfs/boot/booter/source/aes.c **** long* replaykey, // output 145:/mnt/hgfs/boot/booter/source/aes.c **** long *output_data_block // output 146:/mnt/hgfs/boot/booter/source/aes.c **** ) 147:/mnt/hgfs/boot/booter/source/aes.c **** { 127 .loc 1 147 0 128 .frame $sp,0,$31 # vars= 0, regs= 0/0, args= 0, gp= 0 129 .mask 0x00000000,0 130 .fmask 0x00000000,0 131 .set noreorder 132 .set nomacro 133 134 .loc 1 147 0GAS LISTING /tmp/ccZgMeXN.s page 6 135 00a8 0000A4AF sw $4,0($sp) 136 00ac 0400A5AF sw $5,4($sp) 137 00b0 0800A6AF sw $6,8($sp) 138 00b4 0C00A7AF sw $7,12($sp) 148:/mnt/hgfs/boot/booter/source/aes.c **** int i=0; 149:/mnt/hgfs/boot/booter/source/aes.c **** long longTemp; 150:/mnt/hgfs/boot/booter/source/aes.c **** // reset the register, default value is all zero for the registers 151:/mnt/hgfs/boot/booter/source/aes.c **** AU1200_AES* aes = (AU1200_AES*)KSEG1(AES_PHYS_ADDR); 152:/mnt/hgfs/boot/booter/source/aes.c **** 153:/mnt/hgfs/boot/booter/source/aes.c **** DPRINTF("\nInside AES_driver function....."); 154:/mnt/hgfs/boot/booter/source/aes.c **** PRINT_DATA_BLOCK("input_data_block", input_data_block); 155:/mnt/hgfs/boot/booter/source/aes.c **** 156:/mnt/hgfs/boot/booter/source/aes.c **** //*** configuration sequence (CS, Configuration Reg) 157:/mnt/hgfs/boot/booter/source/aes.c **** // ************************************************ 158:/mnt/hgfs/boot/booter/source/aes.c **** WRITE_REG(aes->config, aes_tc.config); 139 .loc 1 158 0 140 00b8 1000A28F lw $2,16($sp) 141 .loc 1 151 0 142 00bc 30B0063C li $6,-1339031552 # 0xffffffffb0300000 143 .loc 1 147 0 144 00c0 1400A88F lw $8,20($sp) 145 .loc 1 158 0 146 00c4 1000C2AC sw $2,16($6) 159:/mnt/hgfs/boot/booter/source/aes.c **** //*** status sequence (SS, Status Reg) 160:/mnt/hgfs/boot/booter/source/aes.c **** // ************************************************ 161:/mnt/hgfs/boot/booter/source/aes.c **** WRITE_REG(aes->status, aes_tc.status | AES_STATUS_PS ); //| AES_STATUS_IE); 147 .loc 1 161 0 148 00c8 0000A38F lw $3,0($sp) 149 .loc 1 147 0 150 00cc 1800A98F lw $9,24($sp) 151 00d0 1C00A48F lw $4,28($sp) 152 .loc 1 161 0 153 00d4 01006334 ori $3,$3,0x1 154 00d8 0000C3AC sw $3,0($6) 162:/mnt/hgfs/boot/booter/source/aes.c **** 163:/mnt/hgfs/boot/booter/source/aes.c **** PRINT_AES_REG; 164:/mnt/hgfs/boot/booter/source/aes.c **** //*** block count sequence (BS, Rx Reg) 165:/mnt/hgfs/boot/booter/source/aes.c **** // ************************************************ 166:/mnt/hgfs/boot/booter/source/aes.c **** if(!(aes->config & AES_CONFIG_UC)) // UC = 0 means defined block count 155 .loc 1 166 0 156 00dc 1000C28C lw $2,16($6) 157 .loc 1 147 0 158 00e0 2000AB8F lw $11,32($sp) 159 00e4 2400AA8F lw $10,36($sp)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -