librtas_src/syscall_rmo.c File Reference

#include <fcntl.h>
#include <unistd.h>
#include <sys/mman.h>
#include "common.h"
#include "syscall.h"
#include "librtas.h"

Data Structures

struct  workarea_config

Defines

#define MAX_PAGES   64

Functions

static int read_kregion_bounds (struct region *kregion)
 Read the kernel region bounds for RMO memory.
static uint64_t get_bits (short lobit, short hibit, uint64_t mask)
static void set_bits (short lobit, short hibit, uint64_t value, uint64_t *mask)
static int acquire_file_lock (off_t start, size_t size)
static int release_file_lock (off_t start, size_t size)
static int get_phys_region (size_t size, uint32_t *phys_addr)
static int release_phys_region (uint32_t phys_addr, size_t size)
static int init_workarea_config ()
static int mmap_dev_mem (uint32_t phys_addr, size_t size, void **buf)
static int munmap_dev_mem (void *buf, size_t size)
int sc_interface_exists ()
int sc_free_rmo_buffer (void *buf, uint32_t phys_addr, size_t size)
int sc_get_rmo_buffer (size_t size, void **buf, uint32_t *phys_addr)

Variables

static const char * rmo_filename = "rmo_buffer"
static const char * devmem_path = "/dev/mem"
static const char * lockfile_path = "/var/lock/LCK..librtas"
static struct
workarea_config 
wa_config

Detailed Description

Copyright (C) 2005 IBM Corporation Common Public License Version 1.0 (see COPYRIGHT)

Author:
John Rose <johnrose@us.ibm.com>

Define Documentation

#define MAX_PAGES   64


Function Documentation

static int acquire_file_lock ( off_t  start,
size_t  size 
) [static]

acquire_file_lock

Parameters:
start 
size 
Returns:
0 on success, !0 otherwise

static uint64_t get_bits ( short  lobit,
short  hibit,
uint64_t  mask 
) [inline, static]

get_bits

Parameters:
lobit 
hibit 
mask 
Returns:
0 on success, !0 otherwise

static int get_phys_region ( size_t  size,
uint32_t *  phys_addr 
) [static]

get_phys_region

Parameters:
size 
phys_addr 
Returns:
0 on success, !0 otherwise

static int init_workarea_config (  )  [static]

init_workarea_config

Returns:
0 on success, !0 otherwise

static int mmap_dev_mem ( uint32_t  phys_addr,
size_t  size,
void **  buf 
) [static]

mmap_dev_mem

Parameters:
phys_addr 
size 
buf 
Returns:
0 on success, !0 otherwise

static int munmap_dev_mem ( void *  buf,
size_t  size 
) [static]

munmap_dev_mem

Parameters:
buf 
size 
Returns:
0 on success, !0 otherwise

static int read_kregion_bounds ( struct region kregion  )  [static]

read_kregion_bounds

Parameters:
kregion 
Returns:
0 on success, !0 otherwise

static int release_file_lock ( off_t  start,
size_t  size 
) [static]

release_file_lock

Parameters:
start 
size 
Returns:
0 on success, !0 otherwise

static int release_phys_region ( uint32_t  phys_addr,
size_t  size 
) [static]

release_phys_region

Parameters:
phys_addr 
size 
Returns:
0 on success, !0 otherwise

int sc_free_rmo_buffer ( void *  buf,
uint32_t  phys_addr,
size_t  size 
)

sc_free_rmo_buffer

Parameters:
buf virtual address of mmap()'ed buffer
phys_addr physical address of low mem buffer
size size of buffer
Returns:
0 on success, !0 otherwise RTAS_FREE_ERR - Free called before get RTAS_IO_ASSERT - Unexpected I/O Error

int sc_get_rmo_buffer ( size_t  size,
void **  buf,
uint32_t *  phys_addr 
)

sc_get_rmo_buffer

Parameters:
size Size of requested region. Must be a multiple of 4096.
buf Assigned to mmap'ed buffer of acquired region
phys_addr Assigned to physical address of acquired region
Returns:
0 on success, !0 otherwise RTAS_NO_MEM - Out of heap memory RTAS_NO_LOWMEM - Out of rmo memory RTAS_IO_ASSERT - Unexpected I/O Error

int sc_interface_exists (  ) 

sc_interface_exists

Returns:
0 on success, !0 otherwise

static void set_bits ( short  lobit,
short  hibit,
uint64_t  value,
uint64_t *  mask 
) [inline, static]

set_bits

Parameters:
lobit 
hibit 
value 
mask 
Returns:
0 on success, !0 otherwise


Variable Documentation

const char* devmem_path = "/dev/mem" [static]

const char* lockfile_path = "/var/lock/LCK..librtas" [static]

const char* rmo_filename = "rmo_buffer" [static]

struct workarea_config wa_config [static]

Initial value:

 {
        .lockfile_fd = -1,
        .init_done = 0,
        .pages_map = 0ll,
}


Generated on Sat Sep 22 08:52:51 2007 for librtas by  doxygen 1.5.3