Dear all,
I am working on a ARM9 platform that has WINCE 5 ported onit. I want
to use some cached memory space in user application. The normal malloc
is allocating the address at 0x004ea14c, but when i saw the virtual
address space mapping in OEMAddressTable, it shows that cached memory
space lies between 0x80000000-0x9FFFFFFF. Hence I am trying to use
virtual alloc to allocate some memory from that address space, I am
not able to allocate at that location. When I verify the address
returned by virtualalloc, it remains the same as returned by normal
malloc.
I am not able to understand the difference in here between
1) malloc and virtual alloc, and also
2) cached memory space reserved in kernel space and userspace
memorymap where does it points to.

Or am I missing some thing in here. I am using the virtual alloc as
follows.

unsigned int* tempPtr;
tempPtr = (unsigned int*)VirtualAlloc((LPVOID) 0x80000000, 2468,
MEM_RESERVE, PAGE_READWRITE);

I also tried with other (MEM_RESERVE || MEM_TOP_DOWN).

Can any one please letme know if something is wrong in my approach.

Regards
Deepu

Re: Wince address space allocation by Steve

Steve
Thu Jun 05 20:44:29 PDT 2008

but I think that the OEMAddressTable only applies to the kernel process.

In your example, your tempPtr is in cached memory.

The cache is usually only enabled for RAM access, it usually does not make
sense for peripherals. With that in mind, explicitly asking for 0x80000000
(probably RAM) will likely corrupt something if you write to it.

What are you actually trying to do?

steve araiza



"deepu" <pradeepit@gmail.com> wrote in message
news:edd142cb-c806-4e79-8823-b5fb72522b9f@w1g2000prd.googlegroups.com...
> Dear all,
> I am working on a ARM9 platform that has WINCE 5 ported onit. I want
> to use some cached memory space in user application. The normal malloc
> is allocating the address at 0x004ea14c, but when i saw the virtual
> address space mapping in OEMAddressTable, it shows that cached memory
> space lies between 0x80000000-0x9FFFFFFF. Hence I am trying to use
> virtual alloc to allocate some memory from that address space, I am
> not able to allocate at that location. When I verify the address
> returned by virtualalloc, it remains the same as returned by normal
> malloc.
> I am not able to understand the difference in here between
> 1) malloc and virtual alloc, and also
> 2) cached memory space reserved in kernel space and userspace
> memorymap where does it points to.
>
> Or am I missing some thing in here. I am using the virtual alloc as
> follows.
>
> unsigned int* tempPtr;
> tempPtr = (unsigned int*)VirtualAlloc((LPVOID) 0x80000000, 2468,
> MEM_RESERVE, PAGE_READWRITE);
>
> I also tried with other (MEM_RESERVE || MEM_TOP_DOWN).
>
> Can any one please letme know if something is wrong in my approach.
>
> Regards
> Deepu



Re: Wince address space allocation by deepu

deepu
Thu Jun 05 21:08:00 PDT 2008

Dear steve,
Thanks for the response. I wanted to allocate a memory location in a
cached adress spcae and lock it in the cache. As I am working in arm9
processor. cache locking is possible.
You mean the whole of the userspace is already cacheable in windows
CE. But the variable adress it returns doesnot match with any of the
adresses mentioned in the virtual map. How can i relate these 2?

Regadrs
Deepu

On Jun 6, 12:43=A0pm, "Steve Araiza" <sara...@contractor.net> wrote:
> but I think that the OEMAddressTable only applies to the kernel process.
>
> In your example, your tempPtr is in cached memory.
>
> The cache is usually only enabled for RAM access, it usually does not make=

> sense for peripherals. With that in mind, explicitly asking for 0x80000000=

> (probably RAM) will likely corrupt something if you write to it.
>
> What are you actually trying to do?
>
> steve araiza
>
> "deepu" <pradee...@gmail.com> wrote in message
>
> news:edd142cb-c806-4e79-8823-b5fb72522b9f@w1g2000prd.googlegroups.com...
>
>
>
> > Dear all,
> > I am working on a ARM9 platform that has WINCE 5 ported onit. I want
> > to use some cached memory space in user application. The normal malloc
> > is allocating the address at 0x004ea14c, but when i saw the virtual
> > address space mapping in OEMAddressTable, it shows that cached memory
> > space lies between 0x80000000-0x9FFFFFFF. Hence I am trying to use
> > virtual alloc to allocate some memory from that address space, I am
> > not able to allocate at that location. When I verify the address
> > returned by virtualalloc, it remains the same as returned by normal
> > malloc.
> > I am not able to understand the difference in here between
> > 1) malloc and virtual alloc, and also
> > 2) cached memory space reserved in kernel space and userspace
> > memorymap where does it points to.
>
> > Or am I missing some thing in here. I am using the virtual alloc as
> > follows.
>
> > unsigned int* tempPtr;
> > tempPtr =3D (unsigned int*)VirtualAlloc((LPVOID) 0x80000000, 2468,
> > MEM_RESERVE, PAGE_READWRITE);
>
> > I also tried with other (MEM_RESERVE || MEM_TOP_DOWN).
>
> > Can any one please letme know if something is wrong in my approach.
>
> > Regards
> > Deepu- Hide quoted text -
>
> - Show quoted text -


Re: Wince address space allocation by Steve

Steve
Fri Jun 06 04:14:03 PDT 2008

They are not related. For a user mode process, you can't look at a virtual
address and make an assumption about it being cachable.

"deepu" <pradeepit@gmail.com> wrote in message
news:60904a07-d9b4-4276-99ba-1b9fd2dd0110@i18g2000prn.googlegroups.com...
Dear steve,
Thanks for the response. I wanted to allocate a memory location in a
cached adress spcae and lock it in the cache. As I am working in arm9
processor. cache locking is possible.
You mean the whole of the userspace is already cacheable in windows
CE. But the variable adress it returns doesnot match with any of the
adresses mentioned in the virtual map. How can i relate these 2?

Regadrs
Deepu

On Jun 6, 12:43 pm, "Steve Araiza" <sara...@contractor.net> wrote:
> but I think that the OEMAddressTable only applies to the kernel process.
>
> In your example, your tempPtr is in cached memory.
>
> The cache is usually only enabled for RAM access, it usually does not make
> sense for peripherals. With that in mind, explicitly asking for 0x80000000
> (probably RAM) will likely corrupt something if you write to it.
>
> What are you actually trying to do?
>
> steve araiza
>
> "deepu" <pradee...@gmail.com> wrote in message
>
> news:edd142cb-c806-4e79-8823-b5fb72522b9f@w1g2000prd.googlegroups.com...
>
>
>
> > Dear all,
> > I am working on a ARM9 platform that has WINCE 5 ported onit. I want
> > to use some cached memory space in user application. The normal malloc
> > is allocating the address at 0x004ea14c, but when i saw the virtual
> > address space mapping in OEMAddressTable, it shows that cached memory
> > space lies between 0x80000000-0x9FFFFFFF. Hence I am trying to use
> > virtual alloc to allocate some memory from that address space, I am
> > not able to allocate at that location. When I verify the address
> > returned by virtualalloc, it remains the same as returned by normal
> > malloc.
> > I am not able to understand the difference in here between
> > 1) malloc and virtual alloc, and also
> > 2) cached memory space reserved in kernel space and userspace
> > memorymap where does it points to.
>
> > Or am I missing some thing in here. I am using the virtual alloc as
> > follows.
>
> > unsigned int* tempPtr;
> > tempPtr = (unsigned int*)VirtualAlloc((LPVOID) 0x80000000, 2468,
> > MEM_RESERVE, PAGE_READWRITE);
>
> > I also tried with other (MEM_RESERVE || MEM_TOP_DOWN).
>
> > Can any one please letme know if something is wrong in my approach.
>
> > Regards
> > Deepu- Hide quoted text -
>
> - Show quoted text -



Re: Wince address space allocation by Bruce

Bruce
Fri Jun 06 05:43:13 PDT 2008

Read the documentation for OEMAddressTable again. It set up virtual to
physical mapping in the kernel's address space. To use VirtualAlloc, you
don't even need to have the addresses mapped in OEMAddressTable.

--
Bruce Eitman (eMVP)
Senior Engineer
Bruce.Eitman AT EuroTech DOT com
My BLOG http://geekswithblogs.net/bruceeitman

EuroTech Inc.
www.EuroTech.com

"deepu" <pradeepit@gmail.com> wrote in message
news:60904a07-d9b4-4276-99ba-1b9fd2dd0110@i18g2000prn.googlegroups.com...
Dear steve,
Thanks for the response. I wanted to allocate a memory location in a
cached adress spcae and lock it in the cache. As I am working in arm9
processor. cache locking is possible.
You mean the whole of the userspace is already cacheable in windows
CE. But the variable adress it returns doesnot match with any of the
adresses mentioned in the virtual map. How can i relate these 2?

Regadrs
Deepu

