Index: kernel/Makefile
===================================================================
--- kernel/Makefile	(revision 40257f573530dfd8a6fe333cbdf01104c782effa)
+++ kernel/Makefile	(revision e32e092d6f8bed442ecc81b18af9ef323bc4e650)
@@ -35,5 +35,5 @@
 
 INCLUDES = generic/include
-OPTIMIZATION = 3
+OPTIMIZATION = 1
 
 ## Common compiler flags
Index: kernel/arch/amd64/include/memstr.h
===================================================================
--- kernel/arch/amd64/include/memstr.h	(revision 40257f573530dfd8a6fe333cbdf01104c782effa)
+++ kernel/arch/amd64/include/memstr.h	(revision e32e092d6f8bed442ecc81b18af9ef323bc4e650)
@@ -38,8 +38,8 @@
 #define memcpy(dst, src, cnt)  __builtin_memcpy((dst), (src), (cnt))
 
-extern void memsetw(uintptr_t dst, size_t cnt, uint16_t x);
-extern void memsetb(uintptr_t dst, size_t cnt, uint8_t x);
+extern void memsetw(void *dst, size_t cnt, uint16_t x);
+extern void memsetb(void *dst, size_t cnt, uint8_t x);
 
-extern int memcmp(uintptr_t src, uintptr_t dst, int cnt);
+extern int memcmp(const void *a, const void *b, size_t cnt);
 
 #endif
Index: kernel/arch/amd64/src/pm.c
===================================================================
--- kernel/arch/amd64/src/pm.c	(revision 40257f573530dfd8a6fe333cbdf01104c782effa)
+++ kernel/arch/amd64/src/pm.c	(revision e32e092d6f8bed442ecc81b18af9ef323bc4e650)
@@ -156,5 +156,5 @@
 void tss_initialize(tss_t *t)
 {
-	memsetb((uintptr_t) t, sizeof(tss_t), 0);
+	memsetb(t, sizeof(tss_t), 0);
 }
 
@@ -240,5 +240,5 @@
 	ipl_t ipl = interrupts_disable();
 	
-	memsetb((uintptr_t) idt, sizeof(idt), 0);
+	memsetb(idt, sizeof(idt), 0);
 	idtr_load(&idtr);
 	
Index: kernel/arch/arm32/include/memstr.h
===================================================================
--- kernel/arch/arm32/include/memstr.h	(revision 40257f573530dfd8a6fe333cbdf01104c782effa)
+++ kernel/arch/arm32/include/memstr.h	(revision e32e092d6f8bed442ecc81b18af9ef323bc4e650)
@@ -39,8 +39,8 @@
 #define memcpy(dst, src, cnt)  __builtin_memcpy((dst), (src), (cnt))
 
-extern void memsetw(uintptr_t dst, size_t cnt, uint16_t x);
-extern void memsetb(uintptr_t dst, size_t cnt, uint8_t x);
+extern void memsetw(void *dst, size_t cnt, uint16_t x);
+extern void memsetb(void *dst, size_t cnt, uint8_t x);
 
-extern int memcmp(uintptr_t src, uintptr_t dst, int cnt);
+extern int memcmp(const void *a, const void *b, size_t cnt);
 
 #endif
Index: kernel/arch/ia32/include/memstr.h
===================================================================
--- kernel/arch/ia32/include/memstr.h	(revision 40257f573530dfd8a6fe333cbdf01104c782effa)
+++ kernel/arch/ia32/include/memstr.h	(revision e32e092d6f8bed442ecc81b18af9ef323bc4e650)
@@ -38,8 +38,8 @@
 #define memcpy(dst, src, cnt)  __builtin_memcpy((dst), (src), (cnt))
 
-extern void memsetw(uintptr_t dst, size_t cnt, uint16_t x);
-extern void memsetb(uintptr_t dst, size_t cnt, uint8_t x);
+extern void memsetw(void *dst, size_t cnt, uint16_t x);
+extern void memsetb(void *dst, size_t cnt, uint8_t x);
 
-extern int memcmp(uintptr_t src, uintptr_t dst, int cnt);
+extern int memcmp(const void *a, const void *b, size_t cnt);
 
 #endif
Index: kernel/arch/ia32/src/drivers/ega.c
===================================================================
--- kernel/arch/ia32/src/drivers/ega.c	(revision 40257f573530dfd8a6fe333cbdf01104c782effa)
+++ kernel/arch/ia32/src/drivers/ega.c	(revision e32e092d6f8bed442ecc81b18af9ef323bc4e650)
@@ -116,5 +116,5 @@
 
 	memcpy((void *) videoram, (void *) (videoram + ROW * 2), (SCREEN - ROW) * 2);
-	memsetw((uintptr_t) (videoram + (SCREEN - ROW) * 2), ROW, 0x0720);
+	memsetw(videoram + (SCREEN - ROW) * 2, ROW, 0x0720);
 	ega_cursor = ega_cursor - ROW;
 }
Index: kernel/arch/ia32/src/pm.c
===================================================================
--- kernel/arch/ia32/src/pm.c	(revision 40257f573530dfd8a6fe333cbdf01104c782effa)
+++ kernel/arch/ia32/src/pm.c	(revision e32e092d6f8bed442ecc81b18af9ef323bc4e650)
@@ -113,5 +113,5 @@
 void tss_initialize(tss_t *t)
 {
-	memsetb((uintptr_t) t, sizeof(struct tss), 0);
+	memsetb(t, sizeof(struct tss), 0);
 }
 
@@ -241,5 +241,5 @@
 	ipl_t ipl = interrupts_disable();
 	
-	memsetb((uintptr_t) idt, sizeof(idt), 0);
+	memsetb(idt, sizeof(idt), 0);
 	
 	ptr_16_32_t idtr;
Index: kernel/arch/ia32/src/smp/smp.c
===================================================================
--- kernel/arch/ia32/src/smp/smp.c	(revision 40257f573530dfd8a6fe333cbdf01104c782effa)
+++ kernel/arch/ia32/src/smp/smp.c	(revision e32e092d6f8bed442ecc81b18af9ef323bc4e650)
@@ -161,6 +161,5 @@
 
 		memcpy(gdt_new, gdt, GDT_ITEMS * sizeof(struct descriptor));
-		memsetb((uintptr_t)(&gdt_new[TSS_DES]),
-		    sizeof(struct descriptor), 0);
+		memsetb(&gdt_new[TSS_DES], sizeof(struct descriptor), 0);
 		protected_ap_gdtr.limit = GDT_ITEMS * sizeof(struct descriptor);
 		protected_ap_gdtr.base = KA2PA((uintptr_t) gdt_new);
