本文整理汇总了C++中pinit函数的典型用法代码示例。如果您正苦于以下问题:C++ pinit函数的具体用法?C++ pinit怎么用?C++ pinit使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pinit函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: assemble
int
assemble(char *file)
{
char ofile[100], incfile[20], *p;
int i, of;
strcpy(ofile, file);
if(p = strrchr(ofile, pathchar())) {
include[0] = ofile;
*p++ = 0;
} else
p = ofile;
if(outfile == 0) {
outfile = p;
if(p = strrchr(outfile, '.'))
if(p[1] == 's' && p[2] == 0)
p[0] = 0;
p = strrchr(outfile, 0);
p[0] = '.';
p[1] = thechar;
p[2] = 0;
}
p = getenv("INCLUDE");
if(p) {
setinclude(p);
} else {
if(systemtype(Plan9)) {
sprint(incfile,"/%s/include", thestring);
setinclude(strdup(incfile));
}
}
of = mycreat(outfile, 0664);
if(of < 0) {
yyerror("%ca: cannot create %s", thechar, outfile);
errorexit();
}
Binit(&obuf, of, OWRITE);
pass = 1;
nosched = 0;
pinit(file);
for(i=0; i<nDlist; i++)
dodefine(Dlist[i]);
yyparse();
if(nerrors) {
cclean();
return nerrors;
}
pass = 2;
nosched = 0;
outhist();
pinit(file);
for(i=0; i<nDlist; i++)
dodefine(Dlist[i]);
yyparse();
cclean();
return nerrors;
}
开发者ID:aberg001,项目名称:plan9,代码行数:60,代码来源:lex.c
示例2: assemble
int
assemble(char *file)
{
char *ofile, *p;
int i, of;
ofile = alloc(strlen(file)+3); // +3 for .x\0 (x=thechar)
strcpy(ofile, file);
p = utfrrune(ofile, pathchar());
if(p) {
include[0] = ofile;
*p++ = 0;
} else
p = ofile;
if(outfile == 0) {
outfile = p;
if(outfile){
p = utfrrune(outfile, '.');
if(p)
if(p[1] == 's' && p[2] == 0)
p[0] = 0;
p = utfrune(outfile, 0);
p[0] = '.';
p[1] = thechar;
p[2] = 0;
} else
outfile = "/dev/null";
}
of = create(outfile, OWRITE, 0664);
if(of < 0) {
yyerror("%ca: cannot create %s", thechar, outfile);
errorexit();
}
Binit(&obuf, of, OWRITE);
pass = 1;
pinit(file);
Bprint(&obuf, "go object %s %s %s\n", getgoos(), thestring, getgoversion());
for(i=0; i<nDlist; i++)
dodefine(Dlist[i]);
yyparse();
if(nerrors) {
cclean();
return nerrors;
}
Bprint(&obuf, "\n!\n");
pass = 2;
outhist();
pinit(file);
for(i=0; i<nDlist; i++)
dodefine(Dlist[i]);
yyparse();
cclean();
return nerrors;
}
开发者ID:hfeeki,项目名称:go,代码行数:60,代码来源:lex.c
示例3: main
// Bootstrap processor starts running C code here.
// Allocate a real stack and switch to it, first
// doing some setup required for memory allocator to work.
int
main(void)
{
unsigned char FB[]="MESSAGE WRITTEN THROUGH FRAMEBUFFER!!";
fb_init(); // initialize framebuffer device (2015.11.02)
cprintf("\nUsing Framebuffer still presents some problems :(\n\n");
cprintf("\nSuggestion: review the way it is used in console.c\n\n");
fb_write(FB, sizeof(FB)); // Framebuffer maybe could be used before this moment (2015.11.02)
see_mylock(MYLOCK);
kinit1(end, P2V(4*1024*1024)); // phys page allocator
kvmalloc(); // kernel page table
mpinit(); // collect info about this machine
lapicinit();
seginit(); // set up segments
cprintf("\ncpu%d: starting xv6\n\n", cpu->id);
picinit(); // interrupt controller
ioapicinit(); // another interrupt controller
consoleinit(); // I/O devices & their interrupts
uartinit(); // serial port
pinit(); // process table
tvinit(); // trap vectors
binit(); // buffer cache
fileinit(); // file table
ideinit(); // disk
if(!ismp)
timerinit(); // uniprocessor timer
startothers(); // start other processors
kinit2(P2V(4*1024*1024), P2V(PHYSTOP)); // must come after startothers()
userinit(); // first user process
// Finish setting up this processor in mpmain.
mpmain();
}
开发者ID:ismaellc,项目名称:SOTR,代码行数:35,代码来源:main.c
示例4: main
// Bootstrap processor starts running C code here.
// Allocate a real stack and switch to it, first
// doing some setup required for memory allocator to work.
int
main(void)
{
monitor_clear ();
// Print basic system information.
cprintf ("Ensidia\n\n");
cprintf ("Copyright (c) 2013-2014 Fotis Koutoulakis\n");
cprintf ("Based on xv6 by Russ Cox et al, at MIT CSAIL\n");
kinit1(end, P2V(4*1024*1024)); // phys page allocator
kvmalloc(); // kernel page table
mpinit(); // collect info about this machine
lapicinit();
seginit(); // set up segments
cprintf("\ncpu%d: starting xng kernel\n\n", cpu->id);
picinit(); // interrupt controller
ioapicinit(); // another interrupt controller
consoleinit(); // I/O devices & their interrupts
uartinit(); // serial port
pinit(); // process table
tvinit(); // trap vectors
binit(); // buffer cache
fileinit(); // file table
iinit(); // inode cache
ideinit(); // disk
if(!ismp)
timerinit(); // uniprocessor timer
startothers(); // start other processors
kinit2(P2V(4*1024*1024), P2V(PHYSTOP)); // must come after startothers()
userinit(); // first user process
// Finish setting up this processor in mpmain.
mpmain();
}
开发者ID:NlightNFotis,项目名称:Ensidia,代码行数:37,代码来源:main.c
示例5: init_providence
ENTRYPOINT void init_providence(ModeInfo *mi)
{
providencestruct *mp;
if(!providence) {
if((providence = (providencestruct *)
calloc(MI_NUM_SCREENS(mi), sizeof (providencestruct))) == NULL)
return;
}
mp = &providence[MI_SCREEN(mi)];
mp->trackball = gltrackball_init ();
mp->position0[0] = 1;
mp->position0[1] = 5;
mp->position0[2] = 1;
mp->position0[3] = 1;
mp->camera_velocity = -8.0;
mp->mono = MI_IS_MONO(mi);
mp->wire = MI_IS_WIREFRAME(mi);
/* make multiple screens rotate at slightly different rates. */
mp->theta_scale = 0.7 + frand(0.6);
if((mp->glx_context = init_GL(mi)) != NULL) {
reshape_providence(mi, MI_WIDTH(mi), MI_HEIGHT(mi));
glDrawBuffer(GL_BACK);
pinit(mp);
}
else
MI_CLEARWINDOW(mi);
}
开发者ID:RazZziel,项目名称:pongclock,代码行数:33,代码来源:providence.c
示例6: init_providence
ENTRYPOINT void init_providence(ModeInfo *mi)
{
providencestruct *mp;
MI_INIT(mi, providence);
mp = &providence[MI_SCREEN(mi)];
mp->trackball = gltrackball_init (False);
mp->position0[0] = 1;
mp->position0[1] = 5;
mp->position0[2] = 1;
mp->position0[3] = 1;
mp->camera_velocity = -8.0;
mp->mono = MI_IS_MONO(mi);
mp->wire = MI_IS_WIREFRAME(mi);
# ifdef HAVE_JWZGLES /* #### glPolygonMode other than GL_FILL unimplemented */
mp->wire = 0;
# endif
/* make multiple screens rotate at slightly different rates. */
mp->theta_scale = 0.7 + frand(0.6);
if((mp->glx_context = init_GL(mi)) != NULL) {
reshape_providence(mi, MI_WIDTH(mi), MI_HEIGHT(mi));
/* glDrawBuffer(GL_BACK); */
pinit(mp);
}
else
MI_CLEARWINDOW(mi);
}
开发者ID:MaddTheSane,项目名称:xscreensaver,代码行数:33,代码来源:providence.c
示例7: kmain
/*int main(void){*/
void kmain(void){
// vga_init();
// puts((uint8_t*)"Hello kernel world!\n");
/*do some work here, like initialize timer or paging*/
kinit1(end, P2V(4*1024*1024)); // phys page allocator
kvmalloc(); // kernel page table
mpinit(); // collect info about this machine
lapicinit();
// gdt_descriptor();
// puts((uint8_t*)"GDT initialized...\n");
// idt_descriptor();
// puts((uint8_t*)"IDT initialized...\n");
// cprintf("IDT initialized...\n");
seginit(); // set up segments
cprintf("\ncpu%d: starting xv6\n\n", cpu->id);
picinit(); // interrupt controller
ioapicinit(); // another interrupt controller
consoleinit(); // I/O devices & their interrupts
uartinit(); // serial port
pinit(); // process table
tvinit(); // trap vectors
binit(); // buffer cache
fileinit(); // file table
ideinit(); // disk
if(!ismp)
timerinit(); // uniprocessor timer
startothers(); // start other processors
kinit2(P2V(4*1024*1024), P2V(PHYSTOP)); // must come after startothers()
userinit(); // first user process
// Finish setting up this processor in mpmain.
mpmain();
}
开发者ID:ismaellc,项目名称:SOTR,代码行数:33,代码来源:kernel.c
示例8: init_boxed
ENTRYPOINT void
init_boxed(ModeInfo * mi)
{
int screen = MI_SCREEN(mi);
/* Colormap cmap; */
/* Boolean rgba, doublebuffer, cmap_installed; */
boxedstruct *gp;
MI_INIT(mi, boxed, free_boxed);
gp = &boxed[screen];
gp->window = MI_WINDOW(mi);
if ((gp->glx_context = init_GL(mi)) != NULL) {
reshape_boxed(mi, MI_WIDTH(mi), MI_HEIGHT(mi));
glDrawBuffer(GL_BACK);
if (!glIsList(gp->listobjects)) {
gp->listobjects = glGenLists(3);
gp->gllists[0] = 0;
gp->gllists[1] = 0;
gp->gllists[2] = 0;
}
pinit(mi);
} else {
MI_CLEARWINDOW(mi);
}
}
开发者ID:sev-,项目名称:xscreensaver,代码行数:27,代码来源:boxed.c
示例9: main
// Bootstrap processor starts running C code here.
// Allocate a real stack and switch to it, first
// doing some setup required for memory allocator to work.
int
main(void)
{
kinit1(end, P2V(4*1024*1024)); // phys page allocator // kmem. freelist added
cprintf("%x \n", end);
kvmalloc(); // kernel page table
#ifdef CONFIG_MULTI_PROCESS
mpinit(); // collect info about this machine
#endif
lapicinit();
seginit(); // set up segments
picinit(); // interrupt controller: Programmable Interrupt Controller
#ifdef CONFIG_MULTI_PROCESS
ioapicinit(); // another interrupt controller
#endif
consoleinit(); // I/O devices & their interrupts
uartinit(); // serial port
pinit(); // process table
tvinit(); // trap vectors
binit(); // buffer cache
fileinit(); // file table
iinit(); // inode cache
ideinit(); // disk
if(!ismp)
timerinit(); // uniprocessor timer
#ifdef CONFIG_MULTI_PROCESS
startothers(); // start other processors
kinit2(P2V(4*1024*1024), P2V(PHYSTOP)); // must come after startothers()
#endif
userinit(); // first user process
// Finish setting up this processor in mpmain.
mpmain();
}
开发者ID:hubert-he,项目名称:xv6,代码行数:36,代码来源:main.c
示例10: main
// Bootstrap processor starts running C code here.
// Allocate a real stack and switch to it, first
// doing some setup required for memory allocator to work.
int
main(void)
{
kinit1(end, P2V(4*1024*1024)); // phys page allocator
kvmalloc(); // kernel page table
mpinit(); // collect info about this machine
lapicinit();
seginit(); // set up segments
cprintf("\ncpu%d: starting xv6\n\n", cpu->id);
picinit(); // interrupt controller
ioapicinit(); // another interrupt controller
consoleinit(); // I/O devices & their interrupts
uartinit(); // serial port
pinit(); // process table
tvinit(); // trap vectors
binit(); // buffer cache
fileinit(); // file table
ideinit(); // disk
if(!ismp)
timerinit(); // uniprocessor timer
startothers(); // start other processors
kinit2(P2V(4*1024*1024), P2V(PHYSTOP)); // must come after startothers()
userinit(); // first user process
mpmain();
}
开发者ID:humphreyja,项目名称:Xv6,代码行数:29,代码来源:main.c
示例11: init_morph3d
void
init_morph3d(ModeInfo * mi)
{
morph3dstruct *mp;
if (morph3d == NULL) {
if ((morph3d = (morph3dstruct *) calloc(MI_NUM_SCREENS(mi),
sizeof (morph3dstruct))) == NULL)
return;
}
mp = &morph3d[MI_SCREEN(mi)];
mp->step = NRAND(90);
mp->VisibleSpikes = 1;
if ((mp->glx_context = init_GL(mi)) != NULL) {
reshape_morph3d(mi, MI_WIDTH(mi), MI_HEIGHT(mi));
glDrawBuffer(GL_BACK);
mp->object = MI_COUNT(mi);
if (mp->object <= 0 || mp->object > 5)
mp->object = NRAND(5) + 1;
pinit(mi);
} else {
MI_CLEARWINDOW(mi);
}
}
开发者ID:Gelma,项目名称:xlockmore-for-13.04,代码行数:25,代码来源:morph3d.c
示例12: kmain
void kmain (void)
{
cpu = &cpus[0];
uart_init (P2V(UART0));
init_vmm ();
kpt_freerange (align_up(&end, PT_SZ), P2V_WO(INIT_KERNMAP));
paging_init (INIT_KERNMAP, PHYSTOP);
kmem_init ();
kmem_init2(P2V(INIT_KERNMAP), P2V(PHYSTOP));
trap_init (); // vector table and stacks for models
gic_init(P2V(VIC_BASE)); // arm v2 gic init
uart_enable_rx (); // interrupt for uart
consoleinit (); // console
pinit (); // process (locks)
binit (); // buffer cache
fileinit (); // file table
iinit (); // inode cache
ideinit (); // ide (memory block device)
#ifdef INCLUDE_REMOVED
timer_init (HZ); // the timer (ticker)
#endif
sti ();
userinit(); // first user process
scheduler(); // start running processes
}
开发者ID:finallyjustice,项目名称:xv6-OS-for-arm-v8,代码行数:33,代码来源:main.c
示例13: key
static void GLUTCALLBACK key( unsigned char k, int x, int y )
{
(void) x;
(void) y;
switch (k) {
case '1': object=1; break;
case '2': object=2; break;
case '3': object=3; break;
case '4': object=4; break;
case '5': object=5; break;
case ' ': mono^=1; break;
case 13: smooth^=1; break;
case 'f':
{ sleepTime = sleepTime * 9 / 10;
break;
}
case 's':
{ sleepTime = sleepTime * 11 / 10;
break;
}
case 27:
exit(0);
}
pinit();
}
开发者ID:OS2World,项目名称:DEV-SAMPLES-MESA3D,代码行数:25,代码来源:morph3d.cpp
示例14: main
// Bootstrap processor starts running C code here.
// Allocate a real stack and switch to it, first
// doing some setup required for memory allocator to work.
int
main(void)
{
kinit1(end, P2V(4*1024*1024)); // phys page allocator
kvmalloc(); // kernel page table
mpinit(); // detect other processors
lapicinit(); // interrupt controller
seginit(); // segment descriptors
cprintf("\ncpu%d: starting xv6\n\n", cpunum());
picinit(); // another interrupt controller
ioapicinit(); // another interrupt controller
consoleinit(); // console hardware
uartinit(); // serial port
pinit(); // process table
tvinit(); // trap vectors
binit(); // buffer cache
fileinit(); // file table
ideinit(); // disk
if(!ismp)
timerinit(); // uniprocessor timer
startothers(); // start other processors
kinit2(P2V(4*1024*1024), P2V(PHYSTOP)); // must come after startothers()
userinit(); // first user process
mpmain(); // finish this processor's setup
init_semaphores_on_boot();
}
开发者ID:MarcoCBA,项目名称:Proyectos,代码行数:29,代码来源:main.c
示例15: init_stairs
ENTRYPOINT void
init_stairs (ModeInfo * mi)
{
int screen = MI_SCREEN(mi);
stairsstruct *sp;
if (stairs == NULL) {
if ((stairs = (stairsstruct *) calloc(MI_NUM_SCREENS(mi),
sizeof (stairsstruct))) == NULL)
return;
}
sp = &stairs[screen];
sp->step = 0.0;
sp->rotating = 0;
sp->sphere_position = NRAND(NPOSITIONS);
sp->sphere_tick = 0;
if ((sp->glx_context = init_GL(mi)) != NULL) {
reshape_stairs(mi, MI_WIDTH(mi), MI_HEIGHT(mi));
glDrawBuffer(GL_BACK);
if (!glIsList(sp->objects))
sp->objects = glGenLists(1);
pinit(mi);
} else {
MI_CLEARWINDOW(mi);
}
sp->trackball = gltrackball_init (False);
}
开发者ID:mmarseglia,项目名称:xscreensaver,代码行数:31,代码来源:stairs.c
示例16: main
// Bootstrap processor starts running C code here.
// Allocate a real stack and switch to it, first
// doing some setup required for memory allocator to work.
int
main(void)
{
kvmalloc(); // kernel page table
mpinit(); // collect info about this machine
lapicinit(mpbcpu());
seginit(); // set up segments
cprintf("\ncpu%d: starting xv6\n\n", cpu->id);
picinit(); // interrupt controller
ioapicinit(); // another interrupt controller
consoleinit(); // I/O devices & their interrupts
uartinit(); // serial port
pinit(); // process table
tvinit(); // trap vectors
binit(); // buffer cache
fileinit(); // file table
iinit(); // inode cache
ideinit(); // disk
if(!ismp)
timerinit(); // uniprocessor timer
startothers(); // start other processors (must come before kinit)
kinit(); // initialize memory allocator
userinit(); // first user process (must come after kinit)
// Finish setting up this processor in mpmain.
mpmain();
}
开发者ID:KWMalik,项目名称:Homework-3,代码行数:29,代码来源:main.c
示例17: init_moebius
ENTRYPOINT void
init_moebius (ModeInfo * mi)
{
moebiusstruct *mp;
if (moebius == NULL) {
if ((moebius = (moebiusstruct *) calloc(MI_NUM_SCREENS(mi),
sizeof (moebiusstruct))) == NULL)
return;
}
mp = &moebius[MI_SCREEN(mi)];
mp->step = NRAND(90);
mp->ant_position = NRAND(90);
{
double rot_speed = 0.3;
mp->rot = make_rotator (rot_speed, rot_speed, rot_speed, 1, 0, True);
mp->trackball = gltrackball_init ();
}
if ((mp->glx_context = init_GL(mi)) != NULL) {
reshape_moebius(mi, MI_WIDTH(mi), MI_HEIGHT(mi));
glDrawBuffer(GL_BACK);
pinit(mi);
} else {
MI_CLEARWINDOW(mi);
}
}
开发者ID:davehorner,项目名称:XScreenSaverWin,代码行数:29,代码来源:moebius.c
示例18: key
static void key( unsigned char k, int x, int y )
{
(void) x;
(void) y;
switch (k) {
case '1': object=1; break;
case '2': object=2; break;
case '3': object=3; break;
case '4': object=4; break;
case '5': object=5; break;
case ' ': mono^=1; break;
case 's': smooth^=1; break;
case 'a':
anim^=1;
if (anim)
glutIdleFunc( idle_ );
else
glutIdleFunc(NULL);
break;
case 27:
exit(0);
}
pinit();
glutPostRedisplay();
}
开发者ID:MttDs,项目名称:new-rexeno-tindpe,代码行数:25,代码来源:morph3d.c
示例19: init_antspotlight
ENTRYPOINT void init_antspotlight(ModeInfo *mi)
{
double rot_speed = 0.3;
antspotlightstruct *mp;
if(!antspotlight) {
if((antspotlight = (antspotlightstruct *)
calloc(MI_NUM_SCREENS(mi), sizeof (antspotlightstruct))) == NULL)
return;
}
mp = &antspotlight[MI_SCREEN(mi)];
mp->rot = make_rotator (rot_speed, rot_speed, rot_speed, 1, 0, True);
mp->trackball = gltrackball_init ();
if((mp->glx_context = init_GL(mi)) != NULL) {
reshape_antspotlight(mi, MI_WIDTH(mi), MI_HEIGHT(mi));
glDrawBuffer(GL_BACK);
pinit();
}
else
MI_CLEARWINDOW(mi);
glGenTextures(1, &mp->screentexture);
glBindTexture(GL_TEXTURE_2D, mp->screentexture);
get_snapshot(mi);
build_ant(mp);
mp->mono = MI_IS_MONO(mi);
mp->wire = MI_IS_WIREFRAME(mi);
mp->boardsize = 8.0;
mp->mag = 1;
}
开发者ID:RazZziel,项目名称:pongclock,代码行数:33,代码来源:antspotlight.c
示例20: main
// Bootstrap processor starts running C code here.
int
main(int memsize)
{
mpinit(); // collect info about this machine
lapicinit(mpbcpu());
ksegment();
picinit(); // interrupt controller
ioapicinit(); // another interrupt controller
consoleinit(); // I/O devices & their interrupts
uartinit(); // serial port
cprintf("cpus %p cpu %p\n", cpus, cpu);
cprintf("\ncpu%d: starting xv6\n\n", cpu->id);
cprintf("mem: %d kb\n", memsize);
kinit(memsize); // physical memory allocator
pinit(); // process table
tvinit(); // trap vectors
binit(); // buffer cache
fileinit(); // file table
iinit(); // inode cache
ideinit(); // disk
if(!ismp)
timerinit(); // uniprocessor timer
pageinit(); // enable paging
userinit(); // first user process
bootothers(); // start other processors
// Finish setting up this processor in mpmain.
mpmain();
}
开发者ID:hosanli,项目名称:os4,代码行数:30,代码来源:main.c
注:本文中的pinit函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论