On Jun 6, 12:43 pm, "Steve Araiza" <sara...@contractor.net> wrote:
> but I think that the OEMAddressTable only applies to the kernel process.
>
> In your example, your tempPtr is in cached memory.
>
> The cache is usually only enabled for RAM access, it usually does not make
> sense for peripherals. With that in mind, explicitly asking for 0x80000000
> (probably RAM) will likely corrupt something if you write to it.
>
> What are you actually trying to do?
>
> steve araiza
>
> "deepu" <pradee...@gmail.com> wrote in message
>
> news:edd142cb-c806-4e79-8823-b5fb72522b9f@w1g2000prd.googlegroups.com...
>
>
>
> > Dear all,
> > I am working on a ARM9 platform that has WINCE 5 ported onit. I want
> > to use some cached memory space in user application. The normal malloc
> > is allocating the address at 0x004ea14c, but when i saw the virtual
> > address space mapping in OEMAddressTable, it shows that cached memory
> > space lies between 0x80000000-0x9FFFFFFF. Hence I am trying to use
> > virtual alloc to allocate some memory from that address space, I am
> > not able to allocate at that location. When I verify the address
> > returned by virtualalloc, it remains the same as returned by normal
> > malloc.
> > I am not able to understand the difference in here between
> > 1) malloc and virtual alloc, and also
> > 2) cached memory space reserved in kernel space and userspace
> > memorymap where does it points to.
>
> > Or am I missing some thing in here. I am using the virtual alloc as
> > follows.
>
> > unsigned int* tempPtr;
> > tempPtr = (unsigned int*)VirtualAlloc((LPVOID) 0x80000000, 2468,
> > MEM_RESERVE, PAGE_READWRITE);
>
> > I also tried with other (MEM_RESERVE || MEM_TOP_DOWN).
>
> > Can any one please letme know if something is wrong in my approach.
>
> > Regards
> > Deepu- Hide quoted text -
>
> - Show quoted text -



Re: Wince address space allocation by Tom

Tom
Fri Jun 06 07:53:07 PDT 2008

The address your application receives from the malloc call is a
process specific user-space address within Slot 0 of the Windows CE
5.0 address space.

malloc allocates memory from your process' heap which is created by
the kernel within the RAM memory region specified in the MEMORY
section of CONFIG.BIB and should be located within the cacheable
range.

You do not need to do anything else to allocate cacheable memory for
your application unless that memory needs to reside somewhere specific
within the kernel's virtual address space.

Tom


On Thu, 5 Jun 2008 21:08:00 -0700 (PDT), deepu <pradeepit@gmail.com>
wrote:

>Dear steve,
>Thanks for the response. I wanted to allocate a memory location in a
>cached adress spcae and lock it in the cache. As I am working in arm9
>processor. cache locking is possible.
>You mean the whole of the userspace is already cacheable in windows
>CE. But the variable adress it returns doesnot match with any of the
>adresses mentioned in the virtual map. How can i relate these 2?
>
>Regadrs
>Deepu
>
>On Jun 6, 12:43 pm, "Steve Araiza" <sara...@contractor.net> wrote:
>> but I think that the OEMAddressTable only applies to the kernel process.
>>
>> In your example, your tempPtr is in cached memory.
>>
>> The cache is usually only enabled for RAM access, it usually does not make
>> sense for peripherals. With that in mind, explicitly asking for 0x80000000
>> (probably RAM) will likely corrupt something if you write to it.
>>
>> What are you actually trying to do?
>>
>> steve araiza
>>
>> "deepu" <pradee...@gmail.com> wrote in message
>>
>> news:edd142cb-c806-4e79-8823-b5fb72522b9f@w1g2000prd.googlegroups.com...
>>
>>
>>
>> > Dear all,
>> > I am working on a ARM9 platform that has WINCE 5 ported onit. I want
>> > to use some cached memory space in user application. The normal malloc
>> > is allocating the address at 0x004ea14c, but when i saw the virtual
>> > address space mapping in OEMAddressTable, it shows that cached memory
>> > space lies between 0x80000000-0x9FFFFFFF. Hence I am trying to use
>> > virtual alloc to allocate some memory from that address space, I am
>> > not able to allocate at that location. When I verify the address
>> > returned by virtualalloc, it remains the same as returned by normal
>> > malloc.
>> > I am not able to understand the difference in here between
>> > 1) malloc and virtual alloc, and also
>> > 2) cached memory space reserved in kernel space and userspace
>> > memorymap where does it points to.
>>
>> > Or am I missing some thing in here. I am using the virtual alloc as
>> > follows.
>>
>> > unsigned int* tempPtr;
>> > tempPtr = (unsigned int*)VirtualAlloc((LPVOID) 0x80000000, 2468,
>> > MEM_RESERVE, PAGE_READWRITE);
>>
>> > I also tried with other (MEM_RESERVE || MEM_TOP_DOWN).
>>
>> > Can any one please letme know if something is wrong in my approach.
>>
>> > Regards
>> > Deepu- Hide quoted text -
>>
>> - Show quoted text -

