diff options
author | Andrew Waterman <waterman@cs.berkeley.edu> | 2015-03-12 17:38:04 -0700 |
---|---|---|
committer | Andrew Waterman <waterman@cs.berkeley.edu> | 2015-03-12 17:38:04 -0700 |
commit | 6517fe26a2a0c89c3112f4a383c601572c71d64a (patch) | |
tree | d37eea7ae6f3e15eee94afb5c9c749a4cd800577 /pk/file.h | |
parent | a4ae7da6ef0c09c2616a0b82f7f569e4e134f75c (diff) | |
download | riscv-pk-6517fe26a2a0c89c3112f4a383c601572c71d64a.zip riscv-pk-6517fe26a2a0c89c3112f4a383c601572c71d64a.tar.gz riscv-pk-6517fe26a2a0c89c3112f4a383c601572c71d64a.tar.bz2 |
Update to new privileged spec
Diffstat (limited to 'pk/file.h')
-rw-r--r-- | pk/file.h | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -5,15 +5,19 @@ #include <sys/stat.h> #include <unistd.h> +#include <stdint.h> #include "atomic.h" typedef struct file { - int kfd; // file descriptor on the appserver side - atomic_t refcnt; + int kfd; // file descriptor on the host side of the HTIF + uint32_t refcnt; } file_t; -extern file_t *stdin, *stdout, *stderr; +extern file_t files[]; +#define stdin (files + 0) +#define stdout (files + 1) +#define stderr (files + 2) file_t* file_get(int fd); file_t* file_open(const char* fn, int flags, int mode); |