• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ printm函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中printm函数的典型用法代码示例。如果您正苦于以下问题:C++ printm函数的具体用法?C++ printm怎么用?C++ printm使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了printm函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: hypervisor_call

void hypervisor_call(guest* vm, uint32_t imm16)
{
    rf_elr_hyp_write(rf_elr_hyp_read() - 4);

    switch(imm16)
    {
            //monitor print vm
        case 0x1:
            printmi(vm->id, d_hypervisor_call, "hypervisor call, monitor print vm");
            monitor_print(&vm->mon);
            break;
            //monitor print sys
        case 0x2:
            printmi(vm->id, d_hypervisor_call, "hypervisor call, monitor print sys");
            monitor_print(&sys_monitor);
            break;
        case 0x3:
            printmi(vm->id, d_hypervisor_call, "hypervisor call, monitor print all");
            printm(d_monitor, "================MON_SYS===================");
            monitor_print(&sys_monitor);
            printm(d_monitor, "================MON_VM====================");
            monitor_print(&vm->mon);
            printm(d_monitor, "==========================================");
            break;
        default:
            printm(d_hypervisor_call, "error hypervisor call, imm = %d", imm16);
            break;
    }
}
开发者ID:ufoderek,项目名称:casl_hypervisor,代码行数:29,代码来源:hypervisor_call.c


示例2: while

// AVS
// load globals to 'globals'
// in buf must be a [global] part of input file
int TMapLoader::LoadGlobal(string& buf) {
	
	char wbuf[128];
	while ( buf.length() ) {
		wbuf[0]=0;
		if (!getline(buf,wbuf,sizeof(wbuf))) break;
		if ( wbuf[0]==0 ) break;
		char* Name = strtok(wbuf, TOKEN_DELIMITERS);
		if ( stricmp(Name, "[global]")==0 ) continue;
		
		char* Value = strtok(NULL, TOKEN_DELIMITERS);
		if ( Value == NULL ) {
			//              cerr << "[global] -> no value for " << Name << endl;
			printm(0, FALSE, MSG_KEYNOVAL, Name);
			continue;
		};
		int val = atoi(Value);
		if ( val > 0 && val <= 0xff ) {
			if ( !KeyTrans.AddGlobalDef(val, Name)) return 0;
		}
		else {
			//             cerr << "[global] -> bad value for " << Name << endl;
			printm(0, FALSE, MSG_KEYBADVAL, Name);
			continue;
		};
	};
	return 1;
};
开发者ID:cout,项目名称:consoletelnet,代码行数:31,代码来源:tmapldr.cpp


示例3: main

int
main( int argc, char **argv )
{
	int ret;
	
	if( getuid() ) {
		printf("You must be root to run the MOL debugger\n");
		return 1;
	}
	mregs = &sv.mregs;

        res_manager_init(0, argc, argv );
        atexit( res_manager_cleanup );

	/* Initialize socket and connect to MOL */
	sv.fd = -1;
	do_connect();
	
	symbols_init();
	monitor_init();
	cmdline_init();
	install_monitor_cmds();

	printm("Mac-on-Linux debugger %s, ", MOL_RELEASE);
	printm("(C) 2001 Samuel Rydh <[email protected]>\n");

	atexit(exit_hook);
	for( ;; ) {
		if( (ret = mon_debugger()) == kDbgExit )
			break;
		send_dgram1( sv.fd, kMDG_debug_action, ret );
	}
	send_dgram( sv.fd, kMDG_disconnect );
	return 0;
}
开发者ID:threader,项目名称:Mac-On-Linux,代码行数:35,代码来源:deb.c


示例4: main

