DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400 Tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400 Tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: ┃ P T

⟦9c68757a2⟧ TextFile

    Length: 7947 (0x1f0b)
    Types: TextFile
    Names: »PEAB_INTERPROGRAM_COMMUNICATION_ASM«

Derivation

└─⟦afbc8121e⟧ Bits:30000532 8mm tape, Rational 1000, MC68020_OS2000 7_2_2
    └─ ⟦77aa8350c⟧ »DATA« 
        └─⟦f794ecd1d⟧ 
            └─⟦24d1ddd49⟧ 
                └─⟦this⟧ 

TextFile

;=============================================================================
; Copyright (C)  1989 PHILIPS ELEKTRONIKINDUSTRIER AB , SWEDEN   3.0
;=============================================================================
;
;
;  UNIT NAME :
;     PEAB_INTERPROGRAM_COMMUNICATION_ASM
;
;  KEYWORDS
;     IPCO
;
;  CONTENTS
;
;     Creation information:
;
;         CI-Element-Id : 15/SOURCE-100132
;         Programmer    : CURT STR\M/CUST
;         Creation date : 1989-01-02
;         Department    : DGG
;         Project       : BS2000
;
;     Revision history:
;         1.0/CUST/1989-01-02/First release
;
;     Unit function:
;         Support for Ada runtime. IPC-specific operations required by ART
;         to handle IPC messages in rendezvous. The actual code is contained
;         in OS2000 and this unit is just the interface.
;
;         N.B. This unit is ONLY referenced by ART and is logically an
;         extension of ART.
;
;     Dependencies:
;         MC68020/OS2000/CDF
;
;     Improvements:
;         No suggestions
;
;=============================================================================

        .module "PEAB_INTERPROGRAM_COMMUNICATION_ASM"
                                                
        .gbl.l  __ipc_handle_protocol
        .gbl.l  __ipc_release_buffer
        .gbl.l  __ipc_evacuate_queue
;        
; Miscellaneous definitions
;
        cct_start               equ 16#400#
        a32_size                equ 16#0200_0000#
;
;       CCT offsets
;
        pi_cpt                  equ 88
;
;       CPT offsets
;
        os2000svcptr            equ 72
;    
;       OS2000 svc offsets
;
        ipc$handle_protocol     equ 79
        ipc$release_buffer      equ 80
        ipc$evacuate_queue      equ 81

                    
;-------------------------------------------------------------------
; General parameter offsets in stack
; P1 is the first parameter in the list, P2 is the second and so on.
; Link A6,xx is supposed to have been performed and the offsets
; are valid from the resulting A6 frame pointer.

        P1      equ     8
        P2      equ     P1+4
        P3      equ     P2+4
        P4      equ     P3+4
        P5      equ     P4+4
        P6      equ     P5+4

;------------------------------------------------------------------------
        
    
        .sect   ada_code,code,relocatable,alignment:=2


    
;----------------------------------------------------------------
;
;   Macro _$setup_svc_in_a1
;
;   Set up a1 to point to the svc table
;
;   Destroys:   d1
;
;----------------------------------------------------------------

        .macro  setup_svc_in_a1
        move.l  sp,d1
        andi.l  #(-a32_size),d1
        movea.l ([cct_start+pi_cpt,d1.l],os2000svcptr),a1   ;a1 -> svc
        .endmacro


