解决指定内存区域分配时,缺页模拟的内存还是使用的第一块
This commit is contained in:
@@ -25,42 +25,42 @@ add_subdirectory(cutest)
|
||||
add_subdirectory(fd)
|
||||
|
||||
|
||||
add_custom_target(
|
||||
mkrtos_static_libc ALL
|
||||
#以下命令用于生成binutils链接需要的库
|
||||
COMMAND
|
||||
cd ${CMAKE_SOURCE_DIR}/build
|
||||
COMMAND
|
||||
rm -f -r usr_lib
|
||||
COMMAND
|
||||
mkdir -p usr_lib
|
||||
COMMAND
|
||||
find mkrtos_user -name "*.a" | xargs cp -t usr_lib
|
||||
COMMAND
|
||||
cd usr_lib
|
||||
COMMAND
|
||||
${CMAKE_AR} x libmuslc.a
|
||||
COMMAND
|
||||
${CMAKE_AR} x liblibc_be.a
|
||||
COMMAND
|
||||
${CMAKE_AR} x libsys.a
|
||||
COMMAND
|
||||
${CMAKE_AR} x libsys_svr.a
|
||||
COMMAND
|
||||
${CMAKE_AR} x libsys_util.a
|
||||
COMMAND
|
||||
${CMAKE_AR} x libutil.a
|
||||
COMMAND
|
||||
${CMAKE_AR} cr libnewc.a *.obj
|
||||
COMMAND
|
||||
rm *.obj
|
||||
)
|
||||
add_dependencies(
|
||||
mkrtos_static_libc
|
||||
muslc
|
||||
libc_be
|
||||
sys
|
||||
sys_svr
|
||||
sys_util
|
||||
util
|
||||
)
|
||||
# add_custom_target(
|
||||
# mkrtos_static_libc ALL
|
||||
# #以下命令用于生成binutils链接需要的库
|
||||
# COMMAND
|
||||
# cd ${CMAKE_SOURCE_DIR}/build
|
||||
# COMMAND
|
||||
# rm -f -r usr_lib
|
||||
# COMMAND
|
||||
# mkdir -p usr_lib
|
||||
# COMMAND
|
||||
# find mkrtos_user -name "*.a" | xargs cp -t usr_lib
|
||||
# COMMAND
|
||||
# cd usr_lib
|
||||
# COMMAND
|
||||
# ${CMAKE_AR} x libmuslc.a
|
||||
# COMMAND
|
||||
# ${CMAKE_AR} x liblibc_be.a
|
||||
# COMMAND
|
||||
# ${CMAKE_AR} x libsys.a
|
||||
# COMMAND
|
||||
# ${CMAKE_AR} x libsys_svr.a
|
||||
# COMMAND
|
||||
# ${CMAKE_AR} x libsys_util.a
|
||||
# COMMAND
|
||||
# ${CMAKE_AR} x libutil.a
|
||||
# COMMAND
|
||||
# ${CMAKE_AR} cr libnewc.a *.obj
|
||||
# COMMAND
|
||||
# rm *.obj
|
||||
# )
|
||||
# add_dependencies(
|
||||
# mkrtos_static_libc
|
||||
# muslc
|
||||
# libc_be
|
||||
# sys
|
||||
# sys_svr
|
||||
# sys_util
|
||||
# util
|
||||
# )
|
||||
|
||||
@@ -75,11 +75,11 @@ int ls(int argc, char *agrv[])
|
||||
SHELL_EXPORT_CMD(SHELL_CMD_PERMISSION(0) | SHELL_CMD_TYPE(SHELL_TYPE_CMD_MAIN), ls, ls, ls command);
|
||||
int cp(int argc, char *argv[])
|
||||
{
|
||||
#define BUFFER_SIZE 64
|
||||
#define BUFFER_SIZE 1024
|
||||
|
||||
int source_fd, target_fd;
|
||||
ssize_t bytes_read, bytes_written;
|
||||
char buffer[BUFFER_SIZE];
|
||||
char *buffer;
|
||||
int ret;
|
||||
|
||||
// 检查参数数量
|
||||
@@ -88,12 +88,19 @@ int cp(int argc, char *argv[])
|
||||
fprintf(stderr, "example: %s /bin/a.bin /mnt/a.bin\n", argv[0]);
|
||||
return -1;
|
||||
}
|
||||
|
||||
// 分配缓冲区
|
||||
buffer = (char *)u_malloc(BUFFER_SIZE);
|
||||
if (buffer == NULL)
|
||||
{
|
||||
perror("malloc buffer is error.\n");
|
||||
return -1;
|
||||
}
|
||||
// 打开源文件
|
||||
source_fd = open(argv[1], O_RDONLY);
|
||||
if (source_fd == -1)
|
||||
{
|
||||
perror("can not open src file.\n");
|
||||
u_free(buffer);
|
||||
return -1;
|
||||
}
|
||||
struct stat st = {0};
|
||||
@@ -106,11 +113,13 @@ int cp(int argc, char *argv[])
|
||||
{
|
||||
perror("can not open dest file.");
|
||||
close(source_fd);
|
||||
u_free(buffer);
|
||||
return -1;
|
||||
}
|
||||
if (ftruncate(target_fd, st.st_size) < 0)
|
||||
{
|
||||
printf("to set fiel size is error.\n");
|
||||
u_free(buffer);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -123,6 +132,7 @@ int cp(int argc, char *argv[])
|
||||
perror("write file is error.\n");
|
||||
close(source_fd);
|
||||
close(target_fd);
|
||||
u_free(buffer);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@@ -135,7 +145,7 @@ int cp(int argc, char *argv[])
|
||||
// 关闭文件
|
||||
close(source_fd);
|
||||
close(target_fd);
|
||||
|
||||
u_free(buffer);
|
||||
printf("cp file is success.\n");
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -1473,7 +1473,7 @@ void shellExec(Shell *shell)
|
||||
}
|
||||
if (shell->parser.param[shell->parser.paramCount - 1][0] == '@')
|
||||
{
|
||||
// 指定启动的mem,参数少一个
|
||||
// 指定启动的pid
|
||||
pid = atoi(&(shell->parser.param[shell->parser.paramCount - 1][1]));
|
||||
shell->parser.paramCount--;
|
||||
}
|
||||
|
||||
@@ -39,6 +39,30 @@
|
||||
|
||||
#define IS_ENABLED(option) __or(IS_BUILTIN(option), IS_MODULE(option))
|
||||
|
||||
static unsigned int mk_ffs(unsigned int x)
|
||||
{
|
||||
unsigned int ret;
|
||||
|
||||
__asm__ volatile("clz\t%0, %1"
|
||||
: "=r"(ret)
|
||||
: "r"(x)
|
||||
: "cc");
|
||||
ret = (sizeof(void *) * 8 - 1) - ret;
|
||||
return ret;
|
||||
}
|
||||
static inline unsigned long is_power_of_2(unsigned long num)
|
||||
{
|
||||
return (num & (num - 1)) == 0;
|
||||
}
|
||||
static inline unsigned long align_power_of_2(unsigned long num)
|
||||
{
|
||||
if (is_power_of_2(num))
|
||||
{
|
||||
return num;
|
||||
}
|
||||
return (1 << (mk_ffs(num) + 1));
|
||||
}
|
||||
|
||||
/* Import a binary file */
|
||||
#define IMPORT_BIN(sect, file, sym) asm (\
|
||||
".section " #sect "\n" /* Change section */\
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
#一次读取一行,每行代表启动的应用程序
|
||||
block /dev/block
|
||||
ram_block -p /dev/rblk -s 512 -n 2048 | 2
|
||||
appfs -m /bin -d /dev/block
|
||||
fatfs | 1
|
||||
fatfs -m /mnt -d /dev/rblk
|
||||
pin
|
||||
i2c
|
||||
pca9555
|
||||
display
|
||||
snd
|
||||
a_eth
|
||||
a_net
|
||||
# nes /bin/sm.nes
|
||||
a_net | 1
|
||||
# a_nes /bin/sm.nes
|
||||
sh
|
||||
@@ -15,7 +15,7 @@
|
||||
#define HEAP_SIZE (256 * 1024)
|
||||
#define STACK_SIZE (2 * 1024) //(1024 + 256)
|
||||
#else
|
||||
#define HEAP_SIZE (10 * 1024)
|
||||
#define HEAP_SIZE (1 * 1024)
|
||||
#define STACK_SIZE (2 * 1024) //(1024 + 256)
|
||||
#endif
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#include "ns.h"
|
||||
#ifdef MKRTOS
|
||||
#include <u_hd_man.h>
|
||||
#include <malloc.h>
|
||||
#include <u_malloc.h>
|
||||
#include <u_task.h>
|
||||
#endif
|
||||
// 其他进程可以注册节点进来,并且可以注册子节点进来,子节点可以注册更多的子节点进来。
|
||||
@@ -108,7 +108,7 @@ static ns_node_t *node_create(const char *name, node_type_t type, int pid)
|
||||
ns_node_t *tmp;
|
||||
|
||||
#ifdef MKRTOS
|
||||
tmp = calloc(sizeof(ns_node_t), 1);
|
||||
tmp = u_calloc(sizeof(ns_node_t), 1);
|
||||
#else
|
||||
tmp = calloc(sizeof(ns_node_t), 1);
|
||||
#endif
|
||||
@@ -258,7 +258,7 @@ int ns_delnode(const char *path)
|
||||
}
|
||||
cur_node->parent->ref--;
|
||||
#ifdef MKRTOS
|
||||
free(cur_node);
|
||||
u_free(cur_node);
|
||||
#else
|
||||
free(cur_node);
|
||||
#endif
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <dirent.h>
|
||||
#include <malloc.h>
|
||||
#include <u_malloc.h>
|
||||
#include <u_mutex.h>
|
||||
#include <u_hd_man.h>
|
||||
#include "ns.h"
|
||||
@@ -498,7 +498,7 @@ void fs_ns_del_file_by_pid(const char *path, pid_t pid)
|
||||
int path_len;
|
||||
|
||||
path_len = strlen(path) + 64;
|
||||
new_path = malloc(path_len);
|
||||
new_path = u_malloc(path_len);
|
||||
if (new_path == NULL)
|
||||
{
|
||||
return;
|
||||
@@ -507,7 +507,7 @@ void fs_ns_del_file_by_pid(const char *path, pid_t pid)
|
||||
fd = fs_ns_open(path, O_RDONLY, 0);
|
||||
if (fd < 0)
|
||||
{
|
||||
free(new_path);
|
||||
u_free(new_path);
|
||||
return;
|
||||
}
|
||||
while (1)
|
||||
@@ -540,6 +540,6 @@ void fs_ns_del_file_by_pid(const char *path, pid_t pid)
|
||||
fs_ns_remove(new_path);
|
||||
}
|
||||
}
|
||||
free(new_path);
|
||||
u_free(new_path);
|
||||
fs_ns_close(fd);
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#include "u_sig.h"
|
||||
#include "pm.h"
|
||||
#include "parse_cfg.h"
|
||||
#include "malloc.h"
|
||||
#include "u_malloc.h"
|
||||
#include "nsfs.h"
|
||||
#include "sig_cli.h"
|
||||
#include "tty.h"
|
||||
@@ -133,7 +133,7 @@ static void pm_del_watch_by_pid(pm_t *pm, pid_t pid)
|
||||
{
|
||||
slist_del(&pos->node);
|
||||
handler_free_umap(pos->sig_hd);
|
||||
free(pos);
|
||||
u_free(pos);
|
||||
}
|
||||
pos = next;
|
||||
}
|
||||
@@ -162,7 +162,7 @@ int pm_rpc_watch_pid(pm_t *pm, obj_handler_t sig_rcv_hd, pid_t pid, int flags)
|
||||
fflush(stdout);
|
||||
return -EEXIST;
|
||||
}
|
||||
watch_entry_t *entry = (watch_entry_t *)malloc(sizeof(watch_entry_t));
|
||||
watch_entry_t *entry = (watch_entry_t *)u_malloc(sizeof(watch_entry_t));
|
||||
|
||||
if (!entry)
|
||||
{
|
||||
@@ -220,7 +220,7 @@ static void pm_send_sig_to_task(pm_t *pm, pid_t pid, umword_t sig_val)
|
||||
slist_del(&pos->node);
|
||||
handler_free_umap(pos->sig_hd); //!< 删除信号通知的ipc
|
||||
// handler_free_umap(pos->watch_pid); //!< 删除被watch的进程
|
||||
free(pos);
|
||||
u_free(pos);
|
||||
}
|
||||
pos = next;
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#include "pm.h"
|
||||
#include "pm_svr.h"
|
||||
#include "u_sig.h"
|
||||
#define CONS_STACK_SIZE 2048
|
||||
#define CONS_STACK_SIZE (1024+512)
|
||||
static ATTR_ALIGN(8) uint8_t cons_stack[CONS_STACK_SIZE];
|
||||
static uint8_t cons_ipc_msg[MSG_BUG_LEN];
|
||||
static tty_struct_t sys_tty;
|
||||
|
||||
@@ -47,7 +47,7 @@ static err_t low_level_init(struct netif *netif)
|
||||
tag = u_facotry_create_share_mem(FACTORY_PROT,
|
||||
vpage_create_raw3(KOBJ_ALL_RIGHTS, 0, send_shm_hd), SHARE_MEM_CNT_BUDDY_CNT,
|
||||
2048);
|
||||
assert(msg_tag_get_prot(tag) >= 0);
|
||||
assert(msg_tag_get_prot(tag) >= 0 && "share mem alloc failed.");
|
||||
tag = u_share_mem_map(send_shm_hd, vma_addr_create(VPAGE_PROT_RW, VMA_ADDR_RESV, 0),
|
||||
&send_shm_addr, &send_shm_size);
|
||||
assert(msg_tag_get_prot(tag) >= 0);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include <u_types.h>
|
||||
#if !IS_ENABLED(CONFIG_MMU)
|
||||
#define HEAP_SIZE 16 * 1024
|
||||
#define HEAP_SIZE 8 * 1024
|
||||
#define STACK_SIZE (2 * 1024)
|
||||
|
||||
#if defined(__CC_ARM)
|
||||
|
||||
BIN
mkrtos_user/user/app/ATSURFF437/nes_simulator/nes_rom/hdl.nes
Normal file
BIN
mkrtos_user/user/app/ATSURFF437/nes_simulator/nes_rom/hdl.nes
Normal file
Binary file not shown.
@@ -526,14 +526,20 @@ void nes_emulate_frame(void)
|
||||
extern bool_t print_fps;
|
||||
int32_t used_tick = sys_read_tick() - st_tick;
|
||||
|
||||
// if (1000 / 60 >= used_tick)
|
||||
// {
|
||||
// usleep((1000 / 60 - used_tick) * 1000);
|
||||
// }
|
||||
if (1000 / 60 >= used_tick)
|
||||
{
|
||||
usleep((1000 / 60 - used_tick) * 1000);
|
||||
}
|
||||
used_tick = sys_read_tick() - st_tick;
|
||||
if (print_fps)
|
||||
{
|
||||
printf("fps:%d\n", 1000 / used_tick);
|
||||
static int i = 0;
|
||||
|
||||
i++;
|
||||
if (i % 30 == 0)
|
||||
{
|
||||
printf("fps:%d\n", 1000 / used_tick);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* @version V1.1
|
||||
* @date 2022-05-31
|
||||
* @brief NES PPU ????
|
||||
* ???????????????ye781205??NES?????????, ????<3F><>!
|
||||
* ???????????????ye781205??NES?????????, ????<3F><>!
|
||||
* @license Copyright (c) 2020-2032, ??????????????????????
|
||||
****************************************************************************************************
|
||||
* @attention
|
||||
@@ -116,8 +116,8 @@ uint32 VRAM_accessible()
|
||||
// uint8* get_VROM_tiles() { return VROM_tiles; }
|
||||
|
||||
// #define MASK_BANK(bank,mask) (bank) = ((bank) & (mask))
|
||||
// #define VALIDATE_VROM_BANK(bank) \
|
||||
// MASK_BANK(bank,VROM_mask); \
|
||||
// #define VALIDATE_VROM_BANK(bank)
|
||||
// MASK_BANK(bank,VROM_mask);
|
||||
// if((bank) >= (RomHeader->num_8k_vrom_banks * 8)) return;
|
||||
|
||||
//****************************************************************************************************
|
||||
@@ -410,7 +410,7 @@ void do_scanline_and_draw(uint8 *buf)
|
||||
}
|
||||
else
|
||||
{
|
||||
// clear out solid buffer??????<3F><>????
|
||||
// clear out solid buffer??????<3F><>????
|
||||
memset(ppu->solid_buf, 0x00, sizeof(ppu->solid_buf));
|
||||
}
|
||||
|
||||
@@ -595,7 +595,7 @@ void write_2007(uint8 data)
|
||||
|
||||
if (addr < 0x2000)
|
||||
{
|
||||
#if NES_RAM_SPEED==1 //1:??????<3F><> 0:????
|
||||
#if NES_RAM_SPEED==1 //1:??????<3F><> 0:????
|
||||
|
||||
*(TILE(addr) + (addr & 0xf )) = data;//************************
|
||||
#else
|
||||
@@ -833,7 +833,7 @@ void PPU_WriteToPort(uint8 data, uint16 addr )
|
||||
uint32 attrib_addr;
|
||||
uint32 attrib_bits;
|
||||
|
||||
#if NES_RAM_SPEED==1 //1:??????<3F><> 0:????
|
||||
#if NES_RAM_SPEED==1 //1:??????<3F><> 0:????
|
||||
uint8 pattern_lo;
|
||||
uint8 pattern_hi;
|
||||
uint8 pattern_mask;
|
||||
@@ -872,7 +872,7 @@ void PPU_WriteToPort(uint8 data, uint16 addr )
|
||||
|
||||
// CHECK_MMC2(pattern_addr);//*******************************************************
|
||||
|
||||
#if NES_RAM_SPEED==1 //1:??????<3F><> 0:????
|
||||
#if NES_RAM_SPEED==1 //1:??????<3F><> 0:????
|
||||
data = TILE(pattern_addr) + line;
|
||||
|
||||
pattern_lo = *data;
|
||||
@@ -980,7 +980,7 @@ void PPU_WriteToPort(uint8 data, uint16 addr )
|
||||
|
||||
uint32 spr_height;
|
||||
|
||||
#if NES_RAM_SPEED==1 //1:??????<3F><> 0:????
|
||||
#if NES_RAM_SPEED==1 //1:??????<3F><> 0:????
|
||||
|
||||
uint8 pattern_lo;
|
||||
uint8 pattern_hi;
|
||||
@@ -1078,7 +1078,7 @@ void PPU_WriteToPort(uint8 data, uint16 addr )
|
||||
tile_addr += ppu->spr_pattern_table_addr;
|
||||
}
|
||||
|
||||
#if NES_RAM_SPEED==1 //1:??????<3F><> 0:????
|
||||
#if NES_RAM_SPEED==1 //1:??????<3F><> 0:????
|
||||
t = TILE(tile_addr) + line;
|
||||
|
||||
pattern_lo = *t;
|
||||
@@ -1095,11 +1095,11 @@ void PPU_WriteToPort(uint8 data, uint16 addr )
|
||||
{
|
||||
//uint8 col = 0x00;
|
||||
|
||||
// if a sprite has drawn on this pixel, don't draw anything??????????????????????,?????<3F>ʦ<EFBFBD>???
|
||||
// if a sprite has drawn on this pixel, don't draw anything??????????????????????,?????<3F>ʦ<EFBFBD>???
|
||||
if (!((*solid) & SPR_WRITTEN_FLAG))
|
||||
{
|
||||
|
||||
#if NES_RAM_SPEED==1 //1:??????<3F><> 0:????
|
||||
#if NES_RAM_SPEED==1 //1:??????<3F><> 0:????
|
||||
|
||||
col = ((pattern_hi >> (7 - x) << 1) & 2) | ((pattern_lo >> (7 - x)) & 1);
|
||||
#else
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -77,7 +77,7 @@ int flash_write_sector(uint32_t sector_inx, uint32_t *p_buffer, uint16_t num_wri
|
||||
}
|
||||
|
||||
flash_unlock();
|
||||
status = flash_sector_erase(sector_inx * SECTOR_SIZE + sys_info.bootfs_start_addr);
|
||||
status = flash_sector_erase(write_addr);
|
||||
if (status != FLASH_OPERATE_DONE)
|
||||
{
|
||||
flash_lock();
|
||||
@@ -109,8 +109,8 @@ int flash_init(void)
|
||||
return msg_tag_get_val(tag);
|
||||
}
|
||||
|
||||
tag = u_vmam_alloc(VMA_PROT, vma_addr_create(VPAGE_PROT_RW, VMA_ADDR_PAGE_FAULT_SIM, 0),
|
||||
32 * 1024 * 1024 /*TODO:*/, 0x8000000, &vaddr);
|
||||
tag = u_vmam_alloc(VMA_PROT, vma_addr_create(VPAGE_PROT_RWX, VMA_ADDR_PAGE_FAULT_SIM, 0),
|
||||
align_power_of_2(CONFIG_SYS_TEXT_SIZE), CONFIG_SYS_TEXT_ADDR, &vaddr);
|
||||
if (msg_tag_get_val(tag) < 0)
|
||||
{
|
||||
return msg_tag_get_val(tag);
|
||||
|
||||
@@ -873,7 +873,7 @@ void lcd_color_fill(uint16_t sx, uint16_t sy, uint16_t ex, uint16_t ey, uint16_t
|
||||
*/
|
||||
void lcd_num_show(uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint8_t size, int32_t num, uint8_t num_bit)
|
||||
{
|
||||
uint8_t i, buf[12], start;
|
||||
uint8_t i, buf[12], start = 0;
|
||||
|
||||
buf[11] = 0;
|
||||
|
||||
|
||||
@@ -149,7 +149,7 @@ int fs_svr_open(const char *path, int flags, int mode)
|
||||
|
||||
int fs_svr_read(int fd, void *buf, size_t len)
|
||||
{
|
||||
int ret;
|
||||
int ret = -ENOSYS;
|
||||
file_desc_t *fdp = fd_get(thread_get_src_pid(), fd);
|
||||
|
||||
if (!fdp)
|
||||
@@ -171,7 +171,7 @@ int fs_svr_read(int fd, void *buf, size_t len)
|
||||
}
|
||||
int fs_svr_write(int fd, void *buf, size_t len)
|
||||
{
|
||||
int ret;
|
||||
int ret = -ENOSYS;
|
||||
file_desc_t *fdp = fd_get(thread_get_src_pid(), fd);
|
||||
|
||||
if (!fdp)
|
||||
@@ -188,6 +188,7 @@ int fs_svr_write(int fd, void *buf, size_t len)
|
||||
{
|
||||
ret = char_dev->ops->write(char_dev->dev, buf, len, &fdp->offset);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
void fs_svr_close(int fd)
|
||||
{
|
||||
|
||||
@@ -144,6 +144,7 @@ again:
|
||||
/* config i2c */
|
||||
i2c_init(hi2c->i2cx, 0x0F, PCA_I2C_CLKCTRL_400K);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
static int i2c_bus_configure(mk_i2c_t *drv, umword_t freq)
|
||||
{
|
||||
|
||||
@@ -149,7 +149,7 @@ int fs_svr_open(const char *path, int flags, int mode)
|
||||
|
||||
int fs_svr_read(int fd, void *buf, size_t len)
|
||||
{
|
||||
int ret;
|
||||
int ret = -ENOSYS;
|
||||
file_desc_t *fdp = fd_get(thread_get_src_pid(), fd);
|
||||
|
||||
if (!fdp)
|
||||
@@ -171,7 +171,7 @@ int fs_svr_read(int fd, void *buf, size_t len)
|
||||
}
|
||||
int fs_svr_write(int fd, void *buf, size_t len)
|
||||
{
|
||||
int ret;
|
||||
int ret = -ENOSYS;
|
||||
file_desc_t *fdp = fd_get(thread_get_src_pid(), fd);
|
||||
|
||||
if (!fdp)
|
||||
@@ -188,6 +188,7 @@ int fs_svr_write(int fd, void *buf, size_t len)
|
||||
{
|
||||
ret = char_dev->ops->write(char_dev->dev, buf, len, &fdp->offset);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
void fs_svr_close(int fd)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user