flash_interface.h 1.69 KB
/*
 * Copyright (C) 1996-1998 by the Board of Trustees
 *    of Leland Stanford Junior University.
 * 
 * This file is part of the SimOS distribution. 
 * See LICENSE file for terms of the license. 
 *
 */

/*****************************************************************
 * flash_interface.h
 *
 *****************************************************************/

#ifndef FLASH_INTERFACE_H
#define FLASH_INTERFACE_H

extern void FlashliteConfigDefaults(void);
extern void FlashliteRaiseSlot(int cpu, int slot);
extern void FlashliteClearSlot(int cpu, int slot);
extern unsigned FlashAddrCompress(unsigned long long flashAddr);
extern int FlashliteWQFull(int cpu);

#ifdef COMA
/* WOULD NEED TO REWRITE STUFF TO HAVE THIS WORK FOR COMA */
#endif /* COMA */
extern void SyncMemory(void);

#ifdef SOLO
/*
 * Do the mappings between Solos and Flash addresses
 */

extern void FlashliteResetStats(void);
extern void FlashliteStartCPU(int cpuNum);
extern void FlashliteStopCPU(int cpuNum);

#define FlashAddrFromSoloAddr(_space,_addr)     SoloDecompressAddr(_space,_addr)
#define FlashAddrToSoloAddr(_faddr)             SoloCompressAddr(_faddr)
                       
#else

#define FLASH_PAGE_SIZE 4096
extern unsigned long long
FlashAddrFromSimosAddr(unsigned int space, unsigned int addr);

/* the following routines access the FPROM and FRAM. Needed
   by the debugger interface.
 */
extern int
GetFPROMAndFRAM(int cpuNum, VA vAddr, uint nbytes, char *buf);
extern int
PutFPROMAndFRAM(int cpuNum, VA vAddr, uint nbytes, char *buf);

extern void FlashliteInstallTimer(int cpuNum, unsigned int interval, 
                                  unsigned int timeLeft);
extern void FlashliteUndirtify(int leaveShared);
#endif

#endif