Commit bead0996 authored by Robert Sprowson's avatar Robert Sprowson
Browse files

Adjust buffer size for disjoint APIs

The DeviceFS API is defined in terms of actual useable buffer sizes, but BufferManager only makes use of n-1 of those requested of it (or n-4 for word bnuffers) per PRM4-88.
This change adjusts the request so the client of DeviceFS gets the useable number of bytes desired.
Changes from Colin, ref http://www.riscosopen.org/forum/forums/3/topics/1895

Version 0.70. Tagged as 'DeviceFS-0_70'
parent 5680c1fe
......@@ -11,13 +11,13 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "0.69"
Module_Version SETA 69
Module_MajorVersion SETS "0.70"
Module_Version SETA 70
Module_MinorVersion SETS ""
Module_Date SETS "18 May 2013"
Module_ApplicationDate SETS "18-May-13"
Module_Date SETS "25 May 2013"
Module_ApplicationDate SETS "25-May-13"
Module_ComponentName SETS "DeviceFS"
Module_ComponentPath SETS "castle/RiscOS/Sources/HWSupport/DeviceFS"
Module_FullVersion SETS "0.69"
Module_HelpVersion SETS "0.69 (18 May 2013)"
Module_FullVersion SETS "0.70"
Module_HelpVersion SETS "0.70 (25 May 2013)"
END
/* (0.69)
/* (0.70)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 0.69
#define Module_MajorVersion_CMHG 0.70
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 18 May 2013
#define Module_Date_CMHG 25 May 2013
#define Module_MajorVersion "0.69"
#define Module_Version 69
#define Module_MajorVersion "0.70"
#define Module_Version 70
#define Module_MinorVersion ""
#define Module_Date "18 May 2013"
#define Module_Date "25 May 2013"
#define Module_ApplicationDate "18-May-13"
#define Module_ApplicationDate "25-May-13"
#define Module_ComponentName "DeviceFS"
#define Module_ComponentPath "castle/RiscOS/Sources/HWSupport/DeviceFS"
#define Module_FullVersion "0.69"
#define Module_HelpVersion "0.69 (18 May 2013)"
#define Module_LibraryVersionInfo "0:69"
#define Module_FullVersion "0.70"
#define Module_HelpVersion "0.70 (25 May 2013)"
#define Module_LibraryVersionInfo "0:70"
......@@ -578,6 +578,8 @@ make_buffer ROUT
ADDEQ r3, dr, #device_RXBufferFlags
MOVNE r0, #DeviceCall_CreateBufferTX
ADDNE r3, dr, #device_TXBufferFlags
ASSERT device_RXBufferFlags + 4 = device_RXBufferSize
ASSERT device_TXBufferFlags + 4 = device_TXBufferSize
LDMIA r3, {r3, r4} ; get the buffer flags + size
Debug open, "suggested buffer flags", r3
......@@ -590,6 +592,13 @@ make_buffer ROUT
BL CallDevice
Pull "r3, pc", VS ; it went wrong so give up now buster
; Buffer_Create will create a buffer size of r4 -1 or r4 -4
; depending on word aligned flag. So r4 is increased so that
; we get the size requested.
TST r3, #BufferFlags_WordAlignedInserts
ADDEQ r4, r4, #1
ADDNE r4, r4, #4
Debug open, "modified flags for buffer", r3
Debug open, "modified buffer size", r4
Debug open, "first buffer handle", r5
......
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