Section 12.1. HAT Overview


12.1. HAT Overview

The HAT implementation is different for each type of hardware MMU, and hence there are several different HAT implementations. The HAT layer hides the platform-specific implementation and is used by the segment drivers to implement the segment driver's view of virtual-to-physical translation. The HAT uses the struct hat data structure to hold the top-level translation information for an address space. The hat structure is platform specific and is referenced by the address space structure (see Figure 12.1). HAT-specific data structures existing in every page represent the translation information at a page level.

The HAT layer is called when the segment drivers want to manipulate the hardware MMU. For example, when a segment driver wants to create or destroy an address space mapping, it calls the HAT functions specifying the address range and the action to be taken. We can call the HAT functions without knowing anything about the underlying MMU implementation; the arguments to the HAT functions are machine independent and usually consist of virtual addresses, lengths, page pointers, and protection modes.

Table 12.1 summarizes HAT functions.

Table 12.1. Machine-Independent HAT Functions

Function

Description

hat_alloc()

Allocates a HAT structure in the address space.

hat_chgattr()

Changes the protections for the supplied virtual address range.

hat_clrattr()

Clears the protections for the supplied virtual address range.

hat_free_end()

Informs the HAT layer that a process has exited.

hat_free_start()

Informs the HAT layer that a process is exiting.

hat_get_mapped_size()

Returns the number of bytes that have valid mappings.

hat_getattr()

Gets the protections for the supplied virtual address range.

hat_memload()

Creates a mapping for the supplied page at the supplied virtual address. Used to create mappings.

hat_setattr()

Sets the protections for the supplied virtual address range.

hat_stats_disable()

Finishes collecting statistics on an address space.

hat_stats_enable()

Starts collecting page reference and modification statistics on an address space.

hat_swapin()

Allocates resources for a process that is about to be swapped in.

hat_swapout()

Frees resources for a process that is about to be swapped out.

hat_sync()

Synchronizes the struct_page software referenced and modified bits with the hardware MMU.

hat_unload()

Unloads a mapping for the given page at the given address.





SolarisT Internals. Solaris 10 and OpenSolaris Kernel Architecture
Solaris Internals: Solaris 10 and OpenSolaris Kernel Architecture (2nd Edition)
ISBN: 0131482092
EAN: 2147483647
Year: 2004
Pages: 244

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net