All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai] RT_HEAP physical address
@ 2014-05-16 18:17 Makarand Pradhan
  2014-05-16 18:21 ` Gilles Chanteperdrix
  2014-05-29 15:46 ` Gilles Chanteperdrix
  0 siblings, 2 replies; 5+ messages in thread
From: Makarand Pradhan @ 2014-05-16 18:17 UTC (permalink / raw)
  To: xenomai

Hi All,

I am running on MPC8360(powerpc) linux 3.0, xenomai 2.6.3.

I am trying to get the physical address of a heap using rt_heap_inquire. 
All the same, I'm getting a null pointer. Can you pl point out if I'm 
doing something wrong?

Code:

#include <rtdk.h>
#include <stdio.h>
#include <sys/mman.h>
#include <native/heap.h>
#include <native/task.h>

void task1_func(void *arg)
{
         RT_HEAP heap;
         RT_HEAP_INFO info;

         rt_printf("Running\n");

         int rc = rt_heap_create(&heap, "TEST", 1024, H_DMA);

         rt_printf("Heap allocated: heap: %p, rc: %i\n", heap.mapbase, rc);

         if (rt_heap_inquire(&heap, &info) == 0)
         {
                 rt_printf("task1: heap: %p, phy: %x\n", heap.mapbase, 
info.phys_addr);
         }
         else
         {
                 rt_printf("Could not inquire\n");
         }

}

int main(int argc, char **argv)
{
         RT_TASK task1;

         mlockall(MCL_CURRENT|MCL_FUTURE);

         /* Perform auto-init of rt_print buffers if the task doesn't do 
so */
         rt_print_auto_init(1);

         /* Initialise the rt_print buffer for this task explicitly */
         rt_print_init(4096, "Task 1");

         rt_task_spawn(&task1, "T1", 0, 11, 0, task1_func, NULL);

         return 0;
}

O/P:
root@ruggedcom:~# ./a.out
Running
Heap allocated: heap: 0x48073000, rc: 0
task1: heap: 0x48073000, phy: 0
root@ruggedcom:~#

Thanks and Rgds,
Makarand.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Xenomai] RT_HEAP physical address
  2014-05-16 18:17 [Xenomai] RT_HEAP physical address Makarand Pradhan
@ 2014-05-16 18:21 ` Gilles Chanteperdrix
  2014-05-16 18:29   ` Makarand Pradhan
  2014-05-29 15:46 ` Gilles Chanteperdrix
  1 sibling, 1 reply; 5+ messages in thread
From: Gilles Chanteperdrix @ 2014-05-16 18:21 UTC (permalink / raw)
  To: Makarand Pradhan, xenomai

On 05/16/2014 08:17 PM, Makarand Pradhan wrote:
> Hi All,
>
> I am running on MPC8360(powerpc) linux 3.0, xenomai 2.6.3.
>
> I am trying to get the physical address of a heap using rt_heap_inquire.
> All the same, I'm getting a null pointer. Can you pl point out if I'm
> doing something wrong?
>
> Code:
>
> #include <rtdk.h>
> #include <stdio.h>
> #include <sys/mman.h>
> #include <native/heap.h>
> #include <native/task.h>
>
> void task1_func(void *arg)
> {
>           RT_HEAP heap;
>           RT_HEAP_INFO info;
>
>           rt_printf("Running\n");
>
>           int rc = rt_heap_create(&heap, "TEST", 1024, H_DMA);
>
>           rt_printf("Heap allocated: heap: %p, rc: %i\n", heap.mapbase, rc);
>
>           if (rt_heap_inquire(&heap, &info) == 0)
>           {
>                   rt_printf("task1: heap: %p, phy: %x\n", heap.mapbase,
> info.phys_addr);

What happens if you try phy: %Lx with (unsigned long long)info.phys_addr ?


-- 
					    Gilles.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Xenomai] RT_HEAP physical address
  2014-05-16 18:21 ` Gilles Chanteperdrix
