|
32 | 32 | /* |
33 | 33 | * Our undef handlers (in entry.S) |
34 | 34 | */ |
35 | | -asmlinkage void vfp_support_entry(void); |
36 | | -asmlinkage void vfp_null_entry(void); |
| 35 | +asmlinkage void vfp_support_entry(u32, void *, u32, u32); |
37 | 36 |
|
38 | | -asmlinkage void (*vfp_vector)(void) = vfp_null_entry; |
| 37 | +static bool have_vfp __ro_after_init; |
39 | 38 |
|
40 | 39 | /* |
41 | 40 | * Dual-use variable. |
@@ -645,6 +644,25 @@ static int vfp_starting_cpu(unsigned int unused) |
645 | 644 | return 0; |
646 | 645 | } |
647 | 646 |
|
| 647 | +/* |
| 648 | + * Entered with: |
| 649 | + * |
| 650 | + * r0 = instruction opcode (32-bit ARM or two 16-bit Thumb) |
| 651 | + * r1 = thread_info pointer |
| 652 | + * r2 = PC value to resume execution after successful emulation |
| 653 | + * r3 = normal "successful" return address |
| 654 | + * lr = unrecognised instruction return address |
| 655 | + */ |
| 656 | +asmlinkage void vfp_entry(u32 trigger, struct thread_info *ti, u32 resume_pc, |
| 657 | + u32 resume_return_address) |
| 658 | +{ |
| 659 | + if (unlikely(!have_vfp)) |
| 660 | + return; |
| 661 | + |
| 662 | + local_bh_disable(); |
| 663 | + vfp_support_entry(trigger, ti, resume_pc, resume_return_address); |
| 664 | +} |
| 665 | + |
648 | 666 | #ifdef CONFIG_KERNEL_MODE_NEON |
649 | 667 |
|
650 | 668 | static int vfp_kmode_exception(struct pt_regs *regs, unsigned int instr) |
@@ -798,7 +816,6 @@ static int __init vfp_init(void) |
798 | 816 | vfpsid = fmrx(FPSID); |
799 | 817 | barrier(); |
800 | 818 | unregister_undef_hook(&vfp_detect_hook); |
801 | | - vfp_vector = vfp_null_entry; |
802 | 819 |
|
803 | 820 | pr_info("VFP support v0.3: "); |
804 | 821 | if (VFP_arch) { |
@@ -883,7 +900,7 @@ static int __init vfp_init(void) |
883 | 900 | "arm/vfp:starting", vfp_starting_cpu, |
884 | 901 | vfp_dying_cpu); |
885 | 902 |
|
886 | | - vfp_vector = vfp_support_entry; |
| 903 | + have_vfp = true; |
887 | 904 |
|
888 | 905 | thread_register_notifier(&vfp_notifier_block); |
889 | 906 | vfp_pm_init(); |
|
0 commit comments