pci32.c File Reference

#include <linux/config.h>
#include <linux/module.h>
#include <linux/version.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/smp_lock.h>
#include <linux/devfs_fs_kernel.h>
#include <linux/pci.h>
#include <linux/types.h>
#include <linux/major.h>
#include <linux/errno.h>
#include <linux/signal.h>
#include <linux/fcntl.h>
#include <linux/interrupt.h>
#include <linux/devpts_fs.h>
#include <linux/file.h>
#include <linux/console.h>
#include <linux/timer.h>
#include <linux/ctype.h>
#include <linux/kd.h>
#include <linux/mm.h>
#include <linux/string.h>
#include <linux/poll.h>
#include <linux/proc_fs.h>
#include <linux/init.h>
#include <asm/io.h>
#include <asm/uaccess.h>
#include <asm/system.h>
#include <asm/bitops.h>
#include <linux/unistd.h>
#include "dbgstuff.h"
#include "dsp.h"
#include "pcsim.h"
#include "mbox.h"

Go to the source code of this file.

Defines

#define PCDSP_VERSION   "V0.2 (C) P.Zahl 1998,1999,2000,2001"
#define __KERNEL_SYSCALLS__
#define driver_name   name
#define TTY_HW_COOK_OUT   14
#define TTY_HW_COOK_IN   15
#define TIMEOUT_TICKS   19
#define JIFFIES_SEM   2
#define MAXWAKEUPS_SEM   10
#define MAXWAKEUPS_WMBOX   10
#define MAXWAKEUPS_RMBOX   10
#define MAKE_MY_TIMEOUT_TMR(tmr)
#define free_dport()   free_dport_range(0)
#define get_dport(W)   get_dport_range(W, 0)
#define SEEK_SET   0
#define SEEK_CUR   1
#define SEEK_END   2

Functions

static DECLARE_WAIT_QUEUE_HEAD (waitq)
int SetSemCrtlAdr (int n, unsigned long arg)
int SetSemCrtlLen (int n, unsigned long arg)
int FindSem (unsigned long adr)
static void timeout (unsigned long ignore)
void mysleep (unsigned long myjiffies)
void pcdsp_interrupt_0 (void)
void pcdsp_interrupt_1 (void)
void free_dport_range (int semno)
int get_dport_range (int wait, int semno)
void pcdsp_halt (void)
void pcdsp_run (void)
void pcdsp_reset (void)
int BoxFull (int wait)
int BoxEmpty (int wait)
int ChkBoxEmpty (int wait)
int WriteBox (unsigned long data, int wait)
int ChkBoxFull (int wait)
int ReadBox (unsigned long *data, int wait)
static loff_t pcdsp_seek (struct file *, loff_t, int)
static ssize_t pcdsp_read (struct file *, char *, size_t, loff_t *)
static ssize_t pcdsp_write (struct file *, const char *, size_t, loff_t *)
static int pcdsp_release (struct inode *, struct file *)
static int pcdsp_ioctl (struct inode *, struct file *, unsigned int, unsigned long)
int pcdsp_initialize (void)
void pcdsp_quit (void)
int init_module (void)
void cleanup_module (void)
static int pcdsp_open (struct inode *inode, struct file *f)

Variables

static devfs_handle_t devfs_handle = NULL
static int pcdsp_error
static int opened
static char * tmp_buf
static int pcdsp_running = FALSE
static unsigned long PutMem32Adr
static int pci_remapp_aktive
static int pcdsp_iobase
static int pcdsp_dpram
static char * pcdsp_dprambaseptr
static unsigned long SemCrtlAdr [PCDSP_SEMANZ]
static unsigned long SemCrtlLen [PCDSP_SEMANZ]
static int wakeups = -1
file_operations pcdsp_fops


Define Documentation

#define __KERNEL_SYSCALLS__
 

Definition at line 85 of file pci32.c.

#define driver_name   name
 

Definition at line 95 of file pci32.c.

 
#define free_dport  )     free_dport_range(0)
 

Definition at line 267 of file pci32.c.

Referenced by pcdsp_ioctl(), pcdsp_read(), and pcdsp_write().

#define get_dport  )     get_dport_range(W, 0)
 

Definition at line 274 of file pci32.c.

Referenced by pcdsp_ioctl().

#define JIFFIES_SEM   2
 

Definition at line 152 of file pci32.c.

#define MAKE_MY_TIMEOUT_TMR tmr   ) 
 

Value:

struct timer_list tmr; \
  init_timer(&tmr); \
  tmr.function = timeout; \
  tmr.data = 0

Definition at line 203 of file pci32.c.

#define MAXWAKEUPS_RMBOX   10
 

Definition at line 155 of file pci32.c.

#define MAXWAKEUPS_SEM   10
 

Definition at line 153 of file pci32.c.

#define MAXWAKEUPS_WMBOX   10
 

Definition at line 154 of file pci32.c.

#define PCDSP_VERSION   "V0.2 (C) P.Zahl 1998,1999,2000,2001"
 

Definition at line 40 of file pci32.c.

#define SEEK_CUR   1
 

Definition at line 492 of file pci32.c.

#define SEEK_END   2
 

Definition at line 493 of file pci32.c.

#define SEEK_SET   0
 

Definition at line 491 of file pci32.c.

#define TIMEOUT_TICKS   19
 

Definition at line 151 of file pci32.c.

#define TTY_HW_COOK_IN   15
 

Definition at line 99 of file pci32.c.

#define TTY_HW_COOK_OUT   14
 

Definition at line 98 of file pci32.c.


Function Documentation

int BoxEmpty int  wait  ) 
 

int BoxFull int  wait  ) 
 

int ChkBoxEmpty int  wait  ) 
 

int ChkBoxFull int  wait  ) 
 

void cleanup_module void   ) 
 

static DECLARE_WAIT_QUEUE_HEAD waitq   )  [static]
 

int FindSem unsigned long  adr  )  [inline]
 

Definition at line 238 of file pci32.c.

References PCDSP_SEMANZ, SemCrtlAdr, and SemCrtlLen.

Referenced by pcdsp_read(), and pcdsp_write().

void free_dport_range int  semno  )  [inline]
 

Definition at line 269 of file pci32.c.

References FREE_SEM.

Referenced by get_dport_range(), and pcdsp_halt().

int get_dport_range int  wait,
int  semno
 

Definition at line 276 of file pci32.c.

References FALSE, free_dport_range(), GET_SEM, JIFFIES_SEM, KDEBUG_L3, MAKE_MY_TIMEOUT_TMR, MAXWAKEUPS_SEM, pcdsp_running, SEM, TIMEOUT_TICKS, TRUE, waitq, and wakeups.

Referenced by pcdsp_read(), and pcdsp_write().

int init_module void   ) 
 

void mysleep unsigned long  myjiffies  ) 
 

void pcdsp_halt void   )  [inline]
 

Definition at line 308 of file pci32.c.

References CLR_IRQ0, CLR_IRQ1, FALSE, free_dport_range(), mysleep(), PCDSP_HALT_X, and pcdsp_running.

Referenced by pcdsp_ioctl().

int pcdsp_initialize void   ) 
 

void pcdsp_interrupt_0 void   )  [inline]
 

Definition at line 253 of file pci32.c.

References CLR_IRQ0, and SET_IRQ0.

void pcdsp_interrupt_1 void   )  [inline]
 

Definition at line 260 of file pci32.c.

References CLR_IRQ1, and SET_IRQ1.

static int pcdsp_ioctl struct inode *  ,
struct file *  ,
unsigned  int,
unsigned  long
[static]
 

Definition at line 564 of file pci32.c.

References ChkBoxEmpty(), ChkBoxFull(), DSP_ADR_H, DSP_ADR_L, DSP_DAT_H, DSP_DAT_L, ENABLE_PC31_DPRAM, FALSE, free_dport, get_dport, KDEBUG, KDEBUG_L3, mbox_location, MODID, PC31_ACK, PC31_ACKED, PC31_CONTROL, PC31_SRQ, PC31_SRQED, PCDSP_ADDRESS, pcdsp_dprambaseptr, PCDSP_GETMODID, pcdsp_halt(), PCDSP_HALT, PCDSP_MBOX_EMPTY, PCDSP_MBOX_FULL, PCDSP_MBOX_READ_NOWAIT, PCDSP_MBOX_READ_WAIT, PCDSP_MBOX_WRITE_NOWAIT, PCDSP_MBOX_WRITE_WAIT, PCDSP_PC31ACK, PCDSP_PC31ACKED, PCDSP_PC31ADDR, PCDSP_PC31CONTROL, PCDSP_PC31DPENABLE, PCDSP_PC31FETCH, PCDSP_PC31SRQ, PCDSP_PC31SRQED, PCDSP_PC31STORE, PCDSP_PUT_SPEED, PCDSP_PUTMEM32, PCDSP_PUTMEM32INC, pcdsp_reset(), PCDSP_RESET, pcdsp_run(), PCDSP_RUN, PCDSP_SEM0LEN, PCDSP_SEM0START, PCDSP_SEM1LEN, PCDSP_SEM1START, PCDSP_SEM2LEN, PCDSP_SEM2START, PCDSP_SEM3LEN, PCDSP_SEM3START, PCDSP_SET_MBOX_LOCATION, PCDSP_TALK_ACK, PCDSP_TALK_RCV, PCDSP_TALK_REQ, PCDSP_TALK_XMT, PutMem32Adr, ReadBox(), SetSemCrtlAdr(), SetSemCrtlLen(), TRUE, and WriteBox().

static int pcdsp_open struct inode *  inode,
struct file *  f
[static]
 

Definition at line 549 of file pci32.c.

References KDEBUG, and opened.

void pcdsp_quit void   )  [inline]
 

static ssize_t pcdsp_read struct file *  ,
char *  ,
size_t  ,
loff_t * 
[static]
 

Definition at line 512 of file pci32.c.

References FindSem(), free_dport, get_dport_range(), KDEBUG_L2, pcdsp_dprambaseptr, tmp_buf, and TRUE.

static int pcdsp_release struct inode *  ,
struct file * 
[static]
 

Definition at line 557 of file pci32.c.

References KDEBUG, and opened.

void pcdsp_reset void   )  [inline]
 

Definition at line 328 of file pci32.c.

References mysleep(), PCDSP_HALT_X, PCDSP_RUN_X, pcdsp_running, and TRUE.

Referenced by pcdsp_ioctl().

void pcdsp_run void   )  [inline]
 

Definition at line 321 of file pci32.c.

References mysleep(), PCDSP_RUN_X, pcdsp_running, and TRUE.

Referenced by pcdsp_ioctl().

static loff_t pcdsp_seek struct file *  ,
loff_t  ,
int 
[static]
 

Definition at line 496 of file pci32.c.

References KDEBUG, PCDSP_DPRAM_SIZE, SEEK_CUR, SEEK_END, and SEEK_SET.

static ssize_t pcdsp_write struct file *  ,
const char *  ,
size_t  ,
loff_t * 
[static]
 

Definition at line 531 of file pci32.c.

References FindSem(), free_dport, get_dport_range(), KDEBUG_L2, pcdsp_dprambaseptr, tmp_buf, and TRUE.

int ReadBox unsigned long *  data,
int  wait
 

int SetSemCrtlAdr int  n,
unsigned long  arg
 

Definition at line 221 of file pci32.c.

References PCDSP_SEMANZ, SemCrtlAdr, and SemCrtlLen.

Referenced by pcdsp_ioctl().

int SetSemCrtlLen int  n,
unsigned long  arg
 

Definition at line 230 of file pci32.c.

References PCDSP_DPRAM_SIZE, PCDSP_SEMANZ, SemCrtlAdr, and SemCrtlLen.

Referenced by pcdsp_ioctl().

static void timeout unsigned long  ignore  )  [static]
 

Definition at line 198 of file pci32.c.

References KDEBUG_L3, waitq, and wakeups.

int WriteBox unsigned long  data,
int  wait
 


Variable Documentation

devfs_handle_t devfs_handle = NULL [static]
 

Definition at line 121 of file pci32.c.

int opened [static]
 

Definition at line 125 of file pci32.c.

int pcdsp_dpram [static]
 

Definition at line 135 of file pci32.c.

char* pcdsp_dprambaseptr [static]
 

Definition at line 136 of file pci32.c.

int pcdsp_error [static]
 

Definition at line 123 of file pci32.c.

struct file_operations pcdsp_fops
 

Initial value:

 {
  llseek:    pcdsp_seek,   
  read:    pcdsp_read,   
  write:   pcdsp_write,  
  
  
  ioctl:   pcdsp_ioctl,  
  
  open:    pcdsp_open,   
  
  release: pcdsp_release,
  
  
  
  
  
}

Definition at line 848 of file pci32.c.

int pcdsp_iobase [static]
 

Definition at line 134 of file pci32.c.

int pcdsp_running = FALSE [static]
 

Definition at line 128 of file pci32.c.

Referenced by get_dport_range(), pcdsp_halt(), pcdsp_reset(), and pcdsp_run().

int pci_remapp_aktive [static]
 

Definition at line 133 of file pci32.c.

unsigned long PutMem32Adr [static]
 

Definition at line 130 of file pci32.c.

Referenced by pcdsp_ioctl().

unsigned long SemCrtlAdr[PCDSP_SEMANZ] [static]
 

Definition at line 139 of file pci32.c.

Referenced by FindSem(), SetSemCrtlAdr(), and SetSemCrtlLen().

unsigned long SemCrtlLen[PCDSP_SEMANZ] [static]
 

Definition at line 139 of file pci32.c.

Referenced by FindSem(), SetSemCrtlAdr(), and SetSemCrtlLen().

char* tmp_buf [static]
 

Definition at line 127 of file pci32.c.

Referenced by pcdsp_read(), and pcdsp_write().

int wakeups = -1 [static]
 

Definition at line 144 of file pci32.c.


Generated on Sat Apr 1 09:04:46 2006 for GXSM by  doxygen 1.4.6