Subject: Re: Fault type values for uvm_fault()
To: Jason Thorpe <thorpej@shagadelic.org>
From: Matthias Drochner <M.Drochner@fz-juelich.de>
List: port-arm
Date: 02/23/2006 14:54:09
This is a multipart MIME message.
--==_Exmh_113209397738900
Content-Type: text/plain; charset=us-ascii
thorpej@shagadelic.org said:
> If we're not going to bother to pass the correct fault type values to
> uvm_fault(), then we should simply eliminate that argument to
> uvm_fault() altogether.
Yes -- that argument is just used internally if uvm_fault() is called
by uvm_fault_wire(), to pass the WIRE/WIREMAX flags.
It doesn't look too hard to rearrange this and kill vm_fault_t
completely.
While we are here: Could someone check whether the appended patch
is correct? This would eliminate the last use of uvm_fault_wire()
in md code.
best regards
Matthias
--==_Exmh_113209397738900
Content-Type: text/plain ; name="armidlestack.txt"; charset=us-ascii
Content-Description: armidlestack.txt
Content-Disposition: attachment; filename="armidlestack.txt"
--- cpu.c.~1.61.~ Sun Jan 22 16:35:38 2006
+++ cpu.c Thu Feb 23 14:32:54 2006
@@ -599,18 +599,14 @@ cpu_alloc_idlepcb(struct cpu_info *ci)
vaddr_t uaddr;
struct pcb *pcb;
struct trapframe *tf;
- int error;
/*
* Generate a kernel stack and PCB (in essence, a u-area) for the
* new CPU.
*/
- if (uvm_uarea_alloc(&uaddr)) {
- error = uvm_fault_wire(kernel_map, uaddr, uaddr + USPACE,
- VM_FAULT_WIRE, VM_PROT_READ | VM_PROT_WRITE);
- if (error)
- return error;
- }
+ uaddr = uvm_km_alloc(kernel_map, USPACE, 0, UVM_KMF_WIRED);
+ if (!uaddr)
+ return ENOMEM;
ci->ci_idlepcb = pcb = (struct pcb *)uaddr;
/*
--==_Exmh_113209397738900--