@ 2014-05-16 18:29   ` Makarand Pradhan
  0 siblings, 0 replies; 5+ messages in thread
From: Makarand Pradhan @ 2014-05-16 18:29 UTC (permalink / raw)
  To: Gilles Chanteperdrix; +Cc: xenomai

Still null, after using %Lx

                 rt_printf("rc_xeno_heap_create: heap: %p, Lx: phy: 
%Lx\n", heap.mapbase, (unsigned long long)info.phys_addr);

root@ruggedcom:~# ./a.out
Running
Heap allocated: heap: 0x48073000, rc: 0
rc_xeno_heap_create: heap: 0x48073000, Lx: phy: 0





On 16/05/14 02:21 PM, Gilles Chanteperdrix wrote:
> On 05/16/2014 08:17 PM, Makarand Pradhan wrote:
>> Hi All,
>>
>> I am running on MPC8360(powerpc) linux 3.0, xenomai 2.6.3.
>>
>> I am trying to get the physical address of a heap using rt_heap_inquire.
>> All the same, I'm getting a null pointer. Can you pl point out if I'm
>> doing something wrong?
>>
>> Code:
>>
>> #include <rtdk.h>
>> #include <stdio.h>
>> #include <sys/mman.h>
>> #include <native/heap.h>
>> #include <native/task.h>
>>
>> void task1_func(void *arg)
>> {
>>            RT_HEAP heap;
>>            RT_HEAP_INFO info;
>>
>>            rt_printf("Running\n");
>>
>>            int rc = rt_heap_create(&heap, "TEST", 1024, H_DMA);
>>
>>            rt_printf("Heap allocated: heap: %p, rc: %i\n", heap.mapbase, rc);
>>
>>            if (rt_heap_inquire(&heap, &info) == 0)
>>            {
>>                    rt_printf("task1: heap: %p, phy: %x\n", heap.mapbase,
>> info.phys_addr);
> What happens if you try phy: %Lx with (unsigned long long)info.phys_addr ?
>
>


-- 
Makarand Pradhan
Software Engineer Ruggedcom
Siemens Canada Limited
Industry Sector
300 Applewood Crescent,
Vaughan, ON, L4K 5C7
Tel: 905 482 4572
e-mail:  makarand.pradhan@siemens.com
www.ruggedcom.com

This e-mail is intended only for the named recipient(s) and may contain information that is privileged, confidential and/or exempt from disclosure under applicable law. No waiver of privilege, confidence or otherwise is intended by virtue of communication via the internet. Any unauthorized use, dissemination or copying is strictly prohibited. If you have received this e-mail in error, or are not named as a recipient, please immediately notify the sender and destroy all copies of this e-mail. Please be aware that internet communications are subject to the risk of data corruption and other transmission errors. For information of extraordinary sensitivity, we do not recommend communication by e-mail with us.
By submitting personal information to Siemens Canada Limited or its affiliates, service providers and agents, you consent to our collection, use and disclosure of such information for the purposes described in our Privacy Code available at www.siemens.ca. To the extent you provided us with personal information of another individual, you represent that you have the authority and/or have obtained all necessary consents from such individual to enable us to collect, use and disclose such information for the purposes described in our Privacy Code. To obtain further information, please contact our Chief Privacy Officer at privacy.panel.ca@siemens.com.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Xenomai] RT_HEAP physical address
  2014-05-16 18:17 [Xenomai] RT_HEAP physical address Makarand Pradhan
  2014-05-16 18:21 ` Gilles Chanteperdrix
@ 2014-05-29 15:46 ` Gilles Chanteperdrix
  2014-05-29 19:55   ` Makarand Pradhan
  1 sibling, 1 reply; 5+ messages in thread
From: Gilles Chanteperdrix @ 2014-05-29 15:46 UTC (permalink / raw)
  To: Makarand Pradhan, xenomai

On 05/16/2014 08:17 PM, Makarand Pradhan wrote:
> Hi All,
> 
> I am running on MPC8360(powerpc) linux 3.0, xenomai 2.6.3.
> 
> I am trying to get the physical address of a heap using rt_heap_inquire. 
> All the same, I'm getting a null pointer. Can you pl point out if I'm 
> doing something wrong?
> 
> Code:
> 
> #include <rtdk.h>
> #include <stdio.h>
> #include <sys/mman.h>
> #include <native/heap.h>
> #include <native/task.h>
> 
> void task1_func(void *arg)
> {
>          RT_HEAP heap;
>          RT_HEAP_INFO info;
> 
>          rt_printf("Running\n");
> 
>          int rc = rt_heap_create(&heap, "TEST", 1024, H_DMA);

H_SINGLE is missing here.

-- 
                                                                Gilles.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Xenomai] RT_HEAP physical address
  2014-05-29 15:46 ` Gilles Chanteperdrix
@ 2014-05-29 19:55   ` Makarand Pradhan
  0 siblings, 0 replies; 5+ messages in thread
From: Makarand Pradhan @ 2014-05-29 19:55 UTC (permalink / raw)
  To: Gilles Chanteperdrix; +Cc: xenomai

Tx. Gilles.

On 29/05/14 11:46 AM, Gilles Chanteperdrix wrote:
> On 05/16/2014 08:17 PM, Makarand Pradhan wrote:
>> Hi All,
>>
>> I am running on MPC8360(powerpc) linux 3.0, xenomai 2.6.3.
>>
>> I am trying to get the physical address of a heap using rt_heap_inquire.
>> All the same, I'm getting a null pointer. Can you pl point out if I'm
>> doing something wrong?
>>
>> Code:
>>
>> #include <rtdk.h>
>> #include <stdio.h>
>> #include <sys/mman.h>
>> #include <native/heap.h>
>> #include <native/task.h>
>>
>> void task1_func(void *arg)
>> {
>>           RT_HEAP heap;
>>           RT_HEAP_INFO info;
>>
>>           rt_printf("Running\n");
>>
>>           int rc = rt_heap_create(&heap, "TEST", 1024, H_DMA);
> H_SINGLE is missing here.
>


-- 
Makarand Pradhan
Software Engineer Ruggedcom
Siemens Canada Limited
Industry Sector
300 Applewood Crescent,
Vaughan, ON, L4K 5C7
Tel: 905 482 4572
e-mail:  makarand.pradhan@siemens.com
www.ruggedcom.com

This e-mail is intended only for the named recipient(s) and may contain information that is privileged, confidential and/or exempt from disclosure under applicable law. No waiver of privilege, confidence or otherwise is intended by virtue of communication via the internet. Any unauthorized use, dissemination or copying is strictly prohibited. If you have received this e-mail in error, or are not named as a recipient, please immediately notify the sender and destroy all copies of this e-mail. Please be aware that internet communications are subject to the risk of data corruption and other transmission errors. For information of extraordinary sensitivity, we do not recommend communication by e-mail with us.
By submitting personal information to Siemens Canada Limited or its affiliates, service providers and agents, you consent to our collection, use and disclosure of such information for the purposes described in our Privacy Code available at www.siemens.ca. To the extent you provided us with personal information of another individual, you represent that you have the authority and/or have obtained all necessary consents from such individual to enable us to collect, use and disclose such information for the purposes described in our Privacy Code. To obtain further information, please contact our Chief Privacy Officer at privacy.panel.ca@siemens.com.



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-05-29 19:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-16 18:17 [Xenomai] RT_HEAP physical address Makarand Pradhan
2014-05-16 18:21 ` Gilles Chanteperdrix
2014-05-16 18:29   ` Makarand Pradhan
2014-05-29 15:46 ` Gilles Chanteperdrix
2014-05-29 19:55   ` Makarand Pradhan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.