XenevaOS
Loading...
Searching...
No Matches
autoconf.h
Go to the documentation of this file.
1#ifndef __LINUX_AUTOCONF_H__
2#define __LINUX_AUTOCONF_H__
3
4/*
5 * DCL stand-in for <autoconf.h>: the CONFIG_* surface mainline drivers read.
6 *
7 * Only what an in-tree DCL port actually consumes gets defined here; an
8 * undefined CONFIG_* makes the corresponding mainline #ifdef arm drop out,
9 * which is how /dev/port (x86-only), STRICT_DEVMEM and THP stay out of the
10 * build without editing the vendored source.
11 */
12
13#define CONFIG_MMU 1 /* else mem.c compiles the NOMMU mmap arms */
14#define CONFIG_PRINTK 1 /* mem.c's /dev/kmsg (kmsg_fops) arm */
15#define CONFIG_DEVMEM 1 /* /dev/mem (mem_fops) arm */
16
17/*
18 * mem.c's own valid_phys_addr_range() falls back to __pa(high_memory), which
19 * DCL does not model. Claiming the arch hook (mainline:
20 * arch/arm64/include/asm/io.h) hands the job to linux/mm.h's declaration and
21 * the body in DCL/linux_mm_shim.c instead.
22 */
23#define ARCH_HAS_VALID_PHYS_ADDR_RANGE 1
24
25/*
26 * CONFIG_DRM_CLIENT -- on, because the client half of DRM is in this image:
27 * Vendored/drivers/gpu/drm/drm_client.c and drm_client_event.c are both
28 * compiled, so there are real bodies for drm_client_dev_hotplug(), _restore(),
29 * _suspend(), _resume(), _unregister() and drm_client_debugfs_init().
30 *
31 * Leaving it undefined takes the #else arm of <drm/drm_client_event.h>:16 and
32 * of drm_internal.h:52, which answers those six names with empty *static
33 * inline* definitions. The .c file then defines them at file scope and clang
34 * reports each one as a redefinition of a previous definition -- five errors
35 * at drm_client_event.c:32/:86/:105/:143/:176 pointing back at
36 * drm_client_event.h:17. A guard whose off-arm collides with the source it
37 * is guarding is the wrong polarity: the option is what makes the header
38 * agree with the file.
39 *
40 * It gates nothing else -- the only other reader in the tree is
41 * drm_internal.h:60, paired with CONFIG_MAGIC_SYSRQ, which stays undefined
42 * so the sysrq half keeps its no-op stubs.
43 */
44#define CONFIG_DRM_CLIENT 1
45
46/*
47 * Stage 3 (tty/serial): the two arms 8250_port.c reads with IS_ENABLED().
48 *
49 * CONFIG_SERIAL_8250_CONSOLE is the reason this stage exists -- it gates
50 * 8250_port.c:3197 `port->has_sysrq = IS_ENABLED(CONFIG_SERIAL_8250_CONSOLE)`
51 * and, more importantly, the #ifdef at :3241 that registers 8250 as a
52 * console, so leaving it undefined would build every file, run every probe,
53 * and still print nothing. IS_ENABLED() needs it *defined* (to 1), not just
54 * present: an undefined identifier reads as 0, which is the wrong answer.
55 *
56 * CONFIG_SERIAL_8250_16550A_VARIANTS gates the extra divisor steps in
57 * serial8250_do_set_termios (921). It is on because the hardware this is for
58 * -- iMX8MP and RPi3b+ UARTs -- is 16550A-compatible, and a wrong divisor
59 * table produces a port that transmits at the wrong baud rather than one that
60 * fails to build.
61 */
62
63#define CONFIG_SERIAL_8250_CONSOLE 1
64#define CONFIG_SERIAL_8250_16550A_VARIANTS 1
65
66/*
67 * CONFIG_CPU_BIG_ENDIAN -- deliberately left *undefined*, which is not a
68 * placeholder but the answer: iMX8MP, RPi3b+ and QEMU virt are all
69 * little-endian, and the two places it is read say so either way now that
70 * <linux/kconfig.h> is mainline's token paste:
71 *
72 * *iotype = IS_ENABLED(CONFIG_CPU_BIG_ENDIAN) ? UPIO_MEM32BE : UPIO_MEM32;
73 * (serial_core.c:2120, false -> UPIO_MEM32, the byte order those UARTs are
74 * wired in)
75 *
76 * and kconfig.h's own byte-order block, `#ifdef CONFIG_CPU_BIG_ENDIAN`.
77 *
78 * The second read is why this cannot be defined-to-0. An option present at
79 * 0 is still present to an #ifdef, so a defined-but-false CONFIG_CPU_BIG_
80 * ENDIAN would take that arm, publish __BIG_ENDIAN -- and then drm_fourcc.h:42,
81 * drm_fourcc.c:221, drm_framebuffer.c:357 and seq_buf.c:278, all of which
82 * test `#ifdef __BIG_ENDIAN` to pick the host byte order, would stamp every
83 * little-endian framebuffer format with DRM_FORMAT_BIG_ENDIAN and hexdump
84 * buffers byte-reversed. The same guard #warns from byteorder/
85 * little_endian.h:7. Undefined reads correctly in both places.
86 *
87 * Defined-to-0 used to be required because IS_ENABLED was `!!(opt)`, an
88 * expression that evaluates its argument; mainline's is token pasting that
89 * never touches the identifier, so absent is a plain 0 in a #if and in a
90 * function body alike. With that gone, every option in this file follows
91 * mainline's rule: present only when on.
92 */
93
94/*
95 * CONFIG_LDISC_AUTOLOAD -- undefined, i.e. off, read by exactly one line,
96 * tty_ldisc.c:119, `int tty_ldisc_autoload = IS_BUILTIN(CONFIG_LDISC_AUTOLOAD)`,
97 * which is the flag tty_ldisc_get() consults before it calls
98 * request_module("tty-ldisc-%d") (:154).
99 *
100 * 0 is the truth and not a default: DCL's loader (DCL/module_loader.c) runs
101 * the initcalls baked into this image and has no search path to ask for a
102 * module by name, so request_module() here returns -ENOSYS and the second
103 * get_ldops() attempt after it fails. The gate above it reads
104 * `!capable(CAP_SYS_MODULE) && !tty_ldisc_autoload`, capable() answers yes,
105 * and the `&&` short-circuits -- so the -EPERM arm is skipped, the no-op
106 * request runs, and the caller gets a plain "no such discipline" back. That
107 * is the correct outcome; defining it 1 would promise a lookup that cannot
108 * happen.
109 *
110 * It used to be spelled `#define CONFIG_LDISC_AUTOLOAD 0` purely so that
111 * IS_BUILTIN's `!!(opt)` could evaluate it. IS_BUILTIN is now mainline's
112 * token paste, which never names the option, so absent gives the same 0 --
113 * and leaves it invisible to an #ifdef, which is what the rest of this file
114 * wants.
115 */
116
117/*
118 * CONFIG_SERIAL_CORE_CONSOLE -- serial_core.c's own console half, and the
119 * reason it is *on* rather than left to the else-branch is a link error, not
120 * a preference: the block at serial_core.c:2063 `#if defined(CONFIG_SERIAL_CORE_CONSOLE)
121 * || defined(CONFIG_CONSOLE_POLL)` is where uart_parse_options() and
122 * uart_set_options() are defined, and 8250_port.c calls both from its
123 * console setup path (which is compiled, because CONFIG_SERIAL_8250_CONSOLE
124 * above is on). Leaving this off gave `undefined symbol: uart_set_options`
125 * at link -- the guard had compiled the caller and dropped the callee.
126 *
127 * CONFIG_CONSOLE_POLL stays undefined: uart_poll_init() and the polled
128 * console helpers at :2586/:2697 are for consoles that poll instead of take
129 * interrupts, and DCL's console is interrupt-driven. That the two guards
130 * share one `#if` is why serial_core.c compiles with console output enabled
131 * even though only one of the two conditions is true.
132 */
133#define CONFIG_SERIAL_CORE_CONSOLE 1
134
135/*
136 * CONFIG_REMOTEPROC -- off, and so undefined, which is the mainline
137 * spelling (unset options are simply left out of autoconf.h).
138 *
139 * Nothing here has a remoteproc subsystem: the rproc serial transport is the
140 * path that allocates its buffers through dma_alloc_coherent() and hangs them
141 * off vdev->dev.parent, and with this off every use of is_rproc_serial()
142 * folds out -- including the vdev->id.device comparison beside it, which is
143 * why vdev->id can stay zeroed. Both reads become 0:
144 * `is_rproc_enabled` in the return at virtio_console.c:332, and the
145 * `#if IS_ENABLED(CONFIG_REMOTEPROC)` at :2087.
146 *
147 * It was `#define CONFIG_REMOTEPROC 0` before, because IS_ENABLED was
148 * `!!(opt)`: a C expression, so an undefined option there would have been an
149 * undeclared identifier in a function body rather than a silent 0. The
150 * comment used to say mainline's own #if wrapper was what was missing and
151 * that this line supplied its effect at the source -- that wrapper is now
152 * what <linux/kconfig.h> provides, so the line can go too.
153 */
154
155/*
156 * lib/xarray: multi-index entries and the chunk layout. Both defaults are
157 * mainline's (xarray: default y, BASE_SMALL default n). Only XARRAY_MULTI
158 * is defined, because only it is *on*: xarray.h:1622 reads it, and it keeps
159 * marks[] in struct xa_node, which xas_set_mark() at :1745 indexes without a
160 * guard of its own. BASE_SMALL is off and so absent -- XA_CHUNK_SHIFT at
161 * :1154 is `IS_ENABLED(CONFIG_BASE_SMALL) ? 4 : 6`, which is 6 either way,
162 * now that IS_ENABLED accepts an undefined option.
163 */
164#define CONFIG_XARRAY_MULTI 1
165
166/*
167 * CONFIG_DRM_VIRTIO_GPU_KMS -- on, and it has to be: virtio_gpu_init()
168 * (Vendored/drivers/gpu/drm/virtio/virtgpu_kms.c:240) gates the modeset half
169 * on it with IS_ENABLED(), and its "#else" clears DRIVER_MODESET and
170 * DRIVER_ATOMIC from the driver features and writes num_scanouts = 0. A
171 * virtio-gpu device without KMS is a driver that registers and then has no
172 * output to prove anything on -- the scanout stage exists to prove exactly
173 * that half, so the option is the feature table of this port, not a
174 * preference. It gates nothing else in the tree; the driver is the only
175 * reader.
176 */
177#define CONFIG_DRM_VIRTIO_GPU_KMS 1
178
179/* Deliberately undefined:
180 * CONFIG_DEVPORT no x86 I/O ports on ARM64 -> no /dev/port
181 * CONFIG_STRICT_DEVMEM page_is_allowed() collapses to "allow all"
182 * CONFIG_HAVE_IOREMAP_PROT mmap_mem_ops stays empty (no generic_access_phys)
183 * CONFIG_TRANSPARENT_HUGEPAGE get_unmapped_area_zero uses mm_get_unmapped_area
184 * CONFIG_SECURITY struct security does not exist; security_locked_down()
185 * is still provided by DCL/linux_mm_shim.c
186 */
187
188#endif /* __LINUX_AUTOCONF_H__ */