From becf8eec746910a3ad50c7853fd8a05aa232aca1 Mon Sep 17 00:00:00 2001 From: Mark Date: Tue, 21 Jul 2020 16:22:00 +0300 Subject: [PATCH] Cleanup headers a bit --- arch/amd64/binfmt_elf.c | 2 +- include/sys/mem/shmem.h | 55 ----------------------------------------- include/user/signum.h | 17 ------------- include/user/syscall.h | 1 + include/user/termios.h | 1 + 5 files changed, 3 insertions(+), 73 deletions(-) diff --git a/arch/amd64/binfmt_elf.c b/arch/amd64/binfmt_elf.c index 2c055b0..0f910c7 100644 --- a/arch/amd64/binfmt_elf.c +++ b/arch/amd64/binfmt_elf.c @@ -189,7 +189,7 @@ int elf_load(struct process *proc, struct vfs_ioctx *ctx, struct ofile *fd, uint } } - proc->brk = proc->image_end; + proc->brk = (proc->image_end + MM_PAGE_SIZE - 1) & ~MM_PAGE_OFFSET_MASK; *entry = ehdr.e_entry; res = 0; diff --git a/include/sys/mem/shmem.h b/include/sys/mem/shmem.h index 180a9e8..6eff022 100644 --- a/include/sys/mem/shmem.h +++ b/include/sys/mem/shmem.h @@ -4,61 +4,6 @@ #include "sys/spin.h" struct thread; -//struct blkdev; -// -//struct shm_region { -// spin_t lock; -// -// size_t ref_count; -// // List head for tracking ownership of the region -// struct list_head owners; -// // Link for tracking all the regions in the system -// struct list_head link; -// -// size_t page_count; -// uintptr_t phys[0]; -//}; -// -//// region -> thread ownership link -//struct shm_owner_ref { -// struct thread *owner; -// uintptr_t virt; -// struct list_head link; -//}; -// -//// thread -> region mapping link -//struct shm_region_ref { -// enum { -// // -> memory pages -// SHM_TYPE_PHYS = 0, -// // -> block device mapping -// SHM_TYPE_BLOCK, -// } type; -// uintptr_t virt; -// struct list_head link; -// union { -// // Physical mapping -// struct shm_region *region; -// // Block device mapping -// struct { -// size_t page_count; -// uintptr_t phys_base; -// struct blkdev *blk; -// } block; -// } map; -//}; -// -//struct shm_region *shm_region_create(size_t count); -//void shm_region_free(struct shm_region *region); -// -//uintptr_t shm_region_map(struct shm_region *region, struct thread *thr); -//void shm_region_release_all(struct thread *thr, int noumap); -//struct shm_region_ref *shm_region_find(struct thread *thr, uintptr_t ptr); -// -//void shm_space_fork(struct thread *dst, struct thread *src); -// -//void shm_region_describe(struct shm_region *region); -//void shm_thread_describe(struct thread *thr); void *sys_mmap(void *hint, size_t length, int prot, int flags, int fd, off_t offset); int sys_munmap(void *addr, size_t length); diff --git a/include/user/signum.h b/include/user/signum.h index 2e51bc3..1e11f34 100644 --- a/include/user/signum.h +++ b/include/user/signum.h @@ -1,23 +1,6 @@ #pragma once #include -//#define SIGHUP 1 -//#define SIGINT 2 -//#define SIGQUIT 3 -//#define SIGTRAP 5 -//#define SIGABRT 6 -//#define SIGKILL 9 -//#define SIGUSR1 10 -//#define SIGSEGV 11 -//#define SIGSYS 12 -//#define SIGPIPE 13 -//#define SIGALRM 14 -//#define SIGTERM 15 -//#define SIGSTOP 19 -//#define SIGCHLD 17 -//#define SIGCONT 18 -//#define SIGTTIN 21 -//#define SIGTTOU 22 #define SIGHUP 1 #define SIGINT 2 #define SIGQUIT 3 diff --git a/include/user/syscall.h b/include/user/syscall.h index 1cc469b..5547839 100644 --- a/include/user/syscall.h +++ b/include/user/syscall.h @@ -10,6 +10,7 @@ #define SYSCALL_NR_LSEEK 8 #define SYSCALL_NR_MMAP 9 #define SYSCALL_NR_MUNMAP 11 +#define SYSCALL_NRX_SBRK 12 #define SYSCALL_NR_IOCTL 16 #define SYSCALL_NR_ACCESS 21 #define SYSCALL_NR_PIPE 22 diff --git a/include/user/termios.h b/include/user/termios.h index f35b941..dff7e5f 100644 --- a/include/user/termios.h +++ b/include/user/termios.h @@ -2,6 +2,7 @@ #define TCGETS 0x5401 #define TCSETS 0x5402 +#define TIOCGPGRP 0x540F #define TIOCSPGRP 0x5410 #define TIOCGWINSZ 0x5413