Re: Wince address space allocation by deepu

deepu
Fri Jun 06 19:34:43 PDT 2008

Dear all,
In that case can i check the contents in the cache. Not only in Wince
but on any other platforms like RVDS or any other armsimulators. I
basically want to see the cache dataflow in arm. and the cache data
updated in the processor, as i am not sure from my application has
cache been used efficiently or not. I can also run my application
without any OS.
Any suggestions regarding this.
Regards
Deepu

On Jun 6, 11:53=A0pm, "Tom Gensel (eMVP)"
<tgensel.at.ptgsystems.dot.com> wrote:
> The address your application receives from the malloc call is a
> process specific user-space address within Slot 0 of the Windows CE
> 5.0 address space. =A0
>
> malloc allocates memory from your process' heap which is created by
> the kernel within the RAM memory region specified in the MEMORY
> section of CONFIG.BIB and should be located within the cacheable
> range.
>
> You do not need to do anything else to allocate cacheable memory for
> your application unless that memory needs to reside somewhere specific
> within the kernel's virtual address space.
>
> Tom
>
> On Thu, 5 Jun 2008 21:08:00 -0700 (PDT), deepu <pradee...@gmail.com>
> wrote:
>
>
>
> >Dear steve,
> >Thanks for the response. I wanted to allocate a memory location in a
> >cached adress spcae and lock it in the cache. As I am working in arm9
> >processor. cache locking is possible.
> >You mean the whole of the userspace is already cacheable in windows
> >CE. But the variable adress it returns doesnot match with any of the
> >adresses mentioned in the virtual map. =A0How can i relate these 2?
>
> >Regadrs
> >Deepu
>
> >On Jun 6, 12:43=A0pm, "Steve Araiza" <sara...@contractor.net> wrote:
> >> but I think that the OEMAddressTable only applies to the kernel process=
.
>
> >> In your example, your tempPtr is in cached memory.
>
> >> The cache is usually only enabled for RAM access, it usually does not m=
ake
> >> sense for peripherals. With that in mind, explicitly asking for 0x80000=
000
> >> (probably RAM) will likely corrupt something if you write to it.
>
> >> What are you actually trying to do?
>
> >> steve araiza
>
> >> "deepu" <pradee...@gmail.com> wrote in message
>
> >>news:edd142cb-c806-4e79-8823-b5fb72522b9f@w1g2000prd.googlegroups.com...=

>
> >> > Dear all,
> >> > I am working on a ARM9 platform that has WINCE 5 ported onit. I want
> >> > to use some cached memory space in user application. The normal mallo=
c
> >> > is allocating the address at 0x004ea14c, but when i saw the virtual
> >> > address space mapping in OEMAddressTable, it shows that cached memory=

> >> > space lies between 0x80000000-0x9FFFFFFF. Hence I am trying to use
> >> > virtual alloc to allocate some memory from that address space, I am
> >> > not able to allocate at that location. When I verify the address
> >> > returned by virtualalloc, it remains the same as returned by normal
> >> > malloc.
> >> > I am not able to understand the difference in here between
> >> > 1) malloc and virtual alloc, and also
> >> > 2) cached memory space reserved in kernel space and userspace
> >> > memorymap where does it points to.
>
> >> > Or am I missing some thing in here. I am using the virtual alloc as
> >> > follows.
>
> >> > unsigned int* tempPtr;
> >> > tempPtr =3D (unsigned int*)VirtualAlloc((LPVOID) 0x80000000, 2468,
> >> > MEM_RESERVE, PAGE_READWRITE);
>
> >> > I also tried with other (MEM_RESERVE || MEM_TOP_DOWN).
>
> >> > Can any one please letme know if something is wrong in my approach.
>
> >> > Regards
> >> > Deepu- Hide quoted text -
>
> >> - Show quoted text -- Hide quoted text -
>
> - Show quoted text -


Re: Wince address space allocation by Tom

Tom
Sun Jun 08 00:27:46 PDT 2008

You'll need to find out what type of hardware performance counters
your CPU has, if any, that can give you statistics on cache hits and
misses. Many ARM processors have them (some don't) but they differ
from chip to chip.

Sorry, but I don't have any knowledge of arm simulators with
performance counters.

Tom

On Fri, 6 Jun 2008 19:34:43 -0700 (PDT), deepu <pradeepit@gmail.com>
wrote:

>Dear all,
>In that case can i check the contents in the cache. Not only in Wince
>but on any other platforms like RVDS or any other armsimulators. I
>basically want to see the cache dataflow in arm. and the cache data
>updated in the processor, as i am not sure from my application has
>cache been used efficiently or not. I can also run my application
>without any OS.
>Any suggestions regarding this.
>Regards
>Deepu
>