Commit 242954b5 authored by Ralf Baechle's avatar Ralf Baechle
Browse files

[MIPS] 16K & 64K page size fixes



Derived from Peter Watkins <treestem@gmail.com>'s work.

Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent 4b1c46a3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@
#define offset(string, ptr, member) \
	__asm__("\n@@@" string "%0" : : "i" (_offset(ptr, member)))
#define constant(string, member) \
	__asm__("\n@@@" string "%x0" : : "ri" (member))
	__asm__("\n@@@" string "%X0" : : "ri" (member))
#define size(string, size) \
	__asm__("\n@@@" string "%0" : : "i" (sizeof(size)))
#define linefeed text("")
+2 −1
Original line number Diff line number Diff line
@@ -189,7 +189,8 @@ NESTED(kernel_entry, 16, sp) # kernel entry point

	MTC0		zero, CP0_CONTEXT	# clear context register
	PTR_LA		$28, init_thread_union
	PTR_ADDIU	sp, $28, _THREAD_SIZE - 32
	PTR_LI		sp, _THREAD_SIZE - 32
	PTR_ADDU	sp, $28
	set_saved_sp	sp, t0, t1
	PTR_SUBU	sp, 4 * SZREG		# init stack pointer

+5 −0
Original line number Diff line number Diff line
@@ -85,7 +85,12 @@
	move	$28, a2
	cpu_restore_nonscratch a1

#if (_THREAD_SIZE - 32) < 0x10000
	PTR_ADDIU	t0, $28, _THREAD_SIZE - 32
#else
	PTR_LI		t0, _THREAD_SIZE - 32
	PTR_ADDU	t0, $28
#endif
	set_saved_sp	t0, t1, t2
#ifdef CONFIG_MIPS_MT_SMTC
	/* Read-modify-writes of Status must be atomic on a VPE */
+10 −0
Original line number Diff line number Diff line
@@ -50,6 +50,16 @@ SECTIONS
  /* writeable */
  .data : {			/* Data */
    . = . + DATAOFFSET;		/* for CONFIG_MAPPED_KERNEL */
    /*
     * This ALIGN is needed as a workaround for a bug a gcc bug upto 4.1 which
     * limits the maximum alignment to at most 32kB and results in the following
     * warning:
     *
     *  CC      arch/mips/kernel/init_task.o
     * arch/mips/kernel/init_task.c:30: warning: alignment of init_thread_union
     * is greater than maximum object file alignment.  Using 32768
     */
    . = ALIGN(_PAGE_SIZE);
    *(.data.init_task)

    *(.data)
+3 −3
Original line number Diff line number Diff line
@@ -149,7 +149,7 @@ void dump_list_process(struct task_struct *t, void *address)
	printk("Addr                 == %08lx\n", addr);
	printk("tasks->mm.pgd        == %08lx\n", (unsigned long) t->mm->pgd);

	page_dir = pgd_offset(t->mm, 0);
	page_dir = pgd_offset(t->mm, 0UL);
	printk("page_dir == %016lx\n", (unsigned long) page_dir);

	pgd = pgd_offset(t->mm, addr);
@@ -184,13 +184,13 @@ void dump_list_current(void *address)
	dump_list_process(current, address);
}

unsigned int vtop(void *address)
unsigned long vtop(void *address)
{
	pgd_t	*pgd;
	pud_t	*pud;
	pmd_t	*pmd;
	pte_t	*pte;
	unsigned int addr, paddr;
	unsigned long addr, paddr;

	addr = (unsigned long) address;
	pgd = pgd_offset(current->mm, addr);
Loading