Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Zygoma::ia32::Descriptor Class Reference

#include <descriptor.h>

List of all members.


Detailed Description

A segment descriptor is a data structure in a GDT or LDT that provides the processor with the size, location, type, and access control, and status of a memory segment.


Public Types

enum  Type {
  kTYPE_RESERVED_0 = 0,
  kTYPE_TSS_AVAILABLE = 1,
  kTYPE_LDT = 2,
  kTYPE_TSS_BUSY = 3,
  kTYPE_CALL_GATE = 4,
  kTYPE_TASK_GATE = 5,
  kTYPE_INT_GATE = 6,
  kTYPE_TRAP_GATE = 7
}
 The types defined for a system descriptor. More...
enum  Granularity {
  kGRANULARITY_BYTE = 0,
  kGRANULARITY_4K = 1
}
 Values indicating the granularity of the descriptor. More...
enum  OperationSize {
  kOP_SIZE_16 = 0,
  kOP_SIZE_32 = 1
}
 Values indicating the operation size of the descriptor. More...

Public Member Functions

Type type () const
 Gets the type of the descriptor using a crude form of RTTI.
bool isSystemDescriptor () const
 Returns true if this is a system descriptor, false if it's a memory (code or data) descriptor.
int privilegeLevel () const
 Returns the privilege level (an integer ranging from 0 to 3) required to execute any code in this descriptor.
u32 base () const
 Gets the segment base address.
u32 limit () const
 Gets the segment size.
Granularity granularity () const
 Gets the granularity.
OperationSize operationSize () const
 Gets the default operation size of the desciptor.
bool isPresent () const
 Indicates presence of the segment.
int limit () const

Protected Attributes

u16 m_limit00_15
u16 m_base00_15
u08 m_base16_23
TypeUnion m_flags1
u08 m_segmentLimit:4
u08 m_useMe:1
u08 m_reserved:1
u08 m_operationSize:1
u08 m_granularity:1
u08 m_base24_31

Classes

struct  CodeSegment
struct  DataSegment
struct  SystemSegment
union  TypeUnion


Member Enumeration Documentation

enum Zygoma::ia32::Descriptor::Granularity
 

Values indicating the granularity of the descriptor.

Enumeration values:
kGRANULARITY_BYTE  Descriptor addresses 1 byte chunks.
kGRANULARITY_4K  Descriptor addresses 4k chunks.

enum Zygoma::ia32::Descriptor::OperationSize
 

Values indicating the operation size of the descriptor.

Enumeration values:
kOP_SIZE_16 
kOP_SIZE_32 

enum Zygoma::ia32::Descriptor::Type
 

The types defined for a system descriptor.

Enumeration values:
kTYPE_RESERVED_0 
kTYPE_TSS_AVAILABLE 
kTYPE_LDT 
kTYPE_TSS_BUSY 
kTYPE_CALL_GATE 
kTYPE_TASK_GATE 
kTYPE_INT_GATE 
kTYPE_TRAP_GATE 


Member Function Documentation

u32 Zygoma::ia32::Descriptor::base  )  const [inline]
 

Gets the segment base address.

The segment base address is the location of byte 0 in the memory segment described by this descriptor.

The segment base address should be aligned on a 16-byte boundary.

Returns:
the logical base address of the segment.

Granularity Zygoma::ia32::Descriptor::granularity  )  const [inline]
 

Gets the granularity.

Granularity is either 1 byte or 0x1000 byte chunks.

bool Zygoma::ia32::Descriptor::isPresent  )  const [inline]
 

Indicates presence of the segment.

Returns:
true of this segment is present, false otherwise.

bool Zygoma::ia32::Descriptor::isSystemDescriptor  )  const [inline]
 

Returns true if this is a system descriptor, false if it's a memory (code or data) descriptor.

int Zygoma::ia32::Descriptor::limit  )  const [inline]
 

u32 Zygoma::ia32::Descriptor::limit  )  const [inline]
 

Gets the segment size.

If the granularity flag is true, this value indicates 4 kilobyte increments and the segment can address up to 4 GB, otherwise it measures in byte increments and the segment can address up to 1 MB.

Returns:
the segment size in chunks (the size of a chunk depends on the granularity setting of te descriptor).

OperationSize Zygoma::ia32::Descriptor::operationSize  )  const [inline]
 

Gets the default operation size of the desciptor.

Returns:
the default operation size (16-bit or 32-bit).

int Zygoma::ia32::Descriptor::privilegeLevel  )  const [inline]
 

Returns the privilege level (an integer ranging from 0 to 3) required to execute any code in this descriptor.

Type Zygoma::ia32::Descriptor::type  )  const [inline]
 

Gets the type of the descriptor using a crude form of RTTI.

Returns:
the Type of the descriptor.


Member Data Documentation

u16 Zygoma::ia32::Descriptor::m_base00_15 [protected]
 

u08 Zygoma::ia32::Descriptor::m_base16_23 [protected]
 

u08 Zygoma::ia32::Descriptor::m_base24_31 [protected]
 

TypeUnion Zygoma::ia32::Descriptor::m_flags1 [protected]
 

u08 Zygoma::ia32::Descriptor::m_granularity [protected]
 

u16 Zygoma::ia32::Descriptor::m_limit00_15 [protected]
 

u08 Zygoma::ia32::Descriptor::m_operationSize [protected]
 

u08 Zygoma::ia32::Descriptor::m_reserved [protected]
 

u08 Zygoma::ia32::Descriptor::m_segmentLimit [protected]
 

u08 Zygoma::ia32::Descriptor::m_useMe [protected]
 


The documentation for this class was generated from the following file:
Generated on Fri Sep 2 10:45:11 2005 for zygoma by doxygen 1.4.2