Changeset 13279f5d in rtems


Ignore:
Timestamp:
Sep 7, 2007, 2:34:18 PM (12 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
050249d
Parents:
309cb3b5
Message:

2007-09-07 Daniel Hellstrom <daniel@…>

  • shared/1553/b1553brm.c, shared/can/grcan.c, shared/can/grcan_rasta.c, shared/can/occan.c, shared/spw/grspw.c, shared/spw/grspw_pci.c, shared/uart/apbuart.c: Remove warnings.
Location:
c/src/lib/libbsp/sparc
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/sparc/ChangeLog

    r309cb3b5 r13279f5d  
     12007-09-07      Daniel Hellstrom <daniel@gaisler.com>
     2
     3        * shared/1553/b1553brm.c, shared/can/grcan.c, shared/can/grcan_rasta.c,
     4        shared/can/occan.c, shared/spw/grspw.c, shared/spw/grspw_pci.c,
     5        shared/uart/apbuart.c: Remove warnings.
     6
    172007-09-06      Daniel Hellstrom <daniel@gaisler.com>
    28
  • c/src/lib/libbsp/sparc/shared/1553/b1553brm.c

    r309cb3b5 r13279f5d  
    4040#ifndef B1553BRM_REG_INT
    4141 #define B1553BRM_REG_INT(handler,irqno,arg) set_vector(handler,(irqno)+0x10,1)
     42  #undef  B1553BRM_DEFINE_INTHANDLER
     43  #define B1553BRM_DEFINE_INTHANDLER
    4244#endif
    4345
     
    127129#endif
    128130
     131struct irq_log_list {
     132        volatile unsigned short iiw;
     133        volatile unsigned short iaw;
     134};
     135
    129136typedef struct {
    130137
     
    168175#endif
    169176                        /* interrupt log at 64 bytes from end */
    170                         struct {
    171                                 unsigned short iiw;
    172                                 unsigned short iaw;
    173                         } irq_logs[16];
     177                        struct irq_log_list irq_logs[16];
    174178                } *bcmem;
    175179
     
    204208                       
    205209                        /* interrupt log at 64 bytes from end */
    206                         struct {
    207                                 unsigned short iiw;
    208                                 unsigned short iaw;
    209                         } irq_logs[16];
     210                        struct irq_log_list irq_logs[16];
    210211                } *rtmem;
    211212#elif defined(DMA_MEM_16K)
     
    240241                       
    241242                        /* interrupt log at 64 bytes from end */
    242                         struct {
    243                                 unsigned short iiw;
    244                                 unsigned short iaw;
    245                         } irq_logs[16];
     243                        struct irq_log_list irq_logs[16];
    246244                } *rtmem;
    247245#else
     
    250248
    251249    /* Interrupt log list */
    252     struct irq_log_list {
    253         volatile unsigned short iiw;
    254         volatile unsigned short iaw;
    255     }  *irq_log;
     250    struct irq_log_list *irq_log;
    256251    unsigned int irq;
    257252
     
    292287
    293288static void brm_interrupt(brm_priv *brm);
     289#ifdef B1553BRM_DEFINE_INTHANDLER
    294290static void b1553brm_interrupt_handler(rtems_vector_number v);
     291#endif
    295292
    296293#define OFS(ofs) (((unsigned int)&ofs & 0x1ffff)>>1)
     
    362359                allbrm_memarea = B1553BRM_LOCAL_MEM_ADR;
    363360#else
    364                 allbrm_memarea = NULL;
     361                allbrm_memarea = 0;
    365362#endif
    366363               
     
    420417        }
    421418
    422         brm->irq_log = &brm->rtmem->irq_logs[0];
     419        brm->irq_log = (struct irq_log_list *)&brm->rtmem->irq_logs[0];
    423420
    424421        brm->regs->ctrl   = 0x1912;  /* enable both buses, circular 1 bufmode, broadcast, interrupt log */
     
    497494        brm->bcmem = (void *)brm->mem;
    498495        brm->rtmem = NULL;
    499         brm->irq_log = &brm->bcmem->irq_logs[0];
     496        brm->irq_log = (struct irq_log_list *)&brm->bcmem->irq_logs[0];
    500497       
    501498        brm->head = brm->tail = 0;
     
    544541
    545542        /* end of 16K, fits all current modes (128K, 16K) */
    546         brm->irq_log = &brm->mem[8*1024-16*2];
     543        brm->irq_log = (struct irq_log_list *)&brm->mem[8*1024-16*2];
    547544
    548545        brm->regs->ctrl   = 0x0006;  /* ping pong enable and enable interrupt log */
     
    590587               
    591588        /* allocate & zero memory for the brm devices */
    592         brms = malloc(sizeof(*brms)*dev_cnt);
     589        brms = (brm_priv *)malloc(sizeof(*brms)*dev_cnt);
    593590        if ( !brms ){
    594591                printk("BRM: Failed to allocate SW memory\n\r");
     
    602599        #define BRM_DESCS_PER_CTRL 128
    603600        if ( allbrm_memarea ){
    604                 mem = allbrm_memarea;
     601                mem = (char *)allbrm_memarea;
    605602        }else{
    606603                /* sizeof(struct desc_table) * BRM_DESCS_PER_CTRL * dev_cnt */
    607                 mem = malloc( (128*1024) * (dev_cnt+1)); /* 128k per core + 128k for alignment */
     604                mem = (char *)malloc( (128*1024) * (dev_cnt+1)); /* 128k per core + 128k for alignment */
    608605                if ( !mem ){
    609606                        free(brms);
     
    681678                brm->desc = (struct desc_table *) brm->memarea_base;
    682679                brm->mem = (volatile unsigned short *) brm->memarea_base;
    683           brm->irq_log  = (void *)(brm->memarea_base + (0xFFE0<<1)); /* last 64byte */
     680          brm->irq_log  = (struct irq_log_list *)(brm->memarea_base + (0xFFE0<<1)); /* last 64byte */
    684681               
    685682                brm->bm_event = NULL;
     
    11271124}
    11281125
     1126#ifdef B1553BRM_DEFINE_INTHANDLER
    11291127static void b1553brm_interrupt_handler(rtems_vector_number v){
    11301128        int i;
     
    11371135        }
    11381136}
     1137#endif
    11391138
    11401139static void brm_interrupt(brm_priv *brm) {
     
    11431142        int len;
    11441143        int signal_event=0;
    1145         unsigned int event_status;
    1146         #define SET_ERROR_DESCRIPTOR(descriptor) (event_status = (event_status & 0x0000ffff) | descriptor<<16);
     1144        unsigned int event_status=0;
     1145        #define SET_ERROR_DESCRIPTOR(descriptor) (event_status = (event_status & 0x0000ffff) | descriptor<<16)
    11471146               
    11481147        while( (iiw=READ_REG(&brm->irq_log[brm->irq].iiw)) != 0xffff ){
  • c/src/lib/libbsp/sparc/shared/can/grcan.c

    r309cb3b5 r13279f5d  
    8383#ifndef GRCAN_REG_INT
    8484 #define GRCAN_REG_INT(handler,irqno,arg) set_vector(handler,irqno+0x10,1)
     85 #undef  GRCAN_DEFINE_INTHANDLER
     86 #define GRCAN_DEFINE_INTHANDLER
    8587#endif
    8688
     
    228230struct grcan_priv *grcans;
    229231static amba_confarea_type *amba_bus;
    230 static unsigned int ram_base;
    231232struct grcan_device_info *grcan_cores;
    232233static int grcan_core_cnt;
  • c/src/lib/libbsp/sparc/shared/can/grcan_rasta.c

    r309cb3b5 r13279f5d  
    5959
    6060#define STATIC_TX_BUF_ADDR(core) \
    61         (grcan_rasta_rambase+(core)*(STATIC_TX_BUF_SIZE+STATIC_RX_BUF_SIZE))
     61        ((unsigned int *)\
     62  (grcan_rasta_rambase+(core)*(STATIC_TX_BUF_SIZE+STATIC_RX_BUF_SIZE)))
    6263
    6364#define STATIC_RX_BUF_ADDR(core) \
    64         (grcan_rasta_rambase+(core)*(STATIC_TX_BUF_SIZE+STATIC_RX_BUF_SIZE)+STATIC_RX_BUF_SIZE)
     65  ((unsigned int *) \
     66        (grcan_rasta_rambase+(core)*(STATIC_TX_BUF_SIZE+STATIC_RX_BUF_SIZE)+STATIC_RX_BUF_SIZE))
    6567 
    6668 
    6769#define GRCAN_DEVNAME "/dev/grcan0"
    6870#define GRCAN_DEVNAME_NO(devstr,no) ((devstr)[10]='0'+(no))
    69 
    70 static int grcan_rasta_calc_memoffs(int maxcores, int corenum, unsigned int *mem_base, unsigned int *mem_end, unsigned int *bdtable_base);
    7171
    7272void grcan_rasta_interrupt_handler(int irq, void *pDev);
  • c/src/lib/libbsp/sparc/shared/can/occan.c

    r309cb3b5 r13279f5d  
    6666#ifndef OCCAN_REG_INT
    6767        #define OCCAN_REG_INT(handler,irq,arg) set_vector(handler,irq+0x10,1)
     68  #undef  OCCAN_DEFINE_INTHANDLER
     69  #define OCCAN_DEFINE_INTHANDLER
    6870#endif
    6971
     
    259261static void pelican_init(occan_priv *priv);
    260262static void pelican_open(occan_priv *priv);
    261 static void pelican_close(occan_priv *priv);
    262263static int pelican_start(occan_priv *priv);
    263264static void pelican_stop(occan_priv *priv);
    264 static void pelican_exit(occan_priv *priv);
    265265static int pelican_send(occan_priv *can, CANMsg *msg);
    266266static void pelican_set_accept(occan_priv *priv, unsigned char *acode, unsigned char *amask);
    267267static void occan_interrupt(occan_priv *can);
     268#ifdef DEBUG_PRINT_REGMAP
    268269static void pelican_regadr_print(pelican_regs *regs);
     270#endif
    269271
    270272/***** Driver related interface *****/
     
    275277static rtems_device_driver occan_open(rtems_device_major_number major, rtems_device_minor_number minor, void *arg);
    276278static rtems_device_driver occan_initialize(rtems_device_major_number major, rtems_device_minor_number unused, void *arg);
     279#ifdef OCCAN_DEFINE_INTHANDLER
    277280static void occan_interrupt_handler(rtems_vector_number v);
    278 
     281#endif
    279282static int can_cores;
    280283static occan_priv *cans;
     
    430433}
    431434
    432 static void pelican_close(occan_priv *priv){
    433 
    434         /* disable all interrupts */
    435         priv->regs->inten = 0;
    436        
    437         priv->regs->mode = PELICAN_MOD_RESET;
    438 }
    439 
    440435static int pelican_start(occan_priv *priv){
    441436        unsigned char tmp;
     
    509504}
    510505
    511 
    512 static void pelican_exit(occan_priv *priv){
    513         /* reset core */
    514         priv->regs->mode = PELICAN_MOD_RESET;
    515 }
    516506
    517507/* Try to send message "msg", if hardware txfifo is
     
    596586}
    597587
     588#ifdef DEBUG
    598589static void pelican_regs_print(pelican_regs *regs){
    599590        printk("--- PELICAN 0x%lx ---\n\r",(unsigned int)regs);
     
    628619        printk("-------------------\n\r");
    629620}
    630 
     621#endif
     622
     623#ifdef DEBUG_PRINT_REGMAP
    631624static void pelican_regadr_print(pelican_regs *regs){
    632625        printk("--- PELICAN 0x%lx ---\n\r",(unsigned int)regs);
     
    718711        printk("-------------------\n\r");
    719712}
    720 
     713#endif
     714
     715#ifdef DEBUG
    721716static void occan_stat_print(occan_stats *stats){
    722717        printk("----Stats----\n\r");
     
    732727        printk("-------------\n\r");
    733728}
     729#endif
    734730
    735731/* This function calculates BTR0 BTR1 values for a given bitrate.
     
    13921388        struct occan_afilter *afilter;
    13931389        occan_stats *dststats;
    1394         unsigned char btr0, btr1;
    13951390        unsigned int rxcnt,txcnt;
    13961391       
     
    17951790}
    17961791
     1792#ifdef OCCAN_DEFINE_INTHANDLER
    17971793static void occan_interrupt_handler(rtems_vector_number v){
    17981794        int minor;
     
    18061802        }
    18071803}
     1804#endif
    18081805
    18091806#define OCCAN_DRIVER_TABLE_ENTRY { occan_initialize, occan_open, occan_close, occan_read, occan_write, occan_ioctl }
  • c/src/lib/libbsp/sparc/shared/spw/grspw.c

    r309cb3b5 r13279f5d  
    6868#ifndef GRSPW_REG_INT
    6969 #define GRSPW_REG_INT(handler,irqno,arg) set_vector(handler,irqno+0x10,1)
     70 #undef  GRSPW_DEFINE_INTHANDLER
     71 #define GRSPW_DEFINE_INTHANDLER
    7072#endif
    7173
     
    304306
    305307static int grspw_hw_init(GRSPW_DEV *pDev);
    306 static int grspw_hw_send(GRSPW_DEV *pDev, unsigned int hlen, unsigned char *hdr, unsigned int dlen, unsigned char *data);
    307 static int grspw_hw_receive(GRSPW_DEV *pDev,unsigned char *b,int c);
     308static int grspw_hw_send(GRSPW_DEV *pDev, unsigned int hlen, char *hdr, unsigned int dlen, char *data);
     309static int grspw_hw_receive(GRSPW_DEV *pDev,char *b,int c);
    308310static int grspw_hw_startup (GRSPW_DEV *pDev, int timeout);
    309311static int grspw_hw_stop (GRSPW_DEV *pDev, int rx, int tx);
     
    501503}
    502504
     505#ifdef GRSPW_DEFINE_INTHANDLER
    503506/*
    504507 *  Standard Interrupt handler
     
    515518        }
    516519}
     520#endif
    517521
    518522static void grspw_interrupt(GRSPW_DEV *pDev){
     
    14651469}
    14661470
    1467 int grspw_hw_send(GRSPW_DEV *pDev, unsigned int hlen, unsigned char *hdr, unsigned int dlen, unsigned char *data)
     1471int grspw_hw_send(GRSPW_DEV *pDev, unsigned int hlen, char *hdr, unsigned int dlen, char *data)
    14681472{
    14691473       
     
    15401544}
    15411545
    1542 static int grspw_hw_receive(GRSPW_DEV *pDev, unsigned char *b, int c) {
     1546static int grspw_hw_receive(GRSPW_DEV *pDev, char *b, int c) {
    15431547        unsigned int len, rxlen, ctrl;
    15441548        unsigned int cur;
  • c/src/lib/libbsp/sparc/shared/spw/grspw_pci.c

    r309cb3b5 r13279f5d  
    106106int grspwpci_interrupt_handler(int irq, void *arg){
    107107        grspw_interrupt( (GRSPW_DEV *)arg );
     108  return 0;
    108109}
    109110
  • c/src/lib/libbsp/sparc/shared/uart/apbuart.c

    r309cb3b5 r13279f5d  
    4545#ifndef APBUART_REG_INT
    4646        #define APBUART_REG_INT(handler,irq,arg) set_vector(handler,irq+0x10,1)
     47  #undef APBUART_DEFINE_INTHANDLER
     48  #define APBUART_DEFINE_INTHANDLER
    4749#endif
    4850
     
    118120
    119121static void apbuart_interrupt(apbuart_priv *uart);
     122#ifdef APBUART_DEFINE_INTHANDLER
    120123static void apbuart_interrupt_handler(rtems_vector_number v);
     124#endif
    121125static void apbuart_hw_close(apbuart_priv *uart);
    122126static void apbuart_hw_open(apbuart_priv *uart);
     
    214218}
    215219
     220#ifdef APBUART_DEFINE_INTHANDLER
    216221/* interrupt handler */
    217222static void apbuart_interrupt_handler(rtems_vector_number v){
     
    226231        }
    227232}
     233#endif
    228234
    229235/* The interrupt handler, taking care of the
Note: See TracChangeset for help on using the changeset viewer.