* Disabling interrupts
@ 2000-03-23 21:50 Pavel Roskin
2000-03-23 21:45 ` Cort Dougan
0 siblings, 1 reply; 5+ messages in thread
From: Pavel Roskin @ 2000-03-23 21:50 UTC (permalink / raw)
To: linuxppc-embedded
Hello!
I need to disable interrupts for a short time from a user program on
RPX/Lite. This needs to be done only once, but it's absolutely essential
that the program is not interrupted during a certain period of time.
Using the __cli() function from the kernel sources in a user-space program
doesn't work. The first instruction "mfmsr %r0" (Get current interrupt
state) causes SIGILL.
Probably I could hack the kernel to make processes with very high priority
uninterruptible.
I'm quite sure that the problem is not new. Anybody has a better idea?
Pavel Roskin
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Disabling interrupts
2000-03-23 21:50 Disabling interrupts Pavel Roskin
@ 2000-03-23 21:45 ` Cort Dougan
2000-03-23 21:58 ` Pavel Roskin
0 siblings, 1 reply; 5+ messages in thread
From: Cort Dougan @ 2000-03-23 21:45 UTC (permalink / raw)
To: Pavel Roskin; +Cc: linuxppc-embedded
Does it have to be a user mode piece of code? You're going to have real
trouble figuring that out if so. Could you put that small portion of code
into a kernel module and just load it from your user program to do what it
needs to?
What is it you're trying to do that shouldn't be interrupted?
} I need to disable interrupts for a short time from a user program on
} RPX/Lite. This needs to be done only once, but it's absolutely essential
} that the program is not interrupted during a certain period of time.
}
} Using the __cli() function from the kernel sources in a user-space program
} doesn't work. The first instruction "mfmsr %r0" (Get current interrupt
} state) causes SIGILL.
}
} Probably I could hack the kernel to make processes with very high priority
} uninterruptible.
}
} I'm quite sure that the problem is not new. Anybody has a better idea?
}
} Pavel Roskin
}
}
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Disabling interrupts
2000-03-23 21:45 ` Cort Dougan
@ 2000-03-23 21:58 ` Pavel Roskin
2000-03-23 22:31 ` Greg Johnson
2000-03-23 22:48 ` Cort Dougan
0 siblings, 2 replies; 5+ messages in thread
From: Pavel Roskin @ 2000-03-23 21:58 UTC (permalink / raw)
To: Cort Dougan; +Cc: linuxppc-embedded
Hello, Cort!
> Does it have to be a user mode piece of code? You're going to have real
> trouble figuring that out if so. Could you put that small portion of code
> into a kernel module and just load it from your user program to do what it
> needs to?
Well, this code needs to read some data continously. Then the data must
be processed and written to a file.
If you expect problems, I could create a new syscall and pass a buffer to
it. Probably this should be Ok. But the buffer can be huge (comparable
with the RAM size), so I would like to avoid copying data. This means that
the kernel needs to write to the userspace buffer directly.
Thank you for the reply.
Regards,
Pavel Roskin
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Disabling interrupts
2000-03-23 21:58 ` Pavel Roskin
@ 2000-03-23 22:31 ` Greg Johnson
2000-03-23 22:48 ` Cort Dougan
1 sibling, 0 replies; 5+ messages in thread
From: Greg Johnson @ 2000-03-23 22:31 UTC (permalink / raw)
To: Linux PPC Mailing List
Why don't you just use DMA? Have a couple of buffers and flip between
them writing the data to disk while the DMA controller handles the
reads. Again, this will mean writing a module.
Greg.
Quoth Pavel Roskin:
> > Does it have to be a user mode piece of code? You're going to have real
> > trouble figuring that out if so. Could you put that small portion of code
> > into a kernel module and just load it from your user program to do what it
> > needs to?
>
> Well, this code needs to read some data continously. Then the data must
> be processed and written to a file.
>
> If you expect problems, I could create a new syscall and pass a buffer to
> it. Probably this should be Ok. But the buffer can be huge (comparable
> with the RAM size), so I would like to avoid copying data. This means that
> the kernel needs to write to the userspace buffer directly.
--
+----------------------------------------------------+
| Do you want to know more? |
| --== Greg Johnson ==-- |
| HW/SW Engineer gjohnson@research.canon.com.au |
| Canon Information Systems Research Australia |
| 1 Thomas Holt Dr, North Ryde, NSW, 2113, Australia |
| "I FLEXed my BISON and it went YACC!" - me. |
+----------------------------------------------------+
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Disabling interrupts
2000-03-23 21:58 ` Pavel Roskin
2000-03-23 22:31 ` Greg Johnson
@ 2000-03-23 22:48 ` Cort Dougan
1 sibling, 0 replies; 5+ messages in thread
From: Cort Dougan @ 2000-03-23 22:48 UTC (permalink / raw)
To: Pavel Roskin; +Cc: linuxppc-embedded
For something like this rtl may be better suited for the task.
} Well, this code needs to read some data continously. Then the data must
} be processed and written to a file.
}
} If you expect problems, I could create a new syscall and pass a buffer to
} it. Probably this should be Ok. But the buffer can be huge (comparable
} with the RAM size), so I would like to avoid copying data. This means that
} the kernel needs to write to the userspace buffer directly.
}
} Thank you for the reply.
}
} Regards,
} Pavel Roskin
}
}
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2000-03-23 22:48 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-03-23 21:50 Disabling interrupts Pavel Roskin
2000-03-23 21:45 ` Cort Dougan
2000-03-23 21:58 ` Pavel Roskin
2000-03-23 22:31 ` Greg Johnson
2000-03-23 22:48 ` Cort Dougan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).