Physical Memory allocation

Jeff Bowles bowles at lll-crg.llnl.gov
Tue Jun 21 02:01:18 AEST 1988


In article <4490 at killer.UUCP> egs at killer.UUCP (Eric Schnoebelen) writes:

>	I need to allocate a particular piece of memory for a driver.  The
>card has an onboard buffer in ROM space on the PC that the driver needs to
>be able to read and write....

#include <sys/types.h>
#include <sys/errno.h>
#include <sys/param.h>
#include <sys/dir.h>
#include <sys/immu.h>
#include <sys/file.h>
#include <sys/region.h>
#include <sys/proc.h>
#include <sys/signal.h>
#include <sys/sysmacros.h>
#include <sys/stream.h>
#include <sys/strlog.h>
#include <sys/stropts.h>
#include <sys/user.h>
#include <sys/errno.h>
#include <sys/cmn_err.h>

	{
	char *p = (struct cmm_regs *)sptalloc( btoc(WORKSIZE),
		PG_RW | PG_P , pfnum(BOARDADDR), 0);
	
**********************************

For me, this worked on the Bell Tech Unix SVR3; I believe it's consistent
with all things ported from the 3B2 - BOARDADDR in this case was something
like 0xE00000 and WORKSIZE was something like 8192, but I don't remember.

You can guess the arguments - "I need a workspace of size <arg1> in clicks
to be mapped into kernel space with permissions RW (read/write) and P (present).
The address is page frame number <pfnum(<arg3>. I don't know about the
last arg."

	Jeff Bowles



More information about the Comp.unix.microport mailing list