Improve headers and add sys/mman.h
This commit is contained in:
parent
b352eab798
commit
88b9c3160b
@ -8,7 +8,9 @@ struct uAddrSpace;
|
|||||||
struct uAddrVirtualReg;
|
struct uAddrVirtualReg;
|
||||||
|
|
||||||
#define UA_MAP_SHARED (1 << 0)
|
#define UA_MAP_SHARED (1 << 0)
|
||||||
#define UA_MAP_FIXED (1 << 1)
|
#define UA_MAP_PRIVATE (1 << 1)
|
||||||
|
#define UA_MAP_FIXED (1 << 2)
|
||||||
|
|
||||||
// TODO : move this struct to .c and add accessors
|
// TODO : move this struct to .c and add accessors
|
||||||
struct uAddrVirtualReg {
|
struct uAddrVirtualReg {
|
||||||
uaddr_t addr;
|
uaddr_t addr;
|
||||||
@ -38,7 +40,6 @@ struct mappedRessource {
|
|||||||
int (*onResMapped)(struct uAddrVirtualReg *reg); // Callabck for when the ressourced get mapped
|
int (*onResMapped)(struct uAddrVirtualReg *reg); // Callabck for when the ressourced get mapped
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
struct uAddrSpace *uAddrSpaceCreate(struct process *proc);
|
struct uAddrSpace *uAddrSpaceCreate(struct process *proc);
|
||||||
int uAddrSpaceDelete(struct uAddrSpace *addr);
|
int uAddrSpaceDelete(struct uAddrSpace *addr);
|
||||||
struct mmu_context *uAddrSpaceGetMMUContext(struct uAddrSpace *addr);
|
struct mmu_context *uAddrSpaceGetMMUContext(struct uAddrSpace *addr);
|
||||||
|
@ -36,10 +36,6 @@ int putc(const int c);
|
|||||||
int vsnprintf(char *str, size_t size, const char *format, va_list ap) __attribute__ ((__format__ (printf, 3, 0)));
|
int vsnprintf(char *str, size_t size, const char *format, va_list ap) __attribute__ ((__format__ (printf, 3, 0)));
|
||||||
int vprintf(const char *format, va_list ap) __attribute__ ((__format__ (printf, 1, 0)));
|
int vprintf(const char *format, va_list ap) __attribute__ ((__format__ (printf, 1, 0)));
|
||||||
int printf(const char *format, ...) __attribute__ ((__format__ (printf, 1, 2)));
|
int printf(const char *format, ...) __attribute__ ((__format__ (printf, 1, 2)));
|
||||||
/* To keep in sync with PAGING_MEM_* */
|
|
||||||
#define PROT_EXEC (1<<3)
|
|
||||||
#define PROT_READ (1<<1)
|
|
||||||
#define PROT_WRITE (1<<2)
|
|
||||||
void *mmap(void *addr, size_t len, int prot, int flags, char *path);
|
void *mmap(void *addr, size_t len, int prot, int flags, char *path);
|
||||||
|
|
||||||
int asprintf(char **strp, const char *fmt, ...) __attribute__ ((__format__ (printf, 2, 3)));
|
int asprintf(char **strp, const char *fmt, ...) __attribute__ ((__format__ (printf, 2, 3)));
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
#include "libc.h"
|
#include "libc.h"
|
||||||
#include "stdarg.h"
|
#include "stdarg.h"
|
||||||
|
#include "sys/mman.h"
|
||||||
#include "tiny.h"
|
#include "tiny.h"
|
||||||
|
|
||||||
int func_help()
|
int func_help()
|
||||||
|
11
userspace/sys/mman.h
Normal file
11
userspace/sys/mman.h
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
/* To keep in sync with PAGING_MEM_* */
|
||||||
|
#define PROT_EXEC (1<<3)
|
||||||
|
#define PROT_READ (1<<1)
|
||||||
|
#define PROT_WRITE (1<<2)
|
||||||
|
|
||||||
|
#define MAP_SHARED (1 << 0)
|
||||||
|
#define MAP_PRIVATE (1 << 1)
|
||||||
|
#define MAP_FIXED (1 << 2)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user