예제 #1
0
파일: cbmrpm41.c 프로젝트: bogde/OpenCBM
static void ARCH_SIGNALDECL
handle_CTRL_C(int dummy)
{
    CBM_FILE fd_cbm_local;

    /*
     * remember fd_cbm, and make the global one invalid
     * so that no routine can call a cbm_...() routine
     * once we have cancelled another one
     */
    fd_cbm_local = fd;
    fd = CBM_FILE_INVALID;

    fprintf(stderr, "\nSIGINT caught, resetting IEC bus...\n");

    DEBUG_PRINTDEBUGCOUNTERS();

    arch_sleep(1);
    cbm_reset(fd_cbm_local);

#if 0   // reset automatically restores the VIA shift register
    arch_usleep(100000);
    fprintf(stderr, "Emergency resetting VIA2 shift register to default.\n");
    cbm_exec_command(fd, drive, CmdBuffer, sizeof(CmdBuffer));
#endif

    cbm_driver_close(fd);
    exit(1);
}
예제 #2
0
파일: main.c 프로젝트: jkaessens/opencbm
static void ARCH_SIGNALDECL reset(int dummy)
{
    fprintf(stderr, "\nSIGINT caught X-(  Resetting IEC bus...\n");
    arch_sleep(1);
    d64copy_cleanup();
    cbm_reset(fd_cbm);
    cbm_driver_close(fd_cbm);
    exit(1);
}
예제 #3
0
void TASK_wait() {
  while (task_sys.head == 0) {
#if defined(CONFIG_OS) & defined(CONFIG_TASK_QUEUE_IN_THREAD)
    OS_cond_wait(&task_sys.cond, NULL);
#else
    arch_sleep();
#endif
  }
}
예제 #4
0
파일: main.c 프로젝트: bogde/OpenCBM
static void ARCH_SIGNALDECL
handle_CTRL_C(int dummy)
{
    fprintf(stderr, "\nSIGINT caught, resetting IEC bus...\n");
    DEBUG_PRINTDEBUGCOUNTERS();

    arch_sleep(1);
    cbm_reset(fd);

    cbm_driver_close(fd);
    exit(1);
}
예제 #5
0
int dsp_main(void)
{
	unsigned int machine;
	unsigned int cout=0;

	writel(DSP_CURRENT_RUN,P_AO_RTI_STATUS_REG0);

	while(1)
	{
		//writel(cout,P_AO_RTI_STATUS_REG2);
		//cout++;

		machine = readl(P_AO_RTI_STATUS_REG0);
		if(machine == DSP_REQUST_STOP)
		{
			clear_arc2_irq_mask(VIU2_VSYNC_INT);
			//clear_arc2_irq_mask(VIU1_VSYNC_INT);
			writel(DSP_CURRENT_SLEEP,P_AO_RTI_STATUS_REG0);
			arch_sleep();
		}
	}
	return 0;
}
예제 #6
0
void 
ArchManager::Sleep(uint32_t x)
{
	arch_sleep(x);
}
예제 #7
0
bool
Iso9660::Mount()
{
	ReadDir rd;	
	Iso9660::PrimaryVolumeDescriptor *d = (PrimaryVolumeDescriptor *) malloc(sizeof(PrimaryVolumeDescriptor));
	unsigned i;
	bool f;


	/* Read the bootrecord and find the first block */	
	i = 0;
	f = false;

	while((!f) && (i < 2048 * 64))
	{
		m_Disk->getDriver()->Read((uint8_t *) d, 2048, i);

		if(	(d->Identifier[0] == 'C') && (d->Identifier[1] == 'D') && 
			(d->Identifier[2] == '0') && (d->Identifier[3] == '0') && 
			(d->Identifier[4] == '1') )
			{
				if(d->Type == TC_PRIMARY_VOLUME)
					f = true;
			}

		i += 2048;
	}

	if(!f)
		return false;

	//pd = (PrimaryVolumeDescriptor *) &d;
#if 0
	int k = 0;
	uint8_t pte[2048];
	
		m_Disk->getDriver()->Read((uint8_t *) pte, 2048, 2048*4);
		int j;
		/* Allocate and read the path table */
		for(j = 0; j < 2048; j++)
		{
		//if(pd->Identifier[i] >= 'A')
				//putchar(((char *) pte)[i]);
				putchar(pte[j]); //((char *) pte)[j] << 8 | ((char *) pte)[1+j]);

				if((pte[j] == 'O') && (pte[j+1] == 'O'))
				{
					printf("%d\n", k);
					break;
				}
				arch_sleep(2000);
		}
#endif	
	/*
	m_PathTableSize = 0;

	for(i = 0; i < 8; i++)
		m_PathTableSize += pd->PathTableSize[i];

	m_PathTable = (void *) malloc(m_PathTableSize);
	m_Disk->getDriver()->Read((uint8_t *) m_PathTable, m_PathTableSize, pd->PathLTableLocation);
 */
	/* Clear the opened file list */
	m_FileList->Clear();
 
	/* Set the root node */
	rd.Node = 0;
	m_Root = getFileFromId(&rd);

	m_isMounted = true;

	return true;
}