1 |
|
---|
2 | #include "bs3kit.h"
|
---|
3 | #include <iprt/assert.h>
|
---|
4 |
|
---|
5 | AssertCompileSize(uint16_t, 2);
|
---|
6 | AssertCompileSize(uint32_t, 4);
|
---|
7 | AssertCompileSize(uint64_t, 8);
|
---|
8 |
|
---|
9 |
|
---|
10 | /* Just a sample. */
|
---|
11 | BS3_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 |
|
---|
21 | Bs3PrintStr("Bs3PrintX32:");
|
---|
22 | Bs3PrintX32(UINT32_C(0xfdb97531));
|
---|
23 | Bs3PrintStr("\r\n");
|
---|
24 |
|
---|
25 | Bs3Printf("Bs3Printf: RX32=%#'RX32 string='%s' d=%d p=%p\n", UINT32_C(0xfdb97531), "my string", 42, Main_rm);
|
---|
26 |
|
---|
27 | pvTmp2 = Bs3MemAlloc(BS3MEMKIND_REAL, _4K);
|
---|
28 | Bs3PrintStr("pvTmp2=");
|
---|
29 | Bs3PrintX32((uintptr_t)pvTmp2);
|
---|
30 | Bs3PrintStr("\r\n");
|
---|
31 |
|
---|
32 | pvTmp3 = Bs3MemAlloc(BS3MEMKIND_REAL, _4K);
|
---|
33 | Bs3PrintStr("pvTmp3=");
|
---|
34 | Bs3PrintX32((uintptr_t)pvTmp3);
|
---|
35 | Bs3PrintStr("\r\n");
|
---|
36 | Bs3MemFree(pvTmp2, _4K);
|
---|
37 |
|
---|
38 | pvTmp4 = Bs3MemAlloc(BS3MEMKIND_REAL, _4K);
|
---|
39 | Bs3PrintStr("pvTmp4=");
|
---|
40 | Bs3PrintX32((uintptr_t)pvTmp4);
|
---|
41 | Bs3PrintStr("\r\n");
|
---|
42 | Bs3PrintStr("\r\n");
|
---|
43 |
|
---|
44 | pvTmp1 = Bs3MemAlloc(BS3MEMKIND_REAL, 31);
|
---|
45 | Bs3PrintStr("pvTmp1=");
|
---|
46 | Bs3PrintX32((uintptr_t)pvTmp1);
|
---|
47 | Bs3PrintStr("\r\n");
|
---|
48 |
|
---|
49 | pvTmp2 = Bs3MemAlloc(BS3MEMKIND_REAL, 17);
|
---|
50 | Bs3PrintStr("pvTmp2=");
|
---|
51 | Bs3PrintX32((uintptr_t)pvTmp2);
|
---|
52 | Bs3PrintStr("\r\n");
|
---|
53 |
|
---|
54 | Bs3MemFree(pvTmp1, 31);
|
---|
55 | pvTmp3 = Bs3MemAlloc(BS3MEMKIND_REAL, 17);
|
---|
56 | Bs3PrintStr("pvTmp3=");
|
---|
57 | Bs3PrintX32((uintptr_t)pvTmp3);
|
---|
58 | Bs3PrintStr("\r\n");
|
---|
59 |
|
---|
60 |
|
---|
61 | Bs3Panic();
|
---|
62 | Bs3Shutdown();
|
---|
63 | return;
|
---|
64 | }
|
---|
65 |
|
---|