Deleted Added
full compact
bsd_kernel.h (256281) bsd_kernel.h (269921)
1/* $FreeBSD: stable/10/sys/boot/usb/bsd_kernel.h 246363 2013-02-05 14:44:25Z hselasky $ */
1/* $FreeBSD: stable/10/sys/boot/usb/bsd_kernel.h 269921 2014-08-13 08:18:49Z 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)
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 rebooting 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
41#define M_USB 0
42#define M_USBDEV 0
43#define USB_PROC_MAX 3
44#define USB_BUS_GIANT_PROC(bus) (usb_process + 2)
45#define USB_BUS_NON_GIANT_PROC(bus) (usb_process + 2)
46#define USB_BUS_EXPLORE_PROC(bus) (usb_process + 0)
47#define USB_BUS_CONTROL_XFER_PROC(bus) (usb_process + 1)
48#define SYSCTL_DECL(...)

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

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

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

198 int owned;
199 struct mtx *parent;
200};
201
202#define mtx_assert(...) do { } while (0)
203void mtx_init(struct mtx *, const char *, const char *, int);
204void mtx_lock(struct mtx *);
205void mtx_unlock(struct mtx *);
206#define mtx_lock_spin(x) mtx_lock(x)
207#define mtx_unlock_spin(x) mtx_unlock(x)
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;
208int mtx_owned(struct mtx *);
209void mtx_destroy(struct mtx *);
210
211extern struct mtx Giant;
212
213/* SX API */
214
215struct sx {

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

265struct devclass;
266struct device;
267struct module;
268struct module_data;
269
270typedef struct driver driver_t;
271typedef struct devclass *devclass_t;
272typedef struct device *device_t;
269typedef void (intr_fn_t)(void *arg);
273typedef void (driver_intr_t)(void *arg);
274typedef int (driver_filter_t)(void *arg);
275#define FILTER_STRAY 0x01
276#define FILTER_HANDLED 0x02
277#define FILTER_SCHEDULE_THREAD 0x04
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;
278
279typedef int device_attach_t (device_t dev);
280typedef int device_detach_t (device_t dev);
281typedef int device_resume_t (device_t dev);
282typedef int device_shutdown_t (device_t dev);
283typedef int device_probe_t (device_t dev);
284typedef int device_suspend_t (device_t dev);
285

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

297struct device {
298 TAILQ_HEAD(device_list, device) dev_children;
299 TAILQ_ENTRY(device) dev_link;
300
301 struct device *dev_parent;
302 const struct module_data *dev_module;
303 void *dev_sc;
304 void *dev_aux;
297 intr_fn_t *dev_irq_fn;
305 driver_filter_t *dev_irq_filter;
306 driver_intr_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);
307 void *dev_irq_arg;
308
309 uint16_t dev_unit;
310
311 char dev_nameunit[64];
312 char dev_desc[64];
313
314 uint8_t dev_res_alloc:1;

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

345void *device_get_method(device_t dev, const char *what);
346const char *device_get_name(device_t dev);
347const char *device_get_nameunit(device_t dev);
348
349#define device_printf(dev, fmt,...) \
350 printf("%s: " fmt, device_get_nameunit(dev),## __VA_ARGS__)
351device_t device_add_child(device_t dev, const char *name, int unit);
352void device_quiet(device_t dev);
344void device_set_interrupt(device_t dev, intr_fn_t *fn, void *arg);
353void device_set_interrupt(device_t dev, driver_filter_t *, driver_intr_t *, void *);
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 ---
354void device_run_interrupts(device_t parent);
355void device_set_ivars(device_t dev, void *ivars);
356void *device_get_ivars(device_t dev);
357const char *device_get_desc(device_t dev);
358int device_probe_and_attach(device_t dev);
359int device_detach(device_t dev);
360void *device_get_softc(device_t dev);
361void device_set_softc(device_t dev, void *softc);

--- 110 unchanged lines hidden ---