commit
88358ab302
|
@ -59,17 +59,17 @@ int uname(struct utsname *name)
|
||||||
if (name == NULL) {
|
if (name == NULL) {
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
}
|
}
|
||||||
(VOID)strncpy_s(name->sysname, sizeof(name->sysname), KERNEL_NAME, strlen(KERNEL_NAME) + 1);
|
(VOID)strcpy_s(name->sysname, sizeof(name->sysname), KERNEL_NAME);
|
||||||
(VOID)strncpy_s(name->nodename, sizeof(name->nodename), "hisilicon", strlen("hisilicon") + 1);
|
(VOID)strcpy_s(name->nodename, sizeof(name->nodename), "hisilicon");
|
||||||
ret = snprintf_s(name->version, sizeof(name->version), sizeof(name->version) - 1, "%s %u.%u.%u.%u %s %s",
|
ret = sprintf_s(name->version, sizeof(name->version), "%s %u.%u.%u.%u %s %s",
|
||||||
KERNEL_NAME, KERNEL_MAJOR, KERNEL_MINOR, KERNEL_PATCH, KERNEL_ITRE, __DATE__, __TIME__);
|
KERNEL_NAME, KERNEL_MAJOR, KERNEL_MINOR, KERNEL_PATCH, KERNEL_ITRE, __DATE__, __TIME__);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
cpuInfo = LOS_CpuInfo();
|
cpuInfo = LOS_CpuInfo();
|
||||||
(VOID)strncpy_s(name->machine, sizeof(name->machine), cpuInfo, sizeof(name->machine));
|
(VOID)strcpy_s(name->machine, sizeof(name->machine), cpuInfo);
|
||||||
ret = snprintf_s(name->release, sizeof(name->release), sizeof(name->release) - 1, "%u.%u.%u.%u",
|
ret = sprintf_s(name->release, sizeof(name->release), "%u.%u.%u.%u",
|
||||||
KERNEL_MAJOR, KERNEL_MINOR, KERNEL_PATCH, KERNEL_ITRE);
|
KERNEL_MAJOR, KERNEL_MINOR, KERNEL_PATCH, KERNEL_ITRE);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
return -EIO;
|
return -EIO;
|
||||||
|
|
|
@ -239,7 +239,7 @@ static mode_t fatfs_get_mode(BYTE attribute, mode_t fs_mode)
|
||||||
return fs_mode;
|
return fs_mode;
|
||||||
}
|
}
|
||||||
|
|
||||||
static enum VnodeType fatfstype_2_vnodetype(BYTE type)
|
static enum VnodeType fatfstype_2_vnodetype(BYTE type)
|
||||||
{
|
{
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case AM_ARC:
|
case AM_ARC:
|
||||||
|
@ -292,7 +292,8 @@ static FRESULT init_cluster(DIR_FILE *pdfp, DIR *dp_new, FATFS *fs, int type, co
|
||||||
} else {
|
} else {
|
||||||
/* Write the dir cluster */
|
/* Write the dir cluster */
|
||||||
mem_set(dir, 0, SS(fs));
|
mem_set(dir, 0, SS(fs));
|
||||||
mem_set(dir + DIR_Name, ' ', 11); /* Create "." entry */
|
/* 11, the The max length of of the short file name, Create "." entry */
|
||||||
|
mem_set(dir + DIR_Name, ' ', 11);
|
||||||
dir[DIR_Name] = '.';
|
dir[DIR_Name] = '.';
|
||||||
dir[DIR_Attr] = AM_DIR;
|
dir[DIR_Attr] = AM_DIR;
|
||||||
st_clust(fs, dir, *clust);
|
st_clust(fs, dir, *clust);
|
||||||
|
|
|
@ -37,12 +37,11 @@
|
||||||
|
|
||||||
#define _MAX_ENTRYLENGTH 16 /* MAX virtual partition name length */
|
#define _MAX_ENTRYLENGTH 16 /* MAX virtual partition name length */
|
||||||
#define _MAX_VIRVOLUMES 5 /* MAX virtual partition number */
|
#define _MAX_VIRVOLUMES 5 /* MAX virtual partition number */
|
||||||
typedef struct virtual_partition_info
|
typedef struct virtual_partition_info {
|
||||||
{
|
char *devpartpath; /* need set virtual partition, e.g. /dev/mmcblk0p0 */
|
||||||
char *devpartpath; /* need set virtual partition, e.g. /dev/mmcblk0p0 */
|
int virpartnum; /* virtual partition numbers, MAX number is 5 */
|
||||||
int virpartnum; /* virtual partition numbers, MAX number is 5 */
|
double virpartpercent[_MAX_VIRVOLUMES]; /* every virtual partition percent,e.g 0.6,0.3,0.1 */
|
||||||
double virpartpercent[_MAX_VIRVOLUMES]; /* every virtual partition percent,e.g 0.6,0.3,0.1 */
|
char virpartname[_MAX_VIRVOLUMES][_MAX_ENTRYLENGTH + 1]; /* every virtual partition name, MAX length is 16 */
|
||||||
char virpartname[_MAX_VIRVOLUMES][_MAX_ENTRYLENGTH + 1]; /* every virtual partition name, MAX length is 16 */
|
|
||||||
} virpartinfo;
|
} virpartinfo;
|
||||||
|
|
||||||
extern char g_devPartName[DISK_NAME + 1];
|
extern char g_devPartName[DISK_NAME + 1];
|
||||||
|
|
|
@ -205,7 +205,7 @@ int VfsJffs2Lookup(struct Vnode *parentVnode, const char *path, int len, struct
|
||||||
if (newVnode) {
|
if (newVnode) {
|
||||||
if (newVnode->data == NULL) {
|
if (newVnode->data == NULL) {
|
||||||
LOS_Panic("#####VfsHashGet error#####\n");
|
LOS_Panic("#####VfsHashGet error#####\n");
|
||||||
}
|
}
|
||||||
newVnode->parent = parentVnode;
|
newVnode->parent = parentVnode;
|
||||||
*ppVnode = newVnode;
|
*ppVnode = newVnode;
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -591,13 +591,16 @@ int VfsJffs2Chattr(struct Vnode *pVnode, struct IATTR *attr)
|
||||||
int VfsJffs2Rmdir(struct Vnode *parentVnode, struct Vnode *targetVnode, const char *path)
|
int VfsJffs2Rmdir(struct Vnode *parentVnode, struct Vnode *targetVnode, const char *path)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
struct jffs2_inode *parentInode = (struct jffs2_inode *)parentVnode->data;
|
struct jffs2_inode *parentInode = NULL;
|
||||||
struct jffs2_inode *targetInode = (struct jffs2_inode *)targetVnode->data;
|
struct jffs2_inode *targetInode = NULL;
|
||||||
|
|
||||||
if (!parentVnode || !targetVnode) {
|
if (!parentVnode || !targetVnode) {
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
parentInode = (struct jffs2_inode *)parentVnode->data;
|
||||||
|
targetInode = (struct jffs2_inode *)targetVnode->data;
|
||||||
|
|
||||||
LOS_MuxLock(&g_jffs2FsLock, (uint32_t)JFFS2_WAITING_FOREVER);
|
LOS_MuxLock(&g_jffs2FsLock, (uint32_t)JFFS2_WAITING_FOREVER);
|
||||||
|
|
||||||
ret = jffs2_rmdir(parentInode, targetInode, (const unsigned char *)path);
|
ret = jffs2_rmdir(parentInode, targetInode, (const unsigned char *)path);
|
||||||
|
|
|
@ -40,7 +40,8 @@
|
||||||
#define CLEAR_PATH_CACHE "clear pathcache"
|
#define CLEAR_PATH_CACHE "clear pathcache"
|
||||||
#define CLEAR_PAGE_CACHE "clear pagecache"
|
#define CLEAR_PAGE_CACHE "clear pagecache"
|
||||||
|
|
||||||
static char* VnodeTypeToStr(enum VnodeType type) {
|
static char* VnodeTypeToStr(enum VnodeType type)
|
||||||
|
{
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case VNODE_TYPE_UNKNOWN:
|
case VNODE_TYPE_UNKNOWN:
|
||||||
return "UKN";
|
return "UKN";
|
||||||
|
@ -135,9 +136,9 @@ static int PageCacheMapProcess(struct SeqBuf *buf)
|
||||||
|
|
||||||
static int FsCacheInfoFill(struct SeqBuf *buf, void *arg)
|
static int FsCacheInfoFill(struct SeqBuf *buf, void *arg)
|
||||||
{
|
{
|
||||||
int vnodeFree= 0;
|
int vnodeFree = 0;
|
||||||
int vnodeActive= 0;
|
int vnodeActive = 0;
|
||||||
int vnodeVirtual= 0;
|
int vnodeVirtual = 0;
|
||||||
int vnodeTotal = 0;
|
int vnodeTotal = 0;
|
||||||
|
|
||||||
int pathCacheTotal = 0;
|
int pathCacheTotal = 0;
|
||||||
|
|
|
@ -43,7 +43,7 @@ struct PathCache {
|
||||||
LIST_ENTRY hashEntry; /* list entry for buckets in the hash table */
|
LIST_ENTRY hashEntry; /* list entry for buckets in the hash table */
|
||||||
uint8_t nameLen; /* length of path component */
|
uint8_t nameLen; /* length of path component */
|
||||||
#ifdef LOSCFG_DEBUG_VERSION
|
#ifdef LOSCFG_DEBUG_VERSION
|
||||||
int hit; /* cache hit count*/
|
int hit; /* cache hit count */
|
||||||
#endif
|
#endif
|
||||||
char name[0]; /* path component name */
|
char name[0]; /* path component name */
|
||||||
};
|
};
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
typedef LOS_DL_LIST LIST_HEAD;
|
typedef LOS_DL_LIST LIST_HEAD;
|
||||||
typedef LOS_DL_LIST LIST_ENTRY;
|
typedef LOS_DL_LIST LIST_ENTRY;
|
||||||
|
|
||||||
#define VNODE_FLAG_MOUNT_NEW (1 << 0) /* new mount vnode*/
|
#define VNODE_FLAG_MOUNT_NEW (1 << 0) /* new mount vnode */
|
||||||
#define VNODE_FLAG_MOUNT_ORIGIN (1 << 1) /* origin vnode */
|
#define VNODE_FLAG_MOUNT_ORIGIN (1 << 1) /* origin vnode */
|
||||||
|
|
||||||
#define V_CREATE (1 << 0)
|
#define V_CREATE (1 << 0)
|
||||||
|
@ -76,18 +76,17 @@ typedef LOS_DL_LIST LIST_ENTRY;
|
||||||
#define CHG_MTIME 32
|
#define CHG_MTIME 32
|
||||||
#define CHG_CTIME 64
|
#define CHG_CTIME 64
|
||||||
|
|
||||||
struct IATTR
|
struct IATTR {
|
||||||
{
|
/* This structure is used for record vnode attr. */
|
||||||
/* This structure is used for record vnode attr. */
|
unsigned int attr_chg_valid;
|
||||||
unsigned int attr_chg_valid;
|
unsigned int attr_chg_flags;
|
||||||
unsigned int attr_chg_flags;
|
unsigned attr_chg_mode;
|
||||||
unsigned attr_chg_mode;
|
unsigned attr_chg_uid;
|
||||||
unsigned attr_chg_uid;
|
unsigned attr_chg_gid;
|
||||||
unsigned attr_chg_gid;
|
unsigned attr_chg_size;
|
||||||
unsigned attr_chg_size;
|
unsigned attr_chg_atime;
|
||||||
unsigned attr_chg_atime;
|
unsigned attr_chg_mtime;
|
||||||
unsigned attr_chg_mtime;
|
unsigned attr_chg_ctime;
|
||||||
unsigned attr_chg_ctime;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -385,6 +385,7 @@ int VnodeLookup(const char *path, struct Vnode **result, uint32_t flags)
|
||||||
if (currentDir == NULL || *currentDir == '\0') {
|
if (currentDir == NULL || *currentDir == '\0') {
|
||||||
// return target or parent vnode as result
|
// return target or parent vnode as result
|
||||||
*result = currentVnode;
|
*result = currentVnode;
|
||||||
|
goto OUT_FREE_PATH;
|
||||||
} else if (VfsVnodePermissionCheck(currentVnode, EXEC_OP)) {
|
} else if (VfsVnodePermissionCheck(currentVnode, EXEC_OP)) {
|
||||||
ret = -EACCES;
|
ret = -EACCES;
|
||||||
goto OUT_FREE_PATH;
|
goto OUT_FREE_PATH;
|
||||||
|
|
|
@ -71,19 +71,19 @@
|
||||||
#ifndef ARRAY_SIZE
|
#ifndef ARRAY_SIZE
|
||||||
#define ARRAY_SIZE(array) (sizeof(array) / sizeof(array[0]))
|
#define ARRAY_SIZE(array) (sizeof(array) / sizeof(array[0]))
|
||||||
#endif
|
#endif
|
||||||
#define REPLACE_INTERFACE(dst, src, type, func) {\
|
#define REPLACE_INTERFACE(dst, src, type, func) { \
|
||||||
if (((type *)src)->func != NULL) {\
|
if (((type *)src)->func != NULL) { \
|
||||||
((type *)dst)->func = ((type *)src)->func;\
|
((type *)dst)->func = ((type *)src)->func; \
|
||||||
} else {\
|
} else { \
|
||||||
PRINT_ERR("%s->%s is NULL!\n", #src, #func);\
|
PRINT_ERR("%s->%s is NULL!\n", #src, #func); \
|
||||||
}\
|
} \
|
||||||
}
|
}
|
||||||
#define INVOKE_INTERFACE(adapter, type, func) {\
|
#define INVOKE_INTERFACE(adapter, type, func) { \
|
||||||
if (((type *)adapter)->func != NULL) {\
|
if (((type *)adapter)->func != NULL) { \
|
||||||
((type *)adapter)->func();\
|
((type *)adapter)->func(); \
|
||||||
} else {\
|
} else { \
|
||||||
PRINT_ERR("%s->%s is NULL!\n", #adapter, #func);\
|
PRINT_ERR("%s->%s is NULL!\n", #adapter, #func); \
|
||||||
}\
|
} \
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ------------ local prototypes ------------ */
|
/* ------------ local prototypes ------------ */
|
||||||
|
@ -296,36 +296,36 @@ static INT32 HiDumperIoctl(struct file *filep, INT32 cmd, unsigned long arg)
|
||||||
INT32 ret = 0;
|
INT32 ret = 0;
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case HIDUMPER_DUMP_ALL:
|
case HIDUMPER_DUMP_ALL:
|
||||||
INVOKE_INTERFACE(&g_adapter, struct HiDumperAdapter, DumpSysInfo);
|
INVOKE_INTERFACE(&g_adapter, struct HiDumperAdapter, DumpSysInfo);
|
||||||
INVOKE_INTERFACE(&g_adapter, struct HiDumperAdapter, DumpCpuUsage);
|
INVOKE_INTERFACE(&g_adapter, struct HiDumperAdapter, DumpCpuUsage);
|
||||||
INVOKE_INTERFACE(&g_adapter, struct HiDumperAdapter, DumpMemUsage);
|
INVOKE_INTERFACE(&g_adapter, struct HiDumperAdapter, DumpMemUsage);
|
||||||
INVOKE_INTERFACE(&g_adapter, struct HiDumperAdapter, DumpTaskInfo);
|
INVOKE_INTERFACE(&g_adapter, struct HiDumperAdapter, DumpTaskInfo);
|
||||||
break;
|
break;
|
||||||
case HIDUMPER_CPU_USAGE:
|
case HIDUMPER_CPU_USAGE:
|
||||||
INVOKE_INTERFACE(&g_adapter, struct HiDumperAdapter, DumpCpuUsage);
|
INVOKE_INTERFACE(&g_adapter, struct HiDumperAdapter, DumpCpuUsage);
|
||||||
break;
|
break;
|
||||||
case HIDUMPER_MEM_USAGE:
|
case HIDUMPER_MEM_USAGE:
|
||||||
INVOKE_INTERFACE(&g_adapter, struct HiDumperAdapter, DumpMemUsage);
|
INVOKE_INTERFACE(&g_adapter, struct HiDumperAdapter, DumpMemUsage);
|
||||||
break;
|
break;
|
||||||
case HIDUMPER_TASK_INFO:
|
case HIDUMPER_TASK_INFO:
|
||||||
INVOKE_INTERFACE(&g_adapter, struct HiDumperAdapter, DumpTaskInfo);
|
INVOKE_INTERFACE(&g_adapter, struct HiDumperAdapter, DumpTaskInfo);
|
||||||
break;
|
break;
|
||||||
case HIDUMPER_INJECT_KERNEL_CRASH:
|
case HIDUMPER_INJECT_KERNEL_CRASH:
|
||||||
INVOKE_INTERFACE(&g_adapter, struct HiDumperAdapter, InjectKernelCrash);
|
INVOKE_INTERFACE(&g_adapter, struct HiDumperAdapter, InjectKernelCrash);
|
||||||
break;
|
break;
|
||||||
case HIDUMPER_DUMP_FAULT_LOG:
|
case HIDUMPER_DUMP_FAULT_LOG:
|
||||||
INVOKE_INTERFACE(&g_adapter, struct HiDumperAdapter, DumpFaultLog);
|
INVOKE_INTERFACE(&g_adapter, struct HiDumperAdapter, DumpFaultLog);
|
||||||
break;
|
break;
|
||||||
case HIDUMPER_MEM_DATA:
|
case HIDUMPER_MEM_DATA:
|
||||||
if (g_adapter.DumpMemData != NULL) {
|
if (g_adapter.DumpMemData != NULL) {
|
||||||
g_adapter.DumpMemData((struct MemDumpParam *)arg);
|
g_adapter.DumpMemData((struct MemDumpParam *)arg);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ret = EPERM;
|
ret = EPERM;
|
||||||
PRINTK("Invalid CMD: 0x%x\n", (UINT32)cmd);
|
PRINTK("Invalid CMD: 0x%x\n", (UINT32)cmd);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
@ -48,8 +48,9 @@ STATIC CHAR *g_cmdLine = NULL;
|
||||||
STATIC UINT64 g_alignSize = 0;
|
STATIC UINT64 g_alignSize = 0;
|
||||||
STATIC struct BootArgs g_bootArgs[MAX_ARGS_NUM] = {0};
|
STATIC struct BootArgs g_bootArgs[MAX_ARGS_NUM] = {0};
|
||||||
|
|
||||||
INT32 LOS_GetCmdLine() {
|
INT32 LOS_GetCmdLine()
|
||||||
int ret = 0;
|
{
|
||||||
|
int ret;
|
||||||
|
|
||||||
g_cmdLine = (CHAR *)malloc(COMMAND_LINE_SIZE);
|
g_cmdLine = (CHAR *)malloc(COMMAND_LINE_SIZE);
|
||||||
if (g_cmdLine == NULL) {
|
if (g_cmdLine == NULL) {
|
||||||
|
@ -117,7 +118,8 @@ ERROUT:
|
||||||
return LOS_NOK;
|
return LOS_NOK;
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID LOS_FreeCmdLine() {
|
VOID LOS_FreeCmdLine()
|
||||||
|
{
|
||||||
if (g_cmdLine != NULL) {
|
if (g_cmdLine != NULL) {
|
||||||
free(g_cmdLine);
|
free(g_cmdLine);
|
||||||
g_cmdLine = NULL;
|
g_cmdLine = NULL;
|
||||||
|
@ -153,12 +155,13 @@ STATIC INT32 GetBootargs(CHAR **args)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
INT32 LOS_ParseBootargs() {
|
INT32 LOS_ParseBootargs()
|
||||||
|
{
|
||||||
INT32 idx = 0;
|
INT32 idx = 0;
|
||||||
INT32 ret;
|
INT32 ret;
|
||||||
CHAR *args;
|
CHAR *args = NULL;
|
||||||
CHAR *argName;
|
CHAR *argName = NULL;
|
||||||
CHAR *argValue;
|
CHAR *argValue = NULL;
|
||||||
|
|
||||||
ret = GetBootargs(&args);
|
ret = GetBootargs(&args);
|
||||||
if (ret != LOS_OK) {
|
if (ret != LOS_OK) {
|
||||||
|
@ -183,7 +186,8 @@ INT32 LOS_ParseBootargs() {
|
||||||
return LOS_OK;
|
return LOS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
INT32 LOS_GetArgValue(CHAR *argName, CHAR **argValue) {
|
INT32 LOS_GetArgValue(CHAR *argName, CHAR **argValue)
|
||||||
|
{
|
||||||
INT32 idx = 0;
|
INT32 idx = 0;
|
||||||
|
|
||||||
while (idx < MAX_ARGS_NUM) {
|
while (idx < MAX_ARGS_NUM) {
|
||||||
|
@ -200,7 +204,8 @@ INT32 LOS_GetArgValue(CHAR *argName, CHAR **argValue) {
|
||||||
return LOS_NOK;
|
return LOS_NOK;
|
||||||
}
|
}
|
||||||
|
|
||||||
UINT64 LOS_GetAlignsize() {
|
UINT64 LOS_GetAlignsize()
|
||||||
|
{
|
||||||
return g_alignSize;
|
return g_alignSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -224,7 +229,7 @@ UINT64 LOS_SizeStrToNum(CHAR *value)
|
||||||
if ((ret <= 0) || (decOffset < (strlen(value) - 1))) {
|
if ((ret <= 0) || (decOffset < (strlen(value) - 1))) {
|
||||||
goto ERROUT;
|
goto ERROUT;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strlen(endPos) == 0) {
|
if (strlen(endPos) == 0) {
|
||||||
return num;
|
return num;
|
||||||
} else if (strcasecmp(endPos, "k") == 0) {
|
} else if (strcasecmp(endPos, "k") == 0) {
|
||||||
|
|
|
@ -97,7 +97,7 @@ STATIC INT32 AddEmmcParts(INT32 rootAddr, INT32 rootSize, INT32 userAddr, INT32
|
||||||
return LOS_NOK;
|
return LOS_NOK;
|
||||||
}
|
}
|
||||||
|
|
||||||
LOS_Msleep(10); /* waiting for device identification */
|
LOS_Msleep(10); /* 100, sleep time. waiting for device identification */
|
||||||
|
|
||||||
INT32 diskId = los_alloc_diskid_byname(node_name);
|
INT32 diskId = los_alloc_diskid_byname(node_name);
|
||||||
if (diskId < 0) {
|
if (diskId < 0) {
|
||||||
|
@ -156,11 +156,12 @@ STATIC INT32 AddPartitions(CHAR *dev, UINT64 rootAddr, UINT64 rootSize, UINT64 u
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
STATIC INT32 ParseRootArgs(CHAR **dev, CHAR **fstype, UINT64 *rootAddr, UINT64 *rootSize, UINT32 *mountFlags) {
|
STATIC INT32 ParseRootArgs(CHAR **dev, CHAR **fstype, UINT64 *rootAddr, UINT64 *rootSize, UINT32 *mountFlags)
|
||||||
|
{
|
||||||
INT32 ret;
|
INT32 ret;
|
||||||
CHAR *rootAddrStr;
|
CHAR *rootAddrStr = NULL;
|
||||||
CHAR *rootSizeStr;
|
CHAR *rootSizeStr = NULL;
|
||||||
CHAR *rwTag;
|
CHAR *rwTag = NULL;
|
||||||
|
|
||||||
ret = LOS_GetArgValue("root", dev);
|
ret = LOS_GetArgValue("root", dev);
|
||||||
if (ret != LOS_OK) {
|
if (ret != LOS_OK) {
|
||||||
|
@ -187,7 +188,7 @@ STATIC INT32 ParseRootArgs(CHAR **dev, CHAR **fstype, UINT64 *rootAddr, UINT64 *
|
||||||
} else {
|
} else {
|
||||||
*rootSize = LOS_SizeStrToNum(rootSizeStr);
|
*rootSize = LOS_SizeStrToNum(rootSizeStr);
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = LOS_GetArgValue("ro", &rwTag);
|
ret = LOS_GetArgValue("ro", &rwTag);
|
||||||
if (ret == LOS_OK) {
|
if (ret == LOS_OK) {
|
||||||
*mountFlags = MS_RDONLY;
|
*mountFlags = MS_RDONLY;
|
||||||
|
@ -198,10 +199,11 @@ STATIC INT32 ParseRootArgs(CHAR **dev, CHAR **fstype, UINT64 *rootAddr, UINT64 *
|
||||||
return LOS_OK;
|
return LOS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
STATIC INT32 ParseUserArgs(UINT64 rootAddr, UINT64 rootSize, UINT64 *userAddr, UINT64 *userSize) {
|
STATIC INT32 ParseUserArgs(UINT64 rootAddr, UINT64 rootSize, UINT64 *userAddr, UINT64 *userSize)
|
||||||
|
{
|
||||||
INT32 ret;
|
INT32 ret;
|
||||||
CHAR *userAddrStr;
|
CHAR *userAddrStr = NULL;
|
||||||
CHAR *userSizeStr;
|
CHAR *userSizeStr = NULL;
|
||||||
|
|
||||||
ret = LOS_GetArgValue("useraddr", &userAddrStr);
|
ret = LOS_GetArgValue("useraddr", &userAddrStr);
|
||||||
if (ret != LOS_OK) {
|
if (ret != LOS_OK) {
|
||||||
|
@ -220,7 +222,8 @@ STATIC INT32 ParseUserArgs(UINT64 rootAddr, UINT64 rootSize, UINT64 *userAddr, U
|
||||||
return LOS_OK;
|
return LOS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
STATIC INT32 MountPartitions(CHAR *fsType, UINT32 mountFlags) {
|
STATIC INT32 MountPartitions(CHAR *fsType, UINT32 mountFlags)
|
||||||
|
{
|
||||||
INT32 ret;
|
INT32 ret;
|
||||||
INT32 err;
|
INT32 err;
|
||||||
|
|
||||||
|
@ -275,7 +278,8 @@ STATIC INT32 MountPartitions(CHAR *fsType, UINT32 mountFlags) {
|
||||||
return LOS_OK;
|
return LOS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
STATIC INT32 CheckValidation(UINT64 rootAddr, UINT64 rootSize, UINT64 userAddr, UINT64 userSize) {
|
STATIC INT32 CheckValidation(UINT64 rootAddr, UINT64 rootSize, UINT64 userAddr, UINT64 userSize)
|
||||||
|
{
|
||||||
UINT64 alignSize = LOS_GetAlignsize();
|
UINT64 alignSize = LOS_GetAlignsize();
|
||||||
|
|
||||||
if (alignSize == 0) {
|
if (alignSize == 0) {
|
||||||
|
@ -291,10 +295,11 @@ STATIC INT32 CheckValidation(UINT64 rootAddr, UINT64 rootSize, UINT64 userAddr,
|
||||||
return LOS_OK;
|
return LOS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
INT32 OsMountRootfs() {
|
INT32 OsMountRootfs()
|
||||||
|
{
|
||||||
INT32 ret;
|
INT32 ret;
|
||||||
CHAR *dev;
|
CHAR *dev = NULL;
|
||||||
CHAR *fstype;
|
CHAR *fstype = NULL;
|
||||||
UINT64 rootAddr;
|
UINT64 rootAddr;
|
||||||
UINT64 rootSize;
|
UINT64 rootSize;
|
||||||
UINT64 userAddr;
|
UINT64 userAddr;
|
||||||
|
|
|
@ -758,5 +758,3 @@ ULONG_T LOS_RbAddNode(LosRbTree *pstTree, LosRbNode *pstNew)
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -423,6 +423,7 @@ STATIC VOID EchoToTerminal(CONSOLE_CB *consoleCB, struct file *filep, const stru
|
||||||
|
|
||||||
STATIC VOID StoreReadChar(CONSOLE_CB *consoleCB, char ch, INT32 readcount)
|
STATIC VOID StoreReadChar(CONSOLE_CB *consoleCB, char ch, INT32 readcount)
|
||||||
{
|
{
|
||||||
|
/* 3, store read char len need to minus \b */
|
||||||
if ((readcount == EACH_CHAR) && (consoleCB->fifoIn <= (CONSOLE_FIFO_SIZE - 3))) {
|
if ((readcount == EACH_CHAR) && (consoleCB->fifoIn <= (CONSOLE_FIFO_SIZE - 3))) {
|
||||||
if (ch == '\b') {
|
if (ch == '\b') {
|
||||||
if (!ConsoleFifoEmpty(consoleCB)) {
|
if (!ConsoleFifoEmpty(consoleCB)) {
|
||||||
|
|
|
@ -103,7 +103,7 @@ STATIC UINT32 OsCirBufWriteLoop(CirBuf *cirbufCB, const CHAR *buf, UINT32 size)
|
||||||
|
|
||||||
UINT32 LOS_CirBufWrite(CirBuf *cirbufCB, const CHAR *buf, UINT32 size)
|
UINT32 LOS_CirBufWrite(CirBuf *cirbufCB, const CHAR *buf, UINT32 size)
|
||||||
{
|
{
|
||||||
UINT32 cpSize = 0;
|
UINT32 cpSize;
|
||||||
|
|
||||||
if ((cirbufCB == NULL) || (buf == NULL) || (size == 0)) {
|
if ((cirbufCB == NULL) || (buf == NULL) || (size == 0)) {
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -61,7 +61,7 @@ STATIC VOID InitLevelCall(const CHAR *name, const UINT32 level, struct ModuleIni
|
||||||
#ifdef LOS_INIT_DEBUG
|
#ifdef LOS_INIT_DEBUG
|
||||||
UINT64 startNsec, endNsec;
|
UINT64 startNsec, endNsec;
|
||||||
UINT64 totalTime = 0;
|
UINT64 totalTime = 0;
|
||||||
UINT64 singleTime = 0;
|
UINT64 singleTime;
|
||||||
UINT32 ret = LOS_OK;
|
UINT32 ret = LOS_OK;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ STATIC VOID InitLevelCall(const CHAR *name, const UINT32 level, struct ModuleIni
|
||||||
#endif
|
#endif
|
||||||
g_initCurrentLevel = level;
|
g_initCurrentLevel = level;
|
||||||
g_initCurrentModule = initLevelList[level];
|
g_initCurrentModule = initLevelList[level];
|
||||||
} else {
|
} else {
|
||||||
while (g_initCurrentLevel < level) {
|
while (g_initCurrentLevel < level) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue