]> cvs.zerfleddert.de Git - proxmark3-svn/commitdiff
fix some ARM build fail
authorbushing <bushing@ef4ab9da-24cd-11de-8aaa-f3a34680c41f>
Tue, 22 Dec 2009 12:48:33 +0000 (12:48 +0000)
committerbushing <bushing@ef4ab9da-24cd-11de-8aaa-f3a34680c41f>
Tue, 22 Dec 2009 12:48:33 +0000 (12:48 +0000)
armsrc/appmain.c
armsrc/legicrf.c
bootrom/bootrom.c
include/proxmark3.h

index 81ef407a04d3e94f5caafe94e34143a9d2fabe10..84b0954e7aa46050dedbc15be0b467528c89f024 100644 (file)
@@ -69,8 +69,8 @@ void DbpString(char *str)
 \r
        UsbCommand c;\r
        c.cmd = CMD_DEBUG_PRINT_STRING;\r
 \r
        UsbCommand c;\r
        c.cmd = CMD_DEBUG_PRINT_STRING;\r
-       c.ext1 = strlen(str);\r
-       memcpy(c.d.asBytes, str, c.ext1);\r
+       c.arg[0] = strlen(str);\r
+       memcpy(c.d.asBytes, str, c.arg[0]);\r
 \r
        UsbSendPacket((BYTE *)&c, sizeof(c));\r
        // TODO fix USB so stupid things like this aren't req'd\r
 \r
        UsbSendPacket((BYTE *)&c, sizeof(c));\r
        // TODO fix USB so stupid things like this aren't req'd\r
@@ -85,9 +85,9 @@ void DbpIntegers(int x1, int x2, int x3)
 \r
        UsbCommand c;\r
        c.cmd = CMD_DEBUG_PRINT_INTEGERS;\r
 \r
        UsbCommand c;\r
        c.cmd = CMD_DEBUG_PRINT_INTEGERS;\r
-       c.ext1 = x1;\r
-       c.ext2 = x2;\r
-       c.ext3 = x3;\r
+       c.arg[0] = x1;\r
+       c.arg[1] = x2;\r
+       c.arg[2] = x3;\r
 \r
        UsbSendPacket((BYTE *)&c, sizeof(c));\r
        // XXX\r
 \r
        UsbSendPacket((BYTE *)&c, sizeof(c));\r
        // XXX\r
@@ -176,9 +176,9 @@ void MeasureAntennaTuning(void)
        vHf = (33000 * AvgAdc(ADC_CHAN_HF)) >> 10;\r
 \r
        c.cmd = CMD_MEASURED_ANTENNA_TUNING;\r
        vHf = (33000 * AvgAdc(ADC_CHAN_HF)) >> 10;\r
 \r
        c.cmd = CMD_MEASURED_ANTENNA_TUNING;\r
-       c.ext1 = (vLf125 << 0) | (vLf134 << 16);\r
-       c.ext2 = vHf;\r
-       c.ext3 = peakf | (peakv << 16);\r
+       c.arg[0] = (vLf125 << 0) | (vLf134 << 16);\r
+       c.arg[1] = vHf;\r
+       c.arg[2] = peakf | (peakv << 16);\r
        UsbSendPacket((BYTE *)&c, sizeof(c));\r
 }\r
 \r
        UsbSendPacket((BYTE *)&c, sizeof(c));\r
 }\r
 \r
