Darren J Moffat wrote:
> Christian Kaiser wrote:
>> Hi all,
>>
>> I am wondering how I can find out the physical memory size in kernel 
>> space?
> 
> Why do you want to do that in a driver ? I'm assuming from the past 
> questions from Dolphinics this is still about driver development.

Our interconnect solution offers memory coupling. Every host can prepare 
a piece of its local memory that can be used (read/written) by all other 
remote hosts as if it was "local" memory then. Therefore, we arrange a 
second global address space that we only use for these kind of shared 
memory segments in our driver.

> There is no guarantee that this stays they same and could change just 
> after you have looked at it.  I'm also very nervous about any driver 
> that makes any assumptions based on the size of memory.

Yes, you are right but we are aware of this.

>> We have a device driver running on Linux that does the following:
>>
>>    #define DX_TOTALRAM              (((U64)num_physpages) << PAGE_SHIFT)
>>
> 
>> Can you tell me if there is something similar to 'num_physpages' on 
>> Solaris? PAGE_SHIFT is used to find out the page size. I should use 
>> 'ptob(1)' to get the page size, shouldn't I?
> 
> physmem might be the symbol you are looking for.

Excellent, I will have a look at this.

> That is ptob(9F) of course, running a ptob command inside the kernel 
> would be tricky :-)  But physmem already is the size in bytes.  If you 
> want it in pages use btop(9F).  Also you probably should use the 
> ddi_ptob(9F)/ddi_btop(9F) versions.

... a bit tricky? We are already using it ;-) Some others do as well, 
look here: 
http://src.opensolaris.org/source/search?q=%22ptob(1)%22&defs=&refs=&path=&hist=&project=%2Fonnv
But ddi_ptob(9F) is the common way to find out the page size?


   Christian

-- 
Christian Kaiser, Software Engineer, Dolphin Interconnect Solutions
http//www.dolphinics.com
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to