1 /* See COPYRIGHT for copyright information. */
9 // Change this value to 1 once you're allowing multiple environments
10 // (for UCLA: Lab 3, Part 3; for MIT: Lab 4).
11 #define JOS_MULTIENV 0
14 extern struct Env
*envs
; // All environments
15 extern struct Env
*curenv
; // Current environment
17 LIST_HEAD(Env_list
, Env
); // Declares 'struct Env_list'
20 int env_alloc(struct Env
**e
, envid_t parent_id
);
21 void env_free(struct Env
*e
);
22 void env_create(uint8_t *binary
, size_t size
);
23 void env_destroy(struct Env
*e
); // Does not return if e == curenv
25 int envid2env(envid_t envid
, struct Env
**env_store
, bool checkperm
);
26 // The following two functions do not return
27 void env_run(struct Env
*e
) __attribute__((noreturn
));
28 void env_pop_tf(struct Trapframe
*tf
) __attribute__((noreturn
));
30 // For the grading script
31 #define ENV_CREATE2(start, size) { \
32 extern uint8_t start[], size[]; \
33 env_create(start, (int)size); \
36 #define ENV_CREATE(x) { \
37 extern uint8_t _binary_obj_##x##_start[], \
38 _binary_obj_##x##_size[]; \
39 env_create(_binary_obj_##x##_start, \
40 (int)_binary_obj_##x##_size); \
43 #endif // !JOS_KERN_ENV_H