Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/ohci/hw_struct/hcca.h

    racdb5bac r3e48c93  
    3535#define DRV_OHCI_HW_STRUCT_HCCA_H
    3636
    37 #include <stdint.h>
    3837#include <malloc.h>
     38#include <sys/types.h>
     39#include <macros.h>
    3940
    4041#include "mem_access.h"
     
    5051        /** Frame number. */
    5152        uint16_t frame_number;
    52         uint16_t pad1;
     53        PADD16;
    5354        /** Pointer to the last completed TD. (useless) */
    5455        uint32_t done_head;
    5556        /** Padding to make the size 256B */
    56         uint32_t reserved[30];
     57        PADD32[30];
    5758} hcca_t;
     59
     60STATIC_ASSERT(sizeof(hcca_t) == 256);
    5861
    5962/** Allocate properly aligned structure.
     
    6568static inline hcca_t * hcca_get(void)
    6669{
    67         assert(sizeof(hcca_t) == 256);
    68         hcca_t *hcca = memalign(256, sizeof(hcca_t));
     70        hcca_t *hcca = memalign(sizeof(hcca_t), sizeof(hcca_t));
    6971        if (hcca)
    7072                memset(hcca, 0, sizeof(hcca_t));
     
    8082{
    8183        assert(hcca);
    82         assert(index < HCCA_INT_EP_COUNT);
     84        assert(index < ARRAY_SIZE(hcca->int_ep));
    8385        OHCI_MEM32_WR(hcca->int_ep[index], pa);
    84 
    8586}
    8687#endif
Note: See TracChangeset for help on using the changeset viewer.