diff options
Diffstat (limited to 'arch/m68k')
-rw-r--r-- | arch/m68k/Kconfig | 6 | ||||
-rw-r--r-- | arch/m68k/ifpsp060/src/fpsp.S | 28 | ||||
-rw-r--r-- | arch/m68k/ifpsp060/src/pfpsp.S | 26 | ||||
-rw-r--r-- | arch/m68k/include/asm/bootinfo.h | 2 | ||||
-rw-r--r-- | arch/m68k/include/asm/cacheflush_mm.h | 1 | ||||
-rw-r--r-- | arch/m68k/include/asm/cacheflush_no.h | 1 | ||||
-rw-r--r-- | arch/m68k/include/asm/processor.h | 2 | ||||
-rw-r--r-- | arch/m68k/include/asm/ptrace.h | 17 | ||||
-rw-r--r-- | arch/m68k/include/asm/socket.h | 2 | ||||
-rw-r--r-- | arch/m68k/include/asm/thread_info_mm.h | 5 | ||||
-rw-r--r-- | arch/m68k/include/asm/thread_info_no.h | 4 | ||||
-rw-r--r-- | arch/m68k/kernel/entry.S | 6 | ||||
-rw-r--r-- | arch/m68k/kernel/process.c | 5 | ||||
-rw-r--r-- | arch/m68k/kernel/ptrace.c | 112 | ||||
-rw-r--r-- | arch/m68k/kernel/sys_m68k.c | 83 | ||||
-rw-r--r-- | arch/m68k/kernel/vmlinux-std.lds | 61 | ||||
-rw-r--r-- | arch/m68k/kernel/vmlinux-sun3.lds | 54 |
17 files changed, 140 insertions, 275 deletions
diff --git a/arch/m68k/Kconfig b/arch/m68k/Kconfig index 29dd8489ffec..ecdc19a299b2 100644 --- a/arch/m68k/Kconfig +++ b/arch/m68k/Kconfig | |||
@@ -561,7 +561,7 @@ config HPAPCI | |||
561 | 561 | ||
562 | config MVME147_SCC | 562 | config MVME147_SCC |
563 | bool "SCC support for MVME147 serial ports" | 563 | bool "SCC support for MVME147 serial ports" |
564 | depends on MVME147 | 564 | depends on MVME147 && BROKEN |
565 | help | 565 | help |
566 | This is the driver for the serial ports on the Motorola MVME147 | 566 | This is the driver for the serial ports on the Motorola MVME147 |
567 | boards. Everyone using one of these boards should say Y here. | 567 | boards. Everyone using one of these boards should say Y here. |
@@ -576,14 +576,14 @@ config SERIAL167 | |||
576 | 576 | ||
577 | config MVME162_SCC | 577 | config MVME162_SCC |
578 | bool "SCC support for MVME162 serial ports" | 578 | bool "SCC support for MVME162 serial ports" |
579 | depends on MVME16x | 579 | depends on MVME16x && BROKEN |
580 | help | 580 | help |
581 | This is the driver for the serial ports on the Motorola MVME162 and | 581 | This is the driver for the serial ports on the Motorola MVME162 and |
582 | 172 boards. Everyone using one of these boards should say Y here. | 582 | 172 boards. Everyone using one of these boards should say Y here. |
583 | 583 | ||
584 | config BVME6000_SCC | 584 | config BVME6000_SCC |
585 | bool "SCC support for BVME6000 serial ports" | 585 | bool "SCC support for BVME6000 serial ports" |
586 | depends on BVME6000 | 586 | depends on BVME6000 && BROKEN |
587 | help | 587 | help |
588 | This is the driver for the serial ports on the BVME4000 and BVME6000 | 588 | This is the driver for the serial ports on the BVME4000 and BVME6000 |
589 | boards from BVM Ltd. Everyone using one of these boards should say | 589 | boards from BVM Ltd. Everyone using one of these boards should say |
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/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/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..ee4011c23281 100644 --- a/arch/m68k/include/asm/ptrace.h +++ b/arch/m68k/include/asm/ptrace.h | |||
@@ -71,6 +71,8 @@ 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_SINGLEBLOCK 33 /* resume execution until next branch */ | ||
75 | |||
74 | #ifdef __KERNEL__ | 76 | #ifdef __KERNEL__ |
75 | 77 | ||
76 | #ifndef PS_S | 78 | #ifndef PS_S |
@@ -82,6 +84,21 @@ struct switch_stack { | |||
82 | #define instruction_pointer(regs) ((regs)->pc) | 84 | #define instruction_pointer(regs) ((regs)->pc) |
83 | #define profile_pc(regs) instruction_pointer(regs) | 85 | #define profile_pc(regs) instruction_pointer(regs) |
84 | extern void show_regs(struct pt_regs *); | 86 | extern void show_regs(struct pt_regs *); |
87 | |||
88 | /* | ||
89 | * These are defined as per linux/ptrace.h. | ||
90 | */ | ||
91 | struct task_struct; | ||
92 | |||
93 | #define arch_has_single_step() (1) | ||
94 | extern void user_enable_single_step(struct task_struct *); | ||
95 | extern void user_disable_single_step(struct task_struct *); | ||
96 | |||
97 | #ifdef CONFIG_MMU | ||
98 | #define arch_has_block_step() (1) | ||
99 | extern void user_enable_block_step(struct task_struct *); | ||
100 | #endif | ||
101 | |||
85 | #endif /* __KERNEL__ */ | 102 | #endif /* __KERNEL__ */ |
86 | #endif /* __ASSEMBLY__ */ | 103 | #endif /* __ASSEMBLY__ */ |
87 | #endif /* _M68K_PTRACE_H */ | 104 | #endif /* _M68K_PTRACE_H */ |
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/thread_info_mm.h b/arch/m68k/include/asm/thread_info_mm.h index b6da3882be9b..167e518db41b 100644 --- a/arch/m68k/include/asm/thread_info_mm.h +++ b/arch/m68k/include/asm/thread_info_mm.h | |||
@@ -4,10 +4,12 @@ | |||
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; |
@@ -16,6 +18,7 @@ struct thread_info { | |||
16 | __u32 cpu; /* should always be 0 on m68k */ | 18 | __u32 cpu; /* should always be 0 on m68k */ |
17 | struct restart_block restart_block; | 19 | struct restart_block restart_block; |
18 | }; | 20 | }; |
21 | #endif /* __ASSEMBLY__ */ | ||
19 | 22 | ||
20 | #define PREEMPT_ACTIVE 0x4000000 | 23 | #define PREEMPT_ACTIVE 0x4000000 |
21 | 24 | ||
diff --git a/arch/m68k/include/asm/thread_info_no.h b/arch/m68k/include/asm/thread_info_no.h index c2bde5e24b0b..a6512bfdd01d 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 | */ |
diff --git a/arch/m68k/kernel/entry.S b/arch/m68k/kernel/entry.S index c5b33634c980..77fc7c16bf48 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 |
diff --git a/arch/m68k/kernel/process.c b/arch/m68k/kernel/process.c index 41230c595a8e..05296593e718 100644 --- a/arch/m68k/kernel/process.c +++ b/arch/m68k/kernel/process.c | |||
@@ -317,15 +317,12 @@ asmlinkage int sys_execve(char __user *name, char __user * __user *argv, char __ | |||
317 | char * filename; | 317 | char * filename; |
318 | struct pt_regs *regs = (struct pt_regs *) &name; | 318 | struct pt_regs *regs = (struct pt_regs *) &name; |
319 | 319 | ||
320 | lock_kernel(); | ||
321 | filename = getname(name); | 320 | filename = getname(name); |
322 | error = PTR_ERR(filename); | 321 | error = PTR_ERR(filename); |
323 | if (IS_ERR(filename)) | 322 | if (IS_ERR(filename)) |
324 | goto out; | 323 | return error; |
325 | error = do_execve(filename, argv, envp, regs); | 324 | error = do_execve(filename, argv, envp, regs); |
326 | putname(filename); | 325 | putname(filename); |
327 | out: | ||
328 | unlock_kernel(); | ||
329 | return error; | 326 | return error; |
330 | } | 327 | } |
331 | 328 | ||
diff --git a/arch/m68k/kernel/ptrace.c b/arch/m68k/kernel/ptrace.c index 2075543c2d92..1fc217e5f06b 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); |
diff --git a/arch/m68k/kernel/sys_m68k.c b/arch/m68k/kernel/sys_m68k.c index 7deb402bfc75..218f441de667 100644 --- a/arch/m68k/kernel/sys_m68k.c +++ b/arch/m68k/kernel/sys_m68k.c | |||
@@ -29,37 +29,16 @@ | |||
29 | #include <asm/page.h> | 29 | #include <asm/page.h> |
30 | #include <asm/unistd.h> | 30 | #include <asm/unistd.h> |
31 | 31 | ||
32 | /* common code for old and new mmaps */ | ||
33 | static inline long do_mmap2( | ||
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 | |||
58 | asmlinkage long sys_mmap2(unsigned long addr, unsigned long len, | 32 | asmlinkage long sys_mmap2(unsigned long addr, unsigned long len, |
59 | unsigned long prot, unsigned long flags, | 33 | unsigned long prot, unsigned long flags, |
60 | unsigned long fd, unsigned long pgoff) | 34 | unsigned long fd, unsigned long pgoff) |
61 | { | 35 | { |
62 | return do_mmap2(addr, len, prot, flags, fd, pgoff); | 36 | /* |
37 | * This is wrong for sun3 - there PAGE_SIZE is 8Kb, | ||
38 | * so we need to shift the argument down by 1; m68k mmap64(3) | ||
39 | * (in libc) expects the last argument of mmap2 in 4Kb units. | ||
40 | */ | ||
41 | return sys_mmap_pgoff(addr, len, prot, flags, fd, pgoff); | ||
63 | } | 42 | } |
64 | 43 | ||
65 | /* | 44 | /* |
@@ -90,57 +69,11 @@ asmlinkage int old_mmap(struct mmap_arg_struct __user *arg) | |||
90 | if (a.offset & ~PAGE_MASK) | 69 | if (a.offset & ~PAGE_MASK) |
91 | goto out; | 70 | goto out; |
92 | 71 | ||
93 | a.flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE); | 72 | error = sys_mmap_pgoff(a.addr, a.len, a.prot, a.flags, a.fd, |
94 | 73 | a.offset >> PAGE_SHIFT); | |
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: | 74 | out: |
141 | return error; | 75 | return error; |
142 | } | 76 | } |
143 | #endif | ||
144 | 77 | ||
145 | struct sel_arg_struct { | 78 | struct sel_arg_struct { |
146 | unsigned long n; | 79 | unsigned long n; |
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 |