toaruos/kernel/include/shm.h

48 lines
823 B
C
Raw Normal View History

/* vim: tabstop=4 shiftwidth=4 noexpandtab
*/
#ifndef SHM_H
#define SHM_H
#include <types.h>
2012-02-06 05:56:21 +04:00
#define SHM_PATH_SEPARATOR "."
#define SHM_START 0xD0010000
2012-02-06 05:56:21 +04:00
2012-02-06 00:16:59 +04:00
/* Types */
struct shm_node;
typedef struct {
2012-02-06 00:16:59 +04:00
struct shm_node * parent;
volatile uint8_t lock;
int32_t ref_count;
uint32_t num_frames;
uintptr_t *frames;
} shm_chunk_t;
typedef struct shm_node {
char name[256];
2012-02-06 00:16:59 +04:00
shm_chunk_t * chunk;
} shm_node_t;
2012-02-06 00:16:59 +04:00
typedef struct {
shm_chunk_t * chunk;
uint8_t volatile lock;
uint32_t num_vaddrs;
uintptr_t *vaddrs;
} shm_mapping_t;
/* Syscalls */
extern void * shm_obtain (char * path, size_t * size);
2012-02-06 00:16:59 +04:00
extern int shm_release (char * path);
/* Other exposed functions */
extern void shm_install ();
extern void shm_release_all (process_t * proc);
2012-02-06 00:16:59 +04:00
//extern void shm_debug_frame(uintptr_t vaddr);
#endif