sysdeps/sigma: Use SysdepsAllocator and add kbus auxval

This commit is contained in:
Thomas Woertman 2020-02-21 21:31:21 +01:00
parent 896876cb8d
commit 8f475792b1
3 changed files with 12 additions and 11 deletions

View file

@ -8,6 +8,7 @@
// Sigma specific auxvector entries.
#define AT_VFS_SEVER 0x1000
#define AT_VFS_SERVER 0x1000
#define AT_KBUS_SERVER 0x1001
#endif

View file

@ -16,7 +16,7 @@ extern char** environ;
static mlibc::exec_stack_data __mlibc_stack_data;
tid_t getUmTid(){
return getauxval(AT_VFS_SEVER);
return getauxval(AT_VFS_SERVER);
}
MemoryAllocator& getSysdepsAllocator(){

View file

@ -35,7 +35,7 @@ namespace mlibc {
libsigma_block_thread(SIGMA_BLOCK_WAITING_FOR_IPC);
size_t res_size = libsigma_ipc_get_msg_size();
frg::vector<uint8_t, MemoryAllocator> res{getAllocator()};
frg::vector<uint8_t, MemoryAllocator> res{getSysdepsAllocator()};
res.resize(res_size);
uint64_t origin, useless;
@ -60,7 +60,7 @@ namespace mlibc {
client_request_builder builder{};
builder.add_command((uint64_t)client_request_type::Open);
builder.add_path(iota::string{getAllocator(), path});
builder.add_path(iota::string{getSysdepsAllocator(), path});
builder.add_flags(flags);
if(libsigma_ipc_send(getUmTid(), (libsigma_message_t*)builder.serialize(), builder.length())){
@ -72,7 +72,7 @@ namespace mlibc {
libsigma_block_thread(SIGMA_BLOCK_WAITING_FOR_IPC);
size_t res_size = libsigma_ipc_get_msg_size();
frg::vector<uint8_t, MemoryAllocator> res{getAllocator()};
frg::vector<uint8_t, MemoryAllocator> res{getSysdepsAllocator()};
res.resize(res_size);
uint64_t origin, useless;
@ -109,7 +109,7 @@ namespace mlibc {
libsigma_block_thread(SIGMA_BLOCK_WAITING_FOR_IPC);
size_t res_size = libsigma_ipc_get_msg_size();
frg::vector<uint8_t, MemoryAllocator> res{getAllocator()};
frg::vector<uint8_t, MemoryAllocator> res{getSysdepsAllocator()};
res.resize(res_size);
uint64_t origin, useless;
@ -137,7 +137,7 @@ namespace mlibc {
builder.add_fd(fd);
builder.add_count(count);
frg::vector<uint8_t, MemoryAllocator> buffer{getAllocator()};
frg::vector<uint8_t, MemoryAllocator> buffer{getSysdepsAllocator()};
buffer.resize(count);
memcpy(buffer.data(), buf, count);
@ -152,7 +152,7 @@ namespace mlibc {
libsigma_block_thread(SIGMA_BLOCK_WAITING_FOR_IPC);
size_t res_size = libsigma_ipc_get_msg_size();
frg::vector<uint8_t, MemoryAllocator> res{getAllocator()};
frg::vector<uint8_t, MemoryAllocator> res{getSysdepsAllocator()};
res.resize(res_size);
uint64_t origin, useless;
@ -193,7 +193,7 @@ namespace mlibc {
libsigma_block_thread(SIGMA_BLOCK_WAITING_FOR_IPC);
size_t res_size = libsigma_ipc_get_msg_size();
frg::vector<uint8_t, MemoryAllocator> res{getAllocator()};
frg::vector<uint8_t, MemoryAllocator> res{getSysdepsAllocator()};
res.resize(res_size);
uint64_t origin, useless;
@ -229,7 +229,7 @@ namespace mlibc {
libsigma_block_thread(SIGMA_BLOCK_WAITING_FOR_IPC);
size_t res_size = libsigma_ipc_get_msg_size();
frg::vector<uint8_t, MemoryAllocator> res{getAllocator()};
frg::vector<uint8_t, MemoryAllocator> res{getSysdepsAllocator()};
res.resize(res_size);
uint64_t origin, useless;
@ -278,7 +278,7 @@ namespace mlibc {
libsigma_block_thread(SIGMA_BLOCK_WAITING_FOR_IPC);
size_t res_size = libsigma_ipc_get_msg_size();
frg::vector<uint8_t, MemoryAllocator> res{getAllocator()};
frg::vector<uint8_t, MemoryAllocator> res{getSysdepsAllocator()};
res.resize(res_size);
uint64_t origin, useless;