1 | ; $Id: zero.asm 98103 2023-01-17 14:15:46Z vboxsync $
|
---|
2 | ;; @file
|
---|
3 | ; IPRT - Zero Memory.
|
---|
4 | ;
|
---|
5 |
|
---|
6 | ;
|
---|
7 | ; Copyright (C) 2013-2023 Oracle and/or its affiliates.
|
---|
8 | ;
|
---|
9 | ; This file is part of VirtualBox base platform packages, as
|
---|
10 | ; available from https://www.virtualbox.org.
|
---|
11 | ;
|
---|
12 | ; This program is free software; you can redistribute it and/or
|
---|
13 | ; modify it under the terms of the GNU General Public License
|
---|
14 | ; as published by the Free Software Foundation, in version 3 of the
|
---|
15 | ; License.
|
---|
16 | ;
|
---|
17 | ; This program is distributed in the hope that it will be useful, but
|
---|
18 | ; WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
19 | ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
20 | ; General Public License for more details.
|
---|
21 | ;
|
---|
22 | ; You should have received a copy of the GNU General Public License
|
---|
23 | ; along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
24 | ;
|
---|
25 | ; The contents of this file may alternatively be used under the terms
|
---|
26 | ; of the Common Development and Distribution License Version 1.0
|
---|
27 | ; (CDDL), a copy of it is provided in the "COPYING.CDDL" file included
|
---|
28 | ; in the VirtualBox distribution, in which case the provisions of the
|
---|
29 | ; CDDL are applicable instead of those of the GPL.
|
---|
30 | ;
|
---|
31 | ; You may elect to license modified versions of this file under the
|
---|
32 | ; terms and conditions of either the GPL or the CDDL or both.
|
---|
33 | ;
|
---|
34 | ; SPDX-License-Identifier: GPL-3.0-only OR CDDL-1.0
|
---|
35 | ;
|
---|
36 |
|
---|
37 | ;*******************************************************************************
|
---|
38 | ;* Header Files *
|
---|
39 | ;*******************************************************************************
|
---|
40 | %include "iprt/asmdefs.mac"
|
---|
41 |
|
---|
42 | ;
|
---|
43 | ; Section to put this in.
|
---|
44 | ;
|
---|
45 | ; - PE/COFF: Unless we put this in an BSS like section, the linker will
|
---|
46 | ; write out 64KB of zeros. (Tried using .rdata$zz and put it at the end
|
---|
47 | ; of that section, but the linker did not reduce the RawDataSize.) The
|
---|
48 | ; assmebler does not let us control the write flag directly, so we emit
|
---|
49 | ; a linker directive that switches of the write flag for the section.
|
---|
50 | ;
|
---|
51 | ; - Fallback: Code section.
|
---|
52 | ;
|
---|
53 | %ifdef ASM_FORMAT_PE
|
---|
54 | section .drectve info
|
---|
55 | db '-section:.zero,!W '
|
---|
56 | section .zero bss align=4096
|
---|
57 | %else
|
---|
58 | BEGINCODE
|
---|
59 | %endif
|
---|
60 |
|
---|
61 | ;;
|
---|
62 | ; 64KB of zero memory with various sized labels.
|
---|
63 | ;
|
---|
64 | EXPORTEDNAME_EX g_abRTZeroPage, object
|
---|
65 | EXPORTEDNAME_EX g_abRTZero4K, object
|
---|
66 | EXPORTEDNAME_EX g_abRTZero8K, object
|
---|
67 | EXPORTEDNAME_EX g_abRTZero16K, object
|
---|
68 | EXPORTEDNAME_EX g_abRTZero32K, object
|
---|
69 | EXPORTEDNAME_EX g_abRTZero64K, object
|
---|
70 | %ifdef ASM_FORMAT_PE
|
---|
71 | resb 0x10000
|
---|
72 | %else
|
---|
73 | times 0x10000/(16*4) dd 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0
|
---|
74 | %endif
|
---|
75 | %ifdef ASM_FORMAT_ELF
|
---|
76 | size g_abRTZeroPage _4K
|
---|
77 | size g_abRTZero4K _4K
|
---|
78 | size g_abRTZero8K _8K
|
---|
79 | size g_abRTZero16K _16K
|
---|
80 | size g_abRTZero32K _32K
|
---|
81 | size g_abRTZero64K _64K
|
---|
82 | %endif
|
---|
83 |
|
---|