Source
...
Target
Commits (1)
  • Robert Sprowson's avatar
    Makefile rationalised a bit. · c6ceff35
    Robert Sprowson authored
    Error messages now not padded with one too many nulls.
    Use CMHG's magic BAD_SWI return code rather than our own.
    Compiles, but not tested.
    
    Version 0.67. Tagged as 'NVRAM-0_67'
    c6ceff35
......@@ -8,7 +8,7 @@ Various changes occured in Verson 0.48 of this module that have not been
detailed anywhere, including the addition of five new SWI calls. The error
block 0x00819200 is used.
Please note that the SWI's NVRAM_Read and NVRAM_Write aare now deprecated,
Please note that the SWI's NVRAM_Read and NVRAM_Write are now deprecated,
and may be removed in future versions of the OS.
SWI NVRAM_Lookup (0x4ee02)
......
......@@ -15,52 +15,6 @@
# Makefile for NVRAM
#
#
# Paths
#
EXP_H = <CExport$Dir>.h
EXP_HDR = <export$dir>.^.Interface2
#
# Generic options:
#
MKDIR = mkdir -p
AS = objasm
CC = cc
CMHG = cmhg
CP = copy
LD = link
RM = remove
WIPE = -wipe
AFLAGS = -depend !Depend -Stamp -quit
CFLAGS = -c -depend !Depend -zM -zps1 -ffa ${INCLUDES} ${THROWBACK}
CPFLAGS = ~cfr~v
WFLAGS = ~c~v
#
# Libraries
#
CLIB = CLIB:o.stubs
RLIB = RISCOSLIB:o.risc_oslib
RSTUBS = RISCOSLIB:o.rstubs
ROMSTUBS = RISCOSLIB:o.romstubs
ROMCSTUBS = RISCOSLIB:o.romcstubs
ABSSYM = RISC_OSLib:o.AbsSym
DEBUGLIB = C:DebugLib.o.DebugLibZM
MODMALLOCLIB = C:ModMalloc.o.Lib_M
WILDLIB = C:Wild.o.Wild_M
DDTLIB = C:DDTLib.o.DDTLib_M
DESKLIB = C:Desk.o.Desk_M
DEBUGLIBS = ${DEBUGLIB} ${MODMALLOCLIB} ${WILDLIB} ${DDTLIB} ${DESKLIB}
DLIBS = ${DEBUGLIBS} TCPIPLibs:o.unixlibzm TCPIPLibs:o.inetlibzm TCPIPLibs:o.socklib5zm
#
# Include files
#
INCLUDES = -IC:
#
# Program specific options:
#
......@@ -71,18 +25,22 @@ TRACERAMTARGET = rm.${COMPONENT}db
OBJS = header.o module.o nvram.o msgfile.o parse.o trace.o
EXPORTS = ${EXP_H}.${COMPONENT} ${EXP_HDR}.${COMPONENT}
RDIR = ${RESDIR}.NVRAM
DIRS = o._dirs
DIRS = o._dirs
#
# Paths
#
EXP_H = <CExport$Dir>.h
EXP_HDR = <export$dir>.^.Interface2
#
# Rule patterns
# Generic options:
#
.SUFFIXES: .o .c .s .cmhg
CFLAGS = ${C_NO_STKCHK} ${C_MODULE}
.c.o:; ${CC} ${CFLAGS} ${DFLAGS} -o $@ $<
.cmhg.o:; ${CMHG} -p -o $@ $<
.cmhg.h:; ${CMHG} -p -d $@ $<
.s.o:; ${AS} ${AFLAGS} $< $@
include StdTools
include ModuleLibs
include ModStdRule
#
# build a relocatable module:
......@@ -91,8 +49,7 @@ all: ${RAMTARGET}
trace: ${TRACERAMTARGET}
o.module: h.header
module.o: header.h
#
# Create local directories
......@@ -133,15 +90,11 @@ install_rom: ${TARGET}
@echo ${COMPONENT}: rom module installed
clean:
${WIPE} o.* ${WFLAGS}
${WIPE} linked.* ${WFLAGS}
${RM} ${TARGET}
${RM} ${RAMTARGET}
${XWIPE} o ${WFLAGS}
${XWIPE} aof ${WFLAGS}
${XWIPE} rm ${WFLAGS}
${XWIPE} linked ${WFLAGS}
${RM} h.header
${RM} o
${RM} rm
${RM} aof
${RM} linked
@echo ${COMPONENT}: cleaned
resources:
......@@ -171,7 +124,7 @@ ${RAMTARGET}: ${OBJS} ${CLIB} ${DIRS}
${LD} -o $@ -module ${OBJS} ${CLIB}
${TRACERAMTARGET}: ${OBJS} ${CLIB} ${DIRS}
${LD} -o $@ -module ${OBJS} ${CLIB} ${DLIBS}
${LD} -o $@ -module ${OBJS} ${CLIB} ${DEBUGLIBS}
${EXP_H}.${COMPONENT}: export.h.${COMPONENT}
${CP} export.h.${COMPONENT} $@ ${CPFLAGS}
......
/* (0.66)
/* (0.67)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.2.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 0.66
#define Module_MajorVersion_CMHG 0.67
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 01 Aug 2005
#define Module_Date_CMHG 01 Jan 2012
#define Module_MajorVersion "0.66"
#define Module_Version 66
#define Module_MajorVersion "0.67"
#define Module_Version 67
#define Module_MinorVersion ""
#define Module_Date "01 Aug 2005"
#define Module_Date "01 Jan 2012"
#define Module_ApplicationDate "01-Aug-05"
#define Module_ApplicationDate "01-Jan-12"
#define Module_ComponentName "NVRAM"
#define Module_ComponentPath "RiscOS/Sources/HWSupport/NVRAM"
#define Module_ComponentPath "castle/RiscOS/Sources/HWSupport/NVRAM"
#define Module_FullVersion "0.66"
#define Module_HelpVersion "0.66 (01 Aug 2005)"
#define Module_LibraryVersionInfo "0:66"
#define Module_FullVersion "0.67"
#define Module_HelpVersion "0.67 (01 Jan 2012)"
#define Module_LibraryVersionInfo "0:67"
......@@ -33,8 +33,6 @@
#include "trace.h"
ERROR_STRUCT( BADSWI, "BadSWI" );
static _kernel_oserror *TinyError;
msgtransblock msgs;
msgtransblock tags;
......@@ -140,9 +138,8 @@ module_swi( int swi_no, _kernel_swi_regs *r, void *pw )
err = nvram_setbytes( (char *)r->r[0], (void *)r->r[1], r->r[2], r->r[3] );
break;
default:
return _swix (MessageTrans_ErrorLookup, _INR(0,4), ERROR(BADSWI), 0, 0, 0, MODULE_NAME);
//msgfile_error_lookup( ERROR(BADSWI), 0, 0, 0, MODULE_NAME, 0, 0, 0 );
default:
return error_BAD_SWI;
}
return msgfile_error_lookup( &msgs, err, NULL );
......
......@@ -50,12 +50,12 @@
with non-byte aligned start or end).
KBracey suggested moving the caching into the kernel */
ERROR_STRUCT( NOMEM, "NoMem" );
ERROR_STRUCT( NOTAG, "NoTag" );
ERROR_STRUCT( LOCKED, "Locked");
ERROR_STRUCT( READBUF, "ReadBuf");
ERROR_STRUCT( NEEDBUF, "NeedBuf");
ERROR_STRUCT( NOTBYTE, "NotByte");
ERROR_STRUCT( static, NOMEM, "NoMem" );
ERROR_STRUCT( static, NOTAG, "NoTag" );
ERROR_STRUCT( static, LOCKED, "Locked");
ERROR_STRUCT( static, READBUF, "ReadBuf");
ERROR_STRUCT( static, NEEDBUF, "NeedBuf");
ERROR_STRUCT( static, NOTBYTE, "NotByte");
static char *pCache = NULL;
static int nvram_size;
......
......@@ -17,17 +17,14 @@
* General purpose error header.
*/
/* We use top bit of error number to flag whether error needs */
/* to be looked up before being returned to the OS. */
#define ERROR_LOOKUP_BIT (1U<<30)
/* We use top bit of error number to flag whether error needs */
/* to be looked up before being returned to the OS. */
#define ERROR_LOOKUP_BIT (1U<<30)
#define ERROR_BASE 0x00819200
/* Some specific OS errors. */
#define ERROR_BADSWI 0x00000112
#define ERROR_BASE 0x00819200
/* Our errors. */
#define ERROR_NOMEM (ERROR_BASE+0)
#define ERROR_NOMEM (ERROR_BASE+0)
#define ERROR_NOTAG (ERROR_BASE+1)
#define ERROR_LOCKED (ERROR_BASE+2)
#define ERROR_READBUF (ERROR_BASE+4)
......@@ -35,11 +32,9 @@
#define ERROR_NEEDBUF (ERROR_BASE+6)
/* Declare the given error in a memory efficient way. */
#define ERROR_STRUCT(name,text) \
struct {int errnum; char errmess[sizeof(text)+1];} name = {ERROR_LOOKUP_BIT|ERROR_##name,text}
/* Declare the given error as external. */
#define ERROR_STRUCT(prefix,name,text) \
prefix struct {int errnum; char errmess[sizeof(text)];} name = {ERROR_LOOKUP_BIT | ERROR_##name,text}
#define ERROR_EXTERN(name) \
extern struct {int errnum; char errmess[1];} name
extern struct {int errnum; char errmess[1];} name;
#define ERROR(e) ((_kernel_oserror *)&(e))
......@@ -73,7 +73,6 @@ typedef struct _location {
unsigned int flags;
} location;
_kernel_oserror *nvram_initialise( void );
void nvram_finalise( void );
_kernel_oserror *nvram_read( char *tag, void *buffer, int bufferlen, int *retvalue );
......