diff --git a/ubuntu/vmblock/Makefile b/ubuntu/vmblock/Makefile
index 8a7ae56..ae0c286 100644
--- a/ubuntu/vmblock/Makefile
+++ b/ubuntu/vmblock/Makefile
@@ -1,20 +1,21 @@
#!/usr/bin/make -f
-################################################## ###########
-# Copyright 1998 VMware, Inc. All rights reserved.
-################################################## ###########
-####
-#### This program is free software; you can redistribute it and/or modify it
-#### under the terms of the GNU General Public License as published by the
-#### Free Software Foundation version 2 and no later version.
-####
-#### This program is distributed in the hope that it will be useful, but
-#### WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-#### or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-#### for more details.
-####
-#### You should have received a copy of the GNU General Public License along
-#### with this program; if not, write to the Free Software Foundation, Inc.,
-#### 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+################################################# #########
+# Copyright (C) 1998 VMware, Inc. All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation version 2 and no later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#
+################################################# #########
####
#### VMware kernel module Makefile to be distributed externally
@@ -107,6 +108,22 @@ endif
ifdef TOPDIR
diff --git a/ubuntu/vmblock/Makefile.kernel b/ubuntu/vmblock/Makefile.kernel
index 9f0e14c..a5276ab 100644
--- a/ubuntu/vmblock/Makefile.kernel
+++ b/ubuntu/vmblock/Makefile.kernel
@@ -1,44 +1,21 @@
#!/usr/bin/make -f
-################################################## ###########
-# Copyright 2006 VMware, Inc. All rights reserved.
-################################################## ###########
-####
-#### This program is free software; you can redistribute it and/or modify it
-#### under the terms of the GNU General Public License as published by the
-#### Free Software Foundation version 2 and no later version.
-####
-#### This program is distributed in the hope that it will be useful, but
-#### WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-#### or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-#### for more details.
-####
-#### You should have received a copy of the GNU General Public License along
-#### with this program; if not, write to the Free Software Foundation, Inc.,
-#### 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-####
-#### VMware vmblock Makefile to be distributed externally
-####
-####
-
-vm_check_build = $(shell if $(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_KERNEL)
- $(EXTRA_CFLAGS) -Iinclude2/asm/mach-default
- -DKBUILD_BASENAME="$(DRIVER)"
- -Werror -S -o /dev/null -xc $(1)
- > /dev/null 2>&1; then echo "$(2)"; else echo "$(3)"; fi)
-
-CC_WARNINGS := -Wall -Wstrict-prototypes
-
-CC_OPTS := $(GLOBAL_DEFS) $(CC_WARNINGS)
-
-CC_OPTS += -DVMW_USING_KBUILD
-
-ifdef VMX86_DEVEL
-CC_OPTS += -DVMX86_DEVEL
-endif
-ifdef VMX86_DEBUG
-CC_OPTS += -DVMX86_DEBUG
-endif
+################################################# #########
+# Copyright (C) 2006 VMware, Inc. All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation version 2 and no later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#
+################################################# #########
INCLUDE := -I$(SRCROOT)/include
diff --git a/ubuntu/vmblock/Makefile.normal b/ubuntu/vmblock/Makefile.normal
index ae778c8..9721d11 100644
--- a/ubuntu/vmblock/Makefile.normal
+++ b/ubuntu/vmblock/Makefile.normal
@@ -1,20 +1,21 @@
#!/usr/bin/make -f
-################################################## ###########
-# Copyright 2006 VMware, Inc. All rights reserved.
-################################################## ###########
-####
-#### This program is free software; you can redistribute it and/or modify it
-#### under the terms of the GNU General Public License as published by the
-#### Free Software Foundation version 2 and no later version.
-####
-#### This program is distributed in the hope that it will be useful, but
-#### WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-#### or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-#### for more details.
-####
-#### You should have received a copy of the GNU General Public License along
-#### with this program; if not, write to the Free Software Foundation, Inc.,
-#### 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+################################################# #########
+# Copyright (C) 2006 VMware, Inc. All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation version 2 and no later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#
+################################################# #########
####
#### VMware vmblock Makefile to be distributed externally
@@ -99,20 +100,20 @@ OBJS := $(LINUX_OBJS)
####
diff --git a/ubuntu/vmblock/README b/ubuntu/vmblock/README
index 3cae243..fdb750f 100644
--- a/ubuntu/vmblock/README
+++ b/ubuntu/vmblock/README
@@ -6,9 +6,9 @@ Makefile is correct and then just type
from this directory. A copy of the module will be left in
-(e.g. driver-up-2.4.20/vmblock-up-2.4.20) for 2.4 series kernels and in
+(e.g. driver-up-2.4.20/vmblock.o) for 2.4 series kernels and in
../vmblock.o
diff --git a/ubuntu/vmblock/autoconf/cachecreate.c b/ubuntu/vmblock/autoconf/cachecreate.c
index 98c82eb..88c51c1 100644
--- a/ubuntu/vmblock/autoconf/cachecreate.c
+++ b/ubuntu/vmblock/autoconf/cachecreate.c
@@ -1,6 +1,5 @@
-/* ************************************************** ********
- * Copyright (C) 2006 VMware, Inc. All Rights Reserved.
- * ************************************************** ********
+/************************************************** *******
+ * Copyright (C) 2006 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -14,7 +13,8 @@
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
+ *
+ ************************************************** *******/
#include <linux/autoconf.h>
#include <linux/version.h>
diff --git a/ubuntu/vmblock/autoconf/epoll.c b/ubuntu/vmblock/autoconf/epoll.c
index fc6ac4c..44083c6 100644
--- a/ubuntu/vmblock/autoconf/epoll.c
+++ b/ubuntu/vmblock/autoconf/epoll.c
@@ -1,6 +1,5 @@
-/* ************************************************** ********
- * Copyright (C) 2004 VMware, Inc. All Rights Reserved.
- * ************************************************** ********
+/************************************************** *******
+ * Copyright (C) 2004 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -14,7 +13,8 @@
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
+ *
+ ************************************************** *******/
/*
* Detect whether we have 'struct poll_wqueues'
diff --git a/ubuntu/vmblock/autoconf/filldir1.c b/ubuntu/vmblock/autoconf/filldir1.c
index 8c8b700..754da62 100644
--- a/ubuntu/vmblock/autoconf/filldir1.c
+++ b/ubuntu/vmblock/autoconf/filldir1.c
@@ -1,6 +1,5 @@
-/* ************************************************** ********
- * Copyright (C) 2006 VMware, Inc. All Rights Reserved.
- * ************************************************** ********
+/************************************************** *******
+ * Copyright (C) 2006 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -14,7 +13,8 @@
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
+ *
+ ************************************************** *******/
#include <linux/autoconf.h>
#include <linux/version.h>
diff --git a/ubuntu/vmblock/autoconf/geninclude.c b/ubuntu/vmblock/autoconf/geninclude.c
index 681bb52..f37a20f 100644
--- a/ubuntu/vmblock/autoconf/geninclude.c
+++ b/ubuntu/vmblock/autoconf/geninclude.c
@@ -1,6 +1,5 @@
-/* ************************************************** ********
- * Copyright (C) 2003 VMware, Inc. All Rights Reserved.
- * ************************************************** ********
+/************************************************** *******
+ * Copyright (C) 2003 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -14,7 +13,8 @@
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
+ *
+ ************************************************** *******/
#include <linux/autoconf.h>
diff --git a/ubuntu/vmblock/autoconf/getsb1.c b/ubuntu/vmblock/autoconf/getsb1.c
index c76388a..862ae2b 100644
--- a/ubuntu/vmblock/autoconf/getsb1.c
+++ b/ubuntu/vmblock/autoconf/getsb1.c
@@ -1,6 +1,5 @@
-/* ************************************************** ********
- * Copyright (C) 2006 VMware, Inc. All Rights Reserved.
- * ************************************************** ********
+/************************************************** *******
+ * Copyright (C) 2006 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -14,7 +13,8 @@
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
+ *
+ ************************************************** *******/
#include <linux/autoconf.h>
#include <linux/version.h>
diff --git a/ubuntu/vmblock/autoconf/setnice.c b/ubuntu/vmblock/autoconf/setnice.c
index ebd452a..8d5ebf2 100644
--- a/ubuntu/vmblock/autoconf/setnice.c
+++ b/ubuntu/vmblock/autoconf/setnice.c
@@ -1,6 +1,5 @@
-/* ************************************************** ********
- * Copyright (C) 2005 VMware, Inc. All Rights Reserved.
- * ************************************************** ********
+/************************************************** *******
+ * Copyright (C) 2005 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -14,7 +13,8 @@
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
+ *
+ ************************************************** *******/
/*
* set_user_nice appeared in 2.4.21. But some distros
diff --git a/ubuntu/vmblock/autoconf/skas1.c b/ubuntu/vmblock/autoconf/skas1.c
index e8eab9f..015232f 100644
--- a/ubuntu/vmblock/autoconf/skas1.c
+++ b/ubuntu/vmblock/autoconf/skas1.c
@@ -1,6 +1,5 @@
-/* ************************************************** ********
- * Copyright (C) 2004 VMware, Inc. All Rights Reserved.
- * ************************************************** ********
+/************************************************** *******
+ * Copyright (C) 2004 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -14,7 +13,8 @@
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
+ *
+ ************************************************** *******/
/*
* SKAS patch adds 'struct mm *mm' as first argument to do_mmap_pgoff.
diff --git a/ubuntu/vmblock/autoconf/statfs1.c b/ubuntu/vmblock/autoconf/statfs1.c
index 57c3f14..8501cab 100644
--- a/ubuntu/vmblock/autoconf/statfs1.c
+++ b/ubuntu/vmblock/autoconf/statfs1.c
@@ -1,6 +1,5 @@
-/* ************************************************** ********
- * Copyright (C) 2006 VMware, Inc. All Rights Reserved.
- * ************************************************** ********
+/************************************************** *******
+ * Copyright (C) 2006 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -14,7 +13,8 @@
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
+ *
+ ************************************************** *******/
#include <linux/autoconf.h>
#include <linux/version.h>
diff --git a/ubuntu/vmblock/include/compat_completion.h b/ubuntu/vmblock/include/compat_completion.h
index 35f081f..e690fff 100644
--- a/ubuntu/vmblock/include/compat_completion.h
+++ b/ubuntu/vmblock/include/compat_completion.h
@@ -1,6 +1,5 @@
-/* ************************************************** ********
- * Copyright (C) 2004 VMware, Inc. All Rights Reserved.
- * ************************************************** ********
+/************************************************** *******
+ * Copyright (C) 2004 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -14,7 +13,8 @@
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
+ *
+ ************************************************** *******/
#ifndef __COMPAT_COMPLETION_H__
# define __COMPAT_COMPLETION_H__
diff --git a/ubuntu/vmblock/include/compat_file.h b/ubuntu/vmblock/include/compat_file.h
index 9d16904..5af3010 100644
--- a/ubuntu/vmblock/include/compat_file.h
+++ b/ubuntu/vmblock/include/compat_file.h
@@ -1,6 +1,5 @@
-/* ************************************************** ********
- * Copyright (C) 2002 VMware, Inc. All Rights Reserved.
- * ************************************************** ********
+/************************************************** *******
+ * Copyright (C) 2002 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -14,7 +13,8 @@
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
+ *
+ ************************************************** *******/
#ifndef __COMPAT_FILE_H__
# define __COMPAT_FILE_H__
diff --git a/ubuntu/vmblock/include/compat_fs.h b/ubuntu/vmblock/include/compat_fs.h
index 01d39a6..d1c083a 100644
--- a/ubuntu/vmblock/include/compat_fs.h
+++ b/ubuntu/vmblock/include/compat_fs.h
@@ -1,6 +1,5 @@
-/* ************************************************** ********
- * Copyright (C) 2006 VMware, Inc. All Rights Reserved.
- * ************************************************** ********
+/************************************************** *******
+ * Copyright (C) 2006 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -14,7 +13,8 @@
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
+ *
+ ************************************************** *******/
diff --git a/ubuntu/vmblock/include/compat_init.h b/ubuntu/vmblock/include/compat_init.h
index 0115d9e..48d7075 100644
--- a/ubuntu/vmblock/include/compat_init.h
+++ b/ubuntu/vmblock/include/compat_init.h
@@ -1,6 +1,5 @@
-/* ************************************************** ********
- * Copyright 1999 VMware, Inc. All rights reserved.
- * ************************************************** ********
+/************************************************** *******
+ * Copyright (C) 1999 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -14,7 +13,8 @@
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
+ *
+ ************************************************** *******/
/*
* compat_init.h: Initialization compatibility wrappers.
diff --git a/ubuntu/vmblock/include/compat_kernel.h b/ubuntu/vmblock/include/compat_kernel.h
index d278ae7..76b47cf 100644
--- a/ubuntu/vmblock/include/compat_kernel.h
+++ b/ubuntu/vmblock/include/compat_kernel.h
@@ -1,6 +1,5 @@
-/* ************************************************** ********
- * Copyright (C) 2004 VMware, Inc. All Rights Reserved.
- * ************************************************** ********
+/************************************************** *******
+ * Copyright (C) 2004 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -14,7 +13,8 @@
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
+ *
+ ************************************************** *******/
#ifndef __COMPAT_KERNEL_H__
# define __COMPAT_KERNEL_H__
diff --git a/ubuntu/vmblock/include/compat_list.h b/ubuntu/vmblock/include/compat_list.h
index baaa8ac..333557b 100644
--- a/ubuntu/vmblock/include/compat_list.h
+++ b/ubuntu/vmblock/include/compat_list.h
@@ -1,6 +1,5 @@
-/* ************************************************** ********
- * Copyright (C) 2006 VMware, Inc. All Rights Reserved.
- * ************************************************** ********
+/************************************************** *******
+ * Copyright (C) 2006 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -14,7 +13,8 @@
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
+ *
+ ************************************************** *******/
/*
+ * list_add_tail is with us since 2.4.0, or something like that.
+ */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 0)
+#define list_add_tail(newe, head) do {
+ struct list_head *__h = (head);
+ __list_add((newe), __h->prev, __h);
+} while (0)
+#endif
+
+/*
* list_for_each_safe() showed up in 2.4.10, but it may be backported so we
* just check for its existence.
*/
diff --git a/ubuntu/vmblock/include/compat_mm.h b/ubuntu/vmblock/include/compat_mm.h
index 9e9605b..9265a82 100644
--- a/ubuntu/vmblock/include/compat_mm.h
+++ b/ubuntu/vmblock/include/compat_mm.h
@@ -1,6 +1,5 @@
-/* ************************************************** ********
- * Copyright (C) 2002 VMware, Inc. All Rights Reserved.
- * ************************************************** ********
+/************************************************** *******
+ * Copyright (C) 2002 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -14,7 +13,8 @@
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
+ *
+ ************************************************** *******/
#ifndef __COMPAT_MM_H__
# define __COMPAT_MM_H__
diff --git a/ubuntu/vmblock/include/compat_module.h b/ubuntu/vmblock/include/compat_module.h
index 6576fb6..66fc469 100644
--- a/ubuntu/vmblock/include/compat_module.h
+++ b/ubuntu/vmblock/include/compat_module.h
@@ -1,6 +1,5 @@
-/* ************************************************** ********
- * Copyright 2007 VMware, Inc. All rights reserved.
- * ************************************************** ********
+/************************************************** *******
+ * Copyright (C) 2007 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -14,7 +13,8 @@
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
+ *
+ ************************************************** *******/
/*
* compat_module.h --
diff --git a/ubuntu/vmblock/include/compat_namei.h b/ubuntu/vmblock/include/compat_namei.h
index 9ca3290..a3176f5 100644
--- a/ubuntu/vmblock/include/compat_namei.h
+++ b/ubuntu/vmblock/include/compat_namei.h
@@ -1,6 +1,5 @@
-/* ************************************************** ********
- * Copyright (C) 2006 VMware, Inc. All Rights Reserved.
- * ************************************************** ********
+/************************************************** *******
+ * Copyright (C) 2006 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -14,7 +13,8 @@
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
+ *
+ ************************************************** *******/
#ifndef __COMPAT_NAMEI_H__
# define __COMPAT_NAMEI_H__
diff --git a/ubuntu/vmblock/include/compat_page.h b/ubuntu/vmblock/include/compat_page.h
index 3aeab98..0bf0e25 100644
--- a/ubuntu/vmblock/include/compat_page.h
+++ b/ubuntu/vmblock/include/compat_page.h
@@ -1,6 +1,5 @@
-/* ************************************************** ********
- * Copyright (C) 2002 VMware, Inc. All Rights Reserved.
- * ************************************************** ********
+/************************************************** *******
+ * Copyright (C) 2002 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -14,7 +13,8 @@
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
+ *
+ ************************************************** *******/
#ifndef __COMPAT_PAGE_H__
# define __COMPAT_PAGE_H__
diff --git a/ubuntu/vmblock/include/compat_sched.h b/ubuntu/vmblock/include/compat_sched.h
index e54e1b6..6fc79dc 100644
--- a/ubuntu/vmblock/include/compat_sched.h
+++ b/ubuntu/vmblock/include/compat_sched.h
@@ -1,6 +1,5 @@
-/* ************************************************** ********
- * Copyright (C) 2002 VMware, Inc. All Rights Reserved.
- * ************************************************** ********
+/************************************************** *******
+ * Copyright (C) 2002 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -14,7 +13,8 @@
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
+ *
+ ************************************************** *******/
+/* Oh well. We need yield... Happy us! */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 20)
+# ifdef __x86_64__
+# define compat_yield() there_is_nothing_like_yield()
+# else
+# include <linux/unistd.h>
+# include <linux/kernel.h>
+
+/*
+ * Used by _syscallX macros. Note that this is global variable, so
+ * do not rely on its contents too much. As exit() is only function
+ * we use, and we never check return value from exit(), we have
+ * no problem...
+ */
+extern int errno;
+
+/*
+ * compat_exit() provides an access to the exit() function. It must
+ * be named compat_exit(), as exit() (with different signature) is
+ * provided by x86-64, arm and other (but not by i386).
+ */
+# define __NR_compat_yield __NR_sched_yield
+static inline _syscall0(int, compat_yield);
+# endif
+#else
+# define compat_yield() yield()
+#endif
+
/*
* Since 2.5.34 there are two methods to enumerate tasks:
diff --git a/ubuntu/vmblock/include/compat_semaphore.h b/ubuntu/vmblock/include/compat_semaphore.h
index 23f92f3..8c6df97 100644
--- a/ubuntu/vmblock/include/compat_semaphore.h
+++ b/ubuntu/vmblock/include/compat_semaphore.h
@@ -1,6 +1,5 @@
-/* ************************************************** ********
- * Copyright (C) 2002 VMware, Inc. All Rights Reserved.
- * ************************************************** ********
+/************************************************** *******
+ * Copyright (C) 2002 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -14,7 +13,8 @@
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
+ *
+ ************************************************** *******/
#ifndef __COMPAT_SEMAPHORE_H__
# define __COMPAT_SEMAPHORE_H__
diff --git a/ubuntu/vmblock/include/compat_slab.h b/ubuntu/vmblock/include/compat_slab.h
index c0d504b..8654a9a 100644
--- a/ubuntu/vmblock/include/compat_slab.h
+++ b/ubuntu/vmblock/include/compat_slab.h
@@ -1,6 +1,5 @@
-/* ************************************************** ********
- * Copyright (C) 2005 VMware, Inc. All Rights Reserved.
- * ************************************************** ********
+/************************************************** *******
+ * Copyright (C) 2005 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -14,7 +13,8 @@
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
+ *
+ ************************************************** *******/
/*
- * Destructor is gone since 2.6.23-pre1.
+ * Up to 2.6.22 kmem_cache_create has 6 arguments - name, size, alignment, flags,
+ * constructor, and destructor. Then for some time kernel was asserting that
+ * destructor is NULL, and since 2.6.23-pre1 kmem_cache_create takes only 5
+ * arguments - destructor is gone.
*/
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 22) || defined(VMW_KMEMCR_HAS_DTOR)
#define compat_kmem_cache_create(name, size, align, flags, ctor)
@@ -50,4 +53,18 @@
kmem_cache_create(name, size, align, flags, ctor)
#endif
+/*
+ * Up to 2.6.23 kmem_cache constructor has three arguments - pointer to block to
+ * prepare (aka "this"), from which cache it came, and some unused flags. After
+ * 2.6.23 flags were removed, and order of "this" and cache parameters was swapped...
+ */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 23) && !defined(VMW_KMEMCR_CTOR_HAS_3_ARGS)
+# define VMW_KMEMCR_CTOR_HAS_3_ARGS
+#endif
+#ifdef VMW_KMEMCR_CTOR_HAS_3_ARGS
+typedef void compat_kmem_cache_ctor(void *, compat_kmem_cache *, unsigned long);
+#else
+typedef void compat_kmem_cache_ctor(compat_kmem_cache *, void *);
+#endif
+
#endif /* __COMPAT_SLAB_H__ */
diff --git a/ubuntu/vmblock/include/compat_spinlock.h b/ubuntu/vmblock/include/compat_spinlock.h
index c069db9..ea867f2 100644
--- a/ubuntu/vmblock/include/compat_spinlock.h
+++ b/ubuntu/vmblock/include/compat_spinlock.h
@@ -1,6 +1,5 @@
-/* ************************************************** ********
- * Copyright (C) 2005 VMware, Inc. All Rights Reserved.
- * ************************************************** ********
+/************************************************** *******
+ * Copyright (C) 2005 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -14,7 +13,8 @@
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
+ *
+ ************************************************** *******/
#ifndef __COMPAT_SPINLOCK_H__
# define __COMPAT_SPINLOCK_H__
diff --git a/ubuntu/vmblock/include/compat_statfs.h b/ubuntu/vmblock/include/compat_statfs.h
index 0dc191d..29ec4f8 100644
--- a/ubuntu/vmblock/include/compat_statfs.h
+++ b/ubuntu/vmblock/include/compat_statfs.h
@@ -1,6 +1,5 @@
-/* ************************************************** ********
- * Copyright (C) 2006 VMware, Inc. All Rights Reserved.
- * ************************************************** ********
+/************************************************** *******
+ * Copyright (C) 2006 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -14,7 +13,8 @@
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
+ *
+ ************************************************** *******/
#ifndef __COMPAT_STATFS_H__
# define __COMPAT_STATFS_H__
diff --git a/ubuntu/vmblock/include/compat_string.h b/ubuntu/vmblock/include/compat_string.h
index 6ea0ebf..b74f875 100644
--- a/ubuntu/vmblock/include/compat_string.h
+++ b/ubuntu/vmblock/include/compat_string.h
@@ -1,6 +1,5 @@
-/* ************************************************** ********
- * Copyright (C) 2007 VMware, Inc. All Rights Reserved.
- * ************************************************** ********
+/************************************************** *******
+ * Copyright (C) 2007 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -14,7 +13,8 @@
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
+ *
+ ************************************************** *******/
#ifndef __COMPAT_STRING_H__
# define __COMPAT_STRING_H__
diff --git a/ubuntu/vmblock/include/compat_uaccess.h b/ubuntu/vmblock/include/compat_uaccess.h
index d272269..d58ee05 100644
--- a/ubuntu/vmblock/include/compat_uaccess.h
+++ b/ubuntu/vmblock/include/compat_uaccess.h
@@ -1,6 +1,5 @@
-/* ************************************************** ********
- * Copyright (C) 2002 VMware, Inc. All Rights Reserved.
- * ************************************************** ********
+/************************************************** *******
+ * Copyright (C) 2002 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -14,7 +13,8 @@
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
+ *
+ ************************************************** *******/
#ifndef __COMPAT_UACCESS_H__
# define __COMPAT_UACCESS_H__
diff --git a/ubuntu/vmblock/include/compat_version.h b/ubuntu/vmblock/include/compat_version.h
index 2f4c546..baf9634 100644
--- a/ubuntu/vmblock/include/compat_version.h
+++ b/ubuntu/vmblock/include/compat_version.h
@@ -1,6 +1,5 @@
-/* ************************************************** ********
- * Copyright 1998 VMware, Inc. All rights reserved.
- * ************************************************** ********
+/************************************************** *******
+ * Copyright (C) 1998 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -14,7 +13,8 @@
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
+ *
+ ************************************************** *******/
#ifndef __COMPAT_VERSION_H__
# define __COMPAT_VERSION_H__
diff --git a/ubuntu/vmblock/include/compat_wait.h b/ubuntu/vmblock/include/compat_wait.h
index e3aca6c..ebcf087 100644
--- a/ubuntu/vmblock/include/compat_wait.h
+++ b/ubuntu/vmblock/include/compat_wait.h
@@ -1,6 +1,5 @@
-/* ************************************************** ********
- * Copyright (C) 2002 VMware, Inc. All Rights Reserved.
- * ************************************************** ********
+/************************************************** *******
+ * Copyright (C) 2002 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -14,7 +13,8 @@
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
+ *
+ ************************************************** *******/
#ifndef __COMPAT_WAIT_H__
# define __COMPAT_WAIT_H__
diff --git a/ubuntu/vmblock/include/driver-config.h b/ubuntu/vmblock/include/driver-config.h
index b9aec7f..3722731 100644
--- a/ubuntu/vmblock/include/driver-config.h
+++ b/ubuntu/vmblock/include/driver-config.h
@@ -1,6 +1,5 @@
-/* ************************************************** ********
- * Copyright 1998 VMware, Inc. All rights reserved.
- * ************************************************** ********
+/************************************************** *******
+ * Copyright (C) 1998 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -14,7 +13,8 @@
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
+ *
+ ************************************************** *******/
/*
* Sets the proper defines from the Linux header files
diff --git a/ubuntu/vmblock/include/vm_assert.h b/ubuntu/vmblock/include/vm_assert.h
index 07b987f..12b67f3 100644
--- a/ubuntu/vmblock/include/vm_assert.h
+++ b/ubuntu/vmblock/include/vm_assert.h
@@ -1,7 +1,5 @@
-/* ************************************************** ********
- * Copyright 1998-2004 VMware, Inc. All rights reserved.
- *
- * ************************************************** ********
+/************************************************** *******
+ * Copyright (C) 1998-2004 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -15,7 +13,8 @@
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
+ *
+ ************************************************** *******/
/*
* vm_assert.h --
diff --git a/ubuntu/vmblock/include/vm_basic_defs.h b/ubuntu/vmblock/include/vm_basic_defs.h
index e01cb24..8da371b 100644
--- a/ubuntu/vmblock/include/vm_basic_defs.h
+++ b/ubuntu/vmblock/include/vm_basic_defs.h
@@ -1,7 +1,5 @@
-/* ************************************************** ********
- * Copyright 2003 VMware, Inc. All rights reserved.
- *
- * ************************************************** ********
+/************************************************** *******
+ * Copyright (C) 2003 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -15,7 +13,8 @@
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
+ *
+ ************************************************** *******/
/*
* vm_basic_defs.h --
@@ -152,8 +151,6 @@ Max(int a, int b)
#ifndef PAGE_SHIFT // {
#if defined VM_I386
#define PAGE_SHIFT 12
-#elif defined VM_IA64
- #define PAGE_SHIFT 14 // On IA-64, the default page size is 16K
#elif defined __APPLE__
#define PAGE_SHIFT 12
#else
@@ -382,6 +379,31 @@ typedef int pid_t;
#endif // }
+#ifndef va_copy
+#ifdef _WIN32
+
+/*
+ * Windows needs va_copy. This works for both 32 and 64-bit Windows
+ * based on inspection of how varags.h from the Visual C CRTL is
+ * implemented. (Future versions of the RTL may break this).
+ */
+
+#define va_copy(dest, src) ((dest) = (src))
+
+#endif // _WIN32
+
+#if defined(__APPLE__) && defined(KERNEL)
+
+/*
+ * MacOS kernel-mode needs va_copy. Based on inspection of stdarg.h
+ * from the MacOSX10.4u.sdk kernel framework, this should work.
+ * (Future versions of the SDK may break this).
+ */
+
+#define va_copy(dest, src) ((dest) = (src))
+
+#endif // __APPLE__ && KERNEL
+#endif // va_copy
/*
* This one is outside USERLEVEL because it's used by
diff --git a/ubuntu/vmblock/include/vm_basic_types.h b/ubuntu/vmblock/include/vm_basic_types.h
index 5fc0231..bdefa6f 100644
--- a/ubuntu/vmblock/include/vm_basic_types.h
+++ b/ubuntu/vmblock/include/vm_basic_types.h
@@ -1,6 +1,5 @@
-/* ************************************************** ********
- * Copyright (c) 1998-2007 VMware, Inc. All rights reserved.
- * ************************************************** ********
+/************************************************** *******
+ * Copyright (C) 1998-2007 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -14,7 +13,8 @@
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
+ *
+ ************************************************** *******/
-#if defined VM_I386 && defined VM_IA64
-#error "Only one CPU platform is allowed."
-#endif
-
#ifdef _MSC_VER
typedef unsigned __int64 uint64;
typedef signed __int64 int64;
@@ -109,7 +101,7 @@ typedef signed __int64 int64;
#elif __GNUC__
/* The Xserver source compiles with -ansi -pendantic */
#ifndef __STRICT_ANSI__
-#if defined(VM_IA64) || defined(VM_X86_64)
+#if defined(VM_X86_64)
typedef unsigned long uint64;
typedef long int64;
#else
@@ -140,54 +132,71 @@ typedef char int8;
* This applies to Solaris as well.
*/
-#if defined(__FreeBSD__) || defined(sun)
-# ifdef KLD_MODULE
-# include <sys/types.h>
-# else
-# if (BSD_VERSION >= 50) || defined(HAVE_INTTYPES_H)
-# include <inttypes.h>
+/*
+ * Before trying to do the includes based on OS defines, see if we can use
+ * feature-based defines to get as much functionality as possible
+ */
+
+#ifdef HAVE_INTTYPES_H
+#include <inttypes.h>
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_INTTYPES_H
+#include <sys/inttypes.h>
+#endif
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+
+#if !defined(USING_AUTOCONF)
+# if defined(__FreeBSD__) || defined(sun)
+# ifdef KLD_MODULE
# include <sys/types.h>
# else
-# include <sys/inttypes.h>
-# endif
-# endif
-#elif defined __APPLE__
-# if KERNEL
-# include <sys/types.h> /* mostly for size_t */
-# include <stdint.h>
-# else
-# include <inttypes.h>
-# include <stdlib.h>
-# include <stdint.h>
-# endif
-#else
-# if !defined(__intptr_t_defined) && !defined(intptr_t)
-# define __intptr_t_defined
-# define intptr_t intptr_t
-# ifdef VM_I386
-# ifdef VM_X86_64
- typedef int64 intptr_t;
+# if (BSD_VERSION >= 50)
+# include <inttypes.h>
+# include <sys/types.h>
# else
- typedef int32 intptr_t;
+# include <sys/inttypes.h>
# endif
# endif
-
-# ifdef VM_IA64
- typedef int64 intptr_t;
+# elif defined __APPLE__
+# if KERNEL
+# include <sys/unistd.h>
+# include <sys/types.h> /* mostly for size_t */
+# include <stdint.h>
+# else
+# include <unistd.h>
+# include <inttypes.h>
+# include <stdlib.h>
+# include <stdint.h>
# endif
-# endif
-
-# ifndef _STDINT_H
-# ifdef VM_I386
-# ifdef VM_X86_64
- typedef uint64 uintptr_t;
-# else
- typedef uint32 uintptr_t;
+# else
+# if !defined(__intptr_t_defined) && !defined(intptr_t)
+# define __intptr_t_defined
+# define intptr_t intptr_t
+# ifdef VM_I386
+# ifdef VM_X86_64
+typedef int64 intptr_t;
+# else
+typedef int32 intptr_t;
+# endif
# endif
# endif
+/*
+ * __func__ is a stringified function name that is part of the C99 standard. The block
+ * below defines __func__ on older systems where the compiler does not support that
+ * macro.
+ */
+#if defined(__GNUC__)
+ && ((__GNUC__ == 2 && __GNUC_MINOR < 96)
+ || (__GNUC__ < 2))
+# define __func__ __FUNCTION__
+#endif
/*
* Once upon a time, this was used to silence compiler warnings that
@@ -642,9 +671,6 @@ typedef void * UserVA;
# endif
# endif /* VM_I386 */
+/*
+ * Format modifier for printing time_t. Most platforms define a time_t to be
+ * a long int, but on FreeBSD (as of 5.0, it seems), the time_t is a signed
+ * size quantity. Refer to the definition of FMTSZ to see why we need silly
+ * preprocessor arithmetic.
+ * Use this like this: printf("The mode is %"FMTTIME".
", time);
+ */
+#if defined(__FreeBSD__) && (__FreeBSD__ + 0) && ((__FreeBSD__ + 0) >= 5)
+# define FMTTIME FMTSZ"d"
+#else
+# define FMTTIME "ld"
+#endif
+
#endif /* _VM_BASIC_TYPES_H_ */
diff --git a/ubuntu/vmblock/include/vmblock.h b/ubuntu/vmblock/include/vmblock.h
index db15220..b6c6727 100644
--- a/ubuntu/vmblock/include/vmblock.h
+++ b/ubuntu/vmblock/include/vmblock.h
@@ -1,6 +1,5 @@
-/* ************************************************** ********
- * Copyright (C) 2006 VMware, Inc. All Rights Reserved.
- * ************************************************** ********
+/************************************************** *******
+ * Copyright (C) 2006 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -14,7 +13,8 @@
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
+ *
+ ************************************************** *******/
/*
* vmblock.h --
diff --git a/ubuntu/vmblock/include/vmware.h b/ubuntu/vmblock/include/vmware.h
index 1bf3dab..b7cf86c 100644
--- a/ubuntu/vmblock/include/vmware.h
+++ b/ubuntu/vmblock/include/vmware.h
@@ -1,7 +1,5 @@
-/* ************************************************** ********
- * Copyright 2003 VMware, Inc. All rights reserved.
- *
- * ************************************************** ********
+/************************************************** *******
+ * Copyright (C) 2003 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -15,7 +13,8 @@
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
+ *
+ ************************************************** *******/
/*
* vmware.h --
diff --git a/ubuntu/vmblock/linux/block.c b/ubuntu/vmblock/linux/block.c
index cb3f91c..b559f4e 100644
--- a/ubuntu/vmblock/linux/block.c
+++ b/ubuntu/vmblock/linux/block.c
@@ -1,6 +1,5 @@
-/* ************************************************** ********
- * Copyright (C) 2006 VMware, Inc. All Rights Reserved.
- * ************************************************** ********
+/************************************************** *******
+ * Copyright (C) 2006 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistrib