Index: /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/Makefile.kmk
===================================================================
--- /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/Makefile.kmk	(revision 58719)
+++ /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/Makefile.kmk	(revision 58720)
@@ -373,4 +373,9 @@
        bs3-cmn-MemPCpy.c \
        bs3-cmn-MemMove.c \
+       bs3-cmn-MemZero.asm \
+       bs3-cmn-SlabInit.c \
+       bs3-cmn-SlabListInit.c \
+       bs3-cmn-SlabListAdd.c \
+       bs3-cmn-SlabListAlloc.c \
        bs3-cmn-TestData.c \
        bs3-cmn-TestInit.c \
Index: /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-MemZero.asm
===================================================================
--- /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-MemZero.asm	(revision 58720)
+++ /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-MemZero.asm	(revision 58720)
@@ -0,0 +1,93 @@
+; $Id$
+;; @file
+; BS3Kit - Bs3MemZero.
+;
+
+;
+; Copyright (C) 2007-2015 Oracle Corporation
+;
+; This file is part of VirtualBox Open Source Edition (OSE), as
+; available from http://www.virtualbox.org. This file is free software;
+; you can redistribute it and/or modify it under the terms of the GNU
+; General Public License (GPL) as published by the Free Software
+; Foundation, in version 2 as it comes in the "COPYING" file of the
+; VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+;
+; The contents of this file may alternatively be used under the terms
+; of the Common Development and Distribution License Version 1.0
+; (CDDL) only, as it comes in the "COPYING.CDDL" file of the
+; VirtualBox OSE distribution, in which case the provisions of the
+; CDDL are applicable instead of those of the GPL.
+;
+; You may elect to license modified versions of this file under the
+; terms and conditions of either the GPL or the CDDL or both.
+;
+
+%include "bs3kit-template-header.mac"
+
+;;
+; @cproto   BS3_DECL(void) Bs3MemZero_c16(void BS3_FAR *pvDst, size_t cbDst);
+;
+BS3_PROC_BEGIN_CMN Bs3MemZero
+%ifdef RT_ARCH_AMD64
+        push    rdi
+
+        mov     rdi, rcx                ; rdi = pvDst
+        mov     rcx, rdx                ; rcx = cbDst
+        shr     rcx, 3                  ; calc qword count.
+        xor     eax, eax                ; rax = 0 (filler qword)
+        cld
+        rep stosq
+
+        mov     rcx, rdx                ; cbDst
+        and     rcx, 7                  ; calc trailing byte count.
+        rep stosb
+
+        pop     rdi
+        ret
+
+%elif ARCH_BITS == 16
+        push    bp
+        mov     bp, sp
+        push    edi
+        push    es
+
+        mov     di, [bp + 4]            ; pvDst.off
+        mov     dx, [bp + 4 + 2]        ; pvDst.sel
+        mov     es, dx
+        mov     cx, [bp + 4 + 4]        ; cbDst
+        shr     cx, 2                   ; calc dword count.
+        xor     eax, eax
+        rep stosd
+
+        mov     cx, [bp + 4 + 4]        ; cbDst
+        and     cx, 3                   ; calc tailing byte count.
+        rep stosb
+
+        pop     es
+        pop     edi
+        leave
+        ret
+
+%elif ARCH_BITS == 32
+        push    edi
+
+        mov     edi, [esp + 8]          ; pvDst
+        mov     ecx, [esp + 8 + 4]      ; cbDst
+        shr     cx, 2                   ; calc dword count.
+        xor     eax, eax
+        rep stosd
+
+        mov     ecx, [esp + 8 + 4]      ; cbDst
+        and     ecx, 3                  ; calc tailing byte count.
+        rep stosb
+
+        pop     edi
+        ret
+
+%else
+ %error "Unknown bitness."
+%endif
+BS3_PROC_END_CMN   Bs3MemZero
+
Index: /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-SlabInit.c
===================================================================
--- /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-SlabInit.c	(revision 58720)
+++ /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-SlabInit.c	(revision 58720)
@@ -0,0 +1,55 @@
+/* $Id$ */
+/** @file
+ * BS3Kit - Bs3SlabListAdd
+ */
+
+/*
+ * Copyright (C) 2007-2015 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ *
+ * The contents of this file may alternatively be used under the terms
+ * of the Common Development and Distribution License Version 1.0
+ * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
+ * VirtualBox OSE distribution, in which case the provisions of the
+ * CDDL are applicable instead of those of the GPL.
+ *
+ * You may elect to license modified versions of this file under the
+ * terms and conditions of either the GPL or the CDDL or both.
+ */
+
+#include "bs3kit-template-header.h"
+#include <iprt/asm.h>
+
+
+BS3_DECL(void) Bs3SlabInit(PBS3SLABCLT pSlabCtl, size_t cbSlabCtl, uint32_t uFlatSlabPtr, uint32_t cbSlab, uint16_t cbChunk)
+{
+    BS3_ASSERT(RT_IS_POWER_OF_TWO(cbChunk));
+    BS3_ASSERT(cbSlab >= cbChunk * 4);
+    BS3_ASSERT(!(uFlatSlabPtr & (cbChunk - 1)));
+
+    BS3_XPTR_SET_FLAT(BS3SLABCLT, pSlabCtl->pNext, 0);
+    BS3_XPTR_SET_FLAT(BS3SLABCLT, pSlabCtl->pHead, 0);
+    BS3_XPTR_SET_FLAT(BS3SLABCLT, pSlabCtl->pbStart, uFlatSlabPtr);
+    pSlabCtl->cbChunk           = cbChunk;
+    pSlabCtl->cChunks           = cbSlab / cbChunk;
+    pSlabCtl->cFreeChunks       = pSlabCtl->cChunks;
+    pSlabCtl->cBits             = RT_ALIGN_T(pSlabCtl->cChunks, 32, uint16_t);
+    BS3_ASSERT(cbSlabCtl >= RT_OFFSETOF(BS3SLABCTL, bmAllocated[pSlabCtl->cBits >> 3]));
+    Bs3MemZero(&pSlabCtl->bmAllocated, pSlabCtl->cBits >> 3);
+
+    /* Mark excess bitmap padding bits as allocated. */
+    if (pSlabCtl->cBits != pSlabCtl->cChunks)
+    {
+        uint16_t iBit;
+        for (iBit = pSlabCtl->cChunks; iBit < pSlabCtl->cBits; iBit++)
+            ASMBitSet(pSlabCtl->bmAllocated, iBit);
+    }
+}
+
Index: /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-SlabListAdd.c
===================================================================
--- /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-SlabListAdd.c	(revision 58720)
+++ /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-SlabListAdd.c	(revision 58720)
@@ -0,0 +1,41 @@
+/* $Id$ */
+/** @file
+ * BS3Kit - Bs3SlabListAdd
+ */
+
+/*
+ * Copyright (C) 2007-2015 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ *
+ * The contents of this file may alternatively be used under the terms
+ * of the Common Development and Distribution License Version 1.0
+ * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
+ * VirtualBox OSE distribution, in which case the provisions of the
+ * CDDL are applicable instead of those of the GPL.
+ *
+ * You may elect to license modified versions of this file under the
+ * terms and conditions of either the GPL or the CDDL or both.
+ */
+
+#include "bs3kit-template-header.h"
+
+
+BS3_DECL(void) Bs3SlabListAdd(PBS3SLABHEAD pHead, PBS3SLABCLT pSlabCtl)
+{
+    BS3_ASSERT(pHead->cbChunk == pSlabCtl->cbChunk);
+    BS3_ASSERT(BS3_XPTR_IS_NULL(BS3SLABHEAD, pSlabCtl->pNext));
+
+    BS3_XPTR_SET_FLAT(BS3SLABCLT, pSlabCtl->pNext, BS3_XPTR_GET_FLAT(BS3SLABCLT, pHead->pFirst));
+    BS3_XPTR_SET(BS3SLABCLT, pHead->pFirst, pSlabCtl);
+    pHead->cSlabs      += 1;
+    pHead->cChunks     += pSlabCtl->cChunks;
+    pHead->cFreeChunks += pSlabCtl->cFreeChunks;
+}
+
Index: /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-SlabListAlloc.c
===================================================================
--- /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-SlabListAlloc.c	(revision 58720)
+++ /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-SlabListAlloc.c	(revision 58720)
@@ -0,0 +1,49 @@
+/* $Id$ */
+/** @file
+ * BS3Kit - Bs3SlabListAlloc
+ */
+
+/*
+ * Copyright (C) 2007-2015 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ *
+ * The contents of this file may alternatively be used under the terms
+ * of the Common Development and Distribution License Version 1.0
+ * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
+ * VirtualBox OSE distribution, in which case the provisions of the
+ * CDDL are applicable instead of those of the GPL.
+ *
+ * You may elect to license modified versions of this file under the
+ * terms and conditions of either the GPL or the CDDL or both.
+ */
+
+#include "bs3kit-template-header.h"
+
+BS3_DECL(void BS3_FAR *) Bs3SlabListAlloc(PBS3SLABHEAD pHead, uint16_t cChunks)
+{
+    if (pHead->cFreeChunks >= cChunks)
+    {
+        PBS3SLABCLT pCur;
+        for (pCur = BS3_XPTR_GET(BS3SLABCLT, pHead->pFirst);
+             pCur != NULL;
+             pCur = BS3_XPTR_GET(BS3SLABCLT, pCur->pNext))
+        {
+            if (pCur->cFreeChunks >= cChunks)
+            {
+                int32_t iBit = ASMBitFirstClear(&pCur->bmAllocated, pCur->cBits);
+                if (iBit >= )
+                {
+                }
+            }
+        }
+    }
+    return NULL;
+}
+
Index: /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-SlabListInit.c
===================================================================
--- /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-SlabListInit.c	(revision 58720)
+++ /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-SlabListInit.c	(revision 58720)
@@ -0,0 +1,39 @@
+/* $Id$ */
+/** @file
+ * BS3Kit - Bs3SlabListInit
+ */
+
+/*
+ * Copyright (C) 2007-2015 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ *
+ * The contents of this file may alternatively be used under the terms
+ * of the Common Development and Distribution License Version 1.0
+ * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
+ * VirtualBox OSE distribution, in which case the provisions of the
+ * CDDL are applicable instead of those of the GPL.
+ *
+ * You may elect to license modified versions of this file under the
+ * terms and conditions of either the GPL or the CDDL or both.
+ */
+
+#include "bs3kit-template-header.h"
+
+
+BS3_DECL(void) Bs3SlabListInit(PBS3SLABHEAD pHead, uint16_t cbChunk)
+{
+    BS3_ASSERT(RT_IS_POWER_OF_TWO(cbChunk));
+    BS3_XPTR_SET(struct BS3SLABCLT, pHead->pFirst, 0);
+    pHead->cbChunk     = cbChunk;
+    pHead->cSlabs      = 0;
+    pHead->cChunks     = 0;
+    pHead->cFreeChunks = 0;
+}
+
Index: /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit.h
===================================================================
--- /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit.h	(revision 58719)
+++ /trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit.h	(revision 58720)
@@ -38,4 +38,5 @@
 #include <iprt/x86.h>
 
