Unable to write to SIMASK

Ricardo Scop scop at digitel.com.br
Thu Feb 21 08:27:52 EST 2002


On Wednesday 20 February 2002 21:53, gopi at india.tejasnetworks.com wrote:
> hi..
>
>   We have an MPC860T based custom board.
>
>   We wanted to control interrupt on one of the irqs by writing to SIMASK
> register using a small driver with two ioctls which will will do
> the following:
>
>   // WRITE_MASK_IOCTL
>   simask_write_ioctl(mask) {
>     cli();
better use save_flags(flags); cli();

>     (volatile unsigned int *)(IMMR + simask_offset) = mask;
You're missing a * operator here (don't know about your actual source code,
though...)

>     written_value = *(volatile unsigned int *)(IMMR + simask_offset);
>     sti();
better use restore_flags(flags)... and flags must be defined as an unsigned
long.

>     printk (written_value);
>   }
>
>   // READ_MASK_IOCTL
>   simask_read_ioctl() {
>     cli(); // Not really needed..
>     read_value = *(volatile unsigned int *)(IMMR + simask_offset);
>     sti();
>     printk (read_value);
>   }
>
>
<snip>


HTH,

R. Scop


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/





More information about the Linuxppc-embedded mailing list