update codes

This commit is contained in:
chyyuu
2012-09-14 21:36:57 +08:00
parent c417874aa8
commit 92c553113b
32 changed files with 506 additions and 1809 deletions

View File

@@ -35,7 +35,7 @@ struct mm_struct {
pde_t *pgdir; // the PDT of these vma
int map_count; // the count of these vma
void *sm_priv; // the private data for swap manager
atomic_t mm_count; // the number ofprocess which shared the mm
int mm_count; // the number ofprocess which shared the mm
semaphore_t mm_sem; // mutex for using dup_mmap fun to duplicat the mm
int locked_by; // the lock owner process's pid
@@ -68,22 +68,24 @@ bool copy_to_user(struct mm_struct *mm, void *dst, const void *src, size_t len);
static inline int
mm_count(struct mm_struct *mm) {
return atomic_read(&(mm->mm_count));
return mm->mm_count;
}
static inline void
set_mm_count(struct mm_struct *mm, int val) {
atomic_set(&(mm->mm_count), val);
mm->mm_count = val;
}
static inline int
mm_count_inc(struct mm_struct *mm) {
return atomic_add_return(&(mm->mm_count), 1);
mm->mm_count += 1;
return mm->mm_count;
}
static inline int
mm_count_dec(struct mm_struct *mm) {
return atomic_sub_return(&(mm->mm_count), 1);
mm->mm_count -= 1;
return mm->mm_count;
}
static inline void