@@ -536,13 +536,13 @@ void UsbPacketReceived(BYTE *packet, int len)
        switch(c->cmd) {\r
 #ifdef WITH_LF\r
                case CMD_ACQUIRE_RAW_ADC_SAMPLES_125K:\r
        switch(c->cmd) {\r
 #ifdef WITH_LF\r
                case CMD_ACQUIRE_RAW_ADC_SAMPLES_125K:\r
-                       AcquireRawAdcSamples125k(c->ext1);\r
+                       AcquireRawAdcSamples125k(c->arg[0]);\r
                        break;\r
 #endif\r
 \r
 #ifdef WITH_LF\r
                case CMD_MOD_THEN_ACQUIRE_RAW_ADC_SAMPLES_125K:\r
                        break;\r
 #endif\r
 \r
 #ifdef WITH_LF\r
                case CMD_MOD_THEN_ACQUIRE_RAW_ADC_SAMPLES_125K:\r
-                       ModThenAcquireRawAdcSamples125k(c->ext1,c->ext2,c->ext3,c->d.asBytes);\r
+                       ModThenAcquireRawAdcSamples125k(c->arg[0],c->arg[1],c->arg[2],c->d.asBytes);\r
                        break;\r
 #endif\r
 \r
                        break;\r
 #endif\r
 \r
@@ -558,7 +558,7 @@ void UsbPacketReceived(BYTE *packet, int len)
 \r
 #ifdef WITH_ISO15693\r
                case CMD_READER_ISO_15693:\r
 \r
 #ifdef WITH_ISO15693\r
                case CMD_READER_ISO_15693:\r
-                       ReaderIso15693(c->ext1);\r
+                       ReaderIso15693(c->arg[0]);\r
                        break;\r
 #endif\r
 \r
                        break;\r
 #endif\r
 \r
@@ -568,28 +568,28 @@ void UsbPacketReceived(BYTE *packet, int len)
 \r
 #ifdef WITH_ISO15693\r
                case CMD_SIMTAG_ISO_15693:\r
 \r
 #ifdef WITH_ISO15693\r
                case CMD_SIMTAG_ISO_15693:\r
-                       SimTagIso15693(c->ext1);\r
+                       SimTagIso15693(c->arg[0]);\r
                        break;\r
 #endif\r
 \r
 #ifdef WITH_ISO14443b\r
                case CMD_ACQUIRE_RAW_ADC_SAMPLES_ISO_14443:\r
                        break;\r
 #endif\r
 \r
 #ifdef WITH_ISO14443b\r
                case CMD_ACQUIRE_RAW_ADC_SAMPLES_ISO_14443:\r
-                       AcquireRawAdcSamplesIso14443(c->ext1);\r
+                       AcquireRawAdcSamplesIso14443(c->arg[0]);\r
                        break;\r
 #endif\r
 \r
 #ifdef WITH_ISO14443b\r
                case CMD_READ_SRI512_TAG:\r
                        break;\r
 #endif\r
 \r
 #ifdef WITH_ISO14443b\r
                case CMD_READ_SRI512_TAG:\r
-                       ReadSRI512Iso14443(c->ext1);\r
+                       ReadSRI512Iso14443(c->arg[0]);\r
                        break;\r
                        break;\r
-               case CMD_READ_SRIX4K_TAG:
-                       ReadSRIX4KIso14443(c->ext1);
-                       break;
+               case CMD_READ_SRIX4K_TAG:\r
+                       ReadSRIX4KIso14443(c->arg[0]);\r
+                       break;\r
 #endif\r
 \r
 #ifdef WITH_ISO14443a\r
                case CMD_READER_ISO_14443a:\r
 #endif\r
 \r
 #ifdef WITH_ISO14443a\r
                case CMD_READER_ISO_14443a:\r
-                       ReaderIso14443a(c->ext1);\r
+                       ReaderIso14443a(c->arg[0]);\r
                        break;\r
 #endif\r
 \r
                        break;\r
 #endif\r
 \r
@@ -617,7 +617,7 @@ void UsbPacketReceived(BYTE *packet, int len)
                \r
 #ifdef WITH_ISO14443a\r
                case CMD_SIMULATE_TAG_ISO_14443a:\r
                \r
 #ifdef WITH_ISO14443a\r
                case CMD_SIMULATE_TAG_ISO_14443a:\r
-                       SimulateIso14443aTag(c->ext1, c->ext2);  // ## Simulate iso14443a tag - pass tag type & UID\r
+                       SimulateIso14443aTag(c->arg[0], c->arg[1]);  // ## Simulate iso14443a tag - pass tag type & UID\r
                        break;\r
 #endif\r
 \r
                        break;\r
 #endif\r
 \r
@@ -630,7 +630,7 @@ void UsbPacketReceived(BYTE *packet, int len)
                        break;\r
 \r
                case CMD_LISTEN_READER_FIELD:\r
                        break;\r
 \r
                case CMD_LISTEN_READER_FIELD:\r
-                       ListenReaderField(c->ext1);\r
+                       ListenReaderField(c->arg[0]);\r
                        break;\r
 \r
 #ifdef WITH_LF\r
                        break;\r
 \r
 #ifdef WITH_LF\r
@@ -641,7 +641,7 @@ void UsbPacketReceived(BYTE *packet, int len)
 \r
 #ifdef WITH_LF\r
                case CMD_HID_SIM_TAG:\r
 \r
 #ifdef WITH_LF\r
                case CMD_HID_SIM_TAG:\r
-                       CmdHIDsimTAG(c->ext1, c->ext2, 1);                                      // Simulate HID tag by ID\r
+                       CmdHIDsimTAG(c->arg[0], c->arg[1], 1);                                  // Simulate HID tag by ID\r
                        break;\r
 #endif\r
 \r
                        break;\r
 #endif\r
 \r
@@ -659,7 +659,7 @@ void UsbPacketReceived(BYTE *packet, int len)
 \r
 #ifdef WITH_LF\r
                case CMD_WRITE_TI_TYPE:\r
 \r
 #ifdef WITH_LF\r
                case CMD_WRITE_TI_TYPE:\r
-                       WriteTItag(c->ext1,c->ext2,c->ext3);\r
+                       WriteTItag(c->arg[0],c->arg[1],c->arg[2]);\r
                        break;\r
 #endif\r
 \r
                        break;\r
 #endif\r
 \r
@@ -670,36 +670,36 @@ void UsbPacketReceived(BYTE *packet, int len)
                        } else {\r
                                n.cmd = CMD_DOWNLOADED_RAW_BITS_TI_TYPE;\r
                        }\r
                        } else {\r
                                n.cmd = CMD_DOWNLOADED_RAW_BITS_TI_TYPE;\r
                        }\r
