Print this page
de-linting of .s files

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/sun4u/ml/mach_locore.s
          +++ new/usr/src/uts/sun4u/ml/mach_locore.s
↓ open down ↓ 15 lines elided ↑ open up ↑
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  /*
  22   22   * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  23   23   * Use is subject to license terms.
  24   24   */
  25   25  
  26      -#pragma ident   "%Z%%M% %I%     %E% SMI"
  27      -
  28      -#if defined(lint)
  29      -#include <sys/types.h>
  30      -#include <sys/t_lock.h>
  31      -#include <sys/promif.h>
  32      -#include <sys/prom_isa.h>
  33      -#endif  /* lint */
  34      -
  35   26  #include <sys/asm_linkage.h>
  36   27  #include <sys/intreg.h>
  37   28  #include <sys/ivintr.h>
  38   29  #include <sys/mmu.h>
  39   30  #include <sys/machpcb.h>
  40   31  #include <sys/machtrap.h>
  41   32  #include <sys/machlock.h>
  42   33  #include <sys/fdreg.h>
  43   34  #include <sys/vis.h>
  44   35  #include <sys/traptrace.h>
  45   36  #include <sys/panic.h>
  46   37  #include <sys/machasi.h>
  47   38  #include <sys/clock.h>
  48   39  #include <vm/hat_sfmmu.h>
  49      -#if defined(lint)
  50   40  
  51      -#include <sys/thread.h>
  52      -#include <sys/time.h>
  53      -
  54      -#else   /* lint */
  55      -
  56   41  #include "assym.h"
  57   42  
  58   43  
  59   44  !
  60   45  ! REGOFF must add up to allow double word access to r_tstate.
  61   46  ! PCB_WBUF must also be aligned.
  62   47  !
  63   48  #if (REGOFF & 7) != 0
  64   49  #error "struct regs not aligned"
  65   50  #endif
↓ open down ↓ 101 lines elided ↑ open up ↑
 167  152  #ifdef  NOPROM
 168  153          .global availmem
 169  154  availmem:
 170  155          .word   0
 171  156  #endif  /* NOPROM */
 172  157  
 173  158          .align  8
 174  159  _local_p1275cis:
 175  160          .nword  0
 176  161  
 177      -#endif  /* lint */
 178      -
 179      -#if defined(lint)
 180      -
 181      -void
 182      -_start(void)
 183      -{}
 184      -
 185      -#else /* lint */
 186      -
 187  162          .seg    ".data"
 188  163  
 189  164          .global nwindows, nwin_minus_one, winmask
 190  165  nwindows:
 191  166          .word   8
 192  167  nwin_minus_one:
 193  168          .word   7
 194  169  winmask:
 195  170          .word   8
 196  171  
↓ open down ↓ 152 lines elided ↑ open up ↑
 349  324          !
 350  325          set     .mainretmsg, %o0
 351  326          call    panic
 352  327          nop
 353  328          SET_SIZE(_start)
 354  329  
 355  330  .mainretmsg:
 356  331          .asciz  "main returned"
 357  332          .align  4
 358  333  
 359      -#endif  /* lint */
 360  334  
 361      -
 362  335  /*
 363  336   * Generic system trap handler.
 364  337   *
 365  338   * Some kernel trap handlers save themselves from buying a window by
 366  339   * borrowing some of sys_trap's unused locals. %l0 thru %l3 may be used
 367  340   * for this purpose, as user_rtt and priv_rtt do not depend on them.
 368  341   * %l4 thru %l7 should NOT be used this way.
 369  342   *
 370  343   * Entry Conditions:
 371  344   *      %pstate         am:0 priv:1 ie:0
↓ open down ↓ 15 lines elided ↑ open up ↑
 387  360   * Called function prototype variants:
 388  361   *
 389  362   *      func(struct regs *rp);
 390  363   *      func(struct regs *rp, uintptr_t arg1 [%g2], uintptr_t arg2 [%g3])
 391  364   *      func(struct regs *rp, uintptr_t arg1 [%g2],
 392  365   *          uint32_t arg2 [%g3.l], uint32_t arg3 [%g3.h])
 393  366   *      func(struct regs *rp, uint32_t arg1 [%g2.l],
 394  367   *          uint32_t arg2 [%g3.l], uint32_t arg3 [%g3.h], uint32_t [%g2.h])
 395  368   */
 396  369  
 397      -#if defined(lint)
 398      -
 399      -void
 400      -sys_trap(void)
 401      -{}
 402      -
 403      -#else   /* lint */
 404      -
 405  370          ENTRY_NP(sys_trap)
 406  371          !
 407  372          ! force tl=1, update %cwp, branch to correct handler
 408  373          !
 409  374          wrpr    %g0, 1, %tl
 410  375          rdpr    %tstate, %g5
 411  376          btst    TSTATE_PRIV, %g5
 412  377          and     %g5, TSTATE_CWP, %g6
 413  378          bnz,pn  %xcc, priv_trap
 414  379          wrpr    %g0, %g6, %cwp
