Print this page
de-linting of .s files
@@ -21,17 +21,10 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
-#if defined(lint)
-#include <sys/types.h>
-#include <sys/t_lock.h>
-#include <sys/promif.h>
-#include <sys/prom_isa.h>
-#endif /* lint */
-
#include <sys/asm_linkage.h>
#include <sys/intreg.h>
#include <sys/ivintr.h>
#include <sys/mmu.h>
#include <sys/machpcb.h>
@@ -44,17 +37,10 @@
#include <sys/machasi.h>
#include <sys/privregs.h>
#include <sys/hypervisor_api.h>
#include <sys/clock.h>
-#if defined(lint)
-
-#include <sys/thread.h>
-#include <sys/time.h>
-
-#else /* lint */
-
#include "assym.h"
!
! REGOFF must add up to allow double word access to r_tstate.
@@ -180,20 +166,10 @@
.align 8
_local_p1275cis:
.nword 0
-#endif /* lint */
-
-#if defined(lint)
-
-void
-_start(void)
-{}
-
-#else /* lint */
-
.seg ".data"
.global nwindows, nwin_minus_one, winmask
nwindows:
.word 8
@@ -362,13 +338,11 @@
.mainretmsg:
.asciz "main returned"
.align 4
-#endif /* lint */
-
/*
* Generic system trap handler.
*
* Some kernel trap handlers save themselves from buying a window by
* borrowing some of sys_trap's unused locals. %l0 thru %l3 may be used
@@ -400,18 +374,10 @@
* uint32_t arg2 [%g3.l], uint32_t arg3 [%g3.h])
* func(struct regs *rp, uint32_t arg1 [%g2.l],
* uint32_t arg2 [%g3.l], uint32_t arg3 [%g3.h], uint32_t [%g2.h])
*/
-#if defined(lint)
-
-void
-sys_trap(void)
-{}
-
-#else /* lint */
-
ENTRY_NP(sys_trap)
#ifdef DEBUG
! Assert gl == 1
rdpr %gl, %g5
cmp %g5, 1
@@ -1045,14 +1011,10 @@
retry
/* NOTREACHED */
SET_SIZE(priv_rtt)
SET_SIZE(ktl0)
-#endif /* lint */
-
-#ifndef lint
-
#ifdef DEBUG
.seg ".data"
.align 4
.global bad_g4_called
@@ -1069,63 +1031,36 @@
mov %o2, %o1
call panic
mov %o3, %o2
SET_SIZE(bad_g4)
#endif /* DEBUG */
-#endif /* lint */
/*
* sys_tl1_panic can be called by traps at tl1 which
* really want to panic, but need the rearrangement of
* the args as provided by this wrapper routine.
*/
-#if defined(lint)
-
-void
-sys_tl1_panic(void)
-{}
-
-#else /* lint */
ENTRY_NP(sys_tl1_panic)
mov %o1, %o0
mov %o2, %o1
call panic
mov %o3, %o2
SET_SIZE(sys_tl1_panic)
-#endif /* lint */
/*
* Flush all windows to memory, except for the one we entered in.
* We do this by doing NWINDOW-2 saves then the same number of restores.
* This leaves the WIM immediately before window entered in.
* This is used for context switching.
*/
-#if defined(lint)
-
-void
-flush_windows(void)
-{}
-
-#else /* lint */
-
ENTRY_NP(flush_windows)
retl
flushw
SET_SIZE(flush_windows)
-#endif /* lint */
-
-#if defined(lint)
-
-void
-debug_flush_windows(void)
-{}
-
-#else /* lint */
-
ENTRY_NP(debug_flush_windows)
set nwindows, %g1
ld [%g1], %g1
mov %g1, %g2
@@ -1143,24 +1078,14 @@
retl
nop
SET_SIZE(debug_flush_windows)
-#endif /* lint */
-
/*
* flush user windows to memory.
*/
-#if defined(lint)
-
-void
-flush_user_windows(void)
-{}
-
-#else /* lint */
-
ENTRY_NP(flush_user_windows)
rdpr %otherwin, %g1
brz %g1, 3f
clr %g2
1:
@@ -1175,27 +1100,17 @@
3:
retl
nop
SET_SIZE(flush_user_windows)
-#endif /* lint */
-
/*
* Throw out any user windows in the register file.
* Used by setregs (exec) to clean out old user.
* Used by sigcleanup to remove extraneous windows when returning from a
* signal.
*/
-#if defined(lint)
-
-void
-trash_user_windows(void)
-{}
-
-#else /* lint */
-
ENTRY_NP(trash_user_windows)
rdpr %otherwin, %g1
brz %g1, 3f ! no user windows?
ldn [THREAD_REG + T_STACK], %g5
@@ -1217,47 +1132,20 @@
retl
clr [%g5 + MPCB_WBCNT] ! zero window buffer cnt
SET_SIZE(trash_user_windows)
-#endif /* lint */
-
/*
* Setup g7 via the CPU data structure.
*/
-#if defined(lint)
-struct scb *
-set_tbr(struct scb *s)
-{ return (s); }
-
-#else /* lint */
-
ENTRY_NP(set_tbr)
retl
ta 72 ! no tbr, stop simulation
SET_SIZE(set_tbr)
-#endif /* lint */
-
-#if defined(lint)
-/*
- * These need to be defined somewhere to lint and there is no "hicore.s"...
- */
-char etext[1], end[1];
-#endif /* lint*/
-
-#if defined (lint)
-
-/* ARGSUSED */
-void
-ptl1_panic(u_int reason)
-{}
-
-#else /* lint */
-
#define PTL1_SAVE_WINDOW(RP) \
stxa %l0, [RP + RW64_LOCAL + (0 * RW64_LOCAL_INCR)] %asi; \
stxa %l1, [RP + RW64_LOCAL + (1 * RW64_LOCAL_INCR)] %asi; \
stxa %l2, [RP + RW64_LOCAL + (2 * RW64_LOCAL_INCR)] %asi; \
stxa %l3, [RP + RW64_LOCAL + (3 * RW64_LOCAL_INCR)] %asi; \
@@ -1495,29 +1383,13 @@
!
ba,pt %xcc, ptl1_panic_handler
mov %l1, %o0
/*NOTREACHED*/
SET_SIZE(ptl1_panic)
-#endif /* lint */
#ifdef PTL1_PANIC_DEBUG
-#if defined (lint)
-/*
- * ptl1_recurse() calls itself a number of times to either set up a known
- * stack or to cause a kernel stack overflow. It decrements the arguments
- * on each recursion.
- * It's called by #ifdef PTL1_PANIC_DEBUG code in startup.c to set the
- * registers to a known state to facilitate debugging.
- */
-/* ARGSUSED */
-void
-ptl1_recurse(int count_threshold, int trap_threshold)
-{}
-
-#else /* lint */
-
ENTRY_NP(ptl1_recurse)
save %sp, -SA(MINFRAME), %sp
set ptl1_recurse_call, %o7
cmp %o7, %i7 ! if ptl1_recurse is called
@@ -1578,42 +1450,22 @@
ptl1_recurse_trap:
ta PTL1_DEBUG_TRAP; ! Trap Always to ptl1_panic()
nop ! NOTREACHED
SET_SIZE(ptl1_recurse)
-#endif /* lint */
-
-#if defined (lint)
-
-/* ARGSUSED */
-void
-ptl1_panic_xt(int arg1, int arg2)
-{}
-
-#else /* lint */
/*
* Asm function to handle a cross trap to call ptl1_panic()
*/
ENTRY_NP(ptl1_panic_xt)
ba ptl1_panic
mov PTL1_BAD_DEBUG, %g1
SET_SIZE(ptl1_panic_xt)
-#endif /* lint */
-
#endif /* PTL1_PANIC_DEBUG */
#ifdef TRAPTRACE
-#if defined (lint)
-void
-trace_ptr_panic(void)
-{
-}
-
-#else /* lint */
-
ENTRY_NP(trace_ptr_panic)
!
! freeze the trap trace to disable the assertions. Otherwise,
! ptl1_panic is likely to be repeatedly called from there.
! %g2 and %g3 are used as scratch registers in ptl1_panic.
@@ -1631,27 +1483,17 @@
ba ptl1_panic
mov PTL1_BAD_TRACE_PTR, %g1
SET_SIZE(trace_ptr_panic)
-#endif /* lint */
#endif /* TRAPTRACE */
/*
* The interface for a 32-bit client program that takes over the TBA
* calling the 64-bit romvec OBP.
*/
-#if defined(lint)
-
-/* ARGSUSED */
-int
-client_handler(void *cif_handler, void *arg_array)
-{ return 0; }
-
-#else /* lint */
-
ENTRY(client_handler)
save %sp, -SA64(MINFRAME64), %sp ! 32 bit frame, 64 bit sized
sethi %hi(tba_taken_over), %l2
ld [%l2+%lo(tba_taken_over)], %l3
brz %l3, 1f ! is the tba_taken_over = 1 ?
@@ -1670,21 +1512,10 @@
wrpr %g0, %l5, %wstate ! restore wstate
1: ret ! Return result ...
restore %o0, %g0, %o0 ! delay; result in %o0
SET_SIZE(client_handler)
-#endif /* lint */
-
-#if defined(lint)
-
-/*ARGSUSED*/
-void
-panic_bad_hcall(uint64_t err, uint64_t hcall)
-{}
-
-#else /* lint */
-
.seg ".text"
bad_hcall_error:
.asciz "hypervisor call 0x%x returned an unexpected error %d"
/*
@@ -1701,6 +1532,5 @@
mov %o7, %o3
call panic
mov %o3, %o7
SET_SIZE(panic_bad_hcall)
-#endif /* lint */