-                       n.ext1 = c->ext1;\r
-                       memcpy(n.d.asDwords, BigBuf+c->ext1, 12*sizeof(DWORD));\r
+                       n.arg[0] = c->arg[0];\r
+                       memcpy(n.d.asDwords, BigBuf+c->arg[0], 12*sizeof(DWORD));\r
                        UsbSendPacket((BYTE *)&n, sizeof(n));\r
                        break;\r
                }\r
 \r
                case CMD_DOWNLOADED_SIM_SAMPLES_125K: {\r
                        BYTE *b = (BYTE *)BigBuf;\r
                        UsbSendPacket((BYTE *)&n, sizeof(n));\r
                        break;\r
                }\r
 \r
                case CMD_DOWNLOADED_SIM_SAMPLES_125K: {\r
                        BYTE *b = (BYTE *)BigBuf;\r
-                       memcpy(b+c->ext1, c->d.asBytes, 48);\r
+                       memcpy(b+c->arg[0], c->d.asBytes, 48);\r
                        break;\r
                }\r
 \r
 #ifdef WITH_LF\r
                case CMD_SIMULATE_TAG_125K:\r
                        LED_A_ON();\r
                        break;\r
                }\r
 \r
 #ifdef WITH_LF\r
                case CMD_SIMULATE_TAG_125K:\r
                        LED_A_ON();\r
-                       SimulateTagLowFrequency(c->ext1, 1);\r
+                       SimulateTagLowFrequency(c->arg[0], 1);\r
                        LED_A_OFF();\r
                        break;\r
 #endif\r
 \r
                case CMD_READ_MEM:\r
                        LED_A_OFF();\r
                        break;\r
 #endif\r
 \r
                case CMD_READ_MEM:\r
-                       ReadMem(c->ext1);\r
+                       ReadMem(c->arg[0]);\r
                        break;\r
 \r
                case CMD_SET_LF_DIVISOR:\r
                        break;\r
 \r
                case CMD_SET_LF_DIVISOR:\r
-                       FpgaSendCommand(FPGA_CMD_SET_DIVISOR, c->ext1);\r
+                       FpgaSendCommand(FPGA_CMD_SET_DIVISOR, c->arg[0]);\r
                        break;\r
 \r
                case CMD_SET_ADC_MUX:\r
                        break;\r
 \r
                case CMD_SET_ADC_MUX:\r
