From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: Date: Sat, 27 Nov 2004 19:54:46 -0500 From: Russ Cox To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu> Subject: Re: [9fans] kernel - kmap/KADDR ? In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: Topicbox-Message-UUID: 0d3a27e2-eace-11e9-9e20-41e7f4b1d025 > I'm confused about the usage of kmap and KADDR in the code. I > had assumed that kmap() was used to map a page into kernel memory, > and kunmap() was used to unmap that page. I just noticed that the > KADDR() macro is used in the port code in a similar way. The > port code calls KADDR on a physical addr, and then starts reading > and writing the returned address. KADDR is only used to access the physical memory occupied by the kernel and its data. Kmap/kunmap are used to access the whole of physical memory. So they're not redundant, and that's why there's no unmap for KADDR. Kmap/kunmap are exactly what you think they are. Russ