source: rtems/bsps/m68k/shared/fpsp/x_unimp.S @ b82a4b4

5
Last change on this file since b82a4b4 was 3cf2bf63, checked in by Sebastian Huber <sebastian.huber@…>, on 03/26/18 at 10:17:06

bsps/m68k: Move fpsp support to bsps

This patch is a part of the BSP source reorganization.

Update #3285.

  • Property mode set to 100644
File size: 2.1 KB
Line 
1#include "fpsp-namespace.h"
2//
3//
4//      x_unimp.sa 3.3 7/1/91
5//
6//      fpsp_unimp --- FPSP handler for unimplemented instruction
7//      exception.
8//
9// Invoked when the user program encounters a floating-point
10// op-code that hardware does not support.  Trap vector# 11
11// (See table 8-1 MC68030 User's Manual).
12//
13//
14// Note: An fsave for an unimplemented inst. will create a short
15// fsave stack.
16//
17//  Input: 1. Six word stack frame for unimplemented inst, four word
18//            for illegal
19//            (See table 8-7 MC68030 User's Manual).
20//         2. Unimp (short) fsave state frame created here by fsave
21//            instruction.
22//
23//
24//              Copyright (C) Motorola, Inc. 1990
25//                      All Rights Reserved
26//
27//      THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF MOTOROLA
28//      The copyright notice above does not evidence any
29//      actual or intended publication of such source code.
30
31X_UNIMP:        //idnt    2,1 | Motorola 040 Floating Point Software Package
32
33        |section        8
34
35#include "fpsp.defs"
36
37        |xref   get_op
38        |xref   do_func
39        |xref   sto_res
40        |xref   gen_except
41        |xref   fpsp_fmt_error
42
43        .global fpsp_unimp
44        .global uni_2
45fpsp_unimp:
46        link            %a6,#-LOCAL_SIZE
47        fsave           -(%a7)
48uni_2:
49        moveml          %d0-%d1/%a0-%a1,USER_DA(%a6)
50        fmovemx %fp0-%fp3,USER_FP0(%a6)
51        fmoveml %fpcr/%fpsr/%fpiar,USER_FPCR(%a6)
52        moveb           (%a7),%d0               //test for valid version num
53        andib           #0xf0,%d0               //test for $4x
54        cmpib           #VER_4,%d0      //must be $4x or exit
55        bnel            fpsp_fmt_error
56//
57//      Temporary D25B Fix
58//      The following lines are used to ensure that the FPSR
59//      exception byte and condition codes are clear before proceeding
60//
61        movel           USER_FPSR(%a6),%d0
62        andl            #0xFF00FF,%d0   //clear all but accrued exceptions
63        movel           %d0,USER_FPSR(%a6)
64        fmovel          #0,%FPSR //clear all user bits
65        fmovel          #0,%FPCR        //clear all user exceptions for FPSP
66
67        clrb            UFLG_TMP(%a6)   //clr flag for unsupp data
68
69        bsrl            get_op          //go get operand(s)
70        clrb            STORE_FLG(%a6)
71        bsrl            do_func         //do the function
72        fsave           -(%a7)          //capture possible exc state
73        tstb            STORE_FLG(%a6)
74        bnes            no_store        //if STORE_FLG is set, no store
75        bsrl            sto_res         //store the result in user space
76no_store:
77        bral            gen_except      //post any exceptions and return
78
79        |end
Note: See TracBrowser for help on using the repository browser.