diff options
| author | Paul Mackerras <paulus@tango.paulus.ozlabs.org> | 2002-02-12 20:26:28 +1100 |
|---|---|---|
| committer | Paul Mackerras <paulus@quango.(none)> | 2002-02-12 20:26:28 +1100 |
| commit | 429c7cd2f91a46a5368a7eb3ba294e29727aeda8 (patch) | |
| tree | 29b6fe01a8fbd67ab819ec8523bb3940dceddbae /include | |
| parent | 9b3882db851cf53923237d3291fe089c6aeb8cef (diff) | |
Update PPC for recent generic changes; in particular adapt to
having the thread_info struct at the base of the stack and
the task_struct elsewhere.
Diffstat (limited to 'include')
| -rw-r--r-- | include/asm-ppc/hardirq.h | 1 | ||||
| -rw-r--r-- | include/asm-ppc/pci.h | 10 | ||||
| -rw-r--r-- | include/asm-ppc/processor.h | 14 | ||||
| -rw-r--r-- | include/asm-ppc/scatterlist.h | 11 | ||||
| -rw-r--r-- | include/asm-ppc/smp.h | 2 | ||||
| -rw-r--r-- | include/asm-ppc/thread_info.h | 76 |
6 files changed, 86 insertions, 28 deletions
diff --git a/include/asm-ppc/hardirq.h b/include/asm-ppc/hardirq.h index 2c4aa69aafd4..dcedb5213cd6 100644 --- a/include/asm-ppc/hardirq.h +++ b/include/asm-ppc/hardirq.h @@ -44,6 +44,7 @@ typedef struct { #define hardirq_exit(cpu) (local_irq_count(cpu)--) #define synchronize_irq() do { } while (0) +#define release_irqlock(cpu) do { } while (0) #else /* CONFIG_SMP */ diff --git a/include/asm-ppc/pci.h b/include/asm-ppc/pci.h index 4a843c6be601..532776aa8687 100644 --- a/include/asm-ppc/pci.h +++ b/include/asm-ppc/pci.h @@ -171,15 +171,9 @@ static inline int pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg, * temporary 2.4 hack */ for (i = 0; i < nents; i++) { - if (sg[i].address && sg[i].page) + if (!sg[i].page) BUG(); - else if (!sg[i].address && !sg[i].page) - BUG(); - - if (sg[i].address) - sg[i].dma_address = virt_to_bus(sg[i].address); - else - sg[i].dma_address = page_to_bus(sg[i].page) + sg[i].offset; + sg[i].dma_address = page_to_bus(sg[i].page) + sg[i].offset; } return nents; diff --git a/include/asm-ppc/processor.h b/include/asm-ppc/processor.h index 843b81218ed4..0ed0a0070075 100644 --- a/include/asm-ppc/processor.h +++ b/include/asm-ppc/processor.h @@ -12,6 +12,7 @@ #define current_text_addr() ({ __label__ _l; _l: &&_l;}) #include <linux/config.h> +#include <linux/stringify.h> #include <asm/ptrace.h> #include <asm/types.h> @@ -558,7 +559,6 @@ #define _CHRP_Motorola 0x04 /* motorola chrp, the cobra */ #define _CHRP_IBM 0x05 /* IBM chrp, the longtrail and longtrail 2 */ -#define __stringify(a) #a #define _GLOBAL(n)\ .stabs __stringify(n:F-1),N_FUN,0,0,n;\ .globl n;\ @@ -743,22 +743,10 @@ static inline unsigned int __pack_fe01(unsigned int fpmode) return ((fpmode << 10) & MSR_FE0) | ((fpmode << 8) & MSR_FE1); } -/* - * NOTE! The task struct and the stack go together - */ -#define THREAD_SIZE (2*PAGE_SIZE) -#define alloc_task_struct() \ - ((struct task_struct *) __get_free_pages(GFP_KERNEL,1)) -#define free_task_struct(p) free_pages((unsigned long)(p),1) -#define get_task_struct(tsk) atomic_inc(&virt_to_page(tsk)->count) - /* in process.c - for early bootup debug -- Cort */ int ll_printk(const char *, ...); void ll_puts(const char *); -#define init_task (init_task_union.task) -#define init_stack (init_task_union.stack) - /* In misc.c */ void _nmask_and_or_msr(unsigned long nmask, unsigned long or_val); diff --git a/include/asm-ppc/scatterlist.h b/include/asm-ppc/scatterlist.h index 80be401b513f..5f34a504e038 100644 --- a/include/asm-ppc/scatterlist.h +++ b/include/asm-ppc/scatterlist.h @@ -1,5 +1,5 @@ /* - * BK Id: SCCS/s.scatterlist.h 1.9 10/15/01 22:51:33 paulus + * BK Id: %F% %I% %G% %U% %#% */ #ifdef __KERNEL__ #ifndef _PPC_SCATTERLIST_H @@ -8,11 +8,10 @@ #include <asm/dma.h> struct scatterlist { - struct page * page; - unsigned int offset; - - dma_addr_t dma_address; /* phys/bus dma address */ - unsigned int length; /* length */ + struct page *page; + unsigned int offset; + dma_addr_t dma_address; + unsigned int length; }; /* diff --git a/include/asm-ppc/smp.h b/include/asm-ppc/smp.h index 9de96607a428..7c93fdeafb26 100644 --- a/include/asm-ppc/smp.h +++ b/include/asm-ppc/smp.h @@ -48,7 +48,7 @@ extern void smp_local_timer_interrupt(struct pt_regs *); #define cpu_logical_map(cpu) (cpu) #define cpu_number_map(x) (x) -#define smp_processor_id() (current->cpu) +#define smp_processor_id() (current_thread_info()->cpu) extern int smp_hw_index[NR_CPUS]; #define hard_smp_processor_id() (smp_hw_index[smp_processor_id()]) diff --git a/include/asm-ppc/thread_info.h b/include/asm-ppc/thread_info.h new file mode 100644 index 000000000000..caeda7e3bbfb --- /dev/null +++ b/include/asm-ppc/thread_info.h @@ -0,0 +1,76 @@ +/* thread_info.h: PPC low-level thread information + * adapted from the i386 version by Paul Mackerras + * + * Copyright (C) 2002 David Howells (dhowells@redhat.com) + * - Incorporating suggestions made by Linus Torvalds and Dave Miller + */ + +#ifndef _ASM_THREAD_INFO_H +#define _ASM_THREAD_INFO_H + +#ifdef __KERNEL__ + +#ifndef __ASSEMBLY__ +#include <asm/processor.h> + +/* + * low level task data. + */ +struct thread_info { + struct task_struct *task; /* main task structure */ + struct exec_domain *exec_domain; /* execution domain */ + unsigned long flags; /* low level flags */ + int cpu; /* cpu we're on */ +}; + +/* + * macros/functions for gaining access to the thread information structure + */ +#define INIT_THREAD_INFO(tsk) \ +{ \ + task: &tsk, \ + exec_domain: &default_exec_domain, \ + flags: 0, \ + cpu: 0, \ +} + +#define init_thread_info (init_thread_union.thread_info) +#define init_stack (init_thread_union.stack) + +/* how to get the thread information struct from C */ +static inline struct thread_info *current_thread_info(void) +{ + struct thread_info *ti; + __asm__("rlwinm %0,1,0,0,18" : "=r"(ti)); + return ti; +} + +/* thread information allocation */ +#define alloc_thread_info() ((struct thread_info *) \ + __get_free_pages(GFP_KERNEL, 1)) +#define free_thread_info(ti) free_pages((unsigned long) (ti), 1) +#define get_thread_info(ti) get_task_struct((ti)->task) +#define put_thread_info(ti) put_task_struct((ti)->task) +#define THREAD_SIZE (2*PAGE_SIZE) +#endif /* __ASSEMBLY__ */ + +/* + * thread information flag bit numbers + */ +#define TIF_SYSCALL_TRACE 0 /* syscall trace active */ +#define TIF_NOTIFY_RESUME 1 /* resumption notification requested */ +#define TIF_SIGPENDING 2 /* signal pending */ +#define TIF_NEED_RESCHED 3 /* rescheduling necessary */ +#define TIF_POLLING_NRFLAG 4 /* true if poll_idle() is polling + TIF_NEED_RESCHED */ + +/* as above, but as bit values */ +#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) +#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME) +#define _TIF_SIGPENDING (1<<TIF_SIGPENDING) +#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED) +#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) + +#endif /* __KERNEL__ */ + +#endif /* _ASM_THREAD_INFO_H */ |
