blob: 88837bb35c83ca1f41c40ea04da781e5a5d46146 [file] [log] [blame]
Simon Glass8a3e0352012-02-15 15:51:16 -08001/*
2 * decls for symbols defined in the linker script
3 *
4 * Copyright (c) 2012 The Chromium OS Authors.
5 *
6 * Licensed under the GPL-2 or later.
7 */
8
9#ifndef __SANDBOX_SECTIONS_H
10#define __SANDBOX_SECTIONS_H
11
Simon Glass9bce37c2013-03-05 14:39:37 +000012#include <asm-generic/sections.h>
13
Simon Glass64367c82013-12-03 16:43:23 -070014struct sandbox_cmdline_option;
Simon Glass8a3e0352012-02-15 15:51:16 -080015
Marek Behún184c4af2021-05-20 13:24:06 +020016static inline struct sandbox_cmdline_option **
17__u_boot_sandbox_option_start(void)
18{
19 static char start[0] __aligned(4) __attribute__((unused))
Andrew Scullc6cb99b2022-05-30 10:00:03 +000020 __section("_u_boot_sandbox_getopt_start");
Marek Behún184c4af2021-05-20 13:24:06 +020021
22 return (struct sandbox_cmdline_option **)&start;
23}
24
25static inline struct sandbox_cmdline_option **
26__u_boot_sandbox_option_end(void)
27{
28 static char end[0] __aligned(4) __attribute__((unused))
Andrew Scullc6cb99b2022-05-30 10:00:03 +000029 __section("_u_boot_sandbox_getopt_end");
Marek Behún184c4af2021-05-20 13:24:06 +020030
31 return (struct sandbox_cmdline_option **)&end;
32}
Simon Glass8a3e0352012-02-15 15:51:16 -080033
34static inline size_t __u_boot_sandbox_option_count(void)
35{
Marek Behún184c4af2021-05-20 13:24:06 +020036 return __u_boot_sandbox_option_end() - __u_boot_sandbox_option_start();
Simon Glass8a3e0352012-02-15 15:51:16 -080037}
38
39#endif