[haiku-commits] Re: r38292 - haiku/trunk/src/system/kernel/arch/ppc

  • From: Andreas Färber <andreas.faerber@xxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 25 Aug 2010 19:25:02 +0200

Am 25.08.2010 um 18:32 schrieb Ingo Weinhold:

On 2010-08-21 at 02:36:10 [+0200], andreas.faerber@xxxxxx wrote:
static void
fill_page_table_entry(page_table_entry *entry, uint32 virtualSegmentID, addr_t virtualAddress, phys_addr_t physicalAddress, uint8 protection,
-    bool secondaryHash)
+    uint32 memoryType, bool secondaryHash)
{
    // lower 32 bit - set at once
    entry->physical_page_number = physicalAddress / B_PAGE_SIZE;
    entry->_reserved0 = 0;
    entry->referenced = false;
    entry->changed = false;
-    entry->write_through = false;
-    entry->caching_inhibited = false;
+ entry->write_through = (memoryType == B_MTR_UC) || (memoryType ==
B_MTR_WT);
+    entry->caching_inhibited = (memoryType == B_MTR_UC);

The parentheses are superfluous (both lines).

Right. :) Want me to remove 'em, or just keep it in mind for the future?

Also, I don't find the
automatic conversion from bool to uint32 (one bit) particularly nice.

A valid opinion, I can't spot any in my changeset though. I'm converting uint32 to multiple existing bool fields. What do you suggest? To rewrite page_table_entry in some other way?

Andreas

Other related posts: