Hi
On going through the documenation provided in vxWorks for shared data region it says that it is possible to map Any type of memory can be shared, such as RAM, memory-mapped I/O, flash, or VME. We are trying to do some experiments since we have to map memory on PCI bus. Here is the sample code for the same.

#include

#include
#include
#include
#include
#include
#include
#include

/*
* Description:
*/
void createSdMem()
{
char buf[1024];
SD_ID sd;
char *Buff;
char *addr= (char *)valloc(1024);
off_t64 aa = (off_t64)addr;
printf("Errorno %d \n",errno );
memset(buf, 0, 1024);
if ((sd = sdOpen("/Mysd", 0, OM_CREATE | OM_EXCL, 1024, aa,
(MMU_ATTR)(SD_ATTR_RW | SD_CACHE_OFF) ,
(void **)&Buff))
== NULL)
{
printf("Errorno %d \n",errno );
}

memcpy(Buff,"Hi",2);

}

Some points to note
1) We are specifying the address of physical memory area in the call sdOpen(see the 5th parameter aa. Is this write way of doing this ?) since we have to physically map the PCI based memory in our system.
2) This is the piece of code which I run through the DKM to create shared data region.
3) There is one more sdOpen call in RTP since my aim is to share data between RTP and DKM.
On printing the error no I get this message "S_sdLib_PHYS_PAGES_NOT_AVAILABLE".

I have tried this first running of vxSim and then on P4 target.
How do I get rid of this message. Page size is 4KB.
Regards
tattusingh