From: Makarand Pradhan <makarandpradhan@ruggedcom.com>
To: "xenomai@xenomai.org" <xenomai@xenomai.org>
Subject: [Xenomai] RT_HEAP physical address
Date: Fri, 16 May 2014 14:17:56 -0400 [thread overview]
Message-ID: <53765654.8010509@ruggedcom.com> (raw)
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.
next reply other threads:[~2014-05-16 18:17 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-16 18:17 Makarand Pradhan [this message]
2014-05-16 18:21 ` [Xenomai] RT_HEAP physical address Gilles Chanteperdrix
2014-05-16 18:29 ` Makarand Pradhan
2014-05-29 15:46 ` Gilles Chanteperdrix
2014-05-29 19:55 ` Makarand Pradhan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=53765654.8010509@ruggedcom.com \
--to=makarandpradhan@ruggedcom.com \
--cc=xenomai@xenomai.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.