Commit 637a6ff6 authored by Olof Johansson's avatar Olof Johansson Committed by Paul Mackerras

[PATCH] ppc64: Updated Olof misc updates 3/3

Replace some of the hard-coded constants with PAGE_SIZE/SHIFT/ORDER where
appropriate.

Likewise, in a couple of places it doesn't make sense to base some
allocations on page size when all that's required is a constant 4K,
etc.
Signed-off-by: default avatarOlof Johansson <olof@lixom.net>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent d0035c62
...@@ -1992,7 +1992,7 @@ _GLOBAL(smp_release_cpus) ...@@ -1992,7 +1992,7 @@ _GLOBAL(smp_release_cpus)
*/ */
.section ".bss" .section ".bss"
.align 12 .align PAGE_SHIFT
.globl empty_zero_page .globl empty_zero_page
empty_zero_page: empty_zero_page:
......
...@@ -329,7 +329,7 @@ _GLOBAL(__flush_dcache_icache) ...@@ -329,7 +329,7 @@ _GLOBAL(__flush_dcache_icache)
/* Flush the dcache */ /* Flush the dcache */
ld r7,PPC64_CACHES@toc(r2) ld r7,PPC64_CACHES@toc(r2)
clrrdi r3,r3,12 /* Page align */ clrrdi r3,r3,PAGE_SHIFT /* Page align */
lwz r4,DCACHEL1LINESPERPAGE(r7) /* Get # dcache lines per page */ lwz r4,DCACHEL1LINESPERPAGE(r7) /* Get # dcache lines per page */
lwz r5,DCACHEL1LINESIZE(r7) /* Get dcache line size */ lwz r5,DCACHEL1LINESIZE(r7) /* Get dcache line size */
mr r6,r3 mr r6,r3
......
#include <asm/page.h>
#include <asm-generic/vmlinux.lds.h> #include <asm-generic/vmlinux.lds.h>
OUTPUT_ARCH(powerpc:common64) OUTPUT_ARCH(powerpc:common64)
...@@ -17,7 +18,7 @@ SECTIONS ...@@ -17,7 +18,7 @@ SECTIONS
LOCK_TEXT LOCK_TEXT
KPROBES_TEXT KPROBES_TEXT
*(.fixup) *(.fixup)
. = ALIGN(4096); . = ALIGN(PAGE_SIZE);
_etext = .; _etext = .;
} }
...@@ -43,7 +44,7 @@ SECTIONS ...@@ -43,7 +44,7 @@ SECTIONS
/* will be freed after init */ /* will be freed after init */
. = ALIGN(4096); . = ALIGN(PAGE_SIZE);
__init_begin = .; __init_begin = .;
.init.text : { .init.text : {
...@@ -83,7 +84,7 @@ SECTIONS ...@@ -83,7 +84,7 @@ SECTIONS
SECURITY_INIT SECURITY_INIT
. = ALIGN(4096); . = ALIGN(PAGE_SIZE);
.init.ramfs : { .init.ramfs : {
__initramfs_start = .; __initramfs_start = .;
*(.init.ramfs) *(.init.ramfs)
...@@ -96,18 +97,21 @@ SECTIONS ...@@ -96,18 +97,21 @@ SECTIONS
__per_cpu_end = .; __per_cpu_end = .;
} }
. = ALIGN(PAGE_SIZE);
. = ALIGN(16384); . = ALIGN(16384);
__init_end = .; __init_end = .;
/* freed after init ends here */ /* freed after init ends here */
/* Read/write sections */ /* Read/write sections */
. = ALIGN(PAGE_SIZE);
. = ALIGN(16384); . = ALIGN(16384);
/* The initial task and kernel stack */ /* The initial task and kernel stack */
.data.init_task : { .data.init_task : {
*(.data.init_task) *(.data.init_task)
} }
. = ALIGN(PAGE_SIZE);
.data.page_aligned : { .data.page_aligned : {
*(.data.page_aligned) *(.data.page_aligned)
} }
...@@ -129,18 +133,18 @@ SECTIONS ...@@ -129,18 +133,18 @@ SECTIONS
__toc_start = .; __toc_start = .;
*(.got) *(.got)
*(.toc) *(.toc)
. = ALIGN(4096); . = ALIGN(PAGE_SIZE);
_edata = .; _edata = .;
} }
. = ALIGN(4096); . = ALIGN(PAGE_SIZE);
.bss : { .bss : {
__bss_start = .; __bss_start = .;
*(.bss) *(.bss)
__bss_stop = .; __bss_stop = .;
} }
. = ALIGN(4096); . = ALIGN(PAGE_SIZE);
_end = . ; _end = . ;
} }
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include <asm/ptrace.h> #include <asm/ptrace.h>
#include <asm/cputable.h> #include <asm/cputable.h>
#include <asm/auxvec.h> #include <asm/auxvec.h>
#include <asm/page.h>
/* PowerPC relocations defined by the ABIs */ /* PowerPC relocations defined by the ABIs */
#define R_PPC_NONE 0 #define R_PPC_NONE 0
...@@ -146,7 +147,7 @@ typedef elf_vrreg_t elf_vrregset_t32[ELF_NVRREG32]; ...@@ -146,7 +147,7 @@ typedef elf_vrreg_t elf_vrregset_t32[ELF_NVRREG32];
#define elf_check_arch(x) ((x)->e_machine == ELF_ARCH) #define elf_check_arch(x) ((x)->e_machine == ELF_ARCH)
#define USE_ELF_CORE_DUMP #define USE_ELF_CORE_DUMP
#define ELF_EXEC_PAGESIZE 4096 #define ELF_EXEC_PAGESIZE PAGE_SIZE
/* This is the location that an ET_DYN program is loaded if exec'ed. Typical /* This is the location that an ET_DYN program is loaded if exec'ed. Typical
use of this is to invoke "./ld.so someprog" to test out a new version of use of this is to invoke "./ld.so someprog" to test out a new version of
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
/* Location of cpu0's segment table */ /* Location of cpu0's segment table */
#define STAB0_PAGE 0x6 #define STAB0_PAGE 0x6
#define STAB0_PHYS_ADDR (STAB0_PAGE<<PAGE_SHIFT) #define STAB0_PHYS_ADDR (STAB0_PAGE<<12)
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
extern char initial_stab[]; extern char initial_stab[];
......
...@@ -54,9 +54,9 @@ struct thread_info { ...@@ -54,9 +54,9 @@ struct thread_info {
/* thread information allocation */ /* thread information allocation */
#define THREAD_ORDER 2 #define THREAD_SHIFT 14
#define THREAD_SIZE (PAGE_SIZE << THREAD_ORDER) #define THREAD_ORDER (THREAD_SHIFT - PAGE_SHIFT)
#define THREAD_SHIFT (PAGE_SHIFT + THREAD_ORDER) #define THREAD_SIZE (1 << THREAD_SHIFT)
#ifdef CONFIG_DEBUG_STACK_USAGE #ifdef CONFIG_DEBUG_STACK_USAGE
#define alloc_thread_info(tsk) \ #define alloc_thread_info(tsk) \
({ \ ({ \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment