Esempio n. 1
0
LCPDataset::~LCPDataset()

{
    FlushCache();
    if( fpImage != NULL )
        VSIFCloseL( fpImage );
    CPLFree(pszProjection);
}
Esempio n. 2
0
GTXDataset::~GTXDataset()

{
    FlushCache();

    if( fpImage != NULL )
        VSIFCloseL( fpImage );
}
Esempio n. 3
0
FujiBASDataset::~FujiBASDataset()

{
    FlushCache();
    if( fpImage != NULL )
        VSIFClose( fpImage );
    CSLDestroy( papszHeader );
}
Esempio n. 4
0
WEBPDataset::~WEBPDataset()

{
    FlushCache();
    if (fpImage)
        VSIFCloseL(fpImage);
    VSIFree(pabyUncompressed);
}
Esempio n. 5
0
RasdamanDataset::~RasdamanDataset()
{
  if (transaction.get_status() == r_Transaction::active) {
    transaction.commit();
  }
  database.close();
  FlushCache();
}
GXFDataset::~GXFDataset()

{
    FlushCache();
    if( hGXF != NULL )
        GXFClose( hGXF );
    CPLFree( pszProjection );
}
Esempio n. 7
0
int iop_heap_dma_upload(void *src,u32 dst,int size)
{
	int i=0,len=0,size2;
  u8  *pkt;
	int ret=0;
	int ret2=0;
	int p=0;

	int cont1=0;
while(size>0) // send data with src unaligned
{
if(size>512) size2=512; else size2=size;
CD_memcpy2(memsend,((unsigned char *) src)+p,size2);
do

{
	FlushCache(0);

  /* build packet */
  pkt = send_buffer2; 
  PUSHDATA( u32, pkt, (u32)memsend, i);
  pkt += i; len += i;
  PUSHDATA( u32, pkt, dst, i);
  pkt += i; len += i;
  PUSHDATA( int, pkt, size2, i);
  pkt += i; len += i;
  PUSHDATA( int, pkt, 0, i);
  pkt += i; len += i;

	ret = SifSetDma((SifDmaTransfer_t*)send_buffer2,1);

	if(ret==0)  {nopdelay();cont1++;}
	if(ret==0 && cont1>=3) {cont1=0;SifSetDChain();}
}while(ret==0); // modificado por Hermes

	while((ret2 = SifDmaStat(ret))>=0);


	FlushCache(0);
size-=size2;
p+=size2;
dst+=size2;
}
	return (ret2 < -1);
}
Esempio n. 8
0
/*
 * Conversion to physical address 
 *	Cache control required, but cache control by page cannot be
 *	provided without MMU, so not implemented.
 */
LOCAL INT _CnvPhysicalAddr( VP laddr, INT len, VP *paddr )
{
	*paddr = toPhysicalAddress(laddr);

	/* Cache off not possible, so cache flash only is performed. */
	FlushCache(laddr, len);

	return len;
}
Esempio n. 9
0
PNMDataset::~PNMDataset()

{
    FlushCache();
    if( fpImage != nullptr && VSIFCloseL( fpImage ) != 0 )
    {
        CPLError(CE_Failure, CPLE_FileIO, "I/O error" );
    }
}
Esempio n. 10
0
USGSDEMDataset::~USGSDEMDataset()

{
    FlushCache();

    CPLFree( pszProjection );
    if( fp != NULL )
        VSIFClose( fp );
}
Esempio n. 11
0
IDADataset::~IDADataset()

{
    FlushCache();

    if( fpRaw != NULL )
        VSIFCloseL( fpRaw );
    CPLFree( pszProjection );
}
Esempio n. 12
0
MEMDataset::~MEMDataset()

{
    FlushCache();
    CPLFree( pszProjection );

    GDALDeinitGCPs( nGCPCount, pasGCPs );
    CPLFree( pasGCPs );
}
	/**
	 * Writes a byte to the cached buffer
	 * @param aValue Byte to write
	 */
	void TCachedByteStreamWriter::WriteByte(TUint8 aValue)
		{
		if(iPos == iCacheSize)
			{
			FlushCache();
			}		
		iCacheBuffer[iPos++] = aValue;	
		++iBytesWritten;
		}
GDALArrayBandBlockCache::~GDALArrayBandBlockCache()
{
    FlushCache();

    if( !bSubBlockingActive )
        CPLFree( u.papoBlocks );
    else
        CPLFree( u.papapoBlocks );
}
Esempio n. 15
0
DOQ1Dataset::~DOQ1Dataset()

{
    FlushCache();

    CPLFree( pszProjection );
    if( fpImage != NULL )
        CPL_IGNORE_RET_VAL(VSIFCloseL( fpImage ));
}
Esempio n. 16
0
HF2Dataset::~HF2Dataset()

