23d133b41f9a434473e8558ebd9d73f1888d3042
[pintos-anon] / src / filesys / filesys-stub.c
1 #include "filesys-stub.h"
2 #include <stdarg.h>
3 #include "backdoor.h"
4 #include "debug.h"
5 #include "io.h"
6
7 static void
8 out_byte (uint8_t byte, void *aux UNUSED) 
9 {
10   outb (0x8901, byte);
11 }
12
13 void
14 filesys_stub_send (const char *types, ...) 
15 {
16   va_list args;
17
18   va_start (args, types);
19   backdoor_vmarshal (types, args, out_byte, NULL);
20   va_end (args);
21 }
22
23 static bool
24 in_byte (uint8_t *byte, void *aux UNUSED) 
25 {
26   *byte = inb (0x8901);
27   return true;
28 }
29
30 void
31 filesys_stub_receive (const char *types, ...) 
32 {
33   va_list args;
34
35   va_start (args, types);
36   backdoor_vunmarshal (types, args, in_byte, NULL);
37   va_end (args);
38 }