Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 83184
b: refs/heads/master
c: 8192ab4
h: refs/heads/master
v: v3
  • Loading branch information
Jeff Dike authored and Linus Torvalds committed Feb 5, 2008
1 parent bd36881 commit 7b49612
Show file tree
Hide file tree
Showing 17 changed files with 63 additions and 49 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9157f90f08f7db3188cd06971f41cb2ba5646e57
refs/heads/master: 8192ab42bf60e1e9b7efa046990e9cc5e4a95cf4
1 change: 1 addition & 0 deletions trunk/arch/um/drivers/random.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* This software may be used and distributed according to the terms
* of the GNU General Public License, incorporated herein by reference.
*/
#include <linux/sched.h>
#include <linux/module.h>
#include <linux/fs.h>
#include <linux/miscdevice.h>
Expand Down
4 changes: 3 additions & 1 deletion trunk/arch/um/include/um_uaccess.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
#ifndef __ARCH_UM_UACCESS_H
#define __ARCH_UM_UACCESS_H

#include "asm/fixmap.h"
#include <asm/elf.h>
#include <asm/fixmap.h>
#include "sysdep/archsetjmp.h"

#define __under_task_size(addr, size) \
(((unsigned long) (addr) < TASK_SIZE) && \
Expand Down
21 changes: 16 additions & 5 deletions trunk/arch/um/kernel/mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ pgprot_t kmap_prot;

#define kmap_get_fixmap_pte(vaddr) \
pte_offset_kernel(pmd_offset(pud_offset(pgd_offset_k(vaddr), (vaddr)),\
(vaddr)), (vaddr))
(vaddr)), (vaddr))

static void __init kmap_init(void)
{
Expand Down Expand Up @@ -278,7 +278,8 @@ struct page *arch_validate(struct page *page, gfp_t mask, int order)
goto again;
}

/* This can't do anything because nothing in the kernel image can be freed
/*
* This can't do anything because nothing in the kernel image can be freed
* since it's not in kernel physical memory.
*/

Expand Down Expand Up @@ -331,9 +332,7 @@ void show_mem(void)
printk("%d pages swap cached\n", cached);
}

/*
* Allocate and free page tables.
*/
/* Allocate and free page tables. */

pgd_t *pgd_alloc(struct mm_struct *mm)
{
Expand Down Expand Up @@ -368,3 +367,15 @@ struct page *pte_alloc_one(struct mm_struct *mm, unsigned long address)
pte = alloc_page(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO);
return pte;
}

#ifdef CONFIG_3_LEVEL_PGTABLES
pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address)
{
pmd_t *pmd = (pmd_t *) __get_free_page(GFP_KERNEL);

if (pmd)
memset(pmd, 0, PAGE_SIZE);

return pmd;
}
#endif
8 changes: 8 additions & 0 deletions trunk/arch/um/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -446,3 +446,11 @@ unsigned long get_wchan(struct task_struct *p)

return 0;
}

int elf_core_copy_fpregs(struct task_struct *t, elf_fpregset_t *fpu)
{
int cpu = current_thread_info()->cpu;

return save_fp_registers(userspace_pid[cpu], (unsigned long *) fpu);
}

13 changes: 7 additions & 6 deletions trunk/arch/um/kernel/skas/uaccess.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
* Licensed under the GPL
*/

#include "linux/err.h"
#include "linux/highmem.h"
#include "linux/mm.h"
#include "asm/current.h"
#include "asm/page.h"
#include "asm/pgtable.h"
#include <linux/err.h>
#include <linux/highmem.h>
#include <linux/mm.h>
#include <linux/sched.h>
#include <asm/current.h>
#include <asm/page.h>
#include <asm/pgtable.h>
#include "kern_util.h"
#include "os.h"

Expand Down
7 changes: 4 additions & 3 deletions trunk/arch/um/kernel/tlb.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
* Licensed under the GPL
*/

#include "linux/mm.h"
#include "asm/pgtable.h"
#include "asm/tlbflush.h"
#include <linux/mm.h>
#include <linux/sched.h>
#include <asm/pgtable.h>
#include <asm/tlbflush.h>
#include "as-layout.h"
#include "mem_user.h"
#include "os.h"
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/um/sys-i386/bug.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/

#include <linux/uaccess.h>
#include <asm/errno.h>

/* Mostly copied from i386/x86_86 - eliminated the eip < PAGE_OFFSET because
* that's not relevant in skas mode.
Expand Down
5 changes: 3 additions & 2 deletions trunk/arch/um/sys-i386/ldt.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
* Licensed under the GPL
*/

#include "linux/mm.h"
#include "asm/unistd.h"
#include <linux/mm.h>
#include <linux/sched.h>
#include <asm/unistd.h>
#include "os.h"
#include "proc_mm.h"
#include "skas.h"
Expand Down
9 changes: 2 additions & 7 deletions trunk/include/asm-um/elf-i386.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#ifndef __UM_ELF_I386_H
#define __UM_ELF_I386_H

