Skip to content

Commit e534a58

Browse files
committed
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mattst88/alpha
Pull alpha updates from Al Viro: "Mostly small janitorial fixes but there's also more important ones: a patch to fix loading large modules from Edward Humes, and some fixes from Al Viro" [ The fixes from Al mostly came in separately through Al's trees too and are now duplicated.. - Linus ] * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mattst88/alpha: alpha: in_irq() cleanup alpha: lazy FPU switching alpha/boot/misc: trim unused declarations alpha/boot/tools/objstrip: fix the check for ELF header alpha/boot: fix the breakage from -isystem series... alpha: fix FEN fault handling alpha: Avoid comma separated statements alpha: fixed a typo in core_cia.c alpha: remove unused __SLOW_DOWN_IO and SLOW_DOWN_IO definitions alpha: update config files alpha: fix R_ALPHA_LITERAL reloc for large modules alpha: Add some spaces to ensure format specification alpha: replace NR_SYSCALLS by NR_syscalls alpha: Remove redundant local asm header redirections alpha: Implement "current_stack_pointer" alpha: remove redundant err variable alpha: osf_sys: reduce kernel log spamming on invalid osf_mount call typenr
2 parents cac85e4 + 290ec1d commit e534a58

File tree

26 files changed

+217
-154
lines changed

26 files changed

+217
-154
lines changed

arch/alpha/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ config ALPHA
33
bool
44
default y
55
select ARCH_32BIT_USTAT_F_TINODE
6+
select ARCH_HAS_CURRENT_STACK_POINTER
67
select ARCH_MIGHT_HAVE_PC_PARPORT
78
select ARCH_MIGHT_HAVE_PC_SERIO
89
select ARCH_NO_PREEMPT

arch/alpha/boot/stdio.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ static int skip_atoi(const char **s)
4242

4343
static char * number(char * str, unsigned long long num, int base, int size, int precision, int type)
4444
{
45-
char c,sign,tmp[66];
46-
const char *digits="0123456789abcdefghijklmnopqrstuvwxyz";
45+
char c, sign, tmp[66];
46+
const char *digits = "0123456789abcdefghijklmnopqrstuvwxyz";
4747
int i;
4848

4949
if (type & LARGE)
@@ -83,14 +83,14 @@ static char * number(char * str, unsigned long long num, int base, int size, int
8383
precision = i;
8484
size -= precision;
8585
if (!(type&(ZEROPAD+LEFT)))
86-
while(size-->0)
86+
while (size-- > 0)
8787
*str++ = ' ';
8888
if (sign)
8989
*str++ = sign;
9090
if (type & SPECIAL) {
9191
if (base==8)
9292
*str++ = '0';
93-
else if (base==16) {
93+
else if (base == 16) {
9494
*str++ = '0';
9595
*str++ = digits[33];
9696
}
@@ -125,7 +125,7 @@ int vsprintf(char *buf, const char *fmt, va_list args)
125125
/* 'z' changed to 'Z' --davidm 1/25/99 */
126126

127127

128-
for (str=buf ; *fmt ; ++fmt) {
128+
for (str = buf ; *fmt ; ++fmt) {
129129
if (*fmt != '%') {
130130
*str++ = *fmt;
131131
continue;
@@ -296,7 +296,7 @@ int sprintf(char * buf, const char *fmt, ...)
296296
int i;
297297

298298
va_start(args, fmt);
299-
i=vsprintf(buf,fmt,args);
299+
i = vsprintf(buf, fmt, args);
300300
va_end(args);
301301
return i;
302302
}

arch/alpha/configs/defconfig

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,12 @@ CONFIG_PATA_CYPRESS=y
3939
CONFIG_ATA_GENERIC=y
4040
CONFIG_NETDEVICES=y
4141
CONFIG_DUMMY=m
42-
CONFIG_NET_ETHERNET=y
4342
CONFIG_NET_VENDOR_3COM=y
4443
CONFIG_VORTEX=y
4544
CONFIG_NET_TULIP=y
4645
CONFIG_DE2104X=m
4746
CONFIG_TULIP=y
4847
CONFIG_TULIP_MMIO=y
49-
CONFIG_NET_PCI=y
5048
CONFIG_YELLOWFIN=y
5149
CONFIG_SERIAL_8250=y
5250
CONFIG_SERIAL_8250_CONSOLE=y

arch/alpha/include/asm/Kbuild

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
generated-y += syscall_table.h
44
generic-y += agp.h
5+
generic-y += asm-offsets.h
56
generic-y += export.h
67
generic-y += kvm_para.h
78
generic-y += mcs_spinlock.h

arch/alpha/include/asm/asm-offsets.h

Lines changed: 0 additions & 1 deletion
This file was deleted.

arch/alpha/include/asm/div64.h

Lines changed: 0 additions & 1 deletion
This file was deleted.

arch/alpha/include/asm/fpu.h

Lines changed: 37 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,27 @@ rdfpcr(void)
1515
{
1616
unsigned long tmp, ret;
1717

18+
preempt_disable();
19+
if (current_thread_info()->status & TS_SAVED_FP) {
20+
ret = current_thread_info()->fp[31];
21+
} else {
1822
#if defined(CONFIG_ALPHA_EV6) || defined(CONFIG_ALPHA_EV67)
19-
__asm__ __volatile__ (
20-
"ftoit $f0,%0\n\t"
21-
"mf_fpcr $f0\n\t"
22-
"ftoit $f0,%1\n\t"
23-
"itoft %0,$f0"
24-
: "=r"(tmp), "=r"(ret));
23+
__asm__ __volatile__ (
24+
"ftoit $f0,%0\n\t"
25+
"mf_fpcr $f0\n\t"
26+
"ftoit $f0,%1\n\t"
27+
"itoft %0,$f0"
28+
: "=r"(tmp), "=r"(ret));
2529
#else
26-
__asm__ __volatile__ (
27-
"stt $f0,%0\n\t"
28-
"mf_fpcr $f0\n\t"
29-
"stt $f0,%1\n\t"
30-
"ldt $f0,%0"
31-
: "=m"(tmp), "=m"(ret));
30+
__asm__ __volatile__ (
31+
"stt $f0,%0\n\t"
32+
"mf_fpcr $f0\n\t"
33+
"stt $f0,%1\n\t"
34+
"ldt $f0,%0"
35+
: "=m"(tmp), "=m"(ret));
3236
#endif
37+
}
38+
preempt_enable();
3339

3440
return ret;
3541
}
@@ -39,21 +45,28 @@ wrfpcr(unsigned long val)
3945
{
4046
unsigned long tmp;
4147

48+
preempt_disable();
49+
if (current_thread_info()->status & TS_SAVED_FP) {
50+
current_thread_info()->status |= TS_RESTORE_FP;
51+
current_thread_info()->fp[31] = val;
52+
} else {
4253
#if defined(CONFIG_ALPHA_EV6) || defined(CONFIG_ALPHA_EV67)
43-
__asm__ __volatile__ (
44-
"ftoit $f0,%0\n\t"
45-
"itoft %1,$f0\n\t"
46-
"mt_fpcr $f0\n\t"
47-
"itoft %0,$f0"
48-
: "=&r"(tmp) : "r"(val));
54+
__asm__ __volatile__ (
55+
"ftoit $f0,%0\n\t"
56+
"itoft %1,$f0\n\t"
57+
"mt_fpcr $f0\n\t"
58+
"itoft %0,$f0"
59+
: "=&r"(tmp) : "r"(val));
4960
#else
50-
__asm__ __volatile__ (
51-
"stt $f0,%0\n\t"
52-
"ldt $f0,%1\n\t"
53-
"mt_fpcr $f0\n\t"
54-
"ldt $f0,%0"
55-
: "=m"(tmp) : "m"(val));
61+
__asm__ __volatile__ (
62+
"stt $f0,%0\n\t"
63+
"ldt $f0,%1\n\t"
64+
"mt_fpcr $f0\n\t"
65+
"ldt $f0,%0"
66+
: "=m"(tmp) : "m"(val));
5667
#endif
68+
}
69+
preempt_enable();
5770
}
5871

5972
static inline unsigned long

arch/alpha/include/asm/io.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@
1414
the implementation we have here matches that interface. */
1515
#include <asm-generic/iomap.h>
1616

17-
/* We don't use IO slowdowns on the Alpha, but.. */
18-
#define __SLOW_DOWN_IO do { } while (0)
19-
#define SLOW_DOWN_IO do { } while (0)
20-
2117
/*
2218
* Virtual -> physical identity mapping starts at this offset
2319
*/

arch/alpha/include/asm/irq_regs.h

Lines changed: 0 additions & 1 deletion
This file was deleted.

arch/alpha/include/asm/kdebug.h

Lines changed: 0 additions & 1 deletion
This file was deleted.

arch/alpha/include/asm/thread_info.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ struct thread_info {
2626
int bpt_nsaved;
2727
unsigned long bpt_addr[2]; /* breakpoint handling */
2828
unsigned int bpt_insn[2];
29+
unsigned long fp[32];
2930
};
3031

3132
/*
@@ -41,6 +42,8 @@ struct thread_info {
4142
register struct thread_info *__current_thread_info __asm__("$8");
4243
#define current_thread_info() __current_thread_info
4344

45+
register unsigned long *current_stack_pointer __asm__ ("$30");
46+
4447
#endif /* __ASSEMBLY__ */
4548

4649
/* Thread information allocation. */
@@ -81,6 +84,9 @@ register struct thread_info *__current_thread_info __asm__("$8");
8184
#define TS_UAC_NOFIX 0x0002 /* ! flags as they match */
8285
#define TS_UAC_SIGBUS 0x0004 /* ! userspace part of 'osf_sysinfo' */
8386

87+
#define TS_SAVED_FP 0x0008
88+
#define TS_RESTORE_FP 0x0010
89+
8490
#define SET_UNALIGN_CTL(task,value) ({ \
8591
__u32 status = task_thread_info(task)->status & ~UAC_BITMASK; \
8692
if (value & PR_UNALIGN_NOPRINT) \
@@ -104,5 +110,17 @@ register struct thread_info *__current_thread_info __asm__("$8");
104110
put_user(res, (int __user *)(value)); \
105111
})
106112

113+
#ifndef __ASSEMBLY__
114+
extern void __save_fpu(void);
115+
116+
static inline void save_fpu(void)
117+
{
118+
if (!(current_thread_info()->status & TS_SAVED_FP)) {
119+
current_thread_info()->status |= TS_SAVED_FP;
120+
__save_fpu();
121+
}
122+
}
123+
#endif
124+
107125
#endif /* __KERNEL__ */
108126
#endif /* _ALPHA_THREAD_INFO_H */

arch/alpha/include/asm/unistd.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
#include <uapi/asm/unistd.h>
66

7-
#define NR_SYSCALLS __NR_syscalls
7+
#define NR_syscalls __NR_syscalls
88

99
#define __ARCH_WANT_NEW_STAT
1010
#define __ARCH_WANT_OLD_READDIR

arch/alpha/include/uapi/asm/ptrace.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@ struct switch_stack {
6464
unsigned long r14;
6565
unsigned long r15;
6666
unsigned long r26;
67+
#ifndef __KERNEL__
6768
unsigned long fp[32]; /* fp[31] is fpcr */
69+
#endif
6870
};
6971

7072

arch/alpha/kernel/asm-offsets.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ void foo(void)
1717
DEFINE(TI_TASK, offsetof(struct thread_info, task));
1818
DEFINE(TI_FLAGS, offsetof(struct thread_info, flags));
1919
DEFINE(TI_CPU, offsetof(struct thread_info, cpu));
20+
DEFINE(TI_FP, offsetof(struct thread_info, fp));
21+
DEFINE(TI_STATUS, offsetof(struct thread_info, status));
2022
BLANK();
2123

2224
DEFINE(TASK_BLOCKED, offsetof(struct task_struct, blocked));

arch/alpha/kernel/core_cia.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ verify_tb_operation(void)
527527
if (use_tbia_try2) {
528528
alpha_mv.mv_pci_tbi = cia_pci_tbi_try2;
529529

530-
/* Tags 0-3 must be disabled if we use this workaraund. */
530+
/* Tags 0-3 must be disabled if we use this workaround. */
531531
wmb();
532532
*(vip)CIA_IOC_TB_TAGn(0) = 2;
533533
*(vip)CIA_IOC_TB_TAGn(1) = 2;

0 commit comments

Comments
 (0)