int main ( int argc, char *argv[] )
{
	int N;
	float *donees;
	float *sdetail;

	//Read N from standard input
	scanf("%d", &N);

	//Create arrays of size N
	donees = (float *)malloc(N* sizeof(*donees));
	sdetail = (float *)malloc(N* sizeof(*sdetail));

	//Fill the values of initial array from stdin
	for(int i=0; i<N; i++)
	{
		scanf("%f", &donees[i]);
	}

	printm(donees, N);
	haar(donees, sdetail, N);
	printm(sdetail, N);

	delete donees;
	delete sdetail;	

	return EXIT_SUCCESS;
}		
开发者ID:ZePoLiTaT,项目名称:SiliconPhotonics,代码行数:28,代码来源:haar.cpp


示例5: rvec_break

static int __dbg
rvec_break( int dummy_rvec, int break_flag )
{
	switch( break_flag ) {
	case BREAK_RFI:
		if( (molcpu.break_flags & BREAK_USER) ) {
			if( !(mregs->msr & MSR_PR) )
				return 0;
			clear_break_flag( BREAK_USER );
		}
		printm("BREAK-RFI (%08lX)\n", mregs->nip );
		break;
	case BREAK_EA_PAGE:
		/* breakpoint might not have been written */
		printm("ea-break at %08lX\n", mregs->nip );
		restore_breakpoints();
		setup_breakpoints();
		break;
	case BREAK_SINGLE_STEP:
		if( molcpu.break_flags & BREAK_SINGLE_STEP_CONT ) {
			if( !is_stop_breakpoint( mregs->nip ) )
				return 0;
			clear_break_flag( BREAK_SINGLE_STEP_CONT );
		}
		//setup_breakpoints();
		break;
	default:
		printm("rvec_break: Unknown break flag %d\n", break_flag );
		break;
	}
	stop_emulation();
	clear_break_flag( break_flag );
	return 0;
}
开发者ID:threader,项目名称:Mac-On-Linux,代码行数:34,代码来源:molcpu.c


示例6: cd_scsi_init

void
cd_scsi_init( void )
{
	bdev_desc_t *bdev = NULL;

	if( !get_bool_res("generic_scsi_for_cds") ) {
		printm("    Generic SCSI for CD/DVDs disabled\n");
		return;
	}
	if( is_classic_boot() && get_str_res("cdboot") ) {
		printm("    CD-SCSI disabled (CD-booting)\n");
		return;
	}
	
	while( (bdev=bdev_get_next_volume(bdev)) ) {
		int flags;

		if( !(bdev->flags & BF_CD_ROM) )
			continue;

		flags = ioctl( bdev->fd, CDROM_GET_CAPABILITY );
		if( flags == -1 || !(flags & CDC_GENERIC_PACKET) )
			continue;

		bdev_claim_volume( bdev );
		add_device( bdev );

		printm("    SCSI  %-16s [CDROM/DVD driver]\n", bdev->dev_name );
	}
	x.completion_aev = add_aevent_handler( complete );
}
开发者ID:threader,项目名称:Mac-On-Linux,代码行数:31,代码来源:cd-scsi.c


示例7: rvec_priv_inst

static int
rvec_priv_inst( int dummy_rvec, ulong inst )
{
	int op, op_ext, b1, b2, b3;

	/* unhandled privileged instruction in supervisor mode */
	/* IMPORTANT: The GPRs are not available here! */

	op = OPCODE_PRIM( inst );
	op_ext = OPCODE_EXT( inst );
	b1 = B1( inst );	/* bit 6-10 */
	b2 = B2( inst );	/* bit 11-15 */
	b3 = B3( inst );	/* bit 16-20 */

	switch( OPCODE(op,op_ext) ) {
	case OPCODE( 31, 370 ):	/* tlbia (opt.) */
		/* not implemented on the 601,603,604,G3 (G4?) */
		break;
	case OPCODE( 31, 470 ):  /* dcbi rA,rB  -- rA=b2 rB=b3 */
		printm("dcbi treated as nop\n");
		mregs->nip += 4;
		return 0;
	default:
		printm("Unknown privileged instruction, opcode %lX\n", inst);
		stop_emulation();
		break;
	}
	mac_exception( 0x700, MOL_BIT(13) );
	return 0;
}
开发者ID:threader,项目名称:Mac-On-Linux,代码行数:30,代码来源:molcpu.c