{
    FlushCache();
    CPLFree(pszWKT);
    CPLFree(panBlockOffset);
    if (fp)
        VSIFCloseL(fp);
}
Esempio n. 17
0
RIKDataset::~RIKDataset()

{
    FlushCache();
    CPLFree( pOffsets );
    if( fp != NULL )
        VSIFCloseL( fp );
    delete poColorTable;
}
Esempio n. 18
0
GRIBDataset::~GRIBDataset()

{
    FlushCache();
    if( fp != NULL )
        VSIFCloseL( fp );
		
    CPLFree( pszProjection );
}
Esempio n. 19
0
USGSDEMDataset::~USGSDEMDataset()

{
    FlushCache();

    CPLFree( pszProjection );
    if( fp != nullptr )
        CPL_IGNORE_RET_VAL(VSIFCloseL( fp ));
}
Esempio n. 20
0
ARGDataset::~ARGDataset()

{
    CPLFree(pszFilename);

    FlushCache();
    if( fpImage != nullptr )
        VSIFCloseL( fpImage );
}
Esempio n. 21
0
PDSDataset::~PDSDataset()

{
    FlushCache();
    if( fpImage != NULL )
        VSIFCloseL( fpImage );

    CloseDependentDatasets();
}
Esempio n. 22
0
DTEDDataset::~DTEDDataset()

{
    FlushCache();
    CPLFree(pszFilename);
    CPLFree( pszProjection );
    if( psDTED != NULL )
        DTEDClose( psDTED );
}
Esempio n. 23
0
VRTWarpedDataset::~VRTWarpedDataset()

{
    FlushCache();

/* -------------------------------------------------------------------- */
/*      Cleanup overviews.                                              */
/* -------------------------------------------------------------------- */
    int iOverview;

    for( iOverview = 0; iOverview < nOverviewCount; iOverview++ )
    {
        GDALDatasetH hDS = (GDALDatasetH) papoOverviews[iOverview];

        if( GDALDereferenceDataset( hDS ) < 1 )
        {
            GDALReferenceDataset( hDS );
            GDALClose( hDS );
        }
    }

    CPLFree( papoOverviews );

/* -------------------------------------------------------------------- */
/*      Cleanup warper if one is in effect.                             */
/* -------------------------------------------------------------------- */
    if( poWarper != NULL )
    {
        const GDALWarpOptions *psWO = poWarper->GetOptions();

/* -------------------------------------------------------------------- */
/*      We take care to only call GDALClose() on psWO->hSrcDS if the    */
/*      reference count drops to zero.  This is makes it so that we     */
/*      can operate reference counting semantics more-or-less           */
/*      properly even if the dataset isn't open in shared mode,         */
/*      though we require that the caller also honour the reference     */
/*      counting semantics even though it isn't a shared dataset.       */
/* -------------------------------------------------------------------- */
        if( psWO->hSrcDS != NULL )
        {
            if( GDALDereferenceDataset( psWO->hSrcDS ) < 1 )
            {
                GDALReferenceDataset( psWO->hSrcDS );
                GDALClose( psWO->hSrcDS );
            }
        }

/* -------------------------------------------------------------------- */
/*      We are responsible for cleaning up the transformer outselves.   */
/* -------------------------------------------------------------------- */
        if( psWO->pTransformerArg != NULL )
            GDALDestroyTransformer( psWO->pTransformerArg );

        delete poWarper;
    }
}
Esempio n. 24
0
/*
 * Copy statically linked IRX files to kernel RAM.
 * They will be loaded by the debugger later...
 */
void install_modules(const config_t *config)
{
	ramfile_t file_tab[IRX_NUM + 1];
	ramfile_t *file_ptr = file_tab;
	ramfile_t *ktab = NULL;
	u32 addr = IRX_ADDR;

	D_PRINTF("%s: addr=%08x\n", __FUNCTION__, addr);

	/*
	 * build RAM file table
	 */
#ifdef _SMS_MODULES
	if (config_get_bool(config, SET_DEBUGGER_SMS_MODULES)) {
		ramfile_set(file_ptr++, "ps2ip", _ps2ip_sms_irx_start, _ps2ip_sms_irx_size);
		ramfile_set(file_ptr++, "ps2smap", _ps2smap_sms_irx_start, _ps2smap_sms_irx_size);
	} else {
#endif
		ramfile_set(file_ptr++, "ps2ip", _ps2ip_irx_start, _ps2ip_irx_size);
		ramfile_set(file_ptr++, "ps2smap", _ps2smap_irx_start, _ps2smap_irx_size);
#ifdef _SMS_MODULES
	}
#endif
	ramfile_set(file_ptr++, "ps2dev9", _ps2dev9_irx_start, _ps2dev9_irx_size);
	ramfile_set(file_ptr++, "debugger", _debugger_irx_start, _debugger_irx_size);
	ramfile_set(file_ptr++, "memdisk", _memdisk_irx_start, _memdisk_irx_size);
	ramfile_set(file_ptr++, "eesync", _eesync_irx_start, _eesync_irx_size);
	ramfile_set(file_ptr, NULL, NULL, 0); /* terminator */

	/*
	 * copy modules to kernel RAM
	 *
	 * memory structure at @addr:
	 * |RAM file table|IRX module #1|IRX module #2|etc.
	 */
	DI();
	ee_kmode_enter();

	ktab = (ramfile_t*)addr;
	addr += sizeof(file_tab);
	file_ptr = file_tab;

	while (file_ptr->hash) {
		memcpy((u8*)addr, file_ptr->addr, file_ptr->size);
		file_ptr->addr = (u8*)addr;
		addr += file_ptr->size;
		file_ptr++;
	}

	memcpy(ktab, file_tab, sizeof(file_tab));

	ee_kmode_exit();
	EI();

	FlushCache(0);
}
Esempio n. 25
0
E00GRIDDataset::~E00GRIDDataset()

