Commits (6)
  • Jeffrey Lee's avatar
    Use new OS_Memory 16 items for calculating correct system workspace & hardware/system size · db9b49d0
    Jeffrey Lee authored
    Detail:
      s/Switcher - Calculate system workspace as the sum of ZeroPage, ScratchSpace and DebuggerSpace sizes. This fixes the value being 4KB smaller than it should be when high processor vectors are in use (since the debugger is currently given a page of its own for that case). Also include processor vector page (if any) in hardware/system total (currently not needed, but may be in future)
    Admin:
      Tested on Raspberry Pi
      Values listed in system memory section now total up correctly
    
    
    Version 1.45. Tagged as 'Switcher-1_45'
    db9b49d0
  • Jeffrey Lee's avatar
    Update to cope with physical memory pools · 4aff63cd
    Jeffrey Lee authored
    Detail:
      For physical memory pools, the max size returned by OS_ReadDynamicArea/OS_DynamicArea 2 might be a lie - although the maximum logical size of a PMP is fixed, the maximum physical size can be updated dynamically, so that a PMP can avoid wasting memory for a page list which is mostly unused.
      So whenever we want to resize a PMP, we ignore the max size indicated by the OS and instead treat it as if it has a max of 4GB
      s/Switcher - Implement the above, by replacing calls to OS_ReadDynamicArea with calls to OS_DynamicArea 2 (so DA flags can be read). Also fix some bits of code to do unsigned comparisons on size values, and to cope with the fact that OS_ChangeDynamicArea essentially limits us to +/-2GB at a time (although currently we just clamp the request, rather than make multiple requests)
    Admin:
      Tested on Pandaboard
    
    
    Version 1.46. Tagged as 'Switcher-1_46'
    4aff63cd
  • Jeffrey Lee's avatar
    Fix application and next slot size limits · bcb04bd9
    Jeffrey Lee authored
    Detail:
      s/Switcher - Fix ReadDynamicArea routine to use OS_ReadDynamicArea when reading the details of application space (since OS_DynamicArea doesn't recognise the fake application space DA)
    Admin:
      Tested on imx6
      Fixes inability to increase size of (e.g.) filer action wimpslot, and fixes 'next' slot size not being clamped to 512MB
    
    
    Version 1.47. Tagged as 'Switcher-1_47'
    bcb04bd9
  • Robert Sprowson's avatar
    Remove conflicting save desktop settings · 7b3c022c
    Robert Sprowson authored
    Saving the desktop boot file results in some conflicting settings. Since to be able to save it you must have a writable medium, you also have <Choices$Write> so you should be using !Configure.
    Remove the ChangeDynamicArea lines from being written
    * FontSize - this was specifically mentioned as conflicting in the RISC OS 3.60 User Guide, in the memory dialogue of old !Configure or Font setup plugin now.
    * SpriteSize - deprecated in the RISC OS 3.10 PRM, so don't encourage it to be non zero on boot up
    * RamFsSize - likewise in the memory dialogue of old !Configure or Disc setup plugin now.
    Still writes the WimpSlot size, since there's no corresponding !Configure item for that and it can be resized before every app starts anyway.
    
    Version 1.48. Tagged as 'Switcher-1_48'
    7b3c022c
  • Jeffrey Lee's avatar
    Avoid unnecessary remainder calculations · 0524ed0f
    Jeffrey Lee authored
    Detail:
      s/Switcher - Avoid unnecessary remainder calculations in DivRem macro
    Admin:
      Tested on Cortex-A15
    
    
    Version 1.49. Tagged as 'Switcher-1_49'
    0524ed0f
  • Jeffrey Lee's avatar
    Include page zero compatibility page in system workspace size · fe75a21b
    Jeffrey Lee authored
    Detail:
      s/Switcher - If the page zero compatibility page is present, add it to the system workspace total size
    Admin:
      Tested on BB-xM
    
    
    Version 1.50. Tagged as 'Switcher-1_50'
    fe75a21b
......@@ -11,13 +11,13 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "1.44"
Module_Version SETA 144
Module_MajorVersion SETS "1.50"
Module_Version SETA 150
Module_MinorVersion SETS ""
Module_Date SETS "27 Jan 2015"
Module_ApplicationDate SETS "27-Jan-15"
Module_Date SETS "19 Aug 2017"
Module_ApplicationDate SETS "19-Aug-17"
Module_ComponentName SETS "Switcher"
Module_ComponentPath SETS "castle/RiscOS/Sources/Desktop/Switcher"
Module_FullVersion SETS "1.44"
Module_HelpVersion SETS "1.44 (27 Jan 2015)"
Module_FullVersion SETS "1.50"
Module_HelpVersion SETS "1.50 (19 Aug 2017)"
END
/* (1.44)
/* (1.50)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 1.44
#define Module_MajorVersion_CMHG 1.50
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 27 Jan 2015
#define Module_Date_CMHG 19 Aug 2017
#define Module_MajorVersion "1.44"
#define Module_Version 144
#define Module_MajorVersion "1.50"
#define Module_Version 150
#define Module_MinorVersion ""
#define Module_Date "27 Jan 2015"
#define Module_Date "19 Aug 2017"
#define Module_ApplicationDate "27-Jan-15"
#define Module_ApplicationDate "19-Aug-17"
#define Module_ComponentName "Switcher"
#define Module_ComponentPath "castle/RiscOS/Sources/Desktop/Switcher"
#define Module_FullVersion "1.44"
#define Module_HelpVersion "1.44 (27 Jan 2015)"
#define Module_LibraryVersionInfo "1:44"
#define Module_FullVersion "1.50"
#define Module_HelpVersion "1.50 (19 Aug 2017)"
#define Module_LibraryVersionInfo "1:50"
......@@ -2486,8 +2486,20 @@ gotcounts
SWI XOS_Memory
ADDVC r9, r9, r3
STR r9, [sp, #(ic_memman-ic_sys1)*4]
MOV r0, #32*1024
STR r0, [sp, #(ic_syswork-ic_sys1)*4] ; zero page workspace, fixed size.
LDR r0, =&C10 ; ZeroPage
SWI XOS_Memory
MOVVC r9, r3
LDRVC r0, =&F10 ; ScratchSpace
SWIVC XOS_Memory
ADDVC r9, r9, r3
LDRVC r0, =&E10 ; DebuggerSpace
SWIVC XOS_Memory
ADDVC r9, r9, r3
MOVVS r9, #32*1024 ; ZeroPage+ScratchSpace+DebuggerSpace circa RISC OS 5.22
LDRVC r0, =&1010 ; Page zero compatibility
SWIVC XOS_Memory
ADDVC r9, r9, r3
STR r9, [sp, #(ic_syswork-ic_sys1)*4]
MOV r9, #32*1024
LDR r0, =&110 ; cursor/system/sound
SWI XOS_Memory
......@@ -2501,6 +2513,9 @@ gotcounts
LDR r0, =&A10 ; Kernel buffers
SWI XOS_Memory
ADDVC r9, r9, r3
LDR r0, =&D10 ; Processor vectors
SWI XOS_Memory
ADDVC r9, r9, r3
STR r9, [sp, #(ic_hardware-ic_sys1)*4]
MOV r0, #0 ; system heap
SWI XOS_ReadDynamicArea
......@@ -3152,7 +3167,7 @@ setmembar
MUL userblk,R14,cx1 ; hope we don't get overflow!
SWI XOS_ReadMemMapInfo ; R0 = page size
DivRem cx1,userblk,R0, R14 ; userblk = number of pages
DivRem cx1,userblk,R0,R14,norem ; userblk = number of pages
LDR R14,dx
CMP cx1,R14
MOVLT cx1,R14 ; bar must be at least 1 pixel wide
......@@ -3210,7 +3225,7 @@ calcbarcoords
MUL cy1,R1,x1 ; hope we don't get overflow!
SWI XOS_ReadMemMapInfo ; R0 = page size
DivRem x1,cy1,R0, R14
DivRem x1,cy1,R0,R14,norem
LDR R14,dx
CMP x1,R14
MOVLT x1,R14 ; bar must be at least 1 pixel wide
......@@ -4405,7 +4420,9 @@ switcher_click
LDREQ r1, [userblk,#icb_taskage] ; DA number
MOVS r0, r1
BEQ notdyn
SWI XOS_ReadDynamicArea ; out: r0 = base address, r1 = cur.size, r2 = max size
Push "r14"
BL ReadDynamicArea ; out: r0 = base address, r1 = cur.size, r2 = max size
Pull "r14"
MOVVC r14, r2
notdyn
Pull "r1,r2"
......@@ -4729,7 +4746,7 @@ null_event ROUT
05
Pull "R2-R4"
]
DivRem R1,R0,x1, R14 ; R1 = new memory size
DivRem R1,R0,x1,R14,norem ; R1 = new memory size
LDRB R14,[userblk,#icb_icon1]
TEQ R14,#ic_taskname ; dragging a task slot?
......@@ -4758,10 +4775,14 @@ null_event ROUT
Push "R0"
LDR R0,max_mem_drag
CMP R1,R0
MOVGT R1,R0
MOVHI R1,R0
Pull "R0"
]
SUB R1,R1,R14 ; R1 = change in area size
SUBS R1,R1,R14 ; R1 = change in area size
BVC %FT01
LDR R1,=&7FFFF000 ; Clamp to +/- 2GB-4KB if overflow
RSBLT R1,R1,#0
01
SWI XOS_ChangeDynamicArea
BVC %FT01
......@@ -4807,7 +4828,7 @@ setwimpslot ROUT
LDR R14,max_mem_drag
CMP R1,R14
MOVGT R1,R14 ; restrict drag by ammount available
MOVHI R1,R14 ; restrict drag by ammount available
LDRB R14,[userblk,#icb_icon3]
TEQ R14,#ic_freeBar ; if free bar,
......@@ -4843,20 +4864,22 @@ setcdamem
; R1 is proposed new memory
LDR R0,max_mem_drag
CMP R1,R0
MOVGT R1,R0 ; restrict drag by ammount available
MOVHI R1,R0 ; restrict drag by ammount available
MOV R3,R1
LDR R0,[userblk,#icb_taskage] ; area number
CMP R0,#128
ORRLT R0,R0,#128 ; want max size as well
SWI XOS_ReadDynamicArea
BL ReadDynamicArea
MOV R0,R3
BVS %FT02
CMP R0,R2
MOVGT R0,R2
MOVHI R0,R2
MOV R3,R1
SUBS R1,R0,R1 ; is proposed size the current size?
MOV R4,R1
SUBS R1,R0,R1
BVC %FT01
LDR R1,=&7FFFF000 ; Clamp to +/- 2GB-4KB if overflow
RSBLT R1,R1,#0
01
MOVS R4,R1 ; is proposed size the current size?
Pull "PC",EQ
; R1 is change in size
LDR R0,[userblk,#icb_taskage]
......@@ -6210,12 +6233,12 @@ savestate_bydragging
MOVVC R14,#0
STRVC R14,savedesk_nexttask ; next task to ask for a command
; OSS Get time for comment at top of auotboot file.
; OSS Get time for comment at top of autoboot file.
MOVVC R0,#OsWord_ReadRealTimeClock
ADRVC R1,pollblock
MOVVC R14,#3
STRVCB R14,[R1] ; reason code = 3 => read 5-byte time
MOVVC R14,#OWReadRTC_5ByteInt
STRVCB R14,[R1] ; reason code => read 5-byte time
SWIVC XOS_Word
MOVVC R0,R1
ADDVC R1,R1,#5 ; 5 bytes needed for time
......@@ -6250,20 +6273,6 @@ savestate_bydragging
ADRVCL R2,str_wimpslot
BLVC setmemcommand ; "*WimpSlot -next <n>K"
MOVVC R0,#fontarea
ADRVCL R2,str_fontsize
BLVC setareacommand ; "*ChangeDynamicArea -FontSize <n>K"
MOVVC R0,#spritearea
ADRVCL R2,str_spritesize
BLVC setareacommand ; "*ChangeDynamicArea -SpriteSize <n>K"
[ OldRAMFS
MOVVC R0,#ramfsarea
ADRVCL R2,str_ramfssize
BLVC setareacommand ; "*ChangeDynamicArea -RamFsSize <n>K"
]
MOVVC R0,#0 ; R0 = flag word on entry
LDRVCB R2,savedesk_handle ; R2 = file handle on entry
MOVVC R1,#Service_WimpSaveDesktop
......@@ -6470,22 +6479,6 @@ driveconfig DCB "Configure Drive ",0
;............................................................................
; In R0 = dynamic area number
; R2 -> command prefix
; [savedesk_handle] = file handle
; Out "*ChangeDynamicArea -xxx <n>K" written to file
setareacommand
Push "R1-R2,LR"
MOV R1,#0
SWI XOS_ReadDynamicArea ; doesn't touch R2
BLVC setmemcommand ; R1 = value to set, R2 -> prefix
Pull "R1-R2,PC"
;............................................................................
; In R1 = amount of memory to set (a whole number of K)
; R2 -> command prefix
; [savedesk_handle] = file handle
......@@ -6511,9 +6504,6 @@ setmemcommand
Pull "R1-R2,PC"
str_wimpslot DCB "WimpSlot -next ", 0
str_fontsize DCB "ChangeDynamicArea -FontSize ", 0
str_spritesize DCB "ChangeDynamicArea -SpriteSize ", 0
str_ramfssize DCB "ChangeDynamicArea -RamFsSize ", 0
str_K DCB "K",10,0
ALIGN
......@@ -6999,6 +6989,40 @@ MyXWimp_Poll Push "R0,R14"
ADD SP,SP,#4
Pull "PC"
ReadDynamicArea ROUT
; In: R0 = DA number
; Out: R0 = base address
; R1 = current size
; R2 = max size
[ {TRUE}
Entry "r3-r8"
; Use OS_DynamicArea so that we can claim PMPs have unlimited size
; However, OS_DynamicArea doesn't cope with application space, so we
; must still use OS_ReadDynamicArea for that
CMP r0, #-1
BEQ %FT50
CMP r0, #256
BICLO r0, r0, #128 ; Clear the OS_ReadDynamicArea "return max size" flag
MOV r1, r0
MOV r0, #2
SWI XOS_DynamicArea
TST r4, #1:SHL:20 ; Physical memory pool?
MOVNE r5, #-1 ; Remove size limit (assume will grow as needed)
MOVVC r0, r3
MOV r1, r2
MOV r2, r5
EXIT
50
SWI XOS_ReadDynamicArea
EXIT
|
CMP R0,#128
ADDLO R0,R0,#128 ; Set flag if not already set
SWI XOS_ReadDynamicArea
MOV PC,LR
]
;;----------------------------------------------------------------------------
;; Included resource files
;;----------------------------------------------------------------------------
......