+RT_C_DECLS_BEGIN
 
 /** @defgroup grp_bs3kit     BS3Kit
@@ -686,6 +687,14 @@
  *                      Otherwise the limit is 16MB (due to selector tiling).
  */
-#define BS3_XPTR_SET(a_Type, a_Name, a_uFlatPtr) \
+#define BS3_XPTR_SET_FLAT(a_Type, a_Name, a_uFlatPtr) \
     do { a_Name.XPtr.uFlat = (a_uFlatPtr); } while (0)
+
+/** @def BS3_XPTR_GET_FLAT
+ * Gets the flat address of a cross context pointer.
+ *
+ * @param   a_Type      The type we're pointing to.
+ * @param   a_Name      The member or variable name.
+ */
+#define BS3_XPTR_GET_FLAT(a_Type, a_Name) (a_Name.XPtr.uFlat)
 
 
@@ -738,4 +747,37 @@
 #endif
 
+/** @def BS3_XPTR_SET
+ * Gets the current context pointer value.
+ *
+ * @returns Usable pointer.
+ * @param   a_Type      The type we're pointing to.
+ * @param   a_Name      The member or variable name.
+ * @param   a_pValue    The new pointer value, current context pointer.
+ */
+#if ARCH_BITS == 16
+# define BS3_XPTR_SET(a_Type, a_Name, a_pValue) \
+    do { \
+        a_Type BS3_FAR *pTypeCheck = (a_pValue); \
+        if (BS3_IS_PROTECTED_MODE()) \
+        { \
+            (a_Name).XPtr.u.Low  = BS3_FP_OFF(pTypeCheck); \
+            (a_Name).XPtr.u.High = (BS3_FP_SEG(pTypeCheck) & UINT16_C(0xfff8)) - BS3_SEL_TILED; \
+        } \
+        else \
+            (a_Name).XPtr.uFlat = BS3_FP_OFF(pTypeCheck) + (BS3_FP_SEG(pTypeCheck) << 4); \
+    } while (0)
+#elif ARCH_BITS == 32
+# define BS3_XPTR_SET(a_Type, a_Name, a_pValue) \
+    do { (a_Name).pTyped = (a_pValue); } while (0)
+#elif ARCH_BITS == 64
+# define BS3_XPTR_SET(a_Type, a_Name, a_pValue) \
+    do { \
+        a_Type *pTypeCheck  = (a_pValue);  \
+        (a_Name).XPtr.uFlat = (uint32_t)(uintptr_t)pTypeCheck; \
+    } while (0)
+#else
+# error "ARCH_BITS"
+#endif
+
 
 /** @def BS3_XPTR_IS_NULL
@@ -759,4 +801,6 @@
  * @{
  */
