Commit 4610877c authored by Jeffrey Lee's avatar Jeffrey Lee Committed by ROOL
Browse files

Add Wimp_Extend 15, "read slot size"

Wimp_Extend 15 is equivalent to Wimp_SlotSize,-1,-1, with the exception
that the sizes returned in R0-R2 are now measured in pages instead of
bytes. This allows code to accurately read the amount of free memory on
machines with >2GB of RAM, and provides some future-proofing should we
ever wish to support tasks with >2GB of RAM (e.g. via a future
super-jumbo wimpslot, or more likely via sparse/PMP wimpslots, where
the physical size is larger than the logical size).

Currently there's no need to provide a page-based call to set the slot
size (~2GB is fine for the forseeable future), so this call only
focuses on reading the sizes.

Version 5.67. Tagged as 'Wimp-5_67'
parent 9cc627ac
......@@ -80,5 +80,7 @@
Option SpacesInFilenames, true ; when hard space is allowed but space is not, convert
Option ExtendReadSlotSize, UseAMBControl :LAND: ShrinkableAreas ; Replacement for Wimp_SlotSize read ops, for machines with >=2GB RAM. Current implementation only caters to AMB+shrinkable Wimp/kernel configs.
END
......@@ -9,12 +9,12 @@
GBLS Module_ApplicationDate
GBLS Module_HelpVersion
GBLS Module_ComponentName
Module_MajorVersion SETS "5.66"
Module_Version SETA 566
Module_MajorVersion SETS "5.67"
Module_Version SETA 567
Module_MinorVersion SETS ""
Module_Date SETS "18 Dec 2019"
Module_ApplicationDate SETS "18-Dec-19"
Module_Date SETS "04 Jan 2020"
Module_ApplicationDate SETS "04-Jan-20"
Module_ComponentName SETS "Wimp"
Module_FullVersion SETS "5.66"
Module_HelpVersion SETS "5.66 (18 Dec 2019)"
Module_FullVersion SETS "5.67"
Module_HelpVersion SETS "5.67 (04 Jan 2020)"
END
/* (5.66)
/* (5.67)
*
* This file is automatically maintained by srccommit, do not edit manually.
*
*/
#define Module_MajorVersion_CMHG 5.66
#define Module_MajorVersion_CMHG 5.67
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 18 Dec 2019
#define Module_Date_CMHG 04 Jan 2020
#define Module_MajorVersion "5.66"
#define Module_Version 566
#define Module_MajorVersion "5.67"
#define Module_Version 567
#define Module_MinorVersion ""
#define Module_Date "18 Dec 2019"
#define Module_Date "04 Jan 2020"
#define Module_ApplicationDate "18-Dec-19"
#define Module_ApplicationDate "04-Jan-20"
#define Module_ComponentName "Wimp"
#define Module_FullVersion "5.66"
#define Module_HelpVersion "5.66 (18 Dec 2019)"
#define Module_LibraryVersionInfo "5:66"
#define Module_FullVersion "5.67"
#define Module_HelpVersion "5.67 (04 Jan 2020)"
#define Module_LibraryVersionInfo "5:67"
......@@ -204,6 +204,7 @@ WimpExtend_GetBorderInfo # 1 ; 11 Wimp 3.99 onwards
WimpExtend_NCErrorPointerSuspend # 1 ; 12 Private/STB-only
WimpExtend_SpriteSuffix # 1 ; 13 Wimp 4.85 onwards
WimpExtend_GetValidationString # 1 ; 14 Wimp 5.64 onwards
WimpExtend_ReadSlotSize # 1 ; 15 Wimp 5.67 onwards
WimpExtend_MAX # 0
......
......@@ -574,6 +574,11 @@ SWIWimp_Extend ROUT
B extend_ncerrorpointersuspend
B extend_spritesuffix
B extend_getvalidationstring
[ ExtendReadSlotSize
B extend_readslotsize
|
B badextend
]
ASSERT . - %BT00 = WimpExtend_MAX*4
extend_more
......@@ -1150,4 +1155,24 @@ extend_getvalidationstring ROUT
MyXError WimpBadIconHandle,,L
B ExitWimp
[ ExtendReadSlotSize
extend_readslotsize ROUT
; Read current + next + free memory values (as per Wimp_SlotSize), but
; return values are in units of pages
LDRB R0,osdynamicarea27
MOV R1,#-1
SWI XOS_DynamicArea
BVS ExitWimp
CMP R0,#DAReason_ReturnFree
MOVEQ R2,R2,LSR #12 ; Assume 4K pages
LDR R1,slotsize ; Already page count
STMIA SP,{R1,R2}
MOV R0,#MemoryLimit ; may not actually be full slot size
MOV R1,#0 ; (eg. if Twin is running above)
SWI XOS_ChangeEnvironment
SUBVC R0,R1,#ApplicationStart ; R0 = actual slot size
MOVVC R0,R0,LSR #12
B ExitWimp
]
END
......@@ -1213,6 +1213,9 @@ buttontype # 1 ; nonzero => buttons are release-type
alphaspriteflag # 1 ; nonzero => *iconsprites looks for alpha sprites
]
checkedcolourmapping # 1 ; nonzero => we've checked for colour mapping support in SpriteExtend (and generated the tables)
[ ExtendReadSlotSize
osdynamicarea27 # 1 ; 27 => OS_DynamicArea 27 supported, 5 => use OS_DynamicArea 5 instead
]
[ PoppingIconBar
popiconbar # 1 ; nonzero => enable autofronting
......@@ -3785,6 +3788,16 @@ gotwork
]
STRB R0,arrowIconWidth
]
;
[ ExtendReadSlotSize
; Detect OS_DynamicArea 27 support
MOV R0,#DAReason_ReturnFreePages
MOV R1,#-1
SWI XOS_DynamicArea
MOVVC R0,#DAReason_ReturnFreePages
MOVVS R0,#DAReason_ReturnFree
STRB R0,osdynamicarea27
]
;
ADRL R14,paltable ; initialise palette
ADR R11,emergencypalette
......
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