Changeset 2aaf804 in mainline


Ignore:
Timestamp:
2011-05-17T10:14:50Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5f94a0c
Parents:
5e6e50b
Message:

Use provided barriers instead of asm constructs.

Use warning instead of assert if malloc32 falls back to memalign.

Location:
uspace/drv
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/ohci/endpoint_list.c

    r5e6e50b r2aaf804  
    3434#include <errno.h>
    3535#include <usb/debug.h>
     36#include <arch/barrier.h>
    3637
    3738#include "endpoint_list.h"
     
    107108                last_ed = last->ed;
    108109        }
    109         /* keep link */
     110        /* Keep link */
    110111        hcd_ep->ed->next = last_ed->next;
     112        /* Make sure ED is written to the memory */
     113        write_barrier();
     114
     115        /* Add ed to the hw list */
    111116        ed_append_ed(last_ed, hcd_ep->ed);
    112 
    113         asm volatile ("": : :"memory");
     117        /* Make sure ED is updated */
     118        write_barrier();
     119
    114120
    115121        /* Add to the driver list */
     
    212218        assert((prev_ed->next & ED_NEXT_PTR_MASK) == addr_to_phys(hcd_ep->ed));
    213219        prev_ed->next = hcd_ep->ed->next;
    214 
    215         asm volatile ("": : :"memory");
     220        /* Make sure ED is updated */
     221        write_barrier();
     222
    216223        usb_log_debug("HCD EP(%p) removed (%s) from %s, next %x.\n",
    217224            hcd_ep, qpos, instance->name, hcd_ep->ed->next);
  • uspace/drv/uhci-hcd/transfer_list.c

    r5e6e50b r2aaf804  
    3434#include <errno.h>
    3535#include <usb/debug.h>
     36#include <arch/barrier.h>
    3637
    3738#include "transfer_list.h"
     
    126127        assert((pa & LINK_POINTER_ADDRESS_MASK) == pa);
    127128
     129        /* Make sure all data in the batch are written */
     130        write_barrier();
     131
    128132        /* keep link */
    129133        batch_qh(batch)->next = last_qh->next;
    130134        qh_set_next_qh(last_qh, batch_qh(batch));
    131135
    132         asm volatile ("": : :"memory");
     136        /* Make sure the pointer is updated */
     137        write_barrier();
    133138
    134139        /* Add to the driver list */
     
    222227            == addr_to_phys(batch_qh(batch)));
    223228        prev_qh->next = batch_qh(batch)->next;
    224         asm volatile ("": : :"memory");
     229
     230        /* Make sure the pointer is updated */
     231        write_barrier();
     232
    225233        /* Remove from the batch list */
    226234        list_remove(&batch->link);
  • uspace/drv/uhci-hcd/utils/malloc32.h

    r5e6e50b r2aaf804  
    7474        if (size <= SLAB_ELEMENT_SIZE)
    7575                return slab_malloc_g();
    76         assert(false);
     76        usb_log_warning("Requested %zu bytes, current allocator can't handle "
     77            "that amount, pray that the standard malloc will suffice.");
    7778        return memalign(UHCI_STRCUTURES_ALIGNMENT, size);
    7879}
Note: See TracChangeset for help on using the changeset viewer.