Skip to content

Commit

Permalink
servers: message structure for mmap()
Browse files Browse the repository at this point in the history
  • Loading branch information
jewelcodes committed Nov 29, 2024
1 parent 160d5ac commit 87c5641
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion src/include/kernel/servers.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@
#define COMMAND_CHDIR 0x8010
#define COMMAND_CHROOT 0x8011

#define MAX_SYSCALL_COMMAND 0x8011
#define COMMAND_MMAP 0x8012
#define COMMAND_MSYNC 0x8013

#define MAX_SYSCALL_COMMAND 0x8013

/* these commands are for device drivers */
#define COMMAND_IRQ 0xC000
Expand Down Expand Up @@ -208,6 +211,30 @@ typedef struct {
gid_t gid;
} ChdirCommand;

/* mmap() */
typedef struct {
SyscallHeader header;

/* file descriptor */
char path[MAX_FILE_PATH];
char device[MAX_FILE_PATH];
uint64_t id;
int openFlags;
uid_t uid;
gid_t gid;
off_t position;

/* mmap params */
size_t len;
int prot;
int flags;
off_t off;

int responseType; // 0 = returning data, 1 = returning mmio
uint64_t mmio; // mmio pointer
uint64_t data[];
} MmapCommand;

void serverInit();
void serverIdle();
void handleGeneralRequest(int, const MessageHeader *, void *);
Expand Down

0 comments on commit 87c5641

Please sign in to comment.