]> git.sur5r.net Git - openocd/commitdiff
search and replace usleep(1000) with alive_sleep(1) to avoid GDB timeouts.
authoroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Tue, 19 Aug 2008 16:40:35 +0000 (16:40 +0000)
committeroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Tue, 19 Aug 2008 16:40:35 +0000 (16:40 +0000)
git-svn-id: svn://svn.berlios.de/openocd/trunk@942 b42882b7-edfa-0310-969c-e2dbd0fdcd60

13 files changed:
src/flash/at91sam7.c
src/flash/cfi.c
src/flash/lpc288x.c
src/flash/lpc3180_nand_controller.c
src/flash/nand.c
src/flash/s3c2410_nand.c
src/flash/s3c2440_nand.c
src/flash/stellaris.c
src/flash/stm32x.c
src/flash/str7x.c
src/flash/str9x.c
src/flash/str9xpec.c
src/flash/tms470.c

index 8c73601cda824135cd045f2aebc1a75c3aff1199..db90d30472330ffaa65ec4dcc838bb683ab91fda 100644 (file)
@@ -258,7 +258,7 @@ u32 at91sam7_wait_status_busy(flash_bank_t *bank, u8 flashplane, u32 waitbits, i
        while ((!((status = at91sam7_get_flash_status(bank,flashplane)) & waitbits)) && (timeout-- > 0))
        {
                LOG_DEBUG("status[%i]: 0x%x", flashplane, status);
-               usleep(1000);
+               alive_sleep(1);
        }
        
        LOG_DEBUG("status[%i]: 0x%x", flashplane, status);
index 68f9a0adf41f056ed7febe08af8c316a12c5e222..1ad6d266f01d4e197fd8be9723432d1576bf788c 100644 (file)
@@ -273,7 +273,7 @@ u8 cfi_intel_wait_status_busy(flash_bank_t *bank, int timeout)
        while ((!((status = cfi_get_u8(bank, 0, 0x0)) & 0x80)) && (timeout-- > 0))
        {
                LOG_DEBUG("status: 0x%x", status);
-               usleep(1000);
+               alive_sleep(1);
        }
 
        /* mask out bit 0 (reserved) */
@@ -333,7 +333,7 @@ int cfi_spansion_wait_status_busy(flash_bank_t *bank, int timeout)
                }
 
                oldstatus = status;
-               usleep(1000);
+               alive_sleep(1);
        } while (timeout-- > 0);
 
        LOG_ERROR("timeout, status: 0x%x", status);
index 3e22dd56cbb930c664aefa25432019d3f5eb0343..8c438f8e4ced22c8c7637138e7a2c7e8cfcf2eec 100644 (file)
@@ -138,7 +138,7 @@ u32 lpc288x_wait_status_busy(flash_bank_t *bank, int timeout)
        target_t *target = bank->target;
        do
        {
-               usleep(1000);
+               alive_sleep(1);
                timeout--;
                target_read_u32(target, F_STAT, &status);
        }while (((status & FS_DONE) == 0) && timeout);
index 8b6a5acefb8b3d64e49ef94018c9585f5054e5e5..8c7b6cbcc7755a4bfde0e75f9c307dd23a12a9d3 100644 (file)
@@ -824,7 +824,7 @@ int lpc3180_controller_ready(struct nand_device_s *device, int timeout)
                        return 1;
                }
 
-               usleep(1000);
+               alive_sleep(1);
        } while (timeout-- > 0);
        
        return 0;
@@ -864,7 +864,7 @@ int lpc3180_nand_ready(struct nand_device_s *device, int timeout)
                                return 1;
                }
                
-               usleep(1000);
+               alive_sleep(1);
        } while (timeout-- > 0);
        
        return 0;       
index 3e63335fcf4da594a66efa2d2aa115d7b16aa15c..a2d46cfdae3a358042d75c12b2501411c8631fd4 100644 (file)
@@ -355,7 +355,7 @@ int nand_read_status(struct nand_device_s *device, u8 *status)
        /* Send read status command */
        device->controller->command(device, NAND_CMD_STATUS);
        
-       usleep(1000);
+       alive_sleep(1);
        
        /* read status */
        if (device->device->options & NAND_BUSWIDTH_16)
index 65a66102c8bca60f6892c4b8bff45604f79eb1f8..fabcfbd54ba1a096103285cebb079c0edd78e3e0 100644 (file)
@@ -138,7 +138,7 @@ int s3c2410_nand_ready(struct nand_device_s *device, int timeout)
                if (status & S3C2410_NFSTAT_BUSY)
                        return 1;
 
-               usleep(1000);           
+               alive_sleep(1);         
        } while (timeout-- > 0);
 
        return 0;
index 41081bff79386b99b7179933025fbe77d2fb8a94..7e9365af633ede0b3cca9007223aecada8dd3a91 100644 (file)
@@ -114,7 +114,7 @@ int s3c2440_nand_ready(struct nand_device_s *device, int timeout)
                if (status & S3C2440_NFSTAT_READY)
                        return 1;
 
-               usleep(1000);
+               alive_sleep(1);
        } while (timeout-- > 0);
 
 
index fa9445195200d3a57be37c5a6949babacede512f..e39978606c71b20bc85d8f0ba1cdc0cdb750a1b3 100644 (file)
@@ -410,7 +410,7 @@ u32 stellaris_wait_status_busy(flash_bank_t *bank, u32 waitbits, int timeout)
        while (((status = stellaris_get_flash_status(bank)) & waitbits) && (timeout-- > 0))
        {
                LOG_DEBUG("status: 0x%x", status);
-               usleep(1000);
+               alive_sleep(1);
        }
        
        /* Flash errors are reflected in the FLASH_CRIS register */
index 4a0dc4346eea741cf30bac4c633fbc784b158182..0f62da91194de04a46a690ccd5736e5fc625bd4c 100644 (file)
@@ -126,7 +126,7 @@ u32 stm32x_wait_status_busy(flash_bank_t *bank, int timeout)
        while (((status = stm32x_get_flash_status(bank)) & FLASH_BSY) && (timeout-- > 0))
        {
                LOG_DEBUG("status: 0x%x", status);
-               usleep(1000);
+               alive_sleep(1);
        }
        
        return status;
index 797fe2bc52b38a7c898831aa54d12ec5c6df9ef9..09d3b81770af90c87b22c5c2ab40a55aec39ca13 100644 (file)
@@ -283,7 +283,7 @@ int str7x_erase(struct flash_bank_s *bank, int first, int last)
        target_write_u32(target, str7x_get_flash_adr(bank, FLASH_CR0), cmd);
        
        while (((retval = str7x_status(bank)) & str7x_info->busy_bits)){
-               usleep(1000);
+               alive_sleep(1);
        }
        
        retval = str7x_result(bank);
@@ -339,7 +339,7 @@ int str7x_protect(struct flash_bank_s *bank, int set, int first, int last)
        target_write_u32(target, str7x_get_flash_adr(bank, FLASH_CR0), cmd);
        
        while (((retval = str7x_status(bank)) & str7x_info->busy_bits)){
-               usleep(1000);
+               alive_sleep(1);
        }
        
        retval = str7x_result(bank);
@@ -568,7 +568,7 @@ int str7x_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count)
                
                while (((retval = str7x_status(bank)) & str7x_info->busy_bits))
                {
-                       usleep(1000);
+                       alive_sleep(1);
                }
                
                retval = str7x_result(bank);
@@ -615,7 +615,7 @@ int str7x_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count)
                
                while (((retval = str7x_status(bank)) & str7x_info->busy_bits))
                {
-                       usleep(1000);
+                       alive_sleep(1);
                }
                
                retval = str7x_result(bank);
index c80e56ab53a3bb7e6f604be80f7169a3be388afa..e781c144d08021936572f84701a75edea43ad33d 100644 (file)
@@ -313,7 +313,7 @@ int str9x_erase(struct flash_bank_s *bank, int first, int last)
                        }
                        if( status & 0x80 )
                                break;
-                       usleep(1000);
+                       alive_sleep(1);
                }
                
                /* clear status, also clear read array */
@@ -576,7 +576,7 @@ int str9x_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count)
                        target_read_u8(target, bank_adr, &status);
                        if( status & 0x80 )
                                break;
-                       usleep(1000);
+                       alive_sleep(1);
                }
                
                /* clear status reg and read array */
@@ -618,7 +618,7 @@ int str9x_write(struct flash_bank_s *bank, u8 *buffer, u32 offset, u32 count)
                        target_read_u8(target, bank_adr, &status);
                        if( status & 0x80 )
                                break;
-                       usleep(1000);
+                       alive_sleep(1);
                }
                
                /* clear status reg and read array */
index f508e0bf8d96006a69385b573b9296b895176913..cefa2d9895fcf4588e7227ca2f2d543f01ded77a 100644 (file)
@@ -530,7 +530,7 @@ int str9xpec_erase_area(struct flash_bank_s *bank, int first, int last)
        
        /* wait for erase completion */
        while (!((status = str9xpec_isc_status(chain_pos)) & ISC_STATUS_BUSY)) {
-               usleep(1000);
+               alive_sleep(1);
        }
        
        free(buffer);
index f9d8cd79da0f7b5776d7a3553fc02e6e2cf47081..c7107b86e7d4cc4036e28f47a4e09a74e75d7042 100644 (file)
@@ -372,7 +372,7 @@ int tms470_try_flash_keys(target_t * target, const u32 * key_set)
                do
                {
                        target_read_u32(target, 0xFFE8A814, &fmbptr);
-                       usleep(1000);
+                       alive_sleep(1);
                }
                while (!(fmbptr & 0x0200));
 
@@ -718,7 +718,7 @@ int tms470_erase_sector(struct flash_bank_s *bank, int sector)
                target_read_u32(target, 0xFFE8BC0C, &fmmstat);
                if (fmmstat & 0x0100)
                {
-                       usleep(1000);
+                       alive_sleep(1);
                }
        }
        while (fmmstat & 0x0100);
@@ -932,7 +932,7 @@ int tms470_write(struct flash_bank_s *bank, u8 * buffer, u32 offset, u32 count)
                                target_read_u32(target, 0xFFE8BC0C, &fmmstat);
                                if (fmmstat & 0x0100)
                                {
-                                       usleep(1000);
+                                       alive_sleep(1);
                                }
                        }
                        while (fmmstat & 0x0100);