Zephyr API Documentation
4.1.99
A Scalable Open Source RTOS
4.1.99
Toggle main menu visibility
Main Page
Related Pages
Topics
Data Structures
Data Structures
Data Structure Index
Data Fields
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
Variables
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
Enumerator
Files
File List
Globals
All
$
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Variables
$
a
b
c
d
f
g
h
i
k
l
m
n
o
p
r
s
t
u
x
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
z
Macros
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
▼
Zephyr API Documentation
►
Introduction
Deprecated List
►
Topics
►
Data Structures
▼
Files
▼
File List
►
doc
►
kernel
►
lib
►
modules
►
subsys
▼
zephyr
►
acpi
►
app_memory
►
arch
►
audio
►
bluetooth
►
canbus
►
console
►
crypto
►
data
►
debug
►
devicetree
►
dfu
►
display
►
drivers
►
dsp
►
dt-bindings
►
fs
►
input
►
internal
►
ipc
►
kernel
▼
linker
►
devicetree_regions.h
►
iterable_sections.h
►
linker-defs.h
linker-devnull.h
►
linker-tool-gcc.h
►
linker-tool-lld.h
►
linker-tool-mwdt.h
linker-tool.h
section_tags.h
sections.h
►
utils.h
►
llext
►
logging
►
lorawan
►
math
►
mem_mgmt
►
mgmt
►
misc
►
modbus
►
modem
►
multi_heap
►
net
►
platform
►
pm
►
pmci
►
portability
►
posix
►
psa
►
random
►
retention
►
rtio
►
sd
►
sensing
►
settings
►
shell
►
sip_svc
►
stats
►
storage
►
sys
►
task_wdt
►
timing
►
toolchain
►
tracing
►
usb
►
usb_c
►
virtio
►
xen
►
zbus
►
zvfs
►
bindesc.h
►
cache.h
►
device.h
►
devicetree.h
►
fatal.h
►
fatal_types.h
►
init.h
►
irq.h
►
irq_multilevel.h
►
irq_nextlevel.h
►
irq_offload.h
►
kernel.h
kernel_includes.h
►
kernel_structs.h
►
kernel_version.h
►
net_buf.h
►
shared_irq.h
►
smf.h
►
spinlock.h
►
sw_isr_table.h
►
sys_clock.h
►
syscall.h
►
toolchain.h
types.h
►
Globals
•
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Modules
Pages
Loading...
Searching...
No Matches
linker-devnull.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2023 Nordic Semiconductor ASA
3
*
4
* SPDX-License-Identifier: Apache-2.0
5
*/
6
7
/*
8
* DESCRIPTION
9
* Platform independent set of macros for creating a memory segment for
10
* aggregating data that shall be kept in the elf file but not in the binary.
11
*/
12
13
#ifndef ZEPHYR_INCLUDE_LINKER_LINKER_DEVNULL_H_
14
#define ZEPHYR_INCLUDE_LINKER_LINKER_DEVNULL_H_
15
16
#if defined(CONFIG_LINKER_DEVNULL_MEMORY)
17
18
#if defined(CONFIG_XIP)
19
#if (!defined(ROM_ADDR) && !defined(ROM_BASE)) || !defined(ROM_SIZE)
20
#error "ROM_SIZE, ROM_ADDR or ROM_BASE not defined"
21
#endif
22
#endif
/* CONFIG_XIP */
23
24
#if (!defined(RAM_ADDR) && !defined(RAM_BASE)) || !defined(RAM_SIZE)
25
#error "RAM_SIZE, RAM_ADDR or RAM_BASE not defined"
26
#endif
27
28
#if defined(CONFIG_XIP) && !defined(ROM_ADDR)
29
#define ROM_ADDR ROM_BASE
30
#endif
31
32
#if !defined(RAM_ADDR)
33
#define RAM_ADDR RAM_BASE
34
#endif
35
36
#define ROM_END_ADDR (ROM_ADDR + ROM_SIZE)
37
#define DEVNULL_SIZE CONFIG_LINKER_DEVNULL_MEMORY_SIZE
38
#define ROM_DEVNULL_END_ADDR (ROM_END_ADDR + DEVNULL_SIZE)
39
#define MAX_ADDR UINT32_MAX
40
41
/* Determine where to put the devnull region. It should be adjacent to the ROM
42
* region. If ROM starts after RAM or the distance between ROM and RAM is big
43
* enough to fit the devnull region then devnull region is placed just after
44
* the ROM region. If it cannot be done then the devnull region is placed before
45
* the ROM region. It is possible that the devnull region cannot be placed
46
* adjacent to the ROM (e.g. ROM starts at 0 and RAM follows ROM). In that
47
* case compilation fails and the devnull region is not supported in that
48
* configuration.
49
*/
50
#if !defined(CONFIG_XIP)
51
52
#if RAM_ADDR >= DEVNULL_SIZE
53
#define DEVNULL_ADDR (RAM_ADDR - DEVNULL_SIZE)
54
#else
55
#define DEVNULL_ADDR (RAM_ADDR + RAM_SIZE)
56
#endif
57
58
#else
/* CONFIG_XIP */
59
60
#if ((ROM_ADDR > RAM_ADDR) && ((MAX_ADDR - ROM_END_ADDR) >= DEVNULL_SIZE)) || \
61
((ROM_END_ADDR + DEVNULL_SIZE) <= RAM_ADDR)
62
#define DEVNULL_ADDR ROM_END_ADDR
63
#elif ROM_ADDR > DEVNULL_SIZE
64
#define DEVNULL_ADDR (ROM_ADDR - DEVNULL_SIZE)
65
#else
66
#error "Cannot place devnull segment adjacent to ROM region."
67
#endif
68
69
#endif
/* CONFIG_XIP */
70
71
#define DEVNULL_REGION DEVNULL_ROM
72
73
#endif
/* CONFIG_LINKER_DEVNULL_MEMORY */
74
75
#endif
/* ZEPHYR_INCLUDE_LINKER_LINKER_DEVNULL_H_ */
zephyr
linker
linker-devnull.h
Generated on Thu Jun 5 2025 09:07:06 for Zephyr API Documentation by
1.12.0