generic
[Device Driver Interface]


Files

file  ddi.h
file  ddi_arg.h
file  ddi.c
 Device Driver Interface functions.

Data Structures

struct  ddi_memarg_t
struct  ddi_ioarg_t

Functions

__native sys_physmem_map (__native phys_base, __native virt_base, __native pages, __native flags)
__native sys_iospace_enable (ddi_ioarg_t *uspace_io_arg)
__native sys_preempt_control (int enable)
int ddi_iospace_enable_arch (task_t *task, __address ioaddr, size_t size)
static int ddi_physmem_map (__address pf, __address vp, count_t pages, int flags)
static int ddi_iospace_enable (task_id_t id, __address ioaddr, size_t size)

Function Documentation

static int ddi_iospace_enable task_id_t  id,
__address  ioaddr,
size_t  size
[static]
 

Enable range of I/O space for task.

Parameters:
id Task ID of the destination task.
ioaddr Starting I/O address.
size Size of the enabled I/O space..
Returns:
0 on success, EPERM if the caller lacks capabilities to use this syscall, ENOENT if there is no task matching the specified ID.

Definition at line 113 of file ddi.c.

References cap_get(), CAP_IO_MANAGER, ddi_iospace_enable_arch(), ENOENT, EPERM, interrupts_disable(), interrupts_restore(), spinlock_lock, spinlock_unlock(), TASK, task_find_by_id(), and tasks_lock.

Referenced by sys_iospace_enable().

Here is the call graph for this function:

int ddi_iospace_enable_arch task_t task,
__address  ioaddr,
size_t  size
 

Enable I/O space range for task.

Interrupts are disabled and task is locked.

Parameters:
task Task.
ioaddr Startign I/O space address.
size Size of the enabled I/O range.
Returns:
0 on success or an error code from errno.h.

Definition at line 50 of file ddi.c.

Referenced by ddi_iospace_enable().

static int ddi_physmem_map __address  pf,
__address  vp,
count_t  pages,
int  flags
[static]
 

Map piece of physical memory into virtual address space of current task.

Parameters:
pf Physical frame address of the starting frame.
vp Virtual page address of the starting page.
pages Number of pages to map.
flags Address space area flags for the mapping.
Returns:
0 on success, EPERM if the caller lacks capabilities to use this syscall, ENOENT if there is no task matching the specified ID and ENOMEM if there was a problem in creating address space area.

Definition at line 65 of file ddi.c.

References as_area_create(), cap_get(), CAP_MEM_MANAGER, ENOMEM, EPERM, interrupts_disable(), interrupts_restore(), PAGE_SIZE, phys_backend, spinlock_lock, spinlock_unlock(), and TASK.

Referenced by sys_physmem_map().

Here is the call graph for this function:

__native sys_iospace_enable ddi_ioarg_t uspace_io_arg  ) 
 

Wrapper for SYS_ENABLE_IOSPACE syscall.

Parameters:
uspace_io_arg User space address of DDI argument structure.
Returns:
0 on success, otherwise it returns error code found in errno.h

Definition at line 175 of file ddi.c.

References copy_from_uspace(), ddi_iospace_enable(), ddi_ioarg_t::ioaddr, ddi_ioarg_t::size, and ddi_ioarg_t::task_id.

Here is the call graph for this function:

__native sys_physmem_map __native  phys_base,
__native  virt_base,
__native  pages,
__native  flags
 

Wrapper for SYS_MAP_PHYSMEM syscall.

Parameters:
phys_base Physical base address to map
virt_base Destination virtual address
pages Number of pages
flags Flags of newly mapped pages
Returns:
0 on success, otherwise it returns error code found in errno.h

Definition at line 161 of file ddi.c.

References ALIGN_DOWN, ddi_physmem_map(), FRAME_SIZE, and PAGE_SIZE.

Here is the call graph for this function:

__native sys_preempt_control int  enable  ) 
 

Disable or enable preemption.

Parameters:
enable If non-zero, the preemption counter will be decremented, leading to potential enabling of preemption. Otherwise the preemption counter will be incremented, preventing preemption from occurring.
Returns:
Zero on success or EPERM if callers capabilities are not sufficient.

Definition at line 195 of file ddi.c.

References cap_get(), CAP_PREEMPT_CONTROL, EPERM, preemption_disable(), preemption_enable(), and TASK.

Here is the call graph for this function:


Generated on Sun Jun 18 17:26:15 2006 for HelenOS Kernel (ppc32) by  doxygen 1.4.6