Changeset f334847b in rtems


Ignore:
Timestamp:
Jan 17, 2014, 1:57:08 AM (6 years ago)
Author:
Nick Withers <nick.withers@…>
Branches:
4.11, master
Children:
c26a945
Parents:
a7775cb
git-author:
Nick Withers <nick.withers@…> (01/17/14 01:57:08)
git-committer:
Gedare Bloom <gedare@…> (01/23/14 16:30:15)
Message:

powerpc/flash: give string variables const attribute

Location:
c/src/lib/libbsp/powerpc/shared/flash
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/powerpc/shared/flash/flash.c

    ra7775cb rf334847b  
    105105
    106106static struct bankdesc *
    107 argcheck(int bank, uint32_t offset, char *src, uint32_t size);
     107argcheck(int bank, uint32_t offset, const char *src, uint32_t size);
    108108
    109109/* Type definitions */
     
    224224
    225225STATIC uint32_t
    226 BSP_flashWriteDataRaw(struct bankdesc *b, uint32_t addr, char *src, uint32_t n_words, int quiet)
    227 {
    228 uint32_t sta;
    229 uint32_t N;
    230 uint32_t nxt, a, i, bufsz;
    231 uint32_t then, now;
    232 unsigned f;
    233 char    *s;
     226BSP_flashWriteDataRaw(struct bankdesc *b, uint32_t addr, const char *src, uint32_t n_words, int quiet)
     227{
     228uint32_t   sta;
     229uint32_t   N;
     230uint32_t   nxt, a, i, bufsz;
     231uint32_t   then, now;
     232unsigned   f;
     233const char *s;
    234234
    235235#ifdef DEBUG
     
    478478
    479479static struct bankdesc *
    480 argcheck(int bank, uint32_t offset, char *src, uint32_t size)
     480argcheck(int bank, uint32_t offset, const char *src, uint32_t size)
    481481{
    482482struct bankdesc *b;
     
    515515 */
    516516STATIC int
    517 regionCheckAndErase(int bank, uint32_t offset, char *src, uint32_t n_bytes, int quiet)
     517regionCheckAndErase(int bank, uint32_t offset, const char *src, uint32_t n_bytes, int quiet)
    518518{
    519519struct bankdesc *b;
     
    595595
    596596STATIC int
    597 BSP_flashWriteRegion(int bank, uint32_t offset, char *src, uint32_t n_bytes, int quiet)
     597BSP_flashWriteRegion(int bank, uint32_t offset, const char *src, uint32_t n_bytes, int quiet)
    598598{
    599599struct bankdesc *b = BSP_flashBspOps.bankcheck(bank, 0);        /* caller did bankValidate() */
     
    602602uint32_t     o,i,a,e;
    603603int          err;
    604 char        *p;
     604const char   *p;
    605605union bconv  buf;
    606606
     
    731731
    732732int
    733 BSP_flashWrite(int bank, uint32_t offset, char *src, uint32_t n_bytes, int quiet)
     733BSP_flashWrite(int bank, uint32_t offset, const char *src, uint32_t n_bytes, int quiet)
    734734{
    735735int      rval;
     
    768768
    769769int
    770 BSP_flashWriteFile(int bank, uint32_t offset, char *fname, int quiet)
     770BSP_flashWriteFile(int bank, uint32_t offset, const char *fname, int quiet)
    771771{
    772772int             fd   = -1;
  • c/src/lib/libbsp/powerpc/shared/flash/flashPgm.h

    ra7775cb rf334847b  
    111111 */
    112112int
    113 BSP_flashWrite(int bank, uint32_t offset, char *src, uint32_t n_bytes, int quiet);
     113BSP_flashWrite(int bank, uint32_t offset, const char *src, uint32_t n_bytes, int quiet);
    114114
    115115/* Copy contents of a file to flash.
     
    123123 */
    124124int
    125 BSP_flashWriteFile(int bank, uint32_t offset, char *path, int quiet);
     125BSP_flashWriteFile(int bank, uint32_t offset, const char *path, int quiet);
    126126
    127127/* Dump info about available flash to file
  • c/src/lib/libbsp/powerpc/shared/flash/flashPgmPvt.h

    ra7775cb rf334847b  
    245245 * RETURNS: failure status or zero on success.
    246246 */
    247         uint32_t       (*write_line)(struct bankdesc *b, uint32_t addr, char *src, uint32_t N);
     247        uint32_t       (*write_line)(struct bankdesc *b, uint32_t addr, const char *src, uint32_t N);
    248248};
    249249
  • c/src/lib/libbsp/powerpc/shared/flash/intelFlash.c

    ra7775cb rf334847b  
    142142
    143143STATIC uint32_t
    144 flash_write_line_intel(struct bankdesc *, uint32_t, char *, uint32_t);
     144flash_write_line_intel(struct bankdesc *, uint32_t, const char *, uint32_t);
    145145
    146146/********* Global Variables ********************/
     
    393393
    394394STATIC uint32_t
    395 flash_write_line_intel(struct bankdesc *b, uint32_t a, char *s, uint32_t N)
     395flash_write_line_intel(struct bankdesc *b, uint32_t a, const char *s, uint32_t N)
    396396{
    397397uint32_t sta, Nspla, nxt, j;
     
    417417        for (nxt = a; N>0; N--) {
    418418#if defined(TESTING) || (DEBUG > 4)
    419                 printf("Writing DAT *0x%08"PRIx32" = 0x%08"PRIx32"\n", nxt, *(uint32_t*)s);
     419                printf("Writing DAT *0x%08"PRIx32" = 0x%08"PRIx32"\n", nxt, *(const uint32_t*)s);
    420420#endif
    421421                /* deal with misaligned sources */
  • c/src/lib/libbsp/powerpc/shared/flash/spansionFlash.c

    ra7775cb rf334847b  
    105105
    106106STATIC uint32_t
    107 flash_write_line_s160(struct bankdesc *, uint32_t, char *, uint32_t);
     107flash_write_line_s160(struct bankdesc *, uint32_t, const char *, uint32_t);
    108108
    109109/********* Global Variables ********************/
     
    427427
    428428STATIC uint32_t
    429 flash_write_line_s160(struct bankdesc *b, uint32_t a, char *s, uint32_t N)
     429flash_write_line_s160(struct bankdesc *b, uint32_t a, const char *s, uint32_t N)
    430430{
    431431uint32_t        sta, nxt, j, v;
Note: See TracChangeset for help on using the changeset viewer.