示例8: adb_poll

void
adb_poll( void )
{
	unsigned char buf[32];
	adb_device_t *ad;
	int len;

	/* printm("adb_poll\n"); */

	for( ad=root; ad; ad=ad->next ) {
		if( /* ad->service_req_enable && */ ad->service_req ){
			if( !ad->read_reg_fp )
				continue;
			if( (len = ad->read_reg_fp( ad, 0, buf )) != 0 ) {
#if 0
				{
					int i;
					printm("ADB event packet: ");
					for(i=0; i< len; i++)
						printm("%02X",buf[i] );
					printm("\n");
				}
#endif
				via_cuda_set_reply_buffer( (char *) buf, len );
				break;
			} else {
				/* this is a programming error in adb device driver */
				printm("ADB service request -- BUT NO DATA!\n");
			}
		}
	}
}
开发者ID:threader,项目名称:Mac-On-Linux,代码行数:32,代码来源:adb.c


示例9: switch

IOReturn
MolEnet::setPowerState( unsigned long powerStateOrdinal, IOService *whatDevice )
{
	IOReturn ret = IOPMAckImplied;

	//printm("MolEnet: setPowerState %d\n", powerStateOrdinal);

	if( currentPowerState == powerStateOrdinal )
		return IOPMAckImplied;
	
	switch( powerStateOrdinal ) {
	case 0:
		printm("MolEnet: powering off\n");
		currentPowerState = powerStateOrdinal;
		break;
		
	case 1:
		printm("MolEnet: powering on\n");
		currentPowerState = powerStateOrdinal;
		break;

	default:
		ret = IOPMNoSuchState;
		break;
	}
	return ret;
}
开发者ID:threader,项目名称:Mac-On-Linux,代码行数:27,代码来源:MolEnet.cpp


示例10: kbd_write_reg

static void 
kbd_write_reg( adb_device_t *ad, int reg, char *data, int len )
{
	switch( reg ){
	case 0: /* key data (?) */
		printm("Keyboard write reg 0\n");
		break;
	case 2: /* led register */
		printm("Keyboard write LED register\n");
		break;
	case 3: /* control_register (two bytes data guaranteed)  */
		if( len != 2 )
			return;
		switch( data[1] ){
#if 0
		case 2: /* handler 2, left/right keys same keycodes */ 
		case 3: /* handler 3, left/right leys different keycodes */
			ad->handler_id = data[1];
			break;
#endif
		default:
			break;
		}
		break;
	}
}
开发者ID:threader,项目名称:Mac-On-Linux,代码行数:26,代码来源:adb.c


示例11: vopen

static int
vopen( video_desc_t *vm )
{
	XDGADevice *dev;
	int mask;
	
	if( dga.is_open )
		return 1;

	if( !XDGAOpenFramebuffer( x11.disp, x11.screen ) ) {
		printm("XDGAOpenFramebuffer failed\n");
		return 1;
	}
	if( !(dev=XDGASetMode( x11.disp, x11.screen, (int)vm->module_data )) ) {
		printf("XDGASetMode failure\n");
		XDGACloseFramebuffer( x11.disp, x11.screen );
		return 1;
	}

	printm("%d x %d: %d (%08x/%x)\n", vm->w, vm->h, vm->depth, (int)dev->data, vm->rowbytes );
	vm->lvbase = (char *)dev->data;
	vm->mmu_flags = get_bool_res("use_fb_cache")? MAPPING_FORCE_CACHE : MAPPING_MACOS_CONTROLS_CACHE;
	vm->map_base = 0;
	XFree( dev );

	dga.is_open = 1;
	use_hw_cursor(0);

	mask = KeyPressMask | KeyReleaseMask;
	if( mouse_activate(1) )
		mask |= ButtonPressMask | ButtonReleaseMask | PointerMotionMask;

	XDGASelectInput( x11.disp, x11.screen, mask );
	return 0;
}
开发者ID:threader,项目名称:Mac-On-Linux,代码行数:35,代码来源:xdga.c


