Index: uspace/Makefile
===================================================================
--- uspace/Makefile	(revision 0fcfa488af4d5256b39dbabfae819c9a889745c1)
+++ uspace/Makefile	(revision fcd7053c1b7bca76e2258a6b2b5ce5b3b416f00f)
@@ -55,18 +55,10 @@
 	app/bdsh
 
-ifeq ($(ARCH), amd64)
+ifeq ($(UARCH),amd64)
 	DIRS += srv/pci
 endif
 
-ifeq ($(ARCH), ia32)
+ifeq ($(UARCH),ia32)
 	DIRS += srv/pci
-endif
-
-ifeq ($(ARCH), mips32)
-	CFLAGS += -DCONFIG_MIPS_FPU
-endif
-
-ifeq ($(ARCH), mips32eb)
-	CFLAGS += -DCONFIG_MIPS_FPU
 endif
 
@@ -76,5 +68,5 @@
 .PHONY: all $(BUILDS) $(CLEANS) clean
 
-all: ../Makefile.config $(BUILDS)
+all: ../Makefile.config ../config.h ../config.defs $(BUILDS)
 
 clean: $(CLEANS)
Index: uspace/app/bdsh/Makefile
===================================================================
--- uspace/app/bdsh/Makefile	(revision 0fcfa488af4d5256b39dbabfae819c9a889745c1)
+++ uspace/app/bdsh/Makefile	(revision fcd7053c1b7bca76e2258a6b2b5ce5b3b416f00f)
@@ -31,8 +31,8 @@
 
 include ../../../version
--include ../../../Makefile.config
 
 LIBC_PREFIX = ../../lib/libc
 SOFTINT_PREFIX = ../../lib/softint
+
 include $(LIBC_PREFIX)/Makefile.toolchain
 
@@ -40,13 +40,5 @@
 
 LIBS = $(LIBC_PREFIX)/libc.a
-DEFS += -DRELEASE=\"$(RELEASE)\"
-
-ifdef REVISION
-	DEFS += "-DREVISION=\"$(TIMESTAMP)\""
-endif
-
-ifdef TIMESTAMP
-	DEFS += "-DTIMESTAMP=\"$(TIMESTAMP)\""
-endif
+DEFS += -DRELEASE=$(RELEASE)
 
 PROGRAM = bdsh
@@ -113,5 +105,5 @@
 
 $(PROGRAM): $(OBJECTS) $(LIBS)
-	$(LD) -T $(LIBC_PREFIX)/arch/$(ARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(PROGRAM).map
+	$(LD) -T $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(PROGRAM).map
 
 # Everything else is a phony target
Index: uspace/app/init/Makefile
===================================================================
--- uspace/app/init/Makefile	(revision 0fcfa488af4d5256b39dbabfae819c9a889745c1)
+++ uspace/app/init/Makefile	(revision fcd7053c1b7bca76e2258a6b2b5ce5b3b416f00f)
@@ -28,5 +28,4 @@
 
 include ../../../version
--include ../../../Makefile.config
 
 ## Setup toolchain
@@ -35,4 +34,5 @@
 LIBC_PREFIX = ../../lib/libc
 SOFTINT_PREFIX = ../../lib/softint
+
 include $(LIBC_PREFIX)/Makefile.toolchain
 
@@ -40,13 +40,5 @@
 
 LIBS = $(LIBC_PREFIX)/libc.a
-DEFS += -DRELEASE=\"$(RELEASE)\"
-
-ifdef REVISION
-	DEFS += "-DREVISION=\"$(REVISION)\""
-endif
-
-ifdef TIMESTAMP
-	DEFS += "-DTIMESTAMP=\"$(TIMESTAMP)\""
-endif
+DEFS += -DRELEASE=$(RELEASE)
 
 ## Sources
@@ -73,5 +65,5 @@
 
 $(OUTPUT): $(OBJECTS) $(LIBS)
-	$(LD) -T $(LIBC_PREFIX)/arch/$(ARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map
+	$(LD) -T $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map
 
 disasm: $(OUTPUT).disasm
Index: uspace/app/init/version.c
===================================================================
--- uspace/app/init/version.c	(revision 0fcfa488af4d5256b39dbabfae819c9a889745c1)
+++ uspace/app/init/version.c	(revision fcd7053c1b7bca76e2258a6b2b5ce5b3b416f00f)
@@ -36,11 +36,12 @@
 #include <unistd.h>
 #include <stdio.h>
+#include <macros.h>
 #include "init.h"
 #include "version.h"
 
-char *release = RELEASE;
+char *release = STRING(RELEASE);
 
 #ifdef REVISION
-	char *revision = ", revision " REVISION;
+	char *revision = ", revision " STRING(REVISION);
 #else
 	char *revision = "";
@@ -48,5 +49,5 @@
 
 #ifdef TIMESTAMP
-	char *timestamp = "\nBuilt on " TIMESTAMP;
+	char *timestamp = "\nBuilt on " STRING(TIMESTAMP);
 #else
 	char *timestamp = "";
Index: uspace/app/klog/Makefile
===================================================================
--- uspace/app/klog/Makefile	(revision 0fcfa488af4d5256b39dbabfae819c9a889745c1)
+++ uspace/app/klog/Makefile	(revision fcd7053c1b7bca76e2258a6b2b5ce5b3b416f00f)
@@ -30,8 +30,7 @@
 #
 
--include ../../../Makefile.config
-
 LIBC_PREFIX = ../../lib/libc
 SOFTINT_PREFIX = ../../lib/softint
+
 include $(LIBC_PREFIX)/Makefile.toolchain
 
@@ -61,5 +60,5 @@
 
 $(OUTPUT): $(OBJECTS) $(LIBS)
-	$(LD) -T $(LIBC_PREFIX)/arch/$(ARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map
+	$(LD) -T $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map
 
 disasm: $(OUTPUT).disasm
Index: uspace/app/tester/Makefile
===================================================================
--- uspace/app/tester/Makefile	(revision 0fcfa488af4d5256b39dbabfae819c9a889745c1)
+++ uspace/app/tester/Makefile	(revision fcd7053c1b7bca76e2258a6b2b5ce5b3b416f00f)
@@ -30,8 +30,7 @@
 #
 
--include ../../../Makefile.config
-
 LIBC_PREFIX = ../../lib/libc
 SOFTINT_PREFIX = ../../lib/softint
+
 include $(LIBC_PREFIX)/Makefile.toolchain
 
@@ -77,5 +76,5 @@
 
 $(OUTPUT): $(OBJECTS) $(LIBS)
-	$(LD) -T $(LIBC_PREFIX)/arch/$(ARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map
+	$(LD) -T $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map
 
 disasm: $(OUTPUT).disasm
Index: uspace/app/tetris/Makefile
===================================================================
--- uspace/app/tetris/Makefile	(revision 0fcfa488af4d5256b39dbabfae819c9a889745c1)
+++ uspace/app/tetris/Makefile	(revision fcd7053c1b7bca76e2258a6b2b5ce5b3b416f00f)
@@ -1,6 +1,5 @@
--include ../../../Makefile.config
-
 LIBC_PREFIX = ../../lib/libc
 SOFTINT_PREFIX = ../../lib/softint
+
 include $(LIBC_PREFIX)/Makefile.toolchain
 
@@ -21,5 +20,5 @@
 
 $(OUTPUT): $(OBJECTS) $(LIBS)
-	$(LD) -T $(LIBC_PREFIX)/arch/$(ARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map
+	$(LD) -T $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map
 
 clean:
Index: uspace/app/trace/Makefile
===================================================================
--- uspace/app/trace/Makefile	(revision 0fcfa488af4d5256b39dbabfae819c9a889745c1)
+++ uspace/app/trace/Makefile	(revision fcd7053c1b7bca76e2258a6b2b5ce5b3b416f00f)
@@ -30,8 +30,7 @@
 #
 
--include ../../../Makefile.config
-
 LIBC_PREFIX = ../../lib/libc
 SOFTINT_PREFIX = ../../lib/softint
+
 include $(LIBC_PREFIX)/Makefile.toolchain
 
@@ -66,5 +65,5 @@
 
 $(OUTPUT): $(OBJECTS) $(LIBS)
-	$(LD) -T $(LIBC_PREFIX)/arch/$(ARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map
+	$(LD) -T $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map
 
 disasm:
Index: uspace/lib/libblock/Makefile
===================================================================
--- uspace/lib/libblock/Makefile	(revision 0fcfa488af4d5256b39dbabfae819c9a889745c1)
+++ uspace/lib/libblock/Makefile	(revision fcd7053c1b7bca76e2258a6b2b5ce5b3b416f00f)
@@ -31,7 +31,6 @@
 #
 
--include ../../../Makefile.config
+LIBC_PREFIX = ../libc
 
-LIBC_PREFIX = ../libc
 ## Setup toolchain
 #
@@ -60,5 +59,5 @@
 
 depend:
-	-makedepend -f - -- $(DEFS) $(CFLAGS) -- $(SOURCES) > Makefile.depend 2> /dev/null
+	-makedepend -f - -- $(DEPEND_DEFS) $(CFLAGS) -- $(SOURCES) > Makefile.depend 2> /dev/null
 
 libblock.a: depend $(OBJECTS)
Index: uspace/lib/libc/Makefile
===================================================================
--- uspace/lib/libc/Makefile	(revision 0fcfa488af4d5256b39dbabfae819c9a889745c1)
+++ uspace/lib/libc/Makefile	(revision fcd7053c1b7bca76e2258a6b2b5ce5b3b416f00f)
@@ -30,8 +30,11 @@
 #
 
--include ../../../Makefile.config
-
 LIBC_PREFIX = $(shell pwd)
 SOFTINT_PREFIX = ../softint
+
+ifndef CROSS_PREFIX
+	CROSS_PREFIX = /usr/local
+endif
+
 
 ## Setup toolchain
@@ -40,7 +43,7 @@
 include $(LIBC_PREFIX)/Makefile.toolchain
 
+
 ## Sources
 #
-
 
 GENERIC_SOURCES = \
@@ -88,6 +91,6 @@
 
 ARCH_SOURCES += \
-	arch/$(ARCH)/src/entry.s \
-	arch/$(ARCH)/src/thread_entry.s
+	arch/$(UARCH)/src/entry.s \
+	arch/$(UARCH)/src/thread_entry.s
 
 GENERIC_OBJECTS := $(addsuffix .o,$(basename $(GENERIC_SOURCES)))
@@ -97,24 +100,24 @@
 .PHONY: all clean depend kerninc
 
-all: kerninc libc.a arch/$(ARCH)/_link.ld
+all: kerninc libc.a arch/$(UARCH)/_link.ld
 
 kerninc:
 	ln -sfn ../../../../kernel/generic/include include/kernel
 	ln -sfn kernel/arch include/arch
-	ln -sfn ../arch/$(ARCH)/include include/libarch
+	ln -sfn ../arch/$(UARCH)/include include/libarch
 
 -include Makefile.depend
 
 clean:
-	-rm -f include/kernel include/arch include/libarch libc.a arch/$(ARCH)/_link.ld Makefile.depend
-	find generic/ arch/$(ARCH)/ malloc -name '*.o' -follow -exec rm \{\} \;
+	-rm -f include/kernel include/arch include/libarch libc.a arch/$(UARCH)/_link.ld Makefile.depend
+	find generic/ arch/$(UARCH)/ malloc -name '*.o' -follow -exec rm \{\} \;
 
 depend: kerninc
-	-makedepend -f - -- $(DEFS) $(CFLAGS) -- $(ARCH_SOURCES) $(GENERIC_SOURCES) > Makefile.depend 2> /dev/null
+	-makedepend -f - -- $(DEPEND_DEFS) $(CFLAGS) -- $(ARCH_SOURCES) $(GENERIC_SOURCES) > Makefile.depend 2> /dev/null
 
 libc.a: depend $(ARCH_OBJECTS) $(GENERIC_OBJECTS)
 	$(AR) rc libc.a $(LIBS) $(ARCH_OBJECTS) $(GENERIC_OBJECTS)
 
-arch/$(ARCH)/_link.ld: arch/$(ARCH)/_link.ld.in
+arch/$(UARCH)/_link.ld: arch/$(UARCH)/_link.ld.in
 	$(CC) $(DEFS) $(CFLAGS) -DLIBC_PREFIX=$(LIBC_PREFIX) -E -x c $< | grep -v "^\#" > $@
 
Index: uspace/lib/libc/Makefile.toolchain
===================================================================
--- uspace/lib/libc/Makefile.toolchain	(revision 0fcfa488af4d5256b39dbabfae819c9a889745c1)
+++ uspace/lib/libc/Makefile.toolchain	(revision fcd7053c1b7bca76e2258a6b2b5ce5b3b416f00f)
@@ -27,6 +27,5 @@
 #
 
-DEFS = -DARCH=$(ARCH)
-CFLAGS = -fno-builtin -Wall -Werror-implicit-function-declaration -Wmissing-prototypes -O3 -nostdlib -nostdinc -I$(LIBC_PREFIX)/include -pipe -g
+CFLAGS = -fno-builtin -Wall -Werror-implicit-function-declaration -Wmissing-prototypes -O3 -nostdlib -nostdinc -imacros $(LIBC_PREFIX)/../../../config.h -I$(LIBC_PREFIX)/include -pipe -g
 LFLAGS = -M -N $(SOFTINT_PREFIX)/libsoftint.a
 AFLAGS =
@@ -35,5 +34,7 @@
 #
 
--include $(LIBC_PREFIX)/arch/$(ARCH)/Makefile.inc
+-include $(LIBC_PREFIX)/../../../Makefile.config
+-include $(LIBC_PREFIX)/../../../config.defs
+-include $(LIBC_PREFIX)/arch/$(UARCH)/Makefile.inc
 
 ## Simple detection of the host system
@@ -59,4 +60,5 @@
 	OBJCOPY = $(BINUTILS_PREFIX)objcopy
 	OBJDUMP = $(BINUTILS_PREFIX)objdump
+	DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
 endif
 
@@ -68,4 +70,5 @@
 	OBJCOPY = objcopy
 	OBJDUMP = objdump
+	DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
 endif
 
@@ -77,4 +80,4 @@
 	OBJCOPY = $(TOOLCHAIN_DIR)/$(TARGET)-objcopy
 	OBJDUMP = $(TOOLCHAIN_DIR)/$(TARGET)-objdump
+	DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
 endif
-
Index: uspace/lib/libc/arch/amd64/Makefile.inc
===================================================================
--- uspace/lib/libc/arch/amd64/Makefile.inc	(revision 0fcfa488af4d5256b39dbabfae819c9a889745c1)
+++ uspace/lib/libc/arch/amd64/Makefile.inc	(revision fcd7053c1b7bca76e2258a6b2b5ce5b3b416f00f)
@@ -30,14 +30,10 @@
 #
 
-ifndef CROSS_PREFIX
-	CROSS_PREFIX = /usr/local
-endif
-
 TARGET = amd64-linux-gnu
 TOOLCHAIN_DIR = $(CROSS_PREFIX)/amd64/bin
 
-ARCH_SOURCES += arch/$(ARCH)/src/syscall.S \
-		arch/$(ARCH)/src/fibril.S \
-		arch/$(ARCH)/src/tls.c
+ARCH_SOURCES += arch/$(UARCH)/src/syscall.S \
+	arch/$(UARCH)/src/fibril.S \
+	arch/$(UARCH)/src/tls.c
 
 LFLAGS += -N
Index: uspace/lib/libc/arch/amd64/_link.ld.in
===================================================================
--- uspace/lib/libc/arch/amd64/_link.ld.in	(revision 0fcfa488af4d5256b39dbabfae819c9a889745c1)
+++ uspace/lib/libc/arch/amd64/_link.ld.in	(revision fcd7053c1b7bca76e2258a6b2b5ce5b3b416f00f)
@@ -1,3 +1,3 @@
-STARTUP(LIBC_PREFIX/arch/ARCH/src/entry.o)
+STARTUP(LIBC_PREFIX/arch/UARCH/src/entry.o)
 ENTRY(__entry)
 
Index: uspace/lib/libc/arch/arm32/Makefile.inc
===================================================================
--- uspace/lib/libc/arch/arm32/Makefile.inc	(revision 0fcfa488af4d5256b39dbabfae819c9a889745c1)
+++ uspace/lib/libc/arch/arm32/Makefile.inc	(revision fcd7053c1b7bca76e2258a6b2b5ce5b3b416f00f)
@@ -31,18 +31,14 @@
 #
 
-ifndef CROSS_PREFIX
-	CROSS_PREFIX = /usr/local
-endif
-
 TARGET = arm-linux-gnu
 TOOLCHAIN_DIR = $(CROSS_PREFIX)/arm/bin
 CFLAGS += -ffixed-r9 -mtp=soft 
 LFLAGS += -N $(SOFTINT_PREFIX)/libsoftint.a
-AFLAGS += 
+AFLAGS +=
 
-ARCH_SOURCES += arch/$(ARCH)/src/syscall.c \
-		arch/$(ARCH)/src/fibril.S \
-		arch/$(ARCH)/src/tls.c \
-		arch/$(ARCH)/src/eabi.S
+ARCH_SOURCES += arch/$(UARCH)/src/syscall.c \
+	arch/$(UARCH)/src/fibril.S \
+	arch/$(UARCH)/src/tls.c \
+	arch/$(UARCH)/src/eabi.S
 
 BFD_NAME = elf32-littlearm
Index: uspace/lib/libc/arch/arm32/_link.ld.in
===================================================================
--- uspace/lib/libc/arch/arm32/_link.ld.in	(revision 0fcfa488af4d5256b39dbabfae819c9a889745c1)
+++ uspace/lib/libc/arch/arm32/_link.ld.in	(revision fcd7053c1b7bca76e2258a6b2b5ce5b3b416f00f)
@@ -1,3 +1,3 @@
-STARTUP(LIBC_PREFIX/arch/ARCH/src/entry.o)
+STARTUP(LIBC_PREFIX/arch/UARCH/src/entry.o)
 ENTRY(__entry)
 
Index: uspace/lib/libc/arch/ia32/Makefile.inc
===================================================================
--- uspace/lib/libc/arch/ia32/Makefile.inc	(revision 0fcfa488af4d5256b39dbabfae819c9a889745c1)
+++ uspace/lib/libc/arch/ia32/Makefile.inc	(revision fcd7053c1b7bca76e2258a6b2b5ce5b3b416f00f)
@@ -30,15 +30,11 @@
 #
 
-ifndef CROSS_PREFIX
-	CROSS_PREFIX = /usr/local
-endif
-
 TARGET = i686-pc-linux-gnu
 TOOLCHAIN_DIR = $(CROSS_PREFIX)/i686/bin
 
-ARCH_SOURCES += arch/$(ARCH)/src/syscall.S \
-		arch/$(ARCH)/src/fibril.S \
-		arch/$(ARCH)/src/tls.c \
-		arch/$(ARCH)/src/setjmp.S 
+ARCH_SOURCES += arch/$(UARCH)/src/syscall.S \
+	arch/$(UARCH)/src/fibril.S \
+	arch/$(UARCH)/src/tls.c \
+	arch/$(UARCH)/src/setjmp.S
 
 LFLAGS += -N
Index: uspace/lib/libc/arch/ia32/_link.ld.in
===================================================================
--- uspace/lib/libc/arch/ia32/_link.ld.in	(revision 0fcfa488af4d5256b39dbabfae819c9a889745c1)
+++ uspace/lib/libc/arch/ia32/_link.ld.in	(revision fcd7053c1b7bca76e2258a6b2b5ce5b3b416f00f)
@@ -1,3 +1,3 @@
-STARTUP(LIBC_PREFIX/arch/ARCH/src/entry.o)
+STARTUP(LIBC_PREFIX/arch/UARCH/src/entry.o)
 ENTRY(__entry)
 
Index: uspace/lib/libc/arch/ia64/Makefile.inc
===================================================================
--- uspace/lib/libc/arch/ia64/Makefile.inc	(revision 0fcfa488af4d5256b39dbabfae819c9a889745c1)
+++ uspace/lib/libc/arch/ia64/Makefile.inc	(revision fcd7053c1b7bca76e2258a6b2b5ce5b3b416f00f)
@@ -30,8 +30,4 @@
 #
 
-ifndef CROSS_PREFIX
-	CROSS_PREFIX = /usr/local
-endif
-
 TARGET = ia64-pc-linux-gnu
 TOOLCHAIN_DIR = $(CROSS_PREFIX)/ia64/bin
@@ -40,8 +36,8 @@
 AFLAGS += 
 
-ARCH_SOURCES += arch/$(ARCH)/src/syscall.S \
-		arch/$(ARCH)/src/fibril.S \
-		arch/$(ARCH)/src/tls.c\
-		arch/$(ARCH)/src/ddi.c
+ARCH_SOURCES += arch/$(UARCH)/src/syscall.S \
+	arch/$(UARCH)/src/fibril.S \
+	arch/$(UARCH)/src/tls.c \
+	arch/$(UARCH)/src/ddi.c
 
 BFD_NAME = elf64-ia64-little
Index: uspace/lib/libc/arch/ia64/_link.ld.in
===================================================================
--- uspace/lib/libc/arch/ia64/_link.ld.in	(revision 0fcfa488af4d5256b39dbabfae819c9a889745c1)
+++ uspace/lib/libc/arch/ia64/_link.ld.in	(revision fcd7053c1b7bca76e2258a6b2b5ce5b3b416f00f)
@@ -1,3 +1,3 @@
-STARTUP(LIBC_PREFIX/arch/ARCH/src/entry.o)
+STARTUP(LIBC_PREFIX/arch/UARCH/src/entry.o)
 ENTRY(__entry)
 
Index: uspace/lib/libc/arch/mips32/Makefile.inc
===================================================================
--- uspace/lib/libc/arch/mips32/Makefile.inc	(revision 0fcfa488af4d5256b39dbabfae819c9a889745c1)
+++ uspace/lib/libc/arch/mips32/Makefile.inc	(revision fcd7053c1b7bca76e2258a6b2b5ce5b3b416f00f)
@@ -30,21 +30,11 @@
 #
 
-ifndef CROSS_PREFIX
-	CROSS_PREFIX = /usr/local
-endif
-
 TARGET = mipsel-linux-gnu
 TOOLCHAIN_DIR = $(CROSS_PREFIX)/mipsel/bin
 CFLAGS += -mips3
 
--include ../../../Makefile.config
-ifeq ($(CONFIG_MIPS_FPU),y)
-	CFLAGS += -DCONFIG_MIPS_FPU
-endif
-
-ARCH_SOURCES += arch/$(ARCH)/src/syscall.c \
-	arch/$(ARCH)/src/fibril.S \
-	arch/$(ARCH)/src/tls.c
-
+ARCH_SOURCES += arch/$(UARCH)/src/syscall.c \
+	arch/$(UARCH)/src/fibril.S \
+	arch/$(UARCH)/src/tls.c
 
 BFD_ARCH = mips
Index: uspace/lib/libc/arch/mips32/_link.ld.in
===================================================================
--- uspace/lib/libc/arch/mips32/_link.ld.in	(revision 0fcfa488af4d5256b39dbabfae819c9a889745c1)
+++ uspace/lib/libc/arch/mips32/_link.ld.in	(revision fcd7053c1b7bca76e2258a6b2b5ce5b3b416f00f)
@@ -1,3 +1,3 @@
-STARTUP(LIBC_PREFIX/arch/ARCH/src/entry.o)
+STARTUP(LIBC_PREFIX/arch/UARCH/src/entry.o)
 ENTRY(__entry)
 
Index: uspace/lib/libc/arch/mips32eb/Makefile.inc
===================================================================
--- uspace/lib/libc/arch/mips32eb/Makefile.inc	(revision 0fcfa488af4d5256b39dbabfae819c9a889745c1)
+++ uspace/lib/libc/arch/mips32eb/Makefile.inc	(revision fcd7053c1b7bca76e2258a6b2b5ce5b3b416f00f)
@@ -30,15 +30,11 @@
 #
 
-ifndef CROSS_PREFIX
-	CROSS_PREFIX = /usr/local
-endif
-
 TARGET = mips-sgi-irix5
 TOOLCHAIN_DIR = $(CROSS_PREFIX)/mips/bin
 CFLAGS += -mips3 
 
-ARCH_SOURCES += arch/$(ARCH)/src/syscall.c \
-		arch/$(ARCH)/src/fibril.S \
-		arch/$(ARCH)/src/tls.c
+ARCH_SOURCES += arch/$(UARCH)/src/syscall.c \
+		arch/$(UARCH)/src/fibril.S \
+		arch/$(UARCH)/src/tls.c
 
 LFLAGS += -N
Index: uspace/lib/libc/arch/ppc32/Makefile.inc
===================================================================
--- uspace/lib/libc/arch/ppc32/Makefile.inc	(revision 0fcfa488af4d5256b39dbabfae819c9a889745c1)
+++ uspace/lib/libc/arch/ppc32/Makefile.inc	(revision fcd7053c1b7bca76e2258a6b2b5ce5b3b416f00f)
@@ -30,14 +30,10 @@
 #
 
-ifndef CROSS_PREFIX
-	CROSS_PREFIX = /usr/local
-endif
-
 TARGET = ppc-linux-gnu
 TOOLCHAIN_DIR = $(CROSS_PREFIX)/ppc/bin
 
-ARCH_SOURCES += arch/$(ARCH)/src/syscall.c \
-		arch/$(ARCH)/src/fibril.S \
-		arch/$(ARCH)/src/tls.c
+ARCH_SOURCES += arch/$(UARCH)/src/syscall.c \
+	arch/$(UARCH)/src/fibril.S \
+	arch/$(UARCH)/src/tls.c
 
 CFLAGS += -mcpu=powerpc -msoft-float -m32
Index: uspace/lib/libc/arch/ppc32/_link.ld.in
===================================================================
--- uspace/lib/libc/arch/ppc32/_link.ld.in	(revision 0fcfa488af4d5256b39dbabfae819c9a889745c1)
+++ uspace/lib/libc/arch/ppc32/_link.ld.in	(revision fcd7053c1b7bca76e2258a6b2b5ce5b3b416f00f)
@@ -1,3 +1,3 @@
-STARTUP(LIBC_PREFIX/arch/ARCH/src/entry.o)
+STARTUP(LIBC_PREFIX/arch/UARCH/src/entry.o)
 ENTRY(__entry)
 
Index: uspace/lib/libc/arch/sparc64/Makefile.inc
===================================================================
--- uspace/lib/libc/arch/sparc64/Makefile.inc	(revision 0fcfa488af4d5256b39dbabfae819c9a889745c1)
+++ uspace/lib/libc/arch/sparc64/Makefile.inc	(revision fcd7053c1b7bca76e2258a6b2b5ce5b3b416f00f)
@@ -30,13 +30,9 @@
 #
 
-ifndef CROSS_PREFIX
-	CROSS_PREFIX = /usr/local
-endif
-
 TARGET = sparc64-linux-gnu
 TOOLCHAIN_DIR = $(CROSS_PREFIX)/sparc64/bin
 
-ARCH_SOURCES += arch/$(ARCH)/src/fibril.S \
-		arch/$(ARCH)/src/tls.c
+ARCH_SOURCES += arch/$(UARCH)/src/fibril.S \
+	arch/$(UARCH)/src/tls.c
 
 CFLAGS += -mcpu=ultrasparc -m64
Index: uspace/lib/libc/arch/sparc64/_link.ld.in
===================================================================
--- uspace/lib/libc/arch/sparc64/_link.ld.in	(revision 0fcfa488af4d5256b39dbabfae819c9a889745c1)
+++ uspace/lib/libc/arch/sparc64/_link.ld.in	(revision fcd7053c1b7bca76e2258a6b2b5ce5b3b416f00f)
@@ -1,3 +1,3 @@
-STARTUP(LIBC_PREFIX/arch/ARCH/src/entry.o)
+STARTUP(LIBC_PREFIX/arch/UARCH/src/entry.o)
 ENTRY(__entry)
 
Index: uspace/lib/libc/include/macros.h
===================================================================
--- uspace/lib/libc/include/macros.h	(revision fcd7053c1b7bca76e2258a6b2b5ce5b3b416f00f)
+++ uspace/lib/libc/include/macros.h	(revision fcd7053c1b7bca76e2258a6b2b5ce5b3b416f00f)
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2009 Martin Decky
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup libc
+ * @{
+ */
+/** @file
+ */
+
+#ifndef LIBC_MACROS_H_
+#define LIBC_MACROS_H_
+
+#define SIZE2KB(size) ((size) >> 10)
+#define SIZE2MB(size) ((size) >> 20)
+
+#define KB2SIZE(kb) ((kb) << 10)
+#define MB2SIZE(mb) ((mb) << 20)
+
+#define STRING(arg) STRING_ARG(arg)
+#define STRING_ARG(arg) #arg
+
+#endif
+
+/** @}
+ */
Index: uspace/lib/libfs/Makefile
===================================================================
--- uspace/lib/libfs/Makefile	(revision 0fcfa488af4d5256b39dbabfae819c9a889745c1)
+++ uspace/lib/libfs/Makefile	(revision fcd7053c1b7bca76e2258a6b2b5ce5b3b416f00f)
@@ -31,7 +31,6 @@
 #
 
--include ../../../Makefile.config
+LIBC_PREFIX = ../libc
 
-LIBC_PREFIX = ../libc
 ## Setup toolchain
 #
@@ -60,5 +59,5 @@
 
 depend:
-	-makedepend -f - -- $(DEFS) $(CFLAGS) -- $(SOURCES) > Makefile.depend 2> /dev/null
+	-makedepend -f - -- $(DEPEND_DEFS) $(CFLAGS) -- $(SOURCES) > Makefile.depend 2> /dev/null
 
 libfs.a: depend $(OBJECTS)
Index: uspace/lib/softfloat/Makefile
===================================================================
--- uspace/lib/softfloat/Makefile	(revision 0fcfa488af4d5256b39dbabfae819c9a889745c1)
+++ uspace/lib/softfloat/Makefile	(revision fcd7053c1b7bca76e2258a6b2b5ce5b3b416f00f)
@@ -30,7 +30,6 @@
 #
 
--include ../../../Makefile.config
+LIBC_PREFIX = ../libc
 
-LIBC_PREFIX = ../libc
 ## Setup toolchain
 #
@@ -38,18 +37,18 @@
 include $(LIBC_PREFIX)/Makefile.toolchain
 
-CFLAGS +=-Iinclude -Iarch/$(ARCH)/include/
+CFLAGS +=-Iinclude -Iarch/$(UARCH)/include/
 
 ## Sources
 #
 
-GENERIC_SOURCES =		\
-	generic/add.c		\
-	generic/common.c	\
-	generic/comparison.c	\
-	generic/conversion.c	\
-	generic/div.c		\
-	generic/mul.c		\
-	generic/other.c		\
-	generic/softfloat.c	\
+GENERIC_SOURCES = \
+	generic/add.c \
+	generic/common.c \
+	generic/comparison.c \
+	generic/conversion.c \
+	generic/div.c \
+	generic/mul.c \
+	generic/other.c \
+	generic/softfloat.c \
 	generic/sub.c
 
@@ -69,5 +68,5 @@
 
 depend:
-	-makedepend -f - -- $(DEFS) $(CFLAGS) -- $(GENERIC_SOURCES) > Makefile.depend 2> /dev/null
+	-makedepend -f - -- $(DEPEND_DEFS) $(CFLAGS) -- $(GENERIC_SOURCES) > Makefile.depend 2> /dev/null
 
 libsoftfloat.a: depend $(ARCH_OBJECTS) $(GENERIC_OBJECTS)
Index: uspace/lib/softint/Makefile
===================================================================
--- uspace/lib/softint/Makefile	(revision 0fcfa488af4d5256b39dbabfae819c9a889745c1)
+++ uspace/lib/softint/Makefile	(revision fcd7053c1b7bca76e2258a6b2b5ce5b3b416f00f)
@@ -30,7 +30,6 @@
 #
 
--include ../../../Makefile.config
+LIBC_PREFIX = ../libc
 
-LIBC_PREFIX = ../libc
 ## Setup toolchain
 #
@@ -61,5 +60,5 @@
 
 depend:
-	-makedepend -f - -- $(DEFS) $(CFLAGS) -- $(GENERIC_SOURCES) > Makefile.depend 2> /dev/null
+	-makedepend -f - -- $(DEPEMD_DEFS) $(CFLAGS) -- $(GENERIC_SOURCES) > Makefile.depend 2> /dev/null
 
 libsoftint.a: depend $(ARCH_OBJECTS) $(GENERIC_OBJECTS)
Index: uspace/srv/console/Makefile
===================================================================
--- uspace/srv/console/Makefile	(revision 0fcfa488af4d5256b39dbabfae819c9a889745c1)
+++ uspace/srv/console/Makefile	(revision fcd7053c1b7bca76e2258a6b2b5ce5b3b416f00f)
@@ -30,9 +30,8 @@
 #
 
--include ../../../Makefile.config
-
 LIBC_PREFIX = ../../lib/libc
 SOFTINT_PREFIX = ../../lib/softint
-include $(LIBC_PREFIX)/Makefile.toolchain 
+
+include $(LIBC_PREFIX)/Makefile.toolchain
 
 CFLAGS += -I. -I../kbd/include -I../fb
@@ -75,5 +74,5 @@
 
 $(OUTPUT): $(OBJECTS) $(LIBS)
-	$(LD) -T $(LIBC_PREFIX)/arch/$(ARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map
+	$(LD) -T $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map
 
 disasm: $(OUTPUT).disasm
Index: uspace/srv/devmap/Makefile
===================================================================
--- uspace/srv/devmap/Makefile	(revision 0fcfa488af4d5256b39dbabfae819c9a889745c1)
+++ uspace/srv/devmap/Makefile	(revision fcd7053c1b7bca76e2258a6b2b5ce5b3b416f00f)
@@ -30,8 +30,7 @@
 #
 
--include ../../../Makefile.config
-
 LIBC_PREFIX = ../../lib/libc
 SOFTINT_PREFIX = ../../lib/softint
+
 include $(LIBC_PREFIX)/Makefile.toolchain
 
@@ -47,5 +46,5 @@
 	devmap.c 
 
-CFLAGS += -D$(ARCH)
+CFLAGS += -D$(UARCH)
 
 OBJECTS := $(addsuffix .o,$(basename $(SOURCES)))
@@ -64,5 +63,5 @@
 
 $(OUTPUT): $(OBJECTS) $(LIBS)
-	$(LD) -T $(LIBC_PREFIX)/arch/$(ARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map
+	$(LD) -T $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map
 
 disasm: $(OUTPUT).disasm
Index: uspace/srv/fb/Makefile
===================================================================
--- uspace/srv/fb/Makefile	(revision 0fcfa488af4d5256b39dbabfae819c9a889745c1)
+++ uspace/srv/fb/Makefile	(revision fcd7053c1b7bca76e2258a6b2b5ce5b3b416f00f)
@@ -30,8 +30,7 @@
 #
 
--include ../../../Makefile.config
-
 LIBC_PREFIX = ../../lib/libc
 SOFTINT_PREFIX = ../../lib/softint
+
 include $(LIBC_PREFIX)/Makefile.toolchain
 
@@ -48,39 +47,41 @@
 	ppm.c
 
-ifneq ($(ARCH), ia64)
+ifneq ($(UARCH),ia64)
 	SOURCES += fb.c \
 		font-8x16.c
 	CFLAGS += -DFB_ENABLED
 endif
-ifeq ($(ARCH), ia32)
+
+ifeq ($(UARCH),ia32)
 	SOURCES += ega.c
 	CFLAGS += -DEGA_ENABLED
 endif
-ifeq ($(ARCH), ia64)
+
+ifeq ($(UARCH),ia64)
 	SOURCES += ega.c \
-		   ski.c \
-		   serial_console.c
+		ski.c \
+		serial_console.c
 	CFLAGS += -DSKI_ENABLED
 	CFLAGS += -DEGA_ENABLED
 endif
-ifeq ($(ARCH), amd64)
+
+ifeq ($(UARCH),amd64)
 	SOURCES += ega.c
 	CFLAGS += -DEGA_ENABLED
 endif
-ifeq ($(ARCH), arm32)
-	CFLAGS += -DFB_INVERT_ENDIAN
+
+ifeq ($(UARCH),mips32)
+	SOURCES += msim.c \
+		serial_console.c
+	CFLAGS += -DMSIM_ENABLED
 endif
-ifeq ($(ARCH), mips32)
-	SOURCES += msim.c \
-                   serial_console.c
-	CFLAGS += -DMSIM_ENABLED -DFB_INVERT_ENDIAN
-endif
-ifeq ($(ARCH), sparc64)
+
+ifeq ($(UARCH),sparc64)
 	SOURCES += sgcn.c \
-	           serial_console.c
+		serial_console.c
 	CFLAGS += -DSGCN_ENABLED
 endif
 
-CFLAGS += -D$(ARCH)
+CFLAGS += -D$(UARCH)
 
 
@@ -100,5 +101,5 @@
 
 $(OUTPUT): $(OBJECTS) $(LIBS)
-	$(LD) -T $(LIBC_PREFIX)/arch/$(ARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map
+	$(LD) -T $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map
 
 disasm: $(OUTPUT).disasm
Index: uspace/srv/fb/fb.c
===================================================================
--- uspace/srv/fb/fb.c	(revision 0fcfa488af4d5256b39dbabfae819c9a889745c1)
+++ uspace/srv/fb/fb.c	(revision fcd7053c1b7bca76e2258a6b2b5ce5b3b416f00f)
@@ -237,18 +237,23 @@
 
 
+/** RGB 8:8:8 conversion
+ *
+ */
+static void rgb_888(void *dst, uint32_t rgb)
+{
+	((uint8_t *) dst)[0] = BLUE(rgb, 8);
+	((uint8_t *) dst)[1] = GREEN(rgb, 8);
+	((uint8_t *) dst)[2] = RED(rgb, 8);
+}
+
+
 /** BGR 8:8:8 conversion
  *
  */
-static void rgb_888(void *dst, uint32_t rgb)
-{
-#if defined(FB_INVERT_ENDIAN)
+static void bgr_888(void *dst, uint32_t rgb)
+{
 	((uint8_t *) dst)[0] = RED(rgb, 8);
 	((uint8_t *) dst)[1] = GREEN(rgb, 8);
 	((uint8_t *) dst)[2] = BLUE(rgb, 8);
-#else
-	((uint8_t *) dst)[0] = BLUE(rgb, 8);
-	((uint8_t *) dst)[1] = GREEN(rgb, 8);
-	((uint8_t *) dst)[2] = RED(rgb, 8);
-#endif
 }
 
@@ -596,4 +601,8 @@
 	case VISUAL_RGB_8_8_8:
 		screen.rgb_conv = rgb_888;
+		screen.pixelbytes = 3;
+		break;
+	case VISUAL_BGR_8_8_8:
+		screen.rgb_conv = bgr_888;
 		screen.pixelbytes = 3;
 		break;
Index: uspace/srv/fs/fat/Makefile
===================================================================
--- uspace/srv/fs/fat/Makefile	(revision 0fcfa488af4d5256b39dbabfae819c9a889745c1)
+++ uspace/srv/fs/fat/Makefile	(revision fcd7053c1b7bca76e2258a6b2b5ce5b3b416f00f)
@@ -30,10 +30,9 @@
 #
 
--include ../../../../Makefile.config
-
 LIBC_PREFIX = ../../../lib/libc
 LIBFS_PREFIX = ../../../lib/libfs
 LIBBLOCK_PREFIX = ../../../lib/libblock
 SOFTINT_PREFIX = ../../../lib/softint
+
 include $(LIBC_PREFIX)/Makefile.toolchain
 
@@ -71,5 +70,5 @@
 
 $(OUTPUT): $(OBJECTS) $(LIBS)
-	$(LD) -T $(LIBC_PREFIX)/arch/$(ARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map
+	$(LD) -T $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map
 
 disasm: $(OUTPUT).disasm
Index: uspace/srv/fs/fat/fat.c
===================================================================
--- uspace/srv/fs/fat/fat.c	(revision 0fcfa488af4d5256b39dbabfae819c9a889745c1)
+++ uspace/srv/fs/fat/fat.c	(revision fcd7053c1b7bca76e2258a6b2b5ce5b3b416f00f)
@@ -123,5 +123,5 @@
 	int rc;
 
-	printf("FAT: HelenOS FAT file system server.\n");
+	printf("fat: HelenOS FAT file system server.\n");
 
 	rc = fat_idx_init();
Index: uspace/srv/fs/tmpfs/Makefile
===================================================================
--- uspace/srv/fs/tmpfs/Makefile	(revision 0fcfa488af4d5256b39dbabfae819c9a889745c1)
+++ uspace/srv/fs/tmpfs/Makefile	(revision fcd7053c1b7bca76e2258a6b2b5ce5b3b416f00f)
@@ -30,10 +30,9 @@
 #
 
--include ../../../../Makefile.config
-
 LIBC_PREFIX = ../../../lib/libc
 LIBFS_PREFIX = ../../../lib/libfs
 LIBBLOCK_PREFIX = ../../../lib/libblock
 SOFTINT_PREFIX = ../../../lib/softint
+
 include $(LIBC_PREFIX)/Makefile.toolchain
 
@@ -69,5 +68,5 @@
 
 $(OUTPUT): $(OBJECTS) $(LIBS)
-	$(LD) -T $(LIBC_PREFIX)/arch/$(ARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map
+	$(LD) -T $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map
 
 disasm: $(OUTPUT).disasm
Index: uspace/srv/kbd/Makefile
===================================================================
--- uspace/srv/kbd/Makefile	(revision 0fcfa488af4d5256b39dbabfae819c9a889745c1)
+++ uspace/srv/kbd/Makefile	(revision fcd7053c1b7bca76e2258a6b2b5ce5b3b416f00f)
@@ -30,8 +30,7 @@
 #
 
--include ../../../Makefile.config
-
 LIBC_PREFIX = ../../lib/libc
 SOFTINT_PREFIX = ../../lib/softint
+
 include $(LIBC_PREFIX)/Makefile.toolchain
 
@@ -49,48 +48,48 @@
 
 ARCH_SOURCES = \
-	arch/$(ARCH)/src/kbd.c
+	arch/$(UARCH)/src/kbd.c
 
-ifeq ($(ARCH), ia32)
+ifeq ($(UARCH), ia32)
 	ARCH_SOURCES += \
-		arch/$(ARCH)/src/mouse.c \
-		arch/$(ARCH)/src/scanc.c
+		arch/$(UARCH)/src/mouse.c \
+		arch/$(UARCH)/src/scanc.c
 	GENARCH_SOURCES = \
 		genarch/src/kbd.c
 	CFLAGS += -DMOUSE_ENABLED
 endif
-ifeq ($(ARCH), ia64)
+ifeq ($(UARCH), ia64)
 	ARCH_SOURCES += \
-		arch/$(ARCH)/src/mouse.c \
-		arch/$(ARCH)/src/scanc.c \
-		arch/$(ARCH)/src/lkbd.c
+		arch/$(UARCH)/src/mouse.c \
+		arch/$(UARCH)/src/scanc.c \
+		arch/$(UARCH)/src/lkbd.c
 	GENARCH_SOURCES = \
 		genarch/src/kbd.c
 	CFLAGS += -DMOUSE_ENABLED
 endif
-ifeq ($(ARCH), amd64)
+ifeq ($(UARCH), amd64)
 	ARCH_SOURCES += \
-		arch/$(ARCH)/src/mouse.c \
-		arch/$(ARCH)/src/scanc.c
+		arch/$(UARCH)/src/mouse.c \
+		arch/$(UARCH)/src/scanc.c
 	GENARCH_SOURCES = \
 		genarch/src/kbd.c
 	CFLAGS += -DMOUSE_ENABLED
 endif
-ifeq ($(ARCH), sparc64)
+ifeq ($(UARCH), sparc64)
 	ARCH_SOURCES += \
-		arch/$(ARCH)/src/scanc.c \
-		arch/$(ARCH)/src/sgcn.c
+		arch/$(UARCH)/src/scanc.c \
+		arch/$(UARCH)/src/sgcn.c
 	GENARCH_SOURCES = \
 		genarch/src/kbd.c \
 		genarch/src/nofb.c
 endif
-ifeq ($(ARCH), arm32)
+ifeq ($(UARCH), arm32)
 	ARCH_SOURCES += \
-		arch/$(ARCH)/src/kbd_gxemul.c
+		arch/$(UARCH)/src/kbd_gxemul.c
 endif
-ifeq ($(ARCH), mips32)
+ifeq ($(UARCH), mips32)
 	GENARCH_SOURCES += \
 	    genarch/src/nofb.c
 endif
-ifeq ($(ARCH), mips32eb)
+ifeq ($(UARCH), mips32eb)
 	GENARCH_SOURCES += \
 	    genarch/src/nofb.c
@@ -110,5 +109,5 @@
 
 links:
-	ln -sfn ../arch/$(ARCH)/include include/arch
+	ln -sfn ../arch/$(UARCH)/include include/arch
 	ln -sfn ../genarch/include include/genarch
 
@@ -120,5 +119,5 @@
 
 $(OUTPUT): $(OBJECTS) $(LIBS)
-	$(LD) -T $(LIBC_PREFIX)/arch/$(ARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map
+	$(LD) -T $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map
 
 disasm: $(OUTPUT).disasm
Index: uspace/srv/kbd/arch/ia64/src/kbd.c
===================================================================
--- uspace/srv/kbd/arch/ia64/src/kbd.c	(revision 0fcfa488af4d5256b39dbabfae819c9a889745c1)
+++ uspace/srv/kbd/arch/ia64/src/kbd.c	(revision fcd7053c1b7bca76e2258a6b2b5ce5b3b416f00f)
@@ -115,16 +115,4 @@
 
 
-
-irq_cmd_t ski_cmds[1] = {
-	{ CMD_IA64_GETCHAR, 0, 0, 2 }
-};
-
-irq_code_t ski_kbd = {
-	1,
-	ski_cmds
-};
-
-
-
 irq_cmd_t ns16550_cmds[1] = {
 	{ CMD_PORT_READ_1, 0, 0, 2 },
@@ -145,13 +133,13 @@
 	if (sysinfo_value("kbd")) {
 		kbd_type=sysinfo_value("kbd.type");
-		if(kbd_type==KBD_SKI) ipc_register_irq(sysinfo_value("kbd.inr"), sysinfo_value("kbd.devno"), 0, &ski_kbd);
-		if(kbd_type==KBD_LEGACY) return lkbd_arch_init();
-		if(kbd_type==KBD_NS16550) {
-			ns16550_kbd.cmds[0].addr= (void *)  (sysinfo_value("kbd.port")+RBR_REG);
+		if (kbd_type == KBD_LEGACY)
+			return lkbd_arch_init();
+		if (kbd_type == KBD_NS16550) {
+			ns16550_kbd.cmds[0].addr = (void *) (sysinfo_value("kbd.port") + RBR_REG);
 			ipc_register_irq(sysinfo_value("kbd.inr"), sysinfo_value("kbd.devno"), 0, &ns16550_kbd);
-			iospace_enable(task_get_id(),ns16550_port=sysinfo_value("kbd.port"),8);
-		}	
+			iospace_enable(task_get_id(), ns16550_port = sysinfo_value("kbd.port"), 8);
+		}
 		return 0;
-	}	
+	}
 	return 1;
 }
@@ -171,7 +159,7 @@
 	static unsigned long buf = 0;
 	static int count = 0, esc_count=0;	
-
+	
 	int scan_code = IPC_GET_ARG2(*call);
-
+	
 	if (scan_code == 0x1b) {
 		esc_count++;
@@ -182,8 +170,10 @@
 		esc_count = 0;
 	}
-
-	if(scan_code==0x0d) return 1;	//Delete CR
-	if(scan_code==0x7f) scan_code='\b';	//Convert backspace
-
+	
+	if (scan_code == 0x0d)
+		return 1;        /* Delete CR */
+	if (scan_code == 0x7f)
+		scan_code='\b';  /* Convert backspace */
+	
 	if(scan_code == 0x7e) {
 		switch (buf) {
@@ -308,10 +298,4 @@
 	return 1;
 }
-
-
-
-
-
-
 
 int kbd_ski_process(keybuffer_t *keybuffer, ipc_call_t *call) 
@@ -394,9 +378,10 @@
 {
 	printf("KBD Key pressed: %x(%c)\n",IPC_GET_ARG2(*call),IPC_GET_ARG2(*call));
-	if(kbd_type==KBD_SKI) return kbd_ski_process(keybuffer,call);
-	if(kbd_type==KBD_NS16550) return kbd_ns16550_process(keybuffer,call);
-	if(kbd_type==KBD_LEGACY) return lkbd_arch_process(keybuffer,call);
-
-	
+	if (kbd_type == KBD_SKI)
+		return kbd_ski_process(keybuffer, call);
+	if (kbd_type == KBD_NS16550)
+		return kbd_ns16550_process(keybuffer,call);
+	if (kbd_type == KBD_LEGACY)
+		return lkbd_arch_process(keybuffer,call);
 }
 
@@ -405,3 +390,3 @@
 /**
  * @}
- */ 
+ */
Index: uspace/srv/kbd/arch/ppc32/src/kbd.c
===================================================================
--- uspace/srv/kbd/arch/ppc32/src/kbd.c	(revision 0fcfa488af4d5256b39dbabfae819c9a889745c1)
+++ uspace/srv/kbd/arch/ppc32/src/kbd.c	(revision fcd7053c1b7bca76e2258a6b2b5ce5b3b416f00f)
@@ -40,13 +40,4 @@
 #include <kbd.h>
 #include <keys.h>
-
-irq_cmd_t cuda_cmds[1] = {
-	{ CMD_PPC32_GETCHAR, 0, 0, 2 }
-};
-
-irq_code_t cuda_kbd = {
-	1,
-	cuda_cmds
-};
 
 
@@ -187,5 +178,5 @@
 		return 0;
 	
-	return ipc_register_irq(sysinfo_value("kbd.inr"), sysinfo_value("kbd.devno"), 0, &cuda_kbd);
+	return ipc_register_irq(sysinfo_value("kbd.inr"), sysinfo_value("kbd.devno"), 0, 0);
 }
 
Index: uspace/srv/loader/Makefile
===================================================================
--- uspace/srv/loader/Makefile	(revision 0fcfa488af4d5256b39dbabfae819c9a889745c1)
+++ uspace/srv/loader/Makefile	(revision fcd7053c1b7bca76e2258a6b2b5ce5b3b416f00f)
@@ -28,6 +28,4 @@
 #
 
--include ../../../Makefile.config
-
 ## Setup toolchain
 #
@@ -35,19 +33,11 @@
 LIBC_PREFIX = ../../lib/libc
 SOFTINT_PREFIX = ../../lib/softint
+
 include $(LIBC_PREFIX)/Makefile.toolchain
-include arch/$(ARCH)/Makefile.inc
+include arch/$(UARCH)/Makefile.inc
 
 CFLAGS += -Iinclude
 
 LIBS = $(LIBC_PREFIX)/libc.a $(SOFTINT_PREFIX)/libsoftint.a
-DEFS += -DRELEASE=\"$(RELEASE)\"
-
-ifdef REVISION
-	DEFS += "-DREVISION=\"$(REVISION)\""
-endif
-
-ifdef TIMESTAMP
-	DEFS += "-DTIMESTAMP=\"$(TIMESTAMP)\""
-endif
 
 ## Sources
@@ -70,16 +60,16 @@
 
 clean:
-	-rm -f $(OUTPUT) $(OBJECTS) $(OUTPUT).map $(OUTPUT).disasm arch/$(ARCH)/_link.ld Makefile.depend
+	-rm -f $(OUTPUT) $(OBJECTS) $(OUTPUT).map $(OUTPUT).disasm arch/$(UARCH)/_link.ld Makefile.depend
 
 depend:
 	$(CC) $(DEFS) $(CFLAGS) -M $(SOURCES) > Makefile.depend
 
-$(OUTPUT): $(OBJECTS) $(LIBS) arch/$(ARCH)/_link.ld
-	$(LD) -T arch/$(ARCH)/_link.ld $(LFLAGS) $(OBJECTS) $(LIBS) -o $@ -Map $(OUTPUT).map
+$(OUTPUT): $(OBJECTS) $(LIBS) arch/$(UARCH)/_link.ld
+	$(LD) -T arch/$(UARCH)/_link.ld $(LFLAGS) $(OBJECTS) $(LIBS) -o $@ -Map $(OUTPUT).map
 
 disasm:
 	$(OBJDUMP) -d $(OUTPUT) >$(OUTPUT).disasm
 
-arch/$(ARCH)/_link.ld: arch/$(ARCH)/_link.ld.in
+arch/$(UARCH)/_link.ld: arch/$(UARCH)/_link.ld.in
 	$(CC) $(DEFS) $(CFLAGS) -DLIBC_PREFIX=$(LIBC_PREFIX) -E -x c $< | grep -v "^\#" > $@
 
Index: uspace/srv/loader/arch/amd64/Makefile.inc
===================================================================
--- uspace/srv/loader/arch/amd64/Makefile.inc	(revision 0fcfa488af4d5256b39dbabfae819c9a889745c1)
+++ uspace/srv/loader/arch/amd64/Makefile.inc	(revision fcd7053c1b7bca76e2258a6b2b5ce5b3b416f00f)
@@ -28,3 +28,3 @@
 
 CFLAGS += -D__64_BITS__
-ARCH_SOURCES := arch/$(ARCH)/amd64.s
+ARCH_SOURCES := arch/$(UARCH)/amd64.s
Index: uspace/srv/loader/arch/amd64/_link.ld.in
===================================================================
--- uspace/srv/loader/arch/amd64/_link.ld.in	(revision 0fcfa488af4d5256b39dbabfae819c9a889745c1)
+++ uspace/srv/loader/arch/amd64/_link.ld.in	(revision fcd7053c1b7bca76e2258a6b2b5ce5b3b416f00f)
@@ -1,3 +1,3 @@
-STARTUP(LIBC_PREFIX/arch/ARCH/src/entry.o)
+STARTUP(LIBC_PREFIX/arch/UARCH/src/entry.o)
 ENTRY(__entry)
 
Index: uspace/srv/loader/arch/arm32/Makefile.inc
===================================================================
--- uspace/srv/loader/arch/arm32/Makefile.inc	(revision 0fcfa488af4d5256b39dbabfae819c9a889745c1)
+++ uspace/srv/loader/arch/arm32/Makefile.inc	(revision fcd7053c1b7bca76e2258a6b2b5ce5b3b416f00f)
@@ -28,3 +28,3 @@
 
 CFLAGS += -D__32_BITS__
-ARCH_SOURCES := arch/$(ARCH)/arm32.s
+ARCH_SOURCES := arch/$(UARCH)/arm32.s
Index: uspace/srv/loader/arch/arm32/_link.ld.in
===================================================================
--- uspace/srv/loader/arch/arm32/_link.ld.in	(revision 0fcfa488af4d5256b39dbabfae819c9a889745c1)
+++ uspace/srv/loader/arch/arm32/_link.ld.in	(revision fcd7053c1b7bca76e2258a6b2b5ce5b3b416f00f)
@@ -1,7 +1,7 @@
-/* 
+/*
  * The only difference from _link.ld.in for regular statically-linked apps
  * is the base address.
  */
-STARTUP(LIBC_PREFIX/arch/ARCH/src/entry.o)
+STARTUP(LIBC_PREFIX/arch/UARCH/src/entry.o)
 ENTRY(__entry)
 
Index: uspace/srv/loader/arch/ia32/Makefile.inc
===================================================================
--- uspace/srv/loader/arch/ia32/Makefile.inc	(revision 0fcfa488af4d5256b39dbabfae819c9a889745c1)
+++ uspace/srv/loader/arch/ia32/Makefile.inc	(revision fcd7053c1b7bca76e2258a6b2b5ce5b3b416f00f)
@@ -28,3 +28,3 @@
 
 CFLAGS += -D__32_BITS__
-ARCH_SOURCES := arch/$(ARCH)/ia32.s
+ARCH_SOURCES := arch/$(UARCH)/ia32.s
Index: uspace/srv/loader/arch/ia32/_link.ld.in
===================================================================
--- uspace/srv/loader/arch/ia32/_link.ld.in	(revision 0fcfa488af4d5256b39dbabfae819c9a889745c1)
+++ uspace/srv/loader/arch/ia32/_link.ld.in	(revision fcd7053c1b7bca76e2258a6b2b5ce5b3b416f00f)
@@ -1,7 +1,7 @@
-/* 
+/*
  * The difference from _link.ld.in for regular statically-linked apps
  * is the base address and the special interp section.
  */
-STARTUP(LIBC_PREFIX/arch/ARCH/src/entry.o)
+STARTUP(LIBC_PREFIX/arch/UARCH/src/entry.o)
 ENTRY(__entry)
 
Index: uspace/srv/loader/arch/ia64/Makefile.inc
===================================================================
--- uspace/srv/loader/arch/ia64/Makefile.inc	(revision 0fcfa488af4d5256b39dbabfae819c9a889745c1)
+++ uspace/srv/loader/arch/ia64/Makefile.inc	(revision fcd7053c1b7bca76e2258a6b2b5ce5b3b416f00f)
@@ -28,4 +28,4 @@
 
 CFLAGS += -D__64_BITS__
-ARCH_SOURCES := arch/$(ARCH)/ia64.s
+ARCH_SOURCES := arch/$(UARCH)/ia64.s
 AFLAGS += -xexplicit
Index: uspace/srv/loader/arch/ia64/_link.ld.in
===================================================================
--- uspace/srv/loader/arch/ia64/_link.ld.in	(revision 0fcfa488af4d5256b39dbabfae819c9a889745c1)
+++ uspace/srv/loader/arch/ia64/_link.ld.in	(revision fcd7053c1b7bca76e2258a6b2b5ce5b3b416f00f)
@@ -1,3 +1,3 @@
-STARTUP(LIBC_PREFIX/arch/ARCH/src/entry.o)
+STARTUP(LIBC_PREFIX/arch/UARCH/src/entry.o)
 ENTRY(__entry)
 
Index: uspace/srv/loader/arch/mips32/Makefile.inc
===================================================================
--- uspace/srv/loader/arch/mips32/Makefile.inc	(revision 0fcfa488af4d5256b39dbabfae819c9a889745c1)
+++ uspace/srv/loader/arch/mips32/Makefile.inc	(revision fcd7053c1b7bca76e2258a6b2b5ce5b3b416f00f)
@@ -28,3 +28,3 @@
 
 CFLAGS += -D__32_BITS__
-ARCH_SOURCES := arch/$(ARCH)/mips32.s
+ARCH_SOURCES := arch/$(UARCH)/mips32.s
Index: uspace/srv/loader/arch/mips32/_link.ld.in
===================================================================
--- uspace/srv/loader/arch/mips32/_link.ld.in	(revision 0fcfa488af4d5256b39dbabfae819c9a889745c1)
+++ uspace/srv/loader/arch/mips32/_link.ld.in	(revision fcd7053c1b7bca76e2258a6b2b5ce5b3b416f00f)
@@ -1,7 +1,7 @@
-/* 
+/*
  * The only difference from _link.ld.in for regular statically-linked apps
  * is the base address.
  */
-STARTUP(LIBC_PREFIX/arch/ARCH/src/entry.o)
+STARTUP(LIBC_PREFIX/arch/UARCH/src/entry.o)
 ENTRY(__entry)
 
Index: uspace/srv/loader/arch/ppc32/Makefile.inc
===================================================================
--- uspace/srv/loader/arch/ppc32/Makefile.inc	(revision 0fcfa488af4d5256b39dbabfae819c9a889745c1)
+++ uspace/srv/loader/arch/ppc32/Makefile.inc	(revision fcd7053c1b7bca76e2258a6b2b5ce5b3b416f00f)
@@ -28,3 +28,3 @@
 
 CFLAGS += -D__32_BITS__
-ARCH_SOURCES := arch/$(ARCH)/ppc32.s
+ARCH_SOURCES := arch/$(UARCH)/ppc32.s
Index: uspace/srv/loader/arch/ppc32/_link.ld.in
===================================================================
--- uspace/srv/loader/arch/ppc32/_link.ld.in	(revision 0fcfa488af4d5256b39dbabfae819c9a889745c1)
+++ uspace/srv/loader/arch/ppc32/_link.ld.in	(revision fcd7053c1b7bca76e2258a6b2b5ce5b3b416f00f)
@@ -1,7 +1,7 @@
-/* 
+/*
  * The only difference from _link.ld.in for regular statically-linked apps
  * is the base address.
  */
-STARTUP(LIBC_PREFIX/arch/ARCH/src/entry.o)
+STARTUP(LIBC_PREFIX/arch/UARCH/src/entry.o)
 ENTRY(__entry)
 
Index: uspace/srv/loader/arch/sparc64/Makefile.inc
===================================================================
--- uspace/srv/loader/arch/sparc64/Makefile.inc	(revision 0fcfa488af4d5256b39dbabfae819c9a889745c1)
+++ uspace/srv/loader/arch/sparc64/Makefile.inc	(revision fcd7053c1b7bca76e2258a6b2b5ce5b3b416f00f)
@@ -28,3 +28,3 @@
 
 CFLAGS += -D__64_BITS__
-ARCH_SOURCES := arch/$(ARCH)/sparc64.s
+ARCH_SOURCES := arch/$(UARCH)/sparc64.s
Index: uspace/srv/loader/arch/sparc64/_link.ld.in
===================================================================
--- uspace/srv/loader/arch/sparc64/_link.ld.in	(revision 0fcfa488af4d5256b39dbabfae819c9a889745c1)
+++ uspace/srv/loader/arch/sparc64/_link.ld.in	(revision fcd7053c1b7bca76e2258a6b2b5ce5b3b416f00f)
@@ -1,3 +1,3 @@
-STARTUP(LIBC_PREFIX/arch/ARCH/src/entry.o)
+STARTUP(LIBC_PREFIX/arch/UARCH/src/entry.o)
 ENTRY(__entry)
 
Index: uspace/srv/ns/Makefile
===================================================================
--- uspace/srv/ns/Makefile	(revision 0fcfa488af4d5256b39dbabfae819c9a889745c1)
+++ uspace/srv/ns/Makefile	(revision fcd7053c1b7bca76e2258a6b2b5ce5b3b416f00f)
@@ -30,8 +30,7 @@
 #
 
--include ../../../Makefile.config
-
 LIBC_PREFIX = ../../lib/libc
 SOFTINT_PREFIX = ../../lib/softint
+
 include $(LIBC_PREFIX)/Makefile.toolchain
 
@@ -60,5 +59,5 @@
 
 $(OUTPUT): $(OBJECTS) $(LIBS)
-	$(LD) -T $(LIBC_PREFIX)/arch/$(ARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map
+	$(LD) -T $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map
 
 disasm: $(OUTPUT).disasm
Index: uspace/srv/pci/Makefile
===================================================================
--- uspace/srv/pci/Makefile	(revision 0fcfa488af4d5256b39dbabfae819c9a889745c1)
+++ uspace/srv/pci/Makefile	(revision fcd7053c1b7bca76e2258a6b2b5ce5b3b416f00f)
@@ -30,8 +30,7 @@
 #
 
--include ../../../Makefile.config
-
 LIBC_PREFIX = ../../lib/libc
 SOFTINT_PREFIX = ../../lib/softint
+
 include $(LIBC_PREFIX)/Makefile.toolchain
 
@@ -63,5 +62,5 @@
 $(OUTPUT): $(OBJECTS) $(LIBS)
 	$(MAKE) -C libpci
-	$(LD) -T $(LIBC_PREFIX)/arch/$(ARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map
+	$(LD) -T $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map
 
 disasm:
Index: uspace/srv/pci/libpci/Makefile
===================================================================
--- uspace/srv/pci/libpci/Makefile	(revision 0fcfa488af4d5256b39dbabfae819c9a889745c1)
+++ uspace/srv/pci/libpci/Makefile	(revision fcd7053c1b7bca76e2258a6b2b5ce5b3b416f00f)
@@ -3,6 +3,4 @@
 
 # Modified and ported to HelenOS by Jakub Jermar
-
--include ../../../../Makefile.config
 
 LIBC_PREFIX=$(shell cd ../../../lib/libc; pwd)
Index: uspace/srv/rd/Makefile
===================================================================
--- uspace/srv/rd/Makefile	(revision 0fcfa488af4d5256b39dbabfae819c9a889745c1)
+++ uspace/srv/rd/Makefile	(revision fcd7053c1b7bca76e2258a6b2b5ce5b3b416f00f)
@@ -30,8 +30,8 @@
 #
 
--include ../../../Makefile.config
 
 LIBC_PREFIX = ../../lib/libc
 SOFTINT_PREFIX = ../../lib/softint
+
 include $(LIBC_PREFIX)/Makefile.toolchain
 
@@ -60,5 +60,5 @@
 
 $(OUTPUT): $(OBJECTS) $(LIBS)
-	$(LD) -T $(LIBC_PREFIX)/arch/$(ARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map
+	$(LD) -T $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map
 
 disasm: $(OUTPUT).disasm
Index: uspace/srv/vfs/Makefile
===================================================================
--- uspace/srv/vfs/Makefile	(revision 0fcfa488af4d5256b39dbabfae819c9a889745c1)
+++ uspace/srv/vfs/Makefile	(revision fcd7053c1b7bca76e2258a6b2b5ce5b3b416f00f)
@@ -31,8 +31,7 @@
 #
 
--include ../../../Makefile.config
-
 LIBC_PREFIX = ../../lib/libc
 SOFTINT_PREFIX = ../../lib/softint
+
 include $(LIBC_PREFIX)/Makefile.toolchain
 
@@ -66,5 +65,5 @@
 
 $(OUTPUT): $(OBJECTS) $(LIBS)
-	$(LD) -T $(LIBC_PREFIX)/arch/$(ARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map
+	$(LD) -T $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld $(OBJECTS) $(LIBS) $(LFLAGS) -o $@ -Map $(OUTPUT).map
 
 disasm: $(OUTPUT).disasm
