Multiple above-minor updates.

- fixed is_err(x), was evaluating x twice, resulting in calling a
function x twice.

- Divided task initialisation into multiple parts.
- MM0 now creates a tcb for itself and maintains memory regions of its own.
- MM0's tcb is used for mmapping other tasks' regions. MM0 mmaps and prefaults
  those regions, instead of the typical mmap() and fault approach used by
  non-pager tasks.
  For example there's an internal shmget_shmat() path to map in other tasks'
  shm utcbs. Those mappings are then prefaulted into mm0's address space using
  the default fault handling path.

- FS0 now reads task data into its utcb from mm0 via a syscall.
  FS0 shmat()s to utcbs of other tasks, e.g. mm0 and test0.

  FS0 then crashes, that is to be fixed and where this commit is left last.
This commit is contained in:
Bahadir Balban
2008-03-24 00:34:14 +00:00
parent 82a7228d89
commit 35d2d275b6
11 changed files with 424 additions and 205 deletions

View File

@@ -78,7 +78,14 @@
/* Functions who may either return a pointer or an error code can use these: */
#define PTR_ERR(x) ((void *)(x))
/* checks up to -1000, the rest might be valid pointers!!! E.g. 0xE0000000 */
#define IS_ERR(x) ((((int)(x)) < 0) && (((int)(x) > -1000)))
// #define IS_ERR(x) ((((int)(x)) < 0) && (((int)(x) > -1000)))
#if !defined(__ASSEMBLY__)
#define IS_ERR(x) is_err((int)(x))
static inline int is_err(int x)
{
return x < 0 && x > -0x1000;
}
#endif
/* TEST: Is this type of printk well tested? */
#define BUG() {do { \