示例12: add_netdev

static int
add_netdev( int index, int irq )
{
	me = malloc( sizeof(mol_enet2_t) );
	memset( me, 0, sizeof(mol_enet2_t) );

	if( find_packet_driver(index, &me->iface) )
		goto bail;

	me->running = 0;
	me->irq = irq;
	me->iface.inject_packet = inject_packet;

	if( PD.open(&IFACE) ) {
		printm("Failed to initialize the %s-<%s> device\n", PD.name, IFACE.iface_name );
		goto bail;
	}
	netif_print_blurb( &me->iface, -1 );
	
	if( (me->rx_async=add_async_handler(IFACE.fd, POLLIN | POLLPRI, rx_packet_handler,0)) < 0 )
		printm("add_async_handler failed!\n");
	return 0;

bail:
	free( me );
	me = NULL;
	return 1;
}
开发者ID:threader,项目名称:Mac-On-Linux,代码行数:28,代码来源:enet2.c


示例13: print_btrace_sym

void
print_btrace_sym( ulong addr, const char *sym_filename )
{
	char ch, buf[80];
	ulong v, v2=0;
	int found=0;
	FILE *f=NULL;

	if( sym_filename )
		f = fopen(sym_filename, "ro");

	buf[0]=0;
	while( f && fscanf(f, "%lx %c ", &v, &ch) == 2 ) {
		if( v <= addr ) {
			v2 = v;
			if(fscanf( f, "%79s\n", buf ) != 1) {
				printm("Error reading from backtrace symbol\n");
				fclose(f);
				return;
			}
			continue;
		}
		if( buf[0] ) {
			printm("%s + 0x%lx\n", buf, addr - v2 );
			found=1;
		}
		break;
	}
	if( !found )
		printm("0x%08lx\n", addr );
	if( f )
		fclose(f);
}
开发者ID:threader,项目名称:Mac-On-Linux,代码行数:33,代码来源:backtrace.c


示例14: vopen

static int
vopen( video_desc_t *vm )
{
	struct fb_var_screeninfo var;
	struct fb_fix_screeninfo fix;

	if( cv->is_open || !cv->has_console )
		return 1;

	/* Put console in graphics mode and open display */
	console_set_gfx_mode(1);
	var = *(struct fb_var_screeninfo*)vm->module_data;
	var.activate = FB_ACTIVATE_NOW;
	if( ioctl(cv->fd, FBIOPUT_VSCREENINFO, &var) < 0 ) {
		perrorm("Could not set VSCREENINFO\n");
		goto bail;
	}

	/* is this panning necessary? */
        var.xoffset = 0;
        var.yoffset = 0;
        ioctl(cv->fd, FBIOPAN_DISPLAY, &var);

	if( ioctl(cv->fd, FBIOGET_FSCREENINFO, &fix) < 0) {
		perrorm("Could not get FSCREENINFO!\n");
		goto bail;
	}

	if( vm->offs != ((ulong)fix.smem_start & 0xfff) ) {
		printm("Framebuffer offset has changed!\n");
		goto bail;
	}
	if( vm->rowbytes != fix.line_length ) {
		printm("Rowbytes has changed (was %d, now %d)!\n", vm->rowbytes, fix.line_length);
		goto bail;
	}

	/* runtime fields */
	vm->map_base = (ulong)fix.smem_start & ~0xfff;
        vm->lvbase = map_phys_mem( NULL, vm->map_base, FBBUF_SIZE(vm), PROT_READ | PROT_WRITE );
	vm->mmu_flags = MAPPING_PHYSICAL;

	if( is_newworld_boot() || is_oldworld_boot() )
		vm->mmu_flags |= MAPPING_DBAT;

	/* Use cache with write through bit set */
	vm->mmu_flags |= cv->use_cache? MAPPING_FORCE_CACHE : MAPPING_MACOS_CONTROLS_CACHE;
	use_hw_cursor(0);	/* no hw-cursor for now */

	cv->is_open = 1;
	cv->vmode = *vm;

	return 0;

bail:
	console_set_gfx_mode(0);
	return 1;
}
开发者ID:threader,项目名称:Mac-On-Linux,代码行数:58,代码来源:fbdev.c