-                       switch(c->ext1) {\r
+                       switch(c->arg[0]) {\r
                                case 0: SetAdcMuxFor(GPIO_MUXSEL_LOPKD); break;\r
                                case 1: SetAdcMuxFor(GPIO_MUXSEL_LORAW); break;\r
                                case 2: SetAdcMuxFor(GPIO_MUXSEL_HIPKD); break;\r
                                case 0: SetAdcMuxFor(GPIO_MUXSEL_LOPKD); break;\r
                                case 1: SetAdcMuxFor(GPIO_MUXSEL_LORAW); break;\r
                                case 2: SetAdcMuxFor(GPIO_MUXSEL_HIPKD); break;\r
@@ -713,7 +713,7 @@ void UsbPacketReceived(BYTE *packet, int len)
 \r
 #ifdef WITH_LF\r
                case CMD_LF_SIMULATE_BIDIR:\r
 \r
 #ifdef WITH_LF\r
                case CMD_LF_SIMULATE_BIDIR:\r
-                       SimulateTagLowFrequencyBidir(c->ext1, c->ext2);\r
+                       SimulateTagLowFrequencyBidir(c->arg[0], c->arg[1]);\r
                        break;\r
 #endif\r
 \r
                        break;\r
 #endif\r
 \r
@@ -722,7 +722,7 @@ void UsbPacketReceived(BYTE *packet, int len)
                        LCDReset();\r
                        break;\r
                case CMD_LCD:\r
                        LCDReset();\r
                        break;\r
                case CMD_LCD:\r
-                       LCDSend(c->ext1);\r
+                       LCDSend(c->arg[0]);\r
                        break;\r
 #endif\r
                case CMD_SETUP_WRITE:\r
                        break;\r
 #endif\r
                case CMD_SETUP_WRITE:\r
@@ -749,8 +749,8 @@ void UsbPacketReceived(BYTE *packet, int len)
                case CMD_DEVICE_INFO: {\r
                        UsbCommand c;\r
                        c.cmd = CMD_DEVICE_INFO;\r
                case CMD_DEVICE_INFO: {\r
                        UsbCommand c;\r
                        c.cmd = CMD_DEVICE_INFO;\r
-                       c.ext1 = DEVICE_INFO_FLAG_OSIMAGE_PRESENT | DEVICE_INFO_FLAG_CURRENT_MODE_OS;\r
-                       if(common_area.flags.bootrom_present) c.ext1 |= DEVICE_INFO_FLAG_BOOTROM_PRESENT;\r
+                       c.arg[0] = DEVICE_INFO_FLAG_OSIMAGE_PRESENT | DEVICE_INFO_FLAG_CURRENT_MODE_OS;\r
+                       if(common_area.flags.bootrom_present) c.arg[0] |= DEVICE_INFO_FLAG_BOOTROM_PRESENT;\r
                        UsbSendPacket((BYTE*)&c, sizeof(c));\r
                }\r
                        break;\r
                        UsbSendPacket((BYTE*)&c, sizeof(c));\r
                }\r
                        break;\r
index a8c0cd114b39c447bb825ec8af10e62370984dec..bb0badb07286bd12a7b1d9874a0d60fbb4942d90 100644 (file)
@@ -185,8 +185,8 @@ static void frame_receive_rwd(struct legic_frame * const f, int bits)
 static void frame_respond_tag(struct legic_frame const * const f)
 {
        LED_D_ON();
 static void frame_respond_tag(struct legic_frame const * const f)
 {
        LED_D_ON();
-       int i, r_size;
-       uint16_t r_data;
+       int i, r_size=0;
+       uint16_t r_data=0;
        
        for(i=0; i<sizeof(queries)/sizeof(queries[0]); i++) {
                if(f->bits == queries[i].bits && f->data == queries[i].data) {
        
        for(i=0; i<sizeof(queries)/sizeof(queries[0]); i++) {
                if(f->bits == queries[i].bits && f->data == queries[i].data) {
index 7b29ad97955cd1d5342b6151764ad2034f7b9ff4..f98c1108faba35f5eba8b0a5b04322c415804d7d 100644 (file)
@@ -83,9 +83,9 @@ void UsbPacketReceived(BYTE *packet, int len)
         case CMD_DEVICE_INFO:\r
             dont_ack = 1;\r
             c->cmd = CMD_DEVICE_INFO;\r
         case CMD_DEVICE_INFO:\r
             dont_ack = 1;\r
             c->cmd = CMD_DEVICE_INFO;\r
-            c->ext1 = DEVICE_INFO_FLAG_BOOTROM_PRESENT | DEVICE_INFO_FLAG_CURRENT_MODE_BOOTROM |\r
+            c->arg[0] = DEVICE_INFO_FLAG_BOOTROM_PRESENT | DEVICE_INFO_FLAG_CURRENT_MODE_BOOTROM |\r
                 DEVICE_INFO_FLAG_UNDERSTANDS_START_FLASH;\r
                 DEVICE_INFO_FLAG_UNDERSTANDS_START_FLASH;\r
-            if(common_area.flags.osimage_present) c->ext1 |= DEVICE_INFO_FLAG_OSIMAGE_PRESENT;\r
+            if(common_area.flags.osimage_present) c->arg[0] |= DEVICE_INFO_FLAG_OSIMAGE_PRESENT;\r
             UsbSendPacket(packet, len);\r
             break;\r
 \r
             UsbSendPacket(packet, len);\r
             break;\r
 \r
@@ -95,7 +95,7 @@ void UsbPacketReceived(BYTE *packet, int len)
              */\r
             p = (volatile DWORD *)&_flash_start;\r
             for(i = 0; i < 12; i++) {\r
              */\r
             p = (volatile DWORD *)&_flash_start;\r
             for(i = 0; i < 12; i++) {\r
-                p[i+c->ext1] = c->d.asDwords[i];\r
+                p[i+c->arg[0]] = c->d.asDwords[i];\r
             }\r
             break;\r
 \r
             }\r
             break;\r
 \r
@@ -106,7 +106,7 @@ void UsbPacketReceived(BYTE *packet, int len)
             }\r
 \r
             /* Check that the address that we are supposed to write to is within our allowed region */\r
             }\r
 \r
             /* Check that the address that we are supposed to write to is within our allowed region */\r
-            if( ((c->ext1+AT91C_IFLASH_PAGE_SIZE-1) >= end_addr) || (c->ext1 < start_addr) ) {\r
+            if( ((c->arg[0]+AT91C_IFLASH_PAGE_SIZE-1) >= end_addr) || (c->arg[0] < start_addr) ) {\r
                 /* Disallow write */\r
                 dont_ack = 1;\r
                 c->cmd = CMD_NACK;\r
                 /* Disallow write */\r
                 dont_ack = 1;\r
                 c->cmd = CMD_NACK;\r
@@ -114,7 +114,7 @@ void UsbPacketReceived(BYTE *packet, int len)
             } else {\r
                 /* Translate address to flash page and do flash, update here for the 512k part */\r
                 AT91C_BASE_EFC0->EFC_FCR = MC_FLASH_COMMAND_KEY |\r
             } else {\r
                 /* Translate address to flash page and do flash, update here for the 512k part */\r
                 AT91C_BASE_EFC0->EFC_FCR = MC_FLASH_COMMAND_KEY |\r
-                    MC_FLASH_COMMAND_PAGEN((c->ext1-(int)&_flash_start)/AT91C_IFLASH_PAGE_SIZE) |\r
+                    MC_FLASH_COMMAND_PAGEN((c->arg[0]-(int)&_flash_start)/AT91C_IFLASH_PAGE_SIZE) |\r
                     AT91C_MC_FCMD_START_PROG;\r
             }\r
             while(!(AT91C_BASE_EFC0->EFC_FSR & MC_FLASH_STATUS_READY))\r
                     AT91C_MC_FCMD_START_PROG;\r
             }\r
             while(!(AT91C_BASE_EFC0->EFC_FSR & MC_FLASH_STATUS_READY))\r
@@ -127,15 +127,15 @@ void UsbPacketReceived(BYTE *packet, int len)
             break;\r
 \r
         case CMD_START_FLASH:\r
             break;\r
 \r
         case CMD_START_FLASH:\r
-            if(c->ext3 == START_FLASH_MAGIC) bootrom_unlocked = 1;\r
+            if(c->arg[2] == START_FLASH_MAGIC) bootrom_unlocked = 1;\r
             else bootrom_unlocked = 0;\r
             {\r
                 int prot_start = (int)&_bootrom_start;\r
                 int prot_end = (int)&_bootrom_end;\r
                 int allow_start = (int)&_flash_start;\r
                 int allow_end = (int)&_flash_end;\r
             else bootrom_unlocked = 0;\r
             {\r
                 int prot_start = (int)&_bootrom_start;\r
                 int prot_end = (int)&_bootrom_end;\r
                 int allow_start = (int)&_flash_start;\r
                 int allow_end = (int)&_flash_end;\r
-                int cmd_start = c->ext1;\r
-                int cmd_end = c->ext2;\r
+                int cmd_start = c->arg[0];\r
+                int cmd_end = c->arg[1];\r
 \r
                 /* Only allow command if the bootrom is unlocked, or the parameters are outside of the protected\r
                  * bootrom area. In any case they must be within the flash area.\r
 \r
                 /* Only allow command if the bootrom is unlocked, or the parameters are outside of the protected\r
                  * bootrom area. In any case they must be within the flash area.\r
index afed17a47110bd0039759bcb7c1b3220825c5e70..8cbb98c4c3c368ff1261d3b1426ff3bb3f0f6c06 100644 (file)
@@ -78,7 +78,7 @@ typedef signed short SWORD;
 \r
 #include <usb_cmd.h>\r
 \r
 \r
 #include <usb_cmd.h>\r
 \r
-#define PACKED __attribute__((__packed__))\r
+//#define PACKED __attribute__((__packed__))\r
 \r
 #define USB_D_PLUS_PULLUP_ON() { \\r
                HIGH(GPIO_USB_PU); \\r
 \r
 #define USB_D_PLUS_PULLUP_ON() { \\r
                HIGH(GPIO_USB_PU); \\r
Impressum, Datenschutz