ppb_msq.c (184130) | ppb_msq.c (185003) |
---|---|
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 184130 2008-10-21 18:30:10Z jhb $"); | 30__FBSDID("$FreeBSD: head/sys/dev/ppbus/ppb_msq.c 185003 2008-11-16 17:42:02Z jhb $"); |
31#include <machine/stdarg.h> 32 33#include <sys/param.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> --- 166 unchanged lines hidden (view full) --- 205 type = MS_TYP(param); 206 207 /* check the instruction position */ 208 if (arg >= PPB_MS_MAXARGS) 209 panic("%s: parameter out of range (0x%x)!", 210 __func__, param); 211 212#if 0 | 31#include <machine/stdarg.h> 32 33#include <sys/param.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> --- 166 unchanged lines hidden (view full) --- 205 type = MS_TYP(param); 206 207 /* check the instruction position */ 208 if (arg >= PPB_MS_MAXARGS) 209 panic("%s: parameter out of range (0x%x)!", 210 __func__, param); 211 212#if 0 |
213 printf("%s: param = %d, ins = %d, arg = %d, type = %d\n", | 213 printf("%s: param = %d, ins = %d, arg = %d, type = %d\n", |
214 __func__, param, ins, arg, type); 215#endif 216 217 /* properly cast the parameter */ 218 switch (type) { 219 case MS_TYP_INT: 220 msq[ins].arg[arg].i = va_arg(p_list, int); 221 break; --- 45 unchanged lines hidden (view full) --- 267 268 if (ppb->ppb_owner != dev) 269 return (EACCES); 270 271#define INCR_PC (mi ++) 272 273 mi = msq; 274 for (;;) { | 214 __func__, param, ins, arg, type); 215#endif 216 217 /* properly cast the parameter */ 218 switch (type) { 219 case MS_TYP_INT: 220 msq[ins].arg[arg].i = va_arg(p_list, int); 221 break; --- 45 unchanged lines hidden (view full) --- 267 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) { | 275 switch (mi->opcode) { |
276 case MS_OP_PUT: 277 case MS_OP_GET: 278 279 /* attempt to choose the best mode for the device */ 280 xfer = mode2xfer(bus, ppbdev, mi->opcode); 281 282 /* figure out if we should use ieee1284 code */ 283 if (!xfer->loop) { --- 26 unchanged lines hidden (view full) --- 310 ppb_MS_microseq(bus, dev, xfer->loop, &error); 311 312 if (error) 313 goto error; 314 315 INCR_PC; 316 break; 317 | 276 case MS_OP_PUT: 277 case MS_OP_GET: 278 279 /* attempt to choose the best mode for the device */ 280 xfer = mode2xfer(bus, ppbdev, mi->opcode); 281 282 /* figure out if we should use ieee1284 code */ 283 if (!xfer->loop) { --- 26 unchanged lines hidden (view full) --- 310 ppb_MS_microseq(bus, dev, xfer->loop, &error); 311 312 if (error) 313 goto error; 314 315 INCR_PC; 316 break; 317 |
318 case MS_OP_RET: | 318 case MS_OP_RET: |
319 if (ret) 320 *ret = mi->arg[0].i; /* return code */ 321 return (0); | 319 if (ret) 320 *ret = mi->arg[0].i; /* return code */ 321 return (0); |
322 break; | |
323 324 default: 325 /* executing microinstructions at ppc level is 326 * faster. This is the default if the microinstr 327 * is unknown here 328 */ 329 if ((error = PPBUS_EXEC_MICROSEQ( 330 device_get_parent(bus), &mi))) 331 goto error; 332 break; 333 } 334 next: 335 continue; 336 } 337error: 338 return (error); 339} 340 | 322 323 default: 324 /* executing microinstructions at ppc level is 325 * faster. This is the default if the microinstr 326 * is unknown here 327 */ 328 if ((error = PPBUS_EXEC_MICROSEQ( 329 device_get_parent(bus), &mi))) 330 goto error; 331 break; 332 } 333 next: 334 continue; 335 } 336error: 337 return (error); 338} 339 |