forked from xuos/xiuos
23/07/27 1.Add netdev module and for edu-arm32, fit Lwip to it; 2.Fit Webnet to edu-arm32;
This commit is contained in:
@@ -36,5 +36,9 @@ ifeq ($(CONFIG_ADD_XIZI_FEATURES),y)
|
||||
SRC_DIR += control_app
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_APP_USING_WEBNET),y)
|
||||
SRC_DIR += webnet
|
||||
endif
|
||||
|
||||
include $(KERNEL_ROOT)/compiler.mk
|
||||
endif
|
||||
16
APP_Framework/Applications/benchmark/Makefile
Normal file
16
APP_Framework/Applications/benchmark/Makefile
Normal file
@@ -0,0 +1,16 @@
|
||||
|
||||
# include $(APPDIR)/Application.mk
|
||||
# ifeq ($(CONFIG_ADD_NUTTX_FETURES),y)
|
||||
# include $(APPDIR)/Make.defs
|
||||
# CSRCS += $(wildcard src/*/*.c) $(wildcard support/*.c)
|
||||
# include $(APPDIR)/Application.mk
|
||||
# endif
|
||||
|
||||
# ifeq ($(CONFIG_ADD_XIZI_FEATURES),y)
|
||||
SRC_DIR :=
|
||||
ifeq ($(CONFIG_APP_BENCHMARK), y)
|
||||
SRC_DIR += src
|
||||
SRC_DIR += support
|
||||
endif
|
||||
include $(KERNEL_ROOT)/compiler.mk
|
||||
# endif
|
||||
3
APP_Framework/Applications/webnet/Makefile
Normal file
3
APP_Framework/Applications/webnet/Makefile
Normal file
@@ -0,0 +1,3 @@
|
||||
SRC_DIR += WebNet_XiUOS
|
||||
|
||||
include $(KERNEL_ROOT)/compiler.mk
|
||||
@@ -40,7 +40,8 @@ struct mq_attr {
|
||||
long mq_curmsgs; /* number of messages currently queued */
|
||||
};
|
||||
|
||||
mqd_t mq_open(const char *name, int oflag, ...);
|
||||
// mqd_t mq_open(const char *name, int oflag, ...);
|
||||
mqd_t mq_open(const char *name, int oflag, mode_t mode, struct mq_attr *attr);
|
||||
int mq_close(mqd_t mqdes);
|
||||
ssize_t mq_receive(mqd_t mqdes, char *msg_ptr, size_t msg_len, unsigned *msg_prio);
|
||||
int mq_send(mqd_t mqdes, const char *msg_ptr, size_t msg_len, unsigned msg_prio);
|
||||
|
||||
@@ -21,12 +21,13 @@
|
||||
|
||||
#include "include/mqueue.h"
|
||||
|
||||
mqd_t mq_open(const char *name, int oflag, ...)
|
||||
mqd_t mq_open(const char* name, int oflag, mode_t mode, struct mq_attr* attr)
|
||||
{
|
||||
|
||||
mqd_t mq;
|
||||
|
||||
mq = UserMsgQueueCreate( DEFAULT_MQUEUE_SIZE, DEFAULT_MAX_MSG_SIZE);
|
||||
// Todo: config mq by mode
|
||||
mq = UserMsgQueueCreate(attr->mq_msgsize, attr->mq_maxmsg);
|
||||
if (mq < 0) {
|
||||
return -1;
|
||||
}
|
||||
@@ -39,12 +40,12 @@ int mq_close(mqd_t mqdes)
|
||||
return UserMsgQueueDelete(mqdes);
|
||||
}
|
||||
|
||||
ssize_t mq_receive(mqd_t mqdes, char *msg_ptr, size_t msg_len, unsigned *msg_prio)
|
||||
ssize_t mq_receive(mqd_t mqdes, char* msg_ptr, size_t msg_len, unsigned* msg_prio)
|
||||
{
|
||||
ssize_t ret;
|
||||
|
||||
*msg_prio = 0;
|
||||
ret = UserMsgQueueRecv(mqdes, msg_ptr, (unsigned long)&msg_len, 0);
|
||||
ret = UserMsgQueueRecv(mqdes, (void*)msg_ptr, msg_len, 100000);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user