示例15: minitialize

int minitialize()	//initialize the winsock server
{
    // Initialize Winsock
    iResult = WSAStartup(MAKEWORD(2,2), &wsaData);
    if (iResult != 0) {
        printm("WSAStartup failed with error: %d\n", iResult);
        return 1;
    }

    ZeroMemory(&hints, sizeof(hints));
    hints.ai_family = AF_INET;
    hints.ai_socktype = SOCK_STREAM;
    hints.ai_protocol = IPPROTO_TCP;
    hints.ai_flags = AI_PASSIVE;

    // Resolve the server address and port
    iResult = getaddrinfo(NULL, DEFAULT_PORT, &hints, &result);
    if ( iResult != 0 ) {
        printm("getaddrinfo failed with error: %d\n", iResult);
        WSACleanup();
        return 1;
    }

    // Create a SOCKET for connecting to server
    ListenSocket = socket(result->ai_family, result->ai_socktype, result->ai_protocol);
    if (ListenSocket == INVALID_SOCKET) {
        printm("socket failed with error: %ld\n", WSAGetLastError());
        freeaddrinfo(result);
        WSACleanup();
        return 1;
    }

    // Setup the TCP listening socket
    iResult = bind( ListenSocket, result->ai_addr, (int)result->ai_addrlen);
    if (iResult == SOCKET_ERROR) {
        printm("bind failed with error: %d\n", WSAGetLastError());
        freeaddrinfo(result);
        closesocket(ListenSocket);
        WSACleanup();
        return 1;
    }

    freeaddrinfo(result);

    iResult = listen(ListenSocket, SOMAXCONN);
    if (iResult == SOCKET_ERROR) {
        printm("listen failed with error: %d\n", WSAGetLastError());
        closesocket(ListenSocket);
        WSACleanup();
        return 1;
    }

    unsigned long b=1;
    ioctlsocket(ClientSocket,FIONBIO,&b);


}
开发者ID:Aaahh,项目名称:Server,代码行数:57,代码来源:main.cpp


示例16: mainloop_start

void
mainloop_start( void )
{
	int err;
	_spr_changed();
	struct timespec tv;
	tv.tv_sec = 0;
	tv.tv_nsec = 10000000;

	/* must be called once before the mainloop is entered */
	molcpu_mainloop_prep();

	__stop = (get_bool_res("debug_stop") == 1);

	while( __stop != kQuit ) {
		switch( __stop ) {
		case kGo:
			set_print_guard( print_guard );
			molcpu_mainloop();
			set_print_guard( NULL );
			assert( __stop );
			break;

#ifdef CONFIG_DEBUGGER
		case kStop: {
			FREEZE_TIMERS;
			refresh_debugger();
			while( __stop == kStop ) {
				debugger_nub_poll();
				nanosleep(&tv, NULL);
			}
			RETUNE_TIMERS;
			break;
		}
#endif
		case kSaveSession:
			printm("Saving the session...\n");
			if( !(err = save_session_now()) ) {
				printm("The session was saved successfully\n");
				__stop = kQuit;
			} else if( err == 1 ) {
				static int tries=0;
				__stop = kGo;
				if( ++tries < 200 ) {
					schedule_save_session(1000);
				} else {
					printm("Did not reach a state where the session could be saved\n");
					tries=0;
				}
			} else {
				__stop = kGo;
			}
			break;
		}
	}
}
开发者ID:threader,项目名称:Mac-On-Linux,代码行数:56,代码来源:mainloop.c


示例17: printv

 void HMM::print_parameters() {
     std::cout << "initial distribution:" << std::endl;
     printv(hs, nu);
     
     std::cout << "transition distribution:" << std::endl;
     printm(hs, hs, Q);
     
     std::cout << "emission distribution:" << std::endl;
     printm(hs, os, g);
 }
开发者ID:brunodigiorgi,项目名称:fdhmm,代码行数:10,代码来源:HMM.cpp


示例18: rc_nop

static int 
rc_nop( ulong args[], ulong ret[] ) 
{
	int i;
	printm(">>> Unimplemented RTAS '%08lx' (%d/%d)\n", s_rtas_token, s_rtas_nargs, s_rtas_nret );
	for( i=0; i<s_rtas_nargs; i++ )
		printm("  %08lX ", args[i] );
	printm("\n");
	return 0;	/* -1 might be better... */
}
开发者ID:threader,项目名称:Mac-On-Linux,代码行数:10,代码来源:rtas.c


示例19: dump_cmd_name

static void 
dump_cmd_name( scsi_ureq_t *u )
{
	int i;
	for( i=0; i<sizeof(cmd_names)/sizeof(cmd_names[0]); i++ ) {
		if( u->cdb[0] == cmd_names[i].cmd ) {
			printm( C_GREEN "%-20s"C_NORMAL, cmd_names[i].name );
			return;
		}
	}
	printm(C_RED "Unknown SCSI command %02x" C_NORMAL, u->cdb[0] );
}
开发者ID:threader,项目名称:Mac-On-Linux,代码行数:12,代码来源:scsidbg.c


示例20: fbdev_init

static int
fbdev_init( video_module_t *m )
{
	char *name;

	memset( cv, 0, sizeof(cv[0]) );

	if( !get_bool_res("enable_console_video") )
		return 1;

	if( !(name=get_str_res("fbdev")) )
		name = "/dev/fb0";
	if( (cv->fd=open(name, O_RDWR)) < 0 ) {
		printm("Error opening frame buffer device '%s'\n",name );
		return 1;
	}
	fcntl( cv->fd, F_SETFD, FD_CLOEXEC );

	cv->startup_mode_ok = !ioctl( cv->fd, FBIOGET_VSCREENINFO, &cv->startup_var )
		&& !ioctl( cv->fd, FBIOGET_FSCREENINFO, &cv->startup_fix );
	if( !cv->startup_mode_ok )
		printm("Warning: Startup video mode query failed\n");

	if( !console_init() ) {
		close( cv->fd );
		return 1;
	}
	if( setup_video_modes() ) {
		printm("No usable console video modes were found\n");
		close( cv->fd );
		return 1;
	}
	
	cv->cmap.start = 0;
	cv->cmap.len = 256;
	cv->color_table = (short*)malloc( cv->cmap.len * sizeof(short) * 3 );
	cv->cmap.red = (unsigned short *) cv->color_table;
	cv->cmap.green = (unsigned short *) (cv->color_table + 256);
	cv->cmap.blue = (unsigned short *) (cv->color_table + 512);
	cv->cmap.transp = NULL;

	setup_gamma();

	cv->blank = 0;	/* VESA mode; assume power is initially on */

	if( (cv->use_cache = (get_bool_res("use_fb_cache") != 0)) )
		printm("Cache enabled for console-video\n");

	cv->initialized = 1;
	add_key_actions( console_keys, sizeof(console_keys) );
	return 0;
}
开发者ID:threader,项目名称:Mac-On-Linux,代码行数:52,代码来源:fbdev.c



注:本文中的printm函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ printmsg函数代码示例发布时间:2022-05-30
下一篇:
C++ printlog函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap