Jan Hudec | 2 Jul 2004 00:23
Picon

Re: Good use of pragma pack

On Thu, Jul 01, 2004 at 17:42:52 +0200, Stephane List wrote:
> Hi,
> 
> I want to write a Linux driver that will be generic for ARM and Intel.
> It will use some structures.  The driver will exchange struct with
> hardware, so data must always have the same alignment.
> 
> On ARM920, I think that we can't have a pointer on an address that is
> not multiple of 4. So what is the good pratice ?

Use the __attribute__ modifier on affected structures and elements.

[snap]
> Why not to define something like a global macro called PRAGMA or ...
> instead of all this kind of hack ?

Macro can't expand to directives. That's one of numerous reasons gcc
prefers __attribute__ -- macros can expand to __attribute__
declarations.

-------------------------------------------------------------------------------
						 Jan 'Bulb' Hudec <bulb <at> ucw.cz>
Jan Hudec | 2 Jul 2004 00:26
Picon

Re: List of Processes

On Thu, Jul 01, 2004 at 11:29:14 -0700, Greg Nate wrote:
> Regarding acquiring a lock:  I realize this may be a stupid question, 
> but how does one go about doing this?  Can you provide a short code
> example?

Actualy a proper question here is:

And WHICH lock?

> Thanks
> 
> -----Original Message-----
> From: kernelnewbies-bounce <at> nl.linux.org
> [mailto:kernelnewbies-bounce <at> nl.linux.org]On Behalf Of Dhiman, Gaurav
> Sent: Thursday, July 01, 2004 9:27 AM
> To: Anupam Kapoor; manish regmi
> Cc: so_usp <at> yahoo.com.br; kernelnewbies <at> nl.linux.org
> Subject: RE: List of Processes
> 
> 
> 
> We need to acquire lock before accessing any common data structure of
> kernel. As the "task_struct" list is the common data structure of kernel
> which is accessed from different places in kernel.
> We need to acquire the lock for this task list before accessing it, so
> that when we are accessing the list no other process context or kernel
> thread should be able to access it.
> 
> Regards,
> Gaurav
(Continue reading)

Jan Hudec | 2 Jul 2004 00:29
Picon

Re: List of Processes

On Thu, Jul 01, 2004 at 14:47:01 -0400, Benoit Lefebvre wrote:
> There are many type of lock and each of them have their own utility. If you 
> can sleep, semaphore is probably what you'll use. Example:
> 
> static DECLARE_MUTEX(m);
> 
> down(&m);
> /* accessing your global structure */
> up(&m);

It is correct, but not as a reply to the question below. The question
below is specificaly targeted at task_structs and you need to aquite the
existing lock. It follows from the nature of task_struct, that the lock
is a spin_lock, not a semaphore.

> On July 1, 2004 02:29 pm, Greg Nate wrote:
> > Regarding acquiring a lock:  I realize this may be a stupid question,
> > but how does one go about doing this?  Can you provide a short code
> > example?
> >
> > Thanks
> >
> > -----Original Message-----
> > From: kernelnewbies-bounce <at> nl.linux.org
> > [mailto:kernelnewbies-bounce <at> nl.linux.org]On Behalf Of Dhiman, Gaurav
> > Sent: Thursday, July 01, 2004 9:27 AM
> > To: Anupam Kapoor; manish regmi
> > Cc: so_usp <at> yahoo.com.br; kernelnewbies <at> nl.linux.org
> > Subject: RE: List of Processes
> >
(Continue reading)

Xia Nai | 30 Jun 2004 12:04
Picon
Favicon

What does the keventd do?

hi,
I saw some articles talking about keventd, but i seems that i cannot find it 
in `ps -ef` result.
Then where is it and what does it do?

regards.

Gmane