Index | Thread | Search

From:
Martin Pieuchot <mpi@grenadille.net>
Subject:
uvm_map: kill ifdef __i386__
To:
tech@openbsd.org
Date:
Sun, 9 Nov 2025 10:31:25 +0000

Download raw body.

Thread
There's a specific uvm_map_setup_md() for i386 but it does exactly the
same as other 32 bits architectures.

I386 is no longer the main architecture and I doubt anyone will
resurrect these experiments.  But if that happens it is easy to
reintroduce a custom uvm_map_setup_md(). 

For now I'd like to remove this #ifdef.

ok?

Index: uvm/uvm_map.c
===================================================================
RCS file: /cvs/src/sys/uvm/uvm_map.c,v
diff -u -p -r1.347 uvm_map.c
--- uvm/uvm_map.c	23 Sep 2025 08:00:48 -0000	1.347
+++ uvm/uvm_map.c	5 Oct 2025 16:00:08 -0000
@@ -5386,37 +5386,7 @@ RBT_GENERATE_AUGMENT(uvm_map_addr, vm_ma
 /*
  * MD code: vmspace allocator setup.
  */
-
-#ifdef __i386__
-void
-uvm_map_setup_md(struct vm_map *map)
-{
-	vaddr_t		min, max;
-
-	min = map->min_offset;
-	max = map->max_offset;
-
-	/*
-	 * Ensure the selectors will not try to manage page 0;
-	 * it's too special.
-	 */
-	if (min < VMMAP_MIN_ADDR)
-		min = VMMAP_MIN_ADDR;
-
-#if 0	/* Cool stuff, not yet */
-	/* Executable code is special. */
-	map->uaddr_exe = uaddr_rnd_create(min, I386_MAX_EXE_ADDR);
-	/* Place normal allocations beyond executable mappings. */
-	map->uaddr_any[3] = uaddr_pivot_create(2 * I386_MAX_EXE_ADDR, max);
-#else	/* Crappy stuff, for now */
-	map->uaddr_any[0] = uaddr_rnd_create(min, max);
-#endif
-
-#ifndef SMALL_KERNEL
-	map->uaddr_brk_stack = uaddr_stack_brk_create(min, max);
-#endif /* !SMALL_KERNEL */
-}
-#elif __LP64__
+#if __LP64__
 void
 uvm_map_setup_md(struct vm_map *map)
 {
@@ -5442,7 +5412,7 @@ uvm_map_setup_md(struct vm_map *map)
 	map->uaddr_brk_stack = uaddr_stack_brk_create(min, max);
 #endif /* !SMALL_KERNEL */
 }
-#else	/* non-i386, 32 bit */
+#else	/* 32 bit */
 void
 uvm_map_setup_md(struct vm_map *map)
 {