VirtualBox

source: vbox/trunk/src/VBox/ValidationKit/bootsectors/bs3kit/bs3-shutdown.c@ 58809

最後變更 在這個檔案從58809是 58809,由 vboxsync 提交於 9 年 前

bs3kit: Watcom intrinsics (no 64-bit division yet) and printf.

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Author Date Id Revision
檔案大小: 1.4 KB
 
1
2#include "bs3kit.h"
3#include <iprt/assert.h>
4
5AssertCompileSize(uint16_t, 2);
6AssertCompileSize(uint32_t, 4);
7AssertCompileSize(uint64_t, 8);
8
9
10/* Just a sample. */
11BS3_DECL(void) Main_rm(void)
12{
13 void BS3_FAR *pvTmp1;
14 void BS3_FAR *pvTmp2;
15 void BS3_FAR *pvTmp3;
16 void BS3_FAR *pvTmp4;
17 Bs3InitMemory_rm();
18
19 Bs3TestInit("bs3-shutdown");
20
21Bs3PrintStr("Bs3PrintX32:");
22Bs3PrintX32(UINT32_C(0xfdb97531));
23Bs3PrintStr("\r\n");
24
25Bs3Printf("Bs3Printf: RX32=%#'RX32 string='%s' d=%d p=%p\n", UINT32_C(0xfdb97531), "my string", 42, Main_rm);
26
27pvTmp2 = Bs3MemAlloc(BS3MEMKIND_REAL, _4K);
28Bs3PrintStr("pvTmp2=");
29Bs3PrintX32((uintptr_t)pvTmp2);
30Bs3PrintStr("\r\n");
31
32pvTmp3 = Bs3MemAlloc(BS3MEMKIND_REAL, _4K);
33Bs3PrintStr("pvTmp3=");
34Bs3PrintX32((uintptr_t)pvTmp3);
35Bs3PrintStr("\r\n");
36Bs3MemFree(pvTmp2, _4K);
37
38pvTmp4 = Bs3MemAlloc(BS3MEMKIND_REAL, _4K);
39Bs3PrintStr("pvTmp4=");
40Bs3PrintX32((uintptr_t)pvTmp4);
41Bs3PrintStr("\r\n");
42Bs3PrintStr("\r\n");
43
44pvTmp1 = Bs3MemAlloc(BS3MEMKIND_REAL, 31);
45Bs3PrintStr("pvTmp1=");
46Bs3PrintX32((uintptr_t)pvTmp1);
47Bs3PrintStr("\r\n");
48
49pvTmp2 = Bs3MemAlloc(BS3MEMKIND_REAL, 17);
50Bs3PrintStr("pvTmp2=");
51Bs3PrintX32((uintptr_t)pvTmp2);
52Bs3PrintStr("\r\n");
53
54Bs3MemFree(pvTmp1, 31);
55pvTmp3 = Bs3MemAlloc(BS3MEMKIND_REAL, 17);
56Bs3PrintStr("pvTmp3=");
57Bs3PrintX32((uintptr_t)pvTmp3);
58Bs3PrintStr("\r\n");
59
60
61Bs3Panic();
62 Bs3Shutdown();
63 return;
64}
65
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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