X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-kernel.git;a=blobdiff_plain;f=include%2Fasm-m68knommu%2Fprocessor.h;h=91cba18acdd32a5f14c220aee136649e88262947;hp=278b00bc60c5131ff89171fb906d00dfccddda59;hb=708e16892e1646594a29eaa7ac7b209b600b9fd2;hpb=37224470c8c6d90a4062e76a08d4dc1fcf91fc89 diff --git a/include/asm-m68knommu/processor.h b/include/asm-m68knommu/processor.h index 278b00bc60c5..91cba18acdd3 100644 --- a/include/asm-m68knommu/processor.h +++ b/include/asm-m68knommu/processor.h @@ -1,5 +1,5 @@ /* - * include/asm-m68k/processor.h + * include/asm-m68knommu/processor.h * * Copyright (C) 1995 Hamish Macdonald */ @@ -13,6 +13,7 @@ */ #define current_text_addr() ({ __label__ _l; _l: &&_l;}) +#include #include #include #include @@ -77,20 +78,32 @@ struct thread_struct { {0, 0}, 0, {0,}, {0, 0, 0}, {0,}, \ } +/* + * Coldfire stacks need to be re-aligned on trap exit, conventional + * 68k can handle this case cleanly. + */ +#if defined(CONFIG_COLDFIRE) +#define reformat(_regs) do { (_regs)->format = 0x4; } while(0) +#else +#define reformat(_regs) do { } while (0) +#endif + /* * Do necessary setup to start up a newly executed thread. * * pass the data segment into user programs if it exists, * it can't hurt anything as far as I can tell */ -#define start_thread(_regs, _pc, _usp) \ -do { \ - set_fs(USER_DS); /* reads from user space */ \ - (_regs)->pc = (_pc); \ - if (current->mm) \ - (_regs)->d5 = current->mm->start_data; \ - (_regs)->sr &= ~0x2000; \ - wrusp(_usp); \ +#define start_thread(_regs, _pc, _usp) \ +do { \ + set_fs(USER_DS); /* reads from user space */ \ + (_regs)->pc = (_pc); \ + ((struct switch_stack *)(_regs))[-1].a6 = 0; \ + reformat(_regs); \ + if (current->mm) \ + (_regs)->d5 = current->mm->start_data; \ + (_regs)->sr &= ~0x2000; \ + wrusp(_usp); \ } while(0) /* Forward declaration, a strange C thing */ @@ -125,6 +138,6 @@ unsigned long get_wchan(struct task_struct *p); eip; }) #define KSTK_ESP(tsk) ((tsk) == current ? rdusp() : (tsk)->thread.usp) -#define cpu_relax() do { } while (0) +#define cpu_relax() barrier() #endif