Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] powerpc: Merge a few more include files

Merge a few asm-ppc and asm-ppc64 header files.
Note: the merge of setup.h intentionally does not carry
forward the m68k cruft. That means this patch continues
to break the already broken amiga on the ppc32.

Signed-off-by: Jon Loeliger <jdl@freescale.com>
Signed-off-by: Kumar Gala <kumar.gala@freescale.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>

authored by

jdl@freescale.com and committed by
Paul Mackerras
dd56fdf2 64807081

+62 -202
+9
include/asm-powerpc/setup.h
··· 1 + #ifndef _ASM_POWERPC_SETUP_H 2 + #define _ASM_POWERPC_SETUP_H 3 + 4 + #ifdef __KERNEL__ 5 + 6 + #define COMMAND_LINE_SIZE 512 7 + 8 + #endif /* __KERNEL__ */ 9 + #endif /* _ASM_POWERPC_SETUP_H */
+12 -4
include/asm-ppc/msgbuf.h include/asm-powerpc/msgbuf.h
··· 1 - #ifndef _PPC_MSGBUF_H 2 - #define _PPC_MSGBUF_H 1 + #ifndef _ASM_POWERPC_MSGBUF_H 2 + #define _ASM_POWERPC_MSGBUF_H 3 3 4 4 /* 5 - * The msqid64_ds structure for the PPC architecture. 5 + * The msqid64_ds structure for the PowerPC architecture. 6 + * Note extra padding because this structure is passed back and forth 7 + * between kernel and user space. 6 8 */ 7 9 8 10 struct msqid64_ds { 9 11 struct ipc64_perm msg_perm; 12 + #ifndef __powerpc64__ 10 13 unsigned int __unused1; 14 + #endif 11 15 __kernel_time_t msg_stime; /* last msgsnd time */ 16 + #ifndef __powerpc64__ 12 17 unsigned int __unused2; 18 + #endif 13 19 __kernel_time_t msg_rtime; /* last msgrcv time */ 20 + #ifndef __powerpc64__ 14 21 unsigned int __unused3; 22 + #endif 15 23 __kernel_time_t msg_ctime; /* last change time */ 16 24 unsigned long msg_cbytes; /* current number of bytes on queue */ 17 25 unsigned long msg_qnum; /* number of messages in queue */ ··· 30 22 unsigned long __unused5; 31 23 }; 32 24 33 - #endif /* _PPC_MSGBUF_H */ 25 + #endif /* _ASM_POWERPC_MSGBUF_H */
+4 -4
include/asm-ppc/param.h include/asm-powerpc/param.h
··· 1 - #ifndef _ASM_PPC_PARAM_H 2 - #define _ASM_PPC_PARAM_H 1 + #ifndef _ASM_POWERPC_PARAM_H 2 + #define _ASM_POWERPC_PARAM_H 3 3 4 4 #include <linux/config.h> 5 5 6 6 #ifdef __KERNEL__ 7 - #define HZ CONFIG_HZ /* internal timer frequency */ 7 + #define HZ CONFIG_HZ /* internal kernel timer frequency */ 8 8 #define USER_HZ 100 /* for user interfaces in "ticks" */ 9 9 #define CLOCKS_PER_SEC (USER_HZ) /* frequency at which times() counts */ 10 10 #endif /* __KERNEL__ */ ··· 21 21 22 22 #define MAXHOSTNAMELEN 64 /* max length of hostname */ 23 23 24 - #endif 24 + #endif /* _ASM_POWERPC_PARAM_H */
-14
include/asm-ppc/setup.h
··· 1 - #ifdef __KERNEL__ 2 - #ifndef _PPC_SETUP_H 3 - #define _PPC_SETUP_H 4 - 5 - #define m68k_num_memory num_memory 6 - #define m68k_memory memory 7 - 8 - #include <asm-m68k/setup.h> 9 - /* We have a bigger command line buffer. */ 10 - #undef COMMAND_LINE_SIZE 11 - #define COMMAND_LINE_SIZE 512 12 - 13 - #endif /* _PPC_SETUP_H */ 14 - #endif /* __KERNEL__ */
+24 -15
include/asm-ppc/timex.h include/asm-powerpc/timex.h
··· 1 - /* 2 - * include/asm-ppc/timex.h 3 - * 4 - * ppc architecture timex specifications 5 - */ 1 + #ifndef _ASM_POWERPC_TIMEX_H 2 + #define _ASM_POWERPC_TIMEX_H 3 + 6 4 #ifdef __KERNEL__ 7 - #ifndef _ASMppc_TIMEX_H 8 - #define _ASMppc_TIMEX_H 5 + 6 + /* 7 + * PowerPC architecture timex specifications 8 + */ 9 9 10 10 #include <linux/config.h> 11 11 #include <asm/cputable.h> ··· 14 14 15 15 typedef unsigned long cycles_t; 16 16 17 - /* 18 - * For the "cycle" counter we use the timebase lower half. 19 - * Currently only used on SMP. 20 - */ 21 - 22 17 static inline cycles_t get_cycles(void) 23 18 { 24 - cycles_t ret = 0; 19 + cycles_t ret; 20 + 21 + #ifdef __powerpc64__ 22 + 23 + __asm__ __volatile__("mftb %0" : "=r" (ret) : ); 24 + 25 + #else 26 + /* 27 + * For the "cycle" counter we use the timebase lower half. 28 + * Currently only used on SMP. 29 + */ 30 + 31 + ret = 0; 25 32 26 33 __asm__ __volatile__( 27 34 "98: mftb %0\n" ··· 40 33 " .long 99b\n" 41 34 ".previous" 42 35 : "=r" (ret) : "i" (CPU_FTR_601)); 36 + #endif 37 + 43 38 return ret; 44 39 } 45 40 46 - #endif 47 - #endif /* __KERNEL__ */ 41 + #endif /* __KERNEL__ */ 42 + #endif /* _ASM_POWERPC_TIMEX_H */
-6
include/asm-ppc/topology.h
··· 1 - #ifndef _ASM_PPC_TOPOLOGY_H 2 - #define _ASM_PPC_TOPOLOGY_H 3 - 4 - #include <asm-generic/topology.h> 5 - 6 - #endif /* _ASM_PPC_TOPOLOGY_H */
+8 -7
include/asm-ppc/user.h include/asm-powerpc/user.h
··· 1 + #ifndef _ASM_POWERPC_USER_H 2 + #define _ASM_POWERPC_USER_H 3 + 1 4 #ifdef __KERNEL__ 2 - #ifndef _PPC_USER_H 3 - #define _PPC_USER_H 4 5 5 - /* Adapted from <asm-alpha/user.h> */ 6 - 7 - #include <linux/ptrace.h> 6 + #include <asm/ptrace.h> 8 7 #include <asm/page.h> 9 8 10 9 /* 10 + * Adapted from <asm-alpha/user.h> 11 + * 11 12 * Core file format: The core file is written in such a way that gdb 12 13 * can understand it and provide useful information to the user (under 13 14 * linux we use the `trad-core' bfd, NOT the osf-core). The file contents ··· 51 50 #define HOST_DATA_START_ADDR (u.start_data) 52 51 #define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG) 53 52 54 - #endif /* _PPC_USER_H */ 55 - #endif /* __KERNEL__ */ 53 + #endif /* __KERNEL__ */ 54 + #endif /* _ASM_POWERPC_USER_H */
-27
include/asm-ppc64/msgbuf.h
··· 1 - #ifndef _PPC64_MSGBUF_H 2 - #define _PPC64_MSGBUF_H 3 - 4 - /* 5 - * The msqid64_ds structure for the PPC architecture. 6 - * 7 - * This program is free software; you can redistribute it and/or 8 - * modify it under the terms of the GNU General Public License 9 - * as published by the Free Software Foundation; either version 10 - * 2 of the License, or (at your option) any later version. 11 - */ 12 - 13 - struct msqid64_ds { 14 - struct ipc64_perm msg_perm; 15 - __kernel_time_t msg_stime; /* last msgsnd time */ 16 - __kernel_time_t msg_rtime; /* last msgrcv time */ 17 - __kernel_time_t msg_ctime; /* last change time */ 18 - unsigned long msg_cbytes; /* current number of bytes on queue */ 19 - unsigned long msg_qnum; /* number of messages in queue */ 20 - unsigned long msg_qbytes; /* max number of bytes on queue */ 21 - __kernel_pid_t msg_lspid; /* pid of last msgsnd */ 22 - __kernel_pid_t msg_lrpid; /* last receive pid */ 23 - unsigned long __unused1; 24 - unsigned long __unused2; 25 - }; 26 - 27 - #endif /* _PPC64_MSGBUF_H */
-31
include/asm-ppc64/param.h
··· 1 - #ifndef _ASM_PPC64_PARAM_H 2 - #define _ASM_PPC64_PARAM_H 3 - 4 - #include <linux/config.h> 5 - 6 - /* 7 - * This program is free software; you can redistribute it and/or 8 - * modify it under the terms of the GNU General Public License 9 - * as published by the Free Software Foundation; either version 10 - * 2 of the License, or (at your option) any later version. 11 - */ 12 - 13 - #ifdef __KERNEL__ 14 - # define HZ CONFIG_HZ /* Internal kernel timer frequency */ 15 - # define USER_HZ 100 /* .. some user interfaces are in "ticks" */ 16 - # define CLOCKS_PER_SEC (USER_HZ) /* like times() */ 17 - #endif 18 - 19 - #ifndef HZ 20 - #define HZ 100 21 - #endif 22 - 23 - #define EXEC_PAGESIZE 4096 24 - 25 - #ifndef NOGROUP 26 - #define NOGROUP (-1) 27 - #endif 28 - 29 - #define MAXHOSTNAMELEN 64 /* max length of hostname */ 30 - 31 - #endif /* _ASM_PPC64_PARAM_H */
-6
include/asm-ppc64/setup.h
··· 1 - #ifndef _PPC_SETUP_H 2 - #define _PPC_SETUP_H 3 - 4 - #define COMMAND_LINE_SIZE 512 5 - 6 - #endif /* _PPC_SETUP_H */
-26
include/asm-ppc64/timex.h
··· 1 - /* 2 - * linux/include/asm-ppc/timex.h 3 - * 4 - * PPC64 architecture timex specifications 5 - * 6 - * This program is free software; you can redistribute it and/or 7 - * modify it under the terms of the GNU General Public License 8 - * as published by the Free Software Foundation; either version 9 - * 2 of the License, or (at your option) any later version. 10 - */ 11 - #ifndef _ASMPPC64_TIMEX_H 12 - #define _ASMPPC64_TIMEX_H 13 - 14 - #define CLOCK_TICK_RATE 1193180 /* Underlying HZ */ 15 - 16 - typedef unsigned long cycles_t; 17 - 18 - static inline cycles_t get_cycles(void) 19 - { 20 - cycles_t ret; 21 - 22 - __asm__ __volatile__("mftb %0" : "=r" (ret) : ); 23 - return ret; 24 - } 25 - 26 - #endif
+5 -4
include/asm-ppc64/topology.h include/asm-powerpc/topology.h
··· 1 - #ifndef _ASM_PPC64_TOPOLOGY_H 2 - #define _ASM_PPC64_TOPOLOGY_H 1 + #ifndef _ASM_POWERPC_TOPOLOGY_H 2 + #define _ASM_POWERPC_TOPOLOGY_H 3 3 4 4 #include <linux/config.h> 5 - #include <asm/mmzone.h> 6 5 7 6 #ifdef CONFIG_NUMA 7 + 8 + #include <asm/mmzone.h> 8 9 9 10 static inline int cpu_to_node(int cpu) 10 11 { ··· 67 66 68 67 #endif /* CONFIG_NUMA */ 69 68 70 - #endif /* _ASM_PPC64_TOPOLOGY_H */ 69 + #endif /* _ASM_POWERPC_TOPOLOGY_H */
-58
include/asm-ppc64/user.h
··· 1 - #ifndef _PPC_USER_H 2 - #define _PPC_USER_H 3 - 4 - /* Adapted from <asm-alpha/user.h> 5 - * 6 - * This program is free software; you can redistribute it and/or 7 - * modify it under the terms of the GNU General Public License 8 - * as published by the Free Software Foundation; either version 9 - * 2 of the License, or (at your option) any later version. 10 - */ 11 - 12 - #include <asm/ptrace.h> 13 - #include <asm/page.h> 14 - 15 - /* 16 - * Core file format: The core file is written in such a way that gdb 17 - * can understand it and provide useful information to the user (under 18 - * linux we use the `trad-core' bfd, NOT the osf-core). The file contents 19 - * are as follows: 20 - * 21 - * upage: 1 page consisting of a user struct that tells gdb 22 - * what is present in the file. Directly after this is a 23 - * copy of the task_struct, which is currently not used by gdb, 24 - * but it may come in handy at some point. All of the registers 25 - * are stored as part of the upage. The upage should always be 26 - * only one page long. 27 - * data: The data segment follows next. We use current->end_text to 28 - * current->brk to pick up all of the user variables, plus any memory 29 - * that may have been sbrk'ed. No attempt is made to determine if a 30 - * page is demand-zero or if a page is totally unused, we just cover 31 - * the entire range. All of the addresses are rounded in such a way 32 - * that an integral number of pages is written. 33 - * stack: We need the stack information in order to get a meaningful 34 - * backtrace. We need to write the data from usp to 35 - * current->start_stack, so we round each of these in order to be able 36 - * to write an integer number of pages. 37 - */ 38 - struct user { 39 - struct pt_regs regs; /* entire machine state */ 40 - size_t u_tsize; /* text size (pages) */ 41 - size_t u_dsize; /* data size (pages) */ 42 - size_t u_ssize; /* stack size (pages) */ 43 - unsigned long start_code; /* text starting address */ 44 - unsigned long start_data; /* data starting address */ 45 - unsigned long start_stack; /* stack starting address */ 46 - long int signal; /* signal causing core dump */ 47 - struct regs * u_ar0; /* help gdb find registers */ 48 - unsigned long magic; /* identifies a core file */ 49 - char u_comm[32]; /* user command name */ 50 - }; 51 - 52 - #define NBPG PAGE_SIZE 53 - #define UPAGES 1 54 - #define HOST_TEXT_START_ADDR (u.start_code) 55 - #define HOST_DATA_START_ADDR (u.start_data) 56 - #define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG) 57 - 58 - #endif /* _PPC_USER_H */