{
    FlushCache();
    if (fp)
        VSIFCloseL(fp);
    CSLDestroy(papszPrj);
    E00ReadClose(e00ReadPtr);
    CPLFree(panOffsets);
}
Esempio n. 26
0
BAGDataset::~BAGDataset( )
{
    FlushCache();

    if( hHDF5 >= 0 )
        H5Fclose( hHDF5 );

    CPLFree( pszXMLMetadata );
    CPLFree( pszProjection );
}
Esempio n. 27
0
LevellerDataset::~LevellerDataset()
{
    FlushCache();

    CPLFree(m_pszProjection);
    CPLFree(m_pszFilename);

    if( m_fp != NULL )
        VSIFCloseL( m_fp );
}
Esempio n. 28
0
CPLErr MEMRasterBand::IRasterIO( GDALRWFlag eRWFlag,
                                 int nXOff, int nYOff, int nXSize, int nYSize,
                                 void * pData, int nBufXSize, int nBufYSize,
                                 GDALDataType eBufType,
                                 GSpacing nPixelSpaceBuf,
                                 GSpacing nLineSpaceBuf,
                                 GDALRasterIOExtraArg* psExtraArg )
{
    if( nXSize != nBufXSize || nYSize != nBufYSize )
    {
        return GDALRasterBand::IRasterIO(eRWFlag, nXOff, nYOff, nXSize, nYSize,
                                         pData, nBufXSize, nBufYSize,
                                         eBufType,
                                         static_cast<int>(nPixelSpaceBuf),
                                         nLineSpaceBuf,
                                         psExtraArg);
    }

    // In case block based I/O has been done before.
    FlushCache();

    if( eRWFlag == GF_Read )
    {
        for( int iLine=0; iLine < nYSize; iLine++ )
        {
            GDALCopyWords(
                pabyData + nLineOffset*static_cast<size_t>(iLine + nYOff) +
                nXOff*nPixelOffset,
                eDataType,
                static_cast<int>(nPixelOffset),
                reinterpret_cast<GByte*>( pData ) +
                nLineSpaceBuf * static_cast<size_t>(iLine),
                eBufType,
                static_cast<int>(nPixelSpaceBuf),
                nXSize );
        }
    }
    else
    {
        for( int iLine = 0; iLine < nYSize; iLine++ )
        {
            GDALCopyWords(
                reinterpret_cast<GByte *>( pData ) +
                nLineSpaceBuf*(size_t)iLine,
                eBufType,
                static_cast<int>(nPixelSpaceBuf),
                pabyData + nLineOffset*static_cast<size_t>(iLine + nYOff) +
                nXOff*nPixelOffset,
                eDataType,
                static_cast<int>(nPixelOffset),
                nXSize );
        }
    }
    return CE_None;
}
Esempio n. 29
0
int SifIopReboot(const char* filename)
{
	char param_str[RESET_ARG_MAX+1];
	int param_size;

	if ((filename != NULL) && (*filename != '\0'))
	{
		param_size = strlen( filename ) + 11;

		if(param_size > RESET_ARG_MAX)
		{
//			printf("too long parameter '%s'\n", filename);
			return -1;
		}
	}

	SifInitRpc(0);

	if ((filename != NULL) && (*filename != '\0'))
	{
		strncpy(param_str, "rom0:UDNL ", 10);
	}
	else
	{
		strncpy(param_str, "rom0:UDNL", 9);
	}

	if ((filename != NULL) && (*filename != '\0'))
	{
		strncpy(&param_str[10], filename, strlen(filename));
	}

	SifIopReset(param_str, 0);
	while(!SifIopSync());

	SifInitRpc(0);

	FlushCache(0);
	FlushCache(2);

	return 0;
}
Esempio n. 30
0
ELASDataset::~ELASDataset()

{
    FlushCache();

    if( fp != NULL )
    {
        VSIFClose( fp );
        fp = NULL;
    }
}