Blame view
include/env_callback.h
2.4 KB
170ab1107 env: Add support ... |
1 2 3 4 |
/* * (C) Copyright 2012 * Joe Hershberger, National Instruments, joe.hershberger@ni.com * |
1a4596601 Add GPL-2.0+ SPDX... |
5 |
* SPDX-License-Identifier: GPL-2.0+ |
170ab1107 env: Add support ... |
6 7 8 9 |
*/ #ifndef __ENV_CALLBACK_H__ #define __ENV_CALLBACK_H__ |
2598090b7 env: Add environm... |
10 |
#include <env_flags.h> |
170ab1107 env: Add support ... |
11 12 13 14 15 16 17 18 19 |
#include <linker_lists.h> #include <search.h> #define ENV_CALLBACK_VAR ".callbacks" /* Board configs can define additional static callback bindings */ #ifndef CONFIG_ENV_CALLBACK_LIST_STATIC #define CONFIG_ENV_CALLBACK_LIST_STATIC #endif |
e080d545f env: Add a silent... |
20 21 22 23 24 |
#ifdef CONFIG_SILENT_CONSOLE #define SILENT_CALLBACK "silent:silent," #else #define SILENT_CALLBACK #endif |
c08804853 lcd: implement a ... |
25 26 27 28 29 |
#ifdef CONFIG_SPLASHIMAGE_GUARD #define SPLASHIMAGE_CALLBACK "splashimage:splashimage," #else #define SPLASHIMAGE_CALLBACK #endif |
bdf1fe4e6 env: Add regex su... |
30 31 |
#ifdef CONFIG_REGEX #define ENV_DOT_ESCAPE "\\" |
f7848d90d Allow CONFIG_REGE... |
32 |
#define ETHADDR_WILDCARD "\\d?" |
bdf1fe4e6 env: Add regex su... |
33 34 |
#else #define ENV_DOT_ESCAPE |
f7848d90d Allow CONFIG_REGE... |
35 |
#define ETHADDR_WILDCARD |
bdf1fe4e6 env: Add regex su... |
36 |
#endif |
fd3056337 net: Use env call... |
37 38 39 40 41 |
#ifdef CONFIG_CMD_DNS #define DNS_CALLBACK "dnsip:dnsip," #else #define DNS_CALLBACK #endif |
3b3ea2c56 Kconfig: cmd: Mak... |
42 |
#ifdef CONFIG_CMD_NET |
fd3056337 net: Use env call... |
43 44 45 46 47 48 49 50 |
#define NET_CALLBACKS \ "bootfile:bootfile," \ "ipaddr:ipaddr," \ "gatewayip:gatewayip," \ "netmask:netmask," \ "serverip:serverip," \ "nvlan:nvlan," \ "vlan:vlan," \ |
6e0d26c05 net: Handle ethad... |
51 |
DNS_CALLBACK \ |
f7848d90d Allow CONFIG_REGE... |
52 |
"eth" ETHADDR_WILDCARD "addr:ethaddr," |
fd3056337 net: Use env call... |
53 54 55 |
#else #define NET_CALLBACKS #endif |
170ab1107 env: Add support ... |
56 57 58 59 |
/* * This list of callback bindings is static, but may be overridden by defining * a new association in the ".callbacks" environment variable. */ |
bdf1fe4e6 env: Add regex su... |
60 61 |
#define ENV_CALLBACK_LIST_STATIC ENV_DOT_ESCAPE ENV_CALLBACK_VAR ":callbacks," \ ENV_DOT_ESCAPE ENV_FLAGS_VAR ":flags," \ |
32057717e env: Add a baudra... |
62 |
"baudrate:baudrate," \ |
fd3056337 net: Use env call... |
63 |
NET_CALLBACKS \ |
1cf0a8b2f env: Add a loadad... |
64 |
"loadaddr:loadaddr," \ |
e080d545f env: Add a silent... |
65 |
SILENT_CALLBACK \ |
c08804853 lcd: implement a ... |
66 |
SPLASHIMAGE_CALLBACK \ |
849d5d9cd env: Add a consol... |
67 |
"stdin:console,stdout:console,stderr:console," \ |
de4e4edaf usb: gadget: g_dn... |
68 |
"serial#:serialno," \ |
170ab1107 env: Add support ... |
69 70 71 72 73 74 75 |
CONFIG_ENV_CALLBACK_LIST_STATIC struct env_clbk_tbl { const char *name; /* Callback name */ int (*callback)(const char *name, const char *value, enum env_op op, int flags); }; |
170ab1107 env: Add support ... |
76 77 78 79 80 81 82 |
void env_callback_init(ENTRY *var_entry); /* * Define a callback that can be associated with variables. * when associated through the ".callbacks" environment variable, the callback * will be executed any time the variable is inserted, overwritten, or deleted. */ |
f8cfcf1b1 env: don't genera... |
83 84 |
#ifdef CONFIG_SPL_BUILD #define U_BOOT_ENV_CALLBACK(name, callback) \ |
3ea664c7c env_callback.h: s... |
85 |
static inline __maybe_unused void _u_boot_env_noop_##name(void) \ |
f8cfcf1b1 env: don't genera... |
86 87 88 89 |
{ \ (void)callback; \ } #else |
170ab1107 env: Add support ... |
90 |
#define U_BOOT_ENV_CALLBACK(name, callback) \ |
ef123c525 Refactor linker-g... |
91 |
ll_entry_declare(struct env_clbk_tbl, name, env_clbk) = \ |
170ab1107 env: Add support ... |
92 |
{#name, callback} |
f8cfcf1b1 env: don't genera... |
93 |
#endif |
170ab1107 env: Add support ... |
94 95 |
#endif /* __ENV_CALLBACK_H__ */ |