bsd_kernel.c (256281) | bsd_kernel.c (269921) |
---|---|
1/* $FreeBSD: stable/10/sys/boot/usb/bsd_kernel.c 246363 2013-02-05 14:44:25Z hselasky $ */ | 1/* $FreeBSD: stable/10/sys/boot/usb/bsd_kernel.c 269921 2014-08-13 08:18:49Z hselasky $ */ |
2/*- 3 * Copyright (c) 2013 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. --- 365 unchanged lines hidden (view full) --- 375 376device_t 377device_get_parent(device_t dev) 378{ 379 return (dev ? dev->dev_parent : NULL); 380} 381 382void | 2/*- 3 * Copyright (c) 2013 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. --- 365 unchanged lines hidden (view full) --- 375 376device_t 377device_get_parent(device_t dev) 378{ 379 return (dev ? dev->dev_parent : NULL); 380} 381 382void |
383device_set_interrupt(device_t dev, intr_fn_t *fn, void *arg) | 383device_set_interrupt(device_t dev, driver_filter_t *filter, 384 driver_intr_t *fn, void *arg) |
384{ | 385{ |
386 dev->dev_irq_filter = filter; |
|
385 dev->dev_irq_fn = fn; 386 dev->dev_irq_arg = arg; 387} 388 389void 390device_run_interrupts(device_t parent) 391{ 392 device_t child; 393 394 if (parent == NULL) 395 return; 396 397 TAILQ_FOREACH(child, &parent->dev_children, dev_link) { | 387 dev->dev_irq_fn = fn; 388 dev->dev_irq_arg = arg; 389} 390 391void 392device_run_interrupts(device_t parent) 393{ 394 device_t child; 395 396 if (parent == NULL) 397 return; 398 399 TAILQ_FOREACH(child, &parent->dev_children, dev_link) { |
398 if (child->dev_irq_fn != NULL) 399 (child->dev_irq_fn) (child->dev_irq_arg); | 400 int status; 401 if (child->dev_irq_filter != NULL) 402 status = child->dev_irq_filter(child->dev_irq_arg); 403 else 404 status = FILTER_SCHEDULE_THREAD; 405 406 if (status == FILTER_SCHEDULE_THREAD) { 407 if (child->dev_irq_fn != NULL) 408 (child->dev_irq_fn) (child->dev_irq_arg); 409 } |
400 } 401} 402 403void 404device_set_ivars(device_t dev, void *ivars) 405{ 406 dev->dev_aux = ivars; 407} --- 820 unchanged lines hidden --- | 410 } 411} 412 413void 414device_set_ivars(device_t dev, void *ivars) 415{ 416 dev->dev_aux = ivars; 417} --- 820 unchanged lines hidden --- |