diff options
Diffstat (limited to 'arch/alpha/kernel')
-rw-r--r-- | arch/alpha/kernel/Makefile | 2 | ||||
-rw-r--r-- | arch/alpha/kernel/asm-offsets.c | 11 | ||||
-rw-r--r-- | arch/alpha/kernel/binfmt_loader.c | 51 | ||||
-rw-r--r-- | arch/alpha/kernel/entry.S | 10 | ||||
-rw-r--r-- | arch/alpha/kernel/init_task.c | 1 | ||||
-rw-r--r-- | arch/alpha/kernel/irq.c | 5 | ||||
-rw-r--r-- | arch/alpha/kernel/process.c | 2 | ||||
-rw-r--r-- | arch/alpha/kernel/setup.c | 5 | ||||
-rw-r--r-- | arch/alpha/kernel/smp.c | 7 | ||||
-rw-r--r-- | arch/alpha/kernel/sys_dp264.c | 8 | ||||
-rw-r--r-- | arch/alpha/kernel/sys_titan.c | 4 |
11 files changed, 83 insertions, 23 deletions
diff --git a/arch/alpha/kernel/Makefile b/arch/alpha/kernel/Makefile index ac706c1d7ada..b4697759a123 100644 --- a/arch/alpha/kernel/Makefile +++ b/arch/alpha/kernel/Makefile | |||
@@ -8,7 +8,7 @@ EXTRA_CFLAGS := -Werror -Wno-sign-compare | |||
8 | 8 | ||
9 | obj-y := entry.o traps.o process.o init_task.o osf_sys.o irq.o \ | 9 | obj-y := entry.o traps.o process.o init_task.o osf_sys.o irq.o \ |
10 | irq_alpha.o signal.o setup.o ptrace.o time.o \ | 10 | irq_alpha.o signal.o setup.o ptrace.o time.o \ |
11 | alpha_ksyms.o systbls.o err_common.o io.o | 11 | alpha_ksyms.o systbls.o err_common.o io.o binfmt_loader.o |
12 | 12 | ||
13 | obj-$(CONFIG_VGA_HOSE) += console.o | 13 | obj-$(CONFIG_VGA_HOSE) += console.o |
14 | obj-$(CONFIG_SMP) += smp.o | 14 | obj-$(CONFIG_SMP) += smp.o |
diff --git a/arch/alpha/kernel/asm-offsets.c b/arch/alpha/kernel/asm-offsets.c index 4b18cd94d59d..6ff8886e7e22 100644 --- a/arch/alpha/kernel/asm-offsets.c +++ b/arch/alpha/kernel/asm-offsets.c | |||
@@ -19,15 +19,18 @@ void foo(void) | |||
19 | BLANK(); | 19 | BLANK(); |
20 | 20 | ||
21 | DEFINE(TASK_BLOCKED, offsetof(struct task_struct, blocked)); | 21 | DEFINE(TASK_BLOCKED, offsetof(struct task_struct, blocked)); |
22 | DEFINE(TASK_UID, offsetof(struct task_struct, uid)); | 22 | DEFINE(TASK_CRED, offsetof(struct task_struct, cred)); |
23 | DEFINE(TASK_EUID, offsetof(struct task_struct, euid)); | ||
24 | DEFINE(TASK_GID, offsetof(struct task_struct, gid)); | ||
25 | DEFINE(TASK_EGID, offsetof(struct task_struct, egid)); | ||
26 | DEFINE(TASK_REAL_PARENT, offsetof(struct task_struct, real_parent)); | 23 | DEFINE(TASK_REAL_PARENT, offsetof(struct task_struct, real_parent)); |
27 | DEFINE(TASK_GROUP_LEADER, offsetof(struct task_struct, group_leader)); | 24 | DEFINE(TASK_GROUP_LEADER, offsetof(struct task_struct, group_leader)); |
28 | DEFINE(TASK_TGID, offsetof(struct task_struct, tgid)); | 25 | DEFINE(TASK_TGID, offsetof(struct task_struct, tgid)); |
29 | BLANK(); | 26 | BLANK(); |
30 | 27 | ||
28 | DEFINE(CRED_UID, offsetof(struct cred, uid)); | ||
29 | DEFINE(CRED_EUID, offsetof(struct cred, euid)); | ||
30 | DEFINE(CRED_GID, offsetof(struct cred, gid)); | ||
31 | DEFINE(CRED_EGID, offsetof(struct cred, egid)); | ||
32 | BLANK(); | ||
33 | |||
31 | DEFINE(SIZEOF_PT_REGS, sizeof(struct pt_regs)); | 34 | DEFINE(SIZEOF_PT_REGS, sizeof(struct pt_regs)); |
32 | DEFINE(PT_PTRACED, PT_PTRACED); | 35 | DEFINE(PT_PTRACED, PT_PTRACED); |
33 | DEFINE(CLONE_VM, CLONE_VM); | 36 | DEFINE(CLONE_VM, CLONE_VM); |
diff --git a/arch/alpha/kernel/binfmt_loader.c b/arch/alpha/kernel/binfmt_loader.c new file mode 100644 index 000000000000..4a0af906b00a --- /dev/null +++ b/arch/alpha/kernel/binfmt_loader.c | |||
@@ -0,0 +1,51 @@ | |||
1 | #include <linux/init.h> | ||
2 | #include <linux/fs.h> | ||
3 | #include <linux/file.h> | ||
4 | #include <linux/mm_types.h> | ||
5 | #include <linux/binfmts.h> | ||
6 | #include <linux/a.out.h> | ||
7 | |||
8 | static int load_binary(struct linux_binprm *bprm, struct pt_regs *regs) | ||
9 | { | ||
10 | struct exec *eh = (struct exec *)bprm->buf; | ||
11 | unsigned long loader; | ||
12 | struct file *file; | ||
13 | int retval; | ||
14 | |||
15 | if (eh->fh.f_magic != 0x183 || (eh->fh.f_flags & 0x3000) != 0x3000) | ||
16 | return -ENOEXEC; | ||
17 | |||
18 | if (bprm->loader) | ||
19 | return -ENOEXEC; | ||
20 | |||
21 | allow_write_access(bprm->file); | ||
22 | fput(bprm->file); | ||
23 | bprm->file = NULL; | ||
24 | |||
25 | loader = bprm->vma->vm_end - sizeof(void *); | ||
26 | |||
27 | file = open_exec("/sbin/loader"); | ||
28 | retval = PTR_ERR(file); | ||
29 | if (IS_ERR(file)) | ||
30 | return retval; | ||
31 | |||
32 | /* Remember if the application is TASO. */ | ||
33 | bprm->taso = eh->ah.entry < 0x100000000UL; | ||
34 | |||
35 | bprm->file = file; | ||
36 | bprm->loader = loader; | ||
37 | retval = prepare_binprm(bprm); | ||
38 | if (retval < 0) | ||
39 | return retval; | ||
40 | return search_binary_handler(bprm,regs); | ||
41 | } | ||
42 | |||
43 | static struct linux_binfmt loader_format = { | ||
44 | .load_binary = load_binary, | ||
45 | }; | ||
46 | |||
47 | static int __init init_loader_binfmt(void) | ||
48 | { | ||
49 | return register_binfmt(&loader_format); | ||
50 | } | ||
51 | arch_initcall(init_loader_binfmt); | ||
diff --git a/arch/alpha/kernel/entry.S b/arch/alpha/kernel/entry.S index 5fc61e281ac7..f77345bc66a9 100644 --- a/arch/alpha/kernel/entry.S +++ b/arch/alpha/kernel/entry.S | |||
@@ -850,8 +850,9 @@ osf_getpriority: | |||
850 | sys_getxuid: | 850 | sys_getxuid: |
851 | .prologue 0 | 851 | .prologue 0 |
852 | ldq $2, TI_TASK($8) | 852 | ldq $2, TI_TASK($8) |
853 | ldl $0, TASK_UID($2) | 853 | ldq $3, TASK_CRED($2) |
854 | ldl $1, TASK_EUID($2) | 854 | ldl $0, CRED_UID($3) |
855 | ldl $1, CRED_EUID($3) | ||
855 | stq $1, 80($sp) | 856 | stq $1, 80($sp) |
856 | ret | 857 | ret |
857 | .end sys_getxuid | 858 | .end sys_getxuid |
@@ -862,8 +863,9 @@ sys_getxuid: | |||
862 | sys_getxgid: | 863 | sys_getxgid: |
863 | .prologue 0 | 864 | .prologue 0 |
864 | ldq $2, TI_TASK($8) | 865 | ldq $2, TI_TASK($8) |
865 | ldl $0, TASK_GID($2) | 866 | ldq $3, TASK_CRED($2) |
866 | ldl $1, TASK_EGID($2) | 867 | ldl $0, CRED_GID($3) |
868 | ldl $1, CRED_EGID($3) | ||
867 | stq $1, 80($sp) | 869 | stq $1, 80($sp) |
868 | ret | 870 | ret |
869 | .end sys_getxgid | 871 | .end sys_getxgid |
diff --git a/arch/alpha/kernel/init_task.c b/arch/alpha/kernel/init_task.c index 1f762189fa64..c2938e574a40 100644 --- a/arch/alpha/kernel/init_task.c +++ b/arch/alpha/kernel/init_task.c | |||
@@ -8,7 +8,6 @@ | |||
8 | #include <asm/uaccess.h> | 8 | #include <asm/uaccess.h> |
9 | 9 | ||
10 | 10 | ||
11 | static struct fs_struct init_fs = INIT_FS; | ||
12 | static struct signal_struct init_signals = INIT_SIGNALS(init_signals); | 11 | static struct signal_struct init_signals = INIT_SIGNALS(init_signals); |
13 | static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand); | 12 | static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand); |
14 | struct mm_struct init_mm = INIT_MM(init_mm); | 13 | struct mm_struct init_mm = INIT_MM(init_mm); |
diff --git a/arch/alpha/kernel/irq.c b/arch/alpha/kernel/irq.c index c626a821cdcb..703731accda6 100644 --- a/arch/alpha/kernel/irq.c +++ b/arch/alpha/kernel/irq.c | |||
@@ -50,12 +50,13 @@ int irq_select_affinity(unsigned int irq) | |||
50 | if (!irq_desc[irq].chip->set_affinity || irq_user_affinity[irq]) | 50 | if (!irq_desc[irq].chip->set_affinity || irq_user_affinity[irq]) |
51 | return 1; | 51 | return 1; |
52 | 52 | ||
53 | while (!cpu_possible(cpu) || !cpu_isset(cpu, irq_default_affinity)) | 53 | while (!cpu_possible(cpu) || |
54 | !cpumask_test_cpu(cpu, irq_default_affinity)) | ||
54 | cpu = (cpu < (NR_CPUS-1) ? cpu + 1 : 0); | 55 | cpu = (cpu < (NR_CPUS-1) ? cpu + 1 : 0); |
55 | last_cpu = cpu; | 56 | last_cpu = cpu; |
56 | 57 | ||
57 | irq_desc[irq].affinity = cpumask_of_cpu(cpu); | 58 | irq_desc[irq].affinity = cpumask_of_cpu(cpu); |
58 | irq_desc[irq].chip->set_affinity(irq, cpumask_of_cpu(cpu)); | 59 | irq_desc[irq].chip->set_affinity(irq, cpumask_of(cpu)); |
59 | return 0; | 60 | return 0; |
60 | } | 61 | } |
61 | #endif /* CONFIG_SMP */ | 62 | #endif /* CONFIG_SMP */ |
diff --git a/arch/alpha/kernel/process.c b/arch/alpha/kernel/process.c index 351407e07e71..f238370c907d 100644 --- a/arch/alpha/kernel/process.c +++ b/arch/alpha/kernel/process.c | |||
@@ -94,6 +94,7 @@ common_shutdown_1(void *generic_ptr) | |||
94 | flags |= 0x00040000UL; /* "remain halted" */ | 94 | flags |= 0x00040000UL; /* "remain halted" */ |
95 | *pflags = flags; | 95 | *pflags = flags; |
96 | cpu_clear(cpuid, cpu_present_map); | 96 | cpu_clear(cpuid, cpu_present_map); |
97 | cpu_clear(cpuid, cpu_possible_map); | ||
97 | halt(); | 98 | halt(); |
98 | } | 99 | } |
99 | #endif | 100 | #endif |
@@ -120,6 +121,7 @@ common_shutdown_1(void *generic_ptr) | |||
120 | #ifdef CONFIG_SMP | 121 | #ifdef CONFIG_SMP |
121 | /* Wait for the secondaries to halt. */ | 122 | /* Wait for the secondaries to halt. */ |
122 | cpu_clear(boot_cpuid, cpu_present_map); | 123 | cpu_clear(boot_cpuid, cpu_present_map); |
124 | cpu_clear(boot_cpuid, cpu_possible_map); | ||
123 | while (cpus_weight(cpu_present_map)) | 125 | while (cpus_weight(cpu_present_map)) |
124 | barrier(); | 126 | barrier(); |
125 | #endif | 127 | #endif |
diff --git a/arch/alpha/kernel/setup.c b/arch/alpha/kernel/setup.c index a449e999027c..02bee6983ce2 100644 --- a/arch/alpha/kernel/setup.c +++ b/arch/alpha/kernel/setup.c | |||
@@ -79,6 +79,11 @@ int alpha_l3_cacheshape; | |||
79 | unsigned long alpha_verbose_mcheck = CONFIG_VERBOSE_MCHECK_ON; | 79 | unsigned long alpha_verbose_mcheck = CONFIG_VERBOSE_MCHECK_ON; |
80 | #endif | 80 | #endif |
81 | 81 | ||
82 | #ifdef CONFIG_NUMA | ||
83 | struct cpumask node_to_cpumask_map[MAX_NUMNODES] __read_mostly; | ||
84 | EXPORT_SYMBOL(node_to_cpumask_map); | ||
85 | #endif | ||
86 | |||
82 | /* Which processor we booted from. */ | 87 | /* Which processor we booted from. */ |
83 | int boot_cpuid; | 88 | int boot_cpuid; |
84 | 89 | ||
diff --git a/arch/alpha/kernel/smp.c b/arch/alpha/kernel/smp.c index cf7da10097bb..d953e510f68d 100644 --- a/arch/alpha/kernel/smp.c +++ b/arch/alpha/kernel/smp.c | |||
@@ -70,11 +70,6 @@ enum ipi_message_type { | |||
70 | /* Set to a secondary's cpuid when it comes online. */ | 70 | /* Set to a secondary's cpuid when it comes online. */ |
71 | static int smp_secondary_alive __devinitdata = 0; | 71 | static int smp_secondary_alive __devinitdata = 0; |
72 | 72 | ||
73 | /* Which cpus ids came online. */ | ||
74 | cpumask_t cpu_online_map; | ||
75 | |||
76 | EXPORT_SYMBOL(cpu_online_map); | ||
77 | |||
78 | int smp_num_probed; /* Internal processor count */ | 73 | int smp_num_probed; /* Internal processor count */ |
79 | int smp_num_cpus = 1; /* Number that came online. */ | 74 | int smp_num_cpus = 1; /* Number that came online. */ |
80 | EXPORT_SYMBOL(smp_num_cpus); | 75 | EXPORT_SYMBOL(smp_num_cpus); |
@@ -440,6 +435,7 @@ setup_smp(void) | |||
440 | ((char *)cpubase + i*hwrpb->processor_size); | 435 | ((char *)cpubase + i*hwrpb->processor_size); |
441 | if ((cpu->flags & 0x1cc) == 0x1cc) { | 436 | if ((cpu->flags & 0x1cc) == 0x1cc) { |
442 | smp_num_probed++; | 437 | smp_num_probed++; |
438 | cpu_set(i, cpu_possible_map); | ||
443 | cpu_set(i, cpu_present_map); | 439 | cpu_set(i, cpu_present_map); |
444 | cpu->pal_revision = boot_cpu_palrev; | 440 | cpu->pal_revision = boot_cpu_palrev; |
445 | } | 441 | } |
@@ -473,6 +469,7 @@ smp_prepare_cpus(unsigned int max_cpus) | |||
473 | 469 | ||
474 | /* Nothing to do on a UP box, or when told not to. */ | 470 | /* Nothing to do on a UP box, or when told not to. */ |
475 | if (smp_num_probed == 1 || max_cpus == 0) { | 471 | if (smp_num_probed == 1 || max_cpus == 0) { |
472 | cpu_possible_map = cpumask_of_cpu(boot_cpuid); | ||
476 | cpu_present_map = cpumask_of_cpu(boot_cpuid); | 473 | cpu_present_map = cpumask_of_cpu(boot_cpuid); |
477 | printk(KERN_INFO "SMP mode deactivated.\n"); | 474 | printk(KERN_INFO "SMP mode deactivated.\n"); |
478 | return; | 475 | return; |
diff --git a/arch/alpha/kernel/sys_dp264.c b/arch/alpha/kernel/sys_dp264.c index c71b0fd7a61f..ab44c164d9d4 100644 --- a/arch/alpha/kernel/sys_dp264.c +++ b/arch/alpha/kernel/sys_dp264.c | |||
@@ -177,19 +177,19 @@ cpu_set_irq_affinity(unsigned int irq, cpumask_t affinity) | |||
177 | } | 177 | } |
178 | 178 | ||
179 | static void | 179 | static void |
180 | dp264_set_affinity(unsigned int irq, cpumask_t affinity) | 180 | dp264_set_affinity(unsigned int irq, const struct cpumask *affinity) |
181 | { | 181 | { |
182 | spin_lock(&dp264_irq_lock); | 182 | spin_lock(&dp264_irq_lock); |
183 | cpu_set_irq_affinity(irq, affinity); | 183 | cpu_set_irq_affinity(irq, *affinity); |
184 | tsunami_update_irq_hw(cached_irq_mask); | 184 | tsunami_update_irq_hw(cached_irq_mask); |
185 | spin_unlock(&dp264_irq_lock); | 185 | spin_unlock(&dp264_irq_lock); |
186 | } | 186 | } |
187 | 187 | ||
188 | static void | 188 | static void |
189 | clipper_set_affinity(unsigned int irq, cpumask_t affinity) | 189 | clipper_set_affinity(unsigned int irq, const struct cpumask *affinity) |
190 | { | 190 | { |
191 | spin_lock(&dp264_irq_lock); | 191 | spin_lock(&dp264_irq_lock); |
192 | cpu_set_irq_affinity(irq - 16, affinity); | 192 | cpu_set_irq_affinity(irq - 16, *affinity); |
193 | tsunami_update_irq_hw(cached_irq_mask); | 193 | tsunami_update_irq_hw(cached_irq_mask); |
194 | spin_unlock(&dp264_irq_lock); | 194 | spin_unlock(&dp264_irq_lock); |
195 | } | 195 | } |
diff --git a/arch/alpha/kernel/sys_titan.c b/arch/alpha/kernel/sys_titan.c index 52c91ccc1648..27f840a4ad3d 100644 --- a/arch/alpha/kernel/sys_titan.c +++ b/arch/alpha/kernel/sys_titan.c | |||
@@ -158,10 +158,10 @@ titan_cpu_set_irq_affinity(unsigned int irq, cpumask_t affinity) | |||
158 | } | 158 | } |
159 | 159 | ||
160 | static void | 160 | static void |
161 | titan_set_irq_affinity(unsigned int irq, cpumask_t affinity) | 161 | titan_set_irq_affinity(unsigned int irq, const struct cpumask *affinity) |
162 | { | 162 | { |
163 | spin_lock(&titan_irq_lock); | 163 | spin_lock(&titan_irq_lock); |
164 | titan_cpu_set_irq_affinity(irq - 16, affinity); | 164 | titan_cpu_set_irq_affinity(irq - 16, *affinity); |
165 | titan_update_irq_hw(titan_cached_irq_mask); | 165 | titan_update_irq_hw(titan_cached_irq_mask); |
166 | spin_unlock(&titan_irq_lock); | 166 | spin_unlock(&titan_irq_lock); |
167 | } | 167 | } |