Skip to content

Commit 995473a

Browse files
cfd-36Linus Torvalds
authored andcommitted
[PATCH] uml: file renaming
Move some foo_kern.c files to foo.c now that the old foo.c files are out of the way. Also cleaned up some whitespace and an emacs formatting comment. Signed-off-by: Jeff Dike <jdike@addtoit.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
1 parent 3c91735 commit 995473a

7 files changed

Lines changed: 663 additions & 192 deletions

File tree

‎arch/um/kernel/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ extra-y := vmlinux.lds
77
clean-files :=
88

99
obj-y = config.o exec.o exitcode.o init_task.o irq.o ksyms.o mem.o \
10-
physmem.o process_kern.o ptrace.o reboot.o resource.o sigio.o \
10+
physmem.o process.o ptrace.o reboot.o resource.o sigio.o \
1111
signal.o smp.o syscall.o sysrq.o time.o tlb.o trap.o uaccess.o \
1212
um_arch.o umid.o
1313

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
/*
1+
/*
22
* Copyright (C) 2000, 2001, 2002 Jeff Dike (jdike@karaya.com)
33
* Copyright 2003 PathScale, Inc.
44
* Licensed under the GPL
55
*/
66

7-
#include "linux/config.h"
87
#include "linux/kernel.h"
98
#include "linux/sched.h"
109
#include "linux/interrupt.h"
@@ -113,11 +112,11 @@ void set_current(void *t)
113112

114113
void *_switch_to(void *prev, void *next, void *last)
115114
{
116-
struct task_struct *from = prev;
117-
struct task_struct *to= next;
115+
struct task_struct *from = prev;
116+
struct task_struct *to= next;
118117

119-
to->thread.prev_sched = from;
120-
set_current(to);
118+
to->thread.prev_sched = from;
119+
set_current(to);
121120

122121
do {
123122
current->thread.saved_task = NULL ;
@@ -128,7 +127,7 @@ void *_switch_to(void *prev, void *next, void *last)
128127
prev= current;
129128
} while(current->thread.saved_task);
130129

131-
return(current->thread.prev_sched);
130+
return(current->thread.prev_sched);
132131

133132
}
134133

@@ -142,19 +141,19 @@ void release_thread(struct task_struct *task)
142141
{
143142
CHOOSE_MODE(release_thread_tt(task), release_thread_skas(task));
144143
}
145-
144+
146145
void exit_thread(void)
147146
{
148147
unprotect_stack((unsigned long) current_thread);
149148
}
150-
149+
151150
void *get_current(void)
152151
{
153152
return(current);
154153
}
155154

156155
int copy_thread(int nr, unsigned long clone_flags, unsigned long sp,
157-
unsigned long stack_top, struct task_struct * p,
156+
unsigned long stack_top, struct task_struct * p,
158157
struct pt_regs *regs)
159158
{
160159
int ret;
@@ -183,11 +182,11 @@ void initial_thread_cb(void (*proc)(void *), void *arg)
183182
int save_kmalloc_ok = kmalloc_ok;
184183

185184
kmalloc_ok = 0;
186-
CHOOSE_MODE_PROC(initial_thread_cb_tt, initial_thread_cb_skas, proc,
185+
CHOOSE_MODE_PROC(initial_thread_cb_tt, initial_thread_cb_skas, proc,
187186
arg);
188187
kmalloc_ok = save_kmalloc_ok;
189188
}
190-
189+
191190
unsigned long stack_sp(unsigned long page)
192191
{
193192
return(page + PAGE_SIZE - sizeof(void *));
@@ -211,7 +210,7 @@ void default_idle(void)
211210
*/
212211
if(need_resched())
213212
schedule();
214-
213+
215214
idle_sleep(10);
216215
}
217216
}
@@ -226,7 +225,7 @@ int page_size(void)
226225
return(PAGE_SIZE);
227226
}
228227

229-
void *um_virt_to_phys(struct task_struct *task, unsigned long addr,
228+
void *um_virt_to_phys(struct task_struct *task, unsigned long addr,
230229
pte_t *pte_out)
231230
{
232231
pgd_t *pgd;
@@ -235,7 +234,7 @@ void *um_virt_to_phys(struct task_struct *task, unsigned long addr,
235234
pte_t *pte;
236235
pte_t ptent;
237236

238-
if(task->mm == NULL)
237+
if(task->mm == NULL)
239238
return(ERR_PTR(-EINVAL));
240239
pgd = pgd_offset(task->mm, addr);
241240
if(!pgd_present(*pgd))
@@ -246,7 +245,7 @@ void *um_virt_to_phys(struct task_struct *task, unsigned long addr,
246245
return(ERR_PTR(-EINVAL));
247246

248247
pmd = pmd_offset(pud, addr);
249-
if(!pmd_present(*pmd))
248+
if(!pmd_present(*pmd))
250249
return(ERR_PTR(-EINVAL));
251250

252251
pte = pte_offset_kernel(pmd, addr);
@@ -271,7 +270,7 @@ char *current_cmd(void)
271270

272271
void force_sigbus(void)
273272
{
274-
printk(KERN_ERR "Killing pid %d because of a lack of memory\n",
273+
printk(KERN_ERR "Killing pid %d because of a lack of memory\n",
275274
current->pid);
276275
lock_kernel();
277276
sigaddset(&current->pending.signal, SIGBUS);

‎arch/um/kernel/skas/Makefile‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
# Licensed under the GPL
44
#
55

6-
obj-y := clone.o exec_kern.o mem.o mmu.o process_kern.o \
7-
syscall.o tlb.o uaccess.o
6+
obj-y := clone.o exec.o mem.o mmu.o process.o syscall.o tlb.o uaccess.o
87

98
# clone.o is in the stub, so it can't be built with profiling
109
# GCC hardened also auto-enables -fpic, but we need %ebx so it can't work ->

‎arch/um/kernel/skas/exec.c‎

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
3+
* Licensed under the GPL
4+
*/
5+
6+
#include "linux/kernel.h"
7+
#include "asm/current.h"
8+
#include "asm/page.h"
9+
#include "asm/signal.h"
10+
#include "asm/ptrace.h"
11+
#include "asm/uaccess.h"
12+
#include "asm/mmu_context.h"
13+
#include "tlb.h"
14+
#include "skas.h"
15+
#include "um_mmu.h"
16+
#include "os.h"
17+
18+
void flush_thread_skas(void)
19+
{
20+
force_flush_all();
21+
switch_mm_skas(&current->mm->context.skas.id);
22+
}
23+
24+
void start_thread_skas(struct pt_regs *regs, unsigned long eip,
25+
unsigned long esp)
26+
{
27+
set_fs(USER_DS);
28+
PT_REGS_IP(regs) = eip;
29+
PT_REGS_SP(regs) = esp;
30+
}

‎arch/um/kernel/skas/exec_kern.c‎

Lines changed: 0 additions & 41 deletions
This file was deleted.

0 commit comments

Comments
 (0)