Logo Search packages:      
Sourcecode: linux-fsl-imx51 version File versions  Download package

linux_port.h File Reference


Detailed Description

OS_PORT ported to Linux (2.6.9+ for now)

Definition in file linux_port.h.

#include <linux/version.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/fs.h>
#include <linux/random.h>
#include <linux/spinlock.h>
#include <linux/interrupt.h>
#include <linux/delay.h>
#include <linux/slab.h>
#include <stdarg.h>
#include <linux/platform_device.h>
#include <linux/dmapool.h>
#include <linux/dma-mapping.h>
#include <linux/clk.h>
#include <asm/uaccess.h>
#include <asm/io.h>
#include <asm/irq.h>
#include <asm/cacheflush.h>
#include <mach/hardware.h>

Go to the source code of this file.

Classes

struct  os_driver_reg_t

Defines

#define __NO_VERSION__
#define FALSE   0
#define IRQ_HANDLED
#define IRQ_RETVAL(x)
#define irqreturn_t   void
#define os_alloc_coherent(amount, dma_addrp, flags)   (void*)dma_alloc_coherent(NULL, amount, dma_addrp, flags)
#define os_alloc_memory(amount, flags)   (void*)kmalloc(amount, flags)
#define os_cache_clean_range(start, len)
#define os_cache_flush_range(start, len)
#define os_cache_inv_range(start, len)
#define os_copy_from_user(to, from, size)   ((copy_from_user(to, from, size) == 0) ? 0 : OS_ERROR_BAD_ADDRESS_S)
#define os_copy_to_user(to, from, size)   ((copy_to_user(to, from, size) == 0) ? 0 : OS_ERROR_BAD_ADDRESS_S)
#define os_create_task(function_name)   OS_ERROR_OK_S
#define os_deregister_interrupt(interrupt_id)   free_irq(interrupt_id, NULL)
#define OS_DEV_CLOSE(function_name)   static int function_name(struct inode* inode_p_, struct file* file_p_)
#define OS_DEV_CLOSE_DCL(function_name)   OS_DEV_CLOSE(function_name);
#define OS_DEV_CLOSE_REF(function_name)   function_name
#define os_dev_close_return(code)
#define os_dev_get_count()   ((unsigned)count_bytes_)
#define os_dev_get_file_flags()   (file_p_->f_flags)
#define os_dev_get_ioctl_arg()   (data_)
#define os_dev_get_ioctl_op()   (cmd_)
#define os_dev_get_irq()   N1_
#define os_dev_get_major()   (imajor(inode_p_))
#define os_dev_get_minor()   (iminor(inode_p_))
#define os_dev_get_user_buffer()   ((void*)user_buffer_)
#define os_dev_get_user_private()   ((void*)file_p_->private_data)
#define OS_DEV_INIT(function_name)
#define OS_DEV_INIT_DCL(function_name)   static int __init function_name (void);
#define OS_DEV_INIT_REF(function_name)   function_name
#define os_dev_init_return(code)   return code
#define OS_DEV_IOCTL(function_name)
#define OS_DEV_IOCTL_DCL(function_name)   OS_DEV_IOCTL(function_name);
#define OS_DEV_IOCTL_REF(function_name)   function_name
#define os_dev_ioctl_return(code)
#define os_dev_is_flag_nonblock()   (file_p_->f_flags & (O_NONBLOCK | O_NDELAY))
#define os_dev_is_flag_read()   (file_p_->f_mode & FMODE_READ)
#define os_dev_is_flag_write()   (file_p_->f_mode & FMODE_WRITE)
#define OS_DEV_ISR(function_name)   static irqreturn_t function_name(int N1_, void* N2_)
#define OS_DEV_ISR_DCL(function_name)   OS_DEV_ISR(function_name);
#define OS_DEV_ISR_REF(function_name)   function_name
#define os_dev_isr_return(code)
#define OS_DEV_MMAP(function_name)   int function_name(struct file* file_p_, struct vm_area_struct* vma_)
#define OS_DEV_MMAP_DCL(function_name)   OS_DEV_MMAP(function_name);
#define OS_DEV_MMAP_REF(function_name)   function_name
#define OS_DEV_OPEN(function_name)   static int function_name(struct inode* inode_p_, struct file* file_p_)
#define OS_DEV_OPEN_DCL(function_name)   OS_DEV_OPEN(function_name);
#define OS_DEV_OPEN_REF(function_name)   function_name
#define os_dev_open_return(code)
#define OS_DEV_READ_DCL(function_name)   OS_DEV_READ(function_name);
#define OS_DEV_READ_REF(function_name)   function_name
#define os_dev_read_return(code)
#define os_dev_schedule_task(function_name)   tasklet_schedule(&(function_name ## let))
#define os_dev_set_user_private(struct_p)   file_p_->private_data = (void*)(struct_p)
#define OS_DEV_SHUTDOWN(function_name)
#define OS_DEV_SHUTDOWN_DCL(function_name)   static void function_name(void);
#define OS_DEV_SHUTDOWN_REF(function_name)   function_name
#define os_dev_shutdown_return(code)   return
#define os_dev_stop_task(function_name)
#define OS_DEV_TASK(function_name)   static void function_name(unsigned long data_)
#define os_dev_task_begin()
#define OS_DEV_TASK_DCL(function_name)
#define OS_DEV_TASK_REF(function_name)   (function_name ## let)
#define os_dev_task_return(code)
#define OS_DEV_WRITE(function_name)
#define OS_DEV_WRITE_DCL(function_name)   OS_DEV_WRITE(function_name);
#define OS_DEV_WRITE_REF(function_name)   function_name
#define os_dev_write_return(code)
#define os_driver_add_registration(handle, name, function)   do {handle.fops.name = (void*)(function); } while (0)
#define os_driver_complete_registration(handle, major, driver_name)   os_drv_do_reg(&handle, major, driver_name)
#define os_driver_get_major(handle)   (handle.reg_complete ? MAJOR(handle.dev) : -1)
#define os_driver_init_registration(handle)   os_drv_do_init_reg(&handle)
#define os_driver_register_power_suspend(handle, function)   handle.dd.suspend = function
#define os_driver_register_resume(handle, function)   handle.dd.resume = function
#define os_driver_remove_registration(handle)   os_drv_rmv_reg(&handle)
#define os_flush_cache_all()   v6_flush_kern_cache_all_L2()
#define os_free_coherent(size, virt_addr, dma_addr)   dma_free_coherent(NULL, size, virt_addr, dma_addr
#define os_free_memory(location)   kfree(location)
#define os_get_process_handle()   current
#define os_get_random_bytes(buf, count)   get_random_bytes(buf, count)
#define os_lock(lock_handle)   spin_lock(lock_handle)
#define os_lock_deallocate(lock_handle)   kfree(lock_handle)
#define os_lock_save_context(lock_handle, context)   spin_lock_irqsave(lock_handle, context)
#define os_map_device(start, range_bytes)   (void*)ioremap_nocache((start), range_bytes)
#define os_mdelay   mdelay
#define os_mmap_memory_ctx()   (vma_)
#define os_mmap_memory_size()   (vma_->vm_end - vma_->vm_start)
#define os_mmap_user_base()   (vma_->vm_start)
#define os_pa   __pa
#define os_printk(...)   (void) printk(__VA_ARGS__)
#define os_read16(register_address)   __raw_readw(register_address)
#define os_read32(register_address)   __raw_readl((uint32_t*)(register_address))
#define os_read64(register_address)   ERROR_UNIMPLEMENTED
#define os_read8(register_address)   __raw_readb(register_address)
#define os_register_a_device(device_information)   platform_device_register(device_information)
#define os_register_interrupt(driver_name, interrupt_id, function)   request_irq(interrupt_id, function, 0, driver_name, NULL)
#define os_register_to_driver(driver_information)   driver_register(driver_information)
#define os_send_signal(proc, sig)   send_sig(sig, proc, 0);
#define os_sleep(object, condition, atomic)
#define os_unlock(lock_handle)   spin_unlock(lock_handle)
#define os_unlock_restore_context(lock_handle, context)   spin_unlock_irqrestore(lock_handle, context)
#define os_unmap_device(start, range_bytes)   iounmap((void*)(start))
#define os_unregister_a_device(device_information)   platform_device_unregister(device_information)
#define os_unregister_from_driver(driver_information)   driver_unregister(driver_information)
#define os_va   __va
#define OS_WAIT_OBJECT(name)   DECLARE_WAIT_QUEUE_HEAD(name##_qh)
#define os_wake_sleepers(object)   wake_up_interruptible(&(object##_qh));
#define os_write16(register_address, value)   __raw_writew(value, (uint32_t*)(register_address))
#define os_write32(register_address, value)   __raw_writel(value, register_address)
#define os_write64(register_address, value)   ERROR_UNIMPLEMENTED
#define os_write8(register_address, value)   __raw_writeb(value, register_address)
#define PORTABLE_OS_VERSION   101
#define TRUE   1
#define OS_FN_CLOSE   release
#define OS_FN_IOCTL   ioctl
#define OS_FN_MMAP   mmap
#define OS_FN_OPEN   open
#define OS_FN_READ   read
#define OS_FN_WRITE   write

Typedefs

typedef int(* os_interrupt_handler_t )(int, void *)
typedef int os_interrupt_id_t
typedef unsigned long os_lock_context_t
typedef spinlock_t * os_lock_t
typedef struct task_struct * os_process_handle_t

Enumerations

enum  os_error_code {
  OS_ERROR_OK_S = 0, OS_ERROR_FAIL_S = -EIO, OS_ERROR_NO_MEMORY_S = -ENOMEM, OS_ERROR_BAD_ADDRESS_S = -EFAULT,
  OS_ERROR_BAD_ARG_S = -EINVAL
}

Functions

static int os_drv_do_init_reg (os_driver_reg_t *handle)
static int os_drv_do_reg (os_driver_reg_t *handle, unsigned major, char *driver_name)
static int os_drv_rmv_reg (os_driver_reg_t *handle)
static os_lock_t os_lock_alloc_init (void)
void v6_flush_kern_cache_all_L2 (void)


Generated by  Doxygen 1.6.0   Back to index