diff options
| author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-07-06 09:32:38 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-07-06 09:32:38 -0700 |
| commit | 0ac3fc9f4510c41c02dcb19ecf261ad9bc842d9e (patch) | |
| tree | e9fb6f4f8ea42d14e8d990e9346d07973869103a /include | |
| parent | 2453a83f2c4b5cb0ea6aba4192e60dadc1e52e96 (diff) | |
| parent | b6d199cc7eb5f57c8681cfd3156d17dd4151acfb (diff) | |
Merge bk://kernel.bkbits.net/davem/net-2.6
into ppc970.osdl.org:/home/torvalds/v2.6/linux
Diffstat (limited to 'include')
| -rw-r--r-- | include/asm-i386/signal.h | 13 | ||||
| -rw-r--r-- | include/asm-i386/upd4990a.h | 52 | ||||
| -rw-r--r-- | include/asm-ppc64/signal.h | 14 | ||||
| -rw-r--r-- | include/asm-s390/processor.h | 10 | ||||
| -rw-r--r-- | include/asm-s390/sigp.h | 32 | ||||
| -rw-r--r-- | include/asm-s390/smp.h | 11 | ||||
| -rw-r--r-- | include/linux/fb.h | 1 | ||||
| -rw-r--r-- | include/linux/upd4990a.h | 140 |
8 files changed, 45 insertions, 228 deletions
diff --git a/include/asm-i386/signal.h b/include/asm-i386/signal.h index e3397cd6f77b..de3da5b31077 100644 --- a/include/asm-i386/signal.h +++ b/include/asm-i386/signal.h @@ -4,6 +4,7 @@ #include <linux/types.h> #include <linux/linkage.h> #include <linux/time.h> +#include <linux/compiler.h> /* Avoid too many header ordering problems. */ struct siginfo; @@ -128,7 +129,11 @@ typedef unsigned long sigset_t; #define SIG_SETMASK 2 /* for setting the signal mask */ /* Type of a signal handler. */ -typedef void (*__sighandler_t)(int); +typedef void __signalfn_t(int); +typedef __signalfn_t __user *__sighandler_t; + +typedef void __restorefn_t(void); +typedef __restorefn_t __user *__sigrestore_t; #define SIG_DFL ((__sighandler_t)0) /* default signal handling */ #define SIG_IGN ((__sighandler_t)1) /* ignore signal */ @@ -139,13 +144,13 @@ struct old_sigaction { __sighandler_t sa_handler; old_sigset_t sa_mask; unsigned long sa_flags; - void (*sa_restorer)(void); + __sigrestore_t sa_restorer; }; struct sigaction { __sighandler_t sa_handler; unsigned long sa_flags; - void (*sa_restorer)(void); + __sigrestore_t sa_restorer; sigset_t sa_mask; /* mask last for extensibility */ }; @@ -171,7 +176,7 @@ struct sigaction { #endif /* __KERNEL__ */ typedef struct sigaltstack { - void *ss_sp; + void __user *ss_sp; int ss_flags; size_t ss_size; } stack_t; diff --git a/include/asm-i386/upd4990a.h b/include/asm-i386/upd4990a.h deleted file mode 100644 index de4f4edf91d2..000000000000 --- a/include/asm-i386/upd4990a.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Architecture dependent definitions - * for NEC uPD4990A serial I/O real-time clock. - * - * Copyright 2001 TAKAI Kousuke <tak@kmc.kyoto-u.ac.jp> - * Kyoto University Microcomputer Club (KMC). - * - * References: - * uPD4990A serial I/O real-time clock users' manual (Japanese) - * No. S12828JJ4V0UM00 (4th revision), NEC Corporation, 1999. - */ - -#ifndef _ASM_I386_uPD4990A_H -#define _ASM_I386_uPD4990A_H - -#include <asm/io.h> - -#define UPD4990A_IO (0x0020) -#define UPD4990A_IO_DATAOUT (0x0033) - -#define UPD4990A_OUTPUT_DATA_CLK(data, clk) \ - outb((((data) & 1) << 5) | (((clk) & 1) << 4) \ - | UPD4990A_PAR_SERIAL_MODE, UPD4990A_IO) - -#define UPD4990A_OUTPUT_CLK(clk) UPD4990A_OUTPUT_DATA_CLK(0, (clk)) - -#define UPD4990A_OUTPUT_STROBE(stb) \ - outb(((stb) << 3) | UPD4990A_PAR_SERIAL_MODE, UPD4990A_IO) - -/* - * Note: udelay() is *not* usable for UPD4990A_DELAY because - * the Linux kernel reads uPD4990A to set up system clock - * before calibrating delay... - */ -#define UPD4990A_DELAY(usec) \ - do { \ - if (__builtin_constant_p((usec)) && (usec) < 5) \ - __asm__ (".rept %c1\n\toutb %%al,%0\n\t.endr" \ - : : "N" (0x5F), \ - "i" (((usec) * 10 + 5) / 6)); \ - else { \ - int _count = ((usec) * 10 + 5) / 6; \ - __asm__ volatile ("1: outb %%al,%1\n\tloop 1b" \ - : "=c" (_count) \ - : "N" (0x5F), "0" (_count)); \ - } \ - } while (0) - -/* Caller should ignore all bits except bit0 */ -#define UPD4990A_READ_DATA() inb(UPD4990A_IO_DATAOUT) - -#endif diff --git a/include/asm-ppc64/signal.h b/include/asm-ppc64/signal.h index 7cd1f9a09d71..fe5401adb41b 100644 --- a/include/asm-ppc64/signal.h +++ b/include/asm-ppc64/signal.h @@ -2,6 +2,7 @@ #define _ASMPPC64_SIGNAL_H #include <linux/types.h> +#include <linux/compiler.h> #include <asm/siginfo.h> /* Avoid too many header ordering problems. */ @@ -114,7 +115,12 @@ typedef struct { #define SIG_SETMASK 2 /* for setting the signal mask */ /* Type of a signal handler. */ -typedef void (*__sighandler_t)(int); +typedef void __sigfunction(int); +typedef __sigfunction __user * __sighandler_t; + +/* Type of the restorer function */ +typedef void __sigrestorer(void); +typedef __sigrestorer __user * __sigrestorer_t; #define SIG_DFL ((__sighandler_t)0) /* default signal handling */ #define SIG_IGN ((__sighandler_t)1) /* ignore signal */ @@ -124,13 +130,13 @@ struct old_sigaction { __sighandler_t sa_handler; old_sigset_t sa_mask; unsigned long sa_flags; - void (*sa_restorer)(void); + __sigrestorer_t sa_restorer; }; struct sigaction { __sighandler_t sa_handler; unsigned long sa_flags; - void (*sa_restorer)(void); + __sigrestorer_t sa_restorer; sigset_t sa_mask; /* mask last for extensibility */ }; @@ -139,7 +145,7 @@ struct k_sigaction { }; typedef struct sigaltstack { - void *ss_sp; + void __user *ss_sp; int ss_flags; size_t ss_size; } stack_t; diff --git a/include/asm-s390/processor.h b/include/asm-s390/processor.h index 33154f85aed6..4c9d607021d7 100644 --- a/include/asm-s390/processor.h +++ b/include/asm-s390/processor.h @@ -319,6 +319,16 @@ static inline void disabled_wait(unsigned long code) #endif /* __s390x__ */ } +/* + * CPU idle notifier chain. + */ +#define CPU_IDLE 0 +#define CPU_NOT_IDLE 1 + +struct notifier_block; +int register_idle_notifier(struct notifier_block *nb); +int unregister_idle_notifier(struct notifier_block *nb); + #endif #endif /* __ASM_S390_PROCESSOR_H */ diff --git a/include/asm-s390/sigp.h b/include/asm-s390/sigp.h index d5583c78dc9b..3979bc3858e2 100644 --- a/include/asm-s390/sigp.h +++ b/include/asm-s390/sigp.h @@ -5,6 +5,7 @@ * Copyright (C) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation * Author(s): Denis Joseph Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com), * Martin Schwidefsky (schwidefsky@de.ibm.com) + * Heiko Carstens (heiko.carstens@de.ibm.com) * * sigp.h by D.J. Barrow (c) IBM 1999 * contains routines / structures for signalling other S/390 processors in an @@ -72,17 +73,10 @@ signal_processor(__u16 cpu_addr, sigp_order_code order_code) sigp_ccode ccode; __asm__ __volatile__( -#ifndef __s390x__ " sr 1,1\n" /* parameter=0 in gpr 1 */ " sigp 1,%1,0(%2)\n" " ipm %0\n" " srl %0,28\n" -#else /* __s390x__ */ - " sgr 1,1\n" /* parameter=0 in gpr 1 */ - " sigp 1,%1,0(%2)\n" - " ipm %0\n" - " srl %0,28" -#endif /* __s390x__ */ : "=d" (ccode) : "d" (__cpu_logical_map[cpu_addr]), "a" (order_code) : "cc" , "memory", "1" ); @@ -93,23 +87,16 @@ signal_processor(__u16 cpu_addr, sigp_order_code order_code) * Signal processor with parameter */ extern __inline__ sigp_ccode -signal_processor_p(unsigned long parameter,__u16 cpu_addr, +signal_processor_p(__u32 parameter, __u16 cpu_addr, sigp_order_code order_code) { sigp_ccode ccode; __asm__ __volatile__( -#ifndef __s390x__ " lr 1,%1\n" /* parameter in gpr 1 */ " sigp 1,%2,0(%3)\n" " ipm %0\n" " srl %0,28\n" -#else /* __s390x__ */ - " lgr 1,%1\n" /* parameter in gpr 1 */ - " sigp 1,%2,0(%3)\n" - " ipm %0\n" - " srl %0,28\n" -#endif /* __s390x__ */ : "=d" (ccode) : "d" (parameter), "d" (__cpu_logical_map[cpu_addr]), "a" (order_code) @@ -121,27 +108,18 @@ signal_processor_p(unsigned long parameter,__u16 cpu_addr, * Signal processor with parameter and return status */ extern __inline__ sigp_ccode -signal_processor_ps(unsigned long *statusptr, unsigned long parameter, +signal_processor_ps(__u32 *statusptr, __u32 parameter, __u16 cpu_addr, sigp_order_code order_code) { sigp_ccode ccode; __asm__ __volatile__( -#ifndef __s390x__ - " sr 2,2\n" /* clear status so it doesn't contain rubbish if not saved. */ + " sr 2,2\n" /* clear status */ " lr 3,%2\n" /* parameter in gpr 3 */ " sigp 2,%3,0(%4)\n" " st 2,%1\n" " ipm %0\n" " srl %0,28\n" -#else /* __s390x__ */ - " sgr 2,2\n" /* clear status so it doesn't contain rubbish if not saved. */ - " lgr 3,%2\n" /* parameter in gpr 3 */ - " sigp 2,%3,0(%4)\n" - " stg 2,%1\n" - " ipm %0\n" - " srl %0,28\n" -#endif /* __s390x__ */ : "=d" (ccode), "=m" (*statusptr) : "d" (parameter), "d" (__cpu_logical_map[cpu_addr]), "a" (order_code) @@ -151,5 +129,3 @@ signal_processor_ps(unsigned long *statusptr, unsigned long parameter, } #endif /* __SIGP__ */ - - diff --git a/include/asm-s390/smp.h b/include/asm-s390/smp.h index 70d06261bb9e..0590eccb051a 100644 --- a/include/asm-s390/smp.h +++ b/include/asm-s390/smp.h @@ -5,6 +5,7 @@ * Copyright (C) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation * Author(s): Denis Joseph Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com), * Martin Schwidefsky (schwidefsky@de.ibm.com) + * Heiko Carstens (heiko.carstens@de.ibm.com) */ #ifndef __ASM_SMP_H #define __ASM_SMP_H @@ -47,6 +48,9 @@ extern int smp_call_function_on(void (*func) (void *info), void *info, #define smp_processor_id() (S390_lowcore.cpu_data.cpu_nr) +extern int smp_get_cpu(cpumask_t cpu_map); +extern void smp_put_cpu(int cpu); + extern __inline__ __u16 hard_smp_processor_id(void) { __u16 cpu_address; @@ -57,10 +61,17 @@ extern __inline__ __u16 hard_smp_processor_id(void) #define cpu_logical_map(cpu) (cpu) +extern int __cpu_disable (void); +extern void __cpu_die (unsigned int cpu); +extern void cpu_die (void) __attribute__ ((noreturn)); +extern int __cpu_up (unsigned int cpu); + #endif #ifndef CONFIG_SMP #define smp_call_function_on(func,info,nonatomic,wait,cpu) ({ 0; }) +#define smp_get_cpu(cpu) ({ 0; }) +#define smp_put_cpu(cpu) ({ 0; }) #endif #endif diff --git a/include/linux/fb.h b/include/linux/fb.h index fc695bb87bd6..afcdc664ddc4 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h @@ -533,6 +533,7 @@ struct fb_ops { #define FBINFO_MISC_MODECHANGEUSER 0x10000 /* mode change request from userspace */ #define FBINFO_MISC_MODESWITCH 0x20000 /* mode switch */ +#define FBINFO_MISC_MODESWITCHLATE 0x40000 /* init hardware later */ struct fb_info { int node; diff --git a/include/linux/upd4990a.h b/include/linux/upd4990a.h deleted file mode 100644 index ad5063490808..000000000000 --- a/include/linux/upd4990a.h +++ /dev/null @@ -1,140 +0,0 @@ -/* - * Constant and architecture independent procedures - * for NEC uPD4990A serial I/O real-time clock. - * - * Copyright 2001 TAKAI Kousuke <tak@kmc.kyoto-u.ac.jp> - * Kyoto University Microcomputer Club (KMC). - * - * References: - * uPD4990A serial I/O real-time clock users' manual (Japanese) - * No. S12828JJ4V0UM00 (4th revision), NEC Corporation, 1999. - */ - -#ifndef _LINUX_uPD4990A_H -#define _LINUX_uPD4990A_H - -#include <asm/byteorder.h> - -#include <asm/upd4990a.h> - -/* Serial commands (4 bits) */ -#define UPD4990A_REGISTER_HOLD (0x0) -#define UPD4990A_REGISTER_SHIFT (0x1) -#define UPD4990A_TIME_SET_AND_COUNTER_HOLD (0x2) -#define UPD4990A_TIME_READ (0x3) -#define UPD4990A_TP_64HZ (0x4) -#define UPD4990A_TP_256HZ (0x5) -#define UPD4990A_TP_2048HZ (0x6) -#define UPD4990A_TP_4096HZ (0x7) -#define UPD4990A_TP_1S (0x8) -#define UPD4990A_TP_10S (0x9) -#define UPD4990A_TP_30S (0xA) -#define UPD4990A_TP_60S (0xB) -#define UPD4990A_INTERRUPT_RESET (0xC) -#define UPD4990A_INTERRUPT_TIMER_START (0xD) -#define UPD4990A_INTERRUPT_TIMER_STOP (0xE) -#define UPD4990A_TEST_MODE_SET (0xF) - -/* Parallel commands (3 bits) - 0-6 are same with serial commands. */ -#define UPD4990A_PAR_SERIAL_MODE 7 - -#ifndef UPD4990A_DELAY -# include <linux/delay.h> -# define UPD4990A_DELAY(usec) udelay((usec)) -#endif -#ifndef UPD4990A_OUTPUT_DATA -# define UPD4990A_OUTPUT_DATA(bit) \ - do { \ - UPD4990A_OUTPUT_DATA_CLK((bit), 0); \ - UPD4990A_DELAY(1); /* t-DSU */ \ - UPD4990A_OUTPUT_DATA_CLK((bit), 1); \ - UPD4990A_DELAY(1); /* t-DHLD */ \ - } while (0) -#endif - -static __inline__ void upd4990a_serial_command(int command) -{ - UPD4990A_OUTPUT_DATA(command >> 0); - UPD4990A_OUTPUT_DATA(command >> 1); - UPD4990A_OUTPUT_DATA(command >> 2); - UPD4990A_OUTPUT_DATA(command >> 3); - UPD4990A_DELAY(1); /* t-HLD */ - UPD4990A_OUTPUT_STROBE(1); - UPD4990A_DELAY(1); /* t-STB & t-d1 */ - UPD4990A_OUTPUT_STROBE(0); - /* 19 microseconds extra delay is needed - iff previous mode is TIME READ command */ -} - -struct upd4990a_raw_data { - u8 sec; /* BCD */ - u8 min; /* BCD */ - u8 hour; /* BCD */ - u8 mday; /* BCD */ -#if defined __LITTLE_ENDIAN_BITFIELD - unsigned wday :4; /* 0-6 */ - unsigned mon :4; /* 1-based */ -#elif defined __BIG_ENDIAN_BITFIELD - unsigned mon :4; /* 1-based */ - unsigned wday :4; /* 0-6 */ -#else -# error Unknown bitfield endian! -#endif - u8 year; /* BCD */ -}; - -static __inline__ void upd4990a_get_time(struct upd4990a_raw_data *buf, - int leave_register_hold) -{ - int byte; - - upd4990a_serial_command(UPD4990A_TIME_READ); - upd4990a_serial_command(UPD4990A_REGISTER_SHIFT); - UPD4990A_DELAY(19); /* t-d2 - t-d1 */ - - for (byte = 0; byte < 6; byte++) { - u8 tmp; - int bit; - - for (tmp = 0, bit = 0; bit < 8; bit++) { - tmp = (tmp | (UPD4990A_READ_DATA() << 8)) >> 1; - UPD4990A_OUTPUT_CLK(1); - UPD4990A_DELAY(1); - UPD4990A_OUTPUT_CLK(0); - UPD4990A_DELAY(1); - } - ((u8 *) buf)[byte] = tmp; - } - - /* The uPD4990A users' manual says that we should issue `Register - Hold' command after each data retrieval, or next `Time Read' - command may not work correctly. */ - if (!leave_register_hold) - upd4990a_serial_command(UPD4990A_REGISTER_HOLD); -} - -static __inline__ void upd4990a_set_time(const struct upd4990a_raw_data *data, - int time_set_only) -{ - int byte; - - if (!time_set_only) - upd4990a_serial_command(UPD4990A_REGISTER_SHIFT); - - for (byte = 0; byte < 6; byte++) { - int bit; - u8 tmp = ((const u8 *) data)[byte]; - - for (bit = 0; bit < 8; bit++, tmp >>= 1) - UPD4990A_OUTPUT_DATA(tmp); - } - - upd4990a_serial_command(UPD4990A_TIME_SET_AND_COUNTER_HOLD); - - /* Release counter hold and start the clock. */ - if (!time_set_only) - upd4990a_serial_command(UPD4990A_REGISTER_HOLD); -} - -#endif /* _LINUX_uPD4990A_H */ |
