Commit 8bcc1651 authored by Neil Turton's avatar Neil Turton
Browse files

Import from cleaned 370 CD

parent 9c0b4e47
No preview for this file type
No preview for this file type
......@@ -4,8 +4,8 @@
GBLS VString
GBLS Date
Version SETA 366
VString SETS "3.66"
Date SETS "06 Mar 1995"
Version SETA 368
VString SETS "3.68"
Date SETS "23 May 1996"
END
......@@ -76,6 +76,9 @@ redrawlast SETL {FALSE}
GBLL Swapping
GBLL debug
GBLL debugmjs
GBLL debugmjs2
GBLL debugmjs3
GBLL debugnk
GBLL debugpk
GBLL debugptr
......@@ -193,6 +196,9 @@ debug_flush SETL false ; flushing if going to file
debug SETL false ; ONLY FALSE IF NO DEBUGGING
debugomd SETL false
debugsm SETL false
debugmjs SETL false ; Mike's debugs
debugmjs2 SETL true ; Mike's debugs 2
debugmjs3 SETL false ; Mike's debugs 3
debugnk SETL false ; Neil's special debugs
debugpk SETL false ; special 2
debugptr SETL false ; pointer window
......
This diff is collapsed.
......@@ -19,6 +19,20 @@
;; Author: Neil Raine
;;-----------------------------------------------------------------------------
;whether to delegate task memory management to AMBControl
GBLL UseAMBControl
UseAMBControl SETL {TRUE}
;SWI code for AMBControl (X version) - could be a module, could be in kernel
AMBControl_SWI * &20070
GBLL StrongARM
StrongARM SETL {TRUE}
GBLL SAnaffsilicon ;fudges for naff prototype StrongARM silicon
SAnaffsilicon SETL {TRUE} :LAND: StrongARM
Module_BaseAddr
GET Hdr:ListOpts
......@@ -69,6 +83,7 @@ Module_BaseAddr
GET s.Iconbar
GET s.Wimp07
GET s.ProgErrs
GET s.W08_oldway
GET s.Wimp08
GET s.Wimp09
GET s.Wimp10
......
......@@ -1669,6 +1669,7 @@ Service
BEQ ValidateAddress
TEQ R1,#Service_NewApplication
BEQ newapplication
[ :LNOT UseAMBControl
TEQ R1,#Service_Memory
BEQ servicememory
TEQ R1,#Service_MemoryMoved
......@@ -1677,6 +1678,7 @@ Service
TEQ R1,#Service_PagesSafe
BEQ servicepagessafe ; in wimp08, screen resize etc.
]
]
TEQ R1,#Service_ModeChange
BEQ recalcmodevars
TEQ R1,#Service_ResourceFSStarting ; redeclare resource files
......@@ -2148,9 +2150,15 @@ deallocateptrs
TST R2,#task_unused
BNE %FT11
LDR R2,[R2,#task_slotptr]
Debug mjs2," wimp01 (1) slotptr to free",R2
CMP R2,#0
[ UseAMBControl
MOVGT R0,#1 ;deallocate reason code
SWIGT AMBControl_SWI
|
MOVGT R0,#ModHandReason_Free
BLGT XROS_Module ; free block (ignoring errors)
]
LDR R2,[R4,#-4]
MOV R0,#ModHandReason_Free
BL XROS_Module ; free block (ignoring errors)
......@@ -2185,9 +2193,15 @@ deletependingtask
CMP R2,#0
BLE %FT01
LDR R2,[R2,#task_slotptr] ; delete slot block
Debug mjs2," wimp01 (2) slotptr to free",R2
CMP R2,#0
[ UseAMBControl
MOVGT R0,#1 ;deallocate reason code
SWIGT AMBControl_SWI
|
MOVGT R0,#ModHandReason_Free
BLGT XROS_Module
]
LDR R2,pendingtask ; and task block (in that order)
MOV R0,#ModHandReason_Free
BL XROS_Module
......@@ -2230,6 +2244,7 @@ deletemessagequeue
02
MOV R14,#nullptr
STR R14,headpointer
STR R14,lastpointer
;
Pull "R0-R3,PC",,^ ; ignore errors
......@@ -2866,6 +2881,8 @@ PollTaskPtr # 4 ; -> last entry in PollTaskList
pollwordtaskhandle # 4 ; for cycling pollword events
]
lastpointer # 4 ; end of message queue (NK's optimise)
lastmode_x1 # 4 ; (xwindlimit+1) * px for previous mode
lastmode_y1 # 4 ; (ywindlimit+1) * py for previous mode
forceflags # 4 ; for putting windows back
......@@ -3921,6 +3938,8 @@ sysinfo_appspace
sysinfo_messages
ADR R0,headpointer
ADRL R1,lastpointer
STMIA sp,{R1}
B ExitWimp
sysinfo_memclaim
......
......@@ -2321,6 +2321,7 @@ inittasks
STR R14,backwindowhandle ; created when Wimp_Init called 1st
STR R14,errorhandle ; created when Wimp_Init called 1st
STR R14,headpointer ; no messages on queue
STR R14,lastpointer
STR R14,iconbarhandle ; no iconbar window
STR R14,iconbarleft+icd_list ; no filing system icons
STR R14,iconbarright+icd_list ; no accessory icons
......
......@@ -38,6 +38,14 @@ msf_broadcast * 1:SHL:31
MSToWimpMagicHandle * &706d6957 ; Reads "Wimp" in *memoryi, is not word aligned and has top bit (msf_broadcast) clear
MACRO
$lab CheckMsgQ
$lab
LDR R0,lastpointer
SUBS R0,R0,R2
STREQ R0,lastpointer
MEND
;;----------------------------------------------------------------------------
;; Return Message to task (called by Wimp_Poll)
......@@ -179,6 +187,7 @@ postposting
;
Debug ms,"Freeing block at:",R2
Push "R0"
CheckMsgQ
MOV R0,#ModHandReason_Free
BL XROS_Module
Pull "R0"
......@@ -251,6 +260,53 @@ int_sendmessage_fromwimp
Pull "PC"
; NK's optimise
; if there is already a message_slot_size on the message queue
; for this task, then just update it rather than add another.
check_mem_message
TEQ R0,#User_Message
MOVNE PC,LR
Push "R7,LR"
LDR R7,=Message_SlotSize
LDR LR,[R1,#16]
TEQ LR,R7
Pull "R7,PC",NE
; check queue
Push "R0-R3"
LDR R0,headpointer
LDR R2,taskhandle
CMP R2,#0
LDRGT R14,[wsptr,R2] ; NB task must be alive!
LDRGT R14,[R14,#task_flagword]
MOVGT R14,R14,LSR #flag_versionbit
ORRGT R2,R2,R14,LSL #flag_versionbit
05
CMP R0,#0
BLE %FT99
LDR R3,[R0,#msb_reasoncode]
TEQ R3,#User_Message
LDREQ R3,[R0,#msb_sender]
TEQEQ R3,R2
; its the same task, is it the right message?
LDREQ R3,[R0,#msb_size+16]
TEQEQ R3,R7
LDRNE R0,[R0,#msb_link]
BNE %BT05
LDR R2,[R1,#24] ; new next slot
LDR R1,[R1,#20] ; new current
STR R1,[R0,#msb_size+20]
STR R2,[R0,#msb_size+24]
Pull "R0-R3,R7,PC"
99
CMP PC,#0
Pull "R0-R3,R7,PC"
int_sendmessage
Push "R3-R7,handle,LR"
;
......@@ -258,6 +314,10 @@ int_sendmessage
;
; validate receiving task / window handle
;
;NK's optimise
BL check_mem_message
Pull "R3-R7,handle,PC",EQ
MOV R6,#msh_wastask ; assume not a window handle first
;
CMP R2,#0 ; 0 ==> broadcast to all tasks
......@@ -376,8 +436,9 @@ gottaskhandle
Push "R0-R2"
LDR R14,[R5,#msb_link] ; #nullptr in version 1.43 !!!
STR R14,[R4,#msb_link]
MOV R0,#ModHandReason_Free
MOV R2,R5
CheckMsgQ
MOV R0,#ModHandReason_Free
BL XROS_Module
Pull "R0-R2" ; ignore errors
doneackmess
......@@ -412,15 +473,24 @@ notusermess
ADDVS sp,sp,#4*4
BVS %FT99
;
[ false
ADR R4,headpointer-msb_link
01
LDR R14,[R4,#msb_link]
CMP R14,#0
MOVGT R4,R14
BGT %BT01
|
; use lastpointer to determine where we should put the message
LDR R4,lastpointer
CMP R4,#0
ADRLE R4,headpointer-msb_link
]
STR R2,[R4,#msb_link] ; add to end of list (FIFO)
;
STR R6,[R2,#msb_handle] ; hope this is still intact!
STR R2,lastpointer
;
Pull "R4-R7"
;
......@@ -1096,6 +1166,9 @@ callbackpoll
ADD lr_svc,R4,#task_registers ; lr_svc --> register block
LDMIA lr_svc,{R0-R14}^ ; restore USR regs
NOP
[ SAnaffsilicon
NOP
]
LDR lr_svc,[lr_svc,#15*4]
MOVS PC,lr_svc ; exit to caller, restoring flags
......
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment