VirtualBox

Changeset 60585 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Apr 20, 2016 9:48:09 AM (9 years ago)
Author:
vboxsync
Message:

bs3kit: updates

Location:
trunk/src/VBox/ValidationKit/bootsectors
Files:
2 added
12 edited
1 copied
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/bootsectors/Config.kmk

    r60578 r60585  
    7575
    7676##
    77 # Macro for generating near-call aliases for zero or more 16-bit C functions.
     77# Macro for generating near-call aliases for one 16-bit C function.
    7878# @param    1   The target name.
    79 # @param    2   List of functions.
    80 BS3KIT_FN_GEN_CMN_NEARSTUBS = $(foreach fn,$2,$(evalcall2 def_Bs3KitGenNearStubSource,$1,_$(fn)_c16,_$(fn)_f16))
     79# @param    2   The common function.
     80BS3KIT_FN_GEN_CMN_NEARSTUB = $(evalcall2 def_Bs3KitGenNearStubSource,$1,_$2_c16,_$2_f16)
    8181
    8282##
    83 # Macro for generating near-call aliases for zero or more 16-bit C mode functions.
     83# Macro for generating near-call aliases for one 16-bit C mode function.
    8484# @param    1   The target name.
    85 # @param    2   List of mode functions.
    86 BS3KIT_FN_GEN_MODE_NEARSTUBS = $(foreach fn,$2,$(foreach suff, \
     85# @param    2   The mode function.
     86BS3KIT_FN_GEN_MODE_NEARSTUB = $(foreach suff, \
    8787        _rm \
    8888        _pe16 \
     
    9999        _paev86 \
    100100        _lm16 \
    101         ,$(evalcall2 def_Bs3KitGenNearStubSource,$1,_$(fn)$(suff),_$(fn)$(suff)_far)))
     101        ,$(evalcall2 def_Bs3KitGenNearStubSource,$1,_$2$(suff),_$2$(suff)_far))
    102102
    103103# @param    1   The target name.
     
    124124# Macro for generating far-call aliases for zero or more 16-bit C or assembly functions.
    125125# @param    1   The target name.
    126 # @param    2   List of functions.
    127 BS3KIT_FN_GEN_CMN_FARSTUBS = $(foreach fn,$2,$(evalcall2 def_Bs3KitGenFarStubSource,$1,$(fn),_f16,_c16))
     126# @param    2   The common function.
     127# @param    3   The parameter size in bytes.
     128BS3KIT_FN_GEN_CMN_FARSTUB = $(evalcall2 def_Bs3KitGenFarStubSource,$1,$2,_f16,_c16,$3)
    128129
    129130##
    130131# Macro for generating far-call aliases for zero or more 16-bit C mode functions.
    131132# @param    1   The target name.
    132 # @param    2   List of mode functions.
    133 BS3KIT_FN_GEN_MODE_FARSTUBS = $(foreach fn,$2,$(foreach suff, \
     133# @param    2   The mode function.
     134# @param    3   The parameter size in bytes.
     135BS3KIT_FN_GEN_MODE_FARSTUB = $(foreach suff, \
    134136        _rm \
    135137        _pe16 \
     
    146148        _paev86 \
    147149        _lm16 \
    148         ,$(evalcall2 def_Bs3KitGenFarStubSource,$1,$(fn),$(suff)_far,$(suff))
     150        ,$(evalcall2 def_Bs3KitGenFarStubSource,$1,$2,$(suff)_far,$(suff),$3))
    149151
    150152# @param    1   The target name.
    151 # @param    2   The function and amount of parameters.
     153# @param    2   The function name.
    152154# @param    3   The far function suffix.
    153155# @param    4   The near function suffix.
     156# @param    5   The parameter size in bytes.
    154157define def_Bs3KitGenFarStubSource
    155 $(eval local fn2 = $(firstword $(subst :, $(SP), $2)))
    156 $(eval local cbParam = $(lastword $(subst :, $(SP), $2)))
    157 
    158 $1_SOURCES += $$($1_0_OUTDIR)/stub_$(fn2)$3.asm
    159 $1_CLEAN   += $$($1_0_OUTDIR)/stub_$(fn2)$3.asm
    160 $$$$($1_0_OUTDIR)/stub_$(fn2)$3.asm: $$(VBOX_PATH_BOOTSECTORS_SRC)/Config.kmk | $$$$(dir $$$$@)
     158$1_SOURCES += $$($1_0_OUTDIR)/stub_$2$3.asm
     159$1_CLEAN   += $$($1_0_OUTDIR)/stub_$2$3.asm
     160$$$$($1_0_OUTDIR)/stub_$2$3.asm: $$(VBOX_PATH_BOOTSECTORS_SRC)/Config.kmk | $$$$(dir $$$$@)
    161161        $(QUIET)$(APPEND) -tn $$@ \
    162162                '%include "bs3kit.mac"' \
    163163        'BS3_BEGIN_TEXT16' \
    164                '      extern  _$(fn2)$4' \
     164               '      extern  _$2$4' \
    165165        'BS3_BEGIN_TEXT16_FARSTUBS' \
    166                 'BS3_PROC_BEGIN _$(fn2)$3' \
     166                'BS3_PROC_BEGIN _$2$3' \
    167167               '      CPU 8086' \
    168168               '      inc     bp' \
    169169               '      push    bp' \
    170170               '      mov     bp, sp' \
    171                '%assign offParam $(cbParam)' \
    172                '%rep $(cbParam) / 2' \
     171               '%assign offParam $5' \
     172               '%rep $5 / 2' \
    173173               '      push    word [bp + 2 + 4 + offParam - 2]' \
    174174               '%assign offParam offParam - 2' \
    175175               '%endrep' \
    176                '      call    _$(fn2)$4' \
    177                '      add     sp, $(cbParam)' \
     176               '      call    _$2$4' \
     177               '      add     sp, $5' \
    178178               '      pop     bp' \
    179179               '      dec     bp' \
    180180               '      retf' \
    181                 'BS3_PROC_END _$(fn2)$3' \
     181                'BS3_PROC_END _$2$3' \
    182182               ''
    183183endef
  • trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-basic-2-template.c

    r60578 r60585  
    15281528     * Re-initialize the IDT.
    15291529     */
    1530     TMPL_FAR_NM(Bs3TrapInit)();
     1530    Bs3TrapInit();
    15311531    return bRet;
    15321532}
     
    15541554     * Re-initialize the IDT.
    15551555     */
    1556     TMPL_FAR_NM(Bs3TrapInit)();
     1556    Bs3TrapInit();
    15571557    return 0;
    15581558#elif TMPL_MODE == BS3_MODE_RM
     
    16001600     * Re-initialize the IDT.
    16011601     */
    1602     TMPL_FAR_NM(Bs3TrapInit)();
     1602    Bs3TrapInit();
    16031603    return 0;
    16041604}
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/Makefile.kmk

    r60578 r60585  
    157157       ../../../Runtime/common/asm/ASMSerializeInstruction-rdtscp.asm \
    158158
    159 #
    160 # We generate a list of files with 16-bit far functions for which we generate
    161 # near jump stubs.
    162 #
    163 #$(PATH_OUT_OBJ)/bs3kit-common-16-near-to-far.kmk.ts \
    164 #+| $(PATH_OUT_OBJ)/bs3kit-common-16-near-to-far.kmk: $(VBOX_PATH_BS3KIT_SRC)/bs3kit.h
    165 #       $(SED) \
    166 #               -n -e '/no-near-stub/d' \
    167 #               -e 's/^ *BS3_DECL(.*)  *\([a-zA-Z][a-zA-Z0-9_]*\)(.*[;,][^;]*$/\1/p' \
    168 #               --output $@ \
    169 #               bs3kit.h
    170 #       .$(CP_CHANGED) --changed -f -- $@ $(PATH_OUT_OBJ)/bs3kit-common-16-near-to-far.kmk
    171 #include $(PATH)
    172 
    173 
    174159# The 16-bit BS3Kit library.
    175160LIBRARIES += bs3kit-common-16
     
    199184        bs3-wc16-I4D.asm \
    200185       bs3-c16-Trap16Generic.asm \
     186       bs3-c16-TrapRmV86Generic.asm \
     187       bs3-c16-Trap16RmV86Data.asm \
     188       bs3-c16-TrapRmV86Data.c \
    201189        bs3-c16-CreateHybridFarRet.asm
    202190bs3kit-common-16_bs3-cmn-UInt64Div.c_CFLAGS = -oh -d0 # -d1+ vs -d0 saves 0x6a3-0x577 = 0x12C (300)!
    203 bs3kit-common-16_VBOX_NEAR_TO_FAR_CMN_FUNCTIONS := \
    204         $(sort $(subst bs3-cmn-,Bs3,$(basename $(filter-out \
    205                 %Data.c \
    206                 bs3-rm-% \
    207                 bs3-cmn-hexdigits.c \
    208         ,$(filter %.c,$(bs3kit-common-16_SOURCES)))))) \
    209        Bs3PrintfV \
    210        Bs3StrPrintfV \
    211        Bs3TestPrintfV \
    212        Bs3TestFailedF \
    213        Bs3TestFailedV \
    214        Bs3TestSkippedF \
    215        Bs3TestSkippedV \
    216        Bs3TestSubF \
    217        Bs3TestSubV \
    218        Bs3Trap16InitEx \
    219 
    220 bs3kit-common-16_VBOX_NEAR_TO_FAR_MODE_FUNCTIONS := \
    221         Bs3TrapInit \
    222 
    223 bs3kit-common-16_VBOX_FAR_TO_NEAR_CMN_FUNCTIONS := \
    224         ASMMemFirstMismatchingU8:8 \
    225         ASMMemFirstNonZero:6 \
    226 
    227 $(call BS3KIT_FN_GEN_CMN_NEARSTUBS,bs3kit-common-16,$(bs3kit-common-16_VBOX_NEAR_TO_FAR_CMN_FUNCTIONS))
    228 $(call BS3KIT_FN_GEN_MODE_NEARSTUBS,bs3kit-common-16,$(bs3kit-common-16_VBOX_NEAR_TO_FAR_MODE_FUNCTIONS))
    229 $(call BS3KIT_FN_GEN_CMN_FARSTUBS,bs3kit-common-16,$(bs3kit-common-16_VBOX_FAR_TO_NEAR_CMN_FUNCTIONS))
     191
     192$(call BS3KIT_FN_GEN_CMN_FARSTUB,bs3kit-common-16,ASMMemFirstMismatchingU8,8)
     193$(call BS3KIT_FN_GEN_CMN_FARSTUB,bs3kit-common-16,ASMMemFirstNonZero,6)
     194-include $(PATH_SUB_CURRENT)/bs3kit-autostubs.kmk # manually generated from headers, see bottom of this file.
    230195
    231196# The 32-bit BS3Kit library.
     
    488453bs3kit-mangling-code-undef.h: $(PATH_SUB_CURRENT)/bs3kit-mangling-code-define.h
    489454        $(SED) \
    490                 -e 's/#define \([a-zA-Z_][a-zA-Z0-9_]*\) .*$(DOLLAR)/#undef \1/' \
    491         -e 's/Function needing mangling\./Undefining function mangling - automatically generated by the $@ makefile rule./' \
     455                -e 's/#\( *\)define \([a-zA-Z_][a-zA-Z0-9_]*\) .*$(DOLLAR)/#\1undef \2/' \
     456        -e 's/Function needing mangling.*$(DOLLAR)/Undefining function mangling - automatically generated by the $@ makefile rule./' \
    492457        --output $(dir $<)bs3kit-mangling-code-undef.h \
    493458                $<
    494459
     460#
     461# Rule for regenerating bs3kit-mangling-functions-define.h.
     462#
     463bs3kit-mangling-code-define.h: \
     464                $(PATH_SUB_CURRENT)/bs3kit.h \
     465                $(PATH_SUB_CURRENT)/bs3-cmn-paging.h \
     466                $(PATH_SUB_CURRENT)/bs3-cmn-test.h
     467        $(APPEND) -tn "$(dir $<)$@" \
     468                 '/* $(DOLLAR)Id: $(DOLLAR) */' \
     469                 '/** @file' \
     470                 ' * BS3Kit - Function needing mangling - generated by the $@ makefile rule.' \
     471                 ' */' \
     472                 '' \
     473                 '/*' \
     474                 ' * Copyright (C) 2007-2016 Oracle Corporation' \
     475                 ' *' \
     476                 ' * This file is part of VirtualBox Open Source Edition (OSE), as' \
     477                 ' * available from http://www.virtualbox.org. This file is free software;' \
     478                 ' * you can redistribute it and/or modify it under the terms of the GNU' \
     479                 ' * General Public License (GPL) as published by the Free Software' \
     480                 ' * Foundation, in version 2 as it comes in the "COPYING" file of the' \
     481                 ' * VirtualBox OSE distribution. VirtualBox OSE is distributed in the' \
     482                 ' * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.' \
     483                 ' *' \
     484                 ' * The contents of this file may alternatively be used under the terms' \
     485                 ' * of the Common Development and Distribution License Version 1.0' \
     486                 ' * (CDDL) only, as it comes in the "COPYING.CDDL" file of the' \
     487                 ' * VirtualBox OSE distribution, in which case the provisions of the' \
     488                 ' * CDDL are applicable instead of those of the GPL.' \
     489                 ' *' \
     490                 ' * You may elect to license modified versions of this file under the' \
     491                 ' * terms and conditions of either the GPL or the CDDL or both.' \
     492                 ' */' \
     493                 ''
     494        $(SED) -n \
     495                -e 's/^ *BS3_CMN_PROTO_STUB([^,]*, *\([a-zA-Z_][a-zA-Z0-9_]*\) *,.*$(DOLLAR)/#define \1 BS3_CMN_MANGLER(\1)/p' \
     496                -e 's/^ *BS3_CMN_PROTO_NOSB([^,]*, *\([a-zA-Z_][a-zA-Z0-9_]*\) *,.*$(DOLLAR)/#define \1 BS3_CMN_MANGLER(\1)/p' \
     497                -e 's/^ *BS3_CMN_PROTO_FARSTUB([^,]*,[^,]*, *\([a-zA-Z_][a-zA-Z0-9_]*\) *,.*$(DOLLAR)/#define \1 BS3_CMN_MANGLER(\1)/p' \
     498                $< | sort >> "$(dir $<)bs3kit-mangling-code-define.h"
     499        $(APPEND) -n "$(dir $<)$@" '#ifndef BS3_CMN_ONLY'
     500        $(SED) -n \
     501                -e 's/^ *BS3_MODE_PROTO_STUB([^,]*, *\([a-zA-Z_][a-zA-Z0-9_]*\) *,.*$(DOLLAR)/# define \1 BS3_MODE_MANGLER(\1)/p' \
     502                -e 's/^ *BS3_MODE_PROTO_NOSB([^,]*, *\([a-zA-Z_][a-zA-Z0-9_]*\) *,.*$(DOLLAR)/# define \1 BS3_MODE_MANGLER(\1)/p' \
     503                -e 's/^ *BS3_MODE_PROTO_FARSTUB([^,]*,[^,]*, *\([a-zA-Z_][a-zA-Z0-9_]*\) *,.*$(DOLLAR)/# define \1 BS3_MODE_MANGLER(\1)/p' \
     504                $< | sort >> "$(dir $<)bs3kit-mangling-code-define.h"
     505        $(APPEND) -n "$(dir $<)$@" '#endif /* !BS3_CMN_ONLY */'
     506
     507#
     508# Rule for regenerating bs3kit-autostubs.kmk.
     509#
     510bs3kit-autostubs.kmk: \
     511                $(PATH_SUB_CURRENT)/bs3kit.h \
     512                $(PATH_SUB_CURRENT)/bs3-cmn-memory.h \
     513                $(PATH_SUB_CURRENT)/bs3-cmn-paging.h \
     514                $(PATH_SUB_CURRENT)/bs3-cmn-test.h
     515        $(APPEND) -tn "$(dir $<)$@" \
     516                 '# $(DOLLAR)Id: $(DOLLAR)' \
     517                 '## @file' \
     518                 '# BS3Kit - Automatic near/far stubs - generated by the $@ makefile rule.' \
     519                 '#' \
     520                 '' \
     521                 '#' \
     522                 '# Copyright (C) 2007-2016 Oracle Corporation' \
     523                 '#' \
     524                 '# This file is part of VirtualBox Open Source Edition (OSE), as' \
     525                 '# available from http://www.virtualbox.org. This file is free software;' \
     526                 '# you can redistribute it and/or modify it under the terms of the GNU' \
     527                 '# General Public License (GPL) as published by the Free Software' \
     528                 '# Foundation, in version 2 as it comes in the "COPYING" file of the' \
     529                 '# VirtualBox OSE distribution. VirtualBox OSE is distributed in the' \
     530                 '# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.' \
     531                 '#' \
     532                 '# The contents of this file may alternatively be used under the terms' \
     533                 '# of the Common Development and Distribution License Version 1.0' \
     534                 '# (CDDL) only, as it comes in the "COPYING.CDDL" file of the' \
     535                 '# VirtualBox OSE distribution, in which case the provisions of the' \
     536                 '# CDDL are applicable instead of those of the GPL.' \
     537                 '#' \
     538                 '# You may elect to license modified versions of this file under the' \
     539                 '# terms and conditions of either the GPL or the CDDL or both.' \
     540                 '#' \
     541                 ''
     542        $(SED) -n \
     543                -e '/^ *BS3_CMN_PROTO_STUB/p' \
     544                -e '/^ *BS3_CMD_PROTO_FARSTUB/p' \
     545                -e '/^ *BS3_MODE_PROTO_STUB/p' \
     546                -e '/^ *BS3_MODE_PROTO_FARSTUB/p' \
     547                $< \
     548        | sort \
     549        | $(SED) -n \
     550                -e 's/^ *BS3_CMN_PROTO_STUB([^,]*, *\([a-zA-Z_][a-zA-Z0-9_]*\) *,.*$(DOLLAR)/\$(DOLLAR)(call BS3KIT_FN_GEN_CMN_NEARSTUB,bs3kit-common-16,\1)/p' \
     551                -e 's/^ *BS3_MODE_PROTO_STUB([^,]*, *\([a-zA-Z_][a-zA-Z0-9_]*\) *,.*$(DOLLAR)/\$(DOLLAR)(call BS3KIT_FN_GEN_MODE_NEARSTUB,bs3kit-common-16,\1)/p' \
     552                -e 's/^ *BS3_CMN_PROTO_FARSTUB( *\([^,]*\),[^,]*, *\([a-zA-Z_][a-zA-Z0-9_]*\) *,.*$(DOLLAR)/\$(DOLLAR)(call BS3KIT_FN_GEN_CMN_FARSTUB,bs3kit-common-16,\2,\1)/p' \
     553                -e 's/^ *BS3_MODE_PROTO_FARSTUB( *\([^,]*\),[^,]*, *\([a-zA-Z_][a-zA-Z0-9_]*\) *,.*$(DOLLAR)/\$(DOLLAR)(call BS3KIT_FN_GEN_MODE_FARSTUB,bs3kit-common-16,\2,\1)/p' \
     554                --append "$(dir $<)$@"
     555
     556bs3kit-update:: bs3kit-autostubs.kmk bs3kit-mangling-code-define.h bs3kit-mangling-code-undef.h
     557.NOTPARALLEL:   bs3kit-autostubs.kmk bs3kit-mangling-code-define.h bs3kit-mangling-code-undef.h
     558
    495559
    496560include $(FILE_KBUILD_SUB_FOOTER)
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-c16-Trap16Generic.asm

    r60439 r60585  
    4141BS3_EXTERN_DATA16 g_uBs3TrapEipHint
    4242BS3_EXTERN_DATA16 g_uBs3CpuDetected
     43BS3_EXTERN_DATA16 g_apfnBs3TrapHandlers_c16
    4344BS3_EXTERN_SYSTEM16 Bs3Gdt
    4445TMPL_BEGIN_TEXT
     
    4748TMPL_BEGIN_TEXT
    4849
    49 
    50 ;*********************************************************************************************************************************
    51 ;*  Global Variables                                                                                                             *
    52 ;*********************************************************************************************************************************
    53 BS3_BEGIN_DATA16
    54 ;; Pointer C trap handlers (BS3TEXT16).
    55 BS3_GLOBAL_DATA g_apfnBs3TrapHandlers_c16, 512
    56         resw 256
    57 
    58 
    59 TMPL_BEGIN_TEXT
    6050
    6151;;
     
    181171
    182172        mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rax], eax
    183         mov     edx, [bp - 12h]
    184         mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rsp], edx
    185         mov     [ss:bx + BS3TRAPFRAME.uHandlerRsp], edx
     173        mov     edx, [bp - 12h]         ; This isn't quite right for wrap arounds, but close enough for now
     174        mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rsp], edx     ; high bits
     175        mov     [ss:bx + BS3TRAPFRAME.uHandlerRsp], edx             ; high bits
    186176        mov     dx, [bp - 0eh]
    187177        mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.ss], dx
     
    190180        mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rdx], edx
    191181        mov     edx, [bp - 8]
    192         mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rflags], edx ; high bits
     182        mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rflags], edx  ; high bits
    193183        mov     [ss:bx + BS3TRAPFRAME.fHandlerRfl], edx
    194184        mov     edx, [bp - 4]
     
    212202        int3
    213203%endif
    214         jmp     .stack_load_bx_into_ss
     204        jmp     .stack_esp_out_of_bounds
    215205BS3_PROC_END   bs3Trap16GenericTrapErrCode
    216206
     
    310300        mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.ds], ds
    311301        mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.es], es
     302        mov     [ss:bx + BS3TRAPFRAME.uHandlerCs], cs
    312303
    313304        ;
    314305        ; Load 16-bit data selector for the DPL we're executing at into DS and ES.
    315         ; Save the handler SS and CS values first.
    316         ;
    317         mov     ax, cs
    318         mov     [ss:bx + BS3TRAPFRAME.uHandlerCs], ax
     306        ;
    319307        mov     ax, ss
    320308        and     ax, 3
     
    368356        jmp     .iret_frame_seed_high_eip_word
    369357
    370 .iret_frame_same_cpl:
    371         mov     cx, ss
    372         mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.ss], cx
     358.iret_frame_same_cpl: ; (ss and high bits was saved by CPU specific part)
    373359        lea     cx, [bp + 8]
    374360        mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rsp], cx
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-c16-TrapRmV86Generic.asm

    r60581 r60585  
    11; $Id$
    22;; @file
    3 ; BS3Kit - Trap, 16-bit assembly handlers.
     3; BS3Kit - Trap, 16-bit assembly handlers for real mode and v8086.
    44;
    55
     
    4141BS3_EXTERN_DATA16 g_uBs3TrapEipHint
    4242BS3_EXTERN_DATA16 g_uBs3CpuDetected
    43 BS3_EXTERN_SYSTEM16 Bs3Gdt
     43BS3_EXTERN_DATA16 g_apfnBs3TrapHandlers_c16
    4444TMPL_BEGIN_TEXT
    4545BS3_EXTERN_CMN Bs3TrapDefaultHandler
     
    4848
    4949
    50 ;*********************************************************************************************************************************
    51 ;*  Global Variables                                                                                                             *
    52 ;*********************************************************************************************************************************
    53 BS3_BEGIN_DATA16
    54 ;; Pointer C trap handlers (BS3TEXT16).
    55 BS3_GLOBAL_DATA g_apfnBs3TrapHandlers_c16, 512
    56         resw 256
    57 
    58 
    59 TMPL_BEGIN_TEXT
    60 
    6150;;
    6251; Generic entry points for IDT handlers, 8 byte spacing.
    6352;
    64 BS3_PROC_BEGIN _Bs3Trap16GenericEntries
    65 BS3_PROC_BEGIN Bs3Trap16GenericEntries
    66 %macro Bs3Trap16GenericEntryNoErr 1
     53BS3_PROC_BEGIN _Bs3TrapRmV86GenericEntries
     54BS3_PROC_BEGIN Bs3TrapRmV86GenericEntries
     55%macro Bs3TrapRmV86GenericEntryNoErr 1
    6756        push    byte 0                  ; 2 byte: fake error code
    6857        db      06ah, i                 ; 2 byte: push imm8 - note that this is a signextended value.
     
    7261%endmacro
    7362
    74 %macro Bs3Trap16GenericEntryErrCd 1
     63%macro Bs3TrapRmV86GenericEntryErrCd 1
    7564        db      06ah, i                 ; 2 byte: push imm8 - note that this is a signextended value.
    7665        jmp     %1                      ; 3 byte
     
    8069
    8170%assign i 0                             ; start counter.
    82         Bs3Trap16GenericEntryNoErr bs3Trap16GenericTrapOrInt   ; 0
    83         Bs3Trap16GenericEntryNoErr bs3Trap16GenericTrapOrInt   ; 1
    84         Bs3Trap16GenericEntryNoErr bs3Trap16GenericTrapOrInt   ; 2
    85         Bs3Trap16GenericEntryNoErr bs3Trap16GenericTrapOrInt   ; 3
    86         Bs3Trap16GenericEntryNoErr bs3Trap16GenericTrapOrInt   ; 4
    87         Bs3Trap16GenericEntryNoErr bs3Trap16GenericTrapOrInt   ; 5
    88         Bs3Trap16GenericEntryNoErr bs3Trap16GenericTrapOrInt   ; 6
    89         Bs3Trap16GenericEntryNoErr bs3Trap16GenericTrapOrInt   ; 7
    90         Bs3Trap16GenericEntryErrCd bs3Trap16GenericTrapOrInt   ; 8
    91         Bs3Trap16GenericEntryNoErr bs3Trap16GenericTrapOrInt   ; 9
    92         Bs3Trap16GenericEntryErrCd bs3Trap16GenericTrapOrInt   ; a
    93         Bs3Trap16GenericEntryErrCd bs3Trap16GenericTrapOrInt   ; b
    94         Bs3Trap16GenericEntryErrCd bs3Trap16GenericTrapOrInt   ; c
    95         Bs3Trap16GenericEntryErrCd bs3Trap16GenericTrapOrInt   ; d
    96         Bs3Trap16GenericEntryErrCd bs3Trap16GenericTrapOrInt   ; e
    97         Bs3Trap16GenericEntryNoErr bs3Trap16GenericTrapOrInt   ; f  (reserved)
    98         Bs3Trap16GenericEntryNoErr bs3Trap16GenericTrapOrInt   ; 10
    99         Bs3Trap16GenericEntryErrCd bs3Trap16GenericTrapOrInt   ; 11
    100         Bs3Trap16GenericEntryNoErr bs3Trap16GenericTrapOrInt   ; 12
    101         Bs3Trap16GenericEntryNoErr bs3Trap16GenericTrapOrInt   ; 13
    102         Bs3Trap16GenericEntryNoErr bs3Trap16GenericTrapOrInt   ; 14
    103         Bs3Trap16GenericEntryNoErr bs3Trap16GenericTrapOrInt   ; 15 (reserved)
    104         Bs3Trap16GenericEntryNoErr bs3Trap16GenericTrapOrInt   ; 16 (reserved)
    105         Bs3Trap16GenericEntryNoErr bs3Trap16GenericTrapOrInt   ; 17 (reserved)
    106         Bs3Trap16GenericEntryNoErr bs3Trap16GenericTrapOrInt   ; 18 (reserved)
    107         Bs3Trap16GenericEntryNoErr bs3Trap16GenericTrapOrInt   ; 19 (reserved)
    108         Bs3Trap16GenericEntryNoErr bs3Trap16GenericTrapOrInt   ; 1a (reserved)
    109         Bs3Trap16GenericEntryNoErr bs3Trap16GenericTrapOrInt   ; 1b (reserved)
    110         Bs3Trap16GenericEntryNoErr bs3Trap16GenericTrapOrInt   ; 1c (reserved)
    111         Bs3Trap16GenericEntryNoErr bs3Trap16GenericTrapOrInt   ; 1d (reserved)
    112         Bs3Trap16GenericEntryErrCd bs3Trap16GenericTrapOrInt   ; 1e
    113         Bs3Trap16GenericEntryNoErr bs3Trap16GenericTrapOrInt   ; 1f (reserved)
     71        Bs3TrapRmV86GenericEntryNoErr bs3TrapRmV86GenericTrapOrInt   ; 0
     72        Bs3TrapRmV86GenericEntryNoErr bs3TrapRmV86GenericTrapOrInt   ; 1
     73        Bs3TrapRmV86GenericEntryNoErr bs3TrapRmV86GenericTrapOrInt   ; 2
     74        Bs3TrapRmV86GenericEntryNoErr bs3TrapRmV86GenericTrapOrInt   ; 3
     75        Bs3TrapRmV86GenericEntryNoErr bs3TrapRmV86GenericTrapOrInt   ; 4
     76        Bs3TrapRmV86GenericEntryNoErr bs3TrapRmV86GenericTrapOrInt   ; 5
     77        Bs3TrapRmV86GenericEntryNoErr bs3TrapRmV86GenericTrapOrInt   ; 6
     78        Bs3TrapRmV86GenericEntryNoErr bs3TrapRmV86GenericTrapOrInt   ; 7
     79        Bs3TrapRmV86GenericEntryErrCd bs3TrapRmV86GenericTrapOrInt   ; 8
     80        Bs3TrapRmV86GenericEntryNoErr bs3TrapRmV86GenericTrapOrInt   ; 9
     81        Bs3TrapRmV86GenericEntryErrCd bs3TrapRmV86GenericTrapOrInt   ; a
     82        Bs3TrapRmV86GenericEntryErrCd bs3TrapRmV86GenericTrapOrInt   ; b
     83        Bs3TrapRmV86GenericEntryErrCd bs3TrapRmV86GenericTrapOrInt   ; c
     84        Bs3TrapRmV86GenericEntryErrCd bs3TrapRmV86GenericTrapOrInt   ; d
     85        Bs3TrapRmV86GenericEntryErrCd bs3TrapRmV86GenericTrapOrInt   ; e
     86        Bs3TrapRmV86GenericEntryNoErr bs3TrapRmV86GenericTrapOrInt   ; f  (reserved)
     87        Bs3TrapRmV86GenericEntryNoErr bs3TrapRmV86GenericTrapOrInt   ; 10
     88        Bs3TrapRmV86GenericEntryErrCd bs3TrapRmV86GenericTrapOrInt   ; 11
     89        Bs3TrapRmV86GenericEntryNoErr bs3TrapRmV86GenericTrapOrInt   ; 12
     90        Bs3TrapRmV86GenericEntryNoErr bs3TrapRmV86GenericTrapOrInt   ; 13
     91        Bs3TrapRmV86GenericEntryNoErr bs3TrapRmV86GenericTrapOrInt   ; 14
     92        Bs3TrapRmV86GenericEntryNoErr bs3TrapRmV86GenericTrapOrInt   ; 15 (reserved)
     93        Bs3TrapRmV86GenericEntryNoErr bs3TrapRmV86GenericTrapOrInt   ; 16 (reserved)
     94        Bs3TrapRmV86GenericEntryNoErr bs3TrapRmV86GenericTrapOrInt   ; 17 (reserved)
     95        Bs3TrapRmV86GenericEntryNoErr bs3TrapRmV86GenericTrapOrInt   ; 18 (reserved)
     96        Bs3TrapRmV86GenericEntryNoErr bs3TrapRmV86GenericTrapOrInt   ; 19 (reserved)
     97        Bs3TrapRmV86GenericEntryNoErr bs3TrapRmV86GenericTrapOrInt   ; 1a (reserved)
     98        Bs3TrapRmV86GenericEntryNoErr bs3TrapRmV86GenericTrapOrInt   ; 1b (reserved)
     99        Bs3TrapRmV86GenericEntryNoErr bs3TrapRmV86GenericTrapOrInt   ; 1c (reserved)
     100        Bs3TrapRmV86GenericEntryNoErr bs3TrapRmV86GenericTrapOrInt   ; 1d (reserved)
     101        Bs3TrapRmV86GenericEntryErrCd bs3TrapRmV86GenericTrapOrInt   ; 1e
     102        Bs3TrapRmV86GenericEntryNoErr bs3TrapRmV86GenericTrapOrInt   ; 1f (reserved)
    114103%rep 224
    115         Bs3Trap16GenericEntryNoErr bs3Trap16GenericTrapOrInt
     104        Bs3TrapRmV86GenericEntryNoErr bs3TrapRmV86GenericTrapOrInt
    116105%endrep
    117 BS3_PROC_END  Bs3Trap16GenericEntries
    118 AssertCompile(Bs3Trap16GenericEntries_EndProc - Bs3Trap16GenericEntries == 8*256)
     106BS3_PROC_END  Bs3TrapRmV86GenericEntries
     107AssertCompile(Bs3TrapRmV86GenericEntries_EndProc - Bs3TrapRmV86GenericEntries == 8*256)
    119108
    120109
     
    124113; Note! This code is going to "misbehave" if the high word of ESP is not cleared.
    125114;
    126 BS3_PROC_BEGIN _bs3Trap16GenericTrapOrInt
    127 BS3_PROC_BEGIN bs3Trap16GenericTrapOrInt
     115BS3_PROC_BEGIN _bs3TrapRmV86GenericTrapOrInt
     116BS3_PROC_BEGIN bs3TrapRmV86GenericTrapOrInt
    128117CPU 386
    129         jmp     near bs3Trap16GenericTrapErrCode80286 ; Bs3Trap16Init adjusts this on 80386+
     118        jmp     near bs3TrapRmV86GenericTrapErrCode8086 ; Bs3TrapRmV86Init adjusts this on 80386+
    130119        push    ebp
    131120        movzx   ebp, sp
     
    136125        push    ss                      ; BP - 0eh
    137126        push    esp                     ; BP - 12h
    138 
    139         ;
    140         ; We may be comming from 32-bit code where SS is flat and ESP has a non-
    141         ; zero high word. We need to thunk it for C code to work correctly with
    142         ; [BP+xx] and [SS:BX+xx] style addressing that leaves out the high word.
    143         ;
    144         ; Note! Require ring-0 handler for non-standard stacks (SS.DPL must equal CPL).
    145         ;
    146         mov     bx, ss
    147         lar     ebx, bx
    148         test    ebx, X86LAR_F_D
    149         jz      .stack_fine
    150         test    esp, 0ffff0000h
    151         jnz     .stack_thunk
    152 .stack_load_r0_ss16:
    153         mov     bx, ss
    154         and     bl, 3
    155         AssertCompile(BS3_SEL_RING_SHIFT == 8)
    156         mov     bh, bl
    157         add     bx, BS3_SEL_R0_SS16
    158         jmp     .stack_load_bx_into_ss
    159 .stack_thunk:
    160         mov     ebx, esp
    161         shr     ebx, 16
    162         shl     ebx, X86_SEL_SHIFT
    163         add     ebx, BS3_SEL_TILED_R0
    164         cmp     ebx, BS3_SEL_TILED_R0_LAST
    165         ja      .stack_esp_out_of_bounds
    166 .stack_load_bx_into_ss:
    167         mov     ss, bx
    168 .stack_fine:
    169         movzx   esp, sp
    170127
    171128        ; Reserve space for the the register and trap frame.
     
    181138
    182139        mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rax], eax
    183         mov     edx, [bp - 12h]
    184         mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rsp], edx
    185         mov     [ss:bx + BS3TRAPFRAME.uHandlerRsp], edx
     140        mov     edx, [bp - 12h]         ; This isn't quite right for wrap arounds, but close enough for now
     141        mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rsp], edx     ; high bits
     142        mov     [ss:bx + BS3TRAPFRAME.uHandlerRsp], edx             ; high bits
    186143        mov     dx, [bp - 0eh]
    187         mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.ss], dx
     144        ;mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.ss], dx - share this here
    188145        mov     [ss:bx + BS3TRAPFRAME.uHandlerSs], dx
    189146        mov     edx, [bp - 0ch]
    190147        mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rdx], edx
    191148        mov     edx, [bp - 8]
    192         mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rflags], edx ; high bits
     149        mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rflags], edx  ; high bits
    193150        mov     [ss:bx + BS3TRAPFRAME.fHandlerRfl], edx
    194151        mov     edx, [bp - 4]
     
    206163        add     bp, 6                   ; adjust so it points to the word before the iret frame.
    207164        xor     dx, dx
    208         jmp     bs3Trap16GenericCommon
    209 
    210 .stack_esp_out_of_bounds:
    211 %ifdef BS3_STRICT
    212         int3
    213 %endif
    214         jmp     .stack_load_bx_into_ss
    215 BS3_PROC_END   bs3Trap16GenericTrapErrCode
     165        jmp     bs3TrapRmV86GenericCommon
     166BS3_PROC_END   bs3TrapRmV86GenericTrapErrCode
    216167
    217168;;
    218 ; Trap with error code - 80286 code variant.
    219 ;
    220 BS3_PROC_BEGIN bs3Trap16GenericTrapErrCode80286
    221 CPU 286
     169; Trap with error code - 8086/V20/80186/80286 code variant.
     170;
     171BS3_PROC_BEGIN bs3TrapRmV86GenericTrapErrCode8086
     172CPU 8086
    222173        push    bp
    223174        mov     bp, sp
    224175        push    bx
    225176        pushf
     177        push    ax
    226178        cld
    227179
    228180        ; Reserve space for the the register and trap frame.
    229181        mov     bx, (BS3TRAPFRAME_size + 7) / 8
     182        xor     ax, ax
    230183.more_zeroed_space:
    231         push    0
    232         push    0
    233         push    0
    234         push    0
     184        push    ax
     185        push    ax
     186        push    ax
     187        push    ax
    235188        dec     bx
    236189        jnz     .more_zeroed_space
     
    238191
    239192        mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rax], ax
    240         mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.ss], ss
     193        ;mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.ss], ss - share this here
    241194        mov     [ss:bx + BS3TRAPFRAME.uHandlerSs], ss
    242195        mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rdx], dx
     
    257210        add     bp, 4                   ; adjust so it points to the word before the iret frame.
    258211        mov     dl, 1
    259         jmp     bs3Trap16GenericCommon
    260 BS3_PROC_END   bs3Trap16GenericTrapErrCode80286
     212        jmp     bs3TrapRmV86GenericCommon
     213BS3_PROC_END   bs3TrapRmV86GenericTrapErrCode8086
    261214
    262215
     
    275228;                       - Ctx.rflags - high bits only.
    276229;                       - Ctx.esp    - high bits only.
    277 ;                       - Ctx.ss     - for same cpl frames
    278230;                       - All other bytes are zeroed.
    279231;
     
    282234; @param    dx      One (1) if 286, zero (0) if 386+.
    283235;
    284 BS3_PROC_BEGIN bs3Trap16GenericCommon
    285 CPU 286
     236BS3_PROC_BEGIN bs3TrapRmV86GenericCommon
     237CPU 8086
    286238        ;
    287239        ; Fake EBP frame.
     
    303255        jmp     .save_segment_registers
    304256.save_word_grps:
    305 CPU 286
     257CPU 8086
    306258        mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rcx], cx
    307259        mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rdi], di
     
    310262        mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.ds], ds
    311263        mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.es], es
    312 
    313         ;
    314         ; Load 16-bit data selector for the DPL we're executing at into DS and ES.
    315         ; Save the handler SS and CS values first.
    316         ;
    317         mov     ax, cs
    318         mov     [ss:bx + BS3TRAPFRAME.uHandlerCs], ax
    319         mov     ax, ss
    320         and     ax, 3
    321         mov     cx, ax
    322         shl     ax, BS3_SEL_RING_SHIFT
    323         or      ax, cx
    324         add     ax, BS3_SEL_R0_DS16
     264        mov     [ss:bx + BS3TRAPFRAME.uHandlerCs], cs
     265
     266        ;
     267        ; Load 16-bit BS3KIT_GRPNM_DATA16 into DS and ES so we can access globals.
     268        ;
     269        mov     ax, BS3KIT_GRPNM_DATA16
    325270        mov     ds, ax
    326271        mov     es, ax
    327272
    328273        ;
    329         ; Copy and update the mode now that we've got a flat DS.
     274        ; Copy the mode now that we've got a flat DS.  We don't need to update
     275        ; it as it didn't change.
    330276        ;
    331277        mov     al, [BS3_DATA16_WRT(g_bBs3CurrentMode)]
    332278        mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.bMode], al
    333         mov     cl, al
    334         and     cl, ~BS3_MODE_CODE_MASK
    335         or      cl, BS3_MODE_CODE_16
    336         mov     [BS3_DATA16_WRT(g_bBs3CurrentMode)], cl
    337279
    338280        ;
     
    347289        mov     cx, [bp + 4]
    348290        mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.cs], cx
    349 
    350         test    al, BS3_MODE_CODE_V86
    351         jnz     .iret_frame_v8086
    352 
    353         mov     ax, ss
    354         and     al, 3
    355         and     cl, 3
    356         mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.bCpl], cl
    357         cmp     cl, al
    358         je      .iret_frame_same_cpl
    359 
    360 .ret_frame_different_cpl:
    361         mov     cx, [bp + 10]
    362         mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.ss], cx
    363         mov     cx, [bp + 8]
    364         mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rsp], cx
    365         mov     byte [ss:bx + BS3TRAPFRAME.cbIretFrame], 5*2
    366         test    dx, dx
    367         jnz     .iret_frame_done
    368         jmp     .iret_frame_seed_high_eip_word
    369 
    370 .iret_frame_same_cpl:
    371291        mov     cx, ss
    372292        mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.ss], cx
     
    374294        mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rsp], cx
    375295        mov     byte [ss:bx + BS3TRAPFRAME.cbIretFrame], 3*2
    376         test    dx, dx
    377         jnz     .iret_frame_done
    378         jmp     .iret_frame_seed_high_eip_word
    379 
    380 .iret_frame_v8086:
    381 CPU 386
    382         or      dword [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rflags], X86_EFL_VM
    383         mov     byte [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.bCpl], 3
    384         or      byte [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.bMode], BS3_MODE_CODE_V86 ; paranoia ^ 2
    385 %if 0 ;; @todo testcase: high ESP word from V86 mode, 16-bit TSS.
    386         movzx   ecx, word [bp + 8]
    387         mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rsp], ecx
    388 %else
    389         mov     cx, word [bp + 8]
    390         mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rsp], cx
    391 %endif
    392         mov     cx, [bp + 10]
    393         mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.ss], cx
    394         mov     cx, [bp + 12]
    395         mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.es], cx
    396         mov     cx, [bp + 14]
    397         mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.ds], cx
    398         mov     cx, [bp + 16]
    399         mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.fs], cx
    400         mov     cx, [bp + 18]
    401         mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.gs], cx
    402         mov     byte [ss:bx + BS3TRAPFRAME.cbIretFrame], 9*2
    403         jmp     .iret_frame_done
    404 
    405         ;
    406         ; For 386 we do special tricks to supply the high word of EIP when
    407         ; arriving here from 32-bit code. (ESP was seeded earlier.)
    408         ;
    409 .iret_frame_seed_high_eip_word:
    410         lar     eax, [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.cs]
    411         jnz     .iret_frame_done
    412         test    eax, X86LAR_F_D
    413         jz      .iret_frame_done
    414         mov     ax, [g_uBs3TrapEipHint+2]
    415         mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rip + 2], ax
    416 
    417 .iret_frame_done:
     296
    418297        ;
    419298        ; Control registers.
    420299        ;
     300        cmp     byte [BS3_DATA16_WRT(g_uBs3CpuDetected)], BS3CPU_80286
     301        jb      .skip_control_regsiters_because_80186_or_older
     302
     303        ; The 286 ones.
     304CPU 286
    421305        str     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.tr]
    422306        sldt    [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.ldtr]
     307        smsw    ax
     308        mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.cr0], ax
     309
    423310        test    dx, dx
    424         jnz     .save_286_control_registers
     311        jnz     .set_flags
    425312.save_386_control_registers:
    426313CPU 386
    427         mov     ax, ss
    428         test    al, 3
    429         jnz     .skip_crX_because_cpl_not_0
     314        ; 386 control registers are not accessible from virtual 8086 mode.
     315        test    al, X86_CR0_PE
     316        jnz     .skip_crX_because_v8086
    430317        mov     eax, cr0
    431318        mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.cr0], eax
     
    445332        jmp     .set_flags
    446333
    447 .skip_crX_because_cpl_not_0:
     334CPU 8086
     335.skip_control_regsiters_because_80186_or_older:
     336.skip_crX_because_v8086:
    448337        or      byte [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.fbFlags], BS3REG_CTX_F_NO_CR
    449         jmp     .set_flags
    450 
    451 CPU 286
    452 .save_286_control_registers:
    453         smsw    [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.cr0]
    454 
    455338.set_flags:                             ; The double fault code joins us here.
    456339        or      byte [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.fbFlags], BS3REG_CTX_F_NO_AMD64
     
    476359        ; Resume execution using trap frame.
    477360        ;
    478         push    0
     361        xor     ax, ax
     362        push    ax
    479363        push    ss
    480364        add     di, BS3TRAPFRAME.Ctx
     
    484368        hlt
    485369        jmp     .panic
    486 BS3_PROC_END   bs3Trap16GenericCommon
    487 
    488 
    489 ;;
    490 ; Helper.
    491 ;
    492 ; @retruns  Flat address in es:di.
    493 ; @param    di
    494 ; @uses     eax
    495 ;
    496 bs3Trap16TssInDiToFar1616InEsDi:
    497 CPU 286
    498         push    ax
    499 
    500         ; ASSUME Bs3Gdt is being used.
    501         push    BS3_SEL_SYSTEM16
    502         pop     es
    503         and     di, 0fff8h
    504         add     di, Bs3Gdt wrt BS3SYSTEM16
    505 
    506         ; Load the TSS base into ax:di (di is low, ax high)
    507         mov     al, [es:di + (X86DESCGENERIC_BIT_OFF_BASE_HIGH1 / 8)]
    508         mov     ah, [es:di + (X86DESCGENERIC_BIT_OFF_BASE_HIGH2 / 8)]
    509         mov     di, [es:di + (X86DESCGENERIC_BIT_OFF_BASE_LOW / 8)]
    510 
    511         ; Convert ax to tiled selector, if not within the tiling area we read
    512         ; random BS3SYSTEM16 bits as that's preferable to #GP'ing.
    513         shl     ax, X86_SEL_SHIFT
    514         cmp     ax, BS3_SEL_TILED_LAST - BS3_SEL_TILED
    515 %ifdef BS3_STRICT
    516         jbe     .tiled
    517         int3
    518 %endif
    519         ja      .return                 ; don't crash again.
    520 .tiled:
    521         add     ax, BS3_SEL_TILED
    522         mov     es, ax
    523 .return:
    524         pop     ax
    525         ret
    526 
    527 
    528 ;;
    529 ; Double fault handler.
    530 ;
    531 ; We don't have to load any selectors or clear anything in EFLAGS because the
    532 ; TSS specified sane values which got loaded during the task switch.
    533 ;
    534 ; @param    dx      Zero (0) for indicating 386+ to the common code.
    535 ;
    536 BS3_PROC_BEGIN _Bs3Trap16DoubleFaultHandler80386
    537 BS3_PROC_BEGIN Bs3Trap16DoubleFaultHandler80386
    538 CPU 386
    539         push    0                       ; We'll copy the rip from the other TSS here later to create a more sensible call chain.
    540         push    ebp
    541         mov     bp, sp
    542         pushfd                          ; Handler flags.
    543 
    544         ; Reserve space for the the register and trap frame.
    545         mov     bx, (BS3TRAPFRAME_size + 15) / 16
    546 .more_zeroed_space:
    547         push    dword 0
    548         push    dword 0
    549         push    dword 0
    550         push    dword 0
    551         dec     bx
    552         jz      .more_zeroed_space
    553         mov     bx, sp
    554 
    555         ;
    556         ; Fill in the high GRP register words before we mess them up.
    557         ;
    558         mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rax], eax
    559         mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rbx], ebx
    560         mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rcx], ecx
    561         mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rdx], edx
    562         mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rsi], esi
    563         mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rdi], edi
    564         mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rbp], ebp
    565         mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rsp], esp
    566 
    567         ;
    568         ; FS and GS are not part of the 16-bit TSS because they are 386+ specfic.
    569         ;
    570         mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.fs], fs
    571         mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.gs], gs
    572 
    573         ;
    574         ; Fill in the non-context trap frame bits.
    575         ;
    576         mov     ecx, [bp - 4]
    577         mov     [ss:bx + BS3TRAPFRAME.fHandlerRfl], ecx
    578         mov     byte [ss:bx + BS3TRAPFRAME.bXcpt], X86_XCPT_DF
    579         mov     [ss:bx + BS3TRAPFRAME.uHandlerCs], cs
    580         mov     [ss:bx + BS3TRAPFRAME.uHandlerSs], ss
    581         mov     ecx, esp
    582         lea     cx, [bp + 8]
    583         mov     [ss:bx + BS3TRAPFRAME.uHandlerRsp], ecx
    584         mov     cx, [bp + 6]
    585         mov     [ss:bx + BS3TRAPFRAME.uErrCd], cx
    586 
    587         ;
    588         ; Copy 80386+ control registers.
    589         ;
    590         mov     ecx, cr0
    591         mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.cr0], ecx
    592         mov     ecx, cr2
    593         mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.cr2], ecx
    594         mov     ecx, cr3
    595         mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.cr3], ecx
    596 
    597         test    byte [1 + BS3_DATA16_WRT(g_uBs3CpuDetected)], (BS3CPU_F_CPUID >> 8) ; CR4 first appeared in later 486es.
    598         jz      .skip_cr4_because_not_there
    599         mov     ecx, cr4
    600         mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.cr4], ecx
    601         jmp     .common
    602 
    603 .skip_cr4_because_not_there:
    604         mov     byte [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.fbFlags], BS3REG_CTX_F_NO_CR4
    605 
    606         ;
    607         ; Copy the register state from the previous task segment.
    608         ; The 80286 code with join us here.
    609         ;
    610 .common:
    611 CPU 286
    612         ; Find our TSS.
    613         str     di
    614         call    bs3Trap16TssInDiToFar1616InEsDi
    615 
    616         ; Find the previous TSS.
    617         mov     di, [es:di + X86TSS32.selPrev]
    618         mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.tr], ax
    619         call    bs3Trap16TssInDiToFar1616InEsDi
    620 
    621         ; Do the copying.
    622         mov     cx, [es:di + X86TSS16.ax]
    623         mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rax], cx
    624         mov     cx, [es:di + X86TSS16.cx]
    625         mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rcx], cx
    626         mov     cx, [es:di + X86TSS16.dx]
    627         mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rdx], cx
    628         mov     cx, [es:di + X86TSS16.bx]
    629         mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rbx], cx
    630         mov     cx, [es:di + X86TSS16.sp]
    631         mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rsp], cx
    632         mov     cx, [es:di + X86TSS16.bp]
    633         mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rbp], cx
    634         mov     [bp], cx                ; For better call stacks.
    635         mov     cx, [es:di + X86TSS16.si]
    636         mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rsi], cx
    637         mov     cx, [es:di + X86TSS16.di]
    638         mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rdi], cx
    639         mov     cx, [es:di + X86TSS16.si]
    640         mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rsi], cx
    641         mov     cx, [es:di + X86TSS16.flags]
    642         mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rflags], cx
    643         mov     cx, [es:di + X86TSS16.ip]
    644         mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.rip], cx
    645         mov     [bp + 2], cx            ; For better call stacks.
    646         mov     cx, [es:di + X86TSS16.cs]
    647         mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.cs], cx
    648         mov     cx, [es:di + X86TSS16.ds]
    649         mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.ds], cx
    650         mov     cx, [es:di + X86TSS16.es]
    651         mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.es], cx
    652         mov     cx, [es:di + X86TSS16.ss]
    653         mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.ss], cx
    654         mov     cx, [es:di + X86TSS16.selLdt]             ; Note! This isn't necessarily the ldtr at the time of the fault.
    655         mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.ldtr], cx
    656 
    657         ;
    658         ; Set CPL; copy and update mode.
    659         ;
    660         mov     cl, [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.ss]
    661         and     cl, 3
    662         mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.bCpl], cl
    663 
    664         mov     cl, [BS3_DATA16_WRT(g_bBs3CurrentMode)]
    665         mov     [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.bMode], cl
    666         and     cl, ~BS3_MODE_CODE_MASK
    667         or      cl, BS3_MODE_CODE_16
    668         mov     [BS3_DATA16_WRT(g_bBs3CurrentMode)], cl
    669 
    670         ;
    671         ; Join code paths with the generic handler code.
    672         ;
    673         jmp     bs3Trap16GenericCommon.set_flags
    674 BS3_PROC_END   Bs3Trap16DoubleFaultHandler
    675 
    676 
    677 ;;
    678 ; Double fault handler.
    679 ;
    680 ; We don't have to load any selectors or clear anything in EFLAGS because the
    681 ; TSS specified sane values which got loaded during the task switch.
    682 ;
    683 ; @param    dx      One (1) for indicating 386+ to the common code.
    684 ;
    685 BS3_PROC_BEGIN _Bs3Trap16DoubleFaultHandler80286
    686 BS3_PROC_BEGIN Bs3Trap16DoubleFaultHandler80286
    687 CPU 286
    688         push    0                       ; We'll copy the rip from the other TSS here later to create a more sensible call chain.
    689         push    bp
    690         mov     bp, sp
    691         pushf                           ; Handler flags.
    692 
    693         ; Reserve space for the the register and trap frame.
    694         mov     bx, (BS3TRAPFRAME_size + 7) / 8
    695 .more_zeroed_space:
    696         push    0
    697         push    0
    698         push    0
    699         push    0
    700         dec     bx
    701         jz      .more_zeroed_space
    702         mov     bx, sp
    703 
    704         ;
    705         ; Fill in the non-context trap frame bits.
    706         ;
    707         mov     cx, [bp - 2]
    708         mov     [ss:bx + BS3TRAPFRAME.fHandlerRfl], cx
    709         mov     byte [ss:bx + BS3TRAPFRAME.bXcpt], X86_XCPT_DF
    710         mov     [ss:bx + BS3TRAPFRAME.uHandlerCs], cs
    711         mov     [ss:bx + BS3TRAPFRAME.uHandlerSs], ss
    712         lea     cx, [bp + 8]
    713         mov     [ss:bx + BS3TRAPFRAME.uHandlerRsp], cx
    714         mov     cx, [bp + 6]
    715         mov     [ss:bx + BS3TRAPFRAME.uErrCd], cx
    716 
    717         ;
    718         ; Copy 80286 specific control register.
    719         ;
    720         smsw    [ss:bx + BS3TRAPFRAME.Ctx + BS3REGCTX.cr0]
    721 
    722         jmp     Bs3Trap16DoubleFaultHandler80386.common
    723 BS3_PROC_END   Bs3Trap16DoubleFaultHandler80286
    724 
    725 
     370BS3_PROC_END   bs3TrapRmV86GenericCommon
     371
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-cmn-TrapRmV86Init.c

    r60527 r60585  
    3737   flat address matches.   Also, these symbols are defined both with
    3838   and without underscore prefixes. */
    39 extern BS3_DECL(void) BS3_FAR_CODE Bs3Trap16GenericEntries(void);
     39extern BS3_DECL(void) BS3_FAR_CODE Bs3TrapRmV86GenericEntries(void);
    4040
    4141/* These two are ugly.  Need data access for patching purposes. */
    42 extern uint8_t  BS3_FAR_DATA bs3Trap16GenericTrapOrInt[];
     42extern uint8_t  BS3_FAR_DATA bs3TrapRmV86GenericTrapOrInt[];
    4343
    4444/* bs3-cmn-TrapRmV86Data.c: */
     
    7474    if (f386Plus)
    7575    {
    76         uint8_t BS3_FAR_DATA *pbFunction = &bs3Trap16GenericTrapOrInt[0];
     76        uint8_t BS3_FAR_DATA *pbFunction = &bs3TrapRmV86GenericTrapOrInt[0];
    7777#if ARCH_BITS == 16
    7878        if (g_bBs3CurrentMode != BS3_MODE_RM)
     
    9393        if (iIvt != 0x10 && iIvt != BS3_TRAP_SYSCALL)
    9494        {
    95             paIvt[iIvt].off = (uint16_t)(uintptr_t)Bs3Trap16GenericEntries + iIvt * 8;
     95            paIvt[iIvt].off = (uint16_t)(uintptr_t)Bs3TrapRmV86GenericEntries + iIvt * 8;
    9696            paIvt[iIvt].sel = BS3_SEL_TEXT16;
    9797        }
     
    9999
    100100
    101 #undef Bs3TrapRmV86InitEx
     101#undef Bs3TrapRmV86Init
    102102BS3_CMN_DEF(void, Bs3TrapRmV86Init,(void))
    103103{
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-TestDoModes.c

    r60578 r60585  
    181181}
    182182
    183 
     183#undef Bs3TestDoModes
    184184BS3_MODE_DEF(void, Bs3TestDoModes,(PCBS3TESTMODEENTRY paEntries, size_t cEntries))
    185185{
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-mode-TrapInit.c

    r60554 r60585  
    3232
    3333
     34#undef Bs3TrapInit
    3435BS3_MODE_DEF(void, Bs3TrapInit,(void))
    3536{
    36 #if BS3_MODE_IS_16BIT_SYS(TMPL_MODE)
     37#if BS3_MODE_IS_RM_SYS(TMPL_MODE)
     38    Bs3TrapRmV86Init();
     39#elif BS3_MODE_IS_16BIT_SYS(TMPL_MODE)
     40    Bs3TrapRmV86Init();
    3741    Bs3Trap16Init();
    3842#elif BS3_MODE_IS_32BIT_SYS(TMPL_MODE)
     43    Bs3TrapRmV86Init();
    3944    Bs3Trap32Init();
    4045#elif BS3_MODE_IS_64BIT_SYS(TMPL_MODE)
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-rm-InitAll.c

    r60578 r60585  
    5050    if ((g_uBs3CpuDetected & BS3CPU_TYPE_MASK) >= BS3CPU_80286)
    5151        Bs3Trap16Init();
     52    Bs3TrapRmV86Init();
    5253}
    5354
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-mangling-code-define.h

    r60554 r60585  
    11/* $Id$ */
    22/** @file
    3  * BS3Kit - Function needing mangling.
     3 * BS3Kit - Function needing mangling - generated by the bs3kit-mangling-code-define.h makefile rule.
    44 */
    55
     
    2525 */
    2626
    27 
    28 #define Bs3A20Disable                           BS3_CMN_MANGLER(Bs3A20Disable)
    29 #define Bs3A20DisableViaKbd                     BS3_CMN_MANGLER(Bs3A20DisableViaKbd)
    30 #define Bs3A20DisableViaPortA                   BS3_CMN_MANGLER(Bs3A20DisableViaPortA)
    31 #define Bs3A20Enable                            BS3_CMN_MANGLER(Bs3A20Enable)
    32 #define Bs3A20EnableViaKbd                      BS3_CMN_MANGLER(Bs3A20EnableViaKbd)
    33 #define Bs3A20EnableViaPortA                    BS3_CMN_MANGLER(Bs3A20EnableViaPortA)
    34 #define Bs3KbdRead                              BS3_CMN_MANGLER(Bs3KbdRead)
    35 #define Bs3KbdWait                              BS3_CMN_MANGLER(Bs3KbdWait)
    36 #define Bs3KbdWrite                             BS3_CMN_MANGLER(Bs3KbdWrite)
    37 #define Bs3MemAlloc                             BS3_CMN_MANGLER(Bs3MemAlloc)
    38 #define Bs3MemAllocZ                            BS3_CMN_MANGLER(Bs3MemAllocZ)
    39 #define Bs3MemCpy                               BS3_CMN_MANGLER(Bs3MemCpy)
    40 #define Bs3MemFree                              BS3_CMN_MANGLER(Bs3MemFree)
    41 #define Bs3MemMove                              BS3_CMN_MANGLER(Bs3MemMove)
    42 #define Bs3MemPCpy                              BS3_CMN_MANGLER(Bs3MemPCpy)
    43 #define Bs3MemZero                              BS3_CMN_MANGLER(Bs3MemZero)
    44 #define Bs3PagingInitRootForLM                  BS3_CMN_MANGLER(Bs3PagingInitRootForLM)
    45 #define Bs3PagingInitRootForPAE                 BS3_CMN_MANGLER(Bs3PagingInitRootForPAE)
    46 #define Bs3PagingInitRootForPP                  BS3_CMN_MANGLER(Bs3PagingInitRootForPP)
    47 #define Bs3PagingProtect                        BS3_CMN_MANGLER(Bs3PagingProtect)
    48 #define Bs3PagingProtectPtr                     BS3_CMN_MANGLER(Bs3PagingProtectPtr)
    49 #define Bs3Panic                                BS3_CMN_MANGLER(Bs3Panic)
    50 #define Bs3PicMaskAll                           BS3_CMN_MANGLER(Bs3PicMaskAll)
    51 #define Bs3PrintChr                             BS3_CMN_MANGLER(Bs3PrintChr)
    52 #define Bs3Printf                               BS3_CMN_MANGLER(Bs3Printf)
    53 #define Bs3PrintfV                              BS3_CMN_MANGLER(Bs3PrintfV)
    54 #define Bs3PrintStr                             BS3_CMN_MANGLER(Bs3PrintStr)
    55 #define Bs3PrintStrN                            BS3_CMN_MANGLER(Bs3PrintStrN)
    56 #define Bs3PrintU32                             BS3_CMN_MANGLER(Bs3PrintU32)
    57 #define Bs3PrintX32                             BS3_CMN_MANGLER(Bs3PrintX32)
    58 #define Bs3RegCtxConvertToRingX                 BS3_CMN_MANGLER(Bs3RegCtxConvertToRingX)
    59 #define Bs3RegCtxPrint                          BS3_CMN_MANGLER(Bs3RegCtxPrint)
    60 #define Bs3RegCtxRestore                        BS3_CMN_MANGLER(Bs3RegCtxRestore)
    61 #define Bs3RegCtxSave                           BS3_CMN_MANGLER(Bs3RegCtxSave)
    62 #define Bs3SelFlatCodeToRealMode                BS3_CMN_MANGLER(Bs3SelFlatCodeToRealMode)
    63 #define Bs3SelFlatCodeToProtFar16               BS3_CMN_MANGLER(Bs3SelFlatCodeToProtFar16)
    64 #define Bs3SelFar32ToFlat32                     BS3_CMN_MANGLER(Bs3SelFar32ToFlat32)
    65 #define Bs3SelProtFar32ToFlat32                 BS3_CMN_MANGLER(Bs3SelProtFar32ToFlat32)
    66 #define Bs3SelProtModeCodeToRealMode            BS3_CMN_MANGLER(Bs3SelProtModeCodeToRealMode)
    67 #define Bs3SelRealModeCodeToProtMode            BS3_CMN_MANGLER(Bs3SelRealModeCodeToProtMode)
    68 #define Bs3Shutdown                             BS3_CMN_MANGLER(Bs3Shutdown)
    69 #define Bs3SlabAlloc                            BS3_CMN_MANGLER(Bs3SlabAlloc)
    70 #define Bs3SlabAllocEx                          BS3_CMN_MANGLER(Bs3SlabAllocEx)
    71 #define Bs3SlabFree                             BS3_CMN_MANGLER(Bs3SlabFree)
    72 #define Bs3SlabInit                             BS3_CMN_MANGLER(Bs3SlabInit)
    73 #define Bs3SlabListAdd                          BS3_CMN_MANGLER(Bs3SlabListAdd)
    74 #define Bs3SlabListAlloc                        BS3_CMN_MANGLER(Bs3SlabListAlloc)
    75 #define Bs3SlabListAllocEx                      BS3_CMN_MANGLER(Bs3SlabListAllocEx)
    76 #define Bs3SlabListFree                         BS3_CMN_MANGLER(Bs3SlabListFree)
    77 #define Bs3SlabListInit                         BS3_CMN_MANGLER(Bs3SlabListInit)
    78 #define Bs3StrCpy                               BS3_CMN_MANGLER(Bs3StrCpy)
    79 #define Bs3StrFormatV                           BS3_CMN_MANGLER(Bs3StrFormatV)
    80 #define Bs3StrLen                               BS3_CMN_MANGLER(Bs3StrLen)
    81 #define Bs3StrNLen                              BS3_CMN_MANGLER(Bs3StrNLen)
    82 #define Bs3StrPrintf                            BS3_CMN_MANGLER(Bs3StrPrintf)
    83 #define Bs3StrPrintfV                           BS3_CMN_MANGLER(Bs3StrPrintfV)
    84 #define Bs3TestCheckRegCtxEx                    BS3_CMN_MANGLER(Bs3TestCheckRegCtxEx)
    85 #define Bs3TestFailed                           BS3_CMN_MANGLER(Bs3TestFailed)
    86 #define Bs3TestFailedF                          BS3_CMN_MANGLER(Bs3TestFailedF)
    87 #define Bs3TestFailedV                          BS3_CMN_MANGLER(Bs3TestFailedV)
    88 #define Bs3TestInit                             BS3_CMN_MANGLER(Bs3TestInit)
    89 #define Bs3TestPrintf                           BS3_CMN_MANGLER(Bs3TestPrintf)
    90 #define Bs3TestPrintfV                          BS3_CMN_MANGLER(Bs3TestPrintfV)
    91 #define Bs3TestSkipped                          BS3_CMN_MANGLER(Bs3TestSkipped)
    92 #define Bs3TestSkippedF                         BS3_CMN_MANGLER(Bs3TestSkippedF)
    93 #define Bs3TestSkippedV                         BS3_CMN_MANGLER(Bs3TestSkippedV)
    94 #define Bs3TestSub                              BS3_CMN_MANGLER(Bs3TestSub)
    95 #define Bs3TestSubDone                          BS3_CMN_MANGLER(Bs3TestSubDone)
    96 #define Bs3TestSubErrorCount                    BS3_CMN_MANGLER(Bs3TestSubErrorCount)
    97 #define Bs3TestSubF                             BS3_CMN_MANGLER(Bs3TestSubF)
    98 #define Bs3TestSubV                             BS3_CMN_MANGLER(Bs3TestSubV)
    99 #define Bs3TestTerm                             BS3_CMN_MANGLER(Bs3TestTerm)
    100 #define Bs3Trap16Init                           BS3_CMN_MANGLER(Bs3Trap16Init)
    101 #define Bs3Trap16InitEx                         BS3_CMN_MANGLER(Bs3Trap16InitEx)
    102 #define Bs3Trap16SetGate                        BS3_CMN_MANGLER(Bs3Trap16SetGate)
    103 #define Bs3Trap32Init                           BS3_CMN_MANGLER(Bs3Trap32Init)
    104 #define Bs3Trap32SetGate                        BS3_CMN_MANGLER(Bs3Trap32SetGate)
    105 #define Bs3Trap64Init                           BS3_CMN_MANGLER(Bs3Trap64Init)
    106 #define Bs3Trap64SetGate                        BS3_CMN_MANGLER(Bs3Trap64SetGate)
    107 #define Bs3TrapDefaultHandler                   BS3_CMN_MANGLER(Bs3TrapDefaultHandler)
    108 #define Bs3TrapPrintFrame                       BS3_CMN_MANGLER(Bs3TrapPrintFrame)
    109 #define Bs3TrapRmV86SetGate                     BS3_CMN_MANGLER(Bs3TrapRmV86SetGate)
    110 #define Bs3TrapSetHandler                       BS3_CMN_MANGLER(Bs3TrapSetHandler)
    111 #define Bs3TrapSetJmp                           BS3_CMN_MANGLER(Bs3TrapSetJmp)
    112 #define Bs3TrapSetJmpAndRestore                 BS3_CMN_MANGLER(Bs3TrapSetJmpAndRestore)
    113 #define Bs3TrapUnsetJmp                         BS3_CMN_MANGLER(Bs3TrapUnsetJmp)
    114 
     27#define Bs3A20Disable BS3_CMN_MANGLER(Bs3A20Disable)
     28#define Bs3A20DisableViaKbd BS3_CMN_MANGLER(Bs3A20DisableViaKbd)
     29#define Bs3A20DisableViaPortA BS3_CMN_MANGLER(Bs3A20DisableViaPortA)
     30#define Bs3A20Enable BS3_CMN_MANGLER(Bs3A20Enable)
     31#define Bs3A20EnableViaKbd BS3_CMN_MANGLER(Bs3A20EnableViaKbd)
     32#define Bs3A20EnableViaPortA BS3_CMN_MANGLER(Bs3A20EnableViaPortA)
     33#define Bs3KbdRead BS3_CMN_MANGLER(Bs3KbdRead)
     34#define Bs3KbdWait BS3_CMN_MANGLER(Bs3KbdWait)
     35#define Bs3KbdWrite BS3_CMN_MANGLER(Bs3KbdWrite)
     36#define Bs3MemAlloc BS3_CMN_MANGLER(Bs3MemAlloc)
     37#define Bs3MemAllocZ BS3_CMN_MANGLER(Bs3MemAllocZ)
     38#define Bs3MemCpy BS3_CMN_MANGLER(Bs3MemCpy)
     39#define Bs3MemFree BS3_CMN_MANGLER(Bs3MemFree)
     40#define Bs3MemMove BS3_CMN_MANGLER(Bs3MemMove)
     41#define Bs3MemPCpy BS3_CMN_MANGLER(Bs3MemPCpy)
     42#define Bs3MemZero BS3_CMN_MANGLER(Bs3MemZero)
     43#define Bs3PagingInitRootForLM BS3_CMN_MANGLER(Bs3PagingInitRootForLM)
     44#define Bs3PagingInitRootForPAE BS3_CMN_MANGLER(Bs3PagingInitRootForPAE)
     45#define Bs3PagingInitRootForPP BS3_CMN_MANGLER(Bs3PagingInitRootForPP)
     46#define Bs3PagingProtect BS3_CMN_MANGLER(Bs3PagingProtect)
     47#define Bs3PagingProtectPtr BS3_CMN_MANGLER(Bs3PagingProtectPtr)
     48#define Bs3Panic BS3_CMN_MANGLER(Bs3Panic)
     49#define Bs3PicMaskAll BS3_CMN_MANGLER(Bs3PicMaskAll)
     50#define Bs3PrintChr BS3_CMN_MANGLER(Bs3PrintChr)
     51#define Bs3Printf BS3_CMN_MANGLER(Bs3Printf)
     52#define Bs3PrintfV BS3_CMN_MANGLER(Bs3PrintfV)
     53#define Bs3PrintStr BS3_CMN_MANGLER(Bs3PrintStr)
     54#define Bs3PrintStrN BS3_CMN_MANGLER(Bs3PrintStrN)
     55#define Bs3PrintU32 BS3_CMN_MANGLER(Bs3PrintU32)
     56#define Bs3PrintX32 BS3_CMN_MANGLER(Bs3PrintX32)
     57#define Bs3RegCtxConvertToRingX BS3_CMN_MANGLER(Bs3RegCtxConvertToRingX)
     58#define Bs3RegCtxPrint BS3_CMN_MANGLER(Bs3RegCtxPrint)
     59#define Bs3RegCtxRestore BS3_CMN_MANGLER(Bs3RegCtxRestore)
     60#define Bs3RegCtxSave BS3_CMN_MANGLER(Bs3RegCtxSave)
     61#define Bs3SelFar32ToFlat32 BS3_CMN_MANGLER(Bs3SelFar32ToFlat32)
     62#define Bs3SelFlatCodeToProtFar16 BS3_CMN_MANGLER(Bs3SelFlatCodeToProtFar16)
     63#define Bs3SelFlatCodeToRealMode BS3_CMN_MANGLER(Bs3SelFlatCodeToRealMode)
     64#define Bs3SelProtFar32ToFlat32 BS3_CMN_MANGLER(Bs3SelProtFar32ToFlat32)
     65#define Bs3SelProtModeCodeToRealMode BS3_CMN_MANGLER(Bs3SelProtModeCodeToRealMode)
     66#define Bs3SelRealModeCodeToProtMode BS3_CMN_MANGLER(Bs3SelRealModeCodeToProtMode)
     67#define Bs3Shutdown BS3_CMN_MANGLER(Bs3Shutdown)
     68#define Bs3SlabAlloc BS3_CMN_MANGLER(Bs3SlabAlloc)
     69#define Bs3SlabAllocEx BS3_CMN_MANGLER(Bs3SlabAllocEx)
     70#define Bs3SlabFree BS3_CMN_MANGLER(Bs3SlabFree)
     71#define Bs3SlabInit BS3_CMN_MANGLER(Bs3SlabInit)
     72#define Bs3SlabListAdd BS3_CMN_MANGLER(Bs3SlabListAdd)
     73#define Bs3SlabListAlloc BS3_CMN_MANGLER(Bs3SlabListAlloc)
     74#define Bs3SlabListAllocEx BS3_CMN_MANGLER(Bs3SlabListAllocEx)
     75#define Bs3SlabListFree BS3_CMN_MANGLER(Bs3SlabListFree)
     76#define Bs3SlabListInit BS3_CMN_MANGLER(Bs3SlabListInit)
     77#define Bs3StrCpy BS3_CMN_MANGLER(Bs3StrCpy)
     78#define Bs3StrFormatV BS3_CMN_MANGLER(Bs3StrFormatV)
     79#define Bs3StrLen BS3_CMN_MANGLER(Bs3StrLen)
     80#define Bs3StrNLen BS3_CMN_MANGLER(Bs3StrNLen)
     81#define Bs3StrPrintf BS3_CMN_MANGLER(Bs3StrPrintf)
     82#define Bs3StrPrintfV BS3_CMN_MANGLER(Bs3StrPrintfV)
     83#define Bs3TestCheckRegCtxEx BS3_CMN_MANGLER(Bs3TestCheckRegCtxEx)
     84#define Bs3TestFailed BS3_CMN_MANGLER(Bs3TestFailed)
     85#define Bs3TestFailedF BS3_CMN_MANGLER(Bs3TestFailedF)
     86#define Bs3TestFailedV BS3_CMN_MANGLER(Bs3TestFailedV)
     87#define Bs3TestInit BS3_CMN_MANGLER(Bs3TestInit)
     88#define Bs3TestPrintf BS3_CMN_MANGLER(Bs3TestPrintf)
     89#define Bs3TestPrintfV BS3_CMN_MANGLER(Bs3TestPrintfV)
     90#define Bs3TestSkipped BS3_CMN_MANGLER(Bs3TestSkipped)
     91#define Bs3TestSkippedF BS3_CMN_MANGLER(Bs3TestSkippedF)
     92#define Bs3TestSkippedV BS3_CMN_MANGLER(Bs3TestSkippedV)
     93#define Bs3TestSub BS3_CMN_MANGLER(Bs3TestSub)
     94#define Bs3TestSubDone BS3_CMN_MANGLER(Bs3TestSubDone)
     95#define Bs3TestSubErrorCount BS3_CMN_MANGLER(Bs3TestSubErrorCount)
     96#define Bs3TestSubF BS3_CMN_MANGLER(Bs3TestSubF)
     97#define Bs3TestSubV BS3_CMN_MANGLER(Bs3TestSubV)
     98#define Bs3TestTerm BS3_CMN_MANGLER(Bs3TestTerm)
     99#define Bs3Trap16Init BS3_CMN_MANGLER(Bs3Trap16Init)
     100#define Bs3Trap16InitEx BS3_CMN_MANGLER(Bs3Trap16InitEx)
     101#define Bs3Trap16SetGate BS3_CMN_MANGLER(Bs3Trap16SetGate)
     102#define Bs3Trap32Init BS3_CMN_MANGLER(Bs3Trap32Init)
     103#define Bs3Trap32SetGate BS3_CMN_MANGLER(Bs3Trap32SetGate)
     104#define Bs3Trap64Init BS3_CMN_MANGLER(Bs3Trap64Init)
     105#define Bs3Trap64SetGate BS3_CMN_MANGLER(Bs3Trap64SetGate)
     106#define Bs3TrapDefaultHandler BS3_CMN_MANGLER(Bs3TrapDefaultHandler)
     107#define Bs3TrapPrintFrame BS3_CMN_MANGLER(Bs3TrapPrintFrame)
     108#define Bs3TrapRmV86Init BS3_CMN_MANGLER(Bs3TrapRmV86Init)
     109#define Bs3TrapRmV86InitEx BS3_CMN_MANGLER(Bs3TrapRmV86InitEx)
     110#define Bs3TrapRmV86SetGate BS3_CMN_MANGLER(Bs3TrapRmV86SetGate)
     111#define Bs3TrapSetHandler BS3_CMN_MANGLER(Bs3TrapSetHandler)
     112#define Bs3TrapSetJmp BS3_CMN_MANGLER(Bs3TrapSetJmp)
     113#define Bs3TrapSetJmpAndRestore BS3_CMN_MANGLER(Bs3TrapSetJmpAndRestore)
     114#define Bs3TrapUnsetJmp BS3_CMN_MANGLER(Bs3TrapUnsetJmp)
     115#define Bs3UInt32Div BS3_CMN_MANGLER(Bs3UInt32Div)
     116#define Bs3UInt64Div BS3_CMN_MANGLER(Bs3UInt64Div)
     117#ifndef BS3_CMN_ONLY
     118# define Bs3CpuDetect BS3_MODE_MANGLER(Bs3CpuDetect)
     119# define Bs3TestDoModes BS3_MODE_MANGLER(Bs3TestDoModes)
     120# define Bs3TrapInit BS3_MODE_MANGLER(Bs3TrapInit)
     121#endif /* !BS3_CMN_ONLY */
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-mangling-code-undef.h

    r60554 r60585  
    2424 * terms and conditions of either the GPL or the CDDL or both.
    2525 */
    26 
    2726
    2827#undef Bs3A20Disable
     
    6059#undef Bs3RegCtxRestore
    6160#undef Bs3RegCtxSave
     61#undef Bs3SelFar32ToFlat32
     62#undef Bs3SelFlatCodeToProtFar16
    6263#undef Bs3SelFlatCodeToRealMode
    63 #undef Bs3SelFlatCodeToProtFar16
    64 #undef Bs3SelFar32ToFlat32
    6564#undef Bs3SelProtFar32ToFlat32
    6665#undef Bs3SelProtModeCodeToRealMode
     
    107106#undef Bs3TrapDefaultHandler
    108107#undef Bs3TrapPrintFrame
     108#undef Bs3TrapRmV86Init
     109#undef Bs3TrapRmV86InitEx
    109110#undef Bs3TrapRmV86SetGate
    110111#undef Bs3TrapSetHandler
     
    112113#undef Bs3TrapSetJmpAndRestore
    113114#undef Bs3TrapUnsetJmp
    114 
     115#undef Bs3UInt32Div
     116#undef Bs3UInt64Div
     117#ifndef BS3_CMN_ONLY
     118# undef Bs3CpuDetect
     119# undef Bs3TestDoModes
     120# undef Bs3TrapInit
     121#endif /* !BS3_CMN_ONLY */
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit-mangling-code.h

    r60578 r60585  
    3030 */
    3131#undef BS3_CMN_MANGLER
     32#undef BS3_MODE_MANGLER
    3233#if ARCH_BITS != 16 || !defined(BS3_USE_ALT_16BIT_TEXT_SEG)
    3334# define BS3_CMN_MANGLER(a_Function)            BS3_CMN_NM(a_Function)
     35# define BS3_MODE_MANGLER(a_Function)           TMPL_NM(a_Function)
    3436#else
    3537# define BS3_CMN_MANGLER(a_Function)            BS3_CMN_FAR_NM(a_Function)
     38# define BS3_MODE_MANGLER(a_Function)           TMPL_FAR_NM(a_Function)
    3639#endif
    3740#include "bs3kit-mangling-code-undef.h"
  • trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3kit.h

    r60578 r60585  
    12691269 */
    12701270
    1271 /** @def BS3_CMN_PROTO
    1272  * Macro for prototyping all the variations of a common function.
     1271/** @def BS3_CMN_PROTO_INT
     1272 * Internal macro for prototyping all the variations of a common function.
    12731273 * @param   a_RetType   The return type.
    12741274 * @param   a_Name      The function basename.
    12751275 * @param   a_Params    The parameter list (in parentheses).
    1276  * @param   a_fAutoStub Whether to autogenerate a 16-bit near -> 16-bit far stub
    1277  *                      function. Either 'true' for stub or 'false' for no stub.
     1276 * @sa      BS3_CMN_PROTO_STUB, BS3_CMN_PROTO_NOSB
    12781277 */
    12791278#if ARCH_BITS == 16
    1280 # define BS3_CMN_PROTO(a_RetType, a_Name, a_Params, a_fAutoStub) \
     1279# define BS3_CMN_PROTO_INT(a_RetType, a_Name, a_Params) \
    12811280    BS3_DECL_NEAR(a_RetType) BS3_CMN_NM(a_Name) a_Params;  \
    12821281    BS3_DECL_FAR(a_RetType)  BS3_CMN_FAR_NM(a_Name) a_Params
    12831282#else
    1284 # define BS3_CMN_PROTO(a_RetType, a_Name, a_Params, a_fAutoStub) \
     1283# define BS3_CMN_PROTO_INT(a_RetType, a_Name, a_Params) \
    12851284    BS3_DECL_NEAR(a_RetType) BS3_CMN_NM(a_Name) a_Params
    12861285#endif
     1286
     1287/** @BS3_CMN_PROTO_STUB
     1288 * Macro for prototyping all the variations of a common function with automatic
     1289 * near -> far stub.
     1290 *
     1291 * @param   a_RetType   The return type.
     1292 * @param   a_Name      The function basename.
     1293 * @param   a_Params    The parameter list (in parentheses).
     1294 * @sa      BS3_CMN_PROTO_NOSB
     1295 */
     1296#define BS3_CMN_PROTO_STUB(a_RetType, a_Name, a_Params) BS3_CMN_PROTO_INT(a_RetType, a_Name, a_Params)
     1297
     1298/** @BS3_CMN_PROTO_NOSB
     1299 * Macro for prototyping all the variations of a common function without any
     1300 * near > far stub.
     1301 *
     1302 * @param   a_RetType   The return type.
     1303 * @param   a_Name      The function basename.
     1304 * @param   a_Params    The parameter list (in parentheses).
     1305 * @sa      BS3_CMN_PROTO_STUB
     1306 */
     1307#define BS3_CMN_PROTO_NOSB(a_RetType, a_Name, a_Params) BS3_CMN_PROTO_INT(a_RetType, a_Name, a_Params)
     1308
     1309/** @BS3_CMN_PROTO_FRST
     1310 * Macro for prototyping all the variations of a common function with automatic
     1311 * far -> near stub.
     1312 *
     1313 * @param   a_cbParam16 The size of the 16-bit parameter list in bytes.
     1314 * @param   a_RetType   The return type.
     1315 * @param   a_Name      The function basename.
     1316 * @param   a_Params    The parameter list (in parentheses).
     1317 * @sa      BS3_CMN_PROTO_STUB
     1318 */
     1319#define BS3_CMN_PROTO_FARSTUB(a_cbParam16, a_RetType, a_Name, a_Params) BS3_CMN_PROTO_INT(a_RetType, a_Name, a_Params)
     1320
    12871321
    12881322/** @def BS3_CMN_DEF
     
    13191353 * The current implementation will only halt the CPU.
    13201354 */
    1321 BS3_CMN_PROTO(DECL_NO_RETURN(void), Bs3Panic,(void), false);
     1355BS3_CMN_PROTO_NOSB(DECL_NO_RETURN(void), Bs3Panic,(void));
    13221356#if !defined(BS3_KIT_WITH_NO_RETURN) && defined(__WATCOMC__)
    13231357# pragma aux Bs3Panic_c16 __aborts
     
    13321366 * just halt the CPU.
    13331367 */
    1334 BS3_CMN_PROTO(void, Bs3Shutdown,(void), false);
     1368BS3_CMN_PROTO_NOSB(void, Bs3Shutdown,(void));
    13351369
    13361370/**
     
    13391373 * @param   uValue      The 32-bit value.
    13401374 */
    1341 BS3_CMN_PROTO(void, Bs3PrintU32,(uint32_t uValue), false);
     1375BS3_CMN_PROTO_NOSB(void, Bs3PrintU32,(uint32_t uValue));
    13421376
    13431377/**
     
    13461380 * @param   uValue      The 32-bit value.
    13471381 */
    1348 BS3_CMN_PROTO(void, Bs3PrintX32,(uint32_t uValue), false);
     1382BS3_CMN_PROTO_NOSB(void, Bs3PrintX32,(uint32_t uValue));
    13491383
    13501384/**
     
    13561390 * @param   ...             Format arguments.
    13571391 */
    1358 BS3_CMN_PROTO(size_t, Bs3Printf,(const char BS3_FAR *pszFormat, ...), true);
     1392BS3_CMN_PROTO_STUB(size_t, Bs3Printf,(const char BS3_FAR *pszFormat, ...));
    13591393
    13601394/**
     
    13661400 * @param   va              Format arguments.
    13671401 */
    1368 BS3_CMN_PROTO(size_t, Bs3PrintfV,(const char BS3_FAR *pszFormat, va_list va), true);
     1402BS3_CMN_PROTO_STUB(size_t, Bs3PrintfV,(const char BS3_FAR *pszFormat, va_list va));
    13691403
    13701404/**
     
    13731407 * @param   pszString       The string to print.
    13741408 */
    1375 BS3_CMN_PROTO(void, Bs3PrintStr,(const char BS3_FAR *pszString), true);
     1409BS3_CMN_PROTO_STUB(void, Bs3PrintStr,(const char BS3_FAR *pszString));
    13761410
    13771411/**
     
    13811415 * @param   cchString       The exact number of characters to print.
    13821416 */
    1383 BS3_CMN_PROTO(void, Bs3PrintStrN,(const char BS3_FAR *pszString, size_t cchString), false);
     1417BS3_CMN_PROTO_NOSB(void, Bs3PrintStrN,(const char BS3_FAR *pszString, size_t cchString));
    13841418
    13851419/**
     
    13881422 * @param   ch              The character to print.
    13891423 */
    1390 BS3_CMN_PROTO(void, Bs3PrintChr,(char ch), false);
     1424BS3_CMN_PROTO_NOSB(void, Bs3PrintChr,(char ch));
    13911425
    13921426
     
    14221456 * @param   pvUser      The user argument for the output function.
    14231457 */
    1424 BS3_CMN_PROTO(size_t, Bs3StrFormatV,(const char BS3_FAR *pszFormat, va_list va,
    1425                                      PFNBS3STRFORMATOUTPUT pfnOutput, void BS3_FAR *pvUser), true);
     1458BS3_CMN_PROTO_STUB(size_t, Bs3StrFormatV,(const char BS3_FAR *pszFormat, va_list va,
     1459                                          PFNBS3STRFORMATOUTPUT pfnOutput, void BS3_FAR *pvUser));
    14261460
    14271461/**
     
    14371471 * @param   va          Format arguments.
    14381472 */
    1439 BS3_CMN_PROTO(size_t, Bs3StrPrintfV,(char BS3_FAR *pszBuf, size_t cbBuf, const char BS3_FAR *pszFormat, va_list va), true);
     1473BS3_CMN_PROTO_STUB(size_t, Bs3StrPrintfV,(char BS3_FAR *pszBuf, size_t cbBuf, const char BS3_FAR *pszFormat, va_list va));
    14401474
    14411475/**
     
    14511485 * @param   ...         Format arguments.
    14521486 */
    1453 BS3_CMN_PROTO(size_t, Bs3StrPrintf,(char BS3_FAR *pszBuf, size_t cbBuf, const char BS3_FAR *pszFormat, ...), true);
     1487BS3_CMN_PROTO_STUB(size_t, Bs3StrPrintf,(char BS3_FAR *pszBuf, size_t cbBuf, const char BS3_FAR *pszFormat, ...));
    14541488
    14551489
     
    14601494 * @param   pszString       The string to examine.
    14611495 */
    1462 BS3_CMN_PROTO(size_t, Bs3StrLen,(const char BS3_FAR *pszString), true);
     1496BS3_CMN_PROTO_STUB(size_t, Bs3StrLen,(const char BS3_FAR *pszString));
    14631497
    14641498/**
     
    14701504 * @param   cchMax          The max length to examine.
    14711505 */
    1472 BS3_CMN_PROTO(size_t, Bs3StrNLen,(const char BS3_FAR *pszString, size_t cchMax), true);
     1506BS3_CMN_PROTO_STUB(size_t, Bs3StrNLen,(const char BS3_FAR *pszString, size_t cchMax));
    14731507
    14741508/**
     
    14801514 * @param   pszSrc          The source string.
    14811515 */
    1482 BS3_CMN_PROTO(char BS3_FAR *, Bs3StrCpy,(char BS3_FAR *pszDst, const char BS3_FAR *pszSrc), true);
     1516BS3_CMN_PROTO_STUB(char BS3_FAR *, Bs3StrCpy,(char BS3_FAR *pszDst, const char BS3_FAR *pszSrc));
    14831517
    14841518/**
     
    14901524 * @param   cbCopy          The number of bytes to copy.
    14911525 */
    1492 BS3_CMN_PROTO(void BS3_FAR *, Bs3MemCpy,(void BS3_FAR *pvDst, const void BS3_FAR *pvSrc, size_t cbToCopy), true);
     1526BS3_CMN_PROTO_STUB(void BS3_FAR *, Bs3MemCpy,(void BS3_FAR *pvDst, const void BS3_FAR *pvSrc, size_t cbToCopy));
    14931527
    14941528/**
     
    15001534 * @param   cbCopy          The number of bytes to copy.
    15011535 */
    1502 BS3_CMN_PROTO(void BS3_FAR *, Bs3MemPCpy,(void BS3_FAR *pvDst, const void BS3_FAR *pvSrc, size_t cbToCopy), true);
     1536BS3_CMN_PROTO_STUB(void BS3_FAR *, Bs3MemPCpy,(void BS3_FAR *pvDst, const void BS3_FAR *pvSrc, size_t cbToCopy));
    15031537
    15041538/**
     
    15101544 * @param   cbCopy          The number of bytes to copy.
    15111545 */
    1512 BS3_CMN_PROTO(void BS3_FAR *, Bs3MemMove,(void BS3_FAR *pvDst, const void BS3_FAR *pvSrc, size_t cbToCopy), true);
     1546BS3_CMN_PROTO_STUB(void BS3_FAR *, Bs3MemMove,(void BS3_FAR *pvDst, const void BS3_FAR *pvSrc, size_t cbToCopy));
    15131547
    15141548/**
     
    15181552 * @param   cbDst           The number of bytes to zero.
    15191553 */
    1520 BS3_CMN_PROTO(void, Bs3MemZero,(void BS3_FAR *pvDst, size_t cbDst), false);
     1554BS3_CMN_PROTO_NOSB(void, Bs3MemZero,(void BS3_FAR *pvDst, size_t cbDst));
     1555
     1556
     1557BS3_CMN_PROTO_STUB(void, Bs3UInt64Div,(RTUINT64U uDividend, RTUINT64U uDivisor, RTUINT64U BS3_FAR *paQuotientReminder));
     1558BS3_CMN_PROTO_STUB(void, Bs3UInt32Div,(RTUINT32U uDividend, RTUINT32U uDivisor, RTUINT32U BS3_FAR *paQuotientReminder));
    15211559
    15221560
     
    15281566 * @param   uSel            The protected mode segment selector.
    15291567 */
    1530 BS3_CMN_PROTO(uint32_t, Bs3SelProtFar32ToFlat32,(uint32_t off, uint16_t uSel), true);
     1568BS3_CMN_PROTO_STUB(uint32_t, Bs3SelProtFar32ToFlat32,(uint32_t off, uint16_t uSel));
    15311569
    15321570/**
     
    15371575 * @param   uSel            The current mode segment selector.
    15381576 */
    1539 BS3_CMN_PROTO(uint32_t, Bs3SelFar32ToFlat32,(uint32_t off, uint16_t uSel), true);
     1577BS3_CMN_PROTO_STUB(uint32_t, Bs3SelFar32ToFlat32,(uint32_t off, uint16_t uSel));
    15401578
    15411579/**
     
    15451583 * @param   uRealSeg        Real mode code segment.
    15461584 */
    1547 BS3_CMN_PROTO(uint16_t, Bs3SelRealModeCodeToProtMode,(uint16_t uRealSeg), false);
     1585BS3_CMN_PROTO_NOSB(uint16_t, Bs3SelRealModeCodeToProtMode,(uint16_t uRealSeg));
    15481586
    15491587/**
     
    15531591 * @param   uProtSel        Real mode code segment.
    15541592 */
    1555 BS3_CMN_PROTO(uint16_t, Bs3SelProtModeCodeToRealMode,(uint16_t uProtSel), false);
     1593BS3_CMN_PROTO_NOSB(uint16_t, Bs3SelProtModeCodeToRealMode,(uint16_t uProtSel));
    15561594
    15571595/**
     
    15611599 * @param   uFlatAddr       Flat code address.
    15621600 */
    1563 BS3_CMN_PROTO(uint32_t, Bs3SelFlatCodeToRealMode,(uint32_t uFlatAddr), false);
     1601BS3_CMN_PROTO_NOSB(uint32_t, Bs3SelFlatCodeToRealMode,(uint32_t uFlatAddr));
    15641602
    15651603/**
     
    15701608 * @param   uFlatAddr       Flat code address.
    15711609 */
    1572 BS3_CMN_PROTO(uint32_t, Bs3SelFlatCodeToProtFar16,(uint32_t uFlatAddr), false);
     1610BS3_CMN_PROTO_NOSB(uint32_t, Bs3SelFlatCodeToProtFar16,(uint32_t uFlatAddr));
    15731611
    15741612/**
     
    16511689 * @param   cbChunk         The chunk size.
    16521690 */
    1653 BS3_CMN_PROTO(void, Bs3SlabInit,(PBS3SLABCTL pSlabCtl, size_t cbSlabCtl, uint32_t uFlatSlabPtr,
    1654                                  uint32_t cbSlab, uint16_t cbChunk), true);
     1691BS3_CMN_PROTO_STUB(void, Bs3SlabInit,(PBS3SLABCTL pSlabCtl, size_t cbSlabCtl, uint32_t uFlatSlabPtr,
     1692                                      uint32_t cbSlab, uint16_t cbChunk));
    16551693
    16561694/**
     
    16601698 * @param   pSlabCtl        The slab constrol structure to allocate from.
    16611699 */
    1662 BS3_CMN_PROTO(void BS3_FAR *, Bs3SlabAlloc,(PBS3SLABCTL pSlabCtl), true);
     1700BS3_CMN_PROTO_STUB(void BS3_FAR *, Bs3SlabAlloc,(PBS3SLABCTL pSlabCtl));
    16631701
    16641702/**
     
    16711709 * @param   fFlags          Flags, see BS3_SLAB_ALLOC_F_XXX
    16721710 */
    1673 BS3_CMN_PROTO(void BS3_FAR *, Bs3SlabAllocEx,(PBS3SLABCTL pSlabCtl, uint16_t cChunks, uint16_t fFlags), true);
     1711BS3_CMN_PROTO_STUB(void BS3_FAR *, Bs3SlabAllocEx,(PBS3SLABCTL pSlabCtl, uint16_t cChunks, uint16_t fFlags));
    16741712
    16751713/**
     
    16821720 * @param   cChunks         The number of contiguous chunks to free.
    16831721 */
    1684 BS3_CMN_PROTO(uint16_t, Bs3SlabFree,(PBS3SLABCTL pSlabCtl, uint32_t uFlatChunkPtr, uint16_t cChunks), true);
     1722BS3_CMN_PROTO_STUB(uint16_t, Bs3SlabFree,(PBS3SLABCTL pSlabCtl, uint32_t uFlatChunkPtr, uint16_t cChunks));
    16851723
    16861724
     
    16911729 * @param   cbChunk     The chunk size.
    16921730 */
    1693 BS3_CMN_PROTO(void, Bs3SlabListInit,(PBS3SLABHEAD pHead, uint16_t cbChunk), true);
     1731BS3_CMN_PROTO_STUB(void, Bs3SlabListInit,(PBS3SLABHEAD pHead, uint16_t cbChunk));
    16941732
    16951733/**
     
    16991737 * @param   pSlabCtl        The slab control structure to add.
    17001738 */
    1701 BS3_CMN_PROTO(void, Bs3SlabListAdd,(PBS3SLABHEAD pHead, PBS3SLABCTL pSlabCtl), true);
     1739BS3_CMN_PROTO_STUB(void, Bs3SlabListAdd,(PBS3SLABHEAD pHead, PBS3SLABCTL pSlabCtl));
    17021740
    17031741/**
     
    17071745 * @param   pHead           The slab list to allocate from.
    17081746 */
    1709 BS3_CMN_PROTO(void BS3_FAR *, Bs3SlabListAlloc,(PBS3SLABHEAD pHead), true);
     1747BS3_CMN_PROTO_STUB(void BS3_FAR *, Bs3SlabListAlloc,(PBS3SLABHEAD pHead));
    17101748
    17111749/**
     
    17181756 * @param   fFlags          Flags, see BS3_SLAB_ALLOC_F_XXX
    17191757 */
    1720 BS3_CMN_PROTO(void BS3_FAR *, Bs3SlabListAllocEx,(PBS3SLABHEAD pHead, uint16_t cChunks, uint16_t fFlags), true);
     1758BS3_CMN_PROTO_STUB(void BS3_FAR *, Bs3SlabListAllocEx,(PBS3SLABHEAD pHead, uint16_t cChunks, uint16_t fFlags));
    17211759
    17221760/**
     
    17271765 * @param   cChunks         The number of contiguous chunks to free.
    17281766 */
    1729 BS3_CMN_PROTO(void, Bs3SlabListFree,(PBS3SLABHEAD pHead, void BS3_FAR *pvChunks, uint16_t cChunks), true);
     1767BS3_CMN_PROTO_STUB(void, Bs3SlabListFree,(PBS3SLABHEAD pHead, void BS3_FAR *pvChunks, uint16_t cChunks));
    17301768
    17311769/**
     
    17561794 * @param   cb          How much to allocate.  Must be 4KB or less.
    17571795 */
    1758 BS3_CMN_PROTO(void BS3_FAR *, Bs3MemAlloc,(BS3MEMKIND enmKind, size_t cb), true);
     1796BS3_CMN_PROTO_STUB(void BS3_FAR *, Bs3MemAlloc,(BS3MEMKIND enmKind, size_t cb));
    17591797
    17601798/**
     
    17651803 * @param   cb          How much to allocate.  Must be 4KB or less.
    17661804 */
    1767 BS3_CMN_PROTO(void BS3_FAR *, Bs3MemAllocZ,(BS3MEMKIND enmKind, size_t cb), true);
     1805BS3_CMN_PROTO_STUB(void BS3_FAR *, Bs3MemAllocZ,(BS3MEMKIND enmKind, size_t cb));
    17681806
    17691807/**
     
    17741812 * @param   cb          The size of the allocation.
    17751813 */
    1776 BS3_CMN_PROTO(void, Bs3MemFree,(void BS3_FAR *pv, size_t cb), true);
     1814BS3_CMN_PROTO_STUB(void, Bs3MemFree,(void BS3_FAR *pv, size_t cb));
    17771815
    17781816
     
    17801818 * Enables the A20 gate.
    17811819 */
    1782 BS3_CMN_PROTO(void, Bs3A20Enable,(void), false);
     1820BS3_CMN_PROTO_NOSB(void, Bs3A20Enable,(void));
    17831821
    17841822/**
    17851823 * Enables the A20 gate via the keyboard controller
    17861824 */
    1787 BS3_CMN_PROTO(void, Bs3A20EnableViaKbd,(void), false);
     1825BS3_CMN_PROTO_NOSB(void, Bs3A20EnableViaKbd,(void));
    17881826
    17891827/**
    17901828 * Enables the A20 gate via the PS/2 control port A.
    17911829 */
    1792 BS3_CMN_PROTO(void, Bs3A20EnableViaPortA,(void), false);
     1830BS3_CMN_PROTO_NOSB(void, Bs3A20EnableViaPortA,(void));
    17931831
    17941832/**
    17951833 * Disables the A20 gate.
    17961834 */
    1797 BS3_CMN_PROTO(void, Bs3A20Disable,(void), false);
     1835BS3_CMN_PROTO_NOSB(void, Bs3A20Disable,(void));
    17981836
    17991837/**
    18001838 * Disables the A20 gate via the keyboard controller
    18011839 */
    1802 BS3_CMN_PROTO(void, Bs3A20DisableViaKbd,(void), false);
     1840BS3_CMN_PROTO_NOSB(void, Bs3A20DisableViaKbd,(void));
    18031841
    18041842/**
    18051843 * Disables the A20 gate via the PS/2 control port A.
    18061844 */
    1807 BS3_CMN_PROTO(void, Bs3A20DisableViaPortA,(void), false);
     1845BS3_CMN_PROTO_NOSB(void, Bs3A20DisableViaPortA,(void));
    18081846
    18091847
     
    18141852 * @remarks Must not be called in real-mode!
    18151853 */
    1816 BS3_CMN_PROTO(int, Bs3PagingInitRootForPP,(void), true);
     1854BS3_CMN_PROTO_STUB(int, Bs3PagingInitRootForPP,(void));
    18171855
    18181856/**
     
    18231861 * @remarks Must not be called in real-mode!
    18241862 */
    1825 BS3_CMN_PROTO(int, Bs3PagingInitRootForPAE,(void), true);
     1863BS3_CMN_PROTO_STUB(int, Bs3PagingInitRootForPAE,(void));
    18261864
    18271865/**
     
    18321870 * @remarks Must not be called in real-mode!
    18331871 */
    1834 BS3_CMN_PROTO(int, Bs3PagingInitRootForLM,(void), true);
     1872BS3_CMN_PROTO_STUB(int, Bs3PagingInitRootForLM,(void));
    18351873
    18361874/**
     
    18501888 * @param   fClear      Mask of zero or more X86_PTE_XXX values to clear for the range.
    18511889 */
    1852 BS3_CMN_PROTO(int, Bs3PagingProtect,(uint64_t uFlat, uint64_t cb, uint64_t fSet, uint64_t fClear), true);
     1890BS3_CMN_PROTO_STUB(int, Bs3PagingProtect,(uint64_t uFlat, uint64_t cb, uint64_t fSet, uint64_t fClear));
    18531891
    18541892/**
     
    18681906 * @param   fClear      Mask of zero or more X86_PTE_XXX values to clear for the range.
    18691907 */
    1870 BS3_CMN_PROTO(int, Bs3PagingProtectPtr,(void BS3_FAR *pv, size_t cb, uint64_t fSet, uint64_t fClear), true);
     1908BS3_CMN_PROTO_STUB(int, Bs3PagingProtectPtr,(void BS3_FAR *pv, size_t cb, uint64_t fSet, uint64_t fClear));
    18711909
    18721910/**
    18731911 * Waits for the keyboard controller to become ready.
    18741912 */
    1875 BS3_CMN_PROTO(void, Bs3KbdWait,(void), false);
     1913BS3_CMN_PROTO_NOSB(void, Bs3KbdWait,(void));
    18761914
    18771915/**
     
    18841922 * @param        bCmd            The read command.
    18851923 */
    1886 BS3_CMN_PROTO(uint8_t, Bs3KbdRead,(uint8_t bCmd), false);
     1924BS3_CMN_PROTO_NOSB(uint8_t, Bs3KbdRead,(uint8_t bCmd));
    18871925
    18881926/**
     
    18951933 * @param        bData          The data to write.
    18961934 */
    1897 BS3_CMN_PROTO(void, Bs3KbdWrite,(uint8_t bCmd, uint8_t bData), false);
     1935BS3_CMN_PROTO_NOSB(void, Bs3KbdWrite,(uint8_t bCmd, uint8_t bData));
    18981936
    18991937
     
    19011939 * Disables all IRQs on the PIC.
    19021940 */
    1903 BS3_CMN_PROTO(void, Bs3PicMaskAll,(void), true);
     1941BS3_CMN_PROTO_STUB(void, Bs3PicMaskAll,(void));
    19041942
    19051943
     
    20012039 * @param   pRegCtx     Where to store the register context.
    20022040 */
    2003 BS3_CMN_PROTO(void, Bs3RegCtxSave,(PCBS3REGCTX pRegCtx), false);
     2041BS3_CMN_PROTO_NOSB(void, Bs3RegCtxSave,(PCBS3REGCTX pRegCtx));
    20042042
    20052043/**
     
    20092047 * @param   bRing       The target ring (0..3).
    20102048 */
    2011 BS3_CMN_PROTO(void, Bs3RegCtxConvertToRingX,(PBS3REGCTX pRegCtx, uint8_t bRing), true);
     2049BS3_CMN_PROTO_STUB(void, Bs3RegCtxConvertToRingX,(PBS3REGCTX pRegCtx, uint8_t bRing));
    20122050
    20132051/**
     
    20202058 * @remarks Does not return.
    20212059 */
    2022 BS3_CMN_PROTO(DECL_NO_RETURN(void), Bs3RegCtxRestore,(PCBS3REGCTX pRegCtx, uint16_t fFlags), false);
     2060BS3_CMN_PROTO_NOSB(DECL_NO_RETURN(void), Bs3RegCtxRestore,(PCBS3REGCTX pRegCtx, uint16_t fFlags));
    20232061#if !defined(BS3_KIT_WITH_NO_RETURN) && defined(__WATCOMC__)
    20242062# pragma aux Bs3RegCtxRestore_c16 "_Bs3RegCtxRestore_aborts_c16" __aborts
     
    20352073 * @param   pRegCtx     The register context to be printed.
    20362074 */
    2037 BS3_CMN_PROTO(void, Bs3RegCtxPrint,(PCBS3REGCTX pRegCtx), true);
     2075BS3_CMN_PROTO_STUB(void, Bs3RegCtxPrint,(PCBS3REGCTX pRegCtx));
    20382076
    20392077
     
    20692107
    20702108
    2071 
    2072 /**
    2073  * Initializes 16-bit (protected mode) trap handling.
    2074  *
    2075  * @remarks Does not install 16-bit trap handling, just initializes the
     2109/**
     2110 * Initializes real mode and v8086 trap handling.
     2111 *
     2112 * @remarks Does not install RM/V86 trap handling, just initializes the
    20762113 *          structures.
    20772114 */
    2078 BS3_CMN_PROTO(void, Bs3Trap16Init,(void), true);
    2079 
    2080 /**
    2081  * Initializes 16-bit (protected mode) trap handling, extended version.
     2115BS3_CMN_PROTO_STUB(void, Bs3TrapRmV86Init,(void));
     2116
     2117/**
     2118 * Initializes real mode and v8086 trap handling, extended version.
    20822119 *
    20832120 * @param   f386Plus    Set if the CPU is 80386 or later and
     
    20862123 *                      reversed.
    20872124 *
     2125 * @remarks Does not install RM/V86 trap handling, just initializes the
     2126 *          structures.
     2127 */
     2128BS3_CMN_PROTO_STUB(void, Bs3TrapRmV86InitEx,(bool f386Plus));
     2129
     2130/**
     2131 * Initializes 16-bit (protected mode) trap handling.
     2132 *
    20882133 * @remarks Does not install 16-bit trap handling, just initializes the
    20892134 *          structures.
    20902135 */
    2091 BS3_CMN_PROTO(void, Bs3Trap16InitEx,(bool f386Plus), true);
     2136BS3_CMN_PROTO_STUB(void, Bs3Trap16Init,(void));
     2137
     2138/**
     2139 * Initializes 16-bit (protected mode) trap handling, extended version.
     2140 *
     2141 * @param   f386Plus    Set if the CPU is 80386 or later and
     2142 *                      extended registers should be saved.  Once initialized
     2143 *                      with this parameter set to @a true, the effect cannot be
     2144 *                      reversed.
     2145 *
     2146 * @remarks Does not install 16-bit trap handling, just initializes the
     2147 *          structures.
     2148 */
     2149BS3_CMN_PROTO_STUB(void, Bs3Trap16InitEx,(bool f386Plus));
    20922150
    20932151/**
     
    20972155 *          structures.
    20982156 */
    2099 BS3_CMN_PROTO(void, Bs3Trap32Init,(void), true);
     2157BS3_CMN_PROTO_STUB(void, Bs3Trap32Init,(void));
    21002158
    21012159/**
     
    21052163 *          structures.
    21062164 */
    2107 BS3_CMN_PROTO(void, Bs3Trap64Init,(void), true);
     2165BS3_CMN_PROTO_STUB(void, Bs3Trap64Init,(void));
    21082166
    21092167/**
     
    21142172 * @param   off         The handler offset.
    21152173 */
    2116 BS3_CMN_PROTO(void, Bs3TrapRmV86SetGate,(uint8_t iIvt, uint16_t uSeg, uint16_t off), true);
     2174BS3_CMN_PROTO_STUB(void, Bs3TrapRmV86SetGate,(uint8_t iIvt, uint16_t uSeg, uint16_t off));
    21172175
    21182176/**
     
    21262184 * @param   cParams     The parameter count (for call gates).
    21272185 */
    2128 BS3_CMN_PROTO(void, Bs3Trap16SetGate,(uint8_t iIdt, uint8_t bType, uint8_t bDpl,
    2129                                       uint16_t uSel, uint16_t off, uint8_t cParams), true);
     2186BS3_CMN_PROTO_STUB(void, Bs3Trap16SetGate,(uint8_t iIdt, uint8_t bType, uint8_t bDpl,
     2187                                           uint16_t uSel, uint16_t off, uint8_t cParams));
    21302188
    21312189/** The address of Bs3Trap16GenericEntries.
     
    21452203 * @param   cParams     The parameter count (for call gates).
    21462204 */
    2147 BS3_CMN_PROTO(void, Bs3Trap32SetGate,(uint8_t iIdt, uint8_t bType, uint8_t bDpl,
    2148                                       uint16_t uSel, uint32_t off, uint8_t cParams), true);
     2205BS3_CMN_PROTO_STUB(void, Bs3Trap32SetGate,(uint8_t iIdt, uint8_t bType, uint8_t bDpl,
     2206                                           uint16_t uSel, uint32_t off, uint8_t cParams));
    21492207
    21502208/** The address of Bs3Trap32GenericEntries.
     
    21642222 * @param   bIst        The interrupt stack to use.
    21652223 */
    2166 BS3_CMN_PROTO(void, Bs3Trap64SetGate,(uint8_t iIdt, uint8_t bType, uint8_t bDpl,
    2167                                       uint16_t uSel, uint64_t off, uint8_t bIst), true);
     2224BS3_CMN_PROTO_STUB(void, Bs3Trap64SetGate,(uint8_t iIdt, uint8_t bType, uint8_t bDpl, uint16_t uSel, uint64_t off, uint8_t bIst));
    21682225
    21692226/** The address of Bs3Trap64GenericEntries.
     
    22022259 * @param   pfnHandler  Pointer to the handler.
    22032260 */
    2204 BS3_CMN_PROTO(PFNBS3TRAPHANDLER, Bs3TrapSetHandler,(uint8_t iIdt, PFNBS3TRAPHANDLER pfnHandler), true);
     2261BS3_CMN_PROTO_STUB(PFNBS3TRAPHANDLER, Bs3TrapSetHandler,(uint8_t iIdt, PFNBS3TRAPHANDLER pfnHandler));
    22052262
    22062263/**
     
    22112268 * @param   pTrapFrame      Trap frame of the trap to handle.
    22122269 */
    2213 BS3_CMN_PROTO(void, Bs3TrapDefaultHandler,(PBS3TRAPFRAME pTrapFrame), true);
     2270BS3_CMN_PROTO_STUB(void, Bs3TrapDefaultHandler,(PBS3TRAPFRAME pTrapFrame));
    22142271
    22152272/**
     
    22172274 * @param   pTrapFrame      Trap frame to print.
    22182275 */
    2219 BS3_CMN_PROTO(void, Bs3TrapPrintFrame,(PCBS3TRAPFRAME pTrapFrame), true);
     2276BS3_CMN_PROTO_STUB(void, Bs3TrapPrintFrame,(PCBS3TRAPFRAME pTrapFrame));
    22202277
    22212278/**
     
    22312288 * @sa      #Bs3TrapUnsetJmp
    22322289 */
    2233 BS3_CMN_PROTO(DECL_RETURNS_TWICE(bool),Bs3TrapSetJmp,(PBS3TRAPFRAME pTrapFrame), false);
     2290BS3_CMN_PROTO_NOSB(DECL_RETURNS_TWICE(bool),Bs3TrapSetJmp,(PBS3TRAPFRAME pTrapFrame));
    22342291
    22352292/**
     
    22392296 * @param   pTrapFrame      Where to store the trap information.
    22402297 */
    2241 BS3_CMN_PROTO(void, Bs3TrapSetJmpAndRestore,(PCBS3REGCTX pCtxRestore, PBS3TRAPFRAME pTrapFrame), true);
     2298BS3_CMN_PROTO_STUB(void, Bs3TrapSetJmpAndRestore,(PCBS3REGCTX pCtxRestore, PBS3TRAPFRAME pTrapFrame));
    22422299
    22432300/**
    22442301 * Disables a previous #Bs3TrapSetJmp call.
    22452302 */
    2246 BS3_CMN_PROTO(void, Bs3TrapUnsetJmp,(void), true);
     2303BS3_CMN_PROTO_STUB(void, Bs3TrapUnsetJmp,(void));
    22472304
    22482305
     
    22572314 * @param   pszTest         The test name.
    22582315 */
    2259 BS3_CMN_PROTO(void, Bs3TestInit,(const char BS3_FAR *pszTest), true);
     2316BS3_CMN_PROTO_STUB(void, Bs3TestInit,(const char BS3_FAR *pszTest));
    22602317
    22612318
     
    22632320 * Equivalent to RTTestSummaryAndDestroy.
    22642321 */
    2265 BS3_CMN_PROTO(void, Bs3TestTerm,(void), true);
     2322BS3_CMN_PROTO_STUB(void, Bs3TestTerm,(void));
    22662323
    22672324/**
    22682325 * Equivalent to RTTestISub.
    22692326 */
    2270 BS3_CMN_PROTO(void, Bs3TestSub,(const char BS3_FAR *pszSubTest), true);
     2327BS3_CMN_PROTO_STUB(void, Bs3TestSub,(const char BS3_FAR *pszSubTest));
    22712328
    22722329/**
    22732330 * Equivalent to RTTestIFailedF.
    22742331 */
    2275 BS3_CMN_PROTO(void, Bs3TestSubF,(const char BS3_FAR *pszFormat, ...), true);
     2332BS3_CMN_PROTO_STUB(void, Bs3TestSubF,(const char BS3_FAR *pszFormat, ...));
    22762333
    22772334/**
    22782335 * Equivalent to RTTestISubV.
    22792336 */
    2280 BS3_CMN_PROTO(void, Bs3TestSubV,(const char BS3_FAR *pszFormat, va_list va), true);
     2337BS3_CMN_PROTO_STUB(void, Bs3TestSubV,(const char BS3_FAR *pszFormat, va_list va));
    22812338
    22822339/**
    22832340 * Equivalent to RTTestISubDone.
    22842341 */
    2285 BS3_CMN_PROTO(void, Bs3TestSubDone,(void), true);
     2342BS3_CMN_PROTO_STUB(void, Bs3TestSubDone,(void));
    22862343
    22872344/**
    22882345 * Equivalent to RTTestSubErrorCount.
    22892346 */
    2290 BS3_CMN_PROTO(uint16_t, Bs3TestSubErrorCount,(void), true);
     2347BS3_CMN_PROTO_STUB(uint16_t, Bs3TestSubErrorCount,(void));
    22912348
    22922349/**
     
    22962353 * @param   ...         String format arguments.
    22972354 */
    2298 BS3_CMN_PROTO(void, Bs3TestPrintf,(const char BS3_FAR *pszFormat, ...), true);
     2355BS3_CMN_PROTO_STUB(void, Bs3TestPrintf,(const char BS3_FAR *pszFormat, ...));
    22992356
    23002357/**
     
    23042361 * @param   va          String format arguments.
    23052362 */
    2306 BS3_CMN_PROTO(void, Bs3TestPrintfV,(const char BS3_FAR *pszFormat, va_list va), true);
     2363BS3_CMN_PROTO_STUB(void, Bs3TestPrintfV,(const char BS3_FAR *pszFormat, va_list va));
    23072364
    23082365/**
    23092366 * Equivalent to RTTestIFailed.
    23102367 */
    2311 BS3_CMN_PROTO(void, Bs3TestFailed,(const char BS3_FAR *pszMessage), true);
     2368BS3_CMN_PROTO_STUB(void, Bs3TestFailed,(const char BS3_FAR *pszMessage));
    23122369
    23132370/**
    23142371 * Equivalent to RTTestIFailedF.
    23152372 */
    2316 BS3_CMN_PROTO(void, Bs3TestFailedF,(const char BS3_FAR *pszFormat, ...), true);
     2373BS3_CMN_PROTO_STUB(void, Bs3TestFailedF,(const char BS3_FAR *pszFormat, ...));
    23172374
    23182375/**
    23192376 * Equivalent to RTTestIFailedV.
    23202377 */
    2321 BS3_CMN_PROTO(void, Bs3TestFailedV,(const char BS3_FAR *pszFormat, va_list va), true);
     2378BS3_CMN_PROTO_STUB(void, Bs3TestFailedV,(const char BS3_FAR *pszFormat, va_list va));
    23222379
    23232380/**
     
    23262383 * @param   pszWhy          Optional reason why it's being skipped.
    23272384 */
    2328 BS3_CMN_PROTO(void, Bs3TestSkipped,(const char BS3_FAR *pszWhy), true);
     2385BS3_CMN_PROTO_STUB(void, Bs3TestSkipped,(const char BS3_FAR *pszWhy));
    23292386
    23302387/**
     
    23342391 * @param   ...             Format arguments.
    23352392 */
    2336 BS3_CMN_PROTO(void, Bs3TestSkippedF,(const char BS3_FAR *pszFormat, ...), true);
     2393BS3_CMN_PROTO_STUB(void, Bs3TestSkippedF,(const char BS3_FAR *pszFormat, ...));
    23372394
    23382395/**
     
    23422399 * @param   va              Format arguments.
    23432400 */
    2344 BS3_CMN_PROTO(void, Bs3TestSkippedV,(const char BS3_FAR *pszFormat, va_list va), true);
     2401BS3_CMN_PROTO_STUB(void, Bs3TestSkippedV,(const char BS3_FAR *pszFormat, va_list va));
    23452402
    23462403/**
     
    23582415 * @param   idTestStep      Test step identifier.
    23592416 */
    2360 BS3_CMN_PROTO(bool, Bs3TestCheckRegCtxEx,(PCBS3REGCTX pActualCtx, PCBS3REGCTX pExpectedCtx, uint16_t cbPcAdjust,
    2361                                           int16_t cbSpAdjust, uint32_t fExtraEfl, const char *pszMode, uint16_t idTestStep), true);
     2417BS3_CMN_PROTO_STUB(bool, Bs3TestCheckRegCtxEx,(PCBS3REGCTX pActualCtx, PCBS3REGCTX pExpectedCtx, uint16_t cbPcAdjust,
     2418                                               int16_t cbSpAdjust, uint32_t fExtraEfl, const char *pszMode, uint16_t idTestStep));
    23622419
    23632420/**
     
    25452602
    25462603
    2547 /** @def BS3_MODE_PROTO
    2548  * Macro for reducing typing.
    2549  *
    2550  * Doxygen knows how to expand this, well, kind of.
     2604/** @def BS3_MODE_PROTO_INT
     2605 * Internal macro for emitting prototypes for mode functions.
    25512606 *
    25522607 * @param   a_RetType   The return type.
    25532608 * @param   a_Name      The function basename.
    25542609 * @param   a_Params    The parameter list (in parentheses).
    2555  * @param   a_fAutoStub Whether to autogenerate a 16-bit near -> 16-bit far stub
    2556  *                      function. Either 'true' for stub or 'false' for no stub.
    2557  */
    2558 #define BS3_MODE_PROTO(a_RetType, a_Name, a_Params, a_fAutoStub) \
     2610 * @sa      BS3_MODE_PROTO_STUB, BS3_MODE_PROTO_NOSB
     2611 */
     2612#define BS3_MODE_PROTO_INT(a_RetType, a_Name, a_Params) \
    25592613    BS3_DECL_NEAR(a_RetType) RT_CONCAT(a_Name,_rm)           a_Params; \
    25602614    BS3_DECL_NEAR(a_RetType) RT_CONCAT(a_Name,_pe16)         a_Params; \
     
    25942648    BS3_DECL_FAR(a_RetType)  RT_CONCAT(a_Name,_lm16_far)     a_Params
    25952649
     2650/** @def BS3_MODE_PROTO_STUB
     2651 * Macro for prototyping all the variations of a mod function with automatic
     2652 * near -> far stub.
     2653 *
     2654 * @param   a_RetType   The return type.
     2655 * @param   a_Name      The function basename.
     2656 * @param   a_Params    The parameter list (in parentheses).
     2657 * @sa      BS3_MODE_PROTO_STUB, BS3_MODE_PROTO_NOSB
     2658 */
     2659#define BS3_MODE_PROTO_STUB(a_RetType, a_Name, a_Params) BS3_MODE_PROTO_INT(a_RetType, a_Name, a_Params)
     2660
     2661/** @def BS3_MODE_PROTO_STUB
     2662 * Macro for prototyping all the variations of a mod function without any
     2663 * near -> far stub.
     2664 *
     2665 * @param   a_RetType   The return type.
     2666 * @param   a_Name      The function basename.
     2667 * @param   a_Params    The parameter list (in parentheses).
     2668 * @sa      BS3_MODE_PROTO_STUB, BS3_MODE_PROTO_NOSB
     2669 */
     2670#define BS3_MODE_PROTO_NOSB(a_RetType, a_Name, a_Params) BS3_MODE_PROTO_INT(a_RetType, a_Name, a_Params)
     2671
     2672
    25962673/**
    25972674 * Macro for reducing typing.
     
    26412718 *          capabilities.
    26422719 */
    2643 BS3_MODE_PROTO(uint8_t, Bs3CpuDetect,(void), false);
     2720BS3_MODE_PROTO_NOSB(uint8_t, Bs3CpuDetect,(void));
    26442721
    26452722/** @name BS3CPU_XXX - CPU detected by BS3CpuDetect_c16() and friends.
     
    26772754 * Calls the appropriate Bs3Trap16Init, Bs3Trap32Init or Bs3Trap64Init function.
    26782755 */
    2679 BS3_MODE_PROTO(void, Bs3TrapInit,(void), true);
     2756BS3_MODE_PROTO_STUB(void, Bs3TrapInit,(void));
    26802757
    26812758/**
     
    26852762 * @param   cEntries        The number of sub-test entries.
    26862763 */
    2687 BS3_MODE_PROTO(void, Bs3TestDoModes,(PCBS3TESTMODEENTRY paEntries, size_t cEntries), true);
     2764BS3_MODE_PROTO_NOSB(void, Bs3TestDoModes,(PCBS3TESTMODEENTRY paEntries, size_t cEntries));
    26882765
    26892766
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette