Skip to contentSkip to conversation

Making hotremovable attribute with memory section[4/4]

Lhms-devel Yasunori Goto 1 participant 1 message Aug 16, 2004 Memory management

lore
Share & tools
lore
#0 lore raw

Forwarded by Yasunori Goto <[email protected]> ----------------------- Original Message -----------------------

 From:    Yasunori Goto <[email protected]>
 To:      [email protected]
 Date:    Mon, 16 Aug 2004 14:37:34 -0700

Subject: [Lhms-devel] Making hotremovable attribute with memory section[4/4]
----

This is just for test removable/un-removable section.

Note:
hot-removable or un-removable attribute will be arch/platform dependent.

---

 hotremovable-goto/mm/nonlinear.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletion(-)
mm/nonlinear.c renamed from mm/nonlinear.c~test_sec_removable +7 -1
diff -puN mm/nonlinear.c~test_sec_removable mm/nonlinear.c
@@ -41,11 +41,14 @@ setup_memsections(void)
 	for (index = 0; index < NR_SECTIONS; index++) {
 		mem_section[index].phys_section = INVALID_SECTION;
 		mem_section[index].mem_map = NULL;
+		mem_section[index].flags = 0;
 	}
 	for (index = 0; index < NR_PHYS_SECTIONS; index++)
 		phys_section[index] = INVALID_PHYS_SECTION;
 }
 
+extern unsigned int highmem_start_page;
+
 void
 alloc_memsections(unsigned long start_pfn,
 		  unsigned long start_phys_pfn,
@@ -64,7 +67,10 @@ alloc_memsections(unsigned long start_pf
 	physid = pfn_to_section(start_phys_pfn);
 	for (; index < limit; index++, physid++) {
 		mem_section[index].phys_section = physid;
-		printk("set mem_section[%d].phys_section: %d\n", index, mem_section[index].phys_section);
+		if (section_to_pfn(index) > highmem_start_page)
+			mem_section[index].flags = SECTION_REMOVABLE;
+
+		printk("set mem_section[%d].phys_section: %d :flags=%02x\n", index, mem_section[index].phys_section);
 	}
 
 	index = pfn_to_section(start_phys_pfn);

_

Signature · 26 lines
Yasunori Goto <ygoto at us.fujitsu.com>




-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
_______________________________________________
Lhms-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/lhms-devel

--------------------- Original Message Ends --------------------

-- 
Yasunori Goto <ygoto at us.fujitsu.com>


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>