DSPBRIDGE: OSAL: Get rid of KFILE
Subsystems (2)
PATCH 1/1 DSPBRIDGE: OSAL: Get rid of KFILE
From: Andy Shevchenko <[email protected]>
* Remove KFILE_Init(), KFILE_Exit() and tracing stuff
* Simplify KFILE_Seek()
* Simplify error checker in KFILE_Open after filp_open() call
* Remove pid/tgid related code: it seems totally useless here
* Get rid of KFILE_FileObj, use regular struct file instead
* Remove kfile.c and kfile.h
* Redefine necessary file operations in cod.c in a bit optimal way
* Clean up errbase.h
Signed-off-by Andy Shevchenko <[email protected]>
--- arch/arm/plat-omap/include/dspbridge/errbase.h | 27 -- arch/arm/plat-omap/include/dspbridge/kfile.h | 216 --------------- drivers/dsp/bridge/Kbuild | 2 +- drivers/dsp/bridge/pmgr/cod.c | 108 +++++++- drivers/dsp/bridge/pmgr/dbl.c | 14 +- drivers/dsp/bridge/services/kfile.c | 337 ------------------------ drivers/dsp/bridge/services/services.c | 10 +- 7 files changed, 112 insertions(+), 602 deletions(-) delete mode 100644 arch/arm/plat-omap/include/dspbridge/kfile.h delete mode 100644 drivers/dsp/bridge/services/kfile.c
arch/arm/plat-omap/include/dspbridge/errbase.h +0 -27
@@ -464,31 +464,4 @@/* Insufficient space to hold data in registry value. */ #define REG_E_MOREDATA (REG_EBASE + 0x03) -/* FAILURE Codes : KFILE */ -#define KFILE_EBASE (DSP_COMP_EBASE + 0x900) - -/* Invalid file handle. */ -#define E_KFILE_INVALIDHANDLE (KFILE_EBASE + 0x01) - -/* Bad file name. */ -#define E_KFILE_BADFILENAME (KFILE_EBASE + 0x02) - -/* Invalid file mode. */ -#define E_KFILE_INVALIDMODE (KFILE_EBASE + 0x03) - -/* No resources available. */ -#define E_KFILE_NORESOURCES (KFILE_EBASE + 0x04) - -/* Invalid file buffer . */ -#define E_KFILE_INVALIDBUFFER (KFILE_EBASE + 0x05) - -/* Bad origin argument. */ -#define E_KFILE_BADORIGINFLAG (KFILE_EBASE + 0x06) - -/* Invalid file offset value. */ -#define E_KFILE_INVALIDOFFSET (KFILE_EBASE + 0x07) - -/* General KFILE error condition */ -#define E_KFILE_ERROR (KFILE_EBASE + 0x08) -#endif /* ERRBASE_ */
arch/arm/plat-omap/include/dspbridge/kfile.h deleted +0 -216
216 lines not on this page · raw message
drivers/dsp/bridge/Kbuild +1 -1
@@ -2,7 +2,7 @@ obj-$(CONFIG_MPU_BRIDGE) += bridgedriver.o libgen = gen/gb.o gen/gt.o gen/gs.o gen/gh.o gen/_gt_para.o gen/uuidutil.o libservices = services/mem.o services/dpc.o \ - services/kfile.o services/sync.o \ + services/sync.o \ services/clk.o services/cfg.o services/reg.o \ services/regsup.o services/ntfy.o \ services/dbg.o services/services.o
drivers/dsp/bridge/pmgr/cod.c +102 -6
132 lines not on this page · raw message
drivers/dsp/bridge/pmgr/dbl.c +7 -7
@@ -38,6 +38,7 @@/* ----------------------------------- Host OS */ #include <dspbridge/host_os.h> #include <linux/kernel.h> +#include <linux/fs.h> /* ----------------------------------- DSP/BIOS Bridge */ #include <dspbridge/std.h>
@@ -50,7 +51,6 @@/* ----------------------------------- OS Adaptation Layer */ #include <dspbridge/mem.h> -#include <dspbridge/kfile.h> /* ----------------------------------- This */ #include <dspbridge/dbof.h>
@@ -161,7 +161,7 @@ struct TargetInfo {struct DBL_LibraryObj {u32 dwSignature;/* For object validation */ struct DBL_TargetObj *pTarget;/* Target for this library */ -struct KFILE_FileObj *file;/* DBOF file handle */ +struct file *file;/* DBOF file handle */ bool byteSwapped;/* Are bytes swapped? */ struct DBOF_FileHdr fileHdr;/* Header of DBOF file */ u16 nSymbols;/* Number of DSP/Bridge symbols */
@@ -1024,7 +1024,7 @@ static DSP_STATUS loadSect(struct DBL_TargetObj *dbl, {struct DBOF_SectHdr sectHdr;char *pBuf; -struct KFILE_FileObj *file; +struct file *file;u32 space;u32 addr;u32 total;
@@ -1090,7 +1090,7 @@ static DSP_STATUS readDCDSects(struct DBL_TargetObj *dbl, {struct DBOF_DCDSectHdr *pSectHdr;struct DCDSect *pSect; -struct KFILE_FileObj *file; +struct file *file;u16 nSects;u16 i;u16 mauSize;
@@ -1144,7 +1144,7 @@ static DSP_STATUS readDCDSects(struct DBL_TargetObj *dbl,static DSP_STATUS readHeader (struct DBL_TargetObj *dbl,struct DBL_LibraryObj *pdblLib) { -struct KFILE_FileObj *file; +struct file *file;s32 i;struct DBOF_FileHdr *pHdr;u32 swapMagic;
@@ -1218,7 +1218,7 @@ static DSP_STATUS readOvlySects(struct DBL_TargetObj *dbl,struct DBOF_OvlySectData *pData;struct OvlyData *pOvlyData;char *pName; -struct KFILE_FileObj *file; +struct file *file;u16 i, j;u16 nSects;u16 n;
@@ -1333,7 +1333,7 @@ static DSP_STATUS readSymbols(struct DBL_TargetObj *dbl, struct DBL_LibraryObj *pdblLib) {struct DBOF_SymbolHdr symHdr; -struct KFILE_FileObj *file; +struct file *file;u16 i;u16 nSymbols;u16 len;
drivers/dsp/bridge/services/kfile.c deleted +0 -337
337 lines not on this page · raw message
drivers/dsp/bridge/services/services.c +2 -8
@@ -46,7 +46,6 @@#include <dspbridge/cfg.h> #include <dspbridge/dbg.h> #include <dspbridge/dpc.h> -#include <dspbridge/kfile.h> #include <dspbridge/mem.h> #include <dspbridge/ntfy.h> #include <dspbridge/reg.h>
@@ -83,7 +82,6 @@ void SERVICES_Exit(void)SYNC_Exit ();CLK_Exit ();REG_Exit (); -KFILE_Exit ();DPC_Exit ();DBG_Exit ();CFG_Exit ();
@@ -103,7 +101,7 @@ void SERVICES_Exit(void)bool SERVICES_Init (void ) {bool fInit = true; -bool fCFG, fDBG, fDPC, fKFILE, fMEM; +bool fCFG, fDBG, fDPC, fMEM;bool fREG, fSYNC, fCLK, fNTFY;DBC_Require (cRefs >=0 );
@@ -122,12 +120,11 @@ bool SERVICES_Init(void) fCFG =CFG_Init (); fDBG =DBG_Init (); fDPC =DPC_Init (); - fKFILE =KFILE_Init (); fSYNC =SYNC_Init (); fCLK =CLK_Init (); fNTFY =NTFY_Init (); - fInit = fCFG && fDBG && fDPC && fKFILE && + fInit = fCFG && fDBG && fDPC && fMEM && fREG && fSYNC && fCLK;if (!fInit) {
@@ -143,9 +140,6 @@ bool SERVICES_Init(void)if (fREG)REG_Exit (); -if (fKFILE) -KFILE_Exit (); -if (fDPC)DPC_Exit ();
Signature · 1 line
1.5.6.5