On Sat, Jul 30, 2016 at 7:44 AM, ZeekHuge <[email protected]> wrote:

>
> You can probably use it as an attribute.
> something like this :
>
>
> __far __attribute__((cregister("PRU_SHAREDMEM", near))) volatile uint32_t
> variable_1;
> __far __attribute__((cregister("PRU_SHAREDMEM", near))) volatile uint32_t
> variable_2;
>
>
> //Somewhere In code
>
> variable_1 = data;
> variable_2 = _2_data;
>
>
> So basically, the compiler allocates memory to these variables somewhere
> in the shared mem and you have no control over where it gets allocated. So
> if you wish to share data between the two PRUs, you can probably
> define the variable in a common file and then use this exact same variable
> in the two source codes.
>
> I haven't actually tried this way. Please let us know if this works.
>

I do not think so . . .because somehow, you have to "tap into" the kernels
virtual memory pool. *Or* if the peripheral in question is not already
represented in virtual memory. You need to use something like ioremap().
Read the first answer here:
http://unix.stackexchange.com/questions/239205/whats-the-difference-between-ioremap-and-file-operation-mmap

A few search hit's I found yesterday on the subject mention reading LDD3
chapters 9, and 15 . . . but I saw no examples so did not mention anything.
Plus, I have no personal hands on . . . but I do find it an interesting
question.

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/CALHSORqFPgeAnZrrCw8T%2BEpeMQJtMV_ERS6876w8ZOnF%2BY_DxA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to