↓ open down ↓ 453 lines elided ↑ open up ↑
 868  833          ! set %tstate to the correct %cwp
 869  834          ! retry resumes prom execution
 870  835          !
 871  836          rdpr    %cwp, %g1
 872  837          wrpr    %g1, %g7, %tstate
 873  838          retry
 874  839          /* NOTREACHED */
 875  840          SET_SIZE(priv_rtt)
 876  841          SET_SIZE(ktl0)
 877  842  
 878      -#endif  /* lint */
 879      -
 880      -#ifndef lint
 881      -
 882  843  #ifdef DEBUG
 883  844          .seg    ".data"
 884  845          .align  4
 885  846  
 886  847          .global bad_g4_called
 887  848  bad_g4_called:
 888  849          .word   0
 889  850  
 890  851  sys_trap_wrong_pil:
 891  852          .asciz  "sys_trap: %g4(%d) is lower than %pil(%d)"
 892  853          .align  4
 893  854          .seg    ".text"
 894  855  
 895  856          ENTRY_NP(bad_g4)
 896  857          mov     %o1, %o0
 897  858          mov     %o2, %o1
 898  859          call    panic
 899  860          mov     %o3, %o2
 900  861          SET_SIZE(bad_g4)
 901  862  #endif /* DEBUG */
 902      -#endif /* lint */
 903  863  
 904  864  /*
 905  865   * sys_tl1_panic can be called by traps at tl1 which
 906  866   * really want to panic, but need the rearrangement of
 907  867   * the args as provided by this wrapper routine.
 908  868   */
 909      -#if defined(lint)
 910      -
 911      -void
 912      -sys_tl1_panic(void)
 913      -{}
 914      -
 915      -#else   /* lint */
 916  869          ENTRY_NP(sys_tl1_panic)
 917  870          mov     %o1, %o0
 918  871          mov     %o2, %o1
 919  872          call    panic
 920  873          mov     %o3, %o2
 921  874          SET_SIZE(sys_tl1_panic)
 922      -#endif /* lint */
 923  875  
 924  876  /*
 925  877   * Turn on or off bits in the auxiliary i/o register.
 926  878   *
 927  879   * set_auxioreg(bit, flag)
 928  880   *      int bit;                bit mask in aux i/o reg
 929  881   *      int flag;               0 = off, otherwise on
 930  882   *
 931  883   * This is intrinsicly ugly but is used by the floppy driver.  It is also
 932  884   * used to turn on/off the led.
 933  885   */
 934  886  
 935      -#if defined(lint)
 936      -
 937      -/* ARGSUSED */
 938      -void
 939      -set_auxioreg(int bit, int flag)
 940      -{}
 941      -
 942      -#else   /* lint */
 943      -
 944  887          .seg    ".data"
 945  888          .align  4
 946  889  auxio_panic:
 947  890          .asciz  "set_auxioreg: interrupts already disabled on entry"
 948  891          .align  4
 949  892          .seg    ".text"
 950  893  
 951  894          ENTRY_NP(set_auxioreg)
 952  895          /*
 953  896           * o0 = bit mask
↓ open down ↓ 19 lines elided ↑ open up ↑
 973  916          bnz,a   2f
 974  917           bset   %o0, %g1                /* on */
 975  918          bclr    %o0, %g1                /* off */
 976  919  2:
 977  920          or      %g1, AUX_MBO, %g1       /* Must Be Ones */
 978  921          stb     %g1, [%o4]              /* write aux i/o register */
 979  922          retl
 980  923           wrpr   %g0, %o2, %pstate       /* enable interrupt */
 981  924          SET_SIZE(set_auxioreg)
 982  925  
 983      -#endif /* lint */
 984      -
 985  926  /*
 986  927   * Flush all windows to memory, except for the one we entered in.
 987  928   * We do this by doing NWINDOW-2 saves then the same number of restores.
 988  929   * This leaves the WIM immediately before window entered in.
 989  930   * This is used for context switching.
 990  931   */
 991  932  
 992      -#if defined(lint)
 993      -
 994      -void
 995      -flush_windows(void)
 996      -{}
 997      -
 998      -#else   /* lint */
 999      -
