您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ Halt函数代码示例

51自学网 2021-06-01 21:25:05
  C++
这篇教程C++ Halt函数代码示例写得很实用,希望能帮到您。

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

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

示例1: TestMemory

void TestMemory(){        register unsigned char* i;	PutString("TESTING MEMORY A", 1, 1);        _SimUnprotect(0x4000, 0x5fff);        for(i=(char*)0x4000; i<(char*)0xEEEA; i++) {                *i=0xAA;        }	for(i=(char*)0x4000; i<(char*)0xEEEA; i++) {		if(*i!=0xAA) {			PutString("BAD MEMORY", 1, 1);			Halt("BAD MEMORY");		}	}        PutString("TESTING MEMORY B", 2, 1);        _SimUnprotect(0x4000, 0x5fff);        for(i=(char*)0x4000; i<(char*)0xEEEA; i++) {                *i=(~0xAA);        }        for(i=(char*)0x4000; i<(char*)0xEEEA; i++) {                if(*i!=(~0xAA)) Halt("BAD MEMORY");        }        PutString("MEMORY TEST COMPLETE", 3, 1);        _SimUnprotect(0x4000, 0x5fff);        for(i=(char*)0x4000; i<(char*)0xEEEA; i++) {                *i=0;        }	_SimPrintString("Memory test completed/n");}
开发者ID:LuccoJ,项目名称:z80sim,代码行数:29,


示例2: main

intmain(){  SpaceId kid;  int joinval;  char *args[1];  args[0] = (char *)0;  print("PARENT exists/n");  if ((kid=Fork()) == 0) {    Exec("deepkid1", args);    print("ERROR: exec failed/n");    Halt();  }  if(kid==-1){Halt();}  print("PARENT after fork/exec; kid pid is "); printd((int)kid, ConsoleOutput);  print("/n");  print("PARENT about to Join kid/n");  joinval = Join(kid);  print(">>PARENT off Join with value of ");  printd(joinval, ConsoleOutput);  print("/n");  Exit(10);  Halt();  /* not reached */}
开发者ID:jeche,项目名称:OPS,代码行数:30,


示例3: step

// This is our PRAM program// After each case x label, you can put an instructionvoid step(int pc, int i, int * x, int * y, int * z){    int debug=0;    int writecount=0;//    printf("%d %d %d %d %d/n",pc, i, *x, *y, *z);	// i is the processor number	// *x, *y and *z are temporary registers	switch(pc)	{	case 0: *z = 0;	break;    // Init N <= g < 2N-1 and 2N <= p < 3N - 1 and 3N <= z <= 4N-1	case 1: *y = Read(i+N);	break;	case 2: *x = Read(i);	break;	case 3: *x = *x + *y;	break;	case 4: Write(i,((*x)%10));	break;	case 5: Write(i+N,((*x)>9));	break;	case 6: Write(i+2*N,(*x==9)); // p	break;	case 7: Write(3*N+i, 0);	break;    // Prefix sum the g	case 8: JumpIf(13,i<(int)pow(2,Read(3*N+i)));	break;	case 9: *x = Read(i+N) /* g */ || ( Read(i+2*N) /* p */ && Read(i+N-(int)pow(2,Read(3*N+i))) /*g' */ );	break;	case 10: Write(i+N,*x); //g	break;	case 11: *x = Read(i+2*N) && Read(i+2*N-(int)pow(2,Read(3*N+i)));	break;	case 12: Write(i+2*N,*x);	break;	case 13: Write(3*N+i,Read(3*N+i)+1); // step increment	break;	case 14: JumpIf(8,Read(3*N+i)<(int)log2(N)) ;	break;    // Sum	case 15: JumpIf(19,i==0);	break;	case 16: *x = Read(i);	break;	case 17: *y = Read(i+N-1) || Read(i+2*N-1);    break;	case 18: Write(i,(*x + *y)%10);	break;	case 19: Halt();	break;	default: Halt();	}}
开发者ID:fabceolin,项目名称:cuda_gpu_course,代码行数:58,


