|
DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - download
Length: 15585 (0x3ce1) Types: TextFile Notes: R1k Text-file segment
└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000 └─ ⟦cfc2e13cd⟧ »Space Info Vol 2« └─⟦29d9a6d64⟧ └─⟦this⟧
------------------------------------------------------------------------------- ------------------------------------------------------------------------------- -- -- VERDIX CORPORATION (C) COPYRIGHT 1988 -- 14130-A Sullyfield Circle Proprietary Information -- Chantilly, Virginia 22021 Not to be Disclosed -- -- FILE: V_TDM_CONF_I.A -- -- UNIT: VADS Interface for Configuring the Target Debug -- Monitor (TDM) Program for the M68000 Processor Family Cross -- Targets -- -- PURPOSE: This package provides the interface to TDM used by the -- the package V_TDM_CONF. It contains types, objects, -- and subprograms used to convey configuration information to and -- from TDM. -- -- This package consists of the following type definitions, -- constants, generics and TDM subprogram interfaces: -- 1. Startup table -- 2. Interrupt vector table -- 3. Configuration table -- 4. Misc TDM program variables -- 5. VADS supplied TDM ISRs -- 6. Boot subprogram -- 7. Execute subprogram -- 8. Interrupt handler generic -- 9. TDM service subprograms -- -- NOTES: Do not modify or recompile this package. -- -- This package may only be included in the TDM program. -- It MAY NOT be included in the user or kernel programs. ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- -- -- Revision History: -- -- 870706:2132 A00 Initial version. -- ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- with SYSTEM; use SYSTEM; with V_MEM_CONF; package V_TDM_CONF_I is pragma suppress(ALL_CHECKS); pragma suppress(EXCEPTION_TABLES); --------------------------- #i1: Startup table --------------------------------- type startup_table_t is record startup_stack_base : address; -- specifies the address at which the -- stack used by TDM during system -- startup should begin. The stack -- will grow from this address towards -- lower memory. -- -- Normally set to the same location -- as the kernel program's startup -- stack, top of RAM. -- -- This stack is used until the -- application program being debugged -- changes it. hardware_initialization : address; -- is the address of the routine called -- at the beginning of system initial- -- ization to initialize the hardware. end record; ----------------------- #i2: Interrupt vector table ---------------------------- type interrupt_vector_table_t is array(natural range <>) of address; untouchable_vector : constant address := system.MEMORY_ADDRESS(16#FFFF_FFFF#); -------------------------- #i3: Configuration table ---------------------------- type configuration_table_t is record tdm_stack_base : address; -- specifies the starting address -- of the stack used by TDM after system -- startup. The stack will grow from -- this address toward lower memory. tdm_stack_size : integer; -- size of the TDM stack vector_base_register : address; -- starting location of the interrupt -- vector table. interrupt_vector_size : integer; -- indicates the number of interrupt -- vectors associated with this processor. interrupt_vector_image : address; -- starting location of the user's image -- of the vector table. setup_tdm_entry_callout : address; -- is the address of the routine called -- immediately after TDM is entered via a -- breakpoint, TDM trap request, or TDM -- handled exception. setup_tdm_return_callout : address; -- is the address of the routine called -- called by TDM immediately prior to -- starting execution of the user program. test_message_size : integer; -- indicates the length of the -- tdm test message. test_message_image : address; -- starting location of the -- tdm test message. passthru_callout : address; -- is the address of the routine to -- be called to scan, parse and execute -- a debugger "pass" command tdm_idle_callout : address; -- is the address of the routine to -- be called when TDM is waiting for -- input from the host. kernel_start_enabled : boolean; kernel_start_address : address; -- if TRUE, then, at the conclusion of TDM -- elaboration and initialization, instead -- of waiting for a command from the host -- debugger, TDM jumps to the kernel's -- start address. When TRUE, the kernel and -- user programs must already be loaded on -- the target. memory_write_callout : address; -- is the address of the routine to be -- called when TDM is writing memory for -- purposes of downloading or setting -- breakpoints. memory_read_callout : address; -- is the address of the routine to be -- called when TDM is reading memory for -- purposes of examining memory or memory -- mapped I/O. memory_fill_callout : address; -- is the address of the routine to be -- called when TDM is filling memory. memory_search_callout : address; -- is the address of the routine to be -- called when TDM is searching memory. end record; untouchable_vbr : constant address := system.MEMORY_ADDRESS(16#FFFF_FFFF#); no_vbr : constant address := system.MEMORY_ADDRESS(16#FFFF_FFFE#); untouchable_table : constant address := system.MEMORY_ADDRESS(16#FFFF_FFFF#); --------------------- #i4: Misc TDM program variables ------------------------- stack_limit: address; pragma interface_name(stack_limit, "STACK_LIMIT"); -- Bottom of tdm stack group_table: array (1..1) of character; pragma interface_name(group_table, "GROUP_TABLE"); -- Table generated by the cross linker that defines the -- memory locations of the different program groups (text, constant, -- data, bss and void). Compiler defined dope vector information -- precedes the group records. ------------------------- #i5: VADS supplied TDM ISRs -------------------------- procedure bus_handler; pragma interface(ADA, bus_handler); pragma interface_name(bus_handler, "TDM_BUS_HANDLER"); -- #2 procedure address_handler; pragma interface(ADA, address_handler); pragma interface_name(address_handler, "TDM_ADDRESS_HANDLER"); -- #3 procedure illegal_handler; pragma interface(ADA, illegal_handler); pragma interface_name(illegal_handler, "TDM_ILLEGAL_HANDLER"); -- #4 procedure privilege_handler; pragma interface(ADA, privilege_handler); pragma interface_name(privilege_handler, "TDM_PRIVILEGE_HANDLER"); -- #8 procedure trace_handler; pragma interface(ADA, trace_handler); pragma interface_name(trace_handler, "TDM_TRACE_HANDLER"); -- #9 procedure format_handler; pragma interface(ADA, format_handler); pragma interface_name(format_handler, "TDM_FORMAT_HANDLER"); -- #14 procedure trap_handler; pragma interface(ADA, trap_handler); pragma interface_name(trap_handler, "TDM_TRAP_HANDLER"); -- #47 - trap 15 (default) procedure unexpected_handler; pragma interface(ADA, unexpected_handler); pragma interface_name(unexpected_handler, "TDM_UNEXPECTED_HANDLER"); -- #??? ---------------------------- #i6: Boot subprogram ----------------------------- procedure V_BOOT( configuration_table_a: address); -- specifies the TDM configuration table -- declared in the configuration package. pragma interface(ADA, V_BOOT); pragma interface_name(V_BOOT, "V_BOOT"); -- V_BOOT is called to boot/initialize TDM. It initializes the -- interrupt vector, resets mc68881/mc68882 coprocessor (if -- present). -------------------------- #i7: Execute subprogram ---------------------------- procedure V_EXECUTE; pragma interface(ADA, V_EXECUTE); pragma interface_name(V_EXECUTE, "V_EXECUTE"); -- V_EXECUTE is called to start the execution of TDM. If the -- configuration parameter, KERNEL_START_ENABLED is TRUE, then, -- V_EXECUTE jumps to the kernel program via the KERNEL_START_ADDRESS -- parameter. Otherwise, TDM waits for and processes commands sent -- from the host. ---------------------- #i8: Interrupt handler generic -------------------------- -- -- Note: this ISR wrapper is used only by serial TDM -- and not by Network TDM. -- generic with procedure process_interrupt; procedure interrupt_handler; pragma share_body(interrupt_handler, FALSE); -- Interrupt handler wrapper -- -- Instantiate your handler by: -- my_interrupt_handler is new -- V_TDM_CONF_I.interrupt_handler(my_process_interrupt); -- -- See generic body below for details. ---------------------- #i9: TDM service subprograms --------------------------- procedure passthru_put_chr(c: character); pragma interface(ADA, passthru_put_chr); pragma interface_name(passthru_put_chr, "TDM_PUT_CHR"); -- Called by the passthru command handlers to have a -- character displayed by the host debugger. procedure passthru_put_str(s: string); pragma interface(ADA, passthru_put_str); pragma interface_name(passthru_put_str, "TDM_PUT_STR"); -- Called by the passthru command handlers to have a -- string displayed by the host debugger. -- -- Note: the following subprograms are used only by serial TDM's -- ISR wrapper and not by Network TDM. -- procedure enter_interrupt; pragma interface(ADA, enter_interrupt); pragma interface_name(enter_interrupt, "TDM_ENTER_INTERRUPT"); -- Enter interrupt handler -- -- The parameter and scratch registers (d0/d1/d2/d3/a0/a1) must be -- saved before calling ENTER_INTERRUPT. -- -- Note: the TDM version of this routine doesn't switch stacks. -- However, for compatibility with the kernel, the address of the -- input stack is pushed on the stack before returning. The address -- points to the last entry pushed on the stack before the call. -- procedure complete_interrupt; pragma interface(ADA, complete_interrupt); pragma interface_name(complete_interrupt, "TDM_COMPLETE_INTERRUPT"); -- Complete interrupt handler -- -- COMPLETE_INTERRUPT expects stack to look as follows -- 0 - return pc back to handler -- 4 - pointer to previous stack (see below) (normally, the -- address pushed on the new stack by ENTER_INTERRUPT) -- -- where previous stack looks as follows: -- 0 - d0/d1/d2/d3/a0/a1 (parameter and saved scratch registers) -- 24 - handler's exception stack frame -- -- ENTER_INTERRUPT must have been previously called for this interrupt. -- -- -- Note: no return back to interrupt handler. procedure post_comm_intr; pragma interface(ADA, post_comm_intr); pragma interface_name(post_comm_intr, "TDM_POST_COMM_INTR"); -- -- Post Communications Interrupt -- -- In RS-232 TDM only, this procedure is called by the -- UART receive interrupt handler in package -- V_TDM_CONF.V_SERIAL_SUPPORT to notify TDM of the interrupt. -- This procedure is called by the communications -- interrupt handler to notify TDM of the interrupt. function validate_memory(addr: address; count: integer; memory_acc: v_mem_conf.memory_acc_t) return integer; pragma interface(Ada, validate_memory); pragma interface_name(validate_memory, "TDM_VALIDATE_MEMORY"); -- -- Validate a range of memory addresses -- -- This procedure is called by the default implementations of the -- read, write, fill, and search routines in the V_MEM_CONF -- sub-package of V_TDM_CONF. It returns the number of contiguous -- bytes starting at addr that are accessible in the way specified by -- the memory_acc parameter (READ_ONLY, WRITE_ONLY, READ_WRITE). end V_TDM_CONF_I; with SYSTEM; with MACHINE_CODE; package body V_TDM_CONF_I is pragma suppress(ALL_CHECKS); pragma suppress(EXCEPTION_TABLES); ---------------------- #i8: Interrupt handler generic -------------------------- -- -- Note: this ISR wrapper is used only by serial TDM -- and not by Network TDM. -- procedure interrupt_handler is -- Interrupt handler wrapper pragma implicit_code(off); use machine_code; begin -- Disable all interrupts while in TDM code_2'(ori_w, +16#0700#, sr); -- Save parameter and scratch registers code_2'(movem_l, d0/d1/d2/d3/a0/a1, decr(sp)); call_0'(subp => V_TDM_CONF_I.enter_interrupt'ref); -- Process interrupt call_0'(subp => process_interrupt'ref); -- Complete interrupt which also does a register restore call_0'(subp => V_TDM_CONF_I.complete_interrupt'ref); -- No return back here end; end V_TDM_CONF_I