Index: contrib/vchiq/interface/compat/vchi_bsd.h =================================================================== --- contrib/vchiq/interface/compat/vchi_bsd.h (revision 311939) +++ contrib/vchiq/interface/compat/vchi_bsd.h (working copy) @@ -28,6 +28,7 @@ #ifndef __VCHI_BSD_H__ #define __VCHI_BSD_H__ +#include #include #include #include @@ -41,7 +42,6 @@ #include #include #include -#include #include /* @@ -431,6 +431,8 @@ #define smp_rmb rmb #define smp_wmb wmb +#define DSB() dsb(st) + #define device_print_prettyname(dev) device_printf((dev), "") #endif /* __VCHI_BSD_H__ */ Index: contrib/vchiq/interface/vchi/vchi.h =================================================================== --- contrib/vchiq/interface/vchi/vchi.h (revision 311939) +++ contrib/vchiq/interface/vchi/vchi.h (working copy) @@ -109,14 +109,11 @@ #define FOURCC_TO_CHAR(x) (x >> 24) & 0xFF,(x >> 16) & 0xFF,(x >> 8) & 0xFF, x & 0xFF -// Opaque service information -struct opaque_vchi_service_t; - // Descriptor for a held message. Allocated by client, initialised by vchi_msg_hold, // vchi_msg_iter_hold or vchi_msg_iter_hold_next. Fields are for internal VCHI use only. typedef struct { - struct opaque_vchi_service_t *service; + OPAQUE_VCHI_SERVICE_T service; void *message; } VCHI_HELD_MSG_T; Index: contrib/vchiq/interface/vchi/vchi_common.h =================================================================== --- contrib/vchiq/interface/vchi/vchi_common.h (revision 311939) +++ contrib/vchiq/interface/vchi/vchi_common.h (working copy) @@ -157,7 +157,9 @@ // Opaque type for a message driver typedef struct opaque_vchi_message_driver_t VCHI_MESSAGE_DRIVER_T; +typedef unsigned int OPAQUE_VCHI_SERVICE_T; + // Iterator structure for reading ahead through received message queue. Allocated by client, // initialised by vchi_msg_look_ahead. Fields are for internal VCHI use only. // Iterates over messages in queue at the instant of the call to vchi_msg_lookahead - @@ -165,7 +167,7 @@ // is used again after messages for that service are removed/dequeued by any // means other than vchi_msg_iter_... calls on the iterator itself. typedef struct { - struct opaque_vchi_service_t *service; + OPAQUE_VCHI_SERVICE_T service; void *last; void *next; void *remove; Index: contrib/vchiq/interface/vchiq_arm/vchiq_2835_arm.c =================================================================== --- contrib/vchiq/interface/vchiq_arm/vchiq_2835_arm.c (revision 311939) +++ contrib/vchiq/interface/vchiq_arm/vchiq_2835_arm.c (working copy) @@ -205,7 +205,7 @@ bcm_mbox_write(BCM2835_MBOX_CHAN_VCHIQ, (unsigned int)g_slot_phys); vchiq_log_info(vchiq_arm_log_level, - "vchiq_init - done (slots %x, phys %x)", + "vchiq_init - done (slots %x, phys %jx)", (unsigned int)vchiq_slot_zero, g_slot_phys); vchiq_call_connected_callbacks(); @@ -458,7 +458,7 @@ } vchiq_log_trace(vchiq_arm_log_level, - "create_pagelist - %x (%d bytes @%p)", (unsigned int)pagelist, count, buf); + "create_pagelist - %x (%zu bytes @%p)", (unsigned int)pagelist, count, buf); if (!pagelist) return -ENOMEM; @@ -535,8 +535,7 @@ (fragments - g_fragments_base)/g_fragment_size; } - pa = pmap_extract(PCPU_GET(curpmap), (vm_offset_t)buf); - dcache_wbinv_poc((vm_offset_t)buf, pa, count); + cpu_dcache_wbinv_range((vm_offset_t)buf, count); bus_dmamap_sync(bi->pagelist_dma_tag, bi->pagelist_dma_map, BUS_DMASYNC_PREWRITE); Index: contrib/vchiq/interface/vchiq_arm/vchiq_core.c =================================================================== --- contrib/vchiq/interface/vchiq_arm/vchiq_core.c (revision 311939) +++ contrib/vchiq/interface/vchiq_arm/vchiq_core.c (working copy) @@ -437,7 +437,7 @@ { if (!event->fired) { event->armed = 1; - dsb(); + DSB(); if (!event->fired) { if (down_interruptible(event->event) != 0) { event->armed = 0; @@ -1849,7 +1849,7 @@ bulk = &queue->bulks[ BULK_INDEX(queue->remote_insert)]; bulk->remote_data = - (void *)((int *)header->data)[0]; + (void *)(uintptr_t)((int *)header->data)[1]; bulk->remote_size = ((int *)header->data)[1]; wmb(); @@ -3817,8 +3817,8 @@ vchiq_dump(dump_context, buf, len + 1); len = snprintf(buf, sizeof(buf), - " Ctrl: tx_count=%d, tx_bytes=%llu, " - "rx_count=%d, rx_bytes=%llu", + " Ctrl: tx_count=%d, tx_bytes=%ju, " + "rx_count=%d, rx_bytes=%ju", service->stats.ctrl_tx_count, service->stats.ctrl_tx_bytes, service->stats.ctrl_rx_count, @@ -3826,8 +3826,8 @@ vchiq_dump(dump_context, buf, len + 1); len = snprintf(buf, sizeof(buf), - " Bulk: tx_count=%d, tx_bytes=%llu, " - "rx_count=%d, rx_bytes=%llu", + " Bulk: tx_count=%d, tx_bytes=%ju, " + "rx_count=%d, rx_bytes=%ju", service->stats.bulk_tx_count, service->stats.bulk_tx_bytes, service->stats.bulk_rx_count, Index: contrib/vchiq/interface/vchiq_arm/vchiq_core.h =================================================================== --- contrib/vchiq/interface/vchiq_arm/vchiq_core.h (revision 311939) +++ contrib/vchiq/interface/vchiq_arm/vchiq_core.h (working copy) @@ -185,11 +185,11 @@ #define DEBUG_INITIALISE(local) int *debug_ptr = (local)->debug; #define DEBUG_TRACE(d) \ - do { debug_ptr[DEBUG_ ## d] = __LINE__; dsb(); } while (0) + do { debug_ptr[DEBUG_ ## d] = __LINE__; DSB(); } while (0) #define DEBUG_VALUE(d, v) \ - do { debug_ptr[DEBUG_ ## d] = (v); dsb(); } while (0) + do { debug_ptr[DEBUG_ ## d] = (v); DSB(); } while (0) #define DEBUG_COUNT(d) \ - do { debug_ptr[DEBUG_ ## d]++; dsb(); } while (0) + do { debug_ptr[DEBUG_ ## d]++; DSB(); } while (0) #else /* VCHIQ_ENABLE_DEBUG */ Index: contrib/vchiq/interface/vchiq_arm/vchiq_kmod.c =================================================================== --- contrib/vchiq/interface/vchiq_arm/vchiq_kmod.c (revision 311939) +++ contrib/vchiq/interface/vchiq_arm/vchiq_kmod.c (working copy) @@ -47,7 +47,6 @@ #include #include -#include #include "vchiq_arm.h" #include "vchiq_2835.h" @@ -124,7 +123,7 @@ has completed */ if (event->armed) { /* trigger vc interrupt */ - dsb(); + DSB(); vchiq_write_4(0x48, 0); } } Index: contrib/vchiq/interface/vchiq_arm/vchiq_shim.c =================================================================== --- contrib/vchiq/interface/vchiq_arm/vchiq_shim.c (revision 311939) +++ contrib/vchiq/interface/vchiq_arm/vchiq_shim.c (working copy) @@ -443,8 +443,7 @@ *data = header->data; *msg_size = header->size; - message_handle->service = - (struct opaque_vchi_service_t *)service->handle; + message_handle->service = service->handle; message_handle->message = header; return 0;