示例4: _InterruptService

void _InterruptService() {        register short i;        ExchangeRegs();        GetStackPointerASM(_UserSP);        SaveIndexes();	if(ControlRequests<0) Halt("NEGATIVE CONTROLREQUESTS");        if(!IsMultitasking()) Halt("INTERRUPT IN KERNEL MODE");	ControlRequests++;        Tick();        for(i=0; i<InterruptVectorCount; i++) {                (InterruptVector[i])();        }        Scheduler(UserSP);        Halt("OUT OF REACH");}
开发者ID:LuccoJ,项目名称:z80sim,代码行数:15,


示例5: main

int main(){  int i;  OpenFileId f0, f1;  Create( "test1_f0" );  Create( "test1_f1" );    f0 = Open( "test1_f0" );      f1 = Open( "test1_f1" );    Write( "Test1: This is file 0/n", 22, f0 );  Write( "Test1: This is file 1/n", 22, f1 );  for( i = 0; i < 256; ++i ) usr_buffer_0[i] = 'A';      Write( usr_buffer_0, 128, f0 );    /* reset file pointer of f0 to the starting position */  Close( f0 );  f0 = Open( "test1_f0" );  Read( usr_buffer_1, 128, f0 );  Write( usr_buffer_1, 128, 1 );    // adding this allows the second write to work  Write( usr_buffer_1, 128, f1 );  Close( f0 );  Close( f1 );    Halt(0);}
开发者ID:harrypresman,项目名称:cs270-homework,代码行数:30,


示例6: main

int main(){	// Escribimos un texto indicativo sobre la consola.	char *writeStr = "Ingrese un texto:/n";	Write(writeStr, 18, ConsoleOutput);	// Leemos caracteres desde la consola hasta encontrar el "/n".	char readStr[1024], tmpChar;	int i = 0;	do {		Read(&tmpChar, 1, ConsoleInput);		readStr[i] = tmpChar;		i++;	} while (tmpChar != '/n');	// Escribimos los caracteres ingresados en la consola.	writeStr = "Usted ingreso:/n";	Write(writeStr, 16, ConsoleOutput);	Write(readStr, i, ConsoleOutput);	// Realizamos una llamada a halt para finalizar Nachos.	Halt();}
开发者ID:sebastiangaliano,项目名称:nachos,代码行数:28,


示例7: switch

void CTestSignals::KeyComplete(TKeyCode aKey)	{	switch (aKey)		{	case EKeyEscape:		Halt();		break;	default:		switch (iState)			{		case EAllOff:			DoSignals(ERtsOn);			break;		case ERtsOn:			DoSignals(EDtrOn);			break;		case EDtrOn:			DoSignals(EAllOn);			break;		case EAllOn:			DoSignals(EAllOff);			break;		default:			break;			}		}	}
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:27,


示例8: main

intmain(){  Halt();  /* not reached */}
开发者ID:joseluisdiaz,项目名称:nachos,代码行数:7,


示例9: log_err

/* A kernel magic function that is only used for getting kernel context for newbie */KernelContext *init_newbie_kernel(KernelContext *kernel_context, void *_prev_pcb, void *_next_pcb){    pcb_t *next_proc = (pcb_t *) _next_pcb;    //log_info("First time to init PID(%d) kernel stack!", next_proc->pid);       if(next_proc->kernel_stack_pages == NULL) {        log_err("Init kernel stack fail, pcb->kernel_stack_pages not malloc yet");        Halt();    }    next_proc->kernel_context = *kernel_context;    int rc = alloc_frame_and_copy(next_proc->kernel_stack_pages,                                 kernel_page_table,                                 GET_PAGE_NUMBER(KERNEL_STACK_BASE),                                 GET_PAGE_NUMBER(KERNEL_STACK_LIMIT),                                 kernel_memory.swap_addr);    if(rc) {        log_err("PID(%d) kernel stack cannot init", next_proc->pid);        return NULL;    }    next_proc->init_done = 1;    //print_page_table(kernel_page_table, 120, GET_PAGE_NUMBER(VMEM_0_LIMIT));    //print_page_table(next_proc->kernel_stack_pages, 0, 2);    //log_info("First time to init PID(%d) kernel stack done", next_proc->pid);    return kernel_context;}
开发者ID:jack2684,项目名称:yalnix,代码行数:28,


示例10: main

intmain(){  SpaceId kid;  int joinval;  char *args[2];  args[0] = "huge";  args[1] = (char *)0;  if ((kid = Fork()) == 0)    Exec("huge",args);    prints("PARENT after foprk/exec; kid pid is ", ConsoleOutput);  printd((int)kid, ConsoleOutput);  prints("/n", ConsoleOutput);  prints("PARENT about to Join kid/n", ConsoleOutput);  joinval = Join(kid);  prints("PARENT off Join with value of ", ConsoleOutput);  printd(joinval, ConsoleOutput);  prints("/n", ConsoleOutput);  Halt();  /* not reached */}
开发者ID:jeche,项目名称:OPS,代码行数:27,


示例11: SwitchToProc

// Begin executing the specified proc.// NOTE: place the current proc into the correct queue before callingvoid SwitchToProc(PCB *next_proc, UserContext *user_context) {    TracePrintf(TRACE_LEVEL_FUNCTION_INFO, ">>> SwitchToProc()/n");    assert(user_context);    assert(next_proc);    // Save current user state    current_proc->user_context = *user_context;    TracePrintf(TRACE_LEVEL_DETAIL_INFO, "Loading next proc context into %p/n", user_context);    TracePrintf(TRACE_LEVEL_DETAIL_INFO, "Loading next proc PID: %d/n", next_proc->pid);    *user_context = next_proc->user_context;    // Set the TLB registers for the region 1 page table.    WriteRegister(REG_PTBR1, (unsigned int) next_proc->region_1_page_table);    WriteRegister(REG_TLB_FLUSH, TLB_FLUSH_1);    PCB *old_proc = current_proc;    current_proc = next_proc;    int rc = KernelContextSwitch(&SaveKernelContextAndSwitch, old_proc, next_proc);    if (SUCCESS == rc) {        TracePrintf(TRACE_LEVEL_DETAIL_INFO, "Succesfully switched kernel context!/n");    } else {        TracePrintf(TRACE_LEVEL_NON_TERMINAL_PROBLEM, "Failed to save kernel context!/n");        char *err_str = calloc(TERMINAL_MAX_LINE, sizeof(char));        sprintf(err_str, "KernelContextSwitch failed!!! HALTING!!!/n", current_proc->pid);        KernelTtyWriteInternal(0, err_str, strnlen(err_str, TERMINAL_MAX_LINE), user_context);        free(err_str);        Halt();    }    // Restore user state of new current process    *user_context = current_proc->user_context;    TracePrintf(TRACE_LEVEL_FUNCTION_INFO, "<<< SwitchToProc()/n");}
开发者ID:jakeleichtling,项目名称:THEYNIX,代码行数:36,


示例12: coretracefunc

   Nav2::~Nav2(){      coretracefunc();            Halt();      WaitNavigate2();      coreprintln("Halt and WaitNavigate2 completed..");            delete[] m_globalData->m_writable_files_path;      delete[] m_globalData->m_readonly_files_path;      delete m_errorTable;      delete mainlog;      delete m_globalData->m_logmaster;      delete m_globalData;#ifdef __SYMBIAN32__      delete m_archGlobalData->m_timerThread;      if(m_archGlobalData->m_socketServ){         m_archGlobalData->m_socketServ->Close();         delete m_archGlobalData->m_socketServ;         m_archGlobalData->m_socketServ=NULL;      }      delete m_archGlobalData;      deleteTlsGlobalData(m_tlsGlobalData, m_tlsGlobalDataId);#endif            //delete m_audioSyntax;   - owned by AudioCtrl...   }
开发者ID:FlavioFalcao,项目名称:Wayfinder-CppCore-v2,代码行数:27,


示例13: NewContext

void NewContext(int* SP) {	// SP for next task to go (arg #1) goes into HL	SP; FunctionArgToReg(H, L);		// Restores usermode status        SetStackPointerASM(_OldSP);	ExchangeRegs();	ReloadIndexes();		SaveContext();	// Switches to the process with stack in SP	ExchangeRegs();	GetStackPointerASM(_TempSP);	SetStackPointerREG(HL);        *CurrentSP=TempSP;	ExchangeRegs();		LoadContext();	if(ControlRequests==0) Halt("ISR IN USER MODE");	ControlRequests--;	IntsOn();	ImmediateReturn();}
开发者ID:LuccoJ,项目名称:z80sim,代码行数:26,


示例14: main

intmain(int argc, char **argv){  int i, joinval, tmp;  SpaceId kid;  char *args[1];  args[0] = (char *)0;  for (i=0; i<100000; i++) tmp++;  /* loop to delay kid initially */  if ((kid=Fork()) == 0) {      Exec("deepkid2", args);      print("ERROR: exec failed in kid/n");      Exit(100);  }  print("KID1 after exec; kid1 pid is ");  printd((int)kid, ConsoleOutput);  print("/n");  print("KID1 about to Join kid2/n");  joinval = Join(kid);  print("KID1 off Join with value of ");  printd(joinval, ConsoleOutput);  print("/n");  Exit(1);  /* Should not get past here */  print("ERROR: KID1 after Exit()/n");  Halt();    /* not reached */}
开发者ID:jeche,项目名称:OPS,代码行数:35,


示例15: main

intmain(){  SpaceId kid;  int joinval;  prints("PARENT exists/n", ConsoleOutput);  kid = Fork();  if (kid != 0) {    prints("PARENT after fork; kid pid is ", ConsoleOutput);    printd((int)kid, ConsoleOutput);    prints("/n", ConsoleOutput);        joinval = Join(kid);        prints("PARENT off Join with value of ", ConsoleOutput);    printd(joinval, ConsoleOutput);    prints("/n", ConsoleOutput);    Halt();  /* not reached */  } else     Exec("kid");}
开发者ID:jeche,项目名称:OPS,代码行数:25,


示例16: main

intmain(){  SpaceId kid;  int joinval;  prints("PARENT exists/n", ConsoleOutput);  kid = Fork();  if (kid != 0) {    prints("PARENT after fork; kid pid is ", ConsoleOutput);    printd((int)kid, ConsoleOutput);    prints("/n", ConsoleOutput);        joinval = Join(kid);        prints("PARENT off Join with value of ", ConsoleOutput);    printd(joinval, ConsoleOutput);    prints("/n", ConsoleOutput);    Exit(56);    Halt();  /* not reached */  } else {    prints("KID running, about to Exit()/n", ConsoleOutput);    /* You may want to put some real code here */    Exit(17);  }}
开发者ID:jeche,项目名称:OPS,代码行数:28,


示例17: Exit

static voidExit(void){   if (!Halt()) {      CommOS_StopIO();   }}
开发者ID:AbdulrahmanAmir,项目名称:Dorimanx-LG-G2-D802-Kernel,代码行数:7,


示例18: main

intmain(){    int i, j, k;    prints("Starting matmult/n", ConsoleOutput);    for (i = 0; i < Dim; i++)		/* first initialize the matrices */	for (j = 0; j < Dim; j++) {	     A[i][j] = i;	     B[i][j] = j;	     C[i][j] = 0;	}    prints("Initialization Complete/n", ConsoleOutput);    for (i = 0; i < Dim; i++) {		/* then multiply them together */        prints("i = ", ConsoleOutput); printd(i, ConsoleOutput); prints("/n", ConsoleOutput);	for (j = 0; j < Dim; j++)            for (k = 0; k < Dim; k++)		 C[i][j] += A[i][k] * B[k][j];    }    prints("C[", ConsoleOutput); printd(Dim-1, ConsoleOutput);    prints(",", ConsoleOutput); printd(Dim-1, ConsoleOutput);    prints("] = ", ConsoleOutput); printd(C[Dim-1][Dim-1], ConsoleOutput);    prints("/n", ConsoleOutput);    Exit(1);    Halt();		/* and then we're done */}
开发者ID:jeche,项目名称:OPS,代码行数:30,


示例19: main

int main(){	PutString("Files opened.../n");	ForkExec("userpages1");	PutChar('/n');	ForkExec("userpages2");	PutChar('/n');	ForkExec("userpages1");	PutChar('/n');	ForkExec("userpages2");	PutChar('/n');	ForkExec("userpages1");	PutChar('/n');	ForkExec("userpages2");	PutChar('/n');	ForkExec("userpages1");	PutChar('/n');	ForkExec("userpages2");	PutChar('/n');	ForkExec("userpages1");	PutChar('/n');	ForkExec("userpages2");	PutChar('/n');	ForkExec("userpages1");	PutChar('/n');	ForkExec("userpages2");	PutChar('/n');	PutString("/nExiting.../n");Halt();}
开发者ID:AmineAfia,项目名称:Nachos2,代码行数:30,


示例20: context_switch_to

/* Wrapper of kernel context switch * * @param next_proc: the process to be switched in * @param user_context: current user context */void context_switch_to(pcb_t *next_proc, UserContext *user_context) {    int rc = 0;    rc = KernelContextSwitch(&kernel_context_switch, running_proc, next_proc);    if(rc) {        log_err("Failed to execute magic function!");        Halt();    }}
开发者ID:jack2684,项目名称:yalnix,代码行数:13,


示例21: main

intmain (){    Halt ();     /* not reached */    return 0;}
开发者ID:NicolasAfonso,项目名称:NachOS,代码行数:8,


示例22: Task2

void Task2() {        while(1) {                if(!IsMultitasking()) {			Halt("INTS DISABLED PRC2");		}                ConsoleWrite("2");		_SimPrintString("2");        }}
开发者ID:LuccoJ,项目名称:z80sim,代码行数:9,


示例23: Resume

void Resume() {        if(ControlRequests>0) {	        ControlRequests--;                if(ControlRequests==0) {			UserMode();		}        } else {		Halt("RESUME WITHOUT PAUSE");	}}
开发者ID:LuccoJ,项目名称:z80sim,代码行数:10,


示例24: init_process_kernel

/* Used for special processes that is not forked to init kernel context, * meaning this process is manually created by Yalnix */void init_process_kernel(pcb_t *proc) {    int rc = 0;        rc = KernelContextSwitch(&init_newbie_kernel, proc, proc);    if(rc) {        log_err("Failed to execute magic function!");        Halt();    }    //log_info("Init PID(%d) kernel stack done", proc->pid);}
开发者ID:jack2684,项目名称:yalnix,代码行数:13,


示例25: main

intmain(){  int result;    result = Add(42, 23);  Halt();  /* not reached */}
开发者ID:Ldpe2G,项目名称:NachOS-VirtualMachine,代码行数:10,


示例26: main

intmain(){	void (*func)();	func = &printfork;    Fork(func);    Sleep(10000000);    /*Exit(0);*/    Halt();}
开发者ID:venks06,项目名称:Nachos,代码行数:10,


示例27: main

/* * write.c * *  Created on: 2012-11-18 *      Author: rye */int main() {	//Test Create		int fd;		int readSize;		Create("TestSysCall");		fd = Open("TestSysCall");		Write("Test my system call.",21,fd);		Close(fd);		Halt();}
开发者ID:juyingnan,项目名称:AOS,代码行数:16,



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


C++ HandleAddDisables函数代码示例
C++ HalLedSet函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。