diff options
Diffstat (limited to 'arch/m68k')
56 files changed, 546 insertions, 1189 deletions
diff --git a/arch/m68k/Kconfig b/arch/m68k/Kconfig index ecdc19a299b2..b5da298ba61d 100644 --- a/arch/m68k/Kconfig +++ b/arch/m68k/Kconfig | |||
@@ -536,10 +536,6 @@ config GVPIOEXT_PLIP | |||
536 | Say Y to enable doing IP over the parallel port on your GVP | 536 | Say Y to enable doing IP over the parallel port on your GVP |
537 | IO-Extender card, N otherwise. | 537 | IO-Extender card, N otherwise. |
538 | 538 | ||
539 | config MAC_SCC | ||
540 | tristate "Macintosh serial support" | ||
541 | depends on MAC | ||
542 | |||
543 | config MAC_HID | 539 | config MAC_HID |
544 | bool | 540 | bool |
545 | depends on INPUT_ADBHID | 541 | depends on INPUT_ADBHID |
@@ -595,7 +591,7 @@ config DN_SERIAL | |||
595 | 591 | ||
596 | config SERIAL_CONSOLE | 592 | config SERIAL_CONSOLE |
597 | bool "Support for serial port console" | 593 | bool "Support for serial port console" |
598 | depends on (AMIGA || ATARI || MAC || SUN3 || SUN3X || VME || APOLLO) && (ATARI_MFPSER=y || ATARI_MIDI=y || MAC_SCC=y || AMIGA_BUILTIN_SERIAL=y || GVPIOEXT=y || MULTIFACE_III_TTY=y || SERIAL=y || MVME147_SCC || SERIAL167 || MVME162_SCC || BVME6000_SCC || DN_SERIAL) | 594 | depends on (AMIGA || ATARI || SUN3 || SUN3X || VME || APOLLO) && (ATARI_MFPSER=y || ATARI_MIDI=y || AMIGA_BUILTIN_SERIAL=y || GVPIOEXT=y || MULTIFACE_III_TTY=y || SERIAL=y || MVME147_SCC || SERIAL167 || MVME162_SCC || BVME6000_SCC || DN_SERIAL) |
599 | ---help--- | 595 | ---help--- |
600 | If you say Y here, it will be possible to use a serial port as the | 596 | If you say Y here, it will be possible to use a serial port as the |
601 | system console (the system console is the device which receives all | 597 | system console (the system console is the device which receives all |
diff --git a/arch/m68k/amiga/config.c b/arch/m68k/amiga/config.c index 6c74751c7b82..d2cc35d98532 100644 --- a/arch/m68k/amiga/config.c +++ b/arch/m68k/amiga/config.c | |||
@@ -480,7 +480,7 @@ static void __init amiga_sched_init(irq_handler_t timer_routine) | |||
480 | static struct resource sched_res = { | 480 | static struct resource sched_res = { |
481 | .name = "timer", .start = 0x00bfd400, .end = 0x00bfd5ff, | 481 | .name = "timer", .start = 0x00bfd400, .end = 0x00bfd5ff, |
482 | }; | 482 | }; |
483 | jiffy_ticks = (amiga_eclock+HZ/2)/HZ; | 483 | jiffy_ticks = DIV_ROUND_CLOSEST(amiga_eclock, HZ); |
484 | 484 | ||
485 | if (request_resource(&mb_resources._ciab, &sched_res)) | 485 | if (request_resource(&mb_resources._ciab, &sched_res)) |
486 | printk("Cannot allocate ciab.ta{lo,hi}\n"); | 486 | printk("Cannot allocate ciab.ta{lo,hi}\n"); |
diff --git a/arch/m68k/atari/atakeyb.c b/arch/m68k/atari/atakeyb.c index 4add96d13b19..5890897d28bf 100644 --- a/arch/m68k/atari/atakeyb.c +++ b/arch/m68k/atari/atakeyb.c | |||
@@ -121,7 +121,7 @@ KEYBOARD_STATE kb_state; | |||
121 | * bytes have been lost and in which state of the packet structure we are now. | 121 | * bytes have been lost and in which state of the packet structure we are now. |
122 | * This usually causes keyboards bytes to be interpreted as mouse movements | 122 | * This usually causes keyboards bytes to be interpreted as mouse movements |
123 | * and vice versa, which is very annoying. It seems better to throw away some | 123 | * and vice versa, which is very annoying. It seems better to throw away some |
124 | * bytes (that are usually mouse bytes) than to misinterpret them. Therefor I | 124 | * bytes (that are usually mouse bytes) than to misinterpret them. Therefore I |
125 | * introduced the RESYNC state for IKBD data. In this state, the bytes up to | 125 | * introduced the RESYNC state for IKBD data. In this state, the bytes up to |
126 | * one that really looks like a key event (0x04..0xf2) or the start of a mouse | 126 | * one that really looks like a key event (0x04..0xf2) or the start of a mouse |
127 | * packet (0xf8..0xfb) are thrown away, but at most 2 bytes. This at least | 127 | * packet (0xf8..0xfb) are thrown away, but at most 2 bytes. This at least |
diff --git a/arch/m68k/bvme6000/rtc.c b/arch/m68k/bvme6000/rtc.c index c50bec8aabb1..b46ea1714a89 100644 --- a/arch/m68k/bvme6000/rtc.c +++ b/arch/m68k/bvme6000/rtc.c | |||
@@ -9,7 +9,6 @@ | |||
9 | #include <linux/types.h> | 9 | #include <linux/types.h> |
10 | #include <linux/errno.h> | 10 | #include <linux/errno.h> |
11 | #include <linux/miscdevice.h> | 11 | #include <linux/miscdevice.h> |
12 | #include <linux/slab.h> | ||
13 | #include <linux/smp_lock.h> | 12 | #include <linux/smp_lock.h> |
14 | #include <linux/ioport.h> | 13 | #include <linux/ioport.h> |
15 | #include <linux/capability.h> | 14 | #include <linux/capability.h> |
diff --git a/arch/m68k/configs/mac_defconfig b/arch/m68k/configs/mac_defconfig index 9991b64fea57..c5f3232ff916 100644 --- a/arch/m68k/configs/mac_defconfig +++ b/arch/m68k/configs/mac_defconfig | |||
@@ -701,6 +701,11 @@ CONFIG_VT_HW_CONSOLE_BINDING=y | |||
701 | # | 701 | # |
702 | # Non-8250 serial port support | 702 | # Non-8250 serial port support |
703 | # | 703 | # |
704 | CONFIG_SERIAL_CORE=y | ||
705 | CONFIG_SERIAL_CORE_CONSOLE=y | ||
706 | CONFIG_SERIAL_PMACZILOG=y | ||
707 | CONFIG_SERIAL_PMACZILOG_TTYS=y | ||
708 | CONFIG_SERIAL_PMACZILOG_CONSOLE=y | ||
704 | CONFIG_UNIX98_PTYS=y | 709 | CONFIG_UNIX98_PTYS=y |
705 | # CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set | 710 | # CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set |
706 | CONFIG_LEGACY_PTYS=y | 711 | CONFIG_LEGACY_PTYS=y |
@@ -834,9 +839,7 @@ CONFIG_HIDRAW=y | |||
834 | # | 839 | # |
835 | # Character devices | 840 | # Character devices |
836 | # | 841 | # |
837 | CONFIG_MAC_SCC=y | ||
838 | CONFIG_MAC_HID=y | 842 | CONFIG_MAC_HID=y |
839 | CONFIG_SERIAL_CONSOLE=y | ||
840 | 843 | ||
841 | # | 844 | # |
842 | # File systems | 845 | # File systems |
diff --git a/arch/m68k/configs/multi_defconfig b/arch/m68k/configs/multi_defconfig index 69c43e2d8b45..a8bfa3fa71cf 100644 --- a/arch/m68k/configs/multi_defconfig +++ b/arch/m68k/configs/multi_defconfig | |||
@@ -822,6 +822,11 @@ CONFIG_A2232=y | |||
822 | # | 822 | # |
823 | # Non-8250 serial port support | 823 | # Non-8250 serial port support |
824 | # | 824 | # |
825 | CONFIG_SERIAL_CORE=y | ||
826 | CONFIG_SERIAL_CORE_CONSOLE=y | ||
827 | CONFIG_SERIAL_PMACZILOG=y | ||
828 | CONFIG_SERIAL_PMACZILOG_TTYS=y | ||
829 | CONFIG_SERIAL_PMACZILOG_CONSOLE=y | ||
825 | CONFIG_UNIX98_PTYS=y | 830 | CONFIG_UNIX98_PTYS=y |
826 | # CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set | 831 | # CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set |
827 | CONFIG_LEGACY_PTYS=y | 832 | CONFIG_LEGACY_PTYS=y |
@@ -982,7 +987,6 @@ CONFIG_ATARI_MIDI=y | |||
982 | CONFIG_ATARI_DSP56K=m | 987 | CONFIG_ATARI_DSP56K=m |
983 | CONFIG_AMIGA_BUILTIN_SERIAL=y | 988 | CONFIG_AMIGA_BUILTIN_SERIAL=y |
984 | CONFIG_MULTIFACE_III_TTY=m | 989 | CONFIG_MULTIFACE_III_TTY=m |
985 | CONFIG_MAC_SCC=y | ||
986 | CONFIG_MAC_HID=y | 990 | CONFIG_MAC_HID=y |
987 | CONFIG_MVME147_SCC=y | 991 | CONFIG_MVME147_SCC=y |
988 | CONFIG_SERIAL167=y | 992 | CONFIG_SERIAL167=y |
diff --git a/arch/m68k/ifpsp060/src/fpsp.S b/arch/m68k/ifpsp060/src/fpsp.S index 6c1a9a217887..73613b5f1ee5 100644 --- a/arch/m68k/ifpsp060/src/fpsp.S +++ b/arch/m68k/ifpsp060/src/fpsp.S | |||
@@ -753,7 +753,7 @@ fovfl_ovfl_on: | |||
753 | 753 | ||
754 | bra.l _real_ovfl | 754 | bra.l _real_ovfl |
755 | 755 | ||
756 | # overflow occurred but is disabled. meanwhile, inexact is enabled. therefore, | 756 | # overflow occurred but is disabled. meanwhile, inexact is enabled. Therefore, |
757 | # we must jump to real_inex(). | 757 | # we must jump to real_inex(). |
758 | fovfl_inex_on: | 758 | fovfl_inex_on: |
759 | 759 | ||
@@ -1015,7 +1015,7 @@ funfl_unfl_on2: | |||
1015 | 1015 | ||
1016 | bra.l _real_unfl | 1016 | bra.l _real_unfl |
1017 | 1017 | ||
1018 | # undeflow occurred but is disabled. meanwhile, inexact is enabled. therefore, | 1018 | # underflow occurred but is disabled. meanwhile, inexact is enabled. Therefore, |
1019 | # we must jump to real_inex(). | 1019 | # we must jump to real_inex(). |
1020 | funfl_inex_on: | 1020 | funfl_inex_on: |
1021 | 1021 | ||
@@ -2963,7 +2963,7 @@ iea_disabled: | |||
2963 | 2963 | ||
2964 | tst.w %d0 # is instr fmovm? | 2964 | tst.w %d0 # is instr fmovm? |
2965 | bmi.b iea_dis_fmovm # yes | 2965 | bmi.b iea_dis_fmovm # yes |
2966 | # instruction is using an extended precision immediate operand. therefore, | 2966 | # instruction is using an extended precision immediate operand. Therefore, |
2967 | # the total instruction length is 16 bytes. | 2967 | # the total instruction length is 16 bytes. |
2968 | iea_dis_immed: | 2968 | iea_dis_immed: |
2969 | mov.l &0x10,%d0 # 16 bytes of instruction | 2969 | mov.l &0x10,%d0 # 16 bytes of instruction |
@@ -9624,7 +9624,7 @@ sok_dnrm: | |||
9624 | bge.b sok_norm2 # thank goodness no | 9624 | bge.b sok_norm2 # thank goodness no |
9625 | 9625 | ||
9626 | # the multiply factor that we're trying to create should be a denorm | 9626 | # the multiply factor that we're trying to create should be a denorm |
9627 | # for the multiply to work. therefore, we're going to actually do a | 9627 | # for the multiply to work. Therefore, we're going to actually do a |
9628 | # multiply with a denorm which will cause an unimplemented data type | 9628 | # multiply with a denorm which will cause an unimplemented data type |
9629 | # exception to be put into the machine which will be caught and corrected | 9629 | # exception to be put into the machine which will be caught and corrected |
9630 | # later. we don't do this with the DENORMs above because this method | 9630 | # later. we don't do this with the DENORMs above because this method |
@@ -12216,7 +12216,7 @@ fin_sd_unfl_dis: | |||
12216 | 12216 | ||
12217 | # | 12217 | # |
12218 | # operand will underflow AND underflow or inexact is enabled. | 12218 | # operand will underflow AND underflow or inexact is enabled. |
12219 | # therefore, we must return the result rounded to extended precision. | 12219 | # Therefore, we must return the result rounded to extended precision. |
12220 | # | 12220 | # |
12221 | fin_sd_unfl_ena: | 12221 | fin_sd_unfl_ena: |
12222 | mov.l FP_SCR0_HI(%a6),FP_SCR1_HI(%a6) | 12222 | mov.l FP_SCR0_HI(%a6),FP_SCR1_HI(%a6) |
@@ -12746,7 +12746,7 @@ fdiv_zero_load_p: | |||
12746 | 12746 | ||
12747 | # | 12747 | # |
12748 | # The destination was In Range and the source was a ZERO. The result, | 12748 | # The destination was In Range and the source was a ZERO. The result, |
12749 | # therefore, is an INF w/ the proper sign. | 12749 | # Therefore, is an INF w/ the proper sign. |
12750 | # So, determine the sign and return a new INF (w/ the j-bit cleared). | 12750 | # So, determine the sign and return a new INF (w/ the j-bit cleared). |
12751 | # | 12751 | # |
12752 | global fdiv_inf_load # global for fsgldiv | 12752 | global fdiv_inf_load # global for fsgldiv |
@@ -12996,7 +12996,7 @@ fneg_sd_unfl_dis: | |||
12996 | 12996 | ||
12997 | # | 12997 | # |
12998 | # operand will underflow AND underflow is enabled. | 12998 | # operand will underflow AND underflow is enabled. |
12999 | # therefore, we must return the result rounded to extended precision. | 12999 | # Therefore, we must return the result rounded to extended precision. |
13000 | # | 13000 | # |
13001 | fneg_sd_unfl_ena: | 13001 | fneg_sd_unfl_ena: |
13002 | mov.l FP_SCR0_HI(%a6),FP_SCR1_HI(%a6) | 13002 | mov.l FP_SCR0_HI(%a6),FP_SCR1_HI(%a6) |
@@ -13611,7 +13611,7 @@ fabs_sd_unfl_dis: | |||
13611 | 13611 | ||
13612 | # | 13612 | # |
13613 | # operand will underflow AND underflow is enabled. | 13613 | # operand will underflow AND underflow is enabled. |
13614 | # therefore, we must return the result rounded to extended precision. | 13614 | # Therefore, we must return the result rounded to extended precision. |
13615 | # | 13615 | # |
13616 | fabs_sd_unfl_ena: | 13616 | fabs_sd_unfl_ena: |
13617 | mov.l FP_SCR0_HI(%a6),FP_SCR1_HI(%a6) | 13617 | mov.l FP_SCR0_HI(%a6),FP_SCR1_HI(%a6) |
@@ -14973,7 +14973,7 @@ fadd_zero_2: | |||
14973 | 14973 | ||
14974 | # | 14974 | # |
14975 | # the ZEROes have opposite signs: | 14975 | # the ZEROes have opposite signs: |
14976 | # - therefore, we return +ZERO if the rounding modes are RN,RZ, or RP. | 14976 | # - Therefore, we return +ZERO if the rounding modes are RN,RZ, or RP. |
14977 | # - -ZERO is returned in the case of RM. | 14977 | # - -ZERO is returned in the case of RM. |
14978 | # | 14978 | # |
14979 | fadd_zero_2_chk_rm: | 14979 | fadd_zero_2_chk_rm: |
@@ -15425,7 +15425,7 @@ fsub_zero_2: | |||
15425 | 15425 | ||
15426 | # | 15426 | # |
15427 | # the ZEROes have the same signs: | 15427 | # the ZEROes have the same signs: |
15428 | # - therefore, we return +ZERO if the rounding mode is RN,RZ, or RP | 15428 | # - Therefore, we return +ZERO if the rounding mode is RN,RZ, or RP |
15429 | # - -ZERO is returned in the case of RM. | 15429 | # - -ZERO is returned in the case of RM. |
15430 | # | 15430 | # |
15431 | fsub_zero_2_chk_rm: | 15431 | fsub_zero_2_chk_rm: |
@@ -15693,7 +15693,7 @@ fsqrt_sd_unfl_dis: | |||
15693 | 15693 | ||
15694 | # | 15694 | # |
15695 | # operand will underflow AND underflow is enabled. | 15695 | # operand will underflow AND underflow is enabled. |
15696 | # therefore, we must return the result rounded to extended precision. | 15696 | # Therefore, we must return the result rounded to extended precision. |
15697 | # | 15697 | # |
15698 | fsqrt_sd_unfl_ena: | 15698 | fsqrt_sd_unfl_ena: |
15699 | mov.l FP_SCR0_HI(%a6),FP_SCR1_HI(%a6) | 15699 | mov.l FP_SCR0_HI(%a6),FP_SCR1_HI(%a6) |
@@ -21000,7 +21000,7 @@ fout_pack_type: | |||
21000 | tst.l %d0 | 21000 | tst.l %d0 |
21001 | bne.b fout_pack_set | 21001 | bne.b fout_pack_set |
21002 | # "mantissa" is all zero which means that the answer is zero. but, the '040 | 21002 | # "mantissa" is all zero which means that the answer is zero. but, the '040 |
21003 | # algorithm allows the exponent to be non-zero. the 881/2 do not. therefore, | 21003 | # algorithm allows the exponent to be non-zero. the 881/2 do not. Therefore, |
21004 | # if the mantissa is zero, I will zero the exponent, too. | 21004 | # if the mantissa is zero, I will zero the exponent, too. |
21005 | # the question now is whether the exponents sign bit is allowed to be non-zero | 21005 | # the question now is whether the exponents sign bit is allowed to be non-zero |
21006 | # for a zero, also... | 21006 | # for a zero, also... |
@@ -21743,7 +21743,7 @@ denorm_set_stky: | |||
21743 | rts | 21743 | rts |
21744 | 21744 | ||
21745 | # # | 21745 | # # |
21746 | # dnrm_lp(): normalize exponent/mantissa to specified threshhold # | 21746 | # dnrm_lp(): normalize exponent/mantissa to specified threshold # |
21747 | # # | 21747 | # # |
21748 | # INPUT: # | 21748 | # INPUT: # |
21749 | # %a0 : points to the operand to be denormalized # | 21749 | # %a0 : points to the operand to be denormalized # |
@@ -22402,7 +22402,7 @@ unnorm_shift: | |||
22402 | bgt.b unnorm_nrm_zero # yes; denorm only until exp = 0 | 22402 | bgt.b unnorm_nrm_zero # yes; denorm only until exp = 0 |
22403 | 22403 | ||
22404 | # | 22404 | # |
22405 | # exponent would not go < 0. therefore, number stays normalized | 22405 | # exponent would not go < 0. Therefore, number stays normalized |
22406 | # | 22406 | # |
22407 | sub.w %d0, %d1 # shift exponent value | 22407 | sub.w %d0, %d1 # shift exponent value |
22408 | mov.w FTEMP_EX(%a0), %d0 # load old exponent | 22408 | mov.w FTEMP_EX(%a0), %d0 # load old exponent |
diff --git a/arch/m68k/ifpsp060/src/pfpsp.S b/arch/m68k/ifpsp060/src/pfpsp.S index 51b9f7d879dd..e71ba0ab013c 100644 --- a/arch/m68k/ifpsp060/src/pfpsp.S +++ b/arch/m68k/ifpsp060/src/pfpsp.S | |||
@@ -752,7 +752,7 @@ fovfl_ovfl_on: | |||
752 | 752 | ||
753 | bra.l _real_ovfl | 753 | bra.l _real_ovfl |
754 | 754 | ||
755 | # overflow occurred but is disabled. meanwhile, inexact is enabled. therefore, | 755 | # overflow occurred but is disabled. meanwhile, inexact is enabled. Therefore, |
756 | # we must jump to real_inex(). | 756 | # we must jump to real_inex(). |
757 | fovfl_inex_on: | 757 | fovfl_inex_on: |
758 | 758 | ||
@@ -1014,7 +1014,7 @@ funfl_unfl_on2: | |||
1014 | 1014 | ||
1015 | bra.l _real_unfl | 1015 | bra.l _real_unfl |
1016 | 1016 | ||
1017 | # undeflow occurred but is disabled. meanwhile, inexact is enabled. therefore, | 1017 | # underflow occurred but is disabled. meanwhile, inexact is enabled. Therefore, |
1018 | # we must jump to real_inex(). | 1018 | # we must jump to real_inex(). |
1019 | funfl_inex_on: | 1019 | funfl_inex_on: |
1020 | 1020 | ||
@@ -2962,7 +2962,7 @@ iea_disabled: | |||
2962 | 2962 | ||
2963 | tst.w %d0 # is instr fmovm? | 2963 | tst.w %d0 # is instr fmovm? |
2964 | bmi.b iea_dis_fmovm # yes | 2964 | bmi.b iea_dis_fmovm # yes |
2965 | # instruction is using an extended precision immediate operand. therefore, | 2965 | # instruction is using an extended precision immediate operand. Therefore, |
2966 | # the total instruction length is 16 bytes. | 2966 | # the total instruction length is 16 bytes. |
2967 | iea_dis_immed: | 2967 | iea_dis_immed: |
2968 | mov.l &0x10,%d0 # 16 bytes of instruction | 2968 | mov.l &0x10,%d0 # 16 bytes of instruction |
@@ -5865,7 +5865,7 @@ denorm_set_stky: | |||
5865 | rts | 5865 | rts |
5866 | 5866 | ||
5867 | # # | 5867 | # # |
5868 | # dnrm_lp(): normalize exponent/mantissa to specified threshhold # | 5868 | # dnrm_lp(): normalize exponent/mantissa to specified threshold # |
5869 | # # | 5869 | # # |
5870 | # INPUT: # | 5870 | # INPUT: # |
5871 | # %a0 : points to the operand to be denormalized # | 5871 | # %a0 : points to the operand to be denormalized # |
@@ -6524,7 +6524,7 @@ unnorm_shift: | |||
6524 | bgt.b unnorm_nrm_zero # yes; denorm only until exp = 0 | 6524 | bgt.b unnorm_nrm_zero # yes; denorm only until exp = 0 |
6525 | 6525 | ||
6526 | # | 6526 | # |
6527 | # exponent would not go < 0. therefore, number stays normalized | 6527 | # exponent would not go < 0. Therefore, number stays normalized |
6528 | # | 6528 | # |
6529 | sub.w %d0, %d1 # shift exponent value | 6529 | sub.w %d0, %d1 # shift exponent value |
6530 | mov.w FTEMP_EX(%a0), %d0 # load old exponent | 6530 | mov.w FTEMP_EX(%a0), %d0 # load old exponent |
@@ -7901,7 +7901,7 @@ fout_pack_type: | |||
7901 | tst.l %d0 | 7901 | tst.l %d0 |
7902 | bne.b fout_pack_set | 7902 | bne.b fout_pack_set |
7903 | # "mantissa" is all zero which means that the answer is zero. but, the '040 | 7903 | # "mantissa" is all zero which means that the answer is zero. but, the '040 |
7904 | # algorithm allows the exponent to be non-zero. the 881/2 do not. therefore, | 7904 | # algorithm allows the exponent to be non-zero. the 881/2 do not. Therefore, |
7905 | # if the mantissa is zero, I will zero the exponent, too. | 7905 | # if the mantissa is zero, I will zero the exponent, too. |
7906 | # the question now is whether the exponents sign bit is allowed to be non-zero | 7906 | # the question now is whether the exponents sign bit is allowed to be non-zero |
7907 | # for a zero, also... | 7907 | # for a zero, also... |
@@ -8647,7 +8647,7 @@ fin_sd_unfl_dis: | |||
8647 | 8647 | ||
8648 | # | 8648 | # |
8649 | # operand will underflow AND underflow or inexact is enabled. | 8649 | # operand will underflow AND underflow or inexact is enabled. |
8650 | # therefore, we must return the result rounded to extended precision. | 8650 | # Therefore, we must return the result rounded to extended precision. |
8651 | # | 8651 | # |
8652 | fin_sd_unfl_ena: | 8652 | fin_sd_unfl_ena: |
8653 | mov.l FP_SCR0_HI(%a6),FP_SCR1_HI(%a6) | 8653 | mov.l FP_SCR0_HI(%a6),FP_SCR1_HI(%a6) |
@@ -9177,7 +9177,7 @@ fdiv_zero_load_p: | |||
9177 | 9177 | ||
9178 | # | 9178 | # |
9179 | # The destination was In Range and the source was a ZERO. The result, | 9179 | # The destination was In Range and the source was a ZERO. The result, |
9180 | # therefore, is an INF w/ the proper sign. | 9180 | # Therefore, is an INF w/ the proper sign. |
9181 | # So, determine the sign and return a new INF (w/ the j-bit cleared). | 9181 | # So, determine the sign and return a new INF (w/ the j-bit cleared). |
9182 | # | 9182 | # |
9183 | global fdiv_inf_load # global for fsgldiv | 9183 | global fdiv_inf_load # global for fsgldiv |
@@ -9427,7 +9427,7 @@ fneg_sd_unfl_dis: | |||
9427 | 9427 | ||
9428 | # | 9428 | # |
9429 | # operand will underflow AND underflow is enabled. | 9429 | # operand will underflow AND underflow is enabled. |
9430 | # therefore, we must return the result rounded to extended precision. | 9430 | # Therefore, we must return the result rounded to extended precision. |
9431 | # | 9431 | # |
9432 | fneg_sd_unfl_ena: | 9432 | fneg_sd_unfl_ena: |
9433 | mov.l FP_SCR0_HI(%a6),FP_SCR1_HI(%a6) | 9433 | mov.l FP_SCR0_HI(%a6),FP_SCR1_HI(%a6) |
@@ -10042,7 +10042,7 @@ fabs_sd_unfl_dis: | |||
10042 | 10042 | ||
10043 | # | 10043 | # |
10044 | # operand will underflow AND underflow is enabled. | 10044 | # operand will underflow AND underflow is enabled. |
10045 | # therefore, we must return the result rounded to extended precision. | 10045 | # Therefore, we must return the result rounded to extended precision. |
10046 | # | 10046 | # |
10047 | fabs_sd_unfl_ena: | 10047 | fabs_sd_unfl_ena: |
10048 | mov.l FP_SCR0_HI(%a6),FP_SCR1_HI(%a6) | 10048 | mov.l FP_SCR0_HI(%a6),FP_SCR1_HI(%a6) |
@@ -11404,7 +11404,7 @@ fadd_zero_2: | |||
11404 | 11404 | ||
11405 | # | 11405 | # |
11406 | # the ZEROes have opposite signs: | 11406 | # the ZEROes have opposite signs: |
11407 | # - therefore, we return +ZERO if the rounding modes are RN,RZ, or RP. | 11407 | # - Therefore, we return +ZERO if the rounding modes are RN,RZ, or RP. |
11408 | # - -ZERO is returned in the case of RM. | 11408 | # - -ZERO is returned in the case of RM. |
11409 | # | 11409 | # |
11410 | fadd_zero_2_chk_rm: | 11410 | fadd_zero_2_chk_rm: |
@@ -11856,7 +11856,7 @@ fsub_zero_2: | |||
11856 | 11856 | ||
11857 | # | 11857 | # |
11858 | # the ZEROes have the same signs: | 11858 | # the ZEROes have the same signs: |
11859 | # - therefore, we return +ZERO if the rounding mode is RN,RZ, or RP | 11859 | # - Therefore, we return +ZERO if the rounding mode is RN,RZ, or RP |
11860 | # - -ZERO is returned in the case of RM. | 11860 | # - -ZERO is returned in the case of RM. |
11861 | # | 11861 | # |
11862 | fsub_zero_2_chk_rm: | 11862 | fsub_zero_2_chk_rm: |
@@ -12124,7 +12124,7 @@ fsqrt_sd_unfl_dis: | |||
12124 | 12124 | ||
12125 | # | 12125 | # |
12126 | # operand will underflow AND underflow is enabled. | 12126 | # operand will underflow AND underflow is enabled. |
12127 | # therefore, we must return the result rounded to extended precision. | 12127 | # Therefore, we must return the result rounded to extended precision. |
12128 | # | 12128 | # |
12129 | fsqrt_sd_unfl_ena: | 12129 | fsqrt_sd_unfl_ena: |
12130 | mov.l FP_SCR0_HI(%a6),FP_SCR1_HI(%a6) | 12130 | mov.l FP_SCR0_HI(%a6),FP_SCR1_HI(%a6) |
diff --git a/arch/m68k/include/asm/asm-offsets.h b/arch/m68k/include/asm/asm-offsets.h new file mode 100644 index 000000000000..d370ee36a182 --- /dev/null +++ b/arch/m68k/include/asm/asm-offsets.h | |||
@@ -0,0 +1 @@ | |||
#include <generated/asm-offsets.h> | |||
diff --git a/arch/m68k/include/asm/atomic_mm.h b/arch/m68k/include/asm/atomic_mm.h index 88b7af20a996..d9d2ed647435 100644 --- a/arch/m68k/include/asm/atomic_mm.h +++ b/arch/m68k/include/asm/atomic_mm.h | |||
@@ -148,14 +148,18 @@ static inline int atomic_xchg(atomic_t *v, int new) | |||
148 | static inline int atomic_sub_and_test(int i, atomic_t *v) | 148 | static inline int atomic_sub_and_test(int i, atomic_t *v) |
149 | { | 149 | { |
150 | char c; | 150 | char c; |
151 | __asm__ __volatile__("subl %2,%1; seq %0" : "=d" (c), "+m" (*v): "g" (i)); | 151 | __asm__ __volatile__("subl %2,%1; seq %0" |
152 | : "=d" (c), "+m" (*v) | ||
153 | : "id" (i)); | ||
152 | return c != 0; | 154 | return c != 0; |
153 | } | 155 | } |
154 | 156 | ||
155 | static inline int atomic_add_negative(int i, atomic_t *v) | 157 | static inline int atomic_add_negative(int i, atomic_t *v) |
156 | { | 158 | { |
157 | char c; | 159 | char c; |
158 | __asm__ __volatile__("addl %2,%1; smi %0" : "=d" (c), "+m" (*v): "g" (i)); | 160 | __asm__ __volatile__("addl %2,%1; smi %0" |
161 | : "=d" (c), "+m" (*v) | ||
162 | : "id" (i)); | ||
159 | return c != 0; | 163 | return c != 0; |
160 | } | 164 | } |
161 | 165 | ||
diff --git a/arch/m68k/include/asm/bootinfo.h b/arch/m68k/include/asm/bootinfo.h index fb8a06b9ab6a..67e7a78ad96b 100644 --- a/arch/m68k/include/asm/bootinfo.h +++ b/arch/m68k/include/asm/bootinfo.h | |||
@@ -145,7 +145,7 @@ struct bi_record { | |||
145 | 145 | ||
146 | /* | 146 | /* |
147 | * Macintosh hardware profile data - unused, see macintosh.h for | 147 | * Macintosh hardware profile data - unused, see macintosh.h for |
148 | * resonable type values | 148 | * reasonable type values |
149 | */ | 149 | */ |
150 | 150 | ||
151 | #define BI_MAC_VIA1BASE 0x8010 /* Mac VIA1 base address (always present) */ | 151 | #define BI_MAC_VIA1BASE 0x8010 /* Mac VIA1 base address (always present) */ |
diff --git a/arch/m68k/include/asm/cacheflush_mm.h b/arch/m68k/include/asm/cacheflush_mm.h index 16bf375fdbe1..73de7c89d8e0 100644 --- a/arch/m68k/include/asm/cacheflush_mm.h +++ b/arch/m68k/include/asm/cacheflush_mm.h | |||
@@ -128,6 +128,7 @@ static inline void __flush_page_to_ram(void *vaddr) | |||
128 | } | 128 | } |
129 | } | 129 | } |
130 | 130 | ||
131 | #define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 1 | ||
131 | #define flush_dcache_page(page) __flush_page_to_ram(page_address(page)) | 132 | #define flush_dcache_page(page) __flush_page_to_ram(page_address(page)) |
132 | #define flush_dcache_mmap_lock(mapping) do { } while (0) | 133 | #define flush_dcache_mmap_lock(mapping) do { } while (0) |
133 | #define flush_dcache_mmap_unlock(mapping) do { } while (0) | 134 | #define flush_dcache_mmap_unlock(mapping) do { } while (0) |
diff --git a/arch/m68k/include/asm/cacheflush_no.h b/arch/m68k/include/asm/cacheflush_no.h index c65f00a94553..89f195656be7 100644 --- a/arch/m68k/include/asm/cacheflush_no.h +++ b/arch/m68k/include/asm/cacheflush_no.h | |||
@@ -12,6 +12,7 @@ | |||
12 | #define flush_cache_range(vma, start, end) __flush_cache_all() | 12 | #define flush_cache_range(vma, start, end) __flush_cache_all() |
13 | #define flush_cache_page(vma, vmaddr) do { } while (0) | 13 | #define flush_cache_page(vma, vmaddr) do { } while (0) |
14 | #define flush_dcache_range(start,len) __flush_cache_all() | 14 | #define flush_dcache_range(start,len) __flush_cache_all() |
15 | #define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 0 | ||
15 | #define flush_dcache_page(page) do { } while (0) | 16 | #define flush_dcache_page(page) do { } while (0) |
16 | #define flush_dcache_mmap_lock(mapping) do { } while (0) | 17 | #define flush_dcache_mmap_lock(mapping) do { } while (0) |
17 | #define flush_dcache_mmap_unlock(mapping) do { } while (0) | 18 | #define flush_dcache_mmap_unlock(mapping) do { } while (0) |
diff --git a/arch/m68k/include/asm/elf.h b/arch/m68k/include/asm/elf.h index 0b0f49eb876b..01c193d91412 100644 --- a/arch/m68k/include/asm/elf.h +++ b/arch/m68k/include/asm/elf.h | |||
@@ -59,7 +59,6 @@ typedef struct user_m68kfp_struct elf_fpregset_t; | |||
59 | is actually used on ASV. */ | 59 | is actually used on ASV. */ |
60 | #define ELF_PLAT_INIT(_r, load_addr) _r->a1 = 0 | 60 | #define ELF_PLAT_INIT(_r, load_addr) _r->a1 = 0 |
61 | 61 | ||
62 | #define USE_ELF_CORE_DUMP | ||
63 | #ifndef CONFIG_SUN3 | 62 | #ifndef CONFIG_SUN3 |
64 | #define ELF_EXEC_PAGESIZE 4096 | 63 | #define ELF_EXEC_PAGESIZE 4096 |
65 | #else | 64 | #else |
diff --git a/arch/m68k/include/asm/fbio.h b/arch/m68k/include/asm/fbio.h index b9215a0907d3..0a21da87f7d6 100644 --- a/arch/m68k/include/asm/fbio.h +++ b/arch/m68k/include/asm/fbio.h | |||
@@ -173,7 +173,7 @@ struct mdi_cfginfo { | |||
173 | int mdi_ncluts; /* Number of implemented CLUTs in this MDI */ | 173 | int mdi_ncluts; /* Number of implemented CLUTs in this MDI */ |
174 | int mdi_type; /* FBTYPE name */ | 174 | int mdi_type; /* FBTYPE name */ |
175 | int mdi_height; /* height */ | 175 | int mdi_height; /* height */ |
176 | int mdi_width; /* widht */ | 176 | int mdi_width; /* width */ |
177 | int mdi_size; /* available ram */ | 177 | int mdi_size; /* available ram */ |
178 | int mdi_mode; /* 8bpp, 16bpp or 32bpp */ | 178 | int mdi_mode; /* 8bpp, 16bpp or 32bpp */ |
179 | int mdi_pixfreq; /* pixel clock (from PROM) */ | 179 | int mdi_pixfreq; /* pixel clock (from PROM) */ |
diff --git a/arch/m68k/include/asm/io_no.h b/arch/m68k/include/asm/io_no.h index 7f57436ec18f..6e2413e518cb 100644 --- a/arch/m68k/include/asm/io_no.h +++ b/arch/m68k/include/asm/io_no.h | |||
@@ -3,6 +3,7 @@ | |||
3 | 3 | ||
4 | #ifdef __KERNEL__ | 4 | #ifdef __KERNEL__ |
5 | 5 | ||
6 | #include <asm/virtconvert.h> | ||
6 | 7 | ||
7 | /* | 8 | /* |
8 | * These are for ISA/PCI shared memory _only_ and should never be used | 9 | * These are for ISA/PCI shared memory _only_ and should never be used |
@@ -15,7 +16,7 @@ | |||
15 | * memory location directly. | 16 | * memory location directly. |
16 | */ | 17 | */ |
17 | /* ++roman: The assignments to temp. vars avoid that gcc sometimes generates | 18 | /* ++roman: The assignments to temp. vars avoid that gcc sometimes generates |
18 | * two accesses to memory, which may be undesireable for some devices. | 19 | * two accesses to memory, which may be undesirable for some devices. |
19 | */ | 20 | */ |
20 | 21 | ||
21 | /* | 22 | /* |
@@ -165,19 +166,6 @@ static inline void *ioremap_fullcache(unsigned long physaddr, unsigned long size | |||
165 | 166 | ||
166 | extern void iounmap(void *addr); | 167 | extern void iounmap(void *addr); |
167 | 168 | ||
168 | /* Pages to physical address... */ | ||
169 | #define page_to_phys(page) ((page - mem_map) << PAGE_SHIFT) | ||
170 | #define page_to_bus(page) ((page - mem_map) << PAGE_SHIFT) | ||
171 | |||
172 | /* | ||
173 | * Macros used for converting between virtual and physical mappings. | ||
174 | */ | ||
175 | #define phys_to_virt(vaddr) ((void *) (vaddr)) | ||
176 | #define virt_to_phys(vaddr) ((unsigned long) (vaddr)) | ||
177 | |||
178 | #define virt_to_bus virt_to_phys | ||
179 | #define bus_to_virt phys_to_virt | ||
180 | |||
181 | /* | 169 | /* |
182 | * Convert a physical pointer to a virtual kernel pointer for /dev/mem | 170 | * Convert a physical pointer to a virtual kernel pointer for /dev/mem |
183 | * access | 171 | * access |
diff --git a/arch/m68k/include/asm/machw.h b/arch/m68k/include/asm/machw.h index 2b4de0c2ce4a..a22095164927 100644 --- a/arch/m68k/include/asm/machw.h +++ b/arch/m68k/include/asm/machw.h | |||
@@ -21,29 +21,4 @@ | |||
21 | #define VIDEOMEMSIZE (4096*1024) | 21 | #define VIDEOMEMSIZE (4096*1024) |
22 | #define VIDEOMEMMASK (-4096*1024) | 22 | #define VIDEOMEMMASK (-4096*1024) |
23 | 23 | ||
24 | #ifndef __ASSEMBLY__ | ||
25 | |||
26 | #include <linux/types.h> | ||
27 | |||
28 | #if 0 | ||
29 | /* | ||
30 | ** SCC Z8530 | ||
31 | */ | ||
32 | |||
33 | #define MAC_SCC_BAS (0x50F04000) | ||
34 | struct MAC_SCC | ||
35 | { | ||
36 | u_char cha_a_ctrl; | ||
37 | u_char char_dummy1; | ||
38 | u_char cha_a_data; | ||
39 | u_char char_dummy2; | ||
40 | u_char cha_b_ctrl; | ||
41 | u_char char_dummy3; | ||
42 | u_char cha_b_data; | ||
43 | }; | ||
44 | # define mac_scc ((*(volatile struct SCC*)MAC_SCC_BAS)) | ||
45 | #endif | ||
46 | |||
47 | #endif /* __ASSEMBLY__ */ | ||
48 | |||
49 | #endif /* linux/machw.h */ | 24 | #endif /* linux/machw.h */ |
diff --git a/arch/m68k/include/asm/macints.h b/arch/m68k/include/asm/macints.h index 679c48ab4407..ebe1b70fe90c 100644 --- a/arch/m68k/include/asm/macints.h +++ b/arch/m68k/include/asm/macints.h | |||
@@ -37,7 +37,6 @@ | |||
37 | 37 | ||
38 | #define VIA1_SOURCE_BASE 8 | 38 | #define VIA1_SOURCE_BASE 8 |
39 | #define VIA2_SOURCE_BASE 16 | 39 | #define VIA2_SOURCE_BASE 16 |
40 | #define MAC_SCC_SOURCE_BASE 24 | ||
41 | #define PSC3_SOURCE_BASE 24 | 40 | #define PSC3_SOURCE_BASE 24 |
42 | #define PSC4_SOURCE_BASE 32 | 41 | #define PSC4_SOURCE_BASE 32 |
43 | #define PSC5_SOURCE_BASE 40 | 42 | #define PSC5_SOURCE_BASE 40 |
@@ -96,26 +95,12 @@ | |||
96 | #define IRQ_PSC3_2 (26) | 95 | #define IRQ_PSC3_2 (26) |
97 | #define IRQ_PSC3_3 (27) | 96 | #define IRQ_PSC3_3 (27) |
98 | 97 | ||
99 | /* Level 4 (SCC) interrupts */ | ||
100 | #define IRQ_SCC (32) | ||
101 | #define IRQ_SCCA (33) | ||
102 | #define IRQ_SCCB (34) | ||
103 | #if 0 /* FIXME: are there multiple interrupt conditions on the SCC ?? */ | ||
104 | /* SCC interrupts */ | ||
105 | #define IRQ_SCCB_TX (32) | ||
106 | #define IRQ_SCCB_STAT (33) | ||
107 | #define IRQ_SCCB_RX (34) | ||
108 | #define IRQ_SCCB_SPCOND (35) | ||
109 | #define IRQ_SCCA_TX (36) | ||
110 | #define IRQ_SCCA_STAT (37) | ||
111 | #define IRQ_SCCA_RX (38) | ||
112 | #define IRQ_SCCA_SPCOND (39) | ||
113 | #endif | ||
114 | |||
115 | /* Level 4 (PSC, AV Macs only) interrupts */ | 98 | /* Level 4 (PSC, AV Macs only) interrupts */ |
116 | #define IRQ_PSC4_0 (32) | 99 | #define IRQ_PSC4_0 (32) |
117 | #define IRQ_PSC4_1 (33) | 100 | #define IRQ_PSC4_1 (33) |
101 | #define IRQ_MAC_SCC_A IRQ_PSC4_1 | ||
118 | #define IRQ_PSC4_2 (34) | 102 | #define IRQ_PSC4_2 (34) |
103 | #define IRQ_MAC_SCC_B IRQ_PSC4_2 | ||
119 | #define IRQ_PSC4_3 (35) | 104 | #define IRQ_PSC4_3 (35) |
120 | #define IRQ_MAC_MACE_DMA IRQ_PSC4_3 | 105 | #define IRQ_MAC_MACE_DMA IRQ_PSC4_3 |
121 | 106 | ||
@@ -146,6 +131,9 @@ | |||
146 | #define IRQ_BABOON_2 (66) | 131 | #define IRQ_BABOON_2 (66) |
147 | #define IRQ_BABOON_3 (67) | 132 | #define IRQ_BABOON_3 (67) |
148 | 133 | ||
134 | /* On non-PSC machines, the serial ports share an IRQ */ | ||
135 | #define IRQ_MAC_SCC IRQ_AUTO_4 | ||
136 | |||
149 | #define SLOT2IRQ(x) (x + 47) | 137 | #define SLOT2IRQ(x) (x + 47) |
150 | #define IRQ2SLOT(x) (x - 47) | 138 | #define IRQ2SLOT(x) (x - 47) |
151 | 139 | ||
diff --git a/arch/m68k/include/asm/mcfuart.h b/arch/m68k/include/asm/mcfuart.h index ef2293873612..01a8716c5fc5 100644 --- a/arch/m68k/include/asm/mcfuart.h +++ b/arch/m68k/include/asm/mcfuart.h | |||
@@ -212,5 +212,10 @@ struct mcf_platform_uart { | |||
212 | #define MCFUART_URF_RXS 0xc0 /* Receiver status */ | 212 | #define MCFUART_URF_RXS 0xc0 /* Receiver status */ |
213 | #endif | 213 | #endif |
214 | 214 | ||
215 | #if defined(CONFIG_M5272) | ||
216 | #define MCFUART_TXFIFOSIZE 25 | ||
217 | #else | ||
218 | #define MCFUART_TXFIFOSIZE 1 | ||
219 | #endif | ||
215 | /****************************************************************************/ | 220 | /****************************************************************************/ |
216 | #endif /* mcfuart_h */ | 221 | #endif /* mcfuart_h */ |
diff --git a/arch/m68k/include/asm/page_no.h b/arch/m68k/include/asm/page_no.h index 1f31b060cc8d..8029a33e03c3 100644 --- a/arch/m68k/include/asm/page_no.h +++ b/arch/m68k/include/asm/page_no.h | |||
@@ -56,8 +56,8 @@ extern unsigned long memory_end; | |||
56 | 56 | ||
57 | #ifndef __ASSEMBLY__ | 57 | #ifndef __ASSEMBLY__ |
58 | 58 | ||
59 | #define __pa(vaddr) virt_to_phys((void *)(vaddr)) | 59 | #define __pa(vaddr) ((unsigned long)(vaddr)) |
60 | #define __va(paddr) phys_to_virt((unsigned long)(paddr)) | 60 | #define __va(paddr) ((void *)(paddr)) |
61 | 61 | ||
62 | #define virt_to_pfn(kaddr) (__pa(kaddr) >> PAGE_SHIFT) | 62 | #define virt_to_pfn(kaddr) (__pa(kaddr) >> PAGE_SHIFT) |
63 | #define pfn_to_virt(pfn) __va((pfn) << PAGE_SHIFT) | 63 | #define pfn_to_virt(pfn) __va((pfn) << PAGE_SHIFT) |
diff --git a/arch/m68k/include/asm/pgtable_mm.h b/arch/m68k/include/asm/pgtable_mm.h index fe60e1abaee8..87174c904d2b 100644 --- a/arch/m68k/include/asm/pgtable_mm.h +++ b/arch/m68k/include/asm/pgtable_mm.h | |||
@@ -83,9 +83,9 @@ | |||
83 | #define VMALLOC_START (((unsigned long) high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1)) | 83 | #define VMALLOC_START (((unsigned long) high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1)) |
84 | #define VMALLOC_END KMAP_START | 84 | #define VMALLOC_END KMAP_START |
85 | #else | 85 | #else |
86 | extern unsigned long vmalloc_end; | 86 | extern unsigned long m68k_vmalloc_end; |
87 | #define VMALLOC_START 0x0f800000 | 87 | #define VMALLOC_START 0x0f800000 |
88 | #define VMALLOC_END vmalloc_end | 88 | #define VMALLOC_END m68k_vmalloc_end |
89 | #endif /* CONFIG_SUN3 */ | 89 | #endif /* CONFIG_SUN3 */ |
90 | 90 | ||
91 | /* zero page used for uninitialized stuff */ | 91 | /* zero page used for uninitialized stuff */ |
@@ -115,7 +115,7 @@ extern void kernel_set_cachemode(void *addr, unsigned long size, int cmode); | |||
115 | * they are updated on demand. | 115 | * they are updated on demand. |
116 | */ | 116 | */ |
117 | static inline void update_mmu_cache(struct vm_area_struct *vma, | 117 | static inline void update_mmu_cache(struct vm_area_struct *vma, |
118 | unsigned long address, pte_t pte) | 118 | unsigned long address, pte_t *ptep) |
119 | { | 119 | { |
120 | } | 120 | } |
121 | 121 | ||
diff --git a/arch/m68k/include/asm/processor.h b/arch/m68k/include/asm/processor.h index 74fd674b15ad..cbd3d4751dd2 100644 --- a/arch/m68k/include/asm/processor.h +++ b/arch/m68k/include/asm/processor.h | |||
@@ -165,6 +165,8 @@ unsigned long get_wchan(struct task_struct *p); | |||
165 | eip; }) | 165 | eip; }) |
166 | #define KSTK_ESP(tsk) ((tsk) == current ? rdusp() : (tsk)->thread.usp) | 166 | #define KSTK_ESP(tsk) ((tsk) == current ? rdusp() : (tsk)->thread.usp) |
167 | 167 | ||
168 | #define task_pt_regs(tsk) ((struct pt_regs *) ((tsk)->thread.esp0)) | ||
169 | |||
168 | #define cpu_relax() barrier() | 170 | #define cpu_relax() barrier() |
169 | 171 | ||
170 | #endif | 172 | #endif |
diff --git a/arch/m68k/include/asm/ptrace.h b/arch/m68k/include/asm/ptrace.h index 8c9194b98548..6e6e3ac1d913 100644 --- a/arch/m68k/include/asm/ptrace.h +++ b/arch/m68k/include/asm/ptrace.h | |||
@@ -71,6 +71,10 @@ struct switch_stack { | |||
71 | #define PTRACE_GETFPREGS 14 | 71 | #define PTRACE_GETFPREGS 14 |
72 | #define PTRACE_SETFPREGS 15 | 72 | #define PTRACE_SETFPREGS 15 |
73 | 73 | ||
74 | #define PTRACE_GET_THREAD_AREA 25 | ||
75 | |||
76 | #define PTRACE_SINGLEBLOCK 33 /* resume execution until next branch */ | ||
77 | |||
74 | #ifdef __KERNEL__ | 78 | #ifdef __KERNEL__ |
75 | 79 | ||
76 | #ifndef PS_S | 80 | #ifndef PS_S |
@@ -82,6 +86,13 @@ struct switch_stack { | |||
82 | #define instruction_pointer(regs) ((regs)->pc) | 86 | #define instruction_pointer(regs) ((regs)->pc) |
83 | #define profile_pc(regs) instruction_pointer(regs) | 87 | #define profile_pc(regs) instruction_pointer(regs) |
84 | extern void show_regs(struct pt_regs *); | 88 | extern void show_regs(struct pt_regs *); |
89 | |||
90 | #define arch_has_single_step() (1) | ||
91 | |||
92 | #ifdef CONFIG_MMU | ||
93 | #define arch_has_block_step() (1) | ||
94 | #endif | ||
95 | |||
85 | #endif /* __KERNEL__ */ | 96 | #endif /* __KERNEL__ */ |
86 | #endif /* __ASSEMBLY__ */ | 97 | #endif /* __ASSEMBLY__ */ |
87 | #endif /* _M68K_PTRACE_H */ | 98 | #endif /* _M68K_PTRACE_H */ |
diff --git a/arch/m68k/include/asm/sigcontext.h b/arch/m68k/include/asm/sigcontext.h index 523db2a51cf3..a29dd74a17cb 100644 --- a/arch/m68k/include/asm/sigcontext.h +++ b/arch/m68k/include/asm/sigcontext.h | |||
@@ -15,7 +15,11 @@ struct sigcontext { | |||
15 | unsigned long sc_pc; | 15 | unsigned long sc_pc; |
16 | unsigned short sc_formatvec; | 16 | unsigned short sc_formatvec; |
17 | #ifndef __uClinux__ | 17 | #ifndef __uClinux__ |
18 | # ifdef __mcoldfire__ | ||
19 | unsigned long sc_fpregs[2][2]; /* room for two fp registers */ | ||
20 | # else | ||
18 | unsigned long sc_fpregs[2*3]; /* room for two fp registers */ | 21 | unsigned long sc_fpregs[2*3]; /* room for two fp registers */ |
22 | # endif | ||
19 | unsigned long sc_fpcntl[3]; | 23 | unsigned long sc_fpcntl[3]; |
20 | unsigned char sc_fpstate[216]; | 24 | unsigned char sc_fpstate[216]; |
21 | #endif | 25 | #endif |
diff --git a/arch/m68k/include/asm/siginfo.h b/arch/m68k/include/asm/siginfo.h index ca7dde8fd223..851d3d784b53 100644 --- a/arch/m68k/include/asm/siginfo.h +++ b/arch/m68k/include/asm/siginfo.h | |||
@@ -1,97 +1,6 @@ | |||
1 | #ifndef _M68K_SIGINFO_H | 1 | #ifndef _M68K_SIGINFO_H |
2 | #define _M68K_SIGINFO_H | 2 | #define _M68K_SIGINFO_H |
3 | 3 | ||
4 | #ifndef __uClinux__ | ||
5 | #define HAVE_ARCH_SIGINFO_T | ||
6 | #define HAVE_ARCH_COPY_SIGINFO | ||
7 | #endif | ||
8 | |||
9 | #include <asm-generic/siginfo.h> | 4 | #include <asm-generic/siginfo.h> |
10 | 5 | ||
11 | #ifndef __uClinux__ | ||
12 | |||
13 | typedef struct siginfo { | ||
14 | int si_signo; | ||
15 | int si_errno; | ||
16 | int si_code; | ||
17 | |||
18 | union { | ||
19 | int _pad[SI_PAD_SIZE]; | ||
20 | |||
21 | /* kill() */ | ||
22 | struct { | ||
23 | __kernel_pid_t _pid; /* sender's pid */ | ||
24 | __kernel_uid_t _uid; /* backwards compatibility */ | ||
25 | __kernel_uid32_t _uid32; /* sender's uid */ | ||
26 | } _kill; | ||
27 | |||
28 | /* POSIX.1b timers */ | ||
29 | struct { | ||
30 | timer_t _tid; /* timer id */ | ||
31 | int _overrun; /* overrun count */ | ||
32 | char _pad[sizeof( __ARCH_SI_UID_T) - sizeof(int)]; | ||
33 | sigval_t _sigval; /* same as below */ | ||
34 | int _sys_private; /* not to be passed to user */ | ||
35 | } _timer; | ||
36 | |||
37 | /* POSIX.1b signals */ | ||
38 | struct { | ||
39 | __kernel_pid_t _pid; /* sender's pid */ | ||
40 | __kernel_uid_t _uid; /* backwards compatibility */ | ||
41 | sigval_t _sigval; | ||
42 | __kernel_uid32_t _uid32; /* sender's uid */ | ||
43 | } _rt; | ||
44 | |||
45 | /* SIGCHLD */ | ||
46 | struct { | ||
47 | __kernel_pid_t _pid; /* which child */ | ||
48 | __kernel_uid_t _uid; /* backwards compatibility */ | ||
49 | int _status; /* exit code */ | ||
50 | clock_t _utime; | ||
51 | clock_t _stime; | ||
52 | __kernel_uid32_t _uid32; /* sender's uid */ | ||
53 | } _sigchld; | ||
54 | |||
55 | /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */ | ||
56 | struct { | ||
57 | void *_addr; /* faulting insn/memory ref. */ | ||
58 | } _sigfault; | ||
59 | |||
60 | /* SIGPOLL */ | ||
61 | struct { | ||
62 | int _band; /* POLL_IN, POLL_OUT, POLL_MSG */ | ||
63 | int _fd; | ||
64 | } _sigpoll; | ||
65 | } _sifields; | ||
66 | } siginfo_t; | ||
67 | |||
68 | #define UID16_SIGINFO_COMPAT_NEEDED | ||
69 | |||
70 | /* | ||
71 | * How these fields are to be accessed. | ||
72 | */ | ||
73 | #undef si_uid | ||
74 | #ifdef __KERNEL__ | ||
75 | #define si_uid _sifields._kill._uid32 | ||
76 | #define si_uid16 _sifields._kill._uid | ||
77 | #else | ||
78 | #define si_uid _sifields._kill._uid | ||
79 | #endif | ||
80 | |||
81 | #ifdef __KERNEL__ | ||
82 | |||
83 | #include <linux/string.h> | ||
84 | |||
85 | static inline void copy_siginfo(struct siginfo *to, struct siginfo *from) | ||
86 | { | ||
87 | if (from->si_code < 0) | ||
88 | memcpy(to, from, sizeof(*to)); | ||
89 | else | ||
90 | /* _sigchld is currently the largest know union member */ | ||
91 | memcpy(to, from, 3*sizeof(int) + sizeof(from->_sifields._sigchld)); | ||
92 | } | ||
93 | |||
94 | #endif /* __KERNEL__ */ | ||
95 | #endif /* !__uClinux__ */ | ||
96 | |||
97 | #endif | 6 | #endif |
diff --git a/arch/m68k/include/asm/socket.h b/arch/m68k/include/asm/socket.h index eee01cce921b..9bf49c87d954 100644 --- a/arch/m68k/include/asm/socket.h +++ b/arch/m68k/include/asm/socket.h | |||
@@ -60,4 +60,6 @@ | |||
60 | #define SO_PROTOCOL 38 | 60 | #define SO_PROTOCOL 38 |
61 | #define SO_DOMAIN 39 | 61 | #define SO_DOMAIN 39 |
62 | 62 | ||
63 | #define SO_RXQ_OVFL 40 | ||
64 | |||
63 | #endif /* _ASM_SOCKET_H */ | 65 | #endif /* _ASM_SOCKET_H */ |
diff --git a/arch/m68k/include/asm/swab.h b/arch/m68k/include/asm/swab.h index 5b754aace744..b7b37a40defc 100644 --- a/arch/m68k/include/asm/swab.h +++ b/arch/m68k/include/asm/swab.h | |||
@@ -14,7 +14,7 @@ static inline __attribute_const__ __u32 __arch_swab32(__u32 val) | |||
14 | } | 14 | } |
15 | 15 | ||
16 | #define __arch_swab32 __arch_swab32 | 16 | #define __arch_swab32 __arch_swab32 |
17 | #elif !defined(__uClinux__) | 17 | #elif !defined(__mcoldfire__) |
18 | 18 | ||
19 | static inline __attribute_const__ __u32 __arch_swab32(__u32 val) | 19 | static inline __attribute_const__ __u32 __arch_swab32(__u32 val) |
20 | { | 20 | { |
diff --git a/arch/m68k/include/asm/thread_info_mm.h b/arch/m68k/include/asm/thread_info_mm.h index b6da3882be9b..67266c683453 100644 --- a/arch/m68k/include/asm/thread_info_mm.h +++ b/arch/m68k/include/asm/thread_info_mm.h | |||
@@ -4,18 +4,22 @@ | |||
4 | #ifndef ASM_OFFSETS_C | 4 | #ifndef ASM_OFFSETS_C |
5 | #include <asm/asm-offsets.h> | 5 | #include <asm/asm-offsets.h> |
6 | #endif | 6 | #endif |
7 | #include <asm/current.h> | ||
8 | #include <asm/types.h> | 7 | #include <asm/types.h> |
9 | #include <asm/page.h> | 8 | #include <asm/page.h> |
10 | 9 | ||
10 | #ifndef __ASSEMBLY__ | ||
11 | #include <asm/current.h> | ||
12 | |||
11 | struct thread_info { | 13 | struct thread_info { |
12 | struct task_struct *task; /* main task structure */ | 14 | struct task_struct *task; /* main task structure */ |
13 | unsigned long flags; | 15 | unsigned long flags; |
14 | struct exec_domain *exec_domain; /* execution domain */ | 16 | struct exec_domain *exec_domain; /* execution domain */ |
15 | int preempt_count; /* 0 => preemptable, <0 => BUG */ | 17 | int preempt_count; /* 0 => preemptable, <0 => BUG */ |
16 | __u32 cpu; /* should always be 0 on m68k */ | 18 | __u32 cpu; /* should always be 0 on m68k */ |
19 | unsigned long tp_value; /* thread pointer */ | ||
17 | struct restart_block restart_block; | 20 | struct restart_block restart_block; |
18 | }; | 21 | }; |
22 | #endif /* __ASSEMBLY__ */ | ||
19 | 23 | ||
20 | #define PREEMPT_ACTIVE 0x4000000 | 24 | #define PREEMPT_ACTIVE 0x4000000 |
21 | 25 | ||
diff --git a/arch/m68k/include/asm/thread_info_no.h b/arch/m68k/include/asm/thread_info_no.h index c2bde5e24b0b..884776f686ca 100644 --- a/arch/m68k/include/asm/thread_info_no.h +++ b/arch/m68k/include/asm/thread_info_no.h | |||
@@ -12,8 +12,6 @@ | |||
12 | 12 | ||
13 | #ifdef __KERNEL__ | 13 | #ifdef __KERNEL__ |
14 | 14 | ||
15 | #ifndef __ASSEMBLY__ | ||
16 | |||
17 | /* | 15 | /* |
18 | * Size of kernel stack for each process. This must be a power of 2... | 16 | * Size of kernel stack for each process. This must be a power of 2... |
19 | */ | 17 | */ |
@@ -28,6 +26,8 @@ | |||
28 | */ | 26 | */ |
29 | #define THREAD_SIZE (PAGE_SIZE<<THREAD_SIZE_ORDER) | 27 | #define THREAD_SIZE (PAGE_SIZE<<THREAD_SIZE_ORDER) |
30 | 28 | ||
29 | #ifndef __ASSEMBLY__ | ||
30 | |||
31 | /* | 31 | /* |
32 | * low level task data. | 32 | * low level task data. |
33 | */ | 33 | */ |
@@ -37,6 +37,7 @@ struct thread_info { | |||
37 | unsigned long flags; /* low level flags */ | 37 | unsigned long flags; /* low level flags */ |
38 | int cpu; /* cpu we're on */ | 38 | int cpu; /* cpu we're on */ |
39 | int preempt_count; /* 0 => preemptable, <0 => BUG */ | 39 | int preempt_count; /* 0 => preemptable, <0 => BUG */ |
40 | unsigned long tp_value; /* thread pointer */ | ||
40 | struct restart_block restart_block; | 41 | struct restart_block restart_block; |
41 | }; | 42 | }; |
42 | 43 | ||
diff --git a/arch/m68k/include/asm/ucontext.h b/arch/m68k/include/asm/ucontext.h index e4e22669edc0..00dcc5176c57 100644 --- a/arch/m68k/include/asm/ucontext.h +++ b/arch/m68k/include/asm/ucontext.h | |||
@@ -7,7 +7,11 @@ typedef greg_t gregset_t[NGREG]; | |||
7 | 7 | ||
8 | typedef struct fpregset { | 8 | typedef struct fpregset { |
9 | int f_fpcntl[3]; | 9 | int f_fpcntl[3]; |
10 | #ifdef __mcoldfire__ | ||
11 | int f_fpregs[8][2]; | ||
12 | #else | ||
10 | int f_fpregs[8*3]; | 13 | int f_fpregs[8*3]; |
14 | #endif | ||
11 | } fpregset_t; | 15 | } fpregset_t; |
12 | 16 | ||
13 | struct mcontext { | 17 | struct mcontext { |
diff --git a/arch/m68k/include/asm/unistd.h b/arch/m68k/include/asm/unistd.h index 48b87f5ced50..60b15d0aa072 100644 --- a/arch/m68k/include/asm/unistd.h +++ b/arch/m68k/include/asm/unistd.h | |||
@@ -336,10 +336,14 @@ | |||
336 | #define __NR_pwritev 330 | 336 | #define __NR_pwritev 330 |
337 | #define __NR_rt_tgsigqueueinfo 331 | 337 | #define __NR_rt_tgsigqueueinfo 331 |
338 | #define __NR_perf_event_open 332 | 338 | #define __NR_perf_event_open 332 |
339 | #define __NR_get_thread_area 333 | ||
340 | #define __NR_set_thread_area 334 | ||
341 | #define __NR_atomic_cmpxchg_32 335 | ||
342 | #define __NR_atomic_barrier 336 | ||
339 | 343 | ||
340 | #ifdef __KERNEL__ | 344 | #ifdef __KERNEL__ |
341 | 345 | ||
342 | #define NR_syscalls 333 | 346 | #define NR_syscalls 337 |
343 | 347 | ||
344 | #define __ARCH_WANT_IPC_PARSE_VERSION | 348 | #define __ARCH_WANT_IPC_PARSE_VERSION |
345 | #define __ARCH_WANT_OLD_READDIR | 349 | #define __ARCH_WANT_OLD_READDIR |
@@ -347,6 +351,7 @@ | |||
347 | #define __ARCH_WANT_STAT64 | 351 | #define __ARCH_WANT_STAT64 |
348 | #define __ARCH_WANT_SYS_ALARM | 352 | #define __ARCH_WANT_SYS_ALARM |
349 | #define __ARCH_WANT_SYS_GETHOSTNAME | 353 | #define __ARCH_WANT_SYS_GETHOSTNAME |
354 | #define __ARCH_WANT_SYS_IPC | ||
350 | #define __ARCH_WANT_SYS_PAUSE | 355 | #define __ARCH_WANT_SYS_PAUSE |
351 | #define __ARCH_WANT_SYS_SGETMASK | 356 | #define __ARCH_WANT_SYS_SGETMASK |
352 | #define __ARCH_WANT_SYS_SIGNAL | 357 | #define __ARCH_WANT_SYS_SIGNAL |
@@ -359,6 +364,8 @@ | |||
359 | #define __ARCH_WANT_SYS_LLSEEK | 364 | #define __ARCH_WANT_SYS_LLSEEK |
360 | #define __ARCH_WANT_SYS_NICE | 365 | #define __ARCH_WANT_SYS_NICE |
361 | #define __ARCH_WANT_SYS_OLD_GETRLIMIT | 366 | #define __ARCH_WANT_SYS_OLD_GETRLIMIT |
367 | #define __ARCH_WANT_SYS_OLD_MMAP | ||
368 | #define __ARCH_WANT_SYS_OLD_SELECT | ||
362 | #define __ARCH_WANT_SYS_OLDUMOUNT | 369 | #define __ARCH_WANT_SYS_OLDUMOUNT |
363 | #define __ARCH_WANT_SYS_SIGPENDING | 370 | #define __ARCH_WANT_SYS_SIGPENDING |
364 | #define __ARCH_WANT_SYS_SIGPROCMASK | 371 | #define __ARCH_WANT_SYS_SIGPROCMASK |
diff --git a/arch/m68k/include/asm/virtconvert.h b/arch/m68k/include/asm/virtconvert.h index 22ab05c9c52b..f35229b8651d 100644 --- a/arch/m68k/include/asm/virtconvert.h +++ b/arch/m68k/include/asm/virtconvert.h | |||
@@ -26,16 +26,15 @@ static inline void *phys_to_virt(unsigned long address) | |||
26 | } | 26 | } |
27 | 27 | ||
28 | /* Permanent address of a page. */ | 28 | /* Permanent address of a page. */ |
29 | #ifdef CONFIG_MMU | ||
29 | #ifdef CONFIG_SINGLE_MEMORY_CHUNK | 30 | #ifdef CONFIG_SINGLE_MEMORY_CHUNK |
30 | #define page_to_phys(page) \ | 31 | #define page_to_phys(page) \ |
31 | __pa(PAGE_OFFSET + (((page) - pg_data_map[0].node_mem_map) << PAGE_SHIFT)) | 32 | __pa(PAGE_OFFSET + (((page) - pg_data_map[0].node_mem_map) << PAGE_SHIFT)) |
32 | #else | 33 | #else |
33 | #define page_to_phys(_page) ({ \ | 34 | #define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT) |
34 | struct page *__page = _page; \ | 35 | #endif |
35 | struct pglist_data *pgdat; \ | 36 | #else |
36 | pgdat = pg_data_table[page_to_nid(__page)]; \ | 37 | #define page_to_phys(page) (((page) - mem_map) << PAGE_SHIFT) |
37 | page_to_pfn(__page) << PAGE_SHIFT; \ | ||
38 | }) | ||
39 | #endif | 38 | #endif |
40 | 39 | ||
41 | /* | 40 | /* |
diff --git a/arch/m68k/kernel/dma.c b/arch/m68k/kernel/dma.c index 2bb4245404d8..4bbb3c2a8880 100644 --- a/arch/m68k/kernel/dma.c +++ b/arch/m68k/kernel/dma.c | |||
@@ -10,6 +10,7 @@ | |||
10 | #include <linux/device.h> | 10 | #include <linux/device.h> |
11 | #include <linux/kernel.h> | 11 | #include <linux/kernel.h> |
12 | #include <linux/scatterlist.h> | 12 | #include <linux/scatterlist.h> |
13 | #include <linux/slab.h> | ||
13 | #include <linux/vmalloc.h> | 14 | #include <linux/vmalloc.h> |
14 | 15 | ||
15 | #include <asm/pgalloc.h> | 16 | #include <asm/pgalloc.h> |
diff --git a/arch/m68k/kernel/entry.S b/arch/m68k/kernel/entry.S index c5b33634c980..2391bdff0996 100644 --- a/arch/m68k/kernel/entry.S +++ b/arch/m68k/kernel/entry.S | |||
@@ -179,7 +179,11 @@ do_signal_return: | |||
179 | addql #8,%sp | 179 | addql #8,%sp |
180 | RESTORE_SWITCH_STACK | 180 | RESTORE_SWITCH_STACK |
181 | addql #4,%sp | 181 | addql #4,%sp |
182 | jbra resume_userspace | 182 | tstl %d0 |
183 | jeq resume_userspace | ||
184 | | when single stepping into handler stop at the first insn | ||
185 | btst #6,%curptr@(TASK_INFO+TINFO_FLAGS+2) | ||
186 | jeq resume_userspace | ||
183 | 187 | ||
184 | do_delayed_trace: | 188 | do_delayed_trace: |
185 | bclr #7,%sp@(PT_OFF_SR) | clear trace bit in SR | 189 | bclr #7,%sp@(PT_OFF_SR) | clear trace bit in SR |
@@ -506,7 +510,7 @@ sys_call_table: | |||
506 | .long sys_settimeofday | 510 | .long sys_settimeofday |
507 | .long sys_getgroups16 /* 80 */ | 511 | .long sys_getgroups16 /* 80 */ |
508 | .long sys_setgroups16 | 512 | .long sys_setgroups16 |
509 | .long old_select | 513 | .long sys_old_select |
510 | .long sys_symlink | 514 | .long sys_symlink |
511 | .long sys_lstat | 515 | .long sys_lstat |
512 | .long sys_readlink /* 85 */ | 516 | .long sys_readlink /* 85 */ |
@@ -514,7 +518,7 @@ sys_call_table: | |||
514 | .long sys_swapon | 518 | .long sys_swapon |
515 | .long sys_reboot | 519 | .long sys_reboot |
516 | .long sys_old_readdir | 520 | .long sys_old_readdir |
517 | .long old_mmap /* 90 */ | 521 | .long sys_old_mmap /* 90 */ |
518 | .long sys_munmap | 522 | .long sys_munmap |
519 | .long sys_truncate | 523 | .long sys_truncate |
520 | .long sys_ftruncate | 524 | .long sys_ftruncate |
@@ -757,4 +761,8 @@ sys_call_table: | |||
757 | .long sys_pwritev /* 330 */ | 761 | .long sys_pwritev /* 330 */ |
758 | .long sys_rt_tgsigqueueinfo | 762 | .long sys_rt_tgsigqueueinfo |
759 | .long sys_perf_event_open | 763 | .long sys_perf_event_open |
764 | .long sys_get_thread_area | ||
765 | .long sys_set_thread_area | ||
766 | .long sys_atomic_cmpxchg_32 /* 335 */ | ||
767 | .long sys_atomic_barrier | ||
760 | 768 | ||
diff --git a/arch/m68k/kernel/head.S b/arch/m68k/kernel/head.S index 86edb5fbcfc3..ef54128baa0b 100644 --- a/arch/m68k/kernel/head.S +++ b/arch/m68k/kernel/head.S | |||
@@ -196,7 +196,7 @@ | |||
196 | * for them and trying to understand what they mean. | 196 | * for them and trying to understand what they mean. |
197 | * | 197 | * |
198 | * CONFIG_xxx: These are the obvious machine configuration defines created | 198 | * CONFIG_xxx: These are the obvious machine configuration defines created |
199 | * during configuration. These are defined in include/linux/autoconf.h. | 199 | * during configuration. These are defined in autoconf.h. |
200 | * | 200 | * |
201 | * CONSOLE: There is support for head.S console in this file. This | 201 | * CONSOLE: There is support for head.S console in this file. This |
202 | * console can talk to a Mac frame buffer, but could easily be extrapolated | 202 | * console can talk to a Mac frame buffer, but could easily be extrapolated |
diff --git a/arch/m68k/kernel/process.c b/arch/m68k/kernel/process.c index 41230c595a8e..1a6be27cf165 100644 --- a/arch/m68k/kernel/process.c +++ b/arch/m68k/kernel/process.c | |||
@@ -15,13 +15,13 @@ | |||
15 | #include <linux/sched.h> | 15 | #include <linux/sched.h> |
16 | #include <linux/kernel.h> | 16 | #include <linux/kernel.h> |
17 | #include <linux/mm.h> | 17 | #include <linux/mm.h> |
18 | #include <linux/slab.h> | ||
18 | #include <linux/fs.h> | 19 | #include <linux/fs.h> |
19 | #include <linux/smp.h> | 20 | #include <linux/smp.h> |
20 | #include <linux/smp_lock.h> | 21 | #include <linux/smp_lock.h> |
21 | #include <linux/stddef.h> | 22 | #include <linux/stddef.h> |
22 | #include <linux/unistd.h> | 23 | #include <linux/unistd.h> |
23 | #include <linux/ptrace.h> | 24 | #include <linux/ptrace.h> |
24 | #include <linux/slab.h> | ||
25 | #include <linux/user.h> | 25 | #include <linux/user.h> |
26 | #include <linux/reboot.h> | 26 | #include <linux/reboot.h> |
27 | #include <linux/init_task.h> | 27 | #include <linux/init_task.h> |
@@ -251,6 +251,10 @@ int copy_thread(unsigned long clone_flags, unsigned long usp, | |||
251 | 251 | ||
252 | p->thread.usp = usp; | 252 | p->thread.usp = usp; |
253 | p->thread.ksp = (unsigned long)childstack; | 253 | p->thread.ksp = (unsigned long)childstack; |
254 | |||
255 | if (clone_flags & CLONE_SETTLS) | ||
256 | task_thread_info(p)->tp_value = regs->d5; | ||
257 | |||
254 | /* | 258 | /* |
255 | * Must save the current SFC/DFC value, NOT the value when | 259 | * Must save the current SFC/DFC value, NOT the value when |
256 | * the parent was last descheduled - RGH 10-08-96 | 260 | * the parent was last descheduled - RGH 10-08-96 |
@@ -317,15 +321,12 @@ asmlinkage int sys_execve(char __user *name, char __user * __user *argv, char __ | |||
317 | char * filename; | 321 | char * filename; |
318 | struct pt_regs *regs = (struct pt_regs *) &name; | 322 | struct pt_regs *regs = (struct pt_regs *) &name; |
319 | 323 | ||
320 | lock_kernel(); | ||
321 | filename = getname(name); | 324 | filename = getname(name); |
322 | error = PTR_ERR(filename); | 325 | error = PTR_ERR(filename); |
323 | if (IS_ERR(filename)) | 326 | if (IS_ERR(filename)) |
324 | goto out; | 327 | return error; |
325 | error = do_execve(filename, argv, envp, regs); | 328 | error = do_execve(filename, argv, envp, regs); |
326 | putname(filename); | 329 | putname(filename); |
327 | out: | ||
328 | unlock_kernel(); | ||
329 | return error; | 330 | return error; |
330 | } | 331 | } |
331 | 332 | ||
diff --git a/arch/m68k/kernel/ptrace.c b/arch/m68k/kernel/ptrace.c index 2075543c2d92..616e59752c29 100644 --- a/arch/m68k/kernel/ptrace.c +++ b/arch/m68k/kernel/ptrace.c | |||
@@ -35,7 +35,9 @@ | |||
35 | #define SR_MASK 0x001f | 35 | #define SR_MASK 0x001f |
36 | 36 | ||
37 | /* sets the trace bits. */ | 37 | /* sets the trace bits. */ |
38 | #define TRACE_BITS 0x8000 | 38 | #define TRACE_BITS 0xC000 |
39 | #define T1_BIT 0x8000 | ||
40 | #define T0_BIT 0x4000 | ||
39 | 41 | ||
40 | /* Find the stack offset for a register, relative to thread.esp0. */ | 42 | /* Find the stack offset for a register, relative to thread.esp0. */ |
41 | #define PT_REG(reg) ((long)&((struct pt_regs *)0)->reg) | 43 | #define PT_REG(reg) ((long)&((struct pt_regs *)0)->reg) |
@@ -44,7 +46,7 @@ | |||
44 | /* Mapping from PT_xxx to the stack offset at which the register is | 46 | /* Mapping from PT_xxx to the stack offset at which the register is |
45 | saved. Notice that usp has no stack-slot and needs to be treated | 47 | saved. Notice that usp has no stack-slot and needs to be treated |
46 | specially (see get_reg/put_reg below). */ | 48 | specially (see get_reg/put_reg below). */ |
47 | static int regoff[] = { | 49 | static const int regoff[] = { |
48 | [0] = PT_REG(d1), | 50 | [0] = PT_REG(d1), |
49 | [1] = PT_REG(d2), | 51 | [1] = PT_REG(d2), |
50 | [2] = PT_REG(d3), | 52 | [2] = PT_REG(d3), |
@@ -79,6 +81,14 @@ static inline long get_reg(struct task_struct *task, int regno) | |||
79 | addr = (unsigned long *)(task->thread.esp0 + regoff[regno]); | 81 | addr = (unsigned long *)(task->thread.esp0 + regoff[regno]); |
80 | else | 82 | else |
81 | return 0; | 83 | return 0; |
84 | /* Need to take stkadj into account. */ | ||
85 | if (regno == PT_SR || regno == PT_PC) { | ||
86 | long stkadj = *(long *)(task->thread.esp0 + PT_REG(stkadj)); | ||
87 | addr = (unsigned long *) ((unsigned long)addr + stkadj); | ||
88 | /* The sr is actually a 16 bit register. */ | ||
89 | if (regno == PT_SR) | ||
90 | return *(unsigned short *)addr; | ||
91 | } | ||
82 | return *addr; | 92 | return *addr; |
83 | } | 93 | } |
84 | 94 | ||
@@ -96,6 +106,16 @@ static inline int put_reg(struct task_struct *task, int regno, | |||
96 | addr = (unsigned long *)(task->thread.esp0 + regoff[regno]); | 106 | addr = (unsigned long *)(task->thread.esp0 + regoff[regno]); |
97 | else | 107 | else |
98 | return -1; | 108 | return -1; |
109 | /* Need to take stkadj into account. */ | ||
110 | if (regno == PT_SR || regno == PT_PC) { | ||
111 | long stkadj = *(long *)(task->thread.esp0 + PT_REG(stkadj)); | ||
112 | addr = (unsigned long *) ((unsigned long)addr + stkadj); | ||
113 | /* The sr is actually a 16 bit register. */ | ||
114 | if (regno == PT_SR) { | ||
115 | *(unsigned short *)addr = data; | ||
116 | return 0; | ||
117 | } | ||
118 | } | ||
99 | *addr = data; | 119 | *addr = data; |
100 | return 0; | 120 | return 0; |
101 | } | 121 | } |
@@ -105,7 +125,7 @@ static inline int put_reg(struct task_struct *task, int regno, | |||
105 | */ | 125 | */ |
106 | static inline void singlestep_disable(struct task_struct *child) | 126 | static inline void singlestep_disable(struct task_struct *child) |
107 | { | 127 | { |
108 | unsigned long tmp = get_reg(child, PT_SR) & ~(TRACE_BITS << 16); | 128 | unsigned long tmp = get_reg(child, PT_SR) & ~TRACE_BITS; |
109 | put_reg(child, PT_SR, tmp); | 129 | put_reg(child, PT_SR, tmp); |
110 | clear_tsk_thread_flag(child, TIF_DELAYED_TRACE); | 130 | clear_tsk_thread_flag(child, TIF_DELAYED_TRACE); |
111 | } | 131 | } |
@@ -118,18 +138,30 @@ void ptrace_disable(struct task_struct *child) | |||
118 | singlestep_disable(child); | 138 | singlestep_disable(child); |
119 | } | 139 | } |
120 | 140 | ||
141 | void user_enable_single_step(struct task_struct *child) | ||
142 | { | ||
143 | unsigned long tmp = get_reg(child, PT_SR) & ~TRACE_BITS; | ||
144 | put_reg(child, PT_SR, tmp | T1_BIT); | ||
145 | set_tsk_thread_flag(child, TIF_DELAYED_TRACE); | ||
146 | } | ||
147 | |||
148 | void user_enable_block_step(struct task_struct *child) | ||
149 | { | ||
150 | unsigned long tmp = get_reg(child, PT_SR) & ~TRACE_BITS; | ||
151 | put_reg(child, PT_SR, tmp | T0_BIT); | ||
152 | } | ||
153 | |||
154 | void user_disable_single_step(struct task_struct *child) | ||
155 | { | ||
156 | singlestep_disable(child); | ||
157 | } | ||
158 | |||
121 | long arch_ptrace(struct task_struct *child, long request, long addr, long data) | 159 | long arch_ptrace(struct task_struct *child, long request, long addr, long data) |
122 | { | 160 | { |
123 | unsigned long tmp; | 161 | unsigned long tmp; |
124 | int i, ret = 0; | 162 | int i, ret = 0; |
125 | 163 | ||
126 | switch (request) { | 164 | switch (request) { |
127 | /* when I and D space are separate, these will need to be fixed. */ | ||
128 | case PTRACE_PEEKTEXT: /* read word at location addr. */ | ||
129 | case PTRACE_PEEKDATA: | ||
130 | ret = generic_ptrace_peekdata(child, addr, data); | ||
131 | break; | ||
132 | |||
133 | /* read the word at location addr in the USER area. */ | 165 | /* read the word at location addr in the USER area. */ |
134 | case PTRACE_PEEKUSR: | 166 | case PTRACE_PEEKUSR: |
135 | if (addr & 3) | 167 | if (addr & 3) |
@@ -138,8 +170,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
138 | 170 | ||
139 | if (addr >= 0 && addr < 19) { | 171 | if (addr >= 0 && addr < 19) { |
140 | tmp = get_reg(child, addr); | 172 | tmp = get_reg(child, addr); |
141 | if (addr == PT_SR) | ||
142 | tmp >>= 16; | ||
143 | } else if (addr >= 21 && addr < 49) { | 173 | } else if (addr >= 21 && addr < 49) { |
144 | tmp = child->thread.fp[addr - 21]; | 174 | tmp = child->thread.fp[addr - 21]; |
145 | /* Convert internal fpu reg representation | 175 | /* Convert internal fpu reg representation |
@@ -149,16 +179,10 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
149 | tmp = ((tmp & 0xffff0000) << 15) | | 179 | tmp = ((tmp & 0xffff0000) << 15) | |
150 | ((tmp & 0x0000ffff) << 16); | 180 | ((tmp & 0x0000ffff) << 16); |
151 | } else | 181 | } else |
152 | break; | 182 | goto out_eio; |
153 | ret = put_user(tmp, (unsigned long *)data); | 183 | ret = put_user(tmp, (unsigned long *)data); |
154 | break; | 184 | break; |
155 | 185 | ||
156 | /* when I and D space are separate, this will have to be fixed. */ | ||
157 | case PTRACE_POKETEXT: /* write the word at location addr. */ | ||
158 | case PTRACE_POKEDATA: | ||
159 | ret = generic_ptrace_pokedata(child, addr, data); | ||
160 | break; | ||
161 | |||
162 | case PTRACE_POKEUSR: /* write the word at location addr in the USER area */ | 186 | case PTRACE_POKEUSR: /* write the word at location addr in the USER area */ |
163 | if (addr & 3) | 187 | if (addr & 3) |
164 | goto out_eio; | 188 | goto out_eio; |
@@ -166,9 +190,9 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
166 | 190 | ||
167 | if (addr == PT_SR) { | 191 | if (addr == PT_SR) { |
168 | data &= SR_MASK; | 192 | data &= SR_MASK; |
169 | data <<= 16; | 193 | data |= get_reg(child, PT_SR) & ~SR_MASK; |
170 | data |= get_reg(child, PT_SR) & ~(SR_MASK << 16); | 194 | } |
171 | } else if (addr >= 0 && addr < 19) { | 195 | if (addr >= 0 && addr < 19) { |
172 | if (put_reg(child, addr, data)) | 196 | if (put_reg(child, addr, data)) |
173 | goto out_eio; | 197 | goto out_eio; |
174 | } else if (addr >= 21 && addr < 48) { | 198 | } else if (addr >= 21 && addr < 48) { |
@@ -185,52 +209,9 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
185 | goto out_eio; | 209 | goto out_eio; |
186 | break; | 210 | break; |
187 | 211 | ||
188 | case PTRACE_SYSCALL: /* continue and stop at next (return from) syscall */ | ||
189 | case PTRACE_CONT: /* restart after signal. */ | ||
190 | if (!valid_signal(data)) | ||
191 | goto out_eio; | ||
192 | |||
193 | if (request == PTRACE_SYSCALL) | ||
194 | set_tsk_thread_flag(child, TIF_SYSCALL_TRACE); | ||
195 | else | ||
196 | clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); | ||
197 | child->exit_code = data; | ||
198 | singlestep_disable(child); | ||
199 | wake_up_process(child); | ||
200 | break; | ||
201 | |||
202 | /* | ||
203 | * make the child exit. Best I can do is send it a sigkill. | ||
204 | * perhaps it should be put in the status that it wants to | ||
205 | * exit. | ||
206 | */ | ||
207 | case PTRACE_KILL: | ||
208 | if (child->exit_state == EXIT_ZOMBIE) /* already dead */ | ||
209 | break; | ||
210 | child->exit_code = SIGKILL; | ||
211 | singlestep_disable(child); | ||
212 | wake_up_process(child); | ||
213 | break; | ||
214 | |||
215 | case PTRACE_SINGLESTEP: /* set the trap flag. */ | ||
216 | if (!valid_signal(data)) | ||
217 | goto out_eio; | ||
218 | |||
219 | clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); | ||
220 | tmp = get_reg(child, PT_SR) | (TRACE_BITS << 16); | ||
221 | put_reg(child, PT_SR, tmp); | ||
222 | set_tsk_thread_flag(child, TIF_DELAYED_TRACE); | ||
223 | |||
224 | child->exit_code = data; | ||
225 | /* give it a chance to run. */ | ||
226 | wake_up_process(child); | ||
227 | break; | ||
228 | |||
229 | case PTRACE_GETREGS: /* Get all gp regs from the child. */ | 212 | case PTRACE_GETREGS: /* Get all gp regs from the child. */ |
230 | for (i = 0; i < 19; i++) { | 213 | for (i = 0; i < 19; i++) { |
231 | tmp = get_reg(child, i); | 214 | tmp = get_reg(child, i); |
232 | if (i == PT_SR) | ||
233 | tmp >>= 16; | ||
234 | ret = put_user(tmp, (unsigned long *)data); | 215 | ret = put_user(tmp, (unsigned long *)data); |
235 | if (ret) | 216 | if (ret) |
236 | break; | 217 | break; |
@@ -245,8 +226,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
245 | break; | 226 | break; |
246 | if (i == PT_SR) { | 227 | if (i == PT_SR) { |
247 | tmp &= SR_MASK; | 228 | tmp &= SR_MASK; |
248 | tmp <<= 16; | 229 | tmp |= get_reg(child, PT_SR) & ~SR_MASK; |
249 | tmp |= get_reg(child, PT_SR) & ~(SR_MASK << 16); | ||
250 | } | 230 | } |
251 | put_reg(child, i, tmp); | 231 | put_reg(child, i, tmp); |
252 | data += sizeof(long); | 232 | data += sizeof(long); |
@@ -265,6 +245,11 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
265 | ret = -EFAULT; | 245 | ret = -EFAULT; |
266 | break; | 246 | break; |
267 | 247 | ||
248 | case PTRACE_GET_THREAD_AREA: | ||
249 | ret = put_user(task_thread_info(child)->tp_value, | ||
250 | (unsigned long __user *)data); | ||
251 | break; | ||
252 | |||
268 | default: | 253 | default: |
269 | ret = ptrace_request(child, request, addr, data); | 254 | ret = ptrace_request(child, request, addr, data); |
270 | break; | 255 | break; |
diff --git a/arch/m68k/kernel/signal.c b/arch/m68k/kernel/signal.c index de2d05ddd86d..4b387538706f 100644 --- a/arch/m68k/kernel/signal.c +++ b/arch/m68k/kernel/signal.c | |||
@@ -897,10 +897,17 @@ static void setup_rt_frame (int sig, struct k_sigaction *ka, siginfo_t *info, | |||
897 | 897 | ||
898 | /* Set up to return from userspace. */ | 898 | /* Set up to return from userspace. */ |
899 | err |= __put_user(frame->retcode, &frame->pretcode); | 899 | err |= __put_user(frame->retcode, &frame->pretcode); |
900 | #ifdef __mcoldfire__ | ||
901 | /* movel #__NR_rt_sigreturn,d0; trap #0 */ | ||
902 | err |= __put_user(0x203c0000, (long __user *)(frame->retcode + 0)); | ||
903 | err |= __put_user(0x00004e40 + (__NR_rt_sigreturn << 16), | ||
904 | (long __user *)(frame->retcode + 4)); | ||
905 | #else | ||
900 | /* moveq #,d0; notb d0; trap #0 */ | 906 | /* moveq #,d0; notb d0; trap #0 */ |
901 | err |= __put_user(0x70004600 + ((__NR_rt_sigreturn ^ 0xff) << 16), | 907 | err |= __put_user(0x70004600 + ((__NR_rt_sigreturn ^ 0xff) << 16), |
902 | (long __user *)(frame->retcode + 0)); | 908 | (long __user *)(frame->retcode + 0)); |
903 | err |= __put_user(0x4e40, (short __user *)(frame->retcode + 4)); | 909 | err |= __put_user(0x4e40, (short __user *)(frame->retcode + 4)); |
910 | #endif | ||
904 | 911 | ||
905 | if (err) | 912 | if (err) |
906 | goto give_sigsegv; | 913 | goto give_sigsegv; |
diff --git a/arch/m68k/kernel/sys_m68k.c b/arch/m68k/kernel/sys_m68k.c index 7deb402bfc75..77896692eb0a 100644 --- a/arch/m68k/kernel/sys_m68k.c +++ b/arch/m68k/kernel/sys_m68k.c | |||
@@ -28,215 +28,22 @@ | |||
28 | #include <asm/traps.h> | 28 | #include <asm/traps.h> |
29 | #include <asm/page.h> | 29 | #include <asm/page.h> |
30 | #include <asm/unistd.h> | 30 | #include <asm/unistd.h> |
31 | #include <linux/elf.h> | ||
32 | #include <asm/tlb.h> | ||
31 | 33 | ||
32 | /* common code for old and new mmaps */ | 34 | asmlinkage int do_page_fault(struct pt_regs *regs, unsigned long address, |
33 | static inline long do_mmap2( | 35 | unsigned long error_code); |
34 | unsigned long addr, unsigned long len, | ||
35 | unsigned long prot, unsigned long flags, | ||
36 | unsigned long fd, unsigned long pgoff) | ||
37 | { | ||
38 | int error = -EBADF; | ||
39 | struct file * file = NULL; | ||
40 | |||
41 | flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE); | ||
42 | if (!(flags & MAP_ANONYMOUS)) { | ||
43 | file = fget(fd); | ||
44 | if (!file) | ||
45 | goto out; | ||
46 | } | ||
47 | |||
48 | down_write(¤t->mm->mmap_sem); | ||
49 | error = do_mmap_pgoff(file, addr, len, prot, flags, pgoff); | ||
50 | up_write(¤t->mm->mmap_sem); | ||
51 | |||
52 | if (file) | ||
53 | fput(file); | ||
54 | out: | ||
55 | return error; | ||
56 | } | ||
57 | 36 | ||
58 | asmlinkage long sys_mmap2(unsigned long addr, unsigned long len, | 37 | asmlinkage long sys_mmap2(unsigned long addr, unsigned long len, |
59 | unsigned long prot, unsigned long flags, | 38 | unsigned long prot, unsigned long flags, |
60 | unsigned long fd, unsigned long pgoff) | 39 | unsigned long fd, unsigned long pgoff) |
61 | { | 40 | { |
62 | return do_mmap2(addr, len, prot, flags, fd, pgoff); | 41 | /* |
63 | } | 42 | * This is wrong for sun3 - there PAGE_SIZE is 8Kb, |
64 | 43 | * so we need to shift the argument down by 1; m68k mmap64(3) | |
65 | /* | 44 | * (in libc) expects the last argument of mmap2 in 4Kb units. |
66 | * Perform the select(nd, in, out, ex, tv) and mmap() system | 45 | */ |
67 | * calls. Linux/m68k cloned Linux/i386, which didn't use to be able to | 46 | return sys_mmap_pgoff(addr, len, prot, flags, fd, pgoff); |
68 | * handle more than 4 system call parameters, so these system calls | ||
69 | * used a memory block for parameter passing.. | ||
70 | */ | ||
71 | |||
72 | struct mmap_arg_struct { | ||
73 | unsigned long addr; | ||
74 | unsigned long len; | ||
75 | unsigned long prot; | ||
76 | unsigned long flags; | ||
77 | unsigned long fd; | ||
78 | unsigned long offset; | ||
79 | }; | ||
80 | |||
81 | asmlinkage int old_mmap(struct mmap_arg_struct __user *arg) | ||
82 | { | ||
83 | struct mmap_arg_struct a; | ||
84 | int error = -EFAULT; | ||
85 | |||
86 | if (copy_from_user(&a, arg, sizeof(a))) | ||
87 | goto out; | ||
88 | |||
89 | error = -EINVAL; | ||
90 | if (a.offset & ~PAGE_MASK) | ||
91 | goto out; | ||
92 | |||
93 | a.flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE); | ||
94 | |||
95 | error = do_mmap2(a.addr, a.len, a.prot, a.flags, a.fd, a.offset >> PAGE_SHIFT); | ||
96 | out: | ||
97 | return error; | ||
98 | } | ||
99 | |||
100 | #if 0 | ||
101 | struct mmap_arg_struct64 { | ||
102 | __u32 addr; | ||
103 | __u32 len; | ||
104 | __u32 prot; | ||
105 | __u32 flags; | ||
106 | __u64 offset; /* 64 bits */ | ||
107 | __u32 fd; | ||
108 | }; | ||
109 | |||
110 | asmlinkage long sys_mmap64(struct mmap_arg_struct64 *arg) | ||
111 | { | ||
112 | int error = -EFAULT; | ||
113 | struct file * file = NULL; | ||
114 | struct mmap_arg_struct64 a; | ||
115 | unsigned long pgoff; | ||
116 | |||
117 | if (copy_from_user(&a, arg, sizeof(a))) | ||
118 | return -EFAULT; | ||
119 | |||
120 | if ((long)a.offset & ~PAGE_MASK) | ||
121 | return -EINVAL; | ||
122 | |||
123 | pgoff = a.offset >> PAGE_SHIFT; | ||
124 | if ((a.offset >> PAGE_SHIFT) != pgoff) | ||
125 | return -EINVAL; | ||
126 | |||
127 | if (!(a.flags & MAP_ANONYMOUS)) { | ||
128 | error = -EBADF; | ||
129 | file = fget(a.fd); | ||
130 | if (!file) | ||
131 | goto out; | ||
132 | } | ||
133 | a.flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE); | ||
134 | |||
135 | down_write(¤t->mm->mmap_sem); | ||
136 | error = do_mmap_pgoff(file, a.addr, a.len, a.prot, a.flags, pgoff); | ||
137 | up_write(¤t->mm->mmap_sem); | ||
138 | if (file) | ||
139 | fput(file); | ||
140 | out: | ||
141 | return error; | ||
142 | } | ||
143 | #endif | ||
144 | |||
145 | struct sel_arg_struct { | ||
146 | unsigned long n; | ||
147 | fd_set __user *inp, *outp, *exp; | ||
148 | struct timeval __user *tvp; | ||
149 | }; | ||
150 | |||
151 | asmlinkage int old_select(struct sel_arg_struct __user *arg) | ||
152 | { | ||
153 | struct sel_arg_struct a; | ||
154 | |||
155 | if (copy_from_user(&a, arg, sizeof(a))) | ||
156 | return -EFAULT; | ||
157 | /* sys_select() does the appropriate kernel locking */ | ||
158 | return sys_select(a.n, a.inp, a.outp, a.exp, a.tvp); | ||
159 | } | ||
160 | |||
161 | /* | ||
162 | * sys_ipc() is the de-multiplexer for the SysV IPC calls.. | ||
163 | * | ||
164 | * This is really horribly ugly. | ||
165 | */ | ||
166 | asmlinkage int sys_ipc (uint call, int first, int second, | ||
167 | int third, void __user *ptr, long fifth) | ||
168 | { | ||
169 | int version, ret; | ||
170 | |||
171 | version = call >> 16; /* hack for backward compatibility */ | ||
172 | call &= 0xffff; | ||
173 | |||
174 | if (call <= SEMCTL) | ||
175 | switch (call) { | ||
176 | case SEMOP: | ||
177 | return sys_semop (first, ptr, second); | ||
178 | case SEMGET: | ||
179 | return sys_semget (first, second, third); | ||
180 | case SEMCTL: { | ||
181 | union semun fourth; | ||
182 | if (!ptr) | ||
183 | return -EINVAL; | ||
184 | if (get_user(fourth.__pad, (void __user *__user *) ptr)) | ||
185 | return -EFAULT; | ||
186 | return sys_semctl (first, second, third, fourth); | ||
187 | } | ||
188 | default: | ||
189 | return -ENOSYS; | ||
190 | } | ||
191 | if (call <= MSGCTL) | ||
192 | switch (call) { | ||
193 | case MSGSND: | ||
194 | return sys_msgsnd (first, ptr, second, third); | ||
195 | case MSGRCV: | ||
196 | switch (version) { | ||
197 | case 0: { | ||
198 | struct ipc_kludge tmp; | ||
199 | if (!ptr) | ||
200 | return -EINVAL; | ||
201 | if (copy_from_user (&tmp, ptr, sizeof (tmp))) | ||
202 | return -EFAULT; | ||
203 | return sys_msgrcv (first, tmp.msgp, second, | ||
204 | tmp.msgtyp, third); | ||
205 | } | ||
206 | default: | ||
207 | return sys_msgrcv (first, ptr, | ||
208 | second, fifth, third); | ||
209 | } | ||
210 | case MSGGET: | ||
211 | return sys_msgget ((key_t) first, second); | ||
212 | case MSGCTL: | ||
213 | return sys_msgctl (first, second, ptr); | ||
214 | default: | ||
215 | return -ENOSYS; | ||
216 | } | ||
217 | if (call <= SHMCTL) | ||
218 | switch (call) { | ||
219 | case SHMAT: | ||
220 | switch (version) { | ||
221 | default: { | ||
222 | ulong raddr; | ||
223 | ret = do_shmat (first, ptr, second, &raddr); | ||
224 | if (ret) | ||
225 | return ret; | ||
226 | return put_user (raddr, (ulong __user *) third); | ||
227 | } | ||
228 | } | ||
229 | case SHMDT: | ||
230 | return sys_shmdt (ptr); | ||
231 | case SHMGET: | ||
232 | return sys_shmget (first, second, third); | ||
233 | case SHMCTL: | ||
234 | return sys_shmctl (first, second, ptr); | ||
235 | default: | ||
236 | return -ENOSYS; | ||
237 | } | ||
238 | |||
239 | return -EINVAL; | ||
240 | } | 47 | } |
241 | 48 | ||
242 | /* Convert virtual (user) address VADDR to physical address PADDR */ | 49 | /* Convert virtual (user) address VADDR to physical address PADDR */ |
@@ -662,3 +469,79 @@ int kernel_execve(const char *filename, char *const argv[], char *const envp[]) | |||
662 | : "d" (__a), "d" (__b), "d" (__c)); | 469 | : "d" (__a), "d" (__b), "d" (__c)); |
663 | return __res; | 470 | return __res; |
664 | } | 471 | } |
472 | |||
473 | asmlinkage unsigned long sys_get_thread_area(void) | ||
474 | { | ||
475 | return current_thread_info()->tp_value; | ||
476 | } | ||
477 | |||
478 | asmlinkage int sys_set_thread_area(unsigned long tp) | ||
479 | { | ||
480 | current_thread_info()->tp_value = tp; | ||
481 | return 0; | ||
482 | } | ||
483 | |||
484 | /* This syscall gets its arguments in A0 (mem), D2 (oldval) and | ||
485 | D1 (newval). */ | ||
486 | asmlinkage int | ||
487 | sys_atomic_cmpxchg_32(unsigned long newval, int oldval, int d3, int d4, int d5, | ||
488 | unsigned long __user * mem) | ||
489 | { | ||
490 | /* This was borrowed from ARM's implementation. */ | ||
491 | for (;;) { | ||
492 | struct mm_struct *mm = current->mm; | ||
493 | pgd_t *pgd; | ||
494 | pmd_t *pmd; | ||
495 | pte_t *pte; | ||
496 | spinlock_t *ptl; | ||
497 | unsigned long mem_value; | ||
498 | |||
499 | down_read(&mm->mmap_sem); | ||
500 | pgd = pgd_offset(mm, (unsigned long)mem); | ||
501 | if (!pgd_present(*pgd)) | ||
502 | goto bad_access; | ||
503 | pmd = pmd_offset(pgd, (unsigned long)mem); | ||
504 | if (!pmd_present(*pmd)) | ||
505 | goto bad_access; | ||
506 | pte = pte_offset_map_lock(mm, pmd, (unsigned long)mem, &ptl); | ||
507 | if (!pte_present(*pte) || !pte_dirty(*pte) | ||
508 | || !pte_write(*pte)) { | ||
509 | pte_unmap_unlock(pte, ptl); | ||
510 | goto bad_access; | ||
511 | } | ||
512 | |||
513 | mem_value = *mem; | ||
514 | if (mem_value == oldval) | ||
515 | *mem = newval; | ||
516 | |||
517 | pte_unmap_unlock(pte, ptl); | ||
518 | up_read(&mm->mmap_sem); | ||
519 | return mem_value; | ||
520 | |||
521 | bad_access: | ||
522 | up_read(&mm->mmap_sem); | ||
523 | /* This is not necessarily a bad access, we can get here if | ||
524 | a memory we're trying to write to should be copied-on-write. | ||
525 | Make the kernel do the necessary page stuff, then re-iterate. | ||
526 | Simulate a write access fault to do that. */ | ||
527 | { | ||
528 | /* The first argument of the function corresponds to | ||
529 | D1, which is the first field of struct pt_regs. */ | ||
530 | struct pt_regs *fp = (struct pt_regs *)&newval; | ||
531 | |||
532 | /* '3' is an RMW flag. */ | ||
533 | if (do_page_fault(fp, (unsigned long)mem, 3)) | ||
534 | /* If the do_page_fault() failed, we don't | ||
535 | have anything meaningful to return. | ||
536 | There should be a SIGSEGV pending for | ||
537 | the process. */ | ||
538 | return 0xdeadbeef; | ||
539 | } | ||
540 | } | ||
541 | } | ||
542 | |||
543 | asmlinkage int sys_atomic_barrier(void) | ||
544 | { | ||
545 | /* no code needed for uniprocs */ | ||
546 | return 0; | ||
547 | } | ||
diff --git a/arch/m68k/kernel/vmlinux-std.lds b/arch/m68k/kernel/vmlinux-std.lds index 47eac19e8f61..878be5f38cad 100644 --- a/arch/m68k/kernel/vmlinux-std.lds +++ b/arch/m68k/kernel/vmlinux-std.lds | |||
@@ -2,6 +2,7 @@ | |||
2 | 2 | ||
3 | #include <asm-generic/vmlinux.lds.h> | 3 | #include <asm-generic/vmlinux.lds.h> |
4 | #include <asm/page.h> | 4 | #include <asm/page.h> |
5 | #include <asm/thread_info.h> | ||
5 | 6 | ||
6 | OUTPUT_FORMAT("elf32-m68k", "elf32-m68k", "elf32-m68k") | 7 | OUTPUT_FORMAT("elf32-m68k", "elf32-m68k", "elf32-m68k") |
7 | OUTPUT_ARCH(m68k) | 8 | OUTPUT_ARCH(m68k) |
@@ -22,73 +23,37 @@ SECTIONS | |||
22 | 23 | ||
23 | _etext = .; /* End of text section */ | 24 | _etext = .; /* End of text section */ |
24 | 25 | ||
25 | . = ALIGN(16); /* Exception table */ | 26 | EXCEPTION_TABLE(16) |
26 | __start___ex_table = .; | ||
27 | __ex_table : { *(__ex_table) } | ||
28 | __stop___ex_table = .; | ||
29 | 27 | ||
30 | RODATA | 28 | RODATA |
31 | 29 | ||
32 | .data : { /* Data */ | 30 | RW_DATA_SECTION(16, PAGE_SIZE, THREAD_SIZE) |
33 | DATA_DATA | ||
34 | CONSTRUCTORS | ||
35 | } | ||
36 | 31 | ||
37 | . = ALIGN(16); | 32 | BSS_SECTION(0, 0, 0) |
38 | .data.cacheline_aligned : { *(.data.cacheline_aligned) } | ||
39 | |||
40 | .bss : { *(.bss) } /* BSS */ | ||
41 | 33 | ||
42 | _edata = .; /* End of data section */ | 34 | _edata = .; /* End of data section */ |
43 | 35 | ||
44 | /* will be freed after init */ | 36 | /* will be freed after init */ |
45 | . = ALIGN(PAGE_SIZE); /* Init code and data */ | 37 | . = ALIGN(PAGE_SIZE); /* Init code and data */ |
46 | __init_begin = .; | 38 | __init_begin = .; |
47 | .init.text : { | 39 | INIT_TEXT_SECTION(PAGE_SIZE) :data |
48 | _sinittext = .; | 40 | INIT_DATA_SECTION(16) |
49 | INIT_TEXT | ||
50 | _einittext = .; | ||
51 | } :data | ||
52 | .init.data : { INIT_DATA } | ||
53 | . = ALIGN(16); | ||
54 | __setup_start = .; | ||
55 | .init.setup : { *(.init.setup) } | ||
56 | __setup_end = .; | ||
57 | __initcall_start = .; | ||
58 | .initcall.init : { | ||
59 | INITCALLS | ||
60 | } | ||
61 | __initcall_end = .; | ||
62 | __con_initcall_start = .; | ||
63 | .con_initcall.init : { *(.con_initcall.init) } | ||
64 | __con_initcall_end = .; | ||
65 | .m68k_fixup : { | 41 | .m68k_fixup : { |
66 | __start_fixup = .; | 42 | __start_fixup = .; |
67 | *(.m68k_fixup) | 43 | *(.m68k_fixup) |
68 | __stop_fixup = .; | 44 | __stop_fixup = .; |
69 | } | 45 | } |
70 | SECURITY_INIT | ||
71 | #ifdef CONFIG_BLK_DEV_INITRD | ||
72 | . = ALIGN(8192); | ||
73 | __initramfs_start = .; | ||
74 | .init.ramfs : { *(.init.ramfs) } | ||
75 | __initramfs_end = .; | ||
76 | #endif | ||
77 | NOTES | 46 | NOTES |
78 | . = ALIGN(8192); | 47 | .init_end : { |
79 | __init_end = .; | 48 | /* This ALIGN be in a section so that _end is at the end of the |
80 | 49 | load segment. */ | |
81 | .data.init_task : { *(.data.init_task) } /* The initial task and kernel stack */ | 50 | . = ALIGN(PAGE_SIZE); |
51 | __init_end = .; | ||
52 | } | ||
82 | 53 | ||
83 | _end = . ; | 54 | _end = . ; |
84 | 55 | ||
85 | /* Stabs debugging sections. */ | 56 | STABS_DEBUG |
86 | .stab 0 : { *(.stab) } | ||
87 | .stabstr 0 : { *(.stabstr) } | ||
88 | .stab.excl 0 : { *(.stab.excl) } | ||
89 | .stab.exclstr 0 : { *(.stab.exclstr) } | ||
90 | .stab.index 0 : { *(.stab.index) } | ||
91 | .stab.indexstr 0 : { *(.stab.indexstr) } | ||
92 | .comment 0 : { *(.comment) } | 57 | .comment 0 : { *(.comment) } |
93 | 58 | ||
94 | /* Sections to be discarded */ | 59 | /* Sections to be discarded */ |
diff --git a/arch/m68k/kernel/vmlinux-sun3.lds b/arch/m68k/kernel/vmlinux-sun3.lds index 03efaf04d7d7..1ad6b7ad2c17 100644 --- a/arch/m68k/kernel/vmlinux-sun3.lds +++ b/arch/m68k/kernel/vmlinux-sun3.lds | |||
@@ -2,6 +2,7 @@ | |||
2 | 2 | ||
3 | #include <asm-generic/vmlinux.lds.h> | 3 | #include <asm-generic/vmlinux.lds.h> |
4 | #include <asm/page.h> | 4 | #include <asm/page.h> |
5 | #include <asm/thread_info.h> | ||
5 | 6 | ||
6 | OUTPUT_FORMAT("elf32-m68k", "elf32-m68k", "elf32-m68k") | 7 | OUTPUT_FORMAT("elf32-m68k", "elf32-m68k", "elf32-m68k") |
7 | OUTPUT_ARCH(m68k) | 8 | OUTPUT_ARCH(m68k) |
@@ -23,14 +24,8 @@ SECTIONS | |||
23 | 24 | ||
24 | _etext = .; /* End of text section */ | 25 | _etext = .; /* End of text section */ |
25 | 26 | ||
26 | .data : { /* Data */ | 27 | EXCEPTION_TABLE(16) :data |
27 | DATA_DATA | 28 | RW_DATA_SECTION(16, PAGE_SIZE, THREAD_SIZE) :data |
28 | CONSTRUCTORS | ||
29 | . = ALIGN(16); /* Exception table */ | ||
30 | __start___ex_table = .; | ||
31 | *(__ex_table) | ||
32 | __stop___ex_table = .; | ||
33 | } :data | ||
34 | /* End of data goes *here* so that freeing init code works properly. */ | 29 | /* End of data goes *here* so that freeing init code works properly. */ |
35 | _edata = .; | 30 | _edata = .; |
36 | NOTES | 31 | NOTES |
@@ -38,56 +33,21 @@ SECTIONS | |||
38 | /* will be freed after init */ | 33 | /* will be freed after init */ |
39 | . = ALIGN(PAGE_SIZE); /* Init code and data */ | 34 | . = ALIGN(PAGE_SIZE); /* Init code and data */ |
40 | __init_begin = .; | 35 | __init_begin = .; |
41 | .init.text : { | 36 | INIT_TEXT_SECTION(PAGE_SIZE) |
42 | _sinittext = .; | 37 | INIT_DATA_SECTION(16) |
43 | INIT_TEXT | ||
44 | _einittext = .; | ||
45 | } | ||
46 | .init.data : { INIT_DATA } | ||
47 | . = ALIGN(16); | ||
48 | __setup_start = .; | ||
49 | .init.setup : { *(.init.setup) } | ||
50 | __setup_end = .; | ||
51 | __initcall_start = .; | ||
52 | .initcall.init : { | ||
53 | INITCALLS | ||
54 | } | ||
55 | __initcall_end = .; | ||
56 | __con_initcall_start = .; | ||
57 | .con_initcall.init : { *(.con_initcall.init) } | ||
58 | __con_initcall_end = .; | ||
59 | .m68k_fixup : { | 38 | .m68k_fixup : { |
60 | __start_fixup = .; | 39 | __start_fixup = .; |
61 | *(.m68k_fixup) | 40 | *(.m68k_fixup) |
62 | __stop_fixup = .; | 41 | __stop_fixup = .; |
63 | } | 42 | } |
64 | SECURITY_INIT | ||
65 | #ifdef CONFIG_BLK_DEV_INITRD | ||
66 | . = ALIGN(PAGE_SIZE); | ||
67 | __initramfs_start = .; | ||
68 | .init.ramfs : { *(.init.ramfs) } | ||
69 | __initramfs_end = .; | ||
70 | #endif | ||
71 | . = ALIGN(PAGE_SIZE); | 43 | . = ALIGN(PAGE_SIZE); |
72 | __init_end = .; | 44 | __init_end = .; |
73 | .data.init.task : { *(.data.init_task) } | ||
74 | |||
75 | 45 | ||
76 | .bss : { *(.bss) } /* BSS */ | 46 | BSS_SECTION(0, 0, 0) |
77 | 47 | ||
78 | _end = . ; | 48 | _end = . ; |
79 | 49 | ||
80 | .crap : { | 50 | STABS_DEBUG |
81 | /* Stabs debugging sections. */ | ||
82 | *(.stab) | ||
83 | *(.stabstr) | ||
84 | *(.stab.excl) | ||
85 | *(.stab.exclstr) | ||
86 | *(.stab.index) | ||
87 | *(.stab.indexstr) | ||
88 | *(.comment) | ||
89 | *(.note) | ||
90 | } | ||
91 | 51 | ||
92 | /* Sections to be discarded */ | 52 | /* Sections to be discarded */ |
93 | DISCARDS | 53 | DISCARDS |
diff --git a/arch/m68k/mac/Makefile b/arch/m68k/mac/Makefile index daebd80bdef0..b8d4c835f9a2 100644 --- a/arch/m68k/mac/Makefile +++ b/arch/m68k/mac/Makefile | |||
@@ -3,4 +3,4 @@ | |||
3 | # | 3 | # |
4 | 4 | ||
5 | obj-y := config.o macints.o iop.o via.o oss.o psc.o \ | 5 | obj-y := config.o macints.o iop.o via.o oss.o psc.o \ |
6 | baboon.o macboing.o debug.o misc.o | 6 | baboon.o macboing.o misc.o |
diff --git a/arch/m68k/mac/config.c b/arch/m68k/mac/config.c index be017984a456..0356da9bf763 100644 --- a/arch/m68k/mac/config.c +++ b/arch/m68k/mac/config.c | |||
@@ -23,6 +23,8 @@ | |||
23 | #include <linux/init.h> | 23 | #include <linux/init.h> |
24 | #include <linux/vt_kern.h> | 24 | #include <linux/vt_kern.h> |
25 | #include <linux/platform_device.h> | 25 | #include <linux/platform_device.h> |
26 | #include <linux/adb.h> | ||
27 | #include <linux/cuda.h> | ||
26 | 28 | ||
27 | #define BOOTINFO_COMPAT_1_0 | 29 | #define BOOTINFO_COMPAT_1_0 |
28 | #include <asm/setup.h> | 30 | #include <asm/setup.h> |
@@ -44,12 +46,7 @@ | |||
44 | #include <asm/mac_oss.h> | 46 | #include <asm/mac_oss.h> |
45 | #include <asm/mac_psc.h> | 47 | #include <asm/mac_psc.h> |
46 | 48 | ||
47 | /* platform device info */ | ||
48 | |||
49 | #define SWIM_IO_SIZE 0x2000 /* SWIM IO resource size */ | ||
50 | |||
51 | /* Mac bootinfo struct */ | 49 | /* Mac bootinfo struct */ |
52 | |||
53 | struct mac_booter_data mac_bi_data; | 50 | struct mac_booter_data mac_bi_data; |
54 | 51 | ||
55 | /* The phys. video addr. - might be bogus on some machines */ | 52 | /* The phys. video addr. - might be bogus on some machines */ |
@@ -70,8 +67,6 @@ extern void baboon_init(void); | |||
70 | 67 | ||
71 | extern void mac_mksound(unsigned int, unsigned int); | 68 | extern void mac_mksound(unsigned int, unsigned int); |
72 | 69 | ||
73 | extern void nubus_sweep_video(void); | ||
74 | |||
75 | static void mac_get_model(char *str); | 70 | static void mac_get_model(char *str); |
76 | static void mac_identify(void); | 71 | static void mac_identify(void); |
77 | static void mac_report_hardware(void); | 72 | static void mac_report_hardware(void); |
@@ -168,12 +163,6 @@ void __init config_mac(void) | |||
168 | #if defined(CONFIG_INPUT_M68K_BEEP) || defined(CONFIG_INPUT_M68K_BEEP_MODULE) | 163 | #if defined(CONFIG_INPUT_M68K_BEEP) || defined(CONFIG_INPUT_M68K_BEEP_MODULE) |
169 | mach_beep = mac_mksound; | 164 | mach_beep = mac_mksound; |
170 | #endif | 165 | #endif |
171 | #ifdef CONFIG_HEARTBEAT | ||
172 | #if 0 | ||
173 | mach_heartbeat = mac_heartbeat; | ||
174 | mach_heartbeat_irq = IRQ_MAC_TIMER; | ||
175 | #endif | ||
176 | #endif | ||
177 | 166 | ||
178 | /* | 167 | /* |
179 | * Determine hardware present | 168 | * Determine hardware present |
@@ -191,27 +180,19 @@ void __init config_mac(void) | |||
191 | if (macintosh_config->ident == MAC_MODEL_IICI | 180 | if (macintosh_config->ident == MAC_MODEL_IICI |
192 | || macintosh_config->ident == MAC_MODEL_IIFX) | 181 | || macintosh_config->ident == MAC_MODEL_IIFX) |
193 | mach_l2_flush = mac_cache_card_flush; | 182 | mach_l2_flush = mac_cache_card_flush; |
194 | |||
195 | /* | ||
196 | * Check for machine specific fixups. | ||
197 | */ | ||
198 | |||
199 | #ifdef OLD_NUBUS_CODE | ||
200 | nubus_sweep_video(); | ||
201 | #endif | ||
202 | } | 183 | } |
203 | 184 | ||
204 | 185 | ||
205 | /* | 186 | /* |
206 | * Macintosh Table: hardcoded model configuration data. | 187 | * Macintosh Table: hardcoded model configuration data. |
207 | * | 188 | * |
208 | * Much of this was defined by Alan, based on who knows what docs. | 189 | * Much of this was defined by Alan, based on who knows what docs. |
209 | * I've added a lot more, and some of that was pure guesswork based | 190 | * I've added a lot more, and some of that was pure guesswork based |
210 | * on hardware pages present on the Mac web site. Possibly wildly | 191 | * on hardware pages present on the Mac web site. Possibly wildly |
211 | * inaccurate, so look here if a new Mac model won't run. Example: if | 192 | * inaccurate, so look here if a new Mac model won't run. Example: if |
212 | * a Mac crashes immediately after the VIA1 registers have been dumped | 193 | * a Mac crashes immediately after the VIA1 registers have been dumped |
213 | * to the screen, it probably died attempting to read DirB on a RBV. | 194 | * to the screen, it probably died attempting to read DirB on a RBV. |
214 | * Meaning it should have MAC_VIA_IIci here :-) | 195 | * Meaning it should have MAC_VIA_IIci here :-) |
215 | */ | 196 | */ |
216 | 197 | ||
217 | struct mac_model *macintosh_config; | 198 | struct mac_model *macintosh_config; |
@@ -219,7 +200,7 @@ EXPORT_SYMBOL(macintosh_config); | |||
219 | 200 | ||
220 | static struct mac_model mac_data_table[] = { | 201 | static struct mac_model mac_data_table[] = { |
221 | /* | 202 | /* |
222 | * We'll pretend to be a Macintosh II, that's pretty safe. | 203 | * We'll pretend to be a Macintosh II, that's pretty safe. |
223 | */ | 204 | */ |
224 | 205 | ||
225 | { | 206 | { |
@@ -230,12 +211,11 @@ static struct mac_model mac_data_table[] = { | |||
230 | .scsi_type = MAC_SCSI_OLD, | 211 | .scsi_type = MAC_SCSI_OLD, |
231 | .scc_type = MAC_SCC_II, | 212 | .scc_type = MAC_SCC_II, |
232 | .nubus_type = MAC_NUBUS, | 213 | .nubus_type = MAC_NUBUS, |
233 | .floppy_type = MAC_FLOPPY_IWM | 214 | .floppy_type = MAC_FLOPPY_IWM, |
234 | }, | 215 | }, |
235 | 216 | ||
236 | /* | 217 | /* |
237 | * Original MacII hardware | 218 | * Original Mac II hardware |
238 | * | ||
239 | */ | 219 | */ |
240 | 220 | ||
241 | { | 221 | { |
@@ -246,7 +226,7 @@ static struct mac_model mac_data_table[] = { | |||
246 | .scsi_type = MAC_SCSI_OLD, | 226 | .scsi_type = MAC_SCSI_OLD, |
247 | .scc_type = MAC_SCC_II, | 227 | .scc_type = MAC_SCC_II, |
248 | .nubus_type = MAC_NUBUS, | 228 | .nubus_type = MAC_NUBUS, |
249 | .floppy_type = MAC_FLOPPY_IWM | 229 | .floppy_type = MAC_FLOPPY_IWM, |
250 | }, { | 230 | }, { |
251 | .ident = MAC_MODEL_IIX, | 231 | .ident = MAC_MODEL_IIX, |
252 | .name = "IIx", | 232 | .name = "IIx", |
@@ -255,7 +235,7 @@ static struct mac_model mac_data_table[] = { | |||
255 | .scsi_type = MAC_SCSI_OLD, | 235 | .scsi_type = MAC_SCSI_OLD, |
256 | .scc_type = MAC_SCC_II, | 236 | .scc_type = MAC_SCC_II, |
257 | .nubus_type = MAC_NUBUS, | 237 | .nubus_type = MAC_NUBUS, |
258 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2 | 238 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
259 | }, { | 239 | }, { |
260 | .ident = MAC_MODEL_IICX, | 240 | .ident = MAC_MODEL_IICX, |
261 | .name = "IIcx", | 241 | .name = "IIcx", |
@@ -264,7 +244,7 @@ static struct mac_model mac_data_table[] = { | |||
264 | .scsi_type = MAC_SCSI_OLD, | 244 | .scsi_type = MAC_SCSI_OLD, |
265 | .scc_type = MAC_SCC_II, | 245 | .scc_type = MAC_SCC_II, |
266 | .nubus_type = MAC_NUBUS, | 246 | .nubus_type = MAC_NUBUS, |
267 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2 | 247 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
268 | }, { | 248 | }, { |
269 | .ident = MAC_MODEL_SE30, | 249 | .ident = MAC_MODEL_SE30, |
270 | .name = "SE/30", | 250 | .name = "SE/30", |
@@ -273,13 +253,13 @@ static struct mac_model mac_data_table[] = { | |||
273 | .scsi_type = MAC_SCSI_OLD, | 253 | .scsi_type = MAC_SCSI_OLD, |
274 | .scc_type = MAC_SCC_II, | 254 | .scc_type = MAC_SCC_II, |
275 | .nubus_type = MAC_NUBUS, | 255 | .nubus_type = MAC_NUBUS, |
276 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2 | 256 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
277 | }, | 257 | }, |
278 | 258 | ||
279 | /* | 259 | /* |
280 | * Weirdified MacII hardware - all subtly different. Gee thanks | 260 | * Weirdified Mac II hardware - all subtly different. Gee thanks |
281 | * Apple. All these boxes seem to have VIA2 in a different place to | 261 | * Apple. All these boxes seem to have VIA2 in a different place to |
282 | * the MacII (+1A000 rather than +4000) | 262 | * the Mac II (+1A000 rather than +4000) |
283 | * CSA: see http://developer.apple.com/technotes/hw/hw_09.html | 263 | * CSA: see http://developer.apple.com/technotes/hw/hw_09.html |
284 | */ | 264 | */ |
285 | 265 | ||
@@ -291,7 +271,7 @@ static struct mac_model mac_data_table[] = { | |||
291 | .scsi_type = MAC_SCSI_OLD, | 271 | .scsi_type = MAC_SCSI_OLD, |
292 | .scc_type = MAC_SCC_II, | 272 | .scc_type = MAC_SCC_II, |
293 | .nubus_type = MAC_NUBUS, | 273 | .nubus_type = MAC_NUBUS, |
294 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2 | 274 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
295 | }, { | 275 | }, { |
296 | .ident = MAC_MODEL_IIFX, | 276 | .ident = MAC_MODEL_IIFX, |
297 | .name = "IIfx", | 277 | .name = "IIfx", |
@@ -300,7 +280,7 @@ static struct mac_model mac_data_table[] = { | |||
300 | .scsi_type = MAC_SCSI_OLD, | 280 | .scsi_type = MAC_SCSI_OLD, |
301 | .scc_type = MAC_SCC_IOP, | 281 | .scc_type = MAC_SCC_IOP, |
302 | .nubus_type = MAC_NUBUS, | 282 | .nubus_type = MAC_NUBUS, |
303 | .floppy_type = MAC_FLOPPY_SWIM_IOP | 283 | .floppy_type = MAC_FLOPPY_SWIM_IOP, |
304 | }, { | 284 | }, { |
305 | .ident = MAC_MODEL_IISI, | 285 | .ident = MAC_MODEL_IISI, |
306 | .name = "IIsi", | 286 | .name = "IIsi", |
@@ -309,7 +289,7 @@ static struct mac_model mac_data_table[] = { | |||
309 | .scsi_type = MAC_SCSI_OLD, | 289 | .scsi_type = MAC_SCSI_OLD, |
310 | .scc_type = MAC_SCC_II, | 290 | .scc_type = MAC_SCC_II, |
311 | .nubus_type = MAC_NUBUS, | 291 | .nubus_type = MAC_NUBUS, |
312 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2 | 292 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
313 | }, { | 293 | }, { |
314 | .ident = MAC_MODEL_IIVI, | 294 | .ident = MAC_MODEL_IIVI, |
315 | .name = "IIvi", | 295 | .name = "IIvi", |
@@ -318,7 +298,7 @@ static struct mac_model mac_data_table[] = { | |||
318 | .scsi_type = MAC_SCSI_OLD, | 298 | .scsi_type = MAC_SCSI_OLD, |
319 | .scc_type = MAC_SCC_II, | 299 | .scc_type = MAC_SCC_II, |
320 | .nubus_type = MAC_NUBUS, | 300 | .nubus_type = MAC_NUBUS, |
321 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2 | 301 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
322 | }, { | 302 | }, { |
323 | .ident = MAC_MODEL_IIVX, | 303 | .ident = MAC_MODEL_IIVX, |
324 | .name = "IIvx", | 304 | .name = "IIvx", |
@@ -327,11 +307,11 @@ static struct mac_model mac_data_table[] = { | |||
327 | .scsi_type = MAC_SCSI_OLD, | 307 | .scsi_type = MAC_SCSI_OLD, |
328 | .scc_type = MAC_SCC_II, | 308 | .scc_type = MAC_SCC_II, |
329 | .nubus_type = MAC_NUBUS, | 309 | .nubus_type = MAC_NUBUS, |
330 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2 | 310 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
331 | }, | 311 | }, |
332 | 312 | ||
333 | /* | 313 | /* |
334 | * Classic models (guessing: similar to SE/30 ?? Nope, similar to LC ...) | 314 | * Classic models (guessing: similar to SE/30? Nope, similar to LC...) |
335 | */ | 315 | */ |
336 | 316 | ||
337 | { | 317 | { |
@@ -342,7 +322,7 @@ static struct mac_model mac_data_table[] = { | |||
342 | .scsi_type = MAC_SCSI_OLD, | 322 | .scsi_type = MAC_SCSI_OLD, |
343 | .scc_type = MAC_SCC_II, | 323 | .scc_type = MAC_SCC_II, |
344 | .nubus_type = MAC_NUBUS, | 324 | .nubus_type = MAC_NUBUS, |
345 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2 | 325 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
346 | }, { | 326 | }, { |
347 | .ident = MAC_MODEL_CCL, | 327 | .ident = MAC_MODEL_CCL, |
348 | .name = "Color Classic", | 328 | .name = "Color Classic", |
@@ -351,11 +331,11 @@ static struct mac_model mac_data_table[] = { | |||
351 | .scsi_type = MAC_SCSI_OLD, | 331 | .scsi_type = MAC_SCSI_OLD, |
352 | .scc_type = MAC_SCC_II, | 332 | .scc_type = MAC_SCC_II, |
353 | .nubus_type = MAC_NUBUS, | 333 | .nubus_type = MAC_NUBUS, |
354 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2 | 334 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
355 | }, | 335 | }, |
356 | 336 | ||
357 | /* | 337 | /* |
358 | * Some Mac LC machines. Basically the same as the IIci, ADB like IIsi | 338 | * Some Mac LC machines. Basically the same as the IIci, ADB like IIsi |
359 | */ | 339 | */ |
360 | 340 | ||
361 | { | 341 | { |
@@ -366,7 +346,7 @@ static struct mac_model mac_data_table[] = { | |||
366 | .scsi_type = MAC_SCSI_OLD, | 346 | .scsi_type = MAC_SCSI_OLD, |
367 | .scc_type = MAC_SCC_II, | 347 | .scc_type = MAC_SCC_II, |
368 | .nubus_type = MAC_NUBUS, | 348 | .nubus_type = MAC_NUBUS, |
369 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2 | 349 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
370 | }, { | 350 | }, { |
371 | .ident = MAC_MODEL_LCII, | 351 | .ident = MAC_MODEL_LCII, |
372 | .name = "LC II", | 352 | .name = "LC II", |
@@ -375,7 +355,7 @@ static struct mac_model mac_data_table[] = { | |||
375 | .scsi_type = MAC_SCSI_OLD, | 355 | .scsi_type = MAC_SCSI_OLD, |
376 | .scc_type = MAC_SCC_II, | 356 | .scc_type = MAC_SCC_II, |
377 | .nubus_type = MAC_NUBUS, | 357 | .nubus_type = MAC_NUBUS, |
378 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2 | 358 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
379 | }, { | 359 | }, { |
380 | .ident = MAC_MODEL_LCIII, | 360 | .ident = MAC_MODEL_LCIII, |
381 | .name = "LC III", | 361 | .name = "LC III", |
@@ -384,17 +364,17 @@ static struct mac_model mac_data_table[] = { | |||
384 | .scsi_type = MAC_SCSI_OLD, | 364 | .scsi_type = MAC_SCSI_OLD, |
385 | .scc_type = MAC_SCC_II, | 365 | .scc_type = MAC_SCC_II, |
386 | .nubus_type = MAC_NUBUS, | 366 | .nubus_type = MAC_NUBUS, |
387 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2 | 367 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
388 | }, | 368 | }, |
389 | 369 | ||
390 | /* | 370 | /* |
391 | * Quadra. Video is at 0xF9000000, via is like a MacII. We label it differently | 371 | * Quadra. Video is at 0xF9000000, via is like a MacII. We label it |
392 | * as some of the stuff connected to VIA2 seems different. Better SCSI chip and | 372 | * differently as some of the stuff connected to VIA2 seems different. |
393 | * onboard ethernet using a NatSemi SONIC except the 660AV and 840AV which use an | 373 | * Better SCSI chip and onboard ethernet using a NatSemi SONIC except |
394 | * AMD 79C940 (MACE). | 374 | * the 660AV and 840AV which use an AMD 79C940 (MACE). |
395 | * The 700, 900 and 950 have some I/O chips in the wrong place to | 375 | * The 700, 900 and 950 have some I/O chips in the wrong place to |
396 | * confuse us. The 840AV has a SCSI location of its own (same as | 376 | * confuse us. The 840AV has a SCSI location of its own (same as |
397 | * the 660AV). | 377 | * the 660AV). |
398 | */ | 378 | */ |
399 | 379 | ||
400 | { | 380 | { |
@@ -405,7 +385,7 @@ static struct mac_model mac_data_table[] = { | |||
405 | .scsi_type = MAC_SCSI_QUADRA, | 385 | .scsi_type = MAC_SCSI_QUADRA, |
406 | .scc_type = MAC_SCC_QUADRA, | 386 | .scc_type = MAC_SCC_QUADRA, |
407 | .nubus_type = MAC_NUBUS, | 387 | .nubus_type = MAC_NUBUS, |
408 | .floppy_type = MAC_FLOPPY_SWIM_ADDR1 | 388 | .floppy_type = MAC_FLOPPY_SWIM_ADDR1, |
409 | }, { | 389 | }, { |
410 | .ident = MAC_MODEL_Q605_ACC, | 390 | .ident = MAC_MODEL_Q605_ACC, |
411 | .name = "Quadra 605", | 391 | .name = "Quadra 605", |
@@ -414,7 +394,7 @@ static struct mac_model mac_data_table[] = { | |||
414 | .scsi_type = MAC_SCSI_QUADRA, | 394 | .scsi_type = MAC_SCSI_QUADRA, |
415 | .scc_type = MAC_SCC_QUADRA, | 395 | .scc_type = MAC_SCC_QUADRA, |
416 | .nubus_type = MAC_NUBUS, | 396 | .nubus_type = MAC_NUBUS, |
417 | .floppy_type = MAC_FLOPPY_SWIM_ADDR1 | 397 | .floppy_type = MAC_FLOPPY_SWIM_ADDR1, |
418 | }, { | 398 | }, { |
419 | .ident = MAC_MODEL_Q610, | 399 | .ident = MAC_MODEL_Q610, |
420 | .name = "Quadra 610", | 400 | .name = "Quadra 610", |
@@ -424,7 +404,7 @@ static struct mac_model mac_data_table[] = { | |||
424 | .scc_type = MAC_SCC_QUADRA, | 404 | .scc_type = MAC_SCC_QUADRA, |
425 | .ether_type = MAC_ETHER_SONIC, | 405 | .ether_type = MAC_ETHER_SONIC, |
426 | .nubus_type = MAC_NUBUS, | 406 | .nubus_type = MAC_NUBUS, |
427 | .floppy_type = MAC_FLOPPY_SWIM_ADDR1 | 407 | .floppy_type = MAC_FLOPPY_SWIM_ADDR1, |
428 | }, { | 408 | }, { |
429 | .ident = MAC_MODEL_Q630, | 409 | .ident = MAC_MODEL_Q630, |
430 | .name = "Quadra 630", | 410 | .name = "Quadra 630", |
@@ -435,7 +415,7 @@ static struct mac_model mac_data_table[] = { | |||
435 | .scc_type = MAC_SCC_QUADRA, | 415 | .scc_type = MAC_SCC_QUADRA, |
436 | .ether_type = MAC_ETHER_SONIC, | 416 | .ether_type = MAC_ETHER_SONIC, |
437 | .nubus_type = MAC_NUBUS, | 417 | .nubus_type = MAC_NUBUS, |
438 | .floppy_type = MAC_FLOPPY_SWIM_ADDR1 | 418 | .floppy_type = MAC_FLOPPY_SWIM_ADDR1, |
439 | }, { | 419 | }, { |
440 | .ident = MAC_MODEL_Q650, | 420 | .ident = MAC_MODEL_Q650, |
441 | .name = "Quadra 650", | 421 | .name = "Quadra 650", |
@@ -445,9 +425,9 @@ static struct mac_model mac_data_table[] = { | |||
445 | .scc_type = MAC_SCC_QUADRA, | 425 | .scc_type = MAC_SCC_QUADRA, |
446 | .ether_type = MAC_ETHER_SONIC, | 426 | .ether_type = MAC_ETHER_SONIC, |
447 | .nubus_type = MAC_NUBUS, | 427 | .nubus_type = MAC_NUBUS, |
448 | .floppy_type = MAC_FLOPPY_SWIM_ADDR1 | 428 | .floppy_type = MAC_FLOPPY_SWIM_ADDR1, |
449 | }, | 429 | }, |
450 | /* The Q700 does have a NS Sonic */ | 430 | /* The Q700 does have a NS Sonic */ |
451 | { | 431 | { |
452 | .ident = MAC_MODEL_Q700, | 432 | .ident = MAC_MODEL_Q700, |
453 | .name = "Quadra 700", | 433 | .name = "Quadra 700", |
@@ -457,7 +437,7 @@ static struct mac_model mac_data_table[] = { | |||
457 | .scc_type = MAC_SCC_QUADRA, | 437 | .scc_type = MAC_SCC_QUADRA, |
458 | .ether_type = MAC_ETHER_SONIC, | 438 | .ether_type = MAC_ETHER_SONIC, |
459 | .nubus_type = MAC_NUBUS, | 439 | .nubus_type = MAC_NUBUS, |
460 | .floppy_type = MAC_FLOPPY_SWIM_ADDR1 | 440 | .floppy_type = MAC_FLOPPY_SWIM_ADDR1, |
461 | }, { | 441 | }, { |
462 | .ident = MAC_MODEL_Q800, | 442 | .ident = MAC_MODEL_Q800, |
463 | .name = "Quadra 800", | 443 | .name = "Quadra 800", |
@@ -467,7 +447,7 @@ static struct mac_model mac_data_table[] = { | |||
467 | .scc_type = MAC_SCC_QUADRA, | 447 | .scc_type = MAC_SCC_QUADRA, |
468 | .ether_type = MAC_ETHER_SONIC, | 448 | .ether_type = MAC_ETHER_SONIC, |
469 | .nubus_type = MAC_NUBUS, | 449 | .nubus_type = MAC_NUBUS, |
470 | .floppy_type = MAC_FLOPPY_SWIM_ADDR1 | 450 | .floppy_type = MAC_FLOPPY_SWIM_ADDR1, |
471 | }, { | 451 | }, { |
472 | .ident = MAC_MODEL_Q840, | 452 | .ident = MAC_MODEL_Q840, |
473 | .name = "Quadra 840AV", | 453 | .name = "Quadra 840AV", |
@@ -477,7 +457,7 @@ static struct mac_model mac_data_table[] = { | |||
477 | .scc_type = MAC_SCC_PSC, | 457 | .scc_type = MAC_SCC_PSC, |
478 | .ether_type = MAC_ETHER_MACE, | 458 | .ether_type = MAC_ETHER_MACE, |
479 | .nubus_type = MAC_NUBUS, | 459 | .nubus_type = MAC_NUBUS, |
480 | .floppy_type = MAC_FLOPPY_AV | 460 | .floppy_type = MAC_FLOPPY_AV, |
481 | }, { | 461 | }, { |
482 | .ident = MAC_MODEL_Q900, | 462 | .ident = MAC_MODEL_Q900, |
483 | .name = "Quadra 900", | 463 | .name = "Quadra 900", |
@@ -487,7 +467,7 @@ static struct mac_model mac_data_table[] = { | |||
487 | .scc_type = MAC_SCC_IOP, | 467 | .scc_type = MAC_SCC_IOP, |
488 | .ether_type = MAC_ETHER_SONIC, | 468 | .ether_type = MAC_ETHER_SONIC, |
489 | .nubus_type = MAC_NUBUS, | 469 | .nubus_type = MAC_NUBUS, |
490 | .floppy_type = MAC_FLOPPY_SWIM_IOP | 470 | .floppy_type = MAC_FLOPPY_SWIM_IOP, |
491 | }, { | 471 | }, { |
492 | .ident = MAC_MODEL_Q950, | 472 | .ident = MAC_MODEL_Q950, |
493 | .name = "Quadra 950", | 473 | .name = "Quadra 950", |
@@ -497,60 +477,60 @@ static struct mac_model mac_data_table[] = { | |||
497 | .scc_type = MAC_SCC_IOP, | 477 | .scc_type = MAC_SCC_IOP, |
498 | .ether_type = MAC_ETHER_SONIC, | 478 | .ether_type = MAC_ETHER_SONIC, |
499 | .nubus_type = MAC_NUBUS, | 479 | .nubus_type = MAC_NUBUS, |
500 | .floppy_type = MAC_FLOPPY_SWIM_IOP | 480 | .floppy_type = MAC_FLOPPY_SWIM_IOP, |
501 | }, | 481 | }, |
502 | 482 | ||
503 | /* | 483 | /* |
504 | * Performa - more LC type machines | 484 | * Performa - more LC type machines |
505 | */ | 485 | */ |
506 | 486 | ||
507 | { | 487 | { |
508 | .ident = MAC_MODEL_P460, | 488 | .ident = MAC_MODEL_P460, |
509 | .name = "Performa 460", | 489 | .name = "Performa 460", |
510 | .adb_type = MAC_ADB_IISI, | 490 | .adb_type = MAC_ADB_IISI, |
511 | .via_type = MAC_VIA_IIci, | 491 | .via_type = MAC_VIA_IIci, |
512 | .scsi_type = MAC_SCSI_OLD, | 492 | .scsi_type = MAC_SCSI_OLD, |
513 | .scc_type = MAC_SCC_II, | 493 | .scc_type = MAC_SCC_II, |
514 | .nubus_type = MAC_NUBUS, | 494 | .nubus_type = MAC_NUBUS, |
515 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2 | 495 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
516 | }, { | 496 | }, { |
517 | .ident = MAC_MODEL_P475, | 497 | .ident = MAC_MODEL_P475, |
518 | .name = "Performa 475", | 498 | .name = "Performa 475", |
519 | .adb_type = MAC_ADB_CUDA, | 499 | .adb_type = MAC_ADB_CUDA, |
520 | .via_type = MAC_VIA_QUADRA, | 500 | .via_type = MAC_VIA_QUADRA, |
521 | .scsi_type = MAC_SCSI_QUADRA, | 501 | .scsi_type = MAC_SCSI_QUADRA, |
522 | .scc_type = MAC_SCC_II, | 502 | .scc_type = MAC_SCC_II, |
523 | .nubus_type = MAC_NUBUS, | 503 | .nubus_type = MAC_NUBUS, |
524 | .floppy_type = MAC_FLOPPY_SWIM_ADDR1 | 504 | .floppy_type = MAC_FLOPPY_SWIM_ADDR1, |
525 | }, { | 505 | }, { |
526 | .ident = MAC_MODEL_P475F, | 506 | .ident = MAC_MODEL_P475F, |
527 | .name = "Performa 475", | 507 | .name = "Performa 475", |
528 | .adb_type = MAC_ADB_CUDA, | 508 | .adb_type = MAC_ADB_CUDA, |
529 | .via_type = MAC_VIA_QUADRA, | 509 | .via_type = MAC_VIA_QUADRA, |
530 | .scsi_type = MAC_SCSI_QUADRA, | 510 | .scsi_type = MAC_SCSI_QUADRA, |
531 | .scc_type = MAC_SCC_II, | 511 | .scc_type = MAC_SCC_II, |
532 | .nubus_type = MAC_NUBUS, | 512 | .nubus_type = MAC_NUBUS, |
533 | .floppy_type = MAC_FLOPPY_SWIM_ADDR1 | 513 | .floppy_type = MAC_FLOPPY_SWIM_ADDR1, |
534 | }, { | 514 | }, { |
535 | .ident = MAC_MODEL_P520, | 515 | .ident = MAC_MODEL_P520, |
536 | .name = "Performa 520", | 516 | .name = "Performa 520", |
537 | .adb_type = MAC_ADB_CUDA, | 517 | .adb_type = MAC_ADB_CUDA, |
538 | .via_type = MAC_VIA_IIci, | 518 | .via_type = MAC_VIA_IIci, |
539 | .scsi_type = MAC_SCSI_OLD, | 519 | .scsi_type = MAC_SCSI_OLD, |
540 | .scc_type = MAC_SCC_II, | 520 | .scc_type = MAC_SCC_II, |
541 | .nubus_type = MAC_NUBUS, | 521 | .nubus_type = MAC_NUBUS, |
542 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2 | 522 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
543 | }, { | 523 | }, { |
544 | .ident = MAC_MODEL_P550, | 524 | .ident = MAC_MODEL_P550, |
545 | .name = "Performa 550", | 525 | .name = "Performa 550", |
546 | .adb_type = MAC_ADB_CUDA, | 526 | .adb_type = MAC_ADB_CUDA, |
547 | .via_type = MAC_VIA_IIci, | 527 | .via_type = MAC_VIA_IIci, |
548 | .scsi_type = MAC_SCSI_OLD, | 528 | .scsi_type = MAC_SCSI_OLD, |
549 | .scc_type = MAC_SCC_II, | 529 | .scc_type = MAC_SCC_II, |
550 | .nubus_type = MAC_NUBUS, | 530 | .nubus_type = MAC_NUBUS, |
551 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2 | 531 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
552 | }, | 532 | }, |
553 | /* These have the comm slot, and therefore the possibility of SONIC ethernet */ | 533 | /* These have the comm slot, and therefore possibly SONIC ethernet */ |
554 | { | 534 | { |
555 | .ident = MAC_MODEL_P575, | 535 | .ident = MAC_MODEL_P575, |
556 | .name = "Performa 575", | 536 | .name = "Performa 575", |
@@ -560,7 +540,7 @@ static struct mac_model mac_data_table[] = { | |||
560 | .scc_type = MAC_SCC_II, | 540 | .scc_type = MAC_SCC_II, |
561 | .ether_type = MAC_ETHER_SONIC, | 541 | .ether_type = MAC_ETHER_SONIC, |
562 | .nubus_type = MAC_NUBUS, | 542 | .nubus_type = MAC_NUBUS, |
563 | .floppy_type = MAC_FLOPPY_SWIM_ADDR1 | 543 | .floppy_type = MAC_FLOPPY_SWIM_ADDR1, |
564 | }, { | 544 | }, { |
565 | .ident = MAC_MODEL_P588, | 545 | .ident = MAC_MODEL_P588, |
566 | .name = "Performa 588", | 546 | .name = "Performa 588", |
@@ -571,7 +551,7 @@ static struct mac_model mac_data_table[] = { | |||
571 | .scc_type = MAC_SCC_II, | 551 | .scc_type = MAC_SCC_II, |
572 | .ether_type = MAC_ETHER_SONIC, | 552 | .ether_type = MAC_ETHER_SONIC, |
573 | .nubus_type = MAC_NUBUS, | 553 | .nubus_type = MAC_NUBUS, |
574 | .floppy_type = MAC_FLOPPY_SWIM_ADDR1 | 554 | .floppy_type = MAC_FLOPPY_SWIM_ADDR1, |
575 | }, { | 555 | }, { |
576 | .ident = MAC_MODEL_TV, | 556 | .ident = MAC_MODEL_TV, |
577 | .name = "TV", | 557 | .name = "TV", |
@@ -580,7 +560,7 @@ static struct mac_model mac_data_table[] = { | |||
580 | .scsi_type = MAC_SCSI_OLD, | 560 | .scsi_type = MAC_SCSI_OLD, |
581 | .scc_type = MAC_SCC_II, | 561 | .scc_type = MAC_SCC_II, |
582 | .nubus_type = MAC_NUBUS, | 562 | .nubus_type = MAC_NUBUS, |
583 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2 | 563 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
584 | }, { | 564 | }, { |
585 | .ident = MAC_MODEL_P600, | 565 | .ident = MAC_MODEL_P600, |
586 | .name = "Performa 600", | 566 | .name = "Performa 600", |
@@ -589,14 +569,14 @@ static struct mac_model mac_data_table[] = { | |||
589 | .scsi_type = MAC_SCSI_OLD, | 569 | .scsi_type = MAC_SCSI_OLD, |
590 | .scc_type = MAC_SCC_II, | 570 | .scc_type = MAC_SCC_II, |
591 | .nubus_type = MAC_NUBUS, | 571 | .nubus_type = MAC_NUBUS, |
592 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2 | 572 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
593 | }, | 573 | }, |
594 | 574 | ||
595 | /* | 575 | /* |
596 | * Centris - just guessing again; maybe like Quadra | 576 | * Centris - just guessing again; maybe like Quadra. |
577 | * The C610 may or may not have SONIC. We probe to make sure. | ||
597 | */ | 578 | */ |
598 | 579 | ||
599 | /* The C610 may or may not have SONIC. We probe to make sure */ | ||
600 | { | 580 | { |
601 | .ident = MAC_MODEL_C610, | 581 | .ident = MAC_MODEL_C610, |
602 | .name = "Centris 610", | 582 | .name = "Centris 610", |
@@ -606,7 +586,7 @@ static struct mac_model mac_data_table[] = { | |||
606 | .scc_type = MAC_SCC_QUADRA, | 586 | .scc_type = MAC_SCC_QUADRA, |
607 | .ether_type = MAC_ETHER_SONIC, | 587 | .ether_type = MAC_ETHER_SONIC, |
608 | .nubus_type = MAC_NUBUS, | 588 | .nubus_type = MAC_NUBUS, |
609 | .floppy_type = MAC_FLOPPY_SWIM_ADDR1 | 589 | .floppy_type = MAC_FLOPPY_SWIM_ADDR1, |
610 | }, { | 590 | }, { |
611 | .ident = MAC_MODEL_C650, | 591 | .ident = MAC_MODEL_C650, |
612 | .name = "Centris 650", | 592 | .name = "Centris 650", |
@@ -616,7 +596,7 @@ static struct mac_model mac_data_table[] = { | |||
616 | .scc_type = MAC_SCC_QUADRA, | 596 | .scc_type = MAC_SCC_QUADRA, |
617 | .ether_type = MAC_ETHER_SONIC, | 597 | .ether_type = MAC_ETHER_SONIC, |
618 | .nubus_type = MAC_NUBUS, | 598 | .nubus_type = MAC_NUBUS, |
619 | .floppy_type = MAC_FLOPPY_SWIM_ADDR1 | 599 | .floppy_type = MAC_FLOPPY_SWIM_ADDR1, |
620 | }, { | 600 | }, { |
621 | .ident = MAC_MODEL_C660, | 601 | .ident = MAC_MODEL_C660, |
622 | .name = "Centris 660AV", | 602 | .name = "Centris 660AV", |
@@ -626,7 +606,7 @@ static struct mac_model mac_data_table[] = { | |||
626 | .scc_type = MAC_SCC_PSC, | 606 | .scc_type = MAC_SCC_PSC, |
627 | .ether_type = MAC_ETHER_MACE, | 607 | .ether_type = MAC_ETHER_MACE, |
628 | .nubus_type = MAC_NUBUS, | 608 | .nubus_type = MAC_NUBUS, |
629 | .floppy_type = MAC_FLOPPY_AV | 609 | .floppy_type = MAC_FLOPPY_AV, |
630 | }, | 610 | }, |
631 | 611 | ||
632 | /* | 612 | /* |
@@ -643,7 +623,7 @@ static struct mac_model mac_data_table[] = { | |||
643 | .scsi_type = MAC_SCSI_OLD, | 623 | .scsi_type = MAC_SCSI_OLD, |
644 | .scc_type = MAC_SCC_QUADRA, | 624 | .scc_type = MAC_SCC_QUADRA, |
645 | .nubus_type = MAC_NUBUS, | 625 | .nubus_type = MAC_NUBUS, |
646 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2 | 626 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
647 | }, { | 627 | }, { |
648 | .ident = MAC_MODEL_PB145, | 628 | .ident = MAC_MODEL_PB145, |
649 | .name = "PowerBook 145", | 629 | .name = "PowerBook 145", |
@@ -652,7 +632,7 @@ static struct mac_model mac_data_table[] = { | |||
652 | .scsi_type = MAC_SCSI_OLD, | 632 | .scsi_type = MAC_SCSI_OLD, |
653 | .scc_type = MAC_SCC_QUADRA, | 633 | .scc_type = MAC_SCC_QUADRA, |
654 | .nubus_type = MAC_NUBUS, | 634 | .nubus_type = MAC_NUBUS, |
655 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2 | 635 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
656 | }, { | 636 | }, { |
657 | .ident = MAC_MODEL_PB150, | 637 | .ident = MAC_MODEL_PB150, |
658 | .name = "PowerBook 150", | 638 | .name = "PowerBook 150", |
@@ -662,7 +642,7 @@ static struct mac_model mac_data_table[] = { | |||
662 | .ide_type = MAC_IDE_PB, | 642 | .ide_type = MAC_IDE_PB, |
663 | .scc_type = MAC_SCC_QUADRA, | 643 | .scc_type = MAC_SCC_QUADRA, |
664 | .nubus_type = MAC_NUBUS, | 644 | .nubus_type = MAC_NUBUS, |
665 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2 | 645 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
666 | }, { | 646 | }, { |
667 | .ident = MAC_MODEL_PB160, | 647 | .ident = MAC_MODEL_PB160, |
668 | .name = "PowerBook 160", | 648 | .name = "PowerBook 160", |
@@ -671,7 +651,7 @@ static struct mac_model mac_data_table[] = { | |||
671 | .scsi_type = MAC_SCSI_OLD, | 651 | .scsi_type = MAC_SCSI_OLD, |
672 | .scc_type = MAC_SCC_QUADRA, | 652 | .scc_type = MAC_SCC_QUADRA, |
673 | .nubus_type = MAC_NUBUS, | 653 | .nubus_type = MAC_NUBUS, |
674 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2 | 654 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
675 | }, { | 655 | }, { |
676 | .ident = MAC_MODEL_PB165, | 656 | .ident = MAC_MODEL_PB165, |
677 | .name = "PowerBook 165", | 657 | .name = "PowerBook 165", |
@@ -680,7 +660,7 @@ static struct mac_model mac_data_table[] = { | |||
680 | .scsi_type = MAC_SCSI_OLD, | 660 | .scsi_type = MAC_SCSI_OLD, |
681 | .scc_type = MAC_SCC_QUADRA, | 661 | .scc_type = MAC_SCC_QUADRA, |
682 | .nubus_type = MAC_NUBUS, | 662 | .nubus_type = MAC_NUBUS, |
683 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2 | 663 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
684 | }, { | 664 | }, { |
685 | .ident = MAC_MODEL_PB165C, | 665 | .ident = MAC_MODEL_PB165C, |
686 | .name = "PowerBook 165c", | 666 | .name = "PowerBook 165c", |
@@ -689,7 +669,7 @@ static struct mac_model mac_data_table[] = { | |||
689 | .scsi_type = MAC_SCSI_OLD, | 669 | .scsi_type = MAC_SCSI_OLD, |
690 | .scc_type = MAC_SCC_QUADRA, | 670 | .scc_type = MAC_SCC_QUADRA, |
691 | .nubus_type = MAC_NUBUS, | 671 | .nubus_type = MAC_NUBUS, |
692 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2 | 672 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
693 | }, { | 673 | }, { |
694 | .ident = MAC_MODEL_PB170, | 674 | .ident = MAC_MODEL_PB170, |
695 | .name = "PowerBook 170", | 675 | .name = "PowerBook 170", |
@@ -698,7 +678,7 @@ static struct mac_model mac_data_table[] = { | |||
698 | .scsi_type = MAC_SCSI_OLD, | 678 | .scsi_type = MAC_SCSI_OLD, |
699 | .scc_type = MAC_SCC_QUADRA, | 679 | .scc_type = MAC_SCC_QUADRA, |
700 | .nubus_type = MAC_NUBUS, | 680 | .nubus_type = MAC_NUBUS, |
701 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2 | 681 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
702 | }, { | 682 | }, { |
703 | .ident = MAC_MODEL_PB180, | 683 | .ident = MAC_MODEL_PB180, |
704 | .name = "PowerBook 180", | 684 | .name = "PowerBook 180", |
@@ -707,7 +687,7 @@ static struct mac_model mac_data_table[] = { | |||
707 | .scsi_type = MAC_SCSI_OLD, | 687 | .scsi_type = MAC_SCSI_OLD, |
708 | .scc_type = MAC_SCC_QUADRA, | 688 | .scc_type = MAC_SCC_QUADRA, |
709 | .nubus_type = MAC_NUBUS, | 689 | .nubus_type = MAC_NUBUS, |
710 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2 | 690 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
711 | }, { | 691 | }, { |
712 | .ident = MAC_MODEL_PB180C, | 692 | .ident = MAC_MODEL_PB180C, |
713 | .name = "PowerBook 180c", | 693 | .name = "PowerBook 180c", |
@@ -716,7 +696,7 @@ static struct mac_model mac_data_table[] = { | |||
716 | .scsi_type = MAC_SCSI_OLD, | 696 | .scsi_type = MAC_SCSI_OLD, |
717 | .scc_type = MAC_SCC_QUADRA, | 697 | .scc_type = MAC_SCC_QUADRA, |
718 | .nubus_type = MAC_NUBUS, | 698 | .nubus_type = MAC_NUBUS, |
719 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2 | 699 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
720 | }, { | 700 | }, { |
721 | .ident = MAC_MODEL_PB190, | 701 | .ident = MAC_MODEL_PB190, |
722 | .name = "PowerBook 190", | 702 | .name = "PowerBook 190", |
@@ -726,7 +706,7 @@ static struct mac_model mac_data_table[] = { | |||
726 | .ide_type = MAC_IDE_BABOON, | 706 | .ide_type = MAC_IDE_BABOON, |
727 | .scc_type = MAC_SCC_QUADRA, | 707 | .scc_type = MAC_SCC_QUADRA, |
728 | .nubus_type = MAC_NUBUS, | 708 | .nubus_type = MAC_NUBUS, |
729 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2 | 709 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
730 | }, { | 710 | }, { |
731 | .ident = MAC_MODEL_PB520, | 711 | .ident = MAC_MODEL_PB520, |
732 | .name = "PowerBook 520", | 712 | .name = "PowerBook 520", |
@@ -736,7 +716,7 @@ static struct mac_model mac_data_table[] = { | |||
736 | .scc_type = MAC_SCC_QUADRA, | 716 | .scc_type = MAC_SCC_QUADRA, |
737 | .ether_type = MAC_ETHER_SONIC, | 717 | .ether_type = MAC_ETHER_SONIC, |
738 | .nubus_type = MAC_NUBUS, | 718 | .nubus_type = MAC_NUBUS, |
739 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2 | 719 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
740 | }, | 720 | }, |
741 | 721 | ||
742 | /* | 722 | /* |
@@ -757,7 +737,7 @@ static struct mac_model mac_data_table[] = { | |||
757 | .scsi_type = MAC_SCSI_OLD, | 737 | .scsi_type = MAC_SCSI_OLD, |
758 | .scc_type = MAC_SCC_QUADRA, | 738 | .scc_type = MAC_SCC_QUADRA, |
759 | .nubus_type = MAC_NUBUS, | 739 | .nubus_type = MAC_NUBUS, |
760 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2 | 740 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
761 | }, { | 741 | }, { |
762 | .ident = MAC_MODEL_PB230, | 742 | .ident = MAC_MODEL_PB230, |
763 | .name = "PowerBook Duo 230", | 743 | .name = "PowerBook Duo 230", |
@@ -766,7 +746,7 @@ static struct mac_model mac_data_table[] = { | |||
766 | .scsi_type = MAC_SCSI_OLD, | 746 | .scsi_type = MAC_SCSI_OLD, |
767 | .scc_type = MAC_SCC_QUADRA, | 747 | .scc_type = MAC_SCC_QUADRA, |
768 | .nubus_type = MAC_NUBUS, | 748 | .nubus_type = MAC_NUBUS, |
769 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2 | 749 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
770 | }, { | 750 | }, { |
771 | .ident = MAC_MODEL_PB250, | 751 | .ident = MAC_MODEL_PB250, |
772 | .name = "PowerBook Duo 250", | 752 | .name = "PowerBook Duo 250", |
@@ -775,7 +755,7 @@ static struct mac_model mac_data_table[] = { | |||
775 | .scsi_type = MAC_SCSI_OLD, | 755 | .scsi_type = MAC_SCSI_OLD, |
776 | .scc_type = MAC_SCC_QUADRA, | 756 | .scc_type = MAC_SCC_QUADRA, |
777 | .nubus_type = MAC_NUBUS, | 757 | .nubus_type = MAC_NUBUS, |
778 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2 | 758 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
779 | }, { | 759 | }, { |
780 | .ident = MAC_MODEL_PB270C, | 760 | .ident = MAC_MODEL_PB270C, |
781 | .name = "PowerBook Duo 270c", | 761 | .name = "PowerBook Duo 270c", |
@@ -784,7 +764,7 @@ static struct mac_model mac_data_table[] = { | |||
784 | .scsi_type = MAC_SCSI_OLD, | 764 | .scsi_type = MAC_SCSI_OLD, |
785 | .scc_type = MAC_SCC_QUADRA, | 765 | .scc_type = MAC_SCC_QUADRA, |
786 | .nubus_type = MAC_NUBUS, | 766 | .nubus_type = MAC_NUBUS, |
787 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2 | 767 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
788 | }, { | 768 | }, { |
789 | .ident = MAC_MODEL_PB280, | 769 | .ident = MAC_MODEL_PB280, |
790 | .name = "PowerBook Duo 280", | 770 | .name = "PowerBook Duo 280", |
@@ -793,7 +773,7 @@ static struct mac_model mac_data_table[] = { | |||
793 | .scsi_type = MAC_SCSI_OLD, | 773 | .scsi_type = MAC_SCSI_OLD, |
794 | .scc_type = MAC_SCC_QUADRA, | 774 | .scc_type = MAC_SCC_QUADRA, |
795 | .nubus_type = MAC_NUBUS, | 775 | .nubus_type = MAC_NUBUS, |
796 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2 | 776 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
797 | }, { | 777 | }, { |
798 | .ident = MAC_MODEL_PB280C, | 778 | .ident = MAC_MODEL_PB280C, |
799 | .name = "PowerBook Duo 280c", | 779 | .name = "PowerBook Duo 280c", |
@@ -802,17 +782,44 @@ static struct mac_model mac_data_table[] = { | |||
802 | .scsi_type = MAC_SCSI_OLD, | 782 | .scsi_type = MAC_SCSI_OLD, |
803 | .scc_type = MAC_SCC_QUADRA, | 783 | .scc_type = MAC_SCC_QUADRA, |
804 | .nubus_type = MAC_NUBUS, | 784 | .nubus_type = MAC_NUBUS, |
805 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2 | 785 | .floppy_type = MAC_FLOPPY_SWIM_ADDR2, |
806 | }, | 786 | }, |
807 | 787 | ||
808 | /* | 788 | /* |
809 | * Other stuff ?? | 789 | * Other stuff? |
810 | */ | 790 | */ |
791 | |||
811 | { | 792 | { |
812 | .ident = -1 | 793 | .ident = -1 |
813 | } | 794 | } |
814 | }; | 795 | }; |
815 | 796 | ||
797 | static struct resource scc_a_rsrcs[] = { | ||
798 | { .flags = IORESOURCE_MEM }, | ||
799 | { .flags = IORESOURCE_IRQ }, | ||
800 | }; | ||
801 | |||
802 | static struct resource scc_b_rsrcs[] = { | ||
803 | { .flags = IORESOURCE_MEM }, | ||
804 | { .flags = IORESOURCE_IRQ }, | ||
805 | }; | ||
806 | |||
807 | struct platform_device scc_a_pdev = { | ||
808 | .name = "scc", | ||
809 | .id = 0, | ||
810 | .num_resources = ARRAY_SIZE(scc_a_rsrcs), | ||
811 | .resource = scc_a_rsrcs, | ||
812 | }; | ||
813 | EXPORT_SYMBOL(scc_a_pdev); | ||
814 | |||
815 | struct platform_device scc_b_pdev = { | ||
816 | .name = "scc", | ||
817 | .id = 1, | ||
818 | .num_resources = ARRAY_SIZE(scc_b_rsrcs), | ||
819 | .resource = scc_b_rsrcs, | ||
820 | }; | ||
821 | EXPORT_SYMBOL(scc_b_pdev); | ||
822 | |||
816 | static void __init mac_identify(void) | 823 | static void __init mac_identify(void) |
817 | { | 824 | { |
818 | struct mac_model *m; | 825 | struct mac_model *m; |
@@ -823,7 +830,8 @@ static void __init mac_identify(void) | |||
823 | /* no bootinfo model id -> NetBSD booter was used! */ | 830 | /* no bootinfo model id -> NetBSD booter was used! */ |
824 | /* XXX FIXME: breaks for model > 31 */ | 831 | /* XXX FIXME: breaks for model > 31 */ |
825 | model = (mac_bi_data.cpuid >> 2) & 63; | 832 | model = (mac_bi_data.cpuid >> 2) & 63; |
826 | printk(KERN_WARNING "No bootinfo model ID, using cpuid instead (hey, use Penguin!)\n"); | 833 | printk(KERN_WARNING "No bootinfo model ID, using cpuid instead " |
834 | "(obsolete bootloader?)\n"); | ||
827 | } | 835 | } |
828 | 836 | ||
829 | macintosh_config = mac_data_table; | 837 | macintosh_config = mac_data_table; |
@@ -834,10 +842,29 @@ static void __init mac_identify(void) | |||
834 | } | 842 | } |
835 | } | 843 | } |
836 | 844 | ||
837 | /* We need to pre-init the IOPs, if any. Otherwise */ | 845 | /* Set up serial port resources for the console initcall. */ |
838 | /* the serial console won't work if the user had */ | 846 | |
839 | /* the serial ports set to "Faster" mode in MacOS. */ | 847 | scc_a_rsrcs[0].start = (resource_size_t) mac_bi_data.sccbase + 2; |
848 | scc_a_rsrcs[0].end = scc_a_rsrcs[0].start; | ||
849 | scc_b_rsrcs[0].start = (resource_size_t) mac_bi_data.sccbase; | ||
850 | scc_b_rsrcs[0].end = scc_b_rsrcs[0].start; | ||
840 | 851 | ||
852 | switch (macintosh_config->scc_type) { | ||
853 | case MAC_SCC_PSC: | ||
854 | scc_a_rsrcs[1].start = scc_a_rsrcs[1].end = IRQ_MAC_SCC_A; | ||
855 | scc_b_rsrcs[1].start = scc_b_rsrcs[1].end = IRQ_MAC_SCC_B; | ||
856 | break; | ||
857 | default: | ||
858 | scc_a_rsrcs[1].start = scc_a_rsrcs[1].end = IRQ_MAC_SCC; | ||
859 | scc_b_rsrcs[1].start = scc_b_rsrcs[1].end = IRQ_MAC_SCC; | ||
860 | break; | ||
861 | } | ||
862 | |||
863 | /* | ||
864 | * We need to pre-init the IOPs, if any. Otherwise | ||
865 | * the serial console won't work if the user had | ||
866 | * the serial ports set to "Faster" mode in MacOS. | ||
867 | */ | ||
841 | iop_preinit(); | 868 | iop_preinit(); |
842 | 869 | ||
843 | printk(KERN_INFO "Detected Macintosh model: %d \n", model); | 870 | printk(KERN_INFO "Detected Macintosh model: %d \n", model); |
@@ -846,7 +873,8 @@ static void __init mac_identify(void) | |||
846 | * Report booter data: | 873 | * Report booter data: |
847 | */ | 874 | */ |
848 | printk(KERN_DEBUG " Penguin bootinfo data:\n"); | 875 | printk(KERN_DEBUG " Penguin bootinfo data:\n"); |
849 | printk(KERN_DEBUG " Video: addr 0x%lx row 0x%lx depth %lx dimensions %ld x %ld\n", | 876 | printk(KERN_DEBUG " Video: addr 0x%lx " |
877 | "row 0x%lx depth %lx dimensions %ld x %ld\n", | ||
850 | mac_bi_data.videoaddr, mac_bi_data.videorow, | 878 | mac_bi_data.videoaddr, mac_bi_data.videorow, |
851 | mac_bi_data.videodepth, mac_bi_data.dimensions & 0xFFFF, | 879 | mac_bi_data.videodepth, mac_bi_data.dimensions & 0xFFFF, |
852 | mac_bi_data.dimensions >> 16); | 880 | mac_bi_data.dimensions >> 16); |
@@ -863,6 +891,10 @@ static void __init mac_identify(void) | |||
863 | oss_init(); | 891 | oss_init(); |
864 | psc_init(); | 892 | psc_init(); |
865 | baboon_init(); | 893 | baboon_init(); |
894 | |||
895 | #ifdef CONFIG_ADB_CUDA | ||
896 | find_via_cuda(); | ||
897 | #endif | ||
866 | } | 898 | } |
867 | 899 | ||
868 | static void __init mac_report_hardware(void) | 900 | static void __init mac_report_hardware(void) |
@@ -876,23 +908,50 @@ static void mac_get_model(char *str) | |||
876 | strcat(str, macintosh_config->name); | 908 | strcat(str, macintosh_config->name); |
877 | } | 909 | } |
878 | 910 | ||
879 | static struct resource swim_resources[1]; | 911 | static struct resource swim_rsrc = { .flags = IORESOURCE_MEM }; |
880 | 912 | ||
881 | static struct platform_device swim_device = { | 913 | static struct platform_device swim_pdev = { |
882 | .name = "swim", | 914 | .name = "swim", |
883 | .id = -1, | 915 | .id = -1, |
884 | .num_resources = ARRAY_SIZE(swim_resources), | 916 | .num_resources = 1, |
885 | .resource = swim_resources, | 917 | .resource = &swim_rsrc, |
886 | }; | 918 | }; |
887 | 919 | ||
888 | static struct platform_device *mac_platform_devices[] __initdata = { | 920 | static struct platform_device esp_0_pdev = { |
889 | &swim_device | 921 | .name = "mac_esp", |
922 | .id = 0, | ||
923 | }; | ||
924 | |||
925 | static struct platform_device esp_1_pdev = { | ||
926 | .name = "mac_esp", | ||
927 | .id = 1, | ||
928 | }; | ||
929 | |||
930 | static struct platform_device sonic_pdev = { | ||
931 | .name = "macsonic", | ||
932 | .id = -1, | ||
933 | }; | ||
934 | |||
935 | static struct platform_device mace_pdev = { | ||
936 | .name = "macmace", | ||
937 | .id = -1, | ||
890 | }; | 938 | }; |
891 | 939 | ||
892 | int __init mac_platform_init(void) | 940 | int __init mac_platform_init(void) |
893 | { | 941 | { |
894 | u8 *swim_base; | 942 | u8 *swim_base; |
895 | 943 | ||
944 | /* | ||
945 | * Serial devices | ||
946 | */ | ||
947 | |||
948 | platform_device_register(&scc_a_pdev); | ||
949 | platform_device_register(&scc_b_pdev); | ||
950 | |||
951 | /* | ||
952 | * Floppy device | ||
953 | */ | ||
954 | |||
896 | switch (macintosh_config->floppy_type) { | 955 | switch (macintosh_config->floppy_type) { |
897 | case MAC_FLOPPY_SWIM_ADDR1: | 956 | case MAC_FLOPPY_SWIM_ADDR1: |
898 | swim_base = (u8 *)(VIA1_BASE + 0x1E000); | 957 | swim_base = (u8 *)(VIA1_BASE + 0x1E000); |
@@ -901,16 +960,47 @@ int __init mac_platform_init(void) | |||
901 | swim_base = (u8 *)(VIA1_BASE + 0x16000); | 960 | swim_base = (u8 *)(VIA1_BASE + 0x16000); |
902 | break; | 961 | break; |
903 | default: | 962 | default: |
904 | return 0; | 963 | swim_base = NULL; |
964 | break; | ||
905 | } | 965 | } |
906 | 966 | ||
907 | swim_resources[0].name = "swim-regs"; | 967 | if (swim_base) { |
908 | swim_resources[0].start = (resource_size_t)swim_base; | 968 | swim_rsrc.start = (resource_size_t) swim_base, |
909 | swim_resources[0].end = (resource_size_t)(swim_base + SWIM_IO_SIZE); | 969 | swim_rsrc.end = (resource_size_t) swim_base + 0x2000, |
910 | swim_resources[0].flags = IORESOURCE_MEM; | 970 | platform_device_register(&swim_pdev); |
971 | } | ||
972 | |||
973 | /* | ||
974 | * SCSI device(s) | ||
975 | */ | ||
976 | |||
977 | switch (macintosh_config->scsi_type) { | ||
978 | case MAC_SCSI_QUADRA: | ||
979 | case MAC_SCSI_QUADRA3: | ||
980 | platform_device_register(&esp_0_pdev); | ||
981 | break; | ||
982 | case MAC_SCSI_QUADRA2: | ||
983 | platform_device_register(&esp_0_pdev); | ||
984 | if ((macintosh_config->ident == MAC_MODEL_Q900) || | ||
985 | (macintosh_config->ident == MAC_MODEL_Q950)) | ||
986 | platform_device_register(&esp_1_pdev); | ||
987 | break; | ||
988 | } | ||
989 | |||
990 | /* | ||
991 | * Ethernet device | ||
992 | */ | ||
993 | |||
994 | switch (macintosh_config->ether_type) { | ||
995 | case MAC_ETHER_SONIC: | ||
996 | platform_device_register(&sonic_pdev); | ||
997 | break; | ||
998 | case MAC_ETHER_MACE: | ||
999 | platform_device_register(&mace_pdev); | ||
1000 | break; | ||
1001 | } | ||
911 | 1002 | ||
912 | return platform_add_devices(mac_platform_devices, | 1003 | return 0; |
913 | ARRAY_SIZE(mac_platform_devices)); | ||
914 | } | 1004 | } |
915 | 1005 | ||
916 | arch_initcall(mac_platform_init); | 1006 | arch_initcall(mac_platform_init); |
diff --git a/arch/m68k/mac/debug.c b/arch/m68k/mac/debug.c deleted file mode 100644 index bce074ceb768..000000000000 --- a/arch/m68k/mac/debug.c +++ /dev/null | |||
@@ -1,365 +0,0 @@ | |||
1 | /* | ||
2 | * linux/arch/m68k/mac/debug.c | ||
3 | * | ||
4 | * Shamelessly stolen (SCC code and general framework) from: | ||
5 | * | ||
6 | * linux/arch/m68k/atari/debug.c | ||
7 | * | ||
8 | * Atari debugging and serial console stuff | ||
9 | * | ||
10 | * Assembled of parts of former atari/config.c 97-12-18 by Roman Hodek | ||
11 | * | ||
12 | * This file is subject to the terms and conditions of the GNU General Public | ||
13 | * License. See the file COPYING in the main directory of this archive | ||
14 | * for more details. | ||
15 | */ | ||
16 | |||
17 | #include <linux/types.h> | ||
18 | #include <linux/sched.h> | ||
19 | #include <linux/tty.h> | ||
20 | #include <linux/console.h> | ||
21 | #include <linux/init.h> | ||
22 | #include <linux/delay.h> | ||
23 | |||
24 | #define BOOTINFO_COMPAT_1_0 | ||
25 | #include <asm/setup.h> | ||
26 | #include <asm/bootinfo.h> | ||
27 | #include <asm/macints.h> | ||
28 | |||
29 | extern unsigned long mac_videobase; | ||
30 | extern unsigned long mac_rowbytes; | ||
31 | |||
32 | extern void mac_serial_print(const char *); | ||
33 | |||
34 | #define DEBUG_HEADS | ||
35 | #undef DEBUG_SCREEN | ||
36 | #define DEBUG_SERIAL | ||
37 | |||
38 | /* | ||
39 | * These two auxiliary debug functions should go away ASAP. Only usage: | ||
40 | * before the console output is up (after head.S come some other crucial | ||
41 | * setup routines :-) it permits writing 'data' to the screen as bit patterns | ||
42 | * (good luck reading those). Helped to figure that the bootinfo contained | ||
43 | * garbage data on the amount and size of memory chunks ... | ||
44 | * | ||
45 | * The 'pos' argument now simply means 'linefeed after print' ... | ||
46 | */ | ||
47 | |||
48 | #ifdef DEBUG_SCREEN | ||
49 | static int peng, line; | ||
50 | #endif | ||
51 | |||
52 | #if 0 | ||
53 | |||
54 | void mac_debugging_short(int pos, short num) | ||
55 | { | ||
56 | #ifdef DEBUG_SCREEN | ||
57 | unsigned char *pengoffset; | ||
58 | unsigned char *pptr; | ||
59 | int i; | ||
60 | #endif | ||
61 | |||
62 | #ifdef DEBUG_SERIAL | ||
63 | printk("debug: %d !\n", num); | ||
64 | #endif | ||
65 | |||
66 | #ifdef DEBUG_SCREEN | ||
67 | if (!MACH_IS_MAC) { | ||
68 | /* printk("debug: %d !\n", num); */ | ||
69 | return; | ||
70 | } | ||
71 | |||
72 | /* calculate current offset */ | ||
73 | pengoffset = (unsigned char *)mac_videobase + | ||
74 | (150+line*2) * mac_rowbytes + 80 * peng; | ||
75 | |||
76 | pptr = pengoffset; | ||
77 | |||
78 | for (i = 0; i < 8 * sizeof(short); i++) { /* # of bits */ | ||
79 | /* value mask for bit i, reverse order */ | ||
80 | *pptr++ = (num & (1 << (8*sizeof(short)-i-1)) ? 0xFF : 0x00); | ||
81 | } | ||
82 | |||
83 | peng++; | ||
84 | |||
85 | if (pos) { | ||
86 | line++; | ||
87 | peng = 0; | ||
88 | } | ||
89 | #endif | ||
90 | } | ||
91 | |||
92 | void mac_debugging_long(int pos, long addr) | ||
93 | { | ||
94 | #ifdef DEBUG_SCREEN | ||
95 | unsigned char *pengoffset; | ||
96 | unsigned char *pptr; | ||
97 | int i; | ||
98 | #endif | ||
99 | |||
100 | #ifdef DEBUG_SERIAL | ||
101 | printk("debug: #%ld !\n", addr); | ||
102 | #endif | ||
103 | |||
104 | #ifdef DEBUG_SCREEN | ||
105 | if (!MACH_IS_MAC) { | ||
106 | /* printk("debug: #%ld !\n", addr); */ | ||
107 | return; | ||
108 | } | ||
109 | |||
110 | pengoffset=(unsigned char *)(mac_videobase+(150+line*2)*mac_rowbytes) | ||
111 | +80*peng; | ||
112 | |||
113 | pptr = pengoffset; | ||
114 | |||
115 | for (i = 0; i < 8 * sizeof(long); i++) { /* # of bits */ | ||
116 | *pptr++ = (addr & (1 << (8*sizeof(long)-i-1)) ? 0xFF : 0x00); | ||
117 | } | ||
118 | |||
119 | peng++; | ||
120 | |||
121 | if (pos) { | ||
122 | line++; | ||
123 | peng = 0; | ||
124 | } | ||
125 | #endif | ||
126 | } | ||
127 | |||
128 | #endif /* 0 */ | ||
129 | |||
130 | #ifdef DEBUG_SERIAL | ||
131 | /* | ||
132 | * TODO: serial debug code | ||
133 | */ | ||
134 | |||
135 | struct mac_SCC { | ||
136 | u_char cha_b_ctrl; | ||
137 | u_char char_dummy1; | ||
138 | u_char cha_a_ctrl; | ||
139 | u_char char_dummy2; | ||
140 | u_char cha_b_data; | ||
141 | u_char char_dummy3; | ||
142 | u_char cha_a_data; | ||
143 | }; | ||
144 | |||
145 | # define scc (*((volatile struct mac_SCC*)mac_bi_data.sccbase)) | ||
146 | |||
147 | static int scc_port = -1; | ||
148 | |||
149 | static struct console mac_console_driver = { | ||
150 | .name = "debug", | ||
151 | .flags = CON_PRINTBUFFER, | ||
152 | .index = -1, | ||
153 | }; | ||
154 | |||
155 | /* | ||
156 | * Crude hack to get console output to the screen before the framebuffer | ||
157 | * is initialized (happens a lot later in 2.1!). | ||
158 | * We just use the console routines declared in head.S, this will interfere | ||
159 | * with regular framebuffer console output and should be used exclusively | ||
160 | * to debug kernel problems manifesting before framebuffer init (aka WSOD) | ||
161 | * | ||
162 | * To keep this hack from interfering with the regular console driver, either | ||
163 | * deregister this driver before/on framebuffer console init, or silence this | ||
164 | * function after the fbcon driver is running (will lose console messages!?). | ||
165 | * To debug real early bugs, need to write a 'mac_register_console_hack()' | ||
166 | * that is called from start_kernel() before setup_arch() and just registers | ||
167 | * this driver if Mac. | ||
168 | */ | ||
169 | |||
170 | static void mac_debug_console_write(struct console *co, const char *str, | ||
171 | unsigned int count) | ||
172 | { | ||
173 | mac_serial_print(str); | ||
174 | } | ||
175 | |||
176 | |||
177 | |||
178 | /* Mac: loops_per_jiffy min. 19000 ^= .5 us; MFPDELAY was 0.6 us*/ | ||
179 | |||
180 | #define uSEC 1 | ||
181 | |||
182 | static inline void mac_sccb_out(char c) | ||
183 | { | ||
184 | int i; | ||
185 | |||
186 | do { | ||
187 | for (i = uSEC; i > 0; --i) | ||
188 | barrier(); | ||
189 | } while (!(scc.cha_b_ctrl & 0x04)); /* wait for tx buf empty */ | ||
190 | for (i = uSEC; i > 0; --i) | ||
191 | barrier(); | ||
192 | scc.cha_b_data = c; | ||
193 | } | ||
194 | |||
195 | static inline void mac_scca_out(char c) | ||
196 | { | ||
197 | int i; | ||
198 | |||
199 | do { | ||
200 | for (i = uSEC; i > 0; --i) | ||
201 | barrier(); | ||
202 | } while (!(scc.cha_a_ctrl & 0x04)); /* wait for tx buf empty */ | ||
203 | for (i = uSEC; i > 0; --i) | ||
204 | barrier(); | ||
205 | scc.cha_a_data = c; | ||
206 | } | ||
207 | |||
208 | static void mac_sccb_console_write(struct console *co, const char *str, | ||
209 | unsigned int count) | ||
210 | { | ||
211 | while (count--) { | ||
212 | if (*str == '\n') | ||
213 | mac_sccb_out('\r'); | ||
214 | mac_sccb_out(*str++); | ||
215 | } | ||
216 | } | ||
217 | |||
218 | static void mac_scca_console_write(struct console *co, const char *str, | ||
219 | unsigned int count) | ||
220 | { | ||
221 | while (count--) { | ||
222 | if (*str == '\n') | ||
223 | mac_scca_out('\r'); | ||
224 | mac_scca_out(*str++); | ||
225 | } | ||
226 | } | ||
227 | |||
228 | |||
229 | /* The following two functions do a quick'n'dirty initialization of the MFP or | ||
230 | * SCC serial ports. They're used by the debugging interface, kgdb, and the | ||
231 | * serial console code. */ | ||
232 | #define SCCB_WRITE(reg,val) \ | ||
233 | do { \ | ||
234 | int i; \ | ||
235 | scc.cha_b_ctrl = (reg); \ | ||
236 | for (i = uSEC; i > 0; --i) \ | ||
237 | barrier(); \ | ||
238 | scc.cha_b_ctrl = (val); \ | ||
239 | for (i = uSEC; i > 0; --i) \ | ||
240 | barrier(); \ | ||
241 | } while(0) | ||
242 | |||
243 | #define SCCA_WRITE(reg,val) \ | ||
244 | do { \ | ||
245 | int i; \ | ||
246 | scc.cha_a_ctrl = (reg); \ | ||
247 | for (i = uSEC; i > 0; --i) \ | ||
248 | barrier(); \ | ||
249 | scc.cha_a_ctrl = (val); \ | ||
250 | for (i = uSEC; i > 0; --i) \ | ||
251 | barrier(); \ | ||
252 | } while(0) | ||
253 | |||
254 | /* loops_per_jiffy isn't initialized yet, so we can't use udelay(). This does a | ||
255 | * delay of ~ 60us. */ | ||
256 | /* Mac: loops_per_jiffy min. 19000 ^= .5 us; MFPDELAY was 0.6 us*/ | ||
257 | #define LONG_DELAY() \ | ||
258 | do { \ | ||
259 | int i; \ | ||
260 | for (i = 60*uSEC; i > 0; --i) \ | ||
261 | barrier(); \ | ||
262 | } while(0) | ||
263 | |||
264 | static void __init mac_init_scc_port(int cflag, int port) | ||
265 | { | ||
266 | /* | ||
267 | * baud rates: 1200, 1800, 2400, 4800, 9600, 19.2k, 38.4k, 57.6k, 115.2k | ||
268 | */ | ||
269 | |||
270 | static int clksrc_table[9] = | ||
271 | /* reg 11: 0x50 = BRG, 0x00 = RTxC, 0x28 = TRxC */ | ||
272 | { 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x00, 0x00 }; | ||
273 | static int clkmode_table[9] = | ||
274 | /* reg 4: 0x40 = x16, 0x80 = x32, 0xc0 = x64 */ | ||
275 | { 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0xc0, 0x80 }; | ||
276 | static int div_table[9] = | ||
277 | /* reg12 (BRG low) */ | ||
278 | { 94, 62, 46, 22, 10, 4, 1, 0, 0 }; | ||
279 | |||
280 | int baud = cflag & CBAUD; | ||
281 | int clksrc, clkmode, div, reg3, reg5; | ||
282 | |||
283 | if (cflag & CBAUDEX) | ||
284 | baud += B38400; | ||
285 | if (baud < B1200 || baud > B38400+2) | ||
286 | baud = B9600; /* use default 9600bps for non-implemented rates */ | ||
287 | baud -= B1200; /* tables starts at 1200bps */ | ||
288 | |||
289 | clksrc = clksrc_table[baud]; | ||
290 | clkmode = clkmode_table[baud]; | ||
291 | div = div_table[baud]; | ||
292 | |||
293 | reg3 = (((cflag & CSIZE) == CS8) ? 0xc0 : 0x40); | ||
294 | reg5 = (((cflag & CSIZE) == CS8) ? 0x60 : 0x20) | 0x82 /* assert DTR/RTS */; | ||
295 | |||
296 | if (port == 1) { | ||
297 | (void)scc.cha_b_ctrl; /* reset reg pointer */ | ||
298 | SCCB_WRITE(9, 0xc0); /* reset */ | ||
299 | LONG_DELAY(); /* extra delay after WR9 access */ | ||
300 | SCCB_WRITE(4, (cflag & PARENB) ? ((cflag & PARODD) ? 0x01 : 0x03) : 0 | | ||
301 | 0x04 /* 1 stopbit */ | | ||
302 | clkmode); | ||
303 | SCCB_WRITE(3, reg3); | ||
304 | SCCB_WRITE(5, reg5); | ||
305 | SCCB_WRITE(9, 0); /* no interrupts */ | ||
306 | LONG_DELAY(); /* extra delay after WR9 access */ | ||
307 | SCCB_WRITE(10, 0); /* NRZ mode */ | ||
308 | SCCB_WRITE(11, clksrc); /* main clock source */ | ||
309 | SCCB_WRITE(12, div); /* BRG value */ | ||
310 | SCCB_WRITE(13, 0); /* BRG high byte */ | ||
311 | SCCB_WRITE(14, 1); | ||
312 | SCCB_WRITE(3, reg3 | 1); | ||
313 | SCCB_WRITE(5, reg5 | 8); | ||
314 | } else if (port == 0) { | ||
315 | (void)scc.cha_a_ctrl; /* reset reg pointer */ | ||
316 | SCCA_WRITE(9, 0xc0); /* reset */ | ||
317 | LONG_DELAY(); /* extra delay after WR9 access */ | ||
318 | SCCA_WRITE(4, (cflag & PARENB) ? ((cflag & PARODD) ? 0x01 : 0x03) : 0 | | ||
319 | 0x04 /* 1 stopbit */ | | ||
320 | clkmode); | ||
321 | SCCA_WRITE(3, reg3); | ||
322 | SCCA_WRITE(5, reg5); | ||
323 | SCCA_WRITE(9, 0); /* no interrupts */ | ||
324 | LONG_DELAY(); /* extra delay after WR9 access */ | ||
325 | SCCA_WRITE(10, 0); /* NRZ mode */ | ||
326 | SCCA_WRITE(11, clksrc); /* main clock source */ | ||
327 | SCCA_WRITE(12, div); /* BRG value */ | ||
328 | SCCA_WRITE(13, 0); /* BRG high byte */ | ||
329 | SCCA_WRITE(14, 1); | ||
330 | SCCA_WRITE(3, reg3 | 1); | ||
331 | SCCA_WRITE(5, reg5 | 8); | ||
332 | } | ||
333 | } | ||
334 | #endif /* DEBUG_SERIAL */ | ||
335 | |||
336 | static int __init mac_debug_setup(char *arg) | ||
337 | { | ||
338 | if (!MACH_IS_MAC) | ||
339 | return 0; | ||
340 | |||
341 | #ifdef DEBUG_SERIAL | ||
342 | if (!strcmp(arg, "ser") || !strcmp(arg, "ser1")) { | ||
343 | /* Mac modem port */ | ||
344 | mac_init_scc_port(B9600|CS8, 0); | ||
345 | mac_console_driver.write = mac_scca_console_write; | ||
346 | scc_port = 0; | ||
347 | } else if (!strcmp(arg, "ser2")) { | ||
348 | /* Mac printer port */ | ||
349 | mac_init_scc_port(B9600|CS8, 1); | ||
350 | mac_console_driver.write = mac_sccb_console_write; | ||
351 | scc_port = 1; | ||
352 | } | ||
353 | #endif | ||
354 | #ifdef DEBUG_HEADS | ||
355 | if (!strcmp(arg, "scn") || !strcmp(arg, "con")) { | ||
356 | /* display, using head.S console routines */ | ||
357 | mac_console_driver.write = mac_debug_console_write; | ||
358 | } | ||
359 | #endif | ||
360 | if (mac_console_driver.write) | ||
361 | register_console(&mac_console_driver); | ||
362 | return 0; | ||
363 | } | ||
364 | |||
365 | early_param("debug", mac_debug_setup); | ||
diff --git a/arch/m68k/mac/macints.c b/arch/m68k/mac/macints.c index 23711074e0e2..900d899f3323 100644 --- a/arch/m68k/mac/macints.c +++ b/arch/m68k/mac/macints.c | |||
@@ -34,9 +34,7 @@ | |||
34 | * | 34 | * |
35 | * 3 - unused (?) | 35 | * 3 - unused (?) |
36 | * | 36 | * |
37 | * 4 - SCC (slot number determined by reading RR3 on the SSC itself) | 37 | * 4 - SCC |
38 | * - slot 1: SCC channel A | ||
39 | * - slot 2: SCC channel B | ||
40 | * | 38 | * |
41 | * 5 - unused (?) | 39 | * 5 - unused (?) |
42 | * [serial errors or special conditions seem to raise level 6 | 40 | * [serial errors or special conditions seem to raise level 6 |
@@ -55,8 +53,6 @@ | |||
55 | * - slot 5: Slot $E | 53 | * - slot 5: Slot $E |
56 | * | 54 | * |
57 | * 4 - SCC IOP | 55 | * 4 - SCC IOP |
58 | * - slot 1: SCC channel A | ||
59 | * - slot 2: SCC channel B | ||
60 | * | 56 | * |
61 | * 5 - ISM IOP (ADB?) | 57 | * 5 - ISM IOP (ADB?) |
62 | * | 58 | * |
@@ -136,13 +132,8 @@ | |||
136 | #include <asm/irq_regs.h> | 132 | #include <asm/irq_regs.h> |
137 | #include <asm/mac_oss.h> | 133 | #include <asm/mac_oss.h> |
138 | 134 | ||
139 | #define DEBUG_SPURIOUS | ||
140 | #define SHUTUP_SONIC | 135 | #define SHUTUP_SONIC |
141 | 136 | ||
142 | /* SCC interrupt mask */ | ||
143 | |||
144 | static int scc_mask; | ||
145 | |||
146 | /* | 137 | /* |
147 | * VIA/RBV hooks | 138 | * VIA/RBV hooks |
148 | */ | 139 | */ |
@@ -191,13 +182,6 @@ extern void baboon_irq_disable(int); | |||
191 | extern void baboon_irq_clear(int); | 182 | extern void baboon_irq_clear(int); |
192 | 183 | ||
193 | /* | 184 | /* |
194 | * SCC interrupt routines | ||
195 | */ | ||
196 | |||
197 | static void scc_irq_enable(unsigned int); | ||
198 | static void scc_irq_disable(unsigned int); | ||
199 | |||
200 | /* | ||
201 | * console_loglevel determines NMI handler function | 185 | * console_loglevel determines NMI handler function |
202 | */ | 186 | */ |
203 | 187 | ||
@@ -221,8 +205,6 @@ void __init mac_init_IRQ(void) | |||
221 | #ifdef DEBUG_MACINTS | 205 | #ifdef DEBUG_MACINTS |
222 | printk("mac_init_IRQ(): Setting things up...\n"); | 206 | printk("mac_init_IRQ(): Setting things up...\n"); |
223 | #endif | 207 | #endif |
224 | scc_mask = 0; | ||
225 | |||
226 | m68k_setup_irq_controller(&mac_irq_controller, IRQ_USER, | 208 | m68k_setup_irq_controller(&mac_irq_controller, IRQ_USER, |
227 | NUM_MAC_SOURCES - IRQ_USER); | 209 | NUM_MAC_SOURCES - IRQ_USER); |
228 | /* Make sure the SONIC interrupt is cleared or things get ugly */ | 210 | /* Make sure the SONIC interrupt is cleared or things get ugly */ |
@@ -283,15 +265,16 @@ void mac_enable_irq(unsigned int irq) | |||
283 | via_irq_enable(irq); | 265 | via_irq_enable(irq); |
284 | break; | 266 | break; |
285 | case 3: | 267 | case 3: |
286 | case 4: | ||
287 | case 5: | 268 | case 5: |
288 | case 6: | 269 | case 6: |
289 | if (psc_present) | 270 | if (psc_present) |
290 | psc_irq_enable(irq); | 271 | psc_irq_enable(irq); |
291 | else if (oss_present) | 272 | else if (oss_present) |
292 | oss_irq_enable(irq); | 273 | oss_irq_enable(irq); |
293 | else if (irq_src == 4) | 274 | break; |
294 | scc_irq_enable(irq); | 275 | case 4: |
276 | if (psc_present) | ||
277 | psc_irq_enable(irq); | ||
295 | break; | 278 | break; |
296 | case 8: | 279 | case 8: |
297 | if (baboon_present) | 280 | if (baboon_present) |
@@ -316,15 +299,16 @@ void mac_disable_irq(unsigned int irq) | |||
316 | via_irq_disable(irq); | 299 | via_irq_disable(irq); |
317 | break; | 300 | break; |
318 | case 3: | 301 | case 3: |
319 | case 4: | ||
320 | case 5: | 302 | case 5: |
321 | case 6: | 303 | case 6: |
322 | if (psc_present) | 304 | if (psc_present) |
323 | psc_irq_disable(irq); | 305 | psc_irq_disable(irq); |
324 | else if (oss_present) | 306 | else if (oss_present) |
325 | oss_irq_disable(irq); | 307 | oss_irq_disable(irq); |
326 | else if (irq_src == 4) | 308 | break; |
327 | scc_irq_disable(irq); | 309 | case 4: |
310 | if (psc_present) | ||
311 | psc_irq_disable(irq); | ||
328 | break; | 312 | break; |
329 | case 8: | 313 | case 8: |
330 | if (baboon_present) | 314 | if (baboon_present) |
@@ -347,7 +331,6 @@ void mac_clear_irq(unsigned int irq) | |||
347 | via_irq_clear(irq); | 331 | via_irq_clear(irq); |
348 | break; | 332 | break; |
349 | case 3: | 333 | case 3: |
350 | case 4: | ||
351 | case 5: | 334 | case 5: |
352 | case 6: | 335 | case 6: |
353 | if (psc_present) | 336 | if (psc_present) |
@@ -355,6 +338,10 @@ void mac_clear_irq(unsigned int irq) | |||
355 | else if (oss_present) | 338 | else if (oss_present) |
356 | oss_irq_clear(irq); | 339 | oss_irq_clear(irq); |
357 | break; | 340 | break; |
341 | case 4: | ||
342 | if (psc_present) | ||
343 | psc_irq_clear(irq); | ||
344 | break; | ||
358 | case 8: | 345 | case 8: |
359 | if (baboon_present) | 346 | if (baboon_present) |
360 | baboon_irq_clear(irq); | 347 | baboon_irq_clear(irq); |
@@ -374,13 +361,17 @@ int mac_irq_pending(unsigned int irq) | |||
374 | else | 361 | else |
375 | return via_irq_pending(irq); | 362 | return via_irq_pending(irq); |
376 | case 3: | 363 | case 3: |
377 | case 4: | ||
378 | case 5: | 364 | case 5: |
379 | case 6: | 365 | case 6: |
380 | if (psc_present) | 366 | if (psc_present) |
381 | return psc_irq_pending(irq); | 367 | return psc_irq_pending(irq); |
382 | else if (oss_present) | 368 | else if (oss_present) |
383 | return oss_irq_pending(irq); | 369 | return oss_irq_pending(irq); |
370 | break; | ||
371 | case 4: | ||
372 | if (psc_present) | ||
373 | psc_irq_pending(irq); | ||
374 | break; | ||
384 | } | 375 | } |
385 | return 0; | 376 | return 0; |
386 | } | 377 | } |
@@ -448,59 +439,3 @@ irqreturn_t mac_nmi_handler(int irq, void *dev_id) | |||
448 | in_nmi--; | 439 | in_nmi--; |
449 | return IRQ_HANDLED; | 440 | return IRQ_HANDLED; |
450 | } | 441 | } |
451 | |||
452 | /* | ||
453 | * Simple routines for masking and unmasking | ||
454 | * SCC interrupts in cases where this can't be | ||
455 | * done in hardware (only the PSC can do that.) | ||
456 | */ | ||
457 | |||
458 | static void scc_irq_enable(unsigned int irq) | ||
459 | { | ||
460 | int irq_idx = IRQ_IDX(irq); | ||
461 | |||
462 | scc_mask |= (1 << irq_idx); | ||
463 | } | ||
464 | |||
465 | static void scc_irq_disable(unsigned int irq) | ||
466 | { | ||
467 | int irq_idx = IRQ_IDX(irq); | ||
468 | |||
469 | scc_mask &= ~(1 << irq_idx); | ||
470 | } | ||
471 | |||
472 | /* | ||
473 | * SCC master interrupt handler. We have to do a bit of magic here | ||
474 | * to figure out what channel gave us the interrupt; putting this | ||
475 | * here is cleaner than hacking it into drivers/char/macserial.c. | ||
476 | */ | ||
477 | |||
478 | void mac_scc_dispatch(int irq, void *dev_id) | ||
479 | { | ||
480 | volatile unsigned char *scc = (unsigned char *) mac_bi_data.sccbase + 2; | ||
481 | unsigned char reg; | ||
482 | unsigned long flags; | ||
483 | |||
484 | /* Read RR3 from the chip. Always do this on channel A */ | ||
485 | /* This must be an atomic operation so disable irqs. */ | ||
486 | |||
487 | local_irq_save(flags); | ||
488 | *scc = 3; | ||
489 | reg = *scc; | ||
490 | local_irq_restore(flags); | ||
491 | |||
492 | /* Now dispatch. Bits 0-2 are for channel B and */ | ||
493 | /* bits 3-5 are for channel A. We can safely */ | ||
494 | /* ignore the remaining bits here. */ | ||
495 | /* */ | ||
496 | /* Note that we're ignoring scc_mask for now. */ | ||
497 | /* If we actually mask the ints then we tend to */ | ||
498 | /* get hammered by very persistent SCC irqs, */ | ||
499 | /* and since they're autovector interrupts they */ | ||
500 | /* pretty much kill the system. */ | ||
501 | |||
502 | if (reg & 0x38) | ||
503 | m68k_handle_int(IRQ_SCCA); | ||
504 | if (reg & 0x07) | ||
505 | m68k_handle_int(IRQ_SCCB); | ||
506 | } | ||
diff --git a/arch/m68k/mac/misc.c b/arch/m68k/mac/misc.c index 5d818568b343..0f118ca156d9 100644 --- a/arch/m68k/mac/misc.c +++ b/arch/m68k/mac/misc.c | |||
@@ -8,7 +8,6 @@ | |||
8 | #include <linux/kernel.h> | 8 | #include <linux/kernel.h> |
9 | #include <linux/delay.h> | 9 | #include <linux/delay.h> |
10 | #include <linux/sched.h> | 10 | #include <linux/sched.h> |
11 | #include <linux/slab.h> | ||
12 | #include <linux/time.h> | 11 | #include <linux/time.h> |
13 | #include <linux/rtc.h> | 12 | #include <linux/rtc.h> |
14 | #include <linux/mm.h> | 13 | #include <linux/mm.h> |
diff --git a/arch/m68k/mac/oss.c b/arch/m68k/mac/oss.c index f3d23d6ebcf8..a9c0f5ab4cc0 100644 --- a/arch/m68k/mac/oss.c +++ b/arch/m68k/mac/oss.c | |||
@@ -33,7 +33,6 @@ static irqreturn_t oss_irq(int, void *); | |||
33 | static irqreturn_t oss_nubus_irq(int, void *); | 33 | static irqreturn_t oss_nubus_irq(int, void *); |
34 | 34 | ||
35 | extern irqreturn_t via1_irq(int, void *); | 35 | extern irqreturn_t via1_irq(int, void *); |
36 | extern irqreturn_t mac_scc_dispatch(int, void *); | ||
37 | 36 | ||
38 | /* | 37 | /* |
39 | * Initialize the OSS | 38 | * Initialize the OSS |
@@ -69,9 +68,6 @@ void __init oss_register_interrupts(void) | |||
69 | if (request_irq(OSS_IRQLEV_SCSI, oss_irq, IRQ_FLG_LOCK, | 68 | if (request_irq(OSS_IRQLEV_SCSI, oss_irq, IRQ_FLG_LOCK, |
70 | "scsi", (void *) oss)) | 69 | "scsi", (void *) oss)) |
71 | pr_err("Couldn't register %s interrupt\n", "scsi"); | 70 | pr_err("Couldn't register %s interrupt\n", "scsi"); |
72 | if (request_irq(OSS_IRQLEV_IOPSCC, mac_scc_dispatch, IRQ_FLG_LOCK, | ||
73 | "scc", mac_scc_dispatch)) | ||
74 | pr_err("Couldn't register %s interrupt\n", "scc"); | ||
75 | if (request_irq(OSS_IRQLEV_NUBUS, oss_nubus_irq, IRQ_FLG_LOCK, | 71 | if (request_irq(OSS_IRQLEV_NUBUS, oss_nubus_irq, IRQ_FLG_LOCK, |
76 | "nubus", (void *) oss)) | 72 | "nubus", (void *) oss)) |
77 | pr_err("Couldn't register %s interrupt\n", "nubus"); | 73 | pr_err("Couldn't register %s interrupt\n", "nubus"); |
@@ -172,9 +168,7 @@ void oss_irq_enable(int irq) { | |||
172 | printk("oss_irq_enable(%d)\n", irq); | 168 | printk("oss_irq_enable(%d)\n", irq); |
173 | #endif | 169 | #endif |
174 | switch(irq) { | 170 | switch(irq) { |
175 | case IRQ_SCC: | 171 | case IRQ_MAC_SCC: |
176 | case IRQ_SCCA: | ||
177 | case IRQ_SCCB: | ||
178 | oss->irq_level[OSS_IOPSCC] = OSS_IRQLEV_IOPSCC; | 172 | oss->irq_level[OSS_IOPSCC] = OSS_IRQLEV_IOPSCC; |
179 | break; | 173 | break; |
180 | case IRQ_MAC_ADB: | 174 | case IRQ_MAC_ADB: |
@@ -212,9 +206,7 @@ void oss_irq_disable(int irq) { | |||
212 | printk("oss_irq_disable(%d)\n", irq); | 206 | printk("oss_irq_disable(%d)\n", irq); |
213 | #endif | 207 | #endif |
214 | switch(irq) { | 208 | switch(irq) { |
215 | case IRQ_SCC: | 209 | case IRQ_MAC_SCC: |
216 | case IRQ_SCCA: | ||
217 | case IRQ_SCCB: | ||
218 | oss->irq_level[OSS_IOPSCC] = OSS_IRQLEV_DISABLED; | 210 | oss->irq_level[OSS_IOPSCC] = OSS_IRQLEV_DISABLED; |
219 | break; | 211 | break; |
220 | case IRQ_MAC_ADB: | 212 | case IRQ_MAC_ADB: |
@@ -250,9 +242,7 @@ void oss_irq_disable(int irq) { | |||
250 | void oss_irq_clear(int irq) { | 242 | void oss_irq_clear(int irq) { |
251 | /* FIXME: how to do this on OSS? */ | 243 | /* FIXME: how to do this on OSS? */ |
252 | switch(irq) { | 244 | switch(irq) { |
253 | case IRQ_SCC: | 245 | case IRQ_MAC_SCC: |
254 | case IRQ_SCCA: | ||
255 | case IRQ_SCCB: | ||
256 | oss->irq_pending &= ~OSS_IP_IOPSCC; | 246 | oss->irq_pending &= ~OSS_IP_IOPSCC; |
257 | break; | 247 | break; |
258 | case IRQ_MAC_ADB: | 248 | case IRQ_MAC_ADB: |
@@ -280,9 +270,7 @@ void oss_irq_clear(int irq) { | |||
280 | int oss_irq_pending(int irq) | 270 | int oss_irq_pending(int irq) |
281 | { | 271 | { |
282 | switch(irq) { | 272 | switch(irq) { |
283 | case IRQ_SCC: | 273 | case IRQ_MAC_SCC: |
284 | case IRQ_SCCA: | ||
285 | case IRQ_SCCB: | ||
286 | return oss->irq_pending & OSS_IP_IOPSCC; | 274 | return oss->irq_pending & OSS_IP_IOPSCC; |
287 | break; | 275 | break; |
288 | case IRQ_MAC_ADB: | 276 | case IRQ_MAC_ADB: |
diff --git a/arch/m68k/mac/via.c b/arch/m68k/mac/via.c index 11bce3cb6482..e71166daec6a 100644 --- a/arch/m68k/mac/via.c +++ b/arch/m68k/mac/via.c | |||
@@ -84,8 +84,6 @@ void via_irq_enable(int irq); | |||
84 | void via_irq_disable(int irq); | 84 | void via_irq_disable(int irq); |
85 | void via_irq_clear(int irq); | 85 | void via_irq_clear(int irq); |
86 | 86 | ||
87 | extern irqreturn_t mac_scc_dispatch(int, void *); | ||
88 | |||
89 | /* | 87 | /* |
90 | * Initialize the VIAs | 88 | * Initialize the VIAs |
91 | * | 89 | * |
@@ -311,11 +309,6 @@ void __init via_register_interrupts(void) | |||
311 | if (request_irq(IRQ_AUTO_2, via2_irq, IRQ_FLG_LOCK|IRQ_FLG_FAST, | 309 | if (request_irq(IRQ_AUTO_2, via2_irq, IRQ_FLG_LOCK|IRQ_FLG_FAST, |
312 | "via2", (void *) via2)) | 310 | "via2", (void *) via2)) |
313 | pr_err("Couldn't register %s interrupt\n", "via2"); | 311 | pr_err("Couldn't register %s interrupt\n", "via2"); |
314 | if (!psc_present) { | ||
315 | if (request_irq(IRQ_AUTO_4, mac_scc_dispatch, IRQ_FLG_LOCK, | ||
316 | "scc", mac_scc_dispatch)) | ||
317 | pr_err("Couldn't register %s interrupt\n", "scc"); | ||
318 | } | ||
319 | if (request_irq(IRQ_MAC_NUBUS, via_nubus_irq, | 312 | if (request_irq(IRQ_MAC_NUBUS, via_nubus_irq, |
320 | IRQ_FLG_LOCK|IRQ_FLG_FAST, "nubus", (void *) via2)) | 313 | IRQ_FLG_LOCK|IRQ_FLG_FAST, "nubus", (void *) via2)) |
321 | pr_err("Couldn't register %s interrupt\n", "nubus"); | 314 | pr_err("Couldn't register %s interrupt\n", "nubus"); |
diff --git a/arch/m68k/mm/init.c b/arch/m68k/mm/init.c index 774549accd2d..8bc842554e5b 100644 --- a/arch/m68k/mm/init.c +++ b/arch/m68k/mm/init.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/types.h> | 17 | #include <linux/types.h> |
18 | #include <linux/init.h> | 18 | #include <linux/init.h> |
19 | #include <linux/bootmem.h> | 19 | #include <linux/bootmem.h> |
20 | #include <linux/gfp.h> | ||
20 | 21 | ||
21 | #include <asm/setup.h> | 22 | #include <asm/setup.h> |
22 | #include <asm/uaccess.h> | 23 | #include <asm/uaccess.h> |
diff --git a/arch/m68k/mm/kmap.c b/arch/m68k/mm/kmap.c index df620ac2a296..69345849454b 100644 --- a/arch/m68k/mm/kmap.c +++ b/arch/m68k/mm/kmap.c | |||
@@ -99,8 +99,7 @@ static inline void free_io_area(void *addr) | |||
99 | #endif | 99 | #endif |
100 | 100 | ||
101 | /* | 101 | /* |
102 | * Map some physical address range into the kernel address space. The | 102 | * Map some physical address range into the kernel address space. |
103 | * code is copied and adapted from map_chunk(). | ||
104 | */ | 103 | */ |
105 | /* Rewritten by Andreas Schwab to remove all races. */ | 104 | /* Rewritten by Andreas Schwab to remove all races. */ |
106 | 105 | ||
@@ -116,7 +115,7 @@ void __iomem *__ioremap(unsigned long physaddr, unsigned long size, int cachefla | |||
116 | /* | 115 | /* |
117 | * Don't allow mappings that wrap.. | 116 | * Don't allow mappings that wrap.. |
118 | */ | 117 | */ |
119 | if (!size || size > physaddr + size) | 118 | if (!size || physaddr > (unsigned long)(-size)) |
120 | return NULL; | 119 | return NULL; |
121 | 120 | ||
122 | #ifdef CONFIG_AMIGA | 121 | #ifdef CONFIG_AMIGA |
diff --git a/arch/m68k/mm/memory.c b/arch/m68k/mm/memory.c index b7473525b431..34c77ce24fba 100644 --- a/arch/m68k/mm/memory.c +++ b/arch/m68k/mm/memory.c | |||
@@ -9,9 +9,9 @@ | |||
9 | #include <linux/kernel.h> | 9 | #include <linux/kernel.h> |
10 | #include <linux/string.h> | 10 | #include <linux/string.h> |
11 | #include <linux/types.h> | 11 | #include <linux/types.h> |
12 | #include <linux/slab.h> | ||
13 | #include <linux/init.h> | 12 | #include <linux/init.h> |
14 | #include <linux/pagemap.h> | 13 | #include <linux/pagemap.h> |
14 | #include <linux/gfp.h> | ||
15 | 15 | ||
16 | #include <asm/setup.h> | 16 | #include <asm/setup.h> |
17 | #include <asm/segment.h> | 17 | #include <asm/segment.h> |
diff --git a/arch/m68k/mm/motorola.c b/arch/m68k/mm/motorola.c index 4665fc84b7dc..02b7a03e4226 100644 --- a/arch/m68k/mm/motorola.c +++ b/arch/m68k/mm/motorola.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/types.h> | 18 | #include <linux/types.h> |
19 | #include <linux/init.h> | 19 | #include <linux/init.h> |
20 | #include <linux/bootmem.h> | 20 | #include <linux/bootmem.h> |
21 | #include <linux/gfp.h> | ||
21 | 22 | ||
22 | #include <asm/setup.h> | 23 | #include <asm/setup.h> |
23 | #include <asm/uaccess.h> | 24 | #include <asm/uaccess.h> |
diff --git a/arch/m68k/mvme16x/rtc.c b/arch/m68k/mvme16x/rtc.c index cea5e3e4e636..8da9c250d3e1 100644 --- a/arch/m68k/mvme16x/rtc.c +++ b/arch/m68k/mvme16x/rtc.c | |||
@@ -9,7 +9,6 @@ | |||
9 | #include <linux/types.h> | 9 | #include <linux/types.h> |
10 | #include <linux/errno.h> | 10 | #include <linux/errno.h> |
11 | #include <linux/miscdevice.h> | 11 | #include <linux/miscdevice.h> |
12 | #include <linux/slab.h> | ||
13 | #include <linux/smp_lock.h> | 12 | #include <linux/smp_lock.h> |
14 | #include <linux/ioport.h> | 13 | #include <linux/ioport.h> |
15 | #include <linux/capability.h> | 14 | #include <linux/capability.h> |
diff --git a/arch/m68k/sun3/mmu_emu.c b/arch/m68k/sun3/mmu_emu.c index 3cd19390aae5..94f81ecfe3f8 100644 --- a/arch/m68k/sun3/mmu_emu.c +++ b/arch/m68k/sun3/mmu_emu.c | |||
@@ -45,8 +45,8 @@ | |||
45 | ** Globals | 45 | ** Globals |
46 | */ | 46 | */ |
47 | 47 | ||
48 | unsigned long vmalloc_end; | 48 | unsigned long m68k_vmalloc_end; |
49 | EXPORT_SYMBOL(vmalloc_end); | 49 | EXPORT_SYMBOL(m68k_vmalloc_end); |
50 | 50 | ||
51 | unsigned long pmeg_vaddr[PMEGS_NUM]; | 51 | unsigned long pmeg_vaddr[PMEGS_NUM]; |
52 | unsigned char pmeg_alloc[PMEGS_NUM]; | 52 | unsigned char pmeg_alloc[PMEGS_NUM]; |
@@ -172,8 +172,8 @@ void mmu_emu_init(unsigned long bootmem_end) | |||
172 | #endif | 172 | #endif |
173 | // the lowest mapping here is the end of our | 173 | // the lowest mapping here is the end of our |
174 | // vmalloc region | 174 | // vmalloc region |
175 | if(!vmalloc_end) | 175 | if (!m68k_vmalloc_end) |
176 | vmalloc_end = seg; | 176 | m68k_vmalloc_end = seg; |
177 | 177 | ||
178 | // mark the segmap alloc'd, and reserve any | 178 | // mark the segmap alloc'd, and reserve any |
179 | // of the first 0xbff pages the hardware is | 179 | // of the first 0xbff pages the hardware is |
diff --git a/arch/m68k/sun3/sun3dvma.c b/arch/m68k/sun3/sun3dvma.c index f9277e8b4159..ca0966cac72a 100644 --- a/arch/m68k/sun3/sun3dvma.c +++ b/arch/m68k/sun3/sun3dvma.c | |||
@@ -8,6 +8,7 @@ | |||
8 | 8 | ||
9 | #include <linux/module.h> | 9 | #include <linux/module.h> |
10 | #include <linux/kernel.h> | 10 | #include <linux/kernel.h> |
11 | #include <linux/gfp.h> | ||
11 | #include <linux/mm.h> | 12 | #include <linux/mm.h> |
12 | #include <linux/list.h> | 13 | #include <linux/list.h> |
13 | 14 | ||
diff --git a/arch/m68k/sun3x/dvma.c b/arch/m68k/sun3x/dvma.c index 117481e86305..d5ddcdaa2347 100644 --- a/arch/m68k/sun3x/dvma.c +++ b/arch/m68k/sun3x/dvma.c | |||
@@ -15,7 +15,6 @@ | |||
15 | #include <linux/bitops.h> | 15 | #include <linux/bitops.h> |
16 | #include <linux/mm.h> | 16 | #include <linux/mm.h> |
17 | #include <linux/bootmem.h> | 17 | #include <linux/bootmem.h> |
18 | #include <linux/slab.h> | ||
19 | #include <linux/vmalloc.h> | 18 | #include <linux/vmalloc.h> |
20 | 19 | ||
21 | #include <asm/sun3x.h> | 20 | #include <asm/sun3x.h> |