VirtualBox

source: vbox/trunk/src/VBox/Runtime/common/misc/zero-alt.S

Last change on this file was 106061, checked in by vboxsync, 8 weeks ago

Copyright year updates by scm.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.7 KB
Line 
1/* $Id: zero-alt.S 106061 2024-09-16 14:03:52Z vboxsync $ */
2/** @file
3 * IPRT - Zero Memory, mach-o version (for arm/sparc).
4 */
5
6/*
7 * Copyright (C) 2013-2024 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#ifdef ASM_FORMAT_MACHO
39; Putting it in the code segment/section for now.
40 .section __TEXT,__text,regular,pure_instructions
41 .section __TEXT,__const
42# define NAME(a) _##a
43#elif defined(ASM_FORMAT_ELF) && (defined(RT_ARCH_ARM64) || defined(RT_ARCH_SPARC) || defined(RT_ARCH_SPARC64))
44/* Putting it in the rodata segment/section for now. */
45 .file "zero-alt.S"
46 .section ".rodata"
47# define NAME(a) a
48# ifndef RT_ARCH_ARM64 /* RTSignTool references g_abRTZero4K from VBoxRT.so */
49# define NEED_HIDDEN
50# endif
51#else
52# error "PORT ME!"
53#endif
54
55/* 64KB of zero memory with various sized labels. */
56 .globl NAME(g_abRTZeroPage)
57#ifdef ASM_FORMAT_ELF
58# ifdef NEED_HIDDEN
59 .hidden NAME(g_abRTZeroPage)
60# endif
61 .type NAME(g_abRTZeroPage),#object
62# if defined(RT_ARCH_SPARC) || defined(RT_ARCH_SPARC64)
63 .size NAME(g_abRTZeroPage),8192
64# else
65 .size NAME(g_abRTZeroPage),4096
66# endif
67#endif
68NAME(g_abRTZeroPage):
69 .globl NAME(g_abRTZero4K)
70#ifdef ASM_FORMAT_ELF
71# ifdef NEED_HIDDEN
72 .hidden NAME(g_abRTZero4K)
73# endif
74 .type NAME(g_abRTZero4K),#object
75 .size NAME(g_abRTZero4K),4096
76#endif
77NAME(g_abRTZero4K):
78 .globl NAME(g_abRTZero8K)
79#ifdef ASM_FORMAT_ELF
80# ifdef NEED_HIDDEN
81 .hidden NAME(g_abRTZero8K)
82# endif
83 .type NAME(g_abRTZero8K),#object
84 .size NAME(g_abRTZero8K),8192
85#endif
86NAME(g_abRTZero8K):
87 .globl NAME(g_abRTZero16K)
88#ifdef ASM_FORMAT_ELF
89# ifdef NEED_HIDDEN
90 .hidden NAME(g_abRTZero16K)
91# endif
92 .type NAME(g_abRTZero16K),#object
93 .size NAME(g_abRTZero16K),16384
94#endif
95NAME(g_abRTZero16K):
96 .globl NAME(g_abRTZero32K)
97#ifdef ASM_FORMAT_ELF
98# ifdef NEED_HIDDEN
99 .hidden NAME(g_abRTZero32K)
100# endif
101 .type NAME(g_abRTZero32K),#object
102 .size NAME(g_abRTZero32K),32768
103#endif
104NAME(g_abRTZero32K):
105 .globl NAME(g_abRTZero64K)
106#ifdef ASM_FORMAT_ELF
107# ifdef NEED_HIDDEN
108 .hidden NAME(g_abRTZero64K)
109# endif
110 .type NAME(g_abRTZero64K),#object
111 .size NAME(g_abRTZero64K),65536
112#endif
113NAME(g_abRTZero64K):
114
115#ifdef ASM_FORMAT_MACHO
116 .space 65536
117#elif defined(ASM_FORMAT_ELF)
118 .skip 65536
119#endif
120
Note: See TracBrowser for help on using the repository browser.

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