fix:3.1代码检视
Signed-off-by: x_xiny <1301913191@qq.com> Change-Id: I0e0b59cdc22b292ccf0a790010c037d43793a934
This commit is contained in:
parent
41b80ad20a
commit
5b87a530f5
|
@ -218,7 +218,7 @@ u32_t lwip_tftp_recv_from_server(s32_t iSockNum, u32_t *pulSize, TFTPC_PACKET_S
|
||||||
usOpcode = ntohs(pstRecvBuf->usOpcode);
|
usOpcode = ntohs(pstRecvBuf->usOpcode);
|
||||||
/* if this packet is ERROR packet */
|
/* if this packet is ERROR packet */
|
||||||
if (usOpcode == TFTPC_OP_ERROR) {
|
if (usOpcode == TFTPC_OP_ERROR) {
|
||||||
ulError = ntohs (pstRecvBuf->u.stTFTP_Err.usErrNum);
|
ulError = ntohs(pstRecvBuf->u.stTFTP_Err.usErrNum);
|
||||||
|
|
||||||
/*If the error is according to RFC,then convert to lwip error codes.
|
/*If the error is according to RFC,then convert to lwip error codes.
|
||||||
Constant values are used in the cases as these error codes are as per
|
Constant values are used in the cases as these error codes are as per
|
||||||
|
@ -727,7 +727,7 @@ u32_t lwip_tftp_get_file_by_filename(u32_t ulHostAddr,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* if this packet is unkonwn or incorrect packet */
|
/* if this packet is unkonwn or incorrect packet */
|
||||||
if (ntohs (pstRecvBuf->usOpcode) != TFTPC_OP_DATA) {
|
if (ntohs(pstRecvBuf->usOpcode) != TFTPC_OP_DATA) {
|
||||||
/* Send error packet to server */
|
/* Send error packet to server */
|
||||||
lwip_tftp_send_error(iSockNum,
|
lwip_tftp_send_error(iSockNum,
|
||||||
TFTPC_PROTOCOL_PROTO_ERROR,
|
TFTPC_PROTOCOL_PROTO_ERROR,
|
||||||
|
@ -1557,7 +1557,7 @@ u32_t lwip_tftp_get_file_by_filename_to_rawmem(u32_t ulHostAddr,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* if this packet is unkonwn or incorrect packet */
|
/* if this packet is unkonwn or incorrect packet */
|
||||||
if (ntohs (pstRecvBuf->usOpcode) != TFTPC_OP_DATA) {
|
if (ntohs(pstRecvBuf->usOpcode) != TFTPC_OP_DATA) {
|
||||||
/* Send error packet to server */
|
/* Send error packet to server */
|
||||||
lwip_tftp_send_error(iSockNum,
|
lwip_tftp_send_error(iSockNum,
|
||||||
TFTPC_PROTOCOL_PROTO_ERROR,
|
TFTPC_PROTOCOL_PROTO_ERROR,
|
||||||
|
|
|
@ -45,8 +45,6 @@
|
||||||
#include "bcache.h"
|
#include "bcache.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "pthread.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
#if __cplusplus
|
#if __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|
|
@ -1861,7 +1861,7 @@ static FRESULT fatfs_setlabel(los_part *part)
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
int fatfs_mkfs (struct Vnode *device, int sectors, int option)
|
int fatfs_mkfs(struct Vnode *device, int sectors, int option)
|
||||||
{
|
{
|
||||||
BYTE *work_buff = NULL;
|
BYTE *work_buff = NULL;
|
||||||
los_part *part = NULL;
|
los_part *part = NULL;
|
||||||
|
|
|
@ -137,7 +137,7 @@ int fatfs_readdir(struct Vnode *vnode, struct fs_dirent_s *idir);
|
||||||
int fatfs_rewinddir(struct Vnode *vnode, struct fs_dirent_s *dir);
|
int fatfs_rewinddir(struct Vnode *vnode, struct fs_dirent_s *dir);
|
||||||
int fatfs_closedir(struct Vnode *vnode, struct fs_dirent_s *dir);
|
int fatfs_closedir(struct Vnode *vnode, struct fs_dirent_s *dir);
|
||||||
int fatfs_rename(struct Vnode *oldvnode, struct Vnode *newparent, const char *oldname, const char *newname);
|
int fatfs_rename(struct Vnode *oldvnode, struct Vnode *newparent, const char *oldname, const char *newname);
|
||||||
int fatfs_mkfs (struct Vnode *device, int sectors, int option);
|
int fatfs_mkfs(struct Vnode *device, int sectors, int option);
|
||||||
int fatfs_mkdir(struct Vnode *parent, const char *name, mode_t mode, struct Vnode **vpp);
|
int fatfs_mkdir(struct Vnode *parent, const char *name, mode_t mode, struct Vnode **vpp);
|
||||||
int fatfs_rmdir(struct Vnode *parent, struct Vnode *vp, const char *name);
|
int fatfs_rmdir(struct Vnode *parent, struct Vnode *vp, const char *name);
|
||||||
int fatfs_unlink(struct Vnode *parent, struct Vnode *vp, const char *name);
|
int fatfs_unlink(struct Vnode *parent, struct Vnode *vp, const char *name);
|
||||||
|
|
|
@ -581,11 +581,11 @@ FRESULT f_checkvirpart(FATFS *fs, const TCHAR *path, BYTE vol)
|
||||||
labelTmp = (DWORD *)label;
|
labelTmp = (DWORD *)label;
|
||||||
*labelTmp = tmp;
|
*labelTmp = tmp;
|
||||||
tmp = ld_dword(work + VR_PARTITION + i * VR_ITEMSIZE + VR_Entry + 4);
|
tmp = ld_dword(work + VR_PARTITION + i * VR_ITEMSIZE + VR_Entry + 4);
|
||||||
*((DWORD * )(label + 4)) = tmp;
|
*((DWORD *)(label + 4)) = tmp;
|
||||||
tmp = ld_dword(work + VR_PARTITION + i * VR_ITEMSIZE + VR_Entry + 8);
|
tmp = ld_dword(work + VR_PARTITION + i * VR_ITEMSIZE + VR_Entry + 8);
|
||||||
*((DWORD * )(label + 8)) = tmp;
|
*((DWORD *)(label + 8)) = tmp;
|
||||||
tmp = ld_dword(work + VR_PARTITION + i * VR_ITEMSIZE + VR_Entry + 12);
|
tmp = ld_dword(work + VR_PARTITION + i * VR_ITEMSIZE + VR_Entry + 12);
|
||||||
*((DWORD * )(label + 12)) = tmp;
|
*((DWORD *)(label + 12)) = tmp;
|
||||||
|
|
||||||
if (f_checkname(label) != FR_OK) {
|
if (f_checkname(label) != FR_OK) {
|
||||||
(void)f_unregvirfs(fs);
|
(void)f_unregvirfs(fs);
|
||||||
|
@ -721,11 +721,11 @@ FRESULT f_makevirpart(FATFS *fs, const TCHAR *path, BYTE vol)
|
||||||
labelTmp = (DWORD *)label;
|
labelTmp = (DWORD *)label;
|
||||||
tmp = *labelTmp;
|
tmp = *labelTmp;
|
||||||
st_dword(work + VR_PARTITION + i * VR_ITEMSIZE + VR_Entry + 0, tmp);
|
st_dword(work + VR_PARTITION + i * VR_ITEMSIZE + VR_Entry + 0, tmp);
|
||||||
tmp = *((DWORD * )(label + 4));
|
tmp = *((DWORD *)(label + 4));
|
||||||
st_dword(work + VR_PARTITION + i * VR_ITEMSIZE + VR_Entry + 4, tmp);
|
st_dword(work + VR_PARTITION + i * VR_ITEMSIZE + VR_Entry + 4, tmp);
|
||||||
tmp = *((DWORD * )(label + 8));
|
tmp = *((DWORD *)(label + 8));
|
||||||
st_dword(work + VR_PARTITION + i * VR_ITEMSIZE + VR_Entry + 8, tmp);
|
st_dword(work + VR_PARTITION + i * VR_ITEMSIZE + VR_Entry + 8, tmp);
|
||||||
tmp = *((DWORD * )(label + 12));
|
tmp = *((DWORD *)(label + 12));
|
||||||
st_dword(work + VR_PARTITION + i * VR_ITEMSIZE + VR_Entry + 12, tmp);
|
st_dword(work + VR_PARTITION + i * VR_ITEMSIZE + VR_Entry + 12, tmp);
|
||||||
|
|
||||||
virpartper += g_fatVirPart.virtualinfo.virpartpercent[i];
|
virpartper += g_fatVirPart.virtualinfo.virpartpercent[i];
|
||||||
|
|
|
@ -35,115 +35,174 @@
|
||||||
#include "path_cache.h"
|
#include "path_cache.h"
|
||||||
|
|
||||||
/* vnode operations returns EIO */
|
/* vnode operations returns EIO */
|
||||||
static int ErrorVopCreate (struct Vnode *parent, const char *name, int mode, struct Vnode **vnode)
|
static int ErrorVopCreate(struct Vnode *parent, const char *name, int mode, struct Vnode **vnode)
|
||||||
{
|
{
|
||||||
|
(void)parent;
|
||||||
|
(void)name;
|
||||||
|
(void)mode;
|
||||||
|
(void)vnode;
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ErrorVopLookup (struct Vnode *parent, const char *name, int len, struct Vnode **vnode)
|
static int ErrorVopLookup(struct Vnode *parent, const char *name, int len, struct Vnode **vnode)
|
||||||
{
|
{
|
||||||
|
(void)parent;
|
||||||
|
(void)name;
|
||||||
|
(void)len;
|
||||||
|
(void)vnode;
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ErrorVopOpen (struct Vnode *vnode, int fd, int mode, int flags)
|
static int ErrorVopOpen(struct Vnode *vnode, int fd, int mode, int flags)
|
||||||
{
|
{
|
||||||
|
(void)vnode;
|
||||||
|
(void)fd;
|
||||||
|
(void)mode;
|
||||||
|
(void)flags;
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ErrorVopClose (struct Vnode *vnode)
|
static int ErrorVopClose(struct Vnode *vnode)
|
||||||
{
|
{
|
||||||
|
(void)vnode;
|
||||||
/* already closed at force umount, do nothing here */
|
/* already closed at force umount, do nothing here */
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ErrorVopReclaim (struct Vnode *vnode)
|
static int ErrorVopReclaim(struct Vnode *vnode)
|
||||||
{
|
{
|
||||||
|
(void)vnode;
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ErrorVopUnlink (struct Vnode *parent, struct Vnode *vnode, const char *fileName)
|
static int ErrorVopUnlink(struct Vnode *parent, struct Vnode *vnode, const char *fileName)
|
||||||
{
|
{
|
||||||
|
(void)parent;
|
||||||
|
(void)vnode;
|
||||||
|
(void)fileName;
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ErrorVopRmdir (struct Vnode *parent, struct Vnode *vnode, const char *dirName)
|
static int ErrorVopRmdir(struct Vnode *parent, struct Vnode *vnode, const char *dirName)
|
||||||
{
|
{
|
||||||
|
(void)parent;
|
||||||
|
(void)vnode;
|
||||||
|
(void)dirName;
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ErrorVopMkdir (struct Vnode *parent, const char *dirName, mode_t mode, struct Vnode **vnode)
|
static int ErrorVopMkdir(struct Vnode *parent, const char *dirName, mode_t mode, struct Vnode **vnode)
|
||||||
{
|
{
|
||||||
|
(void)parent;
|
||||||
|
(void)dirName;
|
||||||
|
(void)mode;
|
||||||
|
(void)vnode;
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ErrorVopReaddir (struct Vnode *vnode, struct fs_dirent_s *dir)
|
static int ErrorVopReaddir(struct Vnode *vnode, struct fs_dirent_s *dir)
|
||||||
{
|
{
|
||||||
|
(void)vnode;
|
||||||
|
(void)dir;
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ErrorVopOpendir (struct Vnode *vnode, struct fs_dirent_s *dir)
|
static int ErrorVopOpendir(struct Vnode *vnode, struct fs_dirent_s *dir)
|
||||||
{
|
{
|
||||||
|
(void)vnode;
|
||||||
|
(void)dir;
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ErrorVopRewinddir (struct Vnode *vnode, struct fs_dirent_s *dir)
|
static int ErrorVopRewinddir(struct Vnode *vnode, struct fs_dirent_s *dir)
|
||||||
{
|
{
|
||||||
|
(void)vnode;
|
||||||
|
(void)dir;
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ErrorVopClosedir (struct Vnode *vnode, struct fs_dirent_s *dir)
|
static int ErrorVopClosedir(struct Vnode *vnode, struct fs_dirent_s *dir)
|
||||||
{
|
{
|
||||||
|
(void)vnode;
|
||||||
|
(void)dir;
|
||||||
/* already closed at force umount, do nothing here */
|
/* already closed at force umount, do nothing here */
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ErrorVopGetattr (struct Vnode *vnode, struct stat *st)
|
static int ErrorVopGetattr(struct Vnode *vnode, struct stat *st)
|
||||||
{
|
{
|
||||||
|
(void)vnode;
|
||||||
|
(void)st;
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ErrorVopSetattr (struct Vnode *vnode, struct stat *st)
|
static int ErrorVopSetattr(struct Vnode *vnode, struct stat *st)
|
||||||
{
|
{
|
||||||
|
(void)vnode;
|
||||||
|
(void)st;
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ErrorVopChattr (struct Vnode *vnode, struct IATTR *attr)
|
static int ErrorVopChattr(struct Vnode *vnode, struct IATTR *attr)
|
||||||
{
|
{
|
||||||
|
(void)vnode;
|
||||||
|
(void)attr;
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ErrorVopRename (struct Vnode *src, struct Vnode *dstParent, const char *srcName, const char *dstName)
|
static int ErrorVopRename(struct Vnode *src, struct Vnode *dstParent, const char *srcName, const char *dstName)
|
||||||
{
|
{
|
||||||
|
(void)src;
|
||||||
|
(void)dstParent;
|
||||||
|
(void)srcName;
|
||||||
|
(void)dstName;
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ErrorVopTruncate (struct Vnode *vnode, off_t len)
|
static int ErrorVopTruncate(struct Vnode *vnode, off_t len)
|
||||||
{
|
{
|
||||||
|
(void)vnode;
|
||||||
|
(void)len;
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ErrorVopTruncate64 (struct Vnode *vnode, off64_t len)
|
static int ErrorVopTruncate64(struct Vnode *vnode, off64_t len)
|
||||||
{
|
{
|
||||||
|
(void)vnode;
|
||||||
|
(void)len;
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ErrorVopFscheck (struct Vnode *vnode, struct fs_dirent_s *dir)
|
static int ErrorVopFscheck(struct Vnode *vnode, struct fs_dirent_s *dir)
|
||||||
{
|
{
|
||||||
|
(void)vnode;
|
||||||
|
(void)dir;
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ErrorVopLink (struct Vnode *src, struct Vnode *dstParent, struct Vnode **dst, const char *dstName)
|
static int ErrorVopLink(struct Vnode *src, struct Vnode *dstParent, struct Vnode **dst, const char *dstName)
|
||||||
{
|
{
|
||||||
|
(void)src;
|
||||||
|
(void)dstParent;
|
||||||
|
(void)dst;
|
||||||
|
(void)dstName;
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ErrorVopSymlink (struct Vnode *parentVnode, struct Vnode **newVnode, const char *path, const char *target)
|
static int ErrorVopSymlink(struct Vnode *parentVnode, struct Vnode **newVnode, const char *path, const char *target)
|
||||||
{
|
{
|
||||||
|
(void)parentVnode;
|
||||||
|
(void)newVnode;
|
||||||
|
(void)path;
|
||||||
|
(void)target;
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ssize_t ErrorVopReadlink (struct Vnode *vnode, char *buffer, size_t bufLen)
|
static ssize_t ErrorVopReadlink(struct Vnode *vnode, char *buffer, size_t bufLen)
|
||||||
{
|
{
|
||||||
|
(void)vnode;
|
||||||
|
(void)buffer;
|
||||||
|
(void)bufLen;
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -173,74 +232,107 @@ static struct VnodeOps g_errorVnodeOps = {
|
||||||
};
|
};
|
||||||
|
|
||||||
/* file operations returns EIO */
|
/* file operations returns EIO */
|
||||||
static int ErrorFopOpen (struct file *filep)
|
static int ErrorFopOpen(struct file *filep)
|
||||||
{
|
{
|
||||||
|
(void)filep;
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ErrorFopClose (struct file *filep)
|
static int ErrorFopClose(struct file *filep)
|
||||||
{
|
{
|
||||||
|
(void)filep;
|
||||||
/* already closed at force umount, do nothing here */
|
/* already closed at force umount, do nothing here */
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ssize_t ErrorFopRead (struct file *filep, char *buffer, size_t buflen)
|
static ssize_t ErrorFopRead(struct file *filep, char *buffer, size_t buflen)
|
||||||
{
|
{
|
||||||
|
(void)filep;
|
||||||
|
(void)buffer;
|
||||||
|
(void)buflen;
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ssize_t ErrorFopWrite (struct file *filep, const char *buffer, size_t buflen)
|
static ssize_t ErrorFopWrite(struct file *filep, const char *buffer, size_t buflen)
|
||||||
{
|
{
|
||||||
|
(void)filep;
|
||||||
|
(void)buffer;
|
||||||
|
(void)buflen;
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static off_t ErrorFopSeek (struct file *filep, off_t offset, int whence)
|
static off_t ErrorFopSeek(struct file *filep, off_t offset, int whence)
|
||||||
{
|
{
|
||||||
|
(void)filep;
|
||||||
|
(void)offset;
|
||||||
|
(void)whence;
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ErrorFopIoctl (struct file *filep, int cmd, unsigned long arg)
|
static int ErrorFopIoctl(struct file *filep, int cmd, unsigned long arg)
|
||||||
{
|
{
|
||||||
|
(void)filep;
|
||||||
|
(void)cmd;
|
||||||
|
(void)arg;
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ErrorFopMmap (struct file* filep, struct VmMapRegion *region)
|
static int ErrorFopMmap(struct file* filep, struct VmMapRegion *region)
|
||||||
{
|
{
|
||||||
|
(void)filep;
|
||||||
|
(void)region;
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ErrorFopPoll (struct file *filep, poll_table *fds)
|
static int ErrorFopPoll(struct file *filep, poll_table *fds)
|
||||||
{
|
{
|
||||||
|
(void)filep;
|
||||||
|
(void)fds;
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ErrorFopStat (struct file *filep, struct stat* st)
|
static int ErrorFopStat(struct file *filep, struct stat* st)
|
||||||
{
|
{
|
||||||
|
(void)filep;
|
||||||
|
(void)st;
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ErrorFopFallocate (struct file* filep, int mode, off_t offset, off_t len)
|
static int ErrorFopFallocate(struct file* filep, int mode, off_t offset, off_t len)
|
||||||
{
|
{
|
||||||
|
(void)filep;
|
||||||
|
(void)mode;
|
||||||
|
(void)offset;
|
||||||
|
(void)len;
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ErrorFopFallocate64 (struct file *filep, int mode, off64_t offset, off64_t len)
|
static int ErrorFopFallocate64(struct file *filep, int mode, off64_t offset, off64_t len)
|
||||||
{
|
{
|
||||||
|
(void)filep;
|
||||||
|
(void)mode;
|
||||||
|
(void)offset;
|
||||||
|
(void)len;
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ErrorFopFsync (struct file *filep)
|
static int ErrorFopFsync(struct file *filep)
|
||||||
{
|
{
|
||||||
|
(void)filep;
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ssize_t ErrorFopReadpage (struct file *filep, char *buffer, size_t buflen)
|
static ssize_t ErrorFopReadpage(struct file *filep, char *buffer, size_t buflen)
|
||||||
{
|
{
|
||||||
|
(void)filep;
|
||||||
|
(void)buffer;
|
||||||
|
(void)buflen;
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ErrorFopUnlink (struct Vnode *vnode)
|
static int ErrorFopUnlink(struct Vnode *vnode)
|
||||||
{
|
{
|
||||||
|
(void)vnode;
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -193,7 +193,7 @@ LITE_OS_SEC_TEXT_MINOR UINT32 OsShellCmdUname(INT32 argc, const CHAR *argv[])
|
||||||
|
|
||||||
if (argc == 1) {
|
if (argc == 1) {
|
||||||
if (strcmp(argv[0], "-a") == 0) {
|
if (strcmp(argv[0], "-a") == 0) {
|
||||||
PRINTK("%s %d.%d.%d.%d %s %s\n", KERNEL_NAME, KERNEL_MAJOR, KERNEL_MINOR, KERNEL_PATCH, KERNEL_ITRE,\
|
PRINTK("%s %d.%d.%d.%d %s %s\n", KERNEL_NAME, KERNEL_MAJOR, KERNEL_MINOR, KERNEL_PATCH, KERNEL_ITRE, \
|
||||||
__DATE__, __TIME__);
|
__DATE__, __TIME__);
|
||||||
return 0;
|
return 0;
|
||||||
} else if (strcmp(argv[0], "-s") == 0) {
|
} else if (strcmp(argv[0], "-s") == 0) {
|
||||||
|
|
|
@ -179,7 +179,7 @@ LITE_OS_SEC_TEXT_INIT VOID OsSystemInfo(VOID)
|
||||||
#ifdef LOSCFG_KERNEL_SMP
|
#ifdef LOSCFG_KERNEL_SMP
|
||||||
LOSCFG_KERNEL_SMP_CORE_NUM,
|
LOSCFG_KERNEL_SMP_CORE_NUM,
|
||||||
#endif
|
#endif
|
||||||
HalIrqVersion(), __DATE__, __TIME__,\
|
HalIrqVersion(), __DATE__, __TIME__, \
|
||||||
KERNEL_NAME, KERNEL_MAJOR, KERNEL_MINOR, KERNEL_PATCH, KERNEL_ITRE, buildType);
|
KERNEL_NAME, KERNEL_MAJOR, KERNEL_MINOR, KERNEL_PATCH, KERNEL_ITRE, buildType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -162,7 +162,7 @@ struct ModuleInitInfo {
|
||||||
*/
|
*/
|
||||||
#define OS_INIT_LEVEL_REG(_type, _num, _list) \
|
#define OS_INIT_LEVEL_REG(_type, _num, _list) \
|
||||||
INIT_LABEL_REG_##_num(EXTERN_LABEL, _type) \
|
INIT_LABEL_REG_##_num(EXTERN_LABEL, _type) \
|
||||||
STATIC struct ModuleInitInfo* _list [] = { \
|
STATIC struct ModuleInitInfo *_list[] = { \
|
||||||
INIT_LABEL_REG_##_num(GET_LABEL, _type) \
|
INIT_LABEL_REG_##_num(GET_LABEL, _type) \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -198,7 +198,7 @@ __attribute__((noinline)) VOID UartPrintf(const CHAR *fmt, ...)
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
}
|
}
|
||||||
|
|
||||||
__attribute__ ((noinline)) VOID dprintf(const CHAR *fmt, ...)
|
__attribute__((noinline)) VOID dprintf(const CHAR *fmt, ...)
|
||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
va_start(ap, fmt);
|
va_start(ap, fmt);
|
||||||
|
@ -229,7 +229,7 @@ VOID DmesgPrintf(const CHAR *fmt, va_list ap)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef LOSCFG_PLATFORM_UART_WITHOUT_VFS
|
#ifdef LOSCFG_PLATFORM_UART_WITHOUT_VFS
|
||||||
__attribute__ ((noinline)) INT32 printf(const CHAR *fmt, ...)
|
__attribute__((noinline)) INT32 printf(const CHAR *fmt, ...)
|
||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
va_start(ap, fmt);
|
va_start(ap, fmt);
|
||||||
|
|
|
@ -45,7 +45,6 @@
|
||||||
#ifdef LOSCFG_DRIVERS_TZDRIVER
|
#ifdef LOSCFG_DRIVERS_TZDRIVER
|
||||||
#include "fs/file.h"
|
#include "fs/file.h"
|
||||||
#endif
|
#endif
|
||||||
#include "fs/file.h"
|
|
||||||
#include "unistd.h"
|
#include "unistd.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
|
@ -56,7 +56,7 @@ void *memcpy(void *dest, const void *src, size_t len)
|
||||||
}
|
}
|
||||||
|
|
||||||
#undef strcat
|
#undef strcat
|
||||||
char *strcat (char *s, const char *append)
|
char *strcat(char *s, const char *append)
|
||||||
{
|
{
|
||||||
if ((s == NULL) || (append == NULL)) {
|
if ((s == NULL) || (append == NULL)) {
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -119,4 +119,4 @@ char *strncpy(char *dest, const char *src, size_t n)
|
||||||
__asan_storeN_noabort((UINTPTR)dest, n);
|
__asan_storeN_noabort((UINTPTR)dest, n);
|
||||||
__asan_loadN_noabort((UINTPTR)src, size + 1);
|
__asan_loadN_noabort((UINTPTR)src, size + 1);
|
||||||
return __strncpy(dest, src, n);
|
return __strncpy(dest, src, n);
|
||||||
}
|
}
|
||||||
|
|
|
@ -104,7 +104,7 @@ typedef struct {
|
||||||
#define PMU_INT(_num) PMU_LABEL_INT_##_num
|
#define PMU_INT(_num) PMU_LABEL_INT_##_num
|
||||||
|
|
||||||
#define OS_PMU_INTS(_num, _list) \
|
#define OS_PMU_INTS(_num, _list) \
|
||||||
STATIC UINT32 _list [_num] = { \
|
STATIC UINT32 _list[_num] = { \
|
||||||
PMU_INT(_num) \
|
PMU_INT(_num) \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -181,7 +181,7 @@ STATIC VOID LOS_TraceTaskResume(const LosTaskCB *taskCB)
|
||||||
|
|
||||||
STATIC VOID LOS_TraceTaskSuspend(const LosTaskCB *taskCB)
|
STATIC VOID LOS_TraceTaskSuspend(const LosTaskCB *taskCB)
|
||||||
{
|
{
|
||||||
LOS_TRACE(TASK_SUSPEND, taskCB->taskID, taskCB->taskStatus,OsCurrTaskGet()->taskID);
|
LOS_TRACE(TASK_SUSPEND, taskCB->taskID, taskCB->taskStatus, OsCurrTaskGet()->taskID);
|
||||||
}
|
}
|
||||||
|
|
||||||
STATIC VOID LOS_TraceIsrEnter(UINT32 hwiNum)
|
STATIC VOID LOS_TraceIsrEnter(UINT32 hwiNum)
|
||||||
|
|
|
@ -65,7 +65,6 @@
|
||||||
#include "lwip/api_shell.h"
|
#include "lwip/api_shell.h"
|
||||||
|
|
||||||
#include "lwip/dns.h"
|
#include "lwip/dns.h"
|
||||||
#include "lwip/netdb.h"
|
|
||||||
#include "lwip/udp.h"
|
#include "lwip/udp.h"
|
||||||
#include "lwip/priv/tcp_priv.h"
|
#include "lwip/priv/tcp_priv.h"
|
||||||
|
|
||||||
|
@ -2378,11 +2377,11 @@ LWIP_STATIC int create_ping6_socket(u8_t type, const void *param)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Setting socket filter since we are interested only in ECHO REPLY and ERROR messages */
|
/* Setting socket filter since we are interested only in ECHO REPLY and ERROR messages */
|
||||||
ICMP6_FILTER_SETBLOCKALL (&icmp6_sock_filter);
|
ICMP6_FILTER_SETBLOCKALL(&icmp6_sock_filter);
|
||||||
ICMP6_FILTER_SETPASS (ICMP6_TYPE_EREP, &icmp6_sock_filter);
|
ICMP6_FILTER_SETPASS(ICMP6_TYPE_EREP, &icmp6_sock_filter);
|
||||||
ICMP6_FILTER_SETPASS (ICMP6_TYPE_DUR, &icmp6_sock_filter);
|
ICMP6_FILTER_SETPASS(ICMP6_TYPE_DUR, &icmp6_sock_filter);
|
||||||
ICMP6_FILTER_SETPASS (ICMP6_TYPE_PTB, &icmp6_sock_filter);
|
ICMP6_FILTER_SETPASS(ICMP6_TYPE_PTB, &icmp6_sock_filter);
|
||||||
ICMP6_FILTER_SETPASS (ICMP6_TYPE_TE, &icmp6_sock_filter);
|
ICMP6_FILTER_SETPASS(ICMP6_TYPE_TE, &icmp6_sock_filter);
|
||||||
|
|
||||||
ret = lwip_setsockopt(sfd, IPPROTO_ICMPV6, ICMP6_FILTER, &icmp6_sock_filter, sizeof(struct icmp6_filter));
|
ret = lwip_setsockopt(sfd, IPPROTO_ICMPV6, ICMP6_FILTER, &icmp6_sock_filter, sizeof(struct icmp6_filter));
|
||||||
if (ret == -1) {
|
if (ret == -1) {
|
||||||
|
|
|
@ -34,8 +34,6 @@
|
||||||
#include <lwip/snmp.h>
|
#include <lwip/snmp.h>
|
||||||
#include <lwip/etharp.h>
|
#include <lwip/etharp.h>
|
||||||
#include <lwip/sockets.h>
|
#include <lwip/sockets.h>
|
||||||
#include <lwip/snmp.h>
|
|
||||||
#include <lwip/etharp.h>
|
|
||||||
#include <lwip/ethip6.h>
|
#include <lwip/ethip6.h>
|
||||||
|
|
||||||
#define LWIP_NETIF_HOSTNAME_DEFAULT "default"
|
#define LWIP_NETIF_HOSTNAME_DEFAULT "default"
|
||||||
|
|
|
@ -106,7 +106,7 @@ VOID OsLkLogFileSet(const CHAR *str)
|
||||||
}
|
}
|
||||||
fp = fopen(str, "w+");
|
fp = fopen(str, "w+");
|
||||||
if (fp == NULL) {
|
if (fp == NULL) {
|
||||||
printf("Error can't open the %s file\n",str);
|
printf("Error can't open the %s file\n", str);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -57,8 +57,6 @@
|
||||||
#include "sys/prctl.h"
|
#include "sys/prctl.h"
|
||||||
#include "sys/socket.h"
|
#include "sys/socket.h"
|
||||||
#include "sys/utsname.h"
|
#include "sys/utsname.h"
|
||||||
#include "poll.h"
|
|
||||||
#include "sys/uio.h"
|
|
||||||
#ifdef LOSCFG_SHELL
|
#ifdef LOSCFG_SHELL
|
||||||
#include "shmsg.h"
|
#include "shmsg.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -63,7 +63,6 @@
|
||||||
#include "epoll.h"
|
#include "epoll.h"
|
||||||
#endif
|
#endif
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
#include "sys/resource.h"
|
|
||||||
#ifdef LOSCFG_FS_VFS
|
#ifdef LOSCFG_FS_VFS
|
||||||
#include "vnode.h"
|
#include "vnode.h"
|
||||||
#endif
|
#endif
|
||||||
|
@ -148,8 +147,8 @@ extern int SysBind(int s, const struct sockaddr *name, socklen_t namelen);
|
||||||
extern int SysConnect(int s, const struct sockaddr *name, socklen_t namelen);
|
extern int SysConnect(int s, const struct sockaddr *name, socklen_t namelen);
|
||||||
extern int SysListen(int sockfd, int backlog);
|
extern int SysListen(int sockfd, int backlog);
|
||||||
extern int SysAccept(int socket, struct sockaddr *address, socklen_t *addressLen);
|
extern int SysAccept(int socket, struct sockaddr *address, socklen_t *addressLen);
|
||||||
extern int SysGetSockName (int s, struct sockaddr *name, socklen_t *namelen);
|
extern int SysGetSockName(int s, struct sockaddr *name, socklen_t *namelen);
|
||||||
extern int SysGetPeerName (int s, struct sockaddr *name, socklen_t *namelen);
|
extern int SysGetPeerName(int s, struct sockaddr *name, socklen_t *namelen);
|
||||||
extern ssize_t SysSend(int s, const void *dataptr, size_t size, int flags);
|
extern ssize_t SysSend(int s, const void *dataptr, size_t size, int flags);
|
||||||
extern ssize_t SysSendTo(int s, const void *dataptr, size_t size, int flags,
|
extern ssize_t SysSendTo(int s, const void *dataptr, size_t size, int flags,
|
||||||
const struct sockaddr *to, socklen_t tolen);
|
const struct sockaddr *to, socklen_t tolen);
|
||||||
|
|
|
@ -44,9 +44,6 @@
|
||||||
#include "shmsg.h"
|
#include "shmsg.h"
|
||||||
#endif
|
#endif
|
||||||
#include "user_copy.h"
|
#include "user_copy.h"
|
||||||
#include "los_strncpy_from_user.h"
|
|
||||||
#include "capability_type.h"
|
|
||||||
#include "capability_api.h"
|
|
||||||
#include "unistd.h"
|
#include "unistd.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue