[OpenBIOS] PATCH v2: Rework CIF interface to handle parameters in reverse order

Mark Cave-Ayland mark.cave-ayland at siriusit.co.uk
Tue Dec 1 16:47:31 CET 2009


Laurent Vivier wrote:

> Just one question about the patch: Why do you rename "claim" and
> "release" to "cif-claim" and "cif-release" ?
> Moreover, I think it is not compliant with OpenFirmware specification
> (IEEE 1295).

Right. The reason for this is that all of the C memory management 
routines are in Forth order, and so if they are being called via CIF 
then the argument order needs to be reversed.

At the moment, the memory management routines are registered in 2 
places: within the MMU/memory package (called from Forth) and within the 
  CIF package. So what I did was add claim/release words back into 
forth/system/ciface.fs to swap the argument order and then pass onto the 
correct function.

However: the PPC and Sparc architectures use different C functions when 
called from CIF; hence I registered copies of whichever functions were 
used for that architecture as "cif-claim" and "cif-release" and then 
call these fixed names from "claim" and "release" in 
forth/system/ciface.fs. Does that help?


ATB,

Mark.

-- 
Mark Cave-Ayland - Senior Technical Architect
PostgreSQL - PostGIS
Sirius Corporation plc - control through freedom
http://www.siriusit.co.uk
t: +44 870 608 0063

Sirius Labs: http://www.siriusit.co.uk/labs



More information about the OpenBIOS mailing list