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

Subversion Repositories qaz_libs

[/] [qaz_libs/] [trunk/] [cli/] [util/] [uboot_lib.h] - Rev 22

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

/*-----------------------------------------------------------*/
 
#ifndef _UBOOT_LIB_H_
#define _UBOOT_LIB_H_
 
#include <stdint.h>
#include <inttypes.h>
#include "types.h"
 
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
 
#undef CONFIG_ARCH_MAP_SYSMEM
#include "mapmem.h"
 
#include "sys_cmd.h"
 
 
/*
 * Error codes that commands return to cmd_process(). We use the standard 0
 * and 1 for success and failure, but add one more case - failure with a
 * request to call cmd_usage(). But the cmd_process() function handles
 * CMD_RET_USAGE itself and after calling cmd_usage() it will return 1.
 * This is just a convenience for commands to avoid them having to call
 * cmd_usage() all over the place.
 */
enum command_ret_t {
	CMD_RET_SUCCESS,	/* 0 = Success */
	CMD_RET_FAILURE,	/* 1 = Failure */
	CMD_RET_USAGE = -1,	/* Failure, please report 'usage' error */
};
 
typedef int	cmd_tbl_t;
 
/* sysv */
typedef unsigned char		unchar;
typedef unsigned short		ushort;
typedef unsigned int		uint;
typedef unsigned long		ulong;
 
 
/*
 * Command Flags:
 */
#define CMD_FLAG_REPEAT		0x0001	/* repeat last command		*/
#define CMD_FLAG_BOOTD		0x0002	/* command is from bootd	*/
#define CMD_FLAG_ENV		0x0004	/* command is from the environment */
 
 
#define __maybe_unused			__attribute__((unused))
 
 
/*-----------------------------------------------------------*/
#undef CONFIG_SYS_SUPPORT_64BIT_DATA
 
 
 
/*-----------------------------------------------------------*/
extern int cmd_get_data_size(const char * arg, int default_size);
extern unsigned long simple_strtoul(const char *cp, char **endp, unsigned int base);
extern int print_buffer(ulong addr, const void *data, uint width, uint count, uint linelen);
 
 
#endif  //  _UBOOT_LIB_H_
 
 
 
 
 

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

powered by: WebSVN 2.1.0

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