nexus.c (206717) | nexus.c (212413) |
---|---|
1/*- 2 * Copyright 1998 Massachusetts Institute of Technology 3 * 4 * Permission to use, copy, modify, and distribute this software and 5 * its documentation for any purpose and without fee is hereby 6 * granted, provided that both the above copyright notice and this 7 * permission notice appear in all copies, that both the above 8 * copyright notice and this permission notice appear in all --- 24 unchanged lines hidden (view full) --- 33 * machines. The function of the root nexus is to serve as an 34 * attachment point for both processors and buses, and to manage 35 * resources which are common to all of them. In particular, 36 * this code implements the core resource managers for interrupt 37 * requests and memory address space. 38 */ 39 40#include <sys/cdefs.h> | 1/*- 2 * Copyright 1998 Massachusetts Institute of Technology 3 * 4 * Permission to use, copy, modify, and distribute this software and 5 * its documentation for any purpose and without fee is hereby 6 * granted, provided that both the above copyright notice and this 7 * permission notice appear in all copies, that both the above 8 * copyright notice and this permission notice appear in all --- 24 unchanged lines hidden (view full) --- 33 * machines. The function of the root nexus is to serve as an 34 * attachment point for both processors and buses, and to manage 35 * resources which are common to all of them. In particular, 36 * this code implements the core resource managers for interrupt 37 * requests and memory address space. 38 */ 39 40#include <sys/cdefs.h> |
41__FBSDID("$FreeBSD: head/sys/mips/mips/nexus.c 206717 2010-04-17 01:17:31Z jmallett $"); | 41__FBSDID("$FreeBSD: head/sys/mips/mips/nexus.c 212413 2010-09-10 11:19:03Z avg $"); |
42 43#include <sys/param.h> 44#include <sys/systm.h> 45#include <sys/bus.h> 46#include <sys/kernel.h> 47#include <sys/malloc.h> 48#include <sys/module.h> 49#include <sys/rman.h> --- 27 unchanged lines hidden (view full) --- 77static struct rman irq_rman; 78static struct rman mem_rman; 79 80static struct resource * 81 nexus_alloc_resource(device_t, device_t, int, int *, u_long, 82 u_long, u_long, u_int); 83static int nexus_activate_resource(device_t, device_t, int, int, 84 struct resource *); | 42 43#include <sys/param.h> 44#include <sys/systm.h> 45#include <sys/bus.h> 46#include <sys/kernel.h> 47#include <sys/malloc.h> 48#include <sys/module.h> 49#include <sys/rman.h> --- 27 unchanged lines hidden (view full) --- 77static struct rman irq_rman; 78static struct rman mem_rman; 79 80static struct resource * 81 nexus_alloc_resource(device_t, device_t, int, int *, u_long, 82 u_long, u_long, u_int); 83static int nexus_activate_resource(device_t, device_t, int, int, 84 struct resource *); |
85static device_t nexus_add_child(device_t, int, const char *, int); | 85static device_t nexus_add_child(device_t, u_int, const char *, int); |
86static int nexus_attach(device_t); 87static int nexus_deactivate_resource(device_t, device_t, int, int, 88 struct resource *); 89static void nexus_delete_resource(device_t, device_t, int, int); 90static struct resource_list * 91 nexus_get_reslist(device_t, device_t); 92static int nexus_get_resource(device_t, device_t, int, int, u_long *, 93 u_long *); --- 183 unchanged lines hidden (view full) --- 277 result = bus_set_resource(child, SYS_RES_IRQ, 0, irq, 1); 278 if (result != 0) 279 device_printf(bus, 280 "warning: bus_set_resource() failed\n"); 281 } 282} 283 284static device_t | 86static int nexus_attach(device_t); 87static int nexus_deactivate_resource(device_t, device_t, int, int, 88 struct resource *); 89static void nexus_delete_resource(device_t, device_t, int, int); 90static struct resource_list * 91 nexus_get_reslist(device_t, device_t); 92static int nexus_get_resource(device_t, device_t, int, int, u_long *, 93 u_long *); --- 183 unchanged lines hidden (view full) --- 277 result = bus_set_resource(child, SYS_RES_IRQ, 0, irq, 1); 278 if (result != 0) 279 device_printf(bus, 280 "warning: bus_set_resource() failed\n"); 281 } 282} 283 284static device_t |
285nexus_add_child(device_t bus, int order, const char *name, int unit) | 285nexus_add_child(device_t bus, u_int order, const char *name, int unit) |
286{ 287 device_t child; 288 struct nexus_device *ndev; 289 290 ndev = malloc(sizeof(struct nexus_device), M_NEXUSDEV, M_NOWAIT|M_ZERO); 291 if (!ndev) 292 return (0); 293 resource_list_init(&ndev->nx_resources); --- 197 unchanged lines hidden --- | 286{ 287 device_t child; 288 struct nexus_device *ndev; 289 290 ndev = malloc(sizeof(struct nexus_device), M_NEXUSDEV, M_NOWAIT|M_ZERO); 291 if (!ndev) 292 return (0); 293 resource_list_init(&ndev->nx_resources); --- 197 unchanged lines hidden --- |