fix: 编码规范修改
1.拼写错误 2.未使用的参数使用void 3.删除lint相关注释 4.函数返回值处理 Signed-off-by: zhushengle <zhushengle@huawei.com> Change-Id: I155d786172d62f47d940b32b0a1b36406d3c047f
This commit is contained in:
parent
ba727e2678
commit
d161a0b03d
6
Kconfig
6
Kconfig
|
@ -189,7 +189,7 @@ config DEBUG_VERSION
|
||||||
It also means you do not want to use debug modules, like shell,telnet,tftp,nfs and
|
It also means you do not want to use debug modules, like shell,telnet,tftp,nfs and
|
||||||
memory check, etc.
|
memory check, etc.
|
||||||
If you select this option that means you enable a debug version for LiteOS.
|
If you select this option that means you enable a debug version for LiteOS.
|
||||||
That means you want a opposite behaviour compared to release version.
|
That means you want an opposite behaviour compared to release version.
|
||||||
|
|
||||||
config DEBUG_KERNEL
|
config DEBUG_KERNEL
|
||||||
bool "Enable Debug LiteOS Kernel Resource"
|
bool "Enable Debug LiteOS Kernel Resource"
|
||||||
|
@ -198,7 +198,7 @@ config DEBUG_KERNEL
|
||||||
help
|
help
|
||||||
If you select this option that means you enable debugging kernel resource.
|
If you select this option that means you enable debugging kernel resource.
|
||||||
It also means you want to get queue, mutex, semaphore, memory debug information.
|
It also means you want to get queue, mutex, semaphore, memory debug information.
|
||||||
That means you want a opposite behaviour compared to release version.
|
That means you want an opposite behaviour compared to release version.
|
||||||
|
|
||||||
config DEBUG_QUEUE
|
config DEBUG_QUEUE
|
||||||
bool "Enable Queue Debugging"
|
bool "Enable Queue Debugging"
|
||||||
|
@ -265,7 +265,7 @@ config MEM_LEAKCHECK
|
||||||
default n
|
default n
|
||||||
depends on DEBUG_VERSION && MEM_DEBUG
|
depends on DEBUG_VERSION && MEM_DEBUG
|
||||||
help
|
help
|
||||||
Answer Y to enable record the LR of Function call stack of Mem operation, it can check the mem leak through the infomations of mem node.
|
Answer Y to enable record the LR of Function call stack of Mem operation, it can check the mem leak through the informations of mem node.
|
||||||
config BASE_MEM_NODE_INTEGRITY_CHECK
|
config BASE_MEM_NODE_INTEGRITY_CHECK
|
||||||
bool "Enable integrity check or not"
|
bool "Enable integrity check or not"
|
||||||
default n
|
default n
|
||||||
|
|
2
Makefile
2
Makefile
|
@ -97,7 +97,7 @@ Targets:
|
||||||
cleanall: clean all build outputs
|
cleanall: clean all build outputs
|
||||||
all: make liteos kernel image and rootfs image (Default target)
|
all: make liteos kernel image and rootfs image (Default target)
|
||||||
$(APPS): build all apps
|
$(APPS): build all apps
|
||||||
$(ROOTFS): make a original rootfs image
|
$(ROOTFS): make an original rootfs image
|
||||||
$(LITEOS_LIBS_TARGET): compile all kernel modules (libraries)
|
$(LITEOS_LIBS_TARGET): compile all kernel modules (libraries)
|
||||||
$(LITEOS_TARGET): make liteos kernel image
|
$(LITEOS_TARGET): make liteos kernel image
|
||||||
update_config: update product kernel config (use menuconfig)
|
update_config: update product kernel config (use menuconfig)
|
||||||
|
|
3
OAT.xml
3
OAT.xml
|
@ -12,9 +12,10 @@
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
See the License for the specific language governing permissions and
|
See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<!--
|
||||||
This is the configuration file template for OpenHarmony OSS Audit Tool, please copy it to your project root dir and modify it refer to OpenHarmony/tools_oat/README.
|
This is the configuration file template for OpenHarmony OSS Audit Tool, please copy it to your project root dir and modify it refer to OpenHarmony/tools_oat/README.
|
||||||
|
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<configuration>
|
<configuration>
|
||||||
|
|
12
README.md
12
README.md
|
@ -73,9 +73,9 @@ OpenHarmony LiteOS Cortex-A supports the [Hi3518E V300](https://gitee.com/openh
|
||||||
|
|
||||||
You need to set up the compilation environment on Linux.
|
You need to set up the compilation environment on Linux.
|
||||||
|
|
||||||
- [Compilation environment on Linux](https://gitee.com/openharmony/docs/blob/master/en/device-dev/quick-start/quickstart-lite-env-setup-lin.md)
|
- [Compilation environment on Linux](https://gitee.com/openharmony/docs/blob/master/en/device-dev/quick-start/quickstart-lite-env-setup-linux.md)
|
||||||
- For Hi3518E V300, see [Setting Up the Hi3518 Development Environment](https://gitee.com/openharmony/docs/blob/master/en/device-dev/quick-start/quickstart-lite-steps-board3518-setting.md).
|
- For Hi3518E V300, see [Setting Up the Hi3518 Development Environment](https://gitee.com/openharmony/docs/blob/master/en/device-dev/quick-start/quickstart-lite-steps-hi3518-setting.md).
|
||||||
- For Hi3516D V300, see [Setting Up the Hi3516 Development Environment](https://gitee.com/openharmony/docs/blob/master/en/device-dev/quick-start/quickstart-lite-steps-board3516-setting.md).
|
- For Hi3516D V300, see [Setting Up the Hi3516 Development Environment](https://gitee.com/openharmony/docs/blob/master/en/device-dev/quick-start/quickstart-lite-steps-hi3516-setting.md).
|
||||||
|
|
||||||
### Source Code Acquisition<a name="section11443189655"></a>
|
### Source Code Acquisition<a name="section11443189655"></a>
|
||||||
|
|
||||||
|
@ -85,9 +85,9 @@ Download and decompress a set of source code on a Linux server to acquire the [
|
||||||
|
|
||||||
For details about how to develop the first application, see:
|
For details about how to develop the first application, see:
|
||||||
|
|
||||||
- [Developing the First Example Program Running on Hi3518](https://gitee.com/openharmony/docs/blob/master/en/device-dev/quick-start/quickstart-lite-steps-board3518-running.md)
|
- [Developing the First Example Program Running on Hi3518](https://gitee.com/openharmony/docs/blob/master/en/device-dev/quick-start/quickstart-lite-steps-hi3518-running.md)
|
||||||
|
|
||||||
- [Developing the First Example Program Running on Hi3516](https://gitee.com/openharmony/docs/blob/master/en/device-dev/quick-start/quickstart-lite-steps-board3516-running.md)
|
- [Developing the First Example Program Running on Hi3516](https://gitee.com/openharmony/docs/blob/master/en/device-dev/quick-start/quickstart-lite-steps-hi3516-running.md)
|
||||||
|
|
||||||
## Repositories Involved<a name="section1371113476307"></a>
|
## Repositories Involved<a name="section1371113476307"></a>
|
||||||
|
|
||||||
|
@ -95,5 +95,5 @@ For details about how to develop the first application, see:
|
||||||
|
|
||||||
[drivers\_liteos](https://gitee.com/openharmony/drivers_liteos/blob/master/README.md)
|
[drivers\_liteos](https://gitee.com/openharmony/drivers_liteos/blob/master/README.md)
|
||||||
|
|
||||||
**kernel\_liteos\_a**
|
[kernel\_liteos\_a](https://gitee.com/openharmony/kernel_liteos_a/blob/master/README.md)
|
||||||
|
|
||||||
|
|
|
@ -95,4 +95,4 @@ OpenHarmony LiteOS-A內核支持Hi3518EV300([介紹](https://gitee.com/openhar
|
||||||
|
|
||||||
[drivers\_liteos](https://gitee.com/openharmony/drivers_liteos/blob/master/README_zh.md)
|
[drivers\_liteos](https://gitee.com/openharmony/drivers_liteos/blob/master/README_zh.md)
|
||||||
|
|
||||||
**kernel\_liteos\_a**
|
[kernel\_liteos\_a](https://gitee.com/openharmony/kernel_liteos_a/blob/master/README_zh-HK.md)
|
||||||
|
|
|
@ -94,5 +94,5 @@ OpenHarmony LiteOS-A内核支持Hi3518EV300([介绍](https://gitee.com/openhar
|
||||||
|
|
||||||
[drivers\_liteos](https://gitee.com/openharmony/drivers_liteos/blob/master/README_zh.md)
|
[drivers\_liteos](https://gitee.com/openharmony/drivers_liteos/blob/master/README_zh.md)
|
||||||
|
|
||||||
**kernel\_liteos\_a**
|
[kernel\_liteos\_a](https://gitee.com/openharmony/kernel_liteos_a/blob/master/README_zh.md)
|
||||||
|
|
||||||
|
|
|
@ -48,6 +48,7 @@
|
||||||
#endif
|
#endif
|
||||||
int main(int argc, char * const *argv)
|
int main(int argc, char * const *argv)
|
||||||
{
|
{
|
||||||
|
(void)argv;
|
||||||
int ret;
|
int ret;
|
||||||
pid_t gid;
|
pid_t gid;
|
||||||
const char *shellPath = "/bin/mksh";
|
const char *shellPath = "/bin/mksh";
|
||||||
|
|
|
@ -36,7 +36,6 @@
|
||||||
#include "dirent.h"
|
#include "dirent.h"
|
||||||
#include "securec.h"
|
#include "securec.h"
|
||||||
|
|
||||||
|
|
||||||
#define SHELL_INIT_MAGIC_FLAG 0xABABABAB
|
#define SHELL_INIT_MAGIC_FLAG 0xABABABAB
|
||||||
#define CTRL_C 0x03 /* 0x03: ctrl+c ASCII */
|
#define CTRL_C 0x03 /* 0x03: ctrl+c ASCII */
|
||||||
|
|
||||||
|
@ -378,7 +377,7 @@ static int OsTabMatchFile(char *cmdKey, unsigned int *len)
|
||||||
* Description: Pass in the string and clear useless space ,which include:
|
* Description: Pass in the string and clear useless space ,which include:
|
||||||
* 1) The overmatch space which is not be marked by Quote's area
|
* 1) The overmatch space which is not be marked by Quote's area
|
||||||
* Squeeze the overmatch space into one space
|
* Squeeze the overmatch space into one space
|
||||||
* 2) Clear all space before first valid charatctor
|
* 2) Clear all space before first valid character
|
||||||
* Input: cmdKey : Pass in the buff string, which is ready to be operated
|
* Input: cmdKey : Pass in the buff string, which is ready to be operated
|
||||||
* cmdOut : Pass out the buffer string ,which has already been operated
|
* cmdOut : Pass out the buffer string ,which has already been operated
|
||||||
* size : cmdKey length
|
* size : cmdKey length
|
||||||
|
@ -407,17 +406,17 @@ unsigned int OsCmdKeyShift(const char *cmdKey, char *cmdOut, unsigned int size)
|
||||||
|
|
||||||
/* Backup the 'output' start address */
|
/* Backup the 'output' start address */
|
||||||
outputBak = output;
|
outputBak = output;
|
||||||
/* Scan each charactor in 'cmdKey',and squeeze the overmuch space and ignore invalid charactor */
|
/* Scan each character in 'cmdKey',and squeeze the overmuch space and ignore invalid character */
|
||||||
for (; *cmdKey != '\0'; cmdKey++) {
|
for (; *cmdKey != '\0'; cmdKey++) {
|
||||||
/* Detected a Double Quotes, switch the matching status */
|
/* Detected a Double Quotes, switch the matching status */
|
||||||
if (*(cmdKey) == '\"') {
|
if (*(cmdKey) == '\"') {
|
||||||
SWITCH_QUOTES_STATUS(quotes);
|
SWITCH_QUOTES_STATUS(quotes);
|
||||||
}
|
}
|
||||||
/* Ignore the current charactor in following situation */
|
/* Ignore the current character in following situation */
|
||||||
/* 1) Quotes matching status is FALSE (which said that the space is not been marked by double quotes) */
|
/* 1) Quotes matching status is FALSE (which said that the space is not been marked by double quotes) */
|
||||||
/* 2) Current charactor is a space */
|
/* 2) Current character is a space */
|
||||||
/* 3) Next charactor is a space too, or the string is been seeked to the end already(\0) */
|
/* 3) Next character is a space too, or the string is been seeked to the end already(\0) */
|
||||||
/* 4) Invalid charactor, such as single quotes */
|
/* 4) Invalid character, such as single quotes */
|
||||||
if ((*cmdKey == ' ') && ((*(cmdKey + 1) == ' ') || (*(cmdKey + 1) == '\0')) && QUOTES_STATUS_CLOSE(quotes)) {
|
if ((*cmdKey == ' ') && ((*(cmdKey + 1) == ' ') || (*(cmdKey + 1) == '\0')) && QUOTES_STATUS_CLOSE(quotes)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -431,7 +430,7 @@ unsigned int OsCmdKeyShift(const char *cmdKey, char *cmdOut, unsigned int size)
|
||||||
/* Restore the 'output' start address */
|
/* Restore the 'output' start address */
|
||||||
output = outputBak;
|
output = outputBak;
|
||||||
len = strlen(output);
|
len = strlen(output);
|
||||||
/* Clear the space which is located at the first charactor in buffer */
|
/* Clear the space which is located at the first character in buffer */
|
||||||
if (*output == ' ') {
|
if (*output == ' ') {
|
||||||
output++;
|
output++;
|
||||||
len--;
|
len--;
|
||||||
|
@ -585,7 +584,6 @@ END:
|
||||||
|
|
||||||
unsigned int OsCmdExec(CmdParsed *cmdParsed, char *cmdStr)
|
unsigned int OsCmdExec(CmdParsed *cmdParsed, char *cmdStr)
|
||||||
{
|
{
|
||||||
/* TODO: complete the usrspace command */
|
|
||||||
unsigned int ret = SH_OK;
|
unsigned int ret = SH_OK;
|
||||||
if (cmdParsed && cmdStr) {
|
if (cmdParsed && cmdStr) {
|
||||||
ret = SH_NOK;
|
ret = SH_NOK;
|
||||||
|
|
|
@ -334,12 +334,12 @@ char *GetCmdName(const char *cmdline, unsigned int len)
|
||||||
/* If reach a double quotes, switch the quotes matching status */
|
/* If reach a double quotes, switch the quotes matching status */
|
||||||
if (*tmpStr == '\"') {
|
if (*tmpStr == '\"') {
|
||||||
SWITCH_QUOTES_STATUS(quotes);
|
SWITCH_QUOTES_STATUS(quotes);
|
||||||
/* Ignore the double quote charactor itself */
|
/* Ignore the double quote character itself */
|
||||||
tmpStr++;
|
tmpStr++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
/* If detected a space which the quotes matching status is false */
|
/* If detected a space which the quotes matching status is false */
|
||||||
/* which said has detected the first space for seperator, finish this scan operation */
|
/* which said has detected the first space for separator, finish this scan operation */
|
||||||
if ((*tmpStr == ' ') && (QUOTES_STATUS_CLOSE(quotes))) {
|
if ((*tmpStr == ' ') && (QUOTES_STATUS_CLOSE(quotes))) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -503,7 +503,7 @@ unsigned int PreHandleCmdline(const char *input, char **output, unsigned int *ou
|
||||||
*output = shiftStr;
|
*output = shiftStr;
|
||||||
*outputlen = shiftLen;
|
*outputlen = shiftLen;
|
||||||
|
|
||||||
/* Check and parse "./", located at the first two charaters of the cmd */
|
/* Check and parse "./", located at the first two characters of the cmd */
|
||||||
if ((shiftLen > removeLen) && (shiftStr[0] == '.') && (shiftStr[1] == '/')) {
|
if ((shiftLen > removeLen) && (shiftStr[0] == '.') && (shiftStr[1] == '/')) {
|
||||||
execLen = strlen(execCmd);
|
execLen = strlen(execCmd);
|
||||||
newLen = execLen + shiftLen - removeLen; /* i.e., newLen - execLen == shiftLen - removeLen */
|
newLen = execLen + shiftLen - removeLen; /* i.e., newLen - execLen == shiftLen - removeLen */
|
||||||
|
|
|
@ -42,7 +42,7 @@ extern "C" {
|
||||||
|
|
||||||
#define TFTP_NULL_UINT32 ((u32_t)0xffffffffUL)
|
#define TFTP_NULL_UINT32 ((u32_t)0xffffffffUL)
|
||||||
|
|
||||||
#define TFTP_NULL_INT32 -1
|
#define TFTP_NULL_INT32 (-1)
|
||||||
|
|
||||||
/** @cond liteos
|
/** @cond liteos
|
||||||
* @defgroup TFTP_Interfaces
|
* @defgroup TFTP_Interfaces
|
||||||
|
@ -114,7 +114,7 @@ typedef enum tagTFTPC_OpCode {
|
||||||
TFTPC_OP_RRQ = 1, /* read request */
|
TFTPC_OP_RRQ = 1, /* read request */
|
||||||
TFTPC_OP_WRQ, /* write request */
|
TFTPC_OP_WRQ, /* write request */
|
||||||
TFTPC_OP_DATA, /* data packet */
|
TFTPC_OP_DATA, /* data packet */
|
||||||
TFTPC_OP_ACK, /* acknowledgement */
|
TFTPC_OP_ACK, /* acknowledgment */
|
||||||
TFTPC_OP_ERROR, /* error code */
|
TFTPC_OP_ERROR, /* error code */
|
||||||
TFTPC_OP_OPT /* option code */
|
TFTPC_OP_OPT /* option code */
|
||||||
} TFTPC_OPCODE_E;
|
} TFTPC_OPCODE_E;
|
||||||
|
|
|
@ -50,11 +50,11 @@ static char *TftpError[] = {
|
||||||
"Error while sending data to the peer\n",
|
"Error while sending data to the peer\n",
|
||||||
"Requested file is not found\n",
|
"Requested file is not found\n",
|
||||||
"This is the error sent by the server when hostname cannot be resolved\n",
|
"This is the error sent by the server when hostname cannot be resolved\n",
|
||||||
"Input paramters passed to TFTP interfaces are invalid\n",
|
"Input parameters passed to TFTP interfaces are invalid\n",
|
||||||
"Error detected in TFTP packet or the error received from the TFTP server\n",
|
"Error detected in TFTP packet or the error received from the TFTP server\n",
|
||||||
"Error during packet synhronization while sending or unexpected packet is received\n",
|
"Error during packet synhronization while sending or unexpected packet is received\n",
|
||||||
"File size limit crossed, Max block can be 0xFFFF, each block containing 512 bytes\n",
|
"File size limit crossed, Max block can be 0xFFFF, each block containing 512 bytes\n",
|
||||||
"File name lenght greater than 256\n",
|
"File name length greater than 256\n",
|
||||||
"Hostname IP is not valid\n",
|
"Hostname IP is not valid\n",
|
||||||
"TFTP server returned file access error\n",
|
"TFTP server returned file access error\n",
|
||||||
"TFTP server returned error signifying that the DISK is full to write\n",
|
"TFTP server returned error signifying that the DISK is full to write\n",
|
||||||
|
@ -66,11 +66,11 @@ static char *TftpError[] = {
|
||||||
"File create error\n",
|
"File create error\n",
|
||||||
"File write error\n",
|
"File write error\n",
|
||||||
"Max time expired while waiting for file to be recived\n",
|
"Max time expired while waiting for file to be recived\n",
|
||||||
"Error when the received packet is less than 4bytes(error lenght) or greater than 512bytes\n",
|
"Error when the received packet is less than 4bytes(error length) or greater than 512bytes\n",
|
||||||
"Returned by TFTP server for protocol user error\n",
|
"Returned by TFTP server for protocol user error\n",
|
||||||
"The destination file path length greater than 256\n",
|
"The destination file path length greater than 256\n",
|
||||||
"Returned by TFTP server for undefined transfer ID\n",
|
"Returned by TFTP server for undefined transfer ID\n",
|
||||||
"IOCTL fucntion failed at TFTP client while setting the socket to non-block\n",
|
"IOCTL function failed at TFTP client while setting the socket to non-block\n",
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifndef ARRAY_SIZE
|
#ifndef ARRAY_SIZE
|
||||||
|
|
|
@ -189,7 +189,7 @@ u32_t lwip_tftp_recv_from_server(s32_t iSockNum, u32_t *pulSize, TFTPC_PACKET_S
|
||||||
if (iRet == -1) {
|
if (iRet == -1) {
|
||||||
return TFTPC_SELECT_ERROR;
|
return TFTPC_SELECT_ERROR;
|
||||||
} else if (iRet == 0) {
|
} else if (iRet == 0) {
|
||||||
return TFTPC_TIMEOUT_ERROR; /* Select timeout occured */
|
return TFTPC_TIMEOUT_ERROR; /* Select timeout occurred */
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!FD_ISSET(iSockNum, &stReadfds)) {
|
if (!FD_ISSET(iSockNum, &stReadfds)) {
|
||||||
|
@ -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
|
||||||
|
@ -268,7 +268,7 @@ u32_t lwip_tftp_recv_from_server(s32_t iSockNum, u32_t *pulSize, TFTPC_PACKET_S
|
||||||
*pulSize = (u32_t)iRet;
|
*pulSize = (u32_t)iRet;
|
||||||
|
|
||||||
/* If received packet is first block of data(for get operation) or if
|
/* If received packet is first block of data(for get operation) or if
|
||||||
received packet is acknowledgement for write request (put operation)
|
received packet is acknowledgment for write request (put operation)
|
||||||
store the received port number */
|
store the received port number */
|
||||||
if (((usOpcode == TFTPC_OP_DATA) &&
|
if (((usOpcode == TFTPC_OP_DATA) &&
|
||||||
(ntohs(pstRecvBuf->u.stTFTP_Data.usBlknum) == 1)) ||
|
(ntohs(pstRecvBuf->u.stTFTP_Data.usBlknum) == 1)) ||
|
||||||
|
@ -687,7 +687,7 @@ u32_t lwip_tftp_get_file_by_filename(u32_t ulHostAddr,
|
||||||
|
|
||||||
ulErrCode = lwip_tftp_recv_from_server(iSockNum, &ulRecvSize, pstRecvBuf,
|
ulErrCode = lwip_tftp_recv_from_server(iSockNum, &ulRecvSize, pstRecvBuf,
|
||||||
&ulIgnorePkt, &stServerAddr, pstSendBuf);
|
&ulIgnorePkt, &stServerAddr, pstSendBuf);
|
||||||
/* If select timeout occured */
|
/* If select timeout occurred */
|
||||||
if (ulErrCode == TFTPC_TIMEOUT_ERROR) {
|
if (ulErrCode == TFTPC_TIMEOUT_ERROR) {
|
||||||
ulTotalTime++;
|
ulTotalTime++;
|
||||||
if (ulTotalTime < TFTPC_MAX_SEND_REQ_ATTEMPTS) {
|
if (ulTotalTime < TFTPC_MAX_SEND_REQ_ATTEMPTS) {
|
||||||
|
@ -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,
|
||||||
|
@ -982,7 +982,7 @@ u32_t lwip_tftp_put_file_by_filename(u32_t ulHostAddr, u16_t usTftpServPort, u8_
|
||||||
return TFTPC_MEMALLOC_ERROR;
|
return TFTPC_MEMALLOC_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* First time intialize the buffer */
|
/* First time initialize the buffer */
|
||||||
(void)memset_s((void *)pstSendBuf, sizeof(TFTPC_PACKET_S), 0, sizeof(TFTPC_PACKET_S));
|
(void)memset_s((void *)pstSendBuf, sizeof(TFTPC_PACKET_S), 0, sizeof(TFTPC_PACKET_S));
|
||||||
|
|
||||||
/* The destination path can only be one of the following:
|
/* The destination path can only be one of the following:
|
||||||
|
@ -1221,7 +1221,7 @@ u32_t lwip_tftp_inner_put_file(s32_t iSockNum,
|
||||||
return TFTPC_MEMALLOC_ERROR;
|
return TFTPC_MEMALLOC_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* First time intialize the buffer */
|
/* First time initialize the buffer */
|
||||||
(void)memset_s((void *)pstRecvBuf, sizeof(TFTPC_PACKET_S), 0, sizeof(TFTPC_PACKET_S));
|
(void)memset_s((void *)pstRecvBuf, sizeof(TFTPC_PACKET_S), 0, sizeof(TFTPC_PACKET_S));
|
||||||
|
|
||||||
/* Initialize from address to the server address at first */
|
/* Initialize from address to the server address at first */
|
||||||
|
@ -1235,7 +1235,7 @@ u32_t lwip_tftp_inner_put_file(s32_t iSockNum,
|
||||||
ulError = lwip_tftp_recv_from_server(iSockNum, &ulPktSize,
|
ulError = lwip_tftp_recv_from_server(iSockNum, &ulPktSize,
|
||||||
pstRecvBuf, &ulIgnorePkt,
|
pstRecvBuf, &ulIgnorePkt,
|
||||||
pstServerAddr, pstSendBuf);
|
pstServerAddr, pstSendBuf);
|
||||||
/* If select timeout occured */
|
/* If select timeout occurred */
|
||||||
if (ulError == TFTPC_TIMEOUT_ERROR) {
|
if (ulError == TFTPC_TIMEOUT_ERROR) {
|
||||||
ulTotalTime++;
|
ulTotalTime++;
|
||||||
if (ulTotalTime < TFTPC_MAX_SEND_REQ_ATTEMPTS) {
|
if (ulTotalTime < TFTPC_MAX_SEND_REQ_ATTEMPTS) {
|
||||||
|
@ -1526,7 +1526,7 @@ u32_t lwip_tftp_get_file_by_filename_to_rawmem(u32_t ulHostAddr,
|
||||||
|
|
||||||
ulErrCode = lwip_tftp_recv_from_server(iSockNum, &ulRecvSize, pstRecvBuf, &ulIgnorePkt,
|
ulErrCode = lwip_tftp_recv_from_server(iSockNum, &ulRecvSize, pstRecvBuf, &ulIgnorePkt,
|
||||||
&stServerAddr, pstSendBuf);
|
&stServerAddr, pstSendBuf);
|
||||||
/* If select timeout occured */
|
/* If select timeout occurred */
|
||||||
if (ulErrCode == TFTPC_TIMEOUT_ERROR) {
|
if (ulErrCode == TFTPC_TIMEOUT_ERROR) {
|
||||||
ulTotalTime++;
|
ulTotalTime++;
|
||||||
if (ulTotalTime < TFTPC_MAX_SEND_REQ_ATTEMPTS) {
|
if (ulTotalTime < TFTPC_MAX_SEND_REQ_ATTEMPTS) {
|
||||||
|
@ -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,
|
||||||
|
|
|
@ -246,7 +246,7 @@ STATIC INLINE INT32 LOS_AtomicIncRet(Atomic *v)
|
||||||
* @brief Atomic auto-decrement.
|
* @brief Atomic auto-decrement.
|
||||||
*
|
*
|
||||||
* @par Description:
|
* @par Description:
|
||||||
* This API is used to implementating the atomic auto-decrement.
|
* This API is used to implement the atomic auto-decrement.
|
||||||
* @attention
|
* @attention
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>The pointer v must not be NULL.</li>
|
* <li>The pointer v must not be NULL.</li>
|
||||||
|
@ -280,7 +280,7 @@ STATIC INLINE VOID LOS_AtomicDec(Atomic *v)
|
||||||
* @brief Atomic auto-decrement.
|
* @brief Atomic auto-decrement.
|
||||||
*
|
*
|
||||||
* @par Description:
|
* @par Description:
|
||||||
* This API is used to implementating the atomic auto-decrement and return the result of auto-decrement.
|
* This API is used to implement the atomic auto-decrement and return the result of auto-decrement.
|
||||||
* @attention
|
* @attention
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>The pointer v must not be NULL.</li>
|
* <li>The pointer v must not be NULL.</li>
|
||||||
|
@ -531,7 +531,7 @@ STATIC INLINE INT64 LOS_Atomic64IncRet(Atomic64 *v)
|
||||||
* @brief Atomic64 auto-decrement.
|
* @brief Atomic64 auto-decrement.
|
||||||
*
|
*
|
||||||
* @par Description:
|
* @par Description:
|
||||||
* This API is used to implementating the atomic64 auto-decrement.
|
* This API is used to implement the atomic64 auto-decrement.
|
||||||
* @attention
|
* @attention
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>The pointer v must not be NULL.</li>
|
* <li>The pointer v must not be NULL.</li>
|
||||||
|
@ -566,7 +566,7 @@ STATIC INLINE VOID LOS_Atomic64Dec(Atomic64 *v)
|
||||||
* @brief Atomic64 auto-decrement.
|
* @brief Atomic64 auto-decrement.
|
||||||
*
|
*
|
||||||
* @par Description:
|
* @par Description:
|
||||||
* This API is used to implementating the atomic64 auto-decrement and return the result of auto-decrement.
|
* This API is used to implement the atomic64 auto-decrement and return the result of auto-decrement.
|
||||||
* @attention
|
* @attention
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>The pointer v must not be NULL.</li>
|
* <li>The pointer v must not be NULL.</li>
|
||||||
|
|
|
@ -119,12 +119,12 @@ VOID HalIrqInit(VOID)
|
||||||
{
|
{
|
||||||
UINT32 i;
|
UINT32 i;
|
||||||
|
|
||||||
/* set externel interrupts to be level triggered, active low. */
|
/* set external interrupts to be level triggered, active low. */
|
||||||
for (i = 32; i < OS_HWI_MAX_NUM; i += 16) {
|
for (i = 32; i < OS_HWI_MAX_NUM; i += 16) {
|
||||||
GIC_REG_32(GICD_ICFGR(i / 16)) = 0;
|
GIC_REG_32(GICD_ICFGR(i / 16)) = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* set externel interrupts to CPU 0 */
|
/* set external interrupts to CPU 0 */
|
||||||
for (i = 32; i < OS_HWI_MAX_NUM; i += 4) {
|
for (i = 32; i < OS_HWI_MAX_NUM; i += 4) {
|
||||||
GIC_REG_32(GICD_ITARGETSR(i / 4)) = 0x01010101;
|
GIC_REG_32(GICD_ITARGETSR(i / 4)) = 0x01010101;
|
||||||
}
|
}
|
||||||
|
|
|
@ -362,7 +362,7 @@ VOID HalIrqInit(VOID)
|
||||||
GicWaitForRwp(GICD_CTLR);
|
GicWaitForRwp(GICD_CTLR);
|
||||||
ISB;
|
ISB;
|
||||||
|
|
||||||
/* set externel interrupts to be level triggered, active low. */
|
/* set external interrupts to be level triggered, active low. */
|
||||||
for (i = 32; i < OS_HWI_MAX_NUM; i += 16) {
|
for (i = 32; i < OS_HWI_MAX_NUM; i += 16) {
|
||||||
GIC_REG_32(GICD_ICFGR(i / 16)) = 0;
|
GIC_REG_32(GICD_ICFGR(i / 16)) = 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,8 +77,8 @@ enum {
|
||||||
#define GICD_PIDR2V3 (GICD_OFFSET + 0xffe8)
|
#define GICD_PIDR2V3 (GICD_OFFSET + 0xffe8)
|
||||||
|
|
||||||
#ifdef LOSCFG_ARCH_GIC_V3
|
#ifdef LOSCFG_ARCH_GIC_V3
|
||||||
#define GICD_IGRPMODR(n) (GICD_OFFSET + 0x0d00 + (n) * 4) /* Interrupt Group Mode Reisters */
|
#define GICD_IGRPMODR(n) (GICD_OFFSET + 0x0d00 + (n) * 4) /* Interrupt Group Mode Registers */
|
||||||
#define GICD_IROUTER(n) (GICD_OFFSET + 0x6000 + (n) * 8) /* Interrupt Rounter Reisters */
|
#define GICD_IROUTER(n) (GICD_OFFSET + 0x6000 + (n) * 8) /* Interrupt Rounter Registers */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define GIC_REG_8(reg) (*(volatile UINT8 *)((UINTPTR)(GIC_BASE_ADDR + (reg))))
|
#define GIC_REG_8(reg) (*(volatile UINT8 *)((UINTPTR)(GIC_BASE_ADDR + (reg))))
|
||||||
|
|
|
@ -71,7 +71,7 @@ extern "C" {
|
||||||
/* CONSTANTS */
|
/* CONSTANTS */
|
||||||
|
|
||||||
#define MQ_USE_MAGIC 0x89abcdef
|
#define MQ_USE_MAGIC 0x89abcdef
|
||||||
/* not suppurt prio */
|
/* not support prio */
|
||||||
#define MQ_PRIO_MAX 1
|
#define MQ_PRIO_MAX 1
|
||||||
|
|
||||||
typedef union send_receive_t {
|
typedef union send_receive_t {
|
||||||
|
@ -297,7 +297,7 @@ extern int mq_send(mqd_t personal, const char *msg, size_t msgLen, unsigned int
|
||||||
* <li><b>EAGAIN</b>: The message queue is empty.</li>
|
* <li><b>EAGAIN</b>: The message queue is empty.</li>
|
||||||
* <li><b>EINVAL</b>: invalid parameter.</li>
|
* <li><b>EINVAL</b>: invalid parameter.</li>
|
||||||
* <li><b>EMSGSIZE</b>: The message to be received is too long.</li>
|
* <li><b>EMSGSIZE</b>: The message to be received is too long.</li>
|
||||||
* <li><b>ETIMEDOUT</b>: The operaton times out.</li>
|
* <li><b>ETIMEDOUT</b>: The operation times out.</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
*
|
*
|
||||||
* @par Dependency:
|
* @par Dependency:
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void *calloc(size_t nitems, size_t size)
|
void *calloc(size_t nitems, size_t size)
|
||||||
{ /*lint !e578*/
|
{
|
||||||
size_t real_size;
|
size_t real_size;
|
||||||
void *ptr = NULL;
|
void *ptr = NULL;
|
||||||
|
|
||||||
|
@ -78,7 +78,7 @@ void free(void *ptr)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void *malloc(size_t size)
|
void *malloc(size_t size)
|
||||||
{ /*lint !e31 !e10*/
|
{
|
||||||
if (size == 0) {
|
if (size == 0) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -87,7 +87,7 @@ void *malloc(size_t size)
|
||||||
}
|
}
|
||||||
|
|
||||||
void *zalloc(size_t size)
|
void *zalloc(size_t size)
|
||||||
{ /*lint !e10*/
|
{
|
||||||
void *ptr = NULL;
|
void *ptr = NULL;
|
||||||
|
|
||||||
if (size == 0) {
|
if (size == 0) {
|
||||||
|
|
|
@ -647,7 +647,7 @@ int clock_getres(clockid_t clockID, struct timespec *tp)
|
||||||
case CLOCK_MONOTONIC_RAW:
|
case CLOCK_MONOTONIC_RAW:
|
||||||
case CLOCK_MONOTONIC:
|
case CLOCK_MONOTONIC:
|
||||||
case CLOCK_REALTIME:
|
case CLOCK_REALTIME:
|
||||||
/* the accessable rtc resolution */
|
/* the accessible rtc resolution */
|
||||||
tp->tv_nsec = OS_SYS_NS_PER_US; /* the precision of clock_gettime is 1us */
|
tp->tv_nsec = OS_SYS_NS_PER_US; /* the precision of clock_gettime is 1us */
|
||||||
tp->tv_sec = 0;
|
tp->tv_sec = 0;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -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" {
|
||||||
|
@ -253,7 +251,7 @@ struct disk_divide_info {
|
||||||
* </ul>
|
* </ul>
|
||||||
*
|
*
|
||||||
* @param diskName [IN] Type #const CHAR * disk driver name.
|
* @param diskName [IN] Type #const CHAR * disk driver name.
|
||||||
* @param bops [IN] Type #const struct block_operations * block driver control sturcture.
|
* @param bops [IN] Type #const struct block_operations * block driver control structure.
|
||||||
* @param priv [IN] Type #VOID * private data of vnode.
|
* @param priv [IN] Type #VOID * private data of vnode.
|
||||||
* @param diskID [IN] Type #INT32 disk id number, less than SYS_MAX_DISK.
|
* @param diskID [IN] Type #INT32 disk id number, less than SYS_MAX_DISK.
|
||||||
* @param info [IN] Type #VOID * disk driver partition information.
|
* @param info [IN] Type #VOID * disk driver partition information.
|
||||||
|
@ -712,7 +710,7 @@ INT32 los_alloc_diskid_byname(const CHAR *diskName);
|
||||||
* @brief get the INUSED disk id.
|
* @brief get the INUSED disk id.
|
||||||
*
|
*
|
||||||
* @par Description:
|
* @par Description:
|
||||||
* Get the correponding INUSED disk id by diskName.
|
* Get the corresponding INUSED disk id by diskName.
|
||||||
*
|
*
|
||||||
* @attention
|
* @attention
|
||||||
* <ul>
|
* <ul>
|
||||||
|
|
|
@ -107,7 +107,7 @@ INT32 los_alloc_diskid_byname(const CHAR *diskName)
|
||||||
size_t nameLen;
|
size_t nameLen;
|
||||||
|
|
||||||
if (diskName == NULL) {
|
if (diskName == NULL) {
|
||||||
PRINT_ERR("The paramter disk_name is NULL");
|
PRINT_ERR("The parameter disk_name is NULL");
|
||||||
return VFS_ERROR;
|
return VFS_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -163,7 +163,7 @@ INT32 los_get_diskid_byname(const CHAR *diskName)
|
||||||
size_t diskNameLen;
|
size_t diskNameLen;
|
||||||
|
|
||||||
if (diskName == NULL) {
|
if (diskName == NULL) {
|
||||||
PRINT_ERR("The paramter diskName is NULL");
|
PRINT_ERR("The parameter diskName is NULL");
|
||||||
return VFS_ERROR;
|
return VFS_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -756,7 +756,7 @@ INT32 DiskPartitionRegister(los_disk *disk)
|
||||||
los_part *part = NULL;
|
los_part *part = NULL;
|
||||||
struct disk_divide_info parInfo;
|
struct disk_divide_info parInfo;
|
||||||
|
|
||||||
/* Fill disk_divide_info structure to set partition's infomation. */
|
/* Fill disk_divide_info structure to set partition's information. */
|
||||||
(VOID)memset_s(parInfo.part, sizeof(parInfo.part), 0, sizeof(parInfo.part));
|
(VOID)memset_s(parInfo.part, sizeof(parInfo.part), 0, sizeof(parInfo.part));
|
||||||
partSize = sizeof(parInfo.part) / sizeof(parInfo.part[0]);
|
partSize = sizeof(parInfo.part) / sizeof(parInfo.part[0]);
|
||||||
|
|
||||||
|
@ -788,7 +788,7 @@ INT32 DiskPartitionRegister(los_disk *disk)
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < partSize; i++) {
|
for (i = 0; i < partSize; i++) {
|
||||||
/* Read the disk_divide_info structure to get partition's infomation. */
|
/* Read the disk_divide_info structure to get partition's information. */
|
||||||
if ((parInfo.part[i].type != 0) && (parInfo.part[i].type != EXTENDED_PAR) &&
|
if ((parInfo.part[i].type != 0) && (parInfo.part[i].type != EXTENDED_PAR) &&
|
||||||
(parInfo.part[i].type != EXTENDED_8G)) {
|
(parInfo.part[i].type != EXTENDED_8G)) {
|
||||||
part = get_part(DiskAddPart(disk, parInfo.part[i].sector_start, parInfo.part[i].sector_count, TRUE));
|
part = get_part(DiskAddPart(disk, parInfo.part[i].sector_start, parInfo.part[i].sector_count, TRUE));
|
||||||
|
|
|
@ -103,7 +103,7 @@ static ssize_t TraceWrite(struct file *filep, const char *buffer, size_t buflen)
|
||||||
if (info == NULL) {
|
if (info == NULL) {
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
memset_s(info, infoLen, 0, infoLen);
|
(void)memset_s(info, infoLen, 0, infoLen);
|
||||||
|
|
||||||
ret = LOS_CopyToKernel(info, infoLen, buffer, buflen);
|
ret = LOS_CopyToKernel(info, infoLen, buffer, buflen);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
|
|
|
@ -289,7 +289,7 @@ static INT32 BlockDriverRegisterOperate(mtd_partition *newNode,
|
||||||
if (ret) {
|
if (ret) {
|
||||||
free(newNode->blockdriver_name);
|
free(newNode->blockdriver_name);
|
||||||
newNode->blockdriver_name = NULL;
|
newNode->blockdriver_name = NULL;
|
||||||
PRINT_ERR("register blkdev partion error\n");
|
PRINT_ERR("register blkdev partition error\n");
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -322,7 +322,7 @@ static INT32 CharDriverRegisterOperate(mtd_partition *newNode,
|
||||||
|
|
||||||
ret = register_driver(newNode->chardriver_name, param->char_ops, RWE_RW_RW, newNode);
|
ret = register_driver(newNode->chardriver_name, param->char_ops, RWE_RW_RW, newNode);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
PRINT_ERR("register chardev partion error\n");
|
PRINT_ERR("register chardev partition error\n");
|
||||||
free(newNode->chardriver_name);
|
free(newNode->chardriver_name);
|
||||||
newNode->chardriver_name = NULL;
|
newNode->chardriver_name = NULL;
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -340,7 +340,7 @@ static INT32 BlockDriverUnregister(mtd_partition *node)
|
||||||
if (node->blockdriver_name != NULL) {
|
if (node->blockdriver_name != NULL) {
|
||||||
ret = unregister_blockdriver(node->blockdriver_name);
|
ret = unregister_blockdriver(node->blockdriver_name);
|
||||||
if (ret == -EBUSY) {
|
if (ret == -EBUSY) {
|
||||||
PRINT_ERR("unregister blkdev partion error:%d\n", ret);
|
PRINT_ERR("unregister blkdev partition error:%d\n", ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
free(node->blockdriver_name);
|
free(node->blockdriver_name);
|
||||||
|
@ -356,7 +356,7 @@ static INT32 CharDriverUnregister(mtd_partition *node)
|
||||||
if (node->chardriver_name != NULL) {
|
if (node->chardriver_name != NULL) {
|
||||||
ret = unregister_driver(node->chardriver_name);
|
ret = unregister_driver(node->chardriver_name);
|
||||||
if (ret == -EBUSY) {
|
if (ret == -EBUSY) {
|
||||||
PRINT_ERR("unregister chardev partion error:%d\n", ret);
|
PRINT_ERR("unregister chardev partition error:%d\n", ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
free(node->chardriver_name);
|
free(node->chardriver_name);
|
||||||
|
|
|
@ -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);
|
||||||
|
|
|
@ -319,7 +319,7 @@ FRESULT f_regvirfs(FATFS *fs)
|
||||||
|
|
||||||
/* Set the CHILD object field */
|
/* Set the CHILD object field */
|
||||||
for (i = 0; i < fs->vir_amount; i++) {
|
for (i = 0; i < fs->vir_amount; i++) {
|
||||||
pfs = ff_memalloc(sizeof(FATFS)); /* Allocate a memeory for current child FATFS object */
|
pfs = ff_memalloc(sizeof(FATFS)); /* Allocate a memory for current child FATFS object */
|
||||||
if (pfs == NULL) { /* If allocate failed, must call 'f_unregvirfs' to free the previous FATFS object memory */
|
if (pfs == NULL) { /* If allocate failed, must call 'f_unregvirfs' to free the previous FATFS object memory */
|
||||||
goto ERROUT;
|
goto ERROUT;
|
||||||
}
|
}
|
||||||
|
@ -500,7 +500,7 @@ static void FatfsSetChildClst(BYTE *work, FATFS *fs, WORD i)
|
||||||
* - FR_OK : The external SD configure is complete, all info has been set to the
|
* - FR_OK : The external SD configure is complete, all info has been set to the
|
||||||
* each CHILD FATFS
|
* each CHILD FATFS
|
||||||
* - FR_NOT_MATCHED : The virtual partition's configure does not matched as current setting
|
* - FR_NOT_MATCHED : The virtual partition's configure does not matched as current setting
|
||||||
* - FR_MODIFIED : The virtual partition's configure has been destoried partly or completely
|
* - FR_MODIFIED : The virtual partition's configure has been destroyed partly or completely
|
||||||
* - FR_NOVIRPART : The external SD has not been apllied as virtual partition yet
|
* - FR_NOVIRPART : The external SD has not been apllied as virtual partition yet
|
||||||
*
|
*
|
||||||
* Others Return Value:
|
* Others Return Value:
|
||||||
|
@ -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];
|
||||||
|
|
|
@ -98,7 +98,7 @@ extern char *rindex(const char *s, int c);
|
||||||
* @ingroup fs
|
* @ingroup fs
|
||||||
*
|
*
|
||||||
* @par Description:
|
* @par Description:
|
||||||
* The set_label() function shall set the value of a global varible,
|
* The set_label() function shall set the value of a global variable,
|
||||||
* the value will be used to set the label of SD card in format().
|
* the value will be used to set the label of SD card in format().
|
||||||
*
|
*
|
||||||
* @param name [IN] label to set, the length must be less than 12
|
* @param name [IN] label to set, the length must be less than 12
|
||||||
|
|
|
@ -60,7 +60,7 @@ typedef unsigned short fmode_t;
|
||||||
#define FMODE_64BITHASH ((fmode_t)0x400)
|
#define FMODE_64BITHASH ((fmode_t)0x400)
|
||||||
/* 32bit hashes as llseek() offset (for directories) */
|
/* 32bit hashes as llseek() offset (for directories) */
|
||||||
#define FMODE_32BITHASH ((fmode_t)0x200)
|
#define FMODE_32BITHASH ((fmode_t)0x200)
|
||||||
/* File is opened using open(.., 3, ..) and is writeable only for ioctls
|
/* File is opened using open(.., 3, ..) and is writable only for ioctls
|
||||||
* (specialy hack for floppy.c)
|
* (specialy hack for floppy.c)
|
||||||
*/
|
*/
|
||||||
#define FMODE_WRITE_IOCTL ((fmode_t)0x100)
|
#define FMODE_WRITE_IOCTL ((fmode_t)0x100)
|
||||||
|
|
|
@ -87,7 +87,7 @@ static struct ProcDirEntry *ProcFindNode(struct ProcDirEntry *parent, const char
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* descrition: find the file's handle
|
* description: find the file's handle
|
||||||
* path: the file of fullpath
|
* path: the file of fullpath
|
||||||
* return: the file of handle
|
* return: the file of handle
|
||||||
* add by ll
|
* add by ll
|
||||||
|
@ -519,7 +519,7 @@ int ProcOpen(struct ProcFile *procFile)
|
||||||
|
|
||||||
static int ProcRead(struct ProcDirEntry *pde, char *buf, size_t len)
|
static int ProcRead(struct ProcDirEntry *pde, char *buf, size_t len)
|
||||||
{
|
{
|
||||||
if (pde == NULL || pde == NULL || pde->pf == NULL) {
|
if (pde == NULL || pde->pf == NULL) {
|
||||||
return PROC_ERROR;
|
return PROC_ERROR;
|
||||||
}
|
}
|
||||||
struct ProcFile *procFile = pde->pf;
|
struct ProcFile *procFile = pde->pf;
|
||||||
|
|
|
@ -351,7 +351,7 @@ static INT32 BcacheSyncBlock(OsBcache *bc, OsBcacheBlock *block)
|
||||||
UINT32 len, start, end;
|
UINT32 len, start, end;
|
||||||
|
|
||||||
if (block->modified == TRUE) {
|
if (block->modified == TRUE) {
|
||||||
D(("bcache writting block = %llu\n", block->num));
|
D(("bcache writing block = %llu\n", block->num));
|
||||||
|
|
||||||
ret = FindFlagPos(block->flag, bc->sectorPerBlock >> UNINT_LOG2_SHIFT, &start, &end);
|
ret = FindFlagPos(block->flag, bc->sectorPerBlock >> UNINT_LOG2_SHIFT, &start, &end);
|
||||||
if (ret == ENOERR) {
|
if (ret == ENOERR) {
|
||||||
|
@ -932,7 +932,7 @@ INT32 BlockCacheWrite(OsBcache *bc, const UINT8 *buf, UINT32 *len, UINT64 sector
|
||||||
bc->modifiedBlock++;
|
bc->modifiedBlock++;
|
||||||
}
|
}
|
||||||
if ((pos == 0) && (currentSize == bc->blockSize)) {
|
if ((pos == 0) && (currentSize == bc->blockSize)) {
|
||||||
memset_s(block->flag, sizeof(block->flag), 0xFF, sizeof(block->flag));
|
(void)memset_s(block->flag, sizeof(block->flag), 0xFF, sizeof(block->flag));
|
||||||
block->allDirty = TRUE;
|
block->allDirty = TRUE;
|
||||||
} else {
|
} else {
|
||||||
BcacheSetFlag(bc, block, (UINT32)pos, currentSize);
|
BcacheSetFlag(bc, block, (UINT32)pos, currentSize);
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -637,7 +637,7 @@ void ls(const char *pathname)
|
||||||
|
|
||||||
if (statInfo.st_mode & S_IFDIR) { /* list all directory and file */
|
if (statInfo.st_mode & S_IFDIR) { /* list all directory and file */
|
||||||
ret = LsDir((pathname == NULL) ? path : pathname);
|
ret = LsDir((pathname == NULL) ? path : pathname);
|
||||||
} else { /* show the file infomation */
|
} else { /* show the file information */
|
||||||
ret = LsFile(path);
|
ret = LsFile(path);
|
||||||
}
|
}
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
|
|
|
@ -176,7 +176,7 @@ STATIC ProcessGroup *OsFindProcessGroup(UINT32 gid)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PRINT_INFO("%s is find group : %u failed!\n", __FUNCTION__, gid);
|
PRINT_INFO("%s failed! group id = %u\n", __FUNCTION__, gid);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2002,6 +2002,8 @@ LITE_OS_SEC_TEXT VOID LOS_Exit(INT32 status)
|
||||||
{
|
{
|
||||||
UINT32 intSave;
|
UINT32 intSave;
|
||||||
|
|
||||||
|
(void)status;
|
||||||
|
|
||||||
/* The exit of a kernel - state process must be kernel - state and all threads must actively exit */
|
/* The exit of a kernel - state process must be kernel - state and all threads must actively exit */
|
||||||
LosProcessCB *processCB = OsCurrProcessGet();
|
LosProcessCB *processCB = OsCurrProcessGet();
|
||||||
SCHEDULER_LOCK(intSave);
|
SCHEDULER_LOCK(intSave);
|
||||||
|
|
|
@ -278,7 +278,7 @@ LITE_OS_SEC_TEXT UINT32 OsSwtmrGetNextTimeout(VOID)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Description: Stop of Software Timer interface
|
* Description: Stop of Software Timer interface
|
||||||
* Input : swtmr --- the software timer contrl handler
|
* Input : swtmr --- the software timer control handler
|
||||||
*/
|
*/
|
||||||
LITE_OS_SEC_TEXT STATIC VOID OsSwtmrStop(SWTMR_CTRL_S *swtmr)
|
LITE_OS_SEC_TEXT STATIC VOID OsSwtmrStop(SWTMR_CTRL_S *swtmr)
|
||||||
{
|
{
|
||||||
|
@ -292,7 +292,7 @@ LITE_OS_SEC_TEXT STATIC VOID OsSwtmrStop(SWTMR_CTRL_S *swtmr)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Description: Get next software timer expiretime
|
* Description: Get next software timer expiretime
|
||||||
* Input : swtmr --- the software timer contrl handler
|
* Input : swtmr --- the software timer control handler
|
||||||
*/
|
*/
|
||||||
LITE_OS_SEC_TEXT STATIC UINT32 OsSwtmrTimeGet(const SWTMR_CTRL_S *swtmr)
|
LITE_OS_SEC_TEXT STATIC UINT32 OsSwtmrTimeGet(const SWTMR_CTRL_S *swtmr)
|
||||||
{
|
{
|
||||||
|
|
|
@ -277,7 +277,7 @@ STATIC INLINE UINT32 OsTaskSyncWait(const LosTaskCB *taskCB)
|
||||||
/*
|
/*
|
||||||
* gc soft timer works every OS_MP_GC_PERIOD period, to prevent this timer
|
* gc soft timer works every OS_MP_GC_PERIOD period, to prevent this timer
|
||||||
* triggered right at the timeout has reached, we set the timeout as double
|
* triggered right at the timeout has reached, we set the timeout as double
|
||||||
* of the gc peroid.
|
* of the gc period.
|
||||||
*/
|
*/
|
||||||
if (LOS_SemPend(taskCB->syncSignal, OS_MP_GC_PERIOD * 2) != LOS_OK) {
|
if (LOS_SemPend(taskCB->syncSignal, OS_MP_GC_PERIOD * 2) != LOS_OK) {
|
||||||
ret = LOS_ERRNO_TSK_MP_SYNC_FAILED;
|
ret = LOS_ERRNO_TSK_MP_SYNC_FAILED;
|
||||||
|
|
|
@ -138,28 +138,28 @@ STATIC INLINE BOOL OsSchedIsLock(VOID)
|
||||||
return (OsSchedRunQue()->taskLockCnt != 0);
|
return (OsSchedRunQue()->taskLockCnt != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check if preemptable with counter flag */
|
/* Check if preemptible with counter flag */
|
||||||
STATIC INLINE BOOL OsPreemptable(VOID)
|
STATIC INLINE BOOL OsPreemptable(VOID)
|
||||||
{
|
{
|
||||||
SchedRunQue *rq = OsSchedRunQue();
|
SchedRunQue *rq = OsSchedRunQue();
|
||||||
/*
|
/*
|
||||||
* Unlike OsPreemptableInSched, the int may be not disabled when OsPreemptable
|
* Unlike OsPreemptableInSched, the int may be not disabled when OsPreemptable
|
||||||
* is called, needs mannually disable interrupt, to prevent current task from
|
* is called, needs manually disable interrupt, to prevent current task from
|
||||||
* being migrated to another core, and get the wrong preeptable status.
|
* being migrated to another core, and get the wrong preemptable status.
|
||||||
*/
|
*/
|
||||||
UINT32 intSave = LOS_IntLock();
|
UINT32 intSave = LOS_IntLock();
|
||||||
BOOL preemptable = (rq->taskLockCnt == 0);
|
BOOL preemptible = (rq->taskLockCnt == 0);
|
||||||
if (!preemptable) {
|
if (!preemptible) {
|
||||||
/* Set schedule flag if preemption is disabled */
|
/* Set schedule flag if preemption is disabled */
|
||||||
rq->schedFlag |= INT_PEND_RESCH;
|
rq->schedFlag |= INT_PEND_RESCH;
|
||||||
}
|
}
|
||||||
LOS_IntRestore(intSave);
|
LOS_IntRestore(intSave);
|
||||||
return preemptable;
|
return preemptible;
|
||||||
}
|
}
|
||||||
|
|
||||||
STATIC INLINE BOOL OsPreemptableInSched(VOID)
|
STATIC INLINE BOOL OsPreemptableInSched(VOID)
|
||||||
{
|
{
|
||||||
BOOL preemptable = FALSE;
|
BOOL preemptible = FALSE;
|
||||||
SchedRunQue *rq = OsSchedRunQue();
|
SchedRunQue *rq = OsSchedRunQue();
|
||||||
|
|
||||||
#ifdef LOSCFG_KERNEL_SMP
|
#ifdef LOSCFG_KERNEL_SMP
|
||||||
|
@ -167,17 +167,17 @@ STATIC INLINE BOOL OsPreemptableInSched(VOID)
|
||||||
* For smp systems, schedule must hold the task spinlock, and this counter
|
* For smp systems, schedule must hold the task spinlock, and this counter
|
||||||
* will increase by 1 in that case.
|
* will increase by 1 in that case.
|
||||||
*/
|
*/
|
||||||
preemptable = (rq->taskLockCnt == 1);
|
preemptible = (rq->taskLockCnt == 1);
|
||||||
|
|
||||||
#else
|
#else
|
||||||
preemptable = (rq->taskLockCnt == 0);
|
preemptible = (rq->taskLockCnt == 0);
|
||||||
#endif
|
#endif
|
||||||
if (!preemptable) {
|
if (!preemptible) {
|
||||||
/* Set schedule flag if preemption is disabled */
|
/* Set schedule flag if preemption is disabled */
|
||||||
rq->schedFlag |= INT_PEND_RESCH;
|
rq->schedFlag |= INT_PEND_RESCH;
|
||||||
}
|
}
|
||||||
|
|
||||||
return preemptable;
|
return preemptible;
|
||||||
}
|
}
|
||||||
|
|
||||||
STATIC INLINE UINT32 OsSchedGetRunQueIdle(VOID)
|
STATIC INLINE UINT32 OsSchedGetRunQueIdle(VOID)
|
||||||
|
|
|
@ -48,7 +48,7 @@ typedef struct {
|
||||||
} StackInfo;
|
} StackInfo;
|
||||||
|
|
||||||
#define OS_INVALID_WATERLINE 0xFFFFFFFF
|
#define OS_INVALID_WATERLINE 0xFFFFFFFF
|
||||||
#define OS_STACK_MAGIC_CHECK(topstack) (*(UINTPTR *)(topstack) == OS_STACK_MAGIC_WORD) /* 1:magic valid 0:unvalid */
|
#define OS_STACK_MAGIC_CHECK(topstack) (*(UINTPTR *)(topstack) == OS_STACK_MAGIC_WORD) /* 1:magic valid 0:invalid */
|
||||||
|
|
||||||
extern VOID OsExcStackInfo(VOID);
|
extern VOID OsExcStackInfo(VOID);
|
||||||
extern VOID OsExcStackInfoReg(const StackInfo *stackInfo, UINT32 stackNum);
|
extern VOID OsExcStackInfoReg(const StackInfo *stackInfo, UINT32 stackNum);
|
||||||
|
|
|
@ -43,9 +43,9 @@ extern "C" {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ingroup los_task
|
* @ingroup los_task
|
||||||
* Define task siginal types.
|
* Define task signal types.
|
||||||
*
|
*
|
||||||
* Task siginal types.
|
* Task signal types.
|
||||||
*/
|
*/
|
||||||
#define SIGNAL_NONE 0U
|
#define SIGNAL_NONE 0U
|
||||||
#define SIGNAL_KILL (1U << 0)
|
#define SIGNAL_KILL (1U << 0)
|
||||||
|
|
|
@ -82,7 +82,7 @@ VOID OsQueueDbgUpdate(UINT32 queueID, TSK_ENTRY_FUNC entry)
|
||||||
STATIC INLINE VOID OsQueueInfoOutPut(const LosQueueCB *node)
|
STATIC INLINE VOID OsQueueInfoOutPut(const LosQueueCB *node)
|
||||||
{
|
{
|
||||||
PRINTK("Queue ID <0x%x> may leak, queue len is 0x%x, "
|
PRINTK("Queue ID <0x%x> may leak, queue len is 0x%x, "
|
||||||
"readable cnt:0x%x, writeable cnt:0x%x, ",
|
"readable cnt:0x%x, writable cnt:0x%x, ",
|
||||||
node->queueID,
|
node->queueID,
|
||||||
node->queueLen,
|
node->queueLen,
|
||||||
node->readWriteableCnt[OS_QUEUE_READ],
|
node->readWriteableCnt[OS_QUEUE_READ],
|
||||||
|
|
|
@ -93,7 +93,7 @@ LITE_OS_SEC_TEXT_INIT UINT32 LOS_MemboxInit(VOID *pool, UINT32 poolSize, UINT32
|
||||||
}
|
}
|
||||||
|
|
||||||
MEMBOX_LOCK(intSave);
|
MEMBOX_LOCK(intSave);
|
||||||
boxInfo->uwBlkSize = LOS_MEMBOX_ALLIGNED(blkSize + OS_MEMBOX_NODE_HEAD_SIZE);
|
boxInfo->uwBlkSize = LOS_MEMBOX_ALIGNED(blkSize + OS_MEMBOX_NODE_HEAD_SIZE);
|
||||||
boxInfo->uwBlkNum = (poolSize - sizeof(LOS_MEMBOX_INFO)) / boxInfo->uwBlkSize;
|
boxInfo->uwBlkNum = (poolSize - sizeof(LOS_MEMBOX_INFO)) / boxInfo->uwBlkSize;
|
||||||
boxInfo->uwBlkCnt = 0;
|
boxInfo->uwBlkCnt = 0;
|
||||||
if (boxInfo->uwBlkNum == 0) {
|
if (boxInfo->uwBlkNum == 0) {
|
||||||
|
|
|
@ -169,7 +169,7 @@ struct OsMemPoolHead {
|
||||||
|
|
||||||
/* The memory pool support expand. */
|
/* The memory pool support expand. */
|
||||||
#define OS_MEM_POOL_EXPAND_ENABLE 0x01
|
#define OS_MEM_POOL_EXPAND_ENABLE 0x01
|
||||||
/* The memory pool ssupport no lock. */
|
/* The memory pool support no lock. */
|
||||||
#define OS_MEM_POOL_LOCK_ENABLE 0x02
|
#define OS_MEM_POOL_LOCK_ENABLE 0x02
|
||||||
|
|
||||||
#define OS_MEM_NODE_MAGIC 0xABCDDCBA
|
#define OS_MEM_NODE_MAGIC 0xABCDDCBA
|
||||||
|
@ -486,7 +486,7 @@ STATIC INLINE VOID OsLmsAllocAlignMark(VOID *ptr, VOID *alignedPtr, UINT32 size)
|
||||||
g_lms->simpleMark((UINTPTR)ptr + sizeof(UINT32), (UINTPTR)alignedPtr, LMS_SHADOW_REDZONE_U8);
|
g_lms->simpleMark((UINTPTR)ptr + sizeof(UINT32), (UINTPTR)alignedPtr, LMS_SHADOW_REDZONE_U8);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* mark remining as redzone */
|
/* mark remaining as redzone */
|
||||||
g_lms->simpleMark(LMS_ADDR_ALIGN((UINTPTR)alignedPtr + size), (UINTPTR)OS_MEM_NEXT_NODE(allocNode),
|
g_lms->simpleMark(LMS_ADDR_ALIGN((UINTPTR)alignedPtr + size), (UINTPTR)OS_MEM_NEXT_NODE(allocNode),
|
||||||
LMS_SHADOW_REDZONE_U8);
|
LMS_SHADOW_REDZONE_U8);
|
||||||
}
|
}
|
||||||
|
@ -1804,7 +1804,7 @@ STATIC VOID OsMemIntegrityCheckError(struct OsMemPoolHead *pool,
|
||||||
tmpNode, preNode, taskCB->taskName);
|
tmpNode, preNode, taskCB->taskName);
|
||||||
#else
|
#else
|
||||||
MEM_UNLOCK(pool, intSave);
|
MEM_UNLOCK(pool, intSave);
|
||||||
LOS_Panic("Memory interity check error, cur node: %#x, pre node: %#x\n", tmpNode, preNode);
|
LOS_Panic("Memory integrity check error, cur node: %#x, pre node: %#x\n", tmpNode, preNode);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
|
@ -87,7 +87,7 @@ STATIC INLINE CHAR *OsLockDepErrorStringGet(enum LockDepErrType type)
|
||||||
errorString = "lockdep overflow";
|
errorString = "lockdep overflow";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
errorString = "unknow error code";
|
errorString = "unknown error code";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -142,7 +142,7 @@ STATIC VOID OsLockDepDumpLock(const LosTaskCB *task, const SPIN_LOCK_S *lock,
|
||||||
OsPrintLockDepInfo("task name : %s\n", temp->taskName);
|
OsPrintLockDepInfo("task name : %s\n", temp->taskName);
|
||||||
OsPrintLockDepInfo("task id : %u\n", temp->taskID);
|
OsPrintLockDepInfo("task id : %u\n", temp->taskID);
|
||||||
OsPrintLockDepInfo("cpu num : %u\n", temp->currCpu);
|
OsPrintLockDepInfo("cpu num : %u\n", temp->currCpu);
|
||||||
OsPrintLockDepInfo("start dumping lockdep infomation\n");
|
OsPrintLockDepInfo("start dumping lockdep information\n");
|
||||||
for (i = 0; i < lockDep->lockDepth; i++) {
|
for (i = 0; i < lockDep->lockDepth; i++) {
|
||||||
if (lockDep->heldLocks[i].lockPtr == lock) {
|
if (lockDep->heldLocks[i].lockPtr == lock) {
|
||||||
OsPrintLockDepInfo("[%d] %s <-- addr:0x%x\n", i, LOCKDEP_GET_NAME(lockDep, i),
|
OsPrintLockDepInfo("[%d] %s <-- addr:0x%x\n", i, LOCKDEP_GET_NAME(lockDep, i),
|
||||||
|
@ -165,7 +165,7 @@ STATIC VOID OsLockDepDumpLock(const LosTaskCB *task, const SPIN_LOCK_S *lock,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
STATIC BOOL OsLockDepCheckDependancy(const LosTaskCB *current, LosTaskCB *lockOwner)
|
STATIC BOOL OsLockDepCheckDependency(const LosTaskCB *current, LosTaskCB *lockOwner)
|
||||||
{
|
{
|
||||||
BOOL checkResult = TRUE;
|
BOOL checkResult = TRUE;
|
||||||
SPIN_LOCK_S *lockTemp = NULL;
|
SPIN_LOCK_S *lockTemp = NULL;
|
||||||
|
@ -217,7 +217,7 @@ VOID OsLockDepCheckIn(SPIN_LOCK_S *lock)
|
||||||
goto OUT;
|
goto OUT;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (OsLockDepCheckDependancy(current, lockOwner) != TRUE) {
|
if (OsLockDepCheckDependency(current, lockOwner) != TRUE) {
|
||||||
checkResult = LOCKDEP_ERR_DEAD_LOCK;
|
checkResult = LOCKDEP_ERR_DEAD_LOCK;
|
||||||
goto OUT;
|
goto OUT;
|
||||||
}
|
}
|
||||||
|
@ -313,7 +313,7 @@ VOID OsLockDepCheckOut(SPIN_LOCK_S *lock)
|
||||||
/* record lock holding time */
|
/* record lock holding time */
|
||||||
heldlocks[depth].holdTime = OsLockDepGetCycles() - heldlocks[depth].holdTime;
|
heldlocks[depth].holdTime = OsLockDepGetCycles() - heldlocks[depth].holdTime;
|
||||||
|
|
||||||
/* if unlock a older lock, needs move heldLock records */
|
/* if unlock an older lock, needs move heldLock records */
|
||||||
while (depth < lockDep->lockDepth - 1) {
|
while (depth < lockDep->lockDepth - 1) {
|
||||||
lockDep->heldLocks[depth] = lockDep->heldLocks[depth + 1];
|
lockDep->heldLocks[depth] = lockDep->heldLocks[depth + 1];
|
||||||
depth++;
|
depth++;
|
||||||
|
|
|
@ -322,16 +322,16 @@ CHAR *OsArchFlagsToStr(const UINT32 archFlags)
|
||||||
(VOID)memset_s(archMmuFlagsStr, flagSize, 0, flagSize);
|
(VOID)memset_s(archMmuFlagsStr, flagSize, 0, flagSize);
|
||||||
switch (cacheFlags) {
|
switch (cacheFlags) {
|
||||||
case 0UL:
|
case 0UL:
|
||||||
strcat_s(archMmuFlagsStr, flagSize, " CH\0");
|
(VOID)strcat_s(archMmuFlagsStr, flagSize, " CH\0");
|
||||||
break;
|
break;
|
||||||
case 1UL:
|
case 1UL:
|
||||||
strcat_s(archMmuFlagsStr, flagSize, " UC\0");
|
(VOID)strcat_s(archMmuFlagsStr, flagSize, " UC\0");
|
||||||
break;
|
break;
|
||||||
case 2UL:
|
case 2UL:
|
||||||
strcat_s(archMmuFlagsStr, flagSize, " UD\0");
|
(VOID)strcat_s(archMmuFlagsStr, flagSize, " UD\0");
|
||||||
break;
|
break;
|
||||||
case 3UL:
|
case 3UL:
|
||||||
strcat_s(archMmuFlagsStr, flagSize, " WC\0");
|
(VOID)strcat_s(archMmuFlagsStr, flagSize, " WC\0");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -462,7 +462,7 @@ LosVmMapRegion *OsCreateRegion(VADDR_T vaddr, size_t len, UINT32 regionFlags, un
|
||||||
return region;
|
return region;
|
||||||
}
|
}
|
||||||
|
|
||||||
memset_s(region, sizeof(LosVmMapRegion), 0, sizeof(LosVmMapRegion));
|
(void)memset_s(region, sizeof(LosVmMapRegion), 0, sizeof(LosVmMapRegion));
|
||||||
region->range.base = vaddr;
|
region->range.base = vaddr;
|
||||||
region->range.size = len;
|
region->range.size = len;
|
||||||
region->pgOff = offset;
|
region->pgOff = offset;
|
||||||
|
|
|
@ -387,7 +387,7 @@ STATUS_T OsMremapCheck(VADDR_T addr, size_t oldLen, VADDR_T newAddr, size_t newL
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* avoid new region overlaping with the old one */
|
/* avoid new region overlapping with the old one */
|
||||||
if (flags & MREMAP_FIXED) {
|
if (flags & MREMAP_FIXED) {
|
||||||
if (((region->range.base + region->range.size) > newAddr) &&
|
if (((region->range.base + region->range.size) > newAddr) &&
|
||||||
(region->range.base < (newAddr + newLen))) {
|
(region->range.base < (newAddr + newLen))) {
|
||||||
|
|
|
@ -88,7 +88,7 @@ INT32 GetFilepOps(const struct file *filep, struct file **privFilep, const struc
|
||||||
goto ERROUT;
|
goto ERROUT;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* to find console device's filep(now it is *privFilep) throught i_private */
|
/* to find console device's filep(now it is *privFilep) through i_private */
|
||||||
struct drv_data *drv = (struct drv_data *)filep->f_vnode->data;
|
struct drv_data *drv = (struct drv_data *)filep->f_vnode->data;
|
||||||
*privFilep = (struct file *)drv->priv;
|
*privFilep = (struct file *)drv->priv;
|
||||||
if (((*privFilep)->f_vnode == NULL) || ((*privFilep)->f_vnode->data == NULL)) {
|
if (((*privFilep)->f_vnode == NULL) || ((*privFilep)->f_vnode->data == NULL)) {
|
||||||
|
@ -1073,7 +1073,7 @@ STATIC INT32 OsConsoleDevInit(CONSOLE_CB *consoleCB, const CHAR *deviceName)
|
||||||
filep->f_path = NULL;
|
filep->f_path = NULL;
|
||||||
filep->f_priv = NULL;
|
filep->f_priv = NULL;
|
||||||
/*
|
/*
|
||||||
* Use filep to connect console and uart, we can find uart driver function throught filep.
|
* Use filep to connect console and uart, we can find uart driver function through filep.
|
||||||
* now we can operate /dev/console to operate /dev/ttyS0 through filep.
|
* now we can operate /dev/console to operate /dev/ttyS0 through filep.
|
||||||
*/
|
*/
|
||||||
devOps = (struct file_operations_vfs *)((struct drv_data*)vnode->data)->ops;
|
devOps = (struct file_operations_vfs *)((struct drv_data*)vnode->data)->ops;
|
||||||
|
@ -1325,7 +1325,9 @@ INT32 system_console_init(const CHAR *deviceName)
|
||||||
LOS_SpinLockSave(&g_consoleSpin, &intSave);
|
LOS_SpinLockSave(&g_consoleSpin, &intSave);
|
||||||
(VOID)OsConsoleDelete(consoleCB);
|
(VOID)OsConsoleDelete(consoleCB);
|
||||||
g_console[consoleID - 1] = NULL;
|
g_console[consoleID - 1] = NULL;
|
||||||
|
if (OsCurrTaskGet() != NULL) {
|
||||||
g_taskConsoleIDArray[OsCurrTaskGet()->taskID] = 0;
|
g_taskConsoleIDArray[OsCurrTaskGet()->taskID] = 0;
|
||||||
|
}
|
||||||
LOS_SpinUnlockRestore(&g_consoleSpin, intSave);
|
LOS_SpinUnlockRestore(&g_consoleSpin, intSave);
|
||||||
return VFS_ERROR;
|
return VFS_ERROR;
|
||||||
}
|
}
|
||||||
|
|
|
@ -182,11 +182,11 @@ 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);
|
||||||
}
|
}
|
||||||
|
|
||||||
LITE_OS_SEC_TEXT_INIT INT32 OsMain(VOID)
|
LITE_OS_SEC_TEXT_INIT UINT32 OsMain(VOID)
|
||||||
{
|
{
|
||||||
UINT32 ret;
|
UINT32 ret;
|
||||||
#ifdef LOS_INIT_STATISTICS
|
#ifdef LOS_INIT_STATISTICS
|
||||||
|
|
|
@ -453,7 +453,7 @@ typedef VOID (*log_read_write_fn)(UINT32 startAddr, UINT32 space, UINT32 rwFlag,
|
||||||
VOID LOS_ExcInfoRegHook(UINT32 startAddr, UINT32 space, CHAR *buf, log_read_write_fn hook);
|
VOID LOS_ExcInfoRegHook(UINT32 startAddr, UINT32 space, CHAR *buf, log_read_write_fn hook);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern INT32 OsMain(VOID);
|
extern UINT32 OsMain(VOID);
|
||||||
|
|
||||||
typedef VOID (*SystemRebootFunc)(VOID);
|
typedef VOID (*SystemRebootFunc)(VOID);
|
||||||
VOID OsSetRebootHook(SystemRebootFunc func);
|
VOID OsSetRebootHook(SystemRebootFunc func);
|
||||||
|
|
|
@ -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);
|
||||||
|
|
|
@ -34,11 +34,9 @@
|
||||||
|
|
||||||
LITE_OS_SEC_TEXT_INIT INT32 main(VOID)
|
LITE_OS_SEC_TEXT_INIT INT32 main(VOID)
|
||||||
{
|
{
|
||||||
UINT32 uwRet;
|
UINT32 ret = OsMain();
|
||||||
|
if (ret != LOS_OK) {
|
||||||
uwRet = OsMain();
|
return (INT32)LOS_NOK;
|
||||||
if (uwRet != LOS_OK) {
|
|
||||||
return LOS_NOK;
|
|
||||||
}
|
}
|
||||||
CPU_MAP_SET(0, OsHwIDGet());
|
CPU_MAP_SET(0, OsHwIDGet());
|
||||||
|
|
||||||
|
|
|
@ -284,8 +284,8 @@ LITE_OS_SEC_TEXT_MINOR STATIC VOID OsCpupGetPos(UINT16 mode, UINT16 *curPosPoint
|
||||||
curPos = CPUP_PRE_POS(tmpPos);
|
curPos = CPUP_PRE_POS(tmpPos);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The current postion has nothing to do with the CPUP modes,
|
* The current position has nothing to do with the CPUP modes,
|
||||||
* however, the previous postion differs.
|
* however, the previous position differs.
|
||||||
*/
|
*/
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
case CPUP_LAST_ONE_SECONDS:
|
case CPUP_LAST_ONE_SECONDS:
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -103,7 +103,7 @@ LITE_OS_SEC_TEXT_INIT UINT32 OsLiteIpcInit(VOID)
|
||||||
#if (USE_TASKID_AS_HANDLE == 1)
|
#if (USE_TASKID_AS_HANDLE == 1)
|
||||||
g_cmsTask.status = HANDLE_NOT_USED;
|
g_cmsTask.status = HANDLE_NOT_USED;
|
||||||
#else
|
#else
|
||||||
memset_s(g_serviceHandleMap, sizeof(g_serviceHandleMap), 0, sizeof(g_serviceHandleMap));
|
(void)memset_s(g_serviceHandleMap, sizeof(g_serviceHandleMap), 0, sizeof(g_serviceHandleMap));
|
||||||
#endif
|
#endif
|
||||||
ret = LOS_MuxInit(&g_serviceHandleMapMux, NULL);
|
ret = LOS_MuxInit(&g_serviceHandleMapMux, NULL);
|
||||||
if (ret != LOS_OK) {
|
if (ret != LOS_OK) {
|
||||||
|
@ -565,7 +565,7 @@ LITE_OS_SEC_TEXT STATIC UINT32 SendDeathMsg(UINT32 processID, UINT32 serviceHand
|
||||||
}
|
}
|
||||||
content.flag = SEND;
|
content.flag = SEND;
|
||||||
content.outMsg = &msg;
|
content.outMsg = &msg;
|
||||||
memset_s(content.outMsg, sizeof(IpcMsg), 0, sizeof(IpcMsg));
|
(void)memset_s(content.outMsg, sizeof(IpcMsg), 0, sizeof(IpcMsg));
|
||||||
content.outMsg->type = MT_DEATH_NOTIFY;
|
content.outMsg->type = MT_DEATH_NOTIFY;
|
||||||
content.outMsg->target.handle = ipcTaskID;
|
content.outMsg->target.handle = ipcTaskID;
|
||||||
content.outMsg->target.token = serviceHandle;
|
content.outMsg->target.token = serviceHandle;
|
||||||
|
@ -1161,7 +1161,7 @@ LITE_OS_SEC_TEXT STATIC UINT32 LiteIpcRead(IpcContent *content)
|
||||||
if (ret == LOS_OK) {
|
if (ret == LOS_OK) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (ret == -ENOENT) { /* It means that we've recieved a failed reply */
|
if (ret == -ENOENT) { /* It means that we've received a failed reply */
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1208,7 +1208,7 @@ LITE_OS_SEC_TEXT STATIC UINT32 LiteIpcMsgHandle(IpcContent *con)
|
||||||
}
|
}
|
||||||
content->outMsg = msg;
|
content->outMsg = msg;
|
||||||
if ((content->outMsg->type < 0) || (content->outMsg->type >= MT_DEATH_NOTIFY)) {
|
if ((content->outMsg->type < 0) || (content->outMsg->type >= MT_DEATH_NOTIFY)) {
|
||||||
PRINT_ERR("LiteIpc unknow msg type:%d\n", content->outMsg->type);
|
PRINT_ERR("LiteIpc unknown msg type:%d\n", content->outMsg->type);
|
||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
goto BUFFER_FREE;
|
goto BUFFER_FREE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -150,8 +150,8 @@ typedef struct {
|
||||||
VOID *data;
|
VOID *data;
|
||||||
UINT32 spObjNum;
|
UINT32 spObjNum;
|
||||||
VOID *offsets;
|
VOID *offsets;
|
||||||
UINT32 processID; /**< filled by kernel, processId of sender/reciever */
|
UINT32 processID; /**< filled by kernel, processId of sender/receiver */
|
||||||
UINT32 taskID; /**< filled by kernel, taskId of sender/reciever */
|
UINT32 taskID; /**< filled by kernel, taskId of sender/receiver */
|
||||||
#ifdef LOSCFG_SECURITY_CAPABILITY
|
#ifdef LOSCFG_SECURITY_CAPABILITY
|
||||||
UINT32 userID;
|
UINT32 userID;
|
||||||
UINT32 gid;
|
UINT32 gid;
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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)
|
||||||
|
|
|
@ -94,7 +94,7 @@ typedef struct {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ingroup los_trace
|
* @ingroup los_trace
|
||||||
* struct to store the event infomation
|
* struct to store the event information
|
||||||
*/
|
*/
|
||||||
typedef struct {
|
typedef struct {
|
||||||
UINT32 cmd; /* trace start or stop cmd */
|
UINT32 cmd; /* trace start or stop cmd */
|
||||||
|
|
|
@ -57,6 +57,9 @@ UINT32 SerialPipelineInit(VOID)
|
||||||
|
|
||||||
UINT32 SerialDataReceive(UINT8 *data, UINT32 size, UINT32 timeout)
|
UINT32 SerialDataReceive(UINT8 *data, UINT32 size, UINT32 timeout)
|
||||||
{
|
{
|
||||||
|
(VOID)data;
|
||||||
|
(VOID)size;
|
||||||
|
(VOID)timeout;
|
||||||
return LOS_OK;
|
return LOS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -187,7 +187,7 @@ STATIC VOID OsTraceInfoEventData(VOID)
|
||||||
UINT32 taskLockCnt = frame->core.taskLockCnt;
|
UINT32 taskLockCnt = frame->core.taskLockCnt;
|
||||||
#ifdef LOSCFG_KERNEL_SMP
|
#ifdef LOSCFG_KERNEL_SMP
|
||||||
/*
|
/*
|
||||||
* For smp systems, TRACE_LOCK will requst taskLock, and this counter
|
* For smp systems, TRACE_LOCK will request taskLock, and this counter
|
||||||
* will increase by 1 in that case.
|
* will increase by 1 in that case.
|
||||||
*/
|
*/
|
||||||
taskLockCnt -= 1;
|
taskLockCnt -= 1;
|
||||||
|
|
|
@ -1,3 +1,34 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
||||||
|
* Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without modification,
|
||||||
|
* are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||||
|
* conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||||
|
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||||
|
* provided with the distribution.
|
||||||
|
*
|
||||||
|
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
||||||
|
* to endorse or promote products derived from this software without specific prior written
|
||||||
|
* permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||||
|
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||||
|
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||||
|
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||||
|
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||||
|
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")
|
OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")
|
||||||
OUTPUT_ARCH(arm)
|
OUTPUT_ARCH(arm)
|
||||||
|
|
||||||
|
|
|
@ -90,10 +90,10 @@ extern VOID *LOS_SoLoad(CHAR *elfFileName);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ingroup dynload
|
* @ingroup dynload
|
||||||
* @brief Load a object file.
|
* @brief Load an object file.
|
||||||
*
|
*
|
||||||
* @par Description:
|
* @par Description:
|
||||||
* This API is used to load a object file under a particular module file path.
|
* This API is used to load an object file under a particular module file path.
|
||||||
* @attention
|
* @attention
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>The parameter passed to this API should be a legal path of an object file.</li>
|
* <li>The parameter passed to this API should be a legal path of an object file.</li>
|
||||||
|
|
|
@ -74,14 +74,14 @@ typedef LOS_MEMBOX_INFO OS_MEMBOX_S;
|
||||||
* @ingroup los_membox
|
* @ingroup los_membox
|
||||||
* Memory pool alignment
|
* Memory pool alignment
|
||||||
*/
|
*/
|
||||||
#define LOS_MEMBOX_ALLIGNED(memAddr) (((UINTPTR)(memAddr) + sizeof(UINTPTR) - 1) & (~(sizeof(UINTPTR) - 1)))
|
#define LOS_MEMBOX_ALIGNED(memAddr) (((UINTPTR)(memAddr) + sizeof(UINTPTR) - 1) & (~(sizeof(UINTPTR) - 1)))
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ingroup los_membox
|
* @ingroup los_membox
|
||||||
* Memory pool size
|
* Memory pool size
|
||||||
*/
|
*/
|
||||||
#define LOS_MEMBOX_SIZE(blkSize, blkNum) \
|
#define LOS_MEMBOX_SIZE(blkSize, blkNum) \
|
||||||
(sizeof(LOS_MEMBOX_INFO) + (LOS_MEMBOX_ALLIGNED((blkSize) + OS_MEMBOX_NODE_HEAD_SIZE) * (blkNum)))
|
(sizeof(LOS_MEMBOX_INFO) + (LOS_MEMBOX_ALIGNED((blkSize) + OS_MEMBOX_NODE_HEAD_SIZE) * (blkNum)))
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ingroup los_membox
|
* @ingroup los_membox
|
||||||
|
|
|
@ -59,7 +59,7 @@ extern "C" {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ingroup los_memory
|
* @ingroup los_memory
|
||||||
* The recored layers of function call.
|
* The recorded layers of function call.
|
||||||
*/
|
*/
|
||||||
#define LOS_RECORD_LR_CNT 3
|
#define LOS_RECORD_LR_CNT 3
|
||||||
#endif
|
#endif
|
||||||
|
@ -101,11 +101,11 @@ extern UINT32 LOS_MemDeInit(VOID *pool);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ingroup los_memory
|
* @ingroup los_memory
|
||||||
* @brief Print infomation about all pools.
|
* @brief Print information about all pools.
|
||||||
*
|
*
|
||||||
* @par Description:
|
* @par Description:
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>This API is used to print infomation about all pools.</li>
|
* <li>This API is used to print information about all pools.</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
*
|
*
|
||||||
* @retval #UINT32 The pool number.
|
* @retval #UINT32 The pool number.
|
||||||
|
@ -351,11 +351,11 @@ extern UINT32 LOS_MemTotalUsedGet(VOID *pool);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ingroup los_memory
|
* @ingroup los_memory
|
||||||
* @brief Get the infomation of memory pool.
|
* @brief Get the information of memory pool.
|
||||||
*
|
*
|
||||||
* @par Description:
|
* @par Description:
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>This API is used to get the infomation of memory pool.</li>
|
* <li>This API is used to get the information of memory pool.</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
* @attention
|
* @attention
|
||||||
* <ul>
|
* <ul>
|
||||||
|
@ -366,7 +366,7 @@ extern UINT32 LOS_MemTotalUsedGet(VOID *pool);
|
||||||
* @param poolStatus [IN] A pointer for storage the pool status
|
* @param poolStatus [IN] A pointer for storage the pool status
|
||||||
*
|
*
|
||||||
* @retval #LOS_NOK The incoming parameter pool is NULL or invalid.
|
* @retval #LOS_NOK The incoming parameter pool is NULL or invalid.
|
||||||
* @retval #LOS_OK Success to get memory infomation.
|
* @retval #LOS_OK Success to get memory information.
|
||||||
* @par Dependency:
|
* @par Dependency:
|
||||||
* <ul><li>los_memory.h: the header file that contains the API declaration.</li></ul>
|
* <ul><li>los_memory.h: the header file that contains the API declaration.</li></ul>
|
||||||
* @see None.
|
* @see None.
|
||||||
|
|
|
@ -80,7 +80,7 @@ typedef VOID (*pf_OUTPUT)(const CHAR *fmt, ...);
|
||||||
* <li>None</li>
|
* <li>None</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
*
|
*
|
||||||
* @param fmt [IN] Type char* controls the ouput as in C printf.
|
* @param fmt [IN] Type char* controls the output as in C printf.
|
||||||
*
|
*
|
||||||
* @retval None
|
* @retval None
|
||||||
* @par Dependency:
|
* @par Dependency:
|
||||||
|
|
|
@ -184,7 +184,7 @@ extern UINT32 LOS_RwlockTryRdLock(LosRwlock *rwlock);
|
||||||
* the task scheduling.</li>
|
* the task scheduling.</li>
|
||||||
* is disabled.</li>
|
* is disabled.</li>
|
||||||
* <li>Do not wait on a rwlock during an interrupt.</li>
|
* <li>Do not wait on a rwlock during an interrupt.</li>
|
||||||
* <li>The funtion fails when other tasks have the read or write lock.</li>
|
* <li>The function fails when other tasks have the read or write lock.</li>
|
||||||
* <li>A recursive rwlock can be locked more than once by the same thread.</li>
|
* <li>A recursive rwlock can be locked more than once by the same thread.</li>
|
||||||
* <li>Do not call this API in software timer callback. </li>
|
* <li>Do not call this API in software timer callback. </li>
|
||||||
* </ul>
|
* </ul>
|
||||||
|
@ -218,7 +218,7 @@ extern UINT32 LOS_RwlockWrLock(LosRwlock *rwlock, UINT32 timeout);
|
||||||
* when the task scheduling.</li>
|
* when the task scheduling.</li>
|
||||||
* is disabled.</li>
|
* is disabled.</li>
|
||||||
* <li>Do not wait on a rwlock during an interrupt.</li>
|
* <li>Do not wait on a rwlock during an interrupt.</li>
|
||||||
* <li>The funtion fails when other tasks have the read or write lock.</li>
|
* <li>The function fails when other tasks have the read or write lock.</li>
|
||||||
* <li>A recursive rwlock can be locked more than once by the same thread.</li>
|
* <li>A recursive rwlock can be locked more than once by the same thread.</li>
|
||||||
* <li>Do not call this API in software timer callback. </li>
|
* <li>Do not call this API in software timer callback. </li>
|
||||||
* </ul>
|
* </ul>
|
||||||
|
|
|
@ -221,7 +221,7 @@ extern "C" {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ingroup los_task
|
* @ingroup los_task
|
||||||
* Task error code: The task yeild occurs when the task is locked.
|
* Task error code: The task yield occurs when the task is locked.
|
||||||
* Value: 0x0200020f
|
* Value: 0x0200020f
|
||||||
*
|
*
|
||||||
* Solution: Check the task.
|
* Solution: Check the task.
|
||||||
|
@ -411,7 +411,7 @@ extern "C" {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ingroup los_task
|
* @ingroup los_task
|
||||||
* Task error code: Task yeild in int is not permited, which will result in unexpected result.
|
* Task error code: Task yield in int is not permited, which will result in unexpected result.
|
||||||
*
|
*
|
||||||
* Value: 0x02000224
|
* Value: 0x02000224
|
||||||
*
|
*
|
||||||
|
|
|
@ -235,7 +235,7 @@ typedef struct {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ingroup los_trace
|
* @ingroup los_trace
|
||||||
* struct to store the event infomation
|
* struct to store the event information
|
||||||
*/
|
*/
|
||||||
typedef struct {
|
typedef struct {
|
||||||
UINT32 eventType; /**< event type */
|
UINT32 eventType; /**< event type */
|
||||||
|
@ -331,9 +331,9 @@ extern TRACE_EVENT_HOOK g_traceEventHook;
|
||||||
* <li>The first param is treat as key, keep at least this param if you want trace this event.</li>
|
* <li>The first param is treat as key, keep at least this param if you want trace this event.</li>
|
||||||
* <li>All parameters were treated as UINTPTR.</li>
|
* <li>All parameters were treated as UINTPTR.</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
* eg. Trace a event as:
|
* eg. Trace an event as:
|
||||||
* #define TASK_PRIOSET_PARAMS(taskId, taskStatus, oldPrio, newPrio) taskId, taskStatus, oldPrio, newPrio
|
* #define TASK_PRIOSET_PARAMS(taskId, taskStatus, oldPrio, newPrio) taskId, taskStatus, oldPrio, newPrio
|
||||||
* eg. Not Trace a event as:
|
* eg. Not Trace an event as:
|
||||||
* #define TASK_PRIOSET_PARAMS(taskId, taskStatus, oldPrio, newPrio)
|
* #define TASK_PRIOSET_PARAMS(taskId, taskStatus, oldPrio, newPrio)
|
||||||
* eg. Trace only you need parmas as:
|
* eg. Trace only you need parmas as:
|
||||||
* #define TASK_PRIOSET_PARAMS(taskId, taskStatus, oldPrio, newPrio) taskId
|
* #define TASK_PRIOSET_PARAMS(taskId, taskStatus, oldPrio, newPrio) taskId
|
||||||
|
@ -377,8 +377,8 @@ extern TRACE_EVENT_HOOK g_traceEventHook;
|
||||||
#define QUEUE_CREATE_PARAMS(queueId, queueSz, itemSz, queueAddr, memType) \
|
#define QUEUE_CREATE_PARAMS(queueId, queueSz, itemSz, queueAddr, memType) \
|
||||||
queueId, queueSz, itemSz, queueAddr, memType
|
queueId, queueSz, itemSz, queueAddr, memType
|
||||||
#define QUEUE_DELETE_PARAMS(queueId, state, readable) queueId, state, readable
|
#define QUEUE_DELETE_PARAMS(queueId, state, readable) queueId, state, readable
|
||||||
#define QUEUE_RW_PARAMS(queueId, queueSize, bufSize, operateType, readable, writeable, timeout) \
|
#define QUEUE_RW_PARAMS(queueId, queueSize, bufSize, operateType, readable, writable, timeout) \
|
||||||
queueId, queueSize, bufSize, operateType, readable, writeable, timeout
|
queueId, queueSize, bufSize, operateType, readable, writable, timeout
|
||||||
|
|
||||||
#define SEM_CREATE_PARAMS(semId, type, count) semId, type, count
|
#define SEM_CREATE_PARAMS(semId, type, count) semId, type, count
|
||||||
#define SEM_DELETE_PARAMS(semId, delRetCode) semId, delRetCode
|
#define SEM_DELETE_PARAMS(semId, delRetCode) semId, delRetCode
|
||||||
|
|
|
@ -52,7 +52,7 @@ STATIC VOID OsRbLeftRotateNode(LosRbTree *pstTree, LosRbNode *pstX)
|
||||||
LosRbNode *pstNilT = NULL;
|
LosRbNode *pstNilT = NULL;
|
||||||
LosRbNode *pstParent = NULL;
|
LosRbNode *pstParent = NULL;
|
||||||
|
|
||||||
if (NULL == pstTree || NULL == pstX) {
|
if (pstTree == NULL || pstX == NULL) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
pstNilT = &(pstTree->stNilT);
|
pstNilT = &(pstTree->stNilT);
|
||||||
|
@ -132,11 +132,10 @@ STATIC VOID OsRbInsertNodeFixup(LosRbTree *pstTree, VOID *pstData)
|
||||||
LosRbNode *pstY = NULL;
|
LosRbNode *pstY = NULL;
|
||||||
LosRbNode *pstX = NULL;
|
LosRbNode *pstX = NULL;
|
||||||
|
|
||||||
/* begin: for erase pc-lint warning */
|
|
||||||
if ((NULL == pstTree) || (NULL == pstData)) {
|
if ((NULL == pstTree) || (NULL == pstData)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
/* end */
|
|
||||||
pstX = (LosRbNode *)pstData;
|
pstX = (LosRbNode *)pstData;
|
||||||
/* NilT is forbidden. */
|
/* NilT is forbidden. */
|
||||||
(pstTree->ulNodes)++;
|
(pstTree->ulNodes)++;
|
||||||
|
@ -183,14 +182,8 @@ STATIC VOID OsRbInsertNodeFixup(LosRbTree *pstTree, VOID *pstData)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* if we arrive here, pstTree is not NULL, sp we can close pc-lint warning */
|
|
||||||
/*lint -e613 */
|
|
||||||
/*lint -e831 */
|
|
||||||
pstTree->pstRoot->lColor = LOS_RB_BLACK;
|
pstTree->pstRoot->lColor = LOS_RB_BLACK;
|
||||||
|
|
||||||
/*lint -e613 */
|
|
||||||
/*lint -e831 */
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -271,11 +264,9 @@ STATIC VOID OsRbDeleteNode(LosRbTree *pstTree, VOID *pstData)
|
||||||
LosRbNode *pstZ = NULL;
|
LosRbNode *pstZ = NULL;
|
||||||
LOS_DL_LIST *pstNode = NULL;
|
LOS_DL_LIST *pstNode = NULL;
|
||||||
|
|
||||||
/* begin: for erase pc-lint warning */
|
|
||||||
if ((NULL == pstTree) || (NULL == pstData)) {
|
if ((NULL == pstTree) || (NULL == pstData)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
/* End */
|
|
||||||
|
|
||||||
pstZ = (LosRbNode *)pstData;
|
pstZ = (LosRbNode *)pstData;
|
||||||
pstNilT = &(pstTree->stNilT);
|
pstNilT = &(pstTree->stNilT);
|
||||||
|
@ -312,12 +303,7 @@ STATIC VOID OsRbDeleteNode(LosRbTree *pstTree, VOID *pstData)
|
||||||
pstChild->pstParent = pstZ->pstParent;
|
pstChild->pstParent = pstZ->pstParent;
|
||||||
|
|
||||||
if (pstNilT == pstZ->pstParent) {
|
if (pstNilT == pstZ->pstParent) {
|
||||||
/* if we arrive here, pstTree is no NULL, so we can close pclint warning */
|
|
||||||
/*lint -e613 */
|
|
||||||
/*lint -e831 */
|
|
||||||
pstTree->pstRoot = pstChild;
|
pstTree->pstRoot = pstChild;
|
||||||
/*lint +e831 */
|
|
||||||
/*lint +e613 */
|
|
||||||
} else {
|
} else {
|
||||||
if (pstZ->pstParent->pstLeft == pstZ) {
|
if (pstZ->pstParent->pstLeft == pstZ) {
|
||||||
pstZ->pstParent->pstLeft = pstChild;
|
pstZ->pstParent->pstLeft = pstChild;
|
||||||
|
@ -363,12 +349,7 @@ STATIC VOID OsRbDeleteNode(LosRbTree *pstTree, VOID *pstData)
|
||||||
|
|
||||||
if (pstNilT == pstZ->pstParent) {
|
if (pstNilT == pstZ->pstParent) {
|
||||||
/* In fact, we never go here. */
|
/* In fact, we never go here. */
|
||||||
/* if we arrive here, pstTree is no NULL, so we can close pclint warning */
|
|
||||||
/*lint -e613 */
|
|
||||||
/*lint -e831 */
|
|
||||||
pstTree->pstRoot = pstChild;
|
pstTree->pstRoot = pstChild;
|
||||||
/*lint +e831 */
|
|
||||||
/*lint +e613 */
|
|
||||||
} else {
|
} else {
|
||||||
if (pstZ->pstParent->pstLeft == pstZ) {
|
if (pstZ->pstParent->pstLeft == pstZ) {
|
||||||
pstZ->pstParent->pstLeft = pstChild;
|
pstZ->pstParent->pstLeft = pstChild;
|
||||||
|
@ -384,12 +365,8 @@ STATIC VOID OsRbDeleteNode(LosRbTree *pstTree, VOID *pstData)
|
||||||
pstZ->pstLeft = pstDel->pstLeft;
|
pstZ->pstLeft = pstDel->pstLeft;
|
||||||
|
|
||||||
if (pstNilT == pstDel->pstParent) {
|
if (pstNilT == pstDel->pstParent) {
|
||||||
/* if we arrive here, pstTree is no NULL, so we can close pclint warning */
|
/* if we arrive here, pstTree is no NULL */
|
||||||
/*lint -e613 */
|
|
||||||
/*lint -e831 */
|
|
||||||
pstTree->pstRoot = pstZ;
|
pstTree->pstRoot = pstZ;
|
||||||
/*lint +e831 */
|
|
||||||
/*lint +e613 */
|
|
||||||
} else {
|
} else {
|
||||||
if (pstDel->pstParent->pstLeft == pstDel) {
|
if (pstDel->pstParent->pstLeft == pstDel) {
|
||||||
pstDel->pstParent->pstLeft = pstZ;
|
pstDel->pstParent->pstLeft = pstZ;
|
||||||
|
@ -614,11 +591,9 @@ VOID *LOS_RbSuccessorNode(LosRbTree *pstTree, VOID *pstData)
|
||||||
LosRbNode *pstNilT = NULL;
|
LosRbNode *pstNilT = NULL;
|
||||||
LosRbNode *pstNode = NULL;
|
LosRbNode *pstNode = NULL;
|
||||||
|
|
||||||
/* begin: for erase pc_lint warning */
|
|
||||||
if (NULL == pstTree) {
|
if (NULL == pstTree) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
/* end */
|
|
||||||
|
|
||||||
pstNode = (LosRbNode *)pstData;
|
pstNode = (LosRbNode *)pstData;
|
||||||
|
|
||||||
|
@ -631,12 +606,8 @@ VOID *LOS_RbSuccessorNode(LosRbTree *pstTree, VOID *pstData)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* if we arrive here, pstTree is no NULL, so we can close pclint warning */
|
/* if we arrive here, pstTree is no NULL */
|
||||||
/*lint -e613 */
|
|
||||||
/*lint -e831 */
|
|
||||||
pstNilT = &(pstTree->stNilT);
|
pstNilT = &(pstTree->stNilT);
|
||||||
/*lint +e831 */
|
|
||||||
/*lint +e613 */
|
|
||||||
|
|
||||||
if (pstNilT != pstNode->pstRight) {
|
if (pstNilT != pstNode->pstRight) {
|
||||||
pstNode = pstNode->pstRight;
|
pstNode = pstNode->pstRight;
|
||||||
|
|
|
@ -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"
|
||||||
|
|
||||||
|
@ -168,7 +167,7 @@ typedef struct ping6_stats {
|
||||||
u32_t max_rtt;
|
u32_t max_rtt;
|
||||||
float avg_rtt;
|
float avg_rtt;
|
||||||
} ping6_stats_t;
|
} ping6_stats_t;
|
||||||
LWIP_STATIC void update_ping6_stats(ping6_stats_t *ping6_stats, u32_t rtt, u32_t nrecieved);
|
LWIP_STATIC void update_ping6_stats(ping6_stats_t *ping6_stats, u32_t rtt, u32_t nreceived);
|
||||||
LWIP_STATIC int parse_args_ping6(int argc, const char **argv, ping6_args_t *ping6_params);
|
LWIP_STATIC int parse_args_ping6(int argc, const char **argv, ping6_args_t *ping6_params);
|
||||||
|
|
||||||
u32_t osShellPing6(int argc, const char **argv);
|
u32_t osShellPing6(int argc, const char **argv);
|
||||||
|
@ -1750,7 +1749,7 @@ LWIP_STATIC int osPingFunc(u32_t destip, u32_t cnt, u32_t interval, u32_t data_l
|
||||||
PRINTK("\nPing: parameter problem ...");
|
PRINTK("\nPing: parameter problem ...");
|
||||||
break;
|
break;
|
||||||
default :
|
default :
|
||||||
PRINTK("\nPing: unknow error ...");
|
PRINTK("\nPing: unknown error ...");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
|
@ -2086,7 +2085,7 @@ u32_t osShellPing6(int argc, const char **argv)
|
||||||
u16_t icmpv6_seq;
|
u16_t icmpv6_seq;
|
||||||
u32_t nsent;
|
u32_t nsent;
|
||||||
u32_t nrecieve;
|
u32_t nrecieve;
|
||||||
u32_t last_recieved;
|
u32_t last_received;
|
||||||
struct timespec start, end, start_in_reply;
|
struct timespec start, end, start_in_reply;
|
||||||
struct timespec first, last;
|
struct timespec first, last;
|
||||||
long rtt;
|
long rtt;
|
||||||
|
@ -2170,7 +2169,7 @@ u32_t osShellPing6(int argc, const char **argv)
|
||||||
ping6_stats.avg_rtt = 0;
|
ping6_stats.avg_rtt = 0;
|
||||||
ping6_stats.max_rtt = 0;
|
ping6_stats.max_rtt = 0;
|
||||||
ping6_stats.min_rtt = 0;
|
ping6_stats.min_rtt = 0;
|
||||||
last_recieved = LWIP_PING6_STARTING_SEQ_NUM + LWIP_PING6_OUT_OF_ORDER_MAGNITUDE + 1;
|
last_received = LWIP_PING6_STARTING_SEQ_NUM + LWIP_PING6_OUT_OF_ORDER_MAGNITUDE + 1;
|
||||||
icmpv6_id = (u16_t)LWIP_RAND();
|
icmpv6_id = (u16_t)LWIP_RAND();
|
||||||
icmpv6_seq = LWIP_PING6_STARTING_SEQ_NUM;
|
icmpv6_seq = LWIP_PING6_STARTING_SEQ_NUM;
|
||||||
/* Setting the start time of the entire ping task for statistics */
|
/* Setting the start time of the entire ping task for statistics */
|
||||||
|
@ -2181,7 +2180,7 @@ u32_t osShellPing6(int argc, const char **argv)
|
||||||
for (nsent = 0; nsent < ping6_params.pingcount; nsent++) {
|
for (nsent = 0; nsent < ping6_params.pingcount; nsent++) {
|
||||||
/* capture the start tick to calculate rtt */
|
/* capture the start tick to calculate rtt */
|
||||||
(void)clock_gettime(CLOCK_MONOTONIC_RAW, &start);
|
(void)clock_gettime(CLOCK_MONOTONIC_RAW, &start);
|
||||||
/* Initialize Memory To Prevent Unintialized Memory Read Write Issues */
|
/* Initialize Memory To Prevent Uninitialized Memory Read Write Issues */
|
||||||
if (memset_s(pbuf_req->payload, pbuf_req->len, (int)(start.tv_nsec), pbuf_req->len) != 0) {
|
if (memset_s(pbuf_req->payload, pbuf_req->len, (int)(start.tv_nsec), pbuf_req->len) != 0) {
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
@ -2253,14 +2252,14 @@ u32_t osShellPing6(int argc, const char **argv)
|
||||||
}
|
}
|
||||||
/* Accept and process only those delayed EREP only if its sequence num is within out-of-order magnitude */
|
/* Accept and process only those delayed EREP only if its sequence num is within out-of-order magnitude */
|
||||||
if (nsent && iecho_resp->seqno != icmpv6_seq &&
|
if (nsent && iecho_resp->seqno != icmpv6_seq &&
|
||||||
(iecho_resp->seqno<(u16_t)(last_recieved - LWIP_PING6_OUT_OF_ORDER_MAGNITUDE) ||
|
(iecho_resp->seqno<(u16_t)(last_received - LWIP_PING6_OUT_OF_ORDER_MAGNITUDE) ||
|
||||||
iecho_resp->seqno>(u16_t)(
|
iecho_resp->seqno>(u16_t)(
|
||||||
last_recieved + LWIP_PING6_OUT_OF_ORDER_MAGNITUDE))) {
|
last_received + LWIP_PING6_OUT_OF_ORDER_MAGNITUDE))) {
|
||||||
/* Otherwise drop it and wait for more packets */
|
/* Otherwise drop it and wait for more packets */
|
||||||
goto REDUCE_SELECT_TIME;
|
goto REDUCE_SELECT_TIME;
|
||||||
}
|
}
|
||||||
++nrecieve;
|
++nrecieve;
|
||||||
last_recieved = iecho_resp->seqno;
|
last_received = iecho_resp->seqno;
|
||||||
/* Retrieving the start_tick from the packet which was embedded when the request was transmitted */
|
/* Retrieving the start_tick from the packet which was embedded when the request was transmitted */
|
||||||
(void)pbuf_header(pbuf_resp, (s16_t)(-(s16_t)(sizeof(struct icmp6_echo_hdr))));
|
(void)pbuf_header(pbuf_resp, (s16_t)(-(s16_t)(sizeof(struct icmp6_echo_hdr))));
|
||||||
if (memcpy_s((void *)&start_in_reply, sizeof(start_in_reply),
|
if (memcpy_s((void *)&start_in_reply, sizeof(start_in_reply),
|
||||||
|
@ -2314,7 +2313,7 @@ REDUCE_SELECT_TIME:
|
||||||
nsent, nrecieve, (float)(((float)(nsent - nrecieve)) * ((float)(100)) / ((float)(nsent))),
|
nsent, nrecieve, (float)(((float)(nsent - nrecieve)) * ((float)(100)) / ((float)(nsent))),
|
||||||
((last.tv_sec - first.tv_sec) * 1000 + (last.tv_nsec - first.tv_nsec) / 1000000));
|
((last.tv_sec - first.tv_sec) * 1000 + (last.tv_nsec - first.tv_nsec) / 1000000));
|
||||||
if (nrecieve) {
|
if (nrecieve) {
|
||||||
/* Display rtt stats only if atleast one packet is recieved */
|
/* Display rtt stats only if atleast one packet is received */
|
||||||
PRINTK("rtt min/avg/max = %u/%.2f/%u ms\n", ping6_stats.min_rtt, ping6_stats.avg_rtt, ping6_stats.max_rtt);
|
PRINTK("rtt min/avg/max = %u/%.2f/%u ms\n", ping6_stats.min_rtt, ping6_stats.avg_rtt, ping6_stats.max_rtt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2371,18 +2370,18 @@ LWIP_STATIC int create_ping6_socket(u8_t type, const void *param)
|
||||||
ret = lwip_setsockopt(sfd, SOL_SOCKET, SO_BINDTODEVICE, (char *)(param), strlen((char *)(param)));
|
ret = lwip_setsockopt(sfd, SOL_SOCKET, SO_BINDTODEVICE, (char *)(param), strlen((char *)(param)));
|
||||||
if (ret == -1) {
|
if (ret == -1) {
|
||||||
(void)lwip_close(sfd);
|
(void)lwip_close(sfd);
|
||||||
PRINTK("ping6: unknown iface %s\n", (char *)(param));
|
PRINTK("ping6: unknownn iface %s\n", (char *)(param));
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 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) {
|
||||||
|
@ -2550,7 +2549,7 @@ exit:
|
||||||
* Function to update ping6_stats
|
* Function to update ping6_stats
|
||||||
* stats is maintained in ping6_stats structure
|
* stats is maintained in ping6_stats structure
|
||||||
*/
|
*/
|
||||||
LWIP_STATIC void update_ping6_stats(ping6_stats_t *ping6_stats, u32_t rtt, u32_t nrecieved)
|
LWIP_STATIC void update_ping6_stats(ping6_stats_t *ping6_stats, u32_t rtt, u32_t nreceived)
|
||||||
{
|
{
|
||||||
if (rtt > ping6_stats->max_rtt) {
|
if (rtt > ping6_stats->max_rtt) {
|
||||||
ping6_stats->max_rtt = rtt;
|
ping6_stats->max_rtt = rtt;
|
||||||
|
@ -2562,7 +2561,7 @@ LWIP_STATIC void update_ping6_stats(ping6_stats_t *ping6_stats, u32_t rtt, u32_t
|
||||||
}
|
}
|
||||||
|
|
||||||
ping6_stats->avg_rtt = (float)(ping6_stats->avg_rtt +
|
ping6_stats->avg_rtt = (float)(ping6_stats->avg_rtt +
|
||||||
(float)((float)((float)rtt - ping6_stats->avg_rtt) / (float)(nrecieved)));
|
(float)((float)((float)rtt - ping6_stats->avg_rtt) / (float)(nreceived)));
|
||||||
}
|
}
|
||||||
|
|
||||||
LWIP_STATIC const char *convert_icmpv6_err_to_string(u8_t err_type)
|
LWIP_STATIC const char *convert_icmpv6_err_to_string(u8_t err_type)
|
||||||
|
@ -3015,7 +3014,7 @@ int netstat_netconn_sendq(struct netconn *conn)
|
||||||
retVal = netstat_tcp_sendq(conn->pcb.tcp);
|
retVal = netstat_tcp_sendq(conn->pcb.tcp);
|
||||||
break;
|
break;
|
||||||
case NETCONN_RAW:
|
case NETCONN_RAW:
|
||||||
retVal = 0; /* todo */
|
retVal = 0;
|
||||||
break;
|
break;
|
||||||
#if PF_PKT_SUPPORT
|
#if PF_PKT_SUPPORT
|
||||||
case NETCONN_PKT_RAW:
|
case NETCONN_PKT_RAW:
|
||||||
|
|
|
@ -144,7 +144,7 @@ err_t netifapi_dhcps_stop(struct netif *netif)
|
||||||
*/
|
*/
|
||||||
static void tcp_unlock_accept(ip6_addr_t *ipaddr)
|
static void tcp_unlock_accept(ip6_addr_t *ipaddr)
|
||||||
{
|
{
|
||||||
// FIXME
|
(void)ipaddr;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void netif_ip6_addr_setinvalid(struct netif *netif, const ip6_addr_t *addr6)
|
static void netif_ip6_addr_setinvalid(struct netif *netif, const ip6_addr_t *addr6)
|
||||||
|
@ -327,26 +327,32 @@ err_t netif_set_hwaddr(struct netif *netif, const unsigned char *hw_addr, int hw
|
||||||
|
|
||||||
err_t etharp_update_arp_entry(struct netif *netif, const ip4_addr_t *ipaddr, struct eth_addr *ethaddr, u8_t flags)
|
err_t etharp_update_arp_entry(struct netif *netif, const ip4_addr_t *ipaddr, struct eth_addr *ethaddr, u8_t flags)
|
||||||
{
|
{
|
||||||
// FIXME
|
(void)netif;
|
||||||
|
(void)ipaddr;
|
||||||
|
(void)ethaddr;
|
||||||
|
(void)flags;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
err_t etharp_delete_arp_entry(struct netif *netif, ip4_addr_t *ipaddr)
|
err_t etharp_delete_arp_entry(struct netif *netif, ip4_addr_t *ipaddr)
|
||||||
{
|
{
|
||||||
// FIXME
|
(void)netif;
|
||||||
|
(void)ipaddr;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
err_t lwip_dns_setserver(u8_t numdns, ip_addr_t *dnsserver)
|
err_t lwip_dns_setserver(u8_t numdns, ip_addr_t *dnsserver)
|
||||||
{
|
{
|
||||||
// FIXME
|
(void)numdns;
|
||||||
|
(void)dnsserver;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
err_t lwip_dns_getserver(u8_t numdns, ip_addr_t *dnsserver)
|
err_t lwip_dns_getserver(u8_t numdns, ip_addr_t *dnsserver)
|
||||||
{
|
{
|
||||||
// FIXME
|
(void)numdns;
|
||||||
|
(void)dnsserver;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -372,7 +378,9 @@ sys_sem_t dup_addr_detect;
|
||||||
|
|
||||||
int lwip_sntp_start(int server_num, char **sntp_server, struct timeval *time)
|
int lwip_sntp_start(int server_num, char **sntp_server, struct timeval *time)
|
||||||
{
|
{
|
||||||
// FIXME
|
(void)server_num;
|
||||||
|
(void)sntp_server;
|
||||||
|
(void)time;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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"
|
||||||
|
@ -88,7 +86,7 @@ driverif_init_ifname(struct netif *netif)
|
||||||
*
|
*
|
||||||
* @note Returning ERR_MEM here if a DMA queue of your MAC is full can lead to
|
* @note Returning ERR_MEM here if a DMA queue of your MAC is full can lead to
|
||||||
* strange results. You might consider waiting for space in the DMA queue
|
* strange results. You might consider waiting for space in the DMA queue
|
||||||
* to become availale since the stack doesn't retry to send a packet
|
* to become available since the stack doesn't retry to send a packet
|
||||||
* dropped because of memory failure (except for the TCP timers).
|
* dropped because of memory failure (except for the TCP timers).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -84,7 +84,7 @@ void sys_init(void)
|
||||||
|
|
||||||
u32_t sys_now(void)
|
u32_t sys_now(void)
|
||||||
{
|
{
|
||||||
/* Lwip docs mentioned like wraparound is not a problem in this funtion */
|
/* Lwip docs mentioned like wraparound is not a problem in this function */
|
||||||
return (u32_t)((LOS_TickCountGet() * OS_SYS_MS_PER_SECOND) / LOSCFG_BASE_CORE_TICK_PER_SECOND);
|
return (u32_t)((LOS_TickCountGet() * OS_SYS_MS_PER_SECOND) / LOSCFG_BASE_CORE_TICK_PER_SECOND);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -191,7 +191,7 @@ STATIC INT32 TelnetClose(struct file *file)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Description : When a command resolver task trys to read the telnet device,
|
* Description : When a command resolver task tries to read the telnet device,
|
||||||
* this method is called, and it will take out user's commands from the FIFO to run.
|
* this method is called, and it will take out user's commands from the FIFO to run.
|
||||||
* Return : -1 --- On failure
|
* Return : -1 --- On failure
|
||||||
* Non-negative integer --- length of commands taken out from the FIFO of the telnet device.
|
* Non-negative integer --- length of commands taken out from the FIFO of the telnet device.
|
||||||
|
@ -236,7 +236,7 @@ STATIC ssize_t TelnetRead(struct file *file, CHAR *buf, size_t bufLen)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Description : When a command resolver task trys to write command results to the telnet device,
|
* Description : When a command resolver task tries to write command results to the telnet device,
|
||||||
* just use lwIP send function to send out results.
|
* just use lwIP send function to send out results.
|
||||||
* Return : -1 --- buffer is NULL
|
* Return : -1 --- buffer is NULL
|
||||||
* Non-negative integer --- length of written data, maybe 0.
|
* Non-negative integer --- length of written data, maybe 0.
|
||||||
|
|
|
@ -427,7 +427,7 @@ STATIC INT32 TelnetdAcceptClient(INT32 clientFd, const struct sockaddr_in *inTel
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_telnetClientFd >= 0) {
|
if (g_telnetClientFd >= 0) {
|
||||||
/* alreay connected and support only one */
|
/* already connected and support only one */
|
||||||
goto ERROUT_UNLOCK;
|
goto ERROUT_UNLOCK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,7 @@ BOOL IsCapPermit(UINT32 capIndex)
|
||||||
{
|
{
|
||||||
UINT32 capability = OsCurrProcessGet()->capability;
|
UINT32 capability = OsCurrProcessGet()->capability;
|
||||||
if (capIndex > CAPABILITY_MAX || capIndex < 0) {
|
if (capIndex > CAPABILITY_MAX || capIndex < 0) {
|
||||||
PRINTK("%s,%d, get invalid capIndex %d\n", __FUNCTION__, __LINE__, capIndex);
|
PRINTK("%s,%d, get invalid capIndex %u\n", __FUNCTION__, __LINE__, capIndex);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
|
|
||||||
UINT32 VidMapListInit(LosProcessCB *processCB)
|
UINT32 VidMapListInit(LosProcessCB *processCB)
|
||||||
{
|
{
|
||||||
memset_s(&processCB->timerIdMap, sizeof(TimerIdMap), 0, sizeof(TimerIdMap));
|
(void)memset_s(&processCB->timerIdMap, sizeof(TimerIdMap), 0, sizeof(TimerIdMap));
|
||||||
LOS_ListInit(&processCB->timerIdMap.head);
|
LOS_ListInit(&processCB->timerIdMap.head);
|
||||||
processCB->timerIdMap.bitMap = (UINT32*)LOS_MemAlloc(m_aucSysMem0, sizeof(UINT32));
|
processCB->timerIdMap.bitMap = (UINT32*)LOS_MemAlloc(m_aucSysMem0, sizeof(UINT32));
|
||||||
if (processCB->timerIdMap.bitMap == NULL) {
|
if (processCB->timerIdMap.bitMap == NULL) {
|
||||||
|
|
|
@ -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);
|
||||||
|
@ -269,7 +268,7 @@ extern int SysFstatfs64(int fd, size_t sz, struct statfs *buf);
|
||||||
|
|
||||||
extern int SysStat(const char *path, struct kstat *buf);
|
extern int SysStat(const char *path, struct kstat *buf);
|
||||||
extern int SysLstat(const char *path, struct kstat *buffer);
|
extern int SysLstat(const char *path, struct kstat *buffer);
|
||||||
extern int SysFstat(int fildes, struct kstat *buf);
|
extern int SysFstat(int fields, struct kstat *buf);
|
||||||
extern int SysStatx(int fd, const char *restrict path, int flag, unsigned mask, struct statx *restrict stx);
|
extern int SysStatx(int fd, const char *restrict path, int flag, unsigned mask, struct statx *restrict stx);
|
||||||
extern int SysFsync(int fd);
|
extern int SysFsync(int fd);
|
||||||
extern ssize_t SysReadv(int fd, const struct iovec *iov, int iovcnt);
|
extern ssize_t SysReadv(int fd, const struct iovec *iov, int iovcnt);
|
||||||
|
|
|
@ -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"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,6 @@ int CheckRegion(const LosVmSpace *space, VADDR_T ptr, size_t len)
|
||||||
void *DupUserMem(const void *ptr, size_t len, int needCopy)
|
void *DupUserMem(const void *ptr, size_t len, int needCopy)
|
||||||
{
|
{
|
||||||
void *p = LOS_MemAlloc(OS_SYS_MEM_ADDR, len);
|
void *p = LOS_MemAlloc(OS_SYS_MEM_ADDR, len);
|
||||||
|
|
||||||
if (p == NULL) {
|
if (p == NULL) {
|
||||||
set_errno(ENOMEM);
|
set_errno(ENOMEM);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
|
@ -1,3 +1,33 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
||||||
|
* Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without modification,
|
||||||
|
* are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||||
|
* conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||||
|
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||||
|
* provided with the distribution.
|
||||||
|
*
|
||||||
|
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
||||||
|
* to endorse or promote products derived from this software without specific prior written
|
||||||
|
* permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||||
|
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||||
|
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||||
|
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||||
|
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||||
|
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
ENTRY(reset_vector)
|
ENTRY(reset_vector)
|
||||||
INCLUDE board.ld
|
INCLUDE board.ld
|
||||||
|
@ -145,7 +175,7 @@ SECTIONS
|
||||||
|
|
||||||
__user_init_size = __user_init_end - __user_init_entry;
|
__user_init_size = __user_init_end - __user_init_entry;
|
||||||
|
|
||||||
/* unintialized data (in same segment as writable data) */
|
/* uninitialized data (in same segment as writable data) */
|
||||||
.bss : {
|
.bss : {
|
||||||
. = ALIGN(0x800);
|
. = ALIGN(0x800);
|
||||||
__int_stack_start = .;
|
__int_stack_start = .;
|
||||||
|
|
|
@ -1,3 +1,33 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
|
||||||
|
* Copyright (c) 2020-2022 Huawei Device Co., Ltd. All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without modification,
|
||||||
|
* are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||||
|
* conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||||
|
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||||
|
* provided with the distribution.
|
||||||
|
*
|
||||||
|
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
|
||||||
|
* to endorse or promote products derived from this software without specific prior written
|
||||||
|
* permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||||
|
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||||
|
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||||
|
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||||
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||||
|
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||||
|
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
ENTRY(reset_vector)
|
ENTRY(reset_vector)
|
||||||
INCLUDE board.ld
|
INCLUDE board.ld
|
||||||
|
@ -150,7 +180,7 @@ SECTIONS
|
||||||
|
|
||||||
__user_init_size = __user_init_end - __user_init_entry;
|
__user_init_size = __user_init_end - __user_init_entry;
|
||||||
|
|
||||||
/* unintialized data (in same segment as writable data) */
|
/* uninitialized data (in same segment as writable data) */
|
||||||
.bss : {
|
.bss : {
|
||||||
. = ALIGN(0x800);
|
. = ALIGN(0x800);
|
||||||
__int_stack_start = .;
|
__int_stack_start = .;
|
||||||
|
|
Loading…
Reference in New Issue