diff options
Diffstat (limited to 'arch/m68k')
-rw-r--r-- | arch/m68k/amiga/amifb.c | 6 | ||||
-rw-r--r-- | arch/m68k/amiga/amikeyb.c | 14 | ||||
-rw-r--r-- | arch/m68k/amiga/amisound.c | 8 | ||||
-rw-r--r-- | arch/m68k/amiga/config.c | 1 | ||||
-rw-r--r-- | arch/m68k/atari/ataints.c | 43 | ||||
-rw-r--r-- | arch/m68k/atari/atakeyb.c | 71 | ||||
-rw-r--r-- | arch/m68k/console/fbcon.c | 4 | ||||
-rw-r--r-- | arch/m68k/fpsp040/skeleton.S | 77 | ||||
-rw-r--r-- | arch/m68k/kernel/console.c | 74 | ||||
-rw-r--r-- | arch/m68k/kernel/entry.S | 160 | ||||
-rw-r--r-- | arch/m68k/kernel/setup.c | 4 | ||||
-rw-r--r-- | arch/m68k/kernel/traps.c | 2 | ||||
-rw-r--r-- | arch/m68k/mm/init.c | 3 | ||||
-rw-r--r-- | arch/m68k/mm/memory.c | 90 |
14 files changed, 191 insertions, 366 deletions
diff --git a/arch/m68k/amiga/amifb.c b/arch/m68k/amiga/amifb.c index eb72970d7..15e424ea7 100644 --- a/arch/m68k/amiga/amifb.c +++ b/arch/m68k/amiga/amifb.c @@ -1307,6 +1307,7 @@ static void ami_rebuild_copper(void); */ extern unsigned short ami_intena_vals[]; +extern void amiga_init_sound(void); /* * Support for Graphics Boards @@ -1810,6 +1811,11 @@ __initfunc(struct fb_info *amiga_fb_init(long *mem_start)) u_long chipptr; /* + * Our beloved beeper + */ + amiga_init_sound(); + + /* * Check for a Graphics Board */ diff --git a/arch/m68k/amiga/amikeyb.c b/arch/m68k/amiga/amikeyb.c index 1058270dd..06fe55d29 100644 --- a/arch/m68k/amiga/amikeyb.c +++ b/arch/m68k/amiga/amikeyb.c @@ -23,18 +23,17 @@ #include <linux/random.h> #include <linux/kernel.h> #include <linux/init.h> +#include <linux/kbd_ll.h> #include <asm/amigaints.h> #include <asm/amigahw.h> #include <asm/irq.h> -extern void handle_scancode(unsigned char); - #define AMIKEY_CAPS (0x62) #define BREAK_MASK (0x80) #define RESET_WARNING (0xf0) /* before rotation */ -static u_short amiplain_map[NR_KEYS] = { +static u_short amiplain_map[NR_KEYS] __initdata = { 0xf060, 0xf031, 0xf032, 0xf033, 0xf034, 0xf035, 0xf036, 0xf037, 0xf038, 0xf039, 0xf030, 0xf02d, 0xf03d, 0xf05c, 0xf200, 0xf300, 0xfb71, 0xfb77, 0xfb65, 0xfb72, 0xfb74, 0xfb79, 0xfb75, 0xfb69, @@ -178,15 +177,13 @@ static unsigned char rep_scancode; static void amikeyb_rep(unsigned long ignore); static struct timer_list amikeyb_rep_timer = {NULL, NULL, 0, 0, amikeyb_rep}; -extern struct pt_regs *pt_regs; - static void amikeyb_rep(unsigned long ignore) { unsigned long flags; save_flags(flags); cli(); - pt_regs = NULL; + kbd_pt_regs = NULL; amikeyb_rep_timer.expires = jiffies + key_repeat_rate; amikeyb_rep_timer.prev = amikeyb_rep_timer.next = NULL; @@ -202,7 +199,7 @@ static void keyboard_interrupt(int irq, void *dummy, struct pt_regs *fp) static int reset_warning = 0; /* save frame for register dump */ - pt_regs = (struct pt_regs *)fp; + kbd_pt_regs = fp; /* get and invert scancode (keyboard is active low) */ scancode = ~ciaa.sdr; @@ -302,14 +299,13 @@ __initfunc(int amiga_keyb_init(void)) return -EIO; /* setup key map */ - key_maps[0] = amiplain_map; + memcpy(plain_map, amiplain_map, sizeof(plain_map)); key_maps[1] = amishift_map; key_maps[2] = amialtgr_map; key_maps[4] = amictrl_map; key_maps[5] = amishift_ctrl_map; key_maps[8] = amialt_map; key_maps[12] = amictrl_alt_map; - memcpy(plain_map, amiplain_map, sizeof(plain_map)); /* * Initialize serial data direction. diff --git a/arch/m68k/amiga/amisound.c b/arch/m68k/amiga/amisound.c index d5656d170..72d2091f5 100644 --- a/arch/m68k/amiga/amisound.c +++ b/arch/m68k/amiga/amisound.c @@ -40,7 +40,7 @@ u_short amiga_audio_period = MAX_PERIOD; static u_long clock_constant; -__initfunc(static void init_sound(void)) +__initfunc(void amiga_init_sound(void)) { snd_data = amiga_chip_alloc(sizeof(sine_data)); if (!snd_data) { @@ -58,14 +58,8 @@ static struct timer_list sound_timer = { NULL, NULL, 0, 0, nosound }; void amiga_mksound( unsigned int hz, unsigned int ticks ) { - static int inited = 0; unsigned long flags; - if (!inited) { - init_sound(); - inited = 1; - } - if (!snd_data) return; diff --git a/arch/m68k/amiga/config.c b/arch/m68k/amiga/config.c index 7b6bd208f..e36016306 100644 --- a/arch/m68k/amiga/config.c +++ b/arch/m68k/amiga/config.c @@ -78,6 +78,7 @@ static void amiga_wait_key(void); extern struct consw fb_con; extern struct fb_info *amiga_fb_init(long *); extern void zorro_init(void); +extern void amiga_init_sound(void); static void amiga_savekmsg_init(void); static void amiga_mem_console_write(const char *b, unsigned int count); static void amiga_serial_console_write(const char *s, unsigned int count); diff --git a/arch/m68k/atari/ataints.c b/arch/m68k/atari/ataints.c index b2887f7da..189095cfc 100644 --- a/arch/m68k/atari/ataints.c +++ b/arch/m68k/atari/ataints.c @@ -48,6 +48,7 @@ #include <asm/atariints.h> #include <asm/atari_stdma.h> #include <asm/irq.h> +#include <asm/entry.h> /* @@ -161,22 +162,6 @@ static int free_vme_vec_bitmap = 0; #define IRQ_NAME(nr) atari_slow_irq_##nr##_handler(void) -#define MFP_MK_BASE "0xfa13" - -/* This must agree with entry.S. */ -#define ORIG_DO "0x24" -#define FORMATVEC "0x32" -#define SR "0x2C" -#define SAVE_ALL \ - "clrl %%sp@-;" /* stk_adj */ \ - "pea -1:w;" /* orig d0 = -1 */ \ - "movel %%d0,%%sp@-;" /* d0 */ \ - "moveml %%d1-%%d5/%%a0-%%a2,%%sp@-" -#define GET_CURRENT(tmp) \ - "movel %%sp,"#tmp";" \ - "andw #-8192,"#tmp";" \ - "movel "#tmp",%%a2" - #define BUILD_SLOW_IRQ(n) \ asmlinkage void IRQ_NAME(n); \ /* Dummy function to allow asm with operands. */ \ @@ -184,29 +169,31 @@ void atari_slow_irq_##n##_dummy (void) { \ __asm__ (ALIGN_STR "\n" \ SYMBOL_NAME_STR(atari_slow_irq_) #n "_handler:\t" \ " addql #1,"SYMBOL_NAME_STR(local_irq_count)"\n" \ - SAVE_ALL "\n" \ + SAVE_ALL_INT "\n" \ GET_CURRENT(%%d0) "\n" \ -" andb #~(1<<(" #n "&7))," /* mask this interrupt */ \ - "("MFP_MK_BASE"+(((" #n "&8)^8)>>2)+((" #n "&16)<<3)):w\n" \ -" bfextu %%sp@("SR"){#5,#3},%%d0\n" /* get old IPL from stack frame */ \ +" andb #~(1<<(%c3&7)),%a4:w\n" /* mask this interrupt */ \ + /* get old IPL from stack frame */ \ +" bfextu %%sp@(%c2){#5,#3},%%d0\n" \ " movew %%sr,%%d1\n" \ " bfins %%d0,%%d1{#21,#3}\n" \ " movew %%d1,%%sr\n" /* set IPL = previous value */ \ " addql #1,%a0\n" \ -" lea "SYMBOL_NAME_STR(irq_handler)"+("#n"+8)*8,%%a0\n" \ +" lea %a1,%%a0\n" \ " pea %%sp@\n" /* push addr of frame */ \ " movel %%a0@(4),%%sp@-\n" /* push handler data */ \ -" pea (" #n "+8)\n" /* push int number */ \ +" pea (%c3+8)\n" /* push int number */ \ " movel %%a0@,%%a0\n" \ " jbsr %%a0@\n" /* call the handler */ \ " addql #8,%%sp\n" \ " addql #4,%%sp\n" \ " orw #0x0600,%%sr\n" \ " andw #0xfeff,%%sr\n" /* set IPL = 6 again */ \ -" orb #(1<<(" #n "&7))," /* now unmask the int again */ \ - "("MFP_MK_BASE"+(((" #n "&8)^8)>>2)+((" #n "&16)<<3)):w\n" \ +" orb #(1<<(%c3&7)),%a4:w\n" /* now unmask the int again */ \ " jbra "SYMBOL_NAME_STR(ret_from_interrupt)"\n" \ - : : "i" (&kstat.interrupts[n+8]) \ + : : "i" (&kstat.interrupts[n+8]), "i" (&irq_handler[n+8]), \ + "n" (PT_OFF_SR), "n" (n), \ + "i" (n & 8 ? (n & 16 ? &tt_mfp.int_mk_a : &mfp.int_mk_a) \ + : (n & 16 ? &tt_mfp.int_mk_b : &mfp.int_mk_b)) \ ); \ } @@ -288,10 +275,10 @@ SYMBOL_NAME_STR(atari_fast_irq_handler) ": orw #0x700,%%sr /* disable all interrupts */ "SYMBOL_NAME_STR(atari_prio_irq_handler) ":\t addql #1,"SYMBOL_NAME_STR(local_irq_count)"\n" - SAVE_ALL "\n" + SAVE_ALL_INT "\n" GET_CURRENT(%%d0) " /* get vector number from stack frame and convert to source */ - bfextu %%sp@(" FORMATVEC "){#4,#10},%%d0 + bfextu %%sp@(%c1){#4,#10},%%d0 subw #(0x40-8),%%d0 jpl 1f addw #(0x40-8-0x18),%%d0 @@ -307,7 +294,7 @@ SYMBOL_NAME_STR(atari_fast_irq_handler) ": addql #8,%%sp addql #4,%%sp jbra "SYMBOL_NAME_STR(ret_from_interrupt) - : : "i" (&kstat.interrupts) + : : "i" (&kstat.interrupts), "n" (PT_OFF_FORMATVEC) ); } diff --git a/arch/m68k/atari/atakeyb.c b/arch/m68k/atari/atakeyb.c index beccf9a84..d5d45be01 100644 --- a/arch/m68k/atari/atakeyb.c +++ b/arch/m68k/atari/atakeyb.c @@ -23,6 +23,7 @@ #include <linux/kd.h> #include <linux/random.h> #include <linux/init.h> +#include <linux/kbd_ll.h> #include <asm/atariints.h> #include <asm/atarihw.h> @@ -31,7 +32,6 @@ #include <asm/atari_joystick.h> #include <asm/irq.h> -extern void handle_scancode(unsigned char); extern int ovsc_switchmode; extern unsigned char mach_keyboard_type; static void atakeyb_rep( unsigned long ignore ); @@ -99,7 +99,7 @@ static unsigned long broken_keys[128/(sizeof(unsigned long)*8)] = { 0, }; * - Keypad Left/Right Parenthesis mapped to new K_PPAREN[LR] */ -static u_short ataplain_map[NR_KEYS] = { +static u_short ataplain_map[NR_KEYS] __initdata = { 0xf200, 0xf01b, 0xf031, 0xf032, 0xf033, 0xf034, 0xf035, 0xf036, 0xf037, 0xf038, 0xf039, 0xf030, 0xf02d, 0xf03d, 0xf008, 0xf009, 0xfb71, 0xfb77, 0xfb65, 0xfb72, 0xfb74, 0xfb79, 0xfb75, 0xfb69, @@ -139,7 +139,7 @@ static u_short atashift_map[NR_KEYS] = { static u_short atactrl_map[NR_KEYS] = { 0xf200, 0xf200, 0xf200, 0xf000, 0xf01b, 0xf01c, 0xf01d, 0xf01e, - 0xf01f, 0xf07f, 0xf200, 0xf200, 0xf07f, 0xf200, 0xf008, 0xf200, + 0xf01f, 0xf07f, 0xf200, 0xf200, 0xf01f, 0xf200, 0xf008, 0xf200, 0xf011, 0xf017, 0xf005, 0xf012, 0xf014, 0xf019, 0xf015, 0xf009, 0xf00f, 0xf010, 0xf01b, 0xf01d, 0xf201, 0xf702, 0xf001, 0xf013, 0xf004, 0xf006, 0xf007, 0xf008, 0xf00a, 0xf00b, 0xf00c, 0xf200, @@ -158,18 +158,18 @@ static u_short atactrl_map[NR_KEYS] = { static u_short atashift_ctrl_map[NR_KEYS] = { 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf008, 0xf200, - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, - 0xf200, 0xf200, 0xf200, 0xf200, 0xf201, 0xf702, 0xf200, 0xf200, - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, - 0xf200, 0xf200, 0xf700, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf700, 0xf200, - 0xf703, 0xf200, 0xf207, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf117, + 0xf200, 0xf200, 0xf200, 0xf200, 0xf01f, 0xf200, 0xf008, 0xf200, + 0xf011, 0xf017, 0xf005, 0xf012, 0xf014, 0xf019, 0xf015, 0xf009, + 0xf00f, 0xf010, 0xf200, 0xf200, 0xf201, 0xf702, 0xf001, 0xf013, + 0xf004, 0xf006, 0xf007, 0xf008, 0xf00a, 0xf00b, 0xf00c, 0xf200, + 0xf200, 0xf200, 0xf700, 0xf200, 0xf01a, 0xf018, 0xf003, 0xf016, + 0xf002, 0xf00e, 0xf00d, 0xf200, 0xf200, 0xf07f, 0xf700, 0xf200, + 0xf703, 0xf200, 0xf207, 0xf100, 0xf101, 0xf102, 0xf103, 0xf104, + 0xf105, 0xf106, 0xf107, 0xf108, 0xf109, 0xf200, 0xf200, 0xf117, 0xf603, 0xf200, 0xf30b, 0xf601, 0xf200, 0xf602, 0xf30a, 0xf200, - 0xf600, 0xf200, 0xf115, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, + 0xf600, 0xf200, 0xf115, 0xf07f, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, - 0xf200, 0xf200, 0xf200, 0xf312, 0xf313, 0xf30d, 0xf30c, 0xf307, + 0xf200, 0xf1ff, 0xf11b, 0xf312, 0xf313, 0xf30d, 0xf30c, 0xf307, 0xf308, 0xf309, 0xf304, 0xf305, 0xf306, 0xf301, 0xf302, 0xf303, 0xf300, 0xf310, 0xf30e, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200 @@ -207,7 +207,7 @@ static u_short atashift_alt_map[NR_KEYS] = { 0xf118, 0xf200, 0xf30b, 0xf601, 0xf200, 0xf602, 0xf30a, 0xf200, 0xf119, 0xf200, 0xf115, 0xf87f, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, - 0xf200, 0xf200, 0xf200, 0xf312, 0xf313, 0xf30d, 0xf30c, 0xf307, + 0xf200, 0xf1ff, 0xf11b, 0xf312, 0xf313, 0xf30d, 0xf30c, 0xf307, 0xf308, 0xf309, 0xf304, 0xf305, 0xf306, 0xf301, 0xf302, 0xf303, 0xf300, 0xf310, 0xf30e, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200 @@ -215,7 +215,7 @@ static u_short atashift_alt_map[NR_KEYS] = { static u_short atactrl_alt_map[NR_KEYS] = { 0xf200, 0xf200, 0xf200, 0xf800, 0xf81b, 0xf81c, 0xf81d, 0xf81e, - 0xf81f, 0xf87f, 0xf200, 0xf200, 0xf87f, 0xf200, 0xf808, 0xf200, + 0xf81f, 0xf87f, 0xf200, 0xf200, 0xf81f, 0xf200, 0xf808, 0xf200, 0xf811, 0xf817, 0xf805, 0xf812, 0xf814, 0xf819, 0xf815, 0xf809, 0xf80f, 0xf810, 0xf81b, 0xf81d, 0xf201, 0xf702, 0xf801, 0xf813, 0xf804, 0xf806, 0xf807, 0xf808, 0xf80a, 0xf80b, 0xf80c, 0xf200, @@ -224,7 +224,7 @@ static u_short atactrl_alt_map[NR_KEYS] = { 0xf703, 0xf800, 0xf207, 0xf100, 0xf101, 0xf102, 0xf103, 0xf104, 0xf105, 0xf106, 0xf107, 0xf108, 0xf109, 0xf200, 0xf200, 0xf114, 0xf603, 0xf200, 0xf30b, 0xf601, 0xf200, 0xf602, 0xf30a, 0xf200, - 0xf600, 0xf200, 0xf115, 0xf07f, 0xf200, 0xf200, 0xf200, 0xf200, + 0xf600, 0xf200, 0xf115, 0xf87f, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf1ff, 0xf202, 0xf312, 0xf313, 0xf30d, 0xf30c, 0xf307, 0xf308, 0xf309, 0xf304, 0xf305, 0xf306, 0xf301, 0xf302, 0xf303, @@ -234,18 +234,18 @@ static u_short atactrl_alt_map[NR_KEYS] = { static u_short atashift_ctrl_alt_map[NR_KEYS] = { 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf808, 0xf200, - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, - 0xf200, 0xf200, 0xf200, 0xf200, 0xf201, 0xf702, 0xf200, 0xf200, - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, - 0xf200, 0xf200, 0xf700, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf700, 0xf200, - 0xf703, 0xf200, 0xf207, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, - 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf117, + 0xf200, 0xf200, 0xf200, 0xf200, 0xf81f, 0xf200, 0xf808, 0xf200, + 0xf811, 0xf817, 0xf805, 0xf812, 0xf814, 0xf819, 0xf815, 0xf809, + 0xf80f, 0xf810, 0xf200, 0xf200, 0xf201, 0xf702, 0xf801, 0xf813, + 0xf804, 0xf806, 0xf807, 0xf808, 0xf80a, 0xf80b, 0xf80c, 0xf200, + 0xf200, 0xf200, 0xf700, 0xf200, 0xf81a, 0xf818, 0xf803, 0xf816, + 0xf802, 0xf80e, 0xf80d, 0xf200, 0xf200, 0xf87f, 0xf700, 0xf200, + 0xf703, 0xf200, 0xf207, 0xf100, 0xf101, 0xf102, 0xf103, 0xf104, + 0xf105, 0xf106, 0xf107, 0xf108, 0xf109, 0xf200, 0xf200, 0xf117, 0xf603, 0xf200, 0xf30b, 0xf601, 0xf200, 0xf602, 0xf30a, 0xf200, - 0xf600, 0xf200, 0xf115, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, + 0xf600, 0xf200, 0xf115, 0xf87f, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, - 0xf200, 0xf200, 0xf200, 0xf312, 0xf313, 0xf30d, 0xf30c, 0xf307, + 0xf200, 0xf1ff, 0xf11b, 0xf312, 0xf313, 0xf30d, 0xf30c, 0xf307, 0xf308, 0xf309, 0xf304, 0xf305, 0xf306, 0xf301, 0xf302, 0xf303, 0xf300, 0xf310, 0xf30e, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200 @@ -277,12 +277,10 @@ static unsigned int key_repeat_rate = DEFAULT_KEYB_REP_RATE; static unsigned char rep_scancode; static struct timer_list atakeyb_rep_timer = { NULL, NULL, 0, 0, atakeyb_rep }; -extern struct pt_regs *pt_regs; - static void atakeyb_rep( unsigned long ignore ) { - pt_regs = NULL; + kbd_pt_regs = NULL; /* Disable keyboard for the time we call handle_scancode(), else a race * in the keyboard tty queue may happen */ @@ -327,7 +325,7 @@ static void keyboard_interrupt(int irq, void *dummy, struct pt_regs *fp) int break_flag; /* save frame for register dump */ - pt_regs = (struct pt_regs *)fp; + kbd_pt_regs = fp; repeat: if (acia.mid_ctrl & ACIA_IRQ) @@ -420,14 +418,14 @@ static void keyboard_interrupt(int irq, void *dummy, struct pt_regs *fp) * make codes instead. Therefore, simply ignore * break_flag... * */ - int keyval = ataplain_map[scancode], keytyp; - + int keyval = plain_map[scancode], keytyp; + set_bit( scancode, broken_keys ); self_test_last_rcv = jiffies; - keyval = ataplain_map[scancode]; + keyval = plain_map[scancode]; keytyp = KTYP(keyval) - 0xf0; keyval = KVAL(keyval); - + printk( KERN_WARNING "Key with scancode %d ", scancode ); if (keytyp == KT_LATIN || keytyp == KT_LETTER) { if (keyval < ' ') @@ -440,7 +438,7 @@ static void keyboard_interrupt(int irq, void *dummy, struct pt_regs *fp) } else if (test_bit( scancode, broken_keys )) break; - + if (break_flag) { del_timer( &atakeyb_rep_timer ); rep_scancode = 0; @@ -808,7 +806,7 @@ void atari_kbd_leds (unsigned int leds) __initfunc(int atari_keyb_init(void)) { /* setup key map */ - key_maps[0] = ataplain_map; + memcpy (plain_map, ataplain_map, sizeof(plain_map)); key_maps[1] = atashift_map; key_maps[2] = 0; /* ataaltgr_map */ key_maps[4] = atactrl_map; @@ -817,7 +815,6 @@ __initfunc(int atari_keyb_init(void)) key_maps[9] = atashift_alt_map; key_maps[12] = atactrl_alt_map; key_maps[13] = atashift_ctrl_alt_map; - memcpy (plain_map, ataplain_map, sizeof(plain_map)); keymap_count = 8; /* say that we don't have an AltGr key */ diff --git a/arch/m68k/console/fbcon.c b/arch/m68k/console/fbcon.c index 376249c90..62457c0cb 100644 --- a/arch/m68k/console/fbcon.c +++ b/arch/m68k/console/fbcon.c @@ -69,8 +69,8 @@ #include <asm/system.h> #include <asm/uaccess.h> -#include "../../../drivers/char/vt_kern.h" /* vt_cons and vc_resize_con() */ -#include "../../../drivers/char/console_struct.h" +#include <linux/vt_kern.h> +#include <linux/console_struct.h> /* Import console_blanked from console.c */ diff --git a/arch/m68k/fpsp040/skeleton.S b/arch/m68k/fpsp040/skeleton.S index 466cf3fbc..719bcc9ce 100644 --- a/arch/m68k/fpsp040/skeleton.S +++ b/arch/m68k/fpsp040/skeleton.S @@ -39,6 +39,7 @@ | #include <linux/linkage.h> +#include <asm/entry.h> |SKELETON idnt 2,1 | Motorola 040 Floating Point Software Package @@ -51,24 +52,6 @@ .include "fpsp.h" -/* - * This has to match entry.S - */ -LOFF_ORIG_D0 = 0x24 - -#define curptr a2 - -#define SAVE_ALL \ - clrl %sp@-; /* stk_adj */ \ - movel %d0,%sp@-; /* orig d0 */ \ - movel %d0,%sp@-; /* d0 */ \ - moveml %d1-%d5/%a0-%a1/%curptr,%sp@-; - -#define GET_CURRENT(tmp) \ - movel %sp,tmp; \ - andw &-8192,tmp; \ - movel tmp,%curptr; - |xref b1238_fix | @@ -86,11 +69,7 @@ real_dz: frestore (%sp)+ unlk %a6 - SAVE_ALL - moveq #-1,%d0 - movel %d0,%sp@(LOFF_ORIG_D0) | a -1 in the ORIG_D0 field - | signifies that the stack frame - | is NOT for syscall + SAVE_ALL_INT GET_CURRENT(%d0) movel %sp,%sp@- | stack frame pointer argument bsrl SYMBOL_NAME(trap_c) @@ -181,11 +160,7 @@ inex_done: frestore (%sp)+ unlk %a6 - SAVE_ALL - moveq #-1,%d0 - movel %d0,%sp@(LOFF_ORIG_D0) | a -1 in the ORIG_D0 field - | signifies that the stack frame - | is NOT for syscall + SAVE_ALL_INT GET_CURRENT(%d0) movel %sp,%sp@- | stack frame pointer argument bsrl SYMBOL_NAME(trap_c) @@ -211,11 +186,7 @@ ovfl_done: frestore (%sp)+ unlk %a6 - SAVE_ALL - moveq #-1,%d0 - movel %d0,%sp@(LOFF_ORIG_D0) | a -1 in the ORIG_D0 field - | signifies that the stack frame - | is NOT for syscall + SAVE_ALL_INT GET_CURRENT(%d0) movel %sp,%sp@- | stack frame pointer argument bsrl SYMBOL_NAME(trap_c) @@ -241,11 +212,7 @@ unfl_done: frestore (%sp)+ unlk %a6 - SAVE_ALL - moveq #-1,%d0 - movel %d0,%sp@(LOFF_ORIG_D0) | a -1 in the ORIG_D0 field - | signifies that the stack frame - | is NOT for syscall + SAVE_ALL_INT GET_CURRENT(%d0) movel %sp,%sp@- | stack frame pointer argument bsrl SYMBOL_NAME(trap_c) @@ -267,11 +234,7 @@ real_snan: frestore (%sp)+ unlk %a6 - SAVE_ALL - moveq #-1,%d0 - movel %d0,%sp@(LOFF_ORIG_D0) | a -1 in the ORIG_D0 field - | signifies that the stack frame - | is NOT for syscall + SAVE_ALL_INT GET_CURRENT(%d0) movel %sp,%sp@- | stack frame pointer argument bsrl SYMBOL_NAME(trap_c) @@ -293,11 +256,7 @@ real_operr: frestore (%sp)+ unlk %a6 - SAVE_ALL - moveq #-1,%d0 - movel %d0,%sp@(LOFF_ORIG_D0) | a -1 in the ORIG_D0 field - | signifies that the stack frame - | is NOT for syscall + SAVE_ALL_INT GET_CURRENT(%d0) movel %sp,%sp@- | stack frame pointer argument bsrl SYMBOL_NAME(trap_c) @@ -325,11 +284,7 @@ real_bsun: frestore (%sp)+ unlk %a6 - SAVE_ALL - moveq #-1,%d0 - movel %d0,%sp@(LOFF_ORIG_D0) | a -1 in the ORIG_D0 field - | signifies that the stack frame - | is NOT for syscall + SAVE_ALL_INT GET_CURRENT(%d0) movel %sp,%sp@- | stack frame pointer argument bsrl SYMBOL_NAME(trap_c) @@ -350,11 +305,7 @@ fline: jmp fpsp_fline real_fline: - SAVE_ALL - moveq #-1,%d0 - movel %d0,%sp@(LOFF_ORIG_D0) | a -1 in the ORIG_D0 field - | signifies that the stack frame - | is NOT for syscall + SAVE_ALL_INT GET_CURRENT(%d0) movel %sp,%sp@- | stack frame pointer argument bsrl SYMBOL_NAME(trap_c) @@ -376,11 +327,7 @@ real_unsupp: frestore (%sp)+ unlk %a6 - SAVE_ALL - moveq #-1,%d0 - movel %d0,%sp@(LOFF_ORIG_D0) | a -1 in the ORIG_D0 field - | signifies that the stack frame - | is NOT for syscall + SAVE_ALL_INT GET_CURRENT(%d0) movel %sp,%sp@- | stack frame pointer argument bsrl SYMBOL_NAME(trap_c) @@ -435,9 +382,7 @@ Lnotkern: bne Lmustsched rte Lmustsched: - SAVE_ALL - moveq #-1,%d0 - movel %d0,%sp@(LOFF_ORIG_D0) | indicate stack frame not for syscall + SAVE_ALL_INT GET_CURRENT(%d0) bral SYMBOL_NAME(ret_from_exception) | deliver signals, reschedule etc.. diff --git a/arch/m68k/kernel/console.c b/arch/m68k/kernel/console.c index 468ae0b59..31608e904 100644 --- a/arch/m68k/kernel/console.c +++ b/arch/m68k/kernel/console.c @@ -109,7 +109,6 @@ #include <linux/interrupt.h> #include <linux/tty.h> #include <linux/tty_flip.h> -#include <linux/console.h> #include <linux/kernel.h> #include <linux/string.h> #include <linux/errno.h> @@ -119,17 +118,18 @@ #include <linux/major.h> #include <linux/mm.h> #include <linux/ioport.h> +#include <linux/init.h> #include <asm/io.h> #include <asm/uaccess.h> #include <asm/system.h> #include <asm/bitops.h> -#include "../../../drivers/char/kbd_kern.h" -#include "../../../drivers/char/vt_kern.h" -#include "../../../drivers/char/consolemap.h" -#include "../../../drivers/char/selection.h" -#include "../../../drivers/char/console_struct.h" +#include <linux/kbd_kern.h> +#include <linux/vt_kern.h> +#include <linux/consolemap.h> +#include <linux/selection.h> +#include <linux/console_struct.h> #ifndef MIN @@ -159,6 +159,8 @@ static void set_vesa_blanking(unsigned long arg); extern void vesa_blank(void); extern void vesa_unblank(void); extern void compute_shiftstate(void); +extern void reset_palette(int currcons); +extern void set_palette(void); void poke_blanked_console(void); void do_blank_screen(int); @@ -257,6 +259,7 @@ struct consw *conswitchp; #define ulcolor (vc_cons[currcons].d->vc_ulcolor) #define halfcolor (vc_cons[currcons].d->vc_halfcolor) #define tab_stop (vc_cons[currcons].d->vc_tab_stop) +#define palette (vc_cons[currcons].d->vc_palette) #define bell_pitch (vc_cons[currcons].d->vc_bell_pitch) #define bell_duration (vc_cons[currcons].d->vc_bell_duration) #define sw (vc_cons[currcons].d->vc_sw) @@ -539,6 +542,14 @@ void vc_disallocate(unsigned int currcons) static unsigned char color_table[] = { 0, 4, 2, 6, 1, 5, 3, 7, 8,12,10,14, 9,13,11,15 }; +/* the default colour table, for VGA+ colour systems */ +int default_red[] = {0x00,0xaa,0x00,0xaa,0x00,0xaa,0x00,0xaa, + 0x55,0xff,0x55,0xff,0x55,0xff,0x55,0xff}; +int default_grn[] = {0x00,0x00,0xaa,0x55,0x00,0x00,0xaa,0xaa, + 0x55,0x55,0xff,0xff,0x55,0x55,0xff,0xff}; +int default_blu[] = {0x00,0x00,0x00,0x00,0xaa,0xaa,0xaa,0xaa, + 0x55,0x55,0x55,0x55,0xff,0xff,0xff,0xff}; + /* * gotoxy() must verify all boundaries, because the arguments * might also be negative. If the given position is out of @@ -1655,7 +1666,7 @@ static int do_con_write(struct tty_struct * tty, int from_user, if (nextx == cols) { sw->con_putc(vc_cons[currcons].d, *putcs_buf, y, x); - ((unsigned short *)pos)--; + pos--; need_wrap = decawm; continue; } @@ -1837,9 +1848,7 @@ static int do_con_write(struct tty_struct * tty, int from_user, vc_state = ESpalette; continue; } else if (c=='R') { /* reset palette */ -#if 0 reset_palette (currcons); -#endif vc_state = ESnormal; } else vc_state = ESnormal; @@ -1848,7 +1857,6 @@ static int do_con_write(struct tty_struct * tty, int from_user, if ( (c>='0'&&c<='9') || (c>='A'&&c<='F') || (c>='a'&&c<='f') ) { par[npar++] = (c>'9' ? (c&0xDF)-'A'+10 : c-'0') ; if (npar==7) { -#if 0 int i = par[0]*3, j = 1; palette[i] = 16*par[j++]; palette[i++] += par[j++]; @@ -1857,7 +1865,6 @@ static int do_con_write(struct tty_struct * tty, int from_user, palette[i] = 16*par[j++]; palette[i] += par[j]; set_palette() ; -#endif vc_state = ESnormal; } } else @@ -2283,7 +2290,7 @@ static void console_bh(void) * Reads the information preserved by setup.s to determine the current display * type and sets everything accordingly. */ -unsigned long con_init(unsigned long kmem_start) +__initfunc(unsigned long con_init(unsigned long kmem_start)) { const char *display_desc = "????"; unsigned int currcons = 0; @@ -2617,22 +2624,61 @@ static int set_get_font(char * arg, int set, int ch512) * map, 3 bytes per colour, 16 colours, range from 0 to 255. */ +static int set_get_cmap(unsigned char *arg, int set) +{ + int i, j, k; + + for (i = 0; i < 16; i++) + if (set) { + get_user(default_red[i], arg++); + get_user(default_grn[i], arg++); + get_user(default_blu[i], arg++); + } else { + put_user(default_red[i], arg++); + put_user(default_grn[i], arg++); + put_user(default_blu[i], arg++); + } + if (set) { + for (i = 0; i < MAX_NR_CONSOLES; i++) + if (vc_cons_allocated(i)) + for (j = k = 0; j < 16; j++) { + vc_cons[i].d->vc_palette[k++] = + default_red[j]; + vc_cons[i].d->vc_palette[k++] = + default_grn[j]; + vc_cons[i].d->vc_palette[k++] = + default_blu[j]; + } + set_palette(); + } + return 0; +} + int con_set_cmap (unsigned char *arg) { - return -EINVAL; + return set_get_cmap (arg, 1); } int con_get_cmap (unsigned char *arg) { - return -EINVAL; + return set_get_cmap (arg, 0); } void reset_palette(int currcons) { + int j, k; + for (j = k = 0; j < 16; j++) { + palette[k++] = default_red[j]; + palette[k++] = default_grn[j]; + palette[k++] = default_blu[j]; + } + set_palette() ; } void set_palette(void) { + if (vt_cons[fg_console]->vc_mode != KD_GRAPHICS) + conswitchp->con_set_palette(vc_cons[fg_console].d, color_table); } /* diff --git a/arch/m68k/kernel/entry.S b/arch/m68k/kernel/entry.S index ef5ef46d6..33542ca96 100644 --- a/arch/m68k/kernel/entry.S +++ b/arch/m68k/kernel/entry.S @@ -22,24 +22,6 @@ * NOTE: This code handles signal-recognition, which happens every time * after a timer-interrupt and after each system call. * - * Stack layout in 'ret_from_exception': - * - * This allows access to the syscall arguments in registers d1-d5 - * - * 0(sp) - d1 - * 4(sp) - d2 - * 8(sp) - d3 - * C(sp) - d4 - * 10(sp) - d5 - * 14(sp) - a0 - * 18(sp) - a1 - * 1C(sp) - a2 - * 20(sp) - d0 - * 24(sp) - orig_d0 - * 28(sp) - stack adjustment - * 2C(sp) - sr - * 2E(sp) - pc - * 32(sp) - format & vector */ /* @@ -48,94 +30,12 @@ * number 0 in the 'current_set' list. */ -/* - * 97/05/14 Andreas: Register %a2 is now set to the current task throughout - * the whole kernel. - */ - #include <linux/sys.h> #include <linux/config.h> #include <linux/linkage.h> +#include <asm/entry.h> #include <asm/setup.h> #include <asm/segment.h> -#ifdef CONFIG_KGDB -#include <asm/kgdb.h> -.globl SYMBOL_NAME(kgdb_registers) -#endif - -#define curptr a2 - -LENOSYS = 38 - -/* - * these are offsets into the task-struct - */ -LTASK_STATE = 0 -LTASK_COUNTER = 4 -LTASK_PRIORITY = 8 -LTASK_SIGNAL = 12 -LTASK_BLOCKED = 16 -LTASK_FLAGS = 20 - -/* the following macro is used when enabling interrupts */ -#if defined(MACH_ATARI_ONLY) - /* block out HSYNC on the atari */ -#define ALLOWINT 0xfbff -#define MAX_NOINT_IPL 3 -#else - /* portable version */ -#define ALLOWINT 0xf8ff -#define MAX_NOINT_IPL 0 -#endif /* machine compilation types */ - -LD0 = 0x20 -LORIG_D0 = 0x24 -LSR = 0x2C -LFORMATVEC = 0x32 - -/* - * This defines the normal kernel pt-regs layout. - * - * regs a3-a6 and d6-d7 are preserved by C code - * the kernel doesn't mess with usp unless it needs to - */ -#ifndef CONFIG_KGDB -#define SAVE_ALL \ - clrl %sp@-; /* stk_adj */ \ - movel %d0,%sp@-; /* orig d0 */ \ - movel %d0,%sp@-; /* d0 */ \ - moveml %d1-%d5/%a0-%a1/%curptr,%sp@-; -#else -/* Need to save the "missing" registers for kgdb... - */ -#define SAVE_ALL \ - clrl %sp@-; /* stk_adj */ \ - movel %d0,%sp@-; /* orig d0 */ \ - movel %d0,%sp@-; /* d0 */ \ - moveml %d1-%d5/%a0-%a1/%curptr,%sp@-; \ - moveml %d6-%d7,SYMBOL_NAME(kgdb_registers)+GDBOFFA_D6; \ - moveml %a3-%a6,SYMBOL_NAME(kgdb_registers)+GDBOFFA_A3; -#endif - -#define RESTORE_ALL \ - moveml %sp@+,%a0-%a1/%curptr/%d1-%d5; \ - movel %sp@+,%d0; \ - addql #4,%sp; /* orig d0 */ \ - addl %sp@+,%sp; /* stk adj */ \ - rte - -#define SWITCH_STACK_SIZE (6*4+4) /* includes return address */ - -#define SAVE_SWITCH_STACK \ - moveml %a3-%a6/%d6-%d7,%sp@- - -#define RESTORE_SWITCH_STACK \ - moveml %sp@+,%a3-%a6/%d6-%d7 - -#define GET_CURRENT(tmp) \ - movel %sp,tmp; \ - andw &-8192,tmp; \ - movel tmp,%curptr; .globl SYMBOL_NAME(system_call), SYMBOL_NAME(buserr), SYMBOL_NAME(trap) .globl SYMBOL_NAME(resume), SYMBOL_NAME(ret_from_exception) @@ -146,12 +46,7 @@ LFORMATVEC = 0x32 .text ENTRY(buserr) - SAVE_ALL - moveq #-1,%d0 - movel %d0,%sp@(LORIG_D0) | a -1 in the ORIG_D0 field - | signifies that the stack frame - | is NOT for syscall - + SAVE_ALL_INT GET_CURRENT(%d0) movel %sp,%sp@- | stack frame pointer argument bsrl SYMBOL_NAME(buserr_c) @@ -159,11 +54,7 @@ ENTRY(buserr) jra SYMBOL_NAME(ret_from_exception) ENTRY(trap) - SAVE_ALL - moveq #-1,%d0 - movel %d0,%sp@(LORIG_D0) | a -1 in the ORIG_D0 field - | signifies that the stack frame - | is NOT for syscall + SAVE_ALL_INT GET_CURRENT(%d0) movel %sp,%sp@- | stack frame pointer argument bsrl SYMBOL_NAME(trap_c) @@ -180,18 +71,18 @@ ENTRY(reschedule) jmp SYMBOL_NAME(schedule) badsys: - movel #-LENOSYS,LD0(%sp) + movel #-LENOSYS,LPT_OFF_D0(%sp) jra SYMBOL_NAME(ret_from_exception) do_trace: - movel #-LENOSYS,LD0(%sp) | needed for strace + movel #-LENOSYS,LPT_OFF_D0(%sp) | needed for strace subql #4,%sp SAVE_SWITCH_STACK jbsr SYMBOL_NAME(syscall_trace) RESTORE_SWITCH_STACK addql #4,%sp jbsr @(SYMBOL_NAME(sys_call_table),%d2:l:4)@(0) - movel %d0,%sp@(LD0) | save the return value + movel %d0,%sp@(LPT_OFF_D0) | save the return value subql #4,%sp | dummy return address SAVE_SWITCH_STACK jbsr SYMBOL_NAME(syscall_trace) @@ -202,7 +93,7 @@ SYMBOL_NAME_LABEL(ret_from_signal) jra SYMBOL_NAME(ret_from_exception) ENTRY(system_call) - SAVE_ALL + SAVE_ALL_SYS movel %d0,%d2 GET_CURRENT(%d0) @@ -213,19 +104,20 @@ ENTRY(system_call) cmpl #NR_syscalls,%d2 jcc badsys - btst #5,%curptr@(LTASK_FLAGS+3) | PF_TRACESYS + btst #LPF_TRACESYS_BIT,%curptr@(LTASK_FLAGS+LPF_TRACESYS_OFF) jne do_trace jbsr @(SYMBOL_NAME(sys_call_table),%d2:l:4)@(0) - movel %d0,%sp@(LD0) | save the return value + movel %d0,%sp@(LPT_OFF_D0) | save the return value SYMBOL_NAME_LABEL(ret_from_exception) - btst #5,%sp@(LSR) | check if returning to kernel + btst #5,%sp@(LPT_OFF_SR) | check if returning to kernel bnes 2f | if so, skip resched, signals tstl SYMBOL_NAME(need_resched) jne SYMBOL_NAME(reschedule) cmpl #SYMBOL_NAME(task),%curptr | task[0] cannot have signals jeq 2f - bclr #5,%curptr@(LTASK_FLAGS+1) | check for delayed trace + | check for delayed trace + bclr #LPF_DTRACE_BIT,%curptr@(LTASK_FLAGS+LPF_DTRACE_OFF) jne do_delayed_trace 5: tstl %curptr@(LTASK_STATE) | state @@ -236,7 +128,7 @@ SYMBOL_NAME_LABEL(ret_from_exception) movel %curptr@(LTASK_BLOCKED),%d0 movel %d0,%d1 | save blocked in d1 for sig handling notl %d0 - btst #4,%curptr@(LTASK_FLAGS+3) | PF_PTRACED + btst #LPF_PTRACED_BIT,%curptr@(LTASK_FLAGS+LPF_PTRACED_OFF) jeq 1f moveq #-1,%d0 | let the debugger see all signals 1: andl %curptr@(LTASK_SIGNAL),%d0 @@ -255,10 +147,10 @@ Lsignal_return: RESTORE_ALL do_delayed_trace: - bclr #7,%sp@(LSR) | clear trace bit in SR + bclr #7,%sp@(LPT_OFF_SR) | clear trace bit in SR pea 1 | send SIGTRAP - movel %a0,%sp@- - pea 5 + movel %curptr,%sp@- + pea LSIGTRAP jbsr SYMBOL_NAME(send_sig) addql #8,%sp addql #4,%sp @@ -268,15 +160,11 @@ do_delayed_trace: ** This is the main interrupt handler, responsible for calling process_int() */ SYMBOL_NAME_LABEL(inthandler) - SAVE_ALL - moveq #-1,%d0 - movel %d0,%sp@(LORIG_D0) | a -1 in the ORIG_D0 field - | signifies that the stack frame - | is NOT for syscall + SAVE_ALL_INT GET_CURRENT(%d0) addql #1,SYMBOL_NAME(local_irq_count) | put exception # in d0 - bfextu %sp@(LFORMATVEC){#4,#10},%d0 + bfextu %sp@(LPT_OFF_FORMATVEC){#4,#10},%d0 movel %sp,%sp@- movel %d0,%sp@- | put vector # on stack @@ -290,7 +178,7 @@ SYMBOL_NAME_LABEL(ret_from_interrupt) RESTORE_ALL 1: #if 1 - bfextu %sp@(LSR){#5,#3},%d0 | Check for nested interrupt. + bfextu %sp@(LPT_OFF_SR){#5,#3},%d0 | Check for nested interrupt. #if MAX_NOINT_IPL > 0 cmpiw #MAX_NOINT_IPL,%d0 #endif @@ -347,14 +235,6 @@ ENTRY(sys_sigreturn) RESTORE_SWITCH_STACK rts -LFLUSH_I_AND_D = 0x00000808 -LTSS_KSP = 0 -LTSS_USP = 4 -LTSS_SR = 8 -LTSS_FS = 10 -LTSS_CRP = 12 -LTSS_FPCTXT = 24 - SYMBOL_NAME_LABEL(resume) /* * Beware - when entering resume, offset of tss is in d1, @@ -460,8 +340,10 @@ SYMBOL_NAME_LABEL(resume) #if defined (CONFIG_M68060) /* is it a '060 ? */ +#if !defined(CPU_M68060_ONLY) btst #3,SYMBOL_NAME(m68k_cputype)+3 beqs 2f +#endif /* clear user entries in the branch cache */ movec %cacr,%d0 orl #0x00200000,%d0 diff --git a/arch/m68k/kernel/setup.c b/arch/m68k/kernel/setup.c index def50a747..c27f7f320 100644 --- a/arch/m68k/kernel/setup.c +++ b/arch/m68k/kernel/setup.c @@ -142,8 +142,8 @@ __initfunc(static void m68k_parse_bootinfo(const struct bi_record *record)) } } - __initfunc(void setup_arch(char **cmdline_p, unsigned long * memory_start_p, - unsigned long * memory_end_p)) +__initfunc(void setup_arch(char **cmdline_p, unsigned long * memory_start_p, + unsigned long * memory_end_p)) { unsigned long memory_start, memory_end; extern int _etext, _edata, _end; diff --git a/arch/m68k/kernel/traps.c b/arch/m68k/kernel/traps.c index 25be40007..44e45b9a0 100644 --- a/arch/m68k/kernel/traps.c +++ b/arch/m68k/kernel/traps.c @@ -201,7 +201,7 @@ static inline void access_error060 (struct frame *fp) if ((!(fslw & MMU060_ERR_BITS)) && !(fslw & MMU060_SEE)) return; } - + if (fslw & (MMU060_DESC_ERR | MMU060_WP)) { unsigned long errorcode; unsigned long addr = fp->un.fmt4.effaddr; diff --git a/arch/m68k/mm/init.c b/arch/m68k/mm/init.c index b46037f80..02dff0eea 100644 --- a/arch/m68k/mm/init.c +++ b/arch/m68k/mm/init.c @@ -296,7 +296,8 @@ extern pgd_t swapper_pg_dir[PTRS_PER_PGD]; * The parameters are pointers to where to stick the starting and ending * addresses of available kernel virtual memory. */ -__initfunc(unsigned long paging_init(unsigned long start_mem, unsigned long end_mem)) +__initfunc(unsigned long paging_init(unsigned long start_mem, + unsigned long end_mem)) { int chunk; unsigned long mem_avail = 0; diff --git a/arch/m68k/mm/memory.c b/arch/m68k/mm/memory.c index 77eb2dbfe..dea7695e8 100644 --- a/arch/m68k/mm/memory.c +++ b/arch/m68k/mm/memory.c @@ -552,39 +552,26 @@ unsigned long mm_ptov (unsigned long paddr) void cache_clear (unsigned long paddr, int len) { if (CPU_IS_040_OR_060) { + int tmp; + /* * cwe need special treatment for the first page, in case it * is not page-aligned. */ - if (paddr & (PAGE_SIZE - 1)){ + if ((tmp = -paddr & (PAGE_SIZE - 1))) { pushcl040(paddr); - if (len <= PAGE_SIZE){ - if (((paddr + len - 1) ^ paddr) & PAGE_MASK) { - pushcl040(paddr + len - 1); - } + if ((len -= tmp) <= 0) return; - }else{ - len -=PAGE_SIZE; - paddr += PAGE_SIZE; - } + paddr += tmp; } - - while (len > PAGE_SIZE) { -#if 0 - pushcl040(paddr); -#else + tmp = PAGE_SIZE; + while ((len -= tmp) >= 0) { clear040(paddr); -#endif - len -= PAGE_SIZE; - paddr += PAGE_SIZE; + paddr += tmp; } - if (len > 0) { + if ((len += tmp)) + /* a page boundary gets crossed at the end */ pushcl040(paddr); - if (((paddr + len - 1) ^ paddr) & PAGE_MASK) { - /* a page boundary gets crossed at the end */ - pushcl040(paddr + len - 1); - } - } } else /* 68030 or 68020 */ asm volatile ("movec %/cacr,%/d0\n\t" @@ -605,26 +592,19 @@ void cache_clear (unsigned long paddr, int len) void cache_push (unsigned long paddr, int len) { if (CPU_IS_040_OR_060) { + int tmp = PAGE_SIZE; + /* * on 68040 or 68060, push cache lines for pages in the range; * on the '040 this also invalidates the pushed lines, but not on * the '060! */ - while (len > PAGE_SIZE) { - pushcli040(paddr); - len -= PAGE_SIZE; - paddr += PAGE_SIZE; - } - if (len > 0) { + len += paddr & (PAGE_SIZE - 1); + do { pushcli040(paddr); - if (((paddr + len - 1) ^ paddr) & PAGE_MASK) { - /* a page boundary gets crossed at the end */ - pushcli040(paddr + len - 1); - } - } - } - - + paddr += tmp; + } while ((len -= tmp) > 0); + } /* * 68030/68020 have no writeback cache. On the other hand, * cache_push is actually a superset of cache_clear (the lines @@ -654,34 +634,24 @@ void cache_push (unsigned long paddr, int len) void cache_push_v (unsigned long vaddr, int len) { if (CPU_IS_040) { + int tmp = PAGE_SIZE; + /* on 68040, push cache lines for pages in the range */ - while (len > PAGE_SIZE) { - pushv040(vaddr); - len -= PAGE_SIZE; - vaddr += PAGE_SIZE; - } - if (len > 0) { + len += vaddr & (PAGE_SIZE - 1); + do { pushv040(vaddr); - if (((vaddr + len - 1) ^ vaddr) & PAGE_MASK) { - /* a page boundary gets crossed at the end */ - pushv040(vaddr + len - 1); - } - } - } + vaddr += tmp; + } while ((len -= tmp) > 0); + } else if (CPU_IS_060) { + int tmp = PAGE_SIZE; + /* on 68040, push cache lines for pages in the range */ - while (len > PAGE_SIZE) { - pushv060(vaddr); - len -= PAGE_SIZE; - vaddr += PAGE_SIZE; - } - if (len > 0) { + len += vaddr & (PAGE_SIZE - 1); + do { pushv060(vaddr); - if (((vaddr + len - 1) ^ vaddr) & PAGE_MASK) { - /* a page boundary gets crossed at the end */ - pushv060(vaddr + len - 1); - } - } + vaddr += tmp; + } while ((len -= tmp) > 0); } /* 68030/68020 have no writeback cache; still need to clear icache. */ else /* 68030 or 68020 */ |