Ignore:
Timestamp:
2010-11-20T17:04:59Z (14 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
dd5046dd
Parents:
fdbc3ff
Message:

Redefine packet_t to be just a type alias for struct packet.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/packet/generic/packet_server.c

    rfdbc3ff r46d4d9f  
    6969        fibril_mutex_t lock;
    7070        /** Free packet queues. */
    71         packet_t free[FREE_QUEUES_COUNT];
     71        packet_t *free[FREE_QUEUES_COUNT];
    7272       
    7373        /**
     
    103103};
    104104
    105 int packet_translate_local(int phone, packet_t *packet, packet_id_t packet_id)
     105int packet_translate_local(int phone, packet_t **packet, packet_id_t packet_id)
    106106{
    107107        if (!packet)
     
    122122 */
    123123static void
    124 packet_init(packet_t packet, size_t addr_len, size_t max_prefix,
     124packet_init(packet_t *packet, size_t addr_len, size_t max_prefix,
    125125    size_t max_content, size_t max_suffix)
    126126{
    127127        // clear the packet content
    128         bzero(((void *) packet) + sizeof(struct packet),
    129             packet->length - sizeof(struct packet));
     128        bzero(((void *) packet) + sizeof(packet_t),
     129            packet->length - sizeof(packet_t));
    130130       
    131131        // clear the packet header
     
    135135        packet->next = 0;
    136136        packet->addr_len = 0;
    137         packet->src_addr = sizeof(struct packet);
     137        packet->src_addr = sizeof(packet_t);
    138138        packet->dest_addr = packet->src_addr + addr_len;
    139139        packet->max_prefix = max_prefix;
     
    157157 * @return              NULL if there is not enough memory left.
    158158 */
    159 static packet_t
     159static packet_t *
    160160packet_create(size_t length, size_t addr_len, size_t max_prefix,
    161161    size_t max_content, size_t max_suffix)
    162162{
    163         packet_t packet;
     163        packet_t *packet;
    164164        int rc;
    165165
    166166        // already locked
    167         packet = (packet_t) mmap(NULL, length, PROTO_READ | PROTO_WRITE,
     167        packet = (packet_t *) mmap(NULL, length, PROTO_READ | PROTO_WRITE,
    168168            MAP_SHARED | MAP_ANONYMOUS, 0, 0);
    169169        if (packet == MAP_FAILED)
     
    198198 * @return              NULL if there is not enough memory left.
    199199 */
    200 static packet_t
     200static packet_t *
    201201packet_get_local(size_t addr_len, size_t max_prefix, size_t max_content,
    202202    size_t max_suffix)
    203203{
    204         size_t length = ALIGN_UP(sizeof(struct packet) + 2 * addr_len +
     204        size_t length = ALIGN_UP(sizeof(packet_t) + 2 * addr_len +
    205205            max_prefix + max_content + max_suffix, PAGE_SIZE);
    206206       
    207207        fibril_mutex_lock(&ps_globals.lock);
    208208       
    209         packet_t packet;
     209        packet_t *packet;
    210210        unsigned int index;
    211211       
     
    241241}
    242242
    243 packet_t packet_get_4_local(int phone, size_t max_content, size_t addr_len,
     243packet_t *packet_get_4_local(int phone, size_t max_content, size_t addr_len,
    244244    size_t max_prefix, size_t max_suffix)
    245245{
     
    247247}
    248248
    249 packet_t packet_get_1_local(int phone, size_t content)
     249packet_t *packet_get_1_local(int phone, size_t content)
    250250{
    251251        return packet_get_local(DEFAULT_ADDR_LEN, DEFAULT_PREFIX, content,
     
    260260 *
    261261 */
    262 static void packet_release(packet_t packet)
     262static void packet_release(packet_t *packet)
    263263{
    264264        int index;
     
    283283static int packet_release_wrapper(packet_id_t packet_id)
    284284{
    285         packet_t packet;
     285        packet_t *packet;
    286286
    287287        packet = pm_find(packet_id);
     
    310310 *                      async_share_in_finalize() function.
    311311 */
    312 static int packet_reply(const packet_t packet)
     312static int packet_reply(packet_t *packet)
    313313{
    314314        ipc_callid_t callid;
     
    351351    int *answer_count)
    352352{
    353         packet_t packet;
     353        packet_t *packet;
    354354
    355355        *answer_count = 0;
Note: See TracChangeset for help on using the changeset viewer.