plan 9 kernel history: overview | file list | diff list

1996/0418/pc/devvga.c (diff list | history)

1996/0315/sys/src/9/pc/devvga.c:158,1661996/0418/sys/src/9/pc/devvga.c:158,165 (short | long | prev | next)
1992/0527    
} 
 
void 
vgaclose(Chan *c) 
1996/0418    
vgaclose(Chan*) 
1992/0527    
{ 
1992/0711    
	USED(c); 
1992/0527    
} 
 
1994/0624    
static int 
1996/0315/sys/src/9/pc/devvga.c:241,2461996/0418/sys/src/9/pc/devvga.c:240,246
1995/0406    
	char *cp, *field[4]; 
1995/0126    
	Hwgc *hwgcp; 
	Vgac *vgacp; 
1996/0418    
	ulong mem, size, align; 
1994/0624    
 
1996/0315    
	n = parsefields(arg, field, 4, " "); 
1995/0406    
	if(n < 2) 
1996/0315/sys/src/9/pc/devvga.c:322,3411996/0418/sys/src/9/pc/devvga.c:322,341
1995/0406    
	else if(strcmp(field[0], "linear") == 0){ 
		if(n < 2) 
			error(Ebadarg); 
		x = strtoul(field[1], 0, 0); 
1996/0418    
		size = strtoul(field[1], 0, 0); 
1995/0406    
		if(n < 3) 
			y = 0; 
1996/0418    
			align = 0; 
1995/0406    
		else 
			y = strtoul(field[2], 0, 0); 
1996/0418    
			align = strtoul(field[2], 0, 0); 
1994/0624    
 
1995/0406    
		/* see if it fits in the usual place */ 
1995/0407    
		if(x <= Footprint){ 
1996/0418    
		if(size <= Footprint){ 
1995/0406    
			screenmem = SCREENMEM; 
1995/0407    
			if(x == 0){ 
1996/0418    
			if(size == 0){ 
1995/0406    
				footprint = Footprint; 
1995/0407    
				footshift = Footshift; 
			} else { 
1995/0406    
				footprint = x; 
1996/0418    
				footprint = size; 
1995/0407    
				for(n = 0; n < 31; n++) 
					if((1<<n) >= footprint) 
						break; 
1996/0315/sys/src/9/pc/devvga.c:346,3531996/0418/sys/src/9/pc/devvga.c:346,353
1995/0406    
		} 
 
		/* grab new space */ 
		if(y == 0){ 
			if(footprint >= x) 
1996/0418    
		if(align == 0){ 
			if(footprint >= size) 
1995/0406    
				return; 
		} else { 
			int s, e; 
1996/0315/sys/src/9/pc/devvga.c:354,3691996/0418/sys/src/9/pc/devvga.c:354,374
1995/0406    
 
			s = screenmem & ~KZERO; 
			e = s + footprint; 
			s = ROUND(s, y); 
1995/0624    
			if(e >= s + x) 
1996/0418    
			s = ROUND(s, align); 
			if(e >= s + size) 
1995/0406    
				return; 
		} 
		y = getspace(x, y); 
		if(y == 0) 
1996/0418    
 
		mem = 0; 
		if(vgac->linear) 
			(*vgac->linear)(&mem, &size, &align); 
		else 
			mem = getspace(size, align); 
		if(mem == 0) 
1995/0406    
			error("not enough free address space"); 
		screenmem = y; 
		gscreen.base = (void*)y; 
		footprint = x; 
1996/0418    
		screenmem = mem; 
		gscreen.base = (void*)screenmem; 
		footprint = size; 
1995/0407    
		for(n = 0; n < 31; n++) 
			if((1<<n) >= footprint) 
				break; 
1996/0315/sys/src/9/pc/devvga.c:431,4461996/0418/sys/src/9/pc/devvga.c:436,449
1992/0527    
} 
 
void 
vgaremove(Chan *c) 
1996/0418    
vgaremove(Chan*) 
1992/0527    
{ 
1992/0711    
	USED(c); 
1992/0527    
	error(Eperm); 
} 
 
void 
vgawstat(Chan *c, char *dp) 
1996/0418    
vgawstat(Chan*, char*) 
1992/0527    
{ 
1992/0711    
	USED(c, dp); 
1992/0527    
	error(Eperm); 
} 
1992/1119    
 
1996/0315/sys/src/9/pc/devvga.c:1011,10191996/0418/sys/src/9/pc/devvga.c:1014,1021
1993/1116    
} 
 
1992/1119    
static void 
nopage(int page) 
1996/0418    
nopage(int) 
1992/1119    
{ 
	USED(page); 
} 
 
1995/1227    
static int pos; 


source code copyright © 1990-2005 Lucent Technologies; see license
Plan 9 distribution
comments to russ cox (rsc@swtch.com)