mirror of
https://github.com/drasko/codezero.git
synced 2026-01-12 10:53:16 +01:00
This implements the infrastructure for read/write system calls where file content is first searched in mm0's page cache and then read-in or written via the vfs read/write functions. modified: tasks/fs0/src/syscalls.c modified: tasks/mm0/include/lib/bit.h modified: tasks/mm0/include/lib/idpool.h modified: tasks/mm0/include/task.h modified: tasks/mm0/include/vm_area.h modified: tasks/mm0/main.c modified: tasks/mm0/src/devzero.c modified: tasks/mm0/src/fault.c new file: tasks/mm0/src/file.c modified: tasks/mm0/src/init.c modified: tasks/mm0/src/lib/bit.c modified: tasks/mm0/src/lib/idpool.c modified: tasks/mm0/src/task.c
21 lines
494 B
C
21 lines
494 B
C
#ifndef __MM0_IDPOOL_H__
|
|
#define __MM0_IDPOOL_H__
|
|
|
|
#include <lib/bit.h>
|
|
#include <lib/spinlock.h>
|
|
|
|
struct id_pool {
|
|
struct spinlock lock;
|
|
int nwords;
|
|
u32 bitmap[];
|
|
};
|
|
|
|
struct id_pool *id_pool_new_init(int mapsize);
|
|
int id_new(struct id_pool *pool);
|
|
int id_del(struct id_pool *pool, int id);
|
|
int id_get(struct id_pool *pool, int id);
|
|
int ids_new_contiguous(struct id_pool *pool, int numids);
|
|
int ids_del_contiguous(struct id_pool *pool, int first, int numids);
|
|
|
|
#endif /* __MM0_IDPOOL_H__ */
|