Logo Search packages:      
Sourcecode: virtualbox-ose version File versions  Download package

VMM Coding Guidelines

The guidelines extends the VBox coding guidelines (VBox Coding Guidelines) and consists of a compulsory part and an optional part. It is very important that the rules of the compusory part is followed. That will prevent obvious bugs, and it will ease porting the code to 32/64 and 64/32 bits setups.

Compulsory

It is of vital importance is to distiguish between addresses - both virtual and physical - applying to Guest Context and Host Context. To assist the coder in this, a set of types and macros have been created. Another vital thing is that structures shared between the two contexts ends up with the same size and member offsets in both places. There are types and macros for that too.

The rules:

(1) Talking about porting between 32-bit and 64-bit architectures and even between 64-bit platforms. On 64-bit linux int is 32-bit, long is 64-bit. However on 64-bit windows both int and long are 32-bit - there is no standard 64 bit type (_int64 is not a standard type, it's an stupid extension).

(2) The VBox integer types are RTINT, RTUINT, RTGCINT, RTGCUINT, RTGCINTPTR, RTGCUINTPTR, RTHCINT, RTHCUINT, RTHCINTPTR and RTHCUINTPTR.

Optional

There are the general VBox guidelines, see Optional. In addition to these for the following rules applies to the VMM:


Generated by  Doxygen 1.6.0   Back to index