Deleted Added
sdiff udiff text old ( 256281 ) new ( 269921 )
full compact
1/* $FreeBSD: stable/10/sys/boot/usb/bsd_kernel.h 246363 2013-02-05 14:44:25Z hselasky $ */
2/*-
3 * Copyright (c) 2011 Hans Petter Selasky. 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
9 * notice, this list of conditions and the following disclaimer.

--- 22 unchanged lines hidden (view full) ---

32
33#include <sys/cdefs.h>
34#include <sys/queue.h>
35#include <sys/errno.h>
36
37#define isalpha(x) (((x) >= 'a' && (x) <= 'z') || ((x) >= 'A' && (x) <= 'Z'))
38#define isdigit(x) ((x) >= '0' && (x) <= '9')
39#define panic(...) do { printf("USB PANIC: " __VA_ARGS__); while (1) ; } while (0)
40#define M_USB 0
41#define M_USBDEV 0
42#define USB_PROC_MAX 3
43#define USB_BUS_GIANT_PROC(bus) (usb_process + 2)
44#define USB_BUS_NON_GIANT_PROC(bus) (usb_process + 2)
45#define USB_BUS_EXPLORE_PROC(bus) (usb_process + 0)
46#define USB_BUS_CONTROL_XFER_PROC(bus) (usb_process + 1)
47#define SYSCTL_DECL(...)

--- 43 unchanged lines hidden (view full) ---

91#define NULL ((void *)0)
92#define BUS_SPACE_BARRIER_READ 0x01
93#define BUS_SPACE_BARRIER_WRITE 0x02
94#define hz 1000
95#define PAGE_SIZE 4096
96#define MIN(a,b) (((a) < (b)) ? (a) : (b))
97#define MAX(a,b) (((a) > (b)) ? (a) : (b))
98#define MTX_DEF 0
99#define MTX_RECURSE 0
100#define SX_DUPOK 0
101#define SX_NOWITNESS 0
102#define WITNESS_WARN(...)
103#define cold 0
104#define BUS_PROBE_GENERIC 0
105#define CALLOUT_RETURNUNLOCKED 0x1
106#define va_list __builtin_va_list

--- 89 unchanged lines hidden (view full) ---

196 int owned;
197 struct mtx *parent;
198};
199
200#define mtx_assert(...) do { } while (0)
201void mtx_init(struct mtx *, const char *, const char *, int);
202void mtx_lock(struct mtx *);
203void mtx_unlock(struct mtx *);
204int mtx_owned(struct mtx *);
205void mtx_destroy(struct mtx *);
206
207extern struct mtx Giant;
208
209/* SX API */
210
211struct sx {

--- 49 unchanged lines hidden (view full) ---

261struct devclass;
262struct device;
263struct module;
264struct module_data;
265
266typedef struct driver driver_t;
267typedef struct devclass *devclass_t;
268typedef struct device *device_t;
269typedef void (intr_fn_t)(void *arg);
270
271typedef int device_attach_t (device_t dev);
272typedef int device_detach_t (device_t dev);
273typedef int device_resume_t (device_t dev);
274typedef int device_shutdown_t (device_t dev);
275typedef int device_probe_t (device_t dev);
276typedef int device_suspend_t (device_t dev);
277

--- 11 unchanged lines hidden (view full) ---

289struct device {
290 TAILQ_HEAD(device_list, device) dev_children;
291 TAILQ_ENTRY(device) dev_link;
292
293 struct device *dev_parent;
294 const struct module_data *dev_module;
295 void *dev_sc;
296 void *dev_aux;
297 intr_fn_t *dev_irq_fn;
298 void *dev_irq_arg;
299
300 uint16_t dev_unit;
301
302 char dev_nameunit[64];
303 char dev_desc[64];
304
305 uint8_t dev_res_alloc:1;

--- 30 unchanged lines hidden (view full) ---

336void *device_get_method(device_t dev, const char *what);
337const char *device_get_name(device_t dev);
338const char *device_get_nameunit(device_t dev);
339
340#define device_printf(dev, fmt,...) \
341 printf("%s: " fmt, device_get_nameunit(dev),## __VA_ARGS__)
342device_t device_add_child(device_t dev, const char *name, int unit);
343void device_quiet(device_t dev);
344void device_set_interrupt(device_t dev, intr_fn_t *fn, void *arg);
345void device_run_interrupts(device_t parent);
346void device_set_ivars(device_t dev, void *ivars);
347void *device_get_ivars(device_t dev);
348const char *device_get_desc(device_t dev);
349int device_probe_and_attach(device_t dev);
350int device_detach(device_t dev);
351void *device_get_softc(device_t dev);
352void device_set_softc(device_t dev, void *softc);

--- 110 unchanged lines hidden ---