+
+#define BS3_ASSERT(a_Expr) do { } while (0) /**< @todo later */
 
 /**
@@ -923,4 +967,15 @@
 #define Bs3MemMove BS3_CMN_NM(Bs3MemMove) /**< Selects #Bs3MemMove_c16, #Bs3MemMove_c32 or #Bs3MemMove_c64. */
 
+/**
+ * BSD style bzero.
+ *
+ * @param   pvDst           The buffer to be zeroed.
+ * @param   cbDst           The number of bytes to zero.
+ */
+BS3_DECL(void) Bs3MemZero_c16(void BS3_FAR *pvDst, size_t cbDst);
+BS3_DECL(void) Bs3MemZero_c32(void BS3_FAR *pvDst, size_t cbDst); /** @copydoc Bs3MemZero_c16 */
+BS3_DECL(void) Bs3MemZero_c64(void BS3_FAR *pvDst, size_t cbDst); /** @copydoc Bs3MemZero_c16 */
+#define Bs3MemZero BS3_CMN_NM(Bs3MemZero) /**< Selects #Bs3MemZero_c16, #Bs3MemZero_c32 or #Bs3MemZero_c64. */
+
 
 
@@ -936,19 +991,174 @@
 
 
-typedef struct BS3SLABLIST
+/**
+ * Slab control structure list head.
+ *
+ * The slabs on the list must all have the same chunk size.
+ */
+typedef struct BS3SLABHEAD
 {
     /** Pointer to the first slab. */
-    BS3_XPTR_MEMBER(struct BS3SLAB *, pNext);
+    BS3_XPTR_MEMBER(struct BS3SLABCLT, pFirst);
     /** The allocation chunk size. */
-    uint16_t    cbBlock;
-
-} BS3SLABLIST;
-
-typedef struct BS3SLAB
+    uint16_t                        cbChunk;
+    /** Number of slabs in the list. */
+    uint16_t                        cSlabs;
+    /** Number of chunks in the list. */
+    uint32_t                        cChunks;
+    /** Number of free chunks. */
+    uint32_t                        cFreeChunks;
+} BS3SLABHEAD;
+/** Pointer to a slab list head. */
+typedef BS3SLABHEAD BS3_FAR *PBS3SLABHEAD;
+
+/**
+ * Allocation slab control structure.
+ *
+ * This may live at the start of the slab for 4KB slabs, while in a separate
+ * static location for the larger ones.
+ */
+typedef struct BS3SLABCLT
 {
-    /** Pointer to the next slab in this list. */
-    BS3_XPTR_MEMBER(struct BS3SLAB *, pNext);
-
-} BS3SLAB;
+    /** Pointer to the next slab control structure in this list. */
+    BS3_XPTR_MEMBER(struct BS3SLABCLT, pNext);
+    /** Pointer to the slab list head. */
+    BS3_XPTR_MEMBER(BS3SLABHEAD,    pHead);
+    /** The base address of the slab. */
+    BS3_XPTR_MEMBER(uint8_t,        pbStart);
+    /** Number of chunks in this slab. */
+    uint16_t                        cChunks;
+    /** Number of currently free chunks. */
+    uint16_t                        cFreeChunks;
+    /** The chunk size. */
+    uint16_t                        cbChunk;
+    /** Number of bits in the bitmap (cChunks rounded up to 32). */
+    uint16_t                        cBits;
+    /** Bitmap where set bits indicates allocated blocks (variable size,
+     * multiple of 4). */
+    uint8_t                         bmAllocated[4];
+} BS3SLABCLT;
+/** Pointer to a bs3kit slab control structure. */
+typedef BS3SLABCLT BS3_FAR *PBS3SLABCLT;
+
+/**
+ * Initializes a slab.
+ *
+ * @param   pSlabCtl        The slab control structure to initialize.
+ * @param   cbSlabCtl       The size of the slab control structure.
+ * @param   uFlatSlabPtr    The base address of the slab.
+ * @param   cbSlab          The size of the slab.
+ * @param   cbChunk         The chunk size.
+ */
+BS3_DECL(void) Bs3SlabInit_c16(PBS3SLABCLT pSlabCtl, size_t cbSlabCtl, uint32_t uFlatSlabPtr, uint32_t cbSlab, uint16_t cbChunk);
+/** @copydoc Bs3SlabInit_c16 */
+BS3_DECL(void) Bs3SlabInit_c32(PBS3SLABCLT pSlabCtl, size_t cbSlabCtl, uint32_t uFlatSlabPtr, uint32_t cbSlab, uint16_t cbChunk);
+/** @copydoc Bs3SlabInit_c16 */
+BS3_DECL(void) Bs3SlabInit_c64(PBS3SLABCLT pSlabCtl, size_t cbSlabCtl, uint32_t uFlatSlabPtr, uint32_t cbSlab, uint16_t cbChunk);
+#define Bs3SlabInit BS3_CMN_NM(Bs3SlabInit) /**< Selects #Bs3SlabInit_c16, #Bs3SlabInit_c32 or #Bs3SlabInit_c64. */
+
+
+/**
+ * Initializes the given slab list head.
+ *
+ * @param   pHead       The slab list head.
+ * @param   cbChunk     The chunk size.
+ */
+BS3_DECL(void) Bs3SlabListInit_c16(PBS3SLABHEAD pHead, uint16_t cbChunk);
+BS3_DECL(void) Bs3SlabListInit_c32(PBS3SLABHEAD pHead, uint16_t cbChunk); /**< @copydoc Bs3SlabListInit_c16 */
+BS3_DECL(void) Bs3SlabListInit_c64(PBS3SLABHEAD pHead, uint16_t cbChunk); /**< @copydoc Bs3SlabListInit_c16 */
+#define Bs3SlabListInit BS3_CMN_NM(Bs3SlabListInit) /**< Selects #Bs3SlabListInit_c16, #Bs3SlabListInit_c32 or #Bs3SlabListInit_c64. */
+
+/**
+ * Adds an initialized slab control structure to the list.
+ *
+ * @param   pHead           The slab list head to add it to.
+ * @param   pSlabCtl        The slab control structure to add.
+ */
+BS3_DECL(void) Bs3SlabListAdd_c16(PBS3SLABHEAD pHead, PBS3SLABCLT pSlabCtl);
+/** @copydoc Bs3SlabListAdd_c16 */
+BS3_DECL(void) Bs3SlabListAdd_c32(PBS3SLABHEAD pHead, PBS3SLABCLT pSlabCtl);
+/** @copydoc Bs3SlabListAdd_c16 */
+BS3_DECL(void) Bs3SlabListAdd_c64(PBS3SLABHEAD pHead, PBS3SLABCLT pSlabCtl);
+#define Bs3SlabListAdd BS3_CMN_NM(Bs3SlabListAdd) /**< Selects #Bs3SlabListAdd_c16, #Bs3SlabListAdd_c32 or #Bs3SlabListAdd_c64. */
+
+/**
+ * Allocates one or more chunks.
+ *
+ * @returns Pointer to a chunk on success, NULL if we're out of chunks.
+ * @param   pHead           The slab list to allocate from.
+ * @param   cChunks         The number of contiguous chunks we want.
+ */
+BS3_DECL(void BS3_FAR *) Bs3SlabListAlloc_c16(PBS3SLABHEAD pHead, uint16_t cChunks);
+BS3_DECL(void BS3_FAR *) Bs3SlabListAlloc_c32(PBS3SLABHEAD pHead, uint16_t cChunks); /**< @copydoc Bs3SlabListAlloc_c16 */
+BS3_DECL(void BS3_FAR *) Bs3SlabListAlloc_c64(PBS3SLABHEAD pHead, uint16_t cChunks); /**< @copydoc Bs3SlabListAlloc_c16 */
+#define Bs3SlabListAlloc BS3_CMN_NM(Bs3SlabListAlloc) /**< Selects #Bs3SlabListAlloc_c16, #Bs3SlabListAlloc_c32 or #Bs3SlabListAlloc_c64. */
+
+/**
+ * Frees one or more chunks.
+ *
+ * @param   pHead           The slab list to allocate from.
+ * @param   pvChunks        Pointer to the first chunk to free.
+ * @param   cChunks         The number of contiguous chunks we want.
+ */
+BS3_DECL(void) Bs3SlabListFree_c16(PBS3SLABHEAD pHead, void BS3_FAR *pvChunks, uint16_t cChunks);
+BS3_DECL(void) Bs3SlabListFree_c32(PBS3SLABHEAD pHead, void BS3_FAR *pvChunks, uint16_t cChunks); /**< @copydoc Bs3SlabListFree_c16 */
+BS3_DECL(void) Bs3SlabListFree_c64(PBS3SLABHEAD pHead, void BS3_FAR *pvChunks, uint16_t cChunks); /**< @copydoc Bs3SlabListFree_c16 */
+#define Bs3SlabListFree BS3_CMN_NM(Bs3SlabListFree) /**< Selects #Bs3SlabListFree_c16, #Bs3SlabListFree_c32 or #Bs3SlabListFree_c64. */
+
+/**
+ * Allocation addressing constraints.
+ */
+typedef enum BS3MEMKIND
+{
+    /** Invalid zero type. */
+    BS3MEMKIND_INVALID = 0,
+    /** Real mode addressable memory. */
+    BS3MEMKIND_REAL,
+    /** Memory addressable using the 16-bit protected mode tiling. */
+    BS3MEMKIND_TILED,
+    /** Memory addressable using 32-bit flat addressing. */
+    BS3MEMKIND_FLAT32,
+    /** Memory addressable using 64-bit flat addressing. */
+    BS3MEMKIND_FLAT64,
+    /** End of valid types. */
+    BS3MEMKIND_END,
+} BS3MEMKIND;
+
+/**
+ * Allocates low memory.
+ *
+ * @returns Pointer to a chunk on success, NULL if we're out of chunks.
+ * @param   enmKind     The kind of addressing constraints imposed on the
+ *                      allocation.
+ * @param   cb          How much to allocate.  Must be 4KB or less.
+ */
+BS3_DECL(void BS3_FAR *) Bs3MemAlloc_c16(BS3MEMKIND enmKind, size_t cb);
+BS3_DECL(void BS3_FAR *) Bs3MemAlloc_c32(BS3MEMKIND enmKind, size_t cb); /**< @copydoc Bs3MemAlloc_c16 */
+BS3_DECL(void BS3_FAR *) Bs3MemAlloc_c64(BS3MEMKIND enmKind, size_t cb); /**< @copydoc Bs3MemAlloc_c16 */
+#define Bs3MemAlloc BS3_CMN_NM(Bs3MemAlloc) /**< Selects #Bs3MemAlloc_c16, #Bs3MemAlloc_c32 or #Bs3MemAlloc_c64. */
+
+/**
+ * Allocates zero'ed memory.
+ *
+ * @param   enmKind     The kind of addressing constraints imposed on the
+ *                      allocation.
+ * @param   cb          How much to allocate.  Must be 4KB or less.
+ */
+BS3_DECL(void BS3_FAR *) Bs3MemAllocZ_c16(BS3MEMKIND enmKind, size_t cb);
+BS3_DECL(void BS3_FAR *) Bs3MemAllocZ_c32(BS3MEMKIND enmKind, size_t cb); /**< @copydoc Bs3MemAllocZ_c16 */
+BS3_DECL(void BS3_FAR *) Bs3MemAllocZ_c64(BS3MEMKIND enmKind, size_t cb); /**< @copydoc Bs3MemAllocZ_c16 */
+#define Bs3MemAllocZ BS3_CMN_NM(Bs3MemAllocZ) /**< Selects #Bs3MemAllocZ_c16, #Bs3MemAllocZ_c32 or #Bs3MemAllocZ_c64. */
+
+/**
+ * Frees memory.
+ *
+ * @returns Pointer to a chunk on success, NULL if we're out of chunks.
+ * @param   pv          The memory to free (returned by #Bs3MemAlloc).
+ * @param   cb          The size of the allocation.
+ */
+BS3_DECL(void) Bs3MemFree_c16(void BS3_FAR *pv, size_t cb);
+BS3_DECL(void) Bs3MemFree_c32(void BS3_FAR *pv, size_t cb); /**< @copydoc Bs3MemFree_c16 */
+BS3_DECL(void) Bs3MemFree_c64(void BS3_FAR *pv, size_t cb); /**< @copydoc Bs3MemFree_c16 */
+#define Bs3MemFree BS3_CMN_NM(Bs3MemFree) /**< Selects #Bs3MemFree_c16, #Bs3MemFree_c32 or #Bs3MemFree_c64. */
 
 /** @} */
@@ -969,4 +1179,6 @@
 /** @} */
 
-#endif
-
+RT_C_DECLS_END
+
+#endif
+
