Changeset ef94150f in rtems


Ignore:
Timestamp:
Apr 12, 2016, 11:53:42 AM (4 years ago)
Author:
Daniel Hellstrom <daniel@…>
Branches:
master
Children:
418149c8
Parents:
a7cc0da9
git-author:
Daniel Hellstrom <daniel@…> (04/12/16 11:53:42)
git-committer:
Daniel Hellstrom <daniel@…> (03/06/17 06:54:55)
Message:

leon, grspw_pkt: Added checks for special list cases

  • Fixed grspw_dma_tx_send() so that it does not fail when an empty user packet is provided.
  • Added empty checks on some of the list handling inline functions for GRSPW_PKT. Their use by the driver may be correct already, but the user might not have been aware of the assumptions that certain lists had to be non-empty.
Location:
c/src/lib/libbsp/sparc/shared
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/sparc/shared/include/grspw_pkt.h

    ra7cc0da9 ref94150f  
    649649grspw_list_append_list(struct grspw_list *list, struct grspw_list *alist)
    650650{
     651        if (grspw_list_is_empty(alist)) {
     652                return;
     653        }
    651654        alist->tail->next = NULL;
    652655        if ( list->tail == NULL ) {
     
    661664grspw_list_prepend_list(struct grspw_list *list, struct grspw_list *alist)
    662665{
     666        if (grspw_list_is_empty(alist)) {
     667                return;
     668        }
    663669        if ( list->head == NULL ) {
    664670                list->tail = alist->tail;
     
    674680grspw_list_remove_head_list(struct grspw_list *list, struct grspw_list *dlist)
    675681{
     682        if (grspw_list_is_empty(dlist)) {
     683                return;
     684        }
    676685        list->head = dlist->tail->next;
    677686        if ( list->head == NULL ) {
  • c/src/lib/libbsp/sparc/shared/spw/grspw_pkt.c

    ra7cc0da9 ref94150f  
    18421842
    18431843        /* 2. Add the requested packets to the SEND List (USER->SEND) */
    1844         if (pkts) {
     1844        if (pkts && (count > 0)) {
    18451845                grspw_list_append_list(&dma->send, pkts);
    18461846                dma->send_cnt += count;
     
    31053105                    RTEMS_SUCCESSFUL)
    31063106                        return -1;
    3107         }
     3107}
    31083108
    31093109        grspw_initialized = 1;
Note: See TracChangeset for help on using the changeset viewer.