Commits (6)
  • Robert Sprowson's avatar
    Use Rel macros for window handle manipulation · 00b0f1cc
    Robert Sprowson authored
    Munge between internal and external window handles using the same macro the Wimp does for clarity.
    00b0f1cc
  • Robert Sprowson's avatar
    Minor cleanup · 110fd564
    Robert Sprowson authored
    Don't include headers we don't need, add Hdr:HostFS so debug builds work.
    Don't pointlessly preserve low registers in finalise handler.
    Use Unix style names for LNK.
    Typos in docs fixed.
    Be consistent about wsptr/WP/wp when referring to the workspace pointer.
    110fd564
  • Robert Sprowson's avatar
    Remove signed pointer comparison · a119c768
    Robert Sprowson authored
    Linked lists end with NULL, not <= 0.
    a119c768
  • Robert Sprowson's avatar
    Fix for 26 bit pre filter exit · 848b7109
    Robert Sprowson authored
    PRM 3-305 says to return with MOVS PC,LR but in the 26 bit case we were not preserving flags.
    848b7109
  • Robert Sprowson's avatar
    [455] Don't call filters for tasks that have quit · 07fa7e20
    Robert Sprowson authored
    Filter Manager continued to call filters based on their Task ID after they had quit. Now, watch out for Service_WimpCloseDown and disable any matching filters (the filters are retained so that any subsequent legitimate deregister attempt doesn't get an unknown filter error). As only 16 bit Task IDs are stored, define a new flag in b31 to denote a disabled filter - this also means there is a free "no match" when the filter lists are scanned.
    The copy filter isn't affected because it doesn't select on Task ID.
    
    FilterMgr.s: New flag to mark a task as having quit
    ModHead.s: Listen for Service_WimpCloseDown and check the lists of Task IDs for any matches. Simplify *Filters code with advanced subroutine technology.
    SWIs.s: Knock out the "quit" flag when comparing task handles to deregister
    Tail.s: Walk a list, mark any matching tasks as having quit
    
    Version 0.29. Tagged as 'Filter-0_29'
    07fa7e20
  • Robert Sprowson's avatar
    Build fix · fc7abb71
    Robert Sprowson authored
    Ethusiastic unused header cull removed APCS.<APCS> which is used (only) in the standalone case. Replace singular FunctionEntry/Return with Entry/EXIT which is what is more generally used by the module
    
    Version 0.29. Not tagged
    fc7abb71
...@@ -33,7 +33,7 @@ Filter_RegisterPreFilter ...@@ -33,7 +33,7 @@ Filter_RegisterPreFilter
Entry: Entry:
R0 - Pointer to 0 terminated filter name. R0 - Pointer to 0 terminated filter name.
R1 - Addresss of filter. R1 - Address of filter.
R2 - Value to be passed in R12. R2 - Value to be passed in R12.
R3 - Task handle of task to which filter is applied. R3 - Task handle of task to which filter is applied.
or 0 for all tasks. or 0 for all tasks.
...@@ -66,7 +66,7 @@ Filter_RegisterPostFilter ...@@ -66,7 +66,7 @@ Filter_RegisterPostFilter
Entry: Entry:
R0 - Pointer to 0 terminated filter name. R0 - Pointer to 0 terminated filter name.
R1 - Addresss of filter. R1 - Address of filter.
R2 - Value to be passed in R12. R2 - Value to be passed in R12.
R3 - Task handle of task to which filter is applied. R3 - Task handle of task to which filter is applied.
or 0 for all tasks. or 0 for all tasks.
...@@ -104,7 +104,7 @@ R12 equal to the value of R2 when this SWI is called. ...@@ -104,7 +104,7 @@ R12 equal to the value of R2 when this SWI is called.
Entry: Entry:
R0 - Pointer to 0 terminated filter name. R0 - Pointer to 0 terminated filter name.
R1 - Addresss of filter. R1 - Address of filter.
R2 - Value to be passed in R12. R2 - Value to be passed in R12.
R3 - Task handle of task to which filter was applied. R3 - Task handle of task to which filter was applied.
...@@ -120,11 +120,11 @@ R12 equal to the value of R2 when this SWI is called. ...@@ -120,11 +120,11 @@ R12 equal to the value of R2 when this SWI is called.
Entry: Entry:
R0 - Pointer to 0 terminated filter name. R0 - Pointer to 0 terminated filter name.
R1 - Addresss of filter. R1 - Address of filter.
R2 - Value to be passed in R12. R2 - Value to be passed in R12.
R3 - Task handle of task to which filter was applied. R3 - Task handle of task to which filter was applied.
All must be the same as those passed to RegisterPreFilter All must be the same as those passed to RegisterPostFilter
Exit: Exit:
Registers preserved. Registers preserved.
Filter de-registered. Filter de-registered.
......
; ;
; This file is automatically maintained by srccommit, do not edit manually. ; This file is automatically maintained by srccommit, do not edit manually.
; Last processed by srccommit version: 1.1.
; ;
GBLS Module_MajorVersion GBLS Module_MajorVersion
GBLA Module_Version GBLA Module_Version
...@@ -10,14 +9,12 @@ ...@@ -10,14 +9,12 @@
GBLS Module_ApplicationDate GBLS Module_ApplicationDate
GBLS Module_HelpVersion GBLS Module_HelpVersion
GBLS Module_ComponentName GBLS Module_ComponentName
GBLS Module_ComponentPath Module_MajorVersion SETS "0.29"
Module_MajorVersion SETS "0.28" Module_Version SETA 29
Module_Version SETA 28
Module_MinorVersion SETS "" Module_MinorVersion SETS ""
Module_Date SETS "23 Oct 2013" Module_Date SETS "19 Jan 2020"
Module_ApplicationDate SETS "23-Oct-13" Module_ApplicationDate SETS "19-Jan-20"
Module_ComponentName SETS "Filter" Module_ComponentName SETS "Filter"
Module_ComponentPath SETS "castle/RiscOS/Sources/Desktop/Filter" Module_FullVersion SETS "0.29"
Module_FullVersion SETS "0.28" Module_HelpVersion SETS "0.29 (19 Jan 2020)"
Module_HelpVersion SETS "0.28 (23 Oct 2013)"
END END
/* (0.28) /* (0.29)
* *
* This file is automatically maintained by srccommit, do not edit manually. * This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
* *
*/ */
#define Module_MajorVersion_CMHG 0.28 #define Module_MajorVersion_CMHG 0.29
#define Module_MinorVersion_CMHG #define Module_MinorVersion_CMHG
#define Module_Date_CMHG 23 Oct 2013 #define Module_Date_CMHG 19 Jan 2020
#define Module_MajorVersion "0.28" #define Module_MajorVersion "0.29"
#define Module_Version 28 #define Module_Version 29
#define Module_MinorVersion "" #define Module_MinorVersion ""
#define Module_Date "23 Oct 2013" #define Module_Date "19 Jan 2020"
#define Module_ApplicationDate "23-Oct-13" #define Module_ApplicationDate "19-Jan-20"
#define Module_ComponentName "Filter" #define Module_ComponentName "Filter"
#define Module_ComponentPath "castle/RiscOS/Sources/Desktop/Filter"
#define Module_FullVersion "0.28" #define Module_FullVersion "0.29"
#define Module_HelpVersion "0.28 (23 Oct 2013)" #define Module_HelpVersion "0.29 (19 Jan 2020)"
#define Module_LibraryVersionInfo "0:28" #define Module_LibraryVersionInfo "0:29"
...@@ -37,7 +37,7 @@ copy_filter_handler ...@@ -37,7 +37,7 @@ copy_filter_handler
Push "r0-r2,r10,r11,LR" Push "r0-r2,r10,r11,LR"
ADD r0,r10,#1 Rel r0,r10
LDR r1,copy_filters LDR r1,copy_filters
copy_filter_exit copy_filter_exit
...@@ -57,6 +57,7 @@ copy_filter_exit ...@@ -57,6 +57,7 @@ copy_filter_exit
NOP NOP
Pull "r1" Pull "r1"
B copy_filter_exit B copy_filter_exit
LNK s.PostFilter
LNK PostFilter.s
...@@ -39,24 +39,15 @@ Module_BaseAddr ...@@ -39,24 +39,15 @@ Module_BaseAddr
GET Hdr:Macros GET Hdr:Macros
GET Hdr:System GET Hdr:System
GET Hdr:ModHand GET Hdr:ModHand
GET Hdr:Machine.<Machine>
GET Hdr:APCS.<APCS>
GET Hdr:Services GET Hdr:Services
GET Hdr:VduExt
GET Hdr:FSNumbers GET Hdr:FSNumbers
GET Hdr:NewErrors GET Hdr:NewErrors
GET Hdr:Variables
GET Hdr:Proc GET Hdr:Proc
GET Hdr:Sprite
GET Hdr:Wimp GET Hdr:Wimp
GET Hdr:WimpSpace
GET Hdr:Messages GET Hdr:Messages
GET Hdr:FilerAct
GET Hdr:MsgTrans GET Hdr:MsgTrans
GET Hdr:MsgMenus
GET Hdr:ResourceFS GET Hdr:ResourceFS
GET Hdr:ColourTran GET Hdr:HostFS
GET Hdr:Hourglass
GET Hdr:NdrDebug GET Hdr:NdrDebug
GET Hdr:Switcher GET Hdr:Switcher
...@@ -81,14 +72,18 @@ hostvdu SETL {TRUE} ; True to send debug to tube ...@@ -81,14 +72,18 @@ hostvdu SETL {TRUE} ; True to send debug to tube
debugxx SETL {FALSE} ; General debugging. debugxx SETL {FALSE} ; General debugging.
debugregister SETL {FALSE} ; Register/de-register debugregister SETL {FALSE} ; Register/de-register
wsptr RN R12 MACRO
$lab Rel $to,$from,$cc ; Turn Abs window handles to Rel
$lab ADD$cc $to,$from,#1
MEND
; ---------------------------------------------------------------------------------------------------------------------- ; ----------------------------------------------------------------------------------------------------------------------
; Filter block structure ; Filter block structure
^ 0 ^ 0
next_ptr # 4 ; Pointer to next in chain (-1 if none) next_ptr # 4 ; Pointer to next in chain (0 if none)
prev_ptr # 4 ; Pointer to previous entry in chain (-1 if none) prev_ptr # 4 ; Pointer to previous entry in chain (0 if none)
f_task # 4 ; Task ID for which the filter is to be called. f_task # 4 ; Task ID for which the filter is to be called (16 bit)
f_task_quit * 1:SHL:31 ; this Task ID was seen to have quit
f_mask # 4 ; Event mask. f_mask # 4 ; Event mask.
f_address # 4 ; Address to call. f_address # 4 ; Address to call.
f_R12 # 4 ; Value in R12 when calling. f_R12 # 4 ; Value in R12 when calling.
...@@ -113,6 +108,7 @@ post_icon_filters # 4 ...@@ -113,6 +108,7 @@ post_icon_filters # 4
convert_buffer # 20 convert_buffer # 20
message_block # 16 message_block # 16
flags # 4 flags # 4
f_messagesopen * (1:SHL:0)
filter_text # 4 filter_text # 4
task_text # 4 task_text # 4
mask_text # 4 mask_text # 4
...@@ -121,10 +117,8 @@ fake_postrect # 4 ; do we want to fake the post-rectangle filter? (Wimp < 3.86) ...@@ -121,10 +117,8 @@ fake_postrect # 4 ; do we want to fake the post-rectangle filter? (Wimp < 3.86)
get_handle_from_r10 # 4 ; do we get the window handle from r10 or the stack get_handle_from_r10 # 4 ; do we get the window handle from r10 or the stack
; for get-rectangle filters? (from r10 for Wimp > 3.99) ; for get-rectangle filters? (from r10 for Wimp > 3.99)
f_messagesopen * (1:SHL:0)
max_running_work * (@-wsorigin) max_running_work * (@-wsorigin)
LNK s.ModHead LNK ModHead.s
...@@ -70,19 +70,10 @@ min_tab3 * 8 ...@@ -70,19 +70,10 @@ min_tab3 * 8
; --------------------------------------------------------------------------------------------------------------------- ; ---------------------------------------------------------------------------------------------------------------------
; Handle *Filters - List all attached filters with the tasks they are attached to. ; Handle *Filters - List all attached filters with the tasks they are attached to.
Filters_Code Filters_Code
Push "r7-r8,LR" Push "r7-r9,LR"
Debug xx,"*Filters called listing pre_filters" Debug xx,"*Filters called, listing filters"
LDR wsptr,[R12] LDR wp,[R12]
ADR r1, prefilter_token
MOV r2, #0
BL MsgTrans_Lookup
MOVVC r0, r2
MOVVC r1, r3
SWIVC XOS_WriteN
SWIVC XOS_NewLine
Pull "r7-r8,PC",VS
MOV r4, #0 ; r4 = how much space we are using on the stack to hold column headings. MOV r4, #0 ; r4 = how much space we are using on the stack to hold column headings.
...@@ -115,318 +106,189 @@ Filters_Code ...@@ -115,318 +106,189 @@ Filters_Code
BVS %FT05 BVS %FT05
STR sp, all_text STR sp, all_text
LDR r0, filter_text ; pre filters
MOV r1, r5 MOV r0, #2_011
BL writefield ADR r1, prefilter_token
BVS %FT05 BL writeheadings
LDR r0, task_text
MOV r1, r6
BL writefield
SWIVC XOS_NewLine
BVS %FT05
LDR r0, filter_text
MOV r1, r5
BL writefield_dashed
BVS %FT05
LDR r0, task_text
MOV r1, r6
BL writefield_dashed
SWIVC XOS_NewLine
BVS %FT05 BVS %FT05
LDR r3, pre_filters LDR r3, pre_filters
B %FT02 B %FT08
01 01
LDR r9, [r3, #f_task]
TST r9, #f_task_quit
BNE %FT03 ; Mute this one, the specific task has quit
LDR r0, [r3, #f_name] LDR r0, [r3, #f_name]
MOV r1, r5 MOV r1, r5
BL writefield BL writefield
BVS %FT05 BVS %FT05
LDR r0, [r3, #f_task] MOV r0, r9
CMP r0, #0 BL writetaskname
LDREQ r0, all_text SWIVC XOS_NewLine
SWINE XTaskManager_TaskNameFromHandle
BVS %FT05
MOV r1, r6
BL writefield
SWI XOS_NewLine
BVS %FT05 BVS %FT05
03
LDR r3, [r3, #next_ptr] LDR r3, [r3, #next_ptr]
02 08
CMP r3, #0 CMP r3, #0
BNE %BT01 BNE %BT01
SWI XOS_NewLine SWI XOS_NewLine
ADRL r1, postfilter_token
MOV r2, #0
BL MsgTrans_Lookup
MOVVC r0, r2
MOVVC r1, r3
SWIVC XOS_WriteN
SWIVC XOS_NewLine
BVS %FT05 BVS %FT05
LDR r0, filter_text ; post filters
MOV r1, r5 MOV r0, #2_111
BL writefield ADRL r1, postfilter_token
BVS %FT05 BL writeheadings
LDR r0, task_text
MOV r1, r6
BL writefield
BVS %FT05
LDR r0, mask_text
MOV r1, r7
BL writefield
SWIVC XOS_NewLine
BVS %FT05
LDR r0, filter_text
MOV r1, r5
BL writefield_dashed
BVS %FT05
LDR r0, task_text
MOV r1, r6
BL writefield_dashed
BVS %FT05
LDR r0, mask_text
MOV r1, r7
BL writefield_dashed
SWIVC XOS_NewLine
BVS %FT05 BVS %FT05
LDR r3, post_filters LDR r3, post_filters
B %FT04 B %FT18
03 11
LDR r9, [r3, #f_task]
TST r9, #f_task_quit
BNE %FT13 ; Mute this one, the specific task has quit
LDR r0, [r3, #f_name] LDR r0, [r3, #f_name]
MOV r1, r5 MOV r1, r5
BL writefield BL writefield
BVS %FT05 BVS %FT05
LDR r0, [r3, #f_task] MOV r0, r9
CMP r0, #0 BL writetaskname
LDREQ r0, all_text
SWINE XTaskManager_TaskNameFromHandle
MOVVC r1, r6
BLVC writefield
BVS %FT05 BVS %FT05
LDR r0, [r3, #f_mask] LDR r0, [r3, #f_mask]
ADR r1, convert_buffer ADR r1, convert_buffer
MOV r2, #10 MOV r2, #?convert_buffer
SWI XOS_ConvertHex8 SWI XOS_ConvertHex8
SWIVC XOS_Write0 SWIVC XOS_Write0
SWIVC XOS_NewLine SWIVC XOS_NewLine
BVS %FT05 BVS %FT05
13
LDR r3, [r3, #next_ptr] LDR r3, [r3, #next_ptr]
04 18
CMP r3, #0 CMP r3, #0
BNE %BT03 BNE %BT11
SWI XOS_NewLine SWI XOS_NewLine
BVS %FT05 BVS %FT05
; rect filters
MOV r0, #2_011
ADRL r1, rectfilter_token ADRL r1, rectfilter_token
MOV r2, #0 BL writeheadings
BL MsgTrans_Lookup
MOVVC r0, r2
MOVVC r1, r3
SWIVC XOS_WriteN
SWIVC XOS_NewLine
BVS %FT05
LDR r0, filter_text
MOV r1, r5
BL writefield
BVS %FT05
LDR r0, task_text
MOV r1, r6
BL writefield
SWIVC XOS_NewLine
BVS %FT05
LDR r0, filter_text
MOV r1, r5
BL writefield_dashed
BVS %FT05
LDR r0, task_text
MOV r1, r6
BL writefield_dashed
SWIVC XOS_NewLine
BVS %FT05 BVS %FT05
LDR r3, rect_filters LDR r3, rect_filters
B %FT11 B %FT28
21
LDR r9, [r3, #f_task]
TST r9, #f_task_quit
BNE %FT23 ; Mute this one, the specific task has quit
10
LDR r0, [r3, #f_name] LDR r0, [r3, #f_name]
MOV r1, r5 MOV r1, r5
BL writefield BL writefield
BVS %FT05 BVS %FT05
LDR r0, [r3, #f_task] MOV r0, r9
CMP r0, #0 BL writetaskname
LDREQ r0, all_text
SWINE XTaskManager_TaskNameFromHandle
MOVVC r1, r6
BLVC writefield
SWIVC XOS_NewLine
BVS %FT05 BVS %FT05
23
LDR r3, [r3, #next_ptr] LDR r3, [r3, #next_ptr]
11 28
CMP r3, #0 CMP r3, #0
BNE %BT10 BNE %BT21
SWI XOS_NewLine SWI XOS_NewLine
BVS %FT05 BVS %FT05
; post rect filters
MOV r0, #2_011
ADRL r1, postrectfilter_token ADRL r1, postrectfilter_token
MOV r2, #0 BL writeheadings
BL MsgTrans_Lookup
MOVVC r0, r2
MOVVC r1, r3
SWIVC XOS_WriteN
SWIVC XOS_NewLine
BVS %FT05
LDR r0, filter_text
MOV r1, r5
BL writefield
BVS %FT05
LDR r0, task_text
MOV r1, r6
BL writefield
SWIVC XOS_NewLine
BVS %FT05
LDR r0, filter_text
MOV r1, r5
BL writefield_dashed
BVS %FT05
LDR r0, task_text
MOV r1, r6
BL writefield_dashed
SWIVC XOS_NewLine
BVS %FT05 BVS %FT05
LDR r3, post_rect_filters LDR r3, post_rect_filters
B %FT31 B %FT38
31
LDR r9, [r3, #f_task]
TST r9, #f_task_quit
BNE %FT33 ; Mute this one, the specific task has quit
30
LDR r0, [r3, #f_name] LDR r0, [r3, #f_name]
MOV r1, r5 MOV r1, r5
BL writefield BL writefield
BVS %FT05 BVS %FT05
LDR r0, [r3, #f_task] MOV r0, r9
CMP r0, #0 BL writetaskname
LDREQ r0, all_text
SWINE XTaskManager_TaskNameFromHandle
MOVVC r1, r6
BLVC writefield
SWIVC XOS_NewLine SWIVC XOS_NewLine
BVS %FT05 BVS %FT05
33
LDR r3, [r3, #next_ptr] LDR r3, [r3, #next_ptr]
31 38
CMP r3, #0 CMP r3, #0
BNE %BT30 BNE %BT31
SWI XOS_NewLine SWI XOS_NewLine
BVS %FT05 BVS %FT05
; post icon filters
MOV r0, #2_011
ADRL r1, posticonfilter_token ADRL r1, posticonfilter_token
MOV r2, #0 BL writeheadings
BL MsgTrans_Lookup
MOVVC r0, r2
MOVVC r1, r3
SWIVC XOS_WriteN
SWIVC XOS_NewLine
BVS %FT05
LDR r0, filter_text
MOV r1, r5
BL writefield
BVS %FT05
LDR r0, task_text
MOV r1, r6
BL writefield
SWIVC XOS_NewLine
BVS %FT05
LDR r0, filter_text
MOV r1, r5
BL writefield_dashed
BVS %FT05
LDR r0, task_text
MOV r1, r6
BL writefield_dashed
SWIVC XOS_NewLine
BVS %FT05 BVS %FT05
LDR r3, post_icon_filters LDR r3, post_icon_filters
B %FT41 B %FT48
41
LDR r9, [r3, #f_task]
TST r9, #f_task_quit
BNE %FT43 ; Mute this one, the specific task has quit
40
LDR r0, [r3, #f_name] LDR r0, [r3, #f_name]
MOV r1, r5 MOV r1, r5
BL writefield BL writefield
BVS %FT05 BVS %FT05
LDR r0, [r3, #f_task] MOV r0, r9
CMP r0, #0 BL writetaskname
LDREQ r0, all_text
SWINE XTaskManager_TaskNameFromHandle
MOVVC r1, r6
BLVC writefield
SWIVC XOS_NewLine SWIVC XOS_NewLine
BVS %FT05 BVS %FT05
43
LDR r3, [r3, #next_ptr] LDR r3, [r3, #next_ptr]
41 48
CMP r3, #0 CMP r3, #0
BNE %BT40 BNE %BT41
SWI XOS_NewLine SWI XOS_NewLine
BVS %FT05 BVS %FT05
; copy filters
ADRL r1, copyfilter_token MOV r0, #2_001
MOV r2, #0 ADR r1, copyfilter_token
BL MsgTrans_Lookup BL writeheadings
MOVVC r0, r2
MOVVC r1, r3
SWIVC XOS_WriteN
SWIVC XOS_NewLine
BVS %FT05
LDR r0, filter_text
MOV r1, r5
BL writefield
SWIVC XOS_NewLine
BVS %FT05
LDR r0, filter_text
MOV r1, r5
BL writefield_dashed
SWIVC XOS_NewLine
BVS %FT05 BVS %FT05
LDR r3, copy_filters LDR r3, copy_filters
B %FT13 B %FT58
12 51
LDR r0, [r3, #f_name] LDR r0, [r3, #f_name]
MOV r1, r5 MOV r1, r5
BL writefield BL writefield
SWIVC XOS_NewLine SWIVC XOS_NewLine
BVS %FT05 BVS %FT05
53
LDR r3, [r3, #next_ptr] LDR r3, [r3, #next_ptr]
13 58
CMP r3, #0 CMP r3, #0
BNE %BT12 BNE %BT51
05 05
ADD sp, sp, r4 ADD sp, sp, r4
Pull "r7-r8,PC" Pull "r7-r9,PC"
lookuptostack lookuptostack
; In: r1->token ; In: r1->token
...@@ -455,6 +317,74 @@ lookuptostack ...@@ -455,6 +317,74 @@ lookuptostack
STRB r0, [r1] STRB r0, [r1]
MOV pc, r8 MOV pc, r8
writetaskname ROUT
; Write a task name (from ID) or "All"
; In: r0 = the Task ID
; r6 = width of heading column
; Out: r0 corrupted
Push "r1-r2,lr"
CMP r0, #0
LDREQ r0, all_text
SWINE XTaskManager_TaskNameFromHandle
MOVVC r1, r6
BLVC writefield
Pull "r1-r2,pc"
writeheadings ROUT
; Write the introductory text and column headings for a filter
; In: r0 = bitfield asking for b0 = filter heading
; b1 = task heading
; b2 = mask heading
; r1 -> token for introductory text
; r5-r7 = width of heading columns
Push "r0-r4,lr"
MOV r4, r0 ; Flags for later
MOV r2, #0
BL MsgTrans_Lookup
MOVVC r0, r2
MOVVC r1, r3
SWIVC XOS_WriteN
SWIVC XOS_NewLine
Pull "r0-r4,pc",VS
TST r4,#1 ; Want filter heading
LDRNE r0, filter_text
MOVNE r1, r5
BLNE writefield
Pull "r0-r4,pc",VS
TST r4,#2 ; Want task heading
LDRNE r0, task_text
MOVNE r1, r6
BLNE writefield
Pull "r0-r4,pc",VS
TST r4,#4 ; Want mask heading
LDRNE r0, mask_text
MOVNE r1, r6
BLNE writefield
SWIVC XOS_NewLine ; Newline regardless
Pull "r0-r4,pc",VS
TST r4,#1 ; Want filter heading
LDRNE r0, filter_text
MOVNE r1, r5
BLNE writefield_dashed
Pull "r0-r4,pc",VS
TST r4,#2 ; Want task heading
LDRNE r0, task_text
MOVNE r1, r6
BLNE writefield_dashed
Pull "r0-r4,pc",VS
TST r4,#4 ; Want mask heading
LDRNE r0, mask_text
MOVNE r1, r6
BLNE writefield_dashed
SWIVC XOS_NewLine ; Newline regardless
Pull "r0-r4,pc"
writefield writefield
; Write control-terminated string, padded with spaces to field width ; Write control-terminated string, padded with spaces to field width
; In: r0 = text to print ; In: r0 = text to print
...@@ -549,7 +479,7 @@ Init ...@@ -549,7 +479,7 @@ Init
STR r2, [r12] STR r2, [r12]
01 01
MOV r12, r2 MOV wp, r2
; Clear list pointers ; Clear list pointers
...@@ -586,7 +516,7 @@ Init ...@@ -586,7 +516,7 @@ Init
] ]
ADR R0,servicecallback ADR R0,servicecallback
MOV R1,WP ; workspace pointer MOV R1,wp ; workspace pointer
SWI XOS_AddCallBack ; install the call back to broadcast we are here message SWI XOS_AddCallBack ; install the call back to broadcast we are here message
MOVVC R0,#-1 MOVVC R0,#-1
STRVC R0,callbackpending ; and then setup a suitable flag to indicate we have a callback pending STRVC R0,callbackpending ; and then setup a suitable flag to indicate we have a callback pending
...@@ -614,9 +544,11 @@ servicecallback ...@@ -614,9 +544,11 @@ servicecallback
; ---------------------------------------------------------------------------------------------------------------------- ; ----------------------------------------------------------------------------------------------------------------------
; Module service entry point ; Module service entry point
ServiceTable ServiceTable
ASSERT Service_WimpCloseDown < Service_ResourceFSStarting
ASSERT Service_ResourceFSStarting < Service_WimpRegisterFilters ASSERT Service_ResourceFSStarting < Service_WimpRegisterFilters
DCD 0 ; flags word DCD 0 ; flags word
DCD Service2 - Module_BaseAddr DCD Service2 - Module_BaseAddr
DCD Service_WimpCloseDown
[ standalone [ standalone
DCD Service_ResourceFSStarting DCD Service_ResourceFSStarting
] ]
...@@ -627,6 +559,7 @@ ServiceTable ...@@ -627,6 +559,7 @@ ServiceTable
Service Service
MOV R0, R0 ; flag service table to aware kernels MOV R0, R0 ; flag service table to aware kernels
TEQ R1,#Service_WimpRegisterFilters TEQ R1,#Service_WimpRegisterFilters
TEQNE R1,#Service_WimpCloseDown
[ standalone [ standalone
TEQNE R1,#Service_ResourceFSStarting TEQNE R1,#Service_ResourceFSStarting
] ]
...@@ -637,10 +570,14 @@ Service2 ...@@ -637,10 +570,14 @@ Service2
BEQ serviceresourcefsstarting BEQ serviceresourcefsstarting
] ]
LDR R12, [R12] LDR wp, [R12]
CMP R12, #0 CMP R12, #0
MOVEQ PC, LR ; Exit if no workspace MOVEQ PC, LR ; Exit if no workspace
TEQ R1,#Service_WimpCloseDown
BEQ servicewimpclosedown
; else must be Service_WimpRegisterFilters
;------------------------------------- ;-------------------------------------
; Register our filters with the Wimp ; Register our filters with the Wimp
; In: ; In:
...@@ -777,15 +714,40 @@ serviceresourcefsstarting ...@@ -777,15 +714,40 @@ serviceresourcefsstarting
RETURN RETURN
] ]
; Wimp says a task has quit
; In R0 = 0 if closing, +ve if new task starting killed another
; R2 = task handle
servicewimpclosedown ROUT
CMP r0,#0
RETURN NE
Push "r1-r2,LR"
MOV r2,r2,LSL #16
MOV r2,r2,LSR #16
; Mark dead any pre filters matching that Task ID
LDR r1,pre_filters
BL flag_quit_list
LDR r1,rect_filters
BL flag_quit_list
LDR r1,post_filters
BL flag_quit_list
LDR r1,post_rect_filters
BL flag_quit_list
LDR r1,post_icon_filters
BL flag_quit_list
; r1, copy_filters Copy filters don't use a Task ID
Pull "r1-r2,LR"
RETURN
; ---------------------------------------------------------------------------------------------------------------------- ; ----------------------------------------------------------------------------------------------------------------------
; RMKill'ing the module - Release filter handlers. Release linked lists of filters. ; RMKill'ing the module - Release filter handlers. Release linked lists of filters.
Die Die
; ;
LDR r12, [r12] LDR wp, [r12]
CMP r12, #0 CMP r12, #0
RETURN EQ RETURN EQ
Push "r0-r11,LR" Push "r7-r11,LR"
ADR r2, pre_filters ADR r2, pre_filters
BL free_list ; Free list of pre filters BL free_list ; Free list of pre filters
...@@ -833,7 +795,7 @@ Die ...@@ -833,7 +795,7 @@ Die
LDR R0,callbackpending LDR R0,callbackpending
CMP R0,#0 ; do we have a callback pending? (clears V) CMP R0,#0 ; do we have a callback pending? (clears V)
ADRNE R0,servicecallback ; yes, so remove it before its granted ADRNE R0,servicecallback ; yes, so remove it before its granted
MOVNE R1,WP ; as we are going to die MOVNE R1,wp ; as we are going to die
SWINE XOS_RemoveCallBack SWINE XOS_RemoveCallBack
MOV R0,#0 MOV R0,#0
...@@ -849,9 +811,9 @@ Die ...@@ -849,9 +811,9 @@ Die
BL MsgTrans_CloseFile ; Make sure Messages file is closed. BL MsgTrans_CloseFile ; Make sure Messages file is closed.
Pull "R0-R11,LR" Pull "R7-R11,LR"
RETURNVC ; clear V - don't refuse to die RETURNVC ; clear V - don't refuse to die
; ---------------------------------------------------------------------------------------------------------------------- ; ----------------------------------------------------------------------------------------------------------------------
LNK s.SWIs LNK SWIs.s
...@@ -116,4 +116,4 @@ message_file_name ...@@ -116,4 +116,4 @@ message_file_name
ALIGN ALIGN
LNK s.PreFilter LNK PreFilter.s
...@@ -41,7 +41,7 @@ post_icon_filter_handler ...@@ -41,7 +41,7 @@ post_icon_filter_handler
MOV R2,R2,ASL #16 MOV R2,R2,ASL #16
MOV R2,R2,LSR #16 MOV R2,R2,LSR #16
ADD r0,r10,#1 ; find the window being redrawn Rel r0,r10 ; find the window being redrawn
LDR r1,post_icon_filters LDR r1,post_icon_filters
post_icon_filter_exit post_icon_filter_exit
...@@ -69,6 +69,6 @@ post_icon_filter_exit ...@@ -69,6 +69,6 @@ post_icon_filter_exit
B post_icon_filter_exit B post_icon_filter_exit
LNK s.CopyFilter LNK CopyFilter.s
...@@ -40,7 +40,7 @@ post_rect_filter_handler ...@@ -40,7 +40,7 @@ post_rect_filter_handler
MOV R2,R2,ASL #16 MOV R2,R2,ASL #16
MOV R2,R2,LSR #16 MOV R2,R2,LSR #16
ADD r0,r10,#1 ; find the window being redrawn Rel r0,r10 ; find the window being redrawn
LDR r1,post_rect_filters LDR r1,post_rect_filters
post_rect_filter_exit post_rect_filter_exit
...@@ -136,6 +136,6 @@ fakepostrect_handler ...@@ -136,6 +136,6 @@ fakepostrect_handler
] ]
LNK s.PoIcFilter LNK PoIcFilter.s
...@@ -88,4 +88,4 @@ post_filter_exit ...@@ -88,4 +88,4 @@ post_filter_exit
MOVEQ R0,R7 MOVEQ R0,R7
B %BT01 B %BT01
LNK s.Tail LNK Tail.s
...@@ -43,7 +43,11 @@ pre_filter_handler ...@@ -43,7 +43,11 @@ pre_filter_handler
LDR r1,pre_filters LDR r1,pre_filters
pre_filter_exit pre_filter_exit
CMP r1,#0 CMP r1,#0
[ No26bitCode
Pull "r1-r2,PC",EQ ; End of list. Pull "r1-r2,PC",EQ ; End of list.
|
Pull "r1-r2,PC",EQ,^ ; End of list.
]
LDR r14,[r1,#next_ptr] LDR r14,[r1,#next_ptr]
Push "r14" Push "r14"
...@@ -61,6 +65,6 @@ pre_filter_exit ...@@ -61,6 +65,6 @@ pre_filter_exit
Pull "r1" Pull "r1"
B pre_filter_exit B pre_filter_exit
LNK s.RectFilter LNK RectFilter.s
...@@ -49,8 +49,8 @@ rect_filter_handler ...@@ -49,8 +49,8 @@ rect_filter_handler
LDR r0, get_handle_from_r10 ; find the window being redrawn LDR r0, get_handle_from_r10 ; find the window being redrawn
TEQ r0, #0 TEQ r0, #0
LDREQ r0, [sp,#16+12+0] ; BTW - you didn't see that... LDREQ r0, [sp,#16+12+0] ; BTW - you didn't see that...
ADDEQ r0, r0, #1 Rel r0,r0,EQ
ADDNE r0, r10, #1 ; turn pointer into window handle Rel r0,r10,NE ; turn pointer into window handle
LDR r1,rect_filters LDR r1,rect_filters
rect_filter_exit rect_filter_exit
...@@ -76,6 +76,7 @@ rect_filter_exit ...@@ -76,6 +76,7 @@ rect_filter_exit
NOP NOP
Pull "r1" Pull "r1"
B rect_filter_exit B rect_filter_exit
LNK s.PoRtFilter
LNK PoRtFilter.s
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
Filter_SWIdecode Filter_SWIdecode
Push "LR" Push "LR"
LDR wsptr,[R12] ; wsptr --> workspace LDR wp,[R12] ; wsptr --> workspace
Debug xx,"SWI ",r11 Debug xx,"SWI ",r11
...@@ -270,6 +270,7 @@ find_filter ...@@ -270,6 +270,7 @@ find_filter
TEQ r14,r2 TEQ r14,r2
BNE %BT01 BNE %BT01
LDR r14,[r4,#f_task] LDR r14,[r4,#f_task]
BIC r14,r14,#f_task_quit
TEQ r14,r3 TEQ r14,r3
CMPNE r14,#0 CMPNE r14,#0
BNE %BT01 BNE %BT01
...@@ -1040,4 +1041,4 @@ SWIFilter_DeRegisterPostIconFilter ...@@ -1040,4 +1041,4 @@ SWIFilter_DeRegisterPostIconFilter
Pull "r1-r4,LR" Pull "r1-r4,LR"
RETURNVS RETURNVS
LNK s.MsgTrans LNK MsgTrans.s
...@@ -28,21 +28,39 @@ free_list ...@@ -28,21 +28,39 @@ free_list
01 01
MOV r0, #ModHandReason_Free MOV r0, #ModHandReason_Free
SUBS r2, r1, #0 SUBS r2, r1, #0
MOVLE PC, R3 MOVEQ PC, R3
; Free the workspace ; Free the workspace
LDR r1, [r2,#next_ptr] LDR r1, [r2,#next_ptr]
SWI XOS_Module SWI XOS_Module
B %BT01 B %BT01
; ---------------------------------------------------------------------------- ; ----------------------------------------------------------------------------
; 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
; ----------------------------------------------------------------------------
[ standalone [ standalone
declareresourcefsfiles declareresourcefsfiles
FunctionEntry "r0" Entry "r0"
ADR R0,resourcefsfiles ADR R0,resourcefsfiles
SWI XResourceFS_RegisterFiles ; ignore errors SWI XResourceFS_RegisterFiles ; ignore errors
Return "r0" EXIT
resourcefsfiles resourcefsfiles
ResourceFile $MergedMsgs, Resources.FilterMgr.Messages ResourceFile $MergedMsgs, Resources.FilterMgr.Messages
......