Tail 2.53 KB
Newer Older
Neil Turton's avatar
Neil Turton committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
; Copyright 1996 Acorn Computers Ltd
;
; Licensed under the Apache License, Version 2.0 (the "License");
; you may not use this file except in compliance with the License.
; You may obtain a copy of the License at
;
;     http://www.apache.org/licenses/LICENSE-2.0
;
; Unless required by applicable law or agreed to in writing, software
; distributed under the License is distributed on an "AS IS" BASIS,
; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
; See the License for the specific language governing permissions and
; limitations under the License.
;
; > s.Tail

; ----------------------------------------------------------------------------------------------------------------------
;       Release linked lists of filters. Note - may be in USER mode or SVC mode - can't use USER stack,
;       though, as it may not be okay. Hence not allowed to use the stack at all.
;    R2 -> pointer to start of list to kill (pre_filters or post_filters)
;        DANGER - CORRUPTS R0-R3
free_list
        MOV     R3, LR
        LDR     r1, [r2,#next_ptr]
        MOV     r0, #0
        STR     r0, [r2,#next_ptr]
; Get next file in the list
01
        MOV     r0, #ModHandReason_Free
        SUBS    r2, r1, #0
31
        MOVEQ   PC, R3
Neil Turton's avatar
Neil Turton committed
32 33 34 35 36
; Free the workspace
        LDR     r1, [r2,#next_ptr]
        SWI     XOS_Module
        B       %BT01
; ----------------------------------------------------------------------------
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
;       Mark as dead any filters that match on the given Task ID
;       We don't free the list entry since any subsequent call to Filter_DeRegister
;       would return an unknown filter error.
;    R1 -> pointer to start of list to walk
;    R2 =  Task ID
flag_quit_list ROUT
        Push    "r0,LR"
        MOV     r0,r1
01
        CMP     r0,#0                   ; List end?
        Pull    "r0,PC",EQ
        LDR     r14,[r0,#f_task]
        TEQ     r14,r2
        ORREQ   r14,r14,#f_task_quit
        STREQ   r14,[r0,#f_task]
        LDR     r0,[r0,#next_ptr]
        B       %BT01
; ----------------------------------------------------------------------------
Neil Turton's avatar
Neil Turton committed
55

Kevin Bracey's avatar
Kevin Bracey committed
56 57
      [ standalone
declareresourcefsfiles
Robert Sprowson's avatar
Robert Sprowson committed
58
        Entry "r0"
Kevin Bracey's avatar
Kevin Bracey committed
59 60 61 62

        ADR     R0,resourcefsfiles
        SWI     XResourceFS_RegisterFiles   ; ignore errors

Robert Sprowson's avatar
Robert Sprowson committed
63
        EXIT
Kevin Bracey's avatar
Kevin Bracey committed
64 65

resourcefsfiles
66
	ResourceFile	$MergedMsgs, Resources.FilterMgr.Messages
Kevin Bracey's avatar
Kevin Bracey committed
67 68 69
	DCD	0
      ]

Neil Turton's avatar
Neil Turton committed
70 71 72 73 74 75 76 77
; ----------------------------------------------------------------------------------------------------------------------
; Neil's debugging routines

      [ debug
        InsertNDRDebugRoutines
      ]

        END