;------------------------------------------------------------------------
;
;    procedure Handle_Protocol (Buffer : in out Buffer_Address;     P1
;                               Slot_Data : in Message_Slot_Data;   P2
;                               Queue_Data : in Associated_Data;    P3
;                               Parameters : out Parameter_Address; P4
;                               Ignore_Message : out Boolean);      P5
;
;   Shared C interface:
;
;   status  IPC$Handle_Protocol (Buffer,Slot_Data,Queue_Data,Parameters)
;
;   uchar   **Buffer;    /* in out Pointer to buffer address  d0 */
;   ulong   Slot_Data;   /* in     Third word in IPC token  d1 */
;   uchar   *Queue_Data; /* in     User data of current queue  sp+4 */
;   uchar   **Parameters;/* in out Pointer to parameter address sp+8 */
;                     
;
;   Stack layout before call to IPC$Handle_Protocol:
;
;   sp ->   Queue_Data
;   +4      *Parameters ------------+
;   a6 ->   Old a6                  !
;   a6+4    Return address          !
;   a6+8    Buffer (=> d0)          !
;   a6+12   Slot_Data (=> d1)       !
;   a6+16   Queue_Data              !
;   a6+20   Parameters <------------+              
;   a6+24   Ignore_Message
;
;   Function: 
;   Process an incoming message and produce a parameter block which
;   is suitable for a rendezvous call to the receiver. Also manage
;   virtual channels on a low level for a receiver. This format is
;   depending on the actual parameter profile for a receiver. The incoming
;   message buffer may be exchanged by this procedure! If a message is
;   not qualified to be passed to the receiver then Ignore_Message is
;   True and the buffer is deallocated. If Ignore_Message is False then
;   the buffer is NOT deallocated.
;
;   This procedure is called by ART when it has retreived an IPC token
;   from the queue but before the actual "rendezvous".
;
;------------------------------------------------------------------------    

__ipc_handle_protocol:
        .local

        link    a6,#0  

        setup_svc_in_a1

        clr.l   (p5,a6)                         ; Ignore_Message = False
        moveq.l #p1,d0
        add.l   a6,d0                           ; d0 := *Buffer
        move.l  (p2,a6),d1                      ; D1 = Slot_Data
        pea     (p4,a6)                         ; -(sp) = *Parameters
        move.l  (p3,a6),-(sp)                   ; -(sp) = Queue_Data
        jsr     ([IPC$Handle_Protocol*4,a1])    ; Call shared library
        tst.l   d0                              ; D0=status
        beq.s   $exit
$ignore:move.b  #1,(p5+3,a6)                    ; Ignore_Message = True
$exit:  unlk    a6
        rts

 
;------------------------------------------------------------------------
;
;   procedure Release_Buffer (The_Buffer : in Buffer_Address;      P1
;                             Slot_Data : in Message_Slot_Data);   P2
;
;   Shared C interface:
;
;   status    IPC$Release_Buffer (Buffer,Slot_Data)
;
;   uchar   *Buffer     /* in The buffer address  d0 */
;   ulong   Slot_Data   /* in Third longword in IPC token  d1 */
;
;   Function:
;   Release a buffer (deallocate). Use the proper method which is 
;   controlled by the Slot_Data parameter.
;   
;   This procedure is called by ART after a "rendezvous" is made to
;   free the message buffer.
;
;------------------------------------------------------------------------
    
__ipc_release_buffer:
        .local
        link    a6,#0

        setup_svc_in_a1

        move.l  (p1,a6),d0                      ; D0 = Buffer
        move.l  (p2,a6),d1                      ; D1 = Slot_Data
        jsr     ([IPC$Release_Buffer*4,a1])     ; Call shared library
        unlk    a6
        rts
 
    
;------------------------------------------------------------------------
;
;   procedure Evacuate_Queue (The_Queue : in out Message_Queue.Queue;  P1
;                             Queue_Data : in Associated_Data);        P2
;
;   Shared C interface:
;
;   status    IPC$Evacuate_Queue (Queue,Delete_Queue)
;
;   q_address_t     *Queue         /* in out The queue pointer  d0 */
;   ulong           *Delete_Queue  /* in     TRUE/FALSE  d1 */
;                                  
;   N.B. The Queue_Data parameter is discarded in this interface!
;
;   Function:
;   Close a queue and deallocate all resources tied to it. Also abort
;   any open channels, "group_off" any multicast subscriptions and
;   undefine any name in the name server. The queue is emptied but 
;   NOT deleted!
;   
;   This procedure is called by ART as a result of a "Detach_Queue" call
;   from IPC 
;   OR by ART when a task is terminating and the entry is still
;   attached to IPC.
;   
;------------------------------------------------------------------------


__ipc_evacuate_queue:                       
        .local
        link    a6,#0

        setup_svc_in_a1

        move.l  (p1,a6),d0                      ; D0 = The_Queue
        clr.l   d1                              ; D1 = FALSE (<=> keep q) 
        jsr     ([ipc$evacuate_queue*4,a1])     ; Call shared library
        unlk    a6
        rts                     
 
        .end