svn commit: r265883 - head/sys/powerpc/ps3

Nathan Whitehorn nwhitehorn at FreeBSD.org
Sun May 11 16:49:32 UTC 2014


Author: nwhitehorn
Date: Sun May 11 16:49:31 2014
New Revision: 265883
URL: http://svnweb.freebsd.org/changeset/base/265883

Log:
  Fix interrupt allocation after changes to nexus. This makes PS3 boot
  multiuser again (this commit comes from the PS3 itself). Some problems
  still exist with SMP, apparently, as I had to boot a non-SMP kernel to
  get here.

Modified:
  head/sys/powerpc/ps3/ps3bus.c

Modified: head/sys/powerpc/ps3/ps3bus.c
==============================================================================
--- head/sys/powerpc/ps3/ps3bus.c	Sun May 11 16:48:36 2014	(r265882)
+++ head/sys/powerpc/ps3/ps3bus.c	Sun May 11 16:49:31 2014	(r265883)
@@ -127,6 +127,7 @@ static device_method_t ps3bus_methods[] 
 
 struct ps3bus_softc {
 	struct rman sc_mem_rman;
+	struct rman sc_intr_rman;
 	struct mem_region *regions;
 	int rcount;
 };
@@ -328,7 +329,11 @@ ps3bus_attach(device_t self) 
 	sc = device_get_softc(self);
 	sc->sc_mem_rman.rm_type = RMAN_ARRAY;
 	sc->sc_mem_rman.rm_descr = "PS3Bus Memory Mapped I/O";
+	sc->sc_intr_rman.rm_type = RMAN_ARRAY;
+	sc->sc_intr_rman.rm_descr = "PS3Bus Interrupts";
 	rman_init(&sc->sc_mem_rman);
+	rman_init(&sc->sc_intr_rman);
+	rman_manage_region(&sc->sc_intr_rman, 0, ~0);
 
 	/* Get memory regions for DMA */
 	mem_regions(&sc->regions, &sc->rcount, &sc->regions, &sc->rcount);
@@ -562,8 +567,13 @@ ps3bus_alloc_resource(device_t bus, devi
 		rm = &sc->sc_mem_rman;
 		break;
 	case SYS_RES_IRQ:
-		return (resource_list_alloc(&dinfo->resources, bus, child,
-		    type, rid, start, end, count, flags));
+		rle = resource_list_find(&dinfo->resources, SYS_RES_IRQ,
+		    *rid);
+		rm = &sc->sc_intr_rman;
+		adjstart = rle->start;
+		adjcount = ulmax(count, rle->count);
+		adjend = ulmax(rle->end, rle->start + adjcount - 1);
+		break;
 	default:
 		device_printf(bus, "unknown resource request from %s\n",
 			      device_get_nameunit(child));


More information about the svn-src-all mailing list