Index: libc/Makefile
===================================================================
--- libc/Makefile	(revision 12665431deed59bc8d76f61f17368d17c55d2bcb)
+++ libc/Makefile	(revision 1a030b81c465d23c2fff25eaf91615fbf427c804)
@@ -44,7 +44,6 @@
 	generic/io.c
 
-ARCH_SOURCES = \
-	arch/$(ARCH)/src/entry.s \
-	arch/$(ARCH)/src/syscall.c
+ARCH_SOURCES += \
+	arch/$(ARCH)/src/entry.s
 
 GENERIC_OBJECTS := $(addsuffix .o,$(basename $(GENERIC_SOURCES)))
Index: libc/arch/amd64/Makefile.inc
===================================================================
--- libc/arch/amd64/Makefile.inc	(revision 1a030b81c465d23c2fff25eaf91615fbf427c804)
+++ libc/arch/amd64/Makefile.inc	(revision 1a030b81c465d23c2fff25eaf91615fbf427c804)
@@ -0,0 +1,35 @@
+#
+# Copyright (C) 2005 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.
+#
+
+## Toolchain configuration
+#
+
+TARGET = amd64-linux-gnu
+TOOLCHAIN_DIR = /usr/local/amd64/bin
+
+ARCH_SOURCES += arch/$(ARCH)/src/syscall.S
Index: libc/arch/amd64/_link.ld.in
===================================================================
--- libc/arch/amd64/_link.ld.in	(revision 1a030b81c465d23c2fff25eaf91615fbf427c804)
+++ libc/arch/amd64/_link.ld.in	(revision 1a030b81c465d23c2fff25eaf91615fbf427c804)
@@ -0,0 +1,8 @@
+OUTPUT_FORMAT(binary)
+STARTUP(../libc/arch/ARCH/src/entry.o)
+ENTRY(__entry)
+
+SECTIONS {
+ .text 0x00001000 : {
+ }
+}
Index: libc/arch/amd64/include/types.h
===================================================================
--- libc/arch/amd64/include/types.h	(revision 1a030b81c465d23c2fff25eaf91615fbf427c804)
+++ libc/arch/amd64/include/types.h	(revision 1a030b81c465d23c2fff25eaf91615fbf427c804)
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2006 Ondrej Palkovsky
+ * 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.
+ */
+
+#ifndef __LIBC__TYPES_H__
+#define __LIBC__TYPES_H__
+
+typedef unsigned long long sysarg_t;
+typedef unsigned int size_t;
+typedef signed int ssize_t;
+
+#endif
Index: libc/arch/amd64/src/entry.s
===================================================================
--- libc/arch/amd64/src/entry.s	(revision 1a030b81c465d23c2fff25eaf91615fbf427c804)
+++ libc/arch/amd64/src/entry.s	(revision 1a030b81c465d23c2fff25eaf91615fbf427c804)
@@ -0,0 +1,42 @@
+#
+# Copyright (C) 2006 Ondrej Palkovsky
+# 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.
+#
+
+.text
+
+.org 0
+
+.globl __entry
+
+## User-space task entry point
+#
+#
+__entry:
+	call main
+	call __exit
+	
+.end __entry
Index: libc/arch/amd64/src/syscall.S
===================================================================
--- libc/arch/amd64/src/syscall.S	(revision 1a030b81c465d23c2fff25eaf91615fbf427c804)
+++ libc/arch/amd64/src/syscall.S	(revision 1a030b81c465d23c2fff25eaf91615fbf427c804)
@@ -0,0 +1,40 @@
+#
+# Copyright (C) 2006 Ondrej Palkovsky
+# 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.
+#
+
+.text
+	
+.globl __syscall
+
+	
+__syscall:
+	# rcx gets rewritten on syscall
+	movq %rcx, %r9
+	syscall
+	ret
+	
+.end __syscall
Index: libc/arch/ia32/Makefile.inc
===================================================================
--- libc/arch/ia32/Makefile.inc	(revision 12665431deed59bc8d76f61f17368d17c55d2bcb)
+++ libc/arch/ia32/Makefile.inc	(revision 1a030b81c465d23c2fff25eaf91615fbf427c804)
@@ -32,2 +32,4 @@
 TARGET = i686-pc-linux-gnu
 TOOLCHAIN_DIR = /usr/local/i686/bin
+
+ARCH_SOURCES += arch/$(ARCH)/src/syscall.c
Index: libc/arch/mips32/Makefile.inc
===================================================================
--- libc/arch/mips32/Makefile.inc	(revision 12665431deed59bc8d76f61f17368d17c55d2bcb)
+++ libc/arch/mips32/Makefile.inc	(revision 1a030b81c465d23c2fff25eaf91615fbf427c804)
@@ -33,2 +33,4 @@
 TOOLCHAIN_DIR = /usr/local/mipsel/bin
 CFLAGS += -mno-abicalls -mips3 
+
+ARCH_SOURCES += arch/$(ARCH)/src/syscall.c
Index: libc/arch/mips32eb/_link.ld.in
===================================================================
--- libc/arch/mips32eb/_link.ld.in	(revision 1a030b81c465d23c2fff25eaf91615fbf427c804)
+++ libc/arch/mips32eb/_link.ld.in	(revision 1a030b81c465d23c2fff25eaf91615fbf427c804)
@@ -0,0 +1,1 @@
+../mips32/_link.ld.in
Index: uspace.config
===================================================================
--- uspace.config	(revision 12665431deed59bc8d76f61f17368d17c55d2bcb)
+++ uspace.config	(revision 1a030b81c465d23c2fff25eaf91615fbf427c804)
@@ -3,4 +3,5 @@
 # Architecture
 @ "ia32" Intel IA-32
+@ "amd64" AMD64/Intel EM64T
 @ "mips32" MIPS 32-bit
 ! ARCH (choice)
