[T106][ZXW-22]7520V3SCV2.01.01.02P42U09_VEC_V0.8_AP_VEC origin source commit

Change-Id: Ic6e05d89ecd62fc34f82b23dcf306c93764aec4b
diff --git a/ap/app/appdemo/Makefile b/ap/app/appdemo/Makefile
new file mode 100755
index 0000000..9d11874
--- /dev/null
+++ b/ap/app/appdemo/Makefile
@@ -0,0 +1,42 @@
+#*******************************************************************************
+# include build/common makefile
+# 以生成两个应用为例,如果只有一个删除EXEC2 OBJS2即可
+#*******************************************************************************
+include $(COMMON_MK)
+
+EXEC = demo1
+OBJS = demo1.o
+#EXEC 特有的LIB参数
+#LDLIBS_demo1 = -lnvram_sc -L$(LIB_DIR)/libnvram
+
+EXEC2 = demo2
+OBJS2 = demo2.o
+#EXEC2 特有的LIB参数
+#LDLIBS_demo2 = -lsoft_timer_sc -L$(LIB_DIR)/libsoft_timer
+
+#宏和头文件目录在CFLAGS里定义,要用+=,不要用=,否则会覆盖COMMON_MK里的值
+#CFLAGS += -I$(APP_DIR)/include
+CXXFLAGS = -Wall -g -std=c++11
+
+#EXEC EXEC2 公共LIB参数,第一行定义LDLIBS用=,不要用+=,应用连接的库都在本Makefile定义
+LDLIBS = -lpthread
+
+#*******************************************************************************
+# targets
+#*******************************************************************************
+all: $(EXEC) $(EXEC2) 
+
+$(EXEC): $(OBJS)
+	$(CC) $(LDFLAGS) -o $@ $^ -Wl,--start-group $(LDLIBS) $(LDLIBS_$@) -Wl,--end-group
+	@cp $@ $@.elf
+
+$(EXEC2): $(OBJS2)
+	$(CXX) $(LDFLAGS) -o $@ $^ -Wl,--start-group $(LDLIBS) $(LDLIBS_$@) -Wl,--end-group
+	@cp $@ $@.elf
+
+romfs:
+	$(ROMFSINST) $(EXEC) /bin/$(EXEC)
+	$(ROMFSINST) $(EXEC2) /bin/$(EXEC2)
+
+clean:
+	-@rm -f $(EXEC) $(EXEC2) *.elf *.gdb *.o
diff --git a/ap/app/appdemo/Makefile.one b/ap/app/appdemo/Makefile.one
new file mode 100755
index 0000000..41ac788
--- /dev/null
+++ b/ap/app/appdemo/Makefile.one
@@ -0,0 +1,31 @@
+#*******************************************************************************
+# include build/common makefile
+# 以生成两个应用为例,如果只有一个删除EXEC2 OBJS2即可
+#*******************************************************************************
+include $(COMMON_MK)
+
+EXEC = demo1
+OBJS = demo1.o
+#EXEC 特有的LIB参数
+#LDLIBS_demo1 = -lnvram -L$(LIB_DIR)/libnvram
+
+#宏和头文件目录在CFLAGS里定义,要用+=,不要用=,否则会覆盖COMMON_MK里的值
+#CFLAGS += -I$(APP_DIR)/include
+
+#EXEC LIB参数,第一行定义LDLIBS用=,不要用+=,应用连接的库都在本Makefile定义
+LDLIBS = -lpthread
+
+#*******************************************************************************
+# targets
+#*******************************************************************************
+all: $(EXEC)
+
+$(EXEC): $(OBJS)
+	$(CC) $(LDFLAGS) -o $@ $^ -Wl,--start-group $(LDLIBS) $(LDLIBS_$@) -Wl,--end-group
+	@cp $@ $@.elf
+
+romfs:
+	$(ROMFSINST) $(EXEC) /bin/$(EXEC)
+
+clean:
+	-@rm -f $(EXEC) *.elf *.gdb *.o
diff --git a/ap/app/appdemo/demo1.c b/ap/app/appdemo/demo1.c
new file mode 100755
index 0000000..2f25b93
--- /dev/null
+++ b/ap/app/appdemo/demo1.c
@@ -0,0 +1,47 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <pthread.h>
+
+static void *thread_func(void *arg)
+{
+	char buffer[10];
+
+	while(1)
+	{
+		printf("thread_func\n");
+		sleep(1);
+	}
+	pthread_exit(0);
+}
+
+int main(int argc,char *argv[])
+{
+	pthread_attr_t attr;
+	pthread_t tid;
+	int s;
+
+	s = pthread_attr_init(&attr);
+	if (s != 0)
+	{
+		perror("pthread_attr_init error\n");
+		exit(-1);
+	}
+
+	
+	s = pthread_create(&tid, &attr, thread_func, NULL);
+	if (s != 0)
+	{
+		perror("pthread_create error\n");
+		exit(-2);
+	}
+
+	s = pthread_join(tid, NULL);
+	if (s != 0)
+	{
+		perror("pthread_join error\n");
+		exit(-3);
+	}
+
+	return 0;
+}
diff --git a/ap/app/appdemo/demo2.cpp b/ap/app/appdemo/demo2.cpp
new file mode 100644
index 0000000..fae58a8
--- /dev/null
+++ b/ap/app/appdemo/demo2.cpp
@@ -0,0 +1,15 @@
+#include <cstring>
+#include <iostream>
+
+int main(int argc,char *argv[])
+{
+
+	char c[1024]={0};
+
+	strcpy(c, std::to_string(100).c_str());
+	
+	std::cout << "Hello World!" << std::endl;
+	std::cout << c << std::endl;
+
+	return 0;
+}