void* thr1(void* arg){
  while(1)
    switch(__VERIFIER_nondet_int()){
    case 0: rdma_addr_unregister_client(__VERIFIER_nondet_int()); break;
    case 1: queue_req(); break;
    case 2: process_req(); break;
    case 3: rdma_resolve_ip(); break;
    case 4: rdma_addr_cancel(); break; 
  }

  return 0;
}
Exemple #2
0
OSStatus
DriverControlCmd( CntrlParam *pb, IOCommandID ioCmdID )
{
	unit_t *unit = get_unit( pb->ioVRefNum );

	/* handle codes where unit might be NULL */
	switch( pb->csCode ) {
	case kdgLowPowerMode:
		/* sets/returns the current energy consumption level */
		Log("control - SetLowPowerMode\n");
		return controlErr;
	}

	if( !unit ) {
		/* we get this at shudown... */
		if( pb->csCode == -1 )
			return nsDrvErr;
		lprintf("DriveControlCmd IGNORED %d\n", pb->csCode );
		return nsDrvErr;
	}

	switch( pb->csCode ) {
	case killIOCC:
		lprintf("ablk: control - KillIO");
		return controlErr;
		
	case kVerify:
		Log("control - verifyDiskCC\n" );						
		return noErr;
		
	case kFormat:
		lprintf("control - formatDiskCC\n" );
		return noErr;

	case kEject:
		/* lprintf("control - ejectDiskCC\n"); */
		unit->mounted = 0;
		if( (unit->info.flags & ABLK_INFO_REMOVABLE ) ) {
			/* eject only if all partitions are unmounted */
			if( unit_is_unmounted( unit ) ) {
				/* this also ejects physically related partitions */
				eject_unit_records( unit->ch, unit->unit );
				/* post eject disk command */
				return queue_req( (ParamBlockRec*)pb, unit, ABLK_EJECT_REQ, 0, NULL, 0, ioCmdID );
			}
		} else {
			PostEvent( diskEvt, pb->ioVRefNum );
		}
		return noErr;
			
	case kDriveIcon:
		Log("control - physicalIconCC\n" );
		/* return pointer to icon and where string */
		/* *(Ptr *)pb->csParam = (Ptr)globe->physicalIcon; */
		return controlErr;

	case kMediaIcon:
		Log("control - mediaIconCC\n" );
		/* return pointer to icon and where string */
		/* *(Ptr *)pb->csParam = (Ptr)globe->mediaIcon; */
		return controlErr;			
			
	/* When a HFS volume is mounted, the File Manager calls the disk driver
	 * with a "Return Drive Info" _Control call (csCode=23). Then if there
	 * are no errors, it looks at the low-byte (bits 0-7) of csParam to see
	 * if the drive type is ramDiskType (16, $10) or romDiskType (17, $11)
	 * and if so, vcbAtDontCache is set in vcbAtrb.
	 *
	 * $01 == unspecified drive
	 * 
	 * You shouldn't normally have to mess with the vcbAtDontCache bit in the
	 * vcbAtrb. If you've written a RAM or ROM disk and you want the cache to
	 * be bypassed, you only need to support _Control csCode 23 and say
	 * you're a RAM or ROM disk. Other disk drivers probably should not mess
	 * with the vcbAtDontCache bit because any improvements we make to the
	 * File Manager cache will be lost on those drives (and we'll have to say
	 * so when customers ask why our improvements didn't help their drives).
	 *
	 * See the Inside Macintosh:Files Errata technote for a discussion of this.
	 */
	case kDriveInfo:
		Log("control - driverInfoCC\n" );
		/*  high word (bytes 2 & 3) clear  */
		/*  byte 1 = primary + fixed media + internal  */
		/*  byte 0 = drive type (0x10 = RAM disk)  */
		*(ulong*)pb->csParam = 0x00000401;
		return noErr;
		
	case 20:
		/* undocumented */
		return controlErr;
	
	case 24: /* Return SCSI csCode Partition Size */
		Log("control - cscode 24\n" );
		/* *(ulong*)pb->csParam = globe->ramSize >> 9; */
		return noErr;
		
	case accRun:
		Log("control - accRun\n" );				
		return noErr;
		
	case kDriverConfigureCode:
		Log("control - kDriverConfigureCode\n" );				
		switch( ((DriverConfigParam *)pb)->driverConfigureSelector ) {
		case kdcFlush:
			/* globe->driveNeedsFlush = false; */
			return noErr;
		}
		return controlErr;
		
	case kGetADrive: /* control call to ask the driver to create a drive*/
		Log("control - kGetADrive\n");
		return controlErr;			
	}

	lprintf("Unrecognized control cscode %d\n", pb->csCode );		
	return controlErr;
}