Xenomai
3.0.5
|
Functions | |
int | rtdm_mmap_to_user (struct rtdm_fd *fd, void *src_addr, size_t len, int prot, void **pptr, struct vm_operations_struct *vm_ops, void *vm_private_data) |
Map a kernel memory range into the address space of the user. More... | |
int | rtdm_iomap_to_user (struct rtdm_fd *fd, phys_addr_t src_addr, size_t len, int prot, void **pptr, struct vm_operations_struct *vm_ops, void *vm_private_data) |
Map an I/O memory range into the address space of the user. More... | |
int | rtdm_mmap_kmem (struct vm_area_struct *vma, void *va) |
Map a kernel logical memory range to a virtual user area. More... | |
int | rtdm_mmap_vmem (struct vm_area_struct *vma, void *va) |
Map a virtual memory range to a virtual user area. More... | |
int | rtdm_mmap_iomem (struct vm_area_struct *vma, phys_addr_t pa) |
Map an I/O memory range to a virtual user area. More... | |
int | rtdm_munmap (void *ptr, size_t len) |
Unmap a user memory range. More... | |
int | rtdm_ratelimit (struct rtdm_ratelimit_state *rs, const char *func) |
Enforces a rate limit. More... | |
void | rtdm_printk_ratelimited (const char *format,...) |
Real-time safe rate-limited message printing on kernel console. More... | |
void | rtdm_printk (const char *format,...) |
Real-time safe message printing on kernel console. More... | |
void * | rtdm_malloc (size_t size) |
Allocate memory block. More... | |
void | rtdm_free (void *ptr) |
Release real-time memory block. More... | |
int | rtdm_read_user_ok (struct rtdm_fd *fd, const void __user *ptr, size_t size) |
Check if read access to user-space memory block is safe. More... | |
int | rtdm_rw_user_ok (struct rtdm_fd *fd, const void __user *ptr, size_t size) |
Check if read/write access to user-space memory block is safe. More... | |
int | rtdm_copy_from_user (struct rtdm_fd *fd, void *dst, const void __user *src, size_t size) |
Copy user-space memory block to specified buffer. More... | |
int | rtdm_safe_copy_from_user (struct rtdm_fd *fd, void *dst, const void __user *src, size_t size) |
Check if read access to user-space memory block and copy it to specified buffer. More... | |
int | rtdm_copy_to_user (struct rtdm_fd *fd, void __user *dst, const void *src, size_t size) |
Copy specified buffer to user-space memory block. More... | |
int | rtdm_safe_copy_to_user (struct rtdm_fd *fd, void __user *dst, const void *src, size_t size) |
Check if read/write access to user-space memory block is safe and copy specified buffer to it. More... | |
int | rtdm_strncpy_from_user (struct rtdm_fd *fd, char *dst, const char __user *src, size_t count) |
Copy user-space string to specified buffer. More... | |
int | rtdm_in_rt_context (void) |
Test if running in a real-time task. More... | |
int | rtdm_rt_capable (struct rtdm_fd *fd) |
Test if the caller is capable of running in real-time context. More... | |
int rtdm_copy_from_user | ( | struct rtdm_fd * | fd, |
void * | dst, | ||
const void __user * | src, | ||
size_t | size | ||
) |
Copy user-space memory block to specified buffer.
[in] | fd | RTDM file descriptor as passed to the invoked device operation handler |
[in] | dst | Destination buffer address |
[in] | src | Address of the user-space memory block |
[in] | size | Size of the memory block |
Referenced by rtdm_ratelimit().
int rtdm_copy_to_user | ( | struct rtdm_fd * | fd, |
void __user * | dst, | ||
const void * | src, | ||
size_t | size | ||
) |
Copy specified buffer to user-space memory block.
[in] | fd | RTDM file descriptor as passed to the invoked device operation handler |
[in] | dst | Address of the user-space memory block |
[in] | src | Source buffer address |
[in] | size | Size of the memory block |
Referenced by rtdm_ratelimit().
void rtdm_free | ( | void * | ptr | ) |
Release real-time memory block.
[in] | ptr | Pointer to memory block as returned by rtdm_malloc() |
Referenced by rtdm_ratelimit().
int rtdm_in_rt_context | ( | void | ) |
Test if running in a real-time task.
Referenced by rtdm_ratelimit().
int rtdm_iomap_to_user | ( | struct rtdm_fd * | fd, |
phys_addr_t | src_addr, | ||
size_t | len, | ||
int | prot, | ||
void ** | pptr, | ||
struct vm_operations_struct * | vm_ops, | ||
void * | vm_private_data | ||
) |
Map an I/O memory range into the address space of the user.
[in] | fd | RTDM file descriptor as passed to the invoked device operation handler |
[in] | src_addr | physical I/O address to be mapped |
[in] | len | Length of the memory range |
[in] | prot | Protection flags for the user's memory range, typically either PROT_READ or PROT_READ|PROT_WRITE |
[in,out] | pptr | Address of a pointer containing the desired user address or NULL on entry and the finally assigned address on return |
[in] | vm_ops | vm_operations to be executed on the vm_area of the user memory range or NULL |
[in] | vm_private_data | Private data to be stored in the vm_area, primarily useful for vm_operation handlers |
void* rtdm_malloc | ( | size_t | size | ) |
Allocate memory block.
[in] | size | Requested size of the memory block |
Referenced by a4l_alloc_subd(), and rtdm_ratelimit().
int rtdm_mmap_iomem | ( | struct vm_area_struct * | vma, |
phys_addr_t | pa | ||
) |
Map an I/O memory range to a virtual user area.
This routine is commonly used from a ->mmap() handler of a RTDM driver, for mapping an I/O memory area over the user address space referred to by vma.
[in] | vma | The VMA descriptor to receive the mapping. |
[in] | pa | The physical I/O address to be mapped. |
int rtdm_mmap_kmem | ( | struct vm_area_struct * | vma, |
void * | va | ||
) |
Map a kernel logical memory range to a virtual user area.
This routine is commonly used from a ->mmap() handler of a RTDM driver, for mapping a virtual memory area with a direct physical mapping over the user address space referred to by vma.
[in] | vma | The VMA descriptor to receive the mapping. |
[in] | va | The kernel logical address to be mapped. |
int rtdm_mmap_to_user | ( | struct rtdm_fd * | fd, |
void * | src_addr, | ||
size_t | len, | ||
int | prot, | ||
void ** | pptr, | ||
struct vm_operations_struct * | vm_ops, | ||
void * | vm_private_data | ||
) |
Map a kernel memory range into the address space of the user.
[in] | fd | RTDM file descriptor as passed to the invoked device operation handler |
[in] | src_addr | Kernel virtual address to be mapped |
[in] | len | Length of the memory range |
[in] | prot | Protection flags for the user's memory range, typically either PROT_READ or PROT_READ|PROT_WRITE |
[in,out] | pptr | Address of a pointer containing the desired user address or NULL on entry and the finally assigned address on return |
[in] | vm_ops | vm_operations to be executed on the vm_area of the user memory range or NULL |
[in] | vm_private_data | Private data to be stored in the vm_area, primarily useful for vm_operation handlers |
int rtdm_mmap_vmem | ( | struct vm_area_struct * | vma, |
void * | va | ||
) |
Map a virtual memory range to a virtual user area.
This routine is commonly used from a ->mmap() handler of a RTDM driver, for mapping a purely virtual memory area over the user address space referred to by vma.
[in] | vma | The VMA descriptor to receive the mapping. |
[in] | va | The virtual address to be mapped. |
int rtdm_munmap | ( | void * | ptr, |
size_t | len | ||
) |
Unmap a user memory range.
[in] | ptr | User address or the memory range |
[in] | len | Length of the memory range |
void rtdm_printk | ( | const char * | format, |
... | |||
) |
Real-time safe message printing on kernel console.
[in] | format | Format string (conforming standard printf() ) |
... | Arguments referred by format |
Referenced by rtdm_ratelimit().
void rtdm_printk_ratelimited | ( | const char * | format, |
... | |||
) |
Real-time safe rate-limited message printing on kernel console.
[in] | format | Format string (conforming standard printf() ) |
... | Arguments referred by format |
Referenced by rtdm_ratelimit().
int rtdm_ratelimit | ( | struct rtdm_ratelimit_state * | rs, |
const char * | func | ||
) |
Enforces a rate limit.
This function enforces a rate limit: not more than rs->burst callbacks in every rs->interval.
[in,out] | rs | rtdm_ratelimit_state data |
[in] | func | name of calling function |
References rtdm_clock_read(), rtdm_copy_from_user(), rtdm_copy_to_user(), rtdm_free(), rtdm_in_rt_context(), rtdm_lock_get_irqsave, rtdm_lock_put_irqrestore(), rtdm_malloc(), rtdm_printk(), rtdm_printk_ratelimited(), rtdm_read_user_ok(), rtdm_rt_capable(), rtdm_rw_user_ok(), rtdm_safe_copy_from_user(), rtdm_safe_copy_to_user(), and rtdm_strncpy_from_user().
int rtdm_read_user_ok | ( | struct rtdm_fd * | fd, |
const void __user * | ptr, | ||
size_t | size | ||
) |
Check if read access to user-space memory block is safe.
[in] | fd | RTDM file descriptor as passed to the invoked device operation handler |
[in] | ptr | Address of the user-provided memory block |
[in] | size | Size of the memory block |
Referenced by rtdm_ratelimit().
int rtdm_rt_capable | ( | struct rtdm_fd * | fd | ) |
Test if the caller is capable of running in real-time context.
[in] | fd | RTDM file descriptor as passed to the invoked device operation handler |
Referenced by rtdm_ratelimit().
int rtdm_rw_user_ok | ( | struct rtdm_fd * | fd, |
const void __user * | ptr, | ||
size_t | size | ||
) |
Check if read/write access to user-space memory block is safe.
[in] | fd | RTDM file descriptor as passed to the invoked device operation handler |
[in] | ptr | Address of the user-provided memory block |
[in] | size | Size of the memory block |
Referenced by rtdm_ratelimit().
int rtdm_safe_copy_from_user | ( | struct rtdm_fd * | fd, |
void * | dst, | ||
const void __user * | src, | ||
size_t | size | ||
) |
Check if read access to user-space memory block and copy it to specified buffer.
[in] | fd | RTDM file descriptor as passed to the invoked device operation handler |
[in] | dst | Destination buffer address |
[in] | src | Address of the user-space memory block |
[in] | size | Size of the memory block |
Referenced by rtdm_ratelimit().
int rtdm_safe_copy_to_user | ( | struct rtdm_fd * | fd, |
void __user * | dst, | ||
const void * | src, | ||
size_t | size | ||
) |
Check if read/write access to user-space memory block is safe and copy specified buffer to it.
[in] | fd | RTDM file descriptor as passed to the invoked device operation handler |
[in] | dst | Address of the user-space memory block |
[in] | src | Source buffer address |
[in] | size | Size of the memory block |
Referenced by rtdm_ratelimit().
int rtdm_strncpy_from_user | ( | struct rtdm_fd * | fd, |
char * | dst, | ||
const char __user * | src, | ||
size_t | count | ||
) |
Copy user-space string to specified buffer.
[in] | fd | RTDM file descriptor as passed to the invoked device operation handler |
[in] | dst | Destination buffer address |
[in] | src | Address of the user-space string |
[in] | count | Maximum number of bytes to copy, including the trailing '0' |
Referenced by rtdm_ratelimit().