diff options
author | jdl@freescale.com <jdl@freescale.com> | 2005-09-07 16:59:48 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2005-09-09 08:11:35 -0400 |
commit | dd56fdf23dfa0127d512b73d4238dbd2b5a7c1eb (patch) | |
tree | 59f952b87d4bec5f11c578a384c3aaa2ddf5860d /include/asm-powerpc | |
parent | 64807081e38703617cf9a5d71db14ea2b3e1cb04 (diff) |
[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>
Diffstat (limited to 'include/asm-powerpc')
-rw-r--r-- | include/asm-powerpc/msgbuf.h | 33 | ||||
-rw-r--r-- | include/asm-powerpc/param.h | 24 | ||||
-rw-r--r-- | include/asm-powerpc/setup.h | 9 | ||||
-rw-r--r-- | include/asm-powerpc/timex.h | 49 | ||||
-rw-r--r-- | include/asm-powerpc/topology.h | 70 | ||||
-rw-r--r-- | include/asm-powerpc/user.h | 55 |
6 files changed, 240 insertions, 0 deletions
diff --git a/include/asm-powerpc/msgbuf.h b/include/asm-powerpc/msgbuf.h new file mode 100644 index 000000000000..dd76743c7537 --- /dev/null +++ b/include/asm-powerpc/msgbuf.h | |||
@@ -0,0 +1,33 @@ | |||
1 | #ifndef _ASM_POWERPC_MSGBUF_H | ||
2 | #define _ASM_POWERPC_MSGBUF_H | ||
3 | |||
4 | /* | ||
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. | ||
8 | */ | ||
9 | |||
10 | struct msqid64_ds { | ||
11 | struct ipc64_perm msg_perm; | ||
12 | #ifndef __powerpc64__ | ||
13 | unsigned int __unused1; | ||
14 | #endif | ||
15 | __kernel_time_t msg_stime; /* last msgsnd time */ | ||
16 | #ifndef __powerpc64__ | ||
17 | unsigned int __unused2; | ||
18 | #endif | ||
19 | __kernel_time_t msg_rtime; /* last msgrcv time */ | ||
20 | #ifndef __powerpc64__ | ||
21 | unsigned int __unused3; | ||
22 | #endif | ||
23 | __kernel_time_t msg_ctime; /* last change time */ | ||
24 | unsigned long msg_cbytes; /* current number of bytes on queue */ | ||
25 | unsigned long msg_qnum; /* number of messages in queue */ | ||
26 | unsigned long msg_qbytes; /* max number of bytes on queue */ | ||
27 | __kernel_pid_t msg_lspid; /* pid of last msgsnd */ | ||
28 | __kernel_pid_t msg_lrpid; /* last receive pid */ | ||
29 | unsigned long __unused4; | ||
30 | unsigned long __unused5; | ||
31 | }; | ||
32 | |||
33 | #endif /* _ASM_POWERPC_MSGBUF_H */ | ||
diff --git a/include/asm-powerpc/param.h b/include/asm-powerpc/param.h new file mode 100644 index 000000000000..bdc724f70884 --- /dev/null +++ b/include/asm-powerpc/param.h | |||
@@ -0,0 +1,24 @@ | |||
1 | #ifndef _ASM_POWERPC_PARAM_H | ||
2 | #define _ASM_POWERPC_PARAM_H | ||
3 | |||
4 | #include <linux/config.h> | ||
5 | |||
6 | #ifdef __KERNEL__ | ||
7 | #define HZ CONFIG_HZ /* internal kernel timer frequency */ | ||
8 | #define USER_HZ 100 /* for user interfaces in "ticks" */ | ||
9 | #define CLOCKS_PER_SEC (USER_HZ) /* frequency at which times() counts */ | ||
10 | #endif /* __KERNEL__ */ | ||
11 | |||
12 | #ifndef HZ | ||
13 | #define HZ 100 | ||
14 | #endif | ||
15 | |||
16 | #define EXEC_PAGESIZE 4096 | ||
17 | |||
18 | #ifndef NOGROUP | ||
19 | #define NOGROUP (-1) | ||
20 | #endif | ||
21 | |||
22 | #define MAXHOSTNAMELEN 64 /* max length of hostname */ | ||
23 | |||
24 | #endif /* _ASM_POWERPC_PARAM_H */ | ||
diff --git a/include/asm-powerpc/setup.h b/include/asm-powerpc/setup.h new file mode 100644 index 000000000000..3d9740aae018 --- /dev/null +++ b/include/asm-powerpc/setup.h | |||
@@ -0,0 +1,9 @@ | |||
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 */ | ||
diff --git a/include/asm-powerpc/timex.h b/include/asm-powerpc/timex.h new file mode 100644 index 000000000000..51c5b316be55 --- /dev/null +++ b/include/asm-powerpc/timex.h | |||
@@ -0,0 +1,49 @@ | |||
1 | #ifndef _ASM_POWERPC_TIMEX_H | ||
2 | #define _ASM_POWERPC_TIMEX_H | ||
3 | |||
4 | #ifdef __KERNEL__ | ||
5 | |||
6 | /* | ||
7 | * PowerPC architecture timex specifications | ||
8 | */ | ||
9 | |||
10 | #include <linux/config.h> | ||
11 | #include <asm/cputable.h> | ||
12 | |||
13 | #define CLOCK_TICK_RATE 1193180 /* Underlying HZ */ | ||
14 | |||
15 | typedef unsigned long cycles_t; | ||
16 | |||
17 | static inline cycles_t get_cycles(void) | ||
18 | { | ||
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; | ||
32 | |||
33 | __asm__ __volatile__( | ||
34 | "98: mftb %0\n" | ||
35 | "99:\n" | ||
36 | ".section __ftr_fixup,\"a\"\n" | ||
37 | " .long %1\n" | ||
38 | " .long 0\n" | ||
39 | " .long 98b\n" | ||
40 | " .long 99b\n" | ||
41 | ".previous" | ||
42 | : "=r" (ret) : "i" (CPU_FTR_601)); | ||
43 | #endif | ||
44 | |||
45 | return ret; | ||
46 | } | ||
47 | |||
48 | #endif /* __KERNEL__ */ | ||
49 | #endif /* _ASM_POWERPC_TIMEX_H */ | ||
diff --git a/include/asm-powerpc/topology.h b/include/asm-powerpc/topology.h new file mode 100644 index 000000000000..2512e3836bf4 --- /dev/null +++ b/include/asm-powerpc/topology.h | |||
@@ -0,0 +1,70 @@ | |||
1 | #ifndef _ASM_POWERPC_TOPOLOGY_H | ||
2 | #define _ASM_POWERPC_TOPOLOGY_H | ||
3 | |||
4 | #include <linux/config.h> | ||
5 | |||
6 | #ifdef CONFIG_NUMA | ||
7 | |||
8 | #include <asm/mmzone.h> | ||
9 | |||
10 | static inline int cpu_to_node(int cpu) | ||
11 | { | ||
12 | int node; | ||
13 | |||
14 | node = numa_cpu_lookup_table[cpu]; | ||
15 | |||
16 | #ifdef DEBUG_NUMA | ||
17 | BUG_ON(node == -1); | ||
18 | #endif | ||
19 | |||
20 | return node; | ||
21 | } | ||
22 | |||
23 | #define parent_node(node) (node) | ||
24 | |||
25 | static inline cpumask_t node_to_cpumask(int node) | ||
26 | { | ||
27 | return numa_cpumask_lookup_table[node]; | ||
28 | } | ||
29 | |||
30 | static inline int node_to_first_cpu(int node) | ||
31 | { | ||
32 | cpumask_t tmp; | ||
33 | tmp = node_to_cpumask(node); | ||
34 | return first_cpu(tmp); | ||
35 | } | ||
36 | |||
37 | #define pcibus_to_node(node) (-1) | ||
38 | #define pcibus_to_cpumask(bus) (cpu_online_map) | ||
39 | |||
40 | #define nr_cpus_node(node) (nr_cpus_in_node[node]) | ||
41 | |||
42 | /* sched_domains SD_NODE_INIT for PPC64 machines */ | ||
43 | #define SD_NODE_INIT (struct sched_domain) { \ | ||
44 | .span = CPU_MASK_NONE, \ | ||
45 | .parent = NULL, \ | ||
46 | .groups = NULL, \ | ||
47 | .min_interval = 8, \ | ||
48 | .max_interval = 32, \ | ||
49 | .busy_factor = 32, \ | ||
50 | .imbalance_pct = 125, \ | ||
51 | .cache_hot_time = (10*1000000), \ | ||
52 | .cache_nice_tries = 1, \ | ||
53 | .per_cpu_gain = 100, \ | ||
54 | .flags = SD_LOAD_BALANCE \ | ||
55 | | SD_BALANCE_EXEC \ | ||
56 | | SD_BALANCE_NEWIDLE \ | ||
57 | | SD_WAKE_IDLE \ | ||
58 | | SD_WAKE_BALANCE, \ | ||
59 | .last_balance = jiffies, \ | ||
60 | .balance_interval = 1, \ | ||
61 | .nr_balance_failed = 0, \ | ||
62 | } | ||
63 | |||
64 | #else | ||
65 | |||
66 | #include <asm-generic/topology.h> | ||
67 | |||
68 | #endif /* CONFIG_NUMA */ | ||
69 | |||
70 | #endif /* _ASM_POWERPC_TOPOLOGY_H */ | ||
diff --git a/include/asm-powerpc/user.h b/include/asm-powerpc/user.h new file mode 100644 index 000000000000..e59ade4b3dfb --- /dev/null +++ b/include/asm-powerpc/user.h | |||
@@ -0,0 +1,55 @@ | |||
1 | #ifndef _ASM_POWERPC_USER_H | ||
2 | #define _ASM_POWERPC_USER_H | ||
3 | |||
4 | #ifdef __KERNEL__ | ||
5 | |||
6 | #include <asm/ptrace.h> | ||
7 | #include <asm/page.h> | ||
8 | |||
9 | /* | ||
10 | * Adapted from <asm-alpha/user.h> | ||
11 | * | ||
12 | * Core file format: The core file is written in such a way that gdb | ||
13 | * can understand it and provide useful information to the user (under | ||
14 | * linux we use the `trad-core' bfd, NOT the osf-core). The file contents | ||
15 | * are as follows: | ||
16 | * | ||
17 | * upage: 1 page consisting of a user struct that tells gdb | ||
18 | * what is present in the file. Directly after this is a | ||
19 | * copy of the task_struct, which is currently not used by gdb, | ||
20 | * but it may come in handy at some point. All of the registers | ||
21 | * are stored as part of the upage. The upage should always be | ||
22 | * only one page long. | ||
23 | * data: The data segment follows next. We use current->end_text to | ||
24 | * current->brk to pick up all of the user variables, plus any memory | ||
25 | * that may have been sbrk'ed. No attempt is made to determine if a | ||
26 | * page is demand-zero or if a page is totally unused, we just cover | ||
27 | * the entire range. All of the addresses are rounded in such a way | ||
28 | * that an integral number of pages is written. | ||
29 | * stack: We need the stack information in order to get a meaningful | ||
30 | * backtrace. We need to write the data from usp to | ||
31 | * current->start_stack, so we round each of these in order to be able | ||
32 | * to write an integer number of pages. | ||
33 | */ | ||
34 | struct user { | ||
35 | struct pt_regs regs; /* entire machine state */ | ||
36 | size_t u_tsize; /* text size (pages) */ | ||
37 | size_t u_dsize; /* data size (pages) */ | ||
38 | size_t u_ssize; /* stack size (pages) */ | ||
39 | unsigned long start_code; /* text starting address */ | ||
40 | unsigned long start_data; /* data starting address */ | ||
41 | unsigned long start_stack; /* stack starting address */ | ||
42 | long int signal; /* signal causing core dump */ | ||
43 | struct regs * u_ar0; /* help gdb find registers */ | ||
44 | unsigned long magic; /* identifies a core file */ | ||
45 | char u_comm[32]; /* user command name */ | ||
46 | }; | ||
47 | |||
48 | #define NBPG PAGE_SIZE | ||
49 | #define UPAGES 1 | ||
50 | #define HOST_TEXT_START_ADDR (u.start_code) | ||
51 | #define HOST_DATA_START_ADDR (u.start_data) | ||
52 | #define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG) | ||
53 | |||
54 | #endif /* __KERNEL__ */ | ||
55 | #endif /* _ASM_POWERPC_USER_H */ | ||