subr_intr.c (3fc155dc64bd967aebcde25b51c4210d870718b9) subr_intr.c (9346e9130d7ae72b1a6fadb36de85c835074b883)
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:

--- 897 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 */
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:

--- 897 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 ---