memory.c File Reference

#include "../drivers.h"
#include "../libdriver/driver.h"
#include <sys/ioc_memory.h>
#include "../../kernel/const.h"
#include "../../kernel/config.h"
#include "../../kernel/type.h"
#include <sys/vm.h>
#include "assert.h"
#include "local.h"

Include dependency graph for memory.c:

Go to the source code of this file.

Defines

#define NR_DEVS   7
#define ZERO_BUF_SIZE   1024
#define click_to_round_k(n)   ((unsigned) ((((unsigned long) (n) << CLICK_SHIFT) + 512) / 1024))

Functions

FORWARD _PROTOTYPE (char *m_name,(void))
FORWARD _PROTOTYPE (struct device *m_prepare,(int device))
FORWARD _PROTOTYPE (int m_transfer,(int proc_nr, int opcode, off_t position, iovec_t *iov, unsigned nr_req))
FORWARD _PROTOTYPE (int m_do_open,(struct driver *dp, message *m_ptr))
FORWARD _PROTOTYPE (void m_init,(void))
FORWARD _PROTOTYPE (void m_geometry,(struct partition *entry))
PUBLIC int main (void)
PRIVATE char * m_name ()
PRIVATE struct devicem_prepare (int device)
PRIVATE int m_transfer (int proc_nr, int opcode, off_t position, iovec_t *iov, unsigned nr_req)
PRIVATE int m_do_open (struct driver *dp, message *m_ptr)
PRIVATE void m_init ()
PRIVATE int m_ioctl (struct driver *dp, message *m_ptr)
PRIVATE void m_geometry (struct partition *entry)

Variables

PRIVATE struct device m_geom [NR_DEVS]
PRIVATE int m_seg [NR_DEVS]
PRIVATE int m_device
PRIVATE struct kinfo kinfo
PRIVATE struct machine machine
int errno
PRIVATE struct driver m_dtab
PRIVATE char dev_zero [ZERO_BUF_SIZE]


Define Documentation

#define click_to_round_k n   )     ((unsigned) ((((unsigned long) (n) << CLICK_SHIFT) + 512) / 1024))
 

Definition at line 71 of file memory.c.

Referenced by memmap_dmp(), and proctab_dmp().

#define NR_DEVS   7
 

Definition at line 30 of file memory.c.

#define ZERO_BUF_SIZE   1024
 

Definition at line 68 of file memory.c.

Referenced by m_init(), and m_transfer().


Function Documentation

FORWARD _PROTOTYPE void  m_geometry,
(struct partition *entry
 

FORWARD _PROTOTYPE void  m_init,
(void) 
 

FORWARD _PROTOTYPE int  m_do_open,
(struct driver *dp, message *m_ptr) 
 

FORWARD _PROTOTYPE int  m_transfer,
(int proc_nr, int opcode, off_t position, iovec_t *iov, unsigned nr_req
 

FORWARD _PROTOTYPE struct device m_prepare,
(int device
 

FORWARD _PROTOTYPE char *  m_name,
(void) 
 

PRIVATE int m_do_open struct driver dp,
message m_ptr
 

Definition at line 226 of file memory.c.

References ENXIO, m_device, m_prepare(), MEM_DEV, NIL_DEV, OK, printf, r, and sys_enable_iop().

PRIVATE void m_geometry struct partition entry  ) 
 

Definition at line 429 of file memory.c.

References div64u(), m_device, m_geom, and SECTOR_SIZE.

PRIVATE void m_init  ) 
 

Definition at line 250 of file memory.c.

References _taskcall(), BOOT_DEV, kinfo::bootdev_base, kinfo::bootdev_size, cvul64(), DS_PROC_NR, DS_RETRIEVE, device::dv_base, device::dv_size, i, IMGRD_DEV, imgrd_size, kinfo, kinfo::kmem_base, KMEM_DEV, kinfo::kmem_size, m, m_geom, m_seg, MEMORY_MAJOR, OK, panic, printf, RAM_DEV, s, sys_getkinfo, sys_segctl(), and ZERO_BUF_SIZE.

Referenced by main().

PRIVATE int m_ioctl struct driver dp,
message m_ptr
 

Definition at line 331 of file memory.c.

References _taskcall(), allocmem, cvul64(), D, do_diocntl(), DS_PROC_NR, DS_PUBLISH, device::dv_base, device::dv_size, EINVAL, ENOMEM, ENOTTY, ENXIO, EPERM, errno, m, m_device, m_dtab, m_prepare(), m_seg, MEM_DEV, MEMORY_MAJOR, MIOCMAP, MIOCRAMSIZE, MIOCUNMAP, NIL_DEV, OK, panic, printf, r, RAM_DEV, report(), s, SELF, sys_segctl(), sys_vircopy(), and sys_vm_map().

PRIVATE char* m_name  ) 
 

Definition at line 95 of file memory.c.

PRIVATE struct device* m_prepare int  device  ) 
 

Definition at line 105 of file memory.c.

References m_device, m_geom, NIL_DEV, and NR_DEVS.

Referenced by m_do_open(), and m_ioctl().

PRIVATE int m_transfer int  proc_nr,
int  opcode,
off_t  position,
iovec_t iov,
unsigned  nr_req
 

Definition at line 118 of file memory.c.

References BOOT_DEV, chunk, count, cv64ul(), D, DEV_GATHER, device::dv_base, device::dv_size, EINVAL, imgrd, IMGRD_DEV, iovec_t::iov_addr, iovec_t::iov_size, KMEM_DEV, left(), m_device, m_geom, m_seg, MEM_DEV, NONE, NULL_DEV, OK, PHYS_SEG, RAM_DEV, report(), s, seg, SELF, sys_physcopy(), sys_vircopy(), user_vir, ZERO_BUF_SIZE, and ZERO_DEV.

PUBLIC int main void   ) 
 

Definition at line 77 of file memory.c.

References driver_task(), errno, m_dtab, m_init(), OK, panic, SIG_MESS, sigaction, sigemptyset, and SIGTERM.


Variable Documentation

PRIVATE char dev_zero[ZERO_BUF_SIZE]
 

Definition at line 69 of file memory.c.

int errno
 

Definition at line 70 of file rcp.c.

PRIVATE struct kinfo kinfo
 

Definition at line 35 of file memory.c.

Referenced by do_getsysinfo(), kenv_dmp(), m_init(), main(), sched_dmp(), and uname().

PRIVATE int m_device
 

Definition at line 34 of file memory.c.

Referenced by m_do_open(), m_geometry(), m_ioctl(), m_prepare(), m_transfer(), r_geometry(), r_prepare(), and r_transfer().

PRIVATE struct driver m_dtab
 

Initial value:

Definition at line 50 of file memory.c.

Referenced by m_ioctl(), and main().

PRIVATE struct device m_geom[NR_DEVS]
 

Definition at line 32 of file memory.c.

Referenced by m_geometry(), m_init(), m_prepare(), m_transfer(), r_geometry(), r_prepare(), and r_transfer().

PRIVATE int m_seg[NR_DEVS]
 

Definition at line 33 of file memory.c.

Referenced by m_init(), m_ioctl(), and m_transfer().

PRIVATE struct machine machine
 

Definition at line 36 of file memory.c.

Referenced by addstring(), get_mem_chunks(), kenv_dmp(), and main().


Generated on Fri Apr 14 23:09:07 2006 for minix by  doxygen 1.4.6