Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F109850076
D34778.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D34778.diff
View Options
diff --git a/sys/riscv/include/machdep.h b/sys/riscv/include/machdep.h
--- a/sys/riscv/include/machdep.h
+++ b/sys/riscv/include/machdep.h
@@ -46,9 +46,6 @@
vm_offset_t modulep; /* loader(8) metadata */
};
-extern vm_paddr_t physmap[PHYS_AVAIL_ENTRIES];
-extern u_int physmap_idx;
-
void initriscv(struct riscv_bootparams *);
#endif /* _MACHINE_MACHDEP_H_ */
diff --git a/sys/riscv/riscv/machdep.c b/sys/riscv/riscv/machdep.c
--- a/sys/riscv/riscv/machdep.c
+++ b/sys/riscv/riscv/machdep.c
@@ -111,9 +111,6 @@
#define DTB_SIZE_MAX (1024 * 1024)
-vm_paddr_t physmap[PHYS_AVAIL_ENTRIES];
-u_int physmap_idx;
-
struct kva_md_info kmi;
int64_t dcache_line_size; /* The minimum D cache line size */
@@ -553,18 +550,15 @@
#ifdef FDT
/*
- * XXX: Exclude the lowest 2MB of physical memory, if it hasn't been
- * already, as this area is assumed to contain the SBI firmware. This
- * is a little fragile, but it is consistent with the platforms we
- * support so far.
+ * XXX: Unconditionally exclude the lowest 2MB of physical memory, as
+ * this area is assumed to contain the SBI firmware. This is a little
+ * fragile, but it is consistent with the platforms we support so far.
*
* TODO: remove this when the all regular booting methods properly
* report their reserved memory in the device tree.
*/
- if (mem_regions[0].mr_start == physmap[0]) {
- physmem_exclude_region(mem_regions[0].mr_start, L2_SIZE,
- EXFLAG_NODUMP | EXFLAG_NOALLOC);
- }
+ physmem_exclude_region(mem_regions[0].mr_start, L2_SIZE,
+ EXFLAG_NODUMP | EXFLAG_NOALLOC);
#endif
physmem_init_kernel_globals();
diff --git a/sys/riscv/riscv/pmap.c b/sys/riscv/riscv/pmap.c
--- a/sys/riscv/riscv/pmap.c
+++ b/sys/riscv/riscv/pmap.c
@@ -620,12 +620,14 @@
void
pmap_bootstrap(vm_offset_t l1pt, vm_paddr_t kernstart, vm_size_t kernlen)
{
+ vm_paddr_t physmap[PHYS_AVAIL_ENTRIES];
uint64_t satp;
vm_offset_t dpcpu, freemempos, l0pv, msgbufpv;
vm_paddr_t l0pa, l1pa, max_pa, min_pa, pa;
pd_entry_t *l0p;
pt_entry_t *l2p;
u_int l1_slot, l2_slot;
+ u_int physmap_idx;
int i, mode;
printf("pmap_bootstrap %lx %lx %lx\n", l1pt, kernstart, kernlen);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Feb 11, 8:09 AM (11 h, 16 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16591621
Default Alt Text
D34778.diff (2 KB)
Attached To
Mode
D34778: riscv: eliminate physmap global
Attached
Detach File
Event Timeline
Log In to Comment