Main Page   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields   Globals  

bus_lock.h File Reference

#include "bd_types.h"

Include dependency graph for bus_lock.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Functions

BL_ADDR_INFOgetBusLockInfo (int board_type, unsigned long addr)
void freeBusLockInfo (struct BL_ADDR_INFO *info)
int enableBusLock (struct BL_ADDR_INFO *info)
int disableBusLock (struct BL_ADDR_INFO *info)


Function Documentation

struct BL_ADDR_INFO* getBusLockInfo int    board_type,
unsigned long    addr
 

Definition at line 136 of file bus_lock.c.

Referenced by GLOBMEM::GLOBMEM(), testBusLockRead(), and testBusLockWrite().

00137 {
00138   struct BL_ADDR_INFO *info;
00139   char vme_bus_enable_control_reg;
00140   unsigned long a1;
00141   unsigned long enda1;
00142   unsigned long starta1;
00143 
00144   switch (board_type)
00145     {
00146     case VX_MVME162_BOARD_TYPE:
00147       info = (struct BL_ADDR_INFO *) malloc (sizeof (struct BL_ADDR_INFO));
00148       if (0 == info)
00149         {
00150           return 0;
00151         }
00152       info->addr = addr;
00153       info->board_type = board_type;
00154       return info;
00155 
00156     default:
00157       break;
00158     }
00159   return (0);
00160 }

void freeBusLockInfo struct BL_ADDR_INFO   info
 

Definition at line 163 of file bus_lock.c.

Referenced by testBusLockWrite(), and GLOBMEM::~GLOBMEM().

00164 {
00165   if (0 == info)
00166     {
00167       return;
00168     }
00169   free (info);
00170 }

int enableBusLock struct BL_ADDR_INFO   info
 

Definition at line 173 of file bus_lock.c.

Referenced by GLOBMEM::get_access(), testBusLockRead(), and testBusLockWrite().

00174 {
00175   long requestor_control_register_val;
00176   long DHB = 0;
00177   int board_type;
00178   if (0 == info)
00179     {
00180       return -1;
00181     }
00182 #ifdef VXWORKS
00183   if (bus_lock_use_intlock)
00184     {
00185       intLockKey = intLock ();
00186     }
00187   else
00188     {
00189       taskLock ();
00190     }
00191 #endif
00192   board_type = info->board_type;
00193   switch (board_type)
00194     {
00195     case VX_MVME162_BOARD_TYPE:
00196       while (!DHB)
00197         {
00198           requestor_control_register_val = regReadLong ((long *) 0xFFF40030);
00199           DHB = requestor_control_register_val & (1 << 14);
00200           requestor_control_register_val |= (1 << 13);
00201           regWriteLong (((long *) 0xFFF40030),
00202                         requestor_control_register_val);
00203         }
00204       return 0;
00205 
00206     defualt:
00207       return -1;
00208     }
00209   return -1;
00210 }

int disableBusLock struct BL_ADDR_INFO   info
 

Definition at line 217 of file bus_lock.c.

Referenced by GLOBMEM::release_access(), testBusLockRead(), and testBusLockWrite().

00218 {
00219   long requestor_control_register_val;
00220   long DHB = 0;
00221   long attribute_register;
00222   int board_type;
00223   if (0 == info)
00224     {
00225       return -1;
00226     }
00227   board_type = info->board_type;
00228   switch (board_type)
00229     {
00230     case VX_MVME162_BOARD_TYPE:
00231       requestor_control_register_val = regReadLong ((long *) 0xFFF40030);
00232       requestor_control_register_val &= ~(1 << 13);
00233       regWriteLong (((long *) 0xfff40030), requestor_control_register_val);
00234 #ifdef VXWORKS
00235       if (bus_lock_use_intlock)
00236         {
00237           intUnlock (intLockKey);
00238         }
00239       else
00240         {
00241           taskUnlock ();
00242         }
00243 #endif
00244       return 0;
00245     defualt:
00246       break;
00247     }
00248 #ifdef VXWORKS
00249   if (bus_lock_use_intlock)
00250     {
00251       intUnlock (intLockKey);
00252     }
00253   else
00254     {
00255       taskUnlock ();
00256     }
00257 #endif
00258   return -1;
00259 }


Generated on Sun Dec 2 15:56:57 2001 for rcslib by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001