Index: kernel/arch/ia32xen/src/ia32xen.c
===================================================================
--- kernel/arch/ia32xen/src/ia32xen.c	(revision 40257f573530dfd8a6fe333cbdf01104c782effa)
+++ kernel/arch/ia32xen/src/ia32xen.c	(revision e32e092d6f8bed442ecc81b18af9ef323bc4e650)
@@ -70,5 +70,5 @@
 {
 	pte_t pte;
-	memsetb((uintptr_t) &pte, sizeof(pte), 0);
+	memsetb(&pte, sizeof(pte), 0);
 	
 	pte.present = 1;
@@ -104,5 +104,5 @@
 			uintptr_t tva = PA2KA(tpa);
 			
-			memsetb(tva, PAGE_SIZE, 0);
+			memsetb((void *) tva, PAGE_SIZE, 0);
 			
 			pte_t *tptl3 = (pte_t *) PA2KA(GET_PTL1_ADDRESS(start_info.ptl0, PTL0_INDEX(tva)));
Index: kernel/arch/ia32xen/src/pm.c
===================================================================
--- kernel/arch/ia32xen/src/pm.c	(revision 40257f573530dfd8a6fe333cbdf01104c782effa)
+++ kernel/arch/ia32xen/src/pm.c	(revision e32e092d6f8bed442ecc81b18af9ef323bc4e650)
@@ -99,5 +99,5 @@
 void tss_initialize(tss_t *t)
 {
-	memsetb((uintptr_t) t, sizeof(struct tss), 0);
+	memsetb(t, sizeof(struct tss), 0);
 }
 
Index: kernel/arch/ia32xen/src/smp/smp.c
===================================================================
--- kernel/arch/ia32xen/src/smp/smp.c	(revision 40257f573530dfd8a6fe333cbdf01104c782effa)
+++ kernel/arch/ia32xen/src/smp/smp.c	(revision e32e092d6f8bed442ecc81b18af9ef323bc4e650)
@@ -147,5 +147,5 @@
 
 		memcpy(gdt_new, gdt, GDT_ITEMS * sizeof(struct descriptor));
-		memsetb((uintptr_t)(&gdt_new[TSS_DES]), sizeof(struct descriptor), 0);
+		memsetb(&gdt_new[TSS_DES], sizeof(struct descriptor), 0);
 		gdtr.base = (uintptr_t) gdt_new;
 
Index: kernel/arch/ia64/include/memstr.h
===================================================================
--- kernel/arch/ia64/include/memstr.h	(revision 40257f573530dfd8a6fe333cbdf01104c782effa)
+++ kernel/arch/ia64/include/memstr.h	(revision e32e092d6f8bed442ecc81b18af9ef323bc4e650)
@@ -38,8 +38,8 @@
 #define memcpy(dst, src, cnt)  __builtin_memcpy((dst), (src), (cnt))
 
-extern void memsetw(uintptr_t dst, size_t cnt, uint16_t x);
-extern void memsetb(uintptr_t dst, size_t cnt, uint8_t x);
+extern void memsetw(void *dst, size_t cnt, uint16_t x);
+extern void memsetb(void *dst, size_t cnt, uint8_t x);
 
-extern int memcmp(uintptr_t src, uintptr_t dst, int cnt);
+extern int memcmp(const void *a, const void *b, size_t cnt);
 
 #endif
Index: kernel/arch/ia64/src/drivers/ega.c
===================================================================
--- kernel/arch/ia64/src/drivers/ega.c	(revision 40257f573530dfd8a6fe333cbdf01104c782effa)
+++ kernel/arch/ia64/src/drivers/ega.c	(revision e32e092d6f8bed442ecc81b18af9ef323bc4e650)
@@ -72,5 +72,5 @@
 	 * Clear the screen.
 	 */
-	_memsetw((uintptr_t) videoram, SCREEN, 0x0720);	
+	_memsetw(videoram, SCREEN, 0x0720);	
 
 	chardev_initialize("ega_out", &ega_console, &ega_ops);
@@ -103,5 +103,5 @@
 
 	memcpy((void *) videoram, (void *) (videoram + ROW * 2), (SCREEN - ROW) * 2);
-	_memsetw((uintptr_t) (videoram + (SCREEN - ROW) * 2), ROW, 0x0720);
+	_memsetw(videoram + (SCREEN - ROW) * 2, ROW, 0x0720);
 	ega_cursor = ega_cursor - ROW;
 }
Index: kernel/arch/ia64/src/mm/vhpt.c
===================================================================
--- kernel/arch/ia64/src/mm/vhpt.c	(revision 40257f573530dfd8a6fe333cbdf01104c782effa)
+++ kernel/arch/ia64/src/mm/vhpt.c	(revision e32e092d6f8bed442ecc81b18af9ef323bc4e650)
@@ -82,5 +82,5 @@
 void vhpt_invalidate_all()
 {
-	memsetb((uintptr_t) vhpt_base, 1 << VHPT_WIDTH, 0);
+	memsetb(vhpt_base, 1 << VHPT_WIDTH, 0);
 }
 
Index: kernel/arch/mips32/include/memstr.h
===================================================================
--- kernel/arch/mips32/include/memstr.h	(revision 40257f573530dfd8a6fe333cbdf01104c782effa)
+++ kernel/arch/mips32/include/memstr.h	(revision e32e092d6f8bed442ecc81b18af9ef323bc4e650)
@@ -38,8 +38,8 @@
 #define memcpy(dst, src, cnt)  __builtin_memcpy((dst), (src), (cnt))
 
-extern void memsetw(uintptr_t dst, size_t cnt, uint16_t x);
-extern void memsetb(uintptr_t dst, size_t cnt, uint8_t x);
+extern void memsetw(void *dst, size_t cnt, uint16_t x);
+extern void memsetb(void *dst, size_t cnt, uint8_t x);
 
-extern int memcmp(uintptr_t src, uintptr_t dst, int cnt);
+extern int memcmp(const void *a, const void *b, size_t cnt);
 
 #endif
Index: kernel/arch/ppc32/include/memstr.h
===================================================================
--- kernel/arch/ppc32/include/memstr.h	(revision 40257f573530dfd8a6fe333cbdf01104c782effa)
+++ kernel/arch/ppc32/include/memstr.h	(revision e32e092d6f8bed442ecc81b18af9ef323bc4e650)
@@ -38,8 +38,8 @@
 #define memcpy(dst, src, cnt)  __builtin_memcpy((dst), (src), (cnt))
 
-extern void memsetw(uintptr_t dst, size_t cnt, uint16_t x);
-extern void memsetb(uintptr_t dst, size_t cnt, uint8_t x);
+extern void memsetw(void *dst, size_t cnt, uint16_t x);
+extern void memsetb(void *dst, size_t cnt, uint8_t x);
 
-extern int memcmp(uintptr_t src, uintptr_t dst, int cnt);
+extern int memcmp(const void *a, const void *b, size_t cnt);
 
 #endif
Index: kernel/arch/ppc64/include/memstr.h
===================================================================
--- kernel/arch/ppc64/include/memstr.h	(revision 40257f573530dfd8a6fe333cbdf01104c782effa)
+++ kernel/arch/ppc64/include/memstr.h	(revision e32e092d6f8bed442ecc81b18af9ef323bc4e650)
@@ -38,8 +38,8 @@
 #define memcpy(dst, src, cnt)  __builtin_memcpy((dst), (src), (cnt))
 
-extern void memsetw(uintptr_t dst, size_t cnt, uint16_t x);
-extern void memsetb(uintptr_t dst, size_t cnt, uint8_t x);
+extern void memsetw(void *dst, size_t cnt, uint16_t x);
+extern void memsetb(void *dst, size_t cnt, uint8_t x);
 
-extern int memcmp(uintptr_t src, uintptr_t dst, int cnt);
+extern int memcmp(const void *a, const void *b, size_t cnt);
 
 #endif
Index: kernel/arch/ppc64/src/mm/page.c
===================================================================
--- kernel/arch/ppc64/src/mm/page.c	(revision 40257f573530dfd8a6fe333cbdf01104c782effa)
+++ kernel/arch/ppc64/src/mm/page.c	(revision e32e092d6f8bed442ecc81b18af9ef323bc4e650)
@@ -253,5 +253,5 @@
 void pht_init(void)
 {
-	memsetb((uintptr_t) phte, 1 << PHT_BITS, 0);
+	memsetb(phte, 1 << PHT_BITS, 0);
 }
 
Index: kernel/arch/sparc64/include/memstr.h
===================================================================
--- kernel/arch/sparc64/include/memstr.h	(revision 40257f573530dfd8a6fe333cbdf01104c782effa)
+++ kernel/arch/sparc64/include/memstr.h	(revision e32e092d6f8bed442ecc81b18af9ef323bc4e650)
@@ -38,8 +38,8 @@
 #define memcpy(dst, src, cnt)  __builtin_memcpy((dst), (src), (cnt))
 
-extern void memsetw(uintptr_t dst, size_t cnt, uint16_t x);
-extern void memsetb(uintptr_t dst, size_t cnt, uint8_t x);
+extern void memsetw(void *dst, size_t cnt, uint16_t x);
+extern void memsetb(void *dst, size_t cnt, uint8_t x);
 
-extern int memcmp(uintptr_t src, uintptr_t dst, int cnt);
+extern int memcmp(const void *a, const void *b, size_t cnt);
 
 #endif
Index: kernel/arch/sparc64/src/mm/as.c
===================================================================
--- kernel/arch/sparc64/src/mm/as.c	(revision 40257f573530dfd8a6fe333cbdf01104c782effa)
+++ kernel/arch/sparc64/src/mm/as.c	(revision e32e092d6f8bed442ecc81b18af9ef323bc4e650)
@@ -77,5 +77,5 @@
 	    sizeof(tsb_entry_t));
 
