Page MenuHomeFreeBSD

D42725.id130441.diff
No OneTemporary

D42725.id130441.diff

diff --git a/sys/arm64/arm64/nexus.c b/sys/arm64/arm64/nexus.c
--- a/sys/arm64/arm64/nexus.c
+++ b/sys/arm64/arm64/nexus.c
@@ -112,6 +112,7 @@
static bus_get_resource_list_t nexus_get_reslist;
static bus_map_resource_t nexus_map_resource;
static bus_release_resource_t nexus_release_resource;
+static bus_unmap_resource_t nexus_unmap_resource;
#ifdef SMP
static bus_bind_intr_t nexus_bind_intr;
@@ -141,6 +142,7 @@
DEVMETHOD(bus_map_resource, nexus_map_resource),
DEVMETHOD(bus_release_resource, nexus_release_resource),
DEVMETHOD(bus_set_resource, bus_generic_rl_set_resource),
+ DEVMETHOD(bus_unmap_resource, nexus_unmap_resource),
#ifdef SMP
DEVMETHOD(bus_bind_intr, nexus_bind_intr),
#endif
@@ -494,6 +496,21 @@
return (0);
}
+static int
+nexus_unmap_resource(device_t bus, device_t child, int type, struct resource *r,
+ struct resource_map *map)
+{
+
+ switch (type) {
+ case SYS_RES_MEMORY:
+ case SYS_RES_IOPORT:
+ pmap_unmapdev(map->r_vaddr, map->r_size);
+ return (0);
+ default:
+ return (EINVAL);
+ }
+}
+
#ifdef FDT
static device_method_t nexus_fdt_methods[] = {
/* Device interface */
diff --git a/sys/riscv/riscv/nexus.c b/sys/riscv/riscv/nexus.c
--- a/sys/riscv/riscv/nexus.c
+++ b/sys/riscv/riscv/nexus.c
@@ -87,6 +87,7 @@
static bus_get_resource_list_t nexus_get_reslist;
static bus_map_resource_t nexus_map_resource;
static bus_release_resource_t nexus_release_resource;
+static bus_unmap_resource_t nexus_unmap_resource;
static bus_config_intr_t nexus_config_intr;
static bus_describe_intr_t nexus_describe_intr;
@@ -118,6 +119,7 @@
DEVMETHOD(bus_map_resource, nexus_map_resource),
DEVMETHOD(bus_set_resource, bus_generic_rl_set_resource),
DEVMETHOD(bus_release_resource, nexus_release_resource),
+ DEVMETHOD(bus_unmap_resource, nexus_unmap_resource),
DEVMETHOD(bus_config_intr, nexus_config_intr),
DEVMETHOD(bus_describe_intr, nexus_describe_intr),
DEVMETHOD(bus_setup_intr, nexus_setup_intr),
@@ -456,6 +458,20 @@
return (0);
}
+static int
+nexus_unmap_resource(device_t bus, device_t child, int type, struct resource *r,
+ struct resource_map *map)
+{
+ switch (type) {
+ case SYS_RES_MEMORY:
+ case SYS_RES_IOPORT:
+ pmap_unmapdev(map->r_vaddr, map->r_size);
+ return (0);
+ default:
+ return (EINVAL);
+ }
+}
+
static int
nexus_ofw_map_intr(device_t dev, device_t child, phandle_t iparent, int icells,
pcell_t *intr)

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 17, 12:25 PM (10 h, 24 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14677250
Default Alt Text
D42725.id130441.diff (2 KB)

Event Timeline