support zynq7000-zc702
This commit is contained in:
@@ -1,18 +0,0 @@
|
||||
#
|
||||
# Automatically generated file; DO NOT EDIT.
|
||||
# XiZi_AIoT Project Configuration
|
||||
#
|
||||
CONFIG_BOARD_IMX6Q_SABRELITE=y
|
||||
CONFIG_ARCH_ARM=y
|
||||
|
||||
#
|
||||
# imx6q sabrelite feature
|
||||
#
|
||||
|
||||
#
|
||||
# Lib
|
||||
#
|
||||
CONFIG_LIB=y
|
||||
CONFIG_LIB_POSIX=y
|
||||
CONFIG_LIB_NEWLIB=y
|
||||
# CONFIG_LIB_MUSLLIB is not set
|
||||
@@ -1,25 +0,0 @@
|
||||
mainmenu "XiZi_AIoT Project Configuration"
|
||||
|
||||
config BSP_DIR
|
||||
string
|
||||
option env="BSP_ROOT"
|
||||
default "."
|
||||
|
||||
config KERNEL_DIR
|
||||
string
|
||||
option env="KERNEL_ROOT"
|
||||
default "../.."
|
||||
|
||||
config BOARD_IMX6Q_SABRELITE
|
||||
bool
|
||||
select ARCH_ARM
|
||||
default y
|
||||
|
||||
source "$KERNEL_DIR/hardkernel/arch/Kconfig"
|
||||
|
||||
menu "imx6q sabrelite feature"
|
||||
|
||||
endmenu
|
||||
|
||||
|
||||
source "$KERNEL_DIR/Kconfig"
|
||||
@@ -1,53 +1,28 @@
|
||||
|
||||
ifeq ($(BOARD), imx6q-sabrelite)
|
||||
toolchain ?= arm-none-eabi-
|
||||
endif
|
||||
ifeq ($(BOARD), zynq7000-zc702)
|
||||
toolchain ?= arm-xilinx-eabi-
|
||||
endif
|
||||
cc = ${toolchain}gcc
|
||||
ld = ${toolchain}g++
|
||||
objdump = ${toolchain}objdump
|
||||
user_ldflags = --specs=nosys.specs -Wl,-Map=user.map,-cref -N
|
||||
cflags = -std=c11 -march=armv7-a -mtune=cortex-a9 -nostdlib -nodefaultlibs -mfloat-abi=soft -fno-pic -static -fno-builtin -fno-strict-aliasing -Wall -ggdb -Wno-unused -Werror -fno-omit-frame-pointer -fno-stack-protector -fno-pie -no-pie
|
||||
user_ldflags = -N -Ttext 0
|
||||
|
||||
cflags = -march=armv7-a -mtune=cortex-a9 -nostdlib -nodefaultlibs -mfloat-abi=soft -fno-pic -static -fno-builtin -fno-strict-aliasing -Wall -ggdb -Wno-unused -Werror -fno-omit-frame-pointer -fno-stack-protector -fno-pie -no-pie
|
||||
c_useropts = -O0
|
||||
|
||||
INC_DIR = -I$(KERNEL_ROOT)/services/shell/letter-shell \
|
||||
INC_DIR = -I$(KERNEL_ROOT)/services/fs/libfs \
|
||||
-I$(KERNEL_ROOT)/services/fs/fs_server/include \
|
||||
-I$(KERNEL_ROOT)/services/lib/ipc \
|
||||
-I$(KERNEL_ROOT)/services/lib/memory \
|
||||
-I$(KERNEL_ROOT)/services/boards/imx6q-sabrelite \
|
||||
-I$(KERNEL_ROOT)/services/fs/libfs
|
||||
-I$(KERNEL_ROOT)/services/boards/$(BOARD) \
|
||||
-I$(KERNEL_ROOT)/services/app
|
||||
|
||||
all: init simple_client simple_server shell fs_server test_priority readme.txt | bin
|
||||
../../tools/mkfs/mkfs ./fs.img $^
|
||||
@mv $(filter-out readme.txt, $^) bin
|
||||
@mv *.o bin
|
||||
@mv *.asm bin
|
||||
|
||||
bin:
|
||||
@mkdir -p bin
|
||||
|
||||
shell: shell_port.o libserial.o shell_cmd_list.o shell.o shell_ext.o libfs_to_client.o libipc.o session.o usyscall.o
|
||||
@${ld} ${user_ldflags} -e main -o $@ $^
|
||||
@${objdump} -S $@ > $@.asm
|
||||
|
||||
init: init.o libfs_to_client.o libipc.o session.o libserial.o usyscall.o
|
||||
@${ld} ${user_ldflags} -e main -o $@ $^
|
||||
@${objdump} -S $@ > $@.asm
|
||||
|
||||
simple_client: simple_client.o libserial.o libipc.o session.o simple_service.o libfs_to_client.o usyscall.o
|
||||
@${ld} ${user_ldflags} -e main -o $@ $^
|
||||
@${objdump} -S $@ > $@.asm
|
||||
|
||||
simple_server: simple_server.o libserial.o libipc.o session.o simple_service.o usyscall.o
|
||||
@${ld} ${user_ldflags} -e main -o $@ $^
|
||||
@${objdump} -S $@ > $@.asm
|
||||
|
||||
fs_server: fs_server.o libfs_to_client.o fs.o libserial.o libipc.o session.o block_io.o usyscall.o
|
||||
@${ld} ${user_ldflags} -e main -o $@ $^
|
||||
@${objdump} -S $@ > $@.asm
|
||||
|
||||
test_priority: test_priority.o libserial.o usyscall.o
|
||||
@${ld} ${user_ldflags} -e main -o $@ $^
|
||||
@${objdump} -S $@ > $@.asm
|
||||
libserial: libserial.o
|
||||
@mv $^ ../../app
|
||||
|
||||
%.o: %.c
|
||||
@${cc} ${cflags} ${c_useropts} ${INC_DIR} -o $@ -c $<
|
||||
@echo "cc $^"
|
||||
@${cc} ${cflags} ${c_useropts} ${INC_DIR} -o $@ -c $^
|
||||
|
||||
%.o: %.S
|
||||
@${cc} ${cflags} ${c_useropts} -o $@ -c $<
|
||||
include $(KERNEL_ROOT)/compiler.mk
|
||||
|
||||
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@@ -1,39 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2020 AIIT XUOS Lab
|
||||
* XiUOS is licensed under Mulan PSL v2.
|
||||
* You can use this software according to the terms and conditions of the Mulan PSL v2.
|
||||
* You may obtain a copy of Mulan PSL v2 at:
|
||||
* http://license.coscl.org.cn/MulanPSL2
|
||||
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
* See the Mulan PSL v2 for more details.
|
||||
*/
|
||||
// init: The initial user-level program
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "libfs_to_client.h"
|
||||
#include "libserial.h"
|
||||
#include "usyscall.h"
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
struct Session session;
|
||||
connect_session(&session, "MemFS", 8092);
|
||||
|
||||
int fd;
|
||||
char* shell_task_param[2] = { "/shell", 0 };
|
||||
if ((fd = open(&session, shell_task_param[0])) < 0) {
|
||||
printf("Open %s failed\n", shell_task_param[0]);
|
||||
exit();
|
||||
}
|
||||
|
||||
if (spawn(&session, fd, read, shell_task_param[0], shell_task_param) < 0) {
|
||||
printf("Syscall Spawn shell failed\n");
|
||||
}
|
||||
|
||||
close(&session, fd);
|
||||
|
||||
exit();
|
||||
return 0;
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
Xiuos-AIoT
|
||||
This is User FS
|
||||
@@ -1,64 +0,0 @@
|
||||
/**
|
||||
* @file shell_port.c
|
||||
* @author Letter (NevermindZZT@gmail.com)
|
||||
* @brief
|
||||
* @version 0.1
|
||||
* @date 2019-02-22
|
||||
*
|
||||
* @copyright (c) 2019 Letter
|
||||
*
|
||||
*/
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "libserial.h"
|
||||
#include "session.h"
|
||||
#include "shell.h"
|
||||
#include "usyscall.h"
|
||||
|
||||
Shell shell;
|
||||
char shellBuffer[512];
|
||||
struct Session session_fs;
|
||||
|
||||
signed short userShellWrite(char* data, unsigned short len)
|
||||
{
|
||||
unsigned short length = len;
|
||||
while (length--) {
|
||||
printf("%c", *data++);
|
||||
}
|
||||
return len;
|
||||
}
|
||||
|
||||
signed short userShellRead(char* data, unsigned short len)
|
||||
{
|
||||
unsigned short length = len;
|
||||
static char cur_read;
|
||||
while (length--) {
|
||||
cur_read = getc();
|
||||
if (cur_read == 0xff) {
|
||||
yield();
|
||||
}
|
||||
// *data++ = getc();
|
||||
*data++ = cur_read;
|
||||
}
|
||||
return len;
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
shell.write = userShellWrite;
|
||||
shell.read = userShellRead;
|
||||
|
||||
shellInit(&shell, shellBuffer, 512);
|
||||
|
||||
connect_session(&session_fs, "MemFS", 8092);
|
||||
if (!session_fs.buf) {
|
||||
printf("session connect faield\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
shellTask(&shell);
|
||||
|
||||
free_session(&session_fs);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1,142 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2020 AIIT XUOS Lab
|
||||
* XiUOS is licensed under Mulan PSL v2.
|
||||
* You can use this software according to the terms and conditions of the Mulan PSL v2.
|
||||
* You may obtain a copy of Mulan PSL v2 at:
|
||||
* http://license.coscl.org.cn/MulanPSL2
|
||||
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
* See the Mulan PSL v2 for more details.
|
||||
*/
|
||||
#include <assert.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "libfs_to_client.h"
|
||||
#include "libserial.h"
|
||||
#include "simple_service.h"
|
||||
#include "usyscall.h"
|
||||
|
||||
int string_to_integer(const char* str)
|
||||
{
|
||||
assert(str);
|
||||
while (*str == ' ') {
|
||||
str++;
|
||||
}
|
||||
int is_positive = 1; // 默认是正
|
||||
if (*str - '+' == 0) {
|
||||
is_positive = 1;
|
||||
str++;
|
||||
}
|
||||
if (*str - '-' == 0) {
|
||||
is_positive = 0;
|
||||
str++;
|
||||
}
|
||||
long long result = 0; // int可能存不下 改为long long较为合适虽然返回值会丢失精度但感觉不要紧
|
||||
while ('0' <= *str && *str <= '9') {
|
||||
result *= 10;
|
||||
result += *str - '0'; // 如'1' ascii的值为 49 '0'的ascii的值为48 相减得到1
|
||||
|
||||
if (result > INT32_MAX || result < INT32_MIN) // 可能出现的溢出问题
|
||||
{
|
||||
return result > INT32_MAX ? INT32_MAX : INT32_MIN;
|
||||
}
|
||||
|
||||
str++;
|
||||
}
|
||||
return is_positive ? (result) : -result;
|
||||
}
|
||||
|
||||
void itoa(int num, char* str, int radix)
|
||||
{
|
||||
int i = 0;
|
||||
int sum;
|
||||
unsigned int num1 = num; // 如果是负数求补码,必须将他的绝对值放在无符号位中在进行求反码
|
||||
char str1[33] = { 0 };
|
||||
if (num < 0) { // 求出负数的补码
|
||||
num = -num;
|
||||
num1 = ~num;
|
||||
num1 += 1;
|
||||
}
|
||||
if (num == 0) {
|
||||
str1[i] = '0';
|
||||
|
||||
i++;
|
||||
}
|
||||
while (num1 != 0) { // 进行进制运算
|
||||
sum = num1 % radix;
|
||||
str1[i] = (sum > 9) ? (sum - 10) + 'a' : sum + '0';
|
||||
num1 = num1 / radix;
|
||||
i++;
|
||||
}
|
||||
i--;
|
||||
int j = 0;
|
||||
for (i; i >= 0; i--) { // 逆序输出
|
||||
str[i] = str1[j];
|
||||
j++;
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
int id = 1;
|
||||
if (argc >= 2) {
|
||||
id = string_to_integer(argv[1]);
|
||||
}
|
||||
printf("This is Simple Client %d, size is 0x%x\n", id, task_heap_base());
|
||||
|
||||
struct Session session_wait;
|
||||
struct Session session_nowait;
|
||||
if (connect_session(&session_wait, "SimpleServer", 4096) < 0 || connect_session(&session_nowait, "SimpleServer", 4096) < 0) {
|
||||
printf("connect session failed\n");
|
||||
exit();
|
||||
}
|
||||
|
||||
char *buf1 = NULL, *buf2 = NULL;
|
||||
struct IpcMsg* msg1 = hello_string_nowait(&session_nowait, &buf1, 32);
|
||||
struct IpcMsg* msg2 = hello_string_nowait(&session_nowait, &buf2, 128);
|
||||
|
||||
int ret = add(&session_wait, 17, 22);
|
||||
printf("ipc_add 17 + 22 = %d\n", ret);
|
||||
char buf[32];
|
||||
ret = add(&session_wait, 9, 9);
|
||||
printf("ipc_add 9 + 9 = %d\n", ret);
|
||||
|
||||
struct Session session;
|
||||
static char id_buf[33] = { 0 };
|
||||
if (id > 1) {
|
||||
if (connect_session(&session, "MemFS", 8092) < 0) {
|
||||
printf("connect session failed\n");
|
||||
} else {
|
||||
int fd;
|
||||
itoa(id - 1, id_buf, 10);
|
||||
char* shell_task_param[3] = { "/simple_client", id_buf, 0 };
|
||||
if ((fd = open(&session, shell_task_param[0])) >= 0) {
|
||||
if (spawn(&session, fd, read, shell_task_param[0], shell_task_param) < 0) {
|
||||
printf("Syscall Spawn simple_client failed\n");
|
||||
}
|
||||
if (spawn(&session, fd, read, shell_task_param[0], shell_task_param) < 0) {
|
||||
printf("Syscall Spawn simple_client failed\n");
|
||||
}
|
||||
close(&session, fd);
|
||||
} else {
|
||||
printf("Open %s failed\n", shell_task_param[0]);
|
||||
}
|
||||
free_session(&session);
|
||||
}
|
||||
}
|
||||
|
||||
ipc_session_wait(&session_nowait);
|
||||
printf("buf1: %s\n", buf1);
|
||||
ipc_session_forward(&session_nowait);
|
||||
|
||||
ipc_session_wait(&session_nowait);
|
||||
printf("buf2: %s\n", buf2);
|
||||
ipc_session_forward(&session_nowait);
|
||||
|
||||
free_session(&session_wait);
|
||||
free_session(&session_nowait);
|
||||
|
||||
exit();
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2020 AIIT XUOS Lab
|
||||
* XiUOS is licensed under Mulan PSL v2.
|
||||
* You can use this software according to the terms and conditions of the Mulan PSL v2.
|
||||
* You may obtain a copy of Mulan PSL v2 at:
|
||||
* http://license.coscl.org.cn/MulanPSL2
|
||||
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
* See the Mulan PSL v2 for more details.
|
||||
*/
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "libserial.h"
|
||||
#include "simple_service.h"
|
||||
#include "usyscall.h"
|
||||
|
||||
int IPC_DO_SERVE_FUNC(Ipc_add)(int* a, int* b)
|
||||
{
|
||||
return *a + *b;
|
||||
}
|
||||
|
||||
int IPC_DO_SERVE_FUNC(Ipc_hello_string)(char* buf, int* len)
|
||||
{
|
||||
static char hello_string[] = "Hello, This is server!";
|
||||
int copy_len = sizeof(hello_string) > *len ? *len : sizeof(hello_string);
|
||||
memcpy(buf, hello_string, copy_len);
|
||||
return 0;
|
||||
}
|
||||
|
||||
IPC_SERVER_INTERFACE(Ipc_add, 2);
|
||||
IPC_SERVER_INTERFACE(Ipc_hello_string, 2);
|
||||
IPC_SERVER_REGISTER_INTERFACES(IpcSimpleServer, 2, Ipc_hello_string, Ipc_add);
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
if (register_server("SimpleServer") < 0) {
|
||||
printf("register server name: %s failed.\n", "SimpleServer");
|
||||
exit();
|
||||
}
|
||||
ipc_server_loop(&IpcSimpleServer);
|
||||
|
||||
// never reached
|
||||
exit();
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2020 AIIT XUOS Lab
|
||||
* XiUOS is licensed under Mulan PSL v2.
|
||||
* You can use this software according to the terms and conditions of the Mulan PSL v2.
|
||||
* You may obtain a copy of Mulan PSL v2 at:
|
||||
* http://license.coscl.org.cn/MulanPSL2
|
||||
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
* See the Mulan PSL v2 for more details.
|
||||
*/
|
||||
#include "simple_service.h"
|
||||
|
||||
IPC_INTERFACE(Ipc_add, 2, a, b, sizeof(int), sizeof(int));
|
||||
int add(struct Session* session, int a, int b)
|
||||
{
|
||||
return IPC_CALL(Ipc_add)(session, &a, &b);
|
||||
}
|
||||
|
||||
IPC_INTERFACE(Ipc_hello_string, 2, buf, len, *(int*)len, sizeof(int));
|
||||
int hello_string(struct Session* session, char* buf, int len)
|
||||
{
|
||||
return IPC_CALL(Ipc_hello_string)(session, buf, &len);
|
||||
}
|
||||
|
||||
struct IpcMsg* hello_string_nowait(struct Session* session, char** buf, int len)
|
||||
{
|
||||
struct IpcMsg* msg = IPC_CREATE_MSG_FUNC(Ipc_hello_string)(session, *buf, &len);
|
||||
*buf = ipc_msg_get_nth_arg_buf(msg, 0);
|
||||
ipc_msg_set_nth_arg(msg, 1, &len, sizeof(int));
|
||||
ipc_msg_set_opcode(msg, Ipc_hello_string);
|
||||
ipc_msg_send_nowait(msg);
|
||||
return msg;
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2020 AIIT XUOS Lab
|
||||
* XiUOS is licensed under Mulan PSL v2.
|
||||
* You can use this software according to the terms and conditions of the Mulan PSL v2.
|
||||
* You may obtain a copy of Mulan PSL v2 at:
|
||||
* http://license.coscl.org.cn/MulanPSL2
|
||||
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
* See the Mulan PSL v2 for more details.
|
||||
*/
|
||||
|
||||
// test_fs: Test the file io control of fs
|
||||
#include <assert.h>
|
||||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "libserial.h"
|
||||
#include "libfs_to_client.h"
|
||||
#include "usyscall.h"
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
printf("file system test\n");
|
||||
|
||||
struct Session session;
|
||||
connect_session(&session, "MemFS", 4096);
|
||||
|
||||
register_server("TEST_FS");
|
||||
|
||||
int fd;
|
||||
char* fd_path = "/readme.txt";
|
||||
fd = open(&session, fd_path);
|
||||
/// @todo support malloc for user
|
||||
char buffer[BLOCK_SIZE] = { 0 };
|
||||
read(&session, fd, buffer, 0, BLOCK_SIZE);
|
||||
printf("file content: %s\n", buffer);
|
||||
|
||||
char* write_data = "hello world\n";
|
||||
write(&session, fd, write_data, 0, strlen(write_data) + 1);
|
||||
memset(buffer, 0, BLOCK_SIZE);
|
||||
read(&session, fd, buffer, 0, BLOCK_SIZE);
|
||||
printf("file content: %s\n", buffer);
|
||||
|
||||
close(&session, fd);
|
||||
|
||||
free_session(&session);
|
||||
|
||||
exit();
|
||||
return 0;
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2020 AIIT XUOS Lab
|
||||
* XiUOS is licensed under Mulan PSL v2.
|
||||
* You can use this software according to the terms and conditions of the Mulan PSL v2.
|
||||
* You may obtain a copy of Mulan PSL v2 at:
|
||||
* http://license.coscl.org.cn/MulanPSL2
|
||||
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
* See the Mulan PSL v2 for more details.
|
||||
*/
|
||||
|
||||
// test_priority: Test the priority scheduler of task
|
||||
#include <assert.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "libserial.h"
|
||||
#include "usyscall.h"
|
||||
|
||||
static void count_down()
|
||||
{
|
||||
int time = 500000000;
|
||||
while (time >= 0) {
|
||||
if (time % 10000000 == 0) {
|
||||
printf("Priority-based preempting, time remained %d\n", time);
|
||||
}
|
||||
time--;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
// set priority
|
||||
sys_state_info info;
|
||||
info.priority = 0;
|
||||
set_priority(&info);
|
||||
|
||||
// test function
|
||||
count_down();
|
||||
|
||||
exit();
|
||||
return 0;
|
||||
}
|
||||
@@ -1,614 +0,0 @@
|
||||
Archive member included to satisfy reference by file (symbol)
|
||||
|
||||
/opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/libgcc.a(_udivsi3.o)
|
||||
libserial.o (__aeabi_uidiv)
|
||||
/opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/libgcc.a(_dvmd_tls.o)
|
||||
/opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/libgcc.a(_udivsi3.o) (__aeabi_idiv0)
|
||||
/opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/libc.a(lib_a-init.o)
|
||||
/opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/crt0.o (__libc_init_array)
|
||||
/opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/libc.a(lib_a-memset.o)
|
||||
/opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/crt0.o (memset)
|
||||
|
||||
Memory Configuration
|
||||
|
||||
Name Origin Length Attributes
|
||||
*default* 0x0000000000000000 0xffffffffffffffff
|
||||
|
||||
Linker script and memory map
|
||||
|
||||
LOAD /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/crti.o
|
||||
LOAD /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/crtbegin.o
|
||||
LOAD /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/crt0.o
|
||||
LOAD test_priority.o
|
||||
LOAD libserial.o
|
||||
LOAD usyscall.o
|
||||
LOAD /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/libstdc++.a
|
||||
LOAD /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/libm.a
|
||||
START GROUP
|
||||
LOAD /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/libgcc.a
|
||||
LOAD /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/libc.a
|
||||
END GROUP
|
||||
START GROUP
|
||||
LOAD /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/libgcc.a
|
||||
LOAD /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/libc.a
|
||||
LOAD /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/libnosys.a
|
||||
END GROUP
|
||||
LOAD /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/crtend.o
|
||||
LOAD /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/crtn.o
|
||||
[!provide] PROVIDE (__executable_start, SEGMENT_START ("text-segment", 0x8000))
|
||||
0x0000000000008000 . = SEGMENT_START ("text-segment", 0x8000)
|
||||
|
||||
.interp
|
||||
*(.interp)
|
||||
|
||||
.note.gnu.build-id
|
||||
*(.note.gnu.build-id)
|
||||
|
||||
.hash
|
||||
*(.hash)
|
||||
|
||||
.gnu.hash
|
||||
*(.gnu.hash)
|
||||
|
||||
.dynsym
|
||||
*(.dynsym)
|
||||
|
||||
.dynstr
|
||||
*(.dynstr)
|
||||
|
||||
.gnu.version
|
||||
*(.gnu.version)
|
||||
|
||||
.gnu.version_d
|
||||
*(.gnu.version_d)
|
||||
|
||||
.gnu.version_r
|
||||
*(.gnu.version_r)
|
||||
|
||||
.rel.init
|
||||
*(.rel.init)
|
||||
|
||||
.rela.init
|
||||
*(.rela.init)
|
||||
|
||||
.rel.text
|
||||
*(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
|
||||
|
||||
.rela.text
|
||||
*(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
|
||||
|
||||
.rel.fini
|
||||
*(.rel.fini)
|
||||
|
||||
.rela.fini
|
||||
*(.rela.fini)
|
||||
|
||||
.rel.rodata
|
||||
*(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
|
||||
|
||||
.rela.rodata
|
||||
*(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
|
||||
|
||||
.rel.data.rel.ro
|
||||
*(.rel.data.rel.ro .rel.data.rel.ro.* .rel.gnu.linkonce.d.rel.ro.*)
|
||||
|
||||
.rela.data.rel.ro
|
||||
*(.rela.data.rel.ro .rela.data.rel.ro.* .rela.gnu.linkonce.d.rel.ro.*)
|
||||
|
||||
.rel.data
|
||||
*(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
|
||||
|
||||
.rela.data
|
||||
*(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
|
||||
|
||||
.rel.tdata
|
||||
*(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
|
||||
|
||||
.rela.tdata
|
||||
*(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
|
||||
|
||||
.rel.tbss
|
||||
*(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
|
||||
|
||||
.rela.tbss
|
||||
*(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
|
||||
|
||||
.rel.ctors
|
||||
*(.rel.ctors)
|
||||
|
||||
.rela.ctors
|
||||
*(.rela.ctors)
|
||||
|
||||
.rel.dtors
|
||||
*(.rel.dtors)
|
||||
|
||||
.rela.dtors
|
||||
*(.rela.dtors)
|
||||
|
||||
.rel.got
|
||||
*(.rel.got)
|
||||
|
||||
.rela.got
|
||||
*(.rela.got)
|
||||
|
||||
.rel.bss
|
||||
*(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
|
||||
|
||||
.rela.bss
|
||||
*(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
|
||||
|
||||
.rel.iplt 0x0000000000008000 0x0
|
||||
[!provide] PROVIDE (__rel_iplt_start, .)
|
||||
*(.rel.iplt)
|
||||
.rel.iplt 0x0000000000008000 0x0 /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/crtbegin.o
|
||||
[!provide] PROVIDE (__rel_iplt_end, .)
|
||||
|
||||
.rela.iplt 0x0000000000008000 0x0
|
||||
[!provide] PROVIDE (__rela_iplt_start, .)
|
||||
*(.rela.iplt)
|
||||
[!provide] PROVIDE (__rela_iplt_end, .)
|
||||
|
||||
.rel.plt
|
||||
*(.rel.plt)
|
||||
|
||||
.rela.plt
|
||||
*(.rela.plt)
|
||||
|
||||
.init 0x0000000000008000 0x18
|
||||
*(SORT(.init))
|
||||
.init 0x0000000000008000 0xc /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/crti.o
|
||||
0x0000000000008000 _init
|
||||
.init 0x000000000000800c 0xc /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/crtn.o
|
||||
|
||||
.plt
|
||||
*(.plt)
|
||||
|
||||
.iplt 0x0000000000008018 0x0
|
||||
*(.iplt)
|
||||
.iplt 0x0000000000008018 0x0 /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/crtbegin.o
|
||||
|
||||
.text 0x0000000000008018 0xe40
|
||||
*(.text.unlikely .text.*_unlikely .text.unlikely.*)
|
||||
*(.text.exit .text.exit.*)
|
||||
*(.text.startup .text.startup.*)
|
||||
*(.text.hot .text.hot.*)
|
||||
*(.text .stub .text.* .gnu.linkonce.t.*)
|
||||
.text 0x0000000000008018 0x0 /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/crti.o
|
||||
.text 0x0000000000008018 0xbc /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/crtbegin.o
|
||||
.text 0x00000000000080d4 0x114 /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/crt0.o
|
||||
0x00000000000080d4 _mainCRTStartup
|
||||
0x00000000000080d4 _start
|
||||
.text 0x00000000000081e8 0xc4 test_priority.o
|
||||
0x000000000000826c main
|
||||
.text 0x00000000000082ac 0x4dc libserial.o
|
||||
0x00000000000083a4 getc
|
||||
0x000000000000855c printf
|
||||
.text 0x0000000000008788 0x424 usyscall.o
|
||||
0x00000000000087f8 spawn
|
||||
0x000000000000885c exit
|
||||
0x0000000000008894 yield
|
||||
0x00000000000088cc register_server
|
||||
0x0000000000008908 session
|
||||
0x0000000000008950 poll_session
|
||||
0x0000000000008990 close_session
|
||||
0x00000000000089cc get_memblock_info
|
||||
0x0000000000008a08 set_priority
|
||||
0x0000000000008a44 task_heap_base
|
||||
0x0000000000008a7c show_task
|
||||
0x0000000000008ab4 show_mem
|
||||
0x0000000000008aec show_cpu
|
||||
0x0000000000008b24 mmap
|
||||
0x0000000000008b6c register_irq
|
||||
.text 0x0000000000008bac 0x114 /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/libgcc.a(_udivsi3.o)
|
||||
0x0000000000008bac __udivsi3
|
||||
0x0000000000008bac __aeabi_uidiv
|
||||
0x0000000000008ca0 __aeabi_uidivmod
|
||||
.text 0x0000000000008cc0 0x4 /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/libgcc.a(_dvmd_tls.o)
|
||||
0x0000000000008cc0 __aeabi_ldiv0
|
||||
0x0000000000008cc0 __aeabi_idiv0
|
||||
.text 0x0000000000008cc4 0x0 /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/libc.a(lib_a-init.o)
|
||||
.text.__libc_init_array
|
||||
0x0000000000008cc4 0x80 /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/libc.a(lib_a-init.o)
|
||||
0x0000000000008cc4 __libc_init_array
|
||||
.text 0x0000000000008d44 0x0 /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/libc.a(lib_a-memset.o)
|
||||
.text.memset 0x0000000000008d44 0x114 /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/libc.a(lib_a-memset.o)
|
||||
0x0000000000008d44 memset
|
||||
.text 0x0000000000008e58 0x0 /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/crtend.o
|
||||
.text 0x0000000000008e58 0x0 /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/crtn.o
|
||||
*(.gnu.warning)
|
||||
*(.glue_7t)
|
||||
.glue_7t 0x0000000000008e58 0x0 linker stubs
|
||||
*(.glue_7)
|
||||
.glue_7 0x0000000000008e58 0x0 linker stubs
|
||||
*(.vfp11_veneer)
|
||||
.vfp11_veneer 0x0000000000008e58 0x0 linker stubs
|
||||
*(.v4_bx)
|
||||
.v4_bx 0x0000000000008e58 0x0 linker stubs
|
||||
|
||||
.fini 0x0000000000008e58 0x18
|
||||
*(SORT(.fini))
|
||||
.fini 0x0000000000008e58 0xc /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/crti.o
|
||||
0x0000000000008e58 _fini
|
||||
.fini 0x0000000000008e64 0xc /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/crtn.o
|
||||
[!provide] PROVIDE (__etext, .)
|
||||
[!provide] PROVIDE (_etext, .)
|
||||
[!provide] PROVIDE (etext, .)
|
||||
|
||||
.rodata 0x0000000000008e70 0x37
|
||||
*(.rodata .rodata.* .gnu.linkonce.r.*)
|
||||
.rodata 0x0000000000008e70 0x2d test_priority.o
|
||||
*fill* 0x0000000000008e9d 0x3
|
||||
.rodata 0x0000000000008ea0 0x7 libserial.o
|
||||
|
||||
.rodata1
|
||||
*(.rodata1)
|
||||
|
||||
.ARM.extab 0x0000000000008ea7 0x0
|
||||
*(.ARM.extab* .gnu.linkonce.armextab.*)
|
||||
.ARM.extab 0x0000000000008ea7 0x0 /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/crt0.o
|
||||
[!provide] PROVIDE (__exidx_start, .)
|
||||
|
||||
.ARM.exidx 0x0000000000008ea8 0x8
|
||||
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
|
||||
.ARM.exidx 0x0000000000008ea8 0x8 /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/crt0.o
|
||||
[!provide] PROVIDE (__exidx_end, .)
|
||||
|
||||
.eh_frame_hdr
|
||||
*(.eh_frame_hdr)
|
||||
*(.eh_frame_entry .eh_frame_entry.*)
|
||||
|
||||
.eh_frame 0x0000000000008eb0 0x4
|
||||
*(.eh_frame)
|
||||
.eh_frame 0x0000000000008eb0 0x0 /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/crtbegin.o
|
||||
.eh_frame 0x0000000000008eb0 0x4 /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/crtend.o
|
||||
*(.eh_frame.*)
|
||||
|
||||
.gcc_except_table
|
||||
*(.gcc_except_table .gcc_except_table.*)
|
||||
|
||||
.gnu_extab
|
||||
*(.gnu_extab*)
|
||||
|
||||
.exception_ranges
|
||||
*(.exception_ranges .exception_ranges*)
|
||||
0x0000000000008eb4 . = .
|
||||
|
||||
.eh_frame
|
||||
*(.eh_frame)
|
||||
*(.eh_frame.*)
|
||||
|
||||
.gnu_extab
|
||||
*(.gnu_extab)
|
||||
|
||||
.gcc_except_table
|
||||
*(.gcc_except_table .gcc_except_table.*)
|
||||
|
||||
.exception_ranges
|
||||
*(.exception_ranges .exception_ranges*)
|
||||
|
||||
.tdata
|
||||
*(.tdata .tdata.* .gnu.linkonce.td.*)
|
||||
|
||||
.tbss
|
||||
*(.tbss .tbss.* .gnu.linkonce.tb.*)
|
||||
*(.tcommon)
|
||||
|
||||
.preinit_array 0x0000000000008eb4 0x0
|
||||
0x0000000000008eb4 PROVIDE (__preinit_array_start, .)
|
||||
*(.preinit_array)
|
||||
0x0000000000008eb4 PROVIDE (__preinit_array_end, .)
|
||||
|
||||
.init_array 0x0000000000008eb4 0x4
|
||||
0x0000000000008eb4 PROVIDE (__init_array_start, .)
|
||||
*(SORT(.init_array.*) SORT(.ctors.*))
|
||||
*(.init_array EXCLUDE_FILE(*crtend?.o *crtend.o *crtbegin?.o *crtbegin.o) .ctors)
|
||||
.init_array 0x0000000000008eb4 0x4 /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/crtbegin.o
|
||||
0x0000000000008eb8 PROVIDE (__init_array_end, .)
|
||||
|
||||
.fini_array 0x0000000000008eb8 0x4
|
||||
[!provide] PROVIDE (__fini_array_start, .)
|
||||
*(SORT(.fini_array.*) SORT(.dtors.*))
|
||||
*(.fini_array EXCLUDE_FILE(*crtend?.o *crtend.o *crtbegin?.o *crtbegin.o) .dtors)
|
||||
.fini_array 0x0000000000008eb8 0x4 /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/crtbegin.o
|
||||
[!provide] PROVIDE (__fini_array_end, .)
|
||||
|
||||
.ctors
|
||||
*crtbegin.o(.ctors)
|
||||
*crtbegin?.o(.ctors)
|
||||
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
|
||||
*(SORT(.ctors.*))
|
||||
*(.ctors)
|
||||
|
||||
.dtors
|
||||
*crtbegin.o(.dtors)
|
||||
*crtbegin?.o(.dtors)
|
||||
*(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
|
||||
*(SORT(.dtors.*))
|
||||
*(.dtors)
|
||||
|
||||
.jcr 0x0000000000008ebc 0x4
|
||||
*(.jcr)
|
||||
.jcr 0x0000000000008ebc 0x0 /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/crtbegin.o
|
||||
.jcr 0x0000000000008ebc 0x4 /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/crtend.o
|
||||
|
||||
.data.rel.ro
|
||||
*(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*)
|
||||
*(.data.rel.ro .data.rel.ro.* .gnu.linkonce.d.rel.ro.*)
|
||||
|
||||
.dynamic
|
||||
*(.dynamic)
|
||||
|
||||
.got 0x0000000000008ec0 0x0
|
||||
*(.got.plt)
|
||||
*(.igot.plt)
|
||||
.igot.plt 0x0000000000008ec0 0x0 /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/crtbegin.o
|
||||
*(.got)
|
||||
*(.igot)
|
||||
|
||||
.data 0x0000000000008ec0 0x15
|
||||
0x0000000000008ec0 __data_start = .
|
||||
*(.data .data.* .gnu.linkonce.d.*)
|
||||
.data 0x0000000000008ec0 0x0 /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/crti.o
|
||||
.data 0x0000000000008ec0 0x4 /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/crtbegin.o
|
||||
0x0000000000008ec0 __dso_handle
|
||||
.data 0x0000000000008ec4 0x0 /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/crt0.o
|
||||
.data 0x0000000000008ec4 0x0 test_priority.o
|
||||
.data 0x0000000000008ec4 0x11 libserial.o
|
||||
.data 0x0000000000008ed5 0x0 usyscall.o
|
||||
.data 0x0000000000008ed5 0x0 /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/libgcc.a(_udivsi3.o)
|
||||
.data 0x0000000000008ed5 0x0 /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/libgcc.a(_dvmd_tls.o)
|
||||
.data 0x0000000000008ed5 0x0 /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/libc.a(lib_a-init.o)
|
||||
.data 0x0000000000008ed5 0x0 /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/libc.a(lib_a-memset.o)
|
||||
.data 0x0000000000008ed5 0x0 /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/crtend.o
|
||||
.data 0x0000000000008ed5 0x0 /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/crtn.o
|
||||
|
||||
.data1
|
||||
*(.data1)
|
||||
0x0000000000008ed5 _edata = .
|
||||
[!provide] PROVIDE (edata, .)
|
||||
0x0000000000008ed5 . = .
|
||||
0x0000000000008ed5 __bss_start = .
|
||||
0x0000000000008ed5 __bss_start__ = .
|
||||
|
||||
.bss 0x0000000000008ed8 0x20
|
||||
*(.dynbss)
|
||||
*(.bss .bss.* .gnu.linkonce.b.*)
|
||||
.bss 0x0000000000008ed8 0x0 /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/crti.o
|
||||
.bss 0x0000000000008ed8 0x1c /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/crtbegin.o
|
||||
.bss 0x0000000000008ef4 0x0 /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/crt0.o
|
||||
.bss 0x0000000000008ef4 0x0 test_priority.o
|
||||
.bss 0x0000000000008ef4 0x4 libserial.o
|
||||
.bss 0x0000000000008ef8 0x0 usyscall.o
|
||||
.bss 0x0000000000008ef8 0x0 /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/libgcc.a(_udivsi3.o)
|
||||
.bss 0x0000000000008ef8 0x0 /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/libgcc.a(_dvmd_tls.o)
|
||||
.bss 0x0000000000008ef8 0x0 /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/libc.a(lib_a-init.o)
|
||||
.bss 0x0000000000008ef8 0x0 /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/libc.a(lib_a-memset.o)
|
||||
.bss 0x0000000000008ef8 0x0 /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/crtend.o
|
||||
.bss 0x0000000000008ef8 0x0 /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/crtn.o
|
||||
*(COMMON)
|
||||
0x0000000000008ef8 . = ALIGN ((. != 0x0)?0x4:0x1)
|
||||
0x0000000000008ef8 _bss_end__ = .
|
||||
0x0000000000008ef8 __bss_end__ = .
|
||||
0x0000000000008ef8 . = ALIGN (0x4)
|
||||
0x0000000000008ef8 . = SEGMENT_START ("ldata-segment", .)
|
||||
0x0000000000008ef8 . = ALIGN (0x4)
|
||||
0x0000000000008ef8 __end__ = .
|
||||
0x0000000000008ef8 _end = .
|
||||
[!provide] PROVIDE (end, .)
|
||||
|
||||
.stab
|
||||
*(.stab)
|
||||
|
||||
.stabstr
|
||||
*(.stabstr)
|
||||
|
||||
.stab.excl
|
||||
*(.stab.excl)
|
||||
|
||||
.stab.exclstr
|
||||
*(.stab.exclstr)
|
||||
|
||||
.stab.index
|
||||
*(.stab.index)
|
||||
|
||||
.stab.indexstr
|
||||
*(.stab.indexstr)
|
||||
|
||||
.comment 0x0000000000000000 0x7f
|
||||
*(.comment)
|
||||
.comment 0x0000000000000000 0x7f test_priority.o
|
||||
0x80 (size before relaxing)
|
||||
.comment 0x000000000000007f 0x80 libserial.o
|
||||
.comment 0x000000000000007f 0x80 usyscall.o
|
||||
|
||||
.debug
|
||||
*(.debug)
|
||||
|
||||
.line
|
||||
*(.line)
|
||||
|
||||
.debug_srcinfo
|
||||
*(.debug_srcinfo)
|
||||
|
||||
.debug_sfnames
|
||||
*(.debug_sfnames)
|
||||
|
||||
.debug_aranges 0x0000000000000000 0x60
|
||||
*(.debug_aranges)
|
||||
.debug_aranges
|
||||
0x0000000000000000 0x20 test_priority.o
|
||||
.debug_aranges
|
||||
0x0000000000000020 0x20 libserial.o
|
||||
.debug_aranges
|
||||
0x0000000000000040 0x20 usyscall.o
|
||||
|
||||
.debug_pubnames
|
||||
*(.debug_pubnames)
|
||||
|
||||
.debug_info 0x0000000000000000 0x23e8
|
||||
*(.debug_info .gnu.linkonce.wi.*)
|
||||
.debug_info 0x0000000000000000 0x967 test_priority.o
|
||||
.debug_info 0x0000000000000967 0xd7f libserial.o
|
||||
.debug_info 0x00000000000016e6 0xd02 usyscall.o
|
||||
|
||||
.debug_abbrev 0x0000000000000000 0x66d
|
||||
*(.debug_abbrev)
|
||||
.debug_abbrev 0x0000000000000000 0x1cc test_priority.o
|
||||
.debug_abbrev 0x00000000000001cc 0x283 libserial.o
|
||||
.debug_abbrev 0x000000000000044f 0x21e usyscall.o
|
||||
|
||||
.debug_line 0x0000000000000000 0x554
|
||||
*(.debug_line .debug_line.* .debug_line_end)
|
||||
.debug_line 0x0000000000000000 0x17f test_priority.o
|
||||
.debug_line 0x000000000000017f 0x1e1 libserial.o
|
||||
.debug_line 0x0000000000000360 0x1f4 usyscall.o
|
||||
|
||||
.debug_frame 0x0000000000000000 0x3b4
|
||||
*(.debug_frame)
|
||||
.debug_frame 0x0000000000000000 0x50 test_priority.o
|
||||
.debug_frame 0x0000000000000050 0xc8 libserial.o
|
||||
.debug_frame 0x0000000000000118 0x218 usyscall.o
|
||||
.debug_frame 0x0000000000000330 0x20 /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/libgcc.a(_udivsi3.o)
|
||||
.debug_frame 0x0000000000000350 0x34 /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/libc.a(lib_a-init.o)
|
||||
.debug_frame 0x0000000000000384 0x30 /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/libc.a(lib_a-memset.o)
|
||||
|
||||
.debug_str 0x0000000000000000 0x9a6
|
||||
*(.debug_str)
|
||||
.debug_str 0x0000000000000000 0x5b0 test_priority.o
|
||||
0x640 (size before relaxing)
|
||||
.debug_str 0x00000000000005b0 0x20c libserial.o
|
||||
0x7d4 (size before relaxing)
|
||||
.debug_str 0x00000000000007bc 0x1ea usyscall.o
|
||||
0x825 (size before relaxing)
|
||||
|
||||
.debug_loc
|
||||
*(.debug_loc)
|
||||
|
||||
.debug_macinfo
|
||||
*(.debug_macinfo)
|
||||
|
||||
.debug_weaknames
|
||||
*(.debug_weaknames)
|
||||
|
||||
.debug_funcnames
|
||||
*(.debug_funcnames)
|
||||
|
||||
.debug_typenames
|
||||
*(.debug_typenames)
|
||||
|
||||
.debug_varnames
|
||||
*(.debug_varnames)
|
||||
|
||||
.debug_pubtypes
|
||||
*(.debug_pubtypes)
|
||||
|
||||
.debug_ranges
|
||||
*(.debug_ranges)
|
||||
|
||||
.debug_macro
|
||||
*(.debug_macro)
|
||||
|
||||
.debug_addr
|
||||
*(.debug_addr)
|
||||
|
||||
.stack 0x0000000000080000 0x0
|
||||
0x0000000000080000 _stack = .
|
||||
*(.stack)
|
||||
|
||||
.ARM.attributes
|
||||
0x0000000000000000 0x2b
|
||||
*(.ARM.attributes)
|
||||
.ARM.attributes
|
||||
0x0000000000000000 0x16 /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/crti.o
|
||||
.ARM.attributes
|
||||
0x0000000000000016 0x30 /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/crtbegin.o
|
||||
.ARM.attributes
|
||||
0x0000000000000046 0x14 /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/crt0.o
|
||||
.ARM.attributes
|
||||
0x000000000000005a 0x2f test_priority.o
|
||||
.ARM.attributes
|
||||
0x0000000000000089 0x2f libserial.o
|
||||
.ARM.attributes
|
||||
0x00000000000000b8 0x2f usyscall.o
|
||||
.ARM.attributes
|
||||
0x00000000000000e7 0x18 /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/libgcc.a(_udivsi3.o)
|
||||
.ARM.attributes
|
||||
0x00000000000000ff 0x18 /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/libgcc.a(_dvmd_tls.o)
|
||||
.ARM.attributes
|
||||
0x0000000000000117 0x30 /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/libc.a(lib_a-init.o)
|
||||
.ARM.attributes
|
||||
0x0000000000000147 0x30 /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/libc.a(lib_a-memset.o)
|
||||
.ARM.attributes
|
||||
0x0000000000000177 0x30 /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/crtend.o
|
||||
.ARM.attributes
|
||||
0x00000000000001a7 0x18 /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/crtn.o
|
||||
*(.gnu.attributes)
|
||||
|
||||
.note.gnu.arm.ident
|
||||
*(.note.gnu.arm.ident)
|
||||
|
||||
/DISCARD/
|
||||
*(.note.GNU-stack)
|
||||
*(.gnu_debuglink)
|
||||
*(.gnu.lto_*)
|
||||
OUTPUT(test_priority elf32-littlearm)
|
||||
|
||||
Cross Reference Table
|
||||
|
||||
Symbol File
|
||||
_Jv_RegisterClasses /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/crtbegin.o
|
||||
__aeabi_idiv0 /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/libgcc.a(_dvmd_tls.o)
|
||||
/opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/libgcc.a(_udivsi3.o)
|
||||
__aeabi_ldiv0 /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/libgcc.a(_dvmd_tls.o)
|
||||
__aeabi_uidiv /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/libgcc.a(_udivsi3.o)
|
||||
libserial.o
|
||||
__aeabi_uidivmod /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/libgcc.a(_udivsi3.o)
|
||||
libserial.o
|
||||
__bss_end__ /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/crt0.o
|
||||
__bss_start__ /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/crt0.o
|
||||
__deregister_frame_info /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/crtbegin.o
|
||||
__dso_handle /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/crtbegin.o
|
||||
__init_array_end /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/libc.a(lib_a-init.o)
|
||||
__init_array_start /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/libc.a(lib_a-init.o)
|
||||
__libc_fini_array /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/crt0.o
|
||||
__libc_init_array /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/libc.a(lib_a-init.o)
|
||||
/opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/crt0.o
|
||||
__preinit_array_end /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/libc.a(lib_a-init.o)
|
||||
__preinit_array_start /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/libc.a(lib_a-init.o)
|
||||
__register_frame_info /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/crtbegin.o
|
||||
__stack /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/crt0.o
|
||||
__udivsi3 /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/libgcc.a(_udivsi3.o)
|
||||
_fini /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/crti.o
|
||||
_init /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/crti.o
|
||||
/opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/libc.a(lib_a-init.o)
|
||||
_mainCRTStartup /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/crt0.o
|
||||
_start /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/crt0.o
|
||||
atexit /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/crt0.o
|
||||
close_session usyscall.o
|
||||
exit usyscall.o
|
||||
test_priority.o
|
||||
/opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/crt0.o
|
||||
get_memblock_info usyscall.o
|
||||
getc libserial.o
|
||||
hardware_init_hook /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/crt0.o
|
||||
main test_priority.o
|
||||
/opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/crt0.o
|
||||
memset /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/libc.a(lib_a-memset.o)
|
||||
/opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/crt0.o
|
||||
mmap usyscall.o
|
||||
libserial.o
|
||||
poll_session usyscall.o
|
||||
printf libserial.o
|
||||
test_priority.o
|
||||
register_irq usyscall.o
|
||||
register_server usyscall.o
|
||||
session usyscall.o
|
||||
set_priority usyscall.o
|
||||
test_priority.o
|
||||
show_cpu usyscall.o
|
||||
show_mem usyscall.o
|
||||
show_task usyscall.o
|
||||
software_init_hook /opt/gcc-arm-none-eabi-6-2017-q1-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/crt0.o
|
||||
spawn usyscall.o
|
||||
task_heap_base usyscall.o
|
||||
yield usyscall.o
|
||||
@@ -1,114 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2020 AIIT XUOS Lab
|
||||
* XiUOS is licensed under Mulan PSL v2.
|
||||
* You can use this software according to the terms and conditions of the Mulan PSL v2.
|
||||
* You may obtain a copy of Mulan PSL v2 at:
|
||||
* http://license.coscl.org.cn/MulanPSL2
|
||||
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
* See the Mulan PSL v2 for more details.
|
||||
*/
|
||||
#include "usyscall.h"
|
||||
|
||||
static int
|
||||
syscall(int sys_num, intptr_t a1, intptr_t a2, intptr_t a3, intptr_t a4)
|
||||
{
|
||||
int ret = -1;
|
||||
|
||||
__asm__ volatile(
|
||||
"mov r0, %1;\
|
||||
mov r1, %2;\
|
||||
mov r2, %3;\
|
||||
mov r3, %4;\
|
||||
mov r4, %5;\
|
||||
swi 0;\
|
||||
dsb;\
|
||||
isb;\
|
||||
mov %0, r0"
|
||||
: "=r"(ret)
|
||||
: "r"(sys_num), "r"(a1), "r"(a2), "r"(a3), "r"(a4)
|
||||
: "memory", "r0", "r1", "r2", "r3", "r4");
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int spawn(struct Session* session, int fd, ipc_read_fn ipc_read, char* name, char** argv)
|
||||
{
|
||||
struct KernReadTool read_tool = {
|
||||
.session = session,
|
||||
.fd = fd,
|
||||
.ipc_read = ipc_read,
|
||||
};
|
||||
return syscall(SYSCALL_SPAWN, (intptr_t)&read_tool, (intptr_t)name, (intptr_t)argv, 0);
|
||||
}
|
||||
|
||||
int exit()
|
||||
{
|
||||
return syscall(SYSCALL_EXIT, 0, 0, 0, 0);
|
||||
}
|
||||
|
||||
int yield()
|
||||
{
|
||||
return syscall(SYSCALL_YIELD, 0, 0, 0, 0);
|
||||
}
|
||||
|
||||
int register_server(char* name)
|
||||
{
|
||||
return syscall(SYSCALL_SERVER, (intptr_t)name, 0, 0, 0);
|
||||
}
|
||||
|
||||
int session(char* path, int capacity, struct Session* user_session)
|
||||
{
|
||||
return syscall(SYSCALL_SESSION, (intptr_t)path, (intptr_t)capacity, (intptr_t)user_session, 0);
|
||||
}
|
||||
|
||||
int poll_session(struct Session* userland_session_arr, int arr_capacity)
|
||||
{
|
||||
return syscall(SYSCALL_POLL_SESSION, (intptr_t)userland_session_arr, (intptr_t)arr_capacity, 0, 0);
|
||||
}
|
||||
|
||||
int close_session(struct Session* session)
|
||||
{
|
||||
return syscall(SYSCALL_CLOSE_SESSION, (intptr_t)session, 0, 0, 0);
|
||||
}
|
||||
|
||||
int get_memblock_info(sys_state_info* info)
|
||||
{
|
||||
return syscall(SYSCALL_SYS_STATE, SYS_STATE_MEMBLOCK_INFO, (intptr_t)info, 0, 0);
|
||||
}
|
||||
|
||||
int set_priority(sys_state_info* info)
|
||||
{
|
||||
return syscall(SYSCALL_SYS_STATE, SYS_STATE_SET_TASK_PRIORITY, (intptr_t)info, 0, 0);
|
||||
}
|
||||
|
||||
int task_heap_base()
|
||||
{
|
||||
return syscall(SYSCALL_SYS_STATE, SYS_STATE_GET_HEAP_BASE, 0, 0, 0);
|
||||
}
|
||||
|
||||
int show_task()
|
||||
{
|
||||
return syscall(SYSCALL_SYS_STATE, SYS_STATE_SHOW_TASKS, 0, 0, 0);
|
||||
}
|
||||
|
||||
int show_mem()
|
||||
{
|
||||
return syscall(SYSCALL_SYS_STATE, SYS_STATE_SHOW_MEM_INFO, 0, 0, 0);
|
||||
}
|
||||
|
||||
int show_cpu()
|
||||
{
|
||||
return syscall(SYSCALL_SYS_STATE, SYS_STATE_SHOW_CPU_INFO, 0, 0, 0);
|
||||
}
|
||||
|
||||
int mmap(uintptr_t vaddr, uintptr_t paddr, int len, bool is_dev)
|
||||
{
|
||||
return syscall(SYSCALL_MMAP, vaddr, paddr, (intptr_t)len, (intptr_t)is_dev);
|
||||
}
|
||||
|
||||
int register_irq(int irq, int opcode)
|
||||
{
|
||||
return syscall(SYSCALL_REGISTER_IRQ, (intptr_t)irq, (intptr_t)opcode, 0, 0);
|
||||
}
|
||||
@@ -1,76 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2020 AIIT XUOS Lab
|
||||
* XiUOS is licensed under Mulan PSL v2.
|
||||
* You can use this software according to the terms and conditions of the Mulan PSL v2.
|
||||
* You may obtain a copy of Mulan PSL v2 at:
|
||||
* http://license.coscl.org.cn/MulanPSL2
|
||||
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
* See the Mulan PSL v2 for more details.
|
||||
*/
|
||||
#pragma once
|
||||
#include <stdint.h>
|
||||
|
||||
#include "libserial.h"
|
||||
#include "session.h"
|
||||
|
||||
// clang-format off
|
||||
#define SYSCALL_TEST 0
|
||||
#define SYSCALL_SPAWN 1 // generate a brand new task to run elf
|
||||
#define SYSCALL_EXIT 2 // exit task, delete the task cb
|
||||
#define SYSCALL_YIELD 3 // yield task, go to scheduler
|
||||
|
||||
#define SYSCALL_MMAP 4 // map a virt page to phy page
|
||||
#define SYSCALL_SERVER 5 // register current task as a server
|
||||
#define SYSCALL_SESSION 6 // create a session to a server
|
||||
#define SYSCALL_POLL_SESSION 7 // server poll for it's server sessions
|
||||
#define SYSCALL_CLOSE_SESSION 8 // client close it's client sessions
|
||||
|
||||
#define SYSCALL_EXEC 9 // run elf using current task
|
||||
#define SYSCALL_SYS_STATE 10 // run system state
|
||||
#define SYSCALL_REGISTER_IRQ 11 //
|
||||
// clang-format on
|
||||
|
||||
typedef enum {
|
||||
SYS_STATE_TEST = 0,
|
||||
SYS_STATE_SET_TASK_PRIORITY,
|
||||
SYS_STATE_GET_HEAP_BASE,
|
||||
SYS_STATE_MEMBLOCK_INFO,
|
||||
SYS_STATE_SHOW_TASKS,
|
||||
SYS_STATE_SHOW_MEM_INFO,
|
||||
SYS_STATE_SHOW_CPU_INFO,
|
||||
} sys_state_option;
|
||||
|
||||
typedef union {
|
||||
struct {
|
||||
uintptr_t memblock_start;
|
||||
uintptr_t memblock_end;
|
||||
} memblock_info;
|
||||
int priority;
|
||||
} sys_state_info;
|
||||
|
||||
typedef int (*ipc_read_fn)(struct Session* session, int fd, char* dst, int offset, int len);
|
||||
typedef int (*ipc_write_fn)(struct Session* session, int fd, char* src, int offset, int len);
|
||||
|
||||
struct KernReadTool {
|
||||
struct Session* session;
|
||||
int fd;
|
||||
ipc_read_fn ipc_read;
|
||||
};
|
||||
|
||||
int spawn(struct Session* session, int fd, ipc_read_fn ipc_read, char* name, char** argv);
|
||||
int exit();
|
||||
int yield();
|
||||
int register_server(char* name);
|
||||
int session(char* path, int capacity, struct Session* user_session);
|
||||
int poll_session(struct Session* userland_session_arr, int arr_capacity);
|
||||
int close_session(struct Session* session);
|
||||
int task_heap_base();
|
||||
int get_memblock_info(sys_state_info* info);
|
||||
int set_priority(sys_state_info* info);
|
||||
int show_task();
|
||||
int show_mem();
|
||||
int show_cpu();
|
||||
int mmap(uintptr_t vaddr, uintptr_t paddr, int len, bool is_dev);
|
||||
int register_irq(int irq, int opcode);
|
||||
@@ -1,18 +0,0 @@
|
||||
#ifndef XS_CONFIG_H__
|
||||
#define XS_CONFIG_H__
|
||||
|
||||
/* Automatically generated file; DO NOT EDIT. */
|
||||
/* XiZi_AIoT Project Configuration */
|
||||
|
||||
#define BOARD_IMX6Q_SABRELITE
|
||||
#define ARCH_ARM
|
||||
|
||||
/* imx6q sabrelite feature */
|
||||
|
||||
/* Lib */
|
||||
|
||||
#define LIB
|
||||
#define LIB_POSIX
|
||||
#define LIB_NEWLIB
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,31 @@
|
||||
ifeq ($(BOARD), imx6q-sabrelite)
|
||||
toolchain ?= arm-none-eabi-
|
||||
user_ldflags = -N -Ttext 0
|
||||
cflags = -std=c11 -march=armv7-a -mtune=cortex-a9 -nostdlib -nodefaultlibs -mfloat-abi=soft -fno-pic -static -fno-builtin -fno-strict-aliasing -Wall -ggdb -Wno-unused -Werror -fno-omit-frame-pointer -fno-stack-protector -fno-pie
|
||||
endif
|
||||
ifeq ($(BOARD), zynq7000-zc702)
|
||||
toolchain ?= arm-xilinx-eabi-
|
||||
user_ldflags = --start-group,-lgcc,-lc,--end-group
|
||||
cflags = -std=c11 -march=armv7-a -mtune=cortex-a9 -nostdlib -nodefaultlibs -mfloat-abi=soft -fno-pic -static -fno-builtin -fno-strict-aliasing -Wall -ggdb -Wno-unused -Werror -fno-omit-frame-pointer -fno-stack-protector -fno-pie
|
||||
#cflags = -Wall -g -std=c11
|
||||
endif
|
||||
cc = ${toolchain}gcc
|
||||
ld = ${toolchain}g++
|
||||
objdump = ${toolchain}objdump
|
||||
|
||||
c_useropts = -O0
|
||||
|
||||
INC_DIR = -I$(KERNEL_ROOT)/services/fs/libfs \
|
||||
-I$(KERNEL_ROOT)/services/fs/fs_server/include \
|
||||
-I$(KERNEL_ROOT)/services/lib/ipc \
|
||||
-I$(KERNEL_ROOT)/services/boards/$(BOARD) \
|
||||
-I$(KERNEL_ROOT)/services/app
|
||||
|
||||
libserial: libserial.o stub.o
|
||||
@mv $^ ../../app
|
||||
|
||||
%.o: %.c
|
||||
@echo "cc $^"
|
||||
@${cc} ${cflags} ${c_useropts} ${INC_DIR} -o $@ -c $^
|
||||
|
||||
include $(KERNEL_ROOT)/compiler.mk
|
||||
@@ -0,0 +1,162 @@
|
||||
/*
|
||||
* Copyright (c) 2020 AIIT XUOS Lab
|
||||
* XiUOS is licensed under Mulan PSL v2.
|
||||
* You can use this software according to the terms and conditions of the Mulan PSL v2.
|
||||
* You may obtain a copy of Mulan PSL v2 at:
|
||||
* http://license.coscl.org.cn/MulanPSL2
|
||||
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
* See the Mulan PSL v2 for more details.
|
||||
*/
|
||||
|
||||
/// this file is only used for debug
|
||||
#include "libserial.h"
|
||||
#include "usyscall.h"
|
||||
|
||||
uint32_t Xil_In32(intptr_t Addr)
|
||||
{
|
||||
return *(volatile uint32_t*)Addr;
|
||||
}
|
||||
void Xil_Out32(intptr_t Addr, uint32_t Value)
|
||||
{
|
||||
uint32_t* LocalAddr = (uint32_t*)Addr;
|
||||
*LocalAddr = Value;
|
||||
}
|
||||
#define XUartPs_IsTransmitFull(BaseAddress) \
|
||||
((*(volatile uint32_t*)((BaseAddress) + 0x002CU) & (uint32_t)0x00000010U) == (uint32_t)0x00000010U)
|
||||
#define XUartPs_WriteReg(BaseAddress, RegOffset, RegisterValue) \
|
||||
Xil_Out32((BaseAddress) + (uint32_t)(RegOffset), (uint32_t)(RegisterValue))
|
||||
|
||||
#define XUartPs_ReadReg(BaseAddress, RegOffset) \
|
||||
Xil_In32((BaseAddress) + (uint32_t)(RegOffset))
|
||||
#define XUartPs_IsReceiveData(BaseAddress) \
|
||||
!((Xil_In32((BaseAddress) + 0x002CU) & (uint32_t)0x00000002U) == (uint32_t)0x00000002U)
|
||||
|
||||
uint8_t XUartPs_RecvByte(uint32_t BaseAddress)
|
||||
{
|
||||
uint32_t RecievedByte;
|
||||
/* Wait until there is data */
|
||||
while (!XUartPs_IsReceiveData(BaseAddress)) {
|
||||
;
|
||||
}
|
||||
RecievedByte = XUartPs_ReadReg(BaseAddress, 0x0030U);
|
||||
/* Return the byte received */
|
||||
return (uint8_t)RecievedByte;
|
||||
}
|
||||
|
||||
#define USER_UART_BASE 0x6FFFF000
|
||||
|
||||
static bool init_uart_mmio()
|
||||
{
|
||||
static int mapped = 0;
|
||||
if (mapped == 0) {
|
||||
if (-1 == mmap(USER_UART_BASE, 0xE0001000, 4096, true)) {
|
||||
return false;
|
||||
}
|
||||
mapped = 1;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
static void putc(char c)
|
||||
{
|
||||
if (c == '\n') {
|
||||
while (XUartPs_IsTransmitFull(USER_UART_BASE)) {
|
||||
;
|
||||
}
|
||||
|
||||
XUartPs_WriteReg(USER_UART_BASE, 0x0030U, (uint32_t)'\r');
|
||||
}
|
||||
|
||||
while (XUartPs_IsTransmitFull(USER_UART_BASE)) {
|
||||
;
|
||||
}
|
||||
|
||||
XUartPs_WriteReg(USER_UART_BASE, 0x0030U, (uint32_t)c);
|
||||
}
|
||||
|
||||
char getc(void)
|
||||
{
|
||||
if (!init_uart_mmio()) {
|
||||
return 0xFF;
|
||||
}
|
||||
return XUartPs_RecvByte(USER_UART_BASE);
|
||||
}
|
||||
|
||||
static void printint(int xx, int base, int sgn)
|
||||
{
|
||||
static char digits[] = "0123456789ABCDEF";
|
||||
char buf[16];
|
||||
int i, neg;
|
||||
uint32_t x;
|
||||
|
||||
neg = 0;
|
||||
if (sgn && xx < 0) {
|
||||
neg = 1;
|
||||
x = -xx;
|
||||
} else {
|
||||
x = xx;
|
||||
}
|
||||
|
||||
i = 0;
|
||||
do {
|
||||
buf[i++] = digits[x % base];
|
||||
} while ((x /= base) != 0);
|
||||
if (neg)
|
||||
buf[i++] = '-';
|
||||
|
||||
while (--i >= 0)
|
||||
putc(buf[i]);
|
||||
}
|
||||
|
||||
// Print to usart. Only understands %d, %x, %p, %s.
|
||||
void printf(char* fmt, ...)
|
||||
{
|
||||
if (!init_uart_mmio()) {
|
||||
return;
|
||||
}
|
||||
char* s;
|
||||
int c, i, state;
|
||||
uint32_t* ap;
|
||||
|
||||
state = 0;
|
||||
ap = (uint32_t*)(void*)&fmt + 1;
|
||||
for (i = 0; fmt[i]; i++) {
|
||||
c = fmt[i] & 0xff;
|
||||
if (state == 0) {
|
||||
if (c == '%') {
|
||||
state = '%';
|
||||
} else {
|
||||
putc(c);
|
||||
}
|
||||
} else if (state == '%') {
|
||||
if (c == 'd') {
|
||||
printint(*ap, 10, 1);
|
||||
ap++;
|
||||
} else if (c == 'x' || c == 'p') {
|
||||
printint(*ap, 16, 0);
|
||||
ap++;
|
||||
} else if (c == 's') {
|
||||
s = (char*)*ap;
|
||||
ap++;
|
||||
if (s == 0)
|
||||
s = "(null)";
|
||||
while (*s != 0) {
|
||||
putc(*s);
|
||||
s++;
|
||||
}
|
||||
} else if (c == 'c') {
|
||||
putc(*ap);
|
||||
ap++;
|
||||
} else if (c == '%') {
|
||||
putc(c);
|
||||
} else {
|
||||
// Unknown % sequence. Print it to draw attention.
|
||||
putc('%');
|
||||
putc(c);
|
||||
}
|
||||
state = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
+4
-7
@@ -9,13 +9,10 @@
|
||||
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
* See the Mulan PSL v2 for more details.
|
||||
*/
|
||||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "libipc.h"
|
||||
/// this file is only used for debug
|
||||
#pragma once
|
||||
|
||||
IPC_SERVICES(IpcSimpleServer, Ipc_add, Ipc_hello_string);
|
||||
void printf(char* fmt, ...);
|
||||
|
||||
int add(struct Session* session, int a, int b);
|
||||
int hello_string(struct Session* session, char* buf, int len);
|
||||
struct IpcMsg* hello_string_nowait(struct Session* session, char** buf, int len);
|
||||
char getc();
|
||||
@@ -0,0 +1,91 @@
|
||||
/*
|
||||
* Copyright (c) 2020 AIIT XUOS Lab
|
||||
* XiUOS is licensed under Mulan PSL v2.
|
||||
* You can use this software according to the terms and conditions of the Mulan PSL v2.
|
||||
* You may obtain a copy of Mulan PSL v2 at:
|
||||
* http://license.coscl.org.cn/MulanPSL2
|
||||
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
* See the Mulan PSL v2 for more details.
|
||||
*/
|
||||
|
||||
#include <stddef.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
// _exit: 用于退出程序
|
||||
void _exit(int status)
|
||||
{
|
||||
while (1) { }
|
||||
}
|
||||
|
||||
// _sbrk: 用于增加程序的数据空间
|
||||
void* _sbrk(ptrdiff_t incr)
|
||||
{
|
||||
extern char end; /* Defined by the linker */
|
||||
static char* heap_end;
|
||||
char* prev_heap_end;
|
||||
|
||||
if (heap_end == 0) {
|
||||
heap_end = &end;
|
||||
}
|
||||
prev_heap_end = heap_end;
|
||||
|
||||
// 在这里,你应该添加一些检查来确保堆不会与栈或其他内存区域冲突
|
||||
// 例如,检查 incr 是否会导致堆超出预定的内存区域
|
||||
|
||||
heap_end += incr;
|
||||
return (void*)prev_heap_end;
|
||||
}
|
||||
|
||||
// _write: 用于将数据写入文件描述符
|
||||
ssize_t _write(int file, const void* ptr, size_t len)
|
||||
{
|
||||
// 在这里,你需要实现将数据写入文件描述符的逻辑
|
||||
// 如果你的系统不支持文件系统,你可以将数据发送到串口或其他输出
|
||||
|
||||
return len; // 假设所有数据都被写入
|
||||
}
|
||||
|
||||
// _close: 用于关闭文件描述符
|
||||
int _close(int file)
|
||||
{
|
||||
return -1; // 表示失败,因为没有实际关闭文件的功能
|
||||
}
|
||||
|
||||
// _fstat: 用于获取文件状态
|
||||
int _fstat(int file, struct stat* st)
|
||||
{
|
||||
return 0; // 表示成功
|
||||
}
|
||||
|
||||
// _isatty: 检查文件描述符是否指向TTY设备
|
||||
int _isatty(int file)
|
||||
{
|
||||
return 1; // 表示是TTY设备
|
||||
}
|
||||
|
||||
// _lseek: 用于重新定位文件读/写的位置
|
||||
off_t _lseek(int file, off_t offset, int whence)
|
||||
{
|
||||
return -1; // 表示失败,因为不支持文件定位
|
||||
}
|
||||
|
||||
// _read: 用于从文件描述符读取数据
|
||||
ssize_t _read(int file, void* ptr, size_t len)
|
||||
{
|
||||
return 0; // 表示没有数据被读取
|
||||
}
|
||||
|
||||
// _kill: 发送信号给进程
|
||||
int _kill(int pid, int sig)
|
||||
{
|
||||
return -1; // 表示失败,因为不支持信号
|
||||
}
|
||||
|
||||
// _getpid: 获取进程ID
|
||||
int _getpid()
|
||||
{
|
||||
return 1; // 返回假设的进程ID
|
||||
}
|
||||
Reference in New Issue
Block a user