sys7.1-doc-wip/Internal/Asm/TrapsPrivate.a
2019-07-27 22:37:48 +08:00

562 lines
14 KiB
Plaintext

;
; File: TrapsPrivate.a
;
; Contains: Private System traps, not for public consumption.
;
; Written by: Jim Reekes
;
; Copyright: © 1992-1994 by Apple Computer, Inc., all rights reserved.
;
; Change History (most recent first):
;
; <SM10> 1/22/94 KW added some traps macros from the CygnusX1 ROM
; <SM9> 11/17/93 KW added a trap to turn on 040
; <SM8> 9/9/93 pdw Prettied and changed MakePageWriteThrough to nkMake… to be
; consistent.
; <SM7> 6/23/93 CSS Update from Reality:
; <3> 6/14/93 JDR Moved Get/SetTrapWordAddress into TrapsPrivate.a
; <2> 6/13/93 JDR Added _FigmentDispatch.
; <SM6> 6/6/93 BT Add _MFPrTypeStrings for process manager GetResource patch roll
; in.
; <SM5> 5/10/93 BT Add _HeapDispatch trap for Figment.
; <SM4> 5/6/93 SAM Added several new kernelVM dispatch selectors.
; <SM3> 3/11/93 SAM Added nkAllocateMemory to the list of Nanokernel macros.
; <SM2> 2/20/93 SAM Added all the private process manager traps. Added a slew of
; nanokernel traps and macros.
; <1> 7/22/92 JDR first checked in
;
;
; Notes: This file contains the traps allocated by the System, but
; are not for use by the public and therefore not for use
; by developers. At the time of this writting (the first
; check in) all of the private traps are scattered throughout
; the source files. The hope in creating this file is that
; all of these private traps will be collected into this file.
; If you add a new trap, keep this file in trap number order
; just like the public Traps.h. Also, it would be helpful
; if you add a comment about what the trap is used for.
;
; To Do: Add the traps and trap calling macros which are located in
; the following files
;
; {IntAIncludes}BTreeEqu.a
; {IntAIncludes}DispatchHelperPriv.a
; {IntAIncludes}fontPrivate.a
; {IntAIncludes}MenuMgrPriv.a
; {IntAIncludes}MFPrivate.a
; {IntAIncludes}PalettePriv.a
; {IntAIncludes}ScriptPriv.a
; {IntAIncludes}SCSIPriv.a
;
;___________________________________________________________________________
IF &TYPE('__INCLUDINGTRAPSPRIVATE__') = 'UNDEFINED' THEN
__INCLUDINGTRAPSPRIVATE__ SET 1
;—————————————————————————————————————————————————————————————————————————————————————
; Trap Dispatcher
_GetTrapWordAddress OPWORD $A546 ; used by the Link Patch Loader
_SetTrapWordAddress OPWORD $A447 ; used by the Link Patch Loader
;—————————————————————————————————————————————————————————————————————————————————————
; Memory Manager traps
_MoveHLow OPWORD $A09D
_HeapDispatch OPWORD $A0A4
_FigmentDispatch OPWORD $A0A4
;—————————————————————————————————————————————————————————————————————————————————————
; Sound Manager traps
; SndAppDead is called by InitApplZone which vectors to jIAZInit, which then
; vectors to jSoundDead. This is done by the ROMs on Apple Sound Chip machines,
; for some reason that has been lost in history (probably due to the pre-MultiFinder
; assumptions). It is also called by CleanupApplication. So we've got them
; coming and going, but we really only want this trap to be called once a
; process is going away.
_SndAppDead OPWORD $A0B8
;—————————————————————————————————————————————————————————————————————————————————————
; Time Manager traps
_Microseconds OPWORD $A193 ; no params, returns µS in D0
;—————————————————————————————————————————————————————————————————————————————————————
; Process Manager traps
_InitApplication OPWORD $AAFA
_SynchIdleTime OPWORD $ABF7
_CleanupApplication OPWORD $AAFB
MACRO
_DisableSwitching
MOVE.W #$19,-(SP)
_OSDispatch
ENDM
MACRO
EnableSwitching
MOVE.W #$1A,-(SP)
_OSDispatch
ENDM
MACRO
_GetNextHighLevelEvent
MOVE.W #$12,-(SP)
_OSDispatch
ENDM
MACRO
_MFGetPrTypeStrings
MOVE.W #$27,-(SP)
_OSDispatch
ENDM
MACRO
_PostHighLevelEvent
MOVE.W #$34,-(SP)
_OSDispatch
ENDM
MACRO
_GetProcessFromLayer
MOVE.W #$39,-(SP)
_OSDispatch
ENDM
MACRO
_GetSystemClientProcess
MOVE.W #$3F,-(SP)
_OSDispatch
ENDM
MACRO
_BeginSystemMode
MOVE.W #$40,-(SP)
_OSDispatch
ENDM
MACRO
_EndSystemMode
MOVE.W #$41,-(SP)
_OSDispatch
ENDM
MACRO
_RequestVolumeNotification
MOVE.W #$42,-(SP)
_OSDispatch
ENDM
MACRO
_DeclineVolumeNotification
MOVE.W #$43,-(SP)
_OSDispatch
ENDM
MACRO
_AddAppleMenuItem
MOVE.W #$31,-(SP)
_OSDispatch
ENDM
MACRO
_DeleteAppleMenuItem
MOVE.W #$32,-(SP)
_OSDispatch
ENDM
MACRO
_GetAuxMenuItem
MOVE.W #$3E,-(SP)
_OSDispatch
ENDM
MACRO
_NewDesktopLayerOwner
MOVE.W #$14,-(SP)
_OSDispatch
ENDM
MACRO
_RegisterDebugger
MOVE.W #$30,-(SP)
_OSDispatch
ENDM
MACRO
_GetProcessTrapAddress
MOVE.W #$2C,-(SP)
_OSDispatch
ENDM
MACRO
_SetProcessTrapAddress
MOVE.W #$2D,-(SP)
_OSDispatch
ENDM
MACRO
_ReadWriteProcessMemory
MOVE.W #$2E,-(SP)
_OSDispatch
ENDM
MACRO
_ReadWriteProcessFPURegs
MOVE.W #$2F,-(SP)
_OSDispatch
ENDM
MACRO
_KillProcess
MOVE.W #$44,-(SP)
_OSDispatch
ENDM
MACRO
_SysZoneFloatSizes
MOVE.W #$47,-(SP)
_OSDispatch
ENDM
MACRO
_NewFloatLayer
MOVE.W #$48,-(SP)
_OSDispatch
ENDM
MACRO
_DisposeFloatLayer
MOVE.W #$49,-(SP)
_OSDispatch
ENDM
MACRO
_PostFakeKeyDown
MOVE.W #$4A,-(SP)
_OSDispatch
ENDM
MACRO
_PostText
MOVE.W #$4B,-(SP)
_OSDispatch
ENDM
MACRO
_InlineAware
MOVE.W #$4C,-(SP)
_OSDispatch
ENDM
MACRO
_NewTSMLayerOwner
MOVE.W #$4D,-(SP)
_OSDispatch
ENDM
MACRO
_RouteEventToSWM
MOVE.W #$4E,-(SP)
_OSDispatch
ENDM
Macro
_PEntryFromProcessSerialNumber
move.w #$4F,-(sp)
_OSDispatch
EndM
; End ProcessMgr traps
;—————————————————————————————————————————————————————————————————————————————————————
;—————————————————————————————————————————————————————————————————————————————————————
; NanoKernel traps
; The dispatch selectors to the PowerPC nano-Kernel
_KernelVMDispatch OPWORD $FE0A ; NanoKernel VMDispatch d0/a0/a1/d1 <- params, d0 <- result
_ToolBoxCoprocessorNop OPWORD $FC00 ; NOP if Toolbox Coprocessor Exists, else F-Trap
; Accelerations of the SANE Floating Point Package
_DecodeSANEop OPWORD $FC01
_ExitSANEop OPWORD $FC02
_LoadArg1Extended OPWORD $FC03
_LoadArg2Convert OPWORD $FC04
_CopyArg2ToArg1 OPWORD $FC05
_CheckResultArg1 OPWORD $FC06
_StoreArg1Extended OPWORD $FC07
_StoreArg1Double OPWORD $FC08
_StoreArg1Single OPWORD $FC09
_FloatAdd OPWORD $FC0A
_FloatSub OPWORD $FC0B
_FloatMul OPWORD $FC0C
_FloatDiv OPWORD $FC0D
_FloatRem OPWORD $FC0E
_FloatSqrt OPWORD $FC0F
; Accelerations of the return/exit path of the OS A-Trap dispatcher.
_ATrapOSExit OPWORD $FC10 ; accelerated return path of normal OS A-trap
_ATrapOSNoA0Exit OPWORD $FC11 ; accelerated return path of No A0 OS A-trap
; Accelerations for BlockMove.
_MoveBytes OPWORD $FC12 ; accelerate BlockMove, use DCBZ for writes
_MoveBytesNoDCBZ OPWORD $FC13 ; accelerate BlockMove, don't use DCBZ instruction
_RiscCoprocessorNop OPWORD $FE00 ; NOP if RISC Coprocessor Exists, else F-Trap
_ExecuteRiscContext OPWORD $FE03 ; (a7) points to NativeContextBlock
; Move From/To Emulator Control Register (ECR)
_MoveFromECR OPWORD $FE04 ; d0 <- Register Number, A0 <- Register Value
_MoveToECR OPWORD $FE05 ; d0 <- Register Number, A0 <- Register Value
_VMDispatch OPWORD $FE0A ; d0/a0/a1/d1 <- params, d0 <- result
_HandleMixedModeFault OPWORD $FE07 ; Handle Mixed Mode Interrupts and Page Faults
_ReadTimeBase32 OPWORD $FE08 ; d0 <- lower 32 bits of 64 bit time base
_ReadTimeBase64 OPWORD $FE09 ; a0 <- upper 32 bits, d0 <- lower 32 bits
_MixedMode OPWORD $FEED ; Suspend Emulation, Call Mixed Mode Switcher
; KernelVMDispatch Routine Selectors
mmuInit EQU 0 ; selector for mmuInit
mmuUnInit EQU 1 ; selector for mmuUnInit
mmuFinalInit EQU 2 ; selector for mmuFinalInit
mmuIsResident EQU 3 ; selector for mmuIsResident
mmuIsUnmodified EQU 4 ; selector for mmuIsUnmodified
mmuIsInited EQU 5 ; selector for mmuIsInited
mmuShouldClean EQU 6 ; selector for mmuShouldClean
mmuMarkResident EQU 7 ; selector for mmuMarkResident
mmuMarkBacking EQU 8 ; selector for mmuMarkBacking
mmuMarkCleanUnused EQU 9 ; selector for mmuMarkCleanUnused
mmuGetPhysicalPage EQU 10 ; selector for mmuGetPhysicalPage
mmuGetPhysicalAddress EQU 11 ; selector for mmuGetPhysicalAddress
mmuExchangePages EQU 12 ; selector for mmuExchangePages
mmuReload EQU 13 ; selector for mmuReload
mmuFlushAddressTranslationCache EQU 14 ; selector for mmuFlushAddressTranslationCache
mmuFlushDataCache EQU 15 ; selector for mmuFlushDataCache
mmuFlushCodeCache EQU 16 ; selector for mmuFlushCodeCache
mmuMakePageCacheable EQU 17 ; selector for mmuMakePageCacheable
mmuMakePageNonCacheable EQU 18 ; selector for mmuMakePageNonCacheable
getPTEntryGivenPage EQU 19 ; selector for _GetPTEntryGivenPage
setPTEntryGivenPage EQU 20 ; selector for _SetPTEntryGivenPage
mmuPTest EQU 21 ; selector for mmuPTest
mmuLRU EQU 22
mmuMarkUndefined EQU 23
mmuMakePageWriteThrough EQU 24
mmuAllocateMemory EQU 25 ; (Page:A0, Count:A1, BusAlignMask:D1)
mmuPDSReset EQU 26 ; assert PDS reset for IO and Nubus cards <∞2>
mmuSTPDeathChimes EQU 27 ; play native STP death chimes
mmuSwitchTo040 EQU 28 ; boot the 040
; The macros to enter the nano-Kernel MMU routines
MACRO ; init the MMU virtual space
_nkMMUInitGlue
moveq #mmuInit,d0
_KernelVMDispatch
ENDM
MACRO ; un-init the MMU virtual space
_nkMMUUnInit
moveq #mmuUnInit,d0
_KernelVMDispatch
ENDM
MACRO ; last chance to init after new memory dispatch is installed
_nkMMUFinalInit
moveq #mmuFinalInit,d0
_KernelVMDispatch
ENDM
MACRO ; ask about page status
_nkMMUIsResident
moveq #mmuIsResident,d0
_KernelVMDispatch
ENDM
MACRO ; ask about page status
_nkMMUIsUnmodified
moveq #mmuIsUnmodified,d0
_KernelVMDispatch
ENDM
MACRO ; ask about page status
_nkMMUIsInited
moveq #mmuIsInited,d0
_KernelVMDispatch
ENDM
MACRO ; ask about page status
_nkMMUShouldClean
moveq #mmuShouldClean,d0
_KernelVMDispatch
ENDM
MACRO ; set page status
_nkMMUMarkResidentGlue
moveq #mmuMarkResident,d0
_KernelVMDispatch
ENDM
MACRO ; set page status
_nkMMUMarkBacking
moveq #mmuMarkBacking,d0
_KernelVMDispatch
ENDM
MACRO ; ask about page status
_nkMMUMarkCleanUnused
moveq #mmuMarkCleanUnused,d0
_KernelVMDispatch
ENDM
MACRO ; return phys page given log page
_nkMMUGetPhysicalPage
moveq #mmuGetPhysicalPage,d0
_KernelVMDispatch
ENDM
MACRO ; return phys address given log page (can be different from above!)
_nkMMUGetPhysicalAddress
moveq #mmuGetPhysicalAddress,d0
_KernelVMDispatch
ENDM
MACRO ; exchange physical page contents
_nkMMUExchangePages
moveq #mmuExchangePages,d0
_KernelVMDispatch
ENDM
MACRO ; reload the ATC with specified page
_nkMMUReload
moveq #mmuReload,d0
_KernelVMDispatch
ENDM
MACRO ; just do it
_nkMMUFlushAddressTranslationCache
moveq #mmuFlushAddressTranslationCache,d0
_KernelVMDispatch
ENDM
MACRO ; wack the data cache
_nkMMUFlushDataCache
moveq #mmuFlushDataCache,d0
_KernelVMDispatch
ENDM
MACRO ; wack the code cache
_nkMMUFlushCodeCache
moveq #mmuFlushCodeCache,d0
_KernelVMDispatch
ENDM
MACRO ; make it so…
_nkMMUMakePageCacheable
moveq #mmuMakePageCacheable,d0
_KernelVMDispatch
ENDM
MACRO ; make it so…
_nkMMUMakePageNonCacheable
moveq #mmuMakePageNonCacheable,d0
_KernelVMDispatch
ENDM
MACRO ; given a page, get its 68K PTE
_nkGetPTEntryGivenPage
moveq #getPTEntryGivenPage,d0
_KernelVMDispatch
ENDM
MACRO ; given a page & 68K pte, set the real PTE
_nkSetPTEntryGivenPage
moveq #setPTEntryGivenPage,d0
_KernelVMDispatch
ENDM
MACRO ; ask why we got this page fault
_nkMMUPTest
moveq #mmuPTest,d0
_KernelVMDispatch
ENDM
MACRO
_nkLRU
moveq #mmuLRU,d0
_KernelVMDispatch
ENDM
MACRO
_nkMarkUndefined
moveq #mmuMarkUndefined,d0
_KernelVMDispatch
ENDM
MACRO
_nkMakePageWriteThrough
moveq #mmuMakePageWriteThrough,d0
_KernelVMDispatch
ENDM
MACRO
_nkAllocateMemory
moveq #mmuAllocateMemory,d0
_KernelVMDispatch
ENDM
MACRO
_nkPDSReset
moveq #mmuPDSReset,d0
movea.l #0,a0 ; do soft restart
_KernelVMDispatch
ENDM
MACRO
_nkPDSHardReset
moveq #mmuPDSReset,d0
movea.l #1,a0 ; do hard restart
_KernelVMDispatch
ENDM
MACRO
_nkSTPDeathChimes
moveq #mmuSTPDeathChimes,d0
_KernelVMDispatch
ENDM
MACRO
_nkSwitchTo040
moveq #mmuSwitchTo040,d0
_KernelVMDispatch
ENDM
; End of NanoKernel traps
;____________________________________________________________________________________________
EndIf ; already included...