Deleted Added
full compact
subr_intr.c (299928) subr_intr.c (300149)
1/*-
2 * Copyright (c) 2015-2016 Svatopluk Kraus
3 * Copyright (c) 2015-2016 Michal Meloun
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

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

21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 */
27
28#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2015-2016 Svatopluk Kraus
3 * Copyright (c) 2015-2016 Michal Meloun
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

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

21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 */
27
28#include <sys/cdefs.h>
29__FBSDID("$FreeBSD: head/sys/kern/subr_intr.c 299928 2016-05-16 09:11:40Z andrew $");
29__FBSDID("$FreeBSD: head/sys/kern/subr_intr.c 300149 2016-05-18 15:05:44Z andrew $");
30
31/*
32 * New-style Interrupt Framework
33 *
34 * TODO: - to support IPI (PPI) enabling on other CPUs if already started
35 * - to complete things for removable PICs
36 */
37

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

906 mtx_unlock(&pic_list_lock);
907
908 free(pic, M_INTRNG);
909}
910#endif
911/*
912 * Register interrupt controller.
913 */
30
31/*
32 * New-style Interrupt Framework
33 *
34 * TODO: - to support IPI (PPI) enabling on other CPUs if already started
35 * - to complete things for removable PICs
36 */
37

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

906 mtx_unlock(&pic_list_lock);
907
908 free(pic, M_INTRNG);
909}
910#endif
911/*
912 * Register interrupt controller.
913 */
914int
914struct intr_pic *
915intr_pic_register(device_t dev, intptr_t xref)
916{
917 struct intr_pic *pic;
918
919 if (dev == NULL)
915intr_pic_register(device_t dev, intptr_t xref)
916{
917 struct intr_pic *pic;
918
919 if (dev == NULL)
920 return (EINVAL);
920 return (NULL);
921 pic = pic_create(dev, xref);
922 if (pic == NULL)
921 pic = pic_create(dev, xref);
922 if (pic == NULL)
923 return (ENOMEM);
923 return (NULL);
924
925 pic->pic_flags |= FLAG_PIC;
926
927 debugf("PIC %p registered for %s <dev %p, xref %x>\n", pic,
928 device_get_nameunit(dev), dev, xref);
924
925 pic->pic_flags |= FLAG_PIC;
926
927 debugf("PIC %p registered for %s <dev %p, xref %x>\n", pic,
928 device_get_nameunit(dev), dev, xref);
929 return (0);
929 return (pic);
930}
931
932/*
933 * Unregister interrupt controller.
934 */
935int
936intr_pic_deregister(device_t dev, intptr_t xref)
937{

--- 542 unchanged lines hidden ---
930}
931
932/*
933 * Unregister interrupt controller.
934 */
935int
936intr_pic_deregister(device_t dev, intptr_t xref)
937{

--- 542 unchanged lines hidden ---