Restrict the ARM architecture to use only one set of I/O functions.
[barebox-mini2440.git] / include / environment.h
bloba50fc6857f227eada7fb18b09dbd2d6ec57a2c78
1 /*
2 * (C) Copyright 2002
3 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
5 * See file CREDITS for list of people who contributed to this
6 * project.
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of
11 * the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
21 * MA 02111-1307 USA
24 #ifndef _ENVIRONMENT_H_
25 #define _ENVIRONMENT_H_
28 #ifdef __U_BOOT__
29 /**
30 * Managment of a environment variable
32 struct variable_d {
33 struct variable_d *next; /**< List management */
34 char data[0]; /**< variable length data */
37 struct env_context {
38 struct env_context *parent; /**< FIXME */
39 struct variable_d *local; /**< FIXME */
40 struct variable_d *global; /**< FIXME */
43 struct env_context *get_current_context(void);
44 char *var_val(struct variable_d *);
45 char *var_name(struct variable_d *);
47 const char *getenv(const char *);
48 int setenv(const char *, const char *);
50 int env_pop_context(void);
51 int env_push_context(void);
53 int envfs_load(char *filename, char *dirname);
54 int envfs_save(char *filename, char *dirname);
56 int export(const char *);
58 struct stat;
59 int file_size_action(const char *, struct stat *, void *, int);
60 int file_save_action(const char *, struct stat *, void *, int);
62 #endif /* __U_BOOT__ */
64 /* This part is used for the host and the target */
65 struct action_data {
66 int fd;
67 const char *base;
68 void *writep;
70 #define PAD4(x) ((x + 3) & ~3)
72 #endif /* _ENVIRONMENT_H_ */
74 /**
75 * @file
76 * @brief Environment handling
78 * Important: This file will also be used on the host to create
79 * the default environment when building the U-Boot binary.