Linux-Development-Sys Digest #762, Volume #8     Thu, 31 May 01 02:13:09 EDT

Contents:
  struct request_queue_t (Zhiyong Xu)
  lspci & setpci
  Re: BSD signal (Juergen Heinzl)
  Re: Prob. w/ mem mapped ISA card ( more info ) ("Norm Dresner")
  Re: lspci & setpci
  Lilo and BIOS calls ("Hugin")
  pthread_rwlock_wrlock() across processes on LINUX (Sandeep Mirchandani)
  Re: pthread_rwlock_wrlock() across processes on LINUX (David Schwartz)
  /proc/stat disk_io (Pirabhu)
  Newbie question about PPCLinux distribution package (Kirk Lee)

----------------------------------------------------------------------------

From: Zhiyong Xu <[EMAIL PROTECTED]>
Subject: struct request_queue_t
Date: Wed, 30 May 2001 20:17:14 -0400

Hi,
        The struct request_queue_t is:
struct request_queue
{
 /*
  * the queue request freelist, one for reads and one for writes
  */
 struct list_head request_freelist[2];
 struct list_head pending_freelist[2];
 int   pending_free[2];

 /*
  * Together with queue_head for cacheline sharing
  */
 struct list_head queue_head;
 elevator_t  elevator;

 request_fn_proc  * request_fn;
 merge_request_fn * back_merge_fn;
 merge_request_fn * front_merge_fn;
 merge_requests_fn * merge_requests_fn;
 make_request_fn  * make_request_fn;
 plug_device_fn  * plug_device_fn;
 /*
  * The queue owner gets to use this for whatever they like.
  * ll_rw_blk doesn't touch it.
  */
 void   * queuedata;

 /*
  * This is used to remove the plug when tq_disk runs.
  */
 struct tq_struct plug_tq;

 /*
  * Boolean that indicates whether this queue is plugged or not.
  */
 char   plugged;

 /*
  * Boolean that indicates whether current_request is active or
  * not.
  */
 char   head_active;

 /*
  * Is meant to protect the queue in the future instead of
  * io_request_lock
  */
 spinlock_t  queue_lock;

 /*
  * Tasks wait here for free request
  */
 wait_queue_head_t wait_for_request;
};

struct blk_dev_struct {
 /*
  * queue_proc has to be atomic
  */
 request_queue_t  request_queue;
 queue_proc  *queue;
 void   *data;
};

               I just want to know the functions of the first two
members:
                                 struct list_head request_freelist[2];
                                 struct list_head pending_freelist[2];

              does request_freelist includes several free requests after
the block device init? If I try to insert a new disk request to the
request queue, must I get one free request from this list and fill all
the required contents?

            Thanks in advance.



------------------------------

From: <[EMAIL PROTECTED]>
Subject: lspci & setpci
Date: Wed, 30 May 2001 18:06:48 -0700

Gentlemen:
    Where might I find the source to lspci and setpci??
Charles



------------------------------

From: [EMAIL PROTECTED] (Juergen Heinzl)
Subject: Re: BSD signal
Date: Thu, 31 May 2001 01:15:56 GMT