#include <linux/sched.h>
#include <asm/user.h>
#include "skas.h"

#define R_386_NONE 0
Expand Down Expand Up @@ -76,12 +76,7 @@ typedef struct user_i387_struct elf_fpregset_t;
pr_reg[16] = PT_REGS_SS(regs); \
} while(0);

static inline int elf_core_copy_fpregs(struct task_struct *t,
elf_fpregset_t *fpu)
{
int cpu = ((struct thread_info *) t->stack)->cpu;
return save_fp_registers(userspace_pid[cpu], (unsigned long *) fpu);
}
extern int elf_core_copy_fpregs(struct task_struct *t, elf_fpregset_t *fpu);

#define ELF_CORE_COPY_FPREGS(t, fpu) elf_core_copy_fpregs(t, fpu)

Expand Down
8 changes: 1 addition & 7 deletions trunk/include/asm-um/elf-x86_64.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#ifndef __UM_ELF_X86_64_H
#define __UM_ELF_X86_64_H

#include <linux/sched.h>
#include <asm/user.h>
#include "skas.h"

Expand Down Expand Up @@ -96,12 +95,7 @@ typedef struct user_i387_struct elf_fpregset_t;
(pr_reg)[25] = 0; \
(pr_reg)[26] = 0;

static inline int elf_core_copy_fpregs(struct task_struct *t,
elf_fpregset_t *fpu)
{
int cpu = current_thread->cpu;
return save_fp_registers(userspace_pid[cpu], (unsigned long *) fpu);
}
extern int elf_core_copy_fpregs(struct task_struct *t, elf_fpregset_t *fpu);

#define ELF_CORE_COPY_FPREGS(t, fpu) elf_core_copy_fpregs(t, fpu)

Expand Down
3 changes: 2 additions & 1 deletion trunk/include/asm-um/fixmap.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#ifndef __UM_FIXMAP_H
#define __UM_FIXMAP_H

#include <asm/system.h>
#include <asm/kmap_types.h>
#include <asm/archparam.h>
#include <asm/elf.h>
#include <asm/page.h>

/*
* Here we define all the compile-time 'special' virtual
Expand Down
11 changes: 2 additions & 9 deletions trunk/include/asm-um/pgtable-3level.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,8 @@ static inline void pgd_mkuptodate(pgd_t pgd) { pgd_val(pgd) &= ~_PAGE_NEWPAGE; }

#define set_pmd(pmdptr, pmdval) set_64bit((phys_t *) (pmdptr), pmd_val(pmdval))

static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address)
{
pmd_t *pmd = (pmd_t *) __get_free_page(GFP_KERNEL);

if(pmd)
memset(pmd, 0, PAGE_SIZE);

return pmd;
}
struct mm_struct;
extern pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address);

static inline void pud_clear (pud_t *pud)
{
Expand Down
1 change: 0 additions & 1 deletion trunk/include/asm-um/pgtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#ifndef __UM_PGTABLE_H
#define __UM_PGTABLE_H

#include "linux/sched.h"
#include <asm/fixmap.h>

#define _PAGE_PRESENT 0x001
Expand Down
5 changes: 1 addition & 4 deletions trunk/include/asm-um/processor-generic.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ struct pt_regs;
struct task_struct;

#include "asm/ptrace.h"
#include "asm/pgtable.h"
#include "registers.h"
#include "sysdep/archsetjmp.h"

Expand Down Expand Up @@ -68,10 +69,6 @@ struct thread_struct {
.request = { 0 } \
}

typedef struct {
unsigned long seg;
} mm_segment_t;

extern struct task_struct *alloc_task_struct(void);

static inline void release_thread(struct task_struct *task)
Expand Down
3 changes: 2 additions & 1 deletion trunk/include/asm-um/thread_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@

#ifndef __ASSEMBLY__

#include <asm/processor.h>
#include <asm/types.h>
#include <asm/page.h>
#include <asm/uaccess.h>

struct thread_info {
struct task_struct *task; /* main task structure */
Expand Down
10 changes: 9 additions & 1 deletion trunk/include/asm-um/uaccess.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,15 @@
#ifndef __UM_UACCESS_H
#define __UM_UACCESS_H

#include "linux/sched.h"
#include <asm/errno.h>
#include <asm/processor.h>

/* thread_info has a mm_segment_t in it, so put the definition up here */
typedef struct {
unsigned long seg;
} mm_segment_t;

#include "linux/thread_info.h"

#define VERIFY_READ 0
#define VERIFY_WRITE 1
Expand Down

0 comments on commit 7b49612

Please sign in to comment.