FreeBSD Bugzilla – Attachment 11152 Details for
Bug 22078
Option ROM(s) must be excluded from ISA IO memory space allocation
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 2.51 KB, created by
nms
on 2000-10-18 12:10:01 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
nms
Created:
2000-10-18 12:10:01 UTC
Size:
2.51 KB
patch
obsolete
>--- src/sys/isa/isa_common.c.orig Tue Oct 10 13:49:04 2000 >+++ src/sys/isa/isa_common.c Thu Oct 12 18:24:16 2000 >@@ -1047,3 +1047,95 @@ > DRIVER_MODULE(isa, nexus, isa_driver, isa_devclass, 0, 0); > #endif > >+/* >+ * Pseudo driver to take care of holes in ISA iomem occupied >+ * by option rom(s) >+ */ >+ >+#define ORM_ID 0x00004d3e >+ >+static struct isa_pnp_id orm_ids[] = { >+ { ORM_ID, NULL }, /* ORM0000 */ >+ { 0, NULL }, >+}; >+ >+static int >+orm_probe(device_t dev) { >+ return ISA_PNP_PROBE(device_get_parent(dev), dev, orm_ids); >+} >+ >+static int >+orm_attach(device_t dev) { >+ return 0; >+} >+ >+#define IOMEM_START 0x0a0000 >+#define IOMEM_STEP 0x000800 >+#define IOMEM_END 0x100000 >+ >+static void >+orm_identify(driver_t* driver, device_t parent) { >+ device_t child; >+ u_int32_t chunk; >+ int rnum = 0; >+ >+ child = BUS_ADD_CHILD(parent, ISA_ORDER_SPECULATIVE, "orm", -1); >+ device_set_driver(child, driver); >+ device_set_desc(child, "Option ROM(s)"); >+ isa_set_logicalid(child, ORM_ID); >+ isa_set_vendorid(child, ORM_ID); >+ for (chunk = IOMEM_START; chunk < IOMEM_END; chunk += IOMEM_STEP) { >+ struct resource* res; >+ int rid; >+ bus_space_tag_t bt; >+ bus_space_handle_t bh; >+ u_int32_t rom_size; >+ u_int8_t buf[3]; >+ >+ bus_set_resource(child, SYS_RES_MEMORY, rnum, chunk, IOMEM_STEP); >+ rid = rnum; >+ res = bus_alloc_resource(child, SYS_RES_MEMORY, &rid, 0ul, ~0ul, IOMEM_STEP, RF_ACTIVE); >+ if (res == NULL) { >+ bus_delete_resource(child, SYS_RES_MEMORY, rnum); >+ continue; >+ } >+ bt = rman_get_bustag(res); >+ bh = rman_get_bushandle(res); >+ bus_space_read_region_1(bt, bh, 0, buf, sizeof(buf)); >+ bus_release_resource(child, SYS_RES_MEMORY, rid, res); >+ bus_delete_resource(child, SYS_RES_MEMORY, rnum); >+ if (buf[0] != 0x55 || buf[1] != 0xAA || (buf[2] & 0x03) != 0) { >+ continue; >+ } >+ rom_size = buf[2] << 9; >+ bus_set_resource(child, SYS_RES_MEMORY, rnum, chunk, rom_size); >+ rid = rnum; >+ res = bus_alloc_resource(child, SYS_RES_MEMORY, &rid, 0ul, ~0ul, rom_size, 0); >+ if (res == NULL) { >+ bus_delete_resource(child, SYS_RES_MEMORY, rnum); >+ continue; >+ } >+ chunk += rom_size - IOMEM_STEP; >+ rnum++; >+ } >+ if(rnum == 0) >+ device_delete_child(parent, child); >+} >+ >+static device_method_t orm_methods[] = { >+ /* Device interface */ >+ DEVMETHOD(device_identify, orm_identify), >+ DEVMETHOD(device_probe, orm_probe), >+ DEVMETHOD(device_attach, orm_attach), >+ { 0, 0 } >+}; >+ >+static driver_t orm_driver = { >+ "orm", >+ orm_methods, >+ 0 >+}; >+ >+static devclass_t orm_devclass; >+ >+DRIVER_MODULE(orm, isa, orm_driver, orm_devclass, 0, 0);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 22078
: 11152 |
11153