1000  933          ENTRY_NP(flush_windows)
1001  934          retl
1002  935          flushw
1003  936          SET_SIZE(flush_windows)
1004  937  
1005      -#endif  /* lint */
1006      -
1007      -#if defined(lint)
1008      -
1009      -void
1010      -debug_flush_windows(void)
1011      -{}
1012      -
1013      -#else   /* lint */
1014      -
1015  938          ENTRY_NP(debug_flush_windows)
1016  939          set     nwindows, %g1
1017  940          ld      [%g1], %g1
1018  941          mov     %g1, %g2
1019  942  
1020  943  1:
1021  944          save    %sp, -WINDOWSIZE, %sp
1022  945          brnz    %g2, 1b
1023  946          dec     %g2
1024  947  
↓ open down ↓ 1 lines elided ↑ open up ↑
1026  949  2:
1027  950          restore
1028  951          brnz    %g2, 2b
1029  952          dec     %g2
1030  953  
1031  954          retl
1032  955          nop
1033  956  
1034  957          SET_SIZE(debug_flush_windows)
1035  958  
1036      -#endif  /* lint */
1037      -
1038  959  /*
1039  960   * flush user windows to memory.
1040  961   */
1041  962  
1042      -#if defined(lint)
1043      -
1044      -void
1045      -flush_user_windows(void)
1046      -{}
1047      -
1048      -#else   /* lint */
1049      -
1050  963          ENTRY_NP(flush_user_windows)
1051  964          rdpr    %otherwin, %g1
1052  965          brz     %g1, 3f
1053  966          clr     %g2
1054  967  1:
1055  968          save    %sp, -WINDOWSIZE, %sp
1056  969          rdpr    %otherwin, %g1
1057  970          brnz    %g1, 1b
1058  971          add     %g2, 1, %g2
1059  972  2:
1060  973          sub     %g2, 1, %g2             ! restore back to orig window
1061  974          brnz    %g2, 2b
1062  975          restore
1063  976  3:
1064  977          retl
1065  978          nop
1066  979          SET_SIZE(flush_user_windows)
1067  980  
1068      -#endif  /* lint */
1069      -
1070  981  /*
1071  982   * Throw out any user windows in the register file.
1072  983   * Used by setregs (exec) to clean out old user.
1073  984   * Used by sigcleanup to remove extraneous windows when returning from a
1074  985   * signal.
1075  986   */
1076  987  
1077      -#if defined(lint)
1078      -
1079      -void
1080      -trash_user_windows(void)
1081      -{}
1082      -
1083      -#else   /* lint */
1084      -
1085  988          ENTRY_NP(trash_user_windows)
1086  989          rdpr    %otherwin, %g1
1087  990          brz     %g1, 3f                 ! no user windows?
1088  991          ldn     [THREAD_REG + T_STACK], %g5
1089  992  
1090  993          !
1091  994          ! There are old user windows in the register file. We disable ints
1092  995          ! and increment cansave so that we don't overflow on these windows.
1093  996          ! Also, this sets up a nice underflow when first returning to the
1094  997          ! new user.
↓ open down ↓ 5 lines elided ↑ open up ↑
1100 1003          add     %g3, %g1, %g3
1101 1004          wrpr    %g0, 0, %otherwin
1102 1005          wrpr    %g0, %g3, %cansave
1103 1006          wrpr    %g0, %g2, %pstate
1104 1007  3:
1105 1008          retl
1106 1009          clr     [%g5 + MPCB_WBCNT]       ! zero window buffer cnt
1107 1010          SET_SIZE(trash_user_windows)
1108 1011  
1109 1012  
1110      -#endif  /* lint */
1111      -
1112 1013  /*
1113 1014   * Setup g7 via the CPU data structure.
1114 1015   */
1115      -#if defined(lint)
1116 1016  
1117      -struct scb *
1118      -set_tbr(struct scb *s)
1119      -{ return (s); }
1120      -
1121      -#else   /* lint */
1122      -
1123 1017          ENTRY_NP(set_tbr)
1124 1018          retl
1125 1019          ta      72              ! no tbr, stop simulation
1126 1020          SET_SIZE(set_tbr)
1127 1021  
1128      -#endif  /* lint */
1129 1022  
1130      -
1131      -#if defined(lint)
1132      -/*
1133      - * These need to be defined somewhere to lint and there is no "hicore.s"...
1134      - */
1135      -char etext[1], end[1];
1136      -#endif  /* lint*/
1137      -
1138      -#if defined (lint)
1139      -
1140      -/* ARGSUSED */
1141      -void
1142      -ptl1_panic(u_int reason)
1143      -{}
1144      -
1145      -#else /* lint */
1146      -
1147 1023  #define PTL1_SAVE_WINDOW(RP)                                            \
1148 1024          stxa    %l0, [RP + RW64_LOCAL + (0 * RW64_LOCAL_INCR)] %asi;    \
1149 1025          stxa    %l1, [RP + RW64_LOCAL + (1 * RW64_LOCAL_INCR)] %asi;    \
1150 1026          stxa    %l2, [RP + RW64_LOCAL + (2 * RW64_LOCAL_INCR)] %asi;    \
1151 1027          stxa    %l3, [RP + RW64_LOCAL + (3 * RW64_LOCAL_INCR)] %asi;    \
1152 1028          stxa    %l4, [RP + RW64_LOCAL + (4 * RW64_LOCAL_INCR)] %asi;    \
1153 1029          stxa    %l5, [RP + RW64_LOCAL + (5 * RW64_LOCAL_INCR)] %asi;    \
1154 1030          stxa    %l6, [RP + RW64_LOCAL + (6 * RW64_LOCAL_INCR)] %asi;    \
1155 1031          stxa    %l7, [RP + RW64_LOCAL + (7 * RW64_LOCAL_INCR)] %asi;    \
1156 1032          stxa    %i0, [RP + RW64_IN + (0 * RW64_IN_INCR)] %asi;          \
↓ open down ↓ 254 lines elided ↑ open up ↑
1411 1287          !
1412 1288          ! enable limited interrupts
1413 1289          !
1414 1290          wrpr    %g0, CLOCK_LEVEL, %pil
1415 1291          wrpr    %g0, PSTATE_KERN, %pstate
1416 1292          !
1417 1293          ba,pt   %xcc, ptl1_panic_handler
1418 1294            mov   %l1, %o0
1419 1295          /*NOTREACHED*/
1420 1296          SET_SIZE(ptl1_panic)
1421      -#endif /* lint */
1422 1297  
1423 1298  #ifdef  PTL1_PANIC_DEBUG
1424      -#if defined (lint)
1425      -/*
1426      - * ptl1_recurse() calls itself a number of times to either set up a known
1427      - * stack or to cause a kernel stack overflow. It decrements the arguments 
1428      - * on each recursion.
1429      - * It's called by #ifdef PTL1_PANIC_DEBUG code in startup.c to set the
1430      - * registers to a known state to facilitate debugging.
1431      - */
1432 1299  
1433      -/* ARGSUSED */
1434      -void 
1435      -ptl1_recurse(int count_threshold, int trap_threshold)
1436      -{}
1437      -
1438      -#else /* lint */
1439      -
1440 1300          ENTRY_NP(ptl1_recurse)
1441 1301          save    %sp, -SA(MINFRAME), %sp
1442 1302  
1443 1303          set     ptl1_recurse_call, %o7
1444 1304          cmp     %o7, %i7                        ! if ptl1_recurse is called
1445 1305          be,pt  %icc, 0f                         ! by itself, then skip
1446 1306            nop                                   ! register initialization
1447 1307  
1448 1308          /* 
1449 1309           * Initialize Out Registers to Known Values 
↓ open down ↓ 44 lines elided ↑ open up ↑
1494 1354  
1495 1355  ptl1_recure_exit:
1496 1356          ret
1497 1357          restore
1498 1358  
1499 1359  ptl1_recurse_trap:
1500 1360          ta      PTL1_DEBUG_TRAP;                ! Trap Always to ptl1_panic()
1501 1361            nop                                   ! NOTREACHED 
1502 1362          SET_SIZE(ptl1_recurse)
1503 1363  
1504      -#endif /* lint */
1505      -
1506      -#if defined (lint)
1507      -
1508      -/* ARGSUSED */
1509      -void
1510      -ptl1_panic_xt(int arg1, int arg2)
1511      -{}
1512      -
1513      -#else /* lint */
1514 1364          /*
1515 1365           * Asm function to handle a cross trap to call ptl1_panic()
1516 1366           */
1517 1367          ENTRY_NP(ptl1_panic_xt)
1518 1368          ba      ptl1_panic
1519 1369            mov   PTL1_BAD_DEBUG, %g1
1520 1370          SET_SIZE(ptl1_panic_xt)
1521 1371  
1522      -#endif /* lint */
1523      -
1524 1372  #endif  /* PTL1_PANIC_DEBUG */
1525 1373  
1526 1374  #ifdef  TRAPTRACE
1527      -#if     defined (lint)
1528 1375  
1529      -void
1530      -trace_ptr_panic(void)
1531      -{
1532      -}
1533      -
1534      -#else   /* lint */
1535      -
1536 1376          ENTRY_NP(trace_ptr_panic)
1537 1377          !
1538 1378          ! freeze the trap trace to disable the assertions.  Otherwise,
1539 1379          ! ptl1_panic is likely to be repeatedly called from there.
1540 1380          ! %g2 and %g3 are used as scratch registers in ptl1_panic.
1541 1381          !
1542 1382          mov     1, %g3
1543 1383          sethi   %hi(trap_freeze), %g2
1544 1384          st      %g3, [%g2 + %lo(trap_freeze)]
1545 1385          !
↓ open down ↓ 1 lines elided ↑ open up ↑
1547 1387          ! save it in trap_freeze_pc for a debugging hint if there is
1548 1388          ! no value saved in it.
1549 1389          !
1550 1390          set     trap_freeze_pc, %g2
1551 1391          casn    [%g2], %g0, %g1
1552 1392  
1553 1393          ba      ptl1_panic
1554 1394          mov     PTL1_BAD_TRACE_PTR, %g1
1555 1395          SET_SIZE(trace_ptr_panic)
1556 1396  
1557      -#endif  /* lint */
1558 1397  #endif  /* TRAPTRACE */
1559 1398          
1560      -#if     defined (lint)
1561      -/*
1562      - * set_kcontextreg() sets PCONTEXT to kctx
1563      - * if PCONTEXT==kctx, do nothing
1564      - * if N_pgsz0|N_pgsz1 differ, do demap all first
1565      - */
1566      -
1567      -/* ARGSUSED */
1568      -void
1569      -set_kcontextreg()
1570      -{
1571      -}
1572      -
1573      -#else   /* lint */
1574      -
1575 1399          ENTRY_NP(set_kcontextreg)
1576 1400          ! SET_KCONTEXTREG(reg0, reg1, reg2, reg3, reg4, label1, label2, label3)
1577 1401          SET_KCONTEXTREG(%o0, %o1, %o2, %o3, %o4, l1, l2, l3)
1578 1402          retl
1579 1403          nop
1580 1404          SET_SIZE(set_kcontextreg)
1581 1405          
1582      -#endif /* lint */
1583      -        
1584 1406  
1585 1407  /*
1586 1408   * The interface for a 32-bit client program that takes over the TBA
1587 1409   * calling the 64-bit romvec OBP.
1588 1410   */
1589 1411  
1590      -#if defined(lint)
1591      -
1592      -/* ARGSUSED */
1593      -int
1594      -client_handler(void *cif_handler, void *arg_array)
1595      -{ return 0; }
1596      -
1597      -#else   /* lint */
1598      -
1599 1412          ENTRY(client_handler)
1600 1413          save    %sp, -SA64(MINFRAME64), %sp     ! 32 bit frame, 64 bit sized
1601 1414          sethi   %hi(tba_taken_over), %l2
1602 1415          ld      [%l2+%lo(tba_taken_over)], %l3
1603 1416          brz     %l3, 1f                         ! is the tba_taken_over = 1 ?
1604 1417          rdpr    %wstate, %l5                    ! save %wstate
1605 1418          andn    %l5, WSTATE_MASK, %l6
1606 1419          wrpr    %l6, WSTATE_KMIX, %wstate
1607 1420  
1608 1421          !
↓ open down ↓ 49 lines elided ↑ open up ↑
1658 1471          membar  #Sync
1659 1472          sethi   %hi(FLUSH_ADDR), %o2
1660 1473          flush   %o2                             ! flush required by immu
1661 1474          wrpr    %g0, %l4, %pstate               ! restore interrupt state
1662 1475  #endif /* _OPL */
1663 1476  
1664 1477  1:      ret                                     ! Return result ...
1665 1478          restore %o0, %g0, %o0                   ! delay; result in %o0
1666 1479          SET_SIZE(client_handler)
1667 1480  
1668      -#endif  /* lint */
1669      -        
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX