ppb_msq.c (185003) | ppb_msq.c (187576) |
---|---|
1/*- 2 * Copyright (c) 1998, 1999 Nicolas Souchu 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 13 unchanged lines hidden (view full) --- 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * 26 * 27 */ 28 29#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1998, 1999 Nicolas Souchu 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 13 unchanged lines hidden (view full) --- 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * 26 * 27 */ 28 29#include <sys/cdefs.h> |
30__FBSDID("$FreeBSD: head/sys/dev/ppbus/ppb_msq.c 185003 2008-11-16 17:42:02Z jhb $"); | 30__FBSDID("$FreeBSD: head/sys/dev/ppbus/ppb_msq.c 187576 2009-01-21 23:10:06Z jhb $"); |
31#include <machine/stdarg.h> 32 33#include <sys/param.h> | 31#include <machine/stdarg.h> 32 33#include <sys/param.h> |
34#include <sys/lock.h> 35#include <sys/mutex.h> |
|
34#include <sys/systm.h> 35#include <sys/bus.h> 36 37#include <dev/ppbus/ppbconf.h> 38#include <dev/ppbus/ppb_msq.h> 39 40#include "ppbus_if.h" 41 --- 68 unchanged lines hidden (view full) --- 110 * ppb_MS_init() 111 * 112 * Initialize device dependent submicrosequence of the current mode 113 * 114 */ 115int 116ppb_MS_init(device_t bus, device_t dev, struct ppb_microseq *loop, int opcode) 117{ | 36#include <sys/systm.h> 37#include <sys/bus.h> 38 39#include <dev/ppbus/ppbconf.h> 40#include <dev/ppbus/ppb_msq.h> 41 42#include "ppbus_if.h" 43 --- 68 unchanged lines hidden (view full) --- 112 * ppb_MS_init() 113 * 114 * Initialize device dependent submicrosequence of the current mode 115 * 116 */ 117int 118ppb_MS_init(device_t bus, device_t dev, struct ppb_microseq *loop, int opcode) 119{ |
120#ifdef INVARIANTS 121 struct ppb_data *ppb = device_get_softc(bus); 122#endif |
|
118 struct ppb_device *ppbdev = (struct ppb_device *)device_get_ivars(dev); 119 struct ppb_xfer *xfer = mode2xfer(bus, ppbdev, opcode); 120 | 123 struct ppb_device *ppbdev = (struct ppb_device *)device_get_ivars(dev); 124 struct ppb_xfer *xfer = mode2xfer(bus, ppbdev, opcode); 125 |
126 mtx_assert(ppb->ppc_lock, MA_OWNED); |
|
121 xfer->loop = loop; 122 123 return (0); 124} 125 126/* 127 * ppb_MS_exec() 128 * --- 131 unchanged lines hidden (view full) --- 260 261 /* microsequence executed to initialize the transfer */ 262 struct ppb_microseq initxfer[] = { 263 MS_PTR(MS_UNKNOWN), /* set ptr to buffer */ 264 MS_SET(MS_UNKNOWN), /* set transfer size */ 265 MS_RET(0) 266 }; 267 | 127 xfer->loop = loop; 128 129 return (0); 130} 131 132/* 133 * ppb_MS_exec() 134 * --- 131 unchanged lines hidden (view full) --- 266 267 /* microsequence executed to initialize the transfer */ 268 struct ppb_microseq initxfer[] = { 269 MS_PTR(MS_UNKNOWN), /* set ptr to buffer */ 270 MS_SET(MS_UNKNOWN), /* set transfer size */ 271 MS_RET(0) 272 }; 273 |
274 mtx_assert(ppb->ppc_lock, MA_OWNED); |
|
268 if (ppb->ppb_owner != dev) 269 return (EACCES); 270 271#define INCR_PC (mi ++) 272 273 mi = msq; 274 for (;;) { 275 switch (mi->opcode) { --- 64 unchanged lines hidden --- | 275 if (ppb->ppb_owner != dev) 276 return (EACCES); 277 278#define INCR_PC (mi ++) 279 280 mi = msq; 281 for (;;) { 282 switch (mi->opcode) { --- 64 unchanged lines hidden --- |