In article <[EMAIL PROTECTED]>, Derek Viljoen wrote:
>Does anyone know where the bsd/signal.h file went?
>
>I'm using RedHat 6.2.  The man page for signal() says that if you want 
>bsd semantics (I'm assuming this means reliable signals...) then include 
><bsd/signal.h> instead of <signal.h>.  But this is not anywhere on my 
>system... (well there is one in bcc ...)
>
>I've already surmised that it's not included in bsd-compat.  Anyone?
[-]
info signal -- "In the GNU C Library we use the BSD version by
default." -- this has been valid for quite some time now. Still
read through the whole signal handling stuff to learn about all
the options. I'd problems ages ago with smail for instance due
to a missing option in its compile time configuration which does
not cope yet with the "not so new" signal semantics.

Just in case,
Juergen

-- 
\ Real name     : Juergen Heinzl                \       no flames      /
 \ EMail Private : [EMAIL PROTECTED] \ send money instead /

------------------------------

From: "Norm Dresner" <[EMAIL PROTECTED]>
Subject: Re: Prob. w/ mem mapped ISA card ( more info )
Date: Thu, 31 May 2001 01:20:10 GMT

The first thing I would do would be to get an MS-DOS bootable disk with a
copy of DEBUG and see if the board's memory is accessible in the simplest
environment.  If it isn't, it's almost certainly broken; if it is, they you
might want to try simplifying some of your Linux system -- perhaps unloading
unneeded modules -- so you can get the system down to its simplest form.

    Norm



Jason M. LaPenta <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> Hi,
> There was a typo in the previous post (sorry), so I'm posting
> again and attaching the source code.
> Also, the isa_read() and isa_write() functions are explained in the
> document /usr/src/linux/Documentation/IO-mapping.txt
> The kernel I'm using is linux-2.4.2 (released by Mandrake). I'm running
> on a Pentium II with an ISA/PCI backplane.
>
> Hello.
>
> I'm trying to figure out why I can't access my custom built ISA card on
> my linux box. It supposedly works fine with some ISA tester under WinNT
> that someone else checked the board out with.
>
> As a fundamental test I searched through the ISA memory 0xA0000 -
> 0xFFFFF to see what was there with both the board in the machine and the
> board out of the machine. In both cases I got the same result. Here's
> the code I ran via IOCTRL. My custom card is a 16bit isa card.
> Am I doing something wrong or is my card not working?
>
> Thx in advance
> Jason
>
>
>     case SCAN_IOC_DEBUG :
>       {
>         printk( "scan : debug information %d\n", sizeof( savew ) );
>
>   switch( DEBUG_SW )
> {
>
> case 1:
> printk( "scan : searching for memory by byte\n" );
>
> for( index = 0xA0000; index < 0xFFFFF; index++ )
>   {
> saveb = isa_readb( index );
> isa_writeb( 0x55 , index );
> testb = isa_readb( index );
> if( testb == 0x55 && good == 0 )
> {
>   printk("0x%x", index);
>   good = index;
> }
> else if( testb != 0x55 && good != 0 && index != (good + 1) )
> {
>   printk(" - 0x%x \n", (index - 1));
>   good = 0;
> }
> else if( testb != 0x55 && good != 0 )
> {
>   printk(", ");
>   good = 0;
> }
>
> isa_writeb( savew, index );
>   }
> break;
>
> case 2:
> printk( "scan : searching for memory by word\n" );
>
> for( index = 0xA0000; index < 0xFFFFF; index++ )
>   {
> savew = isa_readw( index );
> isa_writew( 0x5555, index );
> testw = isa_readw( index );
> if( testw == 0x5555 && good == 0 )
> {
>   printk("0x%x", index);
>   good = index;
> }
> else if( testw != 0x5555 && good != 0 && index != (good + 1) )
> {
>   printk(" - 0x%x \n", (index - 1));
>   good = 0;
> }
> else if( testw != 0x5555 && good != 0 )
> {
>   printk(", ");
>   good = 0;
> }
>
> isa_writew( savew, index );
>   }
> break;
>
> }
>
>   printk( "\n g_num_interrupts = %d \n", g_num_interrupts );
>   break;
>       }


============================================================================
----


>
/**************************************************************************
>
>     Scan Controller ISA Test Module
>
>     Date Started : 5/2001
>     Last Updated : 5/15/2001
>
>     Author : Jason LaPenta 5/2001 (adapted from ptg_module)
>
>     Abstract : Tests the interface to the scan controller card
>                for this test the irq will be 5 and the data
>                io will be memory mapped to 0xE0500 - 0x57E
>
>                only the first 32 double words are used for
>                access.
>
>                the isa bus writes to the lower 16 dwords,
>                and reads from upper 16 dwords
>
> ***************************************************/
>
>
> #ifndef __KERNEL__
> #define __KERNEL__
> #endif
> #ifndef MODULE
> #define MODULE
> #endif
>
> #define DEBUG_SW 2
>
> #include <linux/module.h>
> #include <linux/ioport.h>
> #include <asm/io.h>
> #include <asm/uaccess.h>
>
> #include "scan_module.h"
>
> /***************************
>  * MACROS
>  ***************************/
>
>
> /***************************
>  * GLOBALS
>  ***************************/
> int scan_major     = 0;       /* setting to zero request a free major
number */
> int scan_base_addr = 0xE0500; /* memory mapped base addr for scan
controller */
> int scan_range     = 0x7E;    /* length of memory region from base_addr */
> int scan_irq       = 5;       /* software configured */
>
>  /* debugging var */
> int g_temp = 0;
> int g_num_interrupts = 0;
>
> unsigned int scan_out_buf[16] = {0};
> unsigned int scan_in_buf[16]  = {0};
>
> /***************************
>  * open
>  *
>  * called when user code
>  * opens the device
>  ***************************/
> int scan_open (struct inode *inode, struct file *filp)
> {
>   /*MOD_INC_USE_COUNT; removed for development */
>   printk( KERN_INFO "scan : opened 0.04 \n");
>   return 0;
> }
>
> /***************************
>  * release
>  *
>  * called when user code
>  * closes the device
>  ***************************/
> int scan_release (struct inode *inode, struct file *filp)
>

>   /* MOD_DEC_USE_COUNT;  removed for development */
>   printk( KERN_INFO "scan : released \n");
>   return 0;
> }
>
> /********************************************************
>  * Interrupt Handler
>  *
>  *******************************************************/
> static inline void scan_interrupt(int irq, void *dev_id, struct pt_regs
*regs)
> {
>   int index = 0;
>
>   g_num_interrupts++;
>
>   printk( KERN_INFO "scan : interrupt %d\n", g_num_interrupts );
>
>   for( index = 0; index < sizeof( scan_out_buf ) / 2; index++ )
> {
> ((short *)(scan_in_buf))[ index ]  = readw( scan_base_addr + index );
> }
>
> }
>
> /***************************************
>  * IO Control
>  *
>  * communication link to user code
>  *
>  * note : may want to add in a setdefault
>  *        to change default settings
>  ***************************************/
> static int scan_ioctl( struct inode *inode, struct file *file, unsigned
int cmd,
>   unsigned long arg )
>

>   unsigned long flags;         /* for disabling interrupts */
>   int ret   = 0;
>   int index = 0;
>   unsigned short int testw = 0;
>   unsigned short int savew = 0;
>   unsigned char testb = 0;
>   unsigned char saveb = 0;
>   int good = 0;
>
>   /* extract the type and number bitfields, and don't decode */
>   /* wrong cmds: return EINVAL before verify_area()          */
>   if ( _IOC_TYPE(cmd) != SCAN_IOC_MAGIC )
>     return -EINVAL;
>   if ( _IOC_NR(cmd) > SCAN_IOC_MAXNR )
>     return -EINVAL;
>
>   /* process the command. interrupts are disabled if the */
>   /* pulseArray needs to be modified */
>   switch(cmd)
>

>       /* resets timings to default values */
>     case SCAN_IOC_RESET :
>       {
>         save_flags( flags );
>         cli();
>
>         restore_flags( flags );
>         break;
>       }
>
>       /* sets the requested channel to the desired value */
>     case SCAN_IOC_WRITE :
>       {
>         ret = copy_from_user( &scan_out_buf, (void *)arg,
izeof( scan_out_buf ) );
>   if( ret > 0 )
> {
> printk( KERN_INFO "scan : copy_from_user() error in SCAN_IOC_WRITE \n" );
> return -EFAULT;
> }
>
>   printk( KERN_INFO "scan : SCAN_IOC_WRITE 0x%x\n", scan_out_buf[ 0 ] );
>         /* write buffer to scan_controller */
>         save_flags( flags );
>         cli();
>   isa_writew( scan_out_buf[ 0 ], scan_base_addr );
>
> /*   for( index = 0; index < sizeof( scan_out_buf ) / 2; index++ ) */
> /* { */
> /* isa_writew( ((short *)(scan_out_buf))[ index ], scan_base_addr +
index ); */
> /* } */
>
>         restore_flags( flags );
>         break;
>       }
>
>       /* returns the requested channel */
>     case SCAN_IOC_READ :
>       {
>
>     scan_in_buf[ 0 ]  = isa_readw( scan_base_addr );
>
>   ret = copy_to_user( (void *)arg, &scan_in_buf, sizeof( scan_in_buf ) );
>   if( ret > 0 )
> {
> printk( KERN_INFO "scan : copy_from_user() error in SCAN_IOC_READ \n" );
> return -EFAULT;
> }
>
>   printk( KERN_INFO "scan : SCAN_IOC_READ 0x%x \n",
sa_readw( scan_base_addr ) );
>         break;
>       }
>
>       /* print out debug information */
>     case SCAN_IOC_DEBUG :
>       {
>         printk( "scan : debug information %d\n", sizeof( savew ) );
>
>   switch( DEBUG_SW )
> {
>
> case 1:
> printk( "scan : searching for memory by byte\n" );
>
> for( index = 0xA0000; index < 0xFFFFF; index++ )
>   {
> saveb = isa_readb( index );
> isa_writeb( 0x55 , index );
> testb = isa_readb( index );
> if( testb == 0x55 && good == 0 )
> {
>   printk("0x%x", index);
>   good = index;
> }
> else if( testb != 0x55 && good != 0 && index != (good + 1) )
> {
>   printk(" - 0x%x \n", (index - 1));
>   good = 0;
> }
> else if( testb != 0x55 && good != 0 )
> {
>   printk(", ");
>   good = 0;
> }
>
> isa_writeb( savew, index );
>   }
> break;
>
> case 2:
> printk( "scan : searching for memory by word\n" );
>
> for( index = 0xA0000; index < 0xFFFFF; index++ )
>   {
> savew = isa_readw( index );
> isa_writew( 0x5555, index );
> testw = isa_readw( index );
> if( testw == 0x5555 && good == 0 )
> {
>   printk("0x%x", index);
>   good = index;
> }
> else if( testw != 0x5555 && good != 0 && index != (good + 1) )
> {
>   printk(" - 0x%x \n", (index - 1));
>   good = 0;
> }
> else if( testw != 0x5555 && good != 0 )
> {
>   printk(", ");
>   good = 0;
> }
>
> isa_writew( savew, index );
>   }
> break;
>
> }
>
>   printk( "\n g_num_interrupts = %d \n", g_num_interrupts );
>   break;
>       }
>
>       /* redundant, as cmd was checked against MAXNR */
>     default:
> printk( KERN_INFO "scan : Command Not Found \n" );
>       return -EINVAL;
>     }
>
>   return 0;
> }
>
> /***************************
>  * file operations
>  *  needed by init_module
>  *  register_chrdev
>  ***************************/
> static struct file_operations scan_fops = {
>   ioctl:   scan_ioctl,
>   open:    scan_open,
>   release: scan_release,
> };
>
> /*******************************************************
>  * init_module
>  *
>  * called when the module is installed. It requested the
>  * IO port and the required IRQ and starts the signals
>  * out the timer card.
>  *******************************************************/
>
> int init_module(void)
>

>   int  result = 0;
>
>   printk( KERN_INFO "scan : Starting Module\n");
>   printk( KERN_INFO "scan : memory base addr = 0x%X\n", scan_base_addr );
>   printk( KERN_INFO "scan : irq = %d\n", scan_irq );
>
>   /* request isa board memory location */
>   /*  result = request_mem_region( scan_base_addr, 0x1000, "aic7xxx" )
>   if ( result <= 0 )
> {
> printf("scan : Cannot Memory Map Device");
> return result;
> }
>
>   base_page = scan_base_addr & PAGE_MASK;
>   maddr = ioremap_nocache( base_page, base_offset + 256 );*/
>
>
>   /* register the module under /dev */
>   result = register_chrdev( scan_major, "scan", &scan_fops );
>   if( result < 0 )
>     {
>       printk( KERN_INFO "scan : Failed to register_chrdev\n" );
> /*      release_region( scan_base_addr, scan_range ); */
>       return result;
>     }
>
>   if( scan_major == 0 )
>     scan_major = result; /* dynamic */
>
>   /***************************************
>    * interrupt setup
>    ***************************************/
>   if( scan_irq >= 0 )
>     {
>       result = request_irq(scan_irq, scan_interrupt, SA_INTERRUPT, "scan",
NULL);
>
>       if( result )
>         {
> printk( KERN_INFO "scan: failed to assigned irq %i\n", scan_irq );
> scan_irq = -1;
> unregister_chrdev(scan_major, "scan");
> /* release_region( scan_base_addr, scan_range );*/
> return -EINTR;
>         }
>     }
>
>
>   return 0;
> }
>
> /*********************************
>  * cleanup_module
>  *
>  * called when modules if removed
>  *********************************/
> void cleanup_module(void)
> {
>
>   if( scan_irq >= 0 )
>     {
>       free_irq( scan_irq, NULL );
>     }
>
>   unregister_chrdev( scan_major, "scan" );
>   /*  release_region( scan_base_addr, scan_range ); */
> }
>



------------------------------

From: [EMAIL PROTECTED] ()
Subject: Re: lspci & setpci
Date: Thu, 31 May 2001 02:14:52 -0000

In article <5QgR6.379$[EMAIL PROTECTED]>,  <[EMAIL PROTECTED]> wrote:

>    Where might I find the source to lspci and setpci??

$ rpm -qf `which lspci`
pciutils-2.1.5-2

--
http://www.spinics.net/linux/

------------------------------

From: "Hugin" <[EMAIL PROTECTED]>
Subject: Lilo and BIOS calls
Date: Thu, 31 May 2001 05:08:02 +0200

Hello,

My boot sequence in BIOS is set to: C,SCSI,A
C is assigned 0x80, SCSI is assigned 0x81 and A is 0x00,
I believe. Questions:

1. Lilo is installed on C. How do I configure
Lilo to boot device 0x81?

2. Is there a way to force lilo to install, even though
the lilo.conf has errors?

Thanks!




------------------------------

From: [EMAIL PROTECTED] (Sandeep Mirchandani)
Crossposted-To: comp.unix.programmer
Subject: pthread_rwlock_wrlock() across processes on LINUX
Date: 30 May 2001 22:03:39 -0700

I was wondering if anyone had used pthread_rwlock_wrlock() on LINUX
across processes and seen any problems with it? I am using
PTHREAD_PROCESS_SHARED from a call to pthread_rwlockattr_setpshared()
so as to enable inter-process synchronization.   But the behavior of this
seems flaky.  This seems to work more predictably on solaris though.

Has pthread read write locks been known to work correctly on LINUX across
processes?  Is there a better way of doing the same thing?  Any help would
be appreciated.

Thanks in advance.
-- Sandeep

------------------------------

From: David Schwartz <[EMAIL PROTECTED]>
Crossposted-To: comp.unix.programmer
Subject: Re: pthread_rwlock_wrlock() across processes on LINUX
Date: Wed, 30 May 2001 22:20:16 -0700


Sandeep Mirchandani wrote:
 
> I was wondering if anyone had used pthread_rwlock_wrlock() on LINUX
> across processes and seen any problems with it? I am using
> PTHREAD_PROCESS_SHARED from a call to pthread_rwlockattr_setpshared()
> so as to enable inter-process synchronization.   But the behavior of this
> seems flaky.  This seems to work more predictably on solaris though.
> 
> Has pthread read write locks been known to work correctly on LINUX across
> processes?  Is there a better way of doing the same thing?  Any help would
> be appreciated.

        Are you checking for error returns from setpshared? Process shared
mutexes are brand new on Linux and you may have a build that doesn't
support them.

        DS

------------------------------

From: [EMAIL PROTECTED] (Pirabhu)
Subject: /proc/stat disk_io
Date: 30 May 2001 22:38:02 -0700

hi,
  I am Pirabhu Raman, a graduate student at the University of Florida.
I am working on a load balancing project in which i need the system
data of all processors. I would be glad if somebody could explain the
exact details of /proc/stat file especially the disk_io entry. I
checked the man file but it doesnt provide much help.
Thanks
Pirabhu Raman

------------------------------

From: Kirk Lee <[EMAIL PROTECTED]>
Subject: Newbie question about PPCLinux distribution package
Date: Thu, 31 May 2001 14:19:22 +0800

Dear All:

  Excuse me, if this question is off topic!!

  We want to install a PPCLinux distribution package, like RedHat,
   into a PowerMac G4/Cube set.
  This is the first time we touch PowerMac, so we have no idea about
this.

  Could anyone recommend a nice PPCLinux distribution package???

  Thanks very much!!

kirk


------------------------------


** FOR YOUR REFERENCE **

The service address, to which questions about the list itself and requests
to be added to or deleted from it should be directed, is:

    Internet: [EMAIL PROTECTED]

You can send mail to the entire list by posting to the
comp.os.linux.development.system newsgroup.

Linux may be obtained via one of these FTP sites:
    ftp.funet.fi                                pub/Linux
    tsx-11.mit.edu                              pub/linux
    sunsite.unc.edu                             pub/Linux

End of Linux-Development-System Digest
******************************

Reply via email to