-	memsetb((uintptr_t) as->arch.itsb,
+	memsetb(as->arch.itsb,
 	    (ITSB_ENTRY_COUNT + DTSB_ENTRY_COUNT) * sizeof(tsb_entry_t), 0);
 #endif
Index: kernel/genarch/src/mm/as_pt.c
===================================================================
--- kernel/genarch/src/mm/as_pt.c	(revision 40257f573530dfd8a6fe333cbdf01104c782effa)
+++ kernel/genarch/src/mm/as_pt.c	(revision e32e092d6f8bed442ecc81b18af9ef323bc4e650)
@@ -104,5 +104,5 @@
 
 	if (flags & FLAG_AS_KERNEL) {
-		memsetb((uintptr_t) dst_ptl0, table_size, 0);
+		memsetb(dst_ptl0, table_size, 0);
 	} else {
 		uintptr_t src, dst;
@@ -119,5 +119,5 @@
 		dst = (uintptr_t) &dst_ptl0[PTL0_INDEX(KERNEL_ADDRESS_SPACE_START)];
 
-		memsetb((uintptr_t) dst_ptl0, table_size, 0);
+		memsetb(dst_ptl0, table_size, 0);
 		memcpy((void *) dst, (void *) src, table_size - (src - (uintptr_t) src_ptl0));
 		mutex_unlock(&AS_KERNEL->lock);
Index: kernel/genarch/src/mm/page_pt.c
===================================================================
--- kernel/genarch/src/mm/page_pt.c	(revision 40257f573530dfd8a6fe333cbdf01104c782effa)
+++ kernel/genarch/src/mm/page_pt.c	(revision e32e092d6f8bed442ecc81b18af9ef323bc4e650)
@@ -77,5 +77,5 @@
 	if (GET_PTL1_FLAGS(ptl0, PTL0_INDEX(page)) & PAGE_NOT_PRESENT) {
 		newpt = (pte_t *)frame_alloc(PTL1_SIZE, FRAME_KA);
-		memsetb((uintptr_t)newpt, FRAME_SIZE << PTL1_SIZE, 0);
+		memsetb(newpt, FRAME_SIZE << PTL1_SIZE, 0);
 		SET_PTL1_ADDRESS(ptl0, PTL0_INDEX(page), KA2PA(newpt));
 		SET_PTL1_FLAGS(ptl0, PTL0_INDEX(page), PAGE_PRESENT | PAGE_USER | PAGE_EXEC | PAGE_CACHEABLE | PAGE_WRITE);
@@ -86,5 +86,5 @@
 	if (GET_PTL2_FLAGS(ptl1, PTL1_INDEX(page)) & PAGE_NOT_PRESENT) {
 		newpt = (pte_t *)frame_alloc(PTL2_SIZE, FRAME_KA);
-		memsetb((uintptr_t)newpt, FRAME_SIZE << PTL2_SIZE, 0);
+		memsetb(newpt, FRAME_SIZE << PTL2_SIZE, 0);
 		SET_PTL2_ADDRESS(ptl1, PTL1_INDEX(page), KA2PA(newpt));
 		SET_PTL2_FLAGS(ptl1, PTL1_INDEX(page), PAGE_PRESENT | PAGE_USER | PAGE_EXEC | PAGE_CACHEABLE | PAGE_WRITE);
@@ -95,5 +95,5 @@
 	if (GET_PTL3_FLAGS(ptl2, PTL2_INDEX(page)) & PAGE_NOT_PRESENT) {
 		newpt = (pte_t *)frame_alloc(PTL3_SIZE, FRAME_KA);
-		memsetb((uintptr_t)newpt, FRAME_SIZE << PTL3_SIZE, 0);
+		memsetb(newpt, FRAME_SIZE << PTL3_SIZE, 0);
 		SET_PTL3_ADDRESS(ptl2, PTL2_INDEX(page), KA2PA(newpt));
 		SET_PTL3_FLAGS(ptl2, PTL2_INDEX(page), PAGE_PRESENT | PAGE_USER | PAGE_EXEC | PAGE_CACHEABLE | PAGE_WRITE);
@@ -147,5 +147,5 @@
 
 	/* Destroy the mapping. Setting to PAGE_NOT_PRESENT is not sufficient. */
-	memsetb((uintptr_t) &ptl3[PTL3_INDEX(page)], sizeof(pte_t), 0);
+	memsetb(&ptl3[PTL3_INDEX(page)], sizeof(pte_t), 0);
 
 	/*
@@ -167,9 +167,9 @@
 		frame_free(KA2PA((uintptr_t) ptl3));
 		if (PTL2_ENTRIES)
-			memsetb((uintptr_t) &ptl2[PTL2_INDEX(page)], sizeof(pte_t), 0);
+			memsetb(&ptl2[PTL2_INDEX(page)], sizeof(pte_t), 0);
 		else if (PTL1_ENTRIES)
-			memsetb((uintptr_t) &ptl1[PTL1_INDEX(page)], sizeof(pte_t), 0);
+			memsetb(&ptl1[PTL1_INDEX(page)], sizeof(pte_t), 0);
 		else
-			memsetb((uintptr_t) &ptl0[PTL0_INDEX(page)], sizeof(pte_t), 0);
+			memsetb(&ptl0[PTL0_INDEX(page)], sizeof(pte_t), 0);
 	} else {
 		/*
@@ -196,7 +196,7 @@
 			frame_free(KA2PA((uintptr_t) ptl2));
 			if (PTL1_ENTRIES)
-				memsetb((uintptr_t) &ptl1[PTL1_INDEX(page)], sizeof(pte_t), 0);
+				memsetb(&ptl1[PTL1_INDEX(page)], sizeof(pte_t), 0);
 			else
-				memsetb((uintptr_t) &ptl0[PTL0_INDEX(page)], sizeof(pte_t), 0);
+				memsetb(&ptl0[PTL0_INDEX(page)], sizeof(pte_t), 0);
 		}
 		else {
@@ -224,5 +224,5 @@
 			 */
 			frame_free(KA2PA((uintptr_t) ptl1));
-			memsetb((uintptr_t) &ptl0[PTL0_INDEX(page)], sizeof(pte_t), 0);
+			memsetb(&ptl0[PTL0_INDEX(page)], sizeof(pte_t), 0);
 		}
 	}
Index: kernel/generic/include/memstr.h
===================================================================
--- kernel/generic/include/memstr.h	(revision 40257f573530dfd8a6fe333cbdf01104c782effa)
+++ kernel/generic/include/memstr.h	(revision e32e092d6f8bed442ecc81b18af9ef323bc4e650)
@@ -43,6 +43,6 @@
  */
 extern void *_memcpy(void *dst, const void *src, size_t cnt);
-extern void _memsetb(uintptr_t dst, size_t cnt, uint8_t x);
-extern void _memsetw(uintptr_t dst, size_t cnt, uint16_t x);
+extern void _memsetb(void *dst, size_t cnt, uint8_t x);
+extern void _memsetw(void *dst, size_t cnt, uint16_t x);
 extern char *strcpy(char *dest, const char *src);
 
Index: kernel/generic/src/adt/hash_table.c
===================================================================
--- kernel/generic/src/adt/hash_table.c	(revision 40257f573530dfd8a6fe333cbdf01104c782effa)
+++ kernel/generic/src/adt/hash_table.c	(revision e32e092d6f8bed442ecc81b18af9ef323bc4e650)
@@ -64,5 +64,5 @@
 		panic("cannot allocate memory for hash table\n");
 	}
-	memsetb((uintptr_t) h->entry, m * sizeof(link_t), 0);
+	memsetb(h->entry, m * sizeof(link_t), 0);
 	
 	for (i = 0; i < m; i++)
Index: kernel/generic/src/cpu/cpu.c
===================================================================
--- kernel/generic/src/cpu/cpu.c	(revision 40257f573530dfd8a6fe333cbdf01104c782effa)
+++ kernel/generic/src/cpu/cpu.c	(revision e32e092d6f8bed442ecc81b18af9ef323bc4e650)
@@ -68,5 +68,5 @@
 
 		/* initialize everything */
-		memsetb((uintptr_t) cpus, sizeof(cpu_t) * config.cpu_count, 0);
+		memsetb(cpus, sizeof(cpu_t) * config.cpu_count, 0);
 
 		for (i = 0; i < config.cpu_count; i++) {
Index: kernel/generic/src/ipc/ipc.c
===================================================================
--- kernel/generic/src/ipc/ipc.c	(revision 40257f573530dfd8a6fe333cbdf01104c782effa)
+++ kernel/generic/src/ipc/ipc.c	(revision e32e092d6f8bed442ecc81b18af9ef323bc4e650)
@@ -67,5 +67,5 @@
 static void _ipc_call_init(call_t *call)
 {
-	memsetb((uintptr_t) call, sizeof(*call), 0);
+	memsetb(call, sizeof(*call), 0);
 	call->callerbox = &TASK->answerbox;
 	call->sender = TASK;
Index: kernel/generic/src/lib/memstr.c
===================================================================
--- kernel/generic/src/lib/memstr.c	(revision 40257f573530dfd8a6fe333cbdf01104c782effa)
+++ kernel/generic/src/lib/memstr.c	(revision e32e092d6f8bed442ecc81b18af9ef323bc4e650)
@@ -88,5 +88,5 @@
  *
  */
-void _memsetb(uintptr_t dst, size_t cnt, uint8_t x)
+void _memsetb(void *dst, size_t cnt, uint8_t x)
 {
 	unsigned int i;
@@ -107,5 +107,5 @@
  *
  */
-void _memsetw(uintptr_t dst, size_t cnt, uint16_t x)
+void _memsetw(void *dst, size_t cnt, uint16_t x)
 {
 	unsigned int i;
Index: kernel/generic/src/lib/objc_ext.c
===================================================================
--- kernel/generic/src/lib/objc_ext.c	(revision 40257f573530dfd8a6fe333cbdf01104c782effa)
+++ kernel/generic/src/lib/objc_ext.c	(revision e32e092d6f8bed442ecc81b18af9ef323bc4e650)
@@ -162,5 +162,5 @@
 void *memset(void *s, int c, size_t n)
 {
-	memsetb((uintptr_t) s, n, c);
+	memsetb(s, n, c);
 	return s;
 }
Index: kernel/generic/src/mm/as.c
===================================================================
--- kernel/generic/src/mm/as.c	(revision 40257f573530dfd8a6fe333cbdf01104c782effa)
+++ kernel/generic/src/mm/as.c	(revision e32e092d6f8bed442ecc81b18af9ef323bc4e650)
@@ -325,6 +325,5 @@
 		a->backend_data = *backend_data;
 	else
-		memsetb((uintptr_t) &a->backend_data, sizeof(a->backend_data),
-		    0);
+		memsetb(&a->backend_data, sizeof(a->backend_data), 0);
 
 	btree_create(&a->used_space);
Index: kernel/generic/src/mm/backend_anon.c
===================================================================
--- kernel/generic/src/mm/backend_anon.c	(revision 40257f573530dfd8a6fe333cbdf01104c782effa)
+++ kernel/generic/src/mm/backend_anon.c	(revision e32e092d6f8bed442ecc81b18af9ef323bc4e650)
@@ -114,5 +114,5 @@
 			if (allocate) {
 				frame = (uintptr_t) frame_alloc(ONE_FRAME, 0);
-				memsetb(PA2KA(frame), FRAME_SIZE, 0);
+				memsetb((void *) PA2KA(frame), FRAME_SIZE, 0);
 				dirty = true;
 				
@@ -145,5 +145,5 @@
 		 */
 		frame = (uintptr_t) frame_alloc(ONE_FRAME, 0);
-		memsetb(PA2KA(frame), FRAME_SIZE, 0);
+		memsetb((void *) PA2KA(frame), FRAME_SIZE, 0);
 		dirty = true;
 	}
Index: kernel/generic/src/mm/backend_elf.c
===================================================================
--- kernel/generic/src/mm/backend_elf.c	(revision 40257f573530dfd8a6fe333cbdf01104c782effa)
+++ kernel/generic/src/mm/backend_elf.c	(revision e32e092d6f8bed442ecc81b18af9ef323bc4e650)
@@ -163,5 +163,5 @@
 		 */
 		frame = (uintptr_t)frame_alloc(ONE_FRAME, 0);
-		memsetb(PA2KA(frame), FRAME_SIZE, 0);
+		memsetb((void *) PA2KA(frame), FRAME_SIZE, 0);
 		dirty = true;
 	} else {
@@ -188,6 +188,6 @@
 		    (void *) (base + i * FRAME_SIZE + pad_lo),
 		    FRAME_SIZE - pad_lo - pad_hi);
-		memsetb(PA2KA(frame), pad_lo, 0);
-		memsetb(PA2KA(frame) + FRAME_SIZE - pad_hi, pad_hi, 0);
+		memsetb((void *) PA2KA(frame), pad_lo, 0);
+		memsetb((void *) (PA2KA(frame) + FRAME_SIZE - pad_hi), pad_hi, 0);
 		dirty = true;
 	}
Index: kernel/generic/src/mm/slab.c
===================================================================
--- kernel/generic/src/mm/slab.c	(revision 40257f573530dfd8a6fe333cbdf01104c782effa)
+++ kernel/generic/src/mm/slab.c	(revision e32e092d6f8bed442ecc81b18af9ef323bc4e650)
@@ -560,6 +560,5 @@
 	cache->mag_cache = malloc(sizeof(slab_mag_cache_t) * config.cpu_count,0);
 	for (i = 0; i < config.cpu_count; i++) {
-		memsetb((uintptr_t)&cache->mag_cache[i],
-			sizeof(cache->mag_cache[i]), 0);
+		memsetb(&cache->mag_cache[i], sizeof(cache->mag_cache[i]), 0);
 		spinlock_initialize(&cache->mag_cache[i].lock, "slab_maglock_cpu");
 	}
@@ -579,5 +578,5 @@
 	ipl_t ipl;
 
-	memsetb((uintptr_t)cache, sizeof(*cache), 0);
+	memsetb(cache, sizeof(*cache), 0);
 	cache->name = name;
 
Index: kernel/generic/src/proc/thread.c
===================================================================
--- kernel/generic/src/proc/thread.c	(revision 40257f573530dfd8a6fe333cbdf01104c782effa)
+++ kernel/generic/src/proc/thread.c	(revision e32e092d6f8bed442ecc81b18af9ef323bc4e650)
@@ -294,6 +294,5 @@
 	
 	/* Not needed, but good for debugging */
-	memsetb((uintptr_t) t->kstack, THREAD_STACK_SIZE * 1 << STACK_FRAMES,
-	    0);
+	memsetb(t->kstack, THREAD_STACK_SIZE * 1 << STACK_FRAMES, 0);
 	
 	ipl = interrupts_disable();
Index: kernel/test/mm/falloc2.c
===================================================================
--- kernel/test/mm/falloc2.c	(revision 40257f573530dfd8a6fe333cbdf01104c782effa)
+++ kernel/test/mm/falloc2.c	(revision e32e092d6f8bed442ecc81b18af9ef323bc4e650)
@@ -56,5 +56,5 @@
 	index_t k;
 	
-	uintptr_t * frames =  (uintptr_t *) malloc(MAX_FRAMES * sizeof(uintptr_t), FRAME_ATOMIC);
+	void **frames =  (void **) malloc(MAX_FRAMES * sizeof(void *), FRAME_ATOMIC);
 	if (frames == NULL) {
 		if (!sh_quiet)
@@ -74,5 +74,5 @@
 			allocated = 0;
 			for (i = 0; i < (MAX_FRAMES >> order); i++) {
-				frames[allocated] = (uintptr_t)frame_alloc(order, FRAME_ATOMIC | FRAME_KA);
+				frames[allocated] = frame_alloc(order, FRAME_ATOMIC | FRAME_KA);
 				if (frames[allocated]) {
 					memsetb(frames[allocated], FRAME_SIZE << order, val);
Index: kernel/test/mm/slab1.c
===================================================================
--- kernel/test/mm/slab1.c	(revision 40257f573530dfd8a6fe333cbdf01104c782effa)
+++ kernel/test/mm/slab1.c	(revision e32e092d6f8bed442ecc81b18af9ef323bc4e650)
@@ -54,5 +54,5 @@
 	for (i = 0; i < count; i++) {
 		data[i] = slab_alloc(cache, 0);
-		memsetb((uintptr_t) data[i], size, 0);
+		memsetb(data[i], size, 0);
 	}
 	
@@ -72,5 +72,5 @@
 	for (i = 0; i < count; i++) {
 		data[i] = slab_alloc(cache, 0);
-		memsetb((uintptr_t) data[i], size, 0);
+		memsetb(data[i], size, 0);
 	}
 	
@@ -90,5 +90,5 @@
 	for (i = count / 2; i < count; i++) {
 		data[i] = slab_alloc(cache, 0);
-		memsetb((uintptr_t) data[i], size, 0);
+		memsetb(data[i], size, 0);
 	}
 	
Index: kernel/test/mm/slab2.c
===================================================================
--- kernel/test/mm/slab2.c	(revision 40257f573530dfd8a6fe333cbdf01104c782effa)
+++ kernel/test/mm/slab2.c	(revision e32e092d6f8bed442ecc81b18af9ef323bc4e650)
@@ -69,6 +69,6 @@
 			break;
 		}
-		memsetb((uintptr_t) data1, ITEM_SIZE, 0);
-		memsetb((uintptr_t) data2, ITEM_SIZE, 0);
+		memsetb(data1, ITEM_SIZE, 0);
+		memsetb(data2, ITEM_SIZE, 0);
 		*((void **) data1) = olddata1;
 		*((void **) data2) = olddata2;
@@ -101,5 +101,5 @@
 			return;
 		}
-		memsetb((uintptr_t) data1, ITEM_SIZE, 0);
+		memsetb(data1, ITEM_SIZE, 0);
 		*((void **) data1) = olddata1;
 		olddata1 = data1;
@@ -109,5 +109,5 @@
 		if (!data1)
 			break;
-		memsetb((uintptr_t) data1, ITEM_SIZE, 0);
+		memsetb(data1, ITEM_SIZE, 0);
 		*((void **) data1) = olddata1;
 		olddata1 = data1;
