OpenCores
URL https://opencores.org/ocsvn/qaz_libs/qaz_libs/trunk

Subversion Repositories qaz_libs

[/] [qaz_libs/] [trunk/] [cli/] [util/] [uboot_lib.h] - Blame information for rev 22

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 22 qaztronic
/*-----------------------------------------------------------*/
2
 
3
#ifndef _UBOOT_LIB_H_
4
#define _UBOOT_LIB_H_
5
 
6
#include <stdint.h>
7
#include <inttypes.h>
8
#include "types.h"
9
 
10
#include <string.h>
11
#include <stdlib.h>
12
#include <stdio.h>
13
#include <ctype.h>
14
 
15
#undef CONFIG_ARCH_MAP_SYSMEM
16
#include "mapmem.h"
17
 
18
#include "sys_cmd.h"
19
 
20
 
21
/*
22
 * Error codes that commands return to cmd_process(). We use the standard 0
23
 * and 1 for success and failure, but add one more case - failure with a
24
 * request to call cmd_usage(). But the cmd_process() function handles
25
 * CMD_RET_USAGE itself and after calling cmd_usage() it will return 1.
26
 * This is just a convenience for commands to avoid them having to call
27
 * cmd_usage() all over the place.
28
 */
29
enum command_ret_t {
30
        CMD_RET_SUCCESS,        /* 0 = Success */
31
        CMD_RET_FAILURE,        /* 1 = Failure */
32
        CMD_RET_USAGE = -1,     /* Failure, please report 'usage' error */
33
};
34
 
35
typedef int     cmd_tbl_t;
36
 
37
/* sysv */
38
typedef unsigned char           unchar;
39
typedef unsigned short          ushort;
40
typedef unsigned int            uint;
41
typedef unsigned long           ulong;
42
 
43
 
44
/*
45
 * Command Flags:
46
 */
47
#define CMD_FLAG_REPEAT         0x0001  /* repeat last command          */
48
#define CMD_FLAG_BOOTD          0x0002  /* command is from bootd        */
49
#define CMD_FLAG_ENV            0x0004  /* command is from the environment */
50
 
51
 
52
#define __maybe_unused                  __attribute__((unused))
53
 
54
 
55
/*-----------------------------------------------------------*/
56
#undef CONFIG_SYS_SUPPORT_64BIT_DATA
57
 
58
 
59
 
60
/*-----------------------------------------------------------*/
61
extern int cmd_get_data_size(const char * arg, int default_size);
62
extern unsigned long simple_strtoul(const char *cp, char **endp, unsigned int base);
63
extern int print_buffer(ulong addr, const void *data, uint width, uint count, uint linelen);
64
 
65
 
66
#endif  //  _UBOOT_LIB_H_
67
 
68
 
69
 
70
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.