am 4bd402f5: Merge "Fix DOS end-of-lines in winusb INF file."

* commit '4bd402f5f1f15a7e9f13ae0104d32285113d780b':
  Fix DOS end-of-lines in winusb INF file.
diff --git a/apps/Development/AndroidManifest.xml b/apps/Development/AndroidManifest.xml
index c4774c2..c809554 100644
--- a/apps/Development/AndroidManifest.xml
+++ b/apps/Development/AndroidManifest.xml
@@ -176,5 +176,13 @@
             </intent-filter>
         </receiver>
         <service android:name="BadBehaviorActivity$BadService" />
+
+        <activity android:name="ConfigurationViewer" android:label="Configuration">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.TEST" />
+            </intent-filter>
+        </activity>
+
     </application>
 </manifest>
diff --git a/apps/Development/res/layout/configuration_viewer.xml b/apps/Development/res/layout/configuration_viewer.xml
new file mode 100644
index 0000000..6af6739
--- /dev/null
+++ b/apps/Development/res/layout/configuration_viewer.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2007 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+  
+          http://www.apache.org/licenses/LICENSE-2.0
+  
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    >
+
+    <TextView
+        android:id="@+id/text"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:scrollHorizontally="true"
+        android:textSize="18sp"
+        />
+
+</ScrollView>
diff --git a/apps/Development/res/values/strings.xml b/apps/Development/res/values/strings.xml
index 1bb65cf..181c4fa 100644
--- a/apps/Development/res/values/strings.xml
+++ b/apps/Development/res/values/strings.xml
@@ -190,7 +190,7 @@
     <string name="status_sync_succeeded_format">Sync succeeded: %s</string>
     <string name="status_already_bound">Already bound to sync adapter</string>
     <string name="status_sync_adapter_not_selected">No selected sync adapter</string>
-    <string name="binding_connected_format">Connected to Sync Adapter\n\tauthority: %s\n\taccount type: %s</string>
+    <string name="binding_connected_format">Connected to Sync Adapter\n\tauthority: %1$s\n\taccount type: %2$s</string>
     <string name="binding_not_connected">Not connected to a sync adapter</string>
     <string name="binding_bind_failed">Bind failed</string>
     <string name="binding_waiting_for_connection">Waiting for service to be connected...</string>
diff --git a/apps/Development/src/com/android/development/BadBehaviorActivity.java b/apps/Development/src/com/android/development/BadBehaviorActivity.java
index 4e06ae9..7863220 100644
--- a/apps/Development/src/com/android/development/BadBehaviorActivity.java
+++ b/apps/Development/src/com/android/development/BadBehaviorActivity.java
@@ -100,6 +100,10 @@
             return true;
         }
 
+        public int appEarlyNotResponding(String processName, int pid, String annotation) {
+            return 0;
+        }
+
         public int appNotResponding(String proc, int pid, String st) {
             return 0;
         }
diff --git a/apps/Development/src/com/android/development/ConfigurationViewer.java b/apps/Development/src/com/android/development/ConfigurationViewer.java
new file mode 100644
index 0000000..034f65a
--- /dev/null
+++ b/apps/Development/src/com/android/development/ConfigurationViewer.java
@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 2007 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.development;
+
+import android.app.Activity;
+import android.content.res.Configuration;
+import android.os.Bundle;
+import android.util.DisplayMetrics;
+import android.util.Log;
+import android.widget.TextView;
+
+public class ConfigurationViewer extends Activity {
+    @Override
+    public void onCreate(Bundle icicle) {
+        super.onCreate(icicle);
+
+        setContentView(R.layout.configuration_viewer);
+
+        Configuration c = getResources().getConfiguration();
+        DisplayMetrics m = new DisplayMetrics();
+        getWindowManager().getDefaultDisplay().getMetrics(m);
+
+        TextView tv = (TextView)findViewById(R.id.text);
+
+        String s = "Configuration\n"
+                + "\n"
+                + "fontScale=" + c.fontScale + "\n"
+                + "hardKeyboardHidden=" + c.hardKeyboardHidden + "\n"
+                + "keyboard=" + c.keyboard + "\n"
+                + "locale=" + c.locale + "\n"
+                + "mcc=" + c.mcc + "\n"
+                + "mnc=" + c.mnc + "\n"
+                + "navigation=" + c.navigation + "\n"
+                + "navigationHidden=" + c.navigationHidden + "\n"
+                + "orientation=" + c.orientation + "\n"
+                + "screenLayout=0x" + Integer.toHexString(c.screenLayout) + "\n"
+                + "touchscreen=" + c.touchscreen + "\n"
+                + "uiMode=0x" + Integer.toHexString(c.uiMode) + "\n"
+                + "\n"
+                + "DisplayMetrics\n"
+                + "\n"
+                + "density=" + m.density + "\n"
+                + "densityDpi=" + m.densityDpi + "\n"
+                + "heightPixels=" + m.heightPixels + "\n"
+                + "scaledDensity=" + m.scaledDensity + "\n"
+                + "widthPixels=" + m.widthPixels + "\n"
+                + "xdpi=" + m.xdpi + "\n"
+                + "ydpi=" + m.ydpi + "\n"
+                ;
+
+        tv.setText(s);
+
+        // Also log it for bugreport purposes.
+        Log.d("ConfigurationViewer", s);
+    }
+}
+
diff --git a/apps/GestureBuilder/res/values/strings.xml b/apps/GestureBuilder/res/values/strings.xml
index 9b9ba84..fba09c4 100644
--- a/apps/GestureBuilder/res/values/strings.xml
+++ b/apps/GestureBuilder/res/values/strings.xml
@@ -64,6 +64,6 @@
     <string name="gestures_rename_title">Rename gesture</string>
     <!-- Label of gesture name field in Rename gesture dialog box -->
     <string name="gestures_rename_label">Gesture name</string>
-    <!-- Message, displayed when the sdcard cannot be found, 1st parameter is the name of the file that stores the gestures -->
-    <string name="gestures_error_loading">Could not load %s. Make sure you have a mounted SD card.</string>
+    <!-- Message, displayed when the sdcard cannot be found, 1st parameter is the name of the file that stores the gestures.  CHAR LIMIT=80 -->
+    <string name="gestures_error_loading">Could not load %s. Make sure you have storage available.</string>
 </resources>
diff --git a/build/Android.mk b/build/Android.mk
index d804ce7..2864ea3 100644
--- a/build/Android.mk
+++ b/build/Android.mk
@@ -15,7 +15,7 @@
 full_target := $(intermediates)/classes.jar
 src_dir := $(intermediates)/src
 classes_dir := $(intermediates)/classes
-framework_res_package := $(call intermediates-dir-for,APPS,framework-res)/package.apk
+framework_res_package := $(call intermediates-dir-for,APPS,framework-res,,COMMON)/package-export.apk
 
 $(full_target): PRIVATE_SRC_DIR := $(src_dir)
 $(full_target): PRIVATE_INTERMEDIATES_DIR := $(intermediates)
@@ -42,6 +42,7 @@
 	$(hide) (cd $(PRIVATE_CLASS_INTERMEDIATES_DIR) && rm -rf classes.dex META-INF)
 	$(hide) mkdir -p $(dir $@)
 	$(hide) jar -cf $@ -C $(PRIVATE_CLASS_INTERMEDIATES_DIR) .
+	$(hide) jar -u0f $@ -C $(PRIVATE_CLASS_INTERMEDIATES_DIR) resources.arsc
 
 .PHONY: android_stubs
 android_stubs: $(full_target)
diff --git a/build/sdk.atree b/build/sdk.atree
index aea1ff4..35d34dd 100644
--- a/build/sdk.atree
+++ b/build/sdk.atree
@@ -140,30 +140,37 @@
 #
 # the list here should match the list of samples that we generate docs for, 
 # (see web_docs_sample_code_flags in frameworks/base/Android.mk)
-development/samples/source.properties        samples/${PLATFORM_NAME}/source.properties
 development/apps/GestureBuilder              samples/${PLATFORM_NAME}/GestureBuilder
-development/samples/BluetoothChat            samples/${PLATFORM_NAME}/BluetoothChat
-development/samples/Home                     samples/${PLATFORM_NAME}/Home
-development/samples/LunarLander              samples/${PLATFORM_NAME}/LunarLander
-development/samples/NotePad                  samples/${PLATFORM_NAME}/NotePad
+development/samples/source.properties        samples/${PLATFORM_NAME}/source.properties
+#
+# PLEASE KEEP THE SAMPLES IN ALPHABETICAL ORDER.
+#
+development/samples/AccessibilityService     samples/${PLATFORM_NAME}/AccessibilityService
 development/samples/ApiDemos                 samples/${PLATFORM_NAME}/ApiDemos
 development/samples/BackupRestore            samples/${PLATFORM_NAME}/BackupRestore
+development/samples/BluetoothChat            samples/${PLATFORM_NAME}/BluetoothChat
+development/samples/ContactManager           samples/${PLATFORM_NAME}/ContactManager
+development/samples/CrossCompatibility       samples/${PLATFORM_NAME}/CrossCompatibility
+development/samples/CubeLiveWallpaper        samples/${PLATFORM_NAME}/CubeLiveWallpaper
+development/samples/HeavyWeight              samples/${PLATFORM_NAME}/HeavyWeight
+development/samples/Home                     samples/${PLATFORM_NAME}/Home
+development/samples/JetBoy                   samples/${PLATFORM_NAME}/JetBoy
+development/samples/LunarLander              samples/${PLATFORM_NAME}/LunarLander
+development/samples/MultiResolution          samples/${PLATFORM_NAME}/MultiResolution
+development/samples/NotePad                  samples/${PLATFORM_NAME}/NotePad
 development/samples/SampleSyncAdapter        samples/${PLATFORM_NAME}/SampleSyncAdapter
+development/samples/SearchableDictionary     samples/${PLATFORM_NAME}/SearchableDictionary
+development/samples/SipDemo                  samples/${PLATFORM_NAME}/SipDemo
 development/samples/SkeletonApp              samples/${PLATFORM_NAME}/SkeletonApp
 development/samples/Snake                    samples/${PLATFORM_NAME}/Snake
 development/samples/SoftKeyboard             samples/${PLATFORM_NAME}/SoftKeyboard
-development/samples/JetBoy                   samples/${PLATFORM_NAME}/JetBoy
-development/samples/SearchableDictionary     samples/${PLATFORM_NAME}/SearchableDictionary
 development/samples/Spinner                  samples/${PLATFORM_NAME}/Spinner
 development/samples/SpinnerTest              samples/${PLATFORM_NAME}/SpinnerTest
-development/samples/ContactManager           samples/${PLATFORM_NAME}/ContactManager
-development/samples/MultiResolution          samples/${PLATFORM_NAME}/MultiResolution
-development/samples/Wiktionary               samples/${PLATFORM_NAME}/Wiktionary
-development/samples/WiktionarySimple         samples/${PLATFORM_NAME}/WiktionarySimple
-development/samples/CubeLiveWallpaper        samples/${PLATFORM_NAME}/CubeLiveWallpaper
-development/samples/VoiceRecognitionService  samples/${PLATFORM_NAME}/VoiceRecognitionService
 development/samples/TicTacToeLib             samples/${PLATFORM_NAME}/TicTacToeLib
 development/samples/TicTacToeMain            samples/${PLATFORM_NAME}/TicTacToeMain
+development/samples/VoiceRecognitionService  samples/${PLATFORM_NAME}/VoiceRecognitionService
+development/samples/Wiktionary               samples/${PLATFORM_NAME}/Wiktionary
+development/samples/WiktionarySimple         samples/${PLATFORM_NAME}/WiktionarySimple
 
 # NOTICE files are copied by build/core/Makefile from sdk.git
 sdk/files/sdk_files_NOTICE.txt samples/${PLATFORM_NAME}/NOTICE.txt
diff --git a/build/tools/patch_windows_sdk.sh b/build/tools/patch_windows_sdk.sh
index 2d3c707..05acdc5 100755
--- a/build/tools/patch_windows_sdk.sh
+++ b/build/tools/patch_windows_sdk.sh
@@ -56,7 +56,12 @@
 cp $V ${TOPDIR}sdk/apkbuilder/etc/apkbuilder.bat                $TOOLS/
 cp $V ${TOPDIR}sdk/ddms/app/etc/ddms.bat                        $TOOLS/
 cp $V ${TOPDIR}sdk/traceview/etc/traceview.bat                  $TOOLS/
-cp $V ${TOPDIR}sdk/hierarchyviewer2/app/etc/hierarchyviewer.bat $TOOLS/
+if [ -f ${TOPDIR}sdk/hierarchyviewer2/app/etc/hierarchyviewer.bat ]; then
+  cp $V ${TOPDIR}sdk/hierarchyviewer2/app/etc/hierarchyviewer.bat $TOOLS/
+else
+  # That's ok because currently GB uses Tools_r7 but we'll ship Tools_r8 from master-open.
+  echo "WARNING: Ignoring ${TOPDIR}sdk/hierarchyviewer2/app/etc/hierarchyviewer.bat [ok for GB+Tools r8]"
+fi
 cp $V ${TOPDIR}sdk/layoutopt/app/etc/layoutopt.bat              $TOOLS/
 cp $V ${TOPDIR}sdk/draw9patch/etc/draw9patch.bat                $TOOLS/
 cp $V ${TOPDIR}sdk/sdkmanager/app/etc/android.bat               $TOOLS/
diff --git a/cmds/monkey/src/com/android/commands/monkey/Monkey.java b/cmds/monkey/src/com/android/commands/monkey/Monkey.java
index 7c75776..68fb2a5 100644
--- a/cmds/monkey/src/com/android/commands/monkey/Monkey.java
+++ b/cmds/monkey/src/com/android/commands/monkey/Monkey.java
@@ -17,29 +17,34 @@
 package com.android.commands.monkey;
 
 import android.app.ActivityManagerNative;
-import android.app.IActivityManager;
 import android.app.IActivityController;
+import android.app.IActivityManager;
 import android.content.ComponentName;
 import android.content.Intent;
 import android.content.pm.IPackageManager;
 import android.content.pm.ResolveInfo;
 import android.os.Build;
 import android.os.Debug;
+import android.os.Environment;
 import android.os.Process;
 import android.os.RemoteException;
 import android.os.ServiceManager;
+import android.os.StrictMode;
 import android.os.SystemClock;
 import android.os.SystemProperties;
 import android.view.IWindowManager;
 
 import java.io.BufferedReader;
+import java.io.BufferedWriter;
 import java.io.ByteArrayInputStream;
 import java.io.DataInputStream;
 import java.io.File;
 import java.io.FileReader;
+import java.io.FileWriter;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
+import java.io.Writer;
 import java.security.SecureRandom;
 import java.util.ArrayList;
 import java.util.HashSet;
@@ -120,6 +125,21 @@
     private boolean mRequestDumpsysMemInfo = false;
 
     /**
+     * This is set by the ActivityController thread to request a
+     * bugreport after ANR
+     */
+    private boolean mRequestAnrBugreport = false;
+
+    /**
+     * This is set by the ActivityController thread to request a
+     * bugreport after java application crash
+     */
+    private boolean mRequestAppCrashBugreport = false;
+
+    /** Failure process name */
+    private String mReportProcessName;
+
+    /**
      * This is set by the ActivityController thread to request a "procrank"
      */
     private boolean mRequestProcRank = false;
@@ -172,6 +192,19 @@
 
     long mDroppedFlipEvents = 0;
 
+    /** The delay between user actions. This is for the scripted monkey. **/
+    long mProfileWaitTime = 5000;
+
+    /** Device idle time. This is for the scripted monkey. **/
+    long mDeviceSleepTime = 30000;
+
+    boolean mRandomizeScript = false;
+
+    boolean mScriptLog = false;
+
+    /** Capture bugreprot whenever there is a crash. **/
+    private boolean mRequestBugreport = false;
+
     /** a filename to the setup script (if any) */
     private String mSetupFileName = null;
 
@@ -222,8 +255,16 @@
         public boolean activityStarting(Intent intent, String pkg) {
             boolean allow = checkEnteringPackage(pkg) || (DEBUG_ALLOW_ANY_STARTS != 0);
             if (mVerbose > 0) {
+                // StrictMode's disk checks end up catching this on
+                // userdebug/eng builds due to PrintStream going to a
+                // FileOutputStream in the end (perhaps only when
+                // redirected to a file?)  So we allow disk writes
+                // around this region for the monkey to minimize
+                // harmless dropbox uploads from monkeys.
+                StrictMode.ThreadPolicy savedPolicy = StrictMode.allowThreadDiskWrites();
                 System.out.println("    // " + (allow ? "Allowing" : "Rejecting") + " start of "
                         + intent + " in package " + pkg);
+                StrictMode.setThreadPolicy(savedPolicy);
             }
             currentPackage = pkg;
             currentIntent = intent;
@@ -231,6 +272,7 @@
         }
 
         public boolean activityResuming(String pkg) {
+            StrictMode.ThreadPolicy savedPolicy = StrictMode.allowThreadDiskWrites();
             System.out.println("    // activityResuming(" + pkg + ")");
             boolean allow = checkEnteringPackage(pkg) || (DEBUG_ALLOW_ANY_RESTARTS != 0);
             if (!allow) {
@@ -240,12 +282,14 @@
                 }
             }
             currentPackage = pkg;
+            StrictMode.setThreadPolicy(savedPolicy);
             return allow;
         }
 
         public boolean appCrashed(String processName, int pid,
                 String shortMsg, String longMsg,
                 long timeMillis, String stackTrace) {
+            StrictMode.ThreadPolicy savedPolicy = StrictMode.allowThreadDiskWrites();
             System.err.println("// CRASH: " + processName + " (pid " + pid + ")");
             System.err.println("// Short Msg: " + shortMsg);
             System.err.println("// Long Msg: " + longMsg);
@@ -253,24 +297,41 @@
             System.err.println("// Build Changelist: " + Build.VERSION.INCREMENTAL);
             System.err.println("// Build Time: " + Build.TIME);
             System.err.println("// " + stackTrace.replace("\n", "\n// "));
+            StrictMode.setThreadPolicy(savedPolicy);
 
-            if (!mIgnoreCrashes) {
+            if (!mIgnoreCrashes || mRequestBugreport) {
                 synchronized (Monkey.this) {
-                    mAbort = true;
+                    if (!mIgnoreCrashes) {
+                        mAbort = true;
+                    }
+                    if (mRequestBugreport){
+                        mRequestAppCrashBugreport = true;
+                        mReportProcessName = processName;
+                    }
                 }
-
                 return !mKillProcessAfterError;
             }
             return false;
         }
 
+        public int appEarlyNotResponding(String processName, int pid, String annotation) {
+            return 0;
+        }
+
         public int appNotResponding(String processName, int pid, String processStats) {
+            StrictMode.ThreadPolicy savedPolicy = StrictMode.allowThreadDiskWrites();
             System.err.println("// NOT RESPONDING: " + processName + " (pid " + pid + ")");
             System.err.println(processStats);
+            StrictMode.setThreadPolicy(savedPolicy);
+
             synchronized (Monkey.this) {
                 mRequestAnrTraces = true;
                 mRequestDumpsysMemInfo = true;
                 mRequestProcRank = true;
+                if (mRequestBugreport){
+                  mRequestAnrBugreport = true;
+                  mReportProcessName = processName;
+                }
             }
             if (!mIgnoreTimeouts) {
                 synchronized (Monkey.this) {
@@ -326,28 +387,65 @@
     private void commandLineReport(String reportName, String command) {
         System.err.println(reportName + ":");
         Runtime rt = Runtime.getRuntime();
+        Writer logOutput = null;
+
         try {
             // Process must be fully qualified here because android.os.Process
             // is used elsewhere
             java.lang.Process p = Runtime.getRuntime().exec(command);
 
+            if (mRequestBugreport) {
+                logOutput =
+                        new BufferedWriter(new FileWriter(new File(Environment
+                                .getExternalStorageDirectory(), reportName), true));
+            }
             // pipe everything from process stdout -> System.err
             InputStream inStream = p.getInputStream();
             InputStreamReader inReader = new InputStreamReader(inStream);
             BufferedReader inBuffer = new BufferedReader(inReader);
             String s;
             while ((s = inBuffer.readLine()) != null) {
-                System.err.println(s);
+                if (mRequestBugreport) {
+                    logOutput.write(s);
+                    logOutput.write("\n");
+                } else {
+                    System.err.println(s);
+                }
             }
 
             int status = p.waitFor();
             System.err.println("// " + reportName + " status was " + status);
+
+            if (logOutput != null) {
+                logOutput.close();
+            }
         } catch (Exception e) {
             System.err.println("// Exception from " + reportName + ":");
             System.err.println(e.toString());
         }
     }
 
+    // Write the numbe of iteration to the log
+    private void writeScriptLog(int count) {
+        // TO DO: Add the script file name to the log.
+        try {
+            Writer output = new BufferedWriter(new FileWriter(new File(
+                    Environment.getExternalStorageDirectory(), "scriptlog.txt"), true));
+            output.write("iteration: " + count + " time: "
+                    + MonkeyUtils.toCalendarTime(System.currentTimeMillis()) + "\n");
+            output.close();
+        } catch (IOException e) {
+            System.err.println(e.toString());
+        }
+    }
+
+    // Write the bugreport to the sdcard.
+    private void getBugreport(String reportName) {
+        reportName += MonkeyUtils.toCalendarTime(System.currentTimeMillis());
+        String bugreportName = reportName.replaceAll("[ ,:]", "_");
+        commandLineReport(bugreportName + ".txt", "bugreport");
+    }
+
     /**
      * Command-line entry point.
      *
@@ -357,6 +455,7 @@
         // Set ro.monkey if it's not set yet.
         SystemProperties.set("ro.monkey", "true");
 
+        // Set the process name showing in "ps" or "top"
         Process.setArgV0("com.android.commands.monkey");
 
         int resultCode = (new Monkey()).run(args);
@@ -446,18 +545,20 @@
         if (mScriptFileNames != null && mScriptFileNames.size() == 1) {
             // script mode, ignore other options
             mEventSource = new MonkeySourceScript(mRandom, mScriptFileNames.get(0), mThrottle,
-                    mRandomizeThrottle);
+                    mRandomizeThrottle, mProfileWaitTime, mDeviceSleepTime);
             mEventSource.setVerbose(mVerbose);
 
             mCountEvents = false;
         } else if (mScriptFileNames != null && mScriptFileNames.size() > 1) {
             if (mSetupFileName != null) {
-                mEventSource = new MonkeySourceRandomScript(mSetupFileName, mScriptFileNames,
-                        mThrottle, mRandomizeThrottle, mRandom);
+                mEventSource = new MonkeySourceRandomScript(mSetupFileName, 
+                        mScriptFileNames, mThrottle, mRandomizeThrottle, mRandom,
+                        mProfileWaitTime, mDeviceSleepTime, mRandomizeScript);
                 mCount++;
             } else {
-                mEventSource = new MonkeySourceRandomScript(mScriptFileNames, mThrottle,
-                        mRandomizeThrottle, mRandom);
+                mEventSource = new MonkeySourceRandomScript(mScriptFileNames,
+                        mThrottle, mRandomizeThrottle, mRandom, 
+                        mProfileWaitTime, mDeviceSleepTime, mRandomizeScript);
             }
             mEventSource.setVerbose(mVerbose);
             mCountEvents = false;
@@ -507,6 +608,15 @@
                 reportAnrTraces();
                 mRequestAnrTraces = false;
             }
+            if (mRequestAnrBugreport){
+                System.out.println("Print the anr report");
+                getBugreport("anr_" + mReportProcessName + "_");
+                mRequestAnrBugreport = false;
+            }
+            if (mRequestAppCrashBugreport){
+                getBugreport("app_crash" + mReportProcessName + "_");
+                mRequestAnrBugreport = false;
+            }
             if (mRequestDumpsysMemInfo) {
                 reportDumpsysMemInfo();
                 mRequestDumpsysMemInfo = false;
@@ -640,6 +750,18 @@
                     mSetupFileName = nextOptionData();
                 } else if (opt.equals("-f")) {
                     mScriptFileNames.add(nextOptionData());
+                } else if (opt.equals("--profile-wait")) {
+                    mProfileWaitTime = nextOptionLong("Profile delay" +
+                                " (in milliseconds) to wait between user action");
+                } else if (opt.equals("--device-sleep-time")) {
+                    mDeviceSleepTime = nextOptionLong("Device sleep time" +
+                                                      "(in milliseconds)");
+                } else if (opt.equals("--randomize-script")) {
+                    mRandomizeScript = true;
+                } else if (opt.equals("--script-log")) {
+                    mScriptLog = true;
+                } else if (opt.equals("--bugreport")) {
+                    mRequestBugreport = true;
                 } else if (opt.equals("-h")) {
                     showUsage();
                     return false;
@@ -864,6 +986,7 @@
         boolean shouldAbort = false;
         boolean systemCrashed = false;
 
+        // TO DO : The count should apply to each of the script file.
         while (!systemCrashed && cycleCounter < mCount) {
             synchronized (this) {
                 if (mRequestProcRank) {
@@ -874,6 +997,14 @@
                     mRequestAnrTraces = false;
                     shouldReportAnrTraces = true;
                 }
+                if (mRequestAnrBugreport){
+                    getBugreport("anr_" + mReportProcessName + "_");
+                    mRequestAnrBugreport = false;
+                }
+                if (mRequestAppCrashBugreport){
+                    getBugreport("app_crash" + mReportProcessName + "_");
+                    mRequestAnrBugreport = false;
+                }
                 if (mRequestDumpsysMemInfo) {
                     mRequestDumpsysMemInfo = false;
                     shouldReportDumpsysMemInfo = true;
@@ -883,6 +1014,9 @@
                     // the watcher (ignore the error)
                     if (checkNativeCrashes() && (eventCounter > 0)) {
                         System.out.println("** New native crash detected.");
+                        if (mRequestBugreport) {
+                            getBugreport("native_crash_");
+                        }
                         mAbort = mAbort || !mIgnoreNativeCrashes || mKillProcessAfterError;
                     }
                 }
@@ -953,11 +1087,13 @@
                     eventCounter++;
                     if (mCountEvents) {
                         cycleCounter++;
+                        writeScriptLog(cycleCounter);
                     }
                 }
             } else {
                 if (!mCountEvents) {
                     cycleCounter++;
+                    writeScriptLog(cycleCounter);
                 } else {
                     // Event Source has signaled that we have no more events to process
                     break;
@@ -1130,7 +1266,12 @@
         usage.append("              [--port port]\n");
         usage.append("              [-s SEED] [-v [-v] ...]\n");
         usage.append("              [--throttle MILLISEC] [--randomize-throttle]\n");
-        usage.append("              COUNT");
+        usage.append("              [--profile-wait MILLISEC]\n");
+        usage.append("              [--device-sleep-time MILLISEC]\n");
+        usage.append("              [--randomize-script]\n");
+        usage.append("              [--script-log]\n");
+        usage.append("              [--bugreport]\n");
+        usage.append("              COUNT\n");
         System.err.println(usage.toString());
     }
 }
diff --git a/cmds/monkey/src/com/android/commands/monkey/MonkeyActivityEvent.java b/cmds/monkey/src/com/android/commands/monkey/MonkeyActivityEvent.java
index 68e6e6d..262377a 100644
--- a/cmds/monkey/src/com/android/commands/monkey/MonkeyActivityEvent.java
+++ b/cmds/monkey/src/com/android/commands/monkey/MonkeyActivityEvent.java
@@ -19,23 +19,32 @@
 import android.app.IActivityManager;
 import android.content.ComponentName;
 import android.content.Intent;
+import android.os.Bundle;
 import android.os.RemoteException;
 import android.view.IWindowManager;
+import android.util.Log;
 
 /**
  * monkey activity event
  */
 public class MonkeyActivityEvent extends MonkeyEvent {    
     private ComponentName mApp; 
+    long mAlarmTime = 0;
     
     public MonkeyActivityEvent(ComponentName app) {
         super(EVENT_TYPE_ACTIVITY);
         mApp = app;
     }
-     
-    /** 
+
+    public MonkeyActivityEvent(ComponentName app, long arg) {
+        super(EVENT_TYPE_ACTIVITY);
+        mApp = app;
+        mAlarmTime = arg;
+    }
+
+    /**
      * @return Intent for the new activity
-     */        
+     */
     private Intent getEvent() {        
         Intent intent = new Intent(Intent.ACTION_MAIN);
         intent.addCategory(Intent.CATEGORY_LAUNCHER);
@@ -50,6 +59,13 @@
         if (verbose > 0) {
             System.out.println(":Switch: " + intent.toURI());
         }
+
+        if (mAlarmTime != 0){
+            Bundle args = new Bundle();
+            args.putLong("alarmTime", mAlarmTime);
+            intent.putExtras(args);
+        }
+
         try {
             iam.startActivity(null, intent, null, null, 0, null, null, 0,
                     false, false);
diff --git a/cmds/monkey/src/com/android/commands/monkey/MonkeyCommandEvent.java b/cmds/monkey/src/com/android/commands/monkey/MonkeyCommandEvent.java
new file mode 100644
index 0000000..2122cce
--- /dev/null
+++ b/cmds/monkey/src/com/android/commands/monkey/MonkeyCommandEvent.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.commands.monkey;
+
+import android.app.IActivityManager;
+import android.view.IWindowManager;
+import android.os.Build;
+
+
+/**
+ * Events for running the shell command.
+ */
+public class MonkeyCommandEvent extends MonkeyEvent {
+
+    private String mCmd;
+
+    public MonkeyCommandEvent(String cmd) {
+        super(EVENT_TYPE_ACTIVITY);
+        mCmd = cmd;
+    }
+
+    @Override
+    public int injectEvent(IWindowManager iwm, IActivityManager iam, int verbose) {
+        if (mCmd != null) {
+            //Execute the shell command
+            try {
+                java.lang.Process p = Runtime.getRuntime().exec(mCmd);
+                int status = p.waitFor();
+                System.err.println("// Shell command " + mCmd + " status was " + status);
+            } catch (Exception e) {
+                System.err.println("// Exception from " + mCmd + ":");
+                System.err.println(e.toString());
+            }
+        }
+        return MonkeyEvent.INJECT_SUCCESS;
+    }
+}
diff --git a/cmds/monkey/src/com/android/commands/monkey/MonkeySourceRandom.java b/cmds/monkey/src/com/android/commands/monkey/MonkeySourceRandom.java
index 6fa029e..f1edae1 100644
--- a/cmds/monkey/src/com/android/commands/monkey/MonkeySourceRandom.java
+++ b/cmds/monkey/src/com/android/commands/monkey/MonkeySourceRandom.java
@@ -19,6 +19,7 @@
 import android.content.ComponentName;
 import android.os.SystemClock;
 import android.view.Display;
+import android.view.KeyCharacterMap;
 import android.view.KeyEvent;
 import android.view.MotionEvent;
 import android.view.WindowManagerImpl;
@@ -50,6 +51,18 @@
         KeyEvent.KEYCODE_VOLUME_UP, KeyEvent.KEYCODE_VOLUME_DOWN,
         KeyEvent.KEYCODE_MUTE,
     };
+    /** If a physical key exists? */
+    private static final boolean[] PHYSICAL_KEY_EXISTS = new boolean[KeyEvent.getMaxKeyCode() + 1];
+    static {
+        for (int i = 0; i < PHYSICAL_KEY_EXISTS.length; ++i) {
+            PHYSICAL_KEY_EXISTS[i] = true;
+        }
+        // Only examine SYS_KEYS
+        for (int i = 0; i < SYS_KEYS.length; ++i) {
+            PHYSICAL_KEY_EXISTS[SYS_KEYS[i]] = KeyCharacterMap.deviceHasKey(SYS_KEYS[i]);
+        }
+    }
+
     /** Nice names for all key events. */
     private static final String[] KEY_NAMES = {
         "KEYCODE_UNKNOWN",
@@ -144,6 +157,25 @@
         "KEYCODE_REWIND",
         "KEYCODE_FORWARD",
         "KEYCODE_MUTE",
+        "KEYCODE_PAGE_UP",
+        "KEYCODE_PAGE_DOWN",
+        "KEYCODE_PICTSYMBOLS",
+        "KEYCODE_SWITCH_CHARSET",
+        "KEYCODE_BUTTON_A",
+        "KEYCODE_BUTTON_B",
+        "KEYCODE_BUTTON_C",
+        "KEYCODE_BUTTON_X",
+        "KEYCODE_BUTTON_Y",
+        "KEYCODE_BUTTON_Z",
+        "KEYCODE_BUTTON_L1",
+        "KEYCODE_BUTTON_R1",
+        "KEYCODE_BUTTON_L2",
+        "KEYCODE_BUTTON_R2",
+        "KEYCODE_BUTTON_THUMBL",
+        "KEYCODE_BUTTON_THUMBR",
+        "KEYCODE_BUTTON_START",
+        "KEYCODE_BUTTON_SELECT",
+        "KEYCODE_BUTTON_MODE",
 
         "TAG_LAST_KEYCODE"      // EOL.  used to keep the lists in sync
     };
@@ -263,7 +295,6 @@
         }
 
         // if verbose, show factors
-
         if (mVerbose > 0) {
             System.out.println("// Event percentages:");
             for (int i = 0; i < FACTORZ_COUNT; ++i) {
@@ -271,6 +302,10 @@
             }
         }
 
+        if (!validateKeys()) {
+            return false;
+        }
+
         // finally, normalize and convert to running sum
         float sum = 0.0f;
         for (int i = 0; i < FACTORZ_COUNT; ++i) {
@@ -280,6 +315,28 @@
         return true;
     }
 
+    private static boolean validateKeyCategory(String catName, int[] keys, float factor) {
+        if (factor < 0.1f) {
+            return true;
+        }
+        for (int i = 0; i < keys.length; ++i) {
+            if (PHYSICAL_KEY_EXISTS[keys[i]]) {
+                return true;
+            }
+        }
+        System.err.println("** " + catName + " has no physical keys but with factor " + factor + "%.");
+        return false;
+    }
+
+    /**
+     * See if any key exists for non-zero factors.
+     */
+    private boolean validateKeys() {
+        return validateKeyCategory("NAV_KEYS", NAV_KEYS, mFactors[FACTOR_NAV])
+            && validateKeyCategory("MAJOR_NAV_KEYS", MAJOR_NAV_KEYS, mFactors[FACTOR_MAJORNAV])
+            && validateKeyCategory("SYS_KEYS", SYS_KEYS, mFactors[FACTOR_SYSOPS]);
+    }
+
     /**
      * set the factors
      *
@@ -422,25 +479,27 @@
         }
 
         // The remaining event categories are injected as key events
-        if (cls < mFactors[FACTOR_NAV]) {
-            lastKey = NAV_KEYS[mRandom.nextInt(NAV_KEYS.length)];
-        } else if (cls < mFactors[FACTOR_MAJORNAV]) {
-            lastKey = MAJOR_NAV_KEYS[mRandom.nextInt(MAJOR_NAV_KEYS.length)];
-        } else if (cls < mFactors[FACTOR_SYSOPS]) {
-            lastKey = SYS_KEYS[mRandom.nextInt(SYS_KEYS.length)];
-        } else if (cls < mFactors[FACTOR_APPSWITCH]) {
-            MonkeyActivityEvent e = new MonkeyActivityEvent(mMainApps.get(
-                    mRandom.nextInt(mMainApps.size())));
-            mQ.addLast(e);
-            return;
-        } else if (cls < mFactors[FACTOR_FLIP]) {
-            MonkeyFlipEvent e = new MonkeyFlipEvent(mKeyboardOpen);
-            mKeyboardOpen = !mKeyboardOpen;
-            mQ.addLast(e);
-            return;
-        } else {
-            lastKey = 1 + mRandom.nextInt(KeyEvent.getMaxKeyCode() - 1);
-        }
+        do {
+            if (cls < mFactors[FACTOR_NAV]) {
+                lastKey = NAV_KEYS[mRandom.nextInt(NAV_KEYS.length)];
+            } else if (cls < mFactors[FACTOR_MAJORNAV]) {
+                lastKey = MAJOR_NAV_KEYS[mRandom.nextInt(MAJOR_NAV_KEYS.length)];
+            } else if (cls < mFactors[FACTOR_SYSOPS]) {
+                lastKey = SYS_KEYS[mRandom.nextInt(SYS_KEYS.length)];
+            } else if (cls < mFactors[FACTOR_APPSWITCH]) {
+                MonkeyActivityEvent e = new MonkeyActivityEvent(mMainApps.get(
+                        mRandom.nextInt(mMainApps.size())));
+                mQ.addLast(e);
+                return;
+            } else if (cls < mFactors[FACTOR_FLIP]) {
+                MonkeyFlipEvent e = new MonkeyFlipEvent(mKeyboardOpen);
+                mKeyboardOpen = !mKeyboardOpen;
+                mQ.addLast(e);
+                return;
+            } else {
+                lastKey = 1 + mRandom.nextInt(KeyEvent.getMaxKeyCode() - 1);
+            }
+        } while (!PHYSICAL_KEY_EXISTS[lastKey]);
 
         MonkeyKeyEvent e = new MonkeyKeyEvent(KeyEvent.ACTION_DOWN, lastKey);
         mQ.addLast(e);
diff --git a/cmds/monkey/src/com/android/commands/monkey/MonkeySourceRandomScript.java b/cmds/monkey/src/com/android/commands/monkey/MonkeySourceRandomScript.java
index fb60c93..ded7bfc 100644
--- a/cmds/monkey/src/com/android/commands/monkey/MonkeySourceRandomScript.java
+++ b/cmds/monkey/src/com/android/commands/monkey/MonkeySourceRandomScript.java
@@ -38,6 +38,10 @@
     /** The random number generator */
     private Random mRandom;
 
+    private boolean mRandomizeScript = false;
+
+    private int mScriptCount = 0;
+
     /**
      * Creates a MonkeySourceRandomScript instance with an additional setup script.
      *
@@ -48,19 +52,21 @@
      * @param random The random number generator.
      */
     public MonkeySourceRandomScript(String setupFileName, ArrayList<String> scriptFileNames,
-            long throttle, boolean randomizeThrottle, Random random) {
+            long throttle, boolean randomizeThrottle, Random random, long profileWaitTime,
+            long deviceSleepTime, boolean randomizeScript) {
         if (setupFileName != null) {
             mSetupSource = new MonkeySourceScript(random, setupFileName, throttle,
-                    randomizeThrottle);
+                    randomizeThrottle, profileWaitTime, deviceSleepTime);
             mCurrentSource = mSetupSource;
         }
 
         for (String fileName: scriptFileNames) {
             mScriptSources.add(new MonkeySourceScript(random, fileName, throttle,
-                      randomizeThrottle));
+                    randomizeThrottle, profileWaitTime, deviceSleepTime));
         }
 
         mRandom = random;
+        mRandomizeScript = randomizeScript;
     }
 
     /**
@@ -72,8 +78,10 @@
      * @param random The random number generator.
      */
     public MonkeySourceRandomScript(ArrayList<String> scriptFileNames, long throttle,
-            boolean randomizeThrottle, Random random) {
-        this(null, scriptFileNames, throttle, randomizeThrottle, random);
+            boolean randomizeThrottle, Random random, long profileWaitTime, long deviceSleepTime,
+            boolean randomizeScript) {
+        this(null, scriptFileNames, throttle, randomizeThrottle, random, profileWaitTime,
+                deviceSleepTime, randomizeScript);
     }
 
     /**
@@ -89,8 +97,13 @@
             int numSources = mScriptSources.size();
             if (numSources == 1) {
                 mCurrentSource = mScriptSources.get(0);
-            } else if (numSources > 1) {
-                mCurrentSource = mScriptSources.get(mRandom.nextInt(numSources));
+            } else if (numSources > 1 ) {
+                if (mRandomizeScript) {
+                    mCurrentSource = mScriptSources.get(mRandom.nextInt(numSources));
+                } else {
+                    mCurrentSource = mScriptSources.get(mScriptCount % numSources);
+                    mScriptCount++;
+                }
             }
         }
 
diff --git a/cmds/monkey/src/com/android/commands/monkey/MonkeySourceScript.java b/cmds/monkey/src/com/android/commands/monkey/MonkeySourceScript.java
index 9b2328d..6defcb0 100644
--- a/cmds/monkey/src/com/android/commands/monkey/MonkeySourceScript.java
+++ b/cmds/monkey/src/com/android/commands/monkey/MonkeySourceScript.java
@@ -27,6 +27,7 @@
 import java.io.InputStreamReader;
 import java.util.NoSuchElementException;
 import java.util.Random;
+import android.util.Log;
 
 /**
  * monkey event queue. It takes a script to produce events sample script format:
@@ -101,6 +102,16 @@
 
     private static final String EVENT_KEYWORD_WRITEPOWERLOG = "WriteLog";
 
+    private static final String EVENT_KEYWORD_RUNCMD = "RunCmd";
+
+    private static final String EVENT_KEYWORD_TAP = "Tap";
+
+    private static final String EVENT_KEYWORD_PROFILE_WAIT = "ProfileWait";
+
+    private static final String EVENT_KEYWORD_DEVICE_WAKEUP = "DeviceWakeUp";
+
+    private static final String EVENT_KEYWORD_INPUT_STRING = "DispatchString";
+
     // a line at the end of the header
     private static final String STARTING_DATA_LINE = "start data >>";
 
@@ -108,6 +119,10 @@
 
     private static int LONGPRESS_WAIT_TIME = 2000; // wait time for the long
 
+    private long mProfileWaitTime = 5000; //Wait time for each user profile
+
+    private long mDeviceSleepTime = 30000; //Device sleep time
+
     FileInputStream mFStream;
 
     DataInputStream mInputStream;
@@ -121,9 +136,11 @@
      * @param throttle The amount of time in ms to sleep between events.
      */
     public MonkeySourceScript(Random random, String filename, long throttle,
-            boolean randomizeThrottle) {
+            boolean randomizeThrottle, long profileWaitTime, long deviceSleepTime) {
         mScriptFileName = filename;
         mQ = new MonkeyEventQueue(random, throttle, randomizeThrottle);
+        mProfileWaitTime = profileWaitTime;
+        mDeviceSleepTime = deviceSleepTime;
     }
 
     /**
@@ -250,7 +267,6 @@
                 float yPrecision = Float.parseFloat(args[9]);
                 int device = Integer.parseInt(args[10]);
                 int edgeFlags = Integer.parseInt(args[11]);
-
                 int type = MonkeyEvent.EVENT_TYPE_TRACKBALL;
                 if (s.indexOf("Pointer") > 0) {
                     type = MonkeyEvent.EVENT_TYPE_POINTER;
@@ -263,6 +279,40 @@
             return;
         }
 
+        // Handle tap event
+        if ((s.indexOf(EVENT_KEYWORD_TAP) >= 0) && args.length == 2) {
+            try {
+                float x = Float.parseFloat(args[0]);
+                float y = Float.parseFloat(args[1]);
+
+                // Set the default parameters
+                long downTime = SystemClock.uptimeMillis();
+                float pressure = 1;
+                float xPrecision = 1;
+                float yPrecision = 1;
+                int edgeFlags = 0;
+                float size = 5;
+                int device = 0;
+                int metaState = 0;
+                int type = MonkeyEvent.EVENT_TYPE_POINTER;
+
+                MonkeyMotionEvent e1 =
+                        new MonkeyMotionEvent(type, downTime, downTime, KeyEvent.ACTION_DOWN, x,
+                                y, pressure, size, metaState, xPrecision, yPrecision, device,
+                                edgeFlags);
+                MonkeyMotionEvent e2 =
+                        new MonkeyMotionEvent(type, downTime, downTime, KeyEvent.ACTION_UP, x,
+                                y, pressure, size, metaState, xPrecision, yPrecision, device,
+                                edgeFlags);
+                mQ.addLast(e1);
+                mQ.addLast(e2);
+
+            } catch (NumberFormatException e) {
+                System.err.println("// " + e.toString());
+            }
+            return;
+        }
+
         // Handle flip events
         if (s.indexOf(EVENT_KEYWORD_FLIP) >= 0 && args.length == 1) {
             boolean keyboardOpen = Boolean.parseBoolean(args[0]);
@@ -271,12 +321,46 @@
         }
 
         // Handle launch events
-        if (s.indexOf(EVENT_KEYWORD_ACTIVITY) >= 0 && args.length == 2) {
+        if (s.indexOf(EVENT_KEYWORD_ACTIVITY) >= 0 && args.length >= 2) {
             String pkg_name = args[0];
             String cl_name = args[1];
+            long alarmTime = 0;
+
             ComponentName mApp = new ComponentName(pkg_name, cl_name);
-            MonkeyActivityEvent e = new MonkeyActivityEvent(mApp);
-            mQ.addLast(e);
+
+            if (args.length > 2) {
+                try {
+                    alarmTime = Long.parseLong(args[2]);
+                } catch (NumberFormatException e) {
+                    System.err.println("// " + e.toString());
+                    return;
+                }
+            }
+
+            if (args.length == 2) {
+                MonkeyActivityEvent e = new MonkeyActivityEvent(mApp);
+                mQ.addLast(e);
+            } else {
+                MonkeyActivityEvent e = new MonkeyActivityEvent(mApp, alarmTime);
+                mQ.addLast(e);
+            }
+            return;
+        }
+
+        //Handle the device wake up event
+        if (s.indexOf(EVENT_KEYWORD_DEVICE_WAKEUP) >= 0){
+            String pkg_name = "com.google.android.powerutil";
+            String cl_name = "com.google.android.powerutil.WakeUpScreen";
+            long deviceSleepTime = mDeviceSleepTime;
+
+            ComponentName mApp = new ComponentName(pkg_name, cl_name);
+            MonkeyActivityEvent e1 = new MonkeyActivityEvent(mApp, deviceSleepTime);
+            mQ.addLast(e1);
+
+            //Add the wait event after the device sleep event so that the monkey
+            //can continue after the device wake up.
+            MonkeyWaitEvent e2 = new MonkeyWaitEvent(deviceSleepTime + 3000);
+            mQ.addLast(e2);
             return;
         }
 
@@ -300,6 +384,14 @@
             return;
         }
 
+
+        // Handle the profile wait time
+        if (s.indexOf(EVENT_KEYWORD_PROFILE_WAIT) >= 0) {
+            MonkeyWaitEvent e = new MonkeyWaitEvent(mProfileWaitTime);
+            mQ.addLast(e);
+            return;
+        }
+
         // Handle keypress events
         if (s.indexOf(EVENT_KEYWORD_KEYPRESS) >= 0 && args.length == 1) {
             String key_name = args[0];
@@ -342,6 +434,23 @@
             MonkeyPowerEvent e = new MonkeyPowerEvent();
             mQ.addLast(e);
         }
+
+      //Run the shell command
+        if (s.indexOf(EVENT_KEYWORD_RUNCMD) >= 0 && args.length == 1) {
+            String cmd = args[0];
+            MonkeyCommandEvent e = new MonkeyCommandEvent(cmd);
+            mQ.addLast(e);
+        }
+
+        //Input the string through the shell command
+        if (s.indexOf(EVENT_KEYWORD_INPUT_STRING) >= 0 && args.length == 1) {
+            String input = args[0];
+            String cmd = "input text " + input;
+            MonkeyCommandEvent e = new MonkeyCommandEvent(cmd);
+            mQ.addLast(e);
+            return;
+        }
+
     }
 
     /**
diff --git a/ide/eclipse/.classpath b/ide/eclipse/.classpath
index adeb990..1994220 100644
--- a/ide/eclipse/.classpath
+++ b/ide/eclipse/.classpath
@@ -42,14 +42,15 @@
 	<classpathentry kind="src" path="frameworks/base/obex"/>
 	<classpathentry kind="src" path="frameworks/base/opengl/java"/>
 	<classpathentry kind="src" path="frameworks/base/packages/SettingsProvider/src"/>
+	<classpathentry kind="src" path="frameworks/base/policy/src"/>
 	<classpathentry kind="src" path="frameworks/base/sax/java"/>
 	<classpathentry kind="src" path="frameworks/base/services/java"/>
 	<classpathentry kind="src" path="frameworks/base/telephony/java"/>
 	<classpathentry kind="src" path="frameworks/base/test-runner/src"/>
+	<classpathentry kind="src" path="frameworks/base/voip/java"/>
 	<classpathentry kind="src" path="frameworks/base/vpn/java"/>
 	<classpathentry kind="src" path="frameworks/base/wifi/java"/>
 	<classpathentry kind="src" path="frameworks/ex/common/java"/>
-	<classpathentry kind="src" path="frameworks/policies/base/phone"/>
 	<classpathentry kind="src" path="development/samples/ApiDemos/src"/>
 	<classpathentry kind="src" path="development/samples/ApiDemos/tests/src"/>
 	<classpathentry kind="src" path="development/samples/Compass/src"/>
@@ -66,31 +67,11 @@
 	<classpathentry kind="src" path="development/samples/Snake/src"/>
 	<classpathentry kind="src" path="development/samples/Snake/tests/src"/>
 	<classpathentry kind="src" path="development/apps/Term/src"/>
-	<classpathentry kind="src" path="libcore/annotation/src/main/java"/>
-	<classpathentry kind="src" path="libcore/archive/src/main/java"/>
-	<classpathentry kind="src" path="libcore/auth/src/main/java"/>
-	<classpathentry kind="src" path="libcore/awt-kernel/src/main/java"/>
-	<classpathentry kind="src" path="libcore/concurrent/src/main/java"/>
-	<classpathentry kind="src" path="libcore/crypto/src/main/java"/>
 	<classpathentry kind="src" path="libcore/dalvik/src/main/java"/>
 	<classpathentry kind="src" path="libcore/icu/src/main/java"/>
 	<classpathentry kind="src" path="libcore/json/src/main/java"/>
 	<classpathentry kind="src" path="libcore/junit/src/main/java"/>
-	<classpathentry kind="src" path="libcore/logging/src/main/java"/>
-	<classpathentry kind="src" path="libcore/luni-kernel/src/main/java"/>
 	<classpathentry kind="src" path="libcore/luni/src/main/java"/>
-	<classpathentry kind="src" path="libcore/math/src/main/java"/>
-	<classpathentry kind="src" path="libcore/nio_char/src/main/java"/>
-	<classpathentry kind="src" path="libcore/nio/src/main/java"/>
-	<classpathentry kind="src" path="libcore/openssl/src/main/java"/>
-	<classpathentry kind="src" path="libcore/prefs/src/main/java"/>
-	<classpathentry kind="src" path="libcore/regex/src/main/java"/>
-	<classpathentry kind="src" path="libcore/security-kernel/src/main/java"/>
-	<classpathentry kind="src" path="libcore/security/src/main/java"/>
-	<classpathentry kind="src" path="libcore/sql/src/main/java"/>
-	<classpathentry kind="src" path="libcore/suncompat/src/main/java"/>
-	<classpathentry kind="src" path="libcore/text/src/main/java"/>
-	<classpathentry kind="src" path="libcore/x-net/src/main/java"/>
 	<classpathentry kind="src" path="libcore/xml/src/main/java"/>
 	<classpathentry kind="src" path="out/target/common/obj/APPS/ApiDemos_intermediates/src/src"/>
 	<classpathentry kind="src" path="out/target/common/obj/APPS/Browser_intermediates/src/src"/>
@@ -104,12 +85,15 @@
 	<classpathentry kind="src" path="out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/src/location/java"/>
 	<classpathentry kind="src" path="out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/src/media/java"/>
 	<classpathentry kind="src" path="out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/src/telephony/java"/>
+	<classpathentry kind="src" path="out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/src/voip/java"/>
 	<classpathentry kind="src" path="out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/src/vpn/java"/>
 	<classpathentry kind="src" path="out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/src/wifi/java"/>
 	<classpathentry kind="src" path="out/target/common/obj/JAVA_LIBRARIES/services_intermediates/src"/>
 	<classpathentry kind="src" path="out/target/common/R"/>
 	<classpathentry kind="src" path="external/tagsoup/src"/>
 	<classpathentry kind="src" path="external/apache-http/src"/>
+	<classpathentry kind="src" path="external/bouncycastle/src/main/java"/>
+	<classpathentry kind="src" path="external/nist-sip/java"/>
 	<classpathentry kind="lib" path="out/target/common/obj/JAVA_LIBRARIES/guava_intermediates/javalib.jar"/>
 	<classpathentry kind="lib" path="packages/apps/Calculator/arity-2.1.2.jar"/>
 	<classpathentry kind="output" path="out/target/common/obj/JAVA_LIBRARIES/android_stubs_current_intermediates/classes"/>
diff --git a/ndk/.gitignore b/ndk/.gitignore
new file mode 100644
index 0000000..fcbf4d2
--- /dev/null
+++ b/ndk/.gitignore
@@ -0,0 +1,12 @@
+samples/*/libs/
+samples/*/obj/
+samples/*/bin/
+samples/*/gen/
+platforms/android-*/samples/*/obj
+platforms/android-*/samples/*/libs
+tests/*/libs
+tests/*/obj/
+tests/*/bin/
+tests/*/gen/
+local.properties
+build.xml
diff --git a/ndk/Android.mk b/ndk/Android.mk
new file mode 100644
index 0000000..0c7e190
--- /dev/null
+++ b/ndk/Android.mk
@@ -0,0 +1 @@
+# Please this file empty. It is used to make the Android build system happy.
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/a.out.h b/ndk/platforms/android-3/arch-arm/include/asm/a.out.h
new file mode 100644
index 0000000..e8f17dc
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/a.out.h
@@ -0,0 +1,42 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ARM_A_OUT_H__
+#define __ARM_A_OUT_H__
+
+#include <linux/personality.h>
+#include <asm/types.h>
+
+struct exec
+{
+ __u32 a_info;
+ __u32 a_text;
+ __u32 a_data;
+ __u32 a_bss;
+ __u32 a_syms;
+ __u32 a_entry;
+ __u32 a_trsize;
+ __u32 a_drsize;
+};
+
+#define N_TXTADDR(a) (0x00008000)
+
+#define N_TRSIZE(a) ((a).a_trsize)
+#define N_DRSIZE(a) ((a).a_drsize)
+#define N_SYMSIZE(a) ((a).a_syms)
+
+#define M_ARM 103
+
+#ifndef LIBRARY_START_TEXT
+#define LIBRARY_START_TEXT (0x00c00000)
+#endif
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/arch/board-perseus2.h b/ndk/platforms/android-3/arch-arm/include/asm/arch/board-perseus2.h
new file mode 100644
index 0000000..c6c5413
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/arch/board-perseus2.h
@@ -0,0 +1,27 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASM_ARCH_OMAP_PERSEUS2_H
+#define __ASM_ARCH_OMAP_PERSEUS2_H
+
+#include <asm/arch/fpga.h>
+
+#ifndef OMAP_SDRAM_DEVICE
+#define OMAP_SDRAM_DEVICE D256M_1X16_4B
+#endif
+
+#define MAXIRQNUM IH_BOARD_BASE
+#define MAXFIQNUM MAXIRQNUM
+#define MAXSWINUM MAXIRQNUM
+
+#define NR_IRQS (MAXIRQNUM + 1)
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/arch/board.h b/ndk/platforms/android-3/arch-arm/include/asm/arch/board.h
new file mode 100644
index 0000000..a7a4c66
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/arch/board.h
@@ -0,0 +1,163 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _OMAP_BOARD_H
+#define _OMAP_BOARD_H
+
+#include <linux/types.h>
+
+#include <asm/arch/gpio-switch.h>
+
+#define OMAP_TAG_CLOCK 0x4f01
+#define OMAP_TAG_MMC 0x4f02
+#define OMAP_TAG_SERIAL_CONSOLE 0x4f03
+#define OMAP_TAG_USB 0x4f04
+#define OMAP_TAG_LCD 0x4f05
+#define OMAP_TAG_GPIO_SWITCH 0x4f06
+#define OMAP_TAG_UART 0x4f07
+#define OMAP_TAG_FBMEM 0x4f08
+#define OMAP_TAG_STI_CONSOLE 0x4f09
+#define OMAP_TAG_CAMERA_SENSOR 0x4f0a
+#define OMAP_TAG_BT 0x4f0b
+
+#define OMAP_TAG_BOOT_REASON 0x4f80
+#define OMAP_TAG_FLASH_PART 0x4f81
+#define OMAP_TAG_VERSION_STR 0x4f82
+
+struct omap_clock_config {
+
+ u8 system_clock_type;
+};
+
+struct omap_mmc_conf {
+ unsigned enabled:1;
+
+ unsigned nomux:1;
+
+ unsigned cover:1;
+
+ unsigned wire4:1;
+ s16 power_pin;
+ s16 switch_pin;
+ s16 wp_pin;
+};
+
+struct omap_mmc_config {
+ struct omap_mmc_conf mmc[2];
+};
+
+struct omap_serial_console_config {
+ u8 console_uart;
+ u32 console_speed;
+};
+
+struct omap_sti_console_config {
+ unsigned enable:1;
+ u8 channel;
+};
+
+struct omap_camera_sensor_config {
+ u16 reset_gpio;
+ int (*power_on)(void * data);
+ int (*power_off)(void * data);
+};
+
+struct omap_usb_config {
+
+ unsigned register_host:1;
+ unsigned register_dev:1;
+ u8 otg;
+
+ u8 hmc_mode;
+
+ u8 rwc;
+
+ u8 pins[3];
+};
+
+struct omap_lcd_config {
+ char panel_name[16];
+ char ctrl_name[16];
+ s16 nreset_gpio;
+ u8 data_lines;
+};
+
+struct device;
+struct fb_info;
+struct omap_backlight_config {
+ int default_intensity;
+ int (*set_power)(struct device *dev, int state);
+ int (*check_fb)(struct fb_info *fb);
+};
+
+struct omap_fbmem_config {
+ u32 start;
+ u32 size;
+};
+
+struct omap_pwm_led_platform_data {
+ const char *name;
+ int intensity_timer;
+ int blink_timer;
+ void (*set_power)(struct omap_pwm_led_platform_data *self, int on_off);
+};
+
+struct omap_gpio_switch_config {
+ char name[12];
+ u16 gpio;
+ int flags:4;
+ int type:4;
+ int key_code:24;
+};
+
+struct omap_uart_config {
+
+ unsigned int enabled_uarts;
+};
+
+struct omap_flash_part_config {
+ char part_table[0];
+};
+
+struct omap_boot_reason_config {
+ char reason_str[12];
+};
+
+struct omap_version_config {
+ char component[12];
+ char version[12];
+};
+
+struct omap_board_config_entry {
+ u16 tag;
+ u16 len;
+ u8 data[0];
+};
+
+struct omap_board_config_kernel {
+ u16 tag;
+ const void *data;
+};
+
+struct omap_bluetooth_config {
+ u8 chip_type;
+ u8 bt_uart;
+ u8 bd_addr[6];
+ u8 bt_sysclk;
+ int bt_wakeup_gpio;
+ int host_wakeup_gpio;
+ int reset_gpio;
+};
+
+#define omap_get_config(tag, type)   ((const type *) __omap_get_config((tag), sizeof(type), 0))
+#define omap_get_nr_config(tag, type, nr)   ((const type *) __omap_get_config((tag), sizeof(type), (nr)))
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/arch/cpu.h b/ndk/platforms/android-3/arch-arm/include/asm/arch/cpu.h
new file mode 100644
index 0000000..fa7a408
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/arch/cpu.h
@@ -0,0 +1,57 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASM_ARCH_OMAP_CPU_H
+#define __ASM_ARCH_OMAP_CPU_H
+
+#define omap2_cpu_rev() ((system_rev >> 8) & 0x0f)
+
+#undef MULTI_OMAP1
+#undef MULTI_OMAP2
+#undef OMAP_NAME
+
+#define GET_OMAP_CLASS (system_rev & 0xff)
+
+#define IS_OMAP_CLASS(class, id)  static inline int is_omap ##class (void)  {   return (GET_OMAP_CLASS == (id)) ? 1 : 0;  }
+
+#define GET_OMAP_SUBCLASS ((system_rev >> 20) & 0x0fff)
+
+#define IS_OMAP_SUBCLASS(subclass, id)  static inline int is_omap ##subclass (void)  {   return (GET_OMAP_SUBCLASS == (id)) ? 1 : 0;  }
+
+#define cpu_is_omap7xx() 0
+#define cpu_is_omap15xx() 0
+#define cpu_is_omap16xx() 0
+#define cpu_is_omap24xx() 0
+#define cpu_is_omap242x() 0
+#define cpu_is_omap243x() 0
+#ifdef MULTI_OMAP1
+#else
+#endif
+#define GET_OMAP_TYPE ((system_rev >> 16) & 0xffff)
+#define IS_OMAP_TYPE(type, id)  static inline int is_omap ##type (void)  {   return (GET_OMAP_TYPE == (id)) ? 1 : 0;  }
+#define cpu_is_omap310() 0
+#define cpu_is_omap730() 0
+#define cpu_is_omap1510() 0
+#define cpu_is_omap1610() 0
+#define cpu_is_omap5912() 0
+#define cpu_is_omap1611() 0
+#define cpu_is_omap1621() 0
+#define cpu_is_omap1710() 0
+#define cpu_is_omap2420() 0
+#define cpu_is_omap2422() 0
+#define cpu_is_omap2423() 0
+#define cpu_is_omap2430() 0
+#ifdef MULTI_OMAP1
+#else
+#endif
+#define cpu_class_is_omap1() (cpu_is_omap730() || cpu_is_omap15xx() ||   cpu_is_omap16xx())
+#define cpu_class_is_omap2() cpu_is_omap24xx()
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/arch/dma.h b/ndk/platforms/android-3/arch-arm/include/asm/arch/dma.h
new file mode 100644
index 0000000..5e5be76
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/arch/dma.h
@@ -0,0 +1,318 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASM_ARCH_DMA_H
+#define __ASM_ARCH_DMA_H
+
+#define OMAP_DMA_BASE (0xfffed800)
+#define OMAP_DMA_GCR (OMAP_DMA_BASE + 0x400)
+#define OMAP_DMA_GSCR (OMAP_DMA_BASE + 0x404)
+#define OMAP_DMA_GRST (OMAP_DMA_BASE + 0x408)
+#define OMAP_DMA_HW_ID (OMAP_DMA_BASE + 0x442)
+#define OMAP_DMA_PCH2_ID (OMAP_DMA_BASE + 0x444)
+#define OMAP_DMA_PCH0_ID (OMAP_DMA_BASE + 0x446)
+#define OMAP_DMA_PCH1_ID (OMAP_DMA_BASE + 0x448)
+#define OMAP_DMA_PCHG_ID (OMAP_DMA_BASE + 0x44a)
+#define OMAP_DMA_PCHD_ID (OMAP_DMA_BASE + 0x44c)
+#define OMAP_DMA_CAPS_0_U (OMAP_DMA_BASE + 0x44e)
+#define OMAP_DMA_CAPS_0_L (OMAP_DMA_BASE + 0x450)
+#define OMAP_DMA_CAPS_1_U (OMAP_DMA_BASE + 0x452)
+#define OMAP_DMA_CAPS_1_L (OMAP_DMA_BASE + 0x454)
+#define OMAP_DMA_CAPS_2 (OMAP_DMA_BASE + 0x456)
+#define OMAP_DMA_CAPS_3 (OMAP_DMA_BASE + 0x458)
+#define OMAP_DMA_CAPS_4 (OMAP_DMA_BASE + 0x45a)
+#define OMAP_DMA_PCH2_SR (OMAP_DMA_BASE + 0x460)
+#define OMAP_DMA_PCH0_SR (OMAP_DMA_BASE + 0x480)
+#define OMAP_DMA_PCH1_SR (OMAP_DMA_BASE + 0x482)
+#define OMAP_DMA_PCHD_SR (OMAP_DMA_BASE + 0x4c0)
+
+#define OMAP24XX_DMA_BASE (L4_24XX_BASE + 0x56000)
+#define OMAP_DMA4_REVISION (OMAP24XX_DMA_BASE + 0x00)
+#define OMAP_DMA4_GCR_REG (OMAP24XX_DMA_BASE + 0x78)
+#define OMAP_DMA4_IRQSTATUS_L0 (OMAP24XX_DMA_BASE + 0x08)
+#define OMAP_DMA4_IRQSTATUS_L1 (OMAP24XX_DMA_BASE + 0x0c)
+#define OMAP_DMA4_IRQSTATUS_L2 (OMAP24XX_DMA_BASE + 0x10)
+#define OMAP_DMA4_IRQSTATUS_L3 (OMAP24XX_DMA_BASE + 0x14)
+#define OMAP_DMA4_IRQENABLE_L0 (OMAP24XX_DMA_BASE + 0x18)
+#define OMAP_DMA4_IRQENABLE_L1 (OMAP24XX_DMA_BASE + 0x1c)
+#define OMAP_DMA4_IRQENABLE_L2 (OMAP24XX_DMA_BASE + 0x20)
+#define OMAP_DMA4_IRQENABLE_L3 (OMAP24XX_DMA_BASE + 0x24)
+#define OMAP_DMA4_SYSSTATUS (OMAP24XX_DMA_BASE + 0x28)
+#define OMAP_DMA4_CAPS_0 (OMAP24XX_DMA_BASE + 0x64)
+#define OMAP_DMA4_CAPS_2 (OMAP24XX_DMA_BASE + 0x6c)
+#define OMAP_DMA4_CAPS_3 (OMAP24XX_DMA_BASE + 0x70)
+#define OMAP_DMA4_CAPS_4 (OMAP24XX_DMA_BASE + 0x74)
+
+#define OMAP_LOGICAL_DMA_CH_COUNT 32  
+
+#define OMAP_DMA_CCR_REG(n) __REG32(OMAP24XX_DMA_BASE + 0x60 * (n) + 0x80)
+#define OMAP_DMA_CLNK_CTRL_REG(n) __REG32(OMAP24XX_DMA_BASE + 0x60 * (n) + 0x84)
+#define OMAP_DMA_CICR_REG(n) __REG32(OMAP24XX_DMA_BASE + 0x60 * (n) + 0x88)
+#define OMAP_DMA_CSR_REG(n) __REG32(OMAP24XX_DMA_BASE + 0x60 * (n) + 0x8c)
+#define OMAP_DMA_CSDP_REG(n) __REG32(OMAP24XX_DMA_BASE + 0x60 * (n) + 0x90)
+#define OMAP_DMA_CEN_REG(n) __REG32(OMAP24XX_DMA_BASE + 0x60 * (n) + 0x94)
+#define OMAP_DMA_CFN_REG(n) __REG32(OMAP24XX_DMA_BASE + 0x60 * (n) + 0x98)
+#define OMAP_DMA_CSEI_REG(n) __REG32(OMAP24XX_DMA_BASE + 0x60 * (n) + 0xa4)
+#define OMAP_DMA_CSFI_REG(n) __REG32(OMAP24XX_DMA_BASE + 0x60 * (n) + 0xa8)
+#define OMAP_DMA_CDEI_REG(n) __REG32(OMAP24XX_DMA_BASE + 0x60 * (n) + 0xac)
+#define OMAP_DMA_CDFI_REG(n) __REG32(OMAP24XX_DMA_BASE + 0x60 * (n) + 0xb0)
+#define OMAP_DMA_CSAC_REG(n) __REG32(OMAP24XX_DMA_BASE + 0x60 * (n) + 0xb4)
+#define OMAP_DMA_CDAC_REG(n) __REG32(OMAP24XX_DMA_BASE + 0x60 * (n) + 0xb8)
+
+#define OMAP1_DMA_CSSA_L_REG(n) __REG16(OMAP_DMA_BASE + 0x40 * (n) + 0x08)
+#define OMAP1_DMA_CSSA_U_REG(n) __REG16(OMAP_DMA_BASE + 0x40 * (n) + 0x0a)
+#define OMAP1_DMA_CDSA_L_REG(n) __REG16(OMAP_DMA_BASE + 0x40 * (n) + 0x0c)
+#define OMAP1_DMA_CDSA_U_REG(n) __REG16(OMAP_DMA_BASE + 0x40 * (n) + 0x0e)
+#define OMAP1_DMA_COLOR_L_REG(n) __REG16(OMAP_DMA_BASE + 0x40 * (n) + 0x20)
+#define OMAP1_DMA_CCR2_REG(n) __REG16(OMAP_DMA_BASE + 0x40 * (n) + 0x24)
+#define OMAP1_DMA_COLOR_U_REG(n) __REG16(OMAP_DMA_BASE + 0x40 * (n) + 0x22)
+#define OMAP1_DMA_LCH_CTRL_REG(n) __REG16(OMAP_DMA_BASE + 0x40 * (n) + 0x2a)
+
+#define OMAP2_DMA_CSSA_REG(n) __REG32(OMAP24XX_DMA_BASE + 0x60 * (n) + 0x9c)
+#define OMAP2_DMA_CDSA_REG(n) __REG32(OMAP24XX_DMA_BASE + 0x60 * (n) + 0xa0)
+#define OMAP2_DMA_CCEN_REG(n) __REG32(OMAP24XX_DMA_BASE + 0x60 * (n) + 0xbc)
+#define OMAP2_DMA_CCFN_REG(n) __REG32(OMAP24XX_DMA_BASE + 0x60 * (n) + 0xc0)
+#define OMAP2_DMA_COLOR_REG(n) __REG32(OMAP24XX_DMA_BASE + 0x60 * (n) + 0xc4)
+
+#define OMAP_DMA_NO_DEVICE 0
+#define OMAP_DMA_MCSI1_TX 1
+#define OMAP_DMA_MCSI1_RX 2
+#define OMAP_DMA_I2C_RX 3
+#define OMAP_DMA_I2C_TX 4
+#define OMAP_DMA_EXT_NDMA_REQ 5
+#define OMAP_DMA_EXT_NDMA_REQ2 6
+#define OMAP_DMA_UWIRE_TX 7
+#define OMAP_DMA_MCBSP1_TX 8
+#define OMAP_DMA_MCBSP1_RX 9
+#define OMAP_DMA_MCBSP3_TX 10
+#define OMAP_DMA_MCBSP3_RX 11
+#define OMAP_DMA_UART1_TX 12
+#define OMAP_DMA_UART1_RX 13
+#define OMAP_DMA_UART2_TX 14
+#define OMAP_DMA_UART2_RX 15
+#define OMAP_DMA_MCBSP2_TX 16
+#define OMAP_DMA_MCBSP2_RX 17
+#define OMAP_DMA_UART3_TX 18
+#define OMAP_DMA_UART3_RX 19
+#define OMAP_DMA_CAMERA_IF_RX 20
+#define OMAP_DMA_MMC_TX 21
+#define OMAP_DMA_MMC_RX 22
+#define OMAP_DMA_NAND 23
+#define OMAP_DMA_IRQ_LCD_LINE 24
+#define OMAP_DMA_MEMORY_STICK 25
+#define OMAP_DMA_USB_W2FC_RX0 26
+#define OMAP_DMA_USB_W2FC_RX1 27
+#define OMAP_DMA_USB_W2FC_RX2 28
+#define OMAP_DMA_USB_W2FC_TX0 29
+#define OMAP_DMA_USB_W2FC_TX1 30
+#define OMAP_DMA_USB_W2FC_TX2 31
+
+#define OMAP_DMA_CRYPTO_DES_IN 32
+#define OMAP_DMA_SPI_TX 33
+#define OMAP_DMA_SPI_RX 34
+#define OMAP_DMA_CRYPTO_HASH 35
+#define OMAP_DMA_CCP_ATTN 36
+#define OMAP_DMA_CCP_FIFO_NOT_EMPTY 37
+#define OMAP_DMA_CMT_APE_TX_CHAN_0 38
+#define OMAP_DMA_CMT_APE_RV_CHAN_0 39
+#define OMAP_DMA_CMT_APE_TX_CHAN_1 40
+#define OMAP_DMA_CMT_APE_RV_CHAN_1 41
+#define OMAP_DMA_CMT_APE_TX_CHAN_2 42
+#define OMAP_DMA_CMT_APE_RV_CHAN_2 43
+#define OMAP_DMA_CMT_APE_TX_CHAN_3 44
+#define OMAP_DMA_CMT_APE_RV_CHAN_3 45
+#define OMAP_DMA_CMT_APE_TX_CHAN_4 46
+#define OMAP_DMA_CMT_APE_RV_CHAN_4 47
+#define OMAP_DMA_CMT_APE_TX_CHAN_5 48
+#define OMAP_DMA_CMT_APE_RV_CHAN_5 49
+#define OMAP_DMA_CMT_APE_TX_CHAN_6 50
+#define OMAP_DMA_CMT_APE_RV_CHAN_6 51
+#define OMAP_DMA_CMT_APE_TX_CHAN_7 52
+#define OMAP_DMA_CMT_APE_RV_CHAN_7 53
+#define OMAP_DMA_MMC2_TX 54
+#define OMAP_DMA_MMC2_RX 55
+#define OMAP_DMA_CRYPTO_DES_OUT 56
+
+#define OMAP24XX_DMA_NO_DEVICE 0
+#define OMAP24XX_DMA_XTI_DMA 1  
+#define OMAP24XX_DMA_EXT_DMAREQ0 2  
+#define OMAP24XX_DMA_EXT_DMAREQ1 3  
+#define OMAP24XX_DMA_GPMC 4  
+#define OMAP24XX_DMA_GFX 5  
+#define OMAP24XX_DMA_DSS 6  
+#define OMAP24XX_DMA_VLYNQ_TX 7  
+#define OMAP24XX_DMA_CWT 8  
+#define OMAP24XX_DMA_AES_TX 9  
+#define OMAP24XX_DMA_AES_RX 10  
+#define OMAP24XX_DMA_DES_TX 11  
+#define OMAP24XX_DMA_DES_RX 12  
+#define OMAP24XX_DMA_SHA1MD5_RX 13  
+#define OMAP24XX_DMA_EXT_DMAREQ2 14  
+#define OMAP24XX_DMA_EXT_DMAREQ3 15  
+#define OMAP24XX_DMA_EXT_DMAREQ4 16  
+#define OMAP24XX_DMA_EAC_AC_RD 17  
+#define OMAP24XX_DMA_EAC_AC_WR 18  
+#define OMAP24XX_DMA_EAC_MD_UL_RD 19  
+#define OMAP24XX_DMA_EAC_MD_UL_WR 20  
+#define OMAP24XX_DMA_EAC_MD_DL_RD 21  
+#define OMAP24XX_DMA_EAC_MD_DL_WR 22  
+#define OMAP24XX_DMA_EAC_BT_UL_RD 23  
+#define OMAP24XX_DMA_EAC_BT_UL_WR 24  
+#define OMAP24XX_DMA_EAC_BT_DL_RD 25  
+#define OMAP24XX_DMA_EAC_BT_DL_WR 26  
+#define OMAP24XX_DMA_I2C1_TX 27  
+#define OMAP24XX_DMA_I2C1_RX 28  
+#define OMAP24XX_DMA_I2C2_TX 29  
+#define OMAP24XX_DMA_I2C2_RX 30  
+#define OMAP24XX_DMA_MCBSP1_TX 31  
+#define OMAP24XX_DMA_MCBSP1_RX 32  
+#define OMAP24XX_DMA_MCBSP2_TX 33  
+#define OMAP24XX_DMA_MCBSP2_RX 34  
+#define OMAP24XX_DMA_SPI1_TX0 35  
+#define OMAP24XX_DMA_SPI1_RX0 36  
+#define OMAP24XX_DMA_SPI1_TX1 37  
+#define OMAP24XX_DMA_SPI1_RX1 38  
+#define OMAP24XX_DMA_SPI1_TX2 39  
+#define OMAP24XX_DMA_SPI1_RX2 40  
+#define OMAP24XX_DMA_SPI1_TX3 41  
+#define OMAP24XX_DMA_SPI1_RX3 42  
+#define OMAP24XX_DMA_SPI2_TX0 43  
+#define OMAP24XX_DMA_SPI2_RX0 44  
+#define OMAP24XX_DMA_SPI2_TX1 45  
+#define OMAP24XX_DMA_SPI2_RX1 46  
+
+#define OMAP24XX_DMA_UART1_TX 49  
+#define OMAP24XX_DMA_UART1_RX 50  
+#define OMAP24XX_DMA_UART2_TX 51  
+#define OMAP24XX_DMA_UART2_RX 52  
+#define OMAP24XX_DMA_UART3_TX 53  
+#define OMAP24XX_DMA_UART3_RX 54  
+#define OMAP24XX_DMA_USB_W2FC_TX0 55  
+#define OMAP24XX_DMA_USB_W2FC_RX0 56  
+#define OMAP24XX_DMA_USB_W2FC_TX1 57  
+#define OMAP24XX_DMA_USB_W2FC_RX1 58  
+#define OMAP24XX_DMA_USB_W2FC_TX2 59  
+#define OMAP24XX_DMA_USB_W2FC_RX2 60  
+#define OMAP24XX_DMA_MMC1_TX 61  
+#define OMAP24XX_DMA_MMC1_RX 62  
+#define OMAP24XX_DMA_MS 63  
+#define OMAP24XX_DMA_EXT_DMAREQ5 64  
+
+#define OMAP1510_DMA_LCD_BASE (0xfffedb00)
+#define OMAP1510_DMA_LCD_CTRL (OMAP1510_DMA_LCD_BASE + 0x00)
+#define OMAP1510_DMA_LCD_TOP_F1_L (OMAP1510_DMA_LCD_BASE + 0x02)
+#define OMAP1510_DMA_LCD_TOP_F1_U (OMAP1510_DMA_LCD_BASE + 0x04)
+#define OMAP1510_DMA_LCD_BOT_F1_L (OMAP1510_DMA_LCD_BASE + 0x06)
+#define OMAP1510_DMA_LCD_BOT_F1_U (OMAP1510_DMA_LCD_BASE + 0x08)
+
+#define OMAP1610_DMA_LCD_BASE (0xfffee300)
+#define OMAP1610_DMA_LCD_CSDP (OMAP1610_DMA_LCD_BASE + 0xc0)
+#define OMAP1610_DMA_LCD_CCR (OMAP1610_DMA_LCD_BASE + 0xc2)
+#define OMAP1610_DMA_LCD_CTRL (OMAP1610_DMA_LCD_BASE + 0xc4)
+#define OMAP1610_DMA_LCD_TOP_B1_L (OMAP1610_DMA_LCD_BASE + 0xc8)
+#define OMAP1610_DMA_LCD_TOP_B1_U (OMAP1610_DMA_LCD_BASE + 0xca)
+#define OMAP1610_DMA_LCD_BOT_B1_L (OMAP1610_DMA_LCD_BASE + 0xcc)
+#define OMAP1610_DMA_LCD_BOT_B1_U (OMAP1610_DMA_LCD_BASE + 0xce)
+#define OMAP1610_DMA_LCD_TOP_B2_L (OMAP1610_DMA_LCD_BASE + 0xd0)
+#define OMAP1610_DMA_LCD_TOP_B2_U (OMAP1610_DMA_LCD_BASE + 0xd2)
+#define OMAP1610_DMA_LCD_BOT_B2_L (OMAP1610_DMA_LCD_BASE + 0xd4)
+#define OMAP1610_DMA_LCD_BOT_B2_U (OMAP1610_DMA_LCD_BASE + 0xd6)
+#define OMAP1610_DMA_LCD_SRC_EI_B1 (OMAP1610_DMA_LCD_BASE + 0xd8)
+#define OMAP1610_DMA_LCD_SRC_FI_B1_L (OMAP1610_DMA_LCD_BASE + 0xda)
+#define OMAP1610_DMA_LCD_SRC_EN_B1 (OMAP1610_DMA_LCD_BASE + 0xe0)
+#define OMAP1610_DMA_LCD_SRC_FN_B1 (OMAP1610_DMA_LCD_BASE + 0xe4)
+#define OMAP1610_DMA_LCD_LCH_CTRL (OMAP1610_DMA_LCD_BASE + 0xea)
+#define OMAP1610_DMA_LCD_SRC_FI_B1_U (OMAP1610_DMA_LCD_BASE + 0xf4)
+
+#define OMAP1_DMA_TOUT_IRQ (1 << 0)
+#define OMAP_DMA_DROP_IRQ (1 << 1)
+#define OMAP_DMA_HALF_IRQ (1 << 2)
+#define OMAP_DMA_FRAME_IRQ (1 << 3)
+#define OMAP_DMA_LAST_IRQ (1 << 4)
+#define OMAP_DMA_BLOCK_IRQ (1 << 5)
+#define OMAP1_DMA_SYNC_IRQ (1 << 6)
+#define OMAP2_DMA_PKT_IRQ (1 << 7)
+#define OMAP2_DMA_TRANS_ERR_IRQ (1 << 8)
+#define OMAP2_DMA_SECURE_ERR_IRQ (1 << 9)
+#define OMAP2_DMA_SUPERVISOR_ERR_IRQ (1 << 10)
+#define OMAP2_DMA_MISALIGNED_ERR_IRQ (1 << 11)
+
+#define OMAP_DMA_DATA_TYPE_S8 0x00
+#define OMAP_DMA_DATA_TYPE_S16 0x01
+#define OMAP_DMA_DATA_TYPE_S32 0x02
+
+#define OMAP_DMA_SYNC_ELEMENT 0x00
+#define OMAP_DMA_SYNC_FRAME 0x01
+#define OMAP_DMA_SYNC_BLOCK 0x02
+
+#define OMAP_DMA_PORT_EMIFF 0x00
+#define OMAP_DMA_PORT_EMIFS 0x01
+#define OMAP_DMA_PORT_OCP_T1 0x02
+#define OMAP_DMA_PORT_TIPB 0x03
+#define OMAP_DMA_PORT_OCP_T2 0x04
+#define OMAP_DMA_PORT_MPUI 0x05
+
+#define OMAP_DMA_AMODE_CONSTANT 0x00
+#define OMAP_DMA_AMODE_POST_INC 0x01
+#define OMAP_DMA_AMODE_SINGLE_IDX 0x02
+#define OMAP_DMA_AMODE_DOUBLE_IDX 0x03
+
+enum {
+ OMAP_LCD_DMA_B1_TOP,
+ OMAP_LCD_DMA_B1_BOTTOM,
+ OMAP_LCD_DMA_B2_TOP,
+ OMAP_LCD_DMA_B2_BOTTOM
+};
+
+enum omap_dma_burst_mode {
+ OMAP_DMA_DATA_BURST_DIS = 0,
+ OMAP_DMA_DATA_BURST_4,
+ OMAP_DMA_DATA_BURST_8,
+ OMAP_DMA_DATA_BURST_16,
+};
+
+enum omap_dma_color_mode {
+ OMAP_DMA_COLOR_DIS = 0,
+ OMAP_DMA_CONSTANT_FILL,
+ OMAP_DMA_TRANSPARENT_COPY
+};
+
+enum omap_dma_write_mode {
+ OMAP_DMA_WRITE_NON_POSTED = 0,
+ OMAP_DMA_WRITE_POSTED,
+ OMAP_DMA_WRITE_LAST_NON_POSTED
+};
+
+struct omap_dma_channel_params {
+ int data_type;
+ int elem_count;
+ int frame_count;
+
+ int src_port;
+ int src_amode;
+ unsigned long src_start;
+ int src_ei;
+ int src_fi;
+
+ int dst_port;
+ int dst_amode;
+ unsigned long dst_start;
+ int dst_ei;
+ int dst_fi;
+
+ int trigger;
+ int sync_mode;
+ int src_or_dst_synch;
+
+ int ie;
+};
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/arch/fpga.h b/ndk/platforms/android-3/arch-arm/include/asm/arch/fpga.h
new file mode 100644
index 0000000..a1b210d
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/arch/fpga.h
@@ -0,0 +1,160 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASM_ARCH_OMAP_FPGA_H
+#define __ASM_ARCH_OMAP_FPGA_H
+
+#define omap1510_fpga_init_irq() (0)
+
+#define fpga_read(reg) __raw_readb(reg)
+#define fpga_write(val, reg) __raw_writeb(val, reg)
+
+#define H2P2_DBG_FPGA_BASE 0xE8000000  
+#define H2P2_DBG_FPGA_SIZE SZ_4K  
+#define H2P2_DBG_FPGA_START 0x04000000  
+
+#define H2P2_DBG_FPGA_ETHR_START (H2P2_DBG_FPGA_START + 0x300)
+#define H2P2_DBG_FPGA_FPGA_REV (H2P2_DBG_FPGA_BASE + 0x10)  
+#define H2P2_DBG_FPGA_BOARD_REV (H2P2_DBG_FPGA_BASE + 0x12)  
+#define H2P2_DBG_FPGA_GPIO (H2P2_DBG_FPGA_BASE + 0x14)  
+#define H2P2_DBG_FPGA_LEDS (H2P2_DBG_FPGA_BASE + 0x16)  
+#define H2P2_DBG_FPGA_MISC_INPUTS (H2P2_DBG_FPGA_BASE + 0x18)  
+#define H2P2_DBG_FPGA_LAN_STATUS (H2P2_DBG_FPGA_BASE + 0x1A)  
+#define H2P2_DBG_FPGA_LAN_RESET (H2P2_DBG_FPGA_BASE + 0x1C)  
+
+struct h2p2_dbg_fpga {
+
+ u16 smc91x[8];
+
+ u16 fpga_rev;
+ u16 board_rev;
+ u16 gpio_outputs;
+ u16 leds;
+
+ u16 misc_inputs;
+ u16 lan_status;
+ u16 lan_reset;
+ u16 reserved0;
+
+ u16 ps2_data;
+ u16 ps2_ctrl;
+
+};
+
+#define H2P2_DBG_FPGA_LED_GREEN (1 << 15)
+#define H2P2_DBG_FPGA_LED_AMBER (1 << 14)
+#define H2P2_DBG_FPGA_LED_RED (1 << 13)
+#define H2P2_DBG_FPGA_LED_BLUE (1 << 12)
+
+#define H2P2_DBG_FPGA_LOAD_METER (1 << 0) 
+#define H2P2_DBG_FPGA_LOAD_METER_SIZE 11
+#define H2P2_DBG_FPGA_LOAD_METER_MASK ((1 << H2P2_DBG_FPGA_LOAD_METER_SIZE) - 1)
+
+#define H2P2_DBG_FPGA_P2_LED_TIMER (1 << 0)
+#define H2P2_DBG_FPGA_P2_LED_IDLE (1 << 1)
+
+#define OMAP1510_FPGA_BASE 0xE8000000  
+#define OMAP1510_FPGA_SIZE SZ_4K
+#define OMAP1510_FPGA_START 0x08000000  
+
+#define OMAP1510_FPGA_REV_LOW (OMAP1510_FPGA_BASE + 0x0)
+#define OMAP1510_FPGA_REV_HIGH (OMAP1510_FPGA_BASE + 0x1)
+
+#define OMAP1510_FPGA_LCD_PANEL_CONTROL (OMAP1510_FPGA_BASE + 0x2)
+#define OMAP1510_FPGA_LED_DIGIT (OMAP1510_FPGA_BASE + 0x3)
+#define INNOVATOR_FPGA_HID_SPI (OMAP1510_FPGA_BASE + 0x4)
+#define OMAP1510_FPGA_POWER (OMAP1510_FPGA_BASE + 0x5)
+
+#define OMAP1510_FPGA_ISR_LO (OMAP1510_FPGA_BASE + 0x6)
+#define OMAP1510_FPGA_ISR_HI (OMAP1510_FPGA_BASE + 0x7)
+
+#define OMAP1510_FPGA_IMR_LO (OMAP1510_FPGA_BASE + 0x8)
+#define OMAP1510_FPGA_IMR_HI (OMAP1510_FPGA_BASE + 0x9)
+
+#define OMAP1510_FPGA_HOST_RESET (OMAP1510_FPGA_BASE + 0xa)
+#define OMAP1510_FPGA_RST (OMAP1510_FPGA_BASE + 0xb)
+
+#define OMAP1510_FPGA_AUDIO (OMAP1510_FPGA_BASE + 0xc)
+#define OMAP1510_FPGA_DIP (OMAP1510_FPGA_BASE + 0xe)
+#define OMAP1510_FPGA_FPGA_IO (OMAP1510_FPGA_BASE + 0xf)
+#define OMAP1510_FPGA_UART1 (OMAP1510_FPGA_BASE + 0x14)
+#define OMAP1510_FPGA_UART2 (OMAP1510_FPGA_BASE + 0x15)
+#define OMAP1510_FPGA_OMAP1510_STATUS (OMAP1510_FPGA_BASE + 0x16)
+#define OMAP1510_FPGA_BOARD_REV (OMAP1510_FPGA_BASE + 0x18)
+#define OMAP1510P1_PPT_DATA (OMAP1510_FPGA_BASE + 0x100)
+#define OMAP1510P1_PPT_STATUS (OMAP1510_FPGA_BASE + 0x101)
+#define OMAP1510P1_PPT_CONTROL (OMAP1510_FPGA_BASE + 0x102)
+
+#define OMAP1510_FPGA_TOUCHSCREEN (OMAP1510_FPGA_BASE + 0x204)
+
+#define INNOVATOR_FPGA_INFO (OMAP1510_FPGA_BASE + 0x205)
+#define INNOVATOR_FPGA_LCD_BRIGHT_LO (OMAP1510_FPGA_BASE + 0x206)
+#define INNOVATOR_FPGA_LCD_BRIGHT_HI (OMAP1510_FPGA_BASE + 0x207)
+#define INNOVATOR_FPGA_LED_GRN_LO (OMAP1510_FPGA_BASE + 0x208)
+#define INNOVATOR_FPGA_LED_GRN_HI (OMAP1510_FPGA_BASE + 0x209)
+#define INNOVATOR_FPGA_LED_RED_LO (OMAP1510_FPGA_BASE + 0x20a)
+#define INNOVATOR_FPGA_LED_RED_HI (OMAP1510_FPGA_BASE + 0x20b)
+#define INNOVATOR_FPGA_CAM_USB_CONTROL (OMAP1510_FPGA_BASE + 0x20c)
+#define INNOVATOR_FPGA_EXP_CONTROL (OMAP1510_FPGA_BASE + 0x20d)
+#define INNOVATOR_FPGA_ISR2 (OMAP1510_FPGA_BASE + 0x20e)
+#define INNOVATOR_FPGA_IMR2 (OMAP1510_FPGA_BASE + 0x210)
+
+#define OMAP1510_FPGA_ETHR_START (OMAP1510_FPGA_START + 0x300)
+
+#define OMAP1510_FPGA_RESET_VALUE 0x42
+
+#define OMAP1510_FPGA_PCR_IF_PD0 (1 << 7)
+#define OMAP1510_FPGA_PCR_COM2_EN (1 << 6)
+#define OMAP1510_FPGA_PCR_COM1_EN (1 << 5)
+#define OMAP1510_FPGA_PCR_EXP_PD0 (1 << 4)
+#define OMAP1510_FPGA_PCR_EXP_PD1 (1 << 3)
+#define OMAP1510_FPGA_PCR_48MHZ_CLK (1 << 2)
+#define OMAP1510_FPGA_PCR_4MHZ_CLK (1 << 1)
+#define OMAP1510_FPGA_PCR_RSRVD_BIT0 (1 << 0)
+
+#define OMAP1510_FPGA_HID_SCLK (1<<0)  
+#define OMAP1510_FPGA_HID_MOSI (1<<1)  
+#define OMAP1510_FPGA_HID_nSS (1<<2)  
+#define OMAP1510_FPGA_HID_nHSUS (1<<3)  
+#define OMAP1510_FPGA_HID_MISO (1<<4)  
+#define OMAP1510_FPGA_HID_ATN (1<<5)  
+#define OMAP1510_FPGA_HID_rsrvd (1<<6)
+#define OMAP1510_FPGA_HID_RESETn (1<<7)  
+
+#define OMAP1510_INT_FPGA (IH_GPIO_BASE + 13)
+
+#define OMAP1510_IH_FPGA_BASE IH_BOARD_BASE
+#define OMAP1510_INT_FPGA_ATN (OMAP1510_IH_FPGA_BASE + 0)
+#define OMAP1510_INT_FPGA_ACK (OMAP1510_IH_FPGA_BASE + 1)
+#define OMAP1510_INT_FPGA2 (OMAP1510_IH_FPGA_BASE + 2)
+#define OMAP1510_INT_FPGA3 (OMAP1510_IH_FPGA_BASE + 3)
+#define OMAP1510_INT_FPGA4 (OMAP1510_IH_FPGA_BASE + 4)
+#define OMAP1510_INT_FPGA5 (OMAP1510_IH_FPGA_BASE + 5)
+#define OMAP1510_INT_FPGA6 (OMAP1510_IH_FPGA_BASE + 6)
+#define OMAP1510_INT_FPGA7 (OMAP1510_IH_FPGA_BASE + 7)
+#define OMAP1510_INT_FPGA8 (OMAP1510_IH_FPGA_BASE + 8)
+#define OMAP1510_INT_FPGA9 (OMAP1510_IH_FPGA_BASE + 9)
+#define OMAP1510_INT_FPGA10 (OMAP1510_IH_FPGA_BASE + 10)
+#define OMAP1510_INT_FPGA11 (OMAP1510_IH_FPGA_BASE + 11)
+#define OMAP1510_INT_FPGA12 (OMAP1510_IH_FPGA_BASE + 12)
+#define OMAP1510_INT_ETHER (OMAP1510_IH_FPGA_BASE + 13)
+#define OMAP1510_INT_FPGAUART1 (OMAP1510_IH_FPGA_BASE + 14)
+#define OMAP1510_INT_FPGAUART2 (OMAP1510_IH_FPGA_BASE + 15)
+#define OMAP1510_INT_FPGA_TS (OMAP1510_IH_FPGA_BASE + 16)
+#define OMAP1510_INT_FPGA17 (OMAP1510_IH_FPGA_BASE + 17)
+#define OMAP1510_INT_FPGA_CAM (OMAP1510_IH_FPGA_BASE + 18)
+#define OMAP1510_INT_FPGA_RTC_A (OMAP1510_IH_FPGA_BASE + 19)
+#define OMAP1510_INT_FPGA_RTC_B (OMAP1510_IH_FPGA_BASE + 20)
+#define OMAP1510_INT_FPGA_CD (OMAP1510_IH_FPGA_BASE + 21)
+#define OMAP1510_INT_FPGA22 (OMAP1510_IH_FPGA_BASE + 22)
+#define OMAP1510_INT_FPGA23 (OMAP1510_IH_FPGA_BASE + 23)
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/arch/gpio-switch.h b/ndk/platforms/android-3/arch-arm/include/asm/arch/gpio-switch.h
new file mode 100644
index 0000000..20ea3f2
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/arch/gpio-switch.h
@@ -0,0 +1,37 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASM_ARCH_OMAP_GPIO_SWITCH_H
+#define __ASM_ARCH_OMAP_GPIO_SWITCH_H
+
+#include <linux/types.h>
+
+#define OMAP_GPIO_SWITCH_TYPE_COVER 0x0000
+#define OMAP_GPIO_SWITCH_TYPE_CONNECTION 0x0001
+#define OMAP_GPIO_SWITCH_TYPE_ACTIVITY 0x0002
+#define OMAP_GPIO_SWITCH_FLAG_INVERTED 0x0001
+#define OMAP_GPIO_SWITCH_FLAG_OUTPUT 0x0002
+
+struct omap_gpio_switch {
+ const char *name;
+ s16 gpio;
+ unsigned flags:4;
+ unsigned type:4;
+
+ u16 debounce_rising;
+
+ u16 debounce_falling;
+
+ void (* notify)(void *data, int state);
+ void *notify_data;
+};
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/arch/gpio.h b/ndk/platforms/android-3/arch-arm/include/asm/arch/gpio.h
new file mode 100644
index 0000000..332246d
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/arch/gpio.h
@@ -0,0 +1,49 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASM_ARCH_OMAP_GPIO_H
+#define __ASM_ARCH_OMAP_GPIO_H
+
+#include <asm/hardware.h>
+#include <asm/arch/irqs.h>
+#include <asm/io.h>
+
+#define OMAP_MPUIO_BASE (void __iomem *)0xfffb5000
+
+#define OMAP_MPUIO_INPUT_LATCH 0x00
+#define OMAP_MPUIO_OUTPUT 0x04
+#define OMAP_MPUIO_IO_CNTL 0x08
+#define OMAP_MPUIO_KBR_LATCH 0x10
+#define OMAP_MPUIO_KBC 0x14
+#define OMAP_MPUIO_GPIO_EVENT_MODE 0x18
+#define OMAP_MPUIO_GPIO_INT_EDGE 0x1c
+#define OMAP_MPUIO_KBD_INT 0x20
+#define OMAP_MPUIO_GPIO_INT 0x24
+#define OMAP_MPUIO_KBD_MASKIT 0x28
+#define OMAP_MPUIO_GPIO_MASKIT 0x2c
+#define OMAP_MPUIO_GPIO_DEBOUNCING 0x30
+#define OMAP_MPUIO_LATCH 0x34
+
+#define OMAP_MPUIO(nr) (OMAP_MAX_GPIO_LINES + (nr))
+#define OMAP_GPIO_IS_MPUIO(nr) ((nr) >= OMAP_MAX_GPIO_LINES)
+
+#define OMAP_GPIO_IRQ(nr) (OMAP_GPIO_IS_MPUIO(nr) ?   IH_MPUIO_BASE + ((nr) & 0x0f) :   IH_GPIO_BASE + (nr))
+
+struct omap_machine_gpio_bank {
+ int start;
+ int end;
+
+ void (*set_gpio_direction)(int gpio, int is_input);
+ void (*set_gpio_dataout)(int gpio, int enable);
+ int (*get_gpio_datain)(int gpio);
+};
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/arch/hardware.h b/ndk/platforms/android-3/arch-arm/include/asm/arch/hardware.h
new file mode 100644
index 0000000..e515ee8
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/arch/hardware.h
@@ -0,0 +1,157 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASM_ARCH_OMAP_HARDWARE_H
+#define __ASM_ARCH_OMAP_HARDWARE_H
+
+#include <asm/sizes.h>
+#ifndef __ASSEMBLER__
+#include <asm/types.h>
+#include <asm/arch/cpu.h>
+#endif
+#include <asm/arch/io.h>
+#include <asm/arch/serial.h>
+
+#define OMAP_MPU_TIMER1_BASE (0xfffec500)
+#define OMAP_MPU_TIMER2_BASE (0xfffec600)
+#define OMAP_MPU_TIMER3_BASE (0xfffec700)
+#define MPU_TIMER_FREE (1 << 6)
+#define MPU_TIMER_CLOCK_ENABLE (1 << 5)
+#define MPU_TIMER_AR (1 << 1)
+#define MPU_TIMER_ST (1 << 0)
+
+#define CLKGEN_REG_BASE (0xfffece00)
+#define ARM_CKCTL (CLKGEN_REG_BASE + 0x0)
+#define ARM_IDLECT1 (CLKGEN_REG_BASE + 0x4)
+#define ARM_IDLECT2 (CLKGEN_REG_BASE + 0x8)
+#define ARM_EWUPCT (CLKGEN_REG_BASE + 0xC)
+#define ARM_RSTCT1 (CLKGEN_REG_BASE + 0x10)
+#define ARM_RSTCT2 (CLKGEN_REG_BASE + 0x14)
+#define ARM_SYSST (CLKGEN_REG_BASE + 0x18)
+#define ARM_IDLECT3 (CLKGEN_REG_BASE + 0x24)
+
+#define CK_RATEF 1
+#define CK_IDLEF 2
+#define CK_ENABLEF 4
+#define CK_SELECTF 8
+#define SETARM_IDLE_SHIFT
+
+#define DPLL_CTL (0xfffecf00)
+
+#define DSP_CONFIG_REG_BASE (0xe1008000)
+#define DSP_CKCTL (DSP_CONFIG_REG_BASE + 0x0)
+#define DSP_IDLECT1 (DSP_CONFIG_REG_BASE + 0x4)
+#define DSP_IDLECT2 (DSP_CONFIG_REG_BASE + 0x8)
+#define DSP_RSTCT2 (DSP_CONFIG_REG_BASE + 0x14)
+
+#define ULPD_REG_BASE (0xfffe0800)
+#define ULPD_IT_STATUS (ULPD_REG_BASE + 0x14)
+#define ULPD_SETUP_ANALOG_CELL_3 (ULPD_REG_BASE + 0x24)
+#define ULPD_CLOCK_CTRL (ULPD_REG_BASE + 0x30)
+#define DIS_USB_PVCI_CLK (1 << 5)  
+#define USB_MCLK_EN (1 << 4)  
+#define ULPD_SOFT_REQ (ULPD_REG_BASE + 0x34)
+#define SOFT_UDC_REQ (1 << 4)
+#define SOFT_USB_CLK_REQ (1 << 3)
+#define SOFT_DPLL_REQ (1 << 0)
+#define ULPD_DPLL_CTRL (ULPD_REG_BASE + 0x3c)
+#define ULPD_STATUS_REQ (ULPD_REG_BASE + 0x40)
+#define ULPD_APLL_CTRL (ULPD_REG_BASE + 0x4c)
+#define ULPD_POWER_CTRL (ULPD_REG_BASE + 0x50)
+#define ULPD_SOFT_DISABLE_REQ_REG (ULPD_REG_BASE + 0x68)
+#define DIS_MMC2_DPLL_REQ (1 << 11)
+#define DIS_MMC1_DPLL_REQ (1 << 10)
+#define DIS_UART3_DPLL_REQ (1 << 9)
+#define DIS_UART2_DPLL_REQ (1 << 8)
+#define DIS_UART1_DPLL_REQ (1 << 7)
+#define DIS_USB_HOST_DPLL_REQ (1 << 6)
+#define ULPD_SDW_CLK_DIV_CTRL_SEL (ULPD_REG_BASE + 0x74)
+#define ULPD_CAM_CLK_CTRL (ULPD_REG_BASE + 0x7c)
+
+#define OMAP_MPU_WATCHDOG_BASE (0xfffec800)
+#define OMAP_WDT_TIMER (OMAP_MPU_WATCHDOG_BASE + 0x0)
+#define OMAP_WDT_LOAD_TIM (OMAP_MPU_WATCHDOG_BASE + 0x4)
+#define OMAP_WDT_READ_TIM (OMAP_MPU_WATCHDOG_BASE + 0x4)
+#define OMAP_WDT_TIMER_MODE (OMAP_MPU_WATCHDOG_BASE + 0x8)
+
+#define MOD_CONF_CTRL_0 0xfffe1080
+#define MOD_CONF_CTRL_1 0xfffe1110
+
+#define FUNC_MUX_CTRL_0 0xfffe1000
+#define FUNC_MUX_CTRL_1 0xfffe1004
+#define FUNC_MUX_CTRL_2 0xfffe1008
+#define COMP_MODE_CTRL_0 0xfffe100c
+#define FUNC_MUX_CTRL_3 0xfffe1010
+#define FUNC_MUX_CTRL_4 0xfffe1014
+#define FUNC_MUX_CTRL_5 0xfffe1018
+#define FUNC_MUX_CTRL_6 0xfffe101C
+#define FUNC_MUX_CTRL_7 0xfffe1020
+#define FUNC_MUX_CTRL_8 0xfffe1024
+#define FUNC_MUX_CTRL_9 0xfffe1028
+#define FUNC_MUX_CTRL_A 0xfffe102C
+#define FUNC_MUX_CTRL_B 0xfffe1030
+#define FUNC_MUX_CTRL_C 0xfffe1034
+#define FUNC_MUX_CTRL_D 0xfffe1038
+#define PULL_DWN_CTRL_0 0xfffe1040
+#define PULL_DWN_CTRL_1 0xfffe1044
+#define PULL_DWN_CTRL_2 0xfffe1048
+#define PULL_DWN_CTRL_3 0xfffe104c
+#define PULL_DWN_CTRL_4 0xfffe10ac
+
+#define FUNC_MUX_CTRL_E 0xfffe1090
+#define FUNC_MUX_CTRL_F 0xfffe1094
+#define FUNC_MUX_CTRL_10 0xfffe1098
+#define FUNC_MUX_CTRL_11 0xfffe109c
+#define FUNC_MUX_CTRL_12 0xfffe10a0
+#define PU_PD_SEL_0 0xfffe10b4
+#define PU_PD_SEL_1 0xfffe10b8
+#define PU_PD_SEL_2 0xfffe10bc
+#define PU_PD_SEL_3 0xfffe10c0
+#define PU_PD_SEL_4 0xfffe10c4
+
+#define OMAP_TIMER32K_BASE 0xFFFBC400
+
+#define TIPB_PUBLIC_CNTL_BASE 0xfffed300
+#define MPU_PUBLIC_TIPB_CNTL (TIPB_PUBLIC_CNTL_BASE + 0x8)
+#define TIPB_PRIVATE_CNTL_BASE 0xfffeca00
+#define MPU_PRIVATE_TIPB_CNTL (TIPB_PRIVATE_CNTL_BASE + 0x8)
+
+#define MPUI_BASE (0xfffec900)
+#define MPUI_CTRL (MPUI_BASE + 0x0)
+#define MPUI_DEBUG_ADDR (MPUI_BASE + 0x4)
+#define MPUI_DEBUG_DATA (MPUI_BASE + 0x8)
+#define MPUI_DEBUG_FLAG (MPUI_BASE + 0xc)
+#define MPUI_STATUS_REG (MPUI_BASE + 0x10)
+#define MPUI_DSP_STATUS (MPUI_BASE + 0x14)
+#define MPUI_DSP_BOOT_CONFIG (MPUI_BASE + 0x18)
+#define MPUI_DSP_API_CONFIG (MPUI_BASE + 0x1c)
+
+#define OMAP_LPG1_BASE 0xfffbd000
+#define OMAP_LPG2_BASE 0xfffbd800
+#define OMAP_LPG1_LCR (OMAP_LPG1_BASE + 0x00)
+#define OMAP_LPG1_PMR (OMAP_LPG1_BASE + 0x04)
+#define OMAP_LPG2_LCR (OMAP_LPG2_BASE + 0x00)
+#define OMAP_LPG2_PMR (OMAP_LPG2_BASE + 0x04)
+
+#define OMAP_PWL_BASE 0xfffb5800
+#define OMAP_PWL_ENABLE (OMAP_PWL_BASE + 0x00)
+#define OMAP_PWL_CLK_ENABLE (OMAP_PWL_BASE + 0x04)
+
+#include "omap730.h"
+#include "omap1510.h"
+#include "omap24xx.h"
+#include "omap16xx.h"
+
+#ifndef __ASSEMBLER__
+
+#endif
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/arch/io.h b/ndk/platforms/android-3/arch-arm/include/asm/arch/io.h
new file mode 100644
index 0000000..12ac3d4
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/arch/io.h
@@ -0,0 +1,54 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASM_ARM_ARCH_IO_H
+#define __ASM_ARM_ARCH_IO_H
+
+#include <asm/hardware.h>
+
+#define IO_SPACE_LIMIT 0xffffffff
+
+#define __io(a) ((void __iomem *)(PCIO_BASE + (a)))
+#define __mem_pci(a) (a)
+
+#define PCIO_BASE 0
+
+#ifndef __ASSEMBLER__
+
+#define omap_readb(a) (*(volatile unsigned char *)IO_ADDRESS(a))
+#define omap_readw(a) (*(volatile unsigned short *)IO_ADDRESS(a))
+#define omap_readl(a) (*(volatile unsigned int *)IO_ADDRESS(a))
+
+#define omap_writeb(v,a) (*(volatile unsigned char *)IO_ADDRESS(a) = (v))
+#define omap_writew(v,a) (*(volatile unsigned short *)IO_ADDRESS(a) = (v))
+#define omap_writel(v,a) (*(volatile unsigned int *)IO_ADDRESS(a) = (v))
+
+typedef struct { volatile u16 offset[256]; } __regbase16;
+#define __REGV16(vaddr) ((__regbase16 *)((vaddr)&~0xff))   ->offset[((vaddr)&0xff)>>1]
+#define __REG16(paddr) __REGV16(io_p2v(paddr))
+
+typedef struct { volatile u8 offset[4096]; } __regbase8;
+#define __REGV8(vaddr) ((__regbase8 *)((vaddr)&~4095))   ->offset[((vaddr)&4095)>>0]
+#define __REG8(paddr) __REGV8(io_p2v(paddr))
+
+typedef struct { volatile u32 offset[4096]; } __regbase32;
+#define __REGV32(vaddr) ((__regbase32 *)((vaddr)&~4095))   ->offset[((vaddr)&4095)>>2]
+#define __REG32(paddr) __REGV32(io_p2v(paddr))
+
+#else
+
+#define __REG8(paddr) io_p2v(paddr)
+#define __REG16(paddr) io_p2v(paddr)
+#define __REG32(paddr) io_p2v(paddr)
+
+#endif
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/arch/irqs.h b/ndk/platforms/android-3/arch-arm/include/asm/arch/irqs.h
new file mode 100644
index 0000000..3e94487
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/arch/irqs.h
@@ -0,0 +1,242 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASM_ARCH_OMAP15XX_IRQS_H
+#define __ASM_ARCH_OMAP15XX_IRQS_H
+
+#define INT_CAMERA 1
+#define INT_FIQ 3
+#define INT_RTDX 6
+#define INT_DSP_MMU_ABORT 7
+#define INT_HOST 8
+#define INT_ABORT 9
+#define INT_DSP_MAILBOX1 10
+#define INT_DSP_MAILBOX2 11
+#define INT_BRIDGE_PRIV 13
+#define INT_GPIO_BANK1 14
+#define INT_UART3 15
+#define INT_TIMER3 16
+#define INT_DMA_CH0_6 19
+#define INT_DMA_CH1_7 20
+#define INT_DMA_CH2_8 21
+#define INT_DMA_CH3 22
+#define INT_DMA_CH4 23
+#define INT_DMA_CH5 24
+#define INT_DMA_LCD 25
+#define INT_TIMER1 26
+#define INT_WD_TIMER 27
+#define INT_BRIDGE_PUB 28
+#define INT_TIMER2 30
+#define INT_LCD_CTRL 31
+
+#define INT_1510_IH2_IRQ 0
+#define INT_1510_RES2 2
+#define INT_1510_SPI_TX 4
+#define INT_1510_SPI_RX 5
+#define INT_1510_RES12 12
+#define INT_1510_LB_MMU 17
+#define INT_1510_RES18 18
+#define INT_1510_LOCAL_BUS 29
+
+#define INT_1610_IH2_IRQ 0
+#define INT_1610_IH2_FIQ 2
+#define INT_1610_McBSP2_TX 4
+#define INT_1610_McBSP2_RX 5
+#define INT_1610_LCD_LINE 12
+#define INT_1610_GPTIMER1 17
+#define INT_1610_GPTIMER2 18
+#define INT_1610_SSR_FIFO_0 29
+
+#define INT_730_IH2_FIQ 0
+#define INT_730_IH2_IRQ 1
+#define INT_730_USB_NON_ISO 2
+#define INT_730_USB_ISO 3
+#define INT_730_ICR 4
+#define INT_730_EAC 5
+#define INT_730_GPIO_BANK1 6
+#define INT_730_GPIO_BANK2 7
+#define INT_730_GPIO_BANK3 8
+#define INT_730_McBSP2TX 10
+#define INT_730_McBSP2RX 11
+#define INT_730_McBSP2RX_OVF 12
+#define INT_730_LCD_LINE 14
+#define INT_730_GSM_PROTECT 15
+#define INT_730_TIMER3 16
+#define INT_730_GPIO_BANK5 17
+#define INT_730_GPIO_BANK6 18
+#define INT_730_SPGIO_WR 29
+
+#define IH2_BASE 32
+
+#define INT_KEYBOARD (1 + IH2_BASE)
+#define INT_uWireTX (2 + IH2_BASE)
+#define INT_uWireRX (3 + IH2_BASE)
+#define INT_I2C (4 + IH2_BASE)
+#define INT_MPUIO (5 + IH2_BASE)
+#define INT_USB_HHC_1 (6 + IH2_BASE)
+#define INT_McBSP3TX (10 + IH2_BASE)
+#define INT_McBSP3RX (11 + IH2_BASE)
+#define INT_McBSP1TX (12 + IH2_BASE)
+#define INT_McBSP1RX (13 + IH2_BASE)
+#define INT_UART2 (14 + IH2_BASE)
+#define INT_UART1 (15 + IH2_BASE)
+#define INT_BT_MCSI1TX (16 + IH2_BASE)
+#define INT_BT_MCSI1RX (17 + IH2_BASE)
+#define INT_USB_W2FC (20 + IH2_BASE)
+#define INT_1WIRE (21 + IH2_BASE)
+#define INT_OS_TIMER (22 + IH2_BASE)
+#define INT_MMC (23 + IH2_BASE)
+#define INT_GAUGE_32K (24 + IH2_BASE)
+#define INT_RTC_TIMER (25 + IH2_BASE)
+#define INT_RTC_ALARM (26 + IH2_BASE)
+#define INT_MEM_STICK (27 + IH2_BASE)
+#define INT_DSP_MMU (28 + IH2_BASE)
+
+#define INT_1510_COM_SPI_RO (31 + IH2_BASE)
+
+#define INT_1610_FAC (0 + IH2_BASE)
+#define INT_1610_USB_HHC_2 (7 + IH2_BASE)
+#define INT_1610_USB_OTG (8 + IH2_BASE)
+#define INT_1610_SoSSI (9 + IH2_BASE)
+#define INT_1610_SoSSI_MATCH (19 + IH2_BASE)
+#define INT_1610_McBSP2RX_OF (31 + IH2_BASE)
+#define INT_1610_STI (32 + IH2_BASE)
+#define INT_1610_STI_WAKEUP (33 + IH2_BASE)
+#define INT_1610_GPTIMER3 (34 + IH2_BASE)
+#define INT_1610_GPTIMER4 (35 + IH2_BASE)
+#define INT_1610_GPTIMER5 (36 + IH2_BASE)
+#define INT_1610_GPTIMER6 (37 + IH2_BASE)
+#define INT_1610_GPTIMER7 (38 + IH2_BASE)
+#define INT_1610_GPTIMER8 (39 + IH2_BASE)
+#define INT_1610_GPIO_BANK2 (40 + IH2_BASE)
+#define INT_1610_GPIO_BANK3 (41 + IH2_BASE)
+#define INT_1610_MMC2 (42 + IH2_BASE)
+#define INT_1610_CF (43 + IH2_BASE)
+#define INT_1610_WAKE_UP_REQ (46 + IH2_BASE)
+#define INT_1610_GPIO_BANK4 (48 + IH2_BASE)
+#define INT_1610_SPI (49 + IH2_BASE)
+#define INT_1610_DMA_CH6 (53 + IH2_BASE)
+#define INT_1610_DMA_CH7 (54 + IH2_BASE)
+#define INT_1610_DMA_CH8 (55 + IH2_BASE)
+#define INT_1610_DMA_CH9 (56 + IH2_BASE)
+#define INT_1610_DMA_CH10 (57 + IH2_BASE)
+#define INT_1610_DMA_CH11 (58 + IH2_BASE)
+#define INT_1610_DMA_CH12 (59 + IH2_BASE)
+#define INT_1610_DMA_CH13 (60 + IH2_BASE)
+#define INT_1610_DMA_CH14 (61 + IH2_BASE)
+#define INT_1610_DMA_CH15 (62 + IH2_BASE)
+#define INT_1610_NAND (63 + IH2_BASE)
+
+#define INT_730_HW_ERRORS (0 + IH2_BASE)
+#define INT_730_NFIQ_PWR_FAIL (1 + IH2_BASE)
+#define INT_730_CFCD (2 + IH2_BASE)
+#define INT_730_CFIREQ (3 + IH2_BASE)
+#define INT_730_I2C (4 + IH2_BASE)
+#define INT_730_PCC (5 + IH2_BASE)
+#define INT_730_MPU_EXT_NIRQ (6 + IH2_BASE)
+#define INT_730_SPI_100K_1 (7 + IH2_BASE)
+#define INT_730_SYREN_SPI (8 + IH2_BASE)
+#define INT_730_VLYNQ (9 + IH2_BASE)
+#define INT_730_GPIO_BANK4 (10 + IH2_BASE)
+#define INT_730_McBSP1TX (11 + IH2_BASE)
+#define INT_730_McBSP1RX (12 + IH2_BASE)
+#define INT_730_McBSP1RX_OF (13 + IH2_BASE)
+#define INT_730_UART_MODEM_IRDA_2 (14 + IH2_BASE)
+#define INT_730_UART_MODEM_1 (15 + IH2_BASE)
+#define INT_730_MCSI (16 + IH2_BASE)
+#define INT_730_uWireTX (17 + IH2_BASE)
+#define INT_730_uWireRX (18 + IH2_BASE)
+#define INT_730_SMC_CD (19 + IH2_BASE)
+#define INT_730_SMC_IREQ (20 + IH2_BASE)
+#define INT_730_HDQ_1WIRE (21 + IH2_BASE)
+#define INT_730_TIMER32K (22 + IH2_BASE)
+#define INT_730_MMC_SDIO (23 + IH2_BASE)
+#define INT_730_UPLD (24 + IH2_BASE)
+#define INT_730_USB_HHC_1 (27 + IH2_BASE)
+#define INT_730_USB_HHC_2 (28 + IH2_BASE)
+#define INT_730_USB_GENI (29 + IH2_BASE)
+#define INT_730_USB_OTG (30 + IH2_BASE)
+#define INT_730_CAMERA_IF (31 + IH2_BASE)
+#define INT_730_RNG (32 + IH2_BASE)
+#define INT_730_DUAL_MODE_TIMER (33 + IH2_BASE)
+#define INT_730_DBB_RF_EN (34 + IH2_BASE)
+#define INT_730_MPUIO_KEYPAD (35 + IH2_BASE)
+#define INT_730_SHA1_MD5 (36 + IH2_BASE)
+#define INT_730_SPI_100K_2 (37 + IH2_BASE)
+#define INT_730_RNG_IDLE (38 + IH2_BASE)
+#define INT_730_MPUIO (39 + IH2_BASE)
+#define INT_730_LLPC_LCD_CTRL_CAN_BE_OFF (40 + IH2_BASE)
+#define INT_730_LLPC_OE_FALLING (41 + IH2_BASE)
+#define INT_730_LLPC_OE_RISING (42 + IH2_BASE)
+#define INT_730_LLPC_VSYNC (43 + IH2_BASE)
+#define INT_730_WAKE_UP_REQ (46 + IH2_BASE)
+#define INT_730_DMA_CH6 (53 + IH2_BASE)
+#define INT_730_DMA_CH7 (54 + IH2_BASE)
+#define INT_730_DMA_CH8 (55 + IH2_BASE)
+#define INT_730_DMA_CH9 (56 + IH2_BASE)
+#define INT_730_DMA_CH10 (57 + IH2_BASE)
+#define INT_730_DMA_CH11 (58 + IH2_BASE)
+#define INT_730_DMA_CH12 (59 + IH2_BASE)
+#define INT_730_DMA_CH13 (60 + IH2_BASE)
+#define INT_730_DMA_CH14 (61 + IH2_BASE)
+#define INT_730_DMA_CH15 (62 + IH2_BASE)
+#define INT_730_NAND (63 + IH2_BASE)
+
+#define INT_24XX_SYS_NIRQ 7
+#define INT_24XX_SDMA_IRQ0 12
+#define INT_24XX_SDMA_IRQ1 13
+#define INT_24XX_SDMA_IRQ2 14
+#define INT_24XX_SDMA_IRQ3 15
+#define INT_24XX_CAM_IRQ 24
+#define INT_24XX_DSS_IRQ 25
+#define INT_24XX_GPIO_BANK1 29
+#define INT_24XX_GPIO_BANK2 30
+#define INT_24XX_GPIO_BANK3 31
+#define INT_24XX_GPIO_BANK4 32
+#define INT_24XX_GPTIMER1 37
+#define INT_24XX_GPTIMER2 38
+#define INT_24XX_GPTIMER3 39
+#define INT_24XX_GPTIMER4 40
+#define INT_24XX_GPTIMER5 41
+#define INT_24XX_GPTIMER6 42
+#define INT_24XX_GPTIMER7 43
+#define INT_24XX_GPTIMER8 44
+#define INT_24XX_GPTIMER9 45
+#define INT_24XX_GPTIMER10 46
+#define INT_24XX_GPTIMER11 47
+#define INT_24XX_GPTIMER12 48
+#define INT_24XX_MCBSP1_IRQ_TX 59
+#define INT_24XX_MCBSP1_IRQ_RX 60
+#define INT_24XX_MCBSP2_IRQ_TX 62
+#define INT_24XX_MCBSP2_IRQ_RX 63
+#define INT_24XX_UART1_IRQ 72
+#define INT_24XX_UART2_IRQ 73
+#define INT_24XX_UART3_IRQ 74
+#define INT_24XX_MMC_IRQ 83
+
+#define OMAP_MAX_GPIO_LINES 192
+#define IH_GPIO_BASE (128 + IH2_BASE)
+#define IH_MPUIO_BASE (OMAP_MAX_GPIO_LINES + IH_GPIO_BASE)
+#define IH_BOARD_BASE (16 + IH_MPUIO_BASE)
+
+#define OMAP_IRQ_BIT(irq) (1 << ((irq) % 32))
+
+#ifndef __ASSEMBLY__
+
+#endif
+
+#include <asm/hardware.h>
+
+#ifndef NR_IRQS
+#define NR_IRQS IH_BOARD_BASE
+#endif
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/arch/mcbsp.h b/ndk/platforms/android-3/arch-arm/include/asm/arch/mcbsp.h
new file mode 100644
index 0000000..cae5e3b
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/arch/mcbsp.h
@@ -0,0 +1,185 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASM_ARCH_OMAP_MCBSP_H
+#define __ASM_ARCH_OMAP_MCBSP_H
+
+#include <asm/hardware.h>
+
+#define OMAP730_MCBSP1_BASE 0xfffb1000
+#define OMAP730_MCBSP2_BASE 0xfffb1800
+
+#define OMAP1510_MCBSP1_BASE 0xe1011800
+#define OMAP1510_MCBSP2_BASE 0xfffb1000
+#define OMAP1510_MCBSP3_BASE 0xe1017000
+
+#define OMAP1610_MCBSP1_BASE 0xe1011800
+#define OMAP1610_MCBSP2_BASE 0xfffb1000
+#define OMAP1610_MCBSP3_BASE 0xe1017000
+
+#define OMAP24XX_MCBSP1_BASE 0x48074000
+#define OMAP24XX_MCBSP2_BASE 0x48076000
+
+#define OMAP_MCBSP_READ(base, reg) __raw_readw((base) + OMAP_MCBSP_REG_##reg)
+#define OMAP_MCBSP_WRITE(base, reg, val) __raw_writew((val), (base) + OMAP_MCBSP_REG_##reg)
+
+#define RRST 0x0001
+#define RRDY 0x0002
+#define RFULL 0x0004
+#define RSYNC_ERR 0x0008
+#define RINTM(value) ((value)<<4)  
+#define ABIS 0x0040
+#define DXENA 0x0080
+#define CLKSTP(value) ((value)<<11)  
+#define RJUST(value) ((value)<<13)  
+#define DLB 0x8000
+
+#define XRST 0x0001
+#define XRDY 0x0002
+#define XEMPTY 0x0004
+#define XSYNC_ERR 0x0008
+#define XINTM(value) ((value)<<4)  
+#define GRST 0x0040
+#define FRST 0x0080
+#define SOFT 0x0100
+#define FREE 0x0200
+
+#define CLKRP 0x0001
+#define CLKXP 0x0002
+#define FSRP 0x0004
+#define FSXP 0x0008
+#define DR_STAT 0x0010
+#define DX_STAT 0x0020
+#define CLKS_STAT 0x0040
+#define SCLKME 0x0080
+#define CLKRM 0x0100
+#define CLKXM 0x0200
+#define FSRM 0x0400
+#define FSXM 0x0800
+#define RIOEN 0x1000
+#define XIOEN 0x2000
+#define IDLE_EN 0x4000
+
+#define RWDLEN1(value) ((value)<<5)  
+#define RFRLEN1(value) ((value)<<8)  
+
+#define XWDLEN1(value) ((value)<<5)  
+#define XFRLEN1(value) ((value)<<8)  
+
+#define RDATDLY(value) (value)  
+#define RFIG 0x0004
+#define RCOMPAND(value) ((value)<<3)  
+#define RWDLEN2(value) ((value)<<5)  
+#define RFRLEN2(value) ((value)<<8)  
+#define RPHASE 0x8000
+
+#define XDATDLY(value) (value)  
+#define XFIG 0x0004
+#define XCOMPAND(value) ((value)<<3)  
+#define XWDLEN2(value) ((value)<<5)  
+#define XFRLEN2(value) ((value)<<8)  
+#define XPHASE 0x8000
+
+#define CLKGDV(value) (value)  
+#define FWID(value) ((value)<<8)  
+
+#define FPER(value) (value)  
+#define FSGM 0x1000
+#define CLKSM 0x2000
+#define CLKSP 0x4000
+#define GSYNC 0x8000
+
+#define RMCM 0x0001
+#define RCBLK(value) ((value)<<2)  
+#define RPABLK(value) ((value)<<5)  
+#define RPBBLK(value) ((value)<<7)  
+
+#define XMCM(value) (value)  
+#define XCBLK(value) ((value)<<2)  
+#define XPABLK(value) ((value)<<5)  
+#define XPBBLK(value) ((value)<<7)  
+
+struct omap_mcbsp_reg_cfg {
+ u16 spcr2;
+ u16 spcr1;
+ u16 rcr2;
+ u16 rcr1;
+ u16 xcr2;
+ u16 xcr1;
+ u16 srgr2;
+ u16 srgr1;
+ u16 mcr2;
+ u16 mcr1;
+ u16 pcr0;
+ u16 rcerc;
+ u16 rcerd;
+ u16 xcerc;
+ u16 xcerd;
+ u16 rcere;
+ u16 rcerf;
+ u16 xcere;
+ u16 xcerf;
+ u16 rcerg;
+ u16 rcerh;
+ u16 xcerg;
+ u16 xcerh;
+};
+
+typedef enum {
+ OMAP_MCBSP1 = 0,
+ OMAP_MCBSP2,
+ OMAP_MCBSP3,
+} omap_mcbsp_id;
+
+typedef int __bitwise omap_mcbsp_io_type_t;
+#define OMAP_MCBSP_IRQ_IO ((__force omap_mcbsp_io_type_t) 1)
+#define OMAP_MCBSP_POLL_IO ((__force omap_mcbsp_io_type_t) 2)
+
+typedef enum {
+ OMAP_MCBSP_WORD_8 = 0,
+ OMAP_MCBSP_WORD_12,
+ OMAP_MCBSP_WORD_16,
+ OMAP_MCBSP_WORD_20,
+ OMAP_MCBSP_WORD_24,
+ OMAP_MCBSP_WORD_32,
+} omap_mcbsp_word_length;
+
+typedef enum {
+ OMAP_MCBSP_CLK_RISING = 0,
+ OMAP_MCBSP_CLK_FALLING,
+} omap_mcbsp_clk_polarity;
+
+typedef enum {
+ OMAP_MCBSP_FS_ACTIVE_HIGH = 0,
+ OMAP_MCBSP_FS_ACTIVE_LOW,
+} omap_mcbsp_fs_polarity;
+
+typedef enum {
+ OMAP_MCBSP_CLK_STP_MODE_NO_DELAY = 0,
+ OMAP_MCBSP_CLK_STP_MODE_DELAY,
+} omap_mcbsp_clk_stp_mode;
+
+typedef enum {
+ OMAP_MCBSP_SPI_MASTER = 0,
+ OMAP_MCBSP_SPI_SLAVE,
+} omap_mcbsp_spi_mode;
+
+struct omap_mcbsp_spi_cfg {
+ omap_mcbsp_spi_mode spi_mode;
+ omap_mcbsp_clk_polarity rx_clock_polarity;
+ omap_mcbsp_clk_polarity tx_clock_polarity;
+ omap_mcbsp_fs_polarity fsx_polarity;
+ u8 clk_div;
+ omap_mcbsp_clk_stp_mode clk_stp_mode;
+ omap_mcbsp_word_length word_length;
+};
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/arch/memory.h b/ndk/platforms/android-3/arch-arm/include/asm/arch/memory.h
new file mode 100644
index 0000000..8b064b8
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/arch/memory.h
@@ -0,0 +1,19 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASM_ARCH_MEMORY_H
+#define __ASM_ARCH_MEMORY_H
+
+#define __virt_to_bus(x) __virt_to_phys(x)
+#define __bus_to_virt(x) __phys_to_virt(x)
+
+#endif
+
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/arch/mtd-xip.h b/ndk/platforms/android-3/arch-arm/include/asm/arch/mtd-xip.h
new file mode 100644
index 0000000..9b60aef
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/arch/mtd-xip.h
@@ -0,0 +1,31 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ARCH_OMAP_MTD_XIP_H__
+#define __ARCH_OMAP_MTD_XIP_H__
+
+#include <asm/hardware.h>
+#define OMAP_MPU_TIMER_BASE (0xfffec500)
+#define OMAP_MPU_TIMER_OFFSET 0x100
+
+typedef struct {
+ u32 cntl;
+ u32 load_tim;
+ u32 read_tim;
+} xip_omap_mpu_timer_regs_t;
+
+#define xip_omap_mpu_timer_base(n)  ((volatile xip_omap_mpu_timer_regs_t*)IO_ADDRESS(OMAP_MPU_TIMER_BASE +   (n)*OMAP_MPU_TIMER_OFFSET))
+
+#define xip_irqpending()   (omap_readl(OMAP_IH1_ITR) & ~omap_readl(OMAP_IH1_MIR))
+#define xip_currtime() (~xip_omap_mpu_timer_read(0))
+#define xip_elapsed_since(x) (signed)((~xip_omap_mpu_timer_read(0) - (x)) / 6)
+#define xip_cpu_idle() asm volatile ("mcr p15, 0, %0, c7, c0, 4" :: "r" (1))
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/arch/mux.h b/ndk/platforms/android-3/arch-arm/include/asm/arch/mux.h
new file mode 100644
index 0000000..72da54e
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/arch/mux.h
@@ -0,0 +1,391 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASM_ARCH_MUX_H
+#define __ASM_ARCH_MUX_H
+
+#define PU_PD_SEL_NA 0  
+#define PULL_DWN_CTRL_NA 0  
+
+#define MUX_REG(reg, mode_offset, mode) .mux_reg = FUNC_MUX_CTRL_##reg,   .mask_offset = mode_offset,   .mask = mode,
+
+#define PULL_REG(reg, bit, status) .pull_reg = PULL_DWN_CTRL_##reg,   .pull_bit = bit,   .pull_val = status,
+
+#define PU_PD_REG(reg, status) .pu_pd_reg = PU_PD_SEL_##reg,   .pu_pd_val = status,
+
+#define MUX_REG_730(reg, mode_offset, mode)   .mux_reg = OMAP730_IO_CONF_##reg,   .mask_offset = mode_offset,   .mask = mode,
+
+#define PULL_REG_730(reg, bit, status) .pull_reg = OMAP730_IO_CONF_##reg,   .pull_bit = bit,   .pull_val = status,
+
+#define MUX_CFG(desc, mux_reg, mode_offset, mode,   pull_reg, pull_bit, pull_status,   pu_pd_reg, pu_pd_status, debug_status)  {   .name = desc,   .debug = debug_status,   MUX_REG(mux_reg, mode_offset, mode)   PULL_REG(pull_reg, pull_bit, !pull_status)   PU_PD_REG(pu_pd_reg, pu_pd_status)  },
+
+#define MUX_CFG_730(desc, mux_reg, mode_offset, mode,   pull_bit, pull_status, debug_status) {   .name = desc,   .debug = debug_status,   MUX_REG_730(mux_reg, mode_offset, mode)   PULL_REG_730(mux_reg, pull_bit, pull_status)   PU_PD_REG(NA, 0)  },
+
+#define MUX_CFG_24XX(desc, reg_offset, mode,   pull_en, pull_mode, dbg)  {   .name = desc,   .debug = dbg,   .mux_reg = reg_offset,   .mask = mode,   .pull_val = pull_en,   .pu_pd_val = pull_mode,  },
+
+#define PULL_DISABLED 0
+#define PULL_ENABLED 1
+
+#define PULL_DOWN 0
+#define PULL_UP 1
+
+struct pin_config {
+ char *name;
+ unsigned char busy;
+ unsigned char debug;
+
+ const char *mux_reg_name;
+ const unsigned int mux_reg;
+ const unsigned char mask_offset;
+ const unsigned char mask;
+
+ const char *pull_name;
+ const unsigned int pull_reg;
+ const unsigned char pull_val;
+ const unsigned char pull_bit;
+
+ const char *pu_pd_name;
+ const unsigned int pu_pd_reg;
+ const unsigned char pu_pd_val;
+};
+
+enum omap730_index {
+
+ E2_730_KBR0,
+ J7_730_KBR1,
+ E1_730_KBR2,
+ F3_730_KBR3,
+ D2_730_KBR4,
+ AA20_730_KBR5,
+ V17_730_KBR6,
+ C2_730_KBC0,
+ D3_730_KBC1,
+ E4_730_KBC2,
+ F4_730_KBC3,
+ E3_730_KBC4,
+
+ AA17_730_USB_DM,
+ W16_730_USB_PU_EN,
+ W17_730_USB_VBUSI,
+
+ V19_730_GPIO_15,
+ M19_730_GPIO_77,
+ C21_730_GPIO_121_122,
+ K19_730_GPIO_126,
+ K15_730_GPIO_127,
+
+ P15_730_GPIO_16_17,
+
+ M15_730_GPIO_83,
+ N20_730_GPIO_82,
+ N18_730_GPIO_81,
+ N19_730_GPIO_80,
+ L15_730_GPIO_76,
+
+ UART1_CTS_RTS,
+ OMAP_730_GPIOS_42_43,
+ UART1_TX_RX,
+ OMAP_730_GPIOS_40_41,
+ UART1_USB_RX_TX,
+ UART1_USB_RTS,
+ UART1_USB_CTS
+};
+
+enum omap1xxx_index {
+
+ UART1_TX = 0,
+ UART1_RTS,
+
+ UART2_TX,
+ UART2_RX,
+ UART2_CTS,
+ UART2_RTS,
+
+ UART3_TX,
+ UART3_RX,
+ UART3_CTS,
+ UART3_RTS,
+ UART3_CLKREQ,
+ UART3_BCLK,
+ Y15_1610_UART3_RTS,
+
+ PWT,
+ PWL,
+
+ R18_USB_VBUS,
+ R18_1510_USB_GPIO0,
+ W4_USB_PUEN,
+ W4_USB_CLKO,
+ W4_USB_HIGHZ,
+ W4_GPIO58,
+
+ USB1_SUSP,
+ USB1_SEO,
+ W13_1610_USB1_SE0,
+ USB1_TXEN,
+ USB1_TXD,
+ USB1_VP,
+ USB1_VM,
+ USB1_RCV,
+ USB1_SPEED,
+ R13_1610_USB1_SPEED,
+ R13_1710_USB1_SE0,
+
+ USB2_SUSP,
+ USB2_VP,
+ USB2_TXEN,
+ USB2_VM,
+ USB2_RCV,
+ USB2_SEO,
+ USB2_TXD,
+
+ R18_1510_GPIO0,
+ R19_1510_GPIO1,
+ M14_1510_GPIO2,
+
+ P18_1610_GPIO3,
+ Y15_1610_GPIO17,
+
+ R18_1710_GPIO0,
+ V2_1710_GPIO10,
+ N21_1710_GPIO14,
+ W15_1710_GPIO40,
+
+ MPUIO2,
+ N15_1610_MPUIO2,
+ MPUIO4,
+ MPUIO5,
+ T20_1610_MPUIO5,
+ W11_1610_MPUIO6,
+ V10_1610_MPUIO7,
+ W11_1610_MPUIO9,
+ V10_1610_MPUIO10,
+ W10_1610_MPUIO11,
+ E20_1610_MPUIO13,
+ U20_1610_MPUIO14,
+ E19_1610_MPUIO15,
+
+ MCBSP2_CLKR,
+ MCBSP2_CLKX,
+ MCBSP2_DR,
+ MCBSP2_DX,
+ MCBSP2_FSR,
+ MCBSP2_FSX,
+
+ MCBSP3_CLKX,
+
+ BALLOUT_V8_ARMIO3,
+ N20_HDQ,
+
+ W8_1610_MMC2_DAT0,
+ V8_1610_MMC2_DAT1,
+ W15_1610_MMC2_DAT2,
+ R10_1610_MMC2_DAT3,
+ Y10_1610_MMC2_CLK,
+ Y8_1610_MMC2_CMD,
+ V9_1610_MMC2_CMDDIR,
+ V5_1610_MMC2_DATDIR0,
+ W19_1610_MMC2_DATDIR1,
+ R18_1610_MMC2_CLKIN,
+
+ M19_1610_ETM_PSTAT0,
+ L15_1610_ETM_PSTAT1,
+ L18_1610_ETM_PSTAT2,
+ L19_1610_ETM_D0,
+ J19_1610_ETM_D6,
+ J18_1610_ETM_D7,
+
+ P20_1610_GPIO4,
+ V9_1610_GPIO7,
+ W8_1610_GPIO9,
+ N20_1610_GPIO11,
+ N19_1610_GPIO13,
+ P10_1610_GPIO22,
+ V5_1610_GPIO24,
+ AA20_1610_GPIO_41,
+ W19_1610_GPIO48,
+ M7_1610_GPIO62,
+ V14_16XX_GPIO37,
+ R9_16XX_GPIO18,
+ L14_16XX_GPIO49,
+
+ V19_1610_UWIRE_SCLK,
+ U18_1610_UWIRE_SDI,
+ W21_1610_UWIRE_SDO,
+ N14_1610_UWIRE_CS0,
+ P15_1610_UWIRE_CS3,
+ N15_1610_UWIRE_CS1,
+
+ U19_1610_SPIF_SCK,
+ U18_1610_SPIF_DIN,
+ P20_1610_SPIF_DIN,
+ W21_1610_SPIF_DOUT,
+ R18_1610_SPIF_DOUT,
+ N14_1610_SPIF_CS0,
+ N15_1610_SPIF_CS1,
+ T19_1610_SPIF_CS2,
+ P15_1610_SPIF_CS3,
+
+ L3_1610_FLASH_CS2B_OE,
+ M8_1610_FLASH_CS2B_WE,
+
+ MMC_CMD,
+ MMC_DAT1,
+ MMC_DAT2,
+ MMC_DAT0,
+ MMC_CLK,
+ MMC_DAT3,
+
+ M15_1710_MMC_CLKI,
+ P19_1710_MMC_CMDDIR,
+ P20_1710_MMC_DATDIR0,
+
+ W9_USB0_TXEN,
+ AA9_USB0_VP,
+ Y5_USB0_RCV,
+ R9_USB0_VM,
+ V6_USB0_TXD,
+ W5_USB0_SE0,
+ V9_USB0_SPEED,
+ V9_USB0_SUSP,
+
+ W9_USB2_TXEN,
+ AA9_USB2_VP,
+ Y5_USB2_RCV,
+ R9_USB2_VM,
+ V6_USB2_TXD,
+ W5_USB2_SE0,
+
+ R13_1610_UART1_TX,
+ V14_16XX_UART1_RX,
+ R14_1610_UART1_CTS,
+ AA15_1610_UART1_RTS,
+ R9_16XX_UART2_RX,
+ L14_16XX_UART3_RX,
+
+ I2C_SCL,
+ I2C_SDA,
+
+ F18_1610_KBC0,
+ D20_1610_KBC1,
+ D19_1610_KBC2,
+ E18_1610_KBC3,
+ C21_1610_KBC4,
+ G18_1610_KBR0,
+ F19_1610_KBR1,
+ H14_1610_KBR2,
+ E20_1610_KBR3,
+ E19_1610_KBR4,
+ N19_1610_KBR5,
+
+ T20_1610_LOW_PWR,
+
+ V5_1710_MCLK_ON,
+ V5_1710_MCLK_OFF,
+ R10_1610_MCLK_ON,
+ R10_1610_MCLK_OFF,
+
+ P11_1610_CF_CD2,
+ R11_1610_CF_IOIS16,
+ V10_1610_CF_IREQ,
+ W10_1610_CF_RESET,
+ W11_1610_CF_CD1,
+};
+
+enum omap24xx_index {
+
+ M19_24XX_I2C1_SCL,
+ L15_24XX_I2C1_SDA,
+ J15_24XX_I2C2_SCL,
+ H19_24XX_I2C2_SDA,
+
+ W19_24XX_SYS_NIRQ,
+
+ W14_24XX_SYS_CLKOUT,
+
+ L3_GPMC_WAIT0,
+ N7_GPMC_WAIT1,
+ M1_GPMC_WAIT2,
+ P1_GPMC_WAIT3,
+
+ Y15_24XX_MCBSP2_CLKX,
+ R14_24XX_MCBSP2_FSX,
+ W15_24XX_MCBSP2_DR,
+ V15_24XX_MCBSP2_DX,
+
+ M21_242X_GPIO11,
+ AA10_242X_GPIO13,
+ AA6_242X_GPIO14,
+ AA4_242X_GPIO15,
+ Y11_242X_GPIO16,
+ AA12_242X_GPIO17,
+ AA8_242X_GPIO58,
+ Y20_24XX_GPIO60,
+ W4__24XX_GPIO74,
+ M15_24XX_GPIO92,
+ V14_24XX_GPIO117,
+
+ V4_242X_GPIO49,
+ W2_242X_GPIO50,
+ U4_242X_GPIO51,
+ V3_242X_GPIO52,
+ V2_242X_GPIO53,
+ V6_242X_GPIO53,
+ T4_242X_GPIO54,
+ Y4_242X_GPIO54,
+ T3_242X_GPIO55,
+ U2_242X_GPIO56,
+
+ AA10_242X_DMAREQ0,
+ AA6_242X_DMAREQ1,
+ E4_242X_DMAREQ2,
+ G4_242X_DMAREQ3,
+ D3_242X_DMAREQ4,
+ E3_242X_DMAREQ5,
+
+ P20_24XX_TSC_IRQ,
+
+ K15_24XX_UART3_TX,
+ K14_24XX_UART3_RX,
+
+ G19_24XX_MMC_CLKO,
+ H18_24XX_MMC_CMD,
+ F20_24XX_MMC_DAT0,
+ H14_24XX_MMC_DAT1,
+ E19_24XX_MMC_DAT2,
+ D19_24XX_MMC_DAT3,
+ F19_24XX_MMC_DAT_DIR0,
+ E20_24XX_MMC_DAT_DIR1,
+ F18_24XX_MMC_DAT_DIR2,
+ E18_24XX_MMC_DAT_DIR3,
+ G18_24XX_MMC_CMD_DIR,
+ H15_24XX_MMC_CLKI,
+
+ T19_24XX_KBR0,
+ R19_24XX_KBR1,
+ V18_24XX_KBR2,
+ M21_24XX_KBR3,
+ E5__24XX_KBR4,
+ M18_24XX_KBR5,
+ R20_24XX_KBC0,
+ M14_24XX_KBC1,
+ H19_24XX_KBC2,
+ V17_24XX_KBC3,
+ P21_24XX_KBC4,
+ L14_24XX_KBC5,
+ N19_24XX_KBC6,
+
+ B3__24XX_KBR5,
+ AA4_24XX_KBC2,
+ B13_24XX_KBC6,
+};
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/arch/omap24xx.h b/ndk/platforms/android-3/arch-arm/include/asm/arch/omap24xx.h
new file mode 100644
index 0000000..37def2f
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/arch/omap24xx.h
@@ -0,0 +1,30 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASM_ARCH_OMAP24XX_H
+#define __ASM_ARCH_OMAP24XX_H
+
+#define L4_24XX_BASE 0x48000000
+#define L3_24XX_BASE 0x68000000
+
+#define OMAP24XX_IC_BASE (L4_24XX_BASE + 0xfe000)
+#define VA_IC_BASE IO_ADDRESS(OMAP24XX_IC_BASE)
+#define OMAP24XX_IVA_INTC_BASE 0x40000000
+#define IRQ_SIR_IRQ 0x0040
+
+#define OMAP24XX_32KSYNCT_BASE (L4_24XX_BASE + 0x4000)
+#define OMAP24XX_PRCM_BASE (L4_24XX_BASE + 0x8000)
+#define OMAP24XX_SDRC_BASE (L3_24XX_BASE + 0x9000)
+
+#define OMAP242X_CONTROL_STATUS (L4_24XX_BASE + 0x2f8)
+
+#endif
+
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/arch/serial.h b/ndk/platforms/android-3/arch-arm/include/asm/arch/serial.h
new file mode 100644
index 0000000..6ab8613
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/arch/serial.h
@@ -0,0 +1,21 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASM_ARCH_SERIAL_H
+#define __ASM_ARCH_SERIAL_H
+
+#define OMAP_MAX_NR_PORTS 3
+#define OMAP1510_BASE_BAUD (12000000/16)
+#define OMAP16XX_BASE_BAUD (48000000/16)
+
+#define is_omap_port(p) ({int __ret = 0;   if (p == IO_ADDRESS(OMAP_UART1_BASE) ||   p == IO_ADDRESS(OMAP_UART2_BASE) ||   p == IO_ADDRESS(OMAP_UART3_BASE))   __ret = 1;   __ret;   })
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/arch/timex.h b/ndk/platforms/android-3/arch-arm/include/asm/arch/timex.h
new file mode 100644
index 0000000..2c9234c
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/arch/timex.h
@@ -0,0 +1,17 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASM_ARCH_OMAP_TIMEX_H
+#define __ASM_ARCH_OMAP_TIMEX_H
+
+#define CLOCK_TICK_RATE (HZ * 100000UL)
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/arch/vmalloc.h b/ndk/platforms/android-3/arch-arm/include/asm/arch/vmalloc.h
new file mode 100644
index 0000000..f2b5b44
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/arch/vmalloc.h
@@ -0,0 +1,13 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#define VMALLOC_END (PAGE_OFFSET + 0x10000000)
+
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/atomic.h b/ndk/platforms/android-3/arch-arm/include/asm/atomic.h
new file mode 100644
index 0000000..6f1921a
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/atomic.h
@@ -0,0 +1,21 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASM_ARM_ATOMIC_H
+#define __ASM_ARM_ATOMIC_H
+
+#include <linux/compiler.h>
+
+typedef struct { volatile int counter; } atomic_t;
+
+#define ATOMIC_INIT(i) { (i) }
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/auxvec.h b/ndk/platforms/android-3/arch-arm/include/asm/auxvec.h
new file mode 100644
index 0000000..c7e839c
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/auxvec.h
@@ -0,0 +1,15 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASMARM_AUXVEC_H
+#define __ASMARM_AUXVEC_H
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/bitops.h b/ndk/platforms/android-3/arch-arm/include/asm/bitops.h
new file mode 100644
index 0000000..ff76a68
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/bitops.h
@@ -0,0 +1,15 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASM_ARM_BITOPS_H
+#define __ASM_ARM_BITOPS_H
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/byteorder.h b/ndk/platforms/android-3/arch-arm/include/asm/byteorder.h
new file mode 100644
index 0000000..4da37bf
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/byteorder.h
@@ -0,0 +1,51 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASM_ARM_BYTEORDER_H
+#define __ASM_ARM_BYTEORDER_H
+
+#include <linux/compiler.h>
+#include <asm/types.h>
+
+static inline __attribute_const__ __u32 ___arch__swab32(__u32 x)
+{
+ __u32 t;
+
+#ifndef __thumb__
+ if (!__builtin_constant_p(x)) {
+
+ asm ("eor\t%0, %1, %1, ror #16" : "=r" (t) : "r" (x));
+ } else
+#endif
+ t = x ^ ((x << 16) | (x >> 16));
+
+ x = (x << 24) | (x >> 8);
+ t &= ~0x00FF0000;
+ x ^= (t >> 8);
+
+ return x;
+}
+
+#define __arch__swab32(x) ___arch__swab32(x)
+
+#ifndef __STRICT_ANSI__
+#define __BYTEORDER_HAS_U64__
+#define __SWAB_64_THRU_32__
+#endif
+
+#ifdef __ARMEB__
+#include <linux/byteorder/big_endian.h>
+#else
+#include <linux/byteorder/little_endian.h>
+#endif
+
+#endif
+
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/cache.h b/ndk/platforms/android-3/arch-arm/include/asm/cache.h
new file mode 100644
index 0000000..be26423
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/cache.h
@@ -0,0 +1,18 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASMARM_CACHE_H
+#define __ASMARM_CACHE_H
+
+#define L1_CACHE_SHIFT 5
+#define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT)
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/cacheflush.h b/ndk/platforms/android-3/arch-arm/include/asm/cacheflush.h
new file mode 100644
index 0000000..3ffa87a
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/cacheflush.h
@@ -0,0 +1,107 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASMARM_CACHEFLUSH_H
+#define _ASMARM_CACHEFLUSH_H
+
+#include <linux/sched.h>
+#include <linux/mm.h>
+
+#include <asm/glue.h>
+#include <asm/shmparam.h>
+
+#define CACHE_COLOUR(vaddr) ((vaddr & (SHMLBA - 1)) >> PAGE_SHIFT)
+
+#undef _CACHE
+#undef MULTI_CACHE
+
+#if !defined(_CACHE) && !defined(MULTI_CACHE)
+#error Unknown cache maintainence model
+#endif
+
+#define PG_dcache_dirty PG_arch_1
+
+struct cpu_cache_fns {
+ void (*flush_kern_all)(void);
+ void (*flush_user_all)(void);
+ void (*flush_user_range)(unsigned long, unsigned long, unsigned int);
+
+ void (*coherent_kern_range)(unsigned long, unsigned long);
+ void (*coherent_user_range)(unsigned long, unsigned long);
+ void (*flush_kern_dcache_page)(void *);
+
+ void (*dma_inv_range)(unsigned long, unsigned long);
+ void (*dma_clean_range)(unsigned long, unsigned long);
+ void (*dma_flush_range)(unsigned long, unsigned long);
+};
+
+#ifdef MULTI_CACHE
+
+#define __cpuc_flush_kern_all cpu_cache.flush_kern_all
+#define __cpuc_flush_user_all cpu_cache.flush_user_all
+#define __cpuc_flush_user_range cpu_cache.flush_user_range
+#define __cpuc_coherent_kern_range cpu_cache.coherent_kern_range
+#define __cpuc_coherent_user_range cpu_cache.coherent_user_range
+#define __cpuc_flush_dcache_page cpu_cache.flush_kern_dcache_page
+
+#define dmac_inv_range cpu_cache.dma_inv_range
+#define dmac_clean_range cpu_cache.dma_clean_range
+#define dmac_flush_range cpu_cache.dma_flush_range
+
+#else
+
+#define __cpuc_flush_kern_all __glue(_CACHE,_flush_kern_cache_all)
+#define __cpuc_flush_user_all __glue(_CACHE,_flush_user_cache_all)
+#define __cpuc_flush_user_range __glue(_CACHE,_flush_user_cache_range)
+#define __cpuc_coherent_kern_range __glue(_CACHE,_coherent_kern_range)
+#define __cpuc_coherent_user_range __glue(_CACHE,_coherent_user_range)
+#define __cpuc_flush_dcache_page __glue(_CACHE,_flush_kern_dcache_page)
+
+#define dmac_inv_range __glue(_CACHE,_dma_inv_range)
+#define dmac_clean_range __glue(_CACHE,_dma_clean_range)
+#define dmac_flush_range __glue(_CACHE,_dma_flush_range)
+
+#endif
+
+#define flush_cache_vmap(start, end) flush_cache_all()
+#define flush_cache_vunmap(start, end) flush_cache_all()
+
+#define copy_to_user_page(vma, page, vaddr, dst, src, len)   do {   memcpy(dst, src, len);   flush_ptrace_access(vma, page, vaddr, dst, len, 1);  } while (0)
+
+#define copy_from_user_page(vma, page, vaddr, dst, src, len)   do {   memcpy(dst, src, len);   } while (0)
+
+#define flush_cache_all() __cpuc_flush_kern_all()
+#define flush_cache_user_range(vma,start,end)   __cpuc_coherent_user_range((start) & PAGE_MASK, PAGE_ALIGN(end))
+#define flush_icache_range(s,e) __cpuc_coherent_kern_range(s,e)
+#define clean_dcache_area(start,size) cpu_dcache_clean_area(start, size)
+
+#define flush_dcache_mmap_lock(mapping)   write_lock_irq(&(mapping)->tree_lock)
+#define flush_dcache_mmap_unlock(mapping)   write_unlock_irq(&(mapping)->tree_lock)
+
+#define flush_icache_user_range(vma,page,addr,len)   flush_dcache_page(page)
+
+#define flush_icache_page(vma,page) do { } while (0)
+
+#define __cacheid_present(val) (val != read_cpuid(CPUID_ID))
+#define __cacheid_vivt(val) ((val & (15 << 25)) != (14 << 25))
+#define __cacheid_vipt(val) ((val & (15 << 25)) == (14 << 25))
+#define __cacheid_vipt_nonaliasing(val) ((val & (15 << 25 | 1 << 23)) == (14 << 25))
+#define __cacheid_vipt_aliasing(val) ((val & (15 << 25 | 1 << 23)) == (14 << 25 | 1 << 23))
+
+#define cache_is_vivt()   ({   unsigned int __val = read_cpuid(CPUID_CACHETYPE);   (!__cacheid_present(__val)) || __cacheid_vivt(__val);   })
+
+#define cache_is_vipt()   ({   unsigned int __val = read_cpuid(CPUID_CACHETYPE);   __cacheid_present(__val) && __cacheid_vipt(__val);   })
+
+#define cache_is_vipt_nonaliasing()   ({   unsigned int __val = read_cpuid(CPUID_CACHETYPE);   __cacheid_present(__val) &&   __cacheid_vipt_nonaliasing(__val);   })
+
+#define cache_is_vipt_aliasing()   ({   unsigned int __val = read_cpuid(CPUID_CACHETYPE);   __cacheid_present(__val) &&   __cacheid_vipt_aliasing(__val);   })
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/cputime.h b/ndk/platforms/android-3/arch-arm/include/asm/cputime.h
new file mode 100644
index 0000000..4a4097f
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/cputime.h
@@ -0,0 +1,17 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ARM_CPUTIME_H
+#define __ARM_CPUTIME_H
+
+#include <asm-generic/cputime.h>
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/delay.h b/ndk/platforms/android-3/arch-arm/include/asm/delay.h
new file mode 100644
index 0000000..631fd9b
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/delay.h
@@ -0,0 +1,22 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASM_ARM_DELAY_H
+#define __ASM_ARM_DELAY_H
+
+#include <asm/param.h>  
+
+#define MAX_UDELAY_MS 2
+
+#define udelay(n)   (__builtin_constant_p(n) ?   ((n) > (MAX_UDELAY_MS * 1000) ? __bad_udelay() :   __const_udelay((n) * ((2199023U*HZ)>>11))) :   __udelay(n))
+
+#endif
+
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/div64.h b/ndk/platforms/android-3/arch-arm/include/asm/div64.h
new file mode 100644
index 0000000..c03a0e4
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/div64.h
@@ -0,0 +1,27 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASM_ARM_DIV64
+#define __ASM_ARM_DIV64
+
+#include <asm/system.h>
+
+#ifdef __ARMEB__
+#define __xh "r0"
+#define __xl "r1"
+#else
+#define __xl "r0"
+#define __xh "r1"
+#endif
+
+#define do_div(n,base)  ({   register unsigned int __base asm("r4") = base;   register unsigned long long __n asm("r0") = n;   register unsigned long long __res asm("r2");   register unsigned int __rem asm(__xh);   asm( __asmeq("%0", __xh)   __asmeq("%1", "r2")   __asmeq("%2", "r0")   __asmeq("%3", "r4")   "bl	__do_div64"   : "=r" (__rem), "=r" (__res)   : "r" (__n), "r" (__base)   : "ip", "lr", "cc");   n = __res;   __rem;  })
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/dma-mapping.h b/ndk/platforms/android-3/arch-arm/include/asm/dma-mapping.h
new file mode 100644
index 0000000..7e65009
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/dma-mapping.h
@@ -0,0 +1,15 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef ASMARM_DMA_MAPPING_H
+#define ASMARM_DMA_MAPPING_H
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/dma.h b/ndk/platforms/android-3/arch-arm/include/asm/dma.h
new file mode 100644
index 0000000..7eeeb78
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/dma.h
@@ -0,0 +1,45 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASM_ARM_DMA_H
+#define __ASM_ARM_DMA_H
+
+typedef unsigned int dmach_t;
+
+#include <linux/spinlock.h>
+#include <asm/system.h>
+#include <asm/scatterlist.h>
+#include <asm/arch/dma.h>
+
+#ifndef MAX_DMA_ADDRESS
+#define MAX_DMA_ADDRESS 0xffffffff
+#endif
+
+typedef unsigned int dmamode_t;
+
+#define DMA_MODE_MASK 3
+
+#define DMA_MODE_READ 0
+#define DMA_MODE_WRITE 1
+#define DMA_MODE_CASCADE 2
+#define DMA_AUTOINIT 4
+
+#define clear_dma_ff(channel)
+
+#define set_dma_addr(channel, addr)   __set_dma_addr(channel, bus_to_virt(addr))
+
+#ifndef NO_DMA
+#define NO_DMA 255
+#endif
+
+#define isa_dma_bridge_buggy (0)
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/domain.h b/ndk/platforms/android-3/arch-arm/include/asm/domain.h
new file mode 100644
index 0000000..973109e
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/domain.h
@@ -0,0 +1,32 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASM_PROC_DOMAIN_H
+#define __ASM_PROC_DOMAIN_H
+
+#define DOMAIN_KERNEL 0
+#define DOMAIN_TABLE 0
+#define DOMAIN_USER 1
+#define DOMAIN_IO 2
+
+#define DOMAIN_NOACCESS 0
+#define DOMAIN_CLIENT 1
+#define DOMAIN_MANAGER 3
+
+#define domain_val(dom,type) ((type) << (2*(dom)))
+
+#ifndef __ASSEMBLY__
+
+#define set_domain(x) do { } while (0)
+#define modify_domain(dom,type) do { } while (0)
+
+#endif
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/dyntick.h b/ndk/platforms/android-3/arch-arm/include/asm/dyntick.h
new file mode 100644
index 0000000..1f323f2
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/dyntick.h
@@ -0,0 +1,17 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASMARM_DYNTICK_H
+#define _ASMARM_DYNTICK_H
+
+#include <asm/mach/time.h>
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/elf.h b/ndk/platforms/android-3/arch-arm/include/asm/elf.h
new file mode 100644
index 0000000..e9d095e
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/elf.h
@@ -0,0 +1,63 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASMARM_ELF_H
+#define __ASMARM_ELF_H
+
+#include <asm/ptrace.h>
+#include <asm/user.h>
+#ifdef __KERNEL
+#include <asm/procinfo.h>
+#endif
+
+typedef unsigned long elf_greg_t;
+typedef unsigned long elf_freg_t[3];
+
+#define EM_ARM 40
+#define EF_ARM_APCS26 0x08
+#define EF_ARM_SOFT_FLOAT 0x200
+#define EF_ARM_EABI_MASK 0xFF000000
+
+#define R_ARM_NONE 0
+#define R_ARM_PC24 1
+#define R_ARM_ABS32 2
+#define R_ARM_CALL 28
+#define R_ARM_JUMP24 29
+
+#define ELF_NGREG (sizeof (struct pt_regs) / sizeof(elf_greg_t))
+typedef elf_greg_t elf_gregset_t[ELF_NGREG];
+
+typedef struct user_fp elf_fpregset_t;
+
+#define elf_check_arch(x) ( ((x)->e_machine == EM_ARM) && (ELF_PROC_OK((x))) )
+
+#define ELF_CLASS ELFCLASS32
+#ifdef __ARMEB__
+#define ELF_DATA ELFDATA2MSB
+#else
+#define ELF_DATA ELFDATA2LSB
+#endif
+#define ELF_ARCH EM_ARM
+
+#define USE_ELF_CORE_DUMP
+#define ELF_EXEC_PAGESIZE 4096
+
+#define ELF_ET_DYN_BASE (2 * TASK_SIZE / 3)
+
+#define ELF_PLAT_INIT(_r, load_addr) (_r)->ARM_r0 = 0
+
+#define ELF_HWCAP (elf_hwcap)
+
+#define ELF_PLATFORM_SIZE 8
+
+#define ELF_PLATFORM (elf_platform)
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/errno.h b/ndk/platforms/android-3/arch-arm/include/asm/errno.h
new file mode 100644
index 0000000..6be7048
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/errno.h
@@ -0,0 +1,17 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ARM_ERRNO_H
+#define _ARM_ERRNO_H
+
+#include <asm-generic/errno.h>
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/fcntl.h b/ndk/platforms/android-3/arch-arm/include/asm/fcntl.h
new file mode 100644
index 0000000..42351ea
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/fcntl.h
@@ -0,0 +1,22 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ARM_FCNTL_H
+#define _ARM_FCNTL_H
+
+#define O_DIRECTORY 040000  
+#define O_NOFOLLOW 0100000  
+#define O_DIRECT 0200000  
+#define O_LARGEFILE 0400000
+
+#include <asm-generic/fcntl.h>
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/fpstate.h b/ndk/platforms/android-3/arch-arm/include/asm/fpstate.h
new file mode 100644
index 0000000..b362b14
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/fpstate.h
@@ -0,0 +1,68 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASM_ARM_FPSTATE_H
+#define __ASM_ARM_FPSTATE_H
+
+#ifndef __ASSEMBLY__
+
+struct vfp_hard_struct {
+ __u64 fpregs[16];
+#if __LINUX_ARM_ARCH__ < 6
+ __u32 fpmx_state;
+#endif
+ __u32 fpexc;
+ __u32 fpscr;
+
+ __u32 fpinst;
+ __u32 fpinst2;
+};
+
+union vfp_state {
+ struct vfp_hard_struct hard;
+};
+
+#define FP_HARD_SIZE 35
+
+struct fp_hard_struct {
+ unsigned int save[FP_HARD_SIZE];
+};
+
+#define FP_SOFT_SIZE 35
+
+struct fp_soft_struct {
+ unsigned int save[FP_SOFT_SIZE];
+};
+
+#define IWMMXT_SIZE 0x98
+
+struct iwmmxt_struct {
+ unsigned int save[IWMMXT_SIZE / sizeof(unsigned int)];
+};
+
+union fp_state {
+ struct fp_hard_struct hard;
+ struct fp_soft_struct soft;
+};
+
+#define FP_SIZE (sizeof(union fp_state) / sizeof(int))
+
+struct crunch_state {
+ unsigned int mvdx[16][2];
+ unsigned int mvax[4][3];
+ unsigned int dspsc[2];
+};
+
+#define CRUNCH_SIZE sizeof(struct crunch_state)
+
+#endif
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/glue.h b/ndk/platforms/android-3/arch-arm/include/asm/glue.h
new file mode 100644
index 0000000..1327b59
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/glue.h
@@ -0,0 +1,11 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/hardirq.h b/ndk/platforms/android-3/arch-arm/include/asm/hardirq.h
new file mode 100644
index 0000000..54207e3
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/hardirq.h
@@ -0,0 +1,38 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASM_HARDIRQ_H
+#define __ASM_HARDIRQ_H
+
+#include <linux/cache.h>
+#include <linux/threads.h>
+#include <asm/irq.h>
+
+typedef struct {
+ unsigned int __softirq_pending;
+ unsigned int local_timer_irqs;
+} ____cacheline_aligned irq_cpustat_t;
+
+#include <linux/irq_cpustat.h>  
+
+#if NR_IRQS > 256
+#define HARDIRQ_BITS 9
+#else
+#define HARDIRQ_BITS 8
+#endif
+
+#if 1 << HARDIRQ_BITS < NR_IRQS
+#error HARDIRQ_BITS is too low!
+#endif
+
+#define __ARCH_IRQ_EXIT_IRQS_DISABLED 1
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/hardware.h b/ndk/platforms/android-3/arch-arm/include/asm/hardware.h
new file mode 100644
index 0000000..0b381d1
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/hardware.h
@@ -0,0 +1,17 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASM_HARDWARE_H
+#define __ASM_HARDWARE_H
+
+#include <asm/arch/hardware.h>
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/hw_irq.h b/ndk/platforms/android-3/arch-arm/include/asm/hw_irq.h
new file mode 100644
index 0000000..a34b390
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/hw_irq.h
@@ -0,0 +1,17 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ARCH_ARM_HW_IRQ_H
+#define _ARCH_ARM_HW_IRQ_H
+
+#include <asm/mach/irq.h>
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/ide.h b/ndk/platforms/android-3/arch-arm/include/asm/ide.h
new file mode 100644
index 0000000..f52d5ca
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/ide.h
@@ -0,0 +1,15 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASMARM_IDE_H
+#define __ASMARM_IDE_H
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/io.h b/ndk/platforms/android-3/arch-arm/include/asm/io.h
new file mode 100644
index 0000000..6794022
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/io.h
@@ -0,0 +1,15 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASM_ARM_IO_H
+#define __ASM_ARM_IO_H
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/ioctl.h b/ndk/platforms/android-3/arch-arm/include/asm/ioctl.h
new file mode 100644
index 0000000..6e446b6
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/ioctl.h
@@ -0,0 +1,12 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#include <asm-generic/ioctl.h>
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/ioctls.h b/ndk/platforms/android-3/arch-arm/include/asm/ioctls.h
new file mode 100644
index 0000000..9df82bc
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/ioctls.h
@@ -0,0 +1,88 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASM_ARM_IOCTLS_H
+#define __ASM_ARM_IOCTLS_H
+
+#include <asm/ioctl.h>
+
+#define TCGETS 0x5401
+#define TCSETS 0x5402
+#define TCSETSW 0x5403
+#define TCSETSF 0x5404
+#define TCGETA 0x5405
+#define TCSETA 0x5406
+#define TCSETAW 0x5407
+#define TCSETAF 0x5408
+#define TCSBRK 0x5409
+#define TCXONC 0x540A
+#define TCFLSH 0x540B
+#define TIOCEXCL 0x540C
+#define TIOCNXCL 0x540D
+#define TIOCSCTTY 0x540E
+#define TIOCGPGRP 0x540F
+#define TIOCSPGRP 0x5410
+#define TIOCOUTQ 0x5411
+#define TIOCSTI 0x5412
+#define TIOCGWINSZ 0x5413
+#define TIOCSWINSZ 0x5414
+#define TIOCMGET 0x5415
+#define TIOCMBIS 0x5416
+#define TIOCMBIC 0x5417
+#define TIOCMSET 0x5418
+#define TIOCGSOFTCAR 0x5419
+#define TIOCSSOFTCAR 0x541A
+#define FIONREAD 0x541B
+#define TIOCINQ FIONREAD
+#define TIOCLINUX 0x541C
+#define TIOCCONS 0x541D
+#define TIOCGSERIAL 0x541E
+#define TIOCSSERIAL 0x541F
+#define TIOCPKT 0x5420
+#define FIONBIO 0x5421
+#define TIOCNOTTY 0x5422
+#define TIOCSETD 0x5423
+#define TIOCGETD 0x5424
+#define TCSBRKP 0x5425  
+#define TIOCSBRK 0x5427  
+#define TIOCCBRK 0x5428  
+#define TIOCGSID 0x5429  
+#define TIOCGPTN _IOR('T',0x30, unsigned int)  
+#define TIOCSPTLCK _IOW('T',0x31, int)  
+
+#define FIONCLEX 0x5450  
+#define FIOCLEX 0x5451
+#define FIOASYNC 0x5452
+#define TIOCSERCONFIG 0x5453
+#define TIOCSERGWILD 0x5454
+#define TIOCSERSWILD 0x5455
+#define TIOCGLCKTRMIOS 0x5456
+#define TIOCSLCKTRMIOS 0x5457
+#define TIOCSERGSTRUCT 0x5458  
+#define TIOCSERGETLSR 0x5459  
+#define TIOCSERGETMULTI 0x545A  
+#define TIOCSERSETMULTI 0x545B  
+
+#define TIOCMIWAIT 0x545C  
+#define TIOCGICOUNT 0x545D  
+#define FIOQSIZE 0x545E
+
+#define TIOCPKT_DATA 0
+#define TIOCPKT_FLUSHREAD 1
+#define TIOCPKT_FLUSHWRITE 2
+#define TIOCPKT_STOP 4
+#define TIOCPKT_START 8
+#define TIOCPKT_NOSTOP 16
+#define TIOCPKT_DOSTOP 32
+
+#define TIOCSER_TEMT 0x01  
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/ipcbuf.h b/ndk/platforms/android-3/arch-arm/include/asm/ipcbuf.h
new file mode 100644
index 0000000..0e47507
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/ipcbuf.h
@@ -0,0 +1,30 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASMARM_IPCBUF_H
+#define __ASMARM_IPCBUF_H
+
+struct ipc64_perm
+{
+ __kernel_key_t key;
+ __kernel_uid32_t uid;
+ __kernel_gid32_t gid;
+ __kernel_uid32_t cuid;
+ __kernel_gid32_t cgid;
+ __kernel_mode_t mode;
+ unsigned short __pad1;
+ unsigned short seq;
+ unsigned short __pad2;
+ unsigned long __unused1;
+ unsigned long __unused2;
+};
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/irq.h b/ndk/platforms/android-3/arch-arm/include/asm/irq.h
new file mode 100644
index 0000000..2085a21
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/irq.h
@@ -0,0 +1,45 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASM_ARM_IRQ_H
+#define __ASM_ARM_IRQ_H
+
+#include <asm/arch/irqs.h>
+
+#ifndef irq_canonicalize
+#define irq_canonicalize(i) (i)
+#endif
+
+#ifndef NR_IRQS
+#define NR_IRQS 128
+#endif
+
+#ifndef NO_IRQ
+#define NO_IRQ ((unsigned int)(-1))
+#endif
+
+struct irqaction;
+
+#define __IRQT_FALEDGE IRQ_TYPE_EDGE_FALLING
+#define __IRQT_RISEDGE IRQ_TYPE_EDGE_RISING
+#define __IRQT_LOWLVL IRQ_TYPE_LEVEL_LOW
+#define __IRQT_HIGHLVL IRQ_TYPE_LEVEL_HIGH
+
+#define IRQT_NOEDGE (0)
+#define IRQT_RISING (__IRQT_RISEDGE)
+#define IRQT_FALLING (__IRQT_FALEDGE)
+#define IRQT_BOTHEDGE (__IRQT_RISEDGE|__IRQT_FALEDGE)
+#define IRQT_LOW (__IRQT_LOWLVL)
+#define IRQT_HIGH (__IRQT_HIGHLVL)
+#define IRQT_PROBE IRQ_TYPE_PROBE
+
+#endif
+
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/linkage.h b/ndk/platforms/android-3/arch-arm/include/asm/linkage.h
new file mode 100644
index 0000000..1fb628e
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/linkage.h
@@ -0,0 +1,18 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASM_LINKAGE_H
+#define __ASM_LINKAGE_H
+
+#define __ALIGN .align 0
+#define __ALIGN_STR ".align 0"
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/local.h b/ndk/platforms/android-3/arch-arm/include/asm/local.h
new file mode 100644
index 0000000..10d6a60
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/local.h
@@ -0,0 +1,12 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#include <asm-generic/local.h>
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/locks.h b/ndk/platforms/android-3/arch-arm/include/asm/locks.h
new file mode 100644
index 0000000..f48485c
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/locks.h
@@ -0,0 +1,55 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASM_PROC_LOCKS_H
+#define __ASM_PROC_LOCKS_H
+
+#if __LINUX_ARM_ARCH__ >= 6
+
+#define __down_op(ptr,fail)   ({   __asm__ __volatile__(   "@ down_op\n"  "1:	ldrex	lr, [%0]\n"  "	sub	lr, lr, %1\n"  "	strex	ip, lr, [%0]\n"  "	teq	ip, #0\n"  "	bne	1b\n"  "	teq	lr, #0\n"  "	movmi	ip, %0\n"  "	blmi	" #fail   :   : "r" (ptr), "I" (1)   : "ip", "lr", "cc");   smp_mb();   })
+
+#define __down_op_ret(ptr,fail)   ({   unsigned int ret;   __asm__ __volatile__(   "@ down_op_ret\n"  "1:	ldrex	lr, [%1]\n"  "	sub	lr, lr, %2\n"  "	strex	ip, lr, [%1]\n"  "	teq	ip, #0\n"  "	bne	1b\n"  "	teq	lr, #0\n"  "	movmi	ip, %1\n"  "	movpl	ip, #0\n"  "	blmi	" #fail "\n"  "	mov	%0, ip"   : "=&r" (ret)   : "r" (ptr), "I" (1)   : "ip", "lr", "cc");   smp_mb();   ret;   })
+
+#define __up_op(ptr,wake)   ({   smp_mb();   __asm__ __volatile__(   "@ up_op\n"  "1:	ldrex	lr, [%0]\n"  "	add	lr, lr, %1\n"  "	strex	ip, lr, [%0]\n"  "	teq	ip, #0\n"  "	bne	1b\n"  "	cmp	lr, #0\n"  "	movle	ip, %0\n"  "	blle	" #wake   :   : "r" (ptr), "I" (1)   : "ip", "lr", "cc");   })
+
+#define RW_LOCK_BIAS 0x01000000
+#define RW_LOCK_BIAS_STR "0x01000000"
+
+#define __down_op_write(ptr,fail)   ({   __asm__ __volatile__(   "@ down_op_write\n"  "1:	ldrex	lr, [%0]\n"  "	sub	lr, lr, %1\n"  "	strex	ip, lr, [%0]\n"  "	teq	ip, #0\n"  "	bne	1b\n"  "	teq	lr, #0\n"  "	movne	ip, %0\n"  "	blne	" #fail   :   : "r" (ptr), "I" (RW_LOCK_BIAS)   : "ip", "lr", "cc");   smp_mb();   })
+
+#define __up_op_write(ptr,wake)   ({   smp_mb();   __asm__ __volatile__(   "@ up_op_write\n"  "1:	ldrex	lr, [%0]\n"  "	adds	lr, lr, %1\n"  "	strex	ip, lr, [%0]\n"  "	teq	ip, #0\n"  "	bne	1b\n"  "	movcs	ip, %0\n"  "	blcs	" #wake   :   : "r" (ptr), "I" (RW_LOCK_BIAS)   : "ip", "lr", "cc");   })
+
+#define __down_op_read(ptr,fail)   __down_op(ptr, fail)
+
+#define __up_op_read(ptr,wake)   ({   smp_mb();   __asm__ __volatile__(   "@ up_op_read\n"  "1:	ldrex	lr, [%0]\n"  "	add	lr, lr, %1\n"  "	strex	ip, lr, [%0]\n"  "	teq	ip, #0\n"  "	bne	1b\n"  "	teq	lr, #0\n"  "	moveq	ip, %0\n"  "	bleq	" #wake   :   : "r" (ptr), "I" (1)   : "ip", "lr", "cc");   })
+
+#else
+
+#define __down_op(ptr,fail)   ({   __asm__ __volatile__(   "@ down_op\n"  "	mrs	ip, cpsr\n"  "	orr	lr, ip, #128\n"  "	msr	cpsr_c, lr\n"  "	ldr	lr, [%0]\n"  "	subs	lr, lr, %1\n"  "	str	lr, [%0]\n"  "	msr	cpsr_c, ip\n"  "	movmi	ip, %0\n"  "	blmi	" #fail   :   : "r" (ptr), "I" (1)   : "ip", "lr", "cc");   smp_mb();   })
+
+#define __down_op_ret(ptr,fail)   ({   unsigned int ret;   __asm__ __volatile__(   "@ down_op_ret\n"  "	mrs	ip, cpsr\n"  "	orr	lr, ip, #128\n"  "	msr	cpsr_c, lr\n"  "	ldr	lr, [%1]\n"  "	subs	lr, lr, %2\n"  "	str	lr, [%1]\n"  "	msr	cpsr_c, ip\n"  "	movmi	ip, %1\n"  "	movpl	ip, #0\n"  "	blmi	" #fail "\n"  "	mov	%0, ip"   : "=&r" (ret)   : "r" (ptr), "I" (1)   : "ip", "lr", "cc");   smp_mb();   ret;   })
+
+#define __up_op(ptr,wake)   ({   smp_mb();   __asm__ __volatile__(   "@ up_op\n"  "	mrs	ip, cpsr\n"  "	orr	lr, ip, #128\n"  "	msr	cpsr_c, lr\n"  "	ldr	lr, [%0]\n"  "	adds	lr, lr, %1\n"  "	str	lr, [%0]\n"  "	msr	cpsr_c, ip\n"  "	movle	ip, %0\n"  "	blle	" #wake   :   : "r" (ptr), "I" (1)   : "ip", "lr", "cc");   })
+
+#define RW_LOCK_BIAS 0x01000000
+#define RW_LOCK_BIAS_STR "0x01000000"
+
+#define __down_op_write(ptr,fail)   ({   __asm__ __volatile__(   "@ down_op_write\n"  "	mrs	ip, cpsr\n"  "	orr	lr, ip, #128\n"  "	msr	cpsr_c, lr\n"  "	ldr	lr, [%0]\n"  "	subs	lr, lr, %1\n"  "	str	lr, [%0]\n"  "	msr	cpsr_c, ip\n"  "	movne	ip, %0\n"  "	blne	" #fail   :   : "r" (ptr), "I" (RW_LOCK_BIAS)   : "ip", "lr", "cc");   smp_mb();   })
+
+#define __up_op_write(ptr,wake)   ({   __asm__ __volatile__(   "@ up_op_write\n"  "	mrs	ip, cpsr\n"  "	orr	lr, ip, #128\n"  "	msr	cpsr_c, lr\n"  "	ldr	lr, [%0]\n"  "	adds	lr, lr, %1\n"  "	str	lr, [%0]\n"  "	msr	cpsr_c, ip\n"  "	movcs	ip, %0\n"  "	blcs	" #wake   :   : "r" (ptr), "I" (RW_LOCK_BIAS)   : "ip", "lr", "cc");   smp_mb();   })
+
+#define __down_op_read(ptr,fail)   __down_op(ptr, fail)
+
+#define __up_op_read(ptr,wake)   ({   smp_mb();   __asm__ __volatile__(   "@ up_op_read\n"  "	mrs	ip, cpsr\n"  "	orr	lr, ip, #128\n"  "	msr	cpsr_c, lr\n"  "	ldr	lr, [%0]\n"  "	adds	lr, lr, %1\n"  "	str	lr, [%0]\n"  "	msr	cpsr_c, ip\n"  "	moveq	ip, %0\n"  "	bleq	" #wake   :   : "r" (ptr), "I" (1)   : "ip", "lr", "cc");   })
+
+#endif
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/mc146818rtc.h b/ndk/platforms/android-3/arch-arm/include/asm/mc146818rtc.h
new file mode 100644
index 0000000..5a86724
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/mc146818rtc.h
@@ -0,0 +1,26 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_MC146818RTC_H
+#define _ASM_MC146818RTC_H
+
+#include <asm/arch/irqs.h>
+#include <asm/io.h>
+
+#ifndef RTC_PORT
+#define RTC_PORT(x) (0x70 + (x))
+#define RTC_ALWAYS_BCD 1  
+#endif
+
+#define CMOS_READ(addr) ({  outb_p((addr),RTC_PORT(0));  inb_p(RTC_PORT(1));  })
+#define CMOS_WRITE(val, addr) ({  outb_p((addr),RTC_PORT(0));  outb_p((val),RTC_PORT(1));  })
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/memory.h b/ndk/platforms/android-3/arch-arm/include/asm/memory.h
new file mode 100644
index 0000000..c1137a7
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/memory.h
@@ -0,0 +1,95 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASM_ARM_MEMORY_H
+#define __ASM_ARM_MEMORY_H
+
+#ifndef __ASSEMBLY__
+#define UL(x) (x##UL)
+#else
+#define UL(x) (x)
+#endif
+
+#include <linux/compiler.h>
+#include <asm/arch/memory.h>
+#include <asm/sizes.h>
+
+#ifndef TASK_SIZE
+#define TASK_SIZE (CONFIG_DRAM_SIZE)
+#endif
+
+#ifndef TASK_UNMAPPED_BASE
+#define TASK_UNMAPPED_BASE UL(0x00000000)
+#endif
+
+#ifndef PHYS_OFFSET
+#define PHYS_OFFSET (CONFIG_DRAM_BASE)
+#endif
+
+#ifndef END_MEM
+#define END_MEM (CONFIG_DRAM_BASE + CONFIG_DRAM_SIZE)
+#endif
+
+#ifndef PAGE_OFFSET
+#define PAGE_OFFSET (PHYS_OFFSET)
+#endif
+
+#define MODULE_END (END_MEM)
+#define MODULE_START (PHYS_OFFSET)
+
+#ifndef CONSISTENT_DMA_SIZE
+#define CONSISTENT_DMA_SIZE SZ_2M
+#endif
+
+#ifndef __virt_to_phys
+#define __virt_to_phys(x) ((x) - PAGE_OFFSET + PHYS_OFFSET)
+#define __phys_to_virt(x) ((x) - PHYS_OFFSET + PAGE_OFFSET)
+#endif
+
+#define __phys_to_pfn(paddr) ((paddr) >> PAGE_SHIFT)
+#define __pfn_to_phys(pfn) ((pfn) << PAGE_SHIFT)
+
+#ifndef __ASSEMBLY__
+
+#ifndef ISA_DMA_THRESHOLD
+#define ISA_DMA_THRESHOLD (0xffffffffULL)
+#endif
+
+#ifndef arch_adjust_zones
+#define arch_adjust_zones(node,size,holes) do { } while (0)
+#endif
+
+#define PHYS_PFN_OFFSET (PHYS_OFFSET >> PAGE_SHIFT)
+
+#define __pa(x) __virt_to_phys((unsigned long)(x))
+#define __va(x) ((void *)__phys_to_virt((unsigned long)(x)))
+#define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT)
+#define ARCH_PFN_OFFSET PHYS_PFN_OFFSET
+#define pfn_valid(pfn) ((pfn) >= PHYS_PFN_OFFSET && (pfn) < (PHYS_PFN_OFFSET + max_mapnr))
+#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
+#define virt_addr_valid(kaddr) ((unsigned long)(kaddr) >= PAGE_OFFSET && (unsigned long)(kaddr) < (unsigned long)high_memory)
+#define PHYS_TO_NID(addr) (0)
+#define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT)
+#ifndef __arch_page_to_dma
+#define page_to_dma(dev, page) ((dma_addr_t)__virt_to_bus((unsigned long)page_address(page)))
+#define dma_to_virt(dev, addr) ((void *)__bus_to_virt(addr))
+#define virt_to_dma(dev, addr) ((dma_addr_t)__virt_to_bus((unsigned long)(addr)))
+#else
+#define page_to_dma(dev, page) (__arch_page_to_dma(dev, page))
+#define dma_to_virt(dev, addr) (__arch_dma_to_virt(dev, addr))
+#define virt_to_dma(dev, addr) (__arch_virt_to_dma(dev, addr))
+#endif
+#ifndef arch_is_coherent
+#define arch_is_coherent() 0
+#endif
+#endif
+#include <asm-generic/memory_model.h>
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/mman.h b/ndk/platforms/android-3/arch-arm/include/asm/mman.h
new file mode 100644
index 0000000..8f71d1b
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/mman.h
@@ -0,0 +1,28 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ARM_MMAN_H__
+#define __ARM_MMAN_H__
+
+#include <asm-generic/mman.h>
+
+#define MAP_GROWSDOWN 0x0100  
+#define MAP_DENYWRITE 0x0800  
+#define MAP_EXECUTABLE 0x1000  
+#define MAP_LOCKED 0x2000  
+#define MAP_NORESERVE 0x4000  
+#define MAP_POPULATE 0x8000  
+#define MAP_NONBLOCK 0x10000  
+
+#define MCL_CURRENT 1  
+#define MCL_FUTURE 2  
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/module.h b/ndk/platforms/android-3/arch-arm/include/asm/module.h
new file mode 100644
index 0000000..68b806a
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/module.h
@@ -0,0 +1,26 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_ARM_MODULE_H
+#define _ASM_ARM_MODULE_H
+
+struct mod_arch_specific
+{
+ int foo;
+};
+
+#define Elf_Shdr Elf32_Shdr
+#define Elf_Sym Elf32_Sym
+#define Elf_Ehdr Elf32_Ehdr
+
+#define MODULE_ARCH_VERMAGIC "ARMv" __stringify(__LINUX_ARM_ARCH__) " "
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/msgbuf.h b/ndk/platforms/android-3/arch-arm/include/asm/msgbuf.h
new file mode 100644
index 0000000..84d614c
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/msgbuf.h
@@ -0,0 +1,32 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASMARM_MSGBUF_H
+#define _ASMARM_MSGBUF_H
+
+struct msqid64_ds {
+ struct ipc64_perm msg_perm;
+ __kernel_time_t msg_stime;
+ unsigned long __unused1;
+ __kernel_time_t msg_rtime;
+ unsigned long __unused2;
+ __kernel_time_t msg_ctime;
+ unsigned long __unused3;
+ unsigned long msg_cbytes;
+ unsigned long msg_qnum;
+ unsigned long msg_qbytes;
+ __kernel_pid_t msg_lspid;
+ __kernel_pid_t msg_lrpid;
+ unsigned long __unused4;
+ unsigned long __unused5;
+};
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/mtd-xip.h b/ndk/platforms/android-3/arch-arm/include/asm/mtd-xip.h
new file mode 100644
index 0000000..6c53f6f
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/mtd-xip.h
@@ -0,0 +1,20 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ARM_MTD_XIP_H__
+#define __ARM_MTD_XIP_H__
+
+#include <asm/hardware.h>
+#include <asm/arch/mtd-xip.h>
+
+#define xip_iprefetch() do { asm volatile (".rep 8; nop; .endr"); } while (0)
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/page.h b/ndk/platforms/android-3/arch-arm/include/asm/page.h
new file mode 100644
index 0000000..f980343
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/page.h
@@ -0,0 +1,19 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASMARM_PAGE_H
+#define _ASMARM_PAGE_H
+
+#define PAGE_SHIFT 12
+#define PAGE_SIZE (1UL << PAGE_SHIFT)
+#define PAGE_MASK (~(PAGE_SIZE-1))
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/param.h b/ndk/platforms/android-3/arch-arm/include/asm/param.h
new file mode 100644
index 0000000..6814fe3
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/param.h
@@ -0,0 +1,25 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASM_PARAM_H
+#define __ASM_PARAM_H
+
+#define HZ 100
+
+#define EXEC_PAGESIZE 4096
+
+#ifndef NOGROUP
+#define NOGROUP (-1)
+#endif
+
+
+#endif
+
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/percpu.h b/ndk/platforms/android-3/arch-arm/include/asm/percpu.h
new file mode 100644
index 0000000..2500345
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/percpu.h
@@ -0,0 +1,17 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ARM_PERCPU
+#define __ARM_PERCPU
+
+#include <asm-generic/percpu.h>
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/pgalloc.h b/ndk/platforms/android-3/arch-arm/include/asm/pgalloc.h
new file mode 100644
index 0000000..5d45e65
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/pgalloc.h
@@ -0,0 +1,23 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASMARM_PGALLOC_H
+#define _ASMARM_PGALLOC_H
+
+#include <asm/domain.h>
+#include <asm/pgtable-hwdef.h>
+#include <asm/processor.h>
+#include <asm/cacheflush.h>
+#include <asm/tlbflush.h>
+
+#define check_pgt_cache() do { } while (0)
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/pgtable-hwdef.h b/ndk/platforms/android-3/arch-arm/include/asm/pgtable-hwdef.h
new file mode 100644
index 0000000..47e8675
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/pgtable-hwdef.h
@@ -0,0 +1,70 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASMARM_PGTABLE_HWDEF_H
+#define _ASMARM_PGTABLE_HWDEF_H
+
+#define PMD_TYPE_MASK (3 << 0)
+#define PMD_TYPE_FAULT (0 << 0)
+#define PMD_TYPE_TABLE (1 << 0)
+#define PMD_TYPE_SECT (2 << 0)
+#define PMD_BIT4 (1 << 4)
+#define PMD_DOMAIN(x) ((x) << 5)
+#define PMD_PROTECTION (1 << 9)  
+
+#define PMD_SECT_BUFFERABLE (1 << 2)
+#define PMD_SECT_CACHEABLE (1 << 3)
+#define PMD_SECT_XN (1 << 4)  
+#define PMD_SECT_AP_WRITE (1 << 10)
+#define PMD_SECT_AP_READ (1 << 11)
+#define PMD_SECT_TEX(x) ((x) << 12)  
+#define PMD_SECT_APX (1 << 15)  
+#define PMD_SECT_S (1 << 16)  
+#define PMD_SECT_nG (1 << 17)  
+#define PMD_SECT_SUPER (1 << 18)  
+
+#define PMD_SECT_UNCACHED (0)
+#define PMD_SECT_BUFFERED (PMD_SECT_BUFFERABLE)
+#define PMD_SECT_WT (PMD_SECT_CACHEABLE)
+#define PMD_SECT_WB (PMD_SECT_CACHEABLE | PMD_SECT_BUFFERABLE)
+#define PMD_SECT_MINICACHE (PMD_SECT_TEX(1) | PMD_SECT_CACHEABLE)
+#define PMD_SECT_WBWA (PMD_SECT_TEX(1) | PMD_SECT_CACHEABLE | PMD_SECT_BUFFERABLE)
+#define PMD_SECT_NONSHARED_DEV (PMD_SECT_TEX(2))
+
+#define PTE_TYPE_MASK (3 << 0)
+#define PTE_TYPE_FAULT (0 << 0)
+#define PTE_TYPE_LARGE (1 << 0)
+#define PTE_TYPE_SMALL (2 << 0)
+#define PTE_TYPE_EXT (3 << 0)  
+#define PTE_BUFFERABLE (1 << 2)
+#define PTE_CACHEABLE (1 << 3)
+
+#define PTE_EXT_XN (1 << 0)  
+#define PTE_EXT_AP_MASK (3 << 4)
+#define PTE_EXT_AP0 (1 << 4)
+#define PTE_EXT_AP1 (2 << 4)
+#define PTE_EXT_AP_UNO_SRO (0 << 4)
+#define PTE_EXT_AP_UNO_SRW (PTE_EXT_AP0)
+#define PTE_EXT_AP_URO_SRW (PTE_EXT_AP1)
+#define PTE_EXT_AP_URW_SRW (PTE_EXT_AP1|PTE_EXT_AP0)
+#define PTE_EXT_TEX(x) ((x) << 6)  
+#define PTE_EXT_APX (1 << 9)  
+#define PTE_EXT_COHERENT (1 << 9)  
+#define PTE_EXT_SHARED (1 << 10)  
+#define PTE_EXT_NG (1 << 11)  
+
+#define PTE_SMALL_AP_MASK (0xff << 4)
+#define PTE_SMALL_AP_UNO_SRO (0x00 << 4)
+#define PTE_SMALL_AP_UNO_SRW (0x55 << 4)
+#define PTE_SMALL_AP_URO_SRW (0xaa << 4)
+#define PTE_SMALL_AP_URW_SRW (0xff << 4)
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/pgtable.h b/ndk/platforms/android-3/arch-arm/include/asm/pgtable.h
new file mode 100644
index 0000000..cbac611
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/pgtable.h
@@ -0,0 +1,20 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASMARM_PGTABLE_H
+#define _ASMARM_PGTABLE_H
+
+#include <asm-generic/4level-fixup.h>
+#include <asm/proc-fns.h>
+
+#include "pgtable-nommu.h"
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/poll.h b/ndk/platforms/android-3/arch-arm/include/asm/poll.h
new file mode 100644
index 0000000..c5b80a5
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/poll.h
@@ -0,0 +1,36 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASMARM_POLL_H
+#define __ASMARM_POLL_H
+
+#define POLLIN 0x0001
+#define POLLPRI 0x0002
+#define POLLOUT 0x0004
+#define POLLERR 0x0008
+#define POLLHUP 0x0010
+#define POLLNVAL 0x0020
+
+#define POLLRDNORM 0x0040
+#define POLLRDBAND 0x0080
+#define POLLWRNORM 0x0100
+#define POLLWRBAND 0x0200
+#define POLLMSG 0x0400
+#define POLLREMOVE 0x1000
+#define POLLRDHUP 0x2000
+
+struct pollfd {
+ int fd;
+ short events;
+ short revents;
+};
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/posix_types.h b/ndk/platforms/android-3/arch-arm/include/asm/posix_types.h
new file mode 100644
index 0000000..bc85217
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/posix_types.h
@@ -0,0 +1,70 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ARCH_ARM_POSIX_TYPES_H
+#define __ARCH_ARM_POSIX_TYPES_H
+
+typedef unsigned long __kernel_ino_t;
+typedef unsigned short __kernel_mode_t;
+typedef unsigned short __kernel_nlink_t;
+typedef long __kernel_off_t;
+typedef int __kernel_pid_t;
+typedef unsigned short __kernel_ipc_pid_t;
+typedef unsigned short __kernel_uid_t;
+typedef unsigned short __kernel_gid_t;
+typedef unsigned int __kernel_size_t;
+typedef int __kernel_ssize_t;
+typedef int __kernel_ptrdiff_t;
+typedef long __kernel_time_t;
+typedef long __kernel_suseconds_t;
+typedef long __kernel_clock_t;
+typedef int __kernel_timer_t;
+typedef int __kernel_clockid_t;
+typedef int __kernel_daddr_t;
+typedef char * __kernel_caddr_t;
+typedef unsigned short __kernel_uid16_t;
+typedef unsigned short __kernel_gid16_t;
+typedef unsigned int __kernel_uid32_t;
+typedef unsigned int __kernel_gid32_t;
+
+typedef unsigned short __kernel_old_uid_t;
+typedef unsigned short __kernel_old_gid_t;
+typedef unsigned short __kernel_old_dev_t;
+
+#ifdef __GNUC__
+typedef long long __kernel_loff_t;
+#endif
+
+typedef struct {
+#ifdef __USE_ALL
+ int val[2];
+#else
+ int __val[2];
+#endif
+} __kernel_fsid_t;
+
+#if !defined(__GLIBC__) || __GLIBC__ < 2
+
+#undef __FD_SET
+#define __FD_SET(fd, fdsetp)   (((fd_set *)(fdsetp))->fds_bits[(fd) >> 5] |= (1<<((fd) & 31)))
+
+#undef __FD_CLR
+#define __FD_CLR(fd, fdsetp)   (((fd_set *)(fdsetp))->fds_bits[(fd) >> 5] &= ~(1<<((fd) & 31)))
+
+#undef __FD_ISSET
+#define __FD_ISSET(fd, fdsetp)   ((((fd_set *)(fdsetp))->fds_bits[(fd) >> 5] & (1<<((fd) & 31))) != 0)
+
+#undef __FD_ZERO
+#define __FD_ZERO(fdsetp)   (memset (fdsetp, 0, sizeof (*(fd_set *)(fdsetp))))
+
+#endif
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/proc-fns.h b/ndk/platforms/android-3/arch-arm/include/asm/proc-fns.h
new file mode 100644
index 0000000..4a560d0
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/proc-fns.h
@@ -0,0 +1,15 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASM_PROCFNS_H
+#define __ASM_PROCFNS_H
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/processor.h b/ndk/platforms/android-3/arch-arm/include/asm/processor.h
new file mode 100644
index 0000000..f93cbc1
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/processor.h
@@ -0,0 +1,17 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASM_ARM_PROCESSOR_H
+#define __ASM_ARM_PROCESSOR_H
+
+#define current_text_addr() ({ __label__ _l; _l: &&_l;})
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/procinfo.h b/ndk/platforms/android-3/arch-arm/include/asm/procinfo.h
new file mode 100644
index 0000000..d774e0b
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/procinfo.h
@@ -0,0 +1,51 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASM_PROCINFO_H
+#define __ASM_PROCINFO_H
+
+#ifndef __ASSEMBLY__
+
+struct cpu_tlb_fns;
+struct cpu_user_fns;
+struct cpu_cache_fns;
+struct processor;
+
+struct proc_info_list {
+ unsigned int cpu_val;
+ unsigned int cpu_mask;
+ unsigned long __cpu_mm_mmu_flags;
+ unsigned long __cpu_io_mmu_flags;
+ unsigned long __cpu_flush;
+ const char *arch_name;
+ const char *elf_name;
+ unsigned int elf_hwcap;
+ const char *cpu_name;
+ struct processor *proc;
+ struct cpu_tlb_fns *tlb;
+ struct cpu_user_fns *user;
+ struct cpu_cache_fns *cache;
+};
+
+#endif
+
+#define HWCAP_SWP 1
+#define HWCAP_HALF 2
+#define HWCAP_THUMB 4
+#define HWCAP_26BIT 8  
+#define HWCAP_FAST_MULT 16
+#define HWCAP_FPA 32
+#define HWCAP_VFP 64
+#define HWCAP_EDSP 128
+#define HWCAP_JAVA 256
+#define HWCAP_IWMMXT 512
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/ptrace.h b/ndk/platforms/android-3/arch-arm/include/asm/ptrace.h
new file mode 100644
index 0000000..c6dfea1
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/ptrace.h
@@ -0,0 +1,95 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASM_ARM_PTRACE_H
+#define __ASM_ARM_PTRACE_H
+
+#define PTRACE_GETREGS 12
+#define PTRACE_SETREGS 13
+#define PTRACE_GETFPREGS 14
+#define PTRACE_SETFPREGS 15
+
+#define PTRACE_GETWMMXREGS 18
+#define PTRACE_SETWMMXREGS 19
+
+#define PTRACE_OLDSETOPTIONS 21
+
+#define PTRACE_GET_THREAD_AREA 22
+
+#define PTRACE_SET_SYSCALL 23
+
+#define PTRACE_GETCRUNCHREGS 25
+#define PTRACE_SETCRUNCHREGS 26
+
+#define USR26_MODE 0x00000000
+#define FIQ26_MODE 0x00000001
+#define IRQ26_MODE 0x00000002
+#define SVC26_MODE 0x00000003
+#define USR_MODE 0x00000010
+#define FIQ_MODE 0x00000011
+#define IRQ_MODE 0x00000012
+#define SVC_MODE 0x00000013
+#define ABT_MODE 0x00000017
+#define UND_MODE 0x0000001b
+#define SYSTEM_MODE 0x0000001f
+#define MODE32_BIT 0x00000010
+#define MODE_MASK 0x0000001f
+#define PSR_T_BIT 0x00000020
+#define PSR_F_BIT 0x00000040
+#define PSR_I_BIT 0x00000080
+#define PSR_J_BIT 0x01000000
+#define PSR_Q_BIT 0x08000000
+#define PSR_V_BIT 0x10000000
+#define PSR_C_BIT 0x20000000
+#define PSR_Z_BIT 0x40000000
+#define PSR_N_BIT 0x80000000
+#define PCMASK 0
+
+#define PSR_f 0xff000000  
+#define PSR_s 0x00ff0000  
+#define PSR_x 0x0000ff00  
+#define PSR_c 0x000000ff  
+
+#ifndef __ASSEMBLY__
+
+struct pt_regs {
+ long uregs[18];
+};
+
+#define ARM_cpsr uregs[16]
+#define ARM_pc uregs[15]
+#define ARM_lr uregs[14]
+#define ARM_sp uregs[13]
+#define ARM_ip uregs[12]
+#define ARM_fp uregs[11]
+#define ARM_r10 uregs[10]
+#define ARM_r9 uregs[9]
+#define ARM_r8 uregs[8]
+#define ARM_r7 uregs[7]
+#define ARM_r6 uregs[6]
+#define ARM_r5 uregs[5]
+#define ARM_r4 uregs[4]
+#define ARM_r3 uregs[3]
+#define ARM_r2 uregs[2]
+#define ARM_r1 uregs[1]
+#define ARM_r0 uregs[0]
+#define ARM_ORIG_r0 uregs[17]
+
+#define pc_pointer(v)   ((v) & ~PCMASK)
+
+#define instruction_pointer(regs)   (pc_pointer((regs)->ARM_pc))
+
+#define profile_pc(regs) instruction_pointer(regs)
+
+#endif
+
+#endif
+
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/resource.h b/ndk/platforms/android-3/arch-arm/include/asm/resource.h
new file mode 100644
index 0000000..7546dd4
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/resource.h
@@ -0,0 +1,17 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ARM_RESOURCE_H
+#define _ARM_RESOURCE_H
+
+#include <asm-generic/resource.h>
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/scatterlist.h b/ndk/platforms/android-3/arch-arm/include/asm/scatterlist.h
new file mode 100644
index 0000000..a2c06ca
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/scatterlist.h
@@ -0,0 +1,28 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASMARM_SCATTERLIST_H
+#define _ASMARM_SCATTERLIST_H
+
+#include <asm/memory.h>
+#include <asm/types.h>
+
+struct scatterlist {
+ struct page *page;
+ unsigned int offset;
+ dma_addr_t dma_address;
+ unsigned int length;
+};
+
+#define sg_dma_address(sg) ((sg)->dma_address)
+#define sg_dma_len(sg) ((sg)->length)
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/semaphore.h b/ndk/platforms/android-3/arch-arm/include/asm/semaphore.h
new file mode 100644
index 0000000..7c5618a
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/semaphore.h
@@ -0,0 +1,36 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASM_ARM_SEMAPHORE_H
+#define __ASM_ARM_SEMAPHORE_H
+
+#include <linux/linkage.h>
+#include <linux/spinlock.h>
+#include <linux/wait.h>
+#include <linux/rwsem.h>
+
+#include <asm/atomic.h>
+#include <asm/locks.h>
+
+struct semaphore {
+ atomic_t count;
+ int sleepers;
+ wait_queue_head_t wait;
+};
+
+#define __SEMAPHORE_INIT(name, cnt)  {   .count = ATOMIC_INIT(cnt),   .wait = __WAIT_QUEUE_HEAD_INITIALIZER((name).wait),  }
+
+#define __DECLARE_SEMAPHORE_GENERIC(name,count)   struct semaphore name = __SEMAPHORE_INIT(name,count)
+
+#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1)
+#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0)
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/sembuf.h b/ndk/platforms/android-3/arch-arm/include/asm/sembuf.h
new file mode 100644
index 0000000..a2f5dd0
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/sembuf.h
@@ -0,0 +1,26 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASMARM_SEMBUF_H
+#define _ASMARM_SEMBUF_H
+
+struct semid64_ds {
+ struct ipc64_perm sem_perm;
+ __kernel_time_t sem_otime;
+ unsigned long __unused1;
+ __kernel_time_t sem_ctime;
+ unsigned long __unused2;
+ unsigned long sem_nsems;
+ unsigned long __unused3;
+ unsigned long __unused4;
+};
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/shmbuf.h b/ndk/platforms/android-3/arch-arm/include/asm/shmbuf.h
new file mode 100644
index 0000000..1d4d78c
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/shmbuf.h
@@ -0,0 +1,43 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASMARM_SHMBUF_H
+#define _ASMARM_SHMBUF_H
+
+struct shmid64_ds {
+ struct ipc64_perm shm_perm;
+ size_t shm_segsz;
+ __kernel_time_t shm_atime;
+ unsigned long __unused1;
+ __kernel_time_t shm_dtime;
+ unsigned long __unused2;
+ __kernel_time_t shm_ctime;
+ unsigned long __unused3;
+ __kernel_pid_t shm_cpid;
+ __kernel_pid_t shm_lpid;
+ unsigned long shm_nattch;
+ unsigned long __unused4;
+ unsigned long __unused5;
+};
+
+struct shminfo64 {
+ unsigned long shmmax;
+ unsigned long shmmin;
+ unsigned long shmmni;
+ unsigned long shmseg;
+ unsigned long shmall;
+ unsigned long __unused1;
+ unsigned long __unused2;
+ unsigned long __unused3;
+ unsigned long __unused4;
+};
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/shmparam.h b/ndk/platforms/android-3/arch-arm/include/asm/shmparam.h
new file mode 100644
index 0000000..ea53a8d
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/shmparam.h
@@ -0,0 +1,19 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASMARM_SHMPARAM_H
+#define _ASMARM_SHMPARAM_H
+
+#define SHMLBA (4 * PAGE_SIZE)  
+
+#define __ARCH_FORCE_SHMLBA
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/sigcontext.h b/ndk/platforms/android-3/arch-arm/include/asm/sigcontext.h
new file mode 100644
index 0000000..3c4fcf3
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/sigcontext.h
@@ -0,0 +1,39 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASMARM_SIGCONTEXT_H
+#define _ASMARM_SIGCONTEXT_H
+
+struct sigcontext {
+ unsigned long trap_no;
+ unsigned long error_code;
+ unsigned long oldmask;
+ unsigned long arm_r0;
+ unsigned long arm_r1;
+ unsigned long arm_r2;
+ unsigned long arm_r3;
+ unsigned long arm_r4;
+ unsigned long arm_r5;
+ unsigned long arm_r6;
+ unsigned long arm_r7;
+ unsigned long arm_r8;
+ unsigned long arm_r9;
+ unsigned long arm_r10;
+ unsigned long arm_fp;
+ unsigned long arm_ip;
+ unsigned long arm_sp;
+ unsigned long arm_lr;
+ unsigned long arm_pc;
+ unsigned long arm_cpsr;
+ unsigned long fault_address;
+};
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/siginfo.h b/ndk/platforms/android-3/arch-arm/include/asm/siginfo.h
new file mode 100644
index 0000000..225685e
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/siginfo.h
@@ -0,0 +1,17 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASMARM_SIGINFO_H
+#define _ASMARM_SIGINFO_H
+
+#include <asm-generic/siginfo.h>
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/signal.h b/ndk/platforms/android-3/arch-arm/include/asm/signal.h
new file mode 100644
index 0000000..212d9f1
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/signal.h
@@ -0,0 +1,103 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASMARM_SIGNAL_H
+#define _ASMARM_SIGNAL_H
+
+#include <linux/types.h>
+
+struct siginfo;
+
+#define NSIG 32
+typedef unsigned long sigset_t;
+
+#define SIGHUP 1
+#define SIGINT 2
+#define SIGQUIT 3
+#define SIGILL 4
+#define SIGTRAP 5
+#define SIGABRT 6
+#define SIGIOT 6
+#define SIGBUS 7
+#define SIGFPE 8
+#define SIGKILL 9
+#define SIGUSR1 10
+#define SIGSEGV 11
+#define SIGUSR2 12
+#define SIGPIPE 13
+#define SIGALRM 14
+#define SIGTERM 15
+#define SIGSTKFLT 16
+#define SIGCHLD 17
+#define SIGCONT 18
+#define SIGSTOP 19
+#define SIGTSTP 20
+#define SIGTTIN 21
+#define SIGTTOU 22
+#define SIGURG 23
+#define SIGXCPU 24
+#define SIGXFSZ 25
+#define SIGVTALRM 26
+#define SIGPROF 27
+#define SIGWINCH 28
+#define SIGIO 29
+#define SIGPOLL SIGIO
+
+#define SIGPWR 30
+#define SIGSYS 31
+#define SIGUNUSED 31
+
+#define SIGRTMIN 32
+#define SIGRTMAX _NSIG
+
+#define SIGSWI 32
+
+#define SA_NOCLDSTOP 0x00000001
+#define SA_NOCLDWAIT 0x00000002
+#define SA_SIGINFO 0x00000004
+#define SA_THIRTYTWO 0x02000000
+#define SA_RESTORER 0x04000000
+#define SA_ONSTACK 0x08000000
+#define SA_RESTART 0x10000000
+#define SA_NODEFER 0x40000000
+#define SA_RESETHAND 0x80000000
+
+#define SA_NOMASK SA_NODEFER
+#define SA_ONESHOT SA_RESETHAND
+
+#define SS_ONSTACK 1
+#define SS_DISABLE 2
+
+#define MINSIGSTKSZ 2048
+#define SIGSTKSZ 8192
+
+#include <asm-generic/signal.h>
+
+struct sigaction {
+ union {
+ __sighandler_t _sa_handler;
+ void (*_sa_sigaction)(int, struct siginfo *, void *);
+ } _u;
+ sigset_t sa_mask;
+ unsigned long sa_flags;
+ void (*sa_restorer)(void);
+};
+
+#define sa_handler _u._sa_handler
+#define sa_sigaction _u._sa_sigaction
+
+typedef struct sigaltstack {
+ void __user *ss_sp;
+ int ss_flags;
+ size_t ss_size;
+} stack_t;
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/sizes.h b/ndk/platforms/android-3/arch-arm/include/asm/sizes.h
new file mode 100644
index 0000000..90c1c71
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/sizes.h
@@ -0,0 +1,39 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __sizes_h
+#define __sizes_h 1
+
+#define SZ_1K 0x00000400
+#define SZ_4K 0x00001000
+#define SZ_8K 0x00002000
+#define SZ_16K 0x00004000
+#define SZ_64K 0x00010000
+#define SZ_128K 0x00020000
+#define SZ_256K 0x00040000
+#define SZ_512K 0x00080000
+
+#define SZ_1M 0x00100000
+#define SZ_2M 0x00200000
+#define SZ_4M 0x00400000
+#define SZ_8M 0x00800000
+#define SZ_16M 0x01000000
+#define SZ_32M 0x02000000
+#define SZ_64M 0x04000000
+#define SZ_128M 0x08000000
+#define SZ_256M 0x10000000
+#define SZ_512M 0x20000000
+
+#define SZ_1G 0x40000000
+#define SZ_2G 0x80000000
+
+#endif
+
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/smp.h b/ndk/platforms/android-3/arch-arm/include/asm/smp.h
new file mode 100644
index 0000000..e6c1e41
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/smp.h
@@ -0,0 +1,34 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASM_ARM_SMP_H
+#define __ASM_ARM_SMP_H
+
+#include <linux/threads.h>
+#include <linux/cpumask.h>
+#include <linux/thread_info.h>
+
+#include <asm/arch/smp.h>
+
+#error "<asm-arm/smp.h> included in non-SMP build"
+
+#define raw_smp_processor_id() (current_thread_info()->cpu)
+
+#define PROC_CHANGE_PENALTY 15
+
+struct seq_file;
+
+struct secondary_data {
+ unsigned long pgdir;
+ void *stack;
+};
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/socket.h b/ndk/platforms/android-3/arch-arm/include/asm/socket.h
new file mode 100644
index 0000000..1f0050a
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/socket.h
@@ -0,0 +1,61 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASMARM_SOCKET_H
+#define _ASMARM_SOCKET_H
+
+#include <asm/sockios.h>
+
+#define SOL_SOCKET 1
+
+#define SO_DEBUG 1
+#define SO_REUSEADDR 2
+#define SO_TYPE 3
+#define SO_ERROR 4
+#define SO_DONTROUTE 5
+#define SO_BROADCAST 6
+#define SO_SNDBUF 7
+#define SO_RCVBUF 8
+#define SO_SNDBUFFORCE 32
+#define SO_RCVBUFFORCE 33
+#define SO_KEEPALIVE 9
+#define SO_OOBINLINE 10
+#define SO_NO_CHECK 11
+#define SO_PRIORITY 12
+#define SO_LINGER 13
+#define SO_BSDCOMPAT 14
+
+#define SO_PASSCRED 16
+#define SO_PEERCRED 17
+#define SO_RCVLOWAT 18
+#define SO_SNDLOWAT 19
+#define SO_RCVTIMEO 20
+#define SO_SNDTIMEO 21
+
+#define SO_SECURITY_AUTHENTICATION 22
+#define SO_SECURITY_ENCRYPTION_TRANSPORT 23
+#define SO_SECURITY_ENCRYPTION_NETWORK 24
+
+#define SO_BINDTODEVICE 25
+
+#define SO_ATTACH_FILTER 26
+#define SO_DETACH_FILTER 27
+
+#define SO_PEERNAME 28
+#define SO_TIMESTAMP 29
+#define SCM_TIMESTAMP SO_TIMESTAMP
+
+#define SO_ACCEPTCONN 30
+
+#define SO_PEERSEC 31
+#define SO_PASSSEC 34
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/sockios.h b/ndk/platforms/android-3/arch-arm/include/asm/sockios.h
new file mode 100644
index 0000000..cab86b8
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/sockios.h
@@ -0,0 +1,22 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ARCH_ARM_SOCKIOS_H
+#define __ARCH_ARM_SOCKIOS_H
+
+#define FIOSETOWN 0x8901
+#define SIOCSPGRP 0x8902
+#define FIOGETOWN 0x8903
+#define SIOCGPGRP 0x8904
+#define SIOCATMARK 0x8905
+#define SIOCGSTAMP 0x8906  
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/spinlock.h b/ndk/platforms/android-3/arch-arm/include/asm/spinlock.h
new file mode 100644
index 0000000..3ae2173
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/spinlock.h
@@ -0,0 +1,27 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASM_SPINLOCK_H
+#define __ASM_SPINLOCK_H
+
+#if __LINUX_ARM_ARCH__ < 6
+#error SMP not supported on pre-ARMv6 CPUs
+#endif
+
+#define __raw_spin_is_locked(x) ((x)->lock != 0)
+#define __raw_spin_unlock_wait(lock)   do { while (__raw_spin_is_locked(lock)) cpu_relax(); } while (0)
+
+#define __raw_spin_lock_flags(lock, flags) __raw_spin_lock(lock)
+
+#define rwlock_is_locked(x) (*((volatile unsigned int *)(x)) != 0)
+#define __raw_write_can_lock(x) ((x)->lock == 0x80000000)
+#define __raw_read_can_lock(x) ((x)->lock < 0x80000000)
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/spinlock_types.h b/ndk/platforms/android-3/arch-arm/include/asm/spinlock_types.h
new file mode 100644
index 0000000..ee77f20
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/spinlock_types.h
@@ -0,0 +1,31 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASM_SPINLOCK_TYPES_H
+#define __ASM_SPINLOCK_TYPES_H
+
+#ifndef __LINUX_SPINLOCK_TYPES_H
+#error "please don't include this file directly"
+#endif
+
+typedef struct {
+ volatile unsigned int lock;
+} raw_spinlock_t;
+
+#define __RAW_SPIN_LOCK_UNLOCKED { 0 }
+
+typedef struct {
+ volatile unsigned int lock;
+} raw_rwlock_t;
+
+#define __RAW_RW_LOCK_UNLOCKED { 0 }
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/stat.h b/ndk/platforms/android-3/arch-arm/include/asm/stat.h
new file mode 100644
index 0000000..49b85f9
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/stat.h
@@ -0,0 +1,93 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASMARM_STAT_H
+#define _ASMARM_STAT_H
+
+struct __old_kernel_stat {
+ unsigned short st_dev;
+ unsigned short st_ino;
+ unsigned short st_mode;
+ unsigned short st_nlink;
+ unsigned short st_uid;
+ unsigned short st_gid;
+ unsigned short st_rdev;
+ unsigned long st_size;
+ unsigned long st_atime;
+ unsigned long st_mtime;
+ unsigned long st_ctime;
+};
+
+#define STAT_HAVE_NSEC 
+
+struct stat {
+#ifdef __ARMEB__
+ unsigned short st_dev;
+ unsigned short __pad1;
+#else
+ unsigned long st_dev;
+#endif
+ unsigned long st_ino;
+ unsigned short st_mode;
+ unsigned short st_nlink;
+ unsigned short st_uid;
+ unsigned short st_gid;
+#ifdef __ARMEB__
+ unsigned short st_rdev;
+ unsigned short __pad2;
+#else
+ unsigned long st_rdev;
+#endif
+ unsigned long st_size;
+ unsigned long st_blksize;
+ unsigned long st_blocks;
+ unsigned long st_atime;
+ unsigned long st_atime_nsec;
+ unsigned long st_mtime;
+ unsigned long st_mtime_nsec;
+ unsigned long st_ctime;
+ unsigned long st_ctime_nsec;
+ unsigned long __unused4;
+ unsigned long __unused5;
+};
+
+struct stat64 {
+ unsigned long long st_dev;
+ unsigned char __pad0[4];
+
+#define STAT64_HAS_BROKEN_ST_INO 1
+ unsigned long __st_ino;
+ unsigned int st_mode;
+ unsigned int st_nlink;
+
+ unsigned long st_uid;
+ unsigned long st_gid;
+
+ unsigned long long st_rdev;
+ unsigned char __pad3[4];
+
+ long long st_size;
+ unsigned long st_blksize;
+ unsigned long long st_blocks;
+
+ unsigned long st_atime;
+ unsigned long st_atime_nsec;
+
+ unsigned long st_mtime;
+ unsigned long st_mtime_nsec;
+
+ unsigned long st_ctime;
+ unsigned long st_ctime_nsec;
+
+ unsigned long long st_ino;
+};
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/statfs.h b/ndk/platforms/android-3/arch-arm/include/asm/statfs.h
new file mode 100644
index 0000000..7963eab
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/statfs.h
@@ -0,0 +1,43 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASMARM_STATFS_H
+#define _ASMARM_STATFS_H
+
+struct statfs {
+ __u32 f_type;
+ __u32 f_bsize;
+ __u32 f_blocks;
+ __u32 f_bfree;
+ __u32 f_bavail;
+ __u32 f_files;
+ __u32 f_ffree;
+ __kernel_fsid_t f_fsid;
+ __u32 f_namelen;
+ __u32 f_frsize;
+ __u32 f_spare[5];
+};
+
+struct statfs64 {
+ __u32 f_type;
+ __u32 f_bsize;
+ __u64 f_blocks;
+ __u64 f_bfree;
+ __u64 f_bavail;
+ __u64 f_files;
+ __u64 f_ffree;
+ __kernel_fsid_t f_fsid;
+ __u32 f_namelen;
+ __u32 f_frsize;
+ __u32 f_spare[5];
+} __attribute__ ((packed,aligned(4)));
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/suspend.h b/ndk/platforms/android-3/arch-arm/include/asm/suspend.h
new file mode 100644
index 0000000..156c171
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/suspend.h
@@ -0,0 +1,15 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASMARM_SUSPEND_H
+#define _ASMARM_SUSPEND_H
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/system.h b/ndk/platforms/android-3/arch-arm/include/asm/system.h
new file mode 100644
index 0000000..8e85039
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/system.h
@@ -0,0 +1,15 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASM_ARM_SYSTEM_H
+#define __ASM_ARM_SYSTEM_H
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/termbits.h b/ndk/platforms/android-3/arch-arm/include/asm/termbits.h
new file mode 100644
index 0000000..640bd27
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/termbits.h
@@ -0,0 +1,174 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASM_ARM_TERMBITS_H
+#define __ASM_ARM_TERMBITS_H
+
+typedef unsigned char cc_t;
+typedef unsigned int speed_t;
+typedef unsigned int tcflag_t;
+
+#define NCCS 19
+struct termios {
+ tcflag_t c_iflag;
+ tcflag_t c_oflag;
+ tcflag_t c_cflag;
+ tcflag_t c_lflag;
+ cc_t c_line;
+ cc_t c_cc[NCCS];
+};
+
+#define VINTR 0
+#define VQUIT 1
+#define VERASE 2
+#define VKILL 3
+#define VEOF 4
+#define VTIME 5
+#define VMIN 6
+#define VSWTC 7
+#define VSTART 8
+#define VSTOP 9
+#define VSUSP 10
+#define VEOL 11
+#define VREPRINT 12
+#define VDISCARD 13
+#define VWERASE 14
+#define VLNEXT 15
+#define VEOL2 16
+
+#define IGNBRK 0000001
+#define BRKINT 0000002
+#define IGNPAR 0000004
+#define PARMRK 0000010
+#define INPCK 0000020
+#define ISTRIP 0000040
+#define INLCR 0000100
+#define IGNCR 0000200
+#define ICRNL 0000400
+#define IUCLC 0001000
+#define IXON 0002000
+#define IXANY 0004000
+#define IXOFF 0010000
+#define IMAXBEL 0020000
+#define IUTF8 0040000
+
+#define OPOST 0000001
+#define OLCUC 0000002
+#define ONLCR 0000004
+#define OCRNL 0000010
+#define ONOCR 0000020
+#define ONLRET 0000040
+#define OFILL 0000100
+#define OFDEL 0000200
+#define NLDLY 0000400
+#define NL0 0000000
+#define NL1 0000400
+#define CRDLY 0003000
+#define CR0 0000000
+#define CR1 0001000
+#define CR2 0002000
+#define CR3 0003000
+#define TABDLY 0014000
+#define TAB0 0000000
+#define TAB1 0004000
+#define TAB2 0010000
+#define TAB3 0014000
+#define XTABS 0014000
+#define BSDLY 0020000
+#define BS0 0000000
+#define BS1 0020000
+#define VTDLY 0040000
+#define VT0 0000000
+#define VT1 0040000
+#define FFDLY 0100000
+#define FF0 0000000
+#define FF1 0100000
+
+#define CBAUD 0010017
+#define B0 0000000  
+#define B50 0000001
+#define B75 0000002
+#define B110 0000003
+#define B134 0000004
+#define B150 0000005
+#define B200 0000006
+#define B300 0000007
+#define B600 0000010
+#define B1200 0000011
+#define B1800 0000012
+#define B2400 0000013
+#define B4800 0000014
+#define B9600 0000015
+#define B19200 0000016
+#define B38400 0000017
+#define EXTA B19200
+#define EXTB B38400
+#define CSIZE 0000060
+#define CS5 0000000
+#define CS6 0000020
+#define CS7 0000040
+#define CS8 0000060
+#define CSTOPB 0000100
+#define CREAD 0000200
+#define PARENB 0000400
+#define PARODD 0001000
+#define HUPCL 0002000
+#define CLOCAL 0004000
+#define CBAUDEX 0010000
+#define B57600 0010001
+#define B115200 0010002
+#define B230400 0010003
+#define B460800 0010004
+#define B500000 0010005
+#define B576000 0010006
+#define B921600 0010007
+#define B1000000 0010010
+#define B1152000 0010011
+#define B1500000 0010012
+#define B2000000 0010013
+#define B2500000 0010014
+#define B3000000 0010015
+#define B3500000 0010016
+#define B4000000 0010017
+#define CIBAUD 002003600000  
+#define CMSPAR 010000000000  
+#define CRTSCTS 020000000000  
+
+#define ISIG 0000001
+#define ICANON 0000002
+#define XCASE 0000004
+#define ECHO 0000010
+#define ECHOE 0000020
+#define ECHOK 0000040
+#define ECHONL 0000100
+#define NOFLSH 0000200
+#define TOSTOP 0000400
+#define ECHOCTL 0001000
+#define ECHOPRT 0002000
+#define ECHOKE 0004000
+#define FLUSHO 0010000
+#define PENDIN 0040000
+#define IEXTEN 0100000
+
+#define TCOOFF 0
+#define TCOON 1
+#define TCIOFF 2
+#define TCION 3
+
+#define TCIFLUSH 0
+#define TCOFLUSH 1
+#define TCIOFLUSH 2
+
+#define TCSANOW 0
+#define TCSADRAIN 1
+#define TCSAFLUSH 2
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/termios.h b/ndk/platforms/android-3/arch-arm/include/asm/termios.h
new file mode 100644
index 0000000..ba43ac2
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/termios.h
@@ -0,0 +1,67 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASM_ARM_TERMIOS_H
+#define __ASM_ARM_TERMIOS_H
+
+#include <asm/termbits.h>
+#include <asm/ioctls.h>
+
+struct winsize {
+ unsigned short ws_row;
+ unsigned short ws_col;
+ unsigned short ws_xpixel;
+ unsigned short ws_ypixel;
+};
+
+#define NCC 8
+struct termio {
+ unsigned short c_iflag;
+ unsigned short c_oflag;
+ unsigned short c_cflag;
+ unsigned short c_lflag;
+ unsigned char c_line;
+ unsigned char c_cc[NCC];
+};
+
+#define TIOCM_LE 0x001
+#define TIOCM_DTR 0x002
+#define TIOCM_RTS 0x004
+#define TIOCM_ST 0x008
+#define TIOCM_SR 0x010
+#define TIOCM_CTS 0x020
+#define TIOCM_CAR 0x040
+#define TIOCM_RNG 0x080
+#define TIOCM_DSR 0x100
+#define TIOCM_CD TIOCM_CAR
+#define TIOCM_RI TIOCM_RNG
+#define TIOCM_OUT1 0x2000
+#define TIOCM_OUT2 0x4000
+#define TIOCM_LOOP 0x8000
+
+#define N_TTY 0
+#define N_SLIP 1
+#define N_MOUSE 2
+#define N_PPP 3
+#define N_STRIP 4
+#define N_AX25 5
+#define N_X25 6  
+#define N_6PACK 7
+#define N_MASC 8  
+#define N_R3964 9  
+#define N_PROFIBUS_FDL 10  
+#define N_IRDA 11  
+#define N_SMSBLOCK 12  
+#define N_HDLC 13  
+#define N_SYNC_PPP 14
+#define N_HCI 15  
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/thread_info.h b/ndk/platforms/android-3/arch-arm/include/asm/thread_info.h
new file mode 100644
index 0000000..a30d2dc
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/thread_info.h
@@ -0,0 +1,15 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASM_ARM_THREAD_INFO_H
+#define __ASM_ARM_THREAD_INFO_H
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/timex.h b/ndk/platforms/android-3/arch-arm/include/asm/timex.h
new file mode 100644
index 0000000..110c471
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/timex.h
@@ -0,0 +1,19 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASMARM_TIMEX_H
+#define _ASMARM_TIMEX_H
+
+#include <asm/arch/timex.h>
+
+typedef unsigned long cycles_t;
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/tlbflush.h b/ndk/platforms/android-3/arch-arm/include/asm/tlbflush.h
new file mode 100644
index 0000000..70a23dc
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/tlbflush.h
@@ -0,0 +1,17 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASMARM_TLBFLUSH_H
+#define _ASMARM_TLBFLUSH_H
+
+#define tlb_flush(tlb) ((void) tlb)
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/topology.h b/ndk/platforms/android-3/arch-arm/include/asm/topology.h
new file mode 100644
index 0000000..9eccfd4
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/topology.h
@@ -0,0 +1,17 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_ARM_TOPOLOGY_H
+#define _ASM_ARM_TOPOLOGY_H
+
+#include <asm-generic/topology.h>
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/types.h b/ndk/platforms/android-3/arch-arm/include/asm/types.h
new file mode 100644
index 0000000..ec60f10
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/types.h
@@ -0,0 +1,36 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASM_ARM_TYPES_H
+#define __ASM_ARM_TYPES_H
+
+#ifndef __ASSEMBLY__
+
+typedef unsigned short umode_t;
+
+typedef __signed__ char __s8;
+typedef unsigned char __u8;
+
+typedef __signed__ short __s16;
+typedef unsigned short __u16;
+
+typedef __signed__ int __s32;
+typedef unsigned int __u32;
+
+#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
+typedef __signed__ long long __s64;
+typedef unsigned long long __u64;
+#endif
+
+#endif
+
+#endif
+
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/uaccess.h b/ndk/platforms/android-3/arch-arm/include/asm/uaccess.h
new file mode 100644
index 0000000..21fc3f2
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/uaccess.h
@@ -0,0 +1,77 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASMARM_UACCESS_H
+#define _ASMARM_UACCESS_H
+
+#include <linux/sched.h>
+#include <asm/errno.h>
+#include <asm/memory.h>
+#include <asm/domain.h>
+#include <asm/system.h>
+
+#define VERIFY_READ 0
+#define VERIFY_WRITE 1
+
+struct exception_table_entry
+{
+ unsigned long insn, fixup;
+};
+
+#define KERNEL_DS 0x00000000
+#define get_ds() (KERNEL_DS)
+
+#define USER_DS KERNEL_DS
+
+#define segment_eq(a,b) (1)
+#define __addr_ok(addr) (1)
+#define __range_ok(addr,size) (0)
+#define get_fs() (KERNEL_DS)
+
+#define get_user(x,p) __get_user(x,p)
+#define put_user(x,p) __put_user(x,p)
+#define access_ok(type,addr,size) (__range_ok(addr,size) == 0)
+#define __get_user(x,ptr)  ({   long __gu_err = 0;   __get_user_err((x),(ptr),__gu_err);   __gu_err;  })
+#define __get_user_error(x,ptr,err)  ({   __get_user_err((x),(ptr),err);   (void) 0;  })
+#define __get_user_err(x,ptr,err)  do {   unsigned long __gu_addr = (unsigned long)(ptr);   unsigned long __gu_val;   __chk_user_ptr(ptr);   switch (sizeof(*(ptr))) {   case 1: __get_user_asm_byte(__gu_val,__gu_addr,err); break;   case 2: __get_user_asm_half(__gu_val,__gu_addr,err); break;   case 4: __get_user_asm_word(__gu_val,__gu_addr,err); break;   default: (__gu_val) = __get_user_bad();   }   (x) = (__typeof__(*(ptr)))__gu_val;  } while (0)
+#define __get_user_asm_byte(x,addr,err)   __asm__ __volatile__(   "1:	ldrbt	%1,[%2],#0\n"   "2:\n"   "	.section .fixup,\"ax\"\n"   "	.align	2\n"   "3:	mov	%0, %3\n"   "	mov	%1, #0\n"   "	b	2b\n"   "	.previous\n"   "	.section __ex_table,\"a\"\n"   "	.align	3\n"   "	.long	1b, 3b\n"   "	.previous"   : "+r" (err), "=&r" (x)   : "r" (addr), "i" (-EFAULT)   : "cc")
+#ifndef __ARMEB__
+#define __get_user_asm_half(x,__gu_addr,err)  ({   unsigned long __b1, __b2;   __get_user_asm_byte(__b1, __gu_addr, err);   __get_user_asm_byte(__b2, __gu_addr + 1, err);   (x) = __b1 | (__b2 << 8);  })
+#else
+#define __get_user_asm_half(x,__gu_addr,err)  ({   unsigned long __b1, __b2;   __get_user_asm_byte(__b1, __gu_addr, err);   __get_user_asm_byte(__b2, __gu_addr + 1, err);   (x) = (__b1 << 8) | __b2;  })
+#endif
+#define __get_user_asm_word(x,addr,err)   __asm__ __volatile__(   "1:	ldrt	%1,[%2],#0\n"   "2:\n"   "	.section .fixup,\"ax\"\n"   "	.align	2\n"   "3:	mov	%0, %3\n"   "	mov	%1, #0\n"   "	b	2b\n"   "	.previous\n"   "	.section __ex_table,\"a\"\n"   "	.align	3\n"   "	.long	1b, 3b\n"   "	.previous"   : "+r" (err), "=&r" (x)   : "r" (addr), "i" (-EFAULT)   : "cc")
+#define __put_user(x,ptr)  ({   long __pu_err = 0;   __put_user_err((x),(ptr),__pu_err);   __pu_err;  })
+#define __put_user_error(x,ptr,err)  ({   __put_user_err((x),(ptr),err);   (void) 0;  })
+#define __put_user_err(x,ptr,err)  do {   unsigned long __pu_addr = (unsigned long)(ptr);   __typeof__(*(ptr)) __pu_val = (x);   __chk_user_ptr(ptr);   switch (sizeof(*(ptr))) {   case 1: __put_user_asm_byte(__pu_val,__pu_addr,err); break;   case 2: __put_user_asm_half(__pu_val,__pu_addr,err); break;   case 4: __put_user_asm_word(__pu_val,__pu_addr,err); break;   case 8: __put_user_asm_dword(__pu_val,__pu_addr,err); break;   default: __put_user_bad();   }  } while (0)
+#define __put_user_asm_byte(x,__pu_addr,err)   __asm__ __volatile__(   "1:	strbt	%1,[%2],#0\n"   "2:\n"   "	.section .fixup,\"ax\"\n"   "	.align	2\n"   "3:	mov	%0, %3\n"   "	b	2b\n"   "	.previous\n"   "	.section __ex_table,\"a\"\n"   "	.align	3\n"   "	.long	1b, 3b\n"   "	.previous"   : "+r" (err)   : "r" (x), "r" (__pu_addr), "i" (-EFAULT)   : "cc")
+#ifndef __ARMEB__
+#define __put_user_asm_half(x,__pu_addr,err)  ({   unsigned long __temp = (unsigned long)(x);   __put_user_asm_byte(__temp, __pu_addr, err);   __put_user_asm_byte(__temp >> 8, __pu_addr + 1, err);  })
+#else
+#define __put_user_asm_half(x,__pu_addr,err)  ({   unsigned long __temp = (unsigned long)(x);   __put_user_asm_byte(__temp >> 8, __pu_addr, err);   __put_user_asm_byte(__temp, __pu_addr + 1, err);  })
+#endif
+#define __put_user_asm_word(x,__pu_addr,err)   __asm__ __volatile__(   "1:	strt	%1,[%2],#0\n"   "2:\n"   "	.section .fixup,\"ax\"\n"   "	.align	2\n"   "3:	mov	%0, %3\n"   "	b	2b\n"   "	.previous\n"   "	.section __ex_table,\"a\"\n"   "	.align	3\n"   "	.long	1b, 3b\n"   "	.previous"   : "+r" (err)   : "r" (x), "r" (__pu_addr), "i" (-EFAULT)   : "cc")
+#ifndef __ARMEB__
+#define __reg_oper0 "%R2"
+#define __reg_oper1 "%Q2"
+#else
+#define __reg_oper0 "%Q2"
+#define __reg_oper1 "%R2"
+#endif
+#define __put_user_asm_dword(x,__pu_addr,err)   __asm__ __volatile__(   "1:	strt	" __reg_oper1 ", [%1], #4\n"   "2:	strt	" __reg_oper0 ", [%1], #0\n"   "3:\n"   "	.section .fixup,\"ax\"\n"   "	.align	2\n"   "4:	mov	%0, %3\n"   "	b	3b\n"   "	.previous\n"   "	.section __ex_table,\"a\"\n"   "	.align	3\n"   "	.long	1b, 4b\n"   "	.long	2b, 4b\n"   "	.previous"   : "+r" (err), "+r" (__pu_addr)   : "r" (x), "i" (-EFAULT)   : "cc")
+#define __copy_from_user(to,from,n) (memcpy(to, (void __force *)from, n), 0)
+#define __copy_to_user(to,from,n) (memcpy((void __force *)to, from, n), 0)
+#define __clear_user(addr,n) (memset((void __force *)addr, 0, n), 0)
+
+#define __copy_to_user_inatomic __copy_to_user
+#define __copy_from_user_inatomic __copy_from_user
+#define strlen_user(s) strnlen_user(s, ~0UL >> 1)
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/unaligned.h b/ndk/platforms/android-3/arch-arm/include/asm/unaligned.h
new file mode 100644
index 0000000..8b9b096
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/unaligned.h
@@ -0,0 +1,38 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASM_ARM_UNALIGNED_H
+#define __ASM_ARM_UNALIGNED_H
+
+#include <asm/types.h>
+
+#define __get_unaligned_2_le(__p)   (__p[0] | __p[1] << 8)
+
+#define __get_unaligned_2_be(__p)   (__p[0] << 8 | __p[1])
+
+#define __get_unaligned_4_le(__p)   (__p[0] | __p[1] << 8 | __p[2] << 16 | __p[3] << 24)
+
+#define __get_unaligned_4_be(__p)   (__p[0] << 24 | __p[1] << 16 | __p[2] << 8 | __p[3])
+
+#define __get_unaligned_le(ptr)   ({   __typeof__(*(ptr)) __v;   __u8 *__p = (__u8 *)(ptr);   switch (sizeof(*(ptr))) {   case 1: __v = *(ptr); break;   case 2: __v = __get_unaligned_2_le(__p); break;   case 4: __v = __get_unaligned_4_le(__p); break;   case 8: {   unsigned int __v1, __v2;   __v2 = __get_unaligned_4_le((__p+4));   __v1 = __get_unaligned_4_le(__p);   __v = ((unsigned long long)__v2 << 32 | __v1);   }   break;   default: __v = __bug_unaligned_x(__p); break;   }   __v;   })
+
+#define __get_unaligned_be(ptr)   ({   __typeof__(*(ptr)) __v;   __u8 *__p = (__u8 *)(ptr);   switch (sizeof(*(ptr))) {   case 1: __v = *(ptr); break;   case 2: __v = __get_unaligned_2_be(__p); break;   case 4: __v = __get_unaligned_4_be(__p); break;   case 8: {   unsigned int __v1, __v2;   __v2 = __get_unaligned_4_be(__p);   __v1 = __get_unaligned_4_be((__p+4));   __v = ((unsigned long long)__v2 << 32 | __v1);   }   break;   default: __v = __bug_unaligned_x(__p); break;   }   __v;   })
+
+#define __put_unaligned_le(val,ptr)   ({   switch (sizeof(*(ptr))) {   case 1:   *(ptr) = (val);   break;   case 2: __put_unaligned_2_le((val),(__u8 *)(ptr));   break;   case 4: __put_unaligned_4_le((val),(__u8 *)(ptr));   break;   case 8: __put_unaligned_8_le((val),(__u8 *)(ptr));   break;   default: __bug_unaligned_x(ptr);   break;   }   (void) 0;   })
+#define __put_unaligned_be(val,ptr)   ({   switch (sizeof(*(ptr))) {   case 1:   *(ptr) = (val);   break;   case 2: __put_unaligned_2_be((val),(__u8 *)(ptr));   break;   case 4: __put_unaligned_4_be((val),(__u8 *)(ptr));   break;   case 8: __put_unaligned_8_be((val),(__u8 *)(ptr));   break;   default: __bug_unaligned_x(ptr);   break;   }   (void) 0;   })
+#ifndef __ARMEB__
+#define get_unaligned __get_unaligned_le
+#define put_unaligned __put_unaligned_le
+#else
+#define get_unaligned __get_unaligned_be
+#define put_unaligned __put_unaligned_be
+#endif
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/unistd.h b/ndk/platforms/android-3/arch-arm/include/asm/unistd.h
new file mode 100644
index 0000000..9a30ddc
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/unistd.h
@@ -0,0 +1,359 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASM_ARM_UNISTD_H
+#define __ASM_ARM_UNISTD_H
+
+#define __NR_OABI_SYSCALL_BASE 0x900000
+
+#if defined(__thumb__) || defined(__ARM_EABI__)
+#define __NR_SYSCALL_BASE 0
+#else
+#define __NR_SYSCALL_BASE __NR_OABI_SYSCALL_BASE
+#endif
+
+#define __NR_restart_syscall (__NR_SYSCALL_BASE+ 0)
+#define __NR_exit (__NR_SYSCALL_BASE+ 1)
+#define __NR_fork (__NR_SYSCALL_BASE+ 2)
+#define __NR_read (__NR_SYSCALL_BASE+ 3)
+#define __NR_write (__NR_SYSCALL_BASE+ 4)
+#define __NR_open (__NR_SYSCALL_BASE+ 5)
+#define __NR_close (__NR_SYSCALL_BASE+ 6)
+
+#define __NR_creat (__NR_SYSCALL_BASE+ 8)
+#define __NR_link (__NR_SYSCALL_BASE+ 9)
+#define __NR_unlink (__NR_SYSCALL_BASE+ 10)
+#define __NR_execve (__NR_SYSCALL_BASE+ 11)
+#define __NR_chdir (__NR_SYSCALL_BASE+ 12)
+#define __NR_time (__NR_SYSCALL_BASE+ 13)
+#define __NR_mknod (__NR_SYSCALL_BASE+ 14)
+#define __NR_chmod (__NR_SYSCALL_BASE+ 15)
+#define __NR_lchown (__NR_SYSCALL_BASE+ 16)
+
+#define __NR_lseek (__NR_SYSCALL_BASE+ 19)
+#define __NR_getpid (__NR_SYSCALL_BASE+ 20)
+#define __NR_mount (__NR_SYSCALL_BASE+ 21)
+#define __NR_umount (__NR_SYSCALL_BASE+ 22)
+#define __NR_setuid (__NR_SYSCALL_BASE+ 23)
+#define __NR_getuid (__NR_SYSCALL_BASE+ 24)
+#define __NR_stime (__NR_SYSCALL_BASE+ 25)
+#define __NR_ptrace (__NR_SYSCALL_BASE+ 26)
+#define __NR_alarm (__NR_SYSCALL_BASE+ 27)
+
+#define __NR_pause (__NR_SYSCALL_BASE+ 29)
+#define __NR_utime (__NR_SYSCALL_BASE+ 30)
+
+#define __NR_access (__NR_SYSCALL_BASE+ 33)
+#define __NR_nice (__NR_SYSCALL_BASE+ 34)
+
+#define __NR_sync (__NR_SYSCALL_BASE+ 36)
+#define __NR_kill (__NR_SYSCALL_BASE+ 37)
+#define __NR_rename (__NR_SYSCALL_BASE+ 38)
+#define __NR_mkdir (__NR_SYSCALL_BASE+ 39)
+#define __NR_rmdir (__NR_SYSCALL_BASE+ 40)
+#define __NR_dup (__NR_SYSCALL_BASE+ 41)
+#define __NR_pipe (__NR_SYSCALL_BASE+ 42)
+#define __NR_times (__NR_SYSCALL_BASE+ 43)
+
+#define __NR_brk (__NR_SYSCALL_BASE+ 45)
+#define __NR_setgid (__NR_SYSCALL_BASE+ 46)
+#define __NR_getgid (__NR_SYSCALL_BASE+ 47)
+
+#define __NR_geteuid (__NR_SYSCALL_BASE+ 49)
+#define __NR_getegid (__NR_SYSCALL_BASE+ 50)
+#define __NR_acct (__NR_SYSCALL_BASE+ 51)
+#define __NR_umount2 (__NR_SYSCALL_BASE+ 52)
+
+#define __NR_ioctl (__NR_SYSCALL_BASE+ 54)
+#define __NR_fcntl (__NR_SYSCALL_BASE+ 55)
+
+#define __NR_setpgid (__NR_SYSCALL_BASE+ 57)
+
+#define __NR_umask (__NR_SYSCALL_BASE+ 60)
+#define __NR_chroot (__NR_SYSCALL_BASE+ 61)
+#define __NR_ustat (__NR_SYSCALL_BASE+ 62)
+#define __NR_dup2 (__NR_SYSCALL_BASE+ 63)
+#define __NR_getppid (__NR_SYSCALL_BASE+ 64)
+#define __NR_getpgrp (__NR_SYSCALL_BASE+ 65)
+#define __NR_setsid (__NR_SYSCALL_BASE+ 66)
+#define __NR_sigaction (__NR_SYSCALL_BASE+ 67)
+
+#define __NR_setreuid (__NR_SYSCALL_BASE+ 70)
+#define __NR_setregid (__NR_SYSCALL_BASE+ 71)
+#define __NR_sigsuspend (__NR_SYSCALL_BASE+ 72)
+#define __NR_sigpending (__NR_SYSCALL_BASE+ 73)
+#define __NR_sethostname (__NR_SYSCALL_BASE+ 74)
+#define __NR_setrlimit (__NR_SYSCALL_BASE+ 75)
+#define __NR_getrlimit (__NR_SYSCALL_BASE+ 76)  
+#define __NR_getrusage (__NR_SYSCALL_BASE+ 77)
+#define __NR_gettimeofday (__NR_SYSCALL_BASE+ 78)
+#define __NR_settimeofday (__NR_SYSCALL_BASE+ 79)
+#define __NR_getgroups (__NR_SYSCALL_BASE+ 80)
+#define __NR_setgroups (__NR_SYSCALL_BASE+ 81)
+#define __NR_select (__NR_SYSCALL_BASE+ 82)
+#define __NR_symlink (__NR_SYSCALL_BASE+ 83)
+
+#define __NR_readlink (__NR_SYSCALL_BASE+ 85)
+#define __NR_uselib (__NR_SYSCALL_BASE+ 86)
+#define __NR_swapon (__NR_SYSCALL_BASE+ 87)
+#define __NR_reboot (__NR_SYSCALL_BASE+ 88)
+#define __NR_readdir (__NR_SYSCALL_BASE+ 89)
+#define __NR_mmap (__NR_SYSCALL_BASE+ 90)
+#define __NR_munmap (__NR_SYSCALL_BASE+ 91)
+#define __NR_truncate (__NR_SYSCALL_BASE+ 92)
+#define __NR_ftruncate (__NR_SYSCALL_BASE+ 93)
+#define __NR_fchmod (__NR_SYSCALL_BASE+ 94)
+#define __NR_fchown (__NR_SYSCALL_BASE+ 95)
+#define __NR_getpriority (__NR_SYSCALL_BASE+ 96)
+#define __NR_setpriority (__NR_SYSCALL_BASE+ 97)
+
+#define __NR_statfs (__NR_SYSCALL_BASE+ 99)
+#define __NR_fstatfs (__NR_SYSCALL_BASE+100)
+
+#define __NR_socketcall (__NR_SYSCALL_BASE+102)
+#define __NR_syslog (__NR_SYSCALL_BASE+103)
+#define __NR_setitimer (__NR_SYSCALL_BASE+104)
+#define __NR_getitimer (__NR_SYSCALL_BASE+105)
+#define __NR_stat (__NR_SYSCALL_BASE+106)
+#define __NR_lstat (__NR_SYSCALL_BASE+107)
+#define __NR_fstat (__NR_SYSCALL_BASE+108)
+
+#define __NR_vhangup (__NR_SYSCALL_BASE+111)
+
+#define __NR_syscall (__NR_SYSCALL_BASE+113)  
+#define __NR_wait4 (__NR_SYSCALL_BASE+114)
+#define __NR_swapoff (__NR_SYSCALL_BASE+115)
+#define __NR_sysinfo (__NR_SYSCALL_BASE+116)
+#define __NR_ipc (__NR_SYSCALL_BASE+117)
+#define __NR_fsync (__NR_SYSCALL_BASE+118)
+#define __NR_sigreturn (__NR_SYSCALL_BASE+119)
+#define __NR_clone (__NR_SYSCALL_BASE+120)
+#define __NR_setdomainname (__NR_SYSCALL_BASE+121)
+#define __NR_uname (__NR_SYSCALL_BASE+122)
+
+#define __NR_adjtimex (__NR_SYSCALL_BASE+124)
+#define __NR_mprotect (__NR_SYSCALL_BASE+125)
+#define __NR_sigprocmask (__NR_SYSCALL_BASE+126)
+
+#define __NR_init_module (__NR_SYSCALL_BASE+128)
+#define __NR_delete_module (__NR_SYSCALL_BASE+129)
+
+#define __NR_quotactl (__NR_SYSCALL_BASE+131)
+#define __NR_getpgid (__NR_SYSCALL_BASE+132)
+#define __NR_fchdir (__NR_SYSCALL_BASE+133)
+#define __NR_bdflush (__NR_SYSCALL_BASE+134)
+#define __NR_sysfs (__NR_SYSCALL_BASE+135)
+#define __NR_personality (__NR_SYSCALL_BASE+136)
+
+#define __NR_setfsuid (__NR_SYSCALL_BASE+138)
+#define __NR_setfsgid (__NR_SYSCALL_BASE+139)
+#define __NR__llseek (__NR_SYSCALL_BASE+140)
+#define __NR_getdents (__NR_SYSCALL_BASE+141)
+#define __NR__newselect (__NR_SYSCALL_BASE+142)
+#define __NR_flock (__NR_SYSCALL_BASE+143)
+#define __NR_msync (__NR_SYSCALL_BASE+144)
+#define __NR_readv (__NR_SYSCALL_BASE+145)
+#define __NR_writev (__NR_SYSCALL_BASE+146)
+#define __NR_getsid (__NR_SYSCALL_BASE+147)
+#define __NR_fdatasync (__NR_SYSCALL_BASE+148)
+#define __NR__sysctl (__NR_SYSCALL_BASE+149)
+#define __NR_mlock (__NR_SYSCALL_BASE+150)
+#define __NR_munlock (__NR_SYSCALL_BASE+151)
+#define __NR_mlockall (__NR_SYSCALL_BASE+152)
+#define __NR_munlockall (__NR_SYSCALL_BASE+153)
+#define __NR_sched_setparam (__NR_SYSCALL_BASE+154)
+#define __NR_sched_getparam (__NR_SYSCALL_BASE+155)
+#define __NR_sched_setscheduler (__NR_SYSCALL_BASE+156)
+#define __NR_sched_getscheduler (__NR_SYSCALL_BASE+157)
+#define __NR_sched_yield (__NR_SYSCALL_BASE+158)
+#define __NR_sched_get_priority_max (__NR_SYSCALL_BASE+159)
+#define __NR_sched_get_priority_min (__NR_SYSCALL_BASE+160)
+#define __NR_sched_rr_get_interval (__NR_SYSCALL_BASE+161)
+#define __NR_nanosleep (__NR_SYSCALL_BASE+162)
+#define __NR_mremap (__NR_SYSCALL_BASE+163)
+#define __NR_setresuid (__NR_SYSCALL_BASE+164)
+#define __NR_getresuid (__NR_SYSCALL_BASE+165)
+
+#define __NR_poll (__NR_SYSCALL_BASE+168)
+#define __NR_nfsservctl (__NR_SYSCALL_BASE+169)
+#define __NR_setresgid (__NR_SYSCALL_BASE+170)
+#define __NR_getresgid (__NR_SYSCALL_BASE+171)
+#define __NR_prctl (__NR_SYSCALL_BASE+172)
+#define __NR_rt_sigreturn (__NR_SYSCALL_BASE+173)
+#define __NR_rt_sigaction (__NR_SYSCALL_BASE+174)
+#define __NR_rt_sigprocmask (__NR_SYSCALL_BASE+175)
+#define __NR_rt_sigpending (__NR_SYSCALL_BASE+176)
+#define __NR_rt_sigtimedwait (__NR_SYSCALL_BASE+177)
+#define __NR_rt_sigqueueinfo (__NR_SYSCALL_BASE+178)
+#define __NR_rt_sigsuspend (__NR_SYSCALL_BASE+179)
+#define __NR_pread64 (__NR_SYSCALL_BASE+180)
+#define __NR_pwrite64 (__NR_SYSCALL_BASE+181)
+#define __NR_chown (__NR_SYSCALL_BASE+182)
+#define __NR_getcwd (__NR_SYSCALL_BASE+183)
+#define __NR_capget (__NR_SYSCALL_BASE+184)
+#define __NR_capset (__NR_SYSCALL_BASE+185)
+#define __NR_sigaltstack (__NR_SYSCALL_BASE+186)
+#define __NR_sendfile (__NR_SYSCALL_BASE+187)
+
+#define __NR_vfork (__NR_SYSCALL_BASE+190)
+#define __NR_ugetrlimit (__NR_SYSCALL_BASE+191)  
+#define __NR_mmap2 (__NR_SYSCALL_BASE+192)
+#define __NR_truncate64 (__NR_SYSCALL_BASE+193)
+#define __NR_ftruncate64 (__NR_SYSCALL_BASE+194)
+#define __NR_stat64 (__NR_SYSCALL_BASE+195)
+#define __NR_lstat64 (__NR_SYSCALL_BASE+196)
+#define __NR_fstat64 (__NR_SYSCALL_BASE+197)
+#define __NR_lchown32 (__NR_SYSCALL_BASE+198)
+#define __NR_getuid32 (__NR_SYSCALL_BASE+199)
+#define __NR_getgid32 (__NR_SYSCALL_BASE+200)
+#define __NR_geteuid32 (__NR_SYSCALL_BASE+201)
+#define __NR_getegid32 (__NR_SYSCALL_BASE+202)
+#define __NR_setreuid32 (__NR_SYSCALL_BASE+203)
+#define __NR_setregid32 (__NR_SYSCALL_BASE+204)
+#define __NR_getgroups32 (__NR_SYSCALL_BASE+205)
+#define __NR_setgroups32 (__NR_SYSCALL_BASE+206)
+#define __NR_fchown32 (__NR_SYSCALL_BASE+207)
+#define __NR_setresuid32 (__NR_SYSCALL_BASE+208)
+#define __NR_getresuid32 (__NR_SYSCALL_BASE+209)
+#define __NR_setresgid32 (__NR_SYSCALL_BASE+210)
+#define __NR_getresgid32 (__NR_SYSCALL_BASE+211)
+#define __NR_chown32 (__NR_SYSCALL_BASE+212)
+#define __NR_setuid32 (__NR_SYSCALL_BASE+213)
+#define __NR_setgid32 (__NR_SYSCALL_BASE+214)
+#define __NR_setfsuid32 (__NR_SYSCALL_BASE+215)
+#define __NR_setfsgid32 (__NR_SYSCALL_BASE+216)
+#define __NR_getdents64 (__NR_SYSCALL_BASE+217)
+#define __NR_pivot_root (__NR_SYSCALL_BASE+218)
+#define __NR_mincore (__NR_SYSCALL_BASE+219)
+#define __NR_madvise (__NR_SYSCALL_BASE+220)
+#define __NR_fcntl64 (__NR_SYSCALL_BASE+221)
+
+#define __NR_gettid (__NR_SYSCALL_BASE+224)
+#define __NR_readahead (__NR_SYSCALL_BASE+225)
+#define __NR_setxattr (__NR_SYSCALL_BASE+226)
+#define __NR_lsetxattr (__NR_SYSCALL_BASE+227)
+#define __NR_fsetxattr (__NR_SYSCALL_BASE+228)
+#define __NR_getxattr (__NR_SYSCALL_BASE+229)
+#define __NR_lgetxattr (__NR_SYSCALL_BASE+230)
+#define __NR_fgetxattr (__NR_SYSCALL_BASE+231)
+#define __NR_listxattr (__NR_SYSCALL_BASE+232)
+#define __NR_llistxattr (__NR_SYSCALL_BASE+233)
+#define __NR_flistxattr (__NR_SYSCALL_BASE+234)
+#define __NR_removexattr (__NR_SYSCALL_BASE+235)
+#define __NR_lremovexattr (__NR_SYSCALL_BASE+236)
+#define __NR_fremovexattr (__NR_SYSCALL_BASE+237)
+#define __NR_tkill (__NR_SYSCALL_BASE+238)
+#define __NR_sendfile64 (__NR_SYSCALL_BASE+239)
+#define __NR_futex (__NR_SYSCALL_BASE+240)
+#define __NR_sched_setaffinity (__NR_SYSCALL_BASE+241)
+#define __NR_sched_getaffinity (__NR_SYSCALL_BASE+242)
+#define __NR_io_setup (__NR_SYSCALL_BASE+243)
+#define __NR_io_destroy (__NR_SYSCALL_BASE+244)
+#define __NR_io_getevents (__NR_SYSCALL_BASE+245)
+#define __NR_io_submit (__NR_SYSCALL_BASE+246)
+#define __NR_io_cancel (__NR_SYSCALL_BASE+247)
+#define __NR_exit_group (__NR_SYSCALL_BASE+248)
+#define __NR_lookup_dcookie (__NR_SYSCALL_BASE+249)
+#define __NR_epoll_create (__NR_SYSCALL_BASE+250)
+#define __NR_epoll_ctl (__NR_SYSCALL_BASE+251)
+#define __NR_epoll_wait (__NR_SYSCALL_BASE+252)
+#define __NR_remap_file_pages (__NR_SYSCALL_BASE+253)
+
+#define __NR_set_tid_address (__NR_SYSCALL_BASE+256)
+#define __NR_timer_create (__NR_SYSCALL_BASE+257)
+#define __NR_timer_settime (__NR_SYSCALL_BASE+258)
+#define __NR_timer_gettime (__NR_SYSCALL_BASE+259)
+#define __NR_timer_getoverrun (__NR_SYSCALL_BASE+260)
+#define __NR_timer_delete (__NR_SYSCALL_BASE+261)
+#define __NR_clock_settime (__NR_SYSCALL_BASE+262)
+#define __NR_clock_gettime (__NR_SYSCALL_BASE+263)
+#define __NR_clock_getres (__NR_SYSCALL_BASE+264)
+#define __NR_clock_nanosleep (__NR_SYSCALL_BASE+265)
+#define __NR_statfs64 (__NR_SYSCALL_BASE+266)
+#define __NR_fstatfs64 (__NR_SYSCALL_BASE+267)
+#define __NR_tgkill (__NR_SYSCALL_BASE+268)
+#define __NR_utimes (__NR_SYSCALL_BASE+269)
+#define __NR_arm_fadvise64_64 (__NR_SYSCALL_BASE+270)
+#define __NR_pciconfig_iobase (__NR_SYSCALL_BASE+271)
+#define __NR_pciconfig_read (__NR_SYSCALL_BASE+272)
+#define __NR_pciconfig_write (__NR_SYSCALL_BASE+273)
+#define __NR_mq_open (__NR_SYSCALL_BASE+274)
+#define __NR_mq_unlink (__NR_SYSCALL_BASE+275)
+#define __NR_mq_timedsend (__NR_SYSCALL_BASE+276)
+#define __NR_mq_timedreceive (__NR_SYSCALL_BASE+277)
+#define __NR_mq_notify (__NR_SYSCALL_BASE+278)
+#define __NR_mq_getsetattr (__NR_SYSCALL_BASE+279)
+#define __NR_waitid (__NR_SYSCALL_BASE+280)
+#define __NR_socket (__NR_SYSCALL_BASE+281)
+#define __NR_bind (__NR_SYSCALL_BASE+282)
+#define __NR_connect (__NR_SYSCALL_BASE+283)
+#define __NR_listen (__NR_SYSCALL_BASE+284)
+#define __NR_accept (__NR_SYSCALL_BASE+285)
+#define __NR_getsockname (__NR_SYSCALL_BASE+286)
+#define __NR_getpeername (__NR_SYSCALL_BASE+287)
+#define __NR_socketpair (__NR_SYSCALL_BASE+288)
+#define __NR_send (__NR_SYSCALL_BASE+289)
+#define __NR_sendto (__NR_SYSCALL_BASE+290)
+#define __NR_recv (__NR_SYSCALL_BASE+291)
+#define __NR_recvfrom (__NR_SYSCALL_BASE+292)
+#define __NR_shutdown (__NR_SYSCALL_BASE+293)
+#define __NR_setsockopt (__NR_SYSCALL_BASE+294)
+#define __NR_getsockopt (__NR_SYSCALL_BASE+295)
+#define __NR_sendmsg (__NR_SYSCALL_BASE+296)
+#define __NR_recvmsg (__NR_SYSCALL_BASE+297)
+#define __NR_semop (__NR_SYSCALL_BASE+298)
+#define __NR_semget (__NR_SYSCALL_BASE+299)
+#define __NR_semctl (__NR_SYSCALL_BASE+300)
+#define __NR_msgsnd (__NR_SYSCALL_BASE+301)
+#define __NR_msgrcv (__NR_SYSCALL_BASE+302)
+#define __NR_msgget (__NR_SYSCALL_BASE+303)
+#define __NR_msgctl (__NR_SYSCALL_BASE+304)
+#define __NR_shmat (__NR_SYSCALL_BASE+305)
+#define __NR_shmdt (__NR_SYSCALL_BASE+306)
+#define __NR_shmget (__NR_SYSCALL_BASE+307)
+#define __NR_shmctl (__NR_SYSCALL_BASE+308)
+#define __NR_add_key (__NR_SYSCALL_BASE+309)
+#define __NR_request_key (__NR_SYSCALL_BASE+310)
+#define __NR_keyctl (__NR_SYSCALL_BASE+311)
+#define __NR_semtimedop (__NR_SYSCALL_BASE+312)
+#define __NR_vserver (__NR_SYSCALL_BASE+313)
+#define __NR_ioprio_set (__NR_SYSCALL_BASE+314)
+#define __NR_ioprio_get (__NR_SYSCALL_BASE+315)
+#define __NR_inotify_init (__NR_SYSCALL_BASE+316)
+#define __NR_inotify_add_watch (__NR_SYSCALL_BASE+317)
+#define __NR_inotify_rm_watch (__NR_SYSCALL_BASE+318)
+#define __NR_mbind (__NR_SYSCALL_BASE+319)
+#define __NR_get_mempolicy (__NR_SYSCALL_BASE+320)
+#define __NR_set_mempolicy (__NR_SYSCALL_BASE+321)
+
+#define __ARM_NR_BASE (__NR_SYSCALL_BASE+0x0f0000)
+#define __ARM_NR_breakpoint (__ARM_NR_BASE+1)
+#define __ARM_NR_cacheflush (__ARM_NR_BASE+2)
+#define __ARM_NR_usr26 (__ARM_NR_BASE+3)
+#define __ARM_NR_usr32 (__ARM_NR_BASE+4)
+#define __ARM_NR_set_tls (__ARM_NR_BASE+5)
+
+#if defined(__ARM_EABI__) && !defined(__KERNEL__)
+#undef __NR_time
+#undef __NR_umount
+#undef __NR_stime
+#undef __NR_alarm
+#undef __NR_utime
+#undef __NR_getrlimit
+#undef __NR_select
+#undef __NR_readdir
+#undef __NR_mmap
+#undef __NR_socketcall
+#undef __NR_syscall
+#undef __NR_ipc
+#endif
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/user.h b/ndk/platforms/android-3/arch-arm/include/asm/user.h
new file mode 100644
index 0000000..5f25850
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/user.h
@@ -0,0 +1,61 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ARM_USER_H
+#define _ARM_USER_H
+
+#include <asm/page.h>
+#include <asm/ptrace.h>
+
+struct user_fp {
+ struct fp_reg {
+ unsigned int sign1:1;
+ unsigned int unused:15;
+ unsigned int sign2:1;
+ unsigned int exponent:14;
+ unsigned int j:1;
+ unsigned int mantissa1:31;
+ unsigned int mantissa0:32;
+ } fpregs[8];
+ unsigned int fpsr:32;
+ unsigned int fpcr:32;
+ unsigned char ftype[8];
+ unsigned int init_flag;
+};
+
+struct user{
+
+ struct pt_regs regs;
+
+ int u_fpvalid;
+
+ unsigned long int u_tsize;
+ unsigned long int u_dsize;
+ unsigned long int u_ssize;
+ unsigned long start_code;
+ unsigned long start_stack;
+ long int signal;
+ int reserved;
+ struct pt_regs * u_ar0;
+
+ unsigned long magic;
+ char u_comm[32];
+ int u_debugreg[8];
+ struct user_fp u_fp;
+ struct user_fp_struct * u_fp0;
+
+};
+#define NBPG PAGE_SIZE
+#define UPAGES 1
+#define HOST_TEXT_START_ADDR (u.start_code)
+#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG)
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/asm/vga.h b/ndk/platforms/android-3/arch-arm/include/asm/vga.h
new file mode 100644
index 0000000..7875dbf
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/asm/vga.h
@@ -0,0 +1,23 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef ASMARM_VGA_H
+#define ASMARM_VGA_H
+
+#include <asm/hardware.h>
+#include <asm/io.h>
+
+#define VGA_MAP_MEM(x,s) (PCIMEM_BASE + (x))
+
+#define vga_readb(x) (*((volatile unsigned char *)x))
+#define vga_writeb(x,y) (*((volatile unsigned char *)y) = (x))
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/fenv.h b/ndk/platforms/android-3/arch-arm/include/fenv.h
new file mode 100644
index 0000000..e7a8860
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/fenv.h
@@ -0,0 +1,217 @@
+/*-
+ * Copyright (c) 2004-2005 David Schultz <das@FreeBSD.ORG>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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.
+ *
+ * $FreeBSD: src/lib/msun/arm/fenv.h,v 1.5 2005/03/16 19:03:45 das Exp $
+ */
+
+#ifndef	_FENV_H_
+#define	_FENV_H_
+
+#include <sys/_types.h>
+
+typedef	__uint32_t	fenv_t;
+typedef	__uint32_t	fexcept_t;
+
+/* Exception flags */
+#define	FE_INVALID	0x0001
+#define	FE_DIVBYZERO	0x0002
+#define	FE_OVERFLOW	0x0004
+#define	FE_UNDERFLOW	0x0008
+#define	FE_INEXACT	0x0010
+#define	FE_ALL_EXCEPT	(FE_DIVBYZERO | FE_INEXACT | \
+			 FE_INVALID | FE_OVERFLOW | FE_UNDERFLOW)
+
+/* Rounding modes */
+#define	FE_TONEAREST	0x0000
+#define	FE_TOWARDZERO	0x0001
+#define	FE_UPWARD	0x0002
+#define	FE_DOWNWARD	0x0003
+#define	_ROUND_MASK	(FE_TONEAREST | FE_DOWNWARD | \
+			 FE_UPWARD | FE_TOWARDZERO)
+__BEGIN_DECLS
+
+/* Default floating-point environment */
+extern const fenv_t	__fe_dfl_env;
+#define	FE_DFL_ENV	(&__fe_dfl_env)
+
+/* We need to be able to map status flag positions to mask flag positions */
+#define _FPUSW_SHIFT	16
+#define	_ENABLE_MASK	(FE_ALL_EXCEPT << _FPUSW_SHIFT)
+
+#ifdef	ARM_HARD_FLOAT
+#define	__rfs(__fpsr)	__asm __volatile("rfs %0" : "=r" (*(__fpsr)))
+#define	__wfs(__fpsr)	__asm __volatile("wfs %0" : : "r" (__fpsr))
+#else
+#define __rfs(__fpsr)
+#define __wfs(__fpsr)
+#endif
+
+static __inline int
+feclearexcept(int __excepts)
+{
+	fexcept_t __fpsr;
+
+	__rfs(&__fpsr);
+	__fpsr &= ~__excepts;
+	__wfs(__fpsr);
+	return (0);
+}
+
+static __inline int
+fegetexceptflag(fexcept_t *__flagp, int __excepts)
+{
+	fexcept_t __fpsr;
+
+	__rfs(&__fpsr);
+	*__flagp = __fpsr & __excepts;
+	return (0);
+}
+
+static __inline int
+fesetexceptflag(const fexcept_t *__flagp, int __excepts)
+{
+	fexcept_t __fpsr;
+
+	__rfs(&__fpsr);
+	__fpsr &= ~__excepts;
+	__fpsr |= *__flagp & __excepts;
+	__wfs(__fpsr);
+	return (0);
+}
+
+static __inline int
+feraiseexcept(int __excepts)
+{
+	fexcept_t __ex = __excepts;
+
+	fesetexceptflag(&__ex, __excepts);	/* XXX */
+	return (0);
+}
+
+static __inline int
+fetestexcept(int __excepts)
+{
+	fexcept_t __fpsr;
+
+	__rfs(&__fpsr);
+	return (__fpsr & __excepts);
+}
+
+static __inline int
+fegetround(void)
+{
+
+	/*
+	 * Apparently, the rounding mode is specified as part of the
+	 * instruction format on ARM, so the dynamic rounding mode is
+	 * indeterminate.  Some FPUs may differ.
+	 */
+	return (-1);
+}
+
+static __inline int
+fesetround(int __round)
+{
+
+	return (-1);
+}
+
+static __inline int
+fegetenv(fenv_t *__envp)
+{
+
+	__rfs(__envp);
+	return (0);
+}
+
+static __inline int
+feholdexcept(fenv_t *__envp)
+{
+	fenv_t __env;
+
+	__rfs(&__env);
+	*__envp = __env;
+	__env &= ~(FE_ALL_EXCEPT | _ENABLE_MASK);
+	__wfs(__env);
+	return (0);
+}
+
+static __inline int
+fesetenv(const fenv_t *__envp)
+{
+
+	__wfs(*__envp);
+	return (0);
+}
+
+static __inline int
+feupdateenv(const fenv_t *__envp)
+{
+	fexcept_t __fpsr;
+
+	__rfs(&__fpsr);
+	__wfs(*__envp);
+	feraiseexcept(__fpsr & FE_ALL_EXCEPT);
+	return (0);
+}
+
+#if __BSD_VISIBLE
+
+static __inline int
+feenableexcept(int __mask)
+{
+	fenv_t __old_fpsr, __new_fpsr;
+
+	__rfs(&__old_fpsr);
+	__new_fpsr = __old_fpsr | (__mask & FE_ALL_EXCEPT) << _FPUSW_SHIFT;
+	__wfs(__new_fpsr);
+	return ((__old_fpsr >> _FPUSW_SHIFT) & FE_ALL_EXCEPT);
+}
+
+static __inline int
+fedisableexcept(int __mask)
+{
+	fenv_t __old_fpsr, __new_fpsr;
+
+	__rfs(&__old_fpsr);
+	__new_fpsr = __old_fpsr & ~((__mask & FE_ALL_EXCEPT) << _FPUSW_SHIFT);
+	__wfs(__new_fpsr);
+	return ((__old_fpsr >> _FPUSW_SHIFT) & FE_ALL_EXCEPT);
+}
+
+static __inline int
+fegetexcept(void)
+{
+	fenv_t __fpsr;
+
+	__rfs(&__fpsr);
+	return ((__fpsr & _ENABLE_MASK) >> _FPUSW_SHIFT);
+}
+
+#endif /* __BSD_VISIBLE */
+
+__END_DECLS
+
+#endif	/* !_FENV_H_ */
diff --git a/ndk/platforms/android-3/arch-arm/include/machine/_types.h b/ndk/platforms/android-3/arch-arm/include/machine/_types.h
new file mode 100644
index 0000000..6d10e12
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/machine/_types.h
@@ -0,0 +1,127 @@
+/*	$OpenBSD: _types.h,v 1.3 2006/02/14 18:12:58 miod Exp $	*/
+
+/*-
+ * Copyright (c) 1990, 1993
+ *	The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ * 3. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
+ *
+ *	@(#)types.h	8.3 (Berkeley) 1/5/94
+ *	@(#)ansi.h	8.2 (Berkeley) 1/4/94
+ */
+
+#ifndef _ARM__TYPES_H_
+#define _ARM__TYPES_H_
+
+
+#if !defined(__ARM_EABI__)
+/* the kernel defines size_t as unsigned int, but g++ wants it to be unsigned long */
+#define _SIZE_T
+#define _SSIZE_T
+#define _PTRDIFF_T
+typedef unsigned long  size_t;
+typedef long           ssize_t;
+typedef long           ptrdiff_t;
+#endif
+
+//#include <linux/types.h>
+
+/* 7.18.1.1 Exact-width integer types */
+typedef	__signed char		__int8_t;
+typedef	unsigned char		__uint8_t;
+typedef	short			__int16_t;
+typedef	unsigned short		__uint16_t;
+typedef	int			__int32_t;
+typedef	unsigned int		__uint32_t;
+/* LONGLONG */
+typedef	long long		__int64_t;
+/* LONGLONG */
+typedef	unsigned long long	__uint64_t;
+
+/* 7.18.1.2 Minimum-width integer types */
+typedef	__int8_t		__int_least8_t;
+typedef	__uint8_t		__uint_least8_t;
+typedef	__int16_t		__int_least16_t;
+typedef	__uint16_t		__uint_least16_t;
+typedef	__int32_t		__int_least32_t;
+typedef	__uint32_t		__uint_least32_t;
+typedef	__int64_t		__int_least64_t;
+typedef	__uint64_t		__uint_least64_t;
+
+/* 7.18.1.3 Fastest minimum-width integer types */
+typedef	__int32_t		__int_fast8_t;
+typedef	__uint32_t		__uint_fast8_t;
+typedef	__int32_t		__int_fast16_t;
+typedef	__uint32_t		__uint_fast16_t;
+typedef	__int32_t		__int_fast32_t;
+typedef	__uint32_t		__uint_fast32_t;
+typedef	__int64_t		__int_fast64_t;
+typedef	__uint64_t		__uint_fast64_t;
+
+/* 7.18.1.4 Integer types capable of holding object pointers */
+typedef	int 			__intptr_t;
+typedef	unsigned int 		__uintptr_t;
+
+/* 7.18.1.5 Greatest-width integer types */
+typedef	__int64_t		__intmax_t;
+typedef	__uint64_t		__uintmax_t;
+
+/* Register size */
+typedef __int32_t		__register_t;
+
+/* VM system types */
+typedef unsigned long		__vaddr_t;
+typedef unsigned long		__paddr_t;
+typedef unsigned long		__vsize_t;
+typedef unsigned long		__psize_t;
+
+/* Standard system types */
+typedef int			__clock_t;
+typedef int			__clockid_t;
+typedef long			__ptrdiff_t;
+typedef	int			__time_t;
+typedef int			__timer_t;
+#if defined(__GNUC__) && __GNUC__ >= 3
+typedef	__builtin_va_list	__va_list;
+#else
+typedef	char *			__va_list;
+#endif
+
+/* Wide character support types */
+#ifndef __cplusplus
+typedef	int			__wchar_t;
+#endif
+typedef int			__wint_t;
+typedef	int			__rune_t;
+typedef	void *			__wctrans_t;
+typedef	void *			__wctype_t;
+
+#ifdef __ARMEB__
+#define _BYTE_ORDER _BIG_ENDIAN
+#else
+#define _BYTE_ORDER _LITTLE_ENDIAN
+#endif
+
+#endif	/* _ARM__TYPES_H_ */
diff --git a/ndk/platforms/android-3/arch-arm/include/machine/asm.h b/ndk/platforms/android-3/arch-arm/include/machine/asm.h
new file mode 100644
index 0000000..c7bd017
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/machine/asm.h
@@ -0,0 +1,130 @@
+/*	$OpenBSD: asm.h,v 1.1 2004/02/01 05:09:49 drahn Exp $	*/
+/*	$NetBSD: asm.h,v 1.4 2001/07/16 05:43:32 matt Exp $	*/
+
+/*
+ * Copyright (c) 1990 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * William Jolitz.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ * 3. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
+ *
+ *	from: @(#)asm.h	5.5 (Berkeley) 5/7/91
+ */
+
+#ifndef _ARM32_ASM_H_
+#define _ARM32_ASM_H_
+
+#ifdef __ELF__
+# define _C_LABEL(x)	x
+#else
+# ifdef __STDC__
+#  define _C_LABEL(x)	_ ## x
+# else
+#  define _C_LABEL(x)	_/**/x
+# endif
+#endif
+#define	_ASM_LABEL(x)	x
+
+#ifdef __STDC__
+# define __CONCAT(x,y)	x ## y
+# define __STRING(x)	#x
+#else
+# define __CONCAT(x,y)	x/**/y
+# define __STRING(x)	"x"
+#endif
+
+#ifndef _ALIGN_TEXT
+# define _ALIGN_TEXT .align 0
+#endif
+
+/*
+ * gas/arm uses @ as a single comment character and thus cannot be used here
+ * Instead it recognised the # instead of an @ symbols in .type directives
+ * We define a couple of macros so that assembly code will not be dependant
+ * on one or the other.
+ */
+#define _ASM_TYPE_FUNCTION	#function
+#define _ASM_TYPE_OBJECT	#object
+#define _ENTRY(x) \
+	.text; _ALIGN_TEXT; .globl x; .type x,_ASM_TYPE_FUNCTION; x:
+
+#ifdef GPROF
+# ifdef __ELF__
+#  define _PROF_PROLOGUE	\
+	mov ip, lr; bl __mcount
+# else
+#  define _PROF_PROLOGUE	\
+	mov ip,lr; bl mcount
+# endif
+#else
+# define _PROF_PROLOGUE
+#endif
+
+#define	ENTRY(y)	_ENTRY(_C_LABEL(y)); _PROF_PROLOGUE
+#define	ENTRY_NP(y)	_ENTRY(_C_LABEL(y))
+#define	ASENTRY(y)	_ENTRY(_ASM_LABEL(y)); _PROF_PROLOGUE
+#define	ASENTRY_NP(y)	_ENTRY(_ASM_LABEL(y))
+
+#define	ASMSTR		.asciz
+
+#if defined(__ELF__) && defined(PIC)
+#ifdef __STDC__
+#define	PIC_SYM(x,y)	x ## ( ## y ## )
+#else
+#define	PIC_SYM(x,y)	x/**/(/**/y/**/)
+#endif
+#else
+#define	PIC_SYM(x,y)	x
+#endif
+
+#ifdef __ELF__
+#define RCSID(x)	.section ".ident"; .asciz x
+#else
+#define RCSID(x)	.text; .asciz x
+#endif
+
+#ifdef __ELF__
+#define	WEAK_ALIAS(alias,sym)						\
+	.weak alias;							\
+	alias = sym
+#endif
+
+#ifdef __STDC__
+#define	WARN_REFERENCES(sym,msg)					\
+	.stabs msg ## ,30,0,0,0 ;					\
+	.stabs __STRING(_C_LABEL(sym)) ## ,1,0,0,0
+#elif defined(__ELF__)
+#define	WARN_REFERENCES(sym,msg)					\
+	.stabs msg,30,0,0,0 ;						\
+	.stabs __STRING(sym),1,0,0,0
+#else
+#define	WARN_REFERENCES(sym,msg)					\
+	.stabs msg,30,0,0,0 ;						\
+	.stabs __STRING(_/**/sym),1,0,0,0
+#endif /* __STDC__ */
+
+#endif /* !_ARM_ASM_H_ */
diff --git a/ndk/platforms/android-3/arch-arm/include/machine/cdefs.h b/ndk/platforms/android-3/arch-arm/include/machine/cdefs.h
new file mode 100644
index 0000000..44f1542
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/machine/cdefs.h
@@ -0,0 +1,19 @@
+/*	$OpenBSD: cdefs.h,v 1.2 2005/11/24 20:46:44 deraadt Exp $	*/
+
+#ifndef	_MACHINE_CDEFS_H_
+#define	_MACHINE_CDEFS_H_
+
+#if defined(lint)
+#define __indr_reference(sym,alias)	__lint_equal__(sym,alias)
+#define __warn_references(sym,msg)
+#define __weak_alias(alias,sym)		__lint_equal__(sym,alias)
+#elif defined(__GNUC__) && defined(__STDC__)
+#define __weak_alias(alias,sym)					\
+	__asm__(".weak " __STRING(alias) " ; " __STRING(alias)	\
+	    " = " __STRING(sym));
+#define	__warn_references(sym,msg)				\
+	__asm__(".section .gnu.warning." __STRING(sym)		\
+	    " ; .ascii \"" msg "\" ; .text");
+#endif
+
+#endif /* !_MACHINE_CDEFS_H_ */
diff --git a/ndk/platforms/android-3/arch-arm/include/machine/cpu-features.h b/ndk/platforms/android-3/arch-arm/include/machine/cpu-features.h
new file mode 100644
index 0000000..f836006
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/machine/cpu-features.h
@@ -0,0 +1,164 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _ARM_MACHINE_CPU_FEATURES_H
+#define _ARM_MACHINE_CPU_FEATURES_H
+
+/* The purpose of this file is to define several macros corresponding
+ * to CPU features that may or may not be available at build time on
+ * on the target CPU.
+ *
+ * This is done to abstract us from the various ARM Architecture
+ * quirks and alphabet soup.
+ *
+ * IMPORTANT: We have no intention to support anything below an ARMv4T !
+ */
+
+/* _ARM_ARCH_REVISION is a number corresponding to the ARM revision
+ * we're going to support
+ *
+ * it looks like our toolchain doesn't define __ARM_ARCH__
+ * so try to guess it.
+ *
+ *
+ *
+ */
+#ifndef __ARM_ARCH__
+
+#  if defined __ARM_ARCH_7__   || defined __ARM_ARCH_7A__ || \
+      defined __ARM_ARCH_7R__  || defined __ARM_ARCH_7M__
+
+#    define __ARM_ARCH__ 7
+
+#  elif defined __ARM_ARCH_6__   || defined __ARM_ARCH_6J__ || \
+      defined __ARM_ARCH_6K__  || defined __ARM_ARCH_6Z__ || \
+      defined __ARM_ARCH_6KZ__ || defined __ARM_ARCH_6T2__
+#
+#    define __ARM_ARCH__ 6
+#
+#  elif defined __ARM_ARCH_5__ || defined __ARM_ARCH_5T__ || \
+        defined __ARM_ARCH_5TE__ || defined __ARM_ARCH_5TEJ__
+#
+#    define __ARM_ARCH__ 5
+#
+#  elif defined __ARM_ARCH_4T__
+#
+#    define __ARM_ARCH__ 4
+#
+#  elif defined __ARM_ARCH_4__
+#    error ARMv4 is not supported, please use ARMv4T at a minimum
+#  else
+#    error Unknown or unsupported ARM architecture
+#  endif
+#endif
+
+/* experimental feature used to check that our ARMv4 workarounds
+ * work correctly without a real ARMv4 machine */
+#ifdef BIONIC_EXPERIMENTAL_FORCE_ARMV4
+#  undef  __ARM_ARCH__
+#  define __ARM_ARCH__  4
+#endif
+
+/* define __ARM_HAVE_5TE if we have the ARMv5TE instructions */
+#if __ARM_ARCH__ > 5
+#  define  __ARM_HAVE_5TE  1
+#elif __ARM_ARCH__ == 5
+#  if defined __ARM_ARCH_5TE__ || defined __ARM_ARCH_5TEJ__
+#    define __ARM_HAVE_5TE  1
+#  endif
+#endif
+
+/* instructions introduced in ARMv5 */
+#if __ARM_ARCH__ >= 5
+#  define  __ARM_HAVE_BLX  1
+#  define  __ARM_HAVE_CLZ  1
+#  define  __ARM_HAVE_LDC2 1
+#  define  __ARM_HAVE_MCR2 1
+#  define  __ARM_HAVE_MRC2 1
+#  define  __ARM_HAVE_STC2 1
+#endif
+
+/* ARMv5TE introduces a few instructions */
+#if __ARM_HAVE_5TE
+#  define  __ARM_HAVE_PLD   1
+#  define  __ARM_HAVE_MCRR  1
+#  define  __ARM_HAVE_MRRC  1
+#endif
+
+/* define __ARM_HAVE_HALFWORD_MULTIPLY when half-word multiply instructions
+ * this means variants of: smul, smulw, smla, smlaw, smlal
+ */
+#if __ARM_HAVE_5TE
+#  define  __ARM_HAVE_HALFWORD_MULTIPLY  1
+#endif
+
+/* define __ARM_HAVE_PAIR_LOAD_STORE when 64-bit memory loads and stored
+ * into/from a pair of 32-bit registers is supported throuhg 'ldrd' and 'strd'
+ */
+#if __ARM_HAVE_5TE
+#  define  __ARM_HAVE_PAIR_LOAD_STORE 1
+#endif
+
+/* define __ARM_HAVE_SATURATED_ARITHMETIC is you have the saturated integer
+ * arithmetic instructions: qdd, qdadd, qsub, qdsub
+ */
+#if __ARM_HAVE_5TE
+#  define  __ARM_HAVE_SATURATED_ARITHMETIC 1
+#endif
+
+/* define __ARM_HAVE_PC_INTERWORK when a direct assignment to the
+ * pc register will switch into thumb/ARM mode depending on bit 0
+ * of the new instruction address. Before ARMv5, this was not the
+ * case, and you have to write:
+ *
+ *     mov  r0, [<some address>]
+ *     bx   r0
+ *
+ * instead of:
+ *
+ *     ldr  pc, [<some address>]
+ *
+ * note that this affects any instruction that explicitely changes the
+ * value of the pc register, including ldm { ...,pc } or 'add pc, #offset'
+ */
+#if __ARM_ARCH__ >= 5
+#  define __ARM_HAVE_PC_INTERWORK
+#endif
+
+
+/* Assembly-only macros */
+
+/* define a handy PLD(address) macro since the cache preload
+ * is an optional opcode
+ */
+#if __ARM_HAVE_PLD
+#  define  PLD(reg,offset)    pld    [reg, offset]
+#else
+#  define  PLD(reg,offset)    /* nothing */
+#endif
+
+#endif /* _ARM_MACHINE_CPU_FEATURES_H */
diff --git a/ndk/platforms/android-3/arch-arm/include/machine/exec.h b/ndk/platforms/android-3/arch-arm/include/machine/exec.h
new file mode 100644
index 0000000..227b207
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/machine/exec.h
@@ -0,0 +1,50 @@
+/*	$OpenBSD: exec.h,v 1.9 2003/04/17 03:42:14 drahn Exp $	*/
+/*	$NetBSD: exec.h,v 1.6 1994/10/27 04:16:05 cgd Exp $	*/
+
+/*
+ * Copyright (c) 1993 Christopher G. Demetriou
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ * 3. 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 _ARM_EXEC_H_
+#define _ARM_EXEC_H_
+
+#define __LDPGSZ	4096
+
+#define NATIVE_EXEC_ELF
+
+#define ARCH_ELFSIZE		32
+
+#define ELF_TARG_CLASS		ELFCLASS32
+#define ELF_TARG_DATA		ELFDATA2LSB
+#define ELF_TARG_MACH		EM_ARM
+
+#define _NLIST_DO_AOUT
+#define _NLIST_DO_ELF
+
+#define _KERN_DO_AOUT
+#define _KERN_DO_ELF
+
+#endif  /* _ARM_EXEC_H_ */
diff --git a/ndk/platforms/android-3/arch-arm/include/machine/ieee.h b/ndk/platforms/android-3/arch-arm/include/machine/ieee.h
new file mode 100644
index 0000000..5f9b89e
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/machine/ieee.h
@@ -0,0 +1,191 @@
+/*	$OpenBSD: ieee.h,v 1.1 2004/02/01 05:09:49 drahn Exp $	*/
+/*	$NetBSD: ieee.h,v 1.2 2001/02/21 17:43:50 bjh21 Exp $	*/
+
+/*
+ * Copyright (c) 1992, 1993
+ *	The Regents of the University of California.  All rights reserved.
+ *
+ * This software was developed by the Computer Systems Engineering group
+ * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
+ * contributed to Berkeley.
+ *
+ * All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ *	This product includes software developed by the University of
+ *	California, Lawrence Berkeley Laboratory.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *	This product includes software developed by the University of
+ *	California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
+ *
+ *	@(#)ieee.h	8.1 (Berkeley) 6/11/93
+ */
+
+/*
+ * ieee.h defines the machine-dependent layout of the machine's IEEE
+ * floating point.
+ */
+
+/*
+ * Define the number of bits in each fraction and exponent.
+ *
+ *		     k	         k+1
+ * Note that  1.0 x 2  == 0.1 x 2      and that denorms are represented
+ *
+ *					  (-exp_bias+1)
+ * as fractions that look like 0.fffff x 2             .  This means that
+ *
+ *			 -126
+ * the number 0.10000 x 2    , for instance, is the same as the normalized
+ *
+ *		-127			   -128
+ * float 1.0 x 2    .  Thus, to represent 2    , we need one leading zero
+ *
+ *				  -129
+ * in the fraction; to represent 2    , we need two, and so on.  This
+ *
+ *						     (-exp_bias-fracbits+1)
+ * implies that the smallest denormalized number is 2
+ *
+ * for whichever format we are talking about: for single precision, for
+ *
+ *						-126		-149
+ * instance, we get .00000000000000000000001 x 2    , or 1.0 x 2    , and
+ *
+ * -149 == -127 - 23 + 1.
+ */
+
+/*
+ * The ARM has two sets of FP data formats.  The FPA supports 32-bit, 64-bit
+ * and 96-bit IEEE formats, with the words in big-endian order.  VFP supports
+ * 32-bin and 64-bit IEEE formats with the words in the CPU's native byte
+ * order.
+ *
+ * The FPA also has two packed decimal formats, but we ignore them here.
+ */
+
+#define	SNG_EXPBITS	8
+#define	SNG_FRACBITS	23
+
+#define	DBL_EXPBITS	11
+#define	DBL_FRACBITS	52
+
+#ifndef __VFP_FP__
+#define	E80_EXPBITS	15
+#define	E80_FRACBITS	64
+
+#define	EXT_EXPBITS	15
+#define	EXT_FRACBITS	112
+#endif
+
+struct ieee_single {
+	u_int	sng_frac:23;
+	u_int	sng_exponent:8;
+	u_int	sng_sign:1;
+};
+
+#ifdef __VFP_FP__
+struct ieee_double {
+#ifdef __ARMEB__
+	u_int	dbl_sign:1;
+	u_int	dbl_exp:11;
+	u_int	dbl_frach:20;
+	u_int	dbl_fracl;
+#else /* !__ARMEB__ */
+	u_int	dbl_fracl;
+	u_int	dbl_frach:20;
+	u_int	dbl_exp:11;
+	u_int	dbl_sign:1;
+#endif /* !__ARMEB__ */
+};
+#else /* !__VFP_FP__ */
+struct ieee_double {
+	u_int	dbl_frach:20;
+	u_int	dbl_exp:11;
+	u_int	dbl_sign:1;
+	u_int	dbl_fracl;
+};
+
+union ieee_double_u {
+	double                  dblu_d;
+	struct ieee_double      dblu_dbl;
+};
+
+
+struct ieee_e80 {
+	u_int	e80_exp:15;
+	u_int	e80_zero:16;
+	u_int	e80_sign:1;
+	u_int	e80_frach:31;
+	u_int	e80_j:1;
+	u_int	e80_fracl;
+};
+
+struct ieee_ext {
+	u_int	ext_frach:16;
+	u_int	ext_exp:15;
+	u_int	ext_sign:1;
+	u_int	ext_frachm;
+	u_int	ext_fraclm;
+	u_int	ext_fracl;
+};
+#endif /* !__VFP_FP__ */
+
+/*
+ * Floats whose exponent is in [1..INFNAN) (of whatever type) are
+ * `normal'.  Floats whose exponent is INFNAN are either Inf or NaN.
+ * Floats whose exponent is zero are either zero (iff all fraction
+ * bits are zero) or subnormal values.
+ *
+ * A NaN is a `signalling NaN' if its QUIETNAN bit is clear in its
+ * high fraction; if the bit is set, it is a `quiet NaN'.
+ */
+#define	SNG_EXP_INFNAN	255
+#define	DBL_EXP_INFNAN	2047
+#ifndef __VFP_FP__
+#define	E80_EXP_INFNAN	32767
+#define	EXT_EXP_INFNAN	32767
+#endif /* !__VFP_FP__ */
+
+#if 0
+#define	SNG_QUIETNAN	(1 << 22)
+#define	DBL_QUIETNAN	(1 << 19)
+#ifndef __VFP_FP__
+#define	E80_QUIETNAN	(1 << 15)
+#define	EXT_QUIETNAN	(1 << 15)
+#endif /* !__VFP_FP__ */
+#endif
+
+/*
+ * Exponent biases.
+ */
+#define	SNG_EXP_BIAS	127
+#define	DBL_EXP_BIAS	1023
+#ifndef __VFP_FP__
+#define	E80_EXP_BIAS	16383
+#define	EXT_EXP_BIAS	16383
+#endif /* !__VFP_FP__ */
diff --git a/ndk/platforms/android-3/arch-arm/include/machine/internal_types.h b/ndk/platforms/android-3/arch-arm/include/machine/internal_types.h
new file mode 100644
index 0000000..7e610b0
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/machine/internal_types.h
@@ -0,0 +1,10 @@
+/* $OpenBSD: internal_types.h,v 1.2 2004/05/06 15:53:39 drahn Exp $ */
+/* Public domain */
+#ifndef _ARM_INTERNAL_TYPES_H_
+#define _ARM_INTERNAL_TYPES_H_
+
+#ifdef __CHAR_UNSIGNED__
+#define __machine_has_unsigned_chars
+#endif
+
+#endif
diff --git a/ndk/platforms/android-3/arch-arm/include/machine/kernel.h b/ndk/platforms/android-3/arch-arm/include/machine/kernel.h
new file mode 100644
index 0000000..462b8e3
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/machine/kernel.h
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _ARCH_ARM_KERNEL_H
+#define _ARCH_ARM_KERNEL_H
+
+/* this file contains kernel-specific definitions that were optimized out of
+   our processed kernel headers, but still useful nonetheless... */
+
+typedef unsigned long   __kernel_blkcnt_t;
+typedef unsigned long   __kernel_blksize_t;
+
+/* these aren't really defined by the kernel headers though... */
+typedef unsigned long   __kernel_fsblkcnt_t;
+typedef unsigned long   __kernel_fsfilcnt_t;
+typedef unsigned int    __kernel_id_t;
+
+#endif /* _ARCH_ARM_KERNEL_H */
diff --git a/ndk/platforms/android-3/arch-arm/include/machine/limits.h b/ndk/platforms/android-3/arch-arm/include/machine/limits.h
new file mode 100644
index 0000000..f9c04fa
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/machine/limits.h
@@ -0,0 +1,63 @@
+/*	$OpenBSD: limits.h,v 1.3 2006/01/06 22:48:46 millert Exp $	*/
+/*	$NetBSD: limits.h,v 1.4 2003/04/28 23:16:18 bjh21 Exp $	*/
+
+/*
+ * Copyright (c) 1988 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ * 3. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
+ *
+ *	from: @(#)limits.h	7.2 (Berkeley) 6/28/90
+ */
+
+#ifndef	_ARM32_LIMITS_H_
+#define	_ARM32_LIMITS_H_
+
+#include <sys/cdefs.h>
+
+#define	MB_LEN_MAX	1		/* no multibyte characters */
+
+#ifndef	SIZE_MAX
+#define	SIZE_MAX	UINT_MAX	/* max value for a size_t */
+#endif
+#ifndef SSIZE_MAX
+#define	SSIZE_MAX	INT_MAX		/* max value for a ssize_t */
+#endif
+
+#if __BSD_VISIBLE
+#define	SIZE_T_MAX	UINT_MAX	/* max value for a size_t (historic) */
+
+#define	UQUAD_MAX	0xffffffffffffffffULL		/* max unsigned quad */
+#define	QUAD_MAX	0x7fffffffffffffffLL		/* max signed quad */
+#define	QUAD_MIN	(-0x7fffffffffffffffLL-1)	/* min signed quad */
+
+#endif /* __BSD_VISIBLE */
+
+#define LONGLONG_BIT    64
+#define LONGLONG_MIN    (-9223372036854775807LL-1)
+#define LONGLONG_MAX    9223372036854775807LL
+#define ULONGLONG_MAX   18446744073709551615ULL
+
+#endif	/* _ARM32_LIMITS_H_ */
diff --git a/ndk/platforms/android-3/arch-arm/include/machine/setjmp.h b/ndk/platforms/android-3/arch-arm/include/machine/setjmp.h
new file mode 100644
index 0000000..f20cab2
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/include/machine/setjmp.h
@@ -0,0 +1,87 @@
+/*	$OpenBSD: setjmp.h,v 1.1 2004/02/01 05:09:49 drahn Exp $	*/
+/*	$NetBSD: setjmp.h,v 1.2 2001/08/25 14:45:59 bjh21 Exp $	*/
+
+/*
+ * machine/setjmp.h: machine dependent setjmp-related information.
+ */
+
+#ifdef __ELF__
+#define	_JBLEN	64		/* size, in longs, of a jmp_buf */
+#else
+#define	_JBLEN	29		/* size, in longs, of a jmp_buf */
+#endif
+
+/*
+ * NOTE: The internal structure of a jmp_buf is *PRIVATE*
+ *       This information is provided as there is software
+ *       that fiddles with this with obtain the stack pointer
+ *	 (yes really ! and its commercial !).
+ *
+ * Description of the setjmp buffer
+ *
+ * word  0	magic number	(dependant on creator)
+ *       1 -  3	f4		fp register 4
+ *	 4 -  6	f5		fp register 5
+ *	 7 -  9 f6		fp register 6
+ *	10 - 12	f7		fp register 7
+ *	13	fpsr		fp status register
+ *	14	r4		register 4
+ *	15	r5		register 5
+ *	16	r6		register 6
+ *	17	r7		register 7
+ *	18	r8		register 8
+ *	19	r9		register 9
+ *	20	r10		register 10 (sl)
+ *	21	r11		register 11 (fp)
+ *	22	r12		register 12 (ip)
+ *	23	r13		register 13 (sp)
+ *	24	r14		register 14 (lr)
+ *	25	signal mask	(dependant on magic)
+ *	26	(con't)
+ *	27	(con't)
+ *	28	(con't)
+ *
+ * The magic number number identifies the jmp_buf and
+ * how the buffer was created as well as providing
+ * a sanity check
+ *
+ * A side note I should mention - Please do not tamper
+ * with the floating point fields. While they are
+ * always saved and restored at the moment this cannot
+ * be garenteed especially if the compiler happens
+ * to be generating soft-float code so no fp
+ * registers will be used.
+ *
+ * Whilst this can be seen an encouraging people to
+ * use the setjmp buffer in this way I think that it
+ * is for the best then if changes occur compiles will
+ * break rather than just having new builds falling over
+ * mysteriously.
+ */
+
+#define _JB_MAGIC__SETJMP	0x4278f500
+#define _JB_MAGIC_SETJMP	0x4278f501
+
+/* Valid for all jmp_buf's */
+
+#define _JB_MAGIC		 0
+#define _JB_REG_F4		 1
+#define _JB_REG_F5		 4
+#define _JB_REG_F6		 7
+#define _JB_REG_F7		10
+#define _JB_REG_FPSR		13
+#define _JB_REG_R4		14
+#define _JB_REG_R5		15
+#define _JB_REG_R6		16
+#define _JB_REG_R7		17
+#define _JB_REG_R8		18
+#define _JB_REG_R9		19
+#define _JB_REG_R10		20
+#define _JB_REG_R11		21
+#define _JB_REG_R12		22
+#define _JB_REG_R13		23
+#define _JB_REG_R14		24
+
+/* Only valid with the _JB_MAGIC_SETJMP magic */
+
+#define _JB_SIGMASK		25
diff --git a/ndk/platforms/android-3/arch-arm/lib/crtbegin_dynamic.o b/ndk/platforms/android-3/arch-arm/lib/crtbegin_dynamic.o
new file mode 100644
index 0000000..63d4efa
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/lib/crtbegin_dynamic.o
Binary files differ
diff --git a/ndk/platforms/android-3/arch-arm/lib/crtbegin_static.o b/ndk/platforms/android-3/arch-arm/lib/crtbegin_static.o
new file mode 100644
index 0000000..d11c79e
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/lib/crtbegin_static.o
Binary files differ
diff --git a/ndk/platforms/android-3/arch-arm/lib/crtend_android.o b/ndk/platforms/android-3/arch-arm/lib/crtend_android.o
new file mode 100644
index 0000000..5b76af8
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/lib/crtend_android.o
Binary files differ
diff --git a/ndk/platforms/android-3/arch-arm/lib/libc.a b/ndk/platforms/android-3/arch-arm/lib/libc.a
new file mode 100644
index 0000000..4fdcafc
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/lib/libc.a
Binary files differ
diff --git a/ndk/platforms/android-3/arch-arm/lib/libc.so b/ndk/platforms/android-3/arch-arm/lib/libc.so
new file mode 100644
index 0000000..9714e97
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/lib/libc.so
Binary files differ
diff --git a/ndk/platforms/android-3/arch-arm/lib/libdl.so b/ndk/platforms/android-3/arch-arm/lib/libdl.so
new file mode 100644
index 0000000..e2a589c
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/lib/libdl.so
Binary files differ
diff --git a/ndk/platforms/android-3/arch-arm/lib/liblog.so b/ndk/platforms/android-3/arch-arm/lib/liblog.so
new file mode 100644
index 0000000..92bf1a7
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/lib/liblog.so
Binary files differ
diff --git a/ndk/platforms/android-3/arch-arm/lib/libm.a b/ndk/platforms/android-3/arch-arm/lib/libm.a
new file mode 100644
index 0000000..3e1ccb0
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/lib/libm.a
Binary files differ
diff --git a/ndk/platforms/android-3/arch-arm/lib/libm.so b/ndk/platforms/android-3/arch-arm/lib/libm.so
new file mode 100644
index 0000000..87f4446
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/lib/libm.so
Binary files differ
diff --git a/ndk/platforms/android-3/arch-arm/lib/libstdc++.a b/ndk/platforms/android-3/arch-arm/lib/libstdc++.a
new file mode 100644
index 0000000..8f495a5
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/lib/libstdc++.a
Binary files differ
diff --git a/ndk/platforms/android-3/arch-arm/lib/libstdc++.so b/ndk/platforms/android-3/arch-arm/lib/libstdc++.so
new file mode 100644
index 0000000..d3d103f
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/lib/libstdc++.so
Binary files differ
diff --git a/ndk/platforms/android-3/arch-arm/lib/libthread_db.a b/ndk/platforms/android-3/arch-arm/lib/libthread_db.a
new file mode 100644
index 0000000..9d634be
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/lib/libthread_db.a
Binary files differ
diff --git a/ndk/platforms/android-3/arch-arm/lib/libthread_db.so b/ndk/platforms/android-3/arch-arm/lib/libthread_db.so
new file mode 100644
index 0000000..ea603f0
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/lib/libthread_db.so
Binary files differ
diff --git a/ndk/platforms/android-3/arch-arm/lib/libz.so b/ndk/platforms/android-3/arch-arm/lib/libz.so
new file mode 100644
index 0000000..f50a0ff
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/lib/libz.so
Binary files differ
diff --git a/ndk/platforms/android-3/arch-arm/symbols/libc.so.txt b/ndk/platforms/android-3/arch-arm/symbols/libc.so.txt
new file mode 100644
index 0000000..1d13c72
--- /dev/null
+++ b/ndk/platforms/android-3/arch-arm/symbols/libc.so.txt
@@ -0,0 +1,1050 @@
+
+.ARM.extab
+.bss
+.data
+.data.rel.ro
+.rodata
+.text
+MD5_Final
+MD5_Init
+MD5_Update
+SHA1Final
+SHA1Init
+SHA1Transform
+SHA1Update
+_C_ctype_
+_C_tolower_
+_C_toupper_
+_Unwind_Backtrace
+_Unwind_Complete
+_Unwind_DeleteException
+_Unwind_ForcedUnwind
+_Unwind_GetCFA
+_Unwind_GetDataRelBase
+_Unwind_GetLanguageSpecificData
+_Unwind_GetRegionStart
+_Unwind_GetTextRelBase
+_Unwind_RaiseException
+_Unwind_Resume
+_Unwind_Resume_or_Rethrow
+_Unwind_VRS_Get
+_Unwind_VRS_Pop
+_Unwind_VRS_Set
+___Unwind_Backtrace
+___Unwind_ForcedUnwind
+___Unwind_RaiseException
+___Unwind_Resume
+___Unwind_Resume_or_Rethrow
+__adddf3
+__aeabi_atexit
+__aeabi_cdcmpeq
+__aeabi_cdcmple
+__aeabi_cdrcmple
+__aeabi_d2f
+__aeabi_d2iz
+__aeabi_dadd
+__aeabi_dcmpeq
+__aeabi_dcmpge
+__aeabi_dcmpgt
+__aeabi_dcmple
+__aeabi_dcmplt
+__aeabi_ddiv
+__aeabi_dmul
+__aeabi_drsub
+__aeabi_dsub
+__aeabi_f2d
+__aeabi_i2d
+__aeabi_idiv
+__aeabi_idiv0
+__aeabi_idivmod
+__aeabi_l2d
+__aeabi_ldiv0
+__aeabi_ldivmod
+__aeabi_lmul
+__aeabi_memclr
+__aeabi_memclr4
+__aeabi_memclr8
+__aeabi_memcpy
+__aeabi_memcpy4
+__aeabi_memcpy8
+__aeabi_memmove
+__aeabi_memmove4
+__aeabi_memmove8
+__aeabi_memset
+__aeabi_memset4
+__aeabi_memset8
+__aeabi_ui2d
+__aeabi_uidiv
+__aeabi_uidivmod
+__aeabi_ul2d
+__aeabi_uldivmod
+__aeabi_unwind_cpp_pr0
+__aeabi_unwind_cpp_pr1
+__aeabi_unwind_cpp_pr2
+__arc4_getbyte
+__assert
+__assert2
+__atexit
+__atexit_invalid
+__atexit_register_cleanup
+__atomic_cmpxchg
+__atomic_dec
+__atomic_inc
+__atomic_swap
+__b64_ntop
+__b64_pton
+__bionic_brk
+__brk
+__bss_end__
+__bss_start
+__bss_start__
+__clone
+__clz_tab
+__cmpdf2
+__cxa_atexit
+__cxa_begin_cleanup
+__cxa_call_unexpected
+__cxa_finalize
+__cxa_type_match
+__data_start
+__div0
+__divdf3
+__divdi3
+__divsi3
+__dn_comp
+__dn_count_labels
+__dn_skipname
+__dorand48
+__dso_handle
+__dtoa
+__end__
+__eqdf2
+__errno
+__evAddTime
+__evCmpTime
+__evConsIovec
+__evConsTime
+__evNowTime
+__evOptMonoTime
+__evSubTime
+__evTimeSpec
+__evTimeVal
+__evUTCTime
+__exidx_end
+__exidx_start
+__extendsfdf2
+__fcntl
+__fcntl64
+__findenv
+__fixdfsi
+__floatdidf
+__floatsidf
+__floatundidf
+__floatunsidf
+__fork
+__fp_nquery
+__fp_query
+__fremovelock
+__futex_wait
+__futex_wake
+__gedf2
+__get_h_errno
+__get_pc
+__get_res_cache
+__get_sp
+__get_stack_base
+__get_thread
+__getcwd
+__getpriority
+__gnu_Unwind_Backtrace
+__gnu_Unwind_Find_exidx
+__gnu_Unwind_ForcedUnwind
+__gnu_Unwind_RaiseException
+__gnu_Unwind_Restore_VFP
+__gnu_Unwind_Resume
+__gnu_Unwind_Resume_or_Rethrow
+__gnu_Unwind_Save_VFP
+__gnu_ldivmod_helper
+__gnu_uldivmod_helper
+__gnu_unwind_execute
+__gnu_unwind_frame
+__gtdf2
+__hostalias
+__init_tls
+__ioctl
+__isthreaded
+__ledf2
+__libc_android_log_assert
+__libc_android_log_print
+__libc_init
+__libc_init_common
+__llseek
+__loc_aton
+__loc_ntoa
+__ltdf2
+__memcmp16
+__mmap2
+__muldf3
+__muldi3
+__nedf2
+__ns_format_ttl
+__ns_get16
+__ns_get32
+__ns_initparse
+__ns_makecanon
+__ns_msg_getflag
+__ns_name_compress
+__ns_name_ntol
+__ns_name_ntop
+__ns_name_pack
+__ns_name_pton
+__ns_name_rollback
+__ns_name_skip
+__ns_name_uncompress
+__ns_name_unpack
+__ns_parserr
+__ns_put16
+__ns_put32
+__ns_samename
+__ns_skiprr
+__ns_sprintrr
+__ns_sprintrrf
+__open
+__openat
+__p_cdname
+__p_cdnname
+__p_cert_syms
+__p_class
+__p_class_syms
+__p_default_section_syms
+__p_fqname
+__p_fqnname
+__p_key_syms
+__p_option
+__p_query
+__p_rcode
+__p_rcode_syms
+__p_secstodate
+__p_section
+__p_sockun
+__p_time
+__p_type
+__p_type_syms
+__p_update_section_syms
+__page_shift
+__page_size
+__pread64
+__progname
+__pthread_cleanup_pop
+__pthread_cleanup_push
+__pthread_clone
+__pthread_cond_timedwait
+__pthread_cond_timedwait_relative
+__ptrace
+__putlong
+__putshort
+__pwrite64
+__rand48_add
+__rand48_mult
+__rand48_seed
+__reboot
+__res_close
+__res_dnok
+__res_get_nibblesuffix
+__res_get_nibblesuffix2
+__res_get_state
+__res_get_static
+__res_getservers
+__res_hnok
+__res_hostalias
+__res_isourserver
+__res_mailok
+__res_nameinquery
+__res_nametoclass
+__res_nametotype
+__res_nclose
+__res_ndestroy
+__res_ninit
+__res_nmkquery
+__res_nopt
+__res_nquery
+__res_nquerydomain
+__res_nsearch
+__res_nsend
+__res_opt
+__res_ourserver_p
+__res_ownok
+__res_pquery
+__res_put_state
+__res_queriesmatch
+__res_querydomain
+__res_randomid
+__res_send
+__res_send_setqhook
+__res_send_setrhook
+__res_setservers
+__res_vinit
+__restore_core_regs
+__rt_sigaction
+__rt_sigprocmask
+__rt_sigtimedwait
+__sF
+__sFext
+__sclose
+__sdidinit
+__set_errno
+__set_syscall_errno
+__set_tls
+__sflags
+__sflush
+__sfp
+__sfvwrite
+__sglue
+__sigsuspend
+__sinit
+__slbexpand
+__smakebuf
+__sread
+__srefill
+__srget
+__sseek
+__stack_chk_fail
+__stack_chk_guard
+__statfs64
+__subdf3
+__swbuf
+__swhatbuf
+__swrite
+__swsetup
+__sym_ntop
+__sym_ntos
+__sym_ston
+__syslog
+__system_properties_init
+__system_property_area__
+__system_property_find
+__system_property_find_nth
+__system_property_get
+__system_property_read
+__system_property_wait
+__thread_entry
+__timer_create
+__timer_delete
+__timer_getoverrun
+__timer_gettime
+__timer_settime
+__timer_table_start_stop
+__truncdfsf2
+__udivdi3
+__udivsi3
+__wait4
+_bss_end__
+_cleanup
+_ctype_
+_dns_gethtbyaddr
+_dns_gethtbyname
+_dorand48
+_edata
+_end
+_endhtent
+_exit
+_exit_thread
+_exit_with_stack_teardown
+_fwalk
+_gethtbyaddr
+_gethtbyname
+_gethtbyname2
+_gethtent
+_getlong
+_getshort
+_init_thread
+_longjmp
+_mktemp
+_nres
+_ns_flagdata
+_rand48_add
+_rand48_mult
+_rand48_seed
+_res_opcodes
+_resolv_cache_add
+_resolv_cache_create
+_resolv_cache_lookup
+_resolv_cache_reset
+_sethtent
+_setjmp
+_stack
+_thread_atexit_lock
+_thread_atexit_unlock
+_thread_created_hook
+_tolower_tab_
+_toupper_tab_
+abort
+accept
+access
+acct
+alarm
+alphasort
+arc4random
+arc4random_addrandom
+arc4random_buf
+arc4random_stir
+arc4random_uniform
+asctime
+asctime64
+asctime64_r
+asctime_r
+asprintf
+atexit
+atoi
+atol
+atoll
+basename
+basename_r
+bcopy
+bind
+bindresvport
+brk
+bsd_signal
+bsearch
+btowc
+bzero
+cacheflush
+calloc
+capget
+capset
+chdir
+chmod
+chown
+chroot
+clearerr
+clock
+clock_getres
+clock_gettime
+clock_nanosleep
+clock_settime
+close
+closedir
+closelog
+closelog_r
+connect
+copy_TM_to_tm
+copy_tm_to_TM
+creat
+ctime
+ctime64
+ctime64_r
+ctime_r
+daemon
+delete_module
+difftime
+dirfd
+dirname
+dirname_r
+div
+dlindependent_calloc
+dlindependent_comalloc
+dlmallinfo
+dlmalloc_footprint
+dlmalloc_max_footprint
+dlmalloc_stats
+dlmalloc_trim
+dlmalloc_usable_size
+dlmalloc_walk_free_pages
+dlmalloc_walk_heap
+dlmallopt
+dlpvalloc
+dlvalloc
+dn_expand
+dns_change_prop
+dns_last_change_counter
+drand48
+dup
+dup2
+endpwent
+endservent
+endutent
+environ
+epoll_create
+epoll_ctl
+epoll_wait
+erand48
+execl
+execle
+execlp
+execv
+execve
+execvp
+exit
+fake_gmtime_r
+fake_localtime_r
+fchdir
+fchmod
+fchmodat
+fchown
+fchownat
+fclose
+fcntl
+fdopen
+fdopendir
+feof
+ferror
+fflush
+ffs
+fgetc
+fgetln
+fgetpos
+fgets
+fgetwc
+fgetws
+fileno
+flock
+flockfile
+fnmatch
+fopen
+fork
+fpathconf
+fprintf
+fpurge
+fputc
+fputs
+fputwc
+fputws
+fread
+free
+free_malloc_leak_info
+freeaddrinfo
+freedtoa
+freopen
+fscanf
+fseek
+fseeko
+fsetpos
+fstat
+fstatat
+fstatfs
+fsync
+ftell
+ftello
+ftime
+ftok
+ftruncate
+ftrylockfile
+funlockfile
+funopen
+futex
+fwide
+fwprintf
+fwrite
+fwscanf
+gMallocLeakZygoteChild
+gai_strerror
+get_malloc_leak_info
+getaddrinfo
+getc
+getc_unlocked
+getchar
+getchar_unlocked
+getcwd
+getdents
+getdtablesize
+getegid
+getenv
+geteuid
+getgid
+getgrgid
+getgrnam
+getgrouplist
+getgroups
+gethostbyaddr
+gethostbyname
+gethostbyname2
+gethostbyname_r
+gethostent
+gethostname
+getitimer
+getlogin
+getmntent
+getnameinfo
+getnetbyaddr
+getnetbyname
+getopt
+getopt_long
+getopt_long_only
+getpeername
+getpgid
+getpgrp
+getpid
+getppid
+getpriority
+getprotobyname
+getprotobynumber
+getpt
+getpwnam
+getpwuid
+getresgid
+getresuid
+getrlimit
+getrusage
+gets
+getservbyname
+getservbyport
+getservent
+getservent_r
+getsockname
+getsockopt
+gettid
+gettimeofday
+getuid
+getutent
+getwc
+getwchar
+gmtime
+gmtime64
+gmtime64_r
+gmtime_r
+h_errlist
+h_nerr
+herror
+hstrerror
+if_indextoname
+if_nametoindex
+index
+inet_addr
+inet_aton
+inet_nsap_addr
+inet_nsap_ntoa
+inet_ntoa
+inet_ntop
+inet_pton
+init_module
+initgroups
+inotify_add_watch
+inotify_init
+inotify_rm_watch
+ioctl
+isalnum
+isalpha
+isascii
+isatty
+isblank
+iscntrl
+isdigit
+isgraph
+islower
+isprint
+ispunct
+issetugid
+isspace
+isupper
+iswalnum
+iswalpha
+iswcntrl
+iswctype
+iswdigit
+iswgraph
+iswlower
+iswprint
+iswpunct
+iswspace
+iswupper
+iswxdigit
+isxdigit
+jrand48
+kill
+klogctl
+lchown
+ldexp
+ldiv
+link
+listen
+lldiv
+localtime
+localtime64
+localtime64_r
+localtime_r
+longjmp
+longjmperror
+lrand48
+lseek
+lseek64
+lstat
+madvise
+mallinfo
+malloc
+malloc_debug_init
+mbrlen
+mbrtowc
+mbsinit
+mbsrtowcs
+memalign
+memccpy
+memchr
+memcmp
+memcpy
+memmem
+memmove
+memrchr
+memset
+memswap
+mincore
+mkdir
+mkdirat
+mkdtemp
+mknod
+mkstemp
+mkstemps
+mktemp
+mktime
+mktime64
+mlock
+mmap
+mount
+mprotect
+mrand48
+mremap
+msync
+munlock
+munmap
+nanosleep
+nice
+nrand48
+nsdispatch
+open
+openat
+opendir
+openlog
+openlog_r
+optarg
+opterr
+optind
+optopt
+optreset
+pathconf
+pause
+pclose
+perror
+pipe
+poll
+popen
+prctl
+pread
+printf
+pselect
+pthread_attr_destroy
+pthread_attr_getdetachstate
+pthread_attr_getguardsize
+pthread_attr_getschedparam
+pthread_attr_getschedpolicy
+pthread_attr_getscope
+pthread_attr_getstack
+pthread_attr_getstackaddr
+pthread_attr_getstacksize
+pthread_attr_init
+pthread_attr_setdetachstate
+pthread_attr_setguardsize
+pthread_attr_setschedparam
+pthread_attr_setschedpolicy
+pthread_attr_setscope
+pthread_attr_setstack
+pthread_attr_setstackaddr
+pthread_attr_setstacksize
+pthread_cond_broadcast
+pthread_cond_destroy
+pthread_cond_init
+pthread_cond_signal
+pthread_cond_timedwait
+pthread_cond_timedwait_monotonic
+pthread_cond_timeout_np
+pthread_cond_wait
+pthread_create
+pthread_detach
+pthread_equal
+pthread_exit
+pthread_getattr_np
+pthread_getcpuclockid
+pthread_getschedparam
+pthread_getspecific
+pthread_join
+pthread_key_create
+pthread_key_delete
+pthread_kill
+pthread_mutex_destroy
+pthread_mutex_init
+pthread_mutex_lock
+pthread_mutex_trylock
+pthread_mutex_unlock
+pthread_mutexattr_destroy
+pthread_mutexattr_getpshared
+pthread_mutexattr_gettype
+pthread_mutexattr_init
+pthread_mutexattr_setpshared
+pthread_mutexattr_settype
+pthread_once
+pthread_self
+pthread_setschedparam
+pthread_setspecific
+pthread_sigmask
+ptrace
+ptsname
+ptsname_r
+putc
+putc_unlocked
+putchar
+putchar_unlocked
+putenv
+puts
+pututline
+putw
+putwc
+putwchar
+pwrite
+qsort
+raise
+read
+readdir
+readdir_r
+readlink
+readv
+realloc
+realpath
+reboot
+recv
+recvfrom
+recvmsg
+remove
+rename
+renameat
+res_get_dns_changed
+res_init
+res_mkquery
+res_need_init
+res_query
+res_search
+restore_core_regs
+rewind
+rewinddir
+rmdir
+sbrk
+scandir
+scanf
+sched_get_priority_max
+sched_get_priority_min
+sched_getparam
+sched_getscheduler
+sched_rr_get_interval
+sched_setparam
+sched_setscheduler
+sched_yield
+seed48
+select
+sem_close
+sem_destroy
+sem_getvalue
+sem_init
+sem_open
+sem_post
+sem_timedwait
+sem_trywait
+sem_unlink
+sem_wait
+send
+sendfile
+sendmsg
+sendto
+setbuf
+setbuffer
+setegid
+setenv
+seteuid
+setgid
+setgroups
+setitimer
+setjmp
+setlinebuf
+setlocale
+setlogmask
+setlogmask_r
+setpgid
+setpgrp
+setpriority
+setregid
+setresgid
+setresuid
+setreuid
+setrlimit
+setservent
+setsid
+setsockopt
+settimeofday
+setuid
+setutent
+setvbuf
+shutdown
+sigaction
+sigblock
+siginterrupt
+siglongjmp
+sigpending
+sigprocmask
+sigsetjmp
+sigsetmask
+sigsuspend
+sigwait
+sleep
+snprintf
+socket
+socketpair
+sprintf
+srand48
+sscanf
+stat
+statfs
+strcasecmp
+strcasestr
+strcat
+strchr
+strcmp
+strcoll
+strcpy
+strcspn
+strdup
+strerror
+strerror_r
+strftime
+strlcat
+strlcpy
+strlen
+strncasecmp
+strncat
+strncmp
+strncpy
+strndup
+strnlen
+strntoimax
+strntoumax
+strpbrk
+strptime
+strrchr
+strsep
+strsignal
+strspn
+strstr
+strtod
+strtoimax
+strtok
+strtok_r
+strtol
+strtoll
+strtotimeval
+strtoul
+strtoull
+strtoumax
+strxfrm
+swprintf
+swscanf
+symlink
+sync
+sys_siglist
+syscall
+sysconf
+syslog
+syslog_r
+system
+sysv_signal
+tcgetpgrp
+tcsetpgrp
+tempnam
+the_key
+the_once
+time
+timegm64
+timelocal64
+timer_create
+timer_delete
+timer_getoverrun
+timer_gettime
+timer_settime
+times
+tkill
+tmpfile
+tmpnam
+toascii
+tolower
+toupper
+towlower
+towupper
+truncate
+ttyname
+tzname
+tzset
+umask
+umount
+umount2
+uname
+ungetc
+ungetwc
+unlink
+unlinkat
+unlockpt
+unsetenv
+usleep
+utime
+utimes
+utmpname
+valid_tm_mon
+valid_tm_wday
+valloc
+vasprintf
+vfork
+vfprintf
+vfscanf
+vfwprintf
+vprintf
+vscanf
+vsnprintf
+vsprintf
+vsscanf
+vswprintf
+vsyslog
+vsyslog_r
+vwprintf
+wait
+wait3
+waitid
+waitpid
+wcrtomb
+wcscat
+wcschr
+wcscmp
+wcscoll
+wcscpy
+wcscspn
+wcsftime
+wcslen
+wcsncat
+wcsncmp
+wcsncpy
+wcspbrk
+wcsrchr
+wcsrtombs
+wcsspn
+wcsstr
+wcstod
+wcstok
+wcstol
+wcstoul
+wcswcs
+wcswidth
+wcsxfrm
+wctob
+wctype
+wcwidth
+wmemchr
+wmemcmp
+wmemcpy
+wmemmove
+wmemset
+wprintf
+write
+writev
+wscanf
diff --git a/ndk/platforms/android-3/include/alloca.h b/ndk/platforms/android-3/include/alloca.h
new file mode 100644
index 0000000..0c50fc3
--- /dev/null
+++ b/ndk/platforms/android-3/include/alloca.h
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _ALLOCA_H
+#define _ALLOCA_H
+
+#define alloca(size)   __builtin_alloca(size)
+
+#endif /* _ALLOCA_H */
+
diff --git a/ndk/platforms/android-3/include/android/log.h b/ndk/platforms/android-3/include/android/log.h
new file mode 100644
index 0000000..0ea4c29
--- /dev/null
+++ b/ndk/platforms/android-3/include/android/log.h
@@ -0,0 +1,128 @@
+/*
+ * Copyright (C) 2009 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _ANDROID_LOG_H
+#define _ANDROID_LOG_H
+
+/******************************************************************
+ *
+ * IMPORTANT NOTICE:
+ *
+ *   This file is part of Android's set of stable system headers
+ *   exposed by the Android NDK (Native Development Kit) since
+ *   platform release 1.5
+ *
+ *   Third-party source AND binary code relies on the definitions
+ *   here to be FROZEN ON ALL UPCOMING PLATFORM RELEASES.
+ *
+ *   - DO NOT MODIFY ENUMS (EXCEPT IF YOU ADD NEW 32-BIT VALUES)
+ *   - DO NOT MODIFY CONSTANTS OR FUNCTIONAL MACROS
+ *   - DO NOT CHANGE THE SIGNATURE OF FUNCTIONS IN ANY WAY
+ *   - DO NOT CHANGE THE LAYOUT OR SIZE OF STRUCTURES
+ */
+
+/*
+ * Support routines to send messages to the Android in-kernel log buffer,
+ * which can later be accessed through the 'logcat' utility.
+ *
+ * Each log message must have
+ *   - a priority
+ *   - a log tag
+ *   - some text
+ *
+ * The tag normally corresponds to the component that emits the log message,
+ * and should be reasonably small.
+ *
+ * Log message text may be truncated to less than an implementation-specific
+ * limit (e.g. 1023 characters max).
+ *
+ * Note that a newline character ("\n") will be appended automatically to your
+ * log message, if not already there. It is not possible to send several messages
+ * and have them appear on a single line in logcat.
+ *
+ * PLEASE USE LOGS WITH MODERATION:
+ *
+ *  - Sending log messages eats CPU and slow down your application and the
+ *    system.
+ *
+ *  - The circular log buffer is pretty small (<64KB), sending many messages
+ *    might push off other important log messages from the rest of the system.
+ *
+ *  - In release builds, only send log messages to account for exceptional
+ *    conditions.
+ *
+ * NOTE: These functions MUST be implemented by /system/lib/liblog.so
+ */
+
+#include <stdarg.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Android log priority values, in ascending priority order.
+ */
+typedef enum android_LogPriority {
+    ANDROID_LOG_UNKNOWN = 0,
+    ANDROID_LOG_DEFAULT,    /* only for SetMinPriority() */
+    ANDROID_LOG_VERBOSE,
+    ANDROID_LOG_DEBUG,
+    ANDROID_LOG_INFO,
+    ANDROID_LOG_WARN,
+    ANDROID_LOG_ERROR,
+    ANDROID_LOG_FATAL,
+    ANDROID_LOG_SILENT,     /* only for SetMinPriority(); must be last */
+} android_LogPriority;
+
+/*
+ * Send a simple string to the log.
+ */
+int __android_log_write(int prio, const char *tag, const char *text);
+
+/*
+ * Send a formatted string to the log, used like printf(fmt,...)
+ */
+int __android_log_print(int prio, const char *tag,  const char *fmt, ...)
+#if defined(__GNUC__)
+    __attribute__ ((format(printf, 3, 4)))
+#endif
+    ;
+
+/*
+ * A variant of __android_log_print() that takes a va_list to list
+ * additional parameters.
+ */
+int __android_log_vprint(int prio, const char *tag,
+                         const char *fmt, va_list ap);
+
+/*
+ * Log an assertion failure and SIGTRAP the process to have a chance
+ * to inspect it, if a debugger is attached. This uses the FATAL priority.
+ */
+void __android_log_assert(const char *cond, const char *tag,
+			  const char *fmt, ...)    
+#if defined(__GNUC__)
+    __attribute__ ((noreturn))
+    __attribute__ ((format(printf, 3, 4)))
+#endif
+    ;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _ANDROID_LOG_H */
diff --git a/ndk/platforms/android-3/include/arpa/inet.h b/ndk/platforms/android-3/include/arpa/inet.h
new file mode 100644
index 0000000..e78e7c5
--- /dev/null
+++ b/ndk/platforms/android-3/include/arpa/inet.h
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _ARPA_INET_H_
+#define _ARPA_INET_H_
+
+#include <stdint.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+
+__BEGIN_DECLS
+
+typedef uint32_t in_addr_t;
+
+extern uint32_t      inet_addr(const char *);
+
+extern int           inet_aton(const char *, struct in_addr *);
+extern char*         inet_ntoa(struct in_addr);
+
+extern int           inet_pton(int, const char *, void *);
+extern const char*   inet_ntop(int, const void *, char *, size_t);
+
+extern unsigned int  inet_nsap_addr(const char *, unsigned char *, int);
+extern char*         inet_nsap_ntoa(int, const unsigned char *, char *);
+
+__END_DECLS
+
+#endif /* _ARPA_INET_H_ */
+
+
diff --git a/ndk/platforms/android-3/include/arpa/nameser.h b/ndk/platforms/android-3/include/arpa/nameser.h
new file mode 100644
index 0000000..028eadc
--- /dev/null
+++ b/ndk/platforms/android-3/include/arpa/nameser.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _arpa_nameser_h
+#define _arpa_nameser_h
+
+#include <sys/types.h>
+#include <sys/cdefs.h>
+
+/* this header intentionally blank
+ *
+ * the definitions normally found in <arpa/nameser.h> are
+ * really a bunch of resolver's internal declarations that
+ * should not be exposed to client code in any way
+ */
+
+#endif /* _arpa_nameser_h */
diff --git a/ndk/platforms/android-3/include/asm-generic/4level-fixup.h b/ndk/platforms/android-3/include/asm-generic/4level-fixup.h
new file mode 100644
index 0000000..91ae7f4
--- /dev/null
+++ b/ndk/platforms/android-3/include/asm-generic/4level-fixup.h
@@ -0,0 +1,42 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _4LEVEL_FIXUP_H
+#define _4LEVEL_FIXUP_H
+
+#define __ARCH_HAS_4LEVEL_HACK
+#define __PAGETABLE_PUD_FOLDED
+
+#define PUD_SIZE PGDIR_SIZE
+#define PUD_MASK PGDIR_MASK
+#define PTRS_PER_PUD 1
+
+#define pud_t pgd_t
+
+#define pmd_alloc(mm, pud, address)   ((unlikely(pgd_none(*(pud))) && __pmd_alloc(mm, pud, address))?   NULL: pmd_offset(pud, address))
+
+#define pud_alloc(mm, pgd, address) (pgd)
+#define pud_offset(pgd, start) (pgd)
+#define pud_none(pud) 0
+#define pud_bad(pud) 0
+#define pud_present(pud) 1
+#define pud_ERROR(pud) do { } while (0)
+#define pud_clear(pud) pgd_clear(pud)
+
+#undef pud_free_tlb
+#define pud_free_tlb(tlb, x) do { } while (0)
+#define pud_free(x) do { } while (0)
+#define __pud_free_tlb(tlb, x) do { } while (0)
+
+#undef pud_addr_end
+#define pud_addr_end(addr, end) (end)
+
+#endif
diff --git a/ndk/platforms/android-3/include/asm-generic/audit_dir_write.h b/ndk/platforms/android-3/include/asm-generic/audit_dir_write.h
new file mode 100644
index 0000000..1327b59
--- /dev/null
+++ b/ndk/platforms/android-3/include/asm-generic/audit_dir_write.h
@@ -0,0 +1,11 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
diff --git a/ndk/platforms/android-3/include/asm-generic/bitops/__ffs.h b/ndk/platforms/android-3/include/asm-generic/bitops/__ffs.h
new file mode 100644
index 0000000..3d135bd
--- /dev/null
+++ b/ndk/platforms/android-3/include/asm-generic/bitops/__ffs.h
@@ -0,0 +1,19 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_GENERIC_BITOPS___FFS_H_
+#define _ASM_GENERIC_BITOPS___FFS_H_
+
+#include <asm/types.h>
+
+#if BITS_PER_LONG == 64
+#endif
+#endif
diff --git a/ndk/platforms/android-3/include/asm-generic/bitops/atomic.h b/ndk/platforms/android-3/include/asm-generic/bitops/atomic.h
new file mode 100644
index 0000000..5f53ba9
--- /dev/null
+++ b/ndk/platforms/android-3/include/asm-generic/bitops/atomic.h
@@ -0,0 +1,23 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_GENERIC_BITOPS_ATOMIC_H_
+#define _ASM_GENERIC_BITOPS_ATOMIC_H_
+
+#include <asm/types.h>
+
+#define BITOP_MASK(nr) (1UL << ((nr) % BITS_PER_LONG))
+#define BITOP_WORD(nr) ((nr) / BITS_PER_LONG)
+
+#define _atomic_spin_lock_irqsave(l,f) do { local_irq_save(f); } while (0)
+#define _atomic_spin_unlock_irqrestore(l,f) do { local_irq_restore(f); } while (0)
+
+#endif
diff --git a/ndk/platforms/android-3/include/asm-generic/bitops/ffz.h b/ndk/platforms/android-3/include/asm-generic/bitops/ffz.h
new file mode 100644
index 0000000..18da271
--- /dev/null
+++ b/ndk/platforms/android-3/include/asm-generic/bitops/ffz.h
@@ -0,0 +1,17 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_GENERIC_BITOPS_FFZ_H_
+#define _ASM_GENERIC_BITOPS_FFZ_H_
+
+#define ffz(x) __ffs(~(x))
+
+#endif
diff --git a/ndk/platforms/android-3/include/asm-generic/bitops/find.h b/ndk/platforms/android-3/include/asm-generic/bitops/find.h
new file mode 100644
index 0000000..8361cfe
--- /dev/null
+++ b/ndk/platforms/android-3/include/asm-generic/bitops/find.h
@@ -0,0 +1,18 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_GENERIC_BITOPS_FIND_H_
+#define _ASM_GENERIC_BITOPS_FIND_H_
+
+#define find_first_bit(addr, size) find_next_bit((addr), (size), 0)
+#define find_first_zero_bit(addr, size) find_next_zero_bit((addr), (size), 0)
+
+#endif
diff --git a/ndk/platforms/android-3/include/asm-generic/bitops/fls.h b/ndk/platforms/android-3/include/asm-generic/bitops/fls.h
new file mode 100644
index 0000000..8adbf31
--- /dev/null
+++ b/ndk/platforms/android-3/include/asm-generic/bitops/fls.h
@@ -0,0 +1,15 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_GENERIC_BITOPS_FLS_H_
+#define _ASM_GENERIC_BITOPS_FLS_H_
+
+#endif
diff --git a/ndk/platforms/android-3/include/asm-generic/bitops/fls64.h b/ndk/platforms/android-3/include/asm-generic/bitops/fls64.h
new file mode 100644
index 0000000..af77098
--- /dev/null
+++ b/ndk/platforms/android-3/include/asm-generic/bitops/fls64.h
@@ -0,0 +1,17 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_GENERIC_BITOPS_FLS64_H_
+#define _ASM_GENERIC_BITOPS_FLS64_H_
+
+#include <asm/types.h>
+
+#endif
diff --git a/ndk/platforms/android-3/include/asm-generic/bitops/le.h b/ndk/platforms/android-3/include/asm-generic/bitops/le.h
new file mode 100644
index 0000000..97ca973
--- /dev/null
+++ b/ndk/platforms/android-3/include/asm-generic/bitops/le.h
@@ -0,0 +1,53 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_GENERIC_BITOPS_LE_H_
+#define _ASM_GENERIC_BITOPS_LE_H_
+
+#include <asm/types.h>
+#include <asm/byteorder.h>
+
+#define BITOP_WORD(nr) ((nr) / BITS_PER_LONG)
+#define BITOP_LE_SWIZZLE ((BITS_PER_LONG-1) & ~0x7)
+
+#ifdef __LITTLE_ENDIAN
+
+#define generic_test_le_bit(nr, addr) test_bit(nr, addr)
+#define generic___set_le_bit(nr, addr) __set_bit(nr, addr)
+#define generic___clear_le_bit(nr, addr) __clear_bit(nr, addr)
+
+#define generic_test_and_set_le_bit(nr, addr) test_and_set_bit(nr, addr)
+#define generic_test_and_clear_le_bit(nr, addr) test_and_clear_bit(nr, addr)
+
+#define generic___test_and_set_le_bit(nr, addr) __test_and_set_bit(nr, addr)
+#define generic___test_and_clear_le_bit(nr, addr) __test_and_clear_bit(nr, addr)
+
+#define generic_find_next_zero_le_bit(addr, size, offset) find_next_zero_bit(addr, size, offset)
+
+#elif defined(__BIG_ENDIAN)
+
+#define generic_test_le_bit(nr, addr)   test_bit((nr) ^ BITOP_LE_SWIZZLE, (addr))
+#define generic___set_le_bit(nr, addr)   __set_bit((nr) ^ BITOP_LE_SWIZZLE, (addr))
+#define generic___clear_le_bit(nr, addr)   __clear_bit((nr) ^ BITOP_LE_SWIZZLE, (addr))
+
+#define generic_test_and_set_le_bit(nr, addr)   test_and_set_bit((nr) ^ BITOP_LE_SWIZZLE, (addr))
+#define generic_test_and_clear_le_bit(nr, addr)   test_and_clear_bit((nr) ^ BITOP_LE_SWIZZLE, (addr))
+
+#define generic___test_and_set_le_bit(nr, addr)   __test_and_set_bit((nr) ^ BITOP_LE_SWIZZLE, (addr))
+#define generic___test_and_clear_le_bit(nr, addr)   __test_and_clear_bit((nr) ^ BITOP_LE_SWIZZLE, (addr))
+
+#else
+#error "Please fix <asm/byteorder.h>"
+#endif
+
+#define generic_find_first_zero_le_bit(addr, size)   generic_find_next_zero_le_bit((addr), (size), 0)
+
+#endif
diff --git a/ndk/platforms/android-3/include/asm-generic/bitops/non-atomic.h b/ndk/platforms/android-3/include/asm-generic/bitops/non-atomic.h
new file mode 100644
index 0000000..727f736
--- /dev/null
+++ b/ndk/platforms/android-3/include/asm-generic/bitops/non-atomic.h
@@ -0,0 +1,20 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_GENERIC_BITOPS_NON_ATOMIC_H_
+#define _ASM_GENERIC_BITOPS_NON_ATOMIC_H_
+
+#include <asm/types.h>
+
+#define BITOP_MASK(nr) (1UL << ((nr) % BITS_PER_LONG))
+#define BITOP_WORD(nr) ((nr) / BITS_PER_LONG)
+
+#endif
diff --git a/ndk/platforms/android-3/include/asm-generic/bug.h b/ndk/platforms/android-3/include/asm-generic/bug.h
new file mode 100644
index 0000000..d91a135
--- /dev/null
+++ b/ndk/platforms/android-3/include/asm-generic/bug.h
@@ -0,0 +1,33 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_GENERIC_BUG_H
+#define _ASM_GENERIC_BUG_H
+
+#include <linux/compiler.h>
+
+#ifndef HAVE_ARCH_BUG
+#define BUG()
+#endif
+
+#ifndef HAVE_ARCH_BUG_ON
+#define BUG_ON(condition) do { if (condition) ; } while(0)
+#endif
+
+#ifndef HAVE_ARCH_WARN_ON
+#define WARN_ON(condition) do { if (condition) ; } while(0)
+#endif
+
+#define WARN_ON_ONCE(condition)  ({   static int __warn_once = 1;   int __ret = 0;     if (unlikely((condition) && __warn_once)) {   __warn_once = 0;   WARN_ON(1);   __ret = 1;   }   __ret;  })
+
+#define WARN_ON_SMP(x) do { } while (0)
+
+#endif
diff --git a/ndk/platforms/android-3/include/asm-generic/cputime.h b/ndk/platforms/android-3/include/asm-generic/cputime.h
new file mode 100644
index 0000000..0486b87
--- /dev/null
+++ b/ndk/platforms/android-3/include/asm-generic/cputime.h
@@ -0,0 +1,60 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_GENERIC_CPUTIME_H
+#define _ASM_GENERIC_CPUTIME_H
+
+#include <linux/time.h>
+#include <linux/jiffies.h>
+
+typedef unsigned long cputime_t;
+
+#define cputime_zero (0UL)
+#define cputime_max ((~0UL >> 1) - 1)
+#define cputime_add(__a, __b) ((__a) + (__b))
+#define cputime_sub(__a, __b) ((__a) - (__b))
+#define cputime_div(__a, __n) ((__a) / (__n))
+#define cputime_halve(__a) ((__a) >> 1)
+#define cputime_eq(__a, __b) ((__a) == (__b))
+#define cputime_gt(__a, __b) ((__a) > (__b))
+#define cputime_ge(__a, __b) ((__a) >= (__b))
+#define cputime_lt(__a, __b) ((__a) < (__b))
+#define cputime_le(__a, __b) ((__a) <= (__b))
+#define cputime_to_jiffies(__ct) (__ct)
+#define jiffies_to_cputime(__hz) (__hz)
+
+typedef u64 cputime64_t;
+
+#define cputime64_zero (0ULL)
+#define cputime64_add(__a, __b) ((__a) + (__b))
+#define cputime64_sub(__a, __b) ((__a) - (__b))
+#define cputime64_to_jiffies64(__ct) (__ct)
+#define jiffies64_to_cputime64(__jif) (__jif)
+#define cputime_to_cputime64(__ct) ((u64) __ct)
+
+#define cputime_to_msecs(__ct) jiffies_to_msecs(__ct)
+#define msecs_to_cputime(__msecs) msecs_to_jiffies(__msecs)
+
+#define cputime_to_secs(jif) ((jif) / HZ)
+#define secs_to_cputime(sec) ((sec) * HZ)
+
+#define timespec_to_cputime(__val) timespec_to_jiffies(__val)
+#define cputime_to_timespec(__ct,__val) jiffies_to_timespec(__ct,__val)
+
+#define timeval_to_cputime(__val) timeval_to_jiffies(__val)
+#define cputime_to_timeval(__ct,__val) jiffies_to_timeval(__ct,__val)
+
+#define cputime_to_clock_t(__ct) jiffies_to_clock_t(__ct)
+#define clock_t_to_cputime(__x) clock_t_to_jiffies(__x)
+
+#define cputime64_to_clock_t(__ct) jiffies_64_to_clock_t(__ct)
+
+#endif
diff --git a/ndk/platforms/android-3/include/asm-generic/emergency-restart.h b/ndk/platforms/android-3/include/asm-generic/emergency-restart.h
new file mode 100644
index 0000000..619c682
--- /dev/null
+++ b/ndk/platforms/android-3/include/asm-generic/emergency-restart.h
@@ -0,0 +1,15 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_GENERIC_EMERGENCY_RESTART_H
+#define _ASM_GENERIC_EMERGENCY_RESTART_H
+
+#endif
diff --git a/ndk/platforms/android-3/include/asm-generic/errno-base.h b/ndk/platforms/android-3/include/asm-generic/errno-base.h
new file mode 100644
index 0000000..2fb4a33
--- /dev/null
+++ b/ndk/platforms/android-3/include/asm-generic/errno-base.h
@@ -0,0 +1,50 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_GENERIC_ERRNO_BASE_H
+#define _ASM_GENERIC_ERRNO_BASE_H
+
+#define EPERM 1  
+#define ENOENT 2  
+#define ESRCH 3  
+#define EINTR 4  
+#define EIO 5  
+#define ENXIO 6  
+#define E2BIG 7  
+#define ENOEXEC 8  
+#define EBADF 9  
+#define ECHILD 10  
+#define EAGAIN 11  
+#define ENOMEM 12  
+#define EACCES 13  
+#define EFAULT 14  
+#define ENOTBLK 15  
+#define EBUSY 16  
+#define EEXIST 17  
+#define EXDEV 18  
+#define ENODEV 19  
+#define ENOTDIR 20  
+#define EISDIR 21  
+#define EINVAL 22  
+#define ENFILE 23  
+#define EMFILE 24  
+#define ENOTTY 25  
+#define ETXTBSY 26  
+#define EFBIG 27  
+#define ENOSPC 28  
+#define ESPIPE 29  
+#define EROFS 30  
+#define EMLINK 31  
+#define EPIPE 32  
+#define EDOM 33  
+#define ERANGE 34  
+
+#endif
diff --git a/ndk/platforms/android-3/include/asm-generic/errno.h b/ndk/platforms/android-3/include/asm-generic/errno.h
new file mode 100644
index 0000000..11dd00f
--- /dev/null
+++ b/ndk/platforms/android-3/include/asm-generic/errno.h
@@ -0,0 +1,119 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_GENERIC_ERRNO_H
+#define _ASM_GENERIC_ERRNO_H
+
+#include <asm-generic/errno-base.h>
+
+#define EDEADLK 35  
+#define ENAMETOOLONG 36  
+#define ENOLCK 37  
+#define ENOSYS 38  
+#define ENOTEMPTY 39  
+#define ELOOP 40  
+#define EWOULDBLOCK EAGAIN  
+#define ENOMSG 42  
+#define EIDRM 43  
+#define ECHRNG 44  
+#define EL2NSYNC 45  
+#define EL3HLT 46  
+#define EL3RST 47  
+#define ELNRNG 48  
+#define EUNATCH 49  
+#define ENOCSI 50  
+#define EL2HLT 51  
+#define EBADE 52  
+#define EBADR 53  
+#define EXFULL 54  
+#define ENOANO 55  
+#define EBADRQC 56  
+#define EBADSLT 57  
+
+#define EDEADLOCK EDEADLK
+
+#define EBFONT 59  
+#define ENOSTR 60  
+#define ENODATA 61  
+#define ETIME 62  
+#define ENOSR 63  
+#define ENONET 64  
+#define ENOPKG 65  
+#define EREMOTE 66  
+#define ENOLINK 67  
+#define EADV 68  
+#define ESRMNT 69  
+#define ECOMM 70  
+#define EPROTO 71  
+#define EMULTIHOP 72  
+#define EDOTDOT 73  
+#define EBADMSG 74  
+#define EOVERFLOW 75  
+#define ENOTUNIQ 76  
+#define EBADFD 77  
+#define EREMCHG 78  
+#define ELIBACC 79  
+#define ELIBBAD 80  
+#define ELIBSCN 81  
+#define ELIBMAX 82  
+#define ELIBEXEC 83  
+#define EILSEQ 84  
+#define ERESTART 85  
+#define ESTRPIPE 86  
+#define EUSERS 87  
+#define ENOTSOCK 88  
+#define EDESTADDRREQ 89  
+#define EMSGSIZE 90  
+#define EPROTOTYPE 91  
+#define ENOPROTOOPT 92  
+#define EPROTONOSUPPORT 93  
+#define ESOCKTNOSUPPORT 94  
+#define EOPNOTSUPP 95  
+#define EPFNOSUPPORT 96  
+#define EAFNOSUPPORT 97  
+#define EADDRINUSE 98  
+#define EADDRNOTAVAIL 99  
+#define ENETDOWN 100  
+#define ENETUNREACH 101  
+#define ENETRESET 102  
+#define ECONNABORTED 103  
+#define ECONNRESET 104  
+#define ENOBUFS 105  
+#define EISCONN 106  
+#define ENOTCONN 107  
+#define ESHUTDOWN 108  
+#define ETOOMANYREFS 109  
+#define ETIMEDOUT 110  
+#define ECONNREFUSED 111  
+#define EHOSTDOWN 112  
+#define EHOSTUNREACH 113  
+#define EALREADY 114  
+#define EINPROGRESS 115  
+#define ESTALE 116  
+#define EUCLEAN 117  
+#define ENOTNAM 118  
+#define ENAVAIL 119  
+#define EISNAM 120  
+#define EREMOTEIO 121  
+#define EDQUOT 122  
+
+#define ENOMEDIUM 123  
+#define EMEDIUMTYPE 124  
+#define ECANCELED 125  
+#define ENOKEY 126  
+#define EKEYEXPIRED 127  
+#define EKEYREVOKED 128  
+#define EKEYREJECTED 129  
+
+#define EOWNERDEAD 130  
+#define ENOTRECOVERABLE 131  
+
+#endif
diff --git a/ndk/platforms/android-3/include/asm-generic/fcntl.h b/ndk/platforms/android-3/include/asm-generic/fcntl.h
new file mode 100644
index 0000000..a53b536
--- /dev/null
+++ b/ndk/platforms/android-3/include/asm-generic/fcntl.h
@@ -0,0 +1,148 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_GENERIC_FCNTL_H
+#define _ASM_GENERIC_FCNTL_H
+
+#include <linux/types.h>
+
+#define O_ACCMODE 00000003
+#define O_RDONLY 00000000
+#define O_WRONLY 00000001
+#define O_RDWR 00000002
+#ifndef O_CREAT
+#define O_CREAT 00000100  
+#endif
+#ifndef O_EXCL
+#define O_EXCL 00000200  
+#endif
+#ifndef O_NOCTTY
+#define O_NOCTTY 00000400  
+#endif
+#ifndef O_TRUNC
+#define O_TRUNC 00001000  
+#endif
+#ifndef O_APPEND
+#define O_APPEND 00002000
+#endif
+#ifndef O_NONBLOCK
+#define O_NONBLOCK 00004000
+#endif
+#ifndef O_SYNC
+#define O_SYNC 00010000
+#endif
+#ifndef FASYNC
+#define FASYNC 00020000  
+#endif
+#ifndef O_DIRECT
+#define O_DIRECT 00040000  
+#endif
+#ifndef O_LARGEFILE
+#define O_LARGEFILE 00100000
+#endif
+#ifndef O_DIRECTORY
+#define O_DIRECTORY 00200000  
+#endif
+#ifndef O_NOFOLLOW
+#define O_NOFOLLOW 00400000  
+#endif
+#ifndef O_NOATIME
+#define O_NOATIME 01000000
+#endif
+#ifndef O_NDELAY
+#define O_NDELAY O_NONBLOCK
+#endif
+
+#define F_DUPFD 0  
+#define F_GETFD 1  
+#define F_SETFD 2  
+#define F_GETFL 3  
+#define F_SETFL 4  
+#ifndef F_GETLK
+#define F_GETLK 5
+#define F_SETLK 6
+#define F_SETLKW 7
+#endif
+#ifndef F_SETOWN
+#define F_SETOWN 8  
+#define F_GETOWN 9  
+#endif
+#ifndef F_SETSIG
+#define F_SETSIG 10  
+#define F_GETSIG 11  
+#endif
+
+#define FD_CLOEXEC 1  
+
+#ifndef F_RDLCK
+#define F_RDLCK 0
+#define F_WRLCK 1
+#define F_UNLCK 2
+#endif
+
+#ifndef F_EXLCK
+#define F_EXLCK 4  
+#define F_SHLCK 8  
+#endif
+
+#ifndef F_INPROGRESS
+#define F_INPROGRESS 16
+#endif
+
+#define LOCK_SH 1  
+#define LOCK_EX 2  
+#define LOCK_NB 4  
+#define LOCK_UN 8  
+
+#define LOCK_MAND 32  
+#define LOCK_READ 64  
+#define LOCK_WRITE 128  
+#define LOCK_RW 192  
+
+#define F_LINUX_SPECIFIC_BASE 1024
+
+#ifndef HAVE_ARCH_STRUCT_FLOCK
+#ifndef __ARCH_FLOCK_PAD
+#define __ARCH_FLOCK_PAD
+#endif
+
+struct flock {
+ short l_type;
+ short l_whence;
+ off_t l_start;
+ off_t l_len;
+ pid_t l_pid;
+ __ARCH_FLOCK_PAD
+};
+#endif
+
+#ifndef F_GETLK64
+#define F_GETLK64 12  
+#define F_SETLK64 13
+#define F_SETLKW64 14
+#endif
+
+#ifndef HAVE_ARCH_STRUCT_FLOCK64
+#ifndef __ARCH_FLOCK64_PAD
+#define __ARCH_FLOCK64_PAD
+#endif
+
+struct flock64 {
+ short l_type;
+ short l_whence;
+ loff_t l_start;
+ loff_t l_len;
+ pid_t l_pid;
+ __ARCH_FLOCK64_PAD
+};
+#endif
+
+#endif
diff --git a/ndk/platforms/android-3/include/asm-generic/futex.h b/ndk/platforms/android-3/include/asm-generic/futex.h
new file mode 100644
index 0000000..05d3afe
--- /dev/null
+++ b/ndk/platforms/android-3/include/asm-generic/futex.h
@@ -0,0 +1,15 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_GENERIC_FUTEX_H
+#define _ASM_GENERIC_FUTEX_H
+
+#endif
diff --git a/ndk/platforms/android-3/include/asm-generic/ioctl.h b/ndk/platforms/android-3/include/asm-generic/ioctl.h
new file mode 100644
index 0000000..cba2b8e
--- /dev/null
+++ b/ndk/platforms/android-3/include/asm-generic/ioctl.h
@@ -0,0 +1,58 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_GENERIC_IOCTL_H
+#define _ASM_GENERIC_IOCTL_H
+
+#define _IOC_NRBITS 8
+#define _IOC_TYPEBITS 8
+#define _IOC_SIZEBITS 14
+#define _IOC_DIRBITS 2
+
+#define _IOC_NRMASK ((1 << _IOC_NRBITS)-1)
+#define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1)
+#define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS)-1)
+#define _IOC_DIRMASK ((1 << _IOC_DIRBITS)-1)
+
+#define _IOC_NRSHIFT 0
+#define _IOC_TYPESHIFT (_IOC_NRSHIFT+_IOC_NRBITS)
+#define _IOC_SIZESHIFT (_IOC_TYPESHIFT+_IOC_TYPEBITS)
+#define _IOC_DIRSHIFT (_IOC_SIZESHIFT+_IOC_SIZEBITS)
+
+#define _IOC_NONE 0U
+#define _IOC_WRITE 1U
+#define _IOC_READ 2U
+
+#define _IOC(dir,type,nr,size)   (((dir) << _IOC_DIRSHIFT) |   ((type) << _IOC_TYPESHIFT) |   ((nr) << _IOC_NRSHIFT) |   ((size) << _IOC_SIZESHIFT))
+
+extern unsigned int __invalid_size_argument_for_IOC;
+#define _IOC_TYPECHECK(t)   ((sizeof(t) == sizeof(t[1]) &&   sizeof(t) < (1 << _IOC_SIZEBITS)) ?   sizeof(t) : __invalid_size_argument_for_IOC)
+
+#define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0)
+#define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),(_IOC_TYPECHECK(size)))
+#define _IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),(_IOC_TYPECHECK(size)))
+#define _IOWR(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),(_IOC_TYPECHECK(size)))
+#define _IOR_BAD(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size))
+#define _IOW_BAD(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),sizeof(size))
+#define _IOWR_BAD(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size))
+
+#define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK)
+#define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK)
+#define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK)
+#define _IOC_SIZE(nr) (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK)
+
+#define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT)
+#define IOC_OUT (_IOC_READ << _IOC_DIRSHIFT)
+#define IOC_INOUT ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT)
+#define IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT)
+#define IOCSIZE_SHIFT (_IOC_SIZESHIFT)
+
+#endif
diff --git a/ndk/platforms/android-3/include/asm-generic/ipc.h b/ndk/platforms/android-3/include/asm-generic/ipc.h
new file mode 100644
index 0000000..57657a7
--- /dev/null
+++ b/ndk/platforms/android-3/include/asm-generic/ipc.h
@@ -0,0 +1,37 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_GENERIC_IPC_H
+#define _ASM_GENERIC_IPC_H
+
+struct ipc_kludge {
+ struct msgbuf __user *msgp;
+ long msgtyp;
+};
+
+#define SEMOP 1
+#define SEMGET 2
+#define SEMCTL 3
+#define SEMTIMEDOP 4
+#define MSGSND 11
+#define MSGRCV 12
+#define MSGGET 13
+#define MSGCTL 14
+#define SHMAT 21
+#define SHMDT 22
+#define SHMGET 23
+#define SHMCTL 24
+
+#define DIPC 25
+
+#define IPCCALL(version,op) ((version)<<16 | (op))
+
+#endif
diff --git a/ndk/platforms/android-3/include/asm-generic/local.h b/ndk/platforms/android-3/include/asm-generic/local.h
new file mode 100644
index 0000000..cae0d54
--- /dev/null
+++ b/ndk/platforms/android-3/include/asm-generic/local.h
@@ -0,0 +1,51 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_GENERIC_LOCAL_H
+#define _ASM_GENERIC_LOCAL_H
+
+#include <linux/percpu.h>
+#include <linux/hardirq.h>
+#include <asm/atomic.h>
+#include <asm/types.h>
+
+typedef struct
+{
+ atomic_long_t a;
+} local_t;
+
+#define LOCAL_INIT(i) { ATOMIC_LONG_INIT(i) }
+
+#define local_read(l) atomic_long_read(&(l)->a)
+#define local_set(l,i) atomic_long_set((&(l)->a),(i))
+#define local_inc(l) atomic_long_inc(&(l)->a)
+#define local_dec(l) atomic_long_dec(&(l)->a)
+#define local_add(i,l) atomic_long_add((i),(&(l)->a))
+#define local_sub(i,l) atomic_long_sub((i),(&(l)->a))
+
+#define __local_inc(l) local_set((l), local_read(l) + 1)
+#define __local_dec(l) local_set((l), local_read(l) - 1)
+#define __local_add(i,l) local_set((l), local_read(l) + (i))
+#define __local_sub(i,l) local_set((l), local_read(l) - (i))
+
+#define cpu_local_read(v) local_read(&__get_cpu_var(v))
+#define cpu_local_set(v, i) local_set(&__get_cpu_var(v), (i))
+#define cpu_local_inc(v) local_inc(&__get_cpu_var(v))
+#define cpu_local_dec(v) local_dec(&__get_cpu_var(v))
+#define cpu_local_add(i, v) local_add((i), &__get_cpu_var(v))
+#define cpu_local_sub(i, v) local_sub((i), &__get_cpu_var(v))
+
+#define __cpu_local_inc(v) __local_inc(&__get_cpu_var(v))
+#define __cpu_local_dec(v) __local_dec(&__get_cpu_var(v))
+#define __cpu_local_add(i, v) __local_add((i), &__get_cpu_var(v))
+#define __cpu_local_sub(i, v) __local_sub((i), &__get_cpu_var(v))
+
+#endif
diff --git a/ndk/platforms/android-3/include/asm-generic/memory_model.h b/ndk/platforms/android-3/include/asm-generic/memory_model.h
new file mode 100644
index 0000000..fa7602e
--- /dev/null
+++ b/ndk/platforms/android-3/include/asm-generic/memory_model.h
@@ -0,0 +1,15 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASM_MEMORY_MODEL_H
+#define __ASM_MEMORY_MODEL_H
+
+#endif
diff --git a/ndk/platforms/android-3/include/asm-generic/mman.h b/ndk/platforms/android-3/include/asm-generic/mman.h
new file mode 100644
index 0000000..98d2783
--- /dev/null
+++ b/ndk/platforms/android-3/include/asm-generic/mman.h
@@ -0,0 +1,46 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_GENERIC_MMAN_H
+#define _ASM_GENERIC_MMAN_H
+
+#define PROT_READ 0x1  
+#define PROT_WRITE 0x2  
+#define PROT_EXEC 0x4  
+#define PROT_SEM 0x8  
+#define PROT_NONE 0x0  
+#define PROT_GROWSDOWN 0x01000000  
+#define PROT_GROWSUP 0x02000000  
+
+#define MAP_SHARED 0x01  
+#define MAP_PRIVATE 0x02  
+#define MAP_TYPE 0x0f  
+#define MAP_FIXED 0x10  
+#define MAP_ANONYMOUS 0x20  
+
+#define MS_ASYNC 1  
+#define MS_INVALIDATE 2  
+#define MS_SYNC 4  
+
+#define MADV_NORMAL 0  
+#define MADV_RANDOM 1  
+#define MADV_SEQUENTIAL 2  
+#define MADV_WILLNEED 3  
+#define MADV_DONTNEED 4  
+
+#define MADV_REMOVE 9  
+#define MADV_DONTFORK 10  
+#define MADV_DOFORK 11  
+
+#define MAP_ANON MAP_ANONYMOUS
+#define MAP_FILE 0
+
+#endif
diff --git a/ndk/platforms/android-3/include/asm-generic/mutex-xchg.h b/ndk/platforms/android-3/include/asm-generic/mutex-xchg.h
new file mode 100644
index 0000000..63a557e
--- /dev/null
+++ b/ndk/platforms/android-3/include/asm-generic/mutex-xchg.h
@@ -0,0 +1,16 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_GENERIC_MUTEX_XCHG_H
+#define _ASM_GENERIC_MUTEX_XCHG_H
+
+#define __mutex_slowpath_needs_to_unlock() 0
+#endif
diff --git a/ndk/platforms/android-3/include/asm-generic/percpu.h b/ndk/platforms/android-3/include/asm-generic/percpu.h
new file mode 100644
index 0000000..e498300
--- /dev/null
+++ b/ndk/platforms/android-3/include/asm-generic/percpu.h
@@ -0,0 +1,29 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_GENERIC_PERCPU_H_
+#define _ASM_GENERIC_PERCPU_H_
+#include <linux/compiler.h>
+
+#define __GENERIC_PER_CPU
+
+#define DEFINE_PER_CPU(type, name)   __typeof__(type) per_cpu__##name
+
+#define per_cpu(var, cpu) (*((void)(cpu), &per_cpu__##var))
+#define __get_cpu_var(var) per_cpu__##var
+#define __raw_get_cpu_var(var) per_cpu__##var
+
+#define DECLARE_PER_CPU(type, name) extern __typeof__(type) per_cpu__##name
+
+#define EXPORT_PER_CPU_SYMBOL(var) EXPORT_SYMBOL(per_cpu__##var)
+#define EXPORT_PER_CPU_SYMBOL_GPL(var) EXPORT_SYMBOL_GPL(per_cpu__##var)
+
+#endif
diff --git a/ndk/platforms/android-3/include/asm-generic/pgtable-nopud.h b/ndk/platforms/android-3/include/asm-generic/pgtable-nopud.h
new file mode 100644
index 0000000..585f816
--- /dev/null
+++ b/ndk/platforms/android-3/include/asm-generic/pgtable-nopud.h
@@ -0,0 +1,39 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _PGTABLE_NOPUD_H
+#define _PGTABLE_NOPUD_H
+
+#ifndef __ASSEMBLY__
+
+#define __PAGETABLE_PUD_FOLDED
+
+typedef struct { pgd_t pgd; } pud_t;
+
+#define PUD_SHIFT PGDIR_SHIFT
+#define PTRS_PER_PUD 1
+#define PUD_SIZE (1UL << PUD_SHIFT)
+#define PUD_MASK (~(PUD_SIZE-1))
+
+#define pud_ERROR(pud) (pgd_ERROR((pud).pgd))
+#define pgd_populate(mm, pgd, pud) do { } while (0)
+#define set_pgd(pgdptr, pgdval) set_pud((pud_t *)(pgdptr), (pud_t) { pgdval })
+#define pud_val(x) (pgd_val((x).pgd))
+#define __pud(x) ((pud_t) { __pgd(x) } )
+#define pgd_page(pgd) (pud_page((pud_t){ pgd }))
+#define pgd_page_kernel(pgd) (pud_page_kernel((pud_t){ pgd }))
+#define pud_alloc_one(mm, address) NULL
+#define pud_free(x) do { } while (0)
+#define __pud_free_tlb(tlb, x) do { } while (0)
+#undef pud_addr_end
+#define pud_addr_end(addr, end) (end)
+#endif
+#endif
diff --git a/ndk/platforms/android-3/include/asm-generic/pgtable.h b/ndk/platforms/android-3/include/asm-generic/pgtable.h
new file mode 100644
index 0000000..a21cdba
--- /dev/null
+++ b/ndk/platforms/android-3/include/asm-generic/pgtable.h
@@ -0,0 +1,95 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_GENERIC_PGTABLE_H
+#define _ASM_GENERIC_PGTABLE_H
+
+#ifndef __HAVE_ARCH_PTEP_ESTABLISH
+
+#ifndef __HAVE_ARCH_SET_PTE_ATOMIC
+#define ptep_establish(__vma, __address, __ptep, __entry)  do {   set_pte_at((__vma)->vm_mm, (__address), __ptep, __entry);   flush_tlb_page(__vma, __address);  } while (0)
+#else
+#define ptep_establish(__vma, __address, __ptep, __entry)  do {   set_pte_atomic(__ptep, __entry);   flush_tlb_page(__vma, __address);  } while (0)
+#endif
+#endif
+
+#ifndef __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS
+
+#define ptep_set_access_flags(__vma, __address, __ptep, __entry, __dirty)  do {   set_pte_at((__vma)->vm_mm, (__address), __ptep, __entry);   flush_tlb_page(__vma, __address);  } while (0)
+#endif
+
+#ifndef __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
+#define ptep_test_and_clear_young(__vma, __address, __ptep)  ({   pte_t __pte = *(__ptep);   int r = 1;   if (!pte_young(__pte))   r = 0;   else   set_pte_at((__vma)->vm_mm, (__address),   (__ptep), pte_mkold(__pte));   r;  })
+#endif
+
+#ifndef __HAVE_ARCH_PTEP_CLEAR_YOUNG_FLUSH
+#define ptep_clear_flush_young(__vma, __address, __ptep)  ({   int __young;   __young = ptep_test_and_clear_young(__vma, __address, __ptep);   if (__young)   flush_tlb_page(__vma, __address);   __young;  })
+#endif
+
+#ifndef __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY
+#define ptep_test_and_clear_dirty(__vma, __address, __ptep)  ({   pte_t __pte = *__ptep;   int r = 1;   if (!pte_dirty(__pte))   r = 0;   else   set_pte_at((__vma)->vm_mm, (__address), (__ptep),   pte_mkclean(__pte));   r;  })
+#endif
+
+#ifndef __HAVE_ARCH_PTEP_CLEAR_DIRTY_FLUSH
+#define ptep_clear_flush_dirty(__vma, __address, __ptep)  ({   int __dirty;   __dirty = ptep_test_and_clear_dirty(__vma, __address, __ptep);   if (__dirty)   flush_tlb_page(__vma, __address);   __dirty;  })
+#endif
+
+#ifndef __HAVE_ARCH_PTEP_GET_AND_CLEAR
+#define ptep_get_and_clear(__mm, __address, __ptep)  ({   pte_t __pte = *(__ptep);   pte_clear((__mm), (__address), (__ptep));   __pte;  })
+#endif
+
+#ifndef __HAVE_ARCH_PTEP_GET_AND_CLEAR_FULL
+#define ptep_get_and_clear_full(__mm, __address, __ptep, __full)  ({   pte_t __pte;   __pte = ptep_get_and_clear((__mm), (__address), (__ptep));   __pte;  })
+#endif
+
+#ifndef __HAVE_ARCH_PTE_CLEAR_FULL
+#define pte_clear_full(__mm, __address, __ptep, __full)  do {   pte_clear((__mm), (__address), (__ptep));  } while (0)
+#endif
+
+#ifndef __HAVE_ARCH_PTEP_CLEAR_FLUSH
+#define ptep_clear_flush(__vma, __address, __ptep)  ({   pte_t __pte;   __pte = ptep_get_and_clear((__vma)->vm_mm, __address, __ptep);   flush_tlb_page(__vma, __address);   __pte;  })
+#endif
+
+#ifndef __HAVE_ARCH_PTEP_SET_WRPROTECT
+struct mm_struct;
+#endif
+#ifndef __HAVE_ARCH_PTE_SAME
+#define pte_same(A,B) (pte_val(A) == pte_val(B))
+#endif
+#ifndef __HAVE_ARCH_PAGE_TEST_AND_CLEAR_DIRTY
+#define page_test_and_clear_dirty(page) (0)
+#define pte_maybe_dirty(pte) pte_dirty(pte)
+#else
+#define pte_maybe_dirty(pte) (1)
+#endif
+#ifndef __HAVE_ARCH_PAGE_TEST_AND_CLEAR_YOUNG
+#define page_test_and_clear_young(page) (0)
+#endif
+#ifndef __HAVE_ARCH_PGD_OFFSET_GATE
+#define pgd_offset_gate(mm, addr) pgd_offset(mm, addr)
+#endif
+#ifndef __HAVE_ARCH_LAZY_MMU_PROT_UPDATE
+#define lazy_mmu_prot_update(pte) do { } while (0)
+#endif
+#ifndef __HAVE_ARCH_MOVE_PTE
+#define move_pte(pte, prot, old_addr, new_addr) (pte)
+#endif
+#define pgd_addr_end(addr, end)  ({ unsigned long __boundary = ((addr) + PGDIR_SIZE) & PGDIR_MASK;   (__boundary - 1 < (end) - 1)? __boundary: (end);  })
+#ifndef pud_addr_end
+#define pud_addr_end(addr, end)  ({ unsigned long __boundary = ((addr) + PUD_SIZE) & PUD_MASK;   (__boundary - 1 < (end) - 1)? __boundary: (end);  })
+#endif
+#ifndef pmd_addr_end
+#define pmd_addr_end(addr, end)  ({ unsigned long __boundary = ((addr) + PMD_SIZE) & PMD_MASK;   (__boundary - 1 < (end) - 1)? __boundary: (end);  })
+#endif
+#ifndef __ASSEMBLY__
+
+#endif
+#endif
diff --git a/ndk/platforms/android-3/include/asm-generic/poll.h b/ndk/platforms/android-3/include/asm-generic/poll.h
new file mode 100644
index 0000000..b8cd3da
--- /dev/null
+++ b/ndk/platforms/android-3/include/asm-generic/poll.h
@@ -0,0 +1,46 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASM_GENERIC_POLL_H
+#define __ASM_GENERIC_POLL_H
+
+#define POLLIN 0x0001
+#define POLLPRI 0x0002
+#define POLLOUT 0x0004
+#define POLLERR 0x0008
+#define POLLHUP 0x0010
+#define POLLNVAL 0x0020
+
+#define POLLRDNORM 0x0040
+#define POLLRDBAND 0x0080
+#ifndef POLLWRNORM
+#define POLLWRNORM 0x0100
+#endif
+#ifndef POLLWRBAND
+#define POLLWRBAND 0x0200
+#endif
+#ifndef POLLMSG
+#define POLLMSG 0x0400
+#endif
+#ifndef POLLREMOVE
+#define POLLREMOVE 0x1000
+#endif
+#ifndef POLLRDHUP
+#define POLLRDHUP 0x2000
+#endif
+
+struct pollfd {
+ int fd;
+ short events;
+ short revents;
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/asm-generic/resource.h b/ndk/platforms/android-3/include/asm-generic/resource.h
new file mode 100644
index 0000000..a7f7dec
--- /dev/null
+++ b/ndk/platforms/android-3/include/asm-generic/resource.h
@@ -0,0 +1,57 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_GENERIC_RESOURCE_H
+#define _ASM_GENERIC_RESOURCE_H
+
+#define RLIMIT_CPU 0  
+#define RLIMIT_FSIZE 1  
+#define RLIMIT_DATA 2  
+#define RLIMIT_STACK 3  
+#define RLIMIT_CORE 4  
+
+#ifndef RLIMIT_RSS
+#define RLIMIT_RSS 5  
+#endif
+
+#ifndef RLIMIT_NPROC
+#define RLIMIT_NPROC 6  
+#endif
+
+#ifndef RLIMIT_NOFILE
+#define RLIMIT_NOFILE 7  
+#endif
+
+#ifndef RLIMIT_MEMLOCK
+#define RLIMIT_MEMLOCK 8  
+#endif
+
+#ifndef RLIMIT_AS
+#define RLIMIT_AS 9  
+#endif
+
+#define RLIMIT_LOCKS 10  
+#define RLIMIT_SIGPENDING 11  
+#define RLIMIT_MSGQUEUE 12  
+#define RLIMIT_NICE 13  
+#define RLIMIT_RTPRIO 14  
+
+#define RLIM_NLIMITS 15
+
+#ifndef RLIM_INFINITY
+#define RLIM_INFINITY (~0UL)
+#endif
+
+#ifndef _STK_LIM_MAX
+#define _STK_LIM_MAX RLIM_INFINITY
+#endif
+
+#endif
diff --git a/ndk/platforms/android-3/include/asm-generic/sections.h b/ndk/platforms/android-3/include/asm-generic/sections.h
new file mode 100644
index 0000000..e9eaa46
--- /dev/null
+++ b/ndk/platforms/android-3/include/asm-generic/sections.h
@@ -0,0 +1,15 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_GENERIC_SECTIONS_H_
+#define _ASM_GENERIC_SECTIONS_H_
+
+#endif
diff --git a/ndk/platforms/android-3/include/asm-generic/siginfo.h b/ndk/platforms/android-3/include/asm-generic/siginfo.h
new file mode 100644
index 0000000..d6743a7
--- /dev/null
+++ b/ndk/platforms/android-3/include/asm-generic/siginfo.h
@@ -0,0 +1,213 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_GENERIC_SIGINFO_H
+#define _ASM_GENERIC_SIGINFO_H
+
+#include <linux/compiler.h>
+#include <linux/types.h>
+
+typedef union sigval {
+ int sival_int;
+ void __user *sival_ptr;
+} sigval_t;
+
+#ifndef __ARCH_SI_PREAMBLE_SIZE
+#define __ARCH_SI_PREAMBLE_SIZE (3 * sizeof(int))
+#endif
+
+#define SI_MAX_SIZE 128
+#ifndef SI_PAD_SIZE
+#define SI_PAD_SIZE ((SI_MAX_SIZE - __ARCH_SI_PREAMBLE_SIZE) / sizeof(int))
+#endif
+
+#ifndef __ARCH_SI_UID_T
+#define __ARCH_SI_UID_T uid_t
+#endif
+
+#ifndef __ARCH_SI_BAND_T
+#define __ARCH_SI_BAND_T long
+#endif
+
+#ifndef HAVE_ARCH_SIGINFO_T
+
+typedef struct siginfo {
+ int si_signo;
+ int si_errno;
+ int si_code;
+
+ union {
+ int _pad[SI_PAD_SIZE];
+
+ struct {
+ pid_t _pid;
+ __ARCH_SI_UID_T _uid;
+ } _kill;
+
+ struct {
+ timer_t _tid;
+ int _overrun;
+ char _pad[sizeof( __ARCH_SI_UID_T) - sizeof(int)];
+ sigval_t _sigval;
+ int _sys_private;
+ } _timer;
+
+ struct {
+ pid_t _pid;
+ __ARCH_SI_UID_T _uid;
+ sigval_t _sigval;
+ } _rt;
+
+ struct {
+ pid_t _pid;
+ __ARCH_SI_UID_T _uid;
+ int _status;
+ clock_t _utime;
+ clock_t _stime;
+ } _sigchld;
+
+ struct {
+ void __user *_addr;
+#ifdef __ARCH_SI_TRAPNO
+ int _trapno;
+#endif
+ } _sigfault;
+
+ struct {
+ __ARCH_SI_BAND_T _band;
+ int _fd;
+ } _sigpoll;
+ } _sifields;
+} siginfo_t;
+
+#endif
+
+#define si_pid _sifields._kill._pid
+#define si_uid _sifields._kill._uid
+#define si_tid _sifields._timer._tid
+#define si_overrun _sifields._timer._overrun
+#define si_sys_private _sifields._timer._sys_private
+#define si_status _sifields._sigchld._status
+#define si_utime _sifields._sigchld._utime
+#define si_stime _sifields._sigchld._stime
+#define si_value _sifields._rt._sigval
+#define si_int _sifields._rt._sigval.sival_int
+#define si_ptr _sifields._rt._sigval.sival_ptr
+#define si_addr _sifields._sigfault._addr
+#ifdef __ARCH_SI_TRAPNO
+#define si_trapno _sifields._sigfault._trapno
+#endif
+#define si_band _sifields._sigpoll._band
+#define si_fd _sifields._sigpoll._fd
+
+#define __SI_KILL 0
+#define __SI_TIMER 0
+#define __SI_POLL 0
+#define __SI_FAULT 0
+#define __SI_CHLD 0
+#define __SI_RT 0
+#define __SI_MESGQ 0
+#define __SI_CODE(T,N) (N)
+
+#define SI_USER 0  
+#define SI_KERNEL 0x80  
+#define SI_QUEUE -1  
+#define SI_TIMER __SI_CODE(__SI_TIMER,-2)  
+#define SI_MESGQ __SI_CODE(__SI_MESGQ,-3)  
+#define SI_ASYNCIO -4  
+#define SI_SIGIO -5  
+#define SI_TKILL -6  
+#define SI_DETHREAD -7  
+
+#define SI_FROMUSER(siptr) ((siptr)->si_code <= 0)
+#define SI_FROMKERNEL(siptr) ((siptr)->si_code > 0)
+
+#define ILL_ILLOPC (__SI_FAULT|1)  
+#define ILL_ILLOPN (__SI_FAULT|2)  
+#define ILL_ILLADR (__SI_FAULT|3)  
+#define ILL_ILLTRP (__SI_FAULT|4)  
+#define ILL_PRVOPC (__SI_FAULT|5)  
+#define ILL_PRVREG (__SI_FAULT|6)  
+#define ILL_COPROC (__SI_FAULT|7)  
+#define ILL_BADSTK (__SI_FAULT|8)  
+#define NSIGILL 8
+
+#define FPE_INTDIV (__SI_FAULT|1)  
+#define FPE_INTOVF (__SI_FAULT|2)  
+#define FPE_FLTDIV (__SI_FAULT|3)  
+#define FPE_FLTOVF (__SI_FAULT|4)  
+#define FPE_FLTUND (__SI_FAULT|5)  
+#define FPE_FLTRES (__SI_FAULT|6)  
+#define FPE_FLTINV (__SI_FAULT|7)  
+#define FPE_FLTSUB (__SI_FAULT|8)  
+#define NSIGFPE 8
+
+#define SEGV_MAPERR (__SI_FAULT|1)  
+#define SEGV_ACCERR (__SI_FAULT|2)  
+#define NSIGSEGV 2
+
+#define BUS_ADRALN (__SI_FAULT|1)  
+#define BUS_ADRERR (__SI_FAULT|2)  
+#define BUS_OBJERR (__SI_FAULT|3)  
+#define NSIGBUS 3
+
+#define TRAP_BRKPT (__SI_FAULT|1)  
+#define TRAP_TRACE (__SI_FAULT|2)  
+#define NSIGTRAP 2
+
+#define CLD_EXITED (__SI_CHLD|1)  
+#define CLD_KILLED (__SI_CHLD|2)  
+#define CLD_DUMPED (__SI_CHLD|3)  
+#define CLD_TRAPPED (__SI_CHLD|4)  
+#define CLD_STOPPED (__SI_CHLD|5)  
+#define CLD_CONTINUED (__SI_CHLD|6)  
+#define NSIGCHLD 6
+
+#define POLL_IN (__SI_POLL|1)  
+#define POLL_OUT (__SI_POLL|2)  
+#define POLL_MSG (__SI_POLL|3)  
+#define POLL_ERR (__SI_POLL|4)  
+#define POLL_PRI (__SI_POLL|5)  
+#define POLL_HUP (__SI_POLL|6)  
+#define NSIGPOLL 6
+
+#define SIGEV_SIGNAL 0  
+#define SIGEV_NONE 1  
+#define SIGEV_THREAD 2  
+#define SIGEV_THREAD_ID 4  
+
+#ifndef __ARCH_SIGEV_PREAMBLE_SIZE
+#define __ARCH_SIGEV_PREAMBLE_SIZE (sizeof(int) * 2 + sizeof(sigval_t))
+#endif
+
+#define SIGEV_MAX_SIZE 64
+#define SIGEV_PAD_SIZE ((SIGEV_MAX_SIZE - __ARCH_SIGEV_PREAMBLE_SIZE)   / sizeof(int))
+
+typedef struct sigevent {
+ sigval_t sigev_value;
+ int sigev_signo;
+ int sigev_notify;
+ union {
+ int _pad[SIGEV_PAD_SIZE];
+ int _tid;
+
+ struct {
+ void (*_function)(sigval_t);
+ void *_attribute;
+ } _sigev_thread;
+ } _sigev_un;
+} sigevent_t;
+
+#define sigev_notify_function _sigev_un._sigev_thread._function
+#define sigev_notify_attributes _sigev_un._sigev_thread._attribute
+#define sigev_notify_thread_id _sigev_un._tid
+
+#endif
diff --git a/ndk/platforms/android-3/include/asm-generic/signal.h b/ndk/platforms/android-3/include/asm-generic/signal.h
new file mode 100644
index 0000000..226d99c
--- /dev/null
+++ b/ndk/platforms/android-3/include/asm-generic/signal.h
@@ -0,0 +1,39 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASM_GENERIC_SIGNAL_H
+#define __ASM_GENERIC_SIGNAL_H
+
+#include <linux/compiler.h>
+
+#ifndef SIG_BLOCK
+#define SIG_BLOCK 0  
+#endif
+#ifndef SIG_UNBLOCK
+#define SIG_UNBLOCK 1  
+#endif
+#ifndef SIG_SETMASK
+#define SIG_SETMASK 2  
+#endif
+
+#ifndef __ASSEMBLY__
+typedef void __signalfn_t(int);
+typedef __signalfn_t __user *__sighandler_t;
+
+typedef void __restorefn_t(void);
+typedef __restorefn_t __user *__sigrestore_t;
+
+#define SIG_DFL ((__force __sighandler_t)0)  
+#define SIG_IGN ((__force __sighandler_t)1)  
+#define SIG_ERR ((__force __sighandler_t)-1)  
+#endif
+
+#endif
diff --git a/ndk/platforms/android-3/include/asm-generic/tlb.h b/ndk/platforms/android-3/include/asm-generic/tlb.h
new file mode 100644
index 0000000..dc1e79f
--- /dev/null
+++ b/ndk/platforms/android-3/include/asm-generic/tlb.h
@@ -0,0 +1,37 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_GENERIC__TLB_H
+#define _ASM_GENERIC__TLB_H
+
+#include <linux/swap.h>
+#include <asm/pgalloc.h>
+#include <asm/tlbflush.h>
+
+#define FREE_PTE_NR 1
+#define tlb_fast_mode(tlb) 1
+
+struct mmu_gather {
+ struct mm_struct *mm;
+ unsigned int nr;
+ unsigned int need_flush;
+ unsigned int fullmm;
+ struct page * pages[FREE_PTE_NR];
+};
+
+#define tlb_remove_tlb_entry(tlb, ptep, address)   do {   tlb->need_flush = 1;   __tlb_remove_tlb_entry(tlb, ptep, address);   } while (0)
+#define pte_free_tlb(tlb, ptep)   do {   tlb->need_flush = 1;   __pte_free_tlb(tlb, ptep);   } while (0)
+#ifndef __ARCH_HAS_4LEVEL_HACK
+#define pud_free_tlb(tlb, pudp)   do {   tlb->need_flush = 1;   __pud_free_tlb(tlb, pudp);   } while (0)
+#endif
+#define pmd_free_tlb(tlb, pmdp)   do {   tlb->need_flush = 1;   __pmd_free_tlb(tlb, pmdp);   } while (0)
+#define tlb_migrate_finish(mm) do {} while (0)
+#endif
diff --git a/ndk/platforms/android-3/include/asm-generic/topology.h b/ndk/platforms/android-3/include/asm-generic/topology.h
new file mode 100644
index 0000000..089b1f2
--- /dev/null
+++ b/ndk/platforms/android-3/include/asm-generic/topology.h
@@ -0,0 +1,35 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_GENERIC_TOPOLOGY_H
+#define _ASM_GENERIC_TOPOLOGY_H
+
+#ifndef cpu_to_node
+#define cpu_to_node(cpu) (0)
+#endif
+#ifndef parent_node
+#define parent_node(node) (0)
+#endif
+#ifndef node_to_cpumask
+#define node_to_cpumask(node) (cpu_online_map)
+#endif
+#ifndef node_to_first_cpu
+#define node_to_first_cpu(node) (0)
+#endif
+#ifndef pcibus_to_node
+#define pcibus_to_node(node) (-1)
+#endif
+
+#ifndef pcibus_to_cpumask
+#define pcibus_to_cpumask(bus) (pcibus_to_node(bus) == -1 ?   CPU_MASK_ALL :   node_to_cpumask(pcibus_to_node(bus))   )
+#endif
+
+#endif
diff --git a/ndk/platforms/android-3/include/asm-generic/xor.h b/ndk/platforms/android-3/include/asm-generic/xor.h
new file mode 100644
index 0000000..6b1e4e8
--- /dev/null
+++ b/ndk/platforms/android-3/include/asm-generic/xor.h
@@ -0,0 +1,14 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#include <asm/processor.h>
+
+#define XOR_TRY_TEMPLATES   do {   xor_speed(&xor_block_8regs);   xor_speed(&xor_block_8regs_p);   xor_speed(&xor_block_32regs);   xor_speed(&xor_block_32regs_p);   } while (0)
diff --git a/ndk/platforms/android-3/include/assert.h b/ndk/platforms/android-3/include/assert.h
new file mode 100644
index 0000000..62470f5
--- /dev/null
+++ b/ndk/platforms/android-3/include/assert.h
@@ -0,0 +1,65 @@
+/*	$OpenBSD: assert.h,v 1.12 2006/01/31 10:53:51 hshoexer Exp $	*/
+/*	$NetBSD: assert.h,v 1.6 1994/10/26 00:55:44 cgd Exp $	*/
+
+/*-
+ * Copyright (c) 1992, 1993
+ *	The Regents of the University of California.  All rights reserved.
+ * (c) UNIX System Laboratories, Inc.
+ * All or some portions of this file are derived from material licensed
+ * to the University of California by American Telephone and Telegraph
+ * Co. or Unix System Laboratories, Inc. and are reproduced herein with
+ * the permission of UNIX System Laboratories, Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ * 3. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
+ *
+ *	@(#)assert.h	8.2 (Berkeley) 1/21/94
+ */
+
+/*
+ * Unlike other ANSI header files, <assert.h> may usefully be included
+ * multiple times, with and without NDEBUG defined.
+ */
+
+#include <sys/cdefs.h>
+
+#undef assert
+#undef _assert
+
+#ifdef NDEBUG
+# define	assert(e)	((void)0)
+# define	_assert(e)	((void)0)
+#else
+# define	_assert(e)	assert(e)
+# if __ISO_C_VISIBLE >= 1999
+#  define	assert(e)	((e) ? (void)0 : __assert2(__FILE__, __LINE__, __func__, #e))
+# else
+#  define	assert(e)	((e) ? (void)0 : __assert(__FILE__, __LINE__, #e))
+# endif
+#endif
+
+__BEGIN_DECLS
+__dead void __assert(const char *, int, const char *);
+__dead void __assert2(const char *, int, const char *, const char *);
+__END_DECLS
diff --git a/ndk/platforms/android-3/include/byteswap.h b/ndk/platforms/android-3/include/byteswap.h
new file mode 100644
index 0000000..16d2ad4
--- /dev/null
+++ b/ndk/platforms/android-3/include/byteswap.h
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _BYTESWAP_H_
+#define _BYTESWAP_H_
+
+#include <sys/endian.h>
+
+#define  bswap_16(x)   swap16(x)
+#define  bswap_32(x)   swap32(x)
+#define  bswap_64(x)   swap64(x)
+
+#endif /* _BYTESWAP_H_ */
diff --git a/ndk/platforms/android-3/include/ctype.h b/ndk/platforms/android-3/include/ctype.h
new file mode 100644
index 0000000..58b76ea
--- /dev/null
+++ b/ndk/platforms/android-3/include/ctype.h
@@ -0,0 +1,207 @@
+/*	$OpenBSD: ctype.h,v 1.19 2005/12/13 00:35:22 millert Exp $	*/
+/*	$NetBSD: ctype.h,v 1.14 1994/10/26 00:55:47 cgd Exp $	*/
+
+/*
+ * Copyright (c) 1989 The Regents of the University of California.
+ * All rights reserved.
+ * (c) UNIX System Laboratories, Inc.
+ * All or some portions of this file are derived from material licensed
+ * to the University of California by American Telephone and Telegraph
+ * Co. or Unix System Laboratories, Inc. and are reproduced herein with
+ * the permission of UNIX System Laboratories, Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ * 3. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
+ *
+ *	@(#)ctype.h	5.3 (Berkeley) 4/3/91
+ */
+
+#ifndef _CTYPE_H_
+#define _CTYPE_H_
+
+#include <sys/cdefs.h>
+
+#define	_U	0x01
+#define	_L	0x02
+#define	_N	0x04
+#define	_S	0x08
+#define	_P	0x10
+#define	_C	0x20
+#define	_X	0x40
+#define	_B	0x80
+
+__BEGIN_DECLS
+
+extern const char	*_ctype_;
+extern const short	*_tolower_tab_;
+extern const short	*_toupper_tab_;
+
+/* extern __inline is a GNU C extension */
+#ifdef __GNUC__
+#  if defined(__GNUC_STDC_INLINE__)
+#define	__CTYPE_INLINE	extern __inline __attribute__((__gnu_inline__))
+#  else
+#define	__CTYPE_INLINE	extern __inline
+#  endif
+#else
+#define	__CTYPE_INLINE	static __inline
+#endif
+
+#if defined(__GNUC__) || defined(_ANSI_LIBRARY) || defined(lint)
+int	isalnum(int);
+int	isalpha(int);
+int	iscntrl(int);
+int	isdigit(int);
+int	isgraph(int);
+int	islower(int);
+int	isprint(int);
+int	ispunct(int);
+int	isspace(int);
+int	isupper(int);
+int	isxdigit(int);
+int	tolower(int);
+int	toupper(int);
+
+#if __BSD_VISIBLE || __ISO_C_VISIBLE >= 1999 || __POSIX_VISIBLE > 200112 \
+    || __XPG_VISIBLE > 600
+int	isblank(int);
+#endif
+
+#if __BSD_VISIBLE || __XPG_VISIBLE
+int	isascii(int);
+int	toascii(int);
+int	_tolower(int);
+int	_toupper(int);
+#endif /* __BSD_VISIBLE || __XPG_VISIBLE */
+
+#endif /* __GNUC__ || _ANSI_LIBRARY || lint */
+
+#if defined(NDEBUG)
+
+__CTYPE_INLINE int isalnum(int c)
+{
+	return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)c] & (_U|_L|_N)));
+}
+
+__CTYPE_INLINE int isalpha(int c)
+{
+	return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)c] & (_U|_L)));
+}
+
+__CTYPE_INLINE int iscntrl(int c)
+{
+	return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)c] & _C));
+}
+
+__CTYPE_INLINE int isdigit(int c)
+{
+	return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)c] & _N));
+}
+
+__CTYPE_INLINE int isgraph(int c)
+{
+	return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)c] & (_P|_U|_L|_N)));
+}
+
+__CTYPE_INLINE int islower(int c)
+{
+	return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)c] & _L));
+}
+
+__CTYPE_INLINE int isprint(int c)
+{
+	return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)c] & (_P|_U|_L|_N|_B)));
+}
+
+__CTYPE_INLINE int ispunct(int c)
+{
+	return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)c] & _P));
+}
+
+__CTYPE_INLINE int isspace(int c)
+{
+	return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)c] & _S));
+}
+
+__CTYPE_INLINE int isupper(int c)
+{
+	return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)c] & _U));
+}
+
+__CTYPE_INLINE int isxdigit(int c)
+{
+	return (c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)c] & (_N|_X)));
+}
+
+__CTYPE_INLINE int tolower(int c)
+{
+	if ((unsigned int)c > 255)
+		return (c);
+	return ((_tolower_tab_ + 1)[c]);
+}
+
+__CTYPE_INLINE int toupper(int c)
+{
+	if ((unsigned int)c > 255)
+		return (c);
+	return ((_toupper_tab_ + 1)[c]);
+}
+
+#if __BSD_VISIBLE || __ISO_C_VISIBLE >= 1999 || __POSIX_VISIBLE > 200112 \
+    || __XPG_VISIBLE > 600
+__CTYPE_INLINE int isblank(int c)
+{
+	return (c == ' ' || c == '\t');
+}
+#endif
+
+#if __BSD_VISIBLE || __XPG_VISIBLE
+__CTYPE_INLINE int isascii(int c)
+{
+	return ((unsigned int)c <= 0177);
+}
+
+__CTYPE_INLINE int toascii(int c)
+{
+	return (c & 0177);
+}
+
+__CTYPE_INLINE int _tolower(int c)
+{
+	return (c - 'A' + 'a');
+}
+
+__CTYPE_INLINE int _toupper(int c)
+{
+	return (c - 'a' + 'A');
+}
+#endif /* __BSD_VISIBLE || __XPG_VISIBLE */
+
+#endif /* NDEBUG */
+
+__END_DECLS
+
+#undef __CTYPE_INLINE
+
+#endif /* !_CTYPE_H_ */
diff --git a/ndk/platforms/android-3/include/dirent.h b/ndk/platforms/android-3/include/dirent.h
new file mode 100644
index 0000000..55eef7b
--- /dev/null
+++ b/ndk/platforms/android-3/include/dirent.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _DIRENT_H_
+#define _DIRENT_H_
+
+#include <stdint.h>
+#include <sys/cdefs.h>
+
+__BEGIN_DECLS
+
+#ifndef DT_UNKNOWN
+#define  DT_UNKNOWN     0
+#define  DT_FIFO        1
+#define  DT_CHR         2
+#define  DT_DIR         4
+#define  DT_BLK         6
+#define  DT_REG         8
+#define  DT_LNK         10
+#define  DT_SOCK        12
+#define  DT_WHT         14
+#endif
+
+/* the following structure is really called dirent64 by the kernel
+ * headers. They also define a struct dirent, but the latter lack
+ * the d_type field which is required by some libraries (e.g. hotplug)
+ * who assume to be able to access it directly. sad...
+ */
+struct dirent {
+    uint64_t         d_ino;
+    int64_t          d_off;
+    unsigned short   d_reclen;
+    unsigned char    d_type;
+    char             d_name[256];
+};
+
+typedef struct DIR  DIR;
+
+extern  int              getdents(unsigned int, struct dirent*, unsigned int);
+extern  DIR*             opendir(const char*  dirpath);
+extern  DIR*             fdopendir(int fd);
+extern  struct dirent*   readdir(DIR*  dirp);
+extern  int              readdir_r(DIR*  dirp, struct dirent *entry, struct dirent **result);
+extern  int              closedir(DIR*  dirp);
+extern  void             rewinddir(DIR *dirp);
+extern  int              dirfd(DIR* dirp);
+extern  int              alphasort(const void *a, const void *b);
+extern  int              scandir(const char *dir, struct dirent ***namelist,
+                                 int(*filter)(const struct dirent *),
+                                 int(*compar)(const struct dirent **, 
+                                              const struct dirent **));
+
+__END_DECLS
+
+#endif /* _DIRENT_H_ */
diff --git a/ndk/platforms/android-3/include/dlfcn.h b/ndk/platforms/android-3/include/dlfcn.h
new file mode 100644
index 0000000..9582796
--- /dev/null
+++ b/ndk/platforms/android-3/include/dlfcn.h
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 __DLFCN_H__
+#define __DLFCN_H__
+
+#include <sys/cdefs.h>
+
+__BEGIN_DECLS
+
+extern void*        dlopen(const char*  filename, int flag);
+extern int          dlclose(void*  handle);
+extern const char*  dlerror(void);
+extern void*        dlsym(void*  handle, const char*  symbol);
+
+enum {
+  RTLD_NOW  = 0,
+  RTLD_LAZY = 1,
+
+  RTLD_LOCAL  = 0,
+  RTLD_GLOBAL = 2,
+};
+
+#define RTLD_DEFAULT  ((void*) 0xffffffff)
+#define RTLD_NEXT     ((void*) 0xfffffffe)
+
+__END_DECLS
+
+#endif /* __DLFCN_H */
+
+
diff --git a/ndk/platforms/android-3/include/elf.h b/ndk/platforms/android-3/include/elf.h
new file mode 100644
index 0000000..8a86a63
--- /dev/null
+++ b/ndk/platforms/android-3/include/elf.h
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _ELF_H
+#define _ELF_H
+
+/* these definitions are missing from the BSD sources */
+enum {
+    AT_NULL = 0,
+    AT_IGNORE,
+    AT_EXECFD,
+    AT_PHDR,
+    AT_PHENT,
+    AT_PHNUM,
+    AT_PAGESZ,
+    AT_BASE,
+    AT_FLAGS,
+    AT_ENTRY,
+    AT_NOTELF,
+    AT_UID,
+    AT_EUID,
+    AT_GID,
+    AT_EGID,
+    AT_PLATFORM,
+    AT_HWCAP,
+    AT_CLKTCK,
+
+    AT_SECURE = 23
+};
+
+#include <sys/exec_elf.h>
+
+#endif /* _ELF_H */
+
diff --git a/ndk/platforms/android-3/include/endian.h b/ndk/platforms/android-3/include/endian.h
new file mode 100644
index 0000000..475b48c
--- /dev/null
+++ b/ndk/platforms/android-3/include/endian.h
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _ENDIAN_H_
+#define _ENDIAN_H_
+
+#include <sys/endian.h>
+
+#endif /* _ENDIAN_H_ */
diff --git a/tools/zoneinfo/tzdata2009s/MODULE_LICENSE_PUBLIC_DOMAIN b/ndk/platforms/android-3/include/err.h
similarity index 100%
copy from tools/zoneinfo/tzdata2009s/MODULE_LICENSE_PUBLIC_DOMAIN
copy to ndk/platforms/android-3/include/err.h
diff --git a/ndk/platforms/android-3/include/errno.h b/ndk/platforms/android-3/include/errno.h
new file mode 100644
index 0000000..2b2685a
--- /dev/null
+++ b/ndk/platforms/android-3/include/errno.h
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _ERRNO_H
+#define _ERRNO_H
+
+#include <sys/cdefs.h>
+#include <linux/errno.h>
+
+__BEGIN_DECLS
+
+/* on Linux, ENOTSUP and EOPNOTSUPP are defined as the same error code
+ * even if 1000.3 states that they should be different
+ */
+#ifndef  ENOTUP
+#define  ENOTSUP  EOPNOTSUPP
+#endif
+
+/* internal function that should *only* be called from system calls */
+/* use errno = xxxx instead in C code                               */
+extern int    __set_errno(int  error);
+
+/* internal function returning the address of the thread-specific errno */
+extern volatile int*   __errno(void);
+
+/* a macro expanding to the errno l-value */
+#define  errno   (*__errno())
+
+__END_DECLS
+
+#endif /* _ERRNO_H */
diff --git a/ndk/platforms/android-3/include/fcntl.h b/ndk/platforms/android-3/include/fcntl.h
new file mode 100644
index 0000000..7219dd7
--- /dev/null
+++ b/ndk/platforms/android-3/include/fcntl.h
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _FCNTL_H
+#define _FCNTL_H
+
+#include <sys/cdefs.h>
+#include <sys/types.h>
+#include <linux/fcntl.h>
+#include <unistd.h>  /* this is not required, but makes client code much happier */
+
+__BEGIN_DECLS
+
+#ifndef O_ASYNC
+#define O_ASYNC  FASYNC
+#endif
+
+#ifndef O_CLOEXEC
+#define O_CLOEXEC  02000000
+#endif
+
+extern int  open(const char*  path, int  mode, ...);
+extern int  openat(int fd, const char*  path, int  mode, ...);
+extern int  unlinkat(int dirfd, const char *pathname, int flags);
+extern int  fcntl(int   fd, int   command, ...);
+extern int  creat(const char*  path, mode_t  mode);
+
+__END_DECLS
+
+#endif /* _FCNTL_H */
diff --git a/ndk/platforms/android-3/include/features.h b/ndk/platforms/android-3/include/features.h
new file mode 100644
index 0000000..343c84d
--- /dev/null
+++ b/ndk/platforms/android-3/include/features.h
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _FEATURES_H_
+#define _FEATURES_H_
+
+/* certain Linux-specific programs expect a <features.h> header file
+ * that defines various features macros
+ */
+
+/* we do include a number of BSD extensions */
+#define  _BSD_SOURCE  1
+
+/* we do include a number of GNU extensions */
+#define  _GNU_SOURCE  1
+
+/* C95 support */
+#undef __USE_ISOC95
+#if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199409L
+# define __USE_ISOC95   1
+#endif
+
+/* C99 support */
+#undef __USE_ISOC99
+#if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
+# define __USE_ISOC99   1
+#endif
+
+/* Posix support */
+#define  __USE_POSIX   1
+#define  __USE_POSIX2  1
+#define  __USE_XPG     1
+
+#endif /* _FEATURES_H_ */
diff --git a/ndk/platforms/android-3/include/fnmatch.h b/ndk/platforms/android-3/include/fnmatch.h
new file mode 100644
index 0000000..772b4ef
--- /dev/null
+++ b/ndk/platforms/android-3/include/fnmatch.h
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _FNMATCH_H
+#define _FNMATCH_H
+
+#include <sys/cdefs.h>
+
+__BEGIN_DECLS
+
+#define FNM_NOMATCH      1     /* Match failed. */
+#define FNM_NOSYS        2     /* Function not supported (unused). */
+
+#define FNM_NOESCAPE     0x01        /* Disable backslash escaping. */
+#define FNM_PATHNAME     0x02        /* Slash must be matched by slash. */
+#define FNM_PERIOD       0x04        /* Period must be matched by period. */
+#define FNM_LEADING_DIR  0x08        /* Ignore /<tail> after Imatch. */
+#define FNM_CASEFOLD     0x10        /* Case insensitive search. */
+
+#define FNM_IGNORECASE   FNM_CASEFOLD
+#define FNM_FILE_NAME    FNM_PATHNAME
+
+extern int  fnmatch(const char *pattern, const char *string, int flags);
+
+__END_DECLS
+
+#endif /* _FNMATCH_H */
+
diff --git a/ndk/platforms/android-3/include/getopt.h b/ndk/platforms/android-3/include/getopt.h
new file mode 100644
index 0000000..ba3c4c9
--- /dev/null
+++ b/ndk/platforms/android-3/include/getopt.h
@@ -0,0 +1,90 @@
+/*	$OpenBSD: getopt.h,v 1.1 2002/12/03 20:24:29 millert Exp $	*/
+/*	$NetBSD: getopt.h,v 1.4 2000/07/07 10:43:54 ad Exp $	*/
+
+/*-
+ * Copyright (c) 2000 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Dieter Baron and Thomas Klausner.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *        This product includes software developed by the NetBSD
+ *        Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``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 FOUNDATION OR CONTRIBUTORS
+ * 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 _GETOPT_H_
+#define _GETOPT_H_
+
+#include <sys/cdefs.h>
+
+/*
+ * GNU-like getopt_long() and 4.4BSD getsubopt()/optreset extensions
+ */
+#define no_argument        0
+#define required_argument  1
+#define optional_argument  2
+
+struct option {
+	/* name of long option */
+	const char *name;
+	/*
+	 * one of no_argument, required_argument, and optional_argument:
+	 * whether option takes an argument
+	 */
+	int has_arg;
+	/* if not NULL, set *flag to val when option found */
+	int *flag;
+	/* if flag not NULL, value to set *flag to; else return value */
+	int val;
+};
+
+__BEGIN_DECLS
+int	 getopt_long(int, char * const *, const char *,
+	    const struct option *, int *);
+int	 getopt_long_only(int, char * const *, const char *,
+	    const struct option *, int *);
+#ifndef _GETOPT_DEFINED_
+#define _GETOPT_DEFINED_
+int	 getopt(int, char * const *, const char *);
+
+
+extern   char *optarg;                  /* getopt(3) external variables */
+extern   int opterr;
+extern   int optind;
+extern   int optopt;
+extern   int optreset;
+
+#if 0 /* MISSING FROM BIONIC */
+int       getsubopt(char **, char * const *, char **);
+extern   char *suboptarg;   /* getsubopt(3) external variable */
+#endif /* MISSING */
+
+#endif
+__END_DECLS
+
+#endif /* !_GETOPT_H_ */
diff --git a/ndk/platforms/android-3/include/grp.h b/ndk/platforms/android-3/include/grp.h
new file mode 100644
index 0000000..7ddb791
--- /dev/null
+++ b/ndk/platforms/android-3/include/grp.h
@@ -0,0 +1,85 @@
+/*	$OpenBSD: grp.h,v 1.8 2005/12/13 00:35:22 millert Exp $	*/
+/*	$NetBSD: grp.h,v 1.7 1995/04/29 05:30:40 cgd Exp $	*/
+
+/*-
+ * Copyright (c) 1989, 1993
+ *	The Regents of the University of California.  All rights reserved.
+ * (c) UNIX System Laboratories, Inc.
+ * All or some portions of this file are derived from material licensed
+ * to the University of California by American Telephone and Telegraph
+ * Co. or Unix System Laboratories, Inc. and are reproduced herein with
+ * the permission of UNIX System Laboratories, Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ * 3. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
+ *
+ *	@(#)grp.h	8.2 (Berkeley) 1/21/94
+ */
+
+#ifndef _GRP_H_
+#define	_GRP_H_
+
+#include <sys/cdefs.h>
+#include <sys/types.h>
+
+#if __BSD_VISIBLE
+#define	_PATH_GROUP		"/etc/group"
+#endif
+
+struct group {
+	char	*gr_name;		/* group name */
+	char	*gr_passwd;		/* group password */
+	gid_t	gr_gid;			/* group id */
+	char	**gr_mem;		/* group members */
+};
+
+__BEGIN_DECLS
+struct group	*getgrgid(gid_t);
+struct group	*getgrnam(const char *);
+
+#if 0 /* MISSING FROM BIONIC */
+#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200112 || __XPG_VISIBLE
+struct group	*getgrent(void);
+void		 setgrent(void);
+void		 endgrent(void);
+int		 getgrgid_r(gid_t, struct group *, char *,
+		    size_t, struct group **);
+int		 getgrnam_r(const char *, struct group *, char *,
+		    size_t, struct group **);
+#endif
+#if __BSD_VISIBLE
+void		 setgrfile(const char *);
+int		 setgroupent(int);
+char		*group_from_gid(gid_t, int);
+#endif
+#endif /* MISSING */
+
+int   getgrouplist (const char *user, gid_t group,
+                  gid_t *groups, int *ngroups);
+
+int   initgroups (const char *user, gid_t group);
+
+__END_DECLS
+
+#endif /* !_GRP_H_ */
diff --git a/ndk/platforms/android-3/include/inttypes.h b/ndk/platforms/android-3/include/inttypes.h
new file mode 100644
index 0000000..81d2315
--- /dev/null
+++ b/ndk/platforms/android-3/include/inttypes.h
@@ -0,0 +1,261 @@
+/*	$OpenBSD: inttypes.h,v 1.9 2006/01/15 00:47:51 millert Exp $	*/
+
+/*
+ * Copyright (c) 1997, 2005 Todd C. Miller <Todd.Miller@courtesan.com>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifndef	_INTTYPES_H_
+#define	_INTTYPES_H_
+
+#include <stdint.h>
+#include <sys/cdefs.h>
+
+#if !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS)
+/*
+ * 7.8.1 Macros for format specifiers
+ *
+ * Each of the following object-like macros expands to a string
+ * literal containing a conversion specifier, possibly modified by
+ * a prefix such as hh, h, l, or ll, suitable for use within the
+ * format argument of a formatted input/output function when
+ * converting the corresponding integer type.  These macro names
+ * have the general form of PRI (character string literals for the
+ * fprintf family) or SCN (character string literals for the fscanf
+ * family), followed by the conversion specifier, followed by a
+ * name corresponding to a similar typedef name.  For example,
+ * PRIdFAST32 can be used in a format string to print the value of
+ * an integer of type int_fast32_t.
+ */
+
+/* fprintf macros for signed integers */
+#define	PRId8			"d"		/* int8_t */
+#define	PRId16			"d"		/* int16_t */
+#define	PRId32			"d"		/* int32_t */
+#define	PRId64			"lld"		/* int64_t */
+
+#define	PRIdLEAST8		"d"		/* int_least8_t */
+#define	PRIdLEAST16		"d"		/* int_least16_t */
+#define	PRIdLEAST32		"d"		/* int_least32_t */
+#define	PRIdLEAST64		"lld"		/* int_least64_t */
+
+#define	PRIdFAST8		"d"		/* int_fast8_t */
+#define	PRIdFAST16		"d"		/* int_fast16_t */
+#define	PRIdFAST32		"d"		/* int_fast32_t */
+#define	PRIdFAST64		"lld"		/* int_fast64_t */
+
+#define	PRIdMAX			"jd"		/* intmax_t */
+#define	PRIdPTR			"ld"		/* intptr_t */
+
+#define	PRIi8			"i"		/* int8_t */
+#define	PRIi16			"i"		/* int16_t */
+#define	PRIi32			"i"		/* int32_t */
+#define	PRIi64			"lli"		/* int64_t */
+
+#define	PRIiLEAST8		"i"		/* int_least8_t */
+#define	PRIiLEAST16		"i"		/* int_least16_t */
+#define	PRIiLEAST32		"i"		/* int_least32_t */
+#define	PRIiLEAST64		"lli"		/* int_least64_t */
+
+#define	PRIiFAST8		"i"		/* int_fast8_t */
+#define	PRIiFAST16		"i"		/* int_fast16_t */
+#define	PRIiFAST32		"i"		/* int_fast32_t */
+#define	PRIiFAST64		"lli"		/* int_fast64_t */
+
+#define	PRIiMAX			"ji"		/* intmax_t */
+#define	PRIiPTR			"li"		/* intptr_t */
+
+/* fprintf macros for unsigned integers */
+#define	PRIo8			"o"		/* int8_t */
+#define	PRIo16			"o"		/* int16_t */
+#define	PRIo32			"o"		/* int32_t */
+#define	PRIo64			"llo"		/* int64_t */
+
+#define	PRIoLEAST8		"o"		/* int_least8_t */
+#define	PRIoLEAST16		"o"		/* int_least16_t */
+#define	PRIoLEAST32		"o"		/* int_least32_t */
+#define	PRIoLEAST64		"llo"		/* int_least64_t */
+
+#define	PRIoFAST8		"o"		/* int_fast8_t */
+#define	PRIoFAST16		"o"		/* int_fast16_t */
+#define	PRIoFAST32		"o"		/* int_fast32_t */
+#define	PRIoFAST64		"llo"		/* int_fast64_t */
+
+#define	PRIoMAX			"jo"		/* intmax_t */
+#define	PRIoPTR			"lo"		/* intptr_t */
+
+#define	PRIu8			"u"		/* uint8_t */
+#define	PRIu16			"u"		/* uint16_t */
+#define	PRIu32			"u"		/* uint32_t */
+#define	PRIu64			"llu"		/* uint64_t */
+
+#define	PRIuLEAST8		"u"		/* uint_least8_t */
+#define	PRIuLEAST16		"u"		/* uint_least16_t */
+#define	PRIuLEAST32		"u"		/* uint_least32_t */
+#define	PRIuLEAST64		"llu"		/* uint_least64_t */
+
+#define	PRIuFAST8		"u"		/* uint_fast8_t */
+#define	PRIuFAST16		"u"		/* uint_fast16_t */
+#define	PRIuFAST32		"u"		/* uint_fast32_t */
+#define	PRIuFAST64		"llu"		/* uint_fast64_t */
+
+#define	PRIuMAX			"ju"		/* uintmax_t */
+#define	PRIuPTR			"lu"		/* uintptr_t */
+
+#define	PRIx8			"x"		/* uint8_t */
+#define	PRIx16			"x"		/* uint16_t */
+#define	PRIx32			"x"		/* uint32_t */
+#define	PRIx64			"llx"		/* uint64_t */
+
+#define	PRIxLEAST8		"x"		/* uint_least8_t */
+#define	PRIxLEAST16		"x"		/* uint_least16_t */
+#define	PRIxLEAST32		"x"		/* uint_least32_t */
+#define	PRIxLEAST64		"llx"		/* uint_least64_t */
+
+#define	PRIxFAST8		"x"		/* uint_fast8_t */
+#define	PRIxFAST16		"x"		/* uint_fast16_t */
+#define	PRIxFAST32		"x"		/* uint_fast32_t */
+#define	PRIxFAST64		"llx"		/* uint_fast64_t */
+
+#define	PRIxMAX			"jx"		/* uintmax_t */
+#define	PRIxPTR			"lx"		/* uintptr_t */
+
+#define	PRIX8			"X"		/* uint8_t */
+#define	PRIX16			"X"		/* uint16_t */
+#define	PRIX32			"X"		/* uint32_t */
+#define	PRIX64			"llX"		/* uint64_t */
+
+#define	PRIXLEAST8		"X"		/* uint_least8_t */
+#define	PRIXLEAST16		"X"		/* uint_least16_t */
+#define	PRIXLEAST32		"X"		/* uint_least32_t */
+#define	PRIXLEAST64		"llX"		/* uint_least64_t */
+
+#define	PRIXFAST8		"X"		/* uint_fast8_t */
+#define	PRIXFAST16		"X"		/* uint_fast16_t */
+#define	PRIXFAST32		"X"		/* uint_fast32_t */
+#define	PRIXFAST64		"llX"		/* uint_fast64_t */
+
+#define	PRIXMAX			"jX"		/* uintmax_t */
+#define	PRIXPTR			"lX"		/* uintptr_t */
+
+/* fscanf macros for signed integers */
+#define	SCNd8			"hhd"		/* int8_t */
+#define	SCNd16			"hd"		/* int16_t */
+#define	SCNd32			"d"		/* int32_t */
+#define	SCNd64			"lld"		/* int64_t */
+
+#define	SCNdLEAST8		"hhd"		/* int_least8_t */
+#define	SCNdLEAST16		"hd"		/* int_least16_t */
+#define	SCNdLEAST32		"d"		/* int_least32_t */
+#define	SCNdLEAST64		"lld"		/* int_least64_t */
+
+#define	SCNdFAST8		"hhd"		/* int_fast8_t */
+#define	SCNdFAST16		"hd"		/* int_fast16_t */
+#define	SCNdFAST32		"d"		/* int_fast32_t */
+#define	SCNdFAST64		"lld"		/* int_fast64_t */
+
+#define	SCNdMAX			"jd"		/* intmax_t */
+#define	SCNdPTR			"ld"		/* intptr_t */
+
+#define	SCNi8			"hhi"		/* int8_t */
+#define	SCNi16			"hi"		/* int16_t */
+#define	SCNi32			"i"		/* int32_t */
+#define	SCNi64			"lli"		/* int64_t */
+
+#define	SCNiLEAST8		"hhi"		/* int_least8_t */
+#define	SCNiLEAST16		"hi"		/* int_least16_t */
+#define	SCNiLEAST32		"i"		/* int_least32_t */
+#define	SCNiLEAST64		"lli"		/* int_least64_t */
+
+#define	SCNiFAST8		"hhi"		/* int_fast8_t */
+#define	SCNiFAST16		"hi"		/* int_fast16_t */
+#define	SCNiFAST32		"i"		/* int_fast32_t */
+#define	SCNiFAST64		"lli"		/* int_fast64_t */
+
+#define	SCNiMAX			"ji"		/* intmax_t */
+#define	SCNiPTR			"li"		/* intptr_t */
+
+/* fscanf macros for unsigned integers */
+#define	SCNo8			"hho"		/* uint8_t */
+#define	SCNo16			"ho"		/* uint16_t */
+#define	SCNo32			"o"		/* uint32_t */
+#define	SCNo64			"llo"		/* uint64_t */
+
+#define	SCNoLEAST8		"hho"		/* uint_least8_t */
+#define	SCNoLEAST16		"ho"		/* uint_least16_t */
+#define	SCNoLEAST32		"o"		/* uint_least32_t */
+#define	SCNoLEAST64		"llo"		/* uint_least64_t */
+
+#define	SCNoFAST8		"hho"		/* uint_fast8_t */
+#define	SCNoFAST16		"ho"		/* uint_fast16_t */
+#define	SCNoFAST32		"o"		/* uint_fast32_t */
+#define	SCNoFAST64		"llo"		/* uint_fast64_t */
+
+#define	SCNoMAX			"jo"		/* uintmax_t */
+#define	SCNoPTR			"lo"		/* uintptr_t */
+
+#define	SCNu8			"hhu"		/* uint8_t */
+#define	SCNu16			"hu"		/* uint16_t */
+#define	SCNu32			"u"		/* uint32_t */
+#define	SCNu64			"llu"		/* uint64_t */
+
+#define	SCNuLEAST8		"hhu"		/* uint_least8_t */
+#define	SCNuLEAST16		"hu"		/* uint_least16_t */
+#define	SCNuLEAST32		"u"		/* uint_least32_t */
+#define	SCNuLEAST64		"llu"		/* uint_least64_t */
+
+#define	SCNuFAST8		"hhu"		/* uint_fast8_t */
+#define	SCNuFAST16		"hu"		/* uint_fast16_t */
+#define	SCNuFAST32		"u"		/* uint_fast32_t */
+#define	SCNuFAST64		"llu"		/* uint_fast64_t */
+
+#define	SCNuMAX			"ju"		/* uintmax_t */
+#define	SCNuPTR			"lu"		/* uintptr_t */
+
+#define	SCNx8			"hhx"		/* uint8_t */
+#define	SCNx16			"hx"		/* uint16_t */
+#define	SCNx32			"x"		/* uint32_t */
+#define	SCNx64			"llx"		/* uint64_t */
+
+#define	SCNxLEAST8		"hhx"		/* uint_least8_t */
+#define	SCNxLEAST16		"hx"		/* uint_least16_t */
+#define	SCNxLEAST32		"x"		/* uint_least32_t */
+#define	SCNxLEAST64		"llx"		/* uint_least64_t */
+
+#define	SCNxFAST8		"hhx"		/* uint_fast8_t */
+#define	SCNxFAST16		"hx"		/* uint_fast16_t */
+#define	SCNxFAST32		"x"		/* uint_fast32_t */
+#define	SCNxFAST64		"llx"		/* uint_fast64_t */
+
+#define	SCNxMAX			"jx"		/* uintmax_t */
+#define	SCNxPTR			"lx"		/* uintptr_t */
+
+#endif /* __cplusplus || __STDC_FORMAT_MACROS */
+
+typedef struct {
+	intmax_t quot;		/* quotient */
+	intmax_t rem;		/* remainder */
+} imaxdiv_t;
+
+__BEGIN_DECLS
+intmax_t	imaxabs(intmax_t);
+imaxdiv_t	imaxdiv(intmax_t, intmax_t);
+intmax_t	strtoimax(const char *, char **, int);
+uintmax_t	strtoumax(const char *, char **, int);
+
+intmax_t	strntoimax(const char *nptr, char **endptr, int base, size_t n);
+uintmax_t	strntoumax(const char *nptr, char **endptr, int base, size_t n);
+__END_DECLS
+
+#endif /* _INTTYPES_H_ */
diff --git a/ndk/platforms/android-3/include/jni.h b/ndk/platforms/android-3/include/jni.h
new file mode 100644
index 0000000..ad954c8
--- /dev/null
+++ b/ndk/platforms/android-3/include/jni.h
@@ -0,0 +1,1140 @@
+/*
+ * Copyright 2006 The Android Open Source Project
+ *
+ * JNI specification, as defined by Sun:
+ * http://java.sun.com/javase/6/docs/technotes/guides/jni/spec/jniTOC.html
+ *
+ * Everything here is expected to be VM-neutral.
+ */
+#ifndef _JNI_H
+#define _JNI_H
+
+#include <stdarg.h>
+
+/*
+ * Primitive types that match up with Java equivalents.
+ */
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>      /* C99 */
+typedef uint8_t         jboolean;       /* unsigned 8 bits */
+typedef int8_t          jbyte;          /* signed 8 bits */
+typedef uint16_t        jchar;          /* unsigned 16 bits */
+typedef int16_t         jshort;         /* signed 16 bits */
+typedef int32_t         jint;           /* signed 32 bits */
+typedef int64_t         jlong;          /* signed 64 bits */
+typedef float           jfloat;         /* 32-bit IEEE 754 */
+typedef double          jdouble;        /* 64-bit IEEE 754 */
+#else
+typedef unsigned char   jboolean;       /* unsigned 8 bits */
+typedef signed char     jbyte;          /* signed 8 bits */
+typedef unsigned short  jchar;          /* unsigned 16 bits */
+typedef short           jshort;         /* signed 16 bits */
+typedef int             jint;           /* signed 32 bits */
+typedef long long       jlong;          /* signed 64 bits */
+typedef float           jfloat;         /* 32-bit IEEE 754 */
+typedef double          jdouble;        /* 64-bit IEEE 754 */
+#endif
+
+/* "cardinal indices and sizes" */
+typedef jint            jsize;
+
+#ifdef __cplusplus
+/*
+ * Reference types, in C++
+ */
+class _jobject {};
+class _jclass : public _jobject {};
+class _jstring : public _jobject {};
+class _jarray : public _jobject {};
+class _jobjectArray : public _jarray {};
+class _jbooleanArray : public _jarray {};
+class _jbyteArray : public _jarray {};
+class _jcharArray : public _jarray {};
+class _jshortArray : public _jarray {};
+class _jintArray : public _jarray {};
+class _jlongArray : public _jarray {};
+class _jfloatArray : public _jarray {};
+class _jdoubleArray : public _jarray {};
+class _jthrowable : public _jobject {};
+
+typedef _jobject*       jobject;
+typedef _jclass*        jclass;
+typedef _jstring*       jstring;
+typedef _jarray*        jarray;
+typedef _jobjectArray*  jobjectArray;
+typedef _jbooleanArray* jbooleanArray;
+typedef _jbyteArray*    jbyteArray;
+typedef _jcharArray*    jcharArray;
+typedef _jshortArray*   jshortArray;
+typedef _jintArray*     jintArray;
+typedef _jlongArray*    jlongArray;
+typedef _jfloatArray*   jfloatArray;
+typedef _jdoubleArray*  jdoubleArray;
+typedef _jthrowable*    jthrowable;
+typedef _jobject*       jweak;
+
+
+#else /* not __cplusplus */
+
+/*
+ * Reference types, in C.
+ */
+typedef void*           jobject;
+typedef jobject         jclass;
+typedef jobject         jstring;
+typedef jobject         jarray;
+typedef jarray          jobjectArray;
+typedef jarray          jbooleanArray;
+typedef jarray          jbyteArray;
+typedef jarray          jcharArray;
+typedef jarray          jshortArray;
+typedef jarray          jintArray;
+typedef jarray          jlongArray;
+typedef jarray          jfloatArray;
+typedef jarray          jdoubleArray;
+typedef jobject         jthrowable;
+typedef jobject         jweak;
+
+#endif /* not __cplusplus */
+
+struct _jfieldID;                       /* opaque structure */
+typedef struct _jfieldID* jfieldID;     /* field IDs */
+
+struct _jmethodID;                      /* opaque structure */
+typedef struct _jmethodID* jmethodID;   /* method IDs */
+
+struct JNIInvokeInterface;
+
+typedef union jvalue {
+    jboolean    z;
+    jbyte       b;
+    jchar       c;
+    jshort      s;
+    jint        i;
+    jlong       j;
+    jfloat      f;
+    jdouble     d;
+    jobject     l;
+} jvalue;
+
+typedef enum jobjectRefType {
+    JNIInvalidRefType = 0,
+    JNILocalRefType = 1,
+    JNIGlobalRefType = 2,
+    JNIWeakGlobalRefType = 3
+} jobjectRefType;
+
+typedef struct { 
+    const char* name; 
+    const char* signature; 
+    void*       fnPtr; 
+} JNINativeMethod;
+
+struct _JNIEnv;
+struct _JavaVM;
+typedef const struct JNINativeInterface* C_JNIEnv;
+
+#if defined(__cplusplus)
+typedef _JNIEnv JNIEnv;
+typedef _JavaVM JavaVM;
+#else
+typedef const struct JNINativeInterface* JNIEnv;
+typedef const struct JNIInvokeInterface* JavaVM;
+#endif
+
+/*
+ * Table of interface function pointers.
+ */
+struct JNINativeInterface {
+    void*       reserved0;
+    void*       reserved1;
+    void*       reserved2;
+    void*       reserved3;
+
+    jint        (*GetVersion)(JNIEnv *);
+
+    jclass      (*DefineClass)(JNIEnv*, const char*, jobject, const jbyte*,
+                        jsize);
+    jclass      (*FindClass)(JNIEnv*, const char*);
+
+    jmethodID   (*FromReflectedMethod)(JNIEnv*, jobject);
+    jfieldID    (*FromReflectedField)(JNIEnv*, jobject);
+    /* spec doesn't show jboolean parameter */
+    jobject     (*ToReflectedMethod)(JNIEnv*, jclass, jmethodID, jboolean);
+
+    jclass      (*GetSuperclass)(JNIEnv*, jclass);
+    jboolean    (*IsAssignableFrom)(JNIEnv*, jclass, jclass);
+
+    /* spec doesn't show jboolean parameter */
+    jobject     (*ToReflectedField)(JNIEnv*, jclass, jfieldID, jboolean);
+
+    jint        (*Throw)(JNIEnv*, jthrowable);
+    jint        (*ThrowNew)(JNIEnv *, jclass, const char *);
+    jthrowable  (*ExceptionOccurred)(JNIEnv*);
+    void        (*ExceptionDescribe)(JNIEnv*);
+    void        (*ExceptionClear)(JNIEnv*);
+    void        (*FatalError)(JNIEnv*, const char*);
+
+    jint        (*PushLocalFrame)(JNIEnv*, jint);
+    jobject     (*PopLocalFrame)(JNIEnv*, jobject);
+
+    jobject     (*NewGlobalRef)(JNIEnv*, jobject);
+    void        (*DeleteGlobalRef)(JNIEnv*, jobject);
+    void        (*DeleteLocalRef)(JNIEnv*, jobject);
+    jboolean    (*IsSameObject)(JNIEnv*, jobject, jobject);
+
+    jobject     (*NewLocalRef)(JNIEnv*, jobject);
+    jint        (*EnsureLocalCapacity)(JNIEnv*, jint);
+
+    jobject     (*AllocObject)(JNIEnv*, jclass);
+    jobject     (*NewObject)(JNIEnv*, jclass, jmethodID, ...);
+    jobject     (*NewObjectV)(JNIEnv*, jclass, jmethodID, va_list);
+    jobject     (*NewObjectA)(JNIEnv*, jclass, jmethodID, jvalue*);
+
+    jclass      (*GetObjectClass)(JNIEnv*, jobject);
+    jboolean    (*IsInstanceOf)(JNIEnv*, jobject, jclass);
+    jmethodID   (*GetMethodID)(JNIEnv*, jclass, const char*, const char*);
+
+    jobject     (*CallObjectMethod)(JNIEnv*, jobject, jmethodID, ...);
+    jobject     (*CallObjectMethodV)(JNIEnv*, jobject, jmethodID, va_list);
+    jobject     (*CallObjectMethodA)(JNIEnv*, jobject, jmethodID, jvalue*);
+    jboolean    (*CallBooleanMethod)(JNIEnv*, jobject, jmethodID, ...);
+    jboolean    (*CallBooleanMethodV)(JNIEnv*, jobject, jmethodID, va_list);
+    jboolean    (*CallBooleanMethodA)(JNIEnv*, jobject, jmethodID, jvalue*);
+    jbyte       (*CallByteMethod)(JNIEnv*, jobject, jmethodID, ...);
+    jbyte       (*CallByteMethodV)(JNIEnv*, jobject, jmethodID, va_list);
+    jbyte       (*CallByteMethodA)(JNIEnv*, jobject, jmethodID, jvalue*);
+    jchar       (*CallCharMethod)(JNIEnv*, jobject, jmethodID, ...);
+    jchar       (*CallCharMethodV)(JNIEnv*, jobject, jmethodID, va_list);
+    jchar       (*CallCharMethodA)(JNIEnv*, jobject, jmethodID, jvalue*);
+    jshort      (*CallShortMethod)(JNIEnv*, jobject, jmethodID, ...);
+    jshort      (*CallShortMethodV)(JNIEnv*, jobject, jmethodID, va_list);
+    jshort      (*CallShortMethodA)(JNIEnv*, jobject, jmethodID, jvalue*);
+    jint        (*CallIntMethod)(JNIEnv*, jobject, jmethodID, ...);
+    jint        (*CallIntMethodV)(JNIEnv*, jobject, jmethodID, va_list);
+    jint        (*CallIntMethodA)(JNIEnv*, jobject, jmethodID, jvalue*);
+    jlong       (*CallLongMethod)(JNIEnv*, jobject, jmethodID, ...);
+    jlong       (*CallLongMethodV)(JNIEnv*, jobject, jmethodID, va_list);
+    jlong       (*CallLongMethodA)(JNIEnv*, jobject, jmethodID, jvalue*);
+    jfloat      (*CallFloatMethod)(JNIEnv*, jobject, jmethodID, ...);
+    jfloat      (*CallFloatMethodV)(JNIEnv*, jobject, jmethodID, va_list);
+    jfloat      (*CallFloatMethodA)(JNIEnv*, jobject, jmethodID, jvalue*);
+    jdouble     (*CallDoubleMethod)(JNIEnv*, jobject, jmethodID, ...);
+    jdouble     (*CallDoubleMethodV)(JNIEnv*, jobject, jmethodID, va_list);
+    jdouble     (*CallDoubleMethodA)(JNIEnv*, jobject, jmethodID, jvalue*);
+    void        (*CallVoidMethod)(JNIEnv*, jobject, jmethodID, ...);
+    void        (*CallVoidMethodV)(JNIEnv*, jobject, jmethodID, va_list);
+    void        (*CallVoidMethodA)(JNIEnv*, jobject, jmethodID, jvalue*);
+
+    jobject     (*CallNonvirtualObjectMethod)(JNIEnv*, jobject, jclass,
+                        jmethodID, ...);
+    jobject     (*CallNonvirtualObjectMethodV)(JNIEnv*, jobject, jclass,
+                        jmethodID, va_list);
+    jobject     (*CallNonvirtualObjectMethodA)(JNIEnv*, jobject, jclass,
+                        jmethodID, jvalue*);
+    jboolean    (*CallNonvirtualBooleanMethod)(JNIEnv*, jobject, jclass,
+                        jmethodID, ...);
+    jboolean    (*CallNonvirtualBooleanMethodV)(JNIEnv*, jobject, jclass,
+                         jmethodID, va_list);
+    jboolean    (*CallNonvirtualBooleanMethodA)(JNIEnv*, jobject, jclass,
+                         jmethodID, jvalue*);
+    jbyte       (*CallNonvirtualByteMethod)(JNIEnv*, jobject, jclass,
+                        jmethodID, ...);
+    jbyte       (*CallNonvirtualByteMethodV)(JNIEnv*, jobject, jclass,
+                        jmethodID, va_list);
+    jbyte       (*CallNonvirtualByteMethodA)(JNIEnv*, jobject, jclass,
+                        jmethodID, jvalue*);
+    jchar       (*CallNonvirtualCharMethod)(JNIEnv*, jobject, jclass,
+                        jmethodID, ...);
+    jchar       (*CallNonvirtualCharMethodV)(JNIEnv*, jobject, jclass,
+                        jmethodID, va_list);
+    jchar       (*CallNonvirtualCharMethodA)(JNIEnv*, jobject, jclass,
+                        jmethodID, jvalue*);
+    jshort      (*CallNonvirtualShortMethod)(JNIEnv*, jobject, jclass,
+                        jmethodID, ...);
+    jshort      (*CallNonvirtualShortMethodV)(JNIEnv*, jobject, jclass,
+                        jmethodID, va_list);
+    jshort      (*CallNonvirtualShortMethodA)(JNIEnv*, jobject, jclass,
+                        jmethodID, jvalue*);
+    jint        (*CallNonvirtualIntMethod)(JNIEnv*, jobject, jclass,
+                        jmethodID, ...);
+    jint        (*CallNonvirtualIntMethodV)(JNIEnv*, jobject, jclass,
+                        jmethodID, va_list);
+    jint        (*CallNonvirtualIntMethodA)(JNIEnv*, jobject, jclass,
+                        jmethodID, jvalue*);
+    jlong       (*CallNonvirtualLongMethod)(JNIEnv*, jobject, jclass,
+                        jmethodID, ...);
+    jlong       (*CallNonvirtualLongMethodV)(JNIEnv*, jobject, jclass,
+                        jmethodID, va_list);
+    jlong       (*CallNonvirtualLongMethodA)(JNIEnv*, jobject, jclass,
+                        jmethodID, jvalue*);
+    jfloat      (*CallNonvirtualFloatMethod)(JNIEnv*, jobject, jclass,
+                        jmethodID, ...);
+    jfloat      (*CallNonvirtualFloatMethodV)(JNIEnv*, jobject, jclass,
+                        jmethodID, va_list);
+    jfloat      (*CallNonvirtualFloatMethodA)(JNIEnv*, jobject, jclass,
+                        jmethodID, jvalue*);
+    jdouble     (*CallNonvirtualDoubleMethod)(JNIEnv*, jobject, jclass,
+                        jmethodID, ...);
+    jdouble     (*CallNonvirtualDoubleMethodV)(JNIEnv*, jobject, jclass,
+                        jmethodID, va_list);
+    jdouble     (*CallNonvirtualDoubleMethodA)(JNIEnv*, jobject, jclass,
+                        jmethodID, jvalue*);
+    void        (*CallNonvirtualVoidMethod)(JNIEnv*, jobject, jclass,
+                        jmethodID, ...);
+    void        (*CallNonvirtualVoidMethodV)(JNIEnv*, jobject, jclass,
+                        jmethodID, va_list);
+    void        (*CallNonvirtualVoidMethodA)(JNIEnv*, jobject, jclass,
+                        jmethodID, jvalue*);
+
+    jfieldID    (*GetFieldID)(JNIEnv*, jclass, const char*, const char*);
+
+    jobject     (*GetObjectField)(JNIEnv*, jobject, jfieldID);
+    jboolean    (*GetBooleanField)(JNIEnv*, jobject, jfieldID);
+    jbyte       (*GetByteField)(JNIEnv*, jobject, jfieldID);
+    jchar       (*GetCharField)(JNIEnv*, jobject, jfieldID);
+    jshort      (*GetShortField)(JNIEnv*, jobject, jfieldID);
+    jint        (*GetIntField)(JNIEnv*, jobject, jfieldID);
+    jlong       (*GetLongField)(JNIEnv*, jobject, jfieldID);
+    jfloat      (*GetFloatField)(JNIEnv*, jobject, jfieldID);
+    jdouble     (*GetDoubleField)(JNIEnv*, jobject, jfieldID);
+
+    void        (*SetObjectField)(JNIEnv*, jobject, jfieldID, jobject);
+    void        (*SetBooleanField)(JNIEnv*, jobject, jfieldID, jboolean);
+    void        (*SetByteField)(JNIEnv*, jobject, jfieldID, jbyte);
+    void        (*SetCharField)(JNIEnv*, jobject, jfieldID, jchar);
+    void        (*SetShortField)(JNIEnv*, jobject, jfieldID, jshort);
+    void        (*SetIntField)(JNIEnv*, jobject, jfieldID, jint);
+    void        (*SetLongField)(JNIEnv*, jobject, jfieldID, jlong);
+    void        (*SetFloatField)(JNIEnv*, jobject, jfieldID, jfloat);
+    void        (*SetDoubleField)(JNIEnv*, jobject, jfieldID, jdouble);
+
+    jmethodID   (*GetStaticMethodID)(JNIEnv*, jclass, const char*, const char*);
+
+    jobject     (*CallStaticObjectMethod)(JNIEnv*, jclass, jmethodID, ...);
+    jobject     (*CallStaticObjectMethodV)(JNIEnv*, jclass, jmethodID, va_list);
+    jobject     (*CallStaticObjectMethodA)(JNIEnv*, jclass, jmethodID, jvalue*);
+    jboolean    (*CallStaticBooleanMethod)(JNIEnv*, jclass, jmethodID, ...);
+    jboolean    (*CallStaticBooleanMethodV)(JNIEnv*, jclass, jmethodID,
+                        va_list);
+    jboolean    (*CallStaticBooleanMethodA)(JNIEnv*, jclass, jmethodID,
+                        jvalue*);
+    jbyte       (*CallStaticByteMethod)(JNIEnv*, jclass, jmethodID, ...);
+    jbyte       (*CallStaticByteMethodV)(JNIEnv*, jclass, jmethodID, va_list);
+    jbyte       (*CallStaticByteMethodA)(JNIEnv*, jclass, jmethodID, jvalue*);
+    jchar       (*CallStaticCharMethod)(JNIEnv*, jclass, jmethodID, ...);
+    jchar       (*CallStaticCharMethodV)(JNIEnv*, jclass, jmethodID, va_list);
+    jchar       (*CallStaticCharMethodA)(JNIEnv*, jclass, jmethodID, jvalue*);
+    jshort      (*CallStaticShortMethod)(JNIEnv*, jclass, jmethodID, ...);
+    jshort      (*CallStaticShortMethodV)(JNIEnv*, jclass, jmethodID, va_list);
+    jshort      (*CallStaticShortMethodA)(JNIEnv*, jclass, jmethodID, jvalue*);
+    jint        (*CallStaticIntMethod)(JNIEnv*, jclass, jmethodID, ...);
+    jint        (*CallStaticIntMethodV)(JNIEnv*, jclass, jmethodID, va_list);
+    jint        (*CallStaticIntMethodA)(JNIEnv*, jclass, jmethodID, jvalue*);
+    jlong       (*CallStaticLongMethod)(JNIEnv*, jclass, jmethodID, ...);
+    jlong       (*CallStaticLongMethodV)(JNIEnv*, jclass, jmethodID, va_list);
+    jlong       (*CallStaticLongMethodA)(JNIEnv*, jclass, jmethodID, jvalue*);
+    jfloat      (*CallStaticFloatMethod)(JNIEnv*, jclass, jmethodID, ...);
+    jfloat      (*CallStaticFloatMethodV)(JNIEnv*, jclass, jmethodID, va_list);
+    jfloat      (*CallStaticFloatMethodA)(JNIEnv*, jclass, jmethodID, jvalue*);
+    jdouble     (*CallStaticDoubleMethod)(JNIEnv*, jclass, jmethodID, ...);
+    jdouble     (*CallStaticDoubleMethodV)(JNIEnv*, jclass, jmethodID, va_list);
+    jdouble     (*CallStaticDoubleMethodA)(JNIEnv*, jclass, jmethodID, jvalue*);
+    void        (*CallStaticVoidMethod)(JNIEnv*, jclass, jmethodID, ...);
+    void        (*CallStaticVoidMethodV)(JNIEnv*, jclass, jmethodID, va_list);
+    void        (*CallStaticVoidMethodA)(JNIEnv*, jclass, jmethodID, jvalue*);
+
+    jfieldID    (*GetStaticFieldID)(JNIEnv*, jclass, const char*,
+                        const char*);
+
+    jobject     (*GetStaticObjectField)(JNIEnv*, jclass, jfieldID);
+    jboolean    (*GetStaticBooleanField)(JNIEnv*, jclass, jfieldID);
+    jbyte       (*GetStaticByteField)(JNIEnv*, jclass, jfieldID);
+    jchar       (*GetStaticCharField)(JNIEnv*, jclass, jfieldID);
+    jshort      (*GetStaticShortField)(JNIEnv*, jclass, jfieldID);
+    jint        (*GetStaticIntField)(JNIEnv*, jclass, jfieldID);
+    jlong       (*GetStaticLongField)(JNIEnv*, jclass, jfieldID);
+    jfloat      (*GetStaticFloatField)(JNIEnv*, jclass, jfieldID);
+    jdouble     (*GetStaticDoubleField)(JNIEnv*, jclass, jfieldID);
+
+    void        (*SetStaticObjectField)(JNIEnv*, jclass, jfieldID, jobject);
+    void        (*SetStaticBooleanField)(JNIEnv*, jclass, jfieldID, jboolean);
+    void        (*SetStaticByteField)(JNIEnv*, jclass, jfieldID, jbyte);
+    void        (*SetStaticCharField)(JNIEnv*, jclass, jfieldID, jchar);
+    void        (*SetStaticShortField)(JNIEnv*, jclass, jfieldID, jshort);
+    void        (*SetStaticIntField)(JNIEnv*, jclass, jfieldID, jint);
+    void        (*SetStaticLongField)(JNIEnv*, jclass, jfieldID, jlong);
+    void        (*SetStaticFloatField)(JNIEnv*, jclass, jfieldID, jfloat);
+    void        (*SetStaticDoubleField)(JNIEnv*, jclass, jfieldID, jdouble);
+
+    jstring     (*NewString)(JNIEnv*, const jchar*, jsize);
+    jsize       (*GetStringLength)(JNIEnv*, jstring);
+    const jchar* (*GetStringChars)(JNIEnv*, jstring, jboolean*);
+    void        (*ReleaseStringChars)(JNIEnv*, jstring, const jchar*);
+    jstring     (*NewStringUTF)(JNIEnv*, const char*);
+    jsize       (*GetStringUTFLength)(JNIEnv*, jstring);
+    /* JNI spec says this returns const jbyte*, but that's inconsistent */
+    const char* (*GetStringUTFChars)(JNIEnv*, jstring, jboolean*);
+    void        (*ReleaseStringUTFChars)(JNIEnv*, jstring, const char*);
+    jsize       (*GetArrayLength)(JNIEnv*, jarray);
+    jobjectArray (*NewObjectArray)(JNIEnv*, jsize, jclass, jobject);
+    jobject     (*GetObjectArrayElement)(JNIEnv*, jobjectArray, jsize);
+    void        (*SetObjectArrayElement)(JNIEnv*, jobjectArray, jsize, jobject);
+
+    jbooleanArray (*NewBooleanArray)(JNIEnv*, jsize);
+    jbyteArray    (*NewByteArray)(JNIEnv*, jsize);
+    jcharArray    (*NewCharArray)(JNIEnv*, jsize);
+    jshortArray   (*NewShortArray)(JNIEnv*, jsize);
+    jintArray     (*NewIntArray)(JNIEnv*, jsize);
+    jlongArray    (*NewLongArray)(JNIEnv*, jsize);
+    jfloatArray   (*NewFloatArray)(JNIEnv*, jsize);
+    jdoubleArray  (*NewDoubleArray)(JNIEnv*, jsize);
+
+    jboolean*   (*GetBooleanArrayElements)(JNIEnv*, jbooleanArray, jboolean*);
+    jbyte*      (*GetByteArrayElements)(JNIEnv*, jbyteArray, jboolean*);
+    jchar*      (*GetCharArrayElements)(JNIEnv*, jcharArray, jboolean*);
+    jshort*     (*GetShortArrayElements)(JNIEnv*, jshortArray, jboolean*);
+    jint*       (*GetIntArrayElements)(JNIEnv*, jintArray, jboolean*);
+    jlong*      (*GetLongArrayElements)(JNIEnv*, jlongArray, jboolean*);
+    jfloat*     (*GetFloatArrayElements)(JNIEnv*, jfloatArray, jboolean*);
+    jdouble*    (*GetDoubleArrayElements)(JNIEnv*, jdoubleArray, jboolean*);
+
+    void        (*ReleaseBooleanArrayElements)(JNIEnv*, jbooleanArray,
+                        jboolean*, jint);
+    void        (*ReleaseByteArrayElements)(JNIEnv*, jbyteArray,
+                        jbyte*, jint);
+    void        (*ReleaseCharArrayElements)(JNIEnv*, jcharArray,
+                        jchar*, jint);
+    void        (*ReleaseShortArrayElements)(JNIEnv*, jshortArray,
+                        jshort*, jint);
+    void        (*ReleaseIntArrayElements)(JNIEnv*, jintArray,
+                        jint*, jint);
+    void        (*ReleaseLongArrayElements)(JNIEnv*, jlongArray,
+                        jlong*, jint);
+    void        (*ReleaseFloatArrayElements)(JNIEnv*, jfloatArray,
+                        jfloat*, jint);
+    void        (*ReleaseDoubleArrayElements)(JNIEnv*, jdoubleArray,
+                        jdouble*, jint);
+
+    void        (*GetBooleanArrayRegion)(JNIEnv*, jbooleanArray,
+                        jsize, jsize, jboolean*);
+    void        (*GetByteArrayRegion)(JNIEnv*, jbyteArray,
+                        jsize, jsize, jbyte*);
+    void        (*GetCharArrayRegion)(JNIEnv*, jcharArray,
+                        jsize, jsize, jchar*);
+    void        (*GetShortArrayRegion)(JNIEnv*, jshortArray,
+                        jsize, jsize, jshort*);
+    void        (*GetIntArrayRegion)(JNIEnv*, jintArray,
+                        jsize, jsize, jint*);
+    void        (*GetLongArrayRegion)(JNIEnv*, jlongArray,
+                        jsize, jsize, jlong*);
+    void        (*GetFloatArrayRegion)(JNIEnv*, jfloatArray,
+                        jsize, jsize, jfloat*);
+    void        (*GetDoubleArrayRegion)(JNIEnv*, jdoubleArray,
+                        jsize, jsize, jdouble*);
+
+    /* spec shows these without const; some jni.h do, some don't */
+    void        (*SetBooleanArrayRegion)(JNIEnv*, jbooleanArray,
+                        jsize, jsize, const jboolean*);
+    void        (*SetByteArrayRegion)(JNIEnv*, jbyteArray,
+                        jsize, jsize, const jbyte*);
+    void        (*SetCharArrayRegion)(JNIEnv*, jcharArray,
+                        jsize, jsize, const jchar*);
+    void        (*SetShortArrayRegion)(JNIEnv*, jshortArray,
+                        jsize, jsize, const jshort*);
+    void        (*SetIntArrayRegion)(JNIEnv*, jintArray,
+                        jsize, jsize, const jint*);
+    void        (*SetLongArrayRegion)(JNIEnv*, jlongArray,
+                        jsize, jsize, const jlong*);
+    void        (*SetFloatArrayRegion)(JNIEnv*, jfloatArray,
+                        jsize, jsize, const jfloat*);
+    void        (*SetDoubleArrayRegion)(JNIEnv*, jdoubleArray,
+                        jsize, jsize, const jdouble*);
+
+    jint        (*RegisterNatives)(JNIEnv*, jclass, const JNINativeMethod*,
+                        jint);
+    jint        (*UnregisterNatives)(JNIEnv*, jclass);
+    jint        (*MonitorEnter)(JNIEnv*, jobject);
+    jint        (*MonitorExit)(JNIEnv*, jobject);
+    jint        (*GetJavaVM)(JNIEnv*, JavaVM**);
+
+    void        (*GetStringRegion)(JNIEnv*, jstring, jsize, jsize, jchar*);
+    void        (*GetStringUTFRegion)(JNIEnv*, jstring, jsize, jsize, char*);
+
+    void*       (*GetPrimitiveArrayCritical)(JNIEnv*, jarray, jboolean*);
+    void        (*ReleasePrimitiveArrayCritical)(JNIEnv*, jarray, void*, jint);
+
+    const jchar* (*GetStringCritical)(JNIEnv*, jstring, jboolean*);
+    void        (*ReleaseStringCritical)(JNIEnv*, jstring, const jchar*);
+
+    jweak       (*NewWeakGlobalRef)(JNIEnv*, jobject);
+    void        (*DeleteWeakGlobalRef)(JNIEnv*, jweak);
+
+    jboolean    (*ExceptionCheck)(JNIEnv*);
+
+    jobject     (*NewDirectByteBuffer)(JNIEnv*, void*, jlong);
+    void*       (*GetDirectBufferAddress)(JNIEnv*, jobject);
+    jlong       (*GetDirectBufferCapacity)(JNIEnv*, jobject);
+
+    /* added in JNI 1.6 */
+    jobjectRefType (*GetObjectRefType)(JNIEnv*, jobject);
+};
+
+/*
+ * C++ object wrapper.
+ *
+ * This is usually overlaid on a C struct whose first element is a
+ * JNINativeInterface*.  We rely somewhat on compiler behavior.
+ */
+struct _JNIEnv {
+    /* do not rename this; it does not seem to be entirely opaque */
+    const struct JNINativeInterface* functions;
+
+#if defined(__cplusplus)
+
+    jint GetVersion()
+    { return functions->GetVersion(this); }
+
+    jclass DefineClass(const char *name, jobject loader, const jbyte* buf,
+        jsize bufLen)
+    { return functions->DefineClass(this, name, loader, buf, bufLen); }
+
+    jclass FindClass(const char* name)
+    { return functions->FindClass(this, name); }
+
+    jmethodID FromReflectedMethod(jobject method)
+    { return functions->FromReflectedMethod(this, method); }
+
+    jfieldID FromReflectedField(jobject field)
+    { return functions->FromReflectedField(this, field); }
+
+    jobject ToReflectedMethod(jclass cls, jmethodID methodID, jboolean isStatic)
+    { return functions->ToReflectedMethod(this, cls, methodID, isStatic); }
+
+    jclass GetSuperclass(jclass clazz)
+    { return functions->GetSuperclass(this, clazz); }
+
+    jboolean IsAssignableFrom(jclass clazz1, jclass clazz2)
+    { return functions->IsAssignableFrom(this, clazz1, clazz2); }
+
+    jobject ToReflectedField(jclass cls, jfieldID fieldID, jboolean isStatic)
+    { return functions->ToReflectedField(this, cls, fieldID, isStatic); }
+
+    jint Throw(jthrowable obj)
+    { return functions->Throw(this, obj); }
+
+    jint ThrowNew(jclass clazz, const char* message)
+    { return functions->ThrowNew(this, clazz, message); }
+
+    jthrowable ExceptionOccurred()
+    { return functions->ExceptionOccurred(this); }
+
+    void ExceptionDescribe()
+    { functions->ExceptionDescribe(this); }
+
+    void ExceptionClear()
+    { functions->ExceptionClear(this); }
+
+    void FatalError(const char* msg)
+    { functions->FatalError(this, msg); }
+
+    jint PushLocalFrame(jint capacity)
+    { return functions->PushLocalFrame(this, capacity); }
+
+    jobject PopLocalFrame(jobject result)
+    { return functions->PopLocalFrame(this, result); }
+
+    jobject NewGlobalRef(jobject obj)
+    { return functions->NewGlobalRef(this, obj); }
+
+    void DeleteGlobalRef(jobject globalRef)
+    { functions->DeleteGlobalRef(this, globalRef); }
+
+    void DeleteLocalRef(jobject localRef)
+    { functions->DeleteLocalRef(this, localRef); }
+
+    jboolean IsSameObject(jobject ref1, jobject ref2)
+    { return functions->IsSameObject(this, ref1, ref2); }
+
+    jobject NewLocalRef(jobject ref)
+    { return functions->NewLocalRef(this, ref); }
+
+    jint EnsureLocalCapacity(jint capacity)
+    { return functions->EnsureLocalCapacity(this, capacity); }
+
+    jobject AllocObject(jclass clazz)
+    { return functions->AllocObject(this, clazz); }
+
+    jobject NewObject(jclass clazz, jmethodID methodID, ...)
+    {
+        va_list args;
+        va_start(args, methodID);
+        jobject result = functions->NewObjectV(this, clazz, methodID, args);
+        va_end(args);
+        return result;
+    }
+
+    jobject NewObjectV(jclass clazz, jmethodID methodID, va_list args)
+    { return functions->NewObjectV(this, clazz, methodID, args); }
+
+    jobject NewObjectA(jclass clazz, jmethodID methodID, jvalue* args)
+    { return functions->NewObjectA(this, clazz, methodID, args); }
+
+    jclass GetObjectClass(jobject obj)
+    { return functions->GetObjectClass(this, obj); }
+
+    jboolean IsInstanceOf(jobject obj, jclass clazz)
+    { return functions->IsInstanceOf(this, obj, clazz); }
+
+    jmethodID GetMethodID(jclass clazz, const char* name, const char* sig)
+    { return functions->GetMethodID(this, clazz, name, sig); }
+
+#define CALL_TYPE_METHOD(_jtype, _jname)                                    \
+    _jtype Call##_jname##Method(jobject obj, jmethodID methodID, ...)       \
+    {                                                                       \
+        _jtype result;                                                      \
+        va_list args;                                                       \
+        va_start(args, methodID);                                           \
+        result = functions->Call##_jname##MethodV(this, obj, methodID,      \
+                    args);                                                  \
+        va_end(args);                                                       \
+        return result;                                                      \
+    }
+#define CALL_TYPE_METHODV(_jtype, _jname)                                   \
+    _jtype Call##_jname##MethodV(jobject obj, jmethodID methodID,           \
+        va_list args)                                                       \
+    { return functions->Call##_jname##MethodV(this, obj, methodID, args); }
+#define CALL_TYPE_METHODA(_jtype, _jname)                                   \
+    _jtype Call##_jname##MethodA(jobject obj, jmethodID methodID,           \
+        jvalue* args)                                                       \
+    { return functions->Call##_jname##MethodA(this, obj, methodID, args); }
+
+#define CALL_TYPE(_jtype, _jname)                                           \
+    CALL_TYPE_METHOD(_jtype, _jname)                                        \
+    CALL_TYPE_METHODV(_jtype, _jname)                                       \
+    CALL_TYPE_METHODA(_jtype, _jname)
+
+    CALL_TYPE(jobject, Object)
+    CALL_TYPE(jboolean, Boolean)
+    CALL_TYPE(jbyte, Byte)
+    CALL_TYPE(jchar, Char)
+    CALL_TYPE(jshort, Short)
+    CALL_TYPE(jint, Int)
+    CALL_TYPE(jlong, Long)
+    CALL_TYPE(jfloat, Float)
+    CALL_TYPE(jdouble, Double)
+
+    void CallVoidMethod(jobject obj, jmethodID methodID, ...)
+    {
+        va_list args;
+        va_start(args, methodID);
+        functions->CallVoidMethodV(this, obj, methodID, args);
+        va_end(args);
+    }
+    void CallVoidMethodV(jobject obj, jmethodID methodID, va_list args)
+    { functions->CallVoidMethodV(this, obj, methodID, args); }
+    void CallVoidMethodA(jobject obj, jmethodID methodID, jvalue* args)
+    { functions->CallVoidMethodA(this, obj, methodID, args); }
+
+#define CALL_NONVIRT_TYPE_METHOD(_jtype, _jname)                            \
+    _jtype CallNonvirtual##_jname##Method(jobject obj, jclass clazz,        \
+        jmethodID methodID, ...)                                            \
+    {                                                                       \
+        _jtype result;                                                      \
+        va_list args;                                                       \
+        va_start(args, methodID);                                           \
+        result = functions->CallNonvirtual##_jname##MethodV(this, obj,      \
+                    clazz, methodID, args);                                 \
+        va_end(args);                                                       \
+        return result;                                                      \
+    }
+#define CALL_NONVIRT_TYPE_METHODV(_jtype, _jname)                           \
+    _jtype CallNonvirtual##_jname##MethodV(jobject obj, jclass clazz,       \
+        jmethodID methodID, va_list args)                                   \
+    { return functions->CallNonvirtual##_jname##MethodV(this, obj, clazz,   \
+        methodID, args); }
+#define CALL_NONVIRT_TYPE_METHODA(_jtype, _jname)                           \
+    _jtype CallNonvirtual##_jname##MethodA(jobject obj, jclass clazz,       \
+        jmethodID methodID, jvalue* args)                                   \
+    { return functions->CallNonvirtual##_jname##MethodA(this, obj, clazz,   \
+        methodID, args); }
+
+#define CALL_NONVIRT_TYPE(_jtype, _jname)                                   \
+    CALL_NONVIRT_TYPE_METHOD(_jtype, _jname)                                \
+    CALL_NONVIRT_TYPE_METHODV(_jtype, _jname)                               \
+    CALL_NONVIRT_TYPE_METHODA(_jtype, _jname)
+
+    CALL_NONVIRT_TYPE(jobject, Object)
+    CALL_NONVIRT_TYPE(jboolean, Boolean)
+    CALL_NONVIRT_TYPE(jbyte, Byte)
+    CALL_NONVIRT_TYPE(jchar, Char)
+    CALL_NONVIRT_TYPE(jshort, Short)
+    CALL_NONVIRT_TYPE(jint, Int)
+    CALL_NONVIRT_TYPE(jlong, Long)
+    CALL_NONVIRT_TYPE(jfloat, Float)
+    CALL_NONVIRT_TYPE(jdouble, Double)
+
+    void CallNonvirtualVoidMethod(jobject obj, jclass clazz,
+        jmethodID methodID, ...)
+    {
+        va_list args;
+        va_start(args, methodID);
+        functions->CallNonvirtualVoidMethodV(this, obj, clazz, methodID, args);
+        va_end(args);
+    }
+    void CallNonvirtualVoidMethodV(jobject obj, jclass clazz,
+        jmethodID methodID, va_list args)
+    { functions->CallNonvirtualVoidMethodV(this, obj, clazz, methodID, args); }
+    void CallNonvirtualVoidMethodA(jobject obj, jclass clazz,
+        jmethodID methodID, jvalue* args)
+    { functions->CallNonvirtualVoidMethodA(this, obj, clazz, methodID, args); }
+
+    jfieldID GetFieldID(jclass clazz, const char* name, const char* sig)
+    { return functions->GetFieldID(this, clazz, name, sig); }
+
+    jobject GetObjectField(jobject obj, jfieldID fieldID)
+    { return functions->GetObjectField(this, obj, fieldID); }
+    jboolean GetBooleanField(jobject obj, jfieldID fieldID)
+    { return functions->GetBooleanField(this, obj, fieldID); }
+    jbyte GetByteField(jobject obj, jfieldID fieldID)
+    { return functions->GetByteField(this, obj, fieldID); }
+    jchar GetCharField(jobject obj, jfieldID fieldID)
+    { return functions->GetCharField(this, obj, fieldID); }
+    jshort GetShortField(jobject obj, jfieldID fieldID)
+    { return functions->GetShortField(this, obj, fieldID); }
+    jint GetIntField(jobject obj, jfieldID fieldID)
+    { return functions->GetIntField(this, obj, fieldID); }
+    jlong GetLongField(jobject obj, jfieldID fieldID)
+    { return functions->GetLongField(this, obj, fieldID); }
+    jfloat GetFloatField(jobject obj, jfieldID fieldID)
+    { return functions->GetFloatField(this, obj, fieldID); }
+    jdouble GetDoubleField(jobject obj, jfieldID fieldID)
+    { return functions->GetDoubleField(this, obj, fieldID); }
+
+    void SetObjectField(jobject obj, jfieldID fieldID, jobject value)
+    { functions->SetObjectField(this, obj, fieldID, value); }
+    void SetBooleanField(jobject obj, jfieldID fieldID, jboolean value)
+    { functions->SetBooleanField(this, obj, fieldID, value); }
+    void SetByteField(jobject obj, jfieldID fieldID, jbyte value)
+    { functions->SetByteField(this, obj, fieldID, value); }
+    void SetCharField(jobject obj, jfieldID fieldID, jchar value)
+    { functions->SetCharField(this, obj, fieldID, value); }
+    void SetShortField(jobject obj, jfieldID fieldID, jshort value)
+    { functions->SetShortField(this, obj, fieldID, value); }
+    void SetIntField(jobject obj, jfieldID fieldID, jint value)
+    { functions->SetIntField(this, obj, fieldID, value); }
+    void SetLongField(jobject obj, jfieldID fieldID, jlong value)
+    { functions->SetLongField(this, obj, fieldID, value); }
+    void SetFloatField(jobject obj, jfieldID fieldID, jfloat value)
+    { functions->SetFloatField(this, obj, fieldID, value); }
+    void SetDoubleField(jobject obj, jfieldID fieldID, jdouble value)
+    { functions->SetDoubleField(this, obj, fieldID, value); }
+
+    jmethodID GetStaticMethodID(jclass clazz, const char* name, const char* sig)
+    { return functions->GetStaticMethodID(this, clazz, name, sig); }
+
+#define CALL_STATIC_TYPE_METHOD(_jtype, _jname)                             \
+    _jtype CallStatic##_jname##Method(jclass clazz, jmethodID methodID,     \
+        ...)                                                                \
+    {                                                                       \
+        _jtype result;                                                      \
+        va_list args;                                                       \
+        va_start(args, methodID);                                           \
+        result = functions->CallStatic##_jname##MethodV(this, clazz,        \
+                    methodID, args);                                        \
+        va_end(args);                                                       \
+        return result;                                                      \
+    }
+#define CALL_STATIC_TYPE_METHODV(_jtype, _jname)                            \
+    _jtype CallStatic##_jname##MethodV(jclass clazz, jmethodID methodID,    \
+        va_list args)                                                       \
+    { return functions->CallStatic##_jname##MethodV(this, clazz, methodID,  \
+        args); }
+#define CALL_STATIC_TYPE_METHODA(_jtype, _jname)                            \
+    _jtype CallStatic##_jname##MethodA(jclass clazz, jmethodID methodID,    \
+        jvalue* args)                                                       \
+    { return functions->CallStatic##_jname##MethodA(this, clazz, methodID,  \
+        args); }
+
+#define CALL_STATIC_TYPE(_jtype, _jname)                                    \
+    CALL_STATIC_TYPE_METHOD(_jtype, _jname)                                 \
+    CALL_STATIC_TYPE_METHODV(_jtype, _jname)                                \
+    CALL_STATIC_TYPE_METHODA(_jtype, _jname)
+
+    CALL_STATIC_TYPE(jobject, Object)
+    CALL_STATIC_TYPE(jboolean, Boolean)
+    CALL_STATIC_TYPE(jbyte, Byte)
+    CALL_STATIC_TYPE(jchar, Char)
+    CALL_STATIC_TYPE(jshort, Short)
+    CALL_STATIC_TYPE(jint, Int)
+    CALL_STATIC_TYPE(jlong, Long)
+    CALL_STATIC_TYPE(jfloat, Float)
+    CALL_STATIC_TYPE(jdouble, Double)
+
+    void CallStaticVoidMethod(jclass clazz, jmethodID methodID, ...)
+    {
+        va_list args;
+        va_start(args, methodID);
+        functions->CallStaticVoidMethodV(this, clazz, methodID, args);
+        va_end(args);
+    }
+    void CallStaticVoidMethodV(jclass clazz, jmethodID methodID, va_list args)
+    { functions->CallStaticVoidMethodV(this, clazz, methodID, args); }
+    void CallStaticVoidMethodA(jclass clazz, jmethodID methodID, jvalue* args)
+    { functions->CallStaticVoidMethodA(this, clazz, methodID, args); }
+
+    jfieldID GetStaticFieldID(jclass clazz, const char* name, const char* sig)
+    { return functions->GetStaticFieldID(this, clazz, name, sig); }
+
+    jobject GetStaticObjectField(jclass clazz, jfieldID fieldID)
+    { return functions->GetStaticObjectField(this, clazz, fieldID); }
+    jboolean GetStaticBooleanField(jclass clazz, jfieldID fieldID)
+    { return functions->GetStaticBooleanField(this, clazz, fieldID); }
+    jbyte GetStaticByteField(jclass clazz, jfieldID fieldID)
+    { return functions->GetStaticByteField(this, clazz, fieldID); }
+    jchar GetStaticCharField(jclass clazz, jfieldID fieldID)
+    { return functions->GetStaticCharField(this, clazz, fieldID); }
+    jshort GetStaticShortField(jclass clazz, jfieldID fieldID)
+    { return functions->GetStaticShortField(this, clazz, fieldID); }
+    jint GetStaticIntField(jclass clazz, jfieldID fieldID)
+    { return functions->GetStaticIntField(this, clazz, fieldID); }
+    jlong GetStaticLongField(jclass clazz, jfieldID fieldID)
+    { return functions->GetStaticLongField(this, clazz, fieldID); }
+    jfloat GetStaticFloatField(jclass clazz, jfieldID fieldID)
+    { return functions->GetStaticFloatField(this, clazz, fieldID); }
+    jdouble GetStaticDoubleField(jclass clazz, jfieldID fieldID)
+    { return functions->GetStaticDoubleField(this, clazz, fieldID); }
+
+    void SetStaticObjectField(jclass clazz, jfieldID fieldID, jobject value)
+    { functions->SetStaticObjectField(this, clazz, fieldID, value); }
+    void SetStaticBooleanField(jclass clazz, jfieldID fieldID, jboolean value)
+    { functions->SetStaticBooleanField(this, clazz, fieldID, value); }
+    void SetStaticByteField(jclass clazz, jfieldID fieldID, jbyte value)
+    { functions->SetStaticByteField(this, clazz, fieldID, value); }
+    void SetStaticCharField(jclass clazz, jfieldID fieldID, jchar value)
+    { functions->SetStaticCharField(this, clazz, fieldID, value); }
+    void SetStaticShortField(jclass clazz, jfieldID fieldID, jshort value)
+    { functions->SetStaticShortField(this, clazz, fieldID, value); }
+    void SetStaticIntField(jclass clazz, jfieldID fieldID, jint value)
+    { functions->SetStaticIntField(this, clazz, fieldID, value); }
+    void SetStaticLongField(jclass clazz, jfieldID fieldID, jlong value)
+    { functions->SetStaticLongField(this, clazz, fieldID, value); }
+    void SetStaticFloatField(jclass clazz, jfieldID fieldID, jfloat value)
+    { functions->SetStaticFloatField(this, clazz, fieldID, value); }
+    void SetStaticDoubleField(jclass clazz, jfieldID fieldID, jdouble value)
+    { functions->SetStaticDoubleField(this, clazz, fieldID, value); }
+
+    jstring NewString(const jchar* unicodeChars, jsize len)
+    { return functions->NewString(this, unicodeChars, len); }
+
+    jsize GetStringLength(jstring string)
+    { return functions->GetStringLength(this, string); }
+
+    const jchar* GetStringChars(jstring string, jboolean* isCopy)
+    { return functions->GetStringChars(this, string, isCopy); }
+
+    void ReleaseStringChars(jstring string, const jchar* chars)
+    { functions->ReleaseStringChars(this, string, chars); }
+
+    jstring NewStringUTF(const char* bytes)
+    { return functions->NewStringUTF(this, bytes); }
+
+    jsize GetStringUTFLength(jstring string)
+    { return functions->GetStringUTFLength(this, string); }
+
+    const char* GetStringUTFChars(jstring string, jboolean* isCopy)
+    { return functions->GetStringUTFChars(this, string, isCopy); }
+
+    void ReleaseStringUTFChars(jstring string, const char* utf)
+    { functions->ReleaseStringUTFChars(this, string, utf); }
+
+    jsize GetArrayLength(jarray array)
+    { return functions->GetArrayLength(this, array); }
+
+    jobjectArray NewObjectArray(jsize length, jclass elementClass,
+        jobject initialElement)
+    { return functions->NewObjectArray(this, length, elementClass,
+        initialElement); }
+
+    jobject GetObjectArrayElement(jobjectArray array, jsize index)
+    { return functions->GetObjectArrayElement(this, array, index); }
+
+    void SetObjectArrayElement(jobjectArray array, jsize index, jobject value)
+    { functions->SetObjectArrayElement(this, array, index, value); }
+
+    jbooleanArray NewBooleanArray(jsize length)
+    { return functions->NewBooleanArray(this, length); }
+    jbyteArray NewByteArray(jsize length)
+    { return functions->NewByteArray(this, length); }
+    jcharArray NewCharArray(jsize length)
+    { return functions->NewCharArray(this, length); }
+    jshortArray NewShortArray(jsize length)
+    { return functions->NewShortArray(this, length); }
+    jintArray NewIntArray(jsize length)
+    { return functions->NewIntArray(this, length); }
+    jlongArray NewLongArray(jsize length)
+    { return functions->NewLongArray(this, length); }
+    jfloatArray NewFloatArray(jsize length)
+    { return functions->NewFloatArray(this, length); }
+    jdoubleArray NewDoubleArray(jsize length)
+    { return functions->NewDoubleArray(this, length); }
+
+    jboolean* GetBooleanArrayElements(jbooleanArray array, jboolean* isCopy)
+    { return functions->GetBooleanArrayElements(this, array, isCopy); }
+    jbyte* GetByteArrayElements(jbyteArray array, jboolean* isCopy)
+    { return functions->GetByteArrayElements(this, array, isCopy); }
+    jchar* GetCharArrayElements(jcharArray array, jboolean* isCopy)
+    { return functions->GetCharArrayElements(this, array, isCopy); }
+    jshort* GetShortArrayElements(jshortArray array, jboolean* isCopy)
+    { return functions->GetShortArrayElements(this, array, isCopy); }
+    jint* GetIntArrayElements(jintArray array, jboolean* isCopy)
+    { return functions->GetIntArrayElements(this, array, isCopy); }
+    jlong* GetLongArrayElements(jlongArray array, jboolean* isCopy)
+    { return functions->GetLongArrayElements(this, array, isCopy); }
+    jfloat* GetFloatArrayElements(jfloatArray array, jboolean* isCopy)
+    { return functions->GetFloatArrayElements(this, array, isCopy); }
+    jdouble* GetDoubleArrayElements(jdoubleArray array, jboolean* isCopy)
+    { return functions->GetDoubleArrayElements(this, array, isCopy); }
+
+    void ReleaseBooleanArrayElements(jbooleanArray array, jboolean* elems,
+        jint mode)
+    { functions->ReleaseBooleanArrayElements(this, array, elems, mode); }
+    void ReleaseByteArrayElements(jbyteArray array, jbyte* elems,
+        jint mode)
+    { functions->ReleaseByteArrayElements(this, array, elems, mode); }
+    void ReleaseCharArrayElements(jcharArray array, jchar* elems,
+        jint mode)
+    { functions->ReleaseCharArrayElements(this, array, elems, mode); }
+    void ReleaseShortArrayElements(jshortArray array, jshort* elems,
+        jint mode)
+    { functions->ReleaseShortArrayElements(this, array, elems, mode); }
+    void ReleaseIntArrayElements(jintArray array, jint* elems,
+        jint mode)
+    { functions->ReleaseIntArrayElements(this, array, elems, mode); }
+    void ReleaseLongArrayElements(jlongArray array, jlong* elems,
+        jint mode)
+    { functions->ReleaseLongArrayElements(this, array, elems, mode); }
+    void ReleaseFloatArrayElements(jfloatArray array, jfloat* elems,
+        jint mode)
+    { functions->ReleaseFloatArrayElements(this, array, elems, mode); }
+    void ReleaseDoubleArrayElements(jdoubleArray array, jdouble* elems,
+        jint mode)
+    { functions->ReleaseDoubleArrayElements(this, array, elems, mode); }
+
+    void GetBooleanArrayRegion(jbooleanArray array, jsize start, jsize len,
+        jboolean* buf)
+    { functions->GetBooleanArrayRegion(this, array, start, len, buf); }
+    void GetByteArrayRegion(jbyteArray array, jsize start, jsize len,
+        jbyte* buf)
+    { functions->GetByteArrayRegion(this, array, start, len, buf); }
+    void GetCharArrayRegion(jcharArray array, jsize start, jsize len,
+        jchar* buf)
+    { functions->GetCharArrayRegion(this, array, start, len, buf); }
+    void GetShortArrayRegion(jshortArray array, jsize start, jsize len,
+        jshort* buf)
+    { functions->GetShortArrayRegion(this, array, start, len, buf); }
+    void GetIntArrayRegion(jintArray array, jsize start, jsize len,
+        jint* buf)
+    { functions->GetIntArrayRegion(this, array, start, len, buf); }
+    void GetLongArrayRegion(jlongArray array, jsize start, jsize len,
+        jlong* buf)
+    { functions->GetLongArrayRegion(this, array, start, len, buf); }
+    void GetFloatArrayRegion(jfloatArray array, jsize start, jsize len,
+        jfloat* buf)
+    { functions->GetFloatArrayRegion(this, array, start, len, buf); }
+    void GetDoubleArrayRegion(jdoubleArray array, jsize start, jsize len,
+        jdouble* buf)
+    { functions->GetDoubleArrayRegion(this, array, start, len, buf); }
+
+    void SetBooleanArrayRegion(jbooleanArray array, jsize start, jsize len,
+        const jboolean* buf)
+    { functions->SetBooleanArrayRegion(this, array, start, len, buf); }
+    void SetByteArrayRegion(jbyteArray array, jsize start, jsize len,
+        const jbyte* buf)
+    { functions->SetByteArrayRegion(this, array, start, len, buf); }
+    void SetCharArrayRegion(jcharArray array, jsize start, jsize len,
+        const jchar* buf)
+    { functions->SetCharArrayRegion(this, array, start, len, buf); }
+    void SetShortArrayRegion(jshortArray array, jsize start, jsize len,
+        const jshort* buf)
+    { functions->SetShortArrayRegion(this, array, start, len, buf); }
+    void SetIntArrayRegion(jintArray array, jsize start, jsize len,
+        const jint* buf)
+    { functions->SetIntArrayRegion(this, array, start, len, buf); }
+    void SetLongArrayRegion(jlongArray array, jsize start, jsize len,
+        const jlong* buf)
+    { functions->SetLongArrayRegion(this, array, start, len, buf); }
+    void SetFloatArrayRegion(jfloatArray array, jsize start, jsize len,
+        const jfloat* buf)
+    { functions->SetFloatArrayRegion(this, array, start, len, buf); }
+    void SetDoubleArrayRegion(jdoubleArray array, jsize start, jsize len,
+        const jdouble* buf)
+    { functions->SetDoubleArrayRegion(this, array, start, len, buf); }
+
+    jint RegisterNatives(jclass clazz, const JNINativeMethod* methods,
+        jint nMethods)
+    { return functions->RegisterNatives(this, clazz, methods, nMethods); }
+
+    jint UnregisterNatives(jclass clazz)
+    { return functions->UnregisterNatives(this, clazz); }
+
+    jint MonitorEnter(jobject obj)
+    { return functions->MonitorEnter(this, obj); }
+
+    jint MonitorExit(jobject obj)
+    { return functions->MonitorExit(this, obj); }
+
+    jint GetJavaVM(JavaVM** vm)
+    { return functions->GetJavaVM(this, vm); }
+
+    void GetStringRegion(jstring str, jsize start, jsize len, jchar* buf)
+    { functions->GetStringRegion(this, str, start, len, buf); }
+
+    void GetStringUTFRegion(jstring str, jsize start, jsize len, char* buf)
+    { return functions->GetStringUTFRegion(this, str, start, len, buf); }
+
+    void* GetPrimitiveArrayCritical(jarray array, jboolean* isCopy)
+    { return functions->GetPrimitiveArrayCritical(this, array, isCopy); }
+
+    void ReleasePrimitiveArrayCritical(jarray array, void* carray, jint mode)
+    { functions->ReleasePrimitiveArrayCritical(this, array, carray, mode); }
+
+    const jchar* GetStringCritical(jstring string, jboolean* isCopy)
+    { return functions->GetStringCritical(this, string, isCopy); }
+
+    void ReleaseStringCritical(jstring string, const jchar* carray)
+    { functions->ReleaseStringCritical(this, string, carray); }
+
+    jweak NewWeakGlobalRef(jobject obj)
+    { return functions->NewWeakGlobalRef(this, obj); }
+
+    void DeleteWeakGlobalRef(jweak obj)
+    { functions->DeleteWeakGlobalRef(this, obj); }
+
+    jboolean ExceptionCheck()
+    { return functions->ExceptionCheck(this); }
+
+    jobject NewDirectByteBuffer(void* address, jlong capacity)
+    { return functions->NewDirectByteBuffer(this, address, capacity); }
+
+    void* GetDirectBufferAddress(jobject buf)
+    { return functions->GetDirectBufferAddress(this, buf); }
+
+    jlong GetDirectBufferCapacity(jobject buf)
+    { return functions->GetDirectBufferCapacity(this, buf); }
+
+    /* added in JNI 1.6 */
+    jobjectRefType GetObjectRefType(jobject obj)
+    { return functions->GetObjectRefType(this, obj); }
+#endif /*__cplusplus*/
+};
+
+
+/*
+ * JNI invocation interface.
+ */
+struct JNIInvokeInterface {
+    void*       reserved0;
+    void*       reserved1;
+    void*       reserved2;
+ 
+    jint        (*DestroyJavaVM)(JavaVM*);
+    jint        (*AttachCurrentThread)(JavaVM*, JNIEnv**, void*);
+    jint        (*DetachCurrentThread)(JavaVM*);
+    jint        (*GetEnv)(JavaVM*, void**, jint);
+    jint        (*AttachCurrentThreadAsDaemon)(JavaVM*, JNIEnv**, void*);
+};
+
+/*
+ * C++ version.
+ */
+struct _JavaVM {
+    const struct JNIInvokeInterface* functions;
+
+#if defined(__cplusplus)
+    jint DestroyJavaVM()
+    { return functions->DestroyJavaVM(this); }
+    jint AttachCurrentThread(JNIEnv** p_env, void* thr_args)
+    { return functions->AttachCurrentThread(this, p_env, thr_args); }
+    jint DetachCurrentThread()
+    { return functions->DetachCurrentThread(this); }
+    jint GetEnv(void** env, jint version)
+    { return functions->GetEnv(this, env, version); }
+    jint AttachCurrentThreadAsDaemon(JNIEnv** p_env, void* thr_args)
+    { return functions->AttachCurrentThreadAsDaemon(this, p_env, thr_args); }
+#endif /*__cplusplus*/
+};
+
+struct JavaVMAttachArgs {
+    jint        version;    /* must be >= JNI_VERSION_1_2 */
+    const char* name;       /* NULL or name of thread as modified UTF-8 str */
+    jobject     group;      /* global ref of a ThreadGroup object, or NULL */
+};
+typedef struct JavaVMAttachArgs JavaVMAttachArgs;
+
+/*
+ * JNI 1.2+ initialization.  (As of 1.6, the pre-1.2 structures are no
+ * longer supported.)
+ */
+typedef struct JavaVMOption {
+    const char* optionString;
+    void*       extraInfo;
+} JavaVMOption;
+
+typedef struct JavaVMInitArgs {
+    jint        version;    /* use JNI_VERSION_1_2 or later */
+
+    jint        nOptions;
+    JavaVMOption* options;
+    jboolean    ignoreUnrecognized;
+} JavaVMInitArgs;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * VM initialization functions.
+ *
+ * Note these are the only symbols exported for JNI by the VM.
+ */
+jint JNI_GetDefaultJavaVMInitArgs(void*);
+jint JNI_CreateJavaVM(JavaVM**, JNIEnv**, void*);
+jint JNI_GetCreatedJavaVMs(JavaVM**, jsize, jsize*);
+
+/*
+ * Prototypes for functions exported by loadable shared libs.  These are
+ * called by JNI, not provided by JNI.
+ */
+jint JNI_OnLoad(JavaVM* vm, void* reserved);
+void JNI_OnUnload(JavaVM* vm, void* reserved);
+
+#ifdef __cplusplus
+}
+#endif
+
+
+/*
+ * Manifest constants.
+ */
+#define JNI_FALSE   0
+#define JNI_TRUE    1
+
+#define JNI_VERSION_1_1 0x00010001
+#define JNI_VERSION_1_2 0x00010002
+#define JNI_VERSION_1_4 0x00010004
+#define JNI_VERSION_1_6 0x00010006
+
+#define JNI_OK          (0)         /* no error */
+#define JNI_ERR         (-1)        /* generic error */
+#define JNI_EDETACHED   (-2)        /* thread detached from the VM */
+#define JNI_EVERSION    (-3)        /* JNI version error */
+
+#define JNI_COMMIT      1           /* copy content, do not free buffer */
+#define JNI_ABORT       2           /* free buffer w/o copying back */
+
+/* need these for Windows-aware headers */
+#define JNIIMPORT
+#define JNIEXPORT
+#define JNICALL
+
+#endif /*_JNI_H*/
diff --git a/tools/zoneinfo/tzdata2009s/MODULE_LICENSE_PUBLIC_DOMAIN b/ndk/platforms/android-3/include/lastlog.h
similarity index 100%
copy from tools/zoneinfo/tzdata2009s/MODULE_LICENSE_PUBLIC_DOMAIN
copy to ndk/platforms/android-3/include/lastlog.h
diff --git a/ndk/platforms/android-3/include/libgen.h b/ndk/platforms/android-3/include/libgen.h
new file mode 100644
index 0000000..c5fc76a
--- /dev/null
+++ b/ndk/platforms/android-3/include/libgen.h
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _LIBGEN_H
+#define _LIBGEN_H
+
+#include <sys/cdefs.h>
+#include <sys/types.h>
+
+__BEGIN_DECLS
+
+/* our version of dirname/basename don't modify the input path */
+extern char*  dirname (const char*  path);
+extern char*  basename(const char*  path);
+
+/* special thread-safe Bionic versions
+ *
+ * if 'buffer' is NULL, 'bufflen' is ignored and the length of the result is returned
+ * otherwise, place result in 'buffer'
+ *
+ * at most bufflen-1 characters written, plus a terminating zero
+ *
+ * return length of result, or -1 in case of error, with errno set to:
+ *
+ *    ERANGE:        buffer is too short
+ *    ENAMETOOLONG:  the result is too long for a valid path
+ */
+extern int    dirname_r(const char*  path, char*  buffer, size_t  bufflen);
+extern int    basename_r(const char*  path, char*  buffer, size_t  bufflen);
+
+__END_DECLS
+
+#endif /* _LIBGEN_H */
diff --git a/ndk/platforms/android-3/include/limits.h b/ndk/platforms/android-3/include/limits.h
new file mode 100644
index 0000000..1de8ea6
--- /dev/null
+++ b/ndk/platforms/android-3/include/limits.h
@@ -0,0 +1,96 @@
+/*	$OpenBSD: limits.h,v 1.13 2005/12/31 19:29:38 millert Exp $	*/
+/*	$NetBSD: limits.h,v 1.7 1994/10/26 00:56:00 cgd Exp $	*/
+
+/*
+ * Copyright (c) 1988 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ * 3. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
+ *
+ *	@(#)limits.h	5.9 (Berkeley) 4/3/91
+ */
+
+#ifndef _LIMITS_H_
+#define	_LIMITS_H_
+
+#include <sys/cdefs.h>
+
+#if __POSIX_VISIBLE
+#define	_POSIX_ARG_MAX		4096
+#define	_POSIX_CHILD_MAX	25
+#define	_POSIX_LINK_MAX		8
+#define	_POSIX_MAX_CANON	255
+#define	_POSIX_MAX_INPUT	255
+#define	_POSIX_NAME_MAX		14
+#define	_POSIX_NGROUPS_MAX	0
+#define	_POSIX_OPEN_MAX		16
+#define	_POSIX_PATH_MAX		256
+#define _POSIX_PIPE_BUF		512
+#define	_POSIX_RE_DUP_MAX	255
+#define _POSIX_SSIZE_MAX	32767
+#define _POSIX_STREAM_MAX	8
+#define _POSIX_SYMLINK_MAX	255
+#define _POSIX_SYMLOOP_MAX	8
+#define _POSIX_TZNAME_MAX	3
+
+#define	_POSIX2_BC_BASE_MAX	99
+#define	_POSIX2_BC_DIM_MAX	2048
+#define	_POSIX2_BC_SCALE_MAX	99
+#define	_POSIX2_BC_STRING_MAX	1000
+#define	_POSIX2_COLL_WEIGHTS_MAX	2
+#define	_POSIX2_EXPR_NEST_MAX	32
+#define	_POSIX2_LINE_MAX	2048
+#define	_POSIX2_RE_DUP_MAX	_POSIX_RE_DUP_MAX
+
+#if __POSIX_VISIBLE >= 200112
+#define _POSIX_TTY_NAME_MAX	9	/* includes trailing NUL */
+#define _POSIX_LOGIN_NAME_MAX	9	/* includes trailing NUL */
+#endif /* __POSIX_VISIBLE >= 200112 */
+#endif /* __POSIX_VISIBLE */
+
+#if __XPG_VISIBLE
+#define PASS_MAX		128	/* _PASSWORD_LEN from <pwd.h> */
+
+#define NL_ARGMAX		9
+#define NL_LANGMAX		14
+#define NL_MSGMAX		32767
+#define NL_NMAX			1
+#define NL_SETMAX		255
+#define NL_TEXTMAX		255
+
+#define TMP_MAX                 308915776
+#endif /* __XPG_VISIBLE */
+
+#include <sys/limits.h>
+
+#if __POSIX_VISIBLE
+#include <sys/syslimits.h>
+#endif
+
+#ifndef PAGESIZE
+#define  PAGESIZE  PAGE_SIZE
+#endif
+
+#endif /* !_LIMITS_H_ */
diff --git a/ndk/platforms/android-3/include/linux/a.out.h b/ndk/platforms/android-3/include/linux/a.out.h
new file mode 100644
index 0000000..7325304
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/a.out.h
@@ -0,0 +1,220 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __A_OUT_GNU_H__
+#define __A_OUT_GNU_H__
+
+#define __GNU_EXEC_MACROS__
+
+#ifndef __STRUCT_EXEC_OVERRIDE__
+
+#include <asm/a.out.h>
+
+#endif
+
+enum machine_type {
+#ifdef M_OLDSUN2
+ M__OLDSUN2 = M_OLDSUN2,
+#else
+ M_OLDSUN2 = 0,
+#endif
+#ifdef M_68010
+ M__68010 = M_68010,
+#else
+ M_68010 = 1,
+#endif
+#ifdef M_68020
+ M__68020 = M_68020,
+#else
+ M_68020 = 2,
+#endif
+#ifdef M_SPARC
+ M__SPARC = M_SPARC,
+#else
+ M_SPARC = 3,
+#endif
+
+ M_386 = 100,
+ M_MIPS1 = 151,
+ M_MIPS2 = 152
+};
+
+#ifndef N_MAGIC
+#define N_MAGIC(exec) ((exec).a_info & 0xffff)
+#endif
+#define N_MACHTYPE(exec) ((enum machine_type)(((exec).a_info >> 16) & 0xff))
+#define N_FLAGS(exec) (((exec).a_info >> 24) & 0xff)
+#define N_SET_INFO(exec, magic, type, flags)   ((exec).a_info = ((magic) & 0xffff)   | (((int)(type) & 0xff) << 16)   | (((flags) & 0xff) << 24))
+#define N_SET_MAGIC(exec, magic)   ((exec).a_info = (((exec).a_info & 0xffff0000) | ((magic) & 0xffff)))
+
+#define N_SET_MACHTYPE(exec, machtype)   ((exec).a_info =   ((exec).a_info&0xff00ffff) | ((((int)(machtype))&0xff) << 16))
+
+#define N_SET_FLAGS(exec, flags)   ((exec).a_info =   ((exec).a_info&0x00ffffff) | (((flags) & 0xff) << 24))
+
+#define OMAGIC 0407
+
+#define NMAGIC 0410
+
+#define ZMAGIC 0413
+
+#define QMAGIC 0314
+
+#define CMAGIC 0421
+
+#ifndef N_BADMAG
+#define N_BADMAG(x) (N_MAGIC(x) != OMAGIC   && N_MAGIC(x) != NMAGIC   && N_MAGIC(x) != ZMAGIC   && N_MAGIC(x) != QMAGIC)
+#endif
+
+#define _N_HDROFF(x) (1024 - sizeof (struct exec))
+
+#ifndef N_TXTOFF
+#define N_TXTOFF(x)   (N_MAGIC(x) == ZMAGIC ? _N_HDROFF((x)) + sizeof (struct exec) :   (N_MAGIC(x) == QMAGIC ? 0 : sizeof (struct exec)))
+#endif
+
+#ifndef N_DATOFF
+#define N_DATOFF(x) (N_TXTOFF(x) + (x).a_text)
+#endif
+
+#ifndef N_TRELOFF
+#define N_TRELOFF(x) (N_DATOFF(x) + (x).a_data)
+#endif
+
+#ifndef N_DRELOFF
+#define N_DRELOFF(x) (N_TRELOFF(x) + N_TRSIZE(x))
+#endif
+
+#ifndef N_SYMOFF
+#define N_SYMOFF(x) (N_DRELOFF(x) + N_DRSIZE(x))
+#endif
+
+#ifndef N_STROFF
+#define N_STROFF(x) (N_SYMOFF(x) + N_SYMSIZE(x))
+#endif
+
+#ifndef N_TXTADDR
+#define N_TXTADDR(x) (N_MAGIC(x) == QMAGIC ? PAGE_SIZE : 0)
+#endif
+
+#if defined(vax) || defined(hp300) || defined(pyr)
+#define SEGMENT_SIZE page_size
+#endif
+#ifdef sony
+#define SEGMENT_SIZE 0x2000
+#endif
+#ifdef is68k
+#define SEGMENT_SIZE 0x20000
+#endif
+#if defined(m68k) && defined(PORTAR)
+#define PAGE_SIZE 0x400
+#define SEGMENT_SIZE PAGE_SIZE
+#endif
+
+#ifdef linux
+#include <asm/page.h>
+#if defined(__i386__) || defined(__mc68000__)
+#define SEGMENT_SIZE 1024
+#else
+#ifndef SEGMENT_SIZE
+#define SEGMENT_SIZE PAGE_SIZE
+#endif
+#endif
+#endif
+
+#define _N_SEGMENT_ROUND(x) ALIGN(x, SEGMENT_SIZE)
+
+#define _N_TXTENDADDR(x) (N_TXTADDR(x)+(x).a_text)
+
+#ifndef N_DATADDR
+#define N_DATADDR(x)   (N_MAGIC(x)==OMAGIC? (_N_TXTENDADDR(x))   : (_N_SEGMENT_ROUND (_N_TXTENDADDR(x))))
+#endif
+
+#ifndef N_BSSADDR
+#define N_BSSADDR(x) (N_DATADDR(x) + (x).a_data)
+#endif
+
+#ifndef N_NLIST_DECLARED
+struct nlist {
+ union {
+ char *n_name;
+ struct nlist *n_next;
+ long n_strx;
+ } n_un;
+ unsigned char n_type;
+ char n_other;
+ short n_desc;
+ unsigned long n_value;
+};
+#endif
+
+#ifndef N_UNDF
+#define N_UNDF 0
+#endif
+#ifndef N_ABS
+#define N_ABS 2
+#endif
+#ifndef N_TEXT
+#define N_TEXT 4
+#endif
+#ifndef N_DATA
+#define N_DATA 6
+#endif
+#ifndef N_BSS
+#define N_BSS 8
+#endif
+#ifndef N_FN
+#define N_FN 15
+#endif
+
+#ifndef N_EXT
+#define N_EXT 1
+#endif
+#ifndef N_TYPE
+#define N_TYPE 036
+#endif
+#ifndef N_STAB
+#define N_STAB 0340
+#endif
+
+#define N_INDR 0xa
+
+#define N_SETA 0x14  
+#define N_SETT 0x16  
+#define N_SETD 0x18  
+#define N_SETB 0x1A  
+
+#define N_SETV 0x1C  
+
+#ifndef N_RELOCATION_INFO_DECLARED
+
+struct relocation_info
+{
+
+ int r_address;
+
+ unsigned int r_symbolnum:24;
+
+ unsigned int r_pcrel:1;
+
+ unsigned int r_length:2;
+
+ unsigned int r_extern:1;
+
+#ifdef NS32K
+ unsigned r_bsr:1;
+ unsigned r_disp:1;
+ unsigned r_pad:2;
+#else
+ unsigned int r_pad:4;
+#endif
+};
+#endif
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/aio_abi.h b/ndk/platforms/android-3/include/linux/aio_abi.h
new file mode 100644
index 0000000..c92bc8f
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/aio_abi.h
@@ -0,0 +1,64 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __LINUX__AIO_ABI_H
+#define __LINUX__AIO_ABI_H
+
+#include <asm/byteorder.h>
+
+typedef unsigned long aio_context_t;
+
+enum {
+ IOCB_CMD_PREAD = 0,
+ IOCB_CMD_PWRITE = 1,
+ IOCB_CMD_FSYNC = 2,
+ IOCB_CMD_FDSYNC = 3,
+
+ IOCB_CMD_NOOP = 6,
+};
+
+struct io_event {
+ __u64 data;
+ __u64 obj;
+ __s64 res;
+ __s64 res2;
+};
+
+#ifdef __LITTLE_ENDIAN
+#define PADDED(x,y) x, y
+#elif defined(__BIG_ENDIAN)
+#define PADDED(x,y) y, x
+#else
+#error edit for your odd byteorder.
+#endif
+
+struct iocb {
+
+ __u64 aio_data;
+ __u32 PADDED(aio_key, aio_reserved1);
+
+ __u16 aio_lio_opcode;
+ __s16 aio_reqprio;
+ __u32 aio_fildes;
+
+ __u64 aio_buf;
+ __u64 aio_nbytes;
+ __s64 aio_offset;
+
+ __u64 aio_reserved2;
+ __u64 aio_reserved3;
+};
+
+#undef IFBIG
+#undef IFLITTLE
+
+#endif
+
diff --git a/ndk/platforms/android-3/include/linux/akm8976.h b/ndk/platforms/android-3/include/linux/akm8976.h
new file mode 100644
index 0000000..a5aa68e
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/akm8976.h
@@ -0,0 +1,89 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef AKM8976_H
+#define AKM8976_H
+
+#include <linux/ioctl.h>
+
+#define AKECS_MODE_MEASURE 0x00  
+
+#define AKECS_MODE_PFFD 0x01  
+#define AKECS_MODE_E2P_READ 0x02  
+#define AKECS_MODE_POWERDOWN 0x03  
+
+#define AKECS_MODE_MEASURE_SNG 0x10  
+#define AKECS_MODE_MEASURE_SEQ 0x11  
+
+#define CSPEC_AINT 0x01  
+#define CSPEC_SNG_NUM 0x01  
+#define CSPEC_SEQ_NUM 0x02  
+#define CSPEC_SFRQ_32 0x00  
+#define CSPEC_SFRQ_64 0x01  
+#define CSPEC_MCS 0x07  
+#define CSPEC_MKS 0x01  
+#define CSPEC_INTEN 0x01  
+
+#define RBUFF_SIZE 31  
+#define MAX_CALI_SIZE 0x1000U  
+
+#define AKECS_REG_ST 0xC0
+#define AKECS_REG_TMPS 0xC1
+#define AKECS_REG_MS1 0xE0
+#define AKECS_REG_MS2 0xE1
+#define AKECS_REG_MS3 0xE2
+
+#define AKMIO 0xA1
+
+#define ECS_IOCTL_INIT _IO(AKMIO, 0x01)
+#define ECS_IOCTL_WRITE _IOW(AKMIO, 0x02, char[5])
+#define ECS_IOCTL_READ _IOWR(AKMIO, 0x03, char[5])
+#define ECS_IOCTL_RESET _IO(AKMIO, 0x04)
+#define ECS_IOCTL_INT_STATUS _IO(AKMIO, 0x05)
+#define ECS_IOCTL_FFD_STATUS _IO(AKMIO, 0x06)
+#define ECS_IOCTL_SET_MODE _IOW(AKMIO, 0x07, short)
+#define ECS_IOCTL_GETDATA _IOR(AKMIO, 0x08, char[RBUFF_SIZE+1])
+#define ECS_IOCTL_GET_NUMFRQ _IOR(AKMIO, 0x09, char[2])
+#define ECS_IOCTL_SET_PERST _IO(AKMIO, 0x0A)
+#define ECS_IOCTL_SET_G0RST _IO(AKMIO, 0x0B)
+#define ECS_IOCTL_SET_YPR _IOW(AKMIO, 0x0C, short[12])
+#define ECS_IOCTL_GET_OPEN_STATUS _IOR(AKMIO, 0x0D, int)
+#define ECS_IOCTL_GET_CLOSE_STATUS _IOR(AKMIO, 0x0E, int)
+#define ECS_IOCTL_GET_CALI_DATA _IOR(AKMIO, 0x0F, char[MAX_CALI_SIZE])
+#define ECS_IOCTL_GET_DELAY _IOR(AKMIO, 0x30, short)
+
+#define ECS_IOCTL_APP_SET_MODE _IOW(AKMIO, 0x10, short)
+#define ECS_IOCTL_APP_SET_MFLAG _IOW(AKMIO, 0x11, short)
+#define ECS_IOCTL_APP_GET_MFLAG _IOW(AKMIO, 0x12, short)
+#define ECS_IOCTL_APP_SET_AFLAG _IOW(AKMIO, 0x13, short)
+#define ECS_IOCTL_APP_GET_AFLAG _IOR(AKMIO, 0x14, short)
+#define ECS_IOCTL_APP_SET_TFLAG _IOR(AKMIO, 0x15, short)
+#define ECS_IOCTL_APP_GET_TFLAG _IOR(AKMIO, 0x16, short)
+#define ECS_IOCTL_APP_RESET_PEDOMETER _IO(AKMIO, 0x17)
+#define ECS_IOCTL_APP_SET_DELAY _IOW(AKMIO, 0x18, short)
+#define ECS_IOCTL_APP_GET_DELAY ECS_IOCTL_GET_DELAY
+#define ECS_IOCTL_APP_SET_MVFLAG _IOW(AKMIO, 0x19, short)  
+#define ECS_IOCTL_APP_GET_MVFLAG _IOR(AKMIO, 0x1A, short)  
+
+#define ECS_IOCTL_SET_STEP_CNT _IOW(AKMIO, 0x20, short)
+
+#define ECS_RST 146  
+#define ECS_CLK_ON 155  
+#define ECS_INTR 161  
+
+struct akm8976_platform_data {
+ int reset;
+ int clk_on;
+ int intr;
+};
+
+#endif
+
diff --git a/ndk/platforms/android-3/include/linux/android_alarm.h b/ndk/platforms/android-3/include/linux/android_alarm.h
new file mode 100644
index 0000000..80828ea
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/android_alarm.h
@@ -0,0 +1,50 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_ANDROID_ALARM_H
+#define _LINUX_ANDROID_ALARM_H
+
+#include <asm/ioctl.h>
+#include <linux/time.h>
+
+typedef enum {
+
+ ANDROID_ALARM_RTC_WAKEUP,
+ ANDROID_ALARM_RTC,
+ ANDROID_ALARM_ELAPSED_REALTIME_WAKEUP,
+ ANDROID_ALARM_ELAPSED_REALTIME,
+ ANDROID_ALARM_SYSTEMTIME,
+
+ ANDROID_ALARM_TYPE_COUNT,
+
+} android_alarm_type_t;
+
+typedef enum {
+ ANDROID_ALARM_RTC_WAKEUP_MASK = 1U << ANDROID_ALARM_RTC_WAKEUP,
+ ANDROID_ALARM_RTC_MASK = 1U << ANDROID_ALARM_RTC,
+ ANDROID_ALARM_ELAPSED_REALTIME_WAKEUP_MASK = 1U << ANDROID_ALARM_ELAPSED_REALTIME_WAKEUP,
+ ANDROID_ALARM_ELAPSED_REALTIME_MASK = 1U << ANDROID_ALARM_ELAPSED_REALTIME,
+ ANDROID_ALARM_SYSTEMTIME_MASK = 1U << ANDROID_ALARM_SYSTEMTIME,
+ ANDROID_ALARM_TIME_CHANGE_MASK = 1U << 16
+} android_alarm_return_flags_t;
+
+#define ANDROID_ALARM_CLEAR(type) _IO('a', 0 | ((type) << 4)) 
+#define ANDROID_ALARM_WAIT _IO('a', 1) 
+#define ANDROID_ALARM_SET(type) _IOW('a', 2 | ((type) << 4), struct timespec) 
+#define ANDROID_ALARM_SET_AND_WAIT(type) _IOW('a', 3 | ((type) << 4), struct timespec)
+#define ANDROID_ALARM_GET_TIME(type) _IOW('a', 4 | ((type) << 4), struct timespec)
+#define ANDROID_ALARM_SET_RTC _IOW('a', 5, struct timespec)
+#define ANDROID_ALARM_SET_TIMEZONE _IOW('a', 6, struct timezone)
+
+#define ANDROID_ALARM_BASE_CMD(cmd) (cmd & ~(_IOC(0, 0, 0xf0, 0)))
+#define ANDROID_ALARM_IOCTL_TO_TYPE(cmd) (_IOC_NR(cmd) >> 4)
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/android_pmem.h b/ndk/platforms/android-3/include/linux/android_pmem.h
new file mode 100644
index 0000000..858857e
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/android_pmem.h
@@ -0,0 +1,52 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ANDROID_PMEM_H_
+#define _ANDROID_PMEM_H_
+
+#include <stdint.h>
+
+#ifndef __user
+#define __user
+#endif
+
+struct pmem_region {
+ unsigned long offset;
+ unsigned long len;
+};
+
+#define PMEM_IOCTL_MAGIC 'p'
+#define PMEM_GET_PHYS _IOW(PMEM_IOCTL_MAGIC, 1, struct pmem_region *)
+#define PMEM_MAP _IOW(PMEM_IOCTL_MAGIC, 2, struct pmem_region *)
+#define PMEM_GET_SIZE _IOW(PMEM_IOCTL_MAGIC, 3, struct pmem_region *)
+#define PMEM_UNMAP _IOW(PMEM_IOCTL_MAGIC, 4, struct pmem_region *)
+
+#define PMEM_ALLOCATE _IOW(PMEM_IOCTL_MAGIC, 5, unsigned int)
+
+#define PMEM_CONNECT _IOW(PMEM_IOCTL_MAGIC, 6, unsigned int)
+
+#define PMEM_GET_TOTAL_SIZE _IOW(PMEM_IOCTL_MAGIC, 7, struct pmem_region *)
+
+#define HW3D_REVOKE_GPU _IOW(PMEM_IOCTL_MAGIC, 8, unsigned int)
+#define HW3D_GRANT_GPU _IOW(PMEM_IOCTL_MAGIC, 9, unsigned int)
+#define HW3D_WAIT_IRQ _IOW(PMEM_IOCTL_MAGIC,10, unsigned int)
+
+struct android_pmem_platform_data;
+struct pmem_file_operations {
+ int (*mmap) (struct file *, struct vm_area_struct *);
+ int (*open) (struct inode *, struct file *);
+ ssize_t (*read) (struct file *, char __user *, size_t, long long *);
+ int (*release) (struct inode *, struct file *);
+ long (*ioctl) (struct file *, unsigned int, unsigned long);
+};
+
+#endif
+
diff --git a/ndk/platforms/android-3/include/linux/android_power.h b/ndk/platforms/android-3/include/linux/android_power.h
new file mode 100644
index 0000000..2e90321
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/android_power.h
@@ -0,0 +1,55 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_ANDROID_POWER_H
+#define _LINUX_ANDROID_POWER_H
+
+#include <linux/list.h>
+
+typedef struct
+{
+ struct list_head link;
+ int lock_count;
+ int flags;
+ const char *name;
+ int expires;
+} android_suspend_lock_t;
+
+#define ANDROID_SUSPEND_LOCK_FLAG_COUNTED (1U << 0)
+#define ANDROID_SUSPEND_LOCK_FLAG_USER_READABLE (1U << 1)
+#define ANDROID_SUSPEND_LOCK_FLAG_USER_SET (1U << 2)
+#define ANDROID_SUSPEND_LOCK_FLAG_USER_CLEAR (1U << 3)
+#define ANDROID_SUSPEND_LOCK_FLAG_USER_INC (1U << 4)
+#define ANDROID_SUSPEND_LOCK_FLAG_USER_DEC (1U << 5)
+#define ANDROID_SUSPEND_LOCK_FLAG_USER_VISIBLE_MASK (0x1fU << 1)
+#define ANDROID_SUSPEND_LOCK_AUTO_EXPIRE (1U << 6)
+
+typedef struct android_early_suspend android_early_suspend_t;
+struct android_early_suspend
+{
+ struct list_head link;
+ int level;
+ void (*suspend)(android_early_suspend_t *h);
+ void (*resume)(android_early_suspend_t *h);
+};
+
+typedef enum {
+ ANDROID_CHARGING_STATE_UNKNOWN,
+ ANDROID_CHARGING_STATE_DISCHARGE,
+ ANDROID_CHARGING_STATE_MAINTAIN,
+ ANDROID_CHARGING_STATE_SLOW,
+ ANDROID_CHARGING_STATE_NORMAL,
+ ANDROID_CHARGING_STATE_FAST,
+ ANDROID_CHARGING_STATE_OVERHEAT
+} android_charging_state_t;
+
+#endif
+
diff --git a/ndk/platforms/android-3/include/linux/apm_bios.h b/ndk/platforms/android-3/include/linux/apm_bios.h
new file mode 100644
index 0000000..d32b4aa
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/apm_bios.h
@@ -0,0 +1,94 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_APM_H
+#define _LINUX_APM_H
+
+typedef unsigned short apm_event_t;
+typedef unsigned short apm_eventinfo_t;
+
+#define APM_STATE_READY 0x0000
+#define APM_STATE_STANDBY 0x0001
+#define APM_STATE_SUSPEND 0x0002
+#define APM_STATE_OFF 0x0003
+#define APM_STATE_BUSY 0x0004
+#define APM_STATE_REJECT 0x0005
+#define APM_STATE_OEM_SYS 0x0020
+#define APM_STATE_OEM_DEV 0x0040
+
+#define APM_STATE_DISABLE 0x0000
+#define APM_STATE_ENABLE 0x0001
+
+#define APM_STATE_DISENGAGE 0x0000
+#define APM_STATE_ENGAGE 0x0001
+
+#define APM_SYS_STANDBY 0x0001
+#define APM_SYS_SUSPEND 0x0002
+#define APM_NORMAL_RESUME 0x0003
+#define APM_CRITICAL_RESUME 0x0004
+#define APM_LOW_BATTERY 0x0005
+#define APM_POWER_STATUS_CHANGE 0x0006
+#define APM_UPDATE_TIME 0x0007
+#define APM_CRITICAL_SUSPEND 0x0008
+#define APM_USER_STANDBY 0x0009
+#define APM_USER_SUSPEND 0x000a
+#define APM_STANDBY_RESUME 0x000b
+#define APM_CAPABILITY_CHANGE 0x000c
+
+#define APM_SUCCESS 0x00
+#define APM_DISABLED 0x01
+#define APM_CONNECTED 0x02
+#define APM_NOT_CONNECTED 0x03
+#define APM_16_CONNECTED 0x05
+#define APM_16_UNSUPPORTED 0x06
+#define APM_32_CONNECTED 0x07
+#define APM_32_UNSUPPORTED 0x08
+#define APM_BAD_DEVICE 0x09
+#define APM_BAD_PARAM 0x0a
+#define APM_NOT_ENGAGED 0x0b
+#define APM_BAD_FUNCTION 0x0c
+#define APM_RESUME_DISABLED 0x0d
+#define APM_NO_ERROR 0x53
+#define APM_BAD_STATE 0x60
+#define APM_NO_EVENTS 0x80
+#define APM_NOT_PRESENT 0x86
+
+#define APM_DEVICE_BIOS 0x0000
+#define APM_DEVICE_ALL 0x0001
+#define APM_DEVICE_DISPLAY 0x0100
+#define APM_DEVICE_STORAGE 0x0200
+#define APM_DEVICE_PARALLEL 0x0300
+#define APM_DEVICE_SERIAL 0x0400
+#define APM_DEVICE_NETWORK 0x0500
+#define APM_DEVICE_PCMCIA 0x0600
+#define APM_DEVICE_BATTERY 0x8000
+#define APM_DEVICE_OEM 0xe000
+#define APM_DEVICE_OLD_ALL 0xffff
+#define APM_DEVICE_CLASS 0x00ff
+#define APM_DEVICE_MASK 0xff00
+
+#define APM_MAX_BATTERIES 2
+
+#define APM_CAP_GLOBAL_STANDBY 0x0001
+#define APM_CAP_GLOBAL_SUSPEND 0x0002
+#define APM_CAP_RESUME_STANDBY_TIMER 0x0004  
+#define APM_CAP_RESUME_SUSPEND_TIMER 0x0008  
+#define APM_CAP_RESUME_STANDBY_RING 0x0010  
+#define APM_CAP_RESUME_SUSPEND_RING 0x0020  
+#define APM_CAP_RESUME_STANDBY_PCMCIA 0x0040  
+#define APM_CAP_RESUME_SUSPEND_PCMCIA 0x0080  
+
+#include <linux/ioctl.h>
+
+#define APM_IOC_STANDBY _IO('A', 1)
+#define APM_IOC_SUSPEND _IO('A', 2)
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/ashmem.h b/ndk/platforms/android-3/include/linux/ashmem.h
new file mode 100644
index 0000000..a57d1de
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/ashmem.h
@@ -0,0 +1,46 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_ASHMEM_H
+#define _LINUX_ASHMEM_H
+
+#include <linux/limits.h>
+#include <linux/ioctl.h>
+
+#define ASHMEM_NAME_LEN 256
+
+#define ASHMEM_NAME_DEF "dev/ashmem"
+
+#define ASHMEM_NOT_PURGED 0
+#define ASHMEM_WAS_PURGED 1
+
+#define ASHMEM_IS_UNPINNED 0
+#define ASHMEM_IS_PINNED 1
+
+struct ashmem_pin {
+ __u32 offset;
+ __u32 len;
+};
+
+#define __ASHMEMIOC 0x77
+
+#define ASHMEM_SET_NAME _IOW(__ASHMEMIOC, 1, char[ASHMEM_NAME_LEN])
+#define ASHMEM_GET_NAME _IOR(__ASHMEMIOC, 2, char[ASHMEM_NAME_LEN])
+#define ASHMEM_SET_SIZE _IOW(__ASHMEMIOC, 3, size_t)
+#define ASHMEM_GET_SIZE _IO(__ASHMEMIOC, 4)
+#define ASHMEM_SET_PROT_MASK _IOW(__ASHMEMIOC, 5, unsigned long)
+#define ASHMEM_GET_PROT_MASK _IO(__ASHMEMIOC, 6)
+#define ASHMEM_PIN _IOW(__ASHMEMIOC, 7, struct ashmem_pin)
+#define ASHMEM_UNPIN _IOW(__ASHMEMIOC, 8, struct ashmem_pin)
+#define ASHMEM_GET_PIN_STATUS _IO(__ASHMEMIOC, 9)
+#define ASHMEM_PURGE_ALL_CACHES _IO(__ASHMEMIOC, 10)
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/ata.h b/ndk/platforms/android-3/include/linux/ata.h
new file mode 100644
index 0000000..76af576
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/ata.h
@@ -0,0 +1,265 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __LINUX_ATA_H__
+#define __LINUX_ATA_H__
+
+#include <linux/types.h>
+
+#define ATA_DMA_BOUNDARY 0xffffUL
+#define ATA_DMA_MASK 0xffffffffULL
+
+enum {
+
+ ATA_MAX_DEVICES = 2,
+ ATA_MAX_PRD = 256,
+ ATA_SECT_SIZE = 512,
+
+ ATA_ID_WORDS = 256,
+ ATA_ID_SERNO_OFS = 10,
+ ATA_ID_FW_REV_OFS = 23,
+ ATA_ID_PROD_OFS = 27,
+ ATA_ID_OLD_PIO_MODES = 51,
+ ATA_ID_FIELD_VALID = 53,
+ ATA_ID_MWDMA_MODES = 63,
+ ATA_ID_PIO_MODES = 64,
+ ATA_ID_EIDE_DMA_MIN = 65,
+ ATA_ID_EIDE_PIO = 67,
+ ATA_ID_EIDE_PIO_IORDY = 68,
+ ATA_ID_UDMA_MODES = 88,
+ ATA_ID_MAJOR_VER = 80,
+ ATA_ID_PIO4 = (1 << 1),
+
+ ATA_PCI_CTL_OFS = 2,
+ ATA_SERNO_LEN = 20,
+ ATA_UDMA0 = (1 << 0),
+ ATA_UDMA1 = ATA_UDMA0 | (1 << 1),
+ ATA_UDMA2 = ATA_UDMA1 | (1 << 2),
+ ATA_UDMA3 = ATA_UDMA2 | (1 << 3),
+ ATA_UDMA4 = ATA_UDMA3 | (1 << 4),
+ ATA_UDMA5 = ATA_UDMA4 | (1 << 5),
+ ATA_UDMA6 = ATA_UDMA5 | (1 << 6),
+ ATA_UDMA7 = ATA_UDMA6 | (1 << 7),
+
+ ATA_UDMA_MASK_40C = ATA_UDMA2,
+
+ ATA_PRD_SZ = 8,
+ ATA_PRD_TBL_SZ = (ATA_MAX_PRD * ATA_PRD_SZ),
+ ATA_PRD_EOT = (1 << 31),
+
+ ATA_DMA_TABLE_OFS = 4,
+ ATA_DMA_STATUS = 2,
+ ATA_DMA_CMD = 0,
+ ATA_DMA_WR = (1 << 3),
+ ATA_DMA_START = (1 << 0),
+ ATA_DMA_INTR = (1 << 2),
+ ATA_DMA_ERR = (1 << 1),
+ ATA_DMA_ACTIVE = (1 << 0),
+
+ ATA_HOB = (1 << 7),
+ ATA_NIEN = (1 << 1),
+ ATA_LBA = (1 << 6),
+ ATA_DEV1 = (1 << 4),
+ ATA_DEVICE_OBS = (1 << 7) | (1 << 5),
+ ATA_DEVCTL_OBS = (1 << 3),
+ ATA_BUSY = (1 << 7),
+ ATA_DRDY = (1 << 6),
+ ATA_DF = (1 << 5),
+ ATA_DRQ = (1 << 3),
+ ATA_ERR = (1 << 0),
+ ATA_SRST = (1 << 2),
+ ATA_ICRC = (1 << 7),
+ ATA_UNC = (1 << 6),
+ ATA_IDNF = (1 << 4),
+ ATA_ABORTED = (1 << 2),
+
+ ATA_REG_DATA = 0x00,
+ ATA_REG_ERR = 0x01,
+ ATA_REG_NSECT = 0x02,
+ ATA_REG_LBAL = 0x03,
+ ATA_REG_LBAM = 0x04,
+ ATA_REG_LBAH = 0x05,
+ ATA_REG_DEVICE = 0x06,
+ ATA_REG_STATUS = 0x07,
+
+ ATA_REG_FEATURE = ATA_REG_ERR,
+ ATA_REG_CMD = ATA_REG_STATUS,
+ ATA_REG_BYTEL = ATA_REG_LBAM,
+ ATA_REG_BYTEH = ATA_REG_LBAH,
+ ATA_REG_DEVSEL = ATA_REG_DEVICE,
+ ATA_REG_IRQ = ATA_REG_NSECT,
+
+ ATA_CMD_CHK_POWER = 0xE5,
+ ATA_CMD_STANDBY = 0xE2,
+ ATA_CMD_IDLE = 0xE3,
+ ATA_CMD_EDD = 0x90,
+ ATA_CMD_FLUSH = 0xE7,
+ ATA_CMD_FLUSH_EXT = 0xEA,
+ ATA_CMD_ID_ATA = 0xEC,
+ ATA_CMD_ID_ATAPI = 0xA1,
+ ATA_CMD_READ = 0xC8,
+ ATA_CMD_READ_EXT = 0x25,
+ ATA_CMD_WRITE = 0xCA,
+ ATA_CMD_WRITE_EXT = 0x35,
+ ATA_CMD_WRITE_FUA_EXT = 0x3D,
+ ATA_CMD_FPDMA_READ = 0x60,
+ ATA_CMD_FPDMA_WRITE = 0x61,
+ ATA_CMD_PIO_READ = 0x20,
+ ATA_CMD_PIO_READ_EXT = 0x24,
+ ATA_CMD_PIO_WRITE = 0x30,
+ ATA_CMD_PIO_WRITE_EXT = 0x34,
+ ATA_CMD_READ_MULTI = 0xC4,
+ ATA_CMD_READ_MULTI_EXT = 0x29,
+ ATA_CMD_WRITE_MULTI = 0xC5,
+ ATA_CMD_WRITE_MULTI_EXT = 0x39,
+ ATA_CMD_WRITE_MULTI_FUA_EXT = 0xCE,
+ ATA_CMD_SET_FEATURES = 0xEF,
+ ATA_CMD_PACKET = 0xA0,
+ ATA_CMD_VERIFY = 0x40,
+ ATA_CMD_VERIFY_EXT = 0x42,
+ ATA_CMD_STANDBYNOW1 = 0xE0,
+ ATA_CMD_IDLEIMMEDIATE = 0xE1,
+ ATA_CMD_INIT_DEV_PARAMS = 0x91,
+ ATA_CMD_READ_NATIVE_MAX = 0xF8,
+ ATA_CMD_READ_NATIVE_MAX_EXT = 0x27,
+ ATA_CMD_READ_LOG_EXT = 0x2f,
+
+ ATA_LOG_SATA_NCQ = 0x10,
+
+ SETFEATURES_XFER = 0x03,
+ XFER_UDMA_7 = 0x47,
+ XFER_UDMA_6 = 0x46,
+ XFER_UDMA_5 = 0x45,
+ XFER_UDMA_4 = 0x44,
+ XFER_UDMA_3 = 0x43,
+ XFER_UDMA_2 = 0x42,
+ XFER_UDMA_1 = 0x41,
+ XFER_UDMA_0 = 0x40,
+ XFER_MW_DMA_2 = 0x22,
+ XFER_MW_DMA_1 = 0x21,
+ XFER_MW_DMA_0 = 0x20,
+ XFER_SW_DMA_2 = 0x12,
+ XFER_SW_DMA_1 = 0x11,
+ XFER_SW_DMA_0 = 0x10,
+ XFER_PIO_4 = 0x0C,
+ XFER_PIO_3 = 0x0B,
+ XFER_PIO_2 = 0x0A,
+ XFER_PIO_1 = 0x09,
+ XFER_PIO_0 = 0x08,
+ XFER_PIO_SLOW = 0x00,
+
+ SETFEATURES_WC_ON = 0x02,
+ SETFEATURES_WC_OFF = 0x82,
+
+ ATAPI_PKT_DMA = (1 << 0),
+ ATAPI_DMADIR = (1 << 2),
+ ATAPI_CDB_LEN = 16,
+
+ ATA_CBL_NONE = 0,
+ ATA_CBL_PATA40 = 1,
+ ATA_CBL_PATA80 = 2,
+ ATA_CBL_PATA_UNK = 3,
+ ATA_CBL_SATA = 4,
+
+ SCR_STATUS = 0,
+ SCR_ERROR = 1,
+ SCR_CONTROL = 2,
+ SCR_ACTIVE = 3,
+ SCR_NOTIFICATION = 4,
+
+ SERR_DATA_RECOVERED = (1 << 0),
+ SERR_COMM_RECOVERED = (1 << 1),
+ SERR_DATA = (1 << 8),
+ SERR_PERSISTENT = (1 << 9),
+ SERR_PROTOCOL = (1 << 10),
+ SERR_INTERNAL = (1 << 11),
+ SERR_PHYRDY_CHG = (1 << 16),
+ SERR_DEV_XCHG = (1 << 26),
+
+ ATA_TFLAG_LBA48 = (1 << 0),
+ ATA_TFLAG_ISADDR = (1 << 1),
+ ATA_TFLAG_DEVICE = (1 << 2),
+ ATA_TFLAG_WRITE = (1 << 3),
+ ATA_TFLAG_LBA = (1 << 4),
+ ATA_TFLAG_FUA = (1 << 5),
+ ATA_TFLAG_POLLING = (1 << 6),
+};
+
+enum ata_tf_protocols {
+
+ ATA_PROT_UNKNOWN,
+ ATA_PROT_NODATA,
+ ATA_PROT_PIO,
+ ATA_PROT_DMA,
+ ATA_PROT_NCQ,
+ ATA_PROT_ATAPI,
+ ATA_PROT_ATAPI_NODATA,
+ ATA_PROT_ATAPI_DMA,
+};
+
+enum ata_ioctls {
+ ATA_IOC_GET_IO32 = 0x309,
+ ATA_IOC_SET_IO32 = 0x324,
+};
+
+struct ata_prd {
+ u32 addr;
+ u32 flags_len;
+};
+
+struct ata_taskfile {
+ unsigned long flags;
+ u8 protocol;
+
+ u8 ctl;
+
+ u8 hob_feature;
+ u8 hob_nsect;
+ u8 hob_lbal;
+ u8 hob_lbam;
+ u8 hob_lbah;
+
+ u8 feature;
+ u8 nsect;
+ u8 lbal;
+ u8 lbam;
+ u8 lbah;
+
+ u8 device;
+
+ u8 command;
+};
+
+#define ata_id_is_ata(id) (((id)[0] & (1 << 15)) == 0)
+#define ata_id_is_cfa(id) ((id)[0] == 0x848A)
+#define ata_id_is_sata(id) ((id)[93] == 0)
+#define ata_id_rahead_enabled(id) ((id)[85] & (1 << 6))
+#define ata_id_wcache_enabled(id) ((id)[85] & (1 << 5))
+#define ata_id_hpa_enabled(id) ((id)[85] & (1 << 10))
+#define ata_id_has_fua(id) ((id)[84] & (1 << 6))
+#define ata_id_has_flush(id) ((id)[83] & (1 << 12))
+#define ata_id_has_flush_ext(id) ((id)[83] & (1 << 13))
+#define ata_id_has_lba48(id) ((id)[83] & (1 << 10))
+#define ata_id_has_hpa(id) ((id)[82] & (1 << 10))
+#define ata_id_has_wcache(id) ((id)[82] & (1 << 5))
+#define ata_id_has_pm(id) ((id)[82] & (1 << 3))
+#define ata_id_has_lba(id) ((id)[49] & (1 << 9))
+#define ata_id_has_dma(id) ((id)[49] & (1 << 8))
+#define ata_id_has_ncq(id) ((id)[76] & (1 << 8))
+#define ata_id_queue_depth(id) (((id)[75] & 0x1f) + 1)
+#define ata_id_removeable(id) ((id)[0] & (1 << 7))
+#define ata_id_has_dword_io(id) ((id)[50] & (1 << 0))
+#define ata_id_u32(id,n)   (((u32) (id)[(n) + 1] << 16) | ((u32) (id)[(n)]))
+#define ata_id_u64(id,n)   ( ((u64) (id)[(n) + 3] << 48) |   ((u64) (id)[(n) + 2] << 32) |   ((u64) (id)[(n) + 1] << 16) |   ((u64) (id)[(n) + 0]) )
+
+#define ata_id_cdb_intr(id) (((id)[0] & 0x60) == 0x20)
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/atm.h b/ndk/platforms/android-3/include/linux/atm.h
new file mode 100644
index 0000000..c9bcd70
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/atm.h
@@ -0,0 +1,161 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_ATM_H
+#define _LINUX_ATM_H
+
+#include <linux/compiler.h>
+#include <linux/atmapi.h>
+#include <linux/atmsap.h>
+#include <linux/atmioc.h>
+
+#define ATM_CELL_SIZE 53  
+#define ATM_CELL_PAYLOAD 48  
+#define ATM_AAL0_SDU 52  
+#define ATM_MAX_AAL34_PDU 65535  
+#define ATM_AAL5_TRAILER 8  
+#define ATM_MAX_AAL5_PDU 65535  
+#define ATM_MAX_CDV 9999  
+#define ATM_NOT_RSV_VCI 32  
+
+#define ATM_MAX_VPI 255  
+#define ATM_MAX_VPI_NNI 4096  
+#define ATM_MAX_VCI 65535  
+
+#define ATM_NO_AAL 0  
+#define ATM_AAL0 13  
+#define ATM_AAL1 1  
+#define ATM_AAL2 2  
+#define ATM_AAL34 3  
+#define ATM_AAL5 5  
+
+#define __SO_ENCODE(l,n,t) ((((l) & 0x1FF) << 22) | ((n) << 16) |   sizeof(t))
+#define __SO_LEVEL_MATCH(c,m) (((c) >> 22) == ((m) & 0x1FF))
+#define __SO_NUMBER(c) (((c) >> 16) & 0x3f)
+#define __SO_SIZE(c) ((c) & 0x3fff)
+
+#define SO_SETCLP __SO_ENCODE(SOL_ATM,0,int)
+
+#define SO_CIRANGE __SO_ENCODE(SOL_ATM,1,struct atm_cirange)
+
+#define SO_ATMQOS __SO_ENCODE(SOL_ATM,2,struct atm_qos)
+
+#define SO_ATMSAP __SO_ENCODE(SOL_ATM,3,struct atm_sap)
+
+#define SO_ATMPVC __SO_ENCODE(SOL_ATM,4,struct sockaddr_atmpvc)
+
+#define SO_MULTIPOINT __SO_ENCODE(SOL_ATM, 5, int)
+
+#define ATM_HDR_GFC_MASK 0xf0000000
+#define ATM_HDR_GFC_SHIFT 28
+#define ATM_HDR_VPI_MASK 0x0ff00000
+#define ATM_HDR_VPI_SHIFT 20
+#define ATM_HDR_VCI_MASK 0x000ffff0
+#define ATM_HDR_VCI_SHIFT 4
+#define ATM_HDR_PTI_MASK 0x0000000e
+#define ATM_HDR_PTI_SHIFT 1
+#define ATM_HDR_CLP 0x00000001
+
+#define ATM_PTI_US0 0  
+#define ATM_PTI_US1 1  
+#define ATM_PTI_UCES0 2  
+#define ATM_PTI_UCES1 3  
+#define ATM_PTI_SEGF5 4  
+#define ATM_PTI_E2EF5 5  
+#define ATM_PTI_RSV_RM 6  
+#define ATM_PTI_RSV 7  
+
+#define ATM_NONE 0  
+#define ATM_UBR 1
+#define ATM_CBR 2
+#define ATM_VBR 3
+#define ATM_ABR 4
+#define ATM_ANYCLASS 5  
+
+#define ATM_MAX_PCR -1  
+
+struct atm_trafprm {
+ unsigned char traffic_class;
+ int max_pcr;
+ int pcr;
+ int min_pcr;
+ int max_cdv;
+ int max_sdu;
+
+ unsigned int icr;
+ unsigned int tbe;
+ unsigned int frtt : 24;
+ unsigned int rif : 4;
+ unsigned int rdf : 4;
+ unsigned int nrm_pres :1;
+ unsigned int trm_pres :1;
+ unsigned int adtf_pres :1;
+ unsigned int cdf_pres :1;
+ unsigned int nrm :3;
+ unsigned int trm :3;
+ unsigned int adtf :10;
+ unsigned int cdf :3;
+ unsigned int spare :9;
+};
+
+struct atm_qos {
+ struct atm_trafprm txtp;
+ struct atm_trafprm rxtp __ATM_API_ALIGN;
+
+ unsigned char aal __ATM_API_ALIGN;
+};
+
+#define ATM_ITF_ANY -1  
+#define ATM_VPI_ANY -1
+#define ATM_VCI_ANY -1
+#define ATM_VPI_UNSPEC -2
+#define ATM_VCI_UNSPEC -2
+
+struct sockaddr_atmpvc {
+ unsigned short sap_family;
+ struct {
+ short itf;
+ short vpi;
+ int vci;
+ } sap_addr __ATM_API_ALIGN;
+};
+
+#define ATM_ESA_LEN 20  
+#define ATM_E164_LEN 12  
+
+#define ATM_AFI_DCC 0x39  
+#define ATM_AFI_ICD 0x47  
+#define ATM_AFI_E164 0x45  
+#define ATM_AFI_LOCAL 0x49   
+
+#define ATM_AFI_DCC_GROUP 0xBD  
+#define ATM_AFI_ICD_GROUP 0xC5  
+#define ATM_AFI_E164_GROUP 0xC3  
+#define ATM_AFI_LOCAL_GROUP 0xC7  
+
+#define ATM_LIJ_NONE 0  
+#define ATM_LIJ 1  
+#define ATM_LIJ_RPJ 2  
+#define ATM_LIJ_NJ 3  
+
+struct sockaddr_atmsvc {
+ unsigned short sas_family;
+ struct {
+ unsigned char prv[ATM_ESA_LEN];
+ char pub[ATM_E164_LEN+1];
+
+ char lij_type;
+ uint32_t lij_id;
+ } sas_addr __ATM_API_ALIGN;
+};
+
+typedef unsigned short atm_backend_t;
+#endif
diff --git a/ndk/platforms/android-3/include/linux/atmapi.h b/ndk/platforms/android-3/include/linux/atmapi.h
new file mode 100644
index 0000000..bee5cae
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/atmapi.h
@@ -0,0 +1,24 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_ATMAPI_H
+#define _LINUX_ATMAPI_H
+
+#if defined(__sparc__) || defined(__ia64__)
+
+#define __ATM_API_ALIGN __attribute__((aligned(8)))
+#else
+#define __ATM_API_ALIGN
+#endif
+
+typedef struct { unsigned char _[8]; } __ATM_API_ALIGN atm_kptr_t;
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/atmdev.h b/ndk/platforms/android-3/include/linux/atmdev.h
new file mode 100644
index 0000000..27baeb0
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/atmdev.h
@@ -0,0 +1,161 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef LINUX_ATMDEV_H
+#define LINUX_ATMDEV_H
+
+#include <linux/atmapi.h>
+#include <linux/atm.h>
+#include <linux/atmioc.h>
+
+#define ESI_LEN 6
+
+#define ATM_OC3_PCR (155520000/270*260/8/53)
+
+#define ATM_25_PCR ((25600000/8-8000)/54)
+
+#define ATM_OC12_PCR (622080000/1080*1040/8/53)
+
+#define ATM_DS3_PCR (8000*12)
+
+#define __AAL_STAT_ITEMS   __HANDLE_ITEM(tx);     __HANDLE_ITEM(tx_err);     __HANDLE_ITEM(rx);     __HANDLE_ITEM(rx_err);     __HANDLE_ITEM(rx_drop);  
+
+struct atm_aal_stats {
+#define __HANDLE_ITEM(i) int i
+ __AAL_STAT_ITEMS
+#undef __HANDLE_ITEM
+};
+
+struct atm_dev_stats {
+ struct atm_aal_stats aal0;
+ struct atm_aal_stats aal34;
+ struct atm_aal_stats aal5;
+} __ATM_API_ALIGN;
+
+#define ATM_GETLINKRATE _IOW('a',ATMIOC_ITF+1,struct atmif_sioc)
+
+#define ATM_GETNAMES _IOW('a',ATMIOC_ITF+3,struct atm_iobuf)
+
+#define ATM_GETTYPE _IOW('a',ATMIOC_ITF+4,struct atmif_sioc)
+
+#define ATM_GETESI _IOW('a',ATMIOC_ITF+5,struct atmif_sioc)
+
+#define ATM_GETADDR _IOW('a',ATMIOC_ITF+6,struct atmif_sioc)
+
+#define ATM_RSTADDR _IOW('a',ATMIOC_ITF+7,struct atmif_sioc)
+
+#define ATM_ADDADDR _IOW('a',ATMIOC_ITF+8,struct atmif_sioc)
+
+#define ATM_DELADDR _IOW('a',ATMIOC_ITF+9,struct atmif_sioc)
+
+#define ATM_GETCIRANGE _IOW('a',ATMIOC_ITF+10,struct atmif_sioc)
+
+#define ATM_SETCIRANGE _IOW('a',ATMIOC_ITF+11,struct atmif_sioc)
+
+#define ATM_SETESI _IOW('a',ATMIOC_ITF+12,struct atmif_sioc)
+
+#define ATM_SETESIF _IOW('a',ATMIOC_ITF+13,struct atmif_sioc)
+
+#define ATM_ADDLECSADDR _IOW('a', ATMIOC_ITF+14, struct atmif_sioc)
+
+#define ATM_DELLECSADDR _IOW('a', ATMIOC_ITF+15, struct atmif_sioc)
+
+#define ATM_GETLECSADDR _IOW('a', ATMIOC_ITF+16, struct atmif_sioc)
+
+#define ATM_GETSTAT _IOW('a',ATMIOC_SARCOM+0,struct atmif_sioc)
+
+#define ATM_GETSTATZ _IOW('a',ATMIOC_SARCOM+1,struct atmif_sioc)
+
+#define ATM_GETLOOP _IOW('a',ATMIOC_SARCOM+2,struct atmif_sioc)
+
+#define ATM_SETLOOP _IOW('a',ATMIOC_SARCOM+3,struct atmif_sioc)
+
+#define ATM_QUERYLOOP _IOW('a',ATMIOC_SARCOM+4,struct atmif_sioc)
+
+#define ATM_SETSC _IOW('a',ATMIOC_SPECIAL+1,int)
+
+#define ATM_SETBACKEND _IOW('a',ATMIOC_SPECIAL+2,atm_backend_t)
+
+#define ATM_NEWBACKENDIF _IOW('a',ATMIOC_SPECIAL+3,atm_backend_t)
+
+#define ATM_ADDPARTY _IOW('a', ATMIOC_SPECIAL+4,struct atm_iobuf)
+
+#define ATM_DROPPARTY _IOW('a', ATMIOC_SPECIAL+5,int)
+
+#define ATM_BACKEND_RAW 0 
+#define ATM_BACKEND_PPP 1  
+#define ATM_BACKEND_BR2684 2  
+
+#define ATM_ITFTYP_LEN 8  
+
+#define __ATM_LM_NONE 0  
+#define __ATM_LM_AAL 1  
+#define __ATM_LM_ATM 2  
+
+#define __ATM_LM_PHY 8  
+#define __ATM_LM_ANALOG 16  
+
+#define __ATM_LM_MKLOC(n) ((n))  
+#define __ATM_LM_MKRMT(n) ((n) << 8)  
+
+#define __ATM_LM_XTLOC(n) ((n) & 0xff)
+#define __ATM_LM_XTRMT(n) (((n) >> 8) & 0xff)
+
+#define ATM_LM_NONE 0  
+
+#define ATM_LM_LOC_AAL __ATM_LM_MKLOC(__ATM_LM_AAL)
+#define ATM_LM_LOC_ATM __ATM_LM_MKLOC(__ATM_LM_ATM)
+#define ATM_LM_LOC_PHY __ATM_LM_MKLOC(__ATM_LM_PHY)
+#define ATM_LM_LOC_ANALOG __ATM_LM_MKLOC(__ATM_LM_ANALOG)
+
+#define ATM_LM_RMT_AAL __ATM_LM_MKRMT(__ATM_LM_AAL)
+#define ATM_LM_RMT_ATM __ATM_LM_MKRMT(__ATM_LM_ATM)
+#define ATM_LM_RMT_PHY __ATM_LM_MKRMT(__ATM_LM_PHY)
+#define ATM_LM_RMT_ANALOG __ATM_LM_MKRMT(__ATM_LM_ANALOG)
+
+struct atm_iobuf {
+ int length;
+ void __user *buffer;
+};
+
+#define ATM_CI_MAX -1  
+
+struct atm_cirange {
+ signed char vpi_bits;
+ signed char vci_bits;
+};
+
+#define ATM_SC_RX 1024  
+#define ATM_SC_TX 2048  
+
+#define ATM_BACKLOG_DEFAULT 32  
+
+#define ATM_MF_IMMED 1  
+#define ATM_MF_INC_RSV 2  
+#define ATM_MF_INC_SHP 4  
+#define ATM_MF_DEC_RSV 8  
+#define ATM_MF_DEC_SHP 16  
+#define ATM_MF_BWD 32  
+
+#define ATM_MF_SET (ATM_MF_INC_RSV | ATM_MF_INC_SHP | ATM_MF_DEC_RSV |   ATM_MF_DEC_SHP | ATM_MF_BWD)
+
+#define ATM_VS_IDLE 0  
+#define ATM_VS_CONNECTED 1  
+#define ATM_VS_CLOSING 2  
+#define ATM_VS_LISTEN 3  
+#define ATM_VS_INUSE 4  
+#define ATM_VS_BOUND 5  
+
+#define ATM_VS2TXT_MAP   "IDLE", "CONNECTED", "CLOSING", "LISTEN", "INUSE", "BOUND"
+
+#define ATM_VF2TXT_MAP   "ADDR", "READY", "PARTIAL", "REGIS",   "RELEASED", "HASQOS", "LISTEN", "META",   "256", "512", "1024", "2048",   "SESSION", "HASSAP", "BOUND", "CLOSE"
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/atmioc.h b/ndk/platforms/android-3/include/linux/atmioc.h
new file mode 100644
index 0000000..d004339
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/atmioc.h
@@ -0,0 +1,40 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_ATMIOC_H
+#define _LINUX_ATMIOC_H
+
+#include <asm/ioctl.h>
+
+#define ATMIOC_PHYCOM 0x00  
+#define ATMIOC_PHYCOM_END 0x0f
+#define ATMIOC_PHYTYP 0x10  
+#define ATMIOC_PHYTYP_END 0x2f
+#define ATMIOC_PHYPRV 0x30  
+#define ATMIOC_PHYPRV_END 0x4f
+#define ATMIOC_SARCOM 0x50  
+#define ATMIOC_SARCOM_END 0x50
+#define ATMIOC_SARPRV 0x60  
+#define ATMIOC_SARPRV_END 0x7f
+#define ATMIOC_ITF 0x80  
+#define ATMIOC_ITF_END 0x8f
+#define ATMIOC_BACKEND 0x90  
+#define ATMIOC_BACKEND_END 0xaf
+
+#define ATMIOC_AREQUIPA 0xc0  
+#define ATMIOC_LANE 0xd0  
+#define ATMIOC_MPOA 0xd8  
+#define ATMIOC_CLIP 0xe0  
+#define ATMIOC_CLIP_END 0xef
+#define ATMIOC_SPECIAL 0xf0  
+#define ATMIOC_SPECIAL_END 0xff
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/atmppp.h b/ndk/platforms/android-3/include/linux/atmppp.h
new file mode 100644
index 0000000..3330c32
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/atmppp.h
@@ -0,0 +1,26 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_ATMPPP_H
+#define _LINUX_ATMPPP_H
+
+#include <linux/atm.h>
+
+#define PPPOATM_ENCAPS_AUTODETECT (0)
+#define PPPOATM_ENCAPS_VC (1)
+#define PPPOATM_ENCAPS_LLC (2)
+
+struct atm_backend_ppp {
+ atm_backend_t backend_num;
+ int encaps;
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/atmsap.h b/ndk/platforms/android-3/include/linux/atmsap.h
new file mode 100644
index 0000000..456f75f
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/atmsap.h
@@ -0,0 +1,117 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_ATMSAP_H
+#define _LINUX_ATMSAP_H
+
+#include <linux/atmapi.h>
+
+#define ATM_L2_NONE 0  
+#define ATM_L2_ISO1745 0x01  
+#define ATM_L2_Q291 0x02  
+#define ATM_L2_X25_LL 0x06  
+#define ATM_L2_X25_ML 0x07  
+#define ATM_L2_LAPB 0x08  
+#define ATM_L2_HDLC_ARM 0x09  
+#define ATM_L2_HDLC_NRM 0x0a  
+#define ATM_L2_HDLC_ABM 0x0b  
+#define ATM_L2_ISO8802 0x0c  
+#define ATM_L2_X75 0x0d  
+#define ATM_L2_Q922 0x0e  
+#define ATM_L2_USER 0x10  
+#define ATM_L2_ISO7776 0x11  
+
+#define ATM_L3_NONE 0  
+#define ATM_L3_X25 0x06  
+#define ATM_L3_ISO8208 0x07  
+#define ATM_L3_X223 0x08  
+#define ATM_L3_ISO8473 0x09  
+#define ATM_L3_T70 0x0a  
+#define ATM_L3_TR9577 0x0b  
+#define ATM_L3_H310 0x0c  
+#define ATM_L3_H321 0x0d  
+#define ATM_L3_USER 0x10  
+
+#define ATM_HL_NONE 0  
+#define ATM_HL_ISO 0x01  
+#define ATM_HL_USER 0x02  
+#define ATM_HL_HLP 0x03  
+#define ATM_HL_VENDOR 0x04  
+
+#define ATM_IMD_NONE 0  
+#define ATM_IMD_NORMAL 1  
+#define ATM_IMD_EXTENDED 2  
+
+#define ATM_TT_NONE 0  
+#define ATM_TT_RX 1  
+#define ATM_TT_TX 2  
+#define ATM_TT_RXTX 3  
+
+#define ATM_MC_NONE 0  
+#define ATM_MC_TS 1  
+#define ATM_MC_TS_FEC 2  
+#define ATM_MC_PS 3  
+#define ATM_MC_PS_FEC 4  
+#define ATM_MC_H221 5  
+
+#define ATM_MAX_HLI 8  
+
+struct atm_blli {
+ unsigned char l2_proto;
+ union {
+ struct {
+ unsigned char mode;
+
+ unsigned char window;
+ } itu;
+ unsigned char user;
+ } l2;
+ unsigned char l3_proto;
+ union {
+ struct {
+ unsigned char mode;
+
+ unsigned char def_size;
+
+ unsigned char window;
+ } itu;
+ unsigned char user;
+ struct {
+ unsigned char term_type;
+ unsigned char fw_mpx_cap;
+
+ unsigned char bw_mpx_cap;
+
+ } h310;
+ struct {
+ unsigned char ipi;
+ unsigned char snap[5];
+
+ } tr9577;
+ } l3;
+} __ATM_API_ALIGN;
+
+struct atm_bhli {
+ unsigned char hl_type;
+ unsigned char hl_length;
+
+ unsigned char hl_info[ATM_MAX_HLI];
+};
+
+#define ATM_MAX_BLLI 3  
+
+struct atm_sap {
+ struct atm_bhli bhli;
+ struct atm_blli blli[ATM_MAX_BLLI] __ATM_API_ALIGN;
+
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/attribute_container.h b/ndk/platforms/android-3/include/linux/attribute_container.h
new file mode 100644
index 0000000..1a9bfb0
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/attribute_container.h
@@ -0,0 +1,34 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ATTRIBUTE_CONTAINER_H_
+#define _ATTRIBUTE_CONTAINER_H_
+
+#include <linux/device.h>
+#include <linux/list.h>
+#include <linux/klist.h>
+#include <linux/spinlock.h>
+
+struct attribute_container {
+ struct list_head node;
+ struct klist containers;
+ struct class *class;
+ struct class_device_attribute **attrs;
+ int (*match)(struct attribute_container *, struct device *);
+#define ATTRIBUTE_CONTAINER_NO_CLASSDEVS 0x01
+ unsigned long flags;
+};
+
+struct attribute_container *attribute_container_classdev_to_container(struct class_device *);
+struct class_device *attribute_container_find_class_device(struct attribute_container *, struct device *);
+struct class_device_attribute **attribute_container_classdev_to_attrs(const struct class_device *classdev);
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/auto_fs.h b/ndk/platforms/android-3/include/linux/auto_fs.h
new file mode 100644
index 0000000..3711cc4
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/auto_fs.h
@@ -0,0 +1,56 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_AUTO_FS_H
+#define _LINUX_AUTO_FS_H
+
+#include <linux/ioctl.h>
+
+#define AUTOFS_PROTO_VERSION 3
+
+#define AUTOFS_MAX_PROTO_VERSION AUTOFS_PROTO_VERSION
+#define AUTOFS_MIN_PROTO_VERSION AUTOFS_PROTO_VERSION
+
+#if defined(__sparc__) || defined(__mips__) || defined(__x86_64__) || defined(__powerpc__) || defined(__s390__)
+typedef unsigned int autofs_wqt_t;
+#else
+typedef unsigned long autofs_wqt_t;
+#endif
+
+#define autofs_ptype_missing 0  
+#define autofs_ptype_expire 1  
+
+struct autofs_packet_hdr {
+ int proto_version;
+ int type;
+};
+
+struct autofs_packet_missing {
+ struct autofs_packet_hdr hdr;
+ autofs_wqt_t wait_queue_token;
+ int len;
+ char name[NAME_MAX+1];
+};
+
+struct autofs_packet_expire {
+ struct autofs_packet_hdr hdr;
+ int len;
+ char name[NAME_MAX+1];
+};
+
+#define AUTOFS_IOC_READY _IO(0x93,0x60)
+#define AUTOFS_IOC_FAIL _IO(0x93,0x61)
+#define AUTOFS_IOC_CATATONIC _IO(0x93,0x62)
+#define AUTOFS_IOC_PROTOVER _IOR(0x93,0x63,int)
+#define AUTOFS_IOC_SETTIMEOUT _IOWR(0x93,0x64,unsigned long)
+#define AUTOFS_IOC_EXPIRE _IOR(0x93,0x65,struct autofs_packet_expire)
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/autoconf.h b/ndk/platforms/android-3/include/linux/autoconf.h
new file mode 100644
index 0000000..306bf12
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/autoconf.h
@@ -0,0 +1,17 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef LINUX_AUTOCONF_CRAP_GOES_HERE
+#define LINUX_AUTOCONF_CRAP_GOES_HERE
+
+#define AUTOCONF_INCLUDED
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/auxvec.h b/ndk/platforms/android-3/include/linux/auxvec.h
new file mode 100644
index 0000000..f8a0701
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/auxvec.h
@@ -0,0 +1,40 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_AUXVEC_H
+#define _LINUX_AUXVEC_H
+
+#include <asm/auxvec.h>
+
+#define AT_NULL 0  
+#define AT_IGNORE 1  
+#define AT_EXECFD 2  
+#define AT_PHDR 3  
+#define AT_PHENT 4  
+#define AT_PHNUM 5  
+#define AT_PAGESZ 6  
+#define AT_BASE 7  
+#define AT_FLAGS 8  
+#define AT_ENTRY 9  
+#define AT_NOTELF 10  
+#define AT_UID 11  
+#define AT_EUID 12  
+#define AT_GID 13  
+#define AT_EGID 14  
+#define AT_PLATFORM 15  
+#define AT_HWCAP 16  
+#define AT_CLKTCK 17  
+
+#define AT_SECURE 23  
+
+#define AT_VECTOR_SIZE 44  
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/backing-dev.h b/ndk/platforms/android-3/include/linux/backing-dev.h
new file mode 100644
index 0000000..4996d2c
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/backing-dev.h
@@ -0,0 +1,53 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_BACKING_DEV_H
+#define _LINUX_BACKING_DEV_H
+
+#include <asm/atomic.h>
+
+enum bdi_state {
+ BDI_pdflush,
+ BDI_write_congested,
+ BDI_read_congested,
+ BDI_unused,
+};
+
+typedef int (congested_fn)(void *, int);
+
+struct backing_dev_info {
+ unsigned long ra_pages;
+ unsigned long state;
+ unsigned int capabilities;
+ congested_fn *congested_fn;
+ void *congested_data;
+ void (*unplug_io_fn)(struct backing_dev_info *, struct page *);
+ void *unplug_io_data;
+};
+
+#define BDI_CAP_NO_ACCT_DIRTY 0x00000001  
+#define BDI_CAP_NO_WRITEBACK 0x00000002  
+#define BDI_CAP_MAP_COPY 0x00000004  
+#define BDI_CAP_MAP_DIRECT 0x00000008  
+#define BDI_CAP_READ_MAP 0x00000010  
+#define BDI_CAP_WRITE_MAP 0x00000020  
+#define BDI_CAP_EXEC_MAP 0x00000040  
+#define BDI_CAP_VMFLAGS   (BDI_CAP_READ_MAP | BDI_CAP_WRITE_MAP | BDI_CAP_EXEC_MAP)
+
+#if defined(VM_MAYREAD) && BDI_CAP_READ_MAP != (VM_MAYREAD || BDI_CAP_WRITE_MAP != (VM_MAYWRITE || BDI_CAP_EXEC_MAP != VM_MAYEXEC))
+#error please change backing_dev_info::capabilities flags
+#endif
+
+#define bdi_cap_writeback_dirty(bdi)   (!((bdi)->capabilities & BDI_CAP_NO_WRITEBACK))
+#define bdi_cap_account_dirty(bdi)   (!((bdi)->capabilities & BDI_CAP_NO_ACCT_DIRTY))
+#define mapping_cap_writeback_dirty(mapping)   bdi_cap_writeback_dirty((mapping)->backing_dev_info)
+#define mapping_cap_account_dirty(mapping)   bdi_cap_account_dirty((mapping)->backing_dev_info)
+#endif
diff --git a/ndk/platforms/android-3/include/linux/binder.h b/ndk/platforms/android-3/include/linux/binder.h
new file mode 100644
index 0000000..b97eafb
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/binder.h
@@ -0,0 +1,186 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_BINDER_H
+#define _LINUX_BINDER_H
+
+#include <linux/ioctl.h>
+
+#define B_PACK_CHARS(c1, c2, c3, c4)   ((((c1)<<24)) | (((c2)<<16)) | (((c3)<<8)) | (c4))
+#define B_TYPE_LARGE 0x85
+
+enum {
+ BINDER_TYPE_BINDER = B_PACK_CHARS('s', 'b', '*', B_TYPE_LARGE),
+ BINDER_TYPE_WEAK_BINDER = B_PACK_CHARS('w', 'b', '*', B_TYPE_LARGE),
+ BINDER_TYPE_HANDLE = B_PACK_CHARS('s', 'h', '*', B_TYPE_LARGE),
+ BINDER_TYPE_WEAK_HANDLE = B_PACK_CHARS('w', 'h', '*', B_TYPE_LARGE),
+ BINDER_TYPE_FD = B_PACK_CHARS('f', 'd', '*', B_TYPE_LARGE),
+};
+
+enum {
+ FLAT_BINDER_FLAG_PRIORITY_MASK = 0xff,
+ FLAT_BINDER_FLAG_ACCEPTS_FDS = 0x100,
+};
+
+struct flat_binder_object {
+
+ unsigned long type;
+ unsigned long flags;
+
+ union {
+ void *binder;
+ signed long handle;
+ };
+
+ void *cookie;
+};
+
+struct binder_write_read {
+ signed long write_size;
+ signed long write_consumed;
+ unsigned long write_buffer;
+ signed long read_size;
+ signed long read_consumed;
+ unsigned long read_buffer;
+};
+
+struct binder_version {
+
+ signed long protocol_version;
+};
+
+#define BINDER_CURRENT_PROTOCOL_VERSION 7
+
+#define BINDER_WRITE_READ _IOWR('b', 1, struct binder_write_read)
+#define BINDER_SET_IDLE_TIMEOUT _IOW('b', 3, int64_t)
+#define BINDER_SET_MAX_THREADS _IOW('b', 5, size_t)
+#define BINDER_SET_IDLE_PRIORITY _IOW('b', 6, int)
+#define BINDER_SET_CONTEXT_MGR _IOW('b', 7, int)
+#define BINDER_THREAD_EXIT _IOW('b', 8, int)
+#define BINDER_VERSION _IOWR('b', 9, struct binder_version)
+
+enum transaction_flags {
+ TF_ONE_WAY = 0x01,
+ TF_ROOT_OBJECT = 0x04,
+ TF_STATUS_CODE = 0x08,
+ TF_ACCEPT_FDS = 0x10,
+};
+
+struct binder_transaction_data {
+
+ union {
+ size_t handle;
+ void *ptr;
+ } target;
+ void *cookie;
+ unsigned int code;
+
+ unsigned int flags;
+ pid_t sender_pid;
+ uid_t sender_euid;
+ size_t data_size;
+ size_t offsets_size;
+
+ union {
+ struct {
+
+ const void *buffer;
+
+ const void *offsets;
+ } ptr;
+ uint8_t buf[8];
+ } data;
+};
+
+struct binder_ptr_cookie {
+ void *ptr;
+ void *cookie;
+};
+
+struct binder_pri_desc {
+ int priority;
+ int desc;
+};
+
+struct binder_pri_ptr_cookie {
+ int priority;
+ void *ptr;
+ void *cookie;
+};
+
+enum BinderDriverReturnProtocol {
+ BR_ERROR = _IOR_BAD('r', 0, int),
+
+ BR_OK = _IO('r', 1),
+
+ BR_TRANSACTION = _IOR_BAD('r', 2, struct binder_transaction_data),
+ BR_REPLY = _IOR_BAD('r', 3, struct binder_transaction_data),
+
+ BR_ACQUIRE_RESULT = _IOR_BAD('r', 4, int),
+
+ BR_DEAD_REPLY = _IO('r', 5),
+
+ BR_TRANSACTION_COMPLETE = _IO('r', 6),
+
+ BR_INCREFS = _IOR_BAD('r', 7, struct binder_ptr_cookie),
+ BR_ACQUIRE = _IOR_BAD('r', 8, struct binder_ptr_cookie),
+ BR_RELEASE = _IOR_BAD('r', 9, struct binder_ptr_cookie),
+ BR_DECREFS = _IOR_BAD('r', 10, struct binder_ptr_cookie),
+
+ BR_ATTEMPT_ACQUIRE = _IOR_BAD('r', 11, struct binder_pri_ptr_cookie),
+
+ BR_NOOP = _IO('r', 12),
+
+ BR_SPAWN_LOOPER = _IO('r', 13),
+
+ BR_FINISHED = _IO('r', 14),
+
+ BR_DEAD_BINDER = _IOR_BAD('r', 15, void *),
+
+ BR_CLEAR_DEATH_NOTIFICATION_DONE = _IOR_BAD('r', 16, void *),
+
+ BR_FAILED_REPLY = _IO('r', 17),
+
+};
+
+enum BinderDriverCommandProtocol {
+ BC_TRANSACTION = _IOW_BAD('c', 0, struct binder_transaction_data),
+ BC_REPLY = _IOW_BAD('c', 1, struct binder_transaction_data),
+
+ BC_ACQUIRE_RESULT = _IOW_BAD('c', 2, int),
+
+ BC_FREE_BUFFER = _IOW_BAD('c', 3, int),
+
+ BC_INCREFS = _IOW_BAD('c', 4, int),
+ BC_ACQUIRE = _IOW_BAD('c', 5, int),
+ BC_RELEASE = _IOW_BAD('c', 6, int),
+ BC_DECREFS = _IOW_BAD('c', 7, int),
+
+ BC_INCREFS_DONE = _IOW_BAD('c', 8, struct binder_ptr_cookie),
+ BC_ACQUIRE_DONE = _IOW_BAD('c', 9, struct binder_ptr_cookie),
+
+ BC_ATTEMPT_ACQUIRE = _IOW_BAD('c', 10, struct binder_pri_desc),
+
+ BC_REGISTER_LOOPER = _IO('c', 11),
+
+ BC_ENTER_LOOPER = _IO('c', 12),
+ BC_EXIT_LOOPER = _IO('c', 13),
+
+ BC_REQUEST_DEATH_NOTIFICATION = _IOW_BAD('c', 14, struct binder_ptr_cookie),
+
+ BC_CLEAR_DEATH_NOTIFICATION = _IOW_BAD('c', 15, struct binder_ptr_cookie),
+
+ BC_DEAD_BINDER_DONE = _IOW_BAD('c', 16, void *),
+
+};
+
+#endif
+
diff --git a/ndk/platforms/android-3/include/linux/binfmts.h b/ndk/platforms/android-3/include/linux/binfmts.h
new file mode 100644
index 0000000..3335985
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/binfmts.h
@@ -0,0 +1,23 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_BINFMTS_H
+#define _LINUX_BINFMTS_H
+
+#include <linux/capability.h>
+
+struct pt_regs;
+
+#define MAX_ARG_PAGES 32
+
+#define BINPRM_BUF_SIZE 128
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/bio.h b/ndk/platforms/android-3/include/linux/bio.h
new file mode 100644
index 0000000..4e91314
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/bio.h
@@ -0,0 +1,171 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __LINUX_BIO_H
+#define __LINUX_BIO_H
+
+#include <linux/highmem.h>
+#include <linux/mempool.h>
+#include <linux/ioprio.h>
+
+#include <asm/io.h>
+
+#if defined(BIO_VMERGE_MAX_SIZE) && defined(BIO_VMERGE_BOUNDARY)
+#define BIOVEC_VIRT_START_SIZE(x) (bvec_to_phys(x) & (BIO_VMERGE_BOUNDARY - 1))
+#define BIOVEC_VIRT_OVERSIZE(x) ((x) > BIO_VMERGE_MAX_SIZE)
+#else
+#define BIOVEC_VIRT_START_SIZE(x) 0
+#define BIOVEC_VIRT_OVERSIZE(x) 0
+#endif
+
+#ifndef BIO_VMERGE_BOUNDARY
+#define BIO_VMERGE_BOUNDARY 0
+#endif
+
+#define BIO_DEBUG
+
+#ifdef BIO_DEBUG
+#define BIO_BUG_ON BUG_ON
+#else
+#define BIO_BUG_ON
+#endif
+
+#define BIO_MAX_PAGES 256
+#define BIO_MAX_SIZE (BIO_MAX_PAGES << PAGE_CACHE_SHIFT)
+#define BIO_MAX_SECTORS (BIO_MAX_SIZE >> 9)
+
+struct bio_vec {
+ struct page *bv_page;
+ unsigned int bv_len;
+ unsigned int bv_offset;
+};
+
+struct bio_set;
+struct bio;
+typedef int (bio_end_io_t) (struct bio *, unsigned int, int);
+typedef void (bio_destructor_t) (struct bio *);
+
+struct bio {
+ sector_t bi_sector;
+ struct bio *bi_next;
+ struct block_device *bi_bdev;
+ unsigned long bi_flags;
+ unsigned long bi_rw;
+
+ unsigned short bi_vcnt;
+ unsigned short bi_idx;
+
+ unsigned short bi_phys_segments;
+
+ unsigned short bi_hw_segments;
+
+ unsigned int bi_size;
+
+ unsigned int bi_hw_front_size;
+ unsigned int bi_hw_back_size;
+
+ unsigned int bi_max_vecs;
+
+ struct bio_vec *bi_io_vec;
+
+ bio_end_io_t *bi_end_io;
+ atomic_t bi_cnt;
+
+ void *bi_private;
+
+ bio_destructor_t *bi_destructor;
+};
+
+#define BIO_UPTODATE 0  
+#define BIO_RW_BLOCK 1  
+#define BIO_EOF 2  
+#define BIO_SEG_VALID 3  
+#define BIO_CLONED 4  
+#define BIO_BOUNCED 5  
+#define BIO_USER_MAPPED 6  
+#define BIO_EOPNOTSUPP 7  
+#define bio_flagged(bio, flag) ((bio)->bi_flags & (1 << (flag)))
+
+#define BIO_POOL_BITS (4)
+#define BIO_POOL_OFFSET (BITS_PER_LONG - BIO_POOL_BITS)
+#define BIO_POOL_MASK (1UL << BIO_POOL_OFFSET)
+#define BIO_POOL_IDX(bio) ((bio)->bi_flags >> BIO_POOL_OFFSET) 
+
+#define BIO_RW 0
+#define BIO_RW_AHEAD 1
+#define BIO_RW_BARRIER 2
+#define BIO_RW_FAILFAST 3
+#define BIO_RW_SYNC 4
+
+#define BIO_PRIO_SHIFT (8 * sizeof(unsigned long) - IOPRIO_BITS)
+#define bio_prio(bio) ((bio)->bi_rw >> BIO_PRIO_SHIFT)
+#define bio_prio_valid(bio) ioprio_valid(bio_prio(bio))
+
+#define bio_set_prio(bio, prio) do {   WARN_ON(prio >= (1 << IOPRIO_BITS));   (bio)->bi_rw &= ((1UL << BIO_PRIO_SHIFT) - 1);   (bio)->bi_rw |= ((unsigned long) (prio) << BIO_PRIO_SHIFT);  } while (0)
+
+#define bio_iovec_idx(bio, idx) (&((bio)->bi_io_vec[(idx)]))
+#define bio_iovec(bio) bio_iovec_idx((bio), (bio)->bi_idx)
+#define bio_page(bio) bio_iovec((bio))->bv_page
+#define bio_offset(bio) bio_iovec((bio))->bv_offset
+#define bio_segments(bio) ((bio)->bi_vcnt - (bio)->bi_idx)
+#define bio_sectors(bio) ((bio)->bi_size >> 9)
+#define bio_cur_sectors(bio) (bio_iovec(bio)->bv_len >> 9)
+#define bio_data(bio) (page_address(bio_page((bio))) + bio_offset((bio)))
+#define bio_barrier(bio) ((bio)->bi_rw & (1 << BIO_RW_BARRIER))
+#define bio_sync(bio) ((bio)->bi_rw & (1 << BIO_RW_SYNC))
+#define bio_failfast(bio) ((bio)->bi_rw & (1 << BIO_RW_FAILFAST))
+#define bio_rw_ahead(bio) ((bio)->bi_rw & (1 << BIO_RW_AHEAD))
+
+#define bio_to_phys(bio) (page_to_phys(bio_page((bio))) + (unsigned long) bio_offset((bio)))
+#define bvec_to_phys(bv) (page_to_phys((bv)->bv_page) + (unsigned long) (bv)->bv_offset)
+
+#define __bio_kmap_atomic(bio, idx, kmtype)   (kmap_atomic(bio_iovec_idx((bio), (idx))->bv_page, kmtype) +   bio_iovec_idx((bio), (idx))->bv_offset)
+
+#define __bio_kunmap_atomic(addr, kmtype) kunmap_atomic(addr, kmtype)
+
+#define __BVEC_END(bio) bio_iovec_idx((bio), (bio)->bi_vcnt - 1)
+#define __BVEC_START(bio) bio_iovec_idx((bio), (bio)->bi_idx)
+
+#ifndef BIOVEC_PHYS_MERGEABLE
+#define BIOVEC_PHYS_MERGEABLE(vec1, vec2)   ((bvec_to_phys((vec1)) + (vec1)->bv_len) == bvec_to_phys((vec2)))
+#endif
+
+#define BIOVEC_VIRT_MERGEABLE(vec1, vec2)   ((((bvec_to_phys((vec1)) + (vec1)->bv_len) | bvec_to_phys((vec2))) & (BIO_VMERGE_BOUNDARY - 1)) == 0)
+#define __BIO_SEG_BOUNDARY(addr1, addr2, mask)   (((addr1) | (mask)) == (((addr2) - 1) | (mask)))
+#define BIOVEC_SEG_BOUNDARY(q, b1, b2)   __BIO_SEG_BOUNDARY(bvec_to_phys((b1)), bvec_to_phys((b2)) + (b2)->bv_len, (q)->seg_boundary_mask)
+#define BIO_SEG_BOUNDARY(q, b1, b2)   BIOVEC_SEG_BOUNDARY((q), __BVEC_END((b1)), __BVEC_START((b2)))
+
+#define bio_io_error(bio, bytes) bio_endio((bio), (bytes), -EIO)
+
+#define __bio_for_each_segment(bvl, bio, i, start_idx)   for (bvl = bio_iovec_idx((bio), (start_idx)), i = (start_idx);   i < (bio)->bi_vcnt;   bvl++, i++)
+
+#define bio_for_each_segment(bvl, bio, i)   __bio_for_each_segment(bvl, bio, i, (bio)->bi_idx)
+
+#define bio_get(bio) atomic_inc(&(bio)->bi_cnt)
+
+struct bio_pair {
+ struct bio bio1, bio2;
+ struct bio_vec bv1, bv2;
+ atomic_t cnt;
+ int error;
+};
+
+struct request_queue;
+
+struct sg_iovec;
+
+#define bvec_kmap_irq(bvec, flags) (page_address((bvec)->bv_page) + (bvec)->bv_offset)
+#define bvec_kunmap_irq(buf, flags) do { *(flags) = 0; } while (0)
+
+#define __bio_kunmap_irq(buf, flags) bvec_kunmap_irq(buf, flags)
+#define bio_kmap_irq(bio, flags)   __bio_kmap_irq((bio), (bio)->bi_idx, (flags))
+#define bio_kunmap_irq(buf,flags) __bio_kunmap_irq(buf, flags)
+#endif
diff --git a/ndk/platforms/android-3/include/linux/bitmap.h b/ndk/platforms/android-3/include/linux/bitmap.h
new file mode 100644
index 0000000..246d158
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/bitmap.h
@@ -0,0 +1,24 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __LINUX_BITMAP_H
+#define __LINUX_BITMAP_H
+
+#ifndef __ASSEMBLY__
+
+#include <linux/types.h>
+#include <linux/bitops.h>
+#include <linux/string.h>
+
+#define BITMAP_LAST_WORD_MASK(nbits)  (   ((nbits) % BITS_PER_LONG) ?   (1UL<<((nbits) % BITS_PER_LONG))-1 : ~0UL  )
+
+#endif
+#endif
diff --git a/ndk/platforms/android-3/include/linux/bitops.h b/ndk/platforms/android-3/include/linux/bitops.h
new file mode 100644
index 0000000..f8df614
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/bitops.h
@@ -0,0 +1,18 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_BITOPS_H
+#define _LINUX_BITOPS_H
+#include <asm/types.h>
+
+#include <asm/bitops.h>
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/blkdev.h b/ndk/platforms/android-3/include/linux/blkdev.h
new file mode 100644
index 0000000..3004524
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/blkdev.h
@@ -0,0 +1,461 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_BLKDEV_H
+#define _LINUX_BLKDEV_H
+
+#include <linux/major.h>
+#include <linux/genhd.h>
+#include <linux/list.h>
+#include <linux/timer.h>
+#include <linux/workqueue.h>
+#include <linux/pagemap.h>
+#include <linux/backing-dev.h>
+#include <linux/wait.h>
+#include <linux/mempool.h>
+#include <linux/bio.h>
+#include <linux/module.h>
+#include <linux/stringify.h>
+
+#include <asm/scatterlist.h>
+
+struct scsi_ioctl_command;
+
+struct request_queue;
+typedef struct request_queue request_queue_t;
+struct elevator_queue;
+typedef struct elevator_queue elevator_t;
+struct request_pm_state;
+struct blk_trace;
+
+#define BLKDEV_MIN_RQ 4
+#define BLKDEV_MAX_RQ 128  
+
+struct as_io_context {
+ spinlock_t lock;
+
+ void (*dtor)(struct as_io_context *aic);
+ void (*exit)(struct as_io_context *aic);
+
+ unsigned long state;
+ atomic_t nr_queued;
+ atomic_t nr_dispatched;
+
+ unsigned long last_end_request;
+ unsigned long ttime_total;
+ unsigned long ttime_samples;
+ unsigned long ttime_mean;
+
+ unsigned int seek_samples;
+ sector_t last_request_pos;
+ u64 seek_total;
+ sector_t seek_mean;
+};
+
+struct cfq_queue;
+struct cfq_io_context {
+ struct rb_node rb_node;
+ void *key;
+
+ struct cfq_queue *cfqq[2];
+
+ struct io_context *ioc;
+
+ unsigned long last_end_request;
+ sector_t last_request_pos;
+ unsigned long last_queue;
+
+ unsigned long ttime_total;
+ unsigned long ttime_samples;
+ unsigned long ttime_mean;
+
+ unsigned int seek_samples;
+ u64 seek_total;
+ sector_t seek_mean;
+
+ struct list_head queue_list;
+
+ void (*dtor)(struct io_context *);
+ void (*exit)(struct io_context *);
+};
+
+struct io_context {
+ atomic_t refcount;
+ struct task_struct *task;
+
+ int (*set_ioprio)(struct io_context *, unsigned int);
+
+ unsigned long last_waited;
+ int nr_batch_requests;
+
+ struct as_io_context *aic;
+ struct rb_root cic_root;
+};
+
+struct io_context *current_io_context(gfp_t gfp_flags);
+struct io_context *get_io_context(gfp_t gfp_flags);
+
+struct request;
+typedef void (rq_end_io_fn)(struct request *, int);
+
+struct request_list {
+ int count[2];
+ int starved[2];
+ int elvpriv;
+ mempool_t *rq_pool;
+ wait_queue_head_t wait[2];
+};
+
+#define BLK_MAX_CDB 16
+
+struct request {
+ struct list_head queuelist;
+ struct list_head donelist;
+
+ unsigned long flags;
+
+ sector_t sector;
+ unsigned long nr_sectors;
+
+ unsigned int current_nr_sectors;
+
+ sector_t hard_sector;
+ unsigned long hard_nr_sectors;
+
+ unsigned int hard_cur_sectors;
+
+ struct bio *bio;
+ struct bio *biotail;
+
+ void *elevator_private;
+ void *completion_data;
+
+ int rq_status;
+ int errors;
+ struct gendisk *rq_disk;
+ unsigned long start_time;
+
+ unsigned short nr_phys_segments;
+
+ unsigned short nr_hw_segments;
+
+ unsigned short ioprio;
+
+ int tag;
+
+ int ref_count;
+ request_queue_t *q;
+ struct request_list *rl;
+
+ struct completion *waiting;
+ void *special;
+ char *buffer;
+
+ unsigned int cmd_len;
+ unsigned char cmd[BLK_MAX_CDB];
+
+ unsigned int data_len;
+ unsigned int sense_len;
+ void *data;
+ void *sense;
+
+ unsigned int timeout;
+ int retries;
+
+ rq_end_io_fn *end_io;
+ void *end_io_data;
+};
+
+enum rq_flag_bits {
+ __REQ_RW,
+ __REQ_FAILFAST,
+ __REQ_SORTED,
+ __REQ_SOFTBARRIER,
+ __REQ_HARDBARRIER,
+ __REQ_FUA,
+ __REQ_CMD,
+ __REQ_NOMERGE,
+ __REQ_STARTED,
+ __REQ_DONTPREP,
+ __REQ_QUEUED,
+ __REQ_ELVPRIV,
+
+ __REQ_PC,
+ __REQ_BLOCK_PC,
+ __REQ_SENSE,
+
+ __REQ_FAILED,
+ __REQ_QUIET,
+ __REQ_SPECIAL,
+ __REQ_DRIVE_CMD,
+ __REQ_DRIVE_TASK,
+ __REQ_DRIVE_TASKFILE,
+ __REQ_PREEMPT,
+ __REQ_PM_SUSPEND,
+ __REQ_PM_RESUME,
+ __REQ_PM_SHUTDOWN,
+ __REQ_ORDERED_COLOR,
+ __REQ_RW_SYNC,
+ __REQ_NR_BITS,
+};
+
+#define REQ_RW (1 << __REQ_RW)
+#define REQ_FAILFAST (1 << __REQ_FAILFAST)
+#define REQ_SORTED (1 << __REQ_SORTED)
+#define REQ_SOFTBARRIER (1 << __REQ_SOFTBARRIER)
+#define REQ_HARDBARRIER (1 << __REQ_HARDBARRIER)
+#define REQ_FUA (1 << __REQ_FUA)
+#define REQ_CMD (1 << __REQ_CMD)
+#define REQ_NOMERGE (1 << __REQ_NOMERGE)
+#define REQ_STARTED (1 << __REQ_STARTED)
+#define REQ_DONTPREP (1 << __REQ_DONTPREP)
+#define REQ_QUEUED (1 << __REQ_QUEUED)
+#define REQ_ELVPRIV (1 << __REQ_ELVPRIV)
+#define REQ_PC (1 << __REQ_PC)
+#define REQ_BLOCK_PC (1 << __REQ_BLOCK_PC)
+#define REQ_SENSE (1 << __REQ_SENSE)
+#define REQ_FAILED (1 << __REQ_FAILED)
+#define REQ_QUIET (1 << __REQ_QUIET)
+#define REQ_SPECIAL (1 << __REQ_SPECIAL)
+#define REQ_DRIVE_CMD (1 << __REQ_DRIVE_CMD)
+#define REQ_DRIVE_TASK (1 << __REQ_DRIVE_TASK)
+#define REQ_DRIVE_TASKFILE (1 << __REQ_DRIVE_TASKFILE)
+#define REQ_PREEMPT (1 << __REQ_PREEMPT)
+#define REQ_PM_SUSPEND (1 << __REQ_PM_SUSPEND)
+#define REQ_PM_RESUME (1 << __REQ_PM_RESUME)
+#define REQ_PM_SHUTDOWN (1 << __REQ_PM_SHUTDOWN)
+#define REQ_ORDERED_COLOR (1 << __REQ_ORDERED_COLOR)
+#define REQ_RW_SYNC (1 << __REQ_RW_SYNC)
+
+struct request_pm_state
+{
+
+ int pm_step;
+
+ u32 pm_state;
+ void* data;
+};
+
+#include <linux/elevator.h>
+
+typedef int (merge_request_fn) (request_queue_t *, struct request *,
+ struct bio *);
+typedef int (merge_requests_fn) (request_queue_t *, struct request *,
+ struct request *);
+typedef void (request_fn_proc) (request_queue_t *q);
+typedef int (make_request_fn) (request_queue_t *q, struct bio *bio);
+typedef int (prep_rq_fn) (request_queue_t *, struct request *);
+typedef void (unplug_fn) (request_queue_t *);
+
+struct bio_vec;
+typedef int (merge_bvec_fn) (request_queue_t *, struct bio *, struct bio_vec *);
+typedef void (activity_fn) (void *data, int rw);
+typedef int (issue_flush_fn) (request_queue_t *, struct gendisk *, sector_t *);
+typedef void (prepare_flush_fn) (request_queue_t *, struct request *);
+typedef void (softirq_done_fn)(struct request *);
+
+enum blk_queue_state {
+ Queue_down,
+ Queue_up,
+};
+
+struct blk_queue_tag {
+ struct request **tag_index;
+ unsigned long *tag_map;
+ struct list_head busy_list;
+ int busy;
+ int max_depth;
+ int real_max_depth;
+ atomic_t refcnt;
+};
+
+struct request_queue
+{
+
+ struct list_head queue_head;
+ struct request *last_merge;
+ elevator_t *elevator;
+
+ struct request_list rq;
+
+ request_fn_proc *request_fn;
+ merge_request_fn *back_merge_fn;
+ merge_request_fn *front_merge_fn;
+ merge_requests_fn *merge_requests_fn;
+ make_request_fn *make_request_fn;
+ prep_rq_fn *prep_rq_fn;
+ unplug_fn *unplug_fn;
+ merge_bvec_fn *merge_bvec_fn;
+ activity_fn *activity_fn;
+ issue_flush_fn *issue_flush_fn;
+ prepare_flush_fn *prepare_flush_fn;
+ softirq_done_fn *softirq_done_fn;
+
+ sector_t end_sector;
+ struct request *boundary_rq;
+
+ struct timer_list unplug_timer;
+ int unplug_thresh;
+ unsigned long unplug_delay;
+ struct work_struct unplug_work;
+
+ struct backing_dev_info backing_dev_info;
+
+ void *queuedata;
+
+ void *activity_data;
+
+ unsigned long bounce_pfn;
+ gfp_t bounce_gfp;
+
+ unsigned long queue_flags;
+
+ spinlock_t __queue_lock;
+ spinlock_t *queue_lock;
+
+ struct kobject kobj;
+
+ unsigned long nr_requests;
+ unsigned int nr_congestion_on;
+ unsigned int nr_congestion_off;
+ unsigned int nr_batching;
+
+ unsigned int max_sectors;
+ unsigned int max_hw_sectors;
+ unsigned short max_phys_segments;
+ unsigned short max_hw_segments;
+ unsigned short hardsect_size;
+ unsigned int max_segment_size;
+
+ unsigned long seg_boundary_mask;
+ unsigned int dma_alignment;
+
+ struct blk_queue_tag *queue_tags;
+
+ unsigned int nr_sorted;
+ unsigned int in_flight;
+
+ unsigned int sg_timeout;
+ unsigned int sg_reserved_size;
+ int node;
+
+ struct blk_trace *blk_trace;
+
+ unsigned int ordered, next_ordered, ordseq;
+ int orderr, ordcolor;
+ struct request pre_flush_rq, bar_rq, post_flush_rq;
+ struct request *orig_bar_rq;
+ unsigned int bi_size;
+
+ struct mutex sysfs_lock;
+};
+
+#define RQ_INACTIVE (-1)
+#define RQ_ACTIVE 1
+
+#define QUEUE_FLAG_CLUSTER 0  
+#define QUEUE_FLAG_QUEUED 1  
+#define QUEUE_FLAG_STOPPED 2  
+#define QUEUE_FLAG_READFULL 3  
+#define QUEUE_FLAG_WRITEFULL 4  
+#define QUEUE_FLAG_DEAD 5  
+#define QUEUE_FLAG_REENTER 6  
+#define QUEUE_FLAG_PLUGGED 7  
+#define QUEUE_FLAG_ELVSWITCH 8  
+
+enum {
+
+ QUEUE_ORDERED_NONE = 0x00,
+ QUEUE_ORDERED_DRAIN = 0x01,
+ QUEUE_ORDERED_TAG = 0x02,
+
+ QUEUE_ORDERED_PREFLUSH = 0x10,
+ QUEUE_ORDERED_POSTFLUSH = 0x20,
+ QUEUE_ORDERED_FUA = 0x40,
+
+ QUEUE_ORDERED_DRAIN_FLUSH = QUEUE_ORDERED_DRAIN |
+ QUEUE_ORDERED_PREFLUSH | QUEUE_ORDERED_POSTFLUSH,
+ QUEUE_ORDERED_DRAIN_FUA = QUEUE_ORDERED_DRAIN |
+ QUEUE_ORDERED_PREFLUSH | QUEUE_ORDERED_FUA,
+ QUEUE_ORDERED_TAG_FLUSH = QUEUE_ORDERED_TAG |
+ QUEUE_ORDERED_PREFLUSH | QUEUE_ORDERED_POSTFLUSH,
+ QUEUE_ORDERED_TAG_FUA = QUEUE_ORDERED_TAG |
+ QUEUE_ORDERED_PREFLUSH | QUEUE_ORDERED_FUA,
+
+ QUEUE_ORDSEQ_STARTED = 0x01,
+ QUEUE_ORDSEQ_DRAIN = 0x02,
+ QUEUE_ORDSEQ_PREFLUSH = 0x04,
+ QUEUE_ORDSEQ_BAR = 0x08,
+ QUEUE_ORDSEQ_POSTFLUSH = 0x10,
+ QUEUE_ORDSEQ_DONE = 0x20,
+};
+
+#define blk_queue_plugged(q) test_bit(QUEUE_FLAG_PLUGGED, &(q)->queue_flags)
+#define blk_queue_tagged(q) test_bit(QUEUE_FLAG_QUEUED, &(q)->queue_flags)
+#define blk_queue_stopped(q) test_bit(QUEUE_FLAG_STOPPED, &(q)->queue_flags)
+#define blk_queue_flushing(q) ((q)->ordseq)
+
+#define blk_fs_request(rq) ((rq)->flags & REQ_CMD)
+#define blk_pc_request(rq) ((rq)->flags & REQ_BLOCK_PC)
+#define blk_noretry_request(rq) ((rq)->flags & REQ_FAILFAST)
+#define blk_rq_started(rq) ((rq)->flags & REQ_STARTED)
+
+#define blk_account_rq(rq) (blk_rq_started(rq) && blk_fs_request(rq))
+
+#define blk_pm_suspend_request(rq) ((rq)->flags & REQ_PM_SUSPEND)
+#define blk_pm_resume_request(rq) ((rq)->flags & REQ_PM_RESUME)
+#define blk_pm_request(rq)   ((rq)->flags & (REQ_PM_SUSPEND | REQ_PM_RESUME))
+
+#define blk_sorted_rq(rq) ((rq)->flags & REQ_SORTED)
+#define blk_barrier_rq(rq) ((rq)->flags & REQ_HARDBARRIER)
+#define blk_fua_rq(rq) ((rq)->flags & REQ_FUA)
+
+#define list_entry_rq(ptr) list_entry((ptr), struct request, queuelist)
+
+#define rq_data_dir(rq) ((rq)->flags & 1)
+
+#define RQ_NOMERGE_FLAGS   (REQ_NOMERGE | REQ_STARTED | REQ_HARDBARRIER | REQ_SOFTBARRIER)
+#define rq_mergeable(rq)   (!((rq)->flags & RQ_NOMERGE_FLAGS) && blk_fs_request((rq)))
+#define blk_queue_headactive(q, head_active)
+#define BLKPREP_OK 0  
+#define BLKPREP_KILL 1  
+#define BLKPREP_DEFER 2  
+
+#define BLK_BOUNCE_HIGH ((u64)blk_max_low_pfn << PAGE_SHIFT)
+#define BLK_BOUNCE_ANY ((u64)blk_max_pfn << PAGE_SHIFT)
+#define BLK_BOUNCE_ISA (ISA_DMA_THRESHOLD)
+
+#define rq_for_each_bio(_bio, rq)   if ((rq->bio))   for (_bio = (rq)->bio; _bio; _bio = _bio->bi_next)
+
+#define end_io_error(uptodate) (unlikely((uptodate) <= 0))
+
+#define blk_queue_tag_depth(q) ((q)->queue_tags->busy)
+#define blk_queue_tag_queue(q) ((q)->queue_tags->busy < (q)->queue_tags->max_depth)
+#define blk_rq_tagged(rq) ((rq)->flags & REQ_QUEUED)
+
+#define MAX_PHYS_SEGMENTS 128
+#define MAX_HW_SEGMENTS 128
+#define SAFE_MAX_SECTORS 255
+#define BLK_DEF_MAX_SECTORS 1024
+
+#define MAX_SEGMENT_SIZE 65536
+
+#define blkdev_entry_to_request(entry) list_entry((entry), struct request, queuelist)
+
+#define blk_finished_io(nsects) do { } while (0)
+#define blk_started_io(nsects) do { } while (0)
+
+#define sector_div(n, b)(  {   int _res;   _res = (n) % (b);   (n) /= (b);   _res;  }  )
+
+#define MODULE_ALIAS_BLOCKDEV(major,minor)   MODULE_ALIAS("block-major-" __stringify(major) "-" __stringify(minor))
+#define MODULE_ALIAS_BLOCKDEV_MAJOR(major)   MODULE_ALIAS("block-major-" __stringify(major) "-*")
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/blkpg.h b/ndk/platforms/android-3/include/linux/blkpg.h
new file mode 100644
index 0000000..45a4a47
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/blkpg.h
@@ -0,0 +1,41 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_BLKPG_H
+#define _LINUX_BLKPG_H
+
+#include <linux/compiler.h>
+#include <linux/ioctl.h>
+
+#define BLKPG _IO(0x12,105)
+
+struct blkpg_ioctl_arg {
+ int op;
+ int flags;
+ int datalen;
+ void __user *data;
+};
+
+#define BLKPG_ADD_PARTITION 1
+#define BLKPG_DEL_PARTITION 2
+
+#define BLKPG_DEVNAMELTH 64
+#define BLKPG_VOLNAMELTH 64
+
+struct blkpg_partition {
+ long long start;
+ long long length;
+ int pno;
+ char devname[BLKPG_DEVNAMELTH];
+ char volname[BLKPG_VOLNAMELTH];
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/blockgroup_lock.h b/ndk/platforms/android-3/include/linux/blockgroup_lock.h
new file mode 100644
index 0000000..c814020
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/blockgroup_lock.h
@@ -0,0 +1,29 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_BLOCKGROUP_LOCK_H
+#define _LINUX_BLOCKGROUP_LOCK_H
+
+#include <linux/spinlock.h>
+#include <linux/cache.h>
+
+#define NR_BG_LOCKS 1
+
+struct bgl_lock {
+ spinlock_t lock;
+} ____cacheline_aligned_in_smp;
+
+struct blockgroup_lock {
+ struct bgl_lock locks[NR_BG_LOCKS];
+};
+
+#define sb_bgl_lock(sb, block_group)   (&(sb)->s_blockgroup_lock.locks[(block_group) & (NR_BG_LOCKS-1)].lock)
+#endif
diff --git a/ndk/platforms/android-3/include/linux/byteorder/big_endian.h b/ndk/platforms/android-3/include/linux/byteorder/big_endian.h
new file mode 100644
index 0000000..ee0d880
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/byteorder/big_endian.h
@@ -0,0 +1,67 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_BYTEORDER_BIG_ENDIAN_H
+#define _LINUX_BYTEORDER_BIG_ENDIAN_H
+
+#ifndef __BIG_ENDIAN
+#define __BIG_ENDIAN 4321
+#endif
+#ifndef __BIG_ENDIAN_BITFIELD
+#define __BIG_ENDIAN_BITFIELD
+#endif
+
+#include <linux/types.h>
+#include <linux/byteorder/swab.h>
+
+#define __constant_htonl(x) ((__force __be32)(__u32)(x))
+#define __constant_ntohl(x) ((__force __u32)(__be32)(x))
+#define __constant_htons(x) ((__force __be16)(__u16)(x))
+#define __constant_ntohs(x) ((__force __u16)(__be16)(x))
+#define __constant_cpu_to_le64(x) ((__force __le64)___constant_swab64((x)))
+#define __constant_le64_to_cpu(x) ___constant_swab64((__force __u64)(__le64)(x))
+#define __constant_cpu_to_le32(x) ((__force __le32)___constant_swab32((x)))
+#define __constant_le32_to_cpu(x) ___constant_swab32((__force __u32)(__le32)(x))
+#define __constant_cpu_to_le16(x) ((__force __le16)___constant_swab16((x)))
+#define __constant_le16_to_cpu(x) ___constant_swab16((__force __u16)(__le16)(x))
+#define __constant_cpu_to_be64(x) ((__force __be64)(__u64)(x))
+#define __constant_be64_to_cpu(x) ((__force __u64)(__be64)(x))
+#define __constant_cpu_to_be32(x) ((__force __be32)(__u32)(x))
+#define __constant_be32_to_cpu(x) ((__force __u32)(__be32)(x))
+#define __constant_cpu_to_be16(x) ((__force __be16)(__u16)(x))
+#define __constant_be16_to_cpu(x) ((__force __u16)(__be16)(x))
+#define __cpu_to_le64(x) ((__force __le64)__swab64((x)))
+#define __le64_to_cpu(x) __swab64((__force __u64)(__le64)(x))
+#define __cpu_to_le32(x) ((__force __le32)__swab32((x)))
+#define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
+#define __cpu_to_le16(x) ((__force __le16)__swab16((x)))
+#define __le16_to_cpu(x) __swab16((__force __u16)(__le16)(x))
+#define __cpu_to_be64(x) ((__force __be64)(__u64)(x))
+#define __be64_to_cpu(x) ((__force __u64)(__be64)(x))
+#define __cpu_to_be32(x) ((__force __be32)(__u32)(x))
+#define __be32_to_cpu(x) ((__force __u32)(__be32)(x))
+#define __cpu_to_be16(x) ((__force __be16)(__u16)(x))
+#define __be16_to_cpu(x) ((__force __u16)(__be16)(x))
+
+#define __cpu_to_le64s(x) __swab64s((x))
+#define __le64_to_cpus(x) __swab64s((x))
+#define __cpu_to_le32s(x) __swab32s((x))
+#define __le32_to_cpus(x) __swab32s((x))
+#define __cpu_to_le16s(x) __swab16s((x))
+#define __le16_to_cpus(x) __swab16s((x))
+#define __cpu_to_be64s(x) do {} while (0)
+#define __be64_to_cpus(x) do {} while (0)
+#define __cpu_to_be32s(x) do {} while (0)
+#define __be32_to_cpus(x) do {} while (0)
+#define __cpu_to_be16s(x) do {} while (0)
+#define __be16_to_cpus(x) do {} while (0)
+#include <linux/byteorder/generic.h>
+#endif
diff --git a/ndk/platforms/android-3/include/linux/byteorder/generic.h b/ndk/platforms/android-3/include/linux/byteorder/generic.h
new file mode 100644
index 0000000..ac469ff
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/byteorder/generic.h
@@ -0,0 +1,15 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_BYTEORDER_GENERIC_H
+#define _LINUX_BYTEORDER_GENERIC_H
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/byteorder/little_endian.h b/ndk/platforms/android-3/include/linux/byteorder/little_endian.h
new file mode 100644
index 0000000..2c26e9c
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/byteorder/little_endian.h
@@ -0,0 +1,67 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_BYTEORDER_LITTLE_ENDIAN_H
+#define _LINUX_BYTEORDER_LITTLE_ENDIAN_H
+
+#ifndef __LITTLE_ENDIAN
+#define __LITTLE_ENDIAN 1234
+#endif
+#ifndef __LITTLE_ENDIAN_BITFIELD
+#define __LITTLE_ENDIAN_BITFIELD
+#endif
+
+#include <linux/types.h>
+#include <linux/byteorder/swab.h>
+
+#define __constant_htonl(x) ((__force __be32)___constant_swab32((x)))
+#define __constant_ntohl(x) ___constant_swab32((__force __be32)(x))
+#define __constant_htons(x) ((__force __be16)___constant_swab16((x)))
+#define __constant_ntohs(x) ___constant_swab16((__force __be16)(x))
+#define __constant_cpu_to_le64(x) ((__force __le64)(__u64)(x))
+#define __constant_le64_to_cpu(x) ((__force __u64)(__le64)(x))
+#define __constant_cpu_to_le32(x) ((__force __le32)(__u32)(x))
+#define __constant_le32_to_cpu(x) ((__force __u32)(__le32)(x))
+#define __constant_cpu_to_le16(x) ((__force __le16)(__u16)(x))
+#define __constant_le16_to_cpu(x) ((__force __u16)(__le16)(x))
+#define __constant_cpu_to_be64(x) ((__force __be64)___constant_swab64((x)))
+#define __constant_be64_to_cpu(x) ___constant_swab64((__force __u64)(__be64)(x))
+#define __constant_cpu_to_be32(x) ((__force __be32)___constant_swab32((x)))
+#define __constant_be32_to_cpu(x) ___constant_swab32((__force __u32)(__be32)(x))
+#define __constant_cpu_to_be16(x) ((__force __be16)___constant_swab16((x)))
+#define __constant_be16_to_cpu(x) ___constant_swab16((__force __u16)(__be16)(x))
+#define __cpu_to_le64(x) ((__force __le64)(__u64)(x))
+#define __le64_to_cpu(x) ((__force __u64)(__le64)(x))
+#define __cpu_to_le32(x) ((__force __le32)(__u32)(x))
+#define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
+#define __cpu_to_le16(x) ((__force __le16)(__u16)(x))
+#define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
+#define __cpu_to_be64(x) ((__force __be64)__swab64((x)))
+#define __be64_to_cpu(x) __swab64((__force __u64)(__be64)(x))
+#define __cpu_to_be32(x) ((__force __be32)__swab32((x)))
+#define __be32_to_cpu(x) __swab32((__force __u32)(__be32)(x))
+#define __cpu_to_be16(x) ((__force __be16)__swab16((x)))
+#define __be16_to_cpu(x) __swab16((__force __u16)(__be16)(x))
+
+#define __cpu_to_le64s(x) do {} while (0)
+#define __le64_to_cpus(x) do {} while (0)
+#define __cpu_to_le32s(x) do {} while (0)
+#define __le32_to_cpus(x) do {} while (0)
+#define __cpu_to_le16s(x) do {} while (0)
+#define __le16_to_cpus(x) do {} while (0)
+#define __cpu_to_be64s(x) __swab64s((x))
+#define __be64_to_cpus(x) __swab64s((x))
+#define __cpu_to_be32s(x) __swab32s((x))
+#define __be32_to_cpus(x) __swab32s((x))
+#define __cpu_to_be16s(x) __swab16s((x))
+#define __be16_to_cpus(x) __swab16s((x))
+#include <linux/byteorder/generic.h>
+#endif
diff --git a/ndk/platforms/android-3/include/linux/byteorder/swab.h b/ndk/platforms/android-3/include/linux/byteorder/swab.h
new file mode 100644
index 0000000..37336b5
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/byteorder/swab.h
@@ -0,0 +1,72 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_BYTEORDER_SWAB_H
+#define _LINUX_BYTEORDER_SWAB_H
+
+#include <linux/compiler.h>
+
+#define ___swab16(x)  ({   __u16 __x = (x);   ((__u16)(   (((__u16)(__x) & (__u16)0x00ffU) << 8) |   (((__u16)(__x) & (__u16)0xff00U) >> 8) ));  })
+
+#define ___swab32(x)  ({   __u32 __x = (x);   ((__u32)(   (((__u32)(__x) & (__u32)0x000000ffUL) << 24) |   (((__u32)(__x) & (__u32)0x0000ff00UL) << 8) |   (((__u32)(__x) & (__u32)0x00ff0000UL) >> 8) |   (((__u32)(__x) & (__u32)0xff000000UL) >> 24) ));  })
+
+#define ___swab64(x)  ({   __u64 __x = (x);   ((__u64)(   (__u64)(((__u64)(__x) & (__u64)0x00000000000000ffULL) << 56) |   (__u64)(((__u64)(__x) & (__u64)0x000000000000ff00ULL) << 40) |   (__u64)(((__u64)(__x) & (__u64)0x0000000000ff0000ULL) << 24) |   (__u64)(((__u64)(__x) & (__u64)0x00000000ff000000ULL) << 8) |   (__u64)(((__u64)(__x) & (__u64)0x000000ff00000000ULL) >> 8) |   (__u64)(((__u64)(__x) & (__u64)0x0000ff0000000000ULL) >> 24) |   (__u64)(((__u64)(__x) & (__u64)0x00ff000000000000ULL) >> 40) |   (__u64)(((__u64)(__x) & (__u64)0xff00000000000000ULL) >> 56) ));  })
+
+#define ___constant_swab16(x)   ((__u16)(   (((__u16)(x) & (__u16)0x00ffU) << 8) |   (((__u16)(x) & (__u16)0xff00U) >> 8) ))
+#define ___constant_swab32(x)   ((__u32)(   (((__u32)(x) & (__u32)0x000000ffUL) << 24) |   (((__u32)(x) & (__u32)0x0000ff00UL) << 8) |   (((__u32)(x) & (__u32)0x00ff0000UL) >> 8) |   (((__u32)(x) & (__u32)0xff000000UL) >> 24) ))
+#define ___constant_swab64(x)   ((__u64)(   (__u64)(((__u64)(x) & (__u64)0x00000000000000ffULL) << 56) |   (__u64)(((__u64)(x) & (__u64)0x000000000000ff00ULL) << 40) |   (__u64)(((__u64)(x) & (__u64)0x0000000000ff0000ULL) << 24) |   (__u64)(((__u64)(x) & (__u64)0x00000000ff000000ULL) << 8) |   (__u64)(((__u64)(x) & (__u64)0x000000ff00000000ULL) >> 8) |   (__u64)(((__u64)(x) & (__u64)0x0000ff0000000000ULL) >> 24) |   (__u64)(((__u64)(x) & (__u64)0x00ff000000000000ULL) >> 40) |   (__u64)(((__u64)(x) & (__u64)0xff00000000000000ULL) >> 56) ))
+
+#ifndef __arch__swab16
+#define __arch__swab16(x) ({ __u16 __tmp = (x) ; ___swab16(__tmp); })
+#endif
+#ifndef __arch__swab32
+#define __arch__swab32(x) ({ __u32 __tmp = (x) ; ___swab32(__tmp); })
+#endif
+#ifndef __arch__swab64
+#define __arch__swab64(x) ({ __u64 __tmp = (x) ; ___swab64(__tmp); })
+#endif
+
+#ifndef __arch__swab16p
+#define __arch__swab16p(x) __arch__swab16(*(x))
+#endif
+#ifndef __arch__swab32p
+#define __arch__swab32p(x) __arch__swab32(*(x))
+#endif
+#ifndef __arch__swab64p
+#define __arch__swab64p(x) __arch__swab64(*(x))
+#endif
+
+#ifndef __arch__swab16s
+#define __arch__swab16s(x) do { *(x) = __arch__swab16p((x)); } while (0)
+#endif
+#ifndef __arch__swab32s
+#define __arch__swab32s(x) do { *(x) = __arch__swab32p((x)); } while (0)
+#endif
+#ifndef __arch__swab64s
+#define __arch__swab64s(x) do { *(x) = __arch__swab64p((x)); } while (0)
+#endif
+
+#if defined(__GNUC__) && defined(__OPTIMIZE__)
+#define __swab16(x)  (__builtin_constant_p((__u16)(x)) ?   ___swab16((x)) :   __fswab16((x)))
+#define __swab32(x)  (__builtin_constant_p((__u32)(x)) ?   ___swab32((x)) :   __fswab32((x)))
+#define __swab64(x)  (__builtin_constant_p((__u64)(x)) ?   ___swab64((x)) :   __fswab64((x)))
+#else
+#define __swab16(x) __fswab16(x)
+#define __swab32(x) __fswab32(x)
+#define __swab64(x) __fswab64(x)
+#endif
+
+#ifdef __BYTEORDER_HAS_U64__
+#ifdef __SWAB_64_THRU_32__
+#else
+#endif
+#endif
+#endif
diff --git a/ndk/platforms/android-3/include/linux/byteorder/swabb.h b/ndk/platforms/android-3/include/linux/byteorder/swabb.h
new file mode 100644
index 0000000..c5b6a3e
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/byteorder/swabb.h
@@ -0,0 +1,52 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_BYTEORDER_SWABB_H
+#define _LINUX_BYTEORDER_SWABB_H
+
+#define ___swahw32(x)  ({   __u32 __x = (x);   ((__u32)(   (((__u32)(__x) & (__u32)0x0000ffffUL) << 16) |   (((__u32)(__x) & (__u32)0xffff0000UL) >> 16) ));  })
+#define ___swahb32(x)  ({   __u32 __x = (x);   ((__u32)(   (((__u32)(__x) & (__u32)0x00ff00ffUL) << 8) |   (((__u32)(__x) & (__u32)0xff00ff00UL) >> 8) ));  })
+
+#define ___constant_swahw32(x)   ((__u32)(   (((__u32)(x) & (__u32)0x0000ffffUL) << 16) |   (((__u32)(x) & (__u32)0xffff0000UL) >> 16) ))
+#define ___constant_swahb32(x)   ((__u32)(   (((__u32)(x) & (__u32)0x00ff00ffUL) << 8) |   (((__u32)(x) & (__u32)0xff00ff00UL) >> 8) ))
+
+#ifndef __arch__swahw32
+#define __arch__swahw32(x) ___swahw32(x)
+#endif
+#ifndef __arch__swahb32
+#define __arch__swahb32(x) ___swahb32(x)
+#endif
+
+#ifndef __arch__swahw32p
+#define __arch__swahw32p(x) __swahw32(*(x))
+#endif
+#ifndef __arch__swahb32p
+#define __arch__swahb32p(x) __swahb32(*(x))
+#endif
+
+#ifndef __arch__swahw32s
+#define __arch__swahw32s(x) do { *(x) = __swahw32p((x)); } while (0)
+#endif
+#ifndef __arch__swahb32s
+#define __arch__swahb32s(x) do { *(x) = __swahb32p((x)); } while (0)
+#endif
+
+#if defined(__GNUC__) && defined(__OPTIMIZE__)
+#define __swahw32(x)  (__builtin_constant_p((__u32)(x)) ?   ___swahw32((x)) :   __fswahw32((x)))
+#define __swahb32(x)  (__builtin_constant_p((__u32)(x)) ?   ___swahb32((x)) :   __fswahb32((x)))
+#else
+#define __swahw32(x) __fswahw32(x)
+#define __swahb32(x) __fswahb32(x)
+#endif
+
+#ifdef __BYTEORDER_HAS_U64__
+#endif
+#endif
diff --git a/ndk/platforms/android-3/include/linux/cache.h b/ndk/platforms/android-3/include/linux/cache.h
new file mode 100644
index 0000000..d281855
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/cache.h
@@ -0,0 +1,54 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __LINUX_CACHE_H
+#define __LINUX_CACHE_H
+
+#include <linux/kernel.h>
+#include <asm/cache.h>
+
+#ifndef L1_CACHE_ALIGN
+#define L1_CACHE_ALIGN(x) ALIGN(x, L1_CACHE_BYTES)
+#endif
+
+#ifndef SMP_CACHE_BYTES
+#define SMP_CACHE_BYTES L1_CACHE_BYTES
+#endif
+
+#ifndef __read_mostly
+#define __read_mostly
+#endif
+
+#ifndef ____cacheline_aligned
+#define ____cacheline_aligned __attribute__((__aligned__(SMP_CACHE_BYTES)))
+#endif
+
+#ifndef ____cacheline_aligned_in_smp
+#define ____cacheline_aligned_in_smp
+#endif
+
+#ifndef __cacheline_aligned
+#define __cacheline_aligned   __attribute__((__aligned__(SMP_CACHE_BYTES),   __section__(".data.cacheline_aligned")))
+#endif
+
+#ifndef __cacheline_aligned_in_smp
+#define __cacheline_aligned_in_smp
+#endif
+
+#ifndef INTERNODE_CACHE_SHIFT
+#define INTERNODE_CACHE_SHIFT L1_CACHE_SHIFT
+#endif
+
+#ifndef ____cacheline_internodealigned_in_smp
+#define ____cacheline_internodealigned_in_smp
+#endif
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/calc64.h b/ndk/platforms/android-3/include/linux/calc64.h
new file mode 100644
index 0000000..9f726aa
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/calc64.h
@@ -0,0 +1,22 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_CALC64_H
+#define _LINUX_CALC64_H
+
+#include <linux/types.h>
+#include <asm/div64.h>
+
+#ifndef div_long_long_rem
+#define div_long_long_rem(dividend, divisor, remainder)   do_div_llr((dividend), divisor, remainder)
+
+#endif
+#endif
diff --git a/ndk/platforms/android-3/include/linux/capability.h b/ndk/platforms/android-3/include/linux/capability.h
new file mode 100644
index 0000000..605bc27
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/capability.h
@@ -0,0 +1,95 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_CAPABILITY_H
+#define _LINUX_CAPABILITY_H
+
+#include <linux/types.h>
+#include <linux/compiler.h>
+
+#define _LINUX_CAPABILITY_VERSION 0x19980330
+
+typedef struct __user_cap_header_struct {
+ __u32 version;
+ int pid;
+} __user *cap_user_header_t;
+
+typedef struct __user_cap_data_struct {
+ __u32 effective;
+ __u32 permitted;
+ __u32 inheritable;
+} __user *cap_user_data_t;
+
+#define CAP_CHOWN 0
+
+#define CAP_DAC_OVERRIDE 1
+
+#define CAP_DAC_READ_SEARCH 2
+
+#define CAP_FOWNER 3
+
+#define CAP_FSETID 4
+
+#define CAP_FS_MASK 0x1f
+
+#define CAP_KILL 5
+
+#define CAP_SETGID 6
+
+#define CAP_SETUID 7
+
+#define CAP_SETPCAP 8
+
+#define CAP_LINUX_IMMUTABLE 9
+
+#define CAP_NET_BIND_SERVICE 10
+
+#define CAP_NET_BROADCAST 11
+
+#define CAP_NET_ADMIN 12
+
+#define CAP_NET_RAW 13
+
+#define CAP_IPC_LOCK 14
+
+#define CAP_IPC_OWNER 15
+
+#define CAP_SYS_MODULE 16
+
+#define CAP_SYS_RAWIO 17
+
+#define CAP_SYS_CHROOT 18
+
+#define CAP_SYS_PTRACE 19
+
+#define CAP_SYS_PACCT 20
+
+#define CAP_SYS_ADMIN 21
+
+#define CAP_SYS_BOOT 22
+
+#define CAP_SYS_NICE 23
+
+#define CAP_SYS_RESOURCE 24
+
+#define CAP_SYS_TIME 25
+
+#define CAP_SYS_TTY_CONFIG 26
+
+#define CAP_MKNOD 27
+
+#define CAP_LEASE 28
+
+#define CAP_AUDIT_WRITE 29
+
+#define CAP_AUDIT_CONTROL 30
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/capi.h b/ndk/platforms/android-3/include/linux/capi.h
new file mode 100644
index 0000000..5591cf6
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/capi.h
@@ -0,0 +1,88 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __LINUX_CAPI_H__
+#define __LINUX_CAPI_H__
+
+#include <asm/types.h>
+#include <linux/ioctl.h>
+#include <linux/kernelcapi.h>
+
+typedef struct capi_register_params {
+ __u32 level3cnt;
+ __u32 datablkcnt;
+ __u32 datablklen;
+} capi_register_params;
+
+#define CAPI_REGISTER _IOW('C',0x01,struct capi_register_params)
+
+#define CAPI_MANUFACTURER_LEN 64
+
+#define CAPI_GET_MANUFACTURER _IOWR('C',0x06,int)  
+
+typedef struct capi_version {
+ __u32 majorversion;
+ __u32 minorversion;
+ __u32 majormanuversion;
+ __u32 minormanuversion;
+} capi_version;
+
+#define CAPI_GET_VERSION _IOWR('C',0x07,struct capi_version)
+
+#define CAPI_SERIAL_LEN 8
+#define CAPI_GET_SERIAL _IOWR('C',0x08,int)  
+
+typedef struct capi_profile {
+ __u16 ncontroller;
+ __u16 nbchannel;
+ __u32 goptions;
+ __u32 support1;
+ __u32 support2;
+ __u32 support3;
+ __u32 reserved[6];
+ __u32 manu[5];
+} capi_profile;
+
+#define CAPI_GET_PROFILE _IOWR('C',0x09,struct capi_profile)
+
+typedef struct capi_manufacturer_cmd {
+ unsigned long cmd;
+ void __user *data;
+} capi_manufacturer_cmd;
+
+#define CAPI_MANUFACTURER_CMD _IOWR('C',0x20, struct capi_manufacturer_cmd)
+
+#define CAPI_GET_ERRCODE _IOR('C',0x21, __u16)
+
+#define CAPI_INSTALLED _IOR('C',0x22, __u16)
+
+typedef union capi_ioctl_struct {
+ __u32 contr;
+ capi_register_params rparams;
+ __u8 manufacturer[CAPI_MANUFACTURER_LEN];
+ capi_version version;
+ __u8 serial[CAPI_SERIAL_LEN];
+ capi_profile profile;
+ capi_manufacturer_cmd cmd;
+ __u16 errcode;
+} capi_ioctl_struct;
+
+#define CAPIFLAG_HIGHJACKING 0x0001
+
+#define CAPI_GET_FLAGS _IOR('C',0x23, unsigned)
+#define CAPI_SET_FLAGS _IOR('C',0x24, unsigned)
+#define CAPI_CLR_FLAGS _IOR('C',0x25, unsigned)
+
+#define CAPI_NCCI_OPENCOUNT _IOR('C',0x26, unsigned)
+
+#define CAPI_NCCI_GETUNIT _IOR('C',0x27, unsigned)
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/cdev.h b/ndk/platforms/android-3/include/linux/cdev.h
new file mode 100644
index 0000000..7a71c7e
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/cdev.h
@@ -0,0 +1,14 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_CDEV_H
+#define _LINUX_CDEV_H
+#endif
diff --git a/ndk/platforms/android-3/include/linux/cdrom.h b/ndk/platforms/android-3/include/linux/cdrom.h
new file mode 100644
index 0000000..cc70c9f
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/cdrom.h
@@ -0,0 +1,718 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_CDROM_H
+#define _LINUX_CDROM_H
+
+#include <asm/byteorder.h>
+
+#define EDRIVE_CANT_DO_THIS EOPNOTSUPP
+
+#define CDROMPAUSE 0x5301   
+#define CDROMRESUME 0x5302  
+#define CDROMPLAYMSF 0x5303  
+#define CDROMPLAYTRKIND 0x5304  
+#define CDROMREADTOCHDR 0x5305  
+#define CDROMREADTOCENTRY 0x5306  
+#define CDROMSTOP 0x5307  
+#define CDROMSTART 0x5308  
+#define CDROMEJECT 0x5309  
+#define CDROMVOLCTRL 0x530a  
+#define CDROMSUBCHNL 0x530b  
+#define CDROMREADMODE2 0x530c  
+#define CDROMREADMODE1 0x530d  
+#define CDROMREADAUDIO 0x530e  
+#define CDROMEJECT_SW 0x530f  
+#define CDROMMULTISESSION 0x5310  
+#define CDROM_GET_MCN 0x5311  
+#define CDROM_GET_UPC CDROM_GET_MCN  
+#define CDROMRESET 0x5312  
+#define CDROMVOLREAD 0x5313  
+#define CDROMREADRAW 0x5314  
+
+#define CDROMREADCOOKED 0x5315  
+#define CDROMSEEK 0x5316  
+
+#define CDROMPLAYBLK 0x5317  
+
+#define CDROMREADALL 0x5318  
+
+#define CDROMGETSPINDOWN 0x531d
+#define CDROMSETSPINDOWN 0x531e
+
+#define CDROMCLOSETRAY 0x5319  
+#define CDROM_SET_OPTIONS 0x5320  
+#define CDROM_CLEAR_OPTIONS 0x5321  
+#define CDROM_SELECT_SPEED 0x5322  
+#define CDROM_SELECT_DISC 0x5323  
+#define CDROM_MEDIA_CHANGED 0x5325  
+#define CDROM_DRIVE_STATUS 0x5326  
+#define CDROM_DISC_STATUS 0x5327  
+#define CDROM_CHANGER_NSLOTS 0x5328  
+#define CDROM_LOCKDOOR 0x5329  
+#define CDROM_DEBUG 0x5330  
+#define CDROM_GET_CAPABILITY 0x5331  
+
+#define CDROMAUDIOBUFSIZ 0x5382  
+
+#define DVD_READ_STRUCT 0x5390  
+#define DVD_WRITE_STRUCT 0x5391  
+#define DVD_AUTH 0x5392  
+
+#define CDROM_SEND_PACKET 0x5393  
+#define CDROM_NEXT_WRITABLE 0x5394  
+#define CDROM_LAST_WRITTEN 0x5395  
+
+struct cdrom_msf0
+{
+ __u8 minute;
+ __u8 second;
+ __u8 frame;
+};
+
+union cdrom_addr
+{
+ struct cdrom_msf0 msf;
+ int lba;
+};
+
+struct cdrom_msf
+{
+ __u8 cdmsf_min0;
+ __u8 cdmsf_sec0;
+ __u8 cdmsf_frame0;
+ __u8 cdmsf_min1;
+ __u8 cdmsf_sec1;
+ __u8 cdmsf_frame1;
+};
+
+struct cdrom_ti
+{
+ __u8 cdti_trk0;
+ __u8 cdti_ind0;
+ __u8 cdti_trk1;
+ __u8 cdti_ind1;
+};
+
+struct cdrom_tochdr
+{
+ __u8 cdth_trk0;
+ __u8 cdth_trk1;
+};
+
+struct cdrom_volctrl
+{
+ __u8 channel0;
+ __u8 channel1;
+ __u8 channel2;
+ __u8 channel3;
+};
+
+struct cdrom_subchnl
+{
+ __u8 cdsc_format;
+ __u8 cdsc_audiostatus;
+ __u8 cdsc_adr: 4;
+ __u8 cdsc_ctrl: 4;
+ __u8 cdsc_trk;
+ __u8 cdsc_ind;
+ union cdrom_addr cdsc_absaddr;
+ union cdrom_addr cdsc_reladdr;
+};
+
+struct cdrom_tocentry
+{
+ __u8 cdte_track;
+ __u8 cdte_adr :4;
+ __u8 cdte_ctrl :4;
+ __u8 cdte_format;
+ union cdrom_addr cdte_addr;
+ __u8 cdte_datamode;
+};
+
+struct cdrom_read
+{
+ int cdread_lba;
+ char *cdread_bufaddr;
+ int cdread_buflen;
+};
+
+struct cdrom_read_audio
+{
+ union cdrom_addr addr;
+ __u8 addr_format;
+ int nframes;
+ __u8 __user *buf;
+};
+
+struct cdrom_multisession
+{
+ union cdrom_addr addr;
+ __u8 xa_flag;
+ __u8 addr_format;
+};
+
+struct cdrom_mcn
+{
+ __u8 medium_catalog_number[14];
+};
+
+struct cdrom_blk
+{
+ unsigned from;
+ unsigned short len;
+};
+
+#define CDROM_PACKET_SIZE 12
+
+#define CGC_DATA_UNKNOWN 0
+#define CGC_DATA_WRITE 1
+#define CGC_DATA_READ 2
+#define CGC_DATA_NONE 3
+
+struct cdrom_generic_command
+{
+ unsigned char cmd[CDROM_PACKET_SIZE];
+ unsigned char __user *buffer;
+ unsigned int buflen;
+ int stat;
+ struct request_sense __user *sense;
+ unsigned char data_direction;
+ int quiet;
+ int timeout;
+ void __user *reserved[1];
+};
+
+#define CD_MINS 74  
+#define CD_SECS 60  
+#define CD_FRAMES 75  
+#define CD_SYNC_SIZE 12  
+#define CD_MSF_OFFSET 150  
+#define CD_CHUNK_SIZE 24  
+#define CD_NUM_OF_CHUNKS 98  
+#define CD_FRAMESIZE_SUB 96  
+#define CD_HEAD_SIZE 4  
+#define CD_SUBHEAD_SIZE 8  
+#define CD_EDC_SIZE 4  
+#define CD_ZERO_SIZE 8  
+#define CD_ECC_SIZE 276  
+#define CD_FRAMESIZE 2048  
+#define CD_FRAMESIZE_RAW 2352  
+#define CD_FRAMESIZE_RAWER 2646   
+
+#define CD_FRAMESIZE_RAW1 (CD_FRAMESIZE_RAW-CD_SYNC_SIZE)  
+#define CD_FRAMESIZE_RAW0 (CD_FRAMESIZE_RAW-CD_SYNC_SIZE-CD_HEAD_SIZE)  
+
+#define CD_XA_HEAD (CD_HEAD_SIZE+CD_SUBHEAD_SIZE)  
+#define CD_XA_TAIL (CD_EDC_SIZE+CD_ECC_SIZE)  
+#define CD_XA_SYNC_HEAD (CD_SYNC_SIZE+CD_XA_HEAD)  
+
+#define CDROM_LBA 0x01  
+#define CDROM_MSF 0x02  
+
+#define CDROM_DATA_TRACK 0x04
+
+#define CDROM_LEADOUT 0xAA
+
+#define CDROM_AUDIO_INVALID 0x00  
+#define CDROM_AUDIO_PLAY 0x11  
+#define CDROM_AUDIO_PAUSED 0x12  
+#define CDROM_AUDIO_COMPLETED 0x13  
+#define CDROM_AUDIO_ERROR 0x14  
+#define CDROM_AUDIO_NO_STATUS 0x15  
+
+#define CDC_CLOSE_TRAY 0x1  
+#define CDC_OPEN_TRAY 0x2  
+#define CDC_LOCK 0x4  
+#define CDC_SELECT_SPEED 0x8  
+#define CDC_SELECT_DISC 0x10  
+#define CDC_MULTI_SESSION 0x20  
+#define CDC_MCN 0x40  
+#define CDC_MEDIA_CHANGED 0x80  
+#define CDC_PLAY_AUDIO 0x100  
+#define CDC_RESET 0x200  
+#define CDC_DRIVE_STATUS 0x800  
+#define CDC_GENERIC_PACKET 0x1000  
+#define CDC_CD_R 0x2000  
+#define CDC_CD_RW 0x4000  
+#define CDC_DVD 0x8000  
+#define CDC_DVD_R 0x10000  
+#define CDC_DVD_RAM 0x20000  
+#define CDC_MO_DRIVE 0x40000  
+#define CDC_MRW 0x80000  
+#define CDC_MRW_W 0x100000  
+#define CDC_RAM 0x200000  
+
+#define CDS_NO_INFO 0  
+#define CDS_NO_DISC 1
+#define CDS_TRAY_OPEN 2
+#define CDS_DRIVE_NOT_READY 3
+#define CDS_DISC_OK 4
+
+#define CDS_AUDIO 100
+#define CDS_DATA_1 101
+#define CDS_DATA_2 102
+#define CDS_XA_2_1 103
+#define CDS_XA_2_2 104
+#define CDS_MIXED 105
+
+#define CDO_AUTO_CLOSE 0x1  
+#define CDO_AUTO_EJECT 0x2  
+#define CDO_USE_FFLAGS 0x4  
+#define CDO_LOCK 0x8  
+#define CDO_CHECK_TYPE 0x10  
+
+#define CDSL_NONE ((int) (~0U>>1)-1)
+#define CDSL_CURRENT ((int) (~0U>>1))
+
+#define CD_PART_MAX 64
+#define CD_PART_MASK (CD_PART_MAX - 1)
+
+#define GPCMD_BLANK 0xa1
+#define GPCMD_CLOSE_TRACK 0x5b
+#define GPCMD_FLUSH_CACHE 0x35
+#define GPCMD_FORMAT_UNIT 0x04
+#define GPCMD_GET_CONFIGURATION 0x46
+#define GPCMD_GET_EVENT_STATUS_NOTIFICATION 0x4a
+#define GPCMD_GET_PERFORMANCE 0xac
+#define GPCMD_INQUIRY 0x12
+#define GPCMD_LOAD_UNLOAD 0xa6
+#define GPCMD_MECHANISM_STATUS 0xbd
+#define GPCMD_MODE_SELECT_10 0x55
+#define GPCMD_MODE_SENSE_10 0x5a
+#define GPCMD_PAUSE_RESUME 0x4b
+#define GPCMD_PLAY_AUDIO_10 0x45
+#define GPCMD_PLAY_AUDIO_MSF 0x47
+#define GPCMD_PLAY_AUDIO_TI 0x48
+#define GPCMD_PLAY_CD 0xbc
+#define GPCMD_PREVENT_ALLOW_MEDIUM_REMOVAL 0x1e
+#define GPCMD_READ_10 0x28
+#define GPCMD_READ_12 0xa8
+#define GPCMD_READ_BUFFER_CAPACITY 0x5c
+#define GPCMD_READ_CDVD_CAPACITY 0x25
+#define GPCMD_READ_CD 0xbe
+#define GPCMD_READ_CD_MSF 0xb9
+#define GPCMD_READ_DISC_INFO 0x51
+#define GPCMD_READ_DVD_STRUCTURE 0xad
+#define GPCMD_READ_FORMAT_CAPACITIES 0x23
+#define GPCMD_READ_HEADER 0x44
+#define GPCMD_READ_TRACK_RZONE_INFO 0x52
+#define GPCMD_READ_SUBCHANNEL 0x42
+#define GPCMD_READ_TOC_PMA_ATIP 0x43
+#define GPCMD_REPAIR_RZONE_TRACK 0x58
+#define GPCMD_REPORT_KEY 0xa4
+#define GPCMD_REQUEST_SENSE 0x03
+#define GPCMD_RESERVE_RZONE_TRACK 0x53
+#define GPCMD_SEND_CUE_SHEET 0x5d
+#define GPCMD_SCAN 0xba
+#define GPCMD_SEEK 0x2b
+#define GPCMD_SEND_DVD_STRUCTURE 0xbf
+#define GPCMD_SEND_EVENT 0xa2
+#define GPCMD_SEND_KEY 0xa3
+#define GPCMD_SEND_OPC 0x54
+#define GPCMD_SET_READ_AHEAD 0xa7
+#define GPCMD_SET_STREAMING 0xb6
+#define GPCMD_START_STOP_UNIT 0x1b
+#define GPCMD_STOP_PLAY_SCAN 0x4e
+#define GPCMD_TEST_UNIT_READY 0x00
+#define GPCMD_VERIFY_10 0x2f
+#define GPCMD_WRITE_10 0x2a
+#define GPCMD_WRITE_AND_VERIFY_10 0x2e
+
+#define GPCMD_SET_SPEED 0xbb
+
+#define GPCMD_PLAYAUDIO_TI 0x48
+
+#define GPCMD_GET_MEDIA_STATUS 0xda
+
+#define GPMODE_VENDOR_PAGE 0x00
+#define GPMODE_R_W_ERROR_PAGE 0x01
+#define GPMODE_WRITE_PARMS_PAGE 0x05
+#define GPMODE_WCACHING_PAGE 0x08
+#define GPMODE_AUDIO_CTL_PAGE 0x0e
+#define GPMODE_POWER_PAGE 0x1a
+#define GPMODE_FAULT_FAIL_PAGE 0x1c
+#define GPMODE_TO_PROTECT_PAGE 0x1d
+#define GPMODE_CAPABILITIES_PAGE 0x2a
+#define GPMODE_ALL_PAGES 0x3f
+
+#define GPMODE_CDROM_PAGE 0x0d
+
+#define DVD_STRUCT_PHYSICAL 0x00
+#define DVD_STRUCT_COPYRIGHT 0x01
+#define DVD_STRUCT_DISCKEY 0x02
+#define DVD_STRUCT_BCA 0x03
+#define DVD_STRUCT_MANUFACT 0x04
+
+struct dvd_layer {
+ __u8 book_version : 4;
+ __u8 book_type : 4;
+ __u8 min_rate : 4;
+ __u8 disc_size : 4;
+ __u8 layer_type : 4;
+ __u8 track_path : 1;
+ __u8 nlayers : 2;
+ __u8 track_density : 4;
+ __u8 linear_density : 4;
+ __u8 bca : 1;
+ __u32 start_sector;
+ __u32 end_sector;
+ __u32 end_sector_l0;
+};
+
+#define DVD_LAYERS 4
+
+struct dvd_physical {
+ __u8 type;
+ __u8 layer_num;
+ struct dvd_layer layer[DVD_LAYERS];
+};
+
+struct dvd_copyright {
+ __u8 type;
+
+ __u8 layer_num;
+ __u8 cpst;
+ __u8 rmi;
+};
+
+struct dvd_disckey {
+ __u8 type;
+
+ unsigned agid : 2;
+ __u8 value[2048];
+};
+
+struct dvd_bca {
+ __u8 type;
+
+ int len;
+ __u8 value[188];
+};
+
+struct dvd_manufact {
+ __u8 type;
+
+ __u8 layer_num;
+ int len;
+ __u8 value[2048];
+};
+
+typedef union {
+ __u8 type;
+
+ struct dvd_physical physical;
+ struct dvd_copyright copyright;
+ struct dvd_disckey disckey;
+ struct dvd_bca bca;
+ struct dvd_manufact manufact;
+} dvd_struct;
+
+#define DVD_LU_SEND_AGID 0
+#define DVD_HOST_SEND_CHALLENGE 1
+#define DVD_LU_SEND_KEY1 2
+#define DVD_LU_SEND_CHALLENGE 3
+#define DVD_HOST_SEND_KEY2 4
+
+#define DVD_AUTH_ESTABLISHED 5
+#define DVD_AUTH_FAILURE 6
+
+#define DVD_LU_SEND_TITLE_KEY 7
+#define DVD_LU_SEND_ASF 8
+#define DVD_INVALIDATE_AGID 9
+#define DVD_LU_SEND_RPC_STATE 10
+#define DVD_HOST_SEND_RPC_STATE 11
+
+typedef __u8 dvd_key[5];
+typedef __u8 dvd_challenge[10];
+
+struct dvd_lu_send_agid {
+ __u8 type;
+ unsigned agid : 2;
+};
+
+struct dvd_host_send_challenge {
+ __u8 type;
+ unsigned agid : 2;
+
+ dvd_challenge chal;
+};
+
+struct dvd_send_key {
+ __u8 type;
+ unsigned agid : 2;
+
+ dvd_key key;
+};
+
+struct dvd_lu_send_challenge {
+ __u8 type;
+ unsigned agid : 2;
+
+ dvd_challenge chal;
+};
+
+#define DVD_CPM_NO_COPYRIGHT 0
+#define DVD_CPM_COPYRIGHTED 1
+
+#define DVD_CP_SEC_NONE 0
+#define DVD_CP_SEC_EXIST 1
+
+#define DVD_CGMS_UNRESTRICTED 0
+#define DVD_CGMS_SINGLE 2
+#define DVD_CGMS_RESTRICTED 3
+
+struct dvd_lu_send_title_key {
+ __u8 type;
+ unsigned agid : 2;
+
+ dvd_key title_key;
+ int lba;
+ unsigned cpm : 1;
+ unsigned cp_sec : 1;
+ unsigned cgms : 2;
+};
+
+struct dvd_lu_send_asf {
+ __u8 type;
+ unsigned agid : 2;
+
+ unsigned asf : 1;
+};
+
+struct dvd_host_send_rpcstate {
+ __u8 type;
+ __u8 pdrc;
+};
+
+struct dvd_lu_send_rpcstate {
+ __u8 type : 2;
+ __u8 vra : 3;
+ __u8 ucca : 3;
+ __u8 region_mask;
+ __u8 rpc_scheme;
+};
+
+typedef union {
+ __u8 type;
+
+ struct dvd_lu_send_agid lsa;
+ struct dvd_host_send_challenge hsc;
+ struct dvd_send_key lsk;
+ struct dvd_lu_send_challenge lsc;
+ struct dvd_send_key hsk;
+ struct dvd_lu_send_title_key lstk;
+ struct dvd_lu_send_asf lsasf;
+ struct dvd_host_send_rpcstate hrpcs;
+ struct dvd_lu_send_rpcstate lrpcs;
+} dvd_authinfo;
+
+struct request_sense {
+#ifdef __BIG_ENDIAN_BITFIELD
+ __u8 valid : 1;
+ __u8 error_code : 7;
+#elif defined(__LITTLE_ENDIAN_BITFIELD)
+ __u8 error_code : 7;
+ __u8 valid : 1;
+#endif
+ __u8 segment_number;
+#ifdef __BIG_ENDIAN_BITFIELD
+ __u8 reserved1 : 2;
+ __u8 ili : 1;
+ __u8 reserved2 : 1;
+ __u8 sense_key : 4;
+#elif defined(__LITTLE_ENDIAN_BITFIELD)
+ __u8 sense_key : 4;
+ __u8 reserved2 : 1;
+ __u8 ili : 1;
+ __u8 reserved1 : 2;
+#endif
+ __u8 information[4];
+ __u8 add_sense_len;
+ __u8 command_info[4];
+ __u8 asc;
+ __u8 ascq;
+ __u8 fruc;
+ __u8 sks[3];
+ __u8 asb[46];
+};
+
+#define CDF_RWRT 0x0020  
+#define CDF_HWDM 0x0024  
+#define CDF_MRW 0x0028
+
+#define CDM_MRW_NOTMRW 0
+#define CDM_MRW_BGFORMAT_INACTIVE 1
+#define CDM_MRW_BGFORMAT_ACTIVE 2
+#define CDM_MRW_BGFORMAT_COMPLETE 3
+
+#define MRW_LBA_DMA 0
+#define MRW_LBA_GAA 1
+
+#define MRW_MODE_PC_PRE1 0x2c
+#define MRW_MODE_PC 0x03
+
+struct mrw_feature_desc {
+ __u16 feature_code;
+#ifdef __BIG_ENDIAN_BITFIELD
+ __u8 reserved1 : 2;
+ __u8 feature_version : 4;
+ __u8 persistent : 1;
+ __u8 curr : 1;
+#elif defined(__LITTLE_ENDIAN_BITFIELD)
+ __u8 curr : 1;
+ __u8 persistent : 1;
+ __u8 feature_version : 4;
+ __u8 reserved1 : 2;
+#endif
+ __u8 add_len;
+#ifdef __BIG_ENDIAN_BITFIELD
+ __u8 reserved2 : 7;
+ __u8 write : 1;
+#elif defined(__LITTLE_ENDIAN_BITFIELD)
+ __u8 write : 1;
+ __u8 reserved2 : 7;
+#endif
+ __u8 reserved3;
+ __u8 reserved4;
+ __u8 reserved5;
+};
+
+struct rwrt_feature_desc {
+ __u16 feature_code;
+#ifdef __BIG_ENDIAN_BITFIELD
+ __u8 reserved1 : 2;
+ __u8 feature_version : 4;
+ __u8 persistent : 1;
+ __u8 curr : 1;
+#elif defined(__LITTLE_ENDIAN_BITFIELD)
+ __u8 curr : 1;
+ __u8 persistent : 1;
+ __u8 feature_version : 4;
+ __u8 reserved1 : 2;
+#endif
+ __u8 add_len;
+ __u32 last_lba;
+ __u32 block_size;
+ __u16 blocking;
+#ifdef __BIG_ENDIAN_BITFIELD
+ __u8 reserved2 : 7;
+ __u8 page_present : 1;
+#elif defined(__LITTLE_ENDIAN_BITFIELD)
+ __u8 page_present : 1;
+ __u8 reserved2 : 7;
+#endif
+ __u8 reserved3;
+};
+
+typedef struct {
+ __u16 disc_information_length;
+#ifdef __BIG_ENDIAN_BITFIELD
+ __u8 reserved1 : 3;
+ __u8 erasable : 1;
+ __u8 border_status : 2;
+ __u8 disc_status : 2;
+#elif defined(__LITTLE_ENDIAN_BITFIELD)
+ __u8 disc_status : 2;
+ __u8 border_status : 2;
+ __u8 erasable : 1;
+ __u8 reserved1 : 3;
+#else
+#error "Please fix <asm/byteorder.h>"
+#endif
+ __u8 n_first_track;
+ __u8 n_sessions_lsb;
+ __u8 first_track_lsb;
+ __u8 last_track_lsb;
+#ifdef __BIG_ENDIAN_BITFIELD
+ __u8 did_v : 1;
+ __u8 dbc_v : 1;
+ __u8 uru : 1;
+ __u8 reserved2 : 2;
+ __u8 dbit : 1;
+ __u8 mrw_status : 2;
+#elif defined(__LITTLE_ENDIAN_BITFIELD)
+ __u8 mrw_status : 2;
+ __u8 dbit : 1;
+ __u8 reserved2 : 2;
+ __u8 uru : 1;
+ __u8 dbc_v : 1;
+ __u8 did_v : 1;
+#endif
+ __u8 disc_type;
+ __u8 n_sessions_msb;
+ __u8 first_track_msb;
+ __u8 last_track_msb;
+ __u32 disc_id;
+ __u32 lead_in;
+ __u32 lead_out;
+ __u8 disc_bar_code[8];
+ __u8 reserved3;
+ __u8 n_opc;
+} disc_information;
+
+typedef struct {
+ __u16 track_information_length;
+ __u8 track_lsb;
+ __u8 session_lsb;
+ __u8 reserved1;
+#ifdef __BIG_ENDIAN_BITFIELD
+ __u8 reserved2 : 2;
+ __u8 damage : 1;
+ __u8 copy : 1;
+ __u8 track_mode : 4;
+ __u8 rt : 1;
+ __u8 blank : 1;
+ __u8 packet : 1;
+ __u8 fp : 1;
+ __u8 data_mode : 4;
+ __u8 reserved3 : 6;
+ __u8 lra_v : 1;
+ __u8 nwa_v : 1;
+#elif defined(__LITTLE_ENDIAN_BITFIELD)
+ __u8 track_mode : 4;
+ __u8 copy : 1;
+ __u8 damage : 1;
+ __u8 reserved2 : 2;
+ __u8 data_mode : 4;
+ __u8 fp : 1;
+ __u8 packet : 1;
+ __u8 blank : 1;
+ __u8 rt : 1;
+ __u8 nwa_v : 1;
+ __u8 lra_v : 1;
+ __u8 reserved3 : 6;
+#endif
+ __u32 track_start;
+ __u32 next_writable;
+ __u32 free_blocks;
+ __u32 fixed_packet_size;
+ __u32 track_size;
+ __u32 last_rec_address;
+} track_information;
+
+struct feature_header {
+ __u32 data_len;
+ __u8 reserved1;
+ __u8 reserved2;
+ __u16 curr_profile;
+};
+
+struct mode_page_header {
+ __u16 mode_data_length;
+ __u8 medium_type;
+ __u8 reserved1;
+ __u8 reserved2;
+ __u8 reserved3;
+ __u16 desc_length;
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/circ_buf.h b/ndk/platforms/android-3/include/linux/circ_buf.h
new file mode 100644
index 0000000..438250c
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/circ_buf.h
@@ -0,0 +1,29 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_CIRC_BUF_H
+#define _LINUX_CIRC_BUF_H 1
+
+struct circ_buf {
+ char *buf;
+ int head;
+ int tail;
+};
+
+#define CIRC_CNT(head,tail,size) (((head) - (tail)) & ((size)-1))
+
+#define CIRC_SPACE(head,tail,size) CIRC_CNT((tail),((head)+1),(size))
+
+#define CIRC_CNT_TO_END(head,tail,size)   ({int end = (size) - (tail);   int n = ((head) + end) & ((size)-1);   n < end ? n : end;})
+
+#define CIRC_SPACE_TO_END(head,tail,size)   ({int end = (size) - 1 - (head);   int n = (end + (tail)) & ((size)-1);   n <= end ? n : end+1;})
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/clk.h b/ndk/platforms/android-3/include/linux/clk.h
new file mode 100644
index 0000000..2b8f436
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/clk.h
@@ -0,0 +1,23 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __LINUX_CLK_H
+#define __LINUX_CLK_H
+
+struct device;
+
+struct clk;
+
+struct clk *clk_get(struct device *dev, const char *id);
+
+struct clk *clk_get_parent(struct clk *clk);
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/coda.h b/ndk/platforms/android-3/include/linux/coda.h
new file mode 100644
index 0000000..e7e89f9
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/coda.h
@@ -0,0 +1,594 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _CODA_HEADER_
+#define _CODA_HEADER_
+
+#if defined(__NetBSD__) || (defined(DJGPP) || defined(__CYGWIN32__)) && !defined(KERNEL)
+#include <sys/types.h>
+#endif
+
+#ifndef CODA_MAXSYMLINKS
+#define CODA_MAXSYMLINKS 10
+#endif
+
+#if defined(DJGPP) || defined(__CYGWIN32__)
+#ifdef KERNEL
+typedef unsigned long u_long;
+typedef unsigned int u_int;
+typedef unsigned short u_short;
+typedef u_long ino_t;
+typedef u_long dev_t;
+typedef void * caddr_t;
+#ifdef DOS
+typedef unsigned __int64 u_quad_t;
+#else
+typedef unsigned long long u_quad_t;
+#endif
+
+#define inline
+
+struct timespec {
+ long ts_sec;
+ long ts_nsec;
+};
+#else
+#include <sys/time.h>
+typedef unsigned long long u_quad_t;
+#endif
+#endif
+
+#ifdef __linux__
+#include <linux/time.h>
+#define cdev_t u_quad_t
+#if !defined(_UQUAD_T_) && (!defined(__GLIBC__) || __GLIBC__ < 2)
+#define _UQUAD_T_ 1
+typedef unsigned long long u_quad_t;
+#endif
+#else
+#define cdev_t dev_t
+#endif
+
+#ifdef __CYGWIN32__
+struct timespec {
+ time_t tv_sec;
+ long tv_nsec;
+};
+#endif
+
+#ifndef __BIT_TYPES_DEFINED__
+#define __BIT_TYPES_DEFINED__
+typedef signed char int8_t;
+typedef unsigned char u_int8_t;
+typedef short int16_t;
+typedef unsigned short u_int16_t;
+typedef int int32_t;
+typedef unsigned int u_int32_t;
+#endif
+
+#define CODA_MAXNAMLEN 255
+#define CODA_MAXPATHLEN 1024
+#define CODA_MAXSYMLINK 10
+
+#define C_O_READ 0x001
+#define C_O_WRITE 0x002
+#define C_O_TRUNC 0x010
+#define C_O_EXCL 0x100
+#define C_O_CREAT 0x200
+
+#define C_M_READ 00400
+#define C_M_WRITE 00200
+
+#define C_A_C_OK 8  
+#define C_A_R_OK 4  
+#define C_A_W_OK 2  
+#define C_A_X_OK 1  
+#define C_A_F_OK 0  
+
+#ifndef _VENUS_DIRENT_T_
+#define _VENUS_DIRENT_T_ 1
+struct venus_dirent {
+ u_int32_t d_fileno;
+ u_int16_t d_reclen;
+ u_int8_t d_type;
+ u_int8_t d_namlen;
+ char d_name[CODA_MAXNAMLEN + 1];
+};
+#undef DIRSIZ
+#define DIRSIZ(dp) ((sizeof (struct venus_dirent) - (CODA_MAXNAMLEN+1)) +   (((dp)->d_namlen+1 + 3) &~ 3))
+
+#define CDT_UNKNOWN 0
+#define CDT_FIFO 1
+#define CDT_CHR 2
+#define CDT_DIR 4
+#define CDT_BLK 6
+#define CDT_REG 8
+#define CDT_LNK 10
+#define CDT_SOCK 12
+#define CDT_WHT 14
+
+#define IFTOCDT(mode) (((mode) & 0170000) >> 12)
+#define CDTTOIF(dirtype) ((dirtype) << 12)
+
+#endif
+
+#ifndef _VUID_T_
+#define _VUID_T_
+typedef u_int32_t vuid_t;
+typedef u_int32_t vgid_t;
+#endif
+
+struct CodaFid {
+ u_int32_t opaque[4];
+};
+
+#define coda_f2i(fid)  (fid ? (fid->opaque[3] ^ (fid->opaque[2]<<10) ^ (fid->opaque[1]<<20) ^ fid->opaque[0]) : 0)
+
+#ifndef _VENUS_VATTR_T_
+#define _VENUS_VATTR_T_
+
+enum coda_vtype { C_VNON, C_VREG, C_VDIR, C_VBLK, C_VCHR, C_VLNK, C_VSOCK, C_VFIFO, C_VBAD };
+
+struct coda_vattr {
+ long va_type;
+ u_short va_mode;
+ short va_nlink;
+ vuid_t va_uid;
+ vgid_t va_gid;
+ long va_fileid;
+ u_quad_t va_size;
+ long va_blocksize;
+ struct timespec va_atime;
+ struct timespec va_mtime;
+ struct timespec va_ctime;
+ u_long va_gen;
+ u_long va_flags;
+ cdev_t va_rdev;
+ u_quad_t va_bytes;
+ u_quad_t va_filerev;
+};
+
+#endif
+
+struct coda_statfs {
+ int32_t f_blocks;
+ int32_t f_bfree;
+ int32_t f_bavail;
+ int32_t f_files;
+ int32_t f_ffree;
+};
+
+#define CODA_ROOT 2
+#define CODA_OPEN_BY_FD 3
+#define CODA_OPEN 4
+#define CODA_CLOSE 5
+#define CODA_IOCTL 6
+#define CODA_GETATTR 7
+#define CODA_SETATTR 8
+#define CODA_ACCESS 9
+#define CODA_LOOKUP 10
+#define CODA_CREATE 11
+#define CODA_REMOVE 12
+#define CODA_LINK 13
+#define CODA_RENAME 14
+#define CODA_MKDIR 15
+#define CODA_RMDIR 16
+#define CODA_SYMLINK 18
+#define CODA_READLINK 19
+#define CODA_FSYNC 20
+#define CODA_VGET 22
+#define CODA_SIGNAL 23
+#define CODA_REPLACE 24  
+#define CODA_FLUSH 25  
+#define CODA_PURGEUSER 26  
+#define CODA_ZAPFILE 27  
+#define CODA_ZAPDIR 28  
+#define CODA_PURGEFID 30  
+#define CODA_OPEN_BY_PATH 31
+#define CODA_RESOLVE 32
+#define CODA_REINTEGRATE 33
+#define CODA_STATFS 34
+#define CODA_STORE 35
+#define CODA_RELEASE 36
+#define CODA_NCALLS 37
+
+#define DOWNCALL(opcode) (opcode >= CODA_REPLACE && opcode <= CODA_PURGEFID)
+
+#define VC_MAXDATASIZE 8192
+#define VC_MAXMSGSIZE sizeof(union inputArgs)+sizeof(union outputArgs) +  VC_MAXDATASIZE 
+
+#define CIOC_KERNEL_VERSION _IOWR('c', 10, size_t)
+
+#define CODA_KERNEL_VERSION 3  
+
+struct coda_in_hdr {
+ u_int32_t opcode;
+ u_int32_t unique;
+ pid_t pid;
+ pid_t pgid;
+ vuid_t uid;
+};
+
+struct coda_out_hdr {
+ u_int32_t opcode;
+ u_int32_t unique;
+ u_int32_t result;
+};
+
+struct coda_root_out {
+ struct coda_out_hdr oh;
+ struct CodaFid VFid;
+};
+
+struct coda_root_in {
+ struct coda_in_hdr in;
+};
+
+struct coda_open_in {
+ struct coda_in_hdr ih;
+ struct CodaFid VFid;
+ int flags;
+};
+
+struct coda_open_out {
+ struct coda_out_hdr oh;
+ cdev_t dev;
+ ino_t inode;
+};
+
+struct coda_store_in {
+ struct coda_in_hdr ih;
+ struct CodaFid VFid;
+ int flags;
+};
+
+struct coda_store_out {
+ struct coda_out_hdr out;
+};
+
+struct coda_release_in {
+ struct coda_in_hdr ih;
+ struct CodaFid VFid;
+ int flags;
+};
+
+struct coda_release_out {
+ struct coda_out_hdr out;
+};
+
+struct coda_close_in {
+ struct coda_in_hdr ih;
+ struct CodaFid VFid;
+ int flags;
+};
+
+struct coda_close_out {
+ struct coda_out_hdr out;
+};
+
+struct coda_ioctl_in {
+ struct coda_in_hdr ih;
+ struct CodaFid VFid;
+ int cmd;
+ int len;
+ int rwflag;
+ char *data;
+};
+
+struct coda_ioctl_out {
+ struct coda_out_hdr oh;
+ int len;
+ caddr_t data;
+};
+
+struct coda_getattr_in {
+ struct coda_in_hdr ih;
+ struct CodaFid VFid;
+};
+
+struct coda_getattr_out {
+ struct coda_out_hdr oh;
+ struct coda_vattr attr;
+};
+
+struct coda_setattr_in {
+ struct coda_in_hdr ih;
+ struct CodaFid VFid;
+ struct coda_vattr attr;
+};
+
+struct coda_setattr_out {
+ struct coda_out_hdr out;
+};
+
+struct coda_access_in {
+ struct coda_in_hdr ih;
+ struct CodaFid VFid;
+ int flags;
+};
+
+struct coda_access_out {
+ struct coda_out_hdr out;
+};
+
+#define CLU_CASE_SENSITIVE 0x01
+#define CLU_CASE_INSENSITIVE 0x02
+
+struct coda_lookup_in {
+ struct coda_in_hdr ih;
+ struct CodaFid VFid;
+ int name;
+ int flags;
+};
+
+struct coda_lookup_out {
+ struct coda_out_hdr oh;
+ struct CodaFid VFid;
+ int vtype;
+};
+
+struct coda_create_in {
+ struct coda_in_hdr ih;
+ struct CodaFid VFid;
+ struct coda_vattr attr;
+ int excl;
+ int mode;
+ int name;
+};
+
+struct coda_create_out {
+ struct coda_out_hdr oh;
+ struct CodaFid VFid;
+ struct coda_vattr attr;
+};
+
+struct coda_remove_in {
+ struct coda_in_hdr ih;
+ struct CodaFid VFid;
+ int name;
+};
+
+struct coda_remove_out {
+ struct coda_out_hdr out;
+};
+
+struct coda_link_in {
+ struct coda_in_hdr ih;
+ struct CodaFid sourceFid;
+ struct CodaFid destFid;
+ int tname;
+};
+
+struct coda_link_out {
+ struct coda_out_hdr out;
+};
+
+struct coda_rename_in {
+ struct coda_in_hdr ih;
+ struct CodaFid sourceFid;
+ int srcname;
+ struct CodaFid destFid;
+ int destname;
+};
+
+struct coda_rename_out {
+ struct coda_out_hdr out;
+};
+
+struct coda_mkdir_in {
+ struct coda_in_hdr ih;
+ struct CodaFid VFid;
+ struct coda_vattr attr;
+ int name;
+};
+
+struct coda_mkdir_out {
+ struct coda_out_hdr oh;
+ struct CodaFid VFid;
+ struct coda_vattr attr;
+};
+
+struct coda_rmdir_in {
+ struct coda_in_hdr ih;
+ struct CodaFid VFid;
+ int name;
+};
+
+struct coda_rmdir_out {
+ struct coda_out_hdr out;
+};
+
+struct coda_symlink_in {
+ struct coda_in_hdr ih;
+ struct CodaFid VFid;
+ int srcname;
+ struct coda_vattr attr;
+ int tname;
+};
+
+struct coda_symlink_out {
+ struct coda_out_hdr out;
+};
+
+struct coda_readlink_in {
+ struct coda_in_hdr ih;
+ struct CodaFid VFid;
+};
+
+struct coda_readlink_out {
+ struct coda_out_hdr oh;
+ int count;
+ caddr_t data;
+};
+
+struct coda_fsync_in {
+ struct coda_in_hdr ih;
+ struct CodaFid VFid;
+};
+
+struct coda_fsync_out {
+ struct coda_out_hdr out;
+};
+
+struct coda_vget_in {
+ struct coda_in_hdr ih;
+ struct CodaFid VFid;
+};
+
+struct coda_vget_out {
+ struct coda_out_hdr oh;
+ struct CodaFid VFid;
+ int vtype;
+};
+
+struct coda_purgeuser_out {
+ struct coda_out_hdr oh;
+ vuid_t uid;
+};
+
+struct coda_zapfile_out {
+ struct coda_out_hdr oh;
+ struct CodaFid CodaFid;
+};
+
+struct coda_zapdir_out {
+ struct coda_out_hdr oh;
+ struct CodaFid CodaFid;
+};
+
+struct coda_purgefid_out {
+ struct coda_out_hdr oh;
+ struct CodaFid CodaFid;
+};
+
+struct coda_replace_out {
+ struct coda_out_hdr oh;
+ struct CodaFid NewFid;
+ struct CodaFid OldFid;
+};
+
+struct coda_open_by_fd_in {
+ struct coda_in_hdr ih;
+ struct CodaFid VFid;
+ int flags;
+};
+
+struct coda_open_by_fd_out {
+ struct coda_out_hdr oh;
+ int fd;
+
+};
+
+struct coda_open_by_path_in {
+ struct coda_in_hdr ih;
+ struct CodaFid VFid;
+ int flags;
+};
+
+struct coda_open_by_path_out {
+ struct coda_out_hdr oh;
+ int path;
+};
+
+struct coda_statfs_in {
+ struct coda_in_hdr in;
+};
+
+struct coda_statfs_out {
+ struct coda_out_hdr oh;
+ struct coda_statfs stat;
+};
+
+#define CODA_NOCACHE 0x80000000
+
+union inputArgs {
+ struct coda_in_hdr ih;
+ struct coda_open_in coda_open;
+ struct coda_store_in coda_store;
+ struct coda_release_in coda_release;
+ struct coda_close_in coda_close;
+ struct coda_ioctl_in coda_ioctl;
+ struct coda_getattr_in coda_getattr;
+ struct coda_setattr_in coda_setattr;
+ struct coda_access_in coda_access;
+ struct coda_lookup_in coda_lookup;
+ struct coda_create_in coda_create;
+ struct coda_remove_in coda_remove;
+ struct coda_link_in coda_link;
+ struct coda_rename_in coda_rename;
+ struct coda_mkdir_in coda_mkdir;
+ struct coda_rmdir_in coda_rmdir;
+ struct coda_symlink_in coda_symlink;
+ struct coda_readlink_in coda_readlink;
+ struct coda_fsync_in coda_fsync;
+ struct coda_vget_in coda_vget;
+ struct coda_open_by_fd_in coda_open_by_fd;
+ struct coda_open_by_path_in coda_open_by_path;
+ struct coda_statfs_in coda_statfs;
+};
+
+union outputArgs {
+ struct coda_out_hdr oh;
+ struct coda_root_out coda_root;
+ struct coda_open_out coda_open;
+ struct coda_ioctl_out coda_ioctl;
+ struct coda_getattr_out coda_getattr;
+ struct coda_lookup_out coda_lookup;
+ struct coda_create_out coda_create;
+ struct coda_mkdir_out coda_mkdir;
+ struct coda_readlink_out coda_readlink;
+ struct coda_vget_out coda_vget;
+ struct coda_purgeuser_out coda_purgeuser;
+ struct coda_zapfile_out coda_zapfile;
+ struct coda_zapdir_out coda_zapdir;
+ struct coda_purgefid_out coda_purgefid;
+ struct coda_replace_out coda_replace;
+ struct coda_open_by_fd_out coda_open_by_fd;
+ struct coda_open_by_path_out coda_open_by_path;
+ struct coda_statfs_out coda_statfs;
+};
+
+union coda_downcalls {
+
+ struct coda_purgeuser_out purgeuser;
+ struct coda_zapfile_out zapfile;
+ struct coda_zapdir_out zapdir;
+ struct coda_purgefid_out purgefid;
+ struct coda_replace_out replace;
+};
+
+#define PIOCPARM_MASK 0x0000ffff
+struct ViceIoctl {
+ void __user *in;
+ void __user *out;
+ u_short in_size;
+ u_short out_size;
+};
+
+struct PioctlData {
+ const char __user *path;
+ int follow;
+ struct ViceIoctl vi;
+};
+
+#define CODA_CONTROL ".CONTROL"
+#define CODA_CONTROLLEN 8
+#define CTL_INO -1
+
+#define CODA_MOUNT_VERSION 1
+
+struct coda_mount_data {
+ int version;
+ int fd;
+};
+
+#endif
+
diff --git a/ndk/platforms/android-3/include/linux/coda_fs_i.h b/ndk/platforms/android-3/include/linux/coda_fs_i.h
new file mode 100644
index 0000000..28b0e59
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/coda_fs_i.h
@@ -0,0 +1,15 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_CODA_FS_I
+#define _LINUX_CODA_FS_I
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/compat.h b/ndk/platforms/android-3/include/linux/compat.h
new file mode 100644
index 0000000..d30b550
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/compat.h
@@ -0,0 +1,15 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_COMPAT_H
+#define _LINUX_COMPAT_H
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/compiler-gcc.h b/ndk/platforms/android-3/include/linux/compiler-gcc.h
new file mode 100644
index 0000000..0dd4a62
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/compiler-gcc.h
@@ -0,0 +1,22 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#define barrier() __asm__ __volatile__("": : :"memory")
+
+#define RELOC_HIDE(ptr, off)   ({ unsigned long __ptr;   __asm__ ("" : "=r"(__ptr) : "0"(ptr));   (typeof(ptr)) (__ptr + (off)); })
+
+#define inline inline __attribute__((always_inline))
+#define __inline__ __inline__ __attribute__((always_inline))
+#define __inline __inline __attribute__((always_inline))
+#define __deprecated __attribute__((deprecated))
+#define noinline __attribute__((noinline))
+#define __attribute_pure__ __attribute__((pure))
+#define __attribute_const__ __attribute__((__const__))
diff --git a/ndk/platforms/android-3/include/linux/compiler.h b/ndk/platforms/android-3/include/linux/compiler.h
new file mode 100644
index 0000000..4055e33
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/compiler.h
@@ -0,0 +1,38 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __LINUX_COMPILER_H
+#define __LINUX_COMPILER_H
+
+#ifndef __ASSEMBLY__
+
+#define __user
+#define __kernel
+#define __safe
+#define __force
+#define __nocast
+#define __iomem
+#define __chk_user_ptr(x) (void)0
+#define __chk_io_ptr(x) (void)0
+#define __builtin_warning(x, y...) (1)
+#define __acquires(x)
+#define __releases(x)
+#define __acquire(x) (void)0
+#define __release(x) (void)0
+#define __cond_lock(x) (x)
+
+#endif
+
+#ifndef __attribute_const__
+#define __attribute_const__  
+#endif
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/completion.h b/ndk/platforms/android-3/include/linux/completion.h
new file mode 100644
index 0000000..ee18211
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/completion.h
@@ -0,0 +1,32 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __LINUX_COMPLETION_H
+#define __LINUX_COMPLETION_H
+
+#include <linux/wait.h>
+
+struct completion {
+ unsigned int done;
+ wait_queue_head_t wait;
+};
+
+#define COMPLETION_INITIALIZER(work)   { 0, __WAIT_QUEUE_HEAD_INITIALIZER((work).wait) }
+
+#define COMPLETION_INITIALIZER_ONSTACK(work)   ({ init_completion(&work); work; })
+
+#define DECLARE_COMPLETION(work)   struct completion work = COMPLETION_INITIALIZER(work)
+
+#define DECLARE_COMPLETION_ONSTACK(work) DECLARE_COMPLETION(work)
+
+#define INIT_COMPLETION(x) ((x).done = 0)
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/config.h b/ndk/platforms/android-3/include/linux/config.h
new file mode 100644
index 0000000..7aa1056
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/config.h
@@ -0,0 +1,17 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_CONFIG_H
+#define _LINUX_CONFIG_H
+
+#include <linux/autoconf.h>
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/console_struct.h b/ndk/platforms/android-3/include/linux/console_struct.h
new file mode 100644
index 0000000..50e4cbe
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/console_struct.h
@@ -0,0 +1,121 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#include <linux/wait.h>
+#include <linux/vt.h>
+
+struct vt_struct;
+
+#define NPAR 16
+
+struct vc_data {
+ unsigned short vc_num;
+ unsigned int vc_cols;
+ unsigned int vc_rows;
+ unsigned int vc_size_row;
+ unsigned int vc_scan_lines;
+ unsigned long vc_origin;
+ unsigned long vc_scr_end;
+ unsigned long vc_visible_origin;
+ unsigned int vc_top, vc_bottom;
+ const struct consw *vc_sw;
+ unsigned short *vc_screenbuf;
+ unsigned int vc_screenbuf_size;
+ unsigned char vc_mode;
+
+ unsigned char vc_attr;
+ unsigned char vc_def_color;
+ unsigned char vc_color;
+ unsigned char vc_s_color;
+ unsigned char vc_ulcolor;
+ unsigned char vc_halfcolor;
+
+ unsigned int vc_cursor_type;
+ unsigned short vc_complement_mask;
+ unsigned short vc_s_complement_mask;
+ unsigned int vc_x, vc_y;
+ unsigned int vc_saved_x, vc_saved_y;
+ unsigned long vc_pos;
+
+ unsigned short vc_hi_font_mask;
+ struct console_font vc_font;
+ unsigned short vc_video_erase_char;
+
+ unsigned int vc_state;
+ unsigned int vc_npar,vc_par[NPAR];
+ struct tty_struct *vc_tty;
+
+ struct vt_mode vt_mode;
+ int vt_pid;
+ int vt_newvt;
+ wait_queue_head_t paste_wait;
+
+ unsigned int vc_charset : 1;
+ unsigned int vc_s_charset : 1;
+ unsigned int vc_disp_ctrl : 1;
+ unsigned int vc_toggle_meta : 1;
+ unsigned int vc_decscnm : 1;
+ unsigned int vc_decom : 1;
+ unsigned int vc_decawm : 1;
+ unsigned int vc_deccm : 1;
+ unsigned int vc_decim : 1;
+ unsigned int vc_deccolm : 1;
+
+ unsigned int vc_intensity : 2;
+ unsigned int vc_underline : 1;
+ unsigned int vc_blink : 1;
+ unsigned int vc_reverse : 1;
+ unsigned int vc_s_intensity : 2;
+ unsigned int vc_s_underline : 1;
+ unsigned int vc_s_blink : 1;
+ unsigned int vc_s_reverse : 1;
+
+ unsigned int vc_ques : 1;
+ unsigned int vc_need_wrap : 1;
+ unsigned int vc_can_do_color : 1;
+ unsigned int vc_report_mouse : 2;
+ unsigned int vc_kmalloced : 1;
+ unsigned char vc_utf : 1;
+ unsigned char vc_utf_count;
+ int vc_utf_char;
+ unsigned int vc_tab_stop[8];
+ unsigned char vc_palette[16*3];
+ unsigned short * vc_translate;
+ unsigned char vc_G0_charset;
+ unsigned char vc_G1_charset;
+ unsigned char vc_saved_G0;
+ unsigned char vc_saved_G1;
+ unsigned int vc_bell_pitch;
+ unsigned int vc_bell_duration;
+ struct vc_data **vc_display_fg;
+ unsigned long vc_uni_pagedir;
+ unsigned long *vc_uni_pagedir_loc;
+
+};
+
+struct vc {
+ struct vc_data *d;
+
+};
+
+#define CUR_DEF 0
+#define CUR_NONE 1
+#define CUR_UNDERLINE 2
+#define CUR_LOWER_THIRD 3
+#define CUR_LOWER_HALF 4
+#define CUR_TWO_THIRDS 5
+#define CUR_BLOCK 6
+#define CUR_HWMASK 0x0f
+#define CUR_SWMASK 0xfff0
+
+#define CUR_DEFAULT CUR_UNDERLINE
+
+#define CON_IS_VISIBLE(conp) (*conp->vc_display_fg == conp)
diff --git a/ndk/platforms/android-3/include/linux/cpu.h b/ndk/platforms/android-3/include/linux/cpu.h
new file mode 100644
index 0000000..f7e3889
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/cpu.h
@@ -0,0 +1,36 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_CPU_H_
+#define _LINUX_CPU_H_
+
+#include <linux/sysdev.h>
+#include <linux/node.h>
+#include <linux/compiler.h>
+#include <linux/cpumask.h>
+#include <asm/semaphore.h>
+
+struct cpu {
+ int node_id;
+ int no_control;
+ struct sys_device sysdev;
+};
+
+struct notifier_block;
+
+#define lock_cpu_hotplug() do { } while (0)
+#define unlock_cpu_hotplug() do { } while (0)
+#define lock_cpu_hotplug_interruptible() 0
+#define hotcpu_notifier(fn, pri) do { } while (0)
+#define register_hotcpu_notifier(nb) do { } while (0)
+#define unregister_hotcpu_notifier(nb) do { } while (0)
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/cpumask.h b/ndk/platforms/android-3/include/linux/cpumask.h
new file mode 100644
index 0000000..541940a
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/cpumask.h
@@ -0,0 +1,87 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __LINUX_CPUMASK_H
+#define __LINUX_CPUMASK_H
+
+#include <linux/kernel.h>
+#include <linux/threads.h>
+#include <linux/bitmap.h>
+
+typedef struct { DECLARE_BITMAP(bits, NR_CPUS); } cpumask_t;
+
+#define cpu_set(cpu, dst) __cpu_set((cpu), &(dst))
+#define cpu_clear(cpu, dst) __cpu_clear((cpu), &(dst))
+#define cpus_setall(dst) __cpus_setall(&(dst), NR_CPUS)
+#define cpus_clear(dst) __cpus_clear(&(dst), NR_CPUS)
+#define cpu_isset(cpu, cpumask) test_bit((cpu), (cpumask).bits)
+#define cpu_test_and_set(cpu, cpumask) __cpu_test_and_set((cpu), &(cpumask))
+#define cpus_and(dst, src1, src2) __cpus_and(&(dst), &(src1), &(src2), NR_CPUS)
+#define cpus_or(dst, src1, src2) __cpus_or(&(dst), &(src1), &(src2), NR_CPUS)
+#define cpus_xor(dst, src1, src2) __cpus_xor(&(dst), &(src1), &(src2), NR_CPUS)
+#define cpus_andnot(dst, src1, src2)   __cpus_andnot(&(dst), &(src1), &(src2), NR_CPUS)
+#define cpus_complement(dst, src) __cpus_complement(&(dst), &(src), NR_CPUS)
+#define cpus_equal(src1, src2) __cpus_equal(&(src1), &(src2), NR_CPUS)
+#define cpus_intersects(src1, src2) __cpus_intersects(&(src1), &(src2), NR_CPUS)
+#define cpus_subset(src1, src2) __cpus_subset(&(src1), &(src2), NR_CPUS)
+#define cpus_empty(src) __cpus_empty(&(src), NR_CPUS)
+#define cpus_full(cpumask) __cpus_full(&(cpumask), NR_CPUS)
+#define cpus_weight(cpumask) __cpus_weight(&(cpumask), NR_CPUS)
+#define cpus_shift_right(dst, src, n)   __cpus_shift_right(&(dst), &(src), (n), NR_CPUS)
+#define cpus_shift_left(dst, src, n)   __cpus_shift_left(&(dst), &(src), (n), NR_CPUS)
+#define first_cpu(src) 0
+#define next_cpu(n, src) 1
+#define cpumask_of_cpu(cpu)  ({   typeof(_unused_cpumask_arg_) m;   if (sizeof(m) == sizeof(unsigned long)) {   m.bits[0] = 1UL<<(cpu);   } else {   cpus_clear(m);   cpu_set((cpu), m);   }   m;  })
+#define CPU_MASK_LAST_WORD BITMAP_LAST_WORD_MASK(NR_CPUS)
+#if NR_CPUS <= BITS_PER_LONG
+#define CPU_MASK_ALL  (cpumask_t) { {   [BITS_TO_LONGS(NR_CPUS)-1] = CPU_MASK_LAST_WORD  } }
+#else
+#define CPU_MASK_ALL  (cpumask_t) { {   [0 ... BITS_TO_LONGS(NR_CPUS)-2] = ~0UL,   [BITS_TO_LONGS(NR_CPUS)-1] = CPU_MASK_LAST_WORD  } }
+#endif
+#define CPU_MASK_NONE  (cpumask_t) { {   [0 ... BITS_TO_LONGS(NR_CPUS)-1] = 0UL  } }
+#define CPU_MASK_CPU0  (cpumask_t) { {   [0] = 1UL  } }
+#define cpus_addr(src) ((src).bits)
+#define cpumask_scnprintf(buf, len, src)   __cpumask_scnprintf((buf), (len), &(src), NR_CPUS)
+#define cpumask_parse(ubuf, ulen, dst)   __cpumask_parse((ubuf), (ulen), &(dst), NR_CPUS)
+#define cpulist_scnprintf(buf, len, src)   __cpulist_scnprintf((buf), (len), &(src), NR_CPUS)
+#define cpulist_parse(buf, dst) __cpulist_parse((buf), &(dst), NR_CPUS)
+#define cpu_remap(oldbit, old, new)   __cpu_remap((oldbit), &(old), &(new), NR_CPUS)
+#define cpus_remap(dst, src, old, new)   __cpus_remap(&(dst), &(src), &(old), &(new), NR_CPUS)
+#if NR_CPUS > 1
+#define for_each_cpu_mask(cpu, mask)   for ((cpu) = first_cpu(mask);   (cpu) < NR_CPUS;   (cpu) = next_cpu((cpu), (mask)))
+#else
+#define for_each_cpu_mask(cpu, mask)   for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask)
+#endif
+
+#if NR_CPUS > 1
+#define num_online_cpus() cpus_weight(cpu_online_map)
+#define num_possible_cpus() cpus_weight(cpu_possible_map)
+#define num_present_cpus() cpus_weight(cpu_present_map)
+#define cpu_online(cpu) cpu_isset((cpu), cpu_online_map)
+#define cpu_possible(cpu) cpu_isset((cpu), cpu_possible_map)
+#define cpu_present(cpu) cpu_isset((cpu), cpu_present_map)
+#else
+#define num_online_cpus() 1
+#define num_possible_cpus() 1
+#define num_present_cpus() 1
+#define cpu_online(cpu) ((cpu) == 0)
+#define cpu_possible(cpu) ((cpu) == 0)
+#define cpu_present(cpu) ((cpu) == 0)
+#endif
+
+#define highest_possible_processor_id() 0
+#define any_online_cpu(mask) 0
+
+#define for_each_possible_cpu(cpu) for_each_cpu_mask((cpu), cpu_possible_map)
+#define for_each_online_cpu(cpu) for_each_cpu_mask((cpu), cpu_online_map)
+#define for_each_present_cpu(cpu) for_each_cpu_mask((cpu), cpu_present_map)
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/ctype.h b/ndk/platforms/android-3/include/linux/ctype.h
new file mode 100644
index 0000000..4644d12
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/ctype.h
@@ -0,0 +1,43 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_CTYPE_H
+#define _LINUX_CTYPE_H
+
+#define _U 0x01  
+#define _L 0x02  
+#define _D 0x04  
+#define _C 0x08  
+#define _P 0x10  
+#define _S 0x20  
+#define _X 0x40  
+#define _SP 0x80  
+
+#define __ismask(x) (_ctype[(int)(unsigned char)(x)])
+
+#define isalnum(c) ((__ismask(c)&(_U|_L|_D)) != 0)
+#define isalpha(c) ((__ismask(c)&(_U|_L)) != 0)
+#define iscntrl(c) ((__ismask(c)&(_C)) != 0)
+#define isdigit(c) ((__ismask(c)&(_D)) != 0)
+#define isgraph(c) ((__ismask(c)&(_P|_U|_L|_D)) != 0)
+#define islower(c) ((__ismask(c)&(_L)) != 0)
+#define isprint(c) ((__ismask(c)&(_P|_U|_L|_D|_SP)) != 0)
+#define ispunct(c) ((__ismask(c)&(_P)) != 0)
+#define isspace(c) ((__ismask(c)&(_S)) != 0)
+#define isupper(c) ((__ismask(c)&(_U)) != 0)
+#define isxdigit(c) ((__ismask(c)&(_D|_X)) != 0)
+
+#define isascii(c) (((unsigned char)(c))<=0x7f)
+#define toascii(c) (((unsigned char)(c))&0x7f)
+
+#define tolower(c) __tolower(c)
+#define toupper(c) __toupper(c)
+#endif
diff --git a/ndk/platforms/android-3/include/linux/dccp.h b/ndk/platforms/android-3/include/linux/dccp.h
new file mode 100644
index 0000000..5e33777
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/dccp.h
@@ -0,0 +1,135 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_DCCP_H
+#define _LINUX_DCCP_H
+
+#include <linux/types.h>
+#include <asm/byteorder.h>
+
+struct dccp_hdr {
+ __be16 dccph_sport,
+ dccph_dport;
+ __u8 dccph_doff;
+#ifdef __LITTLE_ENDIAN_BITFIELD
+ __u8 dccph_cscov:4,
+ dccph_ccval:4;
+#elif defined(__BIG_ENDIAN_BITFIELD)
+ __u8 dccph_ccval:4,
+ dccph_cscov:4;
+#else
+#error "Adjust your <asm/byteorder.h> defines"
+#endif
+ __u16 dccph_checksum;
+#ifdef __LITTLE_ENDIAN_BITFIELD
+ __u8 dccph_x:1,
+ dccph_type:4,
+ dccph_reserved:3;
+#elif defined(__BIG_ENDIAN_BITFIELD)
+ __u8 dccph_reserved:3,
+ dccph_type:4,
+ dccph_x:1;
+#else
+#error "Adjust your <asm/byteorder.h> defines"
+#endif
+ __u8 dccph_seq2;
+ __be16 dccph_seq;
+};
+
+struct dccp_hdr_ext {
+ __be32 dccph_seq_low;
+};
+
+struct dccp_hdr_request {
+ __be32 dccph_req_service;
+};
+
+struct dccp_hdr_ack_bits {
+ __be16 dccph_reserved1;
+ __be16 dccph_ack_nr_high;
+ __be32 dccph_ack_nr_low;
+};
+
+struct dccp_hdr_response {
+ struct dccp_hdr_ack_bits dccph_resp_ack;
+ __be32 dccph_resp_service;
+};
+
+struct dccp_hdr_reset {
+ struct dccp_hdr_ack_bits dccph_reset_ack;
+ __u8 dccph_reset_code,
+ dccph_reset_data[3];
+};
+
+enum dccp_pkt_type {
+ DCCP_PKT_REQUEST = 0,
+ DCCP_PKT_RESPONSE,
+ DCCP_PKT_DATA,
+ DCCP_PKT_ACK,
+ DCCP_PKT_DATAACK,
+ DCCP_PKT_CLOSEREQ,
+ DCCP_PKT_CLOSE,
+ DCCP_PKT_RESET,
+ DCCP_PKT_SYNC,
+ DCCP_PKT_SYNCACK,
+ DCCP_PKT_INVALID,
+};
+
+#define DCCP_NR_PKT_TYPES DCCP_PKT_INVALID
+
+enum {
+ DCCPO_PADDING = 0,
+ DCCPO_MANDATORY = 1,
+ DCCPO_MIN_RESERVED = 3,
+ DCCPO_MAX_RESERVED = 31,
+ DCCPO_CHANGE_L = 32,
+ DCCPO_CONFIRM_L = 33,
+ DCCPO_CHANGE_R = 34,
+ DCCPO_CONFIRM_R = 35,
+ DCCPO_NDP_COUNT = 37,
+ DCCPO_ACK_VECTOR_0 = 38,
+ DCCPO_ACK_VECTOR_1 = 39,
+ DCCPO_TIMESTAMP = 41,
+ DCCPO_TIMESTAMP_ECHO = 42,
+ DCCPO_ELAPSED_TIME = 43,
+ DCCPO_MAX = 45,
+ DCCPO_MIN_CCID_SPECIFIC = 128,
+ DCCPO_MAX_CCID_SPECIFIC = 255,
+};
+
+enum {
+ DCCPF_RESERVED = 0,
+ DCCPF_CCID = 1,
+ DCCPF_SEQUENCE_WINDOW = 3,
+ DCCPF_ACK_RATIO = 5,
+ DCCPF_SEND_ACK_VECTOR = 6,
+ DCCPF_SEND_NDP_COUNT = 7,
+
+ DCCPF_MIN_CCID_SPECIFIC = 128,
+ DCCPF_MAX_CCID_SPECIFIC = 255,
+};
+
+struct dccp_so_feat {
+ __u8 dccpsf_feat;
+ __u8 *dccpsf_val;
+ __u8 dccpsf_len;
+};
+
+#define DCCP_SOCKOPT_PACKET_SIZE 1
+#define DCCP_SOCKOPT_SERVICE 2
+#define DCCP_SOCKOPT_CHANGE_L 3
+#define DCCP_SOCKOPT_CHANGE_R 4
+#define DCCP_SOCKOPT_CCID_RX_INFO 128
+#define DCCP_SOCKOPT_CCID_TX_INFO 192
+
+#define DCCP_SERVICE_LIST_MAX_LEN 32
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/debug_locks.h b/ndk/platforms/android-3/include/linux/debug_locks.h
new file mode 100644
index 0000000..2d55fcd
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/debug_locks.h
@@ -0,0 +1,26 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __LINUX_DEBUG_LOCKING_H
+#define __LINUX_DEBUG_LOCKING_H
+
+struct task_struct;
+
+#define _RET_IP_ (unsigned long)__builtin_return_address(0)
+#define _THIS_IP_ ({ __label__ __here; __here: (unsigned long)&&__here; })
+
+#define DEBUG_LOCKS_WARN_ON(c)  ({   int __ret = 0;     if (unlikely(c)) {   if (debug_locks_off())   WARN_ON(1);   __ret = 1;   }   __ret;  })
+
+#define SMP_DEBUG_LOCKS_WARN_ON(c) do { } while (0)
+
+#define locking_selftest() do { } while (0)
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/delay.h b/ndk/platforms/android-3/include/linux/delay.h
new file mode 100644
index 0000000..e032b6f
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/delay.h
@@ -0,0 +1,29 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_DELAY_H
+#define _LINUX_DELAY_H
+
+#include <asm/delay.h>
+
+#ifndef MAX_UDELAY_MS
+#define MAX_UDELAY_MS 5
+#endif
+
+#ifndef mdelay
+#define mdelay(n) (  (__builtin_constant_p(n) && (n)<=MAX_UDELAY_MS) ? udelay((n)*1000) :   ({unsigned long __ms=(n); while (__ms--) udelay(1000);}))
+#endif
+
+#ifndef ndelay
+#define ndelay(x) udelay(((x)+999)/1000)
+#endif
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/device.h b/ndk/platforms/android-3/include/linux/device.h
new file mode 100644
index 0000000..6419322
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/device.h
@@ -0,0 +1,222 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _DEVICE_H_
+#define _DEVICE_H_
+
+#include <linux/ioport.h>
+#include <linux/kobject.h>
+#include <linux/klist.h>
+#include <linux/list.h>
+#include <linux/types.h>
+#include <linux/module.h>
+#include <linux/pm.h>
+#include <asm/semaphore.h>
+#include <asm/atomic.h>
+
+#define DEVICE_NAME_SIZE 50
+#define DEVICE_NAME_HALF __stringify(20)  
+#define DEVICE_ID_SIZE 32
+#define BUS_ID_SIZE KOBJ_NAME_LEN
+
+struct device;
+struct device_driver;
+struct class;
+struct class_device;
+
+struct bus_type {
+ const char * name;
+
+ struct subsystem subsys;
+ struct kset drivers;
+ struct kset devices;
+ struct klist klist_devices;
+ struct klist klist_drivers;
+
+ struct bus_attribute * bus_attrs;
+ struct device_attribute * dev_attrs;
+ struct driver_attribute * drv_attrs;
+
+ int (*match)(struct device * dev, struct device_driver * drv);
+ int (*uevent)(struct device *dev, char **envp,
+ int num_envp, char *buffer, int buffer_size);
+ int (*probe)(struct device * dev);
+ int (*remove)(struct device * dev);
+ void (*shutdown)(struct device * dev);
+ int (*suspend)(struct device * dev, pm_message_t state);
+ int (*resume)(struct device * dev);
+};
+
+struct device * bus_find_device(struct bus_type *bus, struct device *start,
+ void *data, int (*match)(struct device *, void *));
+
+struct bus_attribute {
+ struct attribute attr;
+ ssize_t (*show)(struct bus_type *, char * buf);
+ ssize_t (*store)(struct bus_type *, const char * buf, size_t count);
+};
+
+#define BUS_ATTR(_name,_mode,_show,_store)  struct bus_attribute bus_attr_##_name = __ATTR(_name,_mode,_show,_store)
+
+struct device_driver {
+ const char * name;
+ struct bus_type * bus;
+
+ struct completion unloaded;
+ struct kobject kobj;
+ struct klist klist_devices;
+ struct klist_node knode_bus;
+
+ struct module * owner;
+
+ int (*probe) (struct device * dev);
+ int (*remove) (struct device * dev);
+ void (*shutdown) (struct device * dev);
+ int (*suspend) (struct device * dev, pm_message_t state);
+ int (*resume) (struct device * dev);
+};
+
+struct driver_attribute {
+ struct attribute attr;
+ ssize_t (*show)(struct device_driver *, char * buf);
+ ssize_t (*store)(struct device_driver *, const char * buf, size_t count);
+};
+
+#define DRIVER_ATTR(_name,_mode,_show,_store)  struct driver_attribute driver_attr_##_name = __ATTR(_name,_mode,_show,_store)
+
+struct device * driver_find_device(struct device_driver *drv,
+ struct device *start, void *data,
+ int (*match)(struct device *, void *));
+
+struct class {
+ const char * name;
+ struct module * owner;
+
+ struct subsystem subsys;
+ struct list_head children;
+ struct list_head devices;
+ struct list_head interfaces;
+ struct semaphore sem;
+
+ struct class_attribute * class_attrs;
+ struct class_device_attribute * class_dev_attrs;
+
+ int (*uevent)(struct class_device *dev, char **envp,
+ int num_envp, char *buffer, int buffer_size);
+
+ void (*release)(struct class_device *dev);
+ void (*class_release)(struct class *class);
+};
+
+struct class_attribute {
+ struct attribute attr;
+ ssize_t (*show)(struct class *, char * buf);
+ ssize_t (*store)(struct class *, const char * buf, size_t count);
+};
+
+#define CLASS_ATTR(_name,_mode,_show,_store)  struct class_attribute class_attr_##_name = __ATTR(_name,_mode,_show,_store) 
+
+struct class_device_attribute {
+ struct attribute attr;
+ ssize_t (*show)(struct class_device *, char * buf);
+ ssize_t (*store)(struct class_device *, const char * buf, size_t count);
+};
+
+#define CLASS_DEVICE_ATTR(_name,_mode,_show,_store)  struct class_device_attribute class_device_attr_##_name =   __ATTR(_name,_mode,_show,_store)
+
+struct class_device {
+ struct list_head node;
+
+ struct kobject kobj;
+ struct class * class;
+ dev_t devt;
+ struct class_device_attribute *devt_attr;
+ struct class_device_attribute uevent_attr;
+ struct device * dev;
+ void * class_data;
+ struct class_device *parent;
+ struct attribute_group ** groups;
+
+ void (*release)(struct class_device *dev);
+ int (*uevent)(struct class_device *dev, char **envp,
+ int num_envp, char *buffer, int buffer_size);
+ char class_id[BUS_ID_SIZE];
+};
+
+struct class_interface {
+ struct list_head node;
+ struct class *class;
+
+ int (*add) (struct class_device *, struct class_interface *);
+ void (*remove) (struct class_device *, struct class_interface *);
+};
+
+struct device_attribute {
+ struct attribute attr;
+ ssize_t (*show)(struct device *dev, struct device_attribute *attr,
+ char *buf);
+ ssize_t (*store)(struct device *dev, struct device_attribute *attr,
+ const char *buf, size_t count);
+};
+
+#define DEVICE_ATTR(_name,_mode,_show,_store)  struct device_attribute dev_attr_##_name = __ATTR(_name,_mode,_show,_store)
+
+struct device {
+ struct klist klist_children;
+ struct klist_node knode_parent;
+ struct klist_node knode_driver;
+ struct klist_node knode_bus;
+ struct device * parent;
+
+ struct kobject kobj;
+ char bus_id[BUS_ID_SIZE];
+ struct device_attribute uevent_attr;
+ struct device_attribute *devt_attr;
+
+ struct semaphore sem;
+
+ struct bus_type * bus;
+ struct device_driver *driver;
+ void *driver_data;
+ void *platform_data;
+ void *firmware_data;
+ struct dev_pm_info power;
+
+ u64 *dma_mask;
+ u64 coherent_dma_mask;
+
+ struct list_head dma_pools;
+
+ struct dma_coherent_mem *dma_mem;
+
+ struct list_head node;
+ struct class *class;
+ dev_t devt;
+
+ void (*release)(struct device * dev);
+};
+
+#define dev_printk(level, dev, format, arg...)   printk(level "%s %s: " format , dev_driver_string(dev) , (dev)->bus_id , ## arg)
+
+#ifdef DEBUG
+#define dev_dbg(dev, format, arg...)   dev_printk(KERN_DEBUG , dev , format , ## arg)
+#else
+#define dev_dbg(dev, format, arg...) do { (void)(dev); } while (0)
+#endif
+
+#define dev_err(dev, format, arg...)   dev_printk(KERN_ERR , dev , format , ## arg)
+#define dev_info(dev, format, arg...)   dev_printk(KERN_INFO , dev , format , ## arg)
+#define dev_warn(dev, format, arg...)   dev_printk(KERN_WARNING , dev , format , ## arg)
+#define dev_notice(dev, format, arg...)   dev_printk(KERN_NOTICE , dev , format , ## arg)
+
+#define MODULE_ALIAS_CHARDEV(major,minor)   MODULE_ALIAS("char-major-" __stringify(major) "-" __stringify(minor))
+#define MODULE_ALIAS_CHARDEV_MAJOR(major)   MODULE_ALIAS("char-major-" __stringify(major) "-*")
+#endif
diff --git a/ndk/platforms/android-3/include/linux/dirent.h b/ndk/platforms/android-3/include/linux/dirent.h
new file mode 100644
index 0000000..2dace18
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/dirent.h
@@ -0,0 +1,30 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_DIRENT_H
+#define _LINUX_DIRENT_H
+
+struct dirent {
+ long d_ino;
+ __kernel_off_t d_off;
+ unsigned short d_reclen;
+ char d_name[256];
+};
+
+struct dirent64 {
+ __u64 d_ino;
+ __s64 d_off;
+ unsigned short d_reclen;
+ unsigned char d_type;
+ char d_name[256];
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/dm-ioctl.h b/ndk/platforms/android-3/include/linux/dm-ioctl.h
new file mode 100644
index 0000000..ead7744
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/dm-ioctl.h
@@ -0,0 +1,146 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_DM_IOCTL_V4_H
+#define _LINUX_DM_IOCTL_V4_H
+
+#include <linux/types.h>
+
+#define DM_DIR "mapper"  
+#define DM_MAX_TYPE_NAME 16
+#define DM_NAME_LEN 128
+#define DM_UUID_LEN 129
+
+struct dm_ioctl {
+
+ uint32_t version[3];
+ uint32_t data_size;
+
+ uint32_t data_start;
+
+ uint32_t target_count;
+ int32_t open_count;
+ uint32_t flags;
+ uint32_t event_nr;
+ uint32_t padding;
+
+ uint64_t dev;
+
+ char name[DM_NAME_LEN];
+ char uuid[DM_UUID_LEN];
+ char data[7];
+};
+
+struct dm_target_spec {
+ uint64_t sector_start;
+ uint64_t length;
+ int32_t status;
+
+ uint32_t next;
+
+ char target_type[DM_MAX_TYPE_NAME];
+
+};
+
+struct dm_target_deps {
+ uint32_t count;
+ uint32_t padding;
+ uint64_t dev[0];
+};
+
+struct dm_name_list {
+ uint64_t dev;
+ uint32_t next;
+ char name[0];
+};
+
+struct dm_target_versions {
+ uint32_t next;
+ uint32_t version[3];
+
+ char name[0];
+};
+
+struct dm_target_msg {
+ uint64_t sector;
+
+ char message[0];
+};
+
+enum {
+
+ DM_VERSION_CMD = 0,
+ DM_REMOVE_ALL_CMD,
+ DM_LIST_DEVICES_CMD,
+
+ DM_DEV_CREATE_CMD,
+ DM_DEV_REMOVE_CMD,
+ DM_DEV_RENAME_CMD,
+ DM_DEV_SUSPEND_CMD,
+ DM_DEV_STATUS_CMD,
+ DM_DEV_WAIT_CMD,
+
+ DM_TABLE_LOAD_CMD,
+ DM_TABLE_CLEAR_CMD,
+ DM_TABLE_DEPS_CMD,
+ DM_TABLE_STATUS_CMD,
+
+ DM_LIST_VERSIONS_CMD,
+ DM_TARGET_MSG_CMD,
+ DM_DEV_SET_GEOMETRY_CMD
+};
+
+#define DM_IOCTL 0xfd
+
+#define DM_VERSION _IOWR(DM_IOCTL, DM_VERSION_CMD, struct dm_ioctl)
+#define DM_REMOVE_ALL _IOWR(DM_IOCTL, DM_REMOVE_ALL_CMD, struct dm_ioctl)
+#define DM_LIST_DEVICES _IOWR(DM_IOCTL, DM_LIST_DEVICES_CMD, struct dm_ioctl)
+
+#define DM_DEV_CREATE _IOWR(DM_IOCTL, DM_DEV_CREATE_CMD, struct dm_ioctl)
+#define DM_DEV_REMOVE _IOWR(DM_IOCTL, DM_DEV_REMOVE_CMD, struct dm_ioctl)
+#define DM_DEV_RENAME _IOWR(DM_IOCTL, DM_DEV_RENAME_CMD, struct dm_ioctl)
+#define DM_DEV_SUSPEND _IOWR(DM_IOCTL, DM_DEV_SUSPEND_CMD, struct dm_ioctl)
+#define DM_DEV_STATUS _IOWR(DM_IOCTL, DM_DEV_STATUS_CMD, struct dm_ioctl)
+#define DM_DEV_WAIT _IOWR(DM_IOCTL, DM_DEV_WAIT_CMD, struct dm_ioctl)
+
+#define DM_TABLE_LOAD _IOWR(DM_IOCTL, DM_TABLE_LOAD_CMD, struct dm_ioctl)
+#define DM_TABLE_CLEAR _IOWR(DM_IOCTL, DM_TABLE_CLEAR_CMD, struct dm_ioctl)
+#define DM_TABLE_DEPS _IOWR(DM_IOCTL, DM_TABLE_DEPS_CMD, struct dm_ioctl)
+#define DM_TABLE_STATUS _IOWR(DM_IOCTL, DM_TABLE_STATUS_CMD, struct dm_ioctl)
+
+#define DM_LIST_VERSIONS _IOWR(DM_IOCTL, DM_LIST_VERSIONS_CMD, struct dm_ioctl)
+
+#define DM_TARGET_MSG _IOWR(DM_IOCTL, DM_TARGET_MSG_CMD, struct dm_ioctl)
+#define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl)
+
+#define DM_VERSION_MAJOR 4
+#define DM_VERSION_MINOR 14
+#define DM_VERSION_PATCHLEVEL 0
+#define DM_VERSION_EXTRA "-ioctl (2008-04-23)"
+
+#define DM_READONLY_FLAG (1 << 0)  
+#define DM_SUSPEND_FLAG (1 << 1)  
+#define DM_PERSISTENT_DEV_FLAG (1 << 3)  
+
+#define DM_STATUS_TABLE_FLAG (1 << 4)  
+
+#define DM_ACTIVE_PRESENT_FLAG (1 << 5)  
+#define DM_INACTIVE_PRESENT_FLAG (1 << 6)  
+
+#define DM_BUFFER_FULL_FLAG (1 << 8)  
+
+#define DM_SKIP_BDGET_FLAG (1 << 9)  
+
+#define DM_SKIP_LOCKFS_FLAG (1 << 10)  
+
+#define DM_NOFLUSH_FLAG (1 << 11)  
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/dma-mapping.h b/ndk/platforms/android-3/include/linux/dma-mapping.h
new file mode 100644
index 0000000..6432259
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/dma-mapping.h
@@ -0,0 +1,48 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_LINUX_DMA_MAPPING_H
+#define _ASM_LINUX_DMA_MAPPING_H
+
+#include <linux/device.h>
+#include <linux/err.h>
+
+enum dma_data_direction {
+ DMA_BIDIRECTIONAL = 0,
+ DMA_TO_DEVICE = 1,
+ DMA_FROM_DEVICE = 2,
+ DMA_NONE = 3,
+};
+
+#define DMA_64BIT_MASK 0xffffffffffffffffULL
+#define DMA_48BIT_MASK 0x0000ffffffffffffULL
+#define DMA_40BIT_MASK 0x000000ffffffffffULL
+#define DMA_39BIT_MASK 0x0000007fffffffffULL
+#define DMA_32BIT_MASK 0x00000000ffffffffULL
+#define DMA_31BIT_MASK 0x000000007fffffffULL
+#define DMA_30BIT_MASK 0x000000003fffffffULL
+#define DMA_29BIT_MASK 0x000000001fffffffULL
+#define DMA_28BIT_MASK 0x000000000fffffffULL
+#define DMA_24BIT_MASK 0x0000000000ffffffULL
+
+#include <asm/dma-mapping.h>
+
+#define dma_sync_single dma_sync_single_for_cpu
+#define dma_sync_sg dma_sync_sg_for_cpu
+
+#define DMA_MEMORY_MAP 0x01
+#define DMA_MEMORY_IO 0x02
+#define DMA_MEMORY_INCLUDES_CHILDREN 0x04
+#define DMA_MEMORY_EXCLUSIVE 0x08
+
+#ifndef ARCH_HAS_DMA_DECLARE_COHERENT_MEMORY
+#endif
+#endif
diff --git a/ndk/platforms/android-3/include/linux/dmaengine.h b/ndk/platforms/android-3/include/linux/dmaengine.h
new file mode 100644
index 0000000..549fea9
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/dmaengine.h
@@ -0,0 +1,15 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef DMAENGINE_H
+#define DMAENGINE_H
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/efs_dir.h b/ndk/platforms/android-3/include/linux/efs_dir.h
new file mode 100644
index 0000000..5be2762
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/efs_dir.h
@@ -0,0 +1,45 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __EFS_DIR_H__
+#define __EFS_DIR_H__
+
+#define EFS_DIRBSIZE_BITS EFS_BLOCKSIZE_BITS
+#define EFS_DIRBSIZE (1 << EFS_DIRBSIZE_BITS)
+
+struct efs_dentry {
+ __be32 inode;
+ unsigned char namelen;
+ char name[3];
+};
+
+#define EFS_DENTSIZE (sizeof(struct efs_dentry) - 3 + 1)
+#define EFS_MAXNAMELEN ((1 << (sizeof(char) * 8)) - 1)
+
+#define EFS_DIRBLK_HEADERSIZE 4
+#define EFS_DIRBLK_MAGIC 0xbeef  
+
+struct efs_dir {
+ __be16 magic;
+ unsigned char firstused;
+ unsigned char slots;
+
+ unsigned char space[EFS_DIRBSIZE - EFS_DIRBLK_HEADERSIZE];
+};
+
+#define EFS_MAXENTS   ((EFS_DIRBSIZE - EFS_DIRBLK_HEADERSIZE) /   (EFS_DENTSIZE + sizeof(char)))
+
+#define EFS_SLOTAT(dir, slot) EFS_REALOFF((dir)->space[slot])
+
+#define EFS_REALOFF(offset) ((offset << 1))
+
+#endif
+
diff --git a/ndk/platforms/android-3/include/linux/efs_fs_i.h b/ndk/platforms/android-3/include/linux/efs_fs_i.h
new file mode 100644
index 0000000..6d88d28
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/efs_fs_i.h
@@ -0,0 +1,63 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __EFS_FS_I_H__
+#define __EFS_FS_I_H__
+
+typedef int32_t efs_block_t;
+typedef uint32_t efs_ino_t;
+
+#define EFS_DIRECTEXTENTS 12
+
+typedef union extent_u {
+ unsigned char raw[8];
+ struct extent_s {
+ unsigned int ex_magic:8;
+ unsigned int ex_bn:24;
+ unsigned int ex_length:8;
+ unsigned int ex_offset:24;
+ } cooked;
+} efs_extent;
+
+typedef struct edevs {
+ __be16 odev;
+ __be32 ndev;
+} efs_devs;
+
+struct efs_dinode {
+ __be16 di_mode;
+ __be16 di_nlink;
+ __be16 di_uid;
+ __be16 di_gid;
+ __be32 di_size;
+ __be32 di_atime;
+ __be32 di_mtime;
+ __be32 di_ctime;
+ __be32 di_gen;
+ __be16 di_numextents;
+ u_char di_version;
+ u_char di_spare;
+ union di_addr {
+ efs_extent di_extents[EFS_DIRECTEXTENTS];
+ efs_devs di_dev;
+ } di_u;
+};
+
+struct efs_inode_info {
+ int numextents;
+ int lastextent;
+
+ efs_extent extents[EFS_DIRECTEXTENTS];
+ struct inode vfs_inode;
+};
+
+#endif
+
diff --git a/ndk/platforms/android-3/include/linux/efs_fs_sb.h b/ndk/platforms/android-3/include/linux/efs_fs_sb.h
new file mode 100644
index 0000000..f7960c0
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/efs_fs_sb.h
@@ -0,0 +1,61 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __EFS_FS_SB_H__
+#define __EFS_FS_SB_H__
+
+#define EFS_SUPER_MAGIC 0x414A53
+
+#define EFS_MAGIC 0x072959
+#define EFS_NEWMAGIC 0x07295a
+
+#define IS_EFS_MAGIC(x) ((x == EFS_MAGIC) || (x == EFS_NEWMAGIC))
+
+#define EFS_SUPER 1
+#define EFS_ROOTINODE 2
+
+struct efs_super {
+ __be32 fs_size;
+ __be32 fs_firstcg;
+ __be32 fs_cgfsize;
+ __be16 fs_cgisize;
+ __be16 fs_sectors;
+ __be16 fs_heads;
+ __be16 fs_ncg;
+ __be16 fs_dirty;
+ __be32 fs_time;
+ __be32 fs_magic;
+ char fs_fname[6];
+ char fs_fpack[6];
+ __be32 fs_bmsize;
+ __be32 fs_tfree;
+ __be32 fs_tinode;
+ __be32 fs_bmblock;
+ __be32 fs_replsb;
+ __be32 fs_lastialloc;
+ char fs_spare[20];
+ __be32 fs_checksum;
+};
+
+struct efs_sb_info {
+ __u32 fs_magic;
+ __u32 fs_start;
+ __u32 first_block;
+ __u32 total_blocks;
+ __u32 group_size;
+ __u32 data_free;
+ __u32 inode_free;
+ __u16 inode_blocks;
+ __u16 total_groups;
+};
+
+#endif
+
diff --git a/ndk/platforms/android-3/include/linux/elevator.h b/ndk/platforms/android-3/include/linux/elevator.h
new file mode 100644
index 0000000..2e79ce9
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/elevator.h
@@ -0,0 +1,109 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_ELEVATOR_H
+#define _LINUX_ELEVATOR_H
+
+typedef int (elevator_merge_fn) (request_queue_t *, struct request **,
+ struct bio *);
+
+typedef void (elevator_merge_req_fn) (request_queue_t *, struct request *, struct request *);
+
+typedef void (elevator_merged_fn) (request_queue_t *, struct request *);
+
+typedef int (elevator_dispatch_fn) (request_queue_t *, int);
+
+typedef void (elevator_add_req_fn) (request_queue_t *, struct request *);
+typedef int (elevator_queue_empty_fn) (request_queue_t *);
+typedef struct request *(elevator_request_list_fn) (request_queue_t *, struct request *);
+typedef void (elevator_completed_req_fn) (request_queue_t *, struct request *);
+typedef int (elevator_may_queue_fn) (request_queue_t *, int, struct bio *);
+
+typedef int (elevator_set_req_fn) (request_queue_t *, struct request *, struct bio *, gfp_t);
+typedef void (elevator_put_req_fn) (request_queue_t *, struct request *);
+typedef void (elevator_activate_req_fn) (request_queue_t *, struct request *);
+typedef void (elevator_deactivate_req_fn) (request_queue_t *, struct request *);
+
+typedef void *(elevator_init_fn) (request_queue_t *, elevator_t *);
+typedef void (elevator_exit_fn) (elevator_t *);
+
+struct elevator_ops
+{
+ elevator_merge_fn *elevator_merge_fn;
+ elevator_merged_fn *elevator_merged_fn;
+ elevator_merge_req_fn *elevator_merge_req_fn;
+
+ elevator_dispatch_fn *elevator_dispatch_fn;
+ elevator_add_req_fn *elevator_add_req_fn;
+ elevator_activate_req_fn *elevator_activate_req_fn;
+ elevator_deactivate_req_fn *elevator_deactivate_req_fn;
+
+ elevator_queue_empty_fn *elevator_queue_empty_fn;
+ elevator_completed_req_fn *elevator_completed_req_fn;
+
+ elevator_request_list_fn *elevator_former_req_fn;
+ elevator_request_list_fn *elevator_latter_req_fn;
+
+ elevator_set_req_fn *elevator_set_req_fn;
+ elevator_put_req_fn *elevator_put_req_fn;
+
+ elevator_may_queue_fn *elevator_may_queue_fn;
+
+ elevator_init_fn *elevator_init_fn;
+ elevator_exit_fn *elevator_exit_fn;
+ void (*trim)(struct io_context *);
+};
+
+#define ELV_NAME_MAX (16)
+
+struct elv_fs_entry {
+ struct attribute attr;
+ ssize_t (*show)(elevator_t *, char *);
+ ssize_t (*store)(elevator_t *, const char *, size_t);
+};
+
+struct elevator_type
+{
+ struct list_head list;
+ struct elevator_ops ops;
+ struct elevator_type *elevator_type;
+ struct elv_fs_entry *elevator_attrs;
+ char elevator_name[ELV_NAME_MAX];
+ struct module *elevator_owner;
+};
+
+struct elevator_queue
+{
+ struct elevator_ops *ops;
+ void *elevator_data;
+ struct kobject kobj;
+ struct elevator_type *elevator_type;
+ struct mutex sysfs_lock;
+};
+
+#define ELEVATOR_NO_MERGE 0
+#define ELEVATOR_FRONT_MERGE 1
+#define ELEVATOR_BACK_MERGE 2
+
+#define ELEVATOR_INSERT_FRONT 1
+#define ELEVATOR_INSERT_BACK 2
+#define ELEVATOR_INSERT_SORT 3
+#define ELEVATOR_INSERT_REQUEUE 4
+
+enum {
+ ELV_MQUEUE_MAY,
+ ELV_MQUEUE_NO,
+ ELV_MQUEUE_MUST,
+};
+
+#define rq_end_sector(rq) ((rq)->sector + (rq)->nr_sectors)
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/elf-em.h b/ndk/platforms/android-3/include/linux/elf-em.h
new file mode 100644
index 0000000..e151fdf
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/elf-em.h
@@ -0,0 +1,51 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_ELF_EM_H
+#define _LINUX_ELF_EM_H
+
+#define EM_NONE 0
+#define EM_M32 1
+#define EM_SPARC 2
+#define EM_386 3
+#define EM_68K 4
+#define EM_88K 5
+#define EM_486 6  
+#define EM_860 7
+#define EM_MIPS 8  
+
+#define EM_MIPS_RS3_LE 10  
+#define EM_MIPS_RS4_BE 10  
+
+#define EM_PARISC 15  
+#define EM_SPARC32PLUS 18  
+#define EM_PPC 20  
+#define EM_PPC64 21  
+#define EM_SH 42  
+#define EM_SPARCV9 43  
+#define EM_IA_64 50  
+#define EM_X86_64 62  
+#define EM_S390 22  
+#define EM_CRIS 76  
+#define EM_V850 87  
+#define EM_M32R 88  
+#define EM_H8_300 46  
+#define EM_FRV 0x5441  
+
+#define EM_ALPHA 0x9026
+
+#define EM_CYGNUS_V850 0x9080
+
+#define EM_CYGNUS_M32R 0x9041
+
+#define EM_S390_OLD 0xA390
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/elf.h b/ndk/platforms/android-3/include/linux/elf.h
new file mode 100644
index 0000000..f16b439
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/elf.h
@@ -0,0 +1,361 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_ELF_H
+#define _LINUX_ELF_H
+
+#include <linux/types.h>
+#include <linux/auxvec.h>
+#include <linux/elf-em.h>
+#include <asm/elf.h>
+
+#ifndef elf_read_implies_exec
+
+#define elf_read_implies_exec(ex, have_pt_gnu_stack) 0
+#endif
+
+typedef __u32 Elf32_Addr;
+typedef __u16 Elf32_Half;
+typedef __u32 Elf32_Off;
+typedef __s32 Elf32_Sword;
+typedef __u32 Elf32_Word;
+
+typedef __u64 Elf64_Addr;
+typedef __u16 Elf64_Half;
+typedef __s16 Elf64_SHalf;
+typedef __u64 Elf64_Off;
+typedef __s32 Elf64_Sword;
+typedef __u32 Elf64_Word;
+typedef __u64 Elf64_Xword;
+typedef __s64 Elf64_Sxword;
+
+#define PT_NULL 0
+#define PT_LOAD 1
+#define PT_DYNAMIC 2
+#define PT_INTERP 3
+#define PT_NOTE 4
+#define PT_SHLIB 5
+#define PT_PHDR 6
+#define PT_TLS 7  
+#define PT_LOOS 0x60000000  
+#define PT_HIOS 0x6fffffff  
+#define PT_LOPROC 0x70000000
+#define PT_HIPROC 0x7fffffff
+#define PT_GNU_EH_FRAME 0x6474e550
+
+#define PT_GNU_STACK (PT_LOOS + 0x474e551)
+
+#define ET_NONE 0
+#define ET_REL 1
+#define ET_EXEC 2
+#define ET_DYN 3
+#define ET_CORE 4
+#define ET_LOPROC 0xff00
+#define ET_HIPROC 0xffff
+
+#define DT_NULL 0
+#define DT_NEEDED 1
+#define DT_PLTRELSZ 2
+#define DT_PLTGOT 3
+#define DT_HASH 4
+#define DT_STRTAB 5
+#define DT_SYMTAB 6
+#define DT_RELA 7
+#define DT_RELASZ 8
+#define DT_RELAENT 9
+#define DT_STRSZ 10
+#define DT_SYMENT 11
+#define DT_INIT 12
+#define DT_FINI 13
+#define DT_SONAME 14
+#define DT_RPATH 15
+#define DT_SYMBOLIC 16
+#define DT_REL 17
+#define DT_RELSZ 18
+#define DT_RELENT 19
+#define DT_PLTREL 20
+#define DT_DEBUG 21
+#define DT_TEXTREL 22
+#define DT_JMPREL 23
+#define DT_LOPROC 0x70000000
+#define DT_HIPROC 0x7fffffff
+
+#define STB_LOCAL 0
+#define STB_GLOBAL 1
+#define STB_WEAK 2
+
+#define STT_NOTYPE 0
+#define STT_OBJECT 1
+#define STT_FUNC 2
+#define STT_SECTION 3
+#define STT_FILE 4
+#define STT_COMMON 5
+#define STT_TLS 6
+
+#define ELF_ST_BIND(x) ((x) >> 4)
+#define ELF_ST_TYPE(x) (((unsigned int) x) & 0xf)
+#define ELF32_ST_BIND(x) ELF_ST_BIND(x)
+#define ELF32_ST_TYPE(x) ELF_ST_TYPE(x)
+#define ELF64_ST_BIND(x) ELF_ST_BIND(x)
+#define ELF64_ST_TYPE(x) ELF_ST_TYPE(x)
+
+typedef struct dynamic{
+ Elf32_Sword d_tag;
+ union{
+ Elf32_Sword d_val;
+ Elf32_Addr d_ptr;
+ } d_un;
+} Elf32_Dyn;
+
+typedef struct {
+ Elf64_Sxword d_tag;
+ union {
+ Elf64_Xword d_val;
+ Elf64_Addr d_ptr;
+ } d_un;
+} Elf64_Dyn;
+
+#define ELF32_R_SYM(x) ((x) >> 8)
+#define ELF32_R_TYPE(x) ((x) & 0xff)
+
+#define ELF64_R_SYM(i) ((i) >> 32)
+#define ELF64_R_TYPE(i) ((i) & 0xffffffff)
+
+typedef struct elf32_rel {
+ Elf32_Addr r_offset;
+ Elf32_Word r_info;
+} Elf32_Rel;
+
+typedef struct elf64_rel {
+ Elf64_Addr r_offset;
+ Elf64_Xword r_info;
+} Elf64_Rel;
+
+typedef struct elf32_rela{
+ Elf32_Addr r_offset;
+ Elf32_Word r_info;
+ Elf32_Sword r_addend;
+} Elf32_Rela;
+
+typedef struct elf64_rela {
+ Elf64_Addr r_offset;
+ Elf64_Xword r_info;
+ Elf64_Sxword r_addend;
+} Elf64_Rela;
+
+typedef struct elf32_sym{
+ Elf32_Word st_name;
+ Elf32_Addr st_value;
+ Elf32_Word st_size;
+ unsigned char st_info;
+ unsigned char st_other;
+ Elf32_Half st_shndx;
+} Elf32_Sym;
+
+typedef struct elf64_sym {
+ Elf64_Word st_name;
+ unsigned char st_info;
+ unsigned char st_other;
+ Elf64_Half st_shndx;
+ Elf64_Addr st_value;
+ Elf64_Xword st_size;
+} Elf64_Sym;
+
+#define EI_NIDENT 16
+
+typedef struct elf32_hdr{
+ unsigned char e_ident[EI_NIDENT];
+ Elf32_Half e_type;
+ Elf32_Half e_machine;
+ Elf32_Word e_version;
+ Elf32_Addr e_entry;
+ Elf32_Off e_phoff;
+ Elf32_Off e_shoff;
+ Elf32_Word e_flags;
+ Elf32_Half e_ehsize;
+ Elf32_Half e_phentsize;
+ Elf32_Half e_phnum;
+ Elf32_Half e_shentsize;
+ Elf32_Half e_shnum;
+ Elf32_Half e_shstrndx;
+} Elf32_Ehdr;
+
+typedef struct elf64_hdr {
+ unsigned char e_ident[16];
+ Elf64_Half e_type;
+ Elf64_Half e_machine;
+ Elf64_Word e_version;
+ Elf64_Addr e_entry;
+ Elf64_Off e_phoff;
+ Elf64_Off e_shoff;
+ Elf64_Word e_flags;
+ Elf64_Half e_ehsize;
+ Elf64_Half e_phentsize;
+ Elf64_Half e_phnum;
+ Elf64_Half e_shentsize;
+ Elf64_Half e_shnum;
+ Elf64_Half e_shstrndx;
+} Elf64_Ehdr;
+
+#define PF_R 0x4
+#define PF_W 0x2
+#define PF_X 0x1
+
+typedef struct elf32_phdr{
+ Elf32_Word p_type;
+ Elf32_Off p_offset;
+ Elf32_Addr p_vaddr;
+ Elf32_Addr p_paddr;
+ Elf32_Word p_filesz;
+ Elf32_Word p_memsz;
+ Elf32_Word p_flags;
+ Elf32_Word p_align;
+} Elf32_Phdr;
+
+typedef struct elf64_phdr {
+ Elf64_Word p_type;
+ Elf64_Word p_flags;
+ Elf64_Off p_offset;
+ Elf64_Addr p_vaddr;
+ Elf64_Addr p_paddr;
+ Elf64_Xword p_filesz;
+ Elf64_Xword p_memsz;
+ Elf64_Xword p_align;
+} Elf64_Phdr;
+
+#define SHT_NULL 0
+#define SHT_PROGBITS 1
+#define SHT_SYMTAB 2
+#define SHT_STRTAB 3
+#define SHT_RELA 4
+#define SHT_HASH 5
+#define SHT_DYNAMIC 6
+#define SHT_NOTE 7
+#define SHT_NOBITS 8
+#define SHT_REL 9
+#define SHT_SHLIB 10
+#define SHT_DYNSYM 11
+#define SHT_NUM 12
+#define SHT_LOPROC 0x70000000
+#define SHT_HIPROC 0x7fffffff
+#define SHT_LOUSER 0x80000000
+#define SHT_HIUSER 0xffffffff
+
+#define SHF_WRITE 0x1
+#define SHF_ALLOC 0x2
+#define SHF_EXECINSTR 0x4
+#define SHF_MASKPROC 0xf0000000
+
+#define SHN_UNDEF 0
+#define SHN_LORESERVE 0xff00
+#define SHN_LOPROC 0xff00
+#define SHN_HIPROC 0xff1f
+#define SHN_ABS 0xfff1
+#define SHN_COMMON 0xfff2
+#define SHN_HIRESERVE 0xffff
+
+typedef struct {
+ Elf32_Word sh_name;
+ Elf32_Word sh_type;
+ Elf32_Word sh_flags;
+ Elf32_Addr sh_addr;
+ Elf32_Off sh_offset;
+ Elf32_Word sh_size;
+ Elf32_Word sh_link;
+ Elf32_Word sh_info;
+ Elf32_Word sh_addralign;
+ Elf32_Word sh_entsize;
+} Elf32_Shdr;
+
+typedef struct elf64_shdr {
+ Elf64_Word sh_name;
+ Elf64_Word sh_type;
+ Elf64_Xword sh_flags;
+ Elf64_Addr sh_addr;
+ Elf64_Off sh_offset;
+ Elf64_Xword sh_size;
+ Elf64_Word sh_link;
+ Elf64_Word sh_info;
+ Elf64_Xword sh_addralign;
+ Elf64_Xword sh_entsize;
+} Elf64_Shdr;
+
+#define EI_MAG0 0  
+#define EI_MAG1 1
+#define EI_MAG2 2
+#define EI_MAG3 3
+#define EI_CLASS 4
+#define EI_DATA 5
+#define EI_VERSION 6
+#define EI_OSABI 7
+#define EI_PAD 8
+
+#define ELFMAG0 0x7f  
+#define ELFMAG1 'E'
+#define ELFMAG2 'L'
+#define ELFMAG3 'F'
+#define ELFMAG "\177ELF"
+#define SELFMAG 4
+
+#define ELFCLASSNONE 0  
+#define ELFCLASS32 1
+#define ELFCLASS64 2
+#define ELFCLASSNUM 3
+
+#define ELFDATANONE 0  
+#define ELFDATA2LSB 1
+#define ELFDATA2MSB 2
+
+#define EV_NONE 0  
+#define EV_CURRENT 1
+#define EV_NUM 2
+
+#define ELFOSABI_NONE 0
+#define ELFOSABI_LINUX 3
+
+#ifndef ELF_OSABI
+#define ELF_OSABI ELFOSABI_NONE
+#endif
+
+#define NT_PRSTATUS 1
+#define NT_PRFPREG 2
+#define NT_PRPSINFO 3
+#define NT_TASKSTRUCT 4
+#define NT_AUXV 6
+#define NT_PRXFPREG 0x46e62b7f  
+
+typedef struct elf32_note {
+ Elf32_Word n_namesz;
+ Elf32_Word n_descsz;
+ Elf32_Word n_type;
+} Elf32_Nhdr;
+
+typedef struct elf64_note {
+ Elf64_Word n_namesz;
+ Elf64_Word n_descsz;
+ Elf64_Word n_type;
+} Elf64_Nhdr;
+
+#if ELF_CLASS == ELFCLASS32
+
+#define elfhdr elf32_hdr
+#define elf_phdr elf32_phdr
+#define elf_note elf32_note
+
+#else
+
+#define elfhdr elf64_hdr
+#define elf_phdr elf64_phdr
+#define elf_note elf64_note
+
+#endif
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/err.h b/ndk/platforms/android-3/include/linux/err.h
new file mode 100644
index 0000000..1aa4f9b
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/err.h
@@ -0,0 +1,23 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_ERR_H
+#define _LINUX_ERR_H
+
+#include <linux/compiler.h>
+
+#include <asm/errno.h>
+
+#define MAX_ERRNO 4095
+
+#define IS_ERR_VALUE(x) unlikely((x) >= (unsigned long)-MAX_ERRNO)
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/errno.h b/ndk/platforms/android-3/include/linux/errno.h
new file mode 100644
index 0000000..72ee642
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/errno.h
@@ -0,0 +1,17 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_ERRNO_H
+#define _LINUX_ERRNO_H
+
+#include <asm/errno.h>
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/errqueue.h b/ndk/platforms/android-3/include/linux/errqueue.h
new file mode 100644
index 0000000..03b2e42
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/errqueue.h
@@ -0,0 +1,33 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_ERRQUEUE_H
+#define _LINUX_ERRQUEUE_H 1
+
+struct sock_extended_err
+{
+ __u32 ee_errno;
+ __u8 ee_origin;
+ __u8 ee_type;
+ __u8 ee_code;
+ __u8 ee_pad;
+ __u32 ee_info;
+ __u32 ee_data;
+};
+
+#define SO_EE_ORIGIN_NONE 0
+#define SO_EE_ORIGIN_LOCAL 1
+#define SO_EE_ORIGIN_ICMP 2
+#define SO_EE_ORIGIN_ICMP6 3
+
+#define SO_EE_OFFENDER(ee) ((struct sockaddr*)((ee)+1))
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/etherdevice.h b/ndk/platforms/android-3/include/linux/etherdevice.h
new file mode 100644
index 0000000..d087e8f
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/etherdevice.h
@@ -0,0 +1,19 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_ETHERDEVICE_H
+#define _LINUX_ETHERDEVICE_H
+
+#include <linux/if_ether.h>
+#include <linux/netdevice.h>
+#include <linux/random.h>
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/ext2_fs.h b/ndk/platforms/android-3/include/linux/ext2_fs.h
new file mode 100644
index 0000000..c21b09a
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/ext2_fs.h
@@ -0,0 +1,378 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_EXT2_FS_H
+#define _LINUX_EXT2_FS_H
+
+#include <linux/types.h>
+
+#undef EXT2FS_DEBUG
+
+#define EXT2_PREALLOCATE
+#define EXT2_DEFAULT_PREALLOC_BLOCKS 8
+
+#define EXT2FS_DATE "95/08/09"
+#define EXT2FS_VERSION "0.5b"
+
+#ifdef EXT2FS_DEBUG
+#define ext2_debug(f, a...) {   printk ("EXT2-fs DEBUG (%s, %d): %s:",   __FILE__, __LINE__, __FUNCTION__);   printk (f, ## a);   }
+#else
+#define ext2_debug(f, a...)  
+#endif
+
+#define EXT2_BAD_INO 1  
+#define EXT2_ROOT_INO 2  
+#define EXT2_BOOT_LOADER_INO 5  
+#define EXT2_UNDEL_DIR_INO 6  
+
+#define EXT2_GOOD_OLD_FIRST_INO 11
+
+#define EXT2_SUPER_MAGIC 0xEF53
+
+#define EXT2_SB(sb) (sb)
+
+#define EXT2_LINK_MAX 32000
+
+#define EXT2_MIN_BLOCK_SIZE 1024
+#define EXT2_MAX_BLOCK_SIZE 4096
+#define EXT2_MIN_BLOCK_LOG_SIZE 10
+#define EXT2_BLOCK_SIZE(s) (EXT2_MIN_BLOCK_SIZE << (s)->s_log_block_size)
+#define EXT2_ADDR_PER_BLOCK(s) (EXT2_BLOCK_SIZE(s) / sizeof (__u32))
+#define EXT2_BLOCK_SIZE_BITS(s) ((s)->s_log_block_size + 10)
+#define EXT2_INODE_SIZE(s) (((s)->s_rev_level == EXT2_GOOD_OLD_REV) ?   EXT2_GOOD_OLD_INODE_SIZE :   (s)->s_inode_size)
+#define EXT2_FIRST_INO(s) (((s)->s_rev_level == EXT2_GOOD_OLD_REV) ?   EXT2_GOOD_OLD_FIRST_INO :   (s)->s_first_ino)
+
+#define EXT2_MIN_FRAG_SIZE 1024
+#define EXT2_MAX_FRAG_SIZE 4096
+#define EXT2_MIN_FRAG_LOG_SIZE 10
+#define EXT2_FRAG_SIZE(s) (EXT2_MIN_FRAG_SIZE << (s)->s_log_frag_size)
+#define EXT2_FRAGS_PER_BLOCK(s) (EXT2_BLOCK_SIZE(s) / EXT2_FRAG_SIZE(s))
+
+struct ext2_group_desc
+{
+ __le32 bg_block_bitmap;
+ __le32 bg_inode_bitmap;
+ __le32 bg_inode_table;
+ __le16 bg_free_blocks_count;
+ __le16 bg_free_inodes_count;
+ __le16 bg_used_dirs_count;
+ __le16 bg_pad;
+ __le32 bg_reserved[3];
+};
+
+#define EXT2_BLOCKS_PER_GROUP(s) ((s)->s_blocks_per_group)
+#define EXT2_DESC_PER_BLOCK(s) (EXT2_BLOCK_SIZE(s) / sizeof (struct ext2_group_desc))
+#define EXT2_INODES_PER_GROUP(s) ((s)->s_inodes_per_group)
+
+#define EXT2_NDIR_BLOCKS 12
+#define EXT2_IND_BLOCK EXT2_NDIR_BLOCKS
+#define EXT2_DIND_BLOCK (EXT2_IND_BLOCK + 1)
+#define EXT2_TIND_BLOCK (EXT2_DIND_BLOCK + 1)
+#define EXT2_N_BLOCKS (EXT2_TIND_BLOCK + 1)
+
+#define EXT2_SECRM_FL 0x00000001  
+#define EXT2_UNRM_FL 0x00000002  
+#define EXT2_COMPR_FL 0x00000004  
+#define EXT2_SYNC_FL 0x00000008  
+#define EXT2_IMMUTABLE_FL 0x00000010  
+#define EXT2_APPEND_FL 0x00000020  
+#define EXT2_NODUMP_FL 0x00000040  
+#define EXT2_NOATIME_FL 0x00000080  
+
+#define EXT2_DIRTY_FL 0x00000100
+#define EXT2_COMPRBLK_FL 0x00000200  
+#define EXT2_NOCOMP_FL 0x00000400  
+#define EXT2_ECOMPR_FL 0x00000800  
+
+#define EXT2_BTREE_FL 0x00001000  
+#define EXT2_INDEX_FL 0x00001000  
+#define EXT2_IMAGIC_FL 0x00002000  
+#define EXT2_JOURNAL_DATA_FL 0x00004000  
+#define EXT2_NOTAIL_FL 0x00008000  
+#define EXT2_DIRSYNC_FL 0x00010000  
+#define EXT2_TOPDIR_FL 0x00020000  
+#define EXT2_RESERVED_FL 0x80000000  
+
+#define EXT2_FL_USER_VISIBLE 0x0003DFFF  
+#define EXT2_FL_USER_MODIFIABLE 0x000380FF  
+
+#define EXT2_IOC_GETFLAGS _IOR('f', 1, long)
+#define EXT2_IOC_SETFLAGS _IOW('f', 2, long)
+#define EXT2_IOC_GETVERSION _IOR('v', 1, long)
+#define EXT2_IOC_SETVERSION _IOW('v', 2, long)
+
+struct ext2_inode {
+ __le16 i_mode;
+ __le16 i_uid;
+ __le32 i_size;
+ __le32 i_atime;
+ __le32 i_ctime;
+ __le32 i_mtime;
+ __le32 i_dtime;
+ __le16 i_gid;
+ __le16 i_links_count;
+ __le32 i_blocks;
+ __le32 i_flags;
+ union {
+ struct {
+ __le32 l_i_reserved1;
+ } linux1;
+ struct {
+ __le32 h_i_translator;
+ } hurd1;
+ struct {
+ __le32 m_i_reserved1;
+ } masix1;
+ } osd1;
+ __le32 i_block[EXT2_N_BLOCKS];
+ __le32 i_generation;
+ __le32 i_file_acl;
+ __le32 i_dir_acl;
+ __le32 i_faddr;
+ union {
+ struct {
+ __u8 l_i_frag;
+ __u8 l_i_fsize;
+ __u16 i_pad1;
+ __le16 l_i_uid_high;
+ __le16 l_i_gid_high;
+ __u32 l_i_reserved2;
+ } linux2;
+ struct {
+ __u8 h_i_frag;
+ __u8 h_i_fsize;
+ __le16 h_i_mode_high;
+ __le16 h_i_uid_high;
+ __le16 h_i_gid_high;
+ __le32 h_i_author;
+ } hurd2;
+ struct {
+ __u8 m_i_frag;
+ __u8 m_i_fsize;
+ __u16 m_pad1;
+ __u32 m_i_reserved2[2];
+ } masix2;
+ } osd2;
+};
+
+#define i_size_high i_dir_acl
+
+#ifdef __linux__
+#define i_reserved1 osd1.linux1.l_i_reserved1
+#define i_frag osd2.linux2.l_i_frag
+#define i_fsize osd2.linux2.l_i_fsize
+#define i_uid_low i_uid
+#define i_gid_low i_gid
+#define i_uid_high osd2.linux2.l_i_uid_high
+#define i_gid_high osd2.linux2.l_i_gid_high
+#define i_reserved2 osd2.linux2.l_i_reserved2
+#endif
+
+#ifdef __hurd__
+#define i_translator osd1.hurd1.h_i_translator
+#define i_frag osd2.hurd2.h_i_frag;
+#define i_fsize osd2.hurd2.h_i_fsize;
+#define i_uid_high osd2.hurd2.h_i_uid_high
+#define i_gid_high osd2.hurd2.h_i_gid_high
+#define i_author osd2.hurd2.h_i_author
+#endif
+
+#ifdef __masix__
+#define i_reserved1 osd1.masix1.m_i_reserved1
+#define i_frag osd2.masix2.m_i_frag
+#define i_fsize osd2.masix2.m_i_fsize
+#define i_reserved2 osd2.masix2.m_i_reserved2
+#endif
+
+#define EXT2_VALID_FS 0x0001  
+#define EXT2_ERROR_FS 0x0002  
+
+#define EXT2_MOUNT_CHECK 0x000001  
+#define EXT2_MOUNT_OLDALLOC 0x000002  
+#define EXT2_MOUNT_GRPID 0x000004  
+#define EXT2_MOUNT_DEBUG 0x000008  
+#define EXT2_MOUNT_ERRORS_CONT 0x000010  
+#define EXT2_MOUNT_ERRORS_RO 0x000020  
+#define EXT2_MOUNT_ERRORS_PANIC 0x000040  
+#define EXT2_MOUNT_MINIX_DF 0x000080  
+#define EXT2_MOUNT_NOBH 0x000100  
+#define EXT2_MOUNT_NO_UID32 0x000200  
+#define EXT2_MOUNT_XATTR_USER 0x004000  
+#define EXT2_MOUNT_POSIX_ACL 0x008000  
+#define EXT2_MOUNT_XIP 0x010000  
+#define EXT2_MOUNT_USRQUOTA 0x020000  
+#define EXT2_MOUNT_GRPQUOTA 0x040000  
+
+#define clear_opt(o, opt) o &= ~EXT2_MOUNT_##opt
+#define set_opt(o, opt) o |= EXT2_MOUNT_##opt
+#define test_opt(sb, opt) (EXT2_SB(sb)->s_mount_opt &   EXT2_MOUNT_##opt)
+
+#define EXT2_DFL_MAX_MNT_COUNT 20  
+#define EXT2_DFL_CHECKINTERVAL 0  
+
+#define EXT2_ERRORS_CONTINUE 1  
+#define EXT2_ERRORS_RO 2  
+#define EXT2_ERRORS_PANIC 3  
+#define EXT2_ERRORS_DEFAULT EXT2_ERRORS_CONTINUE
+
+struct ext2_super_block {
+ __le32 s_inodes_count;
+ __le32 s_blocks_count;
+ __le32 s_r_blocks_count;
+ __le32 s_free_blocks_count;
+ __le32 s_free_inodes_count;
+ __le32 s_first_data_block;
+ __le32 s_log_block_size;
+ __le32 s_log_frag_size;
+ __le32 s_blocks_per_group;
+ __le32 s_frags_per_group;
+ __le32 s_inodes_per_group;
+ __le32 s_mtime;
+ __le32 s_wtime;
+ __le16 s_mnt_count;
+ __le16 s_max_mnt_count;
+ __le16 s_magic;
+ __le16 s_state;
+ __le16 s_errors;
+ __le16 s_minor_rev_level;
+ __le32 s_lastcheck;
+ __le32 s_checkinterval;
+ __le32 s_creator_os;
+ __le32 s_rev_level;
+ __le16 s_def_resuid;
+ __le16 s_def_resgid;
+
+ __le32 s_first_ino;
+ __le16 s_inode_size;
+ __le16 s_block_group_nr;
+ __le32 s_feature_compat;
+ __le32 s_feature_incompat;
+ __le32 s_feature_ro_compat;
+ __u8 s_uuid[16];
+ char s_volume_name[16];
+ char s_last_mounted[64];
+ __le32 s_algorithm_usage_bitmap;
+
+ __u8 s_prealloc_blocks;
+ __u8 s_prealloc_dir_blocks;
+ __u16 s_padding1;
+
+ __u8 s_journal_uuid[16];
+ __u32 s_journal_inum;
+ __u32 s_journal_dev;
+ __u32 s_last_orphan;
+ __u32 s_hash_seed[4];
+ __u8 s_def_hash_version;
+ __u8 s_reserved_char_pad;
+ __u16 s_reserved_word_pad;
+ __le32 s_default_mount_opts;
+ __le32 s_first_meta_bg;
+ __u32 s_reserved[190];
+};
+
+#define EXT2_OS_LINUX 0
+#define EXT2_OS_HURD 1
+#define EXT2_OS_MASIX 2
+#define EXT2_OS_FREEBSD 3
+#define EXT2_OS_LITES 4
+
+#define EXT2_GOOD_OLD_REV 0  
+#define EXT2_DYNAMIC_REV 1  
+
+#define EXT2_CURRENT_REV EXT2_GOOD_OLD_REV
+#define EXT2_MAX_SUPP_REV EXT2_DYNAMIC_REV
+
+#define EXT2_GOOD_OLD_INODE_SIZE 128
+
+#define EXT2_HAS_COMPAT_FEATURE(sb,mask)   ( EXT2_SB(sb)->s_es->s_feature_compat & cpu_to_le32(mask) )
+#define EXT2_HAS_RO_COMPAT_FEATURE(sb,mask)   ( EXT2_SB(sb)->s_es->s_feature_ro_compat & cpu_to_le32(mask) )
+#define EXT2_HAS_INCOMPAT_FEATURE(sb,mask)   ( EXT2_SB(sb)->s_es->s_feature_incompat & cpu_to_le32(mask) )
+#define EXT2_SET_COMPAT_FEATURE(sb,mask)   EXT2_SB(sb)->s_es->s_feature_compat |= cpu_to_le32(mask)
+#define EXT2_SET_RO_COMPAT_FEATURE(sb,mask)   EXT2_SB(sb)->s_es->s_feature_ro_compat |= cpu_to_le32(mask)
+#define EXT2_SET_INCOMPAT_FEATURE(sb,mask)   EXT2_SB(sb)->s_es->s_feature_incompat |= cpu_to_le32(mask)
+#define EXT2_CLEAR_COMPAT_FEATURE(sb,mask)   EXT2_SB(sb)->s_es->s_feature_compat &= ~cpu_to_le32(mask)
+#define EXT2_CLEAR_RO_COMPAT_FEATURE(sb,mask)   EXT2_SB(sb)->s_es->s_feature_ro_compat &= ~cpu_to_le32(mask)
+#define EXT2_CLEAR_INCOMPAT_FEATURE(sb,mask)   EXT2_SB(sb)->s_es->s_feature_incompat &= ~cpu_to_le32(mask)
+
+#define EXT2_FEATURE_COMPAT_DIR_PREALLOC 0x0001
+#define EXT2_FEATURE_COMPAT_IMAGIC_INODES 0x0002
+#define EXT3_FEATURE_COMPAT_HAS_JOURNAL 0x0004
+#define EXT2_FEATURE_COMPAT_EXT_ATTR 0x0008
+#define EXT2_FEATURE_COMPAT_RESIZE_INO 0x0010
+#define EXT2_FEATURE_COMPAT_DIR_INDEX 0x0020
+#define EXT2_FEATURE_COMPAT_ANY 0xffffffff
+
+#define EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER 0x0001
+#define EXT2_FEATURE_RO_COMPAT_LARGE_FILE 0x0002
+#define EXT2_FEATURE_RO_COMPAT_BTREE_DIR 0x0004
+#define EXT2_FEATURE_RO_COMPAT_ANY 0xffffffff
+
+#define EXT2_FEATURE_INCOMPAT_COMPRESSION 0x0001
+#define EXT2_FEATURE_INCOMPAT_FILETYPE 0x0002
+#define EXT3_FEATURE_INCOMPAT_RECOVER 0x0004
+#define EXT3_FEATURE_INCOMPAT_JOURNAL_DEV 0x0008
+#define EXT2_FEATURE_INCOMPAT_META_BG 0x0010
+#define EXT2_FEATURE_INCOMPAT_ANY 0xffffffff
+
+#define EXT2_FEATURE_COMPAT_SUPP EXT2_FEATURE_COMPAT_EXT_ATTR
+#define EXT2_FEATURE_INCOMPAT_SUPP (EXT2_FEATURE_INCOMPAT_FILETYPE|   EXT2_FEATURE_INCOMPAT_META_BG)
+#define EXT2_FEATURE_RO_COMPAT_SUPP (EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER|   EXT2_FEATURE_RO_COMPAT_LARGE_FILE|   EXT2_FEATURE_RO_COMPAT_BTREE_DIR)
+#define EXT2_FEATURE_RO_COMPAT_UNSUPPORTED ~EXT2_FEATURE_RO_COMPAT_SUPP
+#define EXT2_FEATURE_INCOMPAT_UNSUPPORTED ~EXT2_FEATURE_INCOMPAT_SUPP
+
+#define EXT2_DEF_RESUID 0
+#define EXT2_DEF_RESGID 0
+
+#define EXT2_DEFM_DEBUG 0x0001
+#define EXT2_DEFM_BSDGROUPS 0x0002
+#define EXT2_DEFM_XATTR_USER 0x0004
+#define EXT2_DEFM_ACL 0x0008
+#define EXT2_DEFM_UID16 0x0010
+
+#define EXT3_DEFM_JMODE 0x0060 
+#define EXT3_DEFM_JMODE_DATA 0x0020
+#define EXT3_DEFM_JMODE_ORDERED 0x0040
+#define EXT3_DEFM_JMODE_WBACK 0x0060
+
+#define EXT2_NAME_LEN 255
+
+struct ext2_dir_entry {
+ __le32 inode;
+ __le16 rec_len;
+ __le16 name_len;
+ char name[EXT2_NAME_LEN];
+};
+
+struct ext2_dir_entry_2 {
+ __le32 inode;
+ __le16 rec_len;
+ __u8 name_len;
+ __u8 file_type;
+ char name[EXT2_NAME_LEN];
+};
+
+enum {
+ EXT2_FT_UNKNOWN,
+ EXT2_FT_REG_FILE,
+ EXT2_FT_DIR,
+ EXT2_FT_CHRDEV,
+ EXT2_FT_BLKDEV,
+ EXT2_FT_FIFO,
+ EXT2_FT_SOCK,
+ EXT2_FT_SYMLINK,
+ EXT2_FT_MAX
+};
+
+#define EXT2_DIR_PAD 4
+#define EXT2_DIR_ROUND (EXT2_DIR_PAD - 1)
+#define EXT2_DIR_REC_LEN(name_len) (((name_len) + 8 + EXT2_DIR_ROUND) &   ~EXT2_DIR_ROUND)
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/ext3_fs.h b/ndk/platforms/android-3/include/linux/ext3_fs.h
new file mode 100644
index 0000000..8016fd1
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/ext3_fs.h
@@ -0,0 +1,448 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_EXT3_FS_H
+#define _LINUX_EXT3_FS_H
+
+#include <linux/types.h>
+
+#undef EXT3FS_DEBUG
+
+#define EXT3_DEFAULT_RESERVE_BLOCKS 8
+
+#define EXT3_MAX_RESERVE_BLOCKS 1027
+#define EXT3_RESERVE_WINDOW_NOT_ALLOCATED 0
+
+#define CONFIG_EXT3_INDEX
+
+#ifdef EXT3FS_DEBUG
+#define ext3_debug(f, a...)   do {   printk (KERN_DEBUG "EXT3-fs DEBUG (%s, %d): %s:",   __FILE__, __LINE__, __FUNCTION__);   printk (KERN_DEBUG f, ## a);   } while (0)
+#else
+#define ext3_debug(f, a...) do {} while (0)
+#endif
+
+#define EXT3_BAD_INO 1  
+#define EXT3_ROOT_INO 2  
+#define EXT3_BOOT_LOADER_INO 5  
+#define EXT3_UNDEL_DIR_INO 6  
+#define EXT3_RESIZE_INO 7  
+#define EXT3_JOURNAL_INO 8  
+
+#define EXT3_GOOD_OLD_FIRST_INO 11
+
+#define EXT3_SUPER_MAGIC 0xEF53
+
+#define EXT3_LINK_MAX 32000
+
+#define EXT3_MIN_BLOCK_SIZE 1024
+#define EXT3_MAX_BLOCK_SIZE 4096
+#define EXT3_MIN_BLOCK_LOG_SIZE 10
+#define EXT3_BLOCK_SIZE(s) (EXT3_MIN_BLOCK_SIZE << (s)->s_log_block_size)
+#define EXT3_ADDR_PER_BLOCK(s) (EXT3_BLOCK_SIZE(s) / sizeof (__u32))
+#define EXT3_BLOCK_SIZE_BITS(s) ((s)->s_log_block_size + 10)
+#define EXT3_INODE_SIZE(s) (((s)->s_rev_level == EXT3_GOOD_OLD_REV) ?   EXT3_GOOD_OLD_INODE_SIZE :   (s)->s_inode_size)
+#define EXT3_FIRST_INO(s) (((s)->s_rev_level == EXT3_GOOD_OLD_REV) ?   EXT3_GOOD_OLD_FIRST_INO :   (s)->s_first_ino)
+
+#define EXT3_MIN_FRAG_SIZE 1024
+#define EXT3_MAX_FRAG_SIZE 4096
+#define EXT3_MIN_FRAG_LOG_SIZE 10
+#define EXT3_FRAG_SIZE(s) (EXT3_MIN_FRAG_SIZE << (s)->s_log_frag_size)
+#define EXT3_FRAGS_PER_BLOCK(s) (EXT3_BLOCK_SIZE(s) / EXT3_FRAG_SIZE(s))
+
+struct ext3_group_desc
+{
+ __le32 bg_block_bitmap;
+ __le32 bg_inode_bitmap;
+ __le32 bg_inode_table;
+ __le16 bg_free_blocks_count;
+ __le16 bg_free_inodes_count;
+ __le16 bg_used_dirs_count;
+ __u16 bg_pad;
+ __le32 bg_reserved[3];
+};
+
+#define EXT3_BLOCKS_PER_GROUP(s) ((s)->s_blocks_per_group)
+#define EXT3_DESC_PER_BLOCK(s) (EXT3_BLOCK_SIZE(s) / sizeof (struct ext3_group_desc))
+#define EXT3_INODES_PER_GROUP(s) ((s)->s_inodes_per_group)
+
+#define EXT3_NDIR_BLOCKS 12
+#define EXT3_IND_BLOCK EXT3_NDIR_BLOCKS
+#define EXT3_DIND_BLOCK (EXT3_IND_BLOCK + 1)
+#define EXT3_TIND_BLOCK (EXT3_DIND_BLOCK + 1)
+#define EXT3_N_BLOCKS (EXT3_TIND_BLOCK + 1)
+
+#define EXT3_SECRM_FL 0x00000001  
+#define EXT3_UNRM_FL 0x00000002  
+#define EXT3_COMPR_FL 0x00000004  
+#define EXT3_SYNC_FL 0x00000008  
+#define EXT3_IMMUTABLE_FL 0x00000010  
+#define EXT3_APPEND_FL 0x00000020  
+#define EXT3_NODUMP_FL 0x00000040  
+#define EXT3_NOATIME_FL 0x00000080  
+
+#define EXT3_DIRTY_FL 0x00000100
+#define EXT3_COMPRBLK_FL 0x00000200  
+#define EXT3_NOCOMPR_FL 0x00000400  
+#define EXT3_ECOMPR_FL 0x00000800  
+
+#define EXT3_INDEX_FL 0x00001000  
+#define EXT3_IMAGIC_FL 0x00002000  
+#define EXT3_JOURNAL_DATA_FL 0x00004000  
+#define EXT3_NOTAIL_FL 0x00008000  
+#define EXT3_DIRSYNC_FL 0x00010000  
+#define EXT3_TOPDIR_FL 0x00020000  
+#define EXT3_RESERVED_FL 0x80000000  
+
+#define EXT3_FL_USER_VISIBLE 0x0003DFFF  
+#define EXT3_FL_USER_MODIFIABLE 0x000380FF  
+
+#define EXT3_STATE_JDATA 0x00000001  
+#define EXT3_STATE_NEW 0x00000002  
+#define EXT3_STATE_XATTR 0x00000004  
+
+struct ext3_new_group_input {
+ __u32 group;
+ __u32 block_bitmap;
+ __u32 inode_bitmap;
+ __u32 inode_table;
+ __u32 blocks_count;
+ __u16 reserved_blocks;
+ __u16 unused;
+};
+
+struct ext3_new_group_data {
+ __u32 group;
+ __u32 block_bitmap;
+ __u32 inode_bitmap;
+ __u32 inode_table;
+ __u32 blocks_count;
+ __u16 reserved_blocks;
+ __u16 unused;
+ __u32 free_blocks_count;
+};
+
+#define EXT3_IOC_GETFLAGS _IOR('f', 1, long)
+#define EXT3_IOC_SETFLAGS _IOW('f', 2, long)
+#define EXT3_IOC_GETVERSION _IOR('f', 3, long)
+#define EXT3_IOC_SETVERSION _IOW('f', 4, long)
+#define EXT3_IOC_GROUP_EXTEND _IOW('f', 7, unsigned long)
+#define EXT3_IOC_GROUP_ADD _IOW('f', 8,struct ext3_new_group_input)
+#define EXT3_IOC_GETVERSION_OLD _IOR('v', 1, long)
+#define EXT3_IOC_SETVERSION_OLD _IOW('v', 2, long)
+#define EXT3_IOC_GETRSVSZ _IOR('f', 5, long)
+#define EXT3_IOC_SETRSVSZ _IOW('f', 6, long)
+
+struct ext3_mount_options {
+ unsigned long s_mount_opt;
+ uid_t s_resuid;
+ gid_t s_resgid;
+ unsigned long s_commit_interval;
+};
+
+struct ext3_inode {
+ __le16 i_mode;
+ __le16 i_uid;
+ __le32 i_size;
+ __le32 i_atime;
+ __le32 i_ctime;
+ __le32 i_mtime;
+ __le32 i_dtime;
+ __le16 i_gid;
+ __le16 i_links_count;
+ __le32 i_blocks;
+ __le32 i_flags;
+ union {
+ struct {
+ __u32 l_i_reserved1;
+ } linux1;
+ struct {
+ __u32 h_i_translator;
+ } hurd1;
+ struct {
+ __u32 m_i_reserved1;
+ } masix1;
+ } osd1;
+ __le32 i_block[EXT3_N_BLOCKS];
+ __le32 i_generation;
+ __le32 i_file_acl;
+ __le32 i_dir_acl;
+ __le32 i_faddr;
+ union {
+ struct {
+ __u8 l_i_frag;
+ __u8 l_i_fsize;
+ __u16 i_pad1;
+ __le16 l_i_uid_high;
+ __le16 l_i_gid_high;
+ __u32 l_i_reserved2;
+ } linux2;
+ struct {
+ __u8 h_i_frag;
+ __u8 h_i_fsize;
+ __u16 h_i_mode_high;
+ __u16 h_i_uid_high;
+ __u16 h_i_gid_high;
+ __u32 h_i_author;
+ } hurd2;
+ struct {
+ __u8 m_i_frag;
+ __u8 m_i_fsize;
+ __u16 m_pad1;
+ __u32 m_i_reserved2[2];
+ } masix2;
+ } osd2;
+ __le16 i_extra_isize;
+ __le16 i_pad1;
+};
+
+#define i_size_high i_dir_acl
+
+#ifdef __linux__
+#define i_reserved1 osd1.linux1.l_i_reserved1
+#define i_frag osd2.linux2.l_i_frag
+#define i_fsize osd2.linux2.l_i_fsize
+#define i_uid_low i_uid
+#define i_gid_low i_gid
+#define i_uid_high osd2.linux2.l_i_uid_high
+#define i_gid_high osd2.linux2.l_i_gid_high
+#define i_reserved2 osd2.linux2.l_i_reserved2
+
+#elif defined(__GNU__)
+
+#define i_translator osd1.hurd1.h_i_translator
+#define i_frag osd2.hurd2.h_i_frag;
+#define i_fsize osd2.hurd2.h_i_fsize;
+#define i_uid_high osd2.hurd2.h_i_uid_high
+#define i_gid_high osd2.hurd2.h_i_gid_high
+#define i_author osd2.hurd2.h_i_author
+
+#elif defined(__masix__)
+
+#define i_reserved1 osd1.masix1.m_i_reserved1
+#define i_frag osd2.masix2.m_i_frag
+#define i_fsize osd2.masix2.m_i_fsize
+#define i_reserved2 osd2.masix2.m_i_reserved2
+
+#endif
+
+#define EXT3_VALID_FS 0x0001  
+#define EXT3_ERROR_FS 0x0002  
+#define EXT3_ORPHAN_FS 0x0004  
+
+#define EXT3_MOUNT_CHECK 0x00001  
+#define EXT3_MOUNT_OLDALLOC 0x00002  
+#define EXT3_MOUNT_GRPID 0x00004  
+#define EXT3_MOUNT_DEBUG 0x00008  
+#define EXT3_MOUNT_ERRORS_CONT 0x00010  
+#define EXT3_MOUNT_ERRORS_RO 0x00020  
+#define EXT3_MOUNT_ERRORS_PANIC 0x00040  
+#define EXT3_MOUNT_MINIX_DF 0x00080  
+#define EXT3_MOUNT_NOLOAD 0x00100  
+#define EXT3_MOUNT_ABORT 0x00200  
+#define EXT3_MOUNT_DATA_FLAGS 0x00C00  
+#define EXT3_MOUNT_JOURNAL_DATA 0x00400  
+#define EXT3_MOUNT_ORDERED_DATA 0x00800  
+#define EXT3_MOUNT_WRITEBACK_DATA 0x00C00  
+#define EXT3_MOUNT_UPDATE_JOURNAL 0x01000  
+#define EXT3_MOUNT_NO_UID32 0x02000  
+#define EXT3_MOUNT_XATTR_USER 0x04000  
+#define EXT3_MOUNT_POSIX_ACL 0x08000  
+#define EXT3_MOUNT_RESERVATION 0x10000  
+#define EXT3_MOUNT_BARRIER 0x20000  
+#define EXT3_MOUNT_NOBH 0x40000  
+#define EXT3_MOUNT_QUOTA 0x80000  
+#define EXT3_MOUNT_USRQUOTA 0x100000  
+#define EXT3_MOUNT_GRPQUOTA 0x200000  
+
+#ifndef _LINUX_EXT2_FS_H
+#define clear_opt(o, opt) o &= ~EXT3_MOUNT_##opt
+#define set_opt(o, opt) o |= EXT3_MOUNT_##opt
+#define test_opt(sb, opt) (EXT3_SB(sb)->s_mount_opt &   EXT3_MOUNT_##opt)
+#else
+#define EXT2_MOUNT_NOLOAD EXT3_MOUNT_NOLOAD
+#define EXT2_MOUNT_ABORT EXT3_MOUNT_ABORT
+#define EXT2_MOUNT_DATA_FLAGS EXT3_MOUNT_DATA_FLAGS
+#endif
+
+#define ext3_set_bit ext2_set_bit
+#define ext3_set_bit_atomic ext2_set_bit_atomic
+#define ext3_clear_bit ext2_clear_bit
+#define ext3_clear_bit_atomic ext2_clear_bit_atomic
+#define ext3_test_bit ext2_test_bit
+#define ext3_find_first_zero_bit ext2_find_first_zero_bit
+#define ext3_find_next_zero_bit ext2_find_next_zero_bit
+
+#define EXT3_DFL_MAX_MNT_COUNT 20  
+#define EXT3_DFL_CHECKINTERVAL 0  
+
+#define EXT3_ERRORS_CONTINUE 1  
+#define EXT3_ERRORS_RO 2  
+#define EXT3_ERRORS_PANIC 3  
+#define EXT3_ERRORS_DEFAULT EXT3_ERRORS_CONTINUE
+
+struct ext3_super_block {
+  __le32 s_inodes_count;
+ __le32 s_blocks_count;
+ __le32 s_r_blocks_count;
+ __le32 s_free_blocks_count;
+  __le32 s_free_inodes_count;
+ __le32 s_first_data_block;
+ __le32 s_log_block_size;
+ __le32 s_log_frag_size;
+  __le32 s_blocks_per_group;
+ __le32 s_frags_per_group;
+ __le32 s_inodes_per_group;
+ __le32 s_mtime;
+  __le32 s_wtime;
+ __le16 s_mnt_count;
+ __le16 s_max_mnt_count;
+ __le16 s_magic;
+ __le16 s_state;
+ __le16 s_errors;
+ __le16 s_minor_rev_level;
+  __le32 s_lastcheck;
+ __le32 s_checkinterval;
+ __le32 s_creator_os;
+ __le32 s_rev_level;
+  __le16 s_def_resuid;
+ __le16 s_def_resgid;
+
+ __le32 s_first_ino;
+ __le16 s_inode_size;
+ __le16 s_block_group_nr;
+ __le32 s_feature_compat;
+  __le32 s_feature_incompat;
+ __le32 s_feature_ro_compat;
+  __u8 s_uuid[16];
+  char s_volume_name[16];
+  char s_last_mounted[64];
+  __le32 s_algorithm_usage_bitmap;
+
+ __u8 s_prealloc_blocks;
+ __u8 s_prealloc_dir_blocks;
+ __u16 s_reserved_gdt_blocks;
+
+  __u8 s_journal_uuid[16];
+  __le32 s_journal_inum;
+ __le32 s_journal_dev;
+ __le32 s_last_orphan;
+ __le32 s_hash_seed[4];
+ __u8 s_def_hash_version;
+ __u8 s_reserved_char_pad;
+ __u16 s_reserved_word_pad;
+ __le32 s_default_mount_opts;
+ __le32 s_first_meta_bg;
+ __u32 s_reserved[190];
+};
+
+#define EXT3_SB(sb) (sb)
+
+#define NEXT_ORPHAN(inode) EXT3_I(inode)->i_dtime
+
+#define EXT3_OS_LINUX 0
+#define EXT3_OS_HURD 1
+#define EXT3_OS_MASIX 2
+#define EXT3_OS_FREEBSD 3
+#define EXT3_OS_LITES 4
+
+#define EXT3_GOOD_OLD_REV 0  
+#define EXT3_DYNAMIC_REV 1  
+
+#define EXT3_CURRENT_REV EXT3_GOOD_OLD_REV
+#define EXT3_MAX_SUPP_REV EXT3_DYNAMIC_REV
+
+#define EXT3_GOOD_OLD_INODE_SIZE 128
+
+#define EXT3_HAS_COMPAT_FEATURE(sb,mask)   ( EXT3_SB(sb)->s_es->s_feature_compat & cpu_to_le32(mask) )
+#define EXT3_HAS_RO_COMPAT_FEATURE(sb,mask)   ( EXT3_SB(sb)->s_es->s_feature_ro_compat & cpu_to_le32(mask) )
+#define EXT3_HAS_INCOMPAT_FEATURE(sb,mask)   ( EXT3_SB(sb)->s_es->s_feature_incompat & cpu_to_le32(mask) )
+#define EXT3_SET_COMPAT_FEATURE(sb,mask)   EXT3_SB(sb)->s_es->s_feature_compat |= cpu_to_le32(mask)
+#define EXT3_SET_RO_COMPAT_FEATURE(sb,mask)   EXT3_SB(sb)->s_es->s_feature_ro_compat |= cpu_to_le32(mask)
+#define EXT3_SET_INCOMPAT_FEATURE(sb,mask)   EXT3_SB(sb)->s_es->s_feature_incompat |= cpu_to_le32(mask)
+#define EXT3_CLEAR_COMPAT_FEATURE(sb,mask)   EXT3_SB(sb)->s_es->s_feature_compat &= ~cpu_to_le32(mask)
+#define EXT3_CLEAR_RO_COMPAT_FEATURE(sb,mask)   EXT3_SB(sb)->s_es->s_feature_ro_compat &= ~cpu_to_le32(mask)
+#define EXT3_CLEAR_INCOMPAT_FEATURE(sb,mask)   EXT3_SB(sb)->s_es->s_feature_incompat &= ~cpu_to_le32(mask)
+
+#define EXT3_FEATURE_COMPAT_DIR_PREALLOC 0x0001
+#define EXT3_FEATURE_COMPAT_IMAGIC_INODES 0x0002
+#define EXT3_FEATURE_COMPAT_HAS_JOURNAL 0x0004
+#define EXT3_FEATURE_COMPAT_EXT_ATTR 0x0008
+#define EXT3_FEATURE_COMPAT_RESIZE_INODE 0x0010
+#define EXT3_FEATURE_COMPAT_DIR_INDEX 0x0020
+
+#define EXT3_FEATURE_RO_COMPAT_SPARSE_SUPER 0x0001
+#define EXT3_FEATURE_RO_COMPAT_LARGE_FILE 0x0002
+#define EXT3_FEATURE_RO_COMPAT_BTREE_DIR 0x0004
+
+#define EXT3_FEATURE_INCOMPAT_COMPRESSION 0x0001
+#define EXT3_FEATURE_INCOMPAT_FILETYPE 0x0002
+#define EXT3_FEATURE_INCOMPAT_RECOVER 0x0004  
+#define EXT3_FEATURE_INCOMPAT_JOURNAL_DEV 0x0008  
+#define EXT3_FEATURE_INCOMPAT_META_BG 0x0010
+
+#define EXT3_FEATURE_COMPAT_SUPP EXT2_FEATURE_COMPAT_EXT_ATTR
+#define EXT3_FEATURE_INCOMPAT_SUPP (EXT3_FEATURE_INCOMPAT_FILETYPE|   EXT3_FEATURE_INCOMPAT_RECOVER|   EXT3_FEATURE_INCOMPAT_META_BG)
+#define EXT3_FEATURE_RO_COMPAT_SUPP (EXT3_FEATURE_RO_COMPAT_SPARSE_SUPER|   EXT3_FEATURE_RO_COMPAT_LARGE_FILE|   EXT3_FEATURE_RO_COMPAT_BTREE_DIR)
+
+#define EXT3_DEF_RESUID 0
+#define EXT3_DEF_RESGID 0
+
+#define EXT3_DEFM_DEBUG 0x0001
+#define EXT3_DEFM_BSDGROUPS 0x0002
+#define EXT3_DEFM_XATTR_USER 0x0004
+#define EXT3_DEFM_ACL 0x0008
+#define EXT3_DEFM_UID16 0x0010
+#define EXT3_DEFM_JMODE 0x0060
+#define EXT3_DEFM_JMODE_DATA 0x0020
+#define EXT3_DEFM_JMODE_ORDERED 0x0040
+#define EXT3_DEFM_JMODE_WBACK 0x0060
+
+#define EXT3_NAME_LEN 255
+
+struct ext3_dir_entry {
+ __le32 inode;
+ __le16 rec_len;
+ __le16 name_len;
+ char name[EXT3_NAME_LEN];
+};
+
+struct ext3_dir_entry_2 {
+ __le32 inode;
+ __le16 rec_len;
+ __u8 name_len;
+ __u8 file_type;
+ char name[EXT3_NAME_LEN];
+};
+
+#define EXT3_FT_UNKNOWN 0
+#define EXT3_FT_REG_FILE 1
+#define EXT3_FT_DIR 2
+#define EXT3_FT_CHRDEV 3
+#define EXT3_FT_BLKDEV 4
+#define EXT3_FT_FIFO 5
+#define EXT3_FT_SOCK 6
+#define EXT3_FT_SYMLINK 7
+
+#define EXT3_FT_MAX 8
+
+#define EXT3_DIR_PAD 4
+#define EXT3_DIR_ROUND (EXT3_DIR_PAD - 1)
+#define EXT3_DIR_REC_LEN(name_len) (((name_len) + 8 + EXT3_DIR_ROUND) &   ~EXT3_DIR_ROUND)
+
+#define is_dx(dir) 0
+#define EXT3_DIR_LINK_MAX(dir) ((dir)->i_nlink >= EXT3_LINK_MAX)
+#define EXT3_DIR_LINK_EMPTY(dir) ((dir)->i_nlink == 2)
+
+#define DX_HASH_LEGACY 0
+#define DX_HASH_HALF_MD4 1
+#define DX_HASH_TEA 2
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/fadvise.h b/ndk/platforms/android-3/include/linux/fadvise.h
new file mode 100644
index 0000000..25a0a4c
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/fadvise.h
@@ -0,0 +1,28 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef FADVISE_H_INCLUDED
+#define FADVISE_H_INCLUDED
+
+#define POSIX_FADV_NORMAL 0  
+#define POSIX_FADV_RANDOM 1  
+#define POSIX_FADV_SEQUENTIAL 2  
+#define POSIX_FADV_WILLNEED 3  
+
+#ifdef __s390x__
+#define POSIX_FADV_DONTNEED 6  
+#define POSIX_FADV_NOREUSE 7  
+#else
+#define POSIX_FADV_DONTNEED 4  
+#define POSIX_FADV_NOREUSE 5  
+#endif
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/fb.h b/ndk/platforms/android-3/include/linux/fb.h
new file mode 100644
index 0000000..336c439
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/fb.h
@@ -0,0 +1,347 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_FB_H
+#define _LINUX_FB_H
+
+#include <asm/types.h>
+
+#define FB_MAJOR 29
+#define FB_MAX 32  
+
+#define FBIOGET_VSCREENINFO 0x4600
+#define FBIOPUT_VSCREENINFO 0x4601
+#define FBIOGET_FSCREENINFO 0x4602
+#define FBIOGETCMAP 0x4604
+#define FBIOPUTCMAP 0x4605
+#define FBIOPAN_DISPLAY 0x4606
+#define FBIO_CURSOR _IOWR('F', 0x08, struct fb_cursor)
+
+#define FBIOGET_CON2FBMAP 0x460F
+#define FBIOPUT_CON2FBMAP 0x4610
+#define FBIOBLANK 0x4611  
+#define FBIOGET_VBLANK _IOR('F', 0x12, struct fb_vblank)
+#define FBIO_ALLOC 0x4613
+#define FBIO_FREE 0x4614
+#define FBIOGET_GLYPH 0x4615
+#define FBIOGET_HWCINFO 0x4616
+#define FBIOPUT_MODEINFO 0x4617
+#define FBIOGET_DISPINFO 0x4618
+
+#define FB_TYPE_PACKED_PIXELS 0  
+#define FB_TYPE_PLANES 1  
+#define FB_TYPE_INTERLEAVED_PLANES 2  
+#define FB_TYPE_TEXT 3  
+#define FB_TYPE_VGA_PLANES 4  
+
+#define FB_AUX_TEXT_MDA 0  
+#define FB_AUX_TEXT_CGA 1  
+#define FB_AUX_TEXT_S3_MMIO 2  
+#define FB_AUX_TEXT_MGA_STEP16 3  
+#define FB_AUX_TEXT_MGA_STEP8 4  
+
+#define FB_AUX_VGA_PLANES_VGA4 0  
+#define FB_AUX_VGA_PLANES_CFB4 1  
+#define FB_AUX_VGA_PLANES_CFB8 2  
+
+#define FB_VISUAL_MONO01 0  
+#define FB_VISUAL_MONO10 1  
+#define FB_VISUAL_TRUECOLOR 2  
+#define FB_VISUAL_PSEUDOCOLOR 3  
+#define FB_VISUAL_DIRECTCOLOR 4  
+#define FB_VISUAL_STATIC_PSEUDOCOLOR 5  
+
+#define FB_ACCEL_NONE 0  
+#define FB_ACCEL_ATARIBLITT 1  
+#define FB_ACCEL_AMIGABLITT 2  
+#define FB_ACCEL_S3_TRIO64 3  
+#define FB_ACCEL_NCR_77C32BLT 4  
+#define FB_ACCEL_S3_VIRGE 5  
+#define FB_ACCEL_ATI_MACH64GX 6  
+#define FB_ACCEL_DEC_TGA 7  
+#define FB_ACCEL_ATI_MACH64CT 8  
+#define FB_ACCEL_ATI_MACH64VT 9  
+#define FB_ACCEL_ATI_MACH64GT 10  
+#define FB_ACCEL_SUN_CREATOR 11  
+#define FB_ACCEL_SUN_CGSIX 12  
+#define FB_ACCEL_SUN_LEO 13  
+#define FB_ACCEL_IMS_TWINTURBO 14  
+#define FB_ACCEL_3DLABS_PERMEDIA2 15  
+#define FB_ACCEL_MATROX_MGA2064W 16  
+#define FB_ACCEL_MATROX_MGA1064SG 17  
+#define FB_ACCEL_MATROX_MGA2164W 18  
+#define FB_ACCEL_MATROX_MGA2164W_AGP 19  
+#define FB_ACCEL_MATROX_MGAG100 20  
+#define FB_ACCEL_MATROX_MGAG200 21  
+#define FB_ACCEL_SUN_CG14 22  
+#define FB_ACCEL_SUN_BWTWO 23  
+#define FB_ACCEL_SUN_CGTHREE 24  
+#define FB_ACCEL_SUN_TCX 25  
+#define FB_ACCEL_MATROX_MGAG400 26  
+#define FB_ACCEL_NV3 27  
+#define FB_ACCEL_NV4 28  
+#define FB_ACCEL_NV5 29  
+#define FB_ACCEL_CT_6555x 30  
+#define FB_ACCEL_3DFX_BANSHEE 31  
+#define FB_ACCEL_ATI_RAGE128 32  
+#define FB_ACCEL_IGS_CYBER2000 33  
+#define FB_ACCEL_IGS_CYBER2010 34  
+#define FB_ACCEL_IGS_CYBER5000 35  
+#define FB_ACCEL_SIS_GLAMOUR 36  
+#define FB_ACCEL_3DLABS_PERMEDIA3 37  
+#define FB_ACCEL_ATI_RADEON 38  
+#define FB_ACCEL_I810 39  
+#define FB_ACCEL_SIS_GLAMOUR_2 40  
+#define FB_ACCEL_SIS_XABRE 41  
+#define FB_ACCEL_I830 42  
+#define FB_ACCEL_NV_10 43  
+#define FB_ACCEL_NV_20 44  
+#define FB_ACCEL_NV_30 45  
+#define FB_ACCEL_NV_40 46  
+#define FB_ACCEL_XGI_VOLARI_V 47  
+#define FB_ACCEL_XGI_VOLARI_Z 48  
+#define FB_ACCEL_OMAP1610 49  
+#define FB_ACCEL_NEOMAGIC_NM2070 90  
+#define FB_ACCEL_NEOMAGIC_NM2090 91  
+#define FB_ACCEL_NEOMAGIC_NM2093 92  
+#define FB_ACCEL_NEOMAGIC_NM2097 93  
+#define FB_ACCEL_NEOMAGIC_NM2160 94  
+#define FB_ACCEL_NEOMAGIC_NM2200 95  
+#define FB_ACCEL_NEOMAGIC_NM2230 96  
+#define FB_ACCEL_NEOMAGIC_NM2360 97  
+#define FB_ACCEL_NEOMAGIC_NM2380 98  
+
+#define FB_ACCEL_SAVAGE4 0x80  
+#define FB_ACCEL_SAVAGE3D 0x81  
+#define FB_ACCEL_SAVAGE3D_MV 0x82  
+#define FB_ACCEL_SAVAGE2000 0x83  
+#define FB_ACCEL_SAVAGE_MX_MV 0x84  
+#define FB_ACCEL_SAVAGE_MX 0x85  
+#define FB_ACCEL_SAVAGE_IX_MV 0x86  
+#define FB_ACCEL_SAVAGE_IX 0x87  
+#define FB_ACCEL_PROSAVAGE_PM 0x88  
+#define FB_ACCEL_PROSAVAGE_KM 0x89  
+#define FB_ACCEL_S3TWISTER_P 0x8a  
+#define FB_ACCEL_S3TWISTER_K 0x8b  
+#define FB_ACCEL_SUPERSAVAGE 0x8c  
+#define FB_ACCEL_PROSAVAGE_DDR 0x8d  
+#define FB_ACCEL_PROSAVAGE_DDRK 0x8e  
+
+struct fb_fix_screeninfo {
+ char id[16];
+ unsigned long smem_start;
+
+ __u32 smem_len;
+ __u32 type;
+ __u32 type_aux;
+ __u32 visual;
+ __u16 xpanstep;
+ __u16 ypanstep;
+ __u16 ywrapstep;
+ __u32 line_length;
+ unsigned long mmio_start;
+
+ __u32 mmio_len;
+ __u32 accel;
+
+ __u16 reserved[3];
+};
+
+struct fb_bitfield {
+ __u32 offset;
+ __u32 length;
+ __u32 msb_right;
+
+};
+
+#define FB_NONSTD_HAM 1  
+
+#define FB_ACTIVATE_NOW 0  
+#define FB_ACTIVATE_NXTOPEN 1  
+#define FB_ACTIVATE_TEST 2  
+#define FB_ACTIVATE_MASK 15
+
+#define FB_ACTIVATE_VBL 16  
+#define FB_CHANGE_CMAP_VBL 32  
+#define FB_ACTIVATE_ALL 64  
+#define FB_ACTIVATE_FORCE 128  
+#define FB_ACTIVATE_INV_MODE 256  
+
+#define FB_ACCELF_TEXT 1  
+
+#define FB_SYNC_HOR_HIGH_ACT 1  
+#define FB_SYNC_VERT_HIGH_ACT 2  
+#define FB_SYNC_EXT 4  
+#define FB_SYNC_COMP_HIGH_ACT 8  
+#define FB_SYNC_BROADCAST 16  
+
+#define FB_SYNC_ON_GREEN 32  
+
+#define FB_VMODE_NONINTERLACED 0  
+#define FB_VMODE_INTERLACED 1  
+#define FB_VMODE_DOUBLE 2  
+#define FB_VMODE_MASK 255
+
+#define FB_VMODE_YWRAP 256  
+#define FB_VMODE_SMOOTH_XPAN 512  
+#define FB_VMODE_CONUPDATE 512  
+
+#define FB_ROTATE_UR 0
+#define FB_ROTATE_CW 1
+#define FB_ROTATE_UD 2
+#define FB_ROTATE_CCW 3
+
+#define PICOS2KHZ(a) (1000000000UL/(a))
+#define KHZ2PICOS(a) (1000000000UL/(a))
+
+struct fb_var_screeninfo {
+ __u32 xres;
+ __u32 yres;
+ __u32 xres_virtual;
+ __u32 yres_virtual;
+ __u32 xoffset;
+ __u32 yoffset;
+
+ __u32 bits_per_pixel;
+ __u32 grayscale;
+
+ struct fb_bitfield red;
+ struct fb_bitfield green;
+ struct fb_bitfield blue;
+ struct fb_bitfield transp;
+
+ __u32 nonstd;
+
+ __u32 activate;
+
+ __u32 height;
+ __u32 width;
+
+ __u32 accel_flags;
+
+ __u32 pixclock;
+ __u32 left_margin;
+ __u32 right_margin;
+ __u32 upper_margin;
+ __u32 lower_margin;
+ __u32 hsync_len;
+ __u32 vsync_len;
+ __u32 sync;
+ __u32 vmode;
+ __u32 rotate;
+ __u32 reserved[5];
+};
+
+struct fb_cmap {
+ __u32 start;
+ __u32 len;
+ __u16 *red;
+ __u16 *green;
+ __u16 *blue;
+ __u16 *transp;
+};
+
+struct fb_con2fbmap {
+ __u32 console;
+ __u32 framebuffer;
+};
+
+#define VESA_NO_BLANKING 0
+#define VESA_VSYNC_SUSPEND 1
+#define VESA_HSYNC_SUSPEND 2
+#define VESA_POWERDOWN 3
+
+enum {
+
+ FB_BLANK_UNBLANK = VESA_NO_BLANKING,
+
+ FB_BLANK_NORMAL = VESA_NO_BLANKING + 1,
+
+ FB_BLANK_VSYNC_SUSPEND = VESA_VSYNC_SUSPEND + 1,
+
+ FB_BLANK_HSYNC_SUSPEND = VESA_HSYNC_SUSPEND + 1,
+
+ FB_BLANK_POWERDOWN = VESA_POWERDOWN + 1
+};
+
+#define FB_VBLANK_VBLANKING 0x001  
+#define FB_VBLANK_HBLANKING 0x002  
+#define FB_VBLANK_HAVE_VBLANK 0x004  
+#define FB_VBLANK_HAVE_HBLANK 0x008  
+#define FB_VBLANK_HAVE_COUNT 0x010  
+#define FB_VBLANK_HAVE_VCOUNT 0x020  
+#define FB_VBLANK_HAVE_HCOUNT 0x040  
+#define FB_VBLANK_VSYNCING 0x080  
+#define FB_VBLANK_HAVE_VSYNC 0x100  
+
+struct fb_vblank {
+ __u32 flags;
+ __u32 count;
+ __u32 vcount;
+ __u32 hcount;
+ __u32 reserved[4];
+};
+
+#define ROP_COPY 0
+#define ROP_XOR 1
+
+struct fb_copyarea {
+ __u32 dx;
+ __u32 dy;
+ __u32 width;
+ __u32 height;
+ __u32 sx;
+ __u32 sy;
+};
+
+struct fb_fillrect {
+ __u32 dx;
+ __u32 dy;
+ __u32 width;
+ __u32 height;
+ __u32 color;
+ __u32 rop;
+};
+
+struct fb_image {
+ __u32 dx;
+ __u32 dy;
+ __u32 width;
+ __u32 height;
+ __u32 fg_color;
+ __u32 bg_color;
+ __u8 depth;
+ const char *data;
+ struct fb_cmap cmap;
+};
+
+#define FB_CUR_SETIMAGE 0x01
+#define FB_CUR_SETPOS 0x02
+#define FB_CUR_SETHOT 0x04
+#define FB_CUR_SETCMAP 0x08
+#define FB_CUR_SETSHAPE 0x10
+#define FB_CUR_SETSIZE 0x20
+#define FB_CUR_SETALL 0xFF
+
+struct fbcurpos {
+ __u16 x, y;
+};
+
+struct fb_cursor {
+ __u16 set;
+ __u16 enable;
+ __u16 rop;
+ const char *mask;
+ struct fbcurpos hot;
+ struct fb_image image;
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/fcntl.h b/ndk/platforms/android-3/include/linux/fcntl.h
new file mode 100644
index 0000000..323e87a
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/fcntl.h
@@ -0,0 +1,35 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_FCNTL_H
+#define _LINUX_FCNTL_H
+
+#include <asm/fcntl.h>
+
+#define F_SETLEASE (F_LINUX_SPECIFIC_BASE+0)
+#define F_GETLEASE (F_LINUX_SPECIFIC_BASE+1)
+
+#define F_NOTIFY (F_LINUX_SPECIFIC_BASE+2)
+
+#define DN_ACCESS 0x00000001  
+#define DN_MODIFY 0x00000002  
+#define DN_CREATE 0x00000004  
+#define DN_DELETE 0x00000008  
+#define DN_RENAME 0x00000010  
+#define DN_ATTRIB 0x00000020  
+#define DN_MULTISHOT 0x80000000  
+
+#define AT_FDCWD -100  
+#define AT_SYMLINK_NOFOLLOW 0x100  
+#define AT_REMOVEDIR 0x200  
+#define AT_SYMLINK_FOLLOW 0x400  
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/fd.h b/ndk/platforms/android-3/include/linux/fd.h
new file mode 100644
index 0000000..f3bedd1
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/fd.h
@@ -0,0 +1,258 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_FD_H
+#define _LINUX_FD_H
+
+#include <linux/ioctl.h>
+#include <linux/compiler.h>
+
+struct floppy_struct {
+ unsigned int size,
+ sect,
+ head,
+ track,
+ stretch;
+#define FD_STRETCH 1
+#define FD_SWAPSIDES 2
+#define FD_ZEROBASED 4
+
+ unsigned char gap,
+
+ rate,
+#define FD_2M 0x4
+#define FD_SIZECODEMASK 0x38
+#define FD_SIZECODE(floppy) (((((floppy)->rate&FD_SIZECODEMASK)>> 3)+ 2) %8)
+#define FD_SECTSIZE(floppy) ( (floppy)->rate & FD_2M ?   512 : 128 << FD_SIZECODE(floppy) )
+#define FD_PERP 0x40
+
+ spec1,
+ fmt_gap;
+ const char * name;
+};
+
+#define FDCLRPRM _IO(2, 0x41)
+
+#define FDSETPRM _IOW(2, 0x42, struct floppy_struct) 
+#define FDSETMEDIAPRM FDSETPRM
+
+#define FDDEFPRM _IOW(2, 0x43, struct floppy_struct) 
+#define FDGETPRM _IOR(2, 0x04, struct floppy_struct)
+#define FDDEFMEDIAPRM FDDEFPRM
+#define FDGETMEDIAPRM FDGETPRM
+
+#define FDMSGON _IO(2,0x45)
+#define FDMSGOFF _IO(2,0x46)
+
+#define FD_FILL_BYTE 0xF6  
+
+struct format_descr {
+ unsigned int device,head,track;
+};
+
+#define FDFMTBEG _IO(2,0x47)
+
+#define FDFMTTRK _IOW(2,0x48, struct format_descr)
+
+#define FDFMTEND _IO(2,0x49)
+
+struct floppy_max_errors {
+ unsigned int
+ abort,
+ read_track,
+ reset,
+ recal,
+
+ reporting;
+
+};
+
+#define FDSETEMSGTRESH _IO(2,0x4a)
+
+#define FDFLUSH _IO(2,0x4b)
+
+#define FDSETMAXERRS _IOW(2, 0x4c, struct floppy_max_errors)
+#define FDGETMAXERRS _IOR(2, 0x0e, struct floppy_max_errors)
+
+typedef char floppy_drive_name[16];
+#define FDGETDRVTYP _IOR(2, 0x0f, floppy_drive_name)
+
+struct floppy_drive_params {
+ signed char cmos;
+
+ unsigned long max_dtr;
+ unsigned long hlt;
+ unsigned long hut;
+ unsigned long srt;
+
+ unsigned long spinup;
+ unsigned long spindown;
+ unsigned char spindown_offset;
+ unsigned char select_delay;
+ unsigned char rps;
+ unsigned char tracks;
+ unsigned long timeout;
+
+ unsigned char interleave_sect;
+
+ struct floppy_max_errors max_errors;
+
+ char flags;
+
+#define FTD_MSG 0x10
+#define FD_BROKEN_DCL 0x20
+#define FD_DEBUG 0x02
+#define FD_SILENT_DCL_CLEAR 0x4
+#define FD_INVERTED_DCL 0x80  
+
+ char read_track;
+
+ short autodetect[8];
+
+ int checkfreq;
+ int native_format;
+};
+
+enum {
+ FD_NEED_TWADDLE_BIT,
+ FD_VERIFY_BIT,
+ FD_DISK_NEWCHANGE_BIT,
+ FD_UNUSED_BIT,
+ FD_DISK_CHANGED_BIT,
+ FD_DISK_WRITABLE_BIT
+};
+
+#define FDSETDRVPRM _IOW(2, 0x90, struct floppy_drive_params)
+#define FDGETDRVPRM _IOR(2, 0x11, struct floppy_drive_params)
+
+struct floppy_drive_struct {
+ unsigned long flags;
+
+#define FD_NEED_TWADDLE (1 << FD_NEED_TWADDLE_BIT)
+#define FD_VERIFY (1 << FD_VERIFY_BIT)
+#define FD_DISK_NEWCHANGE (1 << FD_DISK_NEWCHANGE_BIT)
+#define FD_DISK_CHANGED (1 << FD_DISK_CHANGED_BIT)
+#define FD_DISK_WRITABLE (1 << FD_DISK_WRITABLE_BIT)
+
+ unsigned long spinup_date;
+ unsigned long select_date;
+ unsigned long first_read_date;
+ short probed_format;
+ short track;
+ short maxblock;
+ short maxtrack;
+ int generation;
+
+ int keep_data;
+
+ int fd_ref;
+ int fd_device;
+ unsigned long last_checked;
+
+ char *dmabuf;
+ int bufblocks;
+};
+
+#define FDGETDRVSTAT _IOR(2, 0x12, struct floppy_drive_struct)
+#define FDPOLLDRVSTAT _IOR(2, 0x13, struct floppy_drive_struct)
+
+enum reset_mode {
+ FD_RESET_IF_NEEDED,
+ FD_RESET_IF_RAWCMD,
+ FD_RESET_ALWAYS
+};
+#define FDRESET _IO(2, 0x54)
+
+struct floppy_fdc_state {
+ int spec1;
+ int spec2;
+ int dtr;
+ unsigned char version;
+ unsigned char dor;
+ unsigned long address;
+ unsigned int rawcmd:2;
+ unsigned int reset:1;
+ unsigned int need_configure:1;
+ unsigned int perp_mode:2;
+ unsigned int has_fifo:1;
+ unsigned int driver_version;
+#define FD_DRIVER_VERSION 0x100
+
+ unsigned char track[4];
+
+};
+
+#define FDGETFDCSTAT _IOR(2, 0x15, struct floppy_fdc_state)
+
+struct floppy_write_errors {
+
+ unsigned int write_errors;
+
+ unsigned long first_error_sector;
+ int first_error_generation;
+ unsigned long last_error_sector;
+ int last_error_generation;
+
+ unsigned int badness;
+};
+
+#define FDWERRORCLR _IO(2, 0x56)
+
+#define FDWERRORGET _IOR(2, 0x17, struct floppy_write_errors)
+
+#define FDHAVEBATCHEDRAWCMD
+
+struct floppy_raw_cmd {
+ unsigned int flags;
+#define FD_RAW_READ 1
+#define FD_RAW_WRITE 2
+#define FD_RAW_NO_MOTOR 4
+#define FD_RAW_DISK_CHANGE 4  
+#define FD_RAW_INTR 8  
+#define FD_RAW_SPIN 0x10  
+#define FD_RAW_NO_MOTOR_AFTER 0x20  
+#define FD_RAW_NEED_DISK 0x40  
+#define FD_RAW_NEED_SEEK 0x80  
+
+#define FD_RAW_MORE 0x100  
+#define FD_RAW_STOP_IF_FAILURE 0x200  
+#define FD_RAW_STOP_IF_SUCCESS 0x400  
+#define FD_RAW_SOFTFAILURE 0x800  
+
+#define FD_RAW_FAILURE 0x10000  
+#define FD_RAW_HARDFAILURE 0x20000  
+
+ void __user *data;
+ char *kernel_data;
+ struct floppy_raw_cmd *next;
+ long length;
+ long phys_length;
+ int buffer_length;
+
+ unsigned char rate;
+ unsigned char cmd_count;
+ unsigned char cmd[16];
+ unsigned char reply_count;
+ unsigned char reply[16];
+ int track;
+ int resultcode;
+
+ int reserved1;
+ int reserved2;
+};
+
+#define FDRAWCMD _IO(2, 0x58)
+
+#define FDTWADDLE _IO(2, 0x59)
+
+#define FDEJECT _IO(2, 0x5a)
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/file.h b/ndk/platforms/android-3/include/linux/file.h
new file mode 100644
index 0000000..87e570b
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/file.h
@@ -0,0 +1,64 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __LINUX_FILE_H
+#define __LINUX_FILE_H
+
+#include <asm/atomic.h>
+#include <linux/posix_types.h>
+#include <linux/compiler.h>
+#include <linux/spinlock.h>
+#include <linux/rcupdate.h>
+#include <linux/types.h>
+
+#define NR_OPEN_DEFAULT BITS_PER_LONG
+
+struct embedded_fd_set {
+ unsigned long fds_bits[1];
+};
+
+#define EMBEDDED_FD_SET_SIZE (BITS_PER_BYTE * sizeof(struct embedded_fd_set))
+
+struct fdtable {
+ unsigned int max_fds;
+ int max_fdset;
+ struct file ** fd;
+ fd_set *close_on_exec;
+ fd_set *open_fds;
+ struct rcu_head rcu;
+ struct files_struct *free_files;
+ struct fdtable *next;
+};
+
+struct files_struct {
+
+ atomic_t count;
+ struct fdtable *fdt;
+ struct fdtable fdtab;
+
+ spinlock_t file_lock ____cacheline_aligned_in_smp;
+ int next_fd;
+ struct embedded_fd_set close_on_exec_init;
+ struct embedded_fd_set open_fds_init;
+ struct file * fd_array[NR_OPEN_DEFAULT];
+};
+
+#define files_fdtable(files) (rcu_dereference((files)->fdt))
+
+struct kmem_cache;
+
+#define fcheck(fd) fcheck_files(current->files, fd)
+
+struct task_struct;
+
+struct files_struct *get_files_struct(struct task_struct *);
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/filter.h b/ndk/platforms/android-3/include/linux/filter.h
new file mode 100644
index 0000000..e858a0f
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/filter.h
@@ -0,0 +1,104 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __LINUX_FILTER_H__
+#define __LINUX_FILTER_H__
+
+#include <linux/compiler.h>
+#include <linux/types.h>
+
+#define BPF_MAJOR_VERSION 1
+#define BPF_MINOR_VERSION 1
+
+struct sock_filter
+{
+ __u16 code;
+ __u8 jt;
+ __u8 jf;
+ __u32 k;
+};
+
+struct sock_fprog
+{
+ unsigned short len;
+ struct sock_filter __user *filter;
+};
+
+#define BPF_CLASS(code) ((code) & 0x07)
+#define BPF_LD 0x00
+#define BPF_LDX 0x01
+#define BPF_ST 0x02
+#define BPF_STX 0x03
+#define BPF_ALU 0x04
+#define BPF_JMP 0x05
+#define BPF_RET 0x06
+#define BPF_MISC 0x07
+
+#define BPF_SIZE(code) ((code) & 0x18)
+#define BPF_W 0x00
+#define BPF_H 0x08
+#define BPF_B 0x10
+#define BPF_MODE(code) ((code) & 0xe0)
+#define BPF_IMM 0x00
+#define BPF_ABS 0x20
+#define BPF_IND 0x40
+#define BPF_MEM 0x60
+#define BPF_LEN 0x80
+#define BPF_MSH 0xa0
+
+#define BPF_OP(code) ((code) & 0xf0)
+#define BPF_ADD 0x00
+#define BPF_SUB 0x10
+#define BPF_MUL 0x20
+#define BPF_DIV 0x30
+#define BPF_OR 0x40
+#define BPF_AND 0x50
+#define BPF_LSH 0x60
+#define BPF_RSH 0x70
+#define BPF_NEG 0x80
+#define BPF_JA 0x00
+#define BPF_JEQ 0x10
+#define BPF_JGT 0x20
+#define BPF_JGE 0x30
+#define BPF_JSET 0x40
+#define BPF_SRC(code) ((code) & 0x08)
+#define BPF_K 0x00
+#define BPF_X 0x08
+
+#define BPF_RVAL(code) ((code) & 0x18)
+#define BPF_A 0x10
+
+#define BPF_MISCOP(code) ((code) & 0xf8)
+#define BPF_TAX 0x00
+#define BPF_TXA 0x80
+
+#ifndef BPF_MAXINSNS
+#define BPF_MAXINSNS 4096
+#endif
+
+#ifndef BPF_STMT
+#define BPF_STMT(code, k) { (unsigned short)(code), 0, 0, k }
+#endif
+#ifndef BPF_JUMP
+#define BPF_JUMP(code, k, jt, jf) { (unsigned short)(code), jt, jf, k }
+#endif
+
+#define BPF_MEMWORDS 16
+
+#define SKF_AD_OFF (-0x1000)
+#define SKF_AD_PROTOCOL 0
+#define SKF_AD_PKTTYPE 4
+#define SKF_AD_IFINDEX 8
+#define SKF_AD_MAX 12
+#define SKF_NET_OFF (-0x100000)
+#define SKF_LL_OFF (-0x200000)
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/fs.h b/ndk/platforms/android-3/include/linux/fs.h
new file mode 100644
index 0000000..8d375b5
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/fs.h
@@ -0,0 +1,162 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_FS_H
+#define _LINUX_FS_H
+
+#include <linux/limits.h>
+#include <linux/ioctl.h>
+
+#undef NR_OPEN
+#define NR_OPEN (1024*1024)  
+#define INR_OPEN 1024  
+
+#define BLOCK_SIZE_BITS 10
+#define BLOCK_SIZE (1<<BLOCK_SIZE_BITS)
+
+#define SEEK_SET 0  
+#define SEEK_CUR 1  
+#define SEEK_END 2  
+
+struct files_stat_struct {
+ int nr_files;
+ int nr_free_files;
+ int max_files;
+};
+
+struct inodes_stat_t {
+ int nr_inodes;
+ int nr_unused;
+ int dummy[5];
+};
+
+#define NR_FILE 8192  
+
+#define MAY_EXEC 1
+#define MAY_WRITE 2
+#define MAY_READ 4
+#define MAY_APPEND 8
+
+#define FMODE_READ 1
+#define FMODE_WRITE 2
+
+#define FMODE_LSEEK 4
+#define FMODE_PREAD 8
+#define FMODE_PWRITE FMODE_PREAD  
+
+#define FMODE_EXEC 16
+
+#define RW_MASK 1
+#define RWA_MASK 2
+#define READ 0
+#define WRITE 1
+#define READA 2  
+#define SWRITE 3  
+#define SPECIAL 4  
+#define READ_SYNC (READ | (1 << BIO_RW_SYNC))
+#define WRITE_SYNC (WRITE | (1 << BIO_RW_SYNC))
+#define WRITE_BARRIER ((1 << BIO_RW) | (1 << BIO_RW_BARRIER))
+
+#define SEL_IN 1
+#define SEL_OUT 2
+#define SEL_EX 4
+
+#define FS_REQUIRES_DEV 1 
+#define FS_BINARY_MOUNTDATA 2
+#define FS_REVAL_DOT 16384  
+#define FS_ODD_RENAME 32768  
+
+#define MS_RDONLY 1  
+#define MS_NOSUID 2  
+#define MS_NODEV 4  
+#define MS_NOEXEC 8  
+#define MS_SYNCHRONOUS 16  
+#define MS_REMOUNT 32  
+#define MS_MANDLOCK 64  
+#define MS_DIRSYNC 128  
+#define MS_NOATIME 1024  
+#define MS_NODIRATIME 2048  
+#define MS_BIND 4096
+#define MS_MOVE 8192
+#define MS_REC 16384
+#define MS_VERBOSE 32768  
+#define MS_SILENT 32768
+#define MS_POSIXACL (1<<16)  
+#define MS_UNBINDABLE (1<<17)  
+#define MS_PRIVATE (1<<18)  
+#define MS_SLAVE (1<<19)  
+#define MS_SHARED (1<<20)  
+#define MS_ACTIVE (1<<30)
+#define MS_NOUSER (1<<31)
+
+#define MS_RMT_MASK (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK)
+
+#define MS_MGC_VAL 0xC0ED0000
+#define MS_MGC_MSK 0xffff0000
+
+#define S_SYNC 1  
+#define S_NOATIME 2  
+#define S_APPEND 4  
+#define S_IMMUTABLE 8  
+#define S_DEAD 16  
+#define S_NOQUOTA 32  
+#define S_DIRSYNC 64  
+#define S_NOCMTIME 128  
+#define S_SWAPFILE 256  
+#define S_PRIVATE 512  
+
+#define __IS_FLG(inode,flg) ((inode)->i_sb->s_flags & (flg))
+
+#define IS_RDONLY(inode) ((inode)->i_sb->s_flags & MS_RDONLY)
+#define IS_SYNC(inode) (__IS_FLG(inode, MS_SYNCHRONOUS) ||   ((inode)->i_flags & S_SYNC))
+#define IS_DIRSYNC(inode) (__IS_FLG(inode, MS_SYNCHRONOUS|MS_DIRSYNC) ||   ((inode)->i_flags & (S_SYNC|S_DIRSYNC)))
+#define IS_MANDLOCK(inode) __IS_FLG(inode, MS_MANDLOCK)
+
+#define IS_NOQUOTA(inode) ((inode)->i_flags & S_NOQUOTA)
+#define IS_APPEND(inode) ((inode)->i_flags & S_APPEND)
+#define IS_IMMUTABLE(inode) ((inode)->i_flags & S_IMMUTABLE)
+#define IS_POSIXACL(inode) __IS_FLG(inode, MS_POSIXACL)
+
+#define IS_DEADDIR(inode) ((inode)->i_flags & S_DEAD)
+#define IS_NOCMTIME(inode) ((inode)->i_flags & S_NOCMTIME)
+#define IS_SWAPFILE(inode) ((inode)->i_flags & S_SWAPFILE)
+#define IS_PRIVATE(inode) ((inode)->i_flags & S_PRIVATE)
+
+#define BLKROSET _IO(0x12,93)  
+#define BLKROGET _IO(0x12,94)  
+#define BLKRRPART _IO(0x12,95)  
+#define BLKGETSIZE _IO(0x12,96)  
+#define BLKFLSBUF _IO(0x12,97)  
+#define BLKRASET _IO(0x12,98)  
+#define BLKRAGET _IO(0x12,99)  
+#define BLKFRASET _IO(0x12,100) 
+#define BLKFRAGET _IO(0x12,101) 
+#define BLKSECTSET _IO(0x12,102) 
+#define BLKSECTGET _IO(0x12,103) 
+#define BLKSSZGET _IO(0x12,104) 
+
+#define BLKBSZGET _IOR(0x12,112,size_t)
+#define BLKBSZSET _IOW(0x12,113,size_t)
+#define BLKGETSIZE64 _IOR(0x12,114,size_t)  
+#define BLKTRACESETUP _IOWR(0x12,115,struct blk_user_trace_setup)
+#define BLKTRACESTART _IO(0x12,116)
+#define BLKTRACESTOP _IO(0x12,117)
+#define BLKTRACETEARDOWN _IO(0x12,118)
+
+#define BMAP_IOCTL 1  
+#define FIBMAP _IO(0x00,1)  
+#define FIGETBSZ _IO(0x00,2)  
+
+#define SYNC_FILE_RANGE_WAIT_BEFORE 1
+#define SYNC_FILE_RANGE_WRITE 2
+#define SYNC_FILE_RANGE_WAIT_AFTER 4
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/ftape.h b/ndk/platforms/android-3/include/linux/ftape.h
new file mode 100644
index 0000000..bb1527c
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/ftape.h
@@ -0,0 +1,51 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _FTAPE_H
+#define _FTAPE_H
+
+#define FTAPE_VERSION "ftape v3.04d 25/11/97"
+
+#include <linux/types.h>
+#include <linux/mtio.h>
+
+#define FT_SECTOR(x) (x+1)  
+#define FT_SECTOR_SIZE 1024
+#define FT_SECTORS_PER_SEGMENT 32
+#define FT_ECC_SECTORS 3
+#define FT_SEGMENT_SIZE ((FT_SECTORS_PER_SEGMENT - FT_ECC_SECTORS) * FT_SECTOR_SIZE)
+#define FT_BUFF_SIZE (FT_SECTORS_PER_SEGMENT * FT_SECTOR_SIZE)
+
+#define FTAPE_SEL_A 0
+#define FTAPE_SEL_B 1
+#define FTAPE_SEL_C 2
+#define FTAPE_SEL_D 3
+#define FTAPE_SEL_MASK 3
+#define FTAPE_SEL(unit) ((unit) & FTAPE_SEL_MASK)
+#define FTAPE_NO_REWIND 4  
+
+typedef union {
+ struct {
+ __u8 error;
+ __u8 command;
+ } error;
+ long space;
+} ft_drive_error;
+typedef union {
+ struct {
+ __u8 drive_status;
+ __u8 drive_config;
+ __u8 tape_status;
+ } status;
+ long space;
+} ft_drive_status;
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/futex.h b/ndk/platforms/android-3/include/linux/futex.h
new file mode 100644
index 0000000..30f9e59
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/futex.h
@@ -0,0 +1,61 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_FUTEX_H
+#define _LINUX_FUTEX_H
+
+#include <linux/sched.h>
+
+#define FUTEX_WAIT 0
+#define FUTEX_WAKE 1
+#define FUTEX_FD 2
+#define FUTEX_REQUEUE 3
+#define FUTEX_CMP_REQUEUE 4
+#define FUTEX_WAKE_OP 5
+#define FUTEX_LOCK_PI 6
+#define FUTEX_UNLOCK_PI 7
+#define FUTEX_TRYLOCK_PI 8
+
+struct robust_list {
+ struct robust_list __user *next;
+};
+
+struct robust_list_head {
+
+ struct robust_list list;
+
+ long futex_offset;
+
+ struct robust_list __user *list_op_pending;
+};
+
+#define FUTEX_WAITERS 0x80000000
+
+#define FUTEX_OWNER_DIED 0x40000000
+
+#define FUTEX_TID_MASK 0x3fffffff
+
+#define ROBUST_LIST_LIMIT 2048
+
+#define FUTEX_OP_SET 0  
+#define FUTEX_OP_ADD 1  
+#define FUTEX_OP_OR 2  
+#define FUTEX_OP_ANDN 3  
+#define FUTEX_OP_XOR 4  
+#define FUTEX_OP_OPARG_SHIFT 8  
+#define FUTEX_OP_CMP_EQ 0  
+#define FUTEX_OP_CMP_NE 1  
+#define FUTEX_OP_CMP_LT 2  
+#define FUTEX_OP_CMP_LE 3  
+#define FUTEX_OP_CMP_GT 4  
+#define FUTEX_OP_CMP_GE 5  
+#define FUTEX_OP(op, oparg, cmp, cmparg)   (((op & 0xf) << 28) | ((cmp & 0xf) << 24)   | ((oparg & 0xfff) << 12) | (cmparg & 0xfff))
+#endif
diff --git a/ndk/platforms/android-3/include/linux/genhd.h b/ndk/platforms/android-3/include/linux/genhd.h
new file mode 100644
index 0000000..a3a3924
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/genhd.h
@@ -0,0 +1,55 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_GENHD_H
+#define _LINUX_GENHD_H
+
+#include <linux/types.h>
+
+enum {
+
+ DOS_EXTENDED_PARTITION = 5,
+ LINUX_EXTENDED_PARTITION = 0x85,
+ WIN98_EXTENDED_PARTITION = 0x0f,
+
+ LINUX_SWAP_PARTITION = 0x82,
+ LINUX_RAID_PARTITION = 0xfd,
+
+ SOLARIS_X86_PARTITION = LINUX_SWAP_PARTITION,
+ NEW_SOLARIS_X86_PARTITION = 0xbf,
+
+ DM6_AUX1PARTITION = 0x51,
+ DM6_AUX3PARTITION = 0x53,
+ DM6_PARTITION = 0x54,
+ EZD_PARTITION = 0x55,
+
+ FREEBSD_PARTITION = 0xa5,
+ OPENBSD_PARTITION = 0xa6,
+ NETBSD_PARTITION = 0xa9,
+ BSDI_PARTITION = 0xb7,
+ MINIX_PARTITION = 0x81,
+ UNIXWARE_PARTITION = 0x63,
+};
+
+struct partition {
+ unsigned char boot_ind;
+ unsigned char head;
+ unsigned char sector;
+ unsigned char cyl;
+ unsigned char sys_ind;
+ unsigned char end_head;
+ unsigned char end_sector;
+ unsigned char end_cyl;
+ unsigned int start_sect;
+ unsigned int nr_sects;
+} __attribute__((packed));
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/gfp.h b/ndk/platforms/android-3/include/linux/gfp.h
new file mode 100644
index 0000000..0a59fe9
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/gfp.h
@@ -0,0 +1,76 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __LINUX_GFP_H
+#define __LINUX_GFP_H
+
+#include <linux/mmzone.h>
+#include <linux/stddef.h>
+#include <linux/linkage.h>
+
+struct vm_area_struct;
+
+#define __GFP_DMA ((__force gfp_t)0x01u)
+#define __GFP_HIGHMEM ((__force gfp_t)0x02u)
+#if BITS_PER_LONG < 64
+#define __GFP_DMA32 ((__force gfp_t)0x00)  
+#else
+#define __GFP_DMA32 ((__force gfp_t)0x04)  
+#endif
+
+#define __GFP_WAIT ((__force gfp_t)0x10u)  
+#define __GFP_HIGH ((__force gfp_t)0x20u)  
+#define __GFP_IO ((__force gfp_t)0x40u)  
+#define __GFP_FS ((__force gfp_t)0x80u)  
+#define __GFP_COLD ((__force gfp_t)0x100u)  
+#define __GFP_NOWARN ((__force gfp_t)0x200u)  
+#define __GFP_REPEAT ((__force gfp_t)0x400u)  
+#define __GFP_NOFAIL ((__force gfp_t)0x800u)  
+#define __GFP_NORETRY ((__force gfp_t)0x1000u) 
+#define __GFP_NO_GROW ((__force gfp_t)0x2000u) 
+#define __GFP_COMP ((__force gfp_t)0x4000u) 
+#define __GFP_ZERO ((__force gfp_t)0x8000u) 
+#define __GFP_NOMEMALLOC ((__force gfp_t)0x10000u)  
+#define __GFP_HARDWALL ((__force gfp_t)0x20000u)  
+
+#define __GFP_BITS_SHIFT 20  
+#define __GFP_BITS_MASK ((__force gfp_t)((1 << __GFP_BITS_SHIFT) - 1))
+
+#define GFP_LEVEL_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS|   __GFP_COLD|__GFP_NOWARN|__GFP_REPEAT|   __GFP_NOFAIL|__GFP_NORETRY|__GFP_NO_GROW|__GFP_COMP|   __GFP_NOMEMALLOC|__GFP_HARDWALL)
+
+#define GFP_NOWAIT (GFP_ATOMIC & ~__GFP_HIGH)
+
+#define GFP_ATOMIC (__GFP_HIGH)
+#define GFP_NOIO (__GFP_WAIT)
+#define GFP_NOFS (__GFP_WAIT | __GFP_IO)
+#define GFP_KERNEL (__GFP_WAIT | __GFP_IO | __GFP_FS)
+#define GFP_USER (__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HARDWALL)
+#define GFP_HIGHUSER (__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HARDWALL |   __GFP_HIGHMEM)
+
+#define GFP_DMA __GFP_DMA
+
+#define GFP_DMA32 __GFP_DMA32
+
+#ifndef HAVE_ARCH_FREE_PAGE
+#endif
+
+#define alloc_pages(gfp_mask, order)   alloc_pages_node(numa_node_id(), gfp_mask, order)
+#define alloc_page_vma(gfp_mask, vma, addr) alloc_pages(gfp_mask, 0)
+#define alloc_page(gfp_mask) alloc_pages(gfp_mask, 0)
+
+#define __get_free_page(gfp_mask)   __get_free_pages((gfp_mask),0)
+
+#define __get_dma_pages(gfp_mask, order)   __get_free_pages((gfp_mask) | GFP_DMA,(order))
+
+#define __free_page(page) __free_pages((page), 0)
+#define free_page(addr) free_pages((addr),0)
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/hardirq.h b/ndk/platforms/android-3/include/linux/hardirq.h
new file mode 100644
index 0000000..c0566b0
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/hardirq.h
@@ -0,0 +1,73 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef LINUX_HARDIRQ_H
+#define LINUX_HARDIRQ_H
+
+#include <linux/preempt.h>
+#include <linux/smp_lock.h>
+#include <linux/lockdep.h>
+#include <asm/hardirq.h>
+#include <asm/system.h>
+
+#define PREEMPT_BITS 8
+#define SOFTIRQ_BITS 8
+
+#ifndef HARDIRQ_BITS
+#define HARDIRQ_BITS 12
+
+#if 1 << HARDIRQ_BITS < NR_IRQS
+#error HARDIRQ_BITS is too low!
+#endif
+#endif
+
+#define PREEMPT_SHIFT 0
+#define SOFTIRQ_SHIFT (PREEMPT_SHIFT + PREEMPT_BITS)
+#define HARDIRQ_SHIFT (SOFTIRQ_SHIFT + SOFTIRQ_BITS)
+
+#define __IRQ_MASK(x) ((1UL << (x))-1)
+
+#define PREEMPT_MASK (__IRQ_MASK(PREEMPT_BITS) << PREEMPT_SHIFT)
+#define SOFTIRQ_MASK (__IRQ_MASK(SOFTIRQ_BITS) << SOFTIRQ_SHIFT)
+#define HARDIRQ_MASK (__IRQ_MASK(HARDIRQ_BITS) << HARDIRQ_SHIFT)
+
+#define PREEMPT_OFFSET (1UL << PREEMPT_SHIFT)
+#define SOFTIRQ_OFFSET (1UL << SOFTIRQ_SHIFT)
+#define HARDIRQ_OFFSET (1UL << HARDIRQ_SHIFT)
+
+#if PREEMPT_ACTIVE < 1 << HARDIRQ_SHIFT + HARDIRQ_BITS
+#error PREEMPT_ACTIVE is too low!
+#endif
+
+#define hardirq_count() (preempt_count() & HARDIRQ_MASK)
+#define softirq_count() (preempt_count() & SOFTIRQ_MASK)
+#define irq_count() (preempt_count() & (HARDIRQ_MASK | SOFTIRQ_MASK))
+
+#define in_irq() (hardirq_count())
+#define in_softirq() (softirq_count())
+#define in_interrupt() (irq_count())
+
+#define in_atomic() ((preempt_count() & ~PREEMPT_ACTIVE) != 0)
+
+#define preemptible() 0
+#define IRQ_EXIT_OFFSET HARDIRQ_OFFSET
+
+#define synchronize_irq(irq) barrier()
+
+struct task_struct;
+
+#define irq_enter()   do {   account_system_vtime(current);   add_preempt_count(HARDIRQ_OFFSET);   trace_hardirq_enter();   } while (0)
+#define __irq_exit()   do {   trace_hardirq_exit();   account_system_vtime(current);   sub_preempt_count(HARDIRQ_OFFSET);   } while (0)
+
+#define nmi_enter() do { lockdep_off(); irq_enter(); } while (0)
+#define nmi_exit() do { __irq_exit(); lockdep_on(); } while (0)
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/hdlc/ioctl.h b/ndk/platforms/android-3/include/linux/hdlc/ioctl.h
new file mode 100644
index 0000000..c15a67f
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/hdlc/ioctl.h
@@ -0,0 +1,57 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __HDLC_IOCTL_H__
+#define __HDLC_IOCTL_H__
+
+typedef struct {
+ unsigned int clock_rate;
+ unsigned int clock_type;
+ unsigned short loopback;
+} sync_serial_settings;
+
+typedef struct {
+ unsigned int clock_rate;
+ unsigned int clock_type;
+ unsigned short loopback;
+ unsigned int slot_map;
+} te1_settings;
+
+typedef struct {
+ unsigned short encoding;
+ unsigned short parity;
+} raw_hdlc_proto;
+
+typedef struct {
+ unsigned int t391;
+ unsigned int t392;
+ unsigned int n391;
+ unsigned int n392;
+ unsigned int n393;
+ unsigned short lmi;
+ unsigned short dce;
+} fr_proto;
+
+typedef struct {
+ unsigned int dlci;
+} fr_proto_pvc;
+
+typedef struct {
+ unsigned int dlci;
+ char master[IFNAMSIZ];
+}fr_proto_pvc_info;
+
+typedef struct {
+ unsigned int interval;
+ unsigned int timeout;
+} cisco_proto;
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/hdreg.h b/ndk/platforms/android-3/include/linux/hdreg.h
new file mode 100644
index 0000000..a684ee9
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/hdreg.h
@@ -0,0 +1,432 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_HDREG_H
+#define _LINUX_HDREG_H
+
+#define HDIO_DRIVE_CMD_HDR_SIZE (4 * sizeof(u8))
+#define HDIO_DRIVE_HOB_HDR_SIZE (8 * sizeof(u8))
+#define HDIO_DRIVE_TASK_HDR_SIZE (8 * sizeof(u8))
+
+#define IDE_DRIVE_TASK_INVALID -1
+#define IDE_DRIVE_TASK_NO_DATA 0
+#define IDE_DRIVE_TASK_SET_XFER 1
+
+#define IDE_DRIVE_TASK_IN 2
+
+#define IDE_DRIVE_TASK_OUT 3
+#define IDE_DRIVE_TASK_RAW_WRITE 4
+
+#define IDE_TASKFILE_STD_IN_FLAGS 0xFE
+#define IDE_HOB_STD_IN_FLAGS 0x3C
+#define IDE_TASKFILE_STD_OUT_FLAGS 0xFE
+#define IDE_HOB_STD_OUT_FLAGS 0x3C
+
+typedef unsigned char task_ioreg_t;
+typedef unsigned long sata_ioreg_t;
+
+typedef union ide_reg_valid_s {
+ unsigned all : 16;
+ struct {
+ unsigned data : 1;
+ unsigned error_feature : 1;
+ unsigned sector : 1;
+ unsigned nsector : 1;
+ unsigned lcyl : 1;
+ unsigned hcyl : 1;
+ unsigned select : 1;
+ unsigned status_command : 1;
+
+ unsigned data_hob : 1;
+ unsigned error_feature_hob : 1;
+ unsigned sector_hob : 1;
+ unsigned nsector_hob : 1;
+ unsigned lcyl_hob : 1;
+ unsigned hcyl_hob : 1;
+ unsigned select_hob : 1;
+ unsigned control_hob : 1;
+ } b;
+} ide_reg_valid_t;
+
+typedef struct ide_task_request_s {
+ task_ioreg_t io_ports[8];
+ task_ioreg_t hob_ports[8];
+ ide_reg_valid_t out_flags;
+ ide_reg_valid_t in_flags;
+ int data_phase;
+ int req_cmd;
+ unsigned long out_size;
+ unsigned long in_size;
+} ide_task_request_t;
+
+typedef struct ide_ioctl_request_s {
+ ide_task_request_t *task_request;
+ unsigned char *out_buffer;
+ unsigned char *in_buffer;
+} ide_ioctl_request_t;
+
+struct hd_drive_cmd_hdr {
+ task_ioreg_t command;
+ task_ioreg_t sector_number;
+ task_ioreg_t feature;
+ task_ioreg_t sector_count;
+};
+
+typedef struct hd_drive_task_hdr {
+ task_ioreg_t data;
+ task_ioreg_t feature;
+ task_ioreg_t sector_count;
+ task_ioreg_t sector_number;
+ task_ioreg_t low_cylinder;
+ task_ioreg_t high_cylinder;
+ task_ioreg_t device_head;
+ task_ioreg_t command;
+} task_struct_t;
+
+typedef struct hd_drive_hob_hdr {
+ task_ioreg_t data;
+ task_ioreg_t feature;
+ task_ioreg_t sector_count;
+ task_ioreg_t sector_number;
+ task_ioreg_t low_cylinder;
+ task_ioreg_t high_cylinder;
+ task_ioreg_t device_head;
+ task_ioreg_t control;
+} hob_struct_t;
+
+#define TASKFILE_INVALID 0x7fff
+#define TASKFILE_48 0x8000
+
+#define TASKFILE_NO_DATA 0x0000
+
+#define TASKFILE_IN 0x0001
+#define TASKFILE_MULTI_IN 0x0002
+
+#define TASKFILE_OUT 0x0004
+#define TASKFILE_MULTI_OUT 0x0008
+#define TASKFILE_IN_OUT 0x0010
+
+#define TASKFILE_IN_DMA 0x0020
+#define TASKFILE_OUT_DMA 0x0040
+#define TASKFILE_IN_DMAQ 0x0080
+#define TASKFILE_OUT_DMAQ 0x0100
+
+#define TASKFILE_P_IN 0x0200
+#define TASKFILE_P_OUT 0x0400
+#define TASKFILE_P_IN_DMA 0x0800
+#define TASKFILE_P_OUT_DMA 0x1000
+#define TASKFILE_P_IN_DMAQ 0x2000
+#define TASKFILE_P_OUT_DMAQ 0x4000
+
+#define WIN_NOP 0x00
+
+#define CFA_REQ_EXT_ERROR_CODE 0x03  
+
+#define WIN_SRST 0x08  
+#define WIN_DEVICE_RESET 0x08
+
+#define WIN_RECAL 0x10
+#define WIN_RESTORE WIN_RECAL
+
+#define WIN_READ 0x20  
+#define WIN_READ_ONCE 0x21  
+#define WIN_READ_LONG 0x22  
+#define WIN_READ_LONG_ONCE 0x23  
+#define WIN_READ_EXT 0x24  
+#define WIN_READDMA_EXT 0x25  
+#define WIN_READDMA_QUEUED_EXT 0x26  
+#define WIN_READ_NATIVE_MAX_EXT 0x27  
+
+#define WIN_MULTREAD_EXT 0x29  
+
+#define WIN_WRITE 0x30  
+#define WIN_WRITE_ONCE 0x31  
+#define WIN_WRITE_LONG 0x32  
+#define WIN_WRITE_LONG_ONCE 0x33  
+#define WIN_WRITE_EXT 0x34  
+#define WIN_WRITEDMA_EXT 0x35  
+#define WIN_WRITEDMA_QUEUED_EXT 0x36  
+#define WIN_SET_MAX_EXT 0x37  
+#define CFA_WRITE_SECT_WO_ERASE 0x38  
+#define WIN_MULTWRITE_EXT 0x39  
+
+#define WIN_WRITE_VERIFY 0x3C  
+
+#define WIN_VERIFY 0x40  
+#define WIN_VERIFY_ONCE 0x41  
+#define WIN_VERIFY_EXT 0x42  
+
+#define WIN_FORMAT 0x50
+
+#define WIN_INIT 0x60
+
+#define WIN_SEEK 0x70  
+
+#define CFA_TRANSLATE_SECTOR 0x87  
+#define WIN_DIAGNOSE 0x90
+#define WIN_SPECIFY 0x91  
+#define WIN_DOWNLOAD_MICROCODE 0x92
+#define WIN_STANDBYNOW2 0x94
+#define WIN_STANDBY2 0x96
+#define WIN_SETIDLE2 0x97
+#define WIN_CHECKPOWERMODE2 0x98
+#define WIN_SLEEPNOW2 0x99
+
+#define WIN_PACKETCMD 0xA0  
+#define WIN_PIDENTIFY 0xA1  
+#define WIN_QUEUED_SERVICE 0xA2
+#define WIN_SMART 0xB0  
+#define CFA_ERASE_SECTORS 0xC0
+#define WIN_MULTREAD 0xC4  
+#define WIN_MULTWRITE 0xC5  
+#define WIN_SETMULT 0xC6  
+#define WIN_READDMA_QUEUED 0xC7  
+#define WIN_READDMA 0xC8  
+#define WIN_READDMA_ONCE 0xC9  
+#define WIN_WRITEDMA 0xCA  
+#define WIN_WRITEDMA_ONCE 0xCB  
+#define WIN_WRITEDMA_QUEUED 0xCC  
+#define CFA_WRITE_MULTI_WO_ERASE 0xCD  
+#define WIN_GETMEDIASTATUS 0xDA
+#define WIN_ACKMEDIACHANGE 0xDB  
+#define WIN_POSTBOOT 0xDC
+#define WIN_PREBOOT 0xDD
+#define WIN_DOORLOCK 0xDE  
+#define WIN_DOORUNLOCK 0xDF  
+#define WIN_STANDBYNOW1 0xE0
+#define WIN_IDLEIMMEDIATE 0xE1  
+#define WIN_STANDBY 0xE2  
+#define WIN_SETIDLE1 0xE3
+#define WIN_READ_BUFFER 0xE4  
+#define WIN_CHECKPOWERMODE1 0xE5
+#define WIN_SLEEPNOW1 0xE6
+#define WIN_FLUSH_CACHE 0xE7
+#define WIN_WRITE_BUFFER 0xE8  
+#define WIN_WRITE_SAME 0xE9  
+
+#define WIN_FLUSH_CACHE_EXT 0xEA  
+#define WIN_IDENTIFY 0xEC  
+#define WIN_MEDIAEJECT 0xED
+#define WIN_IDENTIFY_DMA 0xEE  
+#define WIN_SETFEATURES 0xEF  
+#define EXABYTE_ENABLE_NEST 0xF0
+#define WIN_SECURITY_SET_PASS 0xF1
+#define WIN_SECURITY_UNLOCK 0xF2
+#define WIN_SECURITY_ERASE_PREPARE 0xF3
+#define WIN_SECURITY_ERASE_UNIT 0xF4
+#define WIN_SECURITY_FREEZE_LOCK 0xF5
+#define WIN_SECURITY_DISABLE 0xF6
+#define WIN_READ_NATIVE_MAX 0xF8  
+#define WIN_SET_MAX 0xF9
+#define DISABLE_SEAGATE 0xFB
+
+#define SMART_READ_VALUES 0xD0
+#define SMART_READ_THRESHOLDS 0xD1
+#define SMART_AUTOSAVE 0xD2
+#define SMART_SAVE 0xD3
+#define SMART_IMMEDIATE_OFFLINE 0xD4
+#define SMART_READ_LOG_SECTOR 0xD5
+#define SMART_WRITE_LOG_SECTOR 0xD6
+#define SMART_WRITE_THRESHOLDS 0xD7
+#define SMART_ENABLE 0xD8
+#define SMART_DISABLE 0xD9
+#define SMART_STATUS 0xDA
+#define SMART_AUTO_OFFLINE 0xDB
+
+#define SMART_LCYL_PASS 0x4F
+#define SMART_HCYL_PASS 0xC2
+
+#define SETFEATURES_EN_8BIT 0x01  
+#define SETFEATURES_EN_WCACHE 0x02  
+#define SETFEATURES_DIS_DEFECT 0x04  
+#define SETFEATURES_EN_APM 0x05  
+#define SETFEATURES_EN_SAME_R 0x22  
+#define SETFEATURES_DIS_MSN 0x31  
+#define SETFEATURES_DIS_RETRY 0x33  
+#define SETFEATURES_EN_AAM 0x42  
+#define SETFEATURES_RW_LONG 0x44  
+#define SETFEATURES_SET_CACHE 0x54  
+#define SETFEATURES_DIS_RLA 0x55  
+#define SETFEATURES_EN_RI 0x5D  
+#define SETFEATURES_EN_SI 0x5E  
+#define SETFEATURES_DIS_RPOD 0x66  
+#define SETFEATURES_DIS_ECC 0x77  
+#define SETFEATURES_DIS_8BIT 0x81  
+#define SETFEATURES_DIS_WCACHE 0x82  
+#define SETFEATURES_EN_DEFECT 0x84  
+#define SETFEATURES_DIS_APM 0x85  
+#define SETFEATURES_EN_ECC 0x88  
+#define SETFEATURES_EN_MSN 0x95  
+#define SETFEATURES_EN_RETRY 0x99  
+#define SETFEATURES_EN_RLA 0xAA  
+#define SETFEATURES_PREFETCH 0xAB  
+#define SETFEATURES_EN_REST 0xAC  
+#define SETFEATURES_4B_RW_LONG 0xBB  
+#define SETFEATURES_DIS_AAM 0xC2  
+#define SETFEATURES_EN_RPOD 0xCC  
+#define SETFEATURES_DIS_RI 0xDD  
+#define SETFEATURES_EN_SAME_M 0xDD  
+#define SETFEATURES_DIS_SI 0xDE  
+
+#define SECURITY_SET_PASSWORD 0xBA
+#define SECURITY_UNLOCK 0xBB
+#define SECURITY_ERASE_PREPARE 0xBC
+#define SECURITY_ERASE_UNIT 0xBD
+#define SECURITY_FREEZE_LOCK 0xBE
+#define SECURITY_DISABLE_PASSWORD 0xBF
+
+struct hd_geometry {
+ unsigned char heads;
+ unsigned char sectors;
+ unsigned short cylinders;
+ unsigned long start;
+};
+
+#define HDIO_GETGEO 0x0301  
+#define HDIO_GET_UNMASKINTR 0x0302  
+#define HDIO_GET_MULTCOUNT 0x0304  
+#define HDIO_GET_QDMA 0x0305  
+
+#define HDIO_SET_XFER 0x0306  
+
+#define HDIO_OBSOLETE_IDENTITY 0x0307  
+#define HDIO_GET_KEEPSETTINGS 0x0308  
+#define HDIO_GET_32BIT 0x0309  
+#define HDIO_GET_NOWERR 0x030a  
+#define HDIO_GET_DMA 0x030b  
+#define HDIO_GET_NICE 0x030c  
+#define HDIO_GET_IDENTITY 0x030d  
+#define HDIO_GET_WCACHE 0x030e  
+#define HDIO_GET_ACOUSTIC 0x030f  
+#define HDIO_GET_ADDRESS 0x0310  
+
+#define HDIO_GET_BUSSTATE 0x031a  
+#define HDIO_TRISTATE_HWIF 0x031b  
+#define HDIO_DRIVE_RESET 0x031c  
+#define HDIO_DRIVE_TASKFILE 0x031d  
+#define HDIO_DRIVE_TASK 0x031e  
+#define HDIO_DRIVE_CMD 0x031f  
+#define HDIO_DRIVE_CMD_AEB HDIO_DRIVE_TASK
+
+#define HDIO_SET_MULTCOUNT 0x0321  
+#define HDIO_SET_UNMASKINTR 0x0322  
+#define HDIO_SET_KEEPSETTINGS 0x0323  
+#define HDIO_SET_32BIT 0x0324  
+#define HDIO_SET_NOWERR 0x0325  
+#define HDIO_SET_DMA 0x0326  
+#define HDIO_SET_PIO_MODE 0x0327  
+#define HDIO_SCAN_HWIF 0x0328  
+#define HDIO_SET_NICE 0x0329  
+#define HDIO_UNREGISTER_HWIF 0x032a  
+#define HDIO_SET_WCACHE 0x032b  
+#define HDIO_SET_ACOUSTIC 0x032c  
+#define HDIO_SET_BUSSTATE 0x032d  
+#define HDIO_SET_QDMA 0x032e  
+#define HDIO_SET_ADDRESS 0x032f  
+
+enum {
+ BUSSTATE_OFF = 0,
+ BUSSTATE_ON,
+ BUSSTATE_TRISTATE
+};
+
+#define __NEW_HD_DRIVE_ID
+
+struct hd_driveid {
+ unsigned short config;
+ unsigned short cyls;
+ unsigned short reserved2;
+ unsigned short heads;
+ unsigned short track_bytes;
+ unsigned short sector_bytes;
+ unsigned short sectors;
+ unsigned short vendor0;
+ unsigned short vendor1;
+ unsigned short vendor2;
+ unsigned char serial_no[20];
+ unsigned short buf_type;
+ unsigned short buf_size;
+ unsigned short ecc_bytes;
+ unsigned char fw_rev[8];
+ unsigned char model[40];
+ unsigned char max_multsect;
+ unsigned char vendor3;
+ unsigned short dword_io;
+ unsigned char vendor4;
+ unsigned char capability;
+ unsigned short reserved50;
+ unsigned char vendor5;
+ unsigned char tPIO;
+ unsigned char vendor6;
+ unsigned char tDMA;
+ unsigned short field_valid;
+ unsigned short cur_cyls;
+ unsigned short cur_heads;
+ unsigned short cur_sectors;
+ unsigned short cur_capacity0;
+ unsigned short cur_capacity1;
+ unsigned char multsect;
+ unsigned char multsect_valid;
+ unsigned int lba_capacity;
+ unsigned short dma_1word;
+ unsigned short dma_mword;
+ unsigned short eide_pio_modes;
+ unsigned short eide_dma_min;
+ unsigned short eide_dma_time;
+ unsigned short eide_pio;
+ unsigned short eide_pio_iordy;
+ unsigned short words69_70[2];
+
+ unsigned short words71_74[4];
+ unsigned short queue_depth;
+ unsigned short words76_79[4];
+ unsigned short major_rev_num;
+ unsigned short minor_rev_num;
+ unsigned short command_set_1;
+ unsigned short command_set_2;
+ unsigned short cfsse;
+ unsigned short cfs_enable_1;
+ unsigned short cfs_enable_2;
+ unsigned short csf_default;
+ unsigned short dma_ultra;
+ unsigned short trseuc;
+ unsigned short trsEuc;
+ unsigned short CurAPMvalues;
+ unsigned short mprc;
+ unsigned short hw_config;
+ unsigned short acoustic;
+ unsigned short msrqs;
+ unsigned short sxfert;
+ unsigned short sal;
+ unsigned int spg;
+ unsigned long long lba_capacity_2;
+ unsigned short words104_125[22];
+ unsigned short last_lun;
+ unsigned short word127;
+ unsigned short dlf;
+ unsigned short csfo;
+ unsigned short words130_155[26];
+ unsigned short word156;
+ unsigned short words157_159[3];
+ unsigned short cfa_power;
+ unsigned short words161_175[15];
+ unsigned short words176_205[30];
+ unsigned short words206_254[49];
+ unsigned short integrity_word;
+};
+
+#define IDE_NICE_DSC_OVERLAP (0)  
+#define IDE_NICE_ATAPI_OVERLAP (1)  
+#define IDE_NICE_0 (2)  
+#define IDE_NICE_1 (3)  
+#define IDE_NICE_2 (4)  
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/hdsmart.h b/ndk/platforms/android-3/include/linux/hdsmart.h
new file mode 100644
index 0000000..6cbc653
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/hdsmart.h
@@ -0,0 +1,114 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_HDSMART_H
+#define _LINUX_HDSMART_H
+
+#define OFFLINE_FULL_SCAN 0
+#define SHORT_SELF_TEST 1
+#define EXTEND_SELF_TEST 2
+#define SHORT_CAPTIVE_SELF_TEST 129
+#define EXTEND_CAPTIVE_SELF_TEST 130
+
+typedef struct ata_smart_attribute_s {
+ unsigned char id;
+ unsigned short status_flag;
+ unsigned char normalized;
+ unsigned char worse_normal;
+ unsigned char raw[6];
+ unsigned char reserv;
+} __attribute__ ((packed)) ata_smart_attribute_t;
+
+typedef struct ata_smart_values_s {
+ unsigned short revnumber;
+ ata_smart_attribute_t vendor_attributes [30];
+ unsigned char offline_data_collection_status;
+ unsigned char self_test_exec_status;
+ unsigned short total_time_to_complete_off_line;
+ unsigned char vendor_specific_366;
+ unsigned char offline_data_collection_capability;
+ unsigned short smart_capability;
+ unsigned char errorlog_capability;
+ unsigned char vendor_specific_371;
+ unsigned char short_test_completion_time;
+ unsigned char extend_test_completion_time;
+ unsigned char reserved_374_385 [12];
+ unsigned char vendor_specific_386_509 [125];
+ unsigned char chksum;
+} __attribute__ ((packed)) ata_smart_values_t;
+
+typedef struct ata_smart_threshold_entry_s {
+ unsigned char id;
+ unsigned char normalized_threshold;
+ unsigned char reserved[10];
+} __attribute__ ((packed)) ata_smart_threshold_entry_t;
+
+typedef struct ata_smart_thresholds_s {
+ unsigned short revnumber;
+ ata_smart_threshold_entry_t thres_entries[30];
+ unsigned char reserved[149];
+ unsigned char chksum;
+} __attribute__ ((packed)) ata_smart_thresholds_t;
+
+typedef struct ata_smart_errorlog_command_struct_s {
+ unsigned char devicecontrolreg;
+ unsigned char featuresreg;
+ unsigned char sector_count;
+ unsigned char sector_number;
+ unsigned char cylinder_low;
+ unsigned char cylinder_high;
+ unsigned char drive_head;
+ unsigned char commandreg;
+ unsigned int timestamp;
+} __attribute__ ((packed)) ata_smart_errorlog_command_struct_t;
+
+typedef struct ata_smart_errorlog_error_struct_s {
+ unsigned char error_condition;
+ unsigned char extended_error[14];
+ unsigned char state;
+ unsigned short timestamp;
+} __attribute__ ((packed)) ata_smart_errorlog_error_struct_t;
+
+typedef struct ata_smart_errorlog_struct_s {
+ ata_smart_errorlog_command_struct_t commands[6];
+ ata_smart_errorlog_error_struct_t error_struct;
+} __attribute__ ((packed)) ata_smart_errorlog_struct_t;
+
+typedef struct ata_smart_errorlog_s {
+ unsigned char revnumber;
+ unsigned char error_log_pointer;
+ ata_smart_errorlog_struct_t errorlog_struct[5];
+ unsigned short ata_error_count;
+ unsigned short non_fatal_count;
+ unsigned short drive_timeout_count;
+ unsigned char reserved[53];
+ unsigned char chksum;
+} __attribute__ ((packed)) ata_smart_errorlog_t;
+
+typedef struct ata_smart_selftestlog_struct_s {
+ unsigned char selftestnumber;
+ unsigned char selfteststatus;
+ unsigned short timestamp;
+ unsigned char selftestfailurecheckpoint;
+ unsigned int lbafirstfailure;
+ unsigned char vendorspecific[15];
+} __attribute__ ((packed)) ata_smart_selftestlog_struct_t;
+
+typedef struct ata_smart_selftestlog_s {
+ unsigned short revnumber;
+ ata_smart_selftestlog_struct_t selftest_struct[21];
+ unsigned char vendorspecific[2];
+ unsigned char mostrecenttest;
+ unsigned char resevered[2];
+ unsigned char chksum;
+} __attribute__ ((packed)) ata_smart_selftestlog_t;
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/highmem.h b/ndk/platforms/android-3/include/linux/highmem.h
new file mode 100644
index 0000000..d4a34ca
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/highmem.h
@@ -0,0 +1,31 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_HIGHMEM_H
+#define _LINUX_HIGHMEM_H
+
+#include <linux/fs.h>
+#include <linux/mm.h>
+
+#include <asm/cacheflush.h>
+
+#ifndef ARCH_HAS_FLUSH_ANON_PAGE
+#endif
+#ifndef ARCH_HAS_FLUSH_KERNEL_DCACHE_PAGE
+#endif
+#define kunmap(page) do { (void) (page); } while (0)
+#define kmap_atomic(page, idx) page_address(page)
+#define kunmap_atomic(addr, idx) do { } while (0)
+#define kmap_atomic_pfn(pfn, idx) page_address(pfn_to_page(pfn))
+#define kmap_atomic_to_page(ptr) virt_to_page(ptr)
+#ifndef __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE
+#endif
+#endif
diff --git a/ndk/platforms/android-3/include/linux/hil.h b/ndk/platforms/android-3/include/linux/hil.h
new file mode 100644
index 0000000..a0b3b97
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/hil.h
@@ -0,0 +1,256 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _HIL_H_
+#define _HIL_H_
+
+#include <asm/types.h>
+
+#define HIL_CLOCK 8MHZ
+#define HIL_EK1_CLOCK 30HZ
+#define HIL_EK2_CLOCK 60HZ
+
+#define HIL_TIMEOUT_DEV 5  
+#define HIL_TIMEOUT_DEVS 10  
+#define HIL_TIMEOUT_NORESP 10  
+#define HIL_TIMEOUT_DEVS_DATA 16  
+#define HIL_TIMEOUT_SELFTEST 200  
+
+#define HIL_WIRE_PACKET_LEN 15
+enum hil_wire_bitpos {
+ HIL_WIRE_START = 0,
+ HIL_WIRE_ADDR2,
+ HIL_WIRE_ADDR1,
+ HIL_WIRE_ADDR0,
+ HIL_WIRE_COMMAND,
+ HIL_WIRE_DATA7,
+ HIL_WIRE_DATA6,
+ HIL_WIRE_DATA5,
+ HIL_WIRE_DATA4,
+ HIL_WIRE_DATA3,
+ HIL_WIRE_DATA2,
+ HIL_WIRE_DATA1,
+ HIL_WIRE_DATA0,
+ HIL_WIRE_PARITY,
+ HIL_WIRE_STOP
+};
+
+enum hil_pkt_bitpos {
+ HIL_PKT_CMD = 0x00000800,
+ HIL_PKT_ADDR2 = 0x00000400,
+ HIL_PKT_ADDR1 = 0x00000200,
+ HIL_PKT_ADDR0 = 0x00000100,
+ HIL_PKT_ADDR_MASK = 0x00000700,
+ HIL_PKT_ADDR_SHIFT = 8,
+ HIL_PKT_DATA7 = 0x00000080,
+ HIL_PKT_DATA6 = 0x00000040,
+ HIL_PKT_DATA5 = 0x00000020,
+ HIL_PKT_DATA4 = 0x00000010,
+ HIL_PKT_DATA3 = 0x00000008,
+ HIL_PKT_DATA2 = 0x00000004,
+ HIL_PKT_DATA1 = 0x00000002,
+ HIL_PKT_DATA0 = 0x00000001,
+ HIL_PKT_DATA_MASK = 0x000000FF,
+ HIL_PKT_DATA_SHIFT = 0
+};
+
+enum hil_error_bitpos {
+ HIL_ERR_OB = 0x00000800,
+ HIL_ERR_INT = 0x00010000,
+ HIL_ERR_NMI = 0x00020000,
+ HIL_ERR_LERR = 0x00040000,
+ HIL_ERR_PERR = 0x01000000,
+ HIL_ERR_FERR = 0x02000000,
+ HIL_ERR_FOF = 0x04000000
+};
+
+enum hil_control_bitpos {
+ HIL_CTRL_TEST = 0x00010000,
+ HIL_CTRL_IPF = 0x00040000,
+ HIL_CTRL_APE = 0x02000000
+};
+
+#define HIL_DO_ALTER_CTRL 0x40000000  
+#define HIL_CTRL_ONLY 0xc0000000  
+
+typedef u32 hil_packet;
+
+enum hil_command {
+ HIL_CMD_IFC = 0x00,
+ HIL_CMD_EPT = 0x01,
+ HIL_CMD_ELB = 0x02,
+ HIL_CMD_IDD = 0x03,
+ HIL_CMD_DSR = 0x04,
+ HIL_CMD_PST = 0x05,
+ HIL_CMD_RRG = 0x06,
+ HIL_CMD_WRG = 0x07,
+ HIL_CMD_ACF = 0x08,
+ HIL_CMDID_ACF = 0x07,
+ HIL_CMD_POL = 0x10,
+ HIL_CMDCT_POL = 0x0f,
+ HIL_CMD_RPL = 0x20,
+ HIL_CMDCT_RPL = 0x0f,
+ HIL_CMD_RNM = 0x30,
+ HIL_CMD_RST = 0x31,
+ HIL_CMD_EXD = 0x32,
+ HIL_CMD_RSC = 0x33,
+
+ HIL_CMD_DKA = 0x3d,
+ HIL_CMD_EK1 = 0x3e,
+ HIL_CMD_EK2 = 0x3f,
+ HIL_CMD_PR1 = 0x40,
+ HIL_CMD_PR2 = 0x41,
+ HIL_CMD_PR3 = 0x42,
+ HIL_CMD_PR4 = 0x43,
+ HIL_CMD_PR5 = 0x44,
+ HIL_CMD_PR6 = 0x45,
+ HIL_CMD_PR7 = 0x46,
+ HIL_CMD_PRM = 0x47,
+ HIL_CMD_AK1 = 0x48,
+ HIL_CMD_AK2 = 0x49,
+ HIL_CMD_AK3 = 0x4a,
+ HIL_CMD_AK4 = 0x4b,
+ HIL_CMD_AK5 = 0x4c,
+ HIL_CMD_AK6 = 0x4d,
+ HIL_CMD_AK7 = 0x4e,
+ HIL_CMD_ACK = 0x4f,
+
+ HIL_CMD_RIO = 0xfa,
+ HIL_CMD_SHR = 0xfb,
+ HIL_CMD_TER = 0xfc,
+ HIL_CMD_CAE = 0xfd,
+ HIL_CMD_DHR = 0xfe,
+
+};
+
+#define HIL_IDD_DID_TYPE_MASK 0xe0  
+#define HIL_IDD_DID_TYPE_KB_INTEGRAL 0xa0  
+#define HIL_IDD_DID_TYPE_KB_ITF 0xc0  
+#define HIL_IDD_DID_TYPE_KB_RSVD 0xe0  
+#define HIL_IDD_DID_TYPE_KB_LANG_MASK 0x1f  
+#define HIL_IDD_DID_KBLANG_USE_ESD 0x00  
+#define HIL_IDD_DID_TYPE_ABS 0x80  
+#define HIL_IDD_DID_ABS_RSVD1_MASK 0xf8  
+#define HIL_IDD_DID_ABS_RSVD1 0x98
+#define HIL_IDD_DID_ABS_TABLET_MASK 0xf8  
+#define HIL_IDD_DID_ABS_TABLET 0x90
+#define HIL_IDD_DID_ABS_TSCREEN_MASK 0xfc  
+#define HIL_IDD_DID_ABS_TSCREEN 0x8c
+#define HIL_IDD_DID_ABS_RSVD2_MASK 0xfc  
+#define HIL_IDD_DID_ABS_RSVD2 0x88
+#define HIL_IDD_DID_ABS_RSVD3_MASK 0xfc  
+#define HIL_IDD_DID_ABS_RSVD3 0x80
+#define HIL_IDD_DID_TYPE_REL 0x60  
+#define HIL_IDD_DID_REL_RSVD1_MASK 0xf0  
+#define HIL_IDD_DID_REL_RSVD1 0x70
+#define HIL_IDD_DID_REL_RSVD2_MASK 0xfc  
+#define HIL_IDD_DID_REL_RSVD2 0x6c
+#define HIL_IDD_DID_REL_MOUSE_MASK 0xfc  
+#define HIL_IDD_DID_REL_MOUSE 0x68
+#define HIL_IDD_DID_REL_QUAD_MASK 0xf8  
+#define HIL_IDD_DID_REL_QUAD 0x60
+#define HIL_IDD_DID_TYPE_CHAR 0x40  
+#define HIL_IDD_DID_CHAR_BARCODE_MASK 0xfc  
+#define HIL_IDD_DID_CHAR_BARCODE 0x5c
+#define HIL_IDD_DID_CHAR_RSVD1_MASK 0xfc  
+#define HIL_IDD_DID_CHAR_RSVD1 0x58
+#define HIL_IDD_DID_CHAR_RSVD2_MASK 0xf8  
+#define HIL_IDD_DID_CHAR_RSVD2 0x50
+#define HIL_IDD_DID_CHAR_RSVD3_MASK 0xf0  
+#define HIL_IDD_DID_CHAR_RSVD3 0x40
+#define HIL_IDD_DID_TYPE_OTHER 0x20  
+#define HIL_IDD_DID_OTHER_RSVD1_MASK 0xf0  
+#define HIL_IDD_DID_OTHER_RSVD1 0x30
+#define HIL_IDD_DID_OTHER_BARCODE_MASK 0xfc  
+#define HIL_IDD_DID_OTHER_BARCODE 0x2c
+#define HIL_IDD_DID_OTHER_RSVD2_MASK 0xfc  
+#define HIL_IDD_DID_OTHER_RSVD2 0x28
+#define HIL_IDD_DID_OTHER_RSVD3_MASK 0xf8  
+#define HIL_IDD_DID_OTHER_RSVD3 0x20
+#define HIL_IDD_DID_TYPE_KEYPAD 0x00  
+
+#define HIL_IDD_HEADER_AXSET_MASK 0x03  
+#define HIL_IDD_HEADER_RSC 0x04  
+#define HIL_IDD_HEADER_EXD 0x08  
+#define HIL_IDD_HEADER_IOD 0x10  
+#define HIL_IDD_HEADER_16BIT 0x20  
+#define HIL_IDD_HEADER_ABS 0x40  
+#define HIL_IDD_HEADER_2X_AXIS 0x80  
+
+#define HIL_IDD_IOD_NBUTTON_MASK 0x07  
+#define HIL_IDD_IOD_PROXIMITY 0x08  
+#define HIL_IDD_IOD_PROMPT_MASK 0x70  
+#define HIL_IDD_IOD_PROMPT_SHIFT 4
+#define HIL_IDD_IOD_PROMPT 0x80  
+
+#define HIL_IDD_NUM_AXES_PER_SET(header_packet)  ((header_packet) & HIL_IDD_HEADER_AXSET_MASK)
+
+#define HIL_IDD_NUM_AXSETS(header_packet)  (2 - !((header_packet) & HIL_IDD_HEADER_2X_AXIS))
+
+#define HIL_IDD_LEN(header_packet)  ((4 - !(header_packet & HIL_IDD_HEADER_IOD) -   2 * !(HIL_IDD_NUM_AXES_PER_SET(header_packet))) +   2 * HIL_IDD_NUM_AXES_PER_SET(header_packet) *   !!((header_packet) & HIL_IDD_HEADER_ABS))
+
+#define HIL_IDD_AXIS_COUNTS_PER_M(header_ptr)  (!(HIL_IDD_NUM_AXSETS(*(header_ptr))) ? -1 :  (((*(header_ptr + 1) & HIL_PKT_DATA_MASK) +   ((*(header_ptr + 2) & HIL_PKT_DATA_MASK)) << 8)  * ((*(header_ptr) & HIL_IDD_HEADER_16BIT) ? 100 : 1)))
+
+#define HIL_IDD_AXIS_MAX(header_ptr, __axnum)  ((!(*(header_ptr) & HIL_IDD_HEADER_ABS) ||   (HIL_IDD_NUM_AXES_PER_SET(*(header_ptr)) <= __axnum)) ? 0 :   ((HIL_PKT_DATA_MASK & *((header_ptr) + 3 + 2 * __axnum)) +   ((HIL_PKT_DATA_MASK & *((header_ptr) + 4 + 2 * __axnum)) << 8)))
+
+#define HIL_IDD_IOD(header_ptr)  (*(header_ptr + HIL_IDD_LEN((*header_ptr)) - 1))
+
+#define HIL_IDD_HAS_GEN_PROMPT(header_ptr)  ((*header_ptr & HIL_IDD_HEADER_IOD) &&   (HIL_IDD_IOD(header_ptr) & HIL_IDD_IOD_PROMPT))
+
+#define HIL_IDD_HAS_GEN_PROXIMITY(header_ptr)  ((*header_ptr & HIL_IDD_HEADER_IOD) &&   (HIL_IDD_IOD(header_ptr) & HIL_IDD_IOD_PROXIMITY))
+
+#define HIL_IDD_NUM_BUTTONS(header_ptr)  ((*header_ptr & HIL_IDD_HEADER_IOD) ?   (HIL_IDD_IOD(header_ptr) & HIL_IDD_IOD_NBUTTON_MASK) : 0)
+
+#define HIL_IDD_NUM_PROMPTS(header_ptr)  ((*header_ptr & HIL_IDD_HEADER_IOD) ?   ((HIL_IDD_IOD(header_ptr) & HIL_IDD_IOD_NPROMPT_MASK)   >> HIL_IDD_IOD_PROMPT_SHIFT) : 0)
+
+#define HIL_EXD_HEADER_WRG 0x03  
+#define HIL_EXD_HEADER_WRG_TYPE1 0x01  
+#define HIL_EXD_HEADER_WRG_TYPE2 0x02  
+#define HIL_EXD_HEADER_RRG 0x04  
+#define HIL_EXD_HEADER_RNM 0x10  
+#define HIL_EXD_HEADER_RST 0x20  
+#define HIL_EXD_HEADER_LOCALE 0x40  
+
+#define HIL_EXD_NUM_RRG(header_ptr)  ((*header_ptr & HIL_EXD_HEADER_RRG) ?   (*(header_ptr + 1) & HIL_PKT_DATA_MASK) : 0)
+
+#define HIL_EXD_NUM_WWG(header_ptr)  ((*header_ptr & HIL_EXD_HEADER_WRG) ?   (*(header_ptr + 2 - !(*header_ptr & HIL_EXD_HEADER_RRG)) &   HIL_PKT_DATA_MASK) : 0)
+
+#define HIL_EXD_LEN(header_ptr)  (!!(*header_ptr & HIL_EXD_HEADER_RRG) +   !!(*header_ptr & HIL_EXD_HEADER_WRG) +   !!(*header_ptr & HIL_EXD_HEADER_LOCALE) +   2 * !!(*header_ptr & HIL_EXD_HEADER_WRG_TYPE2) + 1)
+
+#define HIL_EXD_LOCALE(header_ptr)  (!(*header_ptr & HIL_EXD_HEADER_LOCALE) ? -1 :   (*(header_ptr + HIL_EXD_LEN(header_ptr) - 1) & HIL_PKT_DATA_MASK))
+
+#define HIL_EXD_WRG_TYPE2_LEN(header_ptr)  (!(*header_ptr & HIL_EXD_HEADER_WRG_TYPE2) ? -1 :   (*(header_ptr + HIL_EXD_LEN(header_ptr) - 2 -   !!(*header_ptr & HIL_EXD_HEADER_LOCALE)) & HIL_PKT_DATA_MASK) +   ((*(header_ptr + HIL_EXD_LEN(header_ptr) - 1 -   !!(*header_ptr & HIL_EXD_HEADER_LOCALE)) & HIL_PKT_DATA_MASK) << 8))
+
+#define HIL_LOCALE_MAX 0x1f
+
+#define HIL_LOCALE_MAP  "",    "",    "",    "swiss.french",    "portuguese",    "arabic",    "hebrew",    "english.canadian",    "turkish",    "greek",    "thai",    "italian",    "korean",    "dutch",    "swedish",    "german",    "chinese",    "chinese",    "swiss.french",    "spanish",    "swiss.german",    "flemish",    "finnish",    "english.uk",    "french.canadian",    "swiss.german",    "norwegian",    "french",    "danish",    "japanese",    "spanish",   "english.us"    
+
+#define HIL_KEYCODES_SET1_TBLSIZE 128
+#define HIL_KEYCODES_SET1   KEY_5, KEY_RESERVED, KEY_RIGHTALT, KEY_LEFTALT,   KEY_RIGHTSHIFT, KEY_LEFTSHIFT, KEY_LEFTCTRL, KEY_SYSRQ,   KEY_KP4, KEY_KP8, KEY_KP5, KEY_KP9,   KEY_KP6, KEY_KP7, KEY_KPCOMMA, KEY_KPENTER,   KEY_KP1, KEY_KPSLASH, KEY_KP2, KEY_KPPLUS,   KEY_KP3, KEY_KPASTERISK, KEY_KP0, KEY_KPMINUS,   KEY_B, KEY_V, KEY_C, KEY_X,   KEY_Z, KEY_RESERVED, KEY_RESERVED, KEY_ESC,   KEY_6, KEY_F10, KEY_3, KEY_F11,   KEY_KPDOT, KEY_F9, KEY_TAB  , KEY_F12,   KEY_H, KEY_G, KEY_F, KEY_D,   KEY_S, KEY_A, KEY_RESERVED, KEY_CAPSLOCK,   KEY_U, KEY_Y, KEY_T, KEY_R,   KEY_E, KEY_W, KEY_Q, KEY_TAB,   KEY_7, KEY_6, KEY_5, KEY_4,   KEY_3, KEY_2, KEY_1, KEY_GRAVE,   KEY_F13, KEY_F14, KEY_F15, KEY_F16,   KEY_F17, KEY_F18, KEY_F19, KEY_F20,   KEY_MENU, KEY_F4, KEY_F3, KEY_F2,   KEY_F1, KEY_VOLUMEUP, KEY_STOP, KEY_SENDFILE,   KEY_SYSRQ, KEY_F5, KEY_F6, KEY_F7,   KEY_F8, KEY_VOLUMEDOWN, KEY_DEL_EOL, KEY_DEL_EOS,   KEY_8, KEY_9, KEY_0, KEY_MINUS,   KEY_EQUAL, KEY_BACKSPACE, KEY_INS_LINE, KEY_DEL_LINE,   KEY_I, KEY_O, KEY_P, KEY_LEFTBRACE,   KEY_RIGHTBRACE, KEY_BACKSLASH, KEY_INSERT, KEY_DELETE,   KEY_J, KEY_K, KEY_L, KEY_SEMICOLON,   KEY_APOSTROPHE, KEY_ENTER, KEY_HOME, KEY_PAGEUP,   KEY_M, KEY_COMMA, KEY_DOT, KEY_SLASH,   KEY_BACKSLASH, KEY_SELECT, KEY_102ND, KEY_PAGEDOWN,   KEY_N, KEY_SPACE, KEY_NEXT, KEY_RESERVED,   KEY_LEFT, KEY_DOWN, KEY_UP, KEY_RIGHT
+
+#define HIL_KEYCODES_SET3_TBLSIZE 128
+#define HIL_KEYCODES_SET3   KEY_RESERVED, KEY_ESC, KEY_1, KEY_2,   KEY_3, KEY_4, KEY_5, KEY_6,   KEY_7, KEY_8, KEY_9, KEY_0,   KEY_MINUS, KEY_EQUAL, KEY_BACKSPACE, KEY_TAB,   KEY_Q, KEY_W, KEY_E, KEY_R,   KEY_T, KEY_Y, KEY_U, KEY_I,   KEY_O, KEY_P, KEY_LEFTBRACE, KEY_RIGHTBRACE,   KEY_ENTER, KEY_LEFTCTRL, KEY_A, KEY_S,   KEY_D, KEY_F, KEY_G, KEY_H,   KEY_J, KEY_K, KEY_L, KEY_SEMICOLON,   KEY_APOSTROPHE,KEY_GRAVE, KEY_LEFTSHIFT, KEY_BACKSLASH,   KEY_Z, KEY_X, KEY_C, KEY_V,   KEY_B, KEY_N, KEY_M, KEY_COMMA,   KEY_DOT, KEY_SLASH, KEY_RIGHTSHIFT, KEY_KPASTERISK,   KEY_LEFTALT, KEY_SPACE, KEY_CAPSLOCK, KEY_F1,   KEY_F2, KEY_F3, KEY_F4, KEY_F5,   KEY_F6, KEY_F7, KEY_F8, KEY_F9,   KEY_F10, KEY_NUMLOCK, KEY_SCROLLLOCK, KEY_KP7,   KEY_KP8, KEY_KP9, KEY_KPMINUS, KEY_KP4,   KEY_KP5, KEY_KP6, KEY_KPPLUS, KEY_KP1,   KEY_KP2, KEY_KP3, KEY_KP0, KEY_KPDOT,   KEY_SYSRQ, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED,   KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED,   KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED,   KEY_UP, KEY_LEFT, KEY_DOWN, KEY_RIGHT,   KEY_HOME, KEY_PAGEUP, KEY_END, KEY_PAGEDOWN,   KEY_INSERT, KEY_DELETE, KEY_102ND, KEY_RESERVED,   KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED,   KEY_F1, KEY_F2, KEY_F3, KEY_F4,   KEY_F5, KEY_F6, KEY_F7, KEY_F8,   KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED,   KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED
+
+#define HIL_POL_NUM_AXES_MASK 0x03  
+#define HIL_POL_CTS 0x04  
+#define HIL_POL_STATUS_PENDING 0x08  
+#define HIL_POL_CHARTYPE_MASK 0x70  
+#define HIL_POL_CHARTYPE_NONE 0x00  
+#define HIL_POL_CHARTYPE_RSVD1 0x10  
+#define HIL_POL_CHARTYPE_ASCII 0x20  
+#define HIL_POL_CHARTYPE_BINARY 0x30  
+#define HIL_POL_CHARTYPE_SET1 0x40  
+#define HIL_POL_CHARTYPE_RSVD2 0x50  
+#define HIL_POL_CHARTYPE_SET2 0x60  
+#define HIL_POL_CHARTYPE_SET3 0x70  
+#define HIL_POL_AXIS_ALT 0x80  
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/i2c.h b/ndk/platforms/android-3/include/linux/i2c.h
new file mode 100644
index 0000000..9513fc6
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/i2c.h
@@ -0,0 +1,95 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_I2C_H
+#define _LINUX_I2C_H
+
+#include <linux/types.h>
+
+struct i2c_msg {
+ __u16 addr;
+ __u16 flags;
+#define I2C_M_TEN 0x10  
+#define I2C_M_RD 0x01
+#define I2C_M_NOSTART 0x4000
+#define I2C_M_REV_DIR_ADDR 0x2000
+#define I2C_M_IGNORE_NAK 0x1000
+#define I2C_M_NO_RD_ACK 0x0800
+ __u16 len;
+ __u8 *buf;
+};
+
+#define I2C_FUNC_I2C 0x00000001
+#define I2C_FUNC_10BIT_ADDR 0x00000002
+#define I2C_FUNC_PROTOCOL_MANGLING 0x00000004  
+#define I2C_FUNC_SMBUS_HWPEC_CALC 0x00000008  
+#define I2C_FUNC_SMBUS_BLOCK_PROC_CALL 0x00008000  
+#define I2C_FUNC_SMBUS_QUICK 0x00010000 
+#define I2C_FUNC_SMBUS_READ_BYTE 0x00020000 
+#define I2C_FUNC_SMBUS_WRITE_BYTE 0x00040000 
+#define I2C_FUNC_SMBUS_READ_BYTE_DATA 0x00080000 
+#define I2C_FUNC_SMBUS_WRITE_BYTE_DATA 0x00100000 
+#define I2C_FUNC_SMBUS_READ_WORD_DATA 0x00200000 
+#define I2C_FUNC_SMBUS_WRITE_WORD_DATA 0x00400000 
+#define I2C_FUNC_SMBUS_PROC_CALL 0x00800000 
+#define I2C_FUNC_SMBUS_READ_BLOCK_DATA 0x01000000 
+#define I2C_FUNC_SMBUS_WRITE_BLOCK_DATA 0x02000000 
+#define I2C_FUNC_SMBUS_READ_I2C_BLOCK 0x04000000  
+#define I2C_FUNC_SMBUS_WRITE_I2C_BLOCK 0x08000000  
+#define I2C_FUNC_SMBUS_READ_I2C_BLOCK_2 0x10000000  
+#define I2C_FUNC_SMBUS_WRITE_I2C_BLOCK_2 0x20000000  
+
+#define I2C_FUNC_SMBUS_BYTE (I2C_FUNC_SMBUS_READ_BYTE |   I2C_FUNC_SMBUS_WRITE_BYTE)
+#define I2C_FUNC_SMBUS_BYTE_DATA (I2C_FUNC_SMBUS_READ_BYTE_DATA |   I2C_FUNC_SMBUS_WRITE_BYTE_DATA)
+#define I2C_FUNC_SMBUS_WORD_DATA (I2C_FUNC_SMBUS_READ_WORD_DATA |   I2C_FUNC_SMBUS_WRITE_WORD_DATA)
+#define I2C_FUNC_SMBUS_BLOCK_DATA (I2C_FUNC_SMBUS_READ_BLOCK_DATA |   I2C_FUNC_SMBUS_WRITE_BLOCK_DATA)
+#define I2C_FUNC_SMBUS_I2C_BLOCK (I2C_FUNC_SMBUS_READ_I2C_BLOCK |   I2C_FUNC_SMBUS_WRITE_I2C_BLOCK)
+#define I2C_FUNC_SMBUS_I2C_BLOCK_2 (I2C_FUNC_SMBUS_READ_I2C_BLOCK_2 |   I2C_FUNC_SMBUS_WRITE_I2C_BLOCK_2)
+
+#define I2C_FUNC_SMBUS_EMUL (I2C_FUNC_SMBUS_QUICK |   I2C_FUNC_SMBUS_BYTE |   I2C_FUNC_SMBUS_BYTE_DATA |   I2C_FUNC_SMBUS_WORD_DATA |   I2C_FUNC_SMBUS_PROC_CALL |   I2C_FUNC_SMBUS_WRITE_BLOCK_DATA |   I2C_FUNC_SMBUS_I2C_BLOCK)
+
+#define I2C_SMBUS_BLOCK_MAX 32   
+union i2c_smbus_data {
+ __u8 byte;
+ __u16 word;
+ __u8 block[I2C_SMBUS_BLOCK_MAX + 2];
+
+};
+
+#define I2C_SMBUS_READ 1
+#define I2C_SMBUS_WRITE 0
+
+#define I2C_SMBUS_QUICK 0
+#define I2C_SMBUS_BYTE 1
+#define I2C_SMBUS_BYTE_DATA 2 
+#define I2C_SMBUS_WORD_DATA 3
+#define I2C_SMBUS_PROC_CALL 4
+#define I2C_SMBUS_BLOCK_DATA 5
+#define I2C_SMBUS_I2C_BLOCK_DATA 6
+#define I2C_SMBUS_BLOCK_PROC_CALL 7  
+
+#define I2C_RETRIES 0x0701  
+
+#define I2C_TIMEOUT 0x0702  
+
+#define I2C_SLAVE 0x0703  
+
+#define I2C_SLAVE_FORCE 0x0706  
+
+#define I2C_TENBIT 0x0704  
+
+#define I2C_FUNCS 0x0705  
+#define I2C_RDWR 0x0707  
+#define I2C_PEC 0x0708  
+
+#define I2C_SMBUS 0x0720  
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/icmp.h b/ndk/platforms/android-3/include/linux/icmp.h
new file mode 100644
index 0000000..c5b58bb
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/icmp.h
@@ -0,0 +1,81 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_ICMP_H
+#define _LINUX_ICMP_H
+
+#include <linux/types.h>
+
+#define ICMP_ECHOREPLY 0  
+#define ICMP_DEST_UNREACH 3  
+#define ICMP_SOURCE_QUENCH 4  
+#define ICMP_REDIRECT 5  
+#define ICMP_ECHO 8  
+#define ICMP_TIME_EXCEEDED 11  
+#define ICMP_PARAMETERPROB 12  
+#define ICMP_TIMESTAMP 13  
+#define ICMP_TIMESTAMPREPLY 14  
+#define ICMP_INFO_REQUEST 15  
+#define ICMP_INFO_REPLY 16  
+#define ICMP_ADDRESS 17  
+#define ICMP_ADDRESSREPLY 18  
+#define NR_ICMP_TYPES 18
+
+#define ICMP_NET_UNREACH 0  
+#define ICMP_HOST_UNREACH 1  
+#define ICMP_PROT_UNREACH 2  
+#define ICMP_PORT_UNREACH 3  
+#define ICMP_FRAG_NEEDED 4  
+#define ICMP_SR_FAILED 5  
+#define ICMP_NET_UNKNOWN 6
+#define ICMP_HOST_UNKNOWN 7
+#define ICMP_HOST_ISOLATED 8
+#define ICMP_NET_ANO 9
+#define ICMP_HOST_ANO 10
+#define ICMP_NET_UNR_TOS 11
+#define ICMP_HOST_UNR_TOS 12
+#define ICMP_PKT_FILTERED 13  
+#define ICMP_PREC_VIOLATION 14  
+#define ICMP_PREC_CUTOFF 15  
+#define NR_ICMP_UNREACH 15  
+
+#define ICMP_REDIR_NET 0  
+#define ICMP_REDIR_HOST 1  
+#define ICMP_REDIR_NETTOS 2  
+#define ICMP_REDIR_HOSTTOS 3  
+
+#define ICMP_EXC_TTL 0  
+#define ICMP_EXC_FRAGTIME 1  
+
+struct icmphdr {
+ __u8 type;
+ __u8 code;
+ __u16 checksum;
+ union {
+ struct {
+ __u16 id;
+ __u16 sequence;
+ } echo;
+ __u32 gateway;
+ struct {
+ __u16 __unused_field;
+ __u16 mtu;
+ } frag;
+ } un;
+};
+
+#define ICMP_FILTER 1
+
+struct icmp_filter {
+ __u32 data;
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/if.h b/ndk/platforms/android-3/include/linux/if.h
new file mode 100644
index 0000000..47c29d9
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/if.h
@@ -0,0 +1,176 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_IF_H
+#define _LINUX_IF_H
+
+#include <linux/types.h>  
+#include <linux/socket.h>  
+#include <linux/compiler.h>  
+
+#define IFNAMSIZ 16
+#include <linux/hdlc/ioctl.h>
+
+#define IFF_UP 0x1  
+#define IFF_BROADCAST 0x2  
+#define IFF_DEBUG 0x4  
+#define IFF_LOOPBACK 0x8  
+#define IFF_POINTOPOINT 0x10  
+#define IFF_NOTRAILERS 0x20  
+#define IFF_RUNNING 0x40  
+#define IFF_NOARP 0x80  
+#define IFF_PROMISC 0x100  
+#define IFF_ALLMULTI 0x200  
+
+#define IFF_MASTER 0x400  
+#define IFF_SLAVE 0x800  
+
+#define IFF_MULTICAST 0x1000  
+
+#define IFF_PORTSEL 0x2000  
+#define IFF_AUTOMEDIA 0x4000  
+#define IFF_DYNAMIC 0x8000  
+
+#define IFF_LOWER_UP 0x10000  
+#define IFF_DORMANT 0x20000  
+
+#define IFF_VOLATILE (IFF_LOOPBACK|IFF_POINTOPOINT|IFF_BROADCAST|  IFF_MASTER|IFF_SLAVE|IFF_RUNNING|IFF_LOWER_UP|IFF_DORMANT)
+
+#define IFF_802_1Q_VLAN 0x1  
+#define IFF_EBRIDGE 0x2  
+#define IFF_SLAVE_INACTIVE 0x4  
+#define IFF_MASTER_8023AD 0x8  
+#define IFF_MASTER_ALB 0x10  
+
+#define IF_GET_IFACE 0x0001  
+#define IF_GET_PROTO 0x0002
+
+#define IF_IFACE_V35 0x1000  
+#define IF_IFACE_V24 0x1001  
+#define IF_IFACE_X21 0x1002  
+#define IF_IFACE_T1 0x1003  
+#define IF_IFACE_E1 0x1004  
+#define IF_IFACE_SYNC_SERIAL 0x1005  
+#define IF_IFACE_X21D 0x1006  
+
+#define IF_PROTO_HDLC 0x2000  
+#define IF_PROTO_PPP 0x2001  
+#define IF_PROTO_CISCO 0x2002  
+#define IF_PROTO_FR 0x2003  
+#define IF_PROTO_FR_ADD_PVC 0x2004  
+#define IF_PROTO_FR_DEL_PVC 0x2005  
+#define IF_PROTO_X25 0x2006  
+#define IF_PROTO_HDLC_ETH 0x2007  
+#define IF_PROTO_FR_ADD_ETH_PVC 0x2008  
+#define IF_PROTO_FR_DEL_ETH_PVC 0x2009  
+#define IF_PROTO_FR_PVC 0x200A  
+#define IF_PROTO_FR_ETH_PVC 0x200B
+#define IF_PROTO_RAW 0x200C  
+
+enum {
+ IF_OPER_UNKNOWN,
+ IF_OPER_NOTPRESENT,
+ IF_OPER_DOWN,
+ IF_OPER_LOWERLAYERDOWN,
+ IF_OPER_TESTING,
+ IF_OPER_DORMANT,
+ IF_OPER_UP,
+};
+
+enum {
+ IF_LINK_MODE_DEFAULT,
+ IF_LINK_MODE_DORMANT,
+};
+
+struct ifmap
+{
+ unsigned long mem_start;
+ unsigned long mem_end;
+ unsigned short base_addr;
+ unsigned char irq;
+ unsigned char dma;
+ unsigned char port;
+
+};
+
+struct if_settings
+{
+ unsigned int type;
+ unsigned int size;
+ union {
+
+ raw_hdlc_proto __user *raw_hdlc;
+ cisco_proto __user *cisco;
+ fr_proto __user *fr;
+ fr_proto_pvc __user *fr_pvc;
+ fr_proto_pvc_info __user *fr_pvc_info;
+
+ sync_serial_settings __user *sync;
+ te1_settings __user *te1;
+ } ifs_ifsu;
+};
+
+struct ifreq
+{
+#define IFHWADDRLEN 6
+ union
+ {
+ char ifrn_name[IFNAMSIZ];
+ } ifr_ifrn;
+
+ union {
+ struct sockaddr ifru_addr;
+ struct sockaddr ifru_dstaddr;
+ struct sockaddr ifru_broadaddr;
+ struct sockaddr ifru_netmask;
+ struct sockaddr ifru_hwaddr;
+ short ifru_flags;
+ int ifru_ivalue;
+ int ifru_mtu;
+ struct ifmap ifru_map;
+ char ifru_slave[IFNAMSIZ];
+ char ifru_newname[IFNAMSIZ];
+ void __user * ifru_data;
+ struct if_settings ifru_settings;
+ } ifr_ifru;
+};
+
+#define ifr_name ifr_ifrn.ifrn_name  
+#define ifr_hwaddr ifr_ifru.ifru_hwaddr  
+#define ifr_addr ifr_ifru.ifru_addr  
+#define ifr_dstaddr ifr_ifru.ifru_dstaddr  
+#define ifr_broadaddr ifr_ifru.ifru_broadaddr  
+#define ifr_netmask ifr_ifru.ifru_netmask  
+#define ifr_flags ifr_ifru.ifru_flags  
+#define ifr_metric ifr_ifru.ifru_ivalue  
+#define ifr_mtu ifr_ifru.ifru_mtu  
+#define ifr_map ifr_ifru.ifru_map  
+#define ifr_slave ifr_ifru.ifru_slave  
+#define ifr_data ifr_ifru.ifru_data  
+#define ifr_ifindex ifr_ifru.ifru_ivalue  
+#define ifr_bandwidth ifr_ifru.ifru_ivalue  
+#define ifr_qlen ifr_ifru.ifru_ivalue  
+#define ifr_newname ifr_ifru.ifru_newname  
+#define ifr_settings ifr_ifru.ifru_settings  
+
+struct ifconf
+{
+ int ifc_len;
+ union
+ {
+ char __user *ifcu_buf;
+ struct ifreq __user *ifcu_req;
+ } ifc_ifcu;
+};
+#define ifc_buf ifc_ifcu.ifcu_buf  
+#define ifc_req ifc_ifcu.ifcu_req  
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/if_arcnet.h b/ndk/platforms/android-3/include/linux/if_arcnet.h
new file mode 100644
index 0000000..a1ad877
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/if_arcnet.h
@@ -0,0 +1,94 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_IF_ARCNET_H
+#define _LINUX_IF_ARCNET_H
+
+#include <linux/if_ether.h>
+
+#define ARC_P_IP 212  
+#define ARC_P_IPV6 196  
+#define ARC_P_ARP 213  
+#define ARC_P_RARP 214  
+#define ARC_P_IPX 250  
+#define ARC_P_NOVELL_EC 236  
+
+#define ARC_P_IP_RFC1051 240  
+#define ARC_P_ARP_RFC1051 241  
+
+#define ARC_P_ETHER 232  
+
+#define ARC_P_DATAPOINT_BOOT 0  
+#define ARC_P_DATAPOINT_MOUNT 1
+#define ARC_P_POWERLAN_BEACON 8  
+#define ARC_P_POWERLAN_BEACON2 243  
+#define ARC_P_LANSOFT 251  
+#define ARC_P_ATALK 0xDD
+
+#define ARCNET_ALEN 1
+
+struct arc_rfc1201
+{
+ uint8_t proto;
+ uint8_t split_flag;
+ uint16_t sequence;
+ uint8_t payload[0];
+};
+#define RFC1201_HDR_SIZE 4
+
+struct arc_rfc1051
+{
+ uint8_t proto;
+ uint8_t payload[0];
+};
+#define RFC1051_HDR_SIZE 1
+
+struct arc_eth_encap
+{
+ uint8_t proto;
+ struct ethhdr eth;
+ uint8_t payload[0];
+};
+#define ETH_ENCAP_HDR_SIZE 14
+
+struct arc_cap
+{
+ uint8_t proto;
+ uint8_t cookie[sizeof(int)];
+ union {
+ uint8_t ack;
+ uint8_t raw[0];
+ } mes;
+};
+
+struct arc_hardware
+{
+ uint8_t source,
+ dest,
+ offset[2];
+};
+#define ARC_HDR_SIZE 4
+
+struct archdr
+{
+
+ struct arc_hardware hard;
+
+ union {
+ struct arc_rfc1201 rfc1201;
+ struct arc_rfc1051 rfc1051;
+ struct arc_eth_encap eth_encap;
+ struct arc_cap cap;
+ uint8_t raw[0];
+ } soft;
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/if_arp.h b/ndk/platforms/android-3/include/linux/if_arp.h
new file mode 100644
index 0000000..1da50f5
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/if_arp.h
@@ -0,0 +1,119 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_IF_ARP_H
+#define _LINUX_IF_ARP_H
+
+#include <linux/netdevice.h>
+
+#define ARPHRD_NETROM 0  
+#define ARPHRD_ETHER 1  
+#define ARPHRD_EETHER 2  
+#define ARPHRD_AX25 3  
+#define ARPHRD_PRONET 4  
+#define ARPHRD_CHAOS 5  
+#define ARPHRD_IEEE802 6  
+#define ARPHRD_ARCNET 7  
+#define ARPHRD_APPLETLK 8  
+#define ARPHRD_DLCI 15  
+#define ARPHRD_ATM 19  
+#define ARPHRD_METRICOM 23  
+#define ARPHRD_IEEE1394 24  
+#define ARPHRD_EUI64 27  
+#define ARPHRD_INFINIBAND 32  
+
+#define ARPHRD_SLIP 256
+#define ARPHRD_CSLIP 257
+#define ARPHRD_SLIP6 258
+#define ARPHRD_CSLIP6 259
+#define ARPHRD_RSRVD 260  
+#define ARPHRD_ADAPT 264
+#define ARPHRD_ROSE 270
+#define ARPHRD_X25 271  
+#define ARPHRD_HWX25 272  
+#define ARPHRD_PPP 512
+#define ARPHRD_CISCO 513  
+#define ARPHRD_HDLC ARPHRD_CISCO
+#define ARPHRD_LAPB 516  
+#define ARPHRD_DDCMP 517  
+#define ARPHRD_RAWHDLC 518  
+
+#define ARPHRD_TUNNEL 768  
+#define ARPHRD_TUNNEL6 769  
+#define ARPHRD_FRAD 770  
+#define ARPHRD_SKIP 771  
+#define ARPHRD_LOOPBACK 772  
+#define ARPHRD_LOCALTLK 773  
+#define ARPHRD_FDDI 774  
+#define ARPHRD_BIF 775  
+#define ARPHRD_SIT 776  
+#define ARPHRD_IPDDP 777  
+#define ARPHRD_IPGRE 778  
+#define ARPHRD_PIMREG 779  
+#define ARPHRD_HIPPI 780  
+#define ARPHRD_ASH 781  
+#define ARPHRD_ECONET 782  
+#define ARPHRD_IRDA 783  
+
+#define ARPHRD_FCPP 784  
+#define ARPHRD_FCAL 785  
+#define ARPHRD_FCPL 786  
+#define ARPHRD_FCFABRIC 787  
+
+#define ARPHRD_IEEE802_TR 800  
+#define ARPHRD_IEEE80211 801  
+#define ARPHRD_IEEE80211_PRISM 802  
+#define ARPHRD_IEEE80211_RADIOTAP 803  
+
+#define ARPHRD_VOID 0xFFFF  
+#define ARPHRD_NONE 0xFFFE  
+
+#define ARPOP_REQUEST 1  
+#define ARPOP_REPLY 2  
+#define ARPOP_RREQUEST 3  
+#define ARPOP_RREPLY 4  
+#define ARPOP_InREQUEST 8  
+#define ARPOP_InREPLY 9  
+#define ARPOP_NAK 10  
+
+struct arpreq {
+ struct sockaddr arp_pa;
+ struct sockaddr arp_ha;
+ int arp_flags;
+ struct sockaddr arp_netmask;
+ char arp_dev[16];
+};
+
+struct arpreq_old {
+ struct sockaddr arp_pa;
+ struct sockaddr arp_ha;
+ int arp_flags;
+ struct sockaddr arp_netmask;
+};
+
+#define ATF_COM 0x02  
+#define ATF_PERM 0x04  
+#define ATF_PUBL 0x08  
+#define ATF_USETRAILERS 0x10  
+#define ATF_NETMASK 0x20  
+#define ATF_DONTPUB 0x40  
+
+struct arphdr
+{
+ unsigned short ar_hrd;
+ unsigned short ar_pro;
+ unsigned char ar_hln;
+ unsigned char ar_pln;
+ unsigned short ar_op;
+
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/if_bridge.h b/ndk/platforms/android-3/include/linux/if_bridge.h
new file mode 100644
index 0000000..93f9494
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/if_bridge.h
@@ -0,0 +1,100 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_IF_BRIDGE_H
+#define _LINUX_IF_BRIDGE_H
+
+#include <linux/types.h>
+
+#define SYSFS_BRIDGE_ATTR "bridge"
+#define SYSFS_BRIDGE_FDB "brforward"
+#define SYSFS_BRIDGE_PORT_SUBDIR "brif"
+#define SYSFS_BRIDGE_PORT_ATTR "brport"
+#define SYSFS_BRIDGE_PORT_LINK "bridge"
+
+#define BRCTL_VERSION 1
+
+#define BRCTL_GET_VERSION 0
+#define BRCTL_GET_BRIDGES 1
+#define BRCTL_ADD_BRIDGE 2
+#define BRCTL_DEL_BRIDGE 3
+#define BRCTL_ADD_IF 4
+#define BRCTL_DEL_IF 5
+#define BRCTL_GET_BRIDGE_INFO 6
+#define BRCTL_GET_PORT_LIST 7
+#define BRCTL_SET_BRIDGE_FORWARD_DELAY 8
+#define BRCTL_SET_BRIDGE_HELLO_TIME 9
+#define BRCTL_SET_BRIDGE_MAX_AGE 10
+#define BRCTL_SET_AGEING_TIME 11
+#define BRCTL_SET_GC_INTERVAL 12
+#define BRCTL_GET_PORT_INFO 13
+#define BRCTL_SET_BRIDGE_STP_STATE 14
+#define BRCTL_SET_BRIDGE_PRIORITY 15
+#define BRCTL_SET_PORT_PRIORITY 16
+#define BRCTL_SET_PATH_COST 17
+#define BRCTL_GET_FDB_ENTRIES 18
+
+#define BR_STATE_DISABLED 0
+#define BR_STATE_LISTENING 1
+#define BR_STATE_LEARNING 2
+#define BR_STATE_FORWARDING 3
+#define BR_STATE_BLOCKING 4
+
+struct __bridge_info
+{
+ __u64 designated_root;
+ __u64 bridge_id;
+ __u32 root_path_cost;
+ __u32 max_age;
+ __u32 hello_time;
+ __u32 forward_delay;
+ __u32 bridge_max_age;
+ __u32 bridge_hello_time;
+ __u32 bridge_forward_delay;
+ __u8 topology_change;
+ __u8 topology_change_detected;
+ __u8 root_port;
+ __u8 stp_enabled;
+ __u32 ageing_time;
+ __u32 gc_interval;
+ __u32 hello_timer_value;
+ __u32 tcn_timer_value;
+ __u32 topology_change_timer_value;
+ __u32 gc_timer_value;
+};
+
+struct __port_info
+{
+ __u64 designated_root;
+ __u64 designated_bridge;
+ __u16 port_id;
+ __u16 designated_port;
+ __u32 path_cost;
+ __u32 designated_cost;
+ __u8 state;
+ __u8 top_change_ack;
+ __u8 config_pending;
+ __u8 unused0;
+ __u32 message_age_timer_value;
+ __u32 forward_delay_timer_value;
+ __u32 hold_timer_value;
+};
+
+struct __fdb_entry
+{
+ __u8 mac_addr[6];
+ __u8 port_no;
+ __u8 is_local;
+ __u32 ageing_timer_value;
+ __u32 unused;
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/if_ether.h b/ndk/platforms/android-3/include/linux/if_ether.h
new file mode 100644
index 0000000..ff89c3d
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/if_ether.h
@@ -0,0 +1,81 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_IF_ETHER_H
+#define _LINUX_IF_ETHER_H
+
+#include <linux/types.h>
+
+#define ETH_ALEN 6  
+#define ETH_HLEN 14  
+#define ETH_ZLEN 60  
+#define ETH_DATA_LEN 1500  
+#define ETH_FRAME_LEN 1514  
+
+#define ETH_P_LOOP 0x0060  
+#define ETH_P_PUP 0x0200  
+#define ETH_P_PUPAT 0x0201  
+#define ETH_P_IP 0x0800  
+#define ETH_P_X25 0x0805  
+#define ETH_P_ARP 0x0806  
+#define ETH_P_BPQ 0x08FF  
+#define ETH_P_IEEEPUP 0x0a00  
+#define ETH_P_IEEEPUPAT 0x0a01  
+#define ETH_P_DEC 0x6000  
+#define ETH_P_DNA_DL 0x6001  
+#define ETH_P_DNA_RC 0x6002  
+#define ETH_P_DNA_RT 0x6003  
+#define ETH_P_LAT 0x6004  
+#define ETH_P_DIAG 0x6005  
+#define ETH_P_CUST 0x6006  
+#define ETH_P_SCA 0x6007  
+#define ETH_P_RARP 0x8035  
+#define ETH_P_ATALK 0x809B  
+#define ETH_P_AARP 0x80F3  
+#define ETH_P_8021Q 0x8100  
+#define ETH_P_IPX 0x8137  
+#define ETH_P_IPV6 0x86DD  
+#define ETH_P_SLOW 0x8809  
+#define ETH_P_WCCP 0x883E  
+#define ETH_P_PPP_DISC 0x8863  
+#define ETH_P_PPP_SES 0x8864  
+#define ETH_P_MPLS_UC 0x8847  
+#define ETH_P_MPLS_MC 0x8848  
+#define ETH_P_ATMMPOA 0x884c  
+#define ETH_P_ATMFATE 0x8884  
+#define ETH_P_AOE 0x88A2  
+#define ETH_P_TIPC 0x88CA  
+
+#define ETH_P_802_3 0x0001  
+#define ETH_P_AX25 0x0002  
+#define ETH_P_ALL 0x0003  
+#define ETH_P_802_2 0x0004  
+#define ETH_P_SNAP 0x0005  
+#define ETH_P_DDCMP 0x0006  
+#define ETH_P_WAN_PPP 0x0007  
+#define ETH_P_PPP_MP 0x0008  
+#define ETH_P_LOCALTALK 0x0009  
+#define ETH_P_PPPTALK 0x0010  
+#define ETH_P_TR_802_2 0x0011  
+#define ETH_P_MOBITEX 0x0015  
+#define ETH_P_CONTROL 0x0016  
+#define ETH_P_IRDA 0x0017  
+#define ETH_P_ECONET 0x0018  
+#define ETH_P_HDLC 0x0019  
+#define ETH_P_ARCNET 0x001A  
+
+struct ethhdr {
+ unsigned char h_dest[ETH_ALEN];
+ unsigned char h_source[ETH_ALEN];
+ __be16 h_proto;
+} __attribute__((packed));
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/if_fc.h b/ndk/platforms/android-3/include/linux/if_fc.h
new file mode 100644
index 0000000..a6a47b4
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/if_fc.h
@@ -0,0 +1,35 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_IF_FC_H
+#define _LINUX_IF_FC_H
+
+#define FC_ALEN 6  
+#define FC_HLEN (sizeof(struct fch_hdr)+sizeof(struct fcllc))
+#define FC_ID_LEN 3  
+
+#define EXTENDED_SAP 0xAA
+#define UI_CMD 0x03
+
+struct fch_hdr {
+ __u8 daddr[FC_ALEN];
+ __u8 saddr[FC_ALEN];
+};
+
+struct fcllc {
+ __u8 dsap;
+ __u8 ssap;
+ __u8 llc;
+ __u8 protid[3];
+ __be16 ethertype;
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/if_fddi.h b/ndk/platforms/android-3/include/linux/if_fddi.h
new file mode 100644
index 0000000..f59492f
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/if_fddi.h
@@ -0,0 +1,83 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_IF_FDDI_H
+#define _LINUX_IF_FDDI_H
+
+#define FDDI_K_ALEN 6  
+#define FDDI_K_8022_HLEN 16  
+#define FDDI_K_SNAP_HLEN 21  
+#define FDDI_K_8022_ZLEN 16  
+#define FDDI_K_SNAP_ZLEN 21  
+#define FDDI_K_8022_DLEN 4475  
+#define FDDI_K_SNAP_DLEN 4470  
+#define FDDI_K_LLC_ZLEN 13  
+#define FDDI_K_LLC_LEN 4491  
+
+#define FDDI_FC_K_VOID 0x00 
+#define FDDI_FC_K_NON_RESTRICTED_TOKEN 0x80 
+#define FDDI_FC_K_RESTRICTED_TOKEN 0xC0 
+#define FDDI_FC_K_SMT_MIN 0x41
+#define FDDI_FC_K_SMT_MAX 0x4F
+#define FDDI_FC_K_MAC_MIN 0xC1
+#define FDDI_FC_K_MAC_MAX 0xCF 
+#define FDDI_FC_K_ASYNC_LLC_MIN 0x50
+#define FDDI_FC_K_ASYNC_LLC_DEF 0x54
+#define FDDI_FC_K_ASYNC_LLC_MAX 0x5F
+#define FDDI_FC_K_SYNC_LLC_MIN 0xD0
+#define FDDI_FC_K_SYNC_LLC_MAX 0xD7
+#define FDDI_FC_K_IMPLEMENTOR_MIN 0x60
+#define FDDI_FC_K_IMPLEMENTOR_MAX 0x6F
+#define FDDI_FC_K_RESERVED_MIN 0x70
+#define FDDI_FC_K_RESERVED_MAX 0x7F
+
+#define FDDI_EXTENDED_SAP 0xAA
+#define FDDI_UI_CMD 0x03
+
+struct fddi_8022_1_hdr
+ {
+ __u8 dsap;
+ __u8 ssap;
+ __u8 ctrl;
+ } __attribute__ ((packed));
+
+struct fddi_8022_2_hdr
+ {
+ __u8 dsap;
+ __u8 ssap;
+ __u8 ctrl_1;
+ __u8 ctrl_2;
+ } __attribute__ ((packed));
+
+#define FDDI_K_OUI_LEN 3
+struct fddi_snap_hdr
+ {
+ __u8 dsap;
+ __u8 ssap;
+ __u8 ctrl;
+ __u8 oui[FDDI_K_OUI_LEN];
+ __be16 ethertype;
+ } __attribute__ ((packed));
+
+struct fddihdr
+ {
+ __u8 fc;
+ __u8 daddr[FDDI_K_ALEN];
+ __u8 saddr[FDDI_K_ALEN];
+ union
+ {
+ struct fddi_8022_1_hdr llc_8022_1;
+ struct fddi_8022_2_hdr llc_8022_2;
+ struct fddi_snap_hdr llc_snap;
+ } hdr;
+ } __attribute__ ((packed));
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/if_hippi.h b/ndk/platforms/android-3/include/linux/if_hippi.h
new file mode 100644
index 0000000..52d36f6
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/if_hippi.h
@@ -0,0 +1,99 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_IF_HIPPI_H
+#define _LINUX_IF_HIPPI_H
+
+#include <asm/byteorder.h>
+
+#define HIPPI_ALEN 6  
+#define HIPPI_HLEN sizeof(struct hippi_hdr)
+#define HIPPI_ZLEN 0  
+#define HIPPI_DATA_LEN 65280  
+#define HIPPI_FRAME_LEN (HIPPI_DATA_LEN + HIPPI_HLEN)
+
+#define HIPPI_EXTENDED_SAP 0xAA
+#define HIPPI_UI_CMD 0x03
+
+struct hipnet_statistics
+{
+ int rx_packets;
+ int tx_packets;
+ int rx_errors;
+ int tx_errors;
+ int rx_dropped;
+ int tx_dropped;
+
+ int rx_length_errors;
+ int rx_over_errors;
+ int rx_crc_errors;
+ int rx_frame_errors;
+ int rx_fifo_errors;
+ int rx_missed_errors;
+
+ int tx_aborted_errors;
+ int tx_carrier_errors;
+ int tx_fifo_errors;
+ int tx_heartbeat_errors;
+ int tx_window_errors;
+};
+
+struct hippi_fp_hdr
+{
+ __be32 fixed;
+ __be32 d2_size;
+} __attribute__ ((packed));
+
+struct hippi_le_hdr
+{
+#ifdef __BIG_ENDIAN_BITFIELD
+ __u8 fc:3;
+ __u8 double_wide:1;
+ __u8 message_type:4;
+#elif defined(__LITTLE_ENDIAN_BITFIELD)
+ __u8 message_type:4;
+ __u8 double_wide:1;
+ __u8 fc:3;
+#endif
+ __u8 dest_switch_addr[3];
+#ifdef __BIG_ENDIAN_BITFIELD
+ __u8 dest_addr_type:4,
+ src_addr_type:4;
+#elif defined(__LITTLE_ENDIAN_BITFIELD)
+ __u8 src_addr_type:4,
+ dest_addr_type:4;
+#endif
+ __u8 src_switch_addr[3];
+ __u16 reserved;
+ __u8 daddr[HIPPI_ALEN];
+ __u16 locally_administered;
+ __u8 saddr[HIPPI_ALEN];
+} __attribute__ ((packed));
+
+#define HIPPI_OUI_LEN 3
+
+struct hippi_snap_hdr
+{
+ __u8 dsap;
+ __u8 ssap;
+ __u8 ctrl;
+ __u8 oui[HIPPI_OUI_LEN];
+ __be16 ethertype;
+} __attribute__ ((packed));
+
+struct hippi_hdr
+{
+ struct hippi_fp_hdr fp;
+ struct hippi_le_hdr le;
+ struct hippi_snap_hdr snap;
+} __attribute__ ((packed));
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/if_packet.h b/ndk/platforms/android-3/include/linux/if_packet.h
new file mode 100644
index 0000000..1aa3bea
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/if_packet.h
@@ -0,0 +1,96 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __LINUX_IF_PACKET_H
+#define __LINUX_IF_PACKET_H
+
+struct sockaddr_pkt
+{
+ unsigned short spkt_family;
+ unsigned char spkt_device[14];
+ unsigned short spkt_protocol;
+};
+
+struct sockaddr_ll
+{
+ unsigned short sll_family;
+ unsigned short sll_protocol;
+ int sll_ifindex;
+ unsigned short sll_hatype;
+ unsigned char sll_pkttype;
+ unsigned char sll_halen;
+ unsigned char sll_addr[8];
+};
+
+#define PACKET_HOST 0  
+#define PACKET_BROADCAST 1  
+#define PACKET_MULTICAST 2  
+#define PACKET_OTHERHOST 3  
+#define PACKET_OUTGOING 4  
+
+#define PACKET_LOOPBACK 5  
+#define PACKET_FASTROUTE 6  
+
+#define PACKET_ADD_MEMBERSHIP 1
+#define PACKET_DROP_MEMBERSHIP 2
+#define PACKET_RECV_OUTPUT 3
+
+#define PACKET_RX_RING 5
+#define PACKET_STATISTICS 6
+#define PACKET_COPY_THRESH 7
+
+struct tpacket_stats
+{
+ unsigned int tp_packets;
+ unsigned int tp_drops;
+};
+
+struct tpacket_hdr
+{
+ unsigned long tp_status;
+#define TP_STATUS_KERNEL 0
+#define TP_STATUS_USER 1
+#define TP_STATUS_COPY 2
+#define TP_STATUS_LOSING 4
+#define TP_STATUS_CSUMNOTREADY 8
+ unsigned int tp_len;
+ unsigned int tp_snaplen;
+ unsigned short tp_mac;
+ unsigned short tp_net;
+ unsigned int tp_sec;
+ unsigned int tp_usec;
+};
+
+#define TPACKET_ALIGNMENT 16
+#define TPACKET_ALIGN(x) (((x)+TPACKET_ALIGNMENT-1)&~(TPACKET_ALIGNMENT-1))
+#define TPACKET_HDRLEN (TPACKET_ALIGN(sizeof(struct tpacket_hdr)) + sizeof(struct sockaddr_ll))
+
+struct tpacket_req
+{
+ unsigned int tp_block_size;
+ unsigned int tp_block_nr;
+ unsigned int tp_frame_size;
+ unsigned int tp_frame_nr;
+};
+
+struct packet_mreq
+{
+ int mr_ifindex;
+ unsigned short mr_type;
+ unsigned short mr_alen;
+ unsigned char mr_address[8];
+};
+
+#define PACKET_MR_MULTICAST 0
+#define PACKET_MR_PROMISC 1
+#define PACKET_MR_ALLMULTI 2
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/if_ppp.h b/ndk/platforms/android-3/include/linux/if_ppp.h
new file mode 100644
index 0000000..9f35c97
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/if_ppp.h
@@ -0,0 +1,116 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _IF_PPP_H_
+#define _IF_PPP_H_
+
+#include <linux/compiler.h>
+
+#define PPP_MTU 1500  
+#define PPP_MAXMRU 65000  
+#define PROTO_IPX 0x002b  
+#define PROTO_DNA_RT 0x0027  
+
+#define SC_COMP_PROT 0x00000001  
+#define SC_COMP_AC 0x00000002  
+#define SC_COMP_TCP 0x00000004  
+#define SC_NO_TCP_CCID 0x00000008  
+#define SC_REJ_COMP_AC 0x00000010  
+#define SC_REJ_COMP_TCP 0x00000020  
+#define SC_CCP_OPEN 0x00000040  
+#define SC_CCP_UP 0x00000080  
+#define SC_ENABLE_IP 0x00000100  
+#define SC_LOOP_TRAFFIC 0x00000200  
+#define SC_MULTILINK 0x00000400  
+#define SC_MP_SHORTSEQ 0x00000800  
+#define SC_COMP_RUN 0x00001000  
+#define SC_DECOMP_RUN 0x00002000  
+#define SC_MP_XSHORTSEQ 0x00004000  
+#define SC_DEBUG 0x00010000  
+#define SC_LOG_INPKT 0x00020000  
+#define SC_LOG_OUTPKT 0x00040000  
+#define SC_LOG_RAWIN 0x00080000  
+#define SC_LOG_FLUSH 0x00100000  
+#define SC_SYNC 0x00200000  
+#define SC_MUST_COMP 0x00400000  
+#define SC_MASK 0x0f600fff  
+
+#define SC_XMIT_BUSY 0x10000000  
+#define SC_RCV_ODDP 0x08000000  
+#define SC_RCV_EVNP 0x04000000  
+#define SC_RCV_B7_1 0x02000000  
+#define SC_RCV_B7_0 0x01000000  
+#define SC_DC_FERROR 0x00800000  
+#define SC_DC_ERROR 0x00400000  
+
+struct npioctl {
+ int protocol;
+ enum NPmode mode;
+};
+
+struct ppp_option_data {
+ __u8 __user *ptr;
+ __u32 length;
+ int transmit;
+};
+
+struct ifpppstatsreq {
+ struct ifreq b;
+ struct ppp_stats stats;
+};
+
+struct ifpppcstatsreq {
+ struct ifreq b;
+ struct ppp_comp_stats stats;
+};
+
+#define ifr__name b.ifr_ifrn.ifrn_name
+#define stats_ptr b.ifr_ifru.ifru_data
+
+#define PPPIOCGFLAGS _IOR('t', 90, int)  
+#define PPPIOCSFLAGS _IOW('t', 89, int)  
+#define PPPIOCGASYNCMAP _IOR('t', 88, int)  
+#define PPPIOCSASYNCMAP _IOW('t', 87, int)  
+#define PPPIOCGUNIT _IOR('t', 86, int)  
+#define PPPIOCGRASYNCMAP _IOR('t', 85, int)  
+#define PPPIOCSRASYNCMAP _IOW('t', 84, int)  
+#define PPPIOCGMRU _IOR('t', 83, int)  
+#define PPPIOCSMRU _IOW('t', 82, int)  
+#define PPPIOCSMAXCID _IOW('t', 81, int)  
+#define PPPIOCGXASYNCMAP _IOR('t', 80, ext_accm)  
+#define PPPIOCSXASYNCMAP _IOW('t', 79, ext_accm)  
+#define PPPIOCXFERUNIT _IO('t', 78)  
+#define PPPIOCSCOMPRESS _IOW('t', 77, struct ppp_option_data)
+#define PPPIOCGNPMODE _IOWR('t', 76, struct npioctl)  
+#define PPPIOCSNPMODE _IOW('t', 75, struct npioctl)  
+#define PPPIOCSPASS _IOW('t', 71, struct sock_fprog)  
+#define PPPIOCSACTIVE _IOW('t', 70, struct sock_fprog)  
+#define PPPIOCGDEBUG _IOR('t', 65, int)  
+#define PPPIOCSDEBUG _IOW('t', 64, int)  
+#define PPPIOCGIDLE _IOR('t', 63, struct ppp_idle)  
+#define PPPIOCNEWUNIT _IOWR('t', 62, int)  
+#define PPPIOCATTACH _IOW('t', 61, int)  
+#define PPPIOCDETACH _IOW('t', 60, int)  
+#define PPPIOCSMRRU _IOW('t', 59, int)  
+#define PPPIOCCONNECT _IOW('t', 58, int)  
+#define PPPIOCDISCONN _IO('t', 57)  
+#define PPPIOCATTCHAN _IOW('t', 56, int)  
+#define PPPIOCGCHAN _IOR('t', 55, int)  
+
+#define SIOCGPPPSTATS (SIOCDEVPRIVATE + 0)
+#define SIOCGPPPVER (SIOCDEVPRIVATE + 1)  
+#define SIOCGPPPCSTATS (SIOCDEVPRIVATE + 2)
+
+#ifndef ifr_mtu
+#define ifr_mtu ifr_ifru.ifru_metric
+#endif
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/if_tr.h b/ndk/platforms/android-3/include/linux/if_tr.h
new file mode 100644
index 0000000..7d6319a
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/if_tr.h
@@ -0,0 +1,76 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_IF_TR_H
+#define _LINUX_IF_TR_H
+
+#include <asm/byteorder.h>  
+
+#define TR_ALEN 6  
+#define TR_HLEN (sizeof(struct trh_hdr)+sizeof(struct trllc))
+#define AC 0x10
+#define LLC_FRAME 0x40
+
+#define EXTENDED_SAP 0xAA
+#define UI_CMD 0x03
+
+struct trh_hdr {
+ __u8 ac;
+ __u8 fc;
+ __u8 daddr[TR_ALEN];
+ __u8 saddr[TR_ALEN];
+ __be16 rcf;
+ __be16 rseg[8];
+};
+
+struct trllc {
+ __u8 dsap;
+ __u8 ssap;
+ __u8 llc;
+ __u8 protid[3];
+ __be16 ethertype;
+};
+
+struct tr_statistics {
+ unsigned long rx_packets;
+ unsigned long tx_packets;
+ unsigned long rx_bytes;
+ unsigned long tx_bytes;
+ unsigned long rx_errors;
+ unsigned long tx_errors;
+ unsigned long rx_dropped;
+ unsigned long tx_dropped;
+ unsigned long multicast;
+ unsigned long transmit_collision;
+
+ unsigned long line_errors;
+ unsigned long internal_errors;
+ unsigned long burst_errors;
+ unsigned long A_C_errors;
+ unsigned long abort_delimiters;
+ unsigned long lost_frames;
+ unsigned long recv_congest_count;
+ unsigned long frame_copied_errors;
+ unsigned long frequency_errors;
+ unsigned long token_errors;
+ unsigned long dummy1;
+};
+
+#define TR_RII 0x80
+#define TR_RCF_DIR_BIT 0x80
+#define TR_RCF_LEN_MASK 0x1f00
+#define TR_RCF_BROADCAST 0x8000  
+#define TR_RCF_LIMITED_BROADCAST 0xC000  
+#define TR_RCF_FRAME2K 0x20
+#define TR_RCF_BROADCAST_MASK 0xC000
+#define TR_MAXRIFLEN 18
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/if_tun.h b/ndk/platforms/android-3/include/linux/if_tun.h
new file mode 100644
index 0000000..c5db4e0
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/if_tun.h
@@ -0,0 +1,45 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __IF_TUN_H
+#define __IF_TUN_H
+
+#define TUN_READQ_SIZE 500
+
+#define TUN_TUN_DEV 0x0001 
+#define TUN_TAP_DEV 0x0002
+#define TUN_TYPE_MASK 0x000f
+
+#define TUN_FASYNC 0x0010
+#define TUN_NOCHECKSUM 0x0020
+#define TUN_NO_PI 0x0040
+#define TUN_ONE_QUEUE 0x0080
+#define TUN_PERSIST 0x0100 
+
+#define TUNSETNOCSUM _IOW('T', 200, int) 
+#define TUNSETDEBUG _IOW('T', 201, int) 
+#define TUNSETIFF _IOW('T', 202, int) 
+#define TUNSETPERSIST _IOW('T', 203, int) 
+#define TUNSETOWNER _IOW('T', 204, int)
+#define TUNSETLINK _IOW('T', 205, int)
+
+#define IFF_TUN 0x0001
+#define IFF_TAP 0x0002
+#define IFF_NO_PI 0x1000
+#define IFF_ONE_QUEUE 0x2000
+
+struct tun_pi {
+ unsigned short flags;
+ unsigned short proto;
+};
+#define TUN_PKT_STRIP 0x0001
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/if_vlan.h b/ndk/platforms/android-3/include/linux/if_vlan.h
new file mode 100644
index 0000000..d3d2df2
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/if_vlan.h
@@ -0,0 +1,52 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_IF_VLAN_H_
+#define _LINUX_IF_VLAN_H_
+
+enum vlan_ioctl_cmds {
+ ADD_VLAN_CMD,
+ DEL_VLAN_CMD,
+ SET_VLAN_INGRESS_PRIORITY_CMD,
+ SET_VLAN_EGRESS_PRIORITY_CMD,
+ GET_VLAN_INGRESS_PRIORITY_CMD,
+ GET_VLAN_EGRESS_PRIORITY_CMD,
+ SET_VLAN_NAME_TYPE_CMD,
+ SET_VLAN_FLAG_CMD,
+ GET_VLAN_REALDEV_NAME_CMD,
+ GET_VLAN_VID_CMD
+};
+
+enum vlan_name_types {
+ VLAN_NAME_TYPE_PLUS_VID,
+ VLAN_NAME_TYPE_RAW_PLUS_VID,
+ VLAN_NAME_TYPE_PLUS_VID_NO_PAD,
+ VLAN_NAME_TYPE_RAW_PLUS_VID_NO_PAD,
+ VLAN_NAME_TYPE_HIGHEST
+};
+
+struct vlan_ioctl_args {
+ int cmd;
+ char device1[24];
+
+ union {
+ char device2[24];
+ int VID;
+ unsigned int skb_priority;
+ unsigned int name_type;
+ unsigned int bind_type;
+ unsigned int flag;
+ } u;
+
+ short vlan_qos;
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/in.h b/ndk/platforms/android-3/include/linux/in.h
new file mode 100644
index 0000000..894e2da
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/in.h
@@ -0,0 +1,211 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_IN_H
+#define _LINUX_IN_H
+
+#include <linux/types.h>
+#include <linux/socket.h>
+
+enum {
+ IPPROTO_IP = 0,
+ IPPROTO_ICMP = 1,
+ IPPROTO_IGMP = 2,
+ IPPROTO_IPIP = 4,
+ IPPROTO_TCP = 6,
+ IPPROTO_EGP = 8,
+ IPPROTO_PUP = 12,
+ IPPROTO_UDP = 17,
+ IPPROTO_IDP = 22,
+ IPPROTO_DCCP = 33,
+ IPPROTO_RSVP = 46,
+ IPPROTO_GRE = 47,
+
+ IPPROTO_IPV6 = 41,
+
+ IPPROTO_ESP = 50,
+ IPPROTO_AH = 51,
+ IPPROTO_PIM = 103,
+
+ IPPROTO_COMP = 108,
+ IPPROTO_SCTP = 132,
+
+ IPPROTO_RAW = 255,
+ IPPROTO_MAX
+};
+
+struct in_addr {
+ __u32 s_addr;
+};
+
+#define IP_TOS 1
+#define IP_TTL 2
+#define IP_HDRINCL 3
+#define IP_OPTIONS 4
+#define IP_ROUTER_ALERT 5
+#define IP_RECVOPTS 6
+#define IP_RETOPTS 7
+#define IP_PKTINFO 8
+#define IP_PKTOPTIONS 9
+#define IP_MTU_DISCOVER 10
+#define IP_RECVERR 11
+#define IP_RECVTTL 12
+#define IP_RECVTOS 13
+#define IP_MTU 14
+#define IP_FREEBIND 15
+#define IP_IPSEC_POLICY 16
+#define IP_XFRM_POLICY 17
+#define IP_PASSSEC 18
+
+#define IP_RECVRETOPTS IP_RETOPTS
+
+#define IP_PMTUDISC_DONT 0  
+#define IP_PMTUDISC_WANT 1  
+#define IP_PMTUDISC_DO 2  
+
+#define IP_MULTICAST_IF 32
+#define IP_MULTICAST_TTL 33
+#define IP_MULTICAST_LOOP 34
+#define IP_ADD_MEMBERSHIP 35
+#define IP_DROP_MEMBERSHIP 36
+#define IP_UNBLOCK_SOURCE 37
+#define IP_BLOCK_SOURCE 38
+#define IP_ADD_SOURCE_MEMBERSHIP 39
+#define IP_DROP_SOURCE_MEMBERSHIP 40
+#define IP_MSFILTER 41
+#define MCAST_JOIN_GROUP 42
+#define MCAST_BLOCK_SOURCE 43
+#define MCAST_UNBLOCK_SOURCE 44
+#define MCAST_LEAVE_GROUP 45
+#define MCAST_JOIN_SOURCE_GROUP 46
+#define MCAST_LEAVE_SOURCE_GROUP 47
+#define MCAST_MSFILTER 48
+
+#define MCAST_EXCLUDE 0
+#define MCAST_INCLUDE 1
+
+#define IP_DEFAULT_MULTICAST_TTL 1
+#define IP_DEFAULT_MULTICAST_LOOP 1
+
+struct ip_mreq
+{
+ struct in_addr imr_multiaddr;
+ struct in_addr imr_interface;
+};
+
+struct ip_mreqn
+{
+ struct in_addr imr_multiaddr;
+ struct in_addr imr_address;
+ int imr_ifindex;
+};
+
+struct ip_mreq_source {
+ __u32 imr_multiaddr;
+ __u32 imr_interface;
+ __u32 imr_sourceaddr;
+};
+
+struct ip_msfilter {
+ __u32 imsf_multiaddr;
+ __u32 imsf_interface;
+ __u32 imsf_fmode;
+ __u32 imsf_numsrc;
+ __u32 imsf_slist[1];
+};
+
+#define IP_MSFILTER_SIZE(numsrc)   (sizeof(struct ip_msfilter) - sizeof(__u32)   + (numsrc) * sizeof(__u32))
+
+struct group_req
+{
+ __u32 gr_interface;
+ struct __kernel_sockaddr_storage gr_group;
+};
+
+struct group_source_req
+{
+ __u32 gsr_interface;
+ struct __kernel_sockaddr_storage gsr_group;
+ struct __kernel_sockaddr_storage gsr_source;
+};
+
+struct group_filter
+{
+ __u32 gf_interface;
+ struct __kernel_sockaddr_storage gf_group;
+ __u32 gf_fmode;
+ __u32 gf_numsrc;
+ struct __kernel_sockaddr_storage gf_slist[1];
+};
+
+#define GROUP_FILTER_SIZE(numsrc)   (sizeof(struct group_filter) - sizeof(struct __kernel_sockaddr_storage)   + (numsrc) * sizeof(struct __kernel_sockaddr_storage))
+
+struct in_pktinfo
+{
+ int ipi_ifindex;
+ struct in_addr ipi_spec_dst;
+ struct in_addr ipi_addr;
+};
+
+#define __SOCK_SIZE__ 16  
+struct sockaddr_in {
+ sa_family_t sin_family;
+ unsigned short int sin_port;
+ struct in_addr sin_addr;
+
+ unsigned char __pad[__SOCK_SIZE__ - sizeof(short int) -
+ sizeof(unsigned short int) - sizeof(struct in_addr)];
+};
+#define sin_zero __pad  
+
+#define IN_CLASSA(a) ((((long int) (a)) & 0x80000000) == 0)
+#define IN_CLASSA_NET 0xff000000
+#define IN_CLASSA_NSHIFT 24
+#define IN_CLASSA_HOST (0xffffffff & ~IN_CLASSA_NET)
+#define IN_CLASSA_MAX 128
+
+#define IN_CLASSB(a) ((((long int) (a)) & 0xc0000000) == 0x80000000)
+#define IN_CLASSB_NET 0xffff0000
+#define IN_CLASSB_NSHIFT 16
+#define IN_CLASSB_HOST (0xffffffff & ~IN_CLASSB_NET)
+#define IN_CLASSB_MAX 65536
+
+#define IN_CLASSC(a) ((((long int) (a)) & 0xe0000000) == 0xc0000000)
+#define IN_CLASSC_NET 0xffffff00
+#define IN_CLASSC_NSHIFT 8
+#define IN_CLASSC_HOST (0xffffffff & ~IN_CLASSC_NET)
+
+#define IN_CLASSD(a) ((((long int) (a)) & 0xf0000000) == 0xe0000000)
+#define IN_MULTICAST(a) IN_CLASSD(a)
+#define IN_MULTICAST_NET 0xF0000000
+
+#define IN_EXPERIMENTAL(a) ((((long int) (a)) & 0xf0000000) == 0xf0000000)
+#define IN_BADCLASS(a) IN_EXPERIMENTAL((a))
+
+#define INADDR_ANY ((unsigned long int) 0x00000000)
+
+#define INADDR_BROADCAST ((unsigned long int) 0xffffffff)
+
+#define INADDR_NONE ((unsigned long int) 0xffffffff)
+
+#define IN_LOOPBACKNET 127
+
+#define INADDR_LOOPBACK 0x7f000001  
+#define IN_LOOPBACK(a) ((((long int) (a)) & 0xff000000) == 0x7f000000)
+
+#define INADDR_UNSPEC_GROUP 0xe0000000U  
+#define INADDR_ALLHOSTS_GROUP 0xe0000001U  
+#define INADDR_ALLRTRS_GROUP 0xe0000002U  
+#define INADDR_MAX_LOCAL_GROUP 0xe00000ffU  
+
+#include <asm/byteorder.h> 
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/in6.h b/ndk/platforms/android-3/include/linux/in6.h
new file mode 100644
index 0000000..ceaeb7d
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/in6.h
@@ -0,0 +1,158 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_IN6_H
+#define _LINUX_IN6_H
+
+#include <linux/types.h>
+
+struct in6_addr
+{
+ union
+ {
+ __u8 u6_addr8[16];
+ __u16 u6_addr16[8];
+ __u32 u6_addr32[4];
+ } in6_u;
+#define s6_addr in6_u.u6_addr8
+#define s6_addr16 in6_u.u6_addr16
+#define s6_addr32 in6_u.u6_addr32
+};
+
+#define IN6ADDR_LOOPBACK_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } }
+
+struct sockaddr_in6 {
+ unsigned short int sin6_family;
+ __u16 sin6_port;
+ __u32 sin6_flowinfo;
+ struct in6_addr sin6_addr;
+ __u32 sin6_scope_id;
+};
+
+struct ipv6_mreq {
+
+ struct in6_addr ipv6mr_multiaddr;
+
+ int ipv6mr_ifindex;
+};
+
+#define ipv6mr_acaddr ipv6mr_multiaddr
+
+struct in6_flowlabel_req
+{
+ struct in6_addr flr_dst;
+ __u32 flr_label;
+ __u8 flr_action;
+ __u8 flr_share;
+ __u16 flr_flags;
+ __u16 flr_expires;
+ __u16 flr_linger;
+ __u32 __flr_pad;
+
+};
+
+#define IPV6_FL_A_GET 0
+#define IPV6_FL_A_PUT 1
+#define IPV6_FL_A_RENEW 2
+
+#define IPV6_FL_F_CREATE 1
+#define IPV6_FL_F_EXCL 2
+
+#define IPV6_FL_S_NONE 0
+#define IPV6_FL_S_EXCL 1
+#define IPV6_FL_S_PROCESS 2
+#define IPV6_FL_S_USER 3
+#define IPV6_FL_S_ANY 255
+
+#define IPV6_FLOWINFO_FLOWLABEL 0x000fffff
+#define IPV6_FLOWINFO_PRIORITY 0x0ff00000
+
+#define IPV6_PRIORITY_UNCHARACTERIZED 0x0000
+#define IPV6_PRIORITY_FILLER 0x0100
+#define IPV6_PRIORITY_UNATTENDED 0x0200
+#define IPV6_PRIORITY_RESERVED1 0x0300
+#define IPV6_PRIORITY_BULK 0x0400
+#define IPV6_PRIORITY_RESERVED2 0x0500
+#define IPV6_PRIORITY_INTERACTIVE 0x0600
+#define IPV6_PRIORITY_CONTROL 0x0700
+#define IPV6_PRIORITY_8 0x0800
+#define IPV6_PRIORITY_9 0x0900
+#define IPV6_PRIORITY_10 0x0a00
+#define IPV6_PRIORITY_11 0x0b00
+#define IPV6_PRIORITY_12 0x0c00
+#define IPV6_PRIORITY_13 0x0d00
+#define IPV6_PRIORITY_14 0x0e00
+#define IPV6_PRIORITY_15 0x0f00
+
+#define IPPROTO_HOPOPTS 0  
+#define IPPROTO_ROUTING 43  
+#define IPPROTO_FRAGMENT 44  
+#define IPPROTO_ICMPV6 58  
+#define IPPROTO_NONE 59  
+#define IPPROTO_DSTOPTS 60  
+
+#define IPV6_TLV_PAD0 0
+#define IPV6_TLV_PADN 1
+#define IPV6_TLV_ROUTERALERT 5
+#define IPV6_TLV_JUMBO 194
+
+#define IPV6_ADDRFORM 1
+#define IPV6_2292PKTINFO 2
+#define IPV6_2292HOPOPTS 3
+#define IPV6_2292DSTOPTS 4
+#define IPV6_2292RTHDR 5
+#define IPV6_2292PKTOPTIONS 6
+#define IPV6_CHECKSUM 7
+#define IPV6_2292HOPLIMIT 8
+#define IPV6_NEXTHOP 9
+#define IPV6_AUTHHDR 10  
+#define IPV6_FLOWINFO 11
+
+#define IPV6_UNICAST_HOPS 16
+#define IPV6_MULTICAST_IF 17
+#define IPV6_MULTICAST_HOPS 18
+#define IPV6_MULTICAST_LOOP 19
+#define IPV6_ADD_MEMBERSHIP 20
+#define IPV6_DROP_MEMBERSHIP 21
+#define IPV6_ROUTER_ALERT 22
+#define IPV6_MTU_DISCOVER 23
+#define IPV6_MTU 24
+#define IPV6_RECVERR 25
+#define IPV6_V6ONLY 26
+#define IPV6_JOIN_ANYCAST 27
+#define IPV6_LEAVE_ANYCAST 28
+
+#define IPV6_PMTUDISC_DONT 0
+#define IPV6_PMTUDISC_WANT 1
+#define IPV6_PMTUDISC_DO 2
+
+#define IPV6_FLOWLABEL_MGR 32
+#define IPV6_FLOWINFO_SEND 33
+
+#define IPV6_IPSEC_POLICY 34
+#define IPV6_XFRM_POLICY 35
+
+#define IPV6_RECVPKTINFO 49
+#define IPV6_PKTINFO 50
+#define IPV6_RECVHOPLIMIT 51
+#define IPV6_HOPLIMIT 52
+#define IPV6_RECVHOPOPTS 53
+#define IPV6_HOPOPTS 54
+#define IPV6_RTHDRDSTOPTS 55
+#define IPV6_RECVRTHDR 56
+#define IPV6_RTHDR 57
+#define IPV6_RECVDSTOPTS 58
+#define IPV6_DSTOPTS 59
+
+#define IPV6_RECVTCLASS 66
+#define IPV6_TCLASS 67
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/init.h b/ndk/platforms/android-3/include/linux/init.h
new file mode 100644
index 0000000..846c4eb
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/init.h
@@ -0,0 +1,137 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_INIT_H
+#define _LINUX_INIT_H
+
+#include <linux/compiler.h>
+
+#define __init __attribute__ ((__section__ (".init.text")))
+#define __initdata __attribute__ ((__section__ (".init.data")))
+#define __exitdata __attribute__ ((__section__(".exit.data")))
+#define __exit_call __attribute_used__ __attribute__ ((__section__ (".exitcall.exit")))
+
+#ifdef MODULE
+#define __exit __attribute__ ((__section__(".exit.text")))
+#else
+#define __exit __attribute_used__ __attribute__ ((__section__(".exit.text")))
+#endif
+
+#define __INIT .section ".init.text","ax"
+#define __FINIT .previous
+#define __INITDATA .section ".init.data","aw"
+
+#ifndef __ASSEMBLY__
+
+typedef int (*initcall_t)(void);
+typedef void (*exitcall_t)(void);
+
+#endif
+
+#ifndef MODULE
+
+#ifndef __ASSEMBLY__
+
+#define __define_initcall(level,fn)   static initcall_t __initcall_##fn __attribute_used__   __attribute__((__section__(".initcall" level ".init"))) = fn
+
+#define core_initcall(fn) __define_initcall("1",fn)
+#define postcore_initcall(fn) __define_initcall("2",fn)
+#define arch_initcall(fn) __define_initcall("3",fn)
+#define subsys_initcall(fn) __define_initcall("4",fn)
+#define fs_initcall(fn) __define_initcall("5",fn)
+#define device_initcall(fn) __define_initcall("6",fn)
+#define late_initcall(fn) __define_initcall("7",fn)
+
+#define __initcall(fn) device_initcall(fn)
+
+#define __exitcall(fn)   static exitcall_t __exitcall_##fn __exit_call = fn
+
+#define console_initcall(fn)   static initcall_t __initcall_##fn   __attribute_used__ __attribute__((__section__(".con_initcall.init")))=fn
+
+#define security_initcall(fn)   static initcall_t __initcall_##fn   __attribute_used__ __attribute__((__section__(".security_initcall.init"))) = fn
+
+struct obs_kernel_param {
+ const char *str;
+ int (*setup_func)(char *);
+ int early;
+};
+
+#define __setup_param(str, unique_id, fn, early)   static char __setup_str_##unique_id[] __initdata = str;   static struct obs_kernel_param __setup_##unique_id   __attribute_used__   __attribute__((__section__(".init.setup")))   __attribute__((aligned((sizeof(long)))))   = { __setup_str_##unique_id, fn, early }
+
+#define __setup_null_param(str, unique_id)   __setup_param(str, unique_id, NULL, 0)
+
+#define __setup(str, fn)   __setup_param(str, fn, fn, 0)
+
+#define __obsolete_setup(str)   __setup_null_param(str, __LINE__)
+
+#define early_param(str, fn)   __setup_param(str, fn, fn, 1)
+
+#endif
+
+#define module_init(x) __initcall(x);
+
+#define module_exit(x) __exitcall(x);
+
+#else
+
+#define core_initcall(fn) module_init(fn)
+#define postcore_initcall(fn) module_init(fn)
+#define arch_initcall(fn) module_init(fn)
+#define subsys_initcall(fn) module_init(fn)
+#define fs_initcall(fn) module_init(fn)
+#define device_initcall(fn) module_init(fn)
+#define late_initcall(fn) module_init(fn)
+
+#define security_initcall(fn) module_init(fn)
+
+#define module_init(initfn)   static inline initcall_t __inittest(void)   { return initfn; }   int init_module(void) __attribute__((alias(#initfn)));
+
+#define module_exit(exitfn)   static inline exitcall_t __exittest(void)   { return exitfn; }   void cleanup_module(void) __attribute__((alias(#exitfn)));
+
+#define __setup_param(str, unique_id, fn)  
+#define __setup_null_param(str, unique_id)  
+#define __setup(str, func)  
+#define __obsolete_setup(str)  
+#endif
+
+#define __nosavedata __attribute__ ((__section__ (".data.nosave")))
+
+#define __init_or_module __init
+#define __initdata_or_module __initdata
+
+#define __devinit __init
+#define __devinitdata __initdata
+#define __devexit __exit
+#define __devexitdata __exitdata
+
+#define __cpuinit __init
+#define __cpuinitdata __initdata
+#define __cpuexit __exit
+#define __cpuexitdata __exitdata
+
+#define __meminit __init
+#define __meminitdata __initdata
+#define __memexit __exit
+#define __memexitdata __exitdata
+
+#ifdef MODULE
+#define __devexit_p(x) x
+#else
+#define __devexit_p(x) NULL
+#endif
+
+#ifdef MODULE
+#define __exit_p(x) x
+#else
+#define __exit_p(x) NULL
+#endif
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/inotify.h b/ndk/platforms/android-3/include/linux/inotify.h
new file mode 100644
index 0000000..db53417
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/inotify.h
@@ -0,0 +1,53 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_INOTIFY_H
+#define _LINUX_INOTIFY_H
+
+#include <linux/types.h>
+
+struct inotify_event {
+ __s32 wd;
+ __u32 mask;
+ __u32 cookie;
+ __u32 len;
+ char name[0];
+};
+
+#define IN_ACCESS 0x00000001  
+#define IN_MODIFY 0x00000002  
+#define IN_ATTRIB 0x00000004  
+#define IN_CLOSE_WRITE 0x00000008  
+#define IN_CLOSE_NOWRITE 0x00000010  
+#define IN_OPEN 0x00000020  
+#define IN_MOVED_FROM 0x00000040  
+#define IN_MOVED_TO 0x00000080  
+#define IN_CREATE 0x00000100  
+#define IN_DELETE 0x00000200  
+#define IN_DELETE_SELF 0x00000400  
+#define IN_MOVE_SELF 0x00000800  
+
+#define IN_UNMOUNT 0x00002000  
+#define IN_Q_OVERFLOW 0x00004000  
+#define IN_IGNORED 0x00008000  
+
+#define IN_CLOSE (IN_CLOSE_WRITE | IN_CLOSE_NOWRITE)  
+#define IN_MOVE (IN_MOVED_FROM | IN_MOVED_TO)  
+
+#define IN_ONLYDIR 0x01000000  
+#define IN_DONT_FOLLOW 0x02000000  
+#define IN_MASK_ADD 0x20000000  
+#define IN_ISDIR 0x40000000  
+#define IN_ONESHOT 0x80000000  
+
+#define IN_ALL_EVENTS (IN_ACCESS | IN_MODIFY | IN_ATTRIB | IN_CLOSE_WRITE |   IN_CLOSE_NOWRITE | IN_OPEN | IN_MOVED_FROM |   IN_MOVED_TO | IN_DELETE | IN_CREATE | IN_DELETE_SELF |   IN_MOVE_SELF)
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/input.h b/ndk/platforms/android-3/include/linux/input.h
new file mode 100644
index 0000000..96dae14
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/input.h
@@ -0,0 +1,715 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _INPUT_H
+#define _INPUT_H
+
+#include <sys/time.h>
+#include <sys/ioctl.h>
+#include <sys/types.h>
+#include <asm/types.h>
+
+struct input_event {
+ struct timeval time;
+ __u16 type;
+ __u16 code;
+ __s32 value;
+};
+
+#define EV_VERSION 0x010000
+
+struct input_id {
+ __u16 bustype;
+ __u16 vendor;
+ __u16 product;
+ __u16 version;
+};
+
+struct input_absinfo {
+ __s32 value;
+ __s32 minimum;
+ __s32 maximum;
+ __s32 fuzz;
+ __s32 flat;
+};
+
+#define EVIOCGVERSION _IOR('E', 0x01, int)  
+#define EVIOCGID _IOR('E', 0x02, struct input_id)  
+#define EVIOCGREP _IOR('E', 0x03, int[2])  
+#define EVIOCSREP _IOW('E', 0x03, int[2])  
+#define EVIOCGKEYCODE _IOR('E', 0x04, int[2])  
+#define EVIOCSKEYCODE _IOW('E', 0x04, int[2])  
+
+#define EVIOCGNAME(len) _IOC(_IOC_READ, 'E', 0x06, len)  
+#define EVIOCGPHYS(len) _IOC(_IOC_READ, 'E', 0x07, len)  
+#define EVIOCGUNIQ(len) _IOC(_IOC_READ, 'E', 0x08, len)  
+
+#define EVIOCGKEY(len) _IOC(_IOC_READ, 'E', 0x18, len)  
+#define EVIOCGLED(len) _IOC(_IOC_READ, 'E', 0x19, len)  
+#define EVIOCGSND(len) _IOC(_IOC_READ, 'E', 0x1a, len)  
+#define EVIOCGSW(len) _IOC(_IOC_READ, 'E', 0x1b, len)  
+
+#define EVIOCGBIT(ev,len) _IOC(_IOC_READ, 'E', 0x20 + ev, len)  
+#define EVIOCGABS(abs) _IOR('E', 0x40 + abs, struct input_absinfo)  
+#define EVIOCSABS(abs) _IOW('E', 0xc0 + abs, struct input_absinfo)  
+
+#define EVIOCSFF _IOC(_IOC_WRITE, 'E', 0x80, sizeof(struct ff_effect))  
+#define EVIOCRMFF _IOW('E', 0x81, int)  
+#define EVIOCGEFFECTS _IOR('E', 0x84, int)  
+
+#define EVIOCGRAB _IOW('E', 0x90, int)  
+
+#define EV_SYN 0x00
+#define EV_KEY 0x01
+#define EV_REL 0x02
+#define EV_ABS 0x03
+#define EV_MSC 0x04
+#define EV_SW 0x05
+#define EV_LED 0x11
+#define EV_SND 0x12
+#define EV_REP 0x14
+#define EV_FF 0x15
+#define EV_PWR 0x16
+#define EV_FF_STATUS 0x17
+#define EV_MAX 0x1f
+
+#define SYN_REPORT 0
+#define SYN_CONFIG 1
+
+#define KEY_RESERVED 0
+#define KEY_ESC 1
+#define KEY_1 2
+#define KEY_2 3
+#define KEY_3 4
+#define KEY_4 5
+#define KEY_5 6
+#define KEY_6 7
+#define KEY_7 8
+#define KEY_8 9
+#define KEY_9 10
+#define KEY_0 11
+#define KEY_MINUS 12
+#define KEY_EQUAL 13
+#define KEY_BACKSPACE 14
+#define KEY_TAB 15
+#define KEY_Q 16
+#define KEY_W 17
+#define KEY_E 18
+#define KEY_R 19
+#define KEY_T 20
+#define KEY_Y 21
+#define KEY_U 22
+#define KEY_I 23
+#define KEY_O 24
+#define KEY_P 25
+#define KEY_LEFTBRACE 26
+#define KEY_RIGHTBRACE 27
+#define KEY_ENTER 28
+#define KEY_LEFTCTRL 29
+#define KEY_A 30
+#define KEY_S 31
+#define KEY_D 32
+#define KEY_F 33
+#define KEY_G 34
+#define KEY_H 35
+#define KEY_J 36
+#define KEY_K 37
+#define KEY_L 38
+#define KEY_SEMICOLON 39
+#define KEY_APOSTROPHE 40
+#define KEY_GRAVE 41
+#define KEY_LEFTSHIFT 42
+#define KEY_BACKSLASH 43
+#define KEY_Z 44
+#define KEY_X 45
+#define KEY_C 46
+#define KEY_V 47
+#define KEY_B 48
+#define KEY_N 49
+#define KEY_M 50
+#define KEY_COMMA 51
+#define KEY_DOT 52
+#define KEY_SLASH 53
+#define KEY_RIGHTSHIFT 54
+#define KEY_KPASTERISK 55
+#define KEY_LEFTALT 56
+#define KEY_SPACE 57
+#define KEY_CAPSLOCK 58
+#define KEY_F1 59
+#define KEY_F2 60
+#define KEY_F3 61
+#define KEY_F4 62
+#define KEY_F5 63
+#define KEY_F6 64
+#define KEY_F7 65
+#define KEY_F8 66
+#define KEY_F9 67
+#define KEY_F10 68
+#define KEY_NUMLOCK 69
+#define KEY_SCROLLLOCK 70
+#define KEY_KP7 71
+#define KEY_KP8 72
+#define KEY_KP9 73
+#define KEY_KPMINUS 74
+#define KEY_KP4 75
+#define KEY_KP5 76
+#define KEY_KP6 77
+#define KEY_KPPLUS 78
+#define KEY_KP1 79
+#define KEY_KP2 80
+#define KEY_KP3 81
+#define KEY_KP0 82
+#define KEY_KPDOT 83
+
+#define KEY_ZENKAKUHANKAKU 85
+#define KEY_102ND 86
+#define KEY_F11 87
+#define KEY_F12 88
+#define KEY_RO 89
+#define KEY_KATAKANA 90
+#define KEY_HIRAGANA 91
+#define KEY_HENKAN 92
+#define KEY_KATAKANAHIRAGANA 93
+#define KEY_MUHENKAN 94
+#define KEY_KPJPCOMMA 95
+#define KEY_KPENTER 96
+#define KEY_RIGHTCTRL 97
+#define KEY_KPSLASH 98
+#define KEY_SYSRQ 99
+#define KEY_RIGHTALT 100
+#define KEY_LINEFEED 101
+#define KEY_HOME 102
+#define KEY_UP 103
+#define KEY_PAGEUP 104
+#define KEY_LEFT 105
+#define KEY_RIGHT 106
+#define KEY_END 107
+#define KEY_DOWN 108
+#define KEY_PAGEDOWN 109
+#define KEY_INSERT 110
+#define KEY_DELETE 111
+#define KEY_MACRO 112
+#define KEY_MUTE 113
+#define KEY_VOLUMEDOWN 114
+#define KEY_VOLUMEUP 115
+#define KEY_POWER 116
+#define KEY_KPEQUAL 117
+#define KEY_KPPLUSMINUS 118
+#define KEY_PAUSE 119
+
+#define KEY_KPCOMMA 121
+#define KEY_HANGEUL 122
+#define KEY_HANGUEL KEY_HANGEUL
+#define KEY_HANJA 123
+#define KEY_YEN 124
+#define KEY_LEFTMETA 125
+#define KEY_RIGHTMETA 126
+#define KEY_COMPOSE 127
+
+#define KEY_STOP 128
+#define KEY_AGAIN 129
+#define KEY_PROPS 130
+#define KEY_UNDO 131
+#define KEY_FRONT 132
+#define KEY_COPY 133
+#define KEY_OPEN 134
+#define KEY_PASTE 135
+#define KEY_FIND 136
+#define KEY_CUT 137
+#define KEY_HELP 138
+#define KEY_MENU 139
+#define KEY_CALC 140
+#define KEY_SETUP 141
+#define KEY_SLEEP 142
+#define KEY_WAKEUP 143
+#define KEY_FILE 144
+#define KEY_SENDFILE 145
+#define KEY_DELETEFILE 146
+#define KEY_XFER 147
+#define KEY_PROG1 148
+#define KEY_PROG2 149
+#define KEY_WWW 150
+#define KEY_MSDOS 151
+#define KEY_COFFEE 152
+#define KEY_DIRECTION 153
+#define KEY_CYCLEWINDOWS 154
+#define KEY_MAIL 155
+#define KEY_BOOKMARKS 156
+#define KEY_COMPUTER 157
+#define KEY_BACK 158
+#define KEY_FORWARD 159
+#define KEY_CLOSECD 160
+#define KEY_EJECTCD 161
+#define KEY_EJECTCLOSECD 162
+#define KEY_NEXTSONG 163
+#define KEY_PLAYPAUSE 164
+#define KEY_PREVIOUSSONG 165
+#define KEY_STOPCD 166
+#define KEY_RECORD 167
+#define KEY_REWIND 168
+#define KEY_PHONE 169
+#define KEY_ISO 170
+#define KEY_CONFIG 171
+#define KEY_HOMEPAGE 172
+#define KEY_REFRESH 173
+#define KEY_EXIT 174
+#define KEY_MOVE 175
+#define KEY_EDIT 176
+#define KEY_SCROLLUP 177
+#define KEY_SCROLLDOWN 178
+#define KEY_KPLEFTPAREN 179
+#define KEY_KPRIGHTPAREN 180
+#define KEY_NEW 181
+#define KEY_REDO 182
+
+#define KEY_F13 183
+#define KEY_F14 184
+#define KEY_F15 185
+#define KEY_F16 186
+#define KEY_F17 187
+#define KEY_F18 188
+#define KEY_F19 189
+#define KEY_F20 190
+#define KEY_F21 191
+#define KEY_F22 192
+#define KEY_F23 193
+#define KEY_F24 194
+
+#define KEY_PLAYCD 200
+#define KEY_PAUSECD 201
+#define KEY_PROG3 202
+#define KEY_PROG4 203
+#define KEY_SUSPEND 205
+#define KEY_CLOSE 206
+#define KEY_PLAY 207
+#define KEY_FASTFORWARD 208
+#define KEY_BASSBOOST 209
+#define KEY_PRINT 210
+#define KEY_HP 211
+#define KEY_CAMERA 212
+#define KEY_SOUND 213
+#define KEY_QUESTION 214
+#define KEY_EMAIL 215
+#define KEY_CHAT 216
+#define KEY_SEARCH 217
+#define KEY_CONNECT 218
+#define KEY_FINANCE 219
+#define KEY_SPORT 220
+#define KEY_SHOP 221
+#define KEY_ALTERASE 222
+#define KEY_CANCEL 223
+#define KEY_BRIGHTNESSDOWN 224
+#define KEY_BRIGHTNESSUP 225
+#define KEY_MEDIA 226
+
+#define KEY_STAR 227
+#define KEY_SHARP 228
+#define KEY_SOFT1 229
+#define KEY_SOFT2 230
+#define KEY_SEND 231
+#define KEY_CENTER 232
+#define KEY_HEADSETHOOK 233
+#define KEY_0_5 234
+#define KEY_2_5 235
+
+#define KEY_SWITCHVIDEOMODE 236
+#define KEY_KBDILLUMTOGGLE 237
+#define KEY_KBDILLUMDOWN 238
+#define KEY_KBDILLUMUP 239
+
+#define KEY_SEND 231
+#define KEY_REPLY 232
+#define KEY_FORWARDMAIL 233
+#define KEY_SAVE 234
+#define KEY_DOCUMENTS 235
+
+#define KEY_BATTERY 236
+
+#define KEY_UNKNOWN 240
+
+#define BTN_MISC 0x100
+#define BTN_0 0x100
+#define BTN_1 0x101
+#define BTN_2 0x102
+#define BTN_3 0x103
+#define BTN_4 0x104
+#define BTN_5 0x105
+#define BTN_6 0x106
+#define BTN_7 0x107
+#define BTN_8 0x108
+#define BTN_9 0x109
+
+#define BTN_MOUSE 0x110
+#define BTN_LEFT 0x110
+#define BTN_RIGHT 0x111
+#define BTN_MIDDLE 0x112
+#define BTN_SIDE 0x113
+#define BTN_EXTRA 0x114
+#define BTN_FORWARD 0x115
+#define BTN_BACK 0x116
+#define BTN_TASK 0x117
+
+#define BTN_JOYSTICK 0x120
+#define BTN_TRIGGER 0x120
+#define BTN_THUMB 0x121
+#define BTN_THUMB2 0x122
+#define BTN_TOP 0x123
+#define BTN_TOP2 0x124
+#define BTN_PINKIE 0x125
+#define BTN_BASE 0x126
+#define BTN_BASE2 0x127
+#define BTN_BASE3 0x128
+#define BTN_BASE4 0x129
+#define BTN_BASE5 0x12a
+#define BTN_BASE6 0x12b
+#define BTN_DEAD 0x12f
+
+#define BTN_GAMEPAD 0x130
+#define BTN_A 0x130
+#define BTN_B 0x131
+#define BTN_C 0x132
+#define BTN_X 0x133
+#define BTN_Y 0x134
+#define BTN_Z 0x135
+#define BTN_TL 0x136
+#define BTN_TR 0x137
+#define BTN_TL2 0x138
+#define BTN_TR2 0x139
+#define BTN_SELECT 0x13a
+#define BTN_START 0x13b
+#define BTN_MODE 0x13c
+#define BTN_THUMBL 0x13d
+#define BTN_THUMBR 0x13e
+
+#define BTN_DIGI 0x140
+#define BTN_TOOL_PEN 0x140
+#define BTN_TOOL_RUBBER 0x141
+#define BTN_TOOL_BRUSH 0x142
+#define BTN_TOOL_PENCIL 0x143
+#define BTN_TOOL_AIRBRUSH 0x144
+#define BTN_TOOL_FINGER 0x145
+#define BTN_TOOL_MOUSE 0x146
+#define BTN_TOOL_LENS 0x147
+#define BTN_TOUCH 0x14a
+#define BTN_STYLUS 0x14b
+#define BTN_STYLUS2 0x14c
+#define BTN_TOOL_DOUBLETAP 0x14d
+#define BTN_TOOL_TRIPLETAP 0x14e
+
+#define BTN_WHEEL 0x150
+#define BTN_GEAR_DOWN 0x150
+#define BTN_GEAR_UP 0x151
+
+#define KEY_OK 0x160
+#define KEY_SELECT 0x161
+#define KEY_GOTO 0x162
+#define KEY_CLEAR 0x163
+#define KEY_POWER2 0x164
+#define KEY_OPTION 0x165
+#define KEY_INFO 0x166
+#define KEY_TIME 0x167
+#define KEY_VENDOR 0x168
+#define KEY_ARCHIVE 0x169
+#define KEY_PROGRAM 0x16a
+#define KEY_CHANNEL 0x16b
+#define KEY_FAVORITES 0x16c
+#define KEY_EPG 0x16d
+#define KEY_PVR 0x16e
+#define KEY_MHP 0x16f
+#define KEY_LANGUAGE 0x170
+#define KEY_TITLE 0x171
+#define KEY_SUBTITLE 0x172
+#define KEY_ANGLE 0x173
+#define KEY_ZOOM 0x174
+#define KEY_MODE 0x175
+#define KEY_KEYBOARD 0x176
+#define KEY_SCREEN 0x177
+#define KEY_PC 0x178
+#define KEY_TV 0x179
+#define KEY_TV2 0x17a
+#define KEY_VCR 0x17b
+#define KEY_VCR2 0x17c
+#define KEY_SAT 0x17d
+#define KEY_SAT2 0x17e
+#define KEY_CD 0x17f
+#define KEY_TAPE 0x180
+#define KEY_RADIO 0x181
+#define KEY_TUNER 0x182
+#define KEY_PLAYER 0x183
+#define KEY_TEXT 0x184
+#define KEY_DVD 0x185
+#define KEY_AUX 0x186
+#define KEY_MP3 0x187
+#define KEY_AUDIO 0x188
+#define KEY_VIDEO 0x189
+#define KEY_DIRECTORY 0x18a
+#define KEY_LIST 0x18b
+#define KEY_MEMO 0x18c
+#define KEY_CALENDAR 0x18d
+#define KEY_RED 0x18e
+#define KEY_GREEN 0x18f
+#define KEY_YELLOW 0x190
+#define KEY_BLUE 0x191
+#define KEY_CHANNELUP 0x192
+#define KEY_CHANNELDOWN 0x193
+#define KEY_FIRST 0x194
+#define KEY_LAST 0x195
+#define KEY_AB 0x196
+#define KEY_NEXT 0x197
+#define KEY_RESTART 0x198
+#define KEY_SLOW 0x199
+#define KEY_SHUFFLE 0x19a
+#define KEY_BREAK 0x19b
+#define KEY_PREVIOUS 0x19c
+#define KEY_DIGITS 0x19d
+#define KEY_TEEN 0x19e
+#define KEY_TWEN 0x19f
+
+#define KEY_DEL_EOL 0x1c0
+#define KEY_DEL_EOS 0x1c1
+#define KEY_INS_LINE 0x1c2
+#define KEY_DEL_LINE 0x1c3
+
+#define KEY_FN 0x1d0
+#define KEY_FN_ESC 0x1d1
+#define KEY_FN_F1 0x1d2
+#define KEY_FN_F2 0x1d3
+#define KEY_FN_F3 0x1d4
+#define KEY_FN_F4 0x1d5
+#define KEY_FN_F5 0x1d6
+#define KEY_FN_F6 0x1d7
+#define KEY_FN_F7 0x1d8
+#define KEY_FN_F8 0x1d9
+#define KEY_FN_F9 0x1da
+#define KEY_FN_F10 0x1db
+#define KEY_FN_F11 0x1dc
+#define KEY_FN_F12 0x1dd
+#define KEY_FN_1 0x1de
+#define KEY_FN_2 0x1df
+#define KEY_FN_D 0x1e0
+#define KEY_FN_E 0x1e1
+#define KEY_FN_F 0x1e2
+#define KEY_FN_S 0x1e3
+#define KEY_FN_B 0x1e4
+
+#define KEY_BRL_DOT1 0x1f1
+#define KEY_BRL_DOT2 0x1f2
+#define KEY_BRL_DOT3 0x1f3
+#define KEY_BRL_DOT4 0x1f4
+#define KEY_BRL_DOT5 0x1f5
+#define KEY_BRL_DOT6 0x1f6
+#define KEY_BRL_DOT7 0x1f7
+#define KEY_BRL_DOT8 0x1f8
+
+#define KEY_MIN_INTERESTING KEY_MUTE
+#define KEY_MAX 0x1ff
+
+#define REL_X 0x00
+#define REL_Y 0x01
+#define REL_Z 0x02
+#define REL_RX 0x03
+#define REL_RY 0x04
+#define REL_RZ 0x05
+#define REL_HWHEEL 0x06
+#define REL_DIAL 0x07
+#define REL_WHEEL 0x08
+#define REL_MISC 0x09
+#define REL_MAX 0x0f
+
+#define ABS_X 0x00
+#define ABS_Y 0x01
+#define ABS_Z 0x02
+#define ABS_RX 0x03
+#define ABS_RY 0x04
+#define ABS_RZ 0x05
+#define ABS_THROTTLE 0x06
+#define ABS_RUDDER 0x07
+#define ABS_WHEEL 0x08
+#define ABS_GAS 0x09
+#define ABS_BRAKE 0x0a
+#define ABS_HAT0X 0x10
+#define ABS_HAT0Y 0x11
+#define ABS_HAT1X 0x12
+#define ABS_HAT1Y 0x13
+#define ABS_HAT2X 0x14
+#define ABS_HAT2Y 0x15
+#define ABS_HAT3X 0x16
+#define ABS_HAT3Y 0x17
+#define ABS_PRESSURE 0x18
+#define ABS_DISTANCE 0x19
+#define ABS_TILT_X 0x1a
+#define ABS_TILT_Y 0x1b
+#define ABS_TOOL_WIDTH 0x1c
+#define ABS_VOLUME 0x20
+#define ABS_MISC 0x28
+#define ABS_MAX 0x3f
+
+#define SW_LID 0x00  
+#define SW_TABLET_MODE 0x01  
+#define SW_HEADPHONE_INSERT 0x02  
+#define SW_MAX 0x0f
+
+#define MSC_SERIAL 0x00
+#define MSC_PULSELED 0x01
+#define MSC_GESTURE 0x02
+#define MSC_RAW 0x03
+#define MSC_SCAN 0x04
+#define MSC_MAX 0x07
+
+#define LED_NUML 0x00
+#define LED_CAPSL 0x01
+#define LED_SCROLLL 0x02
+#define LED_COMPOSE 0x03
+#define LED_KANA 0x04
+#define LED_SLEEP 0x05
+#define LED_SUSPEND 0x06
+#define LED_MUTE 0x07
+#define LED_MISC 0x08
+#define LED_MAIL 0x09
+#define LED_CHARGING 0x0a
+#define LED_MAX 0x0f
+
+#define REP_DELAY 0x00
+#define REP_PERIOD 0x01
+#define REP_MAX 0x01
+
+#define SND_CLICK 0x00
+#define SND_BELL 0x01
+#define SND_TONE 0x02
+#define SND_MAX 0x07
+
+#define ID_BUS 0
+#define ID_VENDOR 1
+#define ID_PRODUCT 2
+#define ID_VERSION 3
+
+#define BUS_PCI 0x01
+#define BUS_ISAPNP 0x02
+#define BUS_USB 0x03
+#define BUS_HIL 0x04
+#define BUS_BLUETOOTH 0x05
+
+#define BUS_ISA 0x10
+#define BUS_I8042 0x11
+#define BUS_XTKBD 0x12
+#define BUS_RS232 0x13
+#define BUS_GAMEPORT 0x14
+#define BUS_PARPORT 0x15
+#define BUS_AMIGA 0x16
+#define BUS_ADB 0x17
+#define BUS_I2C 0x18
+#define BUS_HOST 0x19
+#define BUS_GSC 0x1A
+
+#define FF_STATUS_STOPPED 0x00
+#define FF_STATUS_PLAYING 0x01
+#define FF_STATUS_MAX 0x01
+
+struct ff_replay {
+ __u16 length;
+ __u16 delay;
+};
+
+struct ff_trigger {
+ __u16 button;
+ __u16 interval;
+};
+
+struct ff_envelope {
+ __u16 attack_length;
+ __u16 attack_level;
+ __u16 fade_length;
+ __u16 fade_level;
+};
+
+struct ff_constant_effect {
+ __s16 level;
+ struct ff_envelope envelope;
+};
+
+struct ff_ramp_effect {
+ __s16 start_level;
+ __s16 end_level;
+ struct ff_envelope envelope;
+};
+
+struct ff_condition_effect {
+ __u16 right_saturation;
+ __u16 left_saturation;
+
+ __s16 right_coeff;
+ __s16 left_coeff;
+
+ __u16 deadband;
+ __s16 center;
+
+};
+
+struct ff_periodic_effect {
+ __u16 waveform;
+ __u16 period;
+ __s16 magnitude;
+ __s16 offset;
+ __u16 phase;
+
+ struct ff_envelope envelope;
+
+ __u32 custom_len;
+ __s16 *custom_data;
+
+};
+
+struct ff_rumble_effect {
+ __u16 strong_magnitude;
+ __u16 weak_magnitude;
+};
+
+struct ff_effect {
+ __u16 type;
+
+ __s16 id;
+
+ __u16 direction;
+
+ struct ff_trigger trigger;
+ struct ff_replay replay;
+
+ union {
+ struct ff_constant_effect constant;
+ struct ff_ramp_effect ramp;
+ struct ff_periodic_effect periodic;
+ struct ff_condition_effect condition[2];
+ struct ff_rumble_effect rumble;
+ } u;
+};
+
+#define FF_RUMBLE 0x50
+#define FF_PERIODIC 0x51
+#define FF_CONSTANT 0x52
+#define FF_SPRING 0x53
+#define FF_FRICTION 0x54
+#define FF_DAMPER 0x55
+#define FF_INERTIA 0x56
+#define FF_RAMP 0x57
+
+#define FF_SQUARE 0x58
+#define FF_TRIANGLE 0x59
+#define FF_SINE 0x5a
+#define FF_SAW_UP 0x5b
+#define FF_SAW_DOWN 0x5c
+#define FF_CUSTOM 0x5d
+
+#define FF_GAIN 0x60
+#define FF_AUTOCENTER 0x61
+
+#define FF_MAX 0x7f
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/interrupt.h b/ndk/platforms/android-3/include/linux/interrupt.h
new file mode 100644
index 0000000..f48592f
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/interrupt.h
@@ -0,0 +1,121 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_INTERRUPT_H
+#define _LINUX_INTERRUPT_H
+
+#include <linux/kernel.h>
+#include <linux/linkage.h>
+#include <linux/bitops.h>
+#include <linux/preempt.h>
+#include <linux/cpumask.h>
+#include <linux/irqreturn.h>
+#include <linux/hardirq.h>
+#include <linux/sched.h>
+#include <linux/irqflags.h>
+#include <asm/atomic.h>
+#include <asm/ptrace.h>
+#include <asm/system.h>
+
+#define IRQF_TRIGGER_NONE 0x00000000
+#define IRQF_TRIGGER_RISING 0x00000001
+#define IRQF_TRIGGER_FALLING 0x00000002
+#define IRQF_TRIGGER_HIGH 0x00000004
+#define IRQF_TRIGGER_LOW 0x00000008
+#define IRQF_TRIGGER_MASK (IRQF_TRIGGER_HIGH | IRQF_TRIGGER_LOW |   IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING)
+#define IRQF_TRIGGER_PROBE 0x00000010
+
+#define IRQF_DISABLED 0x00000020
+#define IRQF_SAMPLE_RANDOM 0x00000040
+#define IRQF_SHARED 0x00000080
+#define IRQF_PROBE_SHARED 0x00000100
+#define IRQF_TIMER 0x00000200
+#define IRQF_PERCPU 0x00000400
+
+#define SA_INTERRUPT IRQF_DISABLED
+#define SA_SAMPLE_RANDOM IRQF_SAMPLE_RANDOM
+#define SA_SHIRQ IRQF_SHARED
+#define SA_PROBEIRQ IRQF_PROBE_SHARED
+#define SA_PERCPU IRQF_PERCPU
+
+#define SA_TRIGGER_LOW IRQF_TRIGGER_LOW
+#define SA_TRIGGER_HIGH IRQF_TRIGGER_HIGH
+#define SA_TRIGGER_FALLING IRQF_TRIGGER_FALLING
+#define SA_TRIGGER_RISING IRQF_TRIGGER_RISING
+#define SA_TRIGGER_MASK IRQF_TRIGGER_MASK
+
+struct irqaction {
+ irqreturn_t (*handler)(int, void *, struct pt_regs *);
+ unsigned long flags;
+ cpumask_t mask;
+ const char *name;
+ void *dev_id;
+ struct irqaction *next;
+ int irq;
+ struct proc_dir_entry *dir;
+};
+
+#define local_irq_enable_in_hardirq() local_irq_enable()
+
+#define disable_irq_nosync_lockdep(irq) disable_irq_nosync(irq)
+#define disable_irq_lockdep(irq) disable_irq(irq)
+#define enable_irq_lockdep(irq) enable_irq(irq)
+
+#ifndef __ARCH_SET_SOFTIRQ_PENDING
+#define set_softirq_pending(x) (local_softirq_pending() = (x))
+#define or_softirq_pending(x) (local_softirq_pending() |= (x))
+#endif
+
+#define save_flags(x) save_flags(&x)
+#define save_and_cli(x) save_and_cli(&x)
+
+enum
+{
+ HI_SOFTIRQ=0,
+ TIMER_SOFTIRQ,
+ NET_TX_SOFTIRQ,
+ NET_RX_SOFTIRQ,
+ BLOCK_SOFTIRQ,
+ TASKLET_SOFTIRQ
+};
+
+struct softirq_action
+{
+ void (*action)(struct softirq_action *);
+ void *data;
+};
+
+#define __raise_softirq_irqoff(nr) do { or_softirq_pending(1UL << (nr)); } while (0)
+
+struct tasklet_struct
+{
+ struct tasklet_struct *next;
+ unsigned long state;
+ atomic_t count;
+ void (*func)(unsigned long);
+ unsigned long data;
+};
+
+#define DECLARE_TASKLET(name, func, data)  struct tasklet_struct name = { NULL, 0, ATOMIC_INIT(0), func, data }
+
+#define DECLARE_TASKLET_DISABLED(name, func, data)  struct tasklet_struct name = { NULL, 0, ATOMIC_INIT(1), func, data }
+
+enum
+{
+ TASKLET_STATE_SCHED,
+ TASKLET_STATE_RUN
+};
+
+#define tasklet_trylock(t) 1
+#define tasklet_unlock_wait(t) do { } while (0)
+#define tasklet_unlock(t) do { } while (0)
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/ioctl.h b/ndk/platforms/android-3/include/linux/ioctl.h
new file mode 100644
index 0000000..9efbeab
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/ioctl.h
@@ -0,0 +1,18 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_IOCTL_H
+#define _LINUX_IOCTL_H
+
+#include <asm/ioctl.h>
+
+#endif
+
diff --git a/ndk/platforms/android-3/include/linux/ioport.h b/ndk/platforms/android-3/include/linux/ioport.h
new file mode 100644
index 0000000..b2081fc
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/ioport.h
@@ -0,0 +1,95 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_IOPORT_H
+#define _LINUX_IOPORT_H
+
+#include <linux/compiler.h>
+#include <linux/types.h>
+
+struct resource {
+ resource_size_t start;
+ resource_size_t end;
+ const char *name;
+ unsigned long flags;
+ struct resource *parent, *sibling, *child;
+};
+
+struct resource_list {
+ struct resource_list *next;
+ struct resource *res;
+ struct pci_dev *dev;
+};
+
+#define IORESOURCE_BITS 0x000000ff  
+
+#define IORESOURCE_IO 0x00000100  
+#define IORESOURCE_MEM 0x00000200
+#define IORESOURCE_IRQ 0x00000400
+#define IORESOURCE_DMA 0x00000800
+
+#define IORESOURCE_PREFETCH 0x00001000  
+#define IORESOURCE_READONLY 0x00002000
+#define IORESOURCE_CACHEABLE 0x00004000
+#define IORESOURCE_RANGELENGTH 0x00008000
+#define IORESOURCE_SHADOWABLE 0x00010000
+#define IORESOURCE_BUS_HAS_VGA 0x00080000
+
+#define IORESOURCE_DISABLED 0x10000000
+#define IORESOURCE_UNSET 0x20000000
+#define IORESOURCE_AUTO 0x40000000
+#define IORESOURCE_BUSY 0x80000000  
+
+#define IORESOURCE_IRQ_HIGHEDGE (1<<0)
+#define IORESOURCE_IRQ_LOWEDGE (1<<1)
+#define IORESOURCE_IRQ_HIGHLEVEL (1<<2)
+#define IORESOURCE_IRQ_LOWLEVEL (1<<3)
+#define IORESOURCE_IRQ_SHAREABLE (1<<4)
+
+#define IORESOURCE_DMA_TYPE_MASK (3<<0)
+#define IORESOURCE_DMA_8BIT (0<<0)
+#define IORESOURCE_DMA_8AND16BIT (1<<0)
+#define IORESOURCE_DMA_16BIT (2<<0)
+
+#define IORESOURCE_DMA_MASTER (1<<2)
+#define IORESOURCE_DMA_BYTE (1<<3)
+#define IORESOURCE_DMA_WORD (1<<4)
+
+#define IORESOURCE_DMA_SPEED_MASK (3<<6)
+#define IORESOURCE_DMA_COMPATIBLE (0<<6)
+#define IORESOURCE_DMA_TYPEA (1<<6)
+#define IORESOURCE_DMA_TYPEB (2<<6)
+#define IORESOURCE_DMA_TYPEF (3<<6)
+
+#define IORESOURCE_MEM_WRITEABLE (1<<0)  
+#define IORESOURCE_MEM_CACHEABLE (1<<1)  
+#define IORESOURCE_MEM_RANGELENGTH (1<<2)  
+#define IORESOURCE_MEM_TYPE_MASK (3<<3)
+#define IORESOURCE_MEM_8BIT (0<<3)
+#define IORESOURCE_MEM_16BIT (1<<3)
+#define IORESOURCE_MEM_8AND16BIT (2<<3)
+#define IORESOURCE_MEM_32BIT (3<<3)
+#define IORESOURCE_MEM_SHADOWABLE (1<<5)  
+#define IORESOURCE_MEM_EXPANSIONROM (1<<6)
+
+#define IORESOURCE_ROM_ENABLE (1<<0)  
+#define IORESOURCE_ROM_SHADOW (1<<1)  
+#define IORESOURCE_ROM_COPY (1<<2)  
+
+#define request_region(start,n,name) __request_region(&ioport_resource, (start), (n), (name))
+#define request_mem_region(start,n,name) __request_region(&iomem_resource, (start), (n), (name))
+#define rename_region(region, newname) do { (region)->name = (newname); } while (0)
+
+#define release_region(start,n) __release_region(&ioport_resource, (start), (n))
+#define check_mem_region(start,n) __check_region(&iomem_resource, (start), (n))
+#define release_mem_region(start,n) __release_region(&iomem_resource, (start), (n))
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/ioprio.h b/ndk/platforms/android-3/include/linux/ioprio.h
new file mode 100644
index 0000000..a0a5d48
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/ioprio.h
@@ -0,0 +1,44 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef IOPRIO_H
+#define IOPRIO_H
+
+#include <linux/sched.h>
+
+#define IOPRIO_BITS (16)
+#define IOPRIO_CLASS_SHIFT (13)
+#define IOPRIO_PRIO_MASK ((1UL << IOPRIO_CLASS_SHIFT) - 1)
+
+#define IOPRIO_PRIO_CLASS(mask) ((mask) >> IOPRIO_CLASS_SHIFT)
+#define IOPRIO_PRIO_DATA(mask) ((mask) & IOPRIO_PRIO_MASK)
+#define IOPRIO_PRIO_VALUE(class, data) (((class) << IOPRIO_CLASS_SHIFT) | data)
+
+#define ioprio_valid(mask) (IOPRIO_PRIO_CLASS((mask)) != IOPRIO_CLASS_NONE)
+
+enum {
+ IOPRIO_CLASS_NONE,
+ IOPRIO_CLASS_RT,
+ IOPRIO_CLASS_BE,
+ IOPRIO_CLASS_IDLE,
+};
+
+#define IOPRIO_BE_NR (8)
+
+enum {
+ IOPRIO_WHO_PROCESS = 1,
+ IOPRIO_WHO_PGRP,
+ IOPRIO_WHO_USER,
+};
+
+#define IOPRIO_NORM (4)
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/ip.h b/ndk/platforms/android-3/include/linux/ip.h
new file mode 100644
index 0000000..040789d
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/ip.h
@@ -0,0 +1,118 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_IP_H
+#define _LINUX_IP_H
+#include <linux/types.h>
+#include <asm/byteorder.h>
+
+#define IPTOS_TOS_MASK 0x1E
+#define IPTOS_TOS(tos) ((tos)&IPTOS_TOS_MASK)
+#define IPTOS_LOWDELAY 0x10
+#define IPTOS_THROUGHPUT 0x08
+#define IPTOS_RELIABILITY 0x04
+#define IPTOS_MINCOST 0x02
+
+#define IPTOS_PREC_MASK 0xE0
+#define IPTOS_PREC(tos) ((tos)&IPTOS_PREC_MASK)
+#define IPTOS_PREC_NETCONTROL 0xe0
+#define IPTOS_PREC_INTERNETCONTROL 0xc0
+#define IPTOS_PREC_CRITIC_ECP 0xa0
+#define IPTOS_PREC_FLASHOVERRIDE 0x80
+#define IPTOS_PREC_FLASH 0x60
+#define IPTOS_PREC_IMMEDIATE 0x40
+#define IPTOS_PREC_PRIORITY 0x20
+#define IPTOS_PREC_ROUTINE 0x00
+
+#define IPOPT_COPY 0x80
+#define IPOPT_CLASS_MASK 0x60
+#define IPOPT_NUMBER_MASK 0x1f
+
+#define IPOPT_COPIED(o) ((o)&IPOPT_COPY)
+#define IPOPT_CLASS(o) ((o)&IPOPT_CLASS_MASK)
+#define IPOPT_NUMBER(o) ((o)&IPOPT_NUMBER_MASK)
+
+#define IPOPT_CONTROL 0x00
+#define IPOPT_RESERVED1 0x20
+#define IPOPT_MEASUREMENT 0x40
+#define IPOPT_RESERVED2 0x60
+
+#define IPOPT_END (0 |IPOPT_CONTROL)
+#define IPOPT_NOOP (1 |IPOPT_CONTROL)
+#define IPOPT_SEC (2 |IPOPT_CONTROL|IPOPT_COPY)
+#define IPOPT_LSRR (3 |IPOPT_CONTROL|IPOPT_COPY)
+#define IPOPT_TIMESTAMP (4 |IPOPT_MEASUREMENT)
+#define IPOPT_RR (7 |IPOPT_CONTROL)
+#define IPOPT_SID (8 |IPOPT_CONTROL|IPOPT_COPY)
+#define IPOPT_SSRR (9 |IPOPT_CONTROL|IPOPT_COPY)
+#define IPOPT_RA (20|IPOPT_CONTROL|IPOPT_COPY)
+
+#define IPVERSION 4
+#define MAXTTL 255
+#define IPDEFTTL 64
+
+#define IPOPT_OPTVAL 0
+#define IPOPT_OLEN 1
+#define IPOPT_OFFSET 2
+#define IPOPT_MINOFF 4
+#define MAX_IPOPTLEN 40
+#define IPOPT_NOP IPOPT_NOOP
+#define IPOPT_EOL IPOPT_END
+#define IPOPT_TS IPOPT_TIMESTAMP
+
+#define IPOPT_TS_TSONLY 0  
+#define IPOPT_TS_TSANDADDR 1  
+#define IPOPT_TS_PRESPEC 3  
+
+struct iphdr {
+#ifdef __LITTLE_ENDIAN_BITFIELD
+ __u8 ihl:4,
+ version:4;
+#elif defined (__BIG_ENDIAN_BITFIELD)
+ __u8 version:4,
+ ihl:4;
+#else
+#error "Please fix <asm/byteorder.h>"
+#endif
+ __u8 tos;
+ __be16 tot_len;
+ __be16 id;
+ __be16 frag_off;
+ __u8 ttl;
+ __u8 protocol;
+ __u16 check;
+ __be32 saddr;
+ __be32 daddr;
+
+};
+
+struct ip_auth_hdr {
+ __u8 nexthdr;
+ __u8 hdrlen;
+ __u16 reserved;
+ __u32 spi;
+ __u32 seq_no;
+ __u8 auth_data[0];
+};
+
+struct ip_esp_hdr {
+ __u32 spi;
+ __u32 seq_no;
+ __u8 enc_data[0];
+};
+
+struct ip_comp_hdr {
+ __u8 nexthdr;
+ __u8 flags;
+ __u16 cpi;
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/ipc.h b/ndk/platforms/android-3/include/linux/ipc.h
new file mode 100644
index 0000000..54766d5
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/ipc.h
@@ -0,0 +1,48 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_IPC_H
+#define _LINUX_IPC_H
+
+#include <linux/types.h>
+
+#define IPC_PRIVATE ((__kernel_key_t) 0) 
+
+struct ipc_perm
+{
+ __kernel_key_t key;
+ __kernel_uid_t uid;
+ __kernel_gid_t gid;
+ __kernel_uid_t cuid;
+ __kernel_gid_t cgid;
+ __kernel_mode_t mode;
+ unsigned short seq;
+};
+
+#include <asm/ipcbuf.h>
+
+#define IPC_CREAT 00001000  
+#define IPC_EXCL 00002000  
+#define IPC_NOWAIT 00004000  
+
+#define IPC_DIPC 00010000  
+#define IPC_OWN 00020000  
+
+#define IPC_RMID 0  
+#define IPC_SET 1  
+#define IPC_STAT 2  
+#define IPC_INFO 3  
+
+#define IPC_OLD 0  
+#define IPC_64 0x0100  
+
+#endif
+
diff --git a/ndk/platforms/android-3/include/linux/ipmi_msgdefs.h b/ndk/platforms/android-3/include/linux/ipmi_msgdefs.h
new file mode 100644
index 0000000..247d563
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/ipmi_msgdefs.h
@@ -0,0 +1,69 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __LINUX_IPMI_MSGDEFS_H
+#define __LINUX_IPMI_MSGDEFS_H
+
+#define IPMI_NETFN_SENSOR_EVENT_REQUEST 0x04
+#define IPMI_NETFN_SENSOR_EVENT_RESPONSE 0x05
+#define IPMI_GET_EVENT_RECEIVER_CMD 0x01
+
+#define IPMI_NETFN_APP_REQUEST 0x06
+#define IPMI_NETFN_APP_RESPONSE 0x07
+#define IPMI_GET_DEVICE_ID_CMD 0x01
+#define IPMI_CLEAR_MSG_FLAGS_CMD 0x30
+#define IPMI_GET_DEVICE_GUID_CMD 0x08
+#define IPMI_GET_MSG_FLAGS_CMD 0x31
+#define IPMI_SEND_MSG_CMD 0x34
+#define IPMI_GET_MSG_CMD 0x33
+#define IPMI_SET_BMC_GLOBAL_ENABLES_CMD 0x2e
+#define IPMI_GET_BMC_GLOBAL_ENABLES_CMD 0x2f
+#define IPMI_READ_EVENT_MSG_BUFFER_CMD 0x35
+#define IPMI_GET_CHANNEL_INFO_CMD 0x42
+
+#define IPMI_NETFN_STORAGE_REQUEST 0x0a
+#define IPMI_NETFN_STORAGE_RESPONSE 0x0b
+#define IPMI_ADD_SEL_ENTRY_CMD 0x44
+
+#define IPMI_BMC_SLAVE_ADDR 0x20
+
+#define IPMI_MAX_MSG_LENGTH 272  
+
+#define IPMI_CC_NO_ERROR 0x00
+#define IPMI_NODE_BUSY_ERR 0xc0
+#define IPMI_INVALID_COMMAND_ERR 0xc1
+#define IPMI_ERR_MSG_TRUNCATED 0xc6
+#define IPMI_LOST_ARBITRATION_ERR 0x81
+#define IPMI_ERR_UNSPECIFIED 0xff
+
+#define IPMI_CHANNEL_PROTOCOL_IPMB 1
+#define IPMI_CHANNEL_PROTOCOL_ICMB 2
+#define IPMI_CHANNEL_PROTOCOL_SMBUS 4
+#define IPMI_CHANNEL_PROTOCOL_KCS 5
+#define IPMI_CHANNEL_PROTOCOL_SMIC 6
+#define IPMI_CHANNEL_PROTOCOL_BT10 7
+#define IPMI_CHANNEL_PROTOCOL_BT15 8
+#define IPMI_CHANNEL_PROTOCOL_TMODE 9
+
+#define IPMI_CHANNEL_MEDIUM_IPMB 1
+#define IPMI_CHANNEL_MEDIUM_ICMB10 2
+#define IPMI_CHANNEL_MEDIUM_ICMB09 3
+#define IPMI_CHANNEL_MEDIUM_8023LAN 4
+#define IPMI_CHANNEL_MEDIUM_ASYNC 5
+#define IPMI_CHANNEL_MEDIUM_OTHER_LAN 6
+#define IPMI_CHANNEL_MEDIUM_PCI_SMBUS 7
+#define IPMI_CHANNEL_MEDIUM_SMBUS1 8
+#define IPMI_CHANNEL_MEDIUM_SMBUS2 9
+#define IPMI_CHANNEL_MEDIUM_USB1 10
+#define IPMI_CHANNEL_MEDIUM_USB2 11
+#define IPMI_CHANNEL_MEDIUM_SYSINTF 12
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/ipmi_smi.h b/ndk/platforms/android-3/include/linux/ipmi_smi.h
new file mode 100644
index 0000000..56cc210
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/ipmi_smi.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __LINUX_IPMI_SMI_H
+#define __LINUX_IPMI_SMI_H
+
+#include <linux/ipmi_msgdefs.h>
+#include <linux/proc_fs.h>
+#include <linux/module.h>
+#include <linux/device.h>
+#include <linux/platform_device.h>
+#include <linux/ipmi_smi.h>
+
+typedef struct ipmi_smi *ipmi_smi_t;
+
+struct ipmi_smi_msg
+{
+ struct list_head link;
+
+ long msgid;
+ void *user_data;
+
+ int data_size;
+ unsigned char data[IPMI_MAX_MSG_LENGTH];
+
+ int rsp_size;
+ unsigned char rsp[IPMI_MAX_MSG_LENGTH];
+
+ void (*done)(struct ipmi_smi_msg *msg);
+};
+
+struct ipmi_smi_handlers
+{
+ struct module *owner;
+
+ int (*start_processing)(void *send_info,
+ ipmi_smi_t new_intf);
+
+ void (*sender)(void *send_info,
+ struct ipmi_smi_msg *msg,
+ int priority);
+
+ void (*request_events)(void *send_info);
+
+ void (*set_run_to_completion)(void *send_info, int run_to_completion);
+
+ void (*poll)(void *send_info);
+
+ int (*inc_usecount)(void *send_info);
+ void (*dec_usecount)(void *send_info);
+};
+
+struct ipmi_device_id {
+ unsigned char device_id;
+ unsigned char device_revision;
+ unsigned char firmware_revision_1;
+ unsigned char firmware_revision_2;
+ unsigned char ipmi_version;
+ unsigned char additional_device_support;
+ unsigned int manufacturer_id;
+ unsigned int product_id;
+ unsigned char aux_firmware_revision[4];
+ unsigned int aux_firmware_revision_set : 1;
+};
+
+#define ipmi_version_major(v) ((v)->ipmi_version & 0xf)
+#define ipmi_version_minor(v) ((v)->ipmi_version >> 4)
+
+struct ipmi_smi_msg *ipmi_alloc_smi_msg(void);
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/ipx.h b/ndk/platforms/android-3/include/linux/ipx.h
new file mode 100644
index 0000000..ff675e9
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/ipx.h
@@ -0,0 +1,78 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _IPX_H_
+#define _IPX_H_
+#include <linux/sockios.h>
+#include <linux/socket.h>
+#define IPX_NODE_LEN 6
+#define IPX_MTU 576
+
+struct sockaddr_ipx {
+ sa_family_t sipx_family;
+ __u16 sipx_port;
+ __u32 sipx_network;
+ unsigned char sipx_node[IPX_NODE_LEN];
+ __u8 sipx_type;
+ unsigned char sipx_zero;
+};
+
+#define sipx_special sipx_port
+#define sipx_action sipx_zero
+#define IPX_DLTITF 0
+#define IPX_CRTITF 1
+
+struct ipx_route_definition {
+ __u32 ipx_network;
+ __u32 ipx_router_network;
+ unsigned char ipx_router_node[IPX_NODE_LEN];
+};
+
+struct ipx_interface_definition {
+ __u32 ipx_network;
+ unsigned char ipx_device[16];
+ unsigned char ipx_dlink_type;
+#define IPX_FRAME_NONE 0
+#define IPX_FRAME_SNAP 1
+#define IPX_FRAME_8022 2
+#define IPX_FRAME_ETHERII 3
+#define IPX_FRAME_8023 4
+#define IPX_FRAME_TR_8022 5  
+ unsigned char ipx_special;
+#define IPX_SPECIAL_NONE 0
+#define IPX_PRIMARY 1
+#define IPX_INTERNAL 2
+ unsigned char ipx_node[IPX_NODE_LEN];
+};
+
+struct ipx_config_data {
+ unsigned char ipxcfg_auto_select_primary;
+ unsigned char ipxcfg_auto_create_interfaces;
+};
+
+struct ipx_route_def {
+ __u32 ipx_network;
+ __u32 ipx_router_network;
+#define IPX_ROUTE_NO_ROUTER 0
+ unsigned char ipx_router_node[IPX_NODE_LEN];
+ unsigned char ipx_device[16];
+ unsigned short ipx_flags;
+#define IPX_RT_SNAP 8
+#define IPX_RT_8022 4
+#define IPX_RT_BLUEBOOK 2
+#define IPX_RT_ROUTED 1
+};
+
+#define SIOCAIPXITFCRT (SIOCPROTOPRIVATE)
+#define SIOCAIPXPRISLT (SIOCPROTOPRIVATE + 1)
+#define SIOCIPXCFGDATA (SIOCPROTOPRIVATE + 2)
+#define SIOCIPXNCPCONN (SIOCPROTOPRIVATE + 3)
+#endif
diff --git a/ndk/platforms/android-3/include/linux/irq.h b/ndk/platforms/android-3/include/linux/irq.h
new file mode 100644
index 0000000..38f5db7
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/irq.h
@@ -0,0 +1,100 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_IRQ_H
+#define _LINUX_IRQ_H
+
+#include <linux/smp.h>
+
+#include <linux/linkage.h>
+#include <linux/cache.h>
+#include <linux/spinlock.h>
+#include <linux/cpumask.h>
+#include <linux/irqreturn.h>
+
+#include <asm/irq.h>
+#include <asm/ptrace.h>
+
+#define IRQ_TYPE_NONE 0x00000000  
+#define IRQ_TYPE_EDGE_RISING 0x00000001  
+#define IRQ_TYPE_EDGE_FALLING 0x00000002  
+#define IRQ_TYPE_EDGE_BOTH (IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING)
+#define IRQ_TYPE_LEVEL_HIGH 0x00000004  
+#define IRQ_TYPE_LEVEL_LOW 0x00000008  
+#define IRQ_TYPE_SENSE_MASK 0x0000000f  
+#define IRQ_TYPE_PROBE 0x00000010  
+
+#define IRQ_INPROGRESS 0x00010000  
+#define IRQ_DISABLED 0x00020000  
+#define IRQ_PENDING 0x00040000  
+#define IRQ_REPLAY 0x00080000  
+#define IRQ_AUTODETECT 0x00100000  
+#define IRQ_WAITING 0x00200000  
+#define IRQ_LEVEL 0x00400000  
+#define IRQ_MASKED 0x00800000  
+#define IRQ_PER_CPU 0x01000000  
+#define CHECK_IRQ_PER_CPU(var) 0
+
+#define IRQ_NOPROBE 0x02000000  
+#define IRQ_NOREQUEST 0x04000000  
+#define IRQ_NOAUTOEN 0x08000000  
+#define IRQ_DELAYED_DISABLE 0x10000000  
+#define IRQ_WAKEUP 0x20000000  
+
+struct proc_dir_entry;
+
+struct irq_chip {
+ const char *name;
+ unsigned int (*startup)(unsigned int irq);
+ void (*shutdown)(unsigned int irq);
+ void (*enable)(unsigned int irq);
+ void (*disable)(unsigned int irq);
+
+ void (*ack)(unsigned int irq);
+ void (*mask)(unsigned int irq);
+ void (*mask_ack)(unsigned int irq);
+ void (*unmask)(unsigned int irq);
+ void (*eoi)(unsigned int irq);
+
+ void (*end)(unsigned int irq);
+ void (*set_affinity)(unsigned int irq, cpumask_t dest);
+ int (*retrigger)(unsigned int irq);
+ int (*set_type)(unsigned int irq, unsigned int flow_type);
+ int (*set_wake)(unsigned int irq, unsigned int on);
+
+ const char *typename;
+};
+
+struct irq_desc {
+ void fastcall (*handle_irq)(unsigned int irq,
+ struct irq_desc *desc,
+ struct pt_regs *regs);
+ struct irq_chip *chip;
+ void *handler_data;
+ void *chip_data;
+ struct irqaction *action;
+ unsigned int status;
+
+ unsigned int depth;
+ unsigned int wake_depth;
+ unsigned int irq_count;
+ unsigned int irqs_unhandled;
+ spinlock_t lock;
+} ____cacheline_aligned;
+
+#define hw_interrupt_type irq_chip
+typedef struct irq_chip hw_irq_controller;
+#define no_irq_type no_irq_chip
+typedef struct irq_desc irq_desc_t;
+
+#include <asm/hw_irq.h>
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/irq_cpustat.h b/ndk/platforms/android-3/include/linux/irq_cpustat.h
new file mode 100644
index 0000000..3540a4a
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/irq_cpustat.h
@@ -0,0 +1,24 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __irq_cpustat_h
+#define __irq_cpustat_h
+
+#ifndef __ARCH_IRQ_STAT
+
+#define __IRQ_STAT(cpu, member) (irq_stat[cpu].member)
+#endif
+
+#define local_softirq_pending()   __IRQ_STAT(smp_processor_id(), __softirq_pending)
+
+#define nmi_count(cpu) __IRQ_STAT((cpu), __nmi_count)  
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/irqflags.h b/ndk/platforms/android-3/include/linux/irqflags.h
new file mode 100644
index 0000000..1bf3f90
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/irqflags.h
@@ -0,0 +1,34 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_TRACE_IRQFLAGS_H
+#define _LINUX_TRACE_IRQFLAGS_H
+
+#define trace_hardirqs_on() do { } while (0)
+#define trace_hardirqs_off() do { } while (0)
+#define trace_softirqs_on(ip) do { } while (0)
+#define trace_softirqs_off(ip) do { } while (0)
+#define trace_hardirq_context(p) 0
+#define trace_softirq_context(p) 0
+#define trace_hardirqs_enabled(p) 0
+#define trace_softirqs_enabled(p) 0
+#define trace_hardirq_enter() do { } while (0)
+#define trace_hardirq_exit() do { } while (0)
+#define trace_softirq_enter() do { } while (0)
+#define trace_softirq_exit() do { } while (0)
+#define INIT_TRACE_IRQFLAGS
+
+#define raw_local_irq_disable() local_irq_disable()
+#define raw_local_irq_enable() local_irq_enable()
+#define raw_local_irq_save(flags) local_irq_save(flags)
+#define raw_local_irq_restore(flags) local_irq_restore(flags)
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/irqreturn.h b/ndk/platforms/android-3/include/linux/irqreturn.h
new file mode 100644
index 0000000..e37f430
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/irqreturn.h
@@ -0,0 +1,21 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_IRQRETURN_H
+#define _LINUX_IRQRETURN_H
+
+typedef int irqreturn_t;
+
+#define IRQ_NONE (0)
+#define IRQ_HANDLED (1)
+#define IRQ_RETVAL(x) ((x) != 0)
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/jbd.h b/ndk/platforms/android-3/include/linux/jbd.h
new file mode 100644
index 0000000..7ba766c
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/jbd.h
@@ -0,0 +1,118 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_JBD_H
+#define _LINUX_JBD_H
+
+#include "jfs_compat.h"
+#define JFS_DEBUG
+#define jfs_debug jbd_debug
+
+#define journal_oom_retry 1
+
+#undef JBD_PARANOID_IOFAIL
+
+#define JBD_DEFAULT_MAX_COMMIT_AGE 5
+
+#define jbd_debug(f, a...)  
+
+#define jbd_kmalloc(size, flags)   __jbd_kmalloc(__FUNCTION__, (size), (flags), journal_oom_retry)
+#define jbd_rep_kmalloc(size, flags)   __jbd_kmalloc(__FUNCTION__, (size), (flags), 1)
+
+#define JFS_MIN_JOURNAL_BLOCKS 1024
+
+#define JFS_MAGIC_NUMBER 0xc03b3998U  
+
+#define JFS_DESCRIPTOR_BLOCK 1
+#define JFS_COMMIT_BLOCK 2
+#define JFS_SUPERBLOCK_V1 3
+#define JFS_SUPERBLOCK_V2 4
+#define JFS_REVOKE_BLOCK 5
+
+typedef struct journal_header_s
+{
+ __be32 h_magic;
+ __be32 h_blocktype;
+ __be32 h_sequence;
+} journal_header_t;
+
+typedef struct journal_block_tag_s
+{
+ __be32 t_blocknr;
+ __be32 t_flags;
+} journal_block_tag_t;
+
+typedef struct journal_revoke_header_s
+{
+ journal_header_t r_header;
+ __be32 r_count;
+} journal_revoke_header_t;
+
+#define JFS_FLAG_ESCAPE 1  
+#define JFS_FLAG_SAME_UUID 2  
+#define JFS_FLAG_DELETED 4  
+#define JFS_FLAG_LAST_TAG 8  
+
+typedef struct journal_superblock_s
+{
+
+ journal_header_t s_header;
+
+ __be32 s_blocksize;
+ __be32 s_maxlen;
+ __be32 s_first;
+
+ __be32 s_sequence;
+ __be32 s_start;
+
+ __be32 s_errno;
+
+ __be32 s_feature_compat;
+ __be32 s_feature_incompat;
+ __be32 s_feature_ro_compat;
+
+ __u8 s_uuid[16];
+
+ __be32 s_nr_users;
+
+ __be32 s_dynsuper;
+
+ __be32 s_max_transaction;
+ __be32 s_max_trans_data;
+
+ __u32 s_padding[44];
+
+ __u8 s_users[16*48];
+
+} journal_superblock_t;
+
+#define JFS_HAS_COMPAT_FEATURE(j,mask)   ((j)->j_format_version >= 2 &&   ((j)->j_superblock->s_feature_compat & cpu_to_be32((mask))))
+#define JFS_HAS_RO_COMPAT_FEATURE(j,mask)   ((j)->j_format_version >= 2 &&   ((j)->j_superblock->s_feature_ro_compat & cpu_to_be32((mask))))
+#define JFS_HAS_INCOMPAT_FEATURE(j,mask)   ((j)->j_format_version >= 2 &&   ((j)->j_superblock->s_feature_incompat & cpu_to_be32((mask))))
+
+#define JFS_FEATURE_INCOMPAT_REVOKE 0x00000001
+
+#define JFS_KNOWN_COMPAT_FEATURES 0
+#define JFS_KNOWN_ROCOMPAT_FEATURES 0
+#define JFS_KNOWN_INCOMPAT_FEATURES JFS_FEATURE_INCOMPAT_REVOKE
+
+#define BJ_None 0  
+#define BJ_SyncData 1  
+#define BJ_Metadata 2  
+#define BJ_Forget 3  
+#define BJ_IO 4  
+#define BJ_Shadow 5  
+#define BJ_LogCtl 6  
+#define BJ_Reserved 7  
+#define BJ_Locked 8  
+#define BJ_Types 9
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/jiffies.h b/ndk/platforms/android-3/include/linux/jiffies.h
new file mode 100644
index 0000000..86b705b
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/jiffies.h
@@ -0,0 +1,115 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_JIFFIES_H
+#define _LINUX_JIFFIES_H
+
+#include <linux/calc64.h>
+#include <linux/kernel.h>
+#include <linux/types.h>
+#include <linux/time.h>
+#include <linux/timex.h>
+#include <asm/param.h>  
+
+#if HZ >= (12 && HZ < 24)
+#define SHIFT_HZ 4
+#elif HZ >= 24 && HZ < 48
+#define SHIFT_HZ 5
+#elif HZ >= 48 && HZ < 96
+#define SHIFT_HZ 6
+#elif HZ >= 96 && HZ < 192
+#define SHIFT_HZ 7
+#elif HZ >= 192 && HZ < 384
+#define SHIFT_HZ 8
+#elif HZ >= 384 && HZ < 768
+#define SHIFT_HZ 9
+#elif HZ >= 768 && HZ < 1536
+#define SHIFT_HZ 10
+#else
+#error You lose.
+#endif
+
+#define LATCH ((CLOCK_TICK_RATE + HZ/2) / HZ)  
+
+#define LATCH_HPET ((HPET_TICK_RATE + HZ/2) / HZ)
+
+#define SH_DIV(NOM,DEN,LSH) ( (((NOM) / (DEN)) << (LSH))   + ((((NOM) % (DEN)) << (LSH)) + (DEN) / 2) / (DEN))
+
+#define ACTHZ (SH_DIV (CLOCK_TICK_RATE, LATCH, 8))
+
+#define ACTHZ_HPET (SH_DIV (HPET_TICK_RATE, LATCH_HPET, 8))
+
+#define TICK_NSEC (SH_DIV (1000000UL * 1000, ACTHZ, 8))
+
+#define TICK_NSEC_HPET (SH_DIV(1000000UL * 1000, ACTHZ_HPET, 8))
+
+#define TICK_USEC ((1000000UL + USER_HZ/2) / USER_HZ)
+
+#define TICK_USEC_TO_NSEC(TUSEC) (SH_DIV (TUSEC * USER_HZ * 1000, ACTHZ, 8))
+
+#define __jiffy_data __attribute__((section(".data")))
+
+#if BITS_PER_LONG < 64
+
+#else
+#endif
+#define time_after(a,b)   (typecheck(unsigned long, a) &&   typecheck(unsigned long, b) &&   ((long)(b) - (long)(a) < 0))
+#define time_before(a,b) time_after(b,a)
+#define time_after_eq(a,b)   (typecheck(unsigned long, a) &&   typecheck(unsigned long, b) &&   ((long)(a) - (long)(b) >= 0))
+#define time_before_eq(a,b) time_after_eq(b,a)
+#define INITIAL_JIFFIES ((unsigned long)(unsigned int) (-300*HZ))
+#define MAX_JIFFY_OFFSET ((~0UL >> 1)-1)
+#define SEC_JIFFIE_SC (31 - SHIFT_HZ)
+#if !((NSEC_PER_SEC << 2) / TICK_NSEC << SEC_JIFFIE_SC - 2 & 0x80000000)
+#undef SEC_JIFFIE_SC
+#define SEC_JIFFIE_SC (32 - SHIFT_HZ)
+#endif
+#define NSEC_JIFFIE_SC (SEC_JIFFIE_SC + 29)
+#define USEC_JIFFIE_SC (SEC_JIFFIE_SC + 19)
+#define SEC_CONVERSION ((unsigned long)((((u64)NSEC_PER_SEC << SEC_JIFFIE_SC) +  TICK_NSEC -1) / (u64)TICK_NSEC))
+#define NSEC_CONVERSION ((unsigned long)((((u64)1 << NSEC_JIFFIE_SC) +  TICK_NSEC -1) / (u64)TICK_NSEC))
+#define USEC_CONVERSION   ((unsigned long)((((u64)NSEC_PER_USEC << USEC_JIFFIE_SC) +  TICK_NSEC -1) / (u64)TICK_NSEC))
+#define USEC_ROUND (u64)(((u64)1 << USEC_JIFFIE_SC) - 1)
+#if BITS_PER_LONG < 64
+#define MAX_SEC_IN_JIFFIES   (long)((u64)((u64)MAX_JIFFY_OFFSET * TICK_NSEC) / NSEC_PER_SEC)
+#else
+#define MAX_SEC_IN_JIFFIES   (SH_DIV((MAX_JIFFY_OFFSET >> SEC_JIFFIE_SC) * TICK_NSEC, NSEC_PER_SEC, 1) - 1)
+#endif
+#if HZ <= (MSEC_PER_SEC && !(MSEC_PER_SEC % HZ))
+#elif HZ > MSEC_PER_SEC && !(HZ % MSEC_PER_SEC)
+#else
+#endif
+#if HZ <= (USEC_PER_SEC && !(USEC_PER_SEC % HZ))
+#elif HZ > USEC_PER_SEC && !(HZ % USEC_PER_SEC)
+#else
+#endif
+#if HZ <= (MSEC_PER_SEC && !(MSEC_PER_SEC % HZ))
+#elif HZ > MSEC_PER_SEC && !(HZ % MSEC_PER_SEC)
+#else
+#endif
+#if HZ <= (USEC_PER_SEC && !(USEC_PER_SEC % HZ))
+#elif HZ > USEC_PER_SEC && !(HZ % USEC_PER_SEC)
+#else
+#endif
+#if TICK_NSEC % NSEC_PER_SEC / USER_HZ == 0
+#else
+#endif
+#if HZ % USER_HZ == 0
+#else
+#endif
+#if TICK_NSEC % NSEC_PER_SEC / USER_HZ == 0
+#else
+#endif
+#if NSEC_PER_SEC % USER_HZ == 0
+#elif (USER_HZ % 512) == 0
+#else
+#endif
+#endif
diff --git a/ndk/platforms/android-3/include/linux/kd.h b/ndk/platforms/android-3/include/linux/kd.h
new file mode 100644
index 0000000..1541ddf
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/kd.h
@@ -0,0 +1,176 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_KD_H
+#define _LINUX_KD_H
+#include <linux/types.h>
+#include <linux/compiler.h>
+
+#define GIO_FONT 0x4B60  
+#define PIO_FONT 0x4B61  
+
+#define GIO_FONTX 0x4B6B  
+#define PIO_FONTX 0x4B6C  
+struct consolefontdesc {
+ unsigned short charcount;
+ unsigned short charheight;
+ char __user *chardata;
+};
+
+#define PIO_FONTRESET 0x4B6D  
+
+#define GIO_CMAP 0x4B70  
+#define PIO_CMAP 0x4B71  
+
+#define KIOCSOUND 0x4B2F  
+#define KDMKTONE 0x4B30  
+
+#define KDGETLED 0x4B31  
+#define KDSETLED 0x4B32  
+#define LED_SCR 0x01  
+#define LED_NUM 0x02  
+#define LED_CAP 0x04  
+
+#define KDGKBTYPE 0x4B33  
+#define KB_84 0x01
+#define KB_101 0x02  
+#define KB_OTHER 0x03
+
+#define KDADDIO 0x4B34  
+#define KDDELIO 0x4B35  
+#define KDENABIO 0x4B36  
+#define KDDISABIO 0x4B37  
+
+#define KDSETMODE 0x4B3A  
+#define KD_TEXT 0x00
+#define KD_GRAPHICS 0x01
+#define KD_TEXT0 0x02  
+#define KD_TEXT1 0x03  
+#define KDGETMODE 0x4B3B  
+
+#define KDMAPDISP 0x4B3C  
+#define KDUNMAPDISP 0x4B3D  
+
+typedef char scrnmap_t;
+#define E_TABSZ 256
+#define GIO_SCRNMAP 0x4B40  
+#define PIO_SCRNMAP 0x4B41  
+#define GIO_UNISCRNMAP 0x4B69  
+#define PIO_UNISCRNMAP 0x4B6A  
+
+#define GIO_UNIMAP 0x4B66  
+struct unipair {
+ unsigned short unicode;
+ unsigned short fontpos;
+};
+struct unimapdesc {
+ unsigned short entry_ct;
+ struct unipair __user *entries;
+};
+#define PIO_UNIMAP 0x4B67  
+#define PIO_UNIMAPCLR 0x4B68  
+struct unimapinit {
+ unsigned short advised_hashsize;
+ unsigned short advised_hashstep;
+ unsigned short advised_hashlevel;
+};
+
+#define UNI_DIRECT_BASE 0xF000  
+#define UNI_DIRECT_MASK 0x01FF  
+
+#define K_RAW 0x00
+#define K_XLATE 0x01
+#define K_MEDIUMRAW 0x02
+#define K_UNICODE 0x03
+#define KDGKBMODE 0x4B44  
+#define KDSKBMODE 0x4B45  
+
+#define K_METABIT 0x03
+#define K_ESCPREFIX 0x04
+#define KDGKBMETA 0x4B62  
+#define KDSKBMETA 0x4B63  
+
+#define K_SCROLLLOCK 0x01
+#define K_NUMLOCK 0x02
+#define K_CAPSLOCK 0x04
+#define KDGKBLED 0x4B64  
+#define KDSKBLED 0x4B65  
+
+struct kbentry {
+ unsigned char kb_table;
+ unsigned char kb_index;
+ unsigned short kb_value;
+};
+#define K_NORMTAB 0x00
+#define K_SHIFTTAB 0x01
+#define K_ALTTAB 0x02
+#define K_ALTSHIFTTAB 0x03
+
+#define KDGKBENT 0x4B46  
+#define KDSKBENT 0x4B47  
+
+struct kbsentry {
+ unsigned char kb_func;
+ unsigned char kb_string[512];
+};
+#define KDGKBSENT 0x4B48  
+#define KDSKBSENT 0x4B49  
+
+struct kbdiacr {
+ unsigned char diacr, base, result;
+};
+struct kbdiacrs {
+ unsigned int kb_cnt;
+ struct kbdiacr kbdiacr[256];
+};
+#define KDGKBDIACR 0x4B4A  
+#define KDSKBDIACR 0x4B4B  
+
+struct kbkeycode {
+ unsigned int scancode, keycode;
+};
+#define KDGETKEYCODE 0x4B4C  
+#define KDSETKEYCODE 0x4B4D  
+
+#define KDSIGACCEPT 0x4B4E  
+
+struct kbd_repeat {
+ int delay;
+ int period;
+
+};
+
+#define KDKBDREP 0x4B52  
+
+#define KDFONTOP 0x4B72  
+
+struct console_font_op {
+ unsigned int op;
+ unsigned int flags;
+ unsigned int width, height;
+ unsigned int charcount;
+ unsigned char __user *data;
+};
+
+struct console_font {
+ unsigned int width, height;
+ unsigned int charcount;
+ unsigned char *data;
+};
+
+#define KD_FONT_OP_SET 0  
+#define KD_FONT_OP_GET 1  
+#define KD_FONT_OP_SET_DEFAULT 2  
+#define KD_FONT_OP_COPY 3  
+
+#define KD_FONT_FLAG_DONT_RECALC 1  
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/kdev_t.h b/ndk/platforms/android-3/include/linux/kdev_t.h
new file mode 100644
index 0000000..517f9c3
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/kdev_t.h
@@ -0,0 +1,18 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_KDEV_T_H
+#define _LINUX_KDEV_T_H
+
+#define MAJOR(dev) ((dev)>>8)
+#define MINOR(dev) ((dev) & 0xff)
+#define MKDEV(ma,mi) ((ma)<<8 | (mi))
+#endif
diff --git a/ndk/platforms/android-3/include/linux/kernel.h b/ndk/platforms/android-3/include/linux/kernel.h
new file mode 100644
index 0000000..9682e47
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/kernel.h
@@ -0,0 +1,39 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_KERNEL_H
+#define _LINUX_KERNEL_H
+
+#define SI_LOAD_SHIFT 16
+struct sysinfo {
+ long uptime;
+ unsigned long loads[3];
+ unsigned long totalram;
+ unsigned long freeram;
+ unsigned long sharedram;
+ unsigned long bufferram;
+ unsigned long totalswap;
+ unsigned long freeswap;
+ unsigned short procs;
+ unsigned short pad;
+ unsigned long totalhigh;
+ unsigned long freehigh;
+ unsigned int mem_unit;
+ char _f[20-2*sizeof(long)-sizeof(int)];
+};
+
+#define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
+
+#define BUILD_BUG_ON_ZERO(e) (sizeof(char[1 - 2 * !!(e)]) - 1)
+
+#define __FUNCTION__ (__func__)
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/kernel_stat.h b/ndk/platforms/android-3/include/linux/kernel_stat.h
new file mode 100644
index 0000000..f333736
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/kernel_stat.h
@@ -0,0 +1,42 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_KERNEL_STAT_H
+#define _LINUX_KERNEL_STAT_H
+
+#include <asm/irq.h>
+#include <linux/smp.h>
+#include <linux/threads.h>
+#include <linux/percpu.h>
+#include <linux/cpumask.h>
+#include <asm/cputime.h>
+
+struct cpu_usage_stat {
+ cputime64_t user;
+ cputime64_t nice;
+ cputime64_t system;
+ cputime64_t softirq;
+ cputime64_t irq;
+ cputime64_t idle;
+ cputime64_t iowait;
+ cputime64_t steal;
+};
+
+struct kernel_stat {
+ struct cpu_usage_stat cpustat;
+ unsigned int irqs[NR_IRQS];
+};
+
+#define kstat_cpu(cpu) per_cpu(kstat, cpu)
+
+#define kstat_this_cpu __get_cpu_var(kstat)
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/kernelcapi.h b/ndk/platforms/android-3/include/linux/kernelcapi.h
new file mode 100644
index 0000000..4638b0a
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/kernelcapi.h
@@ -0,0 +1,41 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __KERNELCAPI_H__
+#define __KERNELCAPI_H__
+
+#define CAPI_MAXAPPL 240  
+#define CAPI_MAXCONTR 32  
+#define CAPI_MAXDATAWINDOW 8
+
+typedef struct kcapi_flagdef {
+ int contr;
+ int flag;
+} kcapi_flagdef;
+
+typedef struct kcapi_carddef {
+ char driver[32];
+ unsigned int port;
+ unsigned irq;
+ unsigned int membase;
+ int cardnr;
+} kcapi_carddef;
+
+#define KCAPI_CMD_TRACE 10
+#define KCAPI_CMD_ADDCARD 11  
+
+#define KCAPI_TRACE_OFF 0
+#define KCAPI_TRACE_SHORT_NO_DATA 1
+#define KCAPI_TRACE_FULL_NO_DATA 2
+#define KCAPI_TRACE_SHORT 3
+#define KCAPI_TRACE_FULL 4
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/kexec.h b/ndk/platforms/android-3/include/linux/kexec.h
new file mode 100644
index 0000000..4004646
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/kexec.h
@@ -0,0 +1,17 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef LINUX_KEXEC_H
+#define LINUX_KEXEC_H
+
+struct pt_regs;
+struct task_struct;
+#endif
diff --git a/ndk/platforms/android-3/include/linux/key.h b/ndk/platforms/android-3/include/linux/key.h
new file mode 100644
index 0000000..5c485d7
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/key.h
@@ -0,0 +1,21 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_KEY_H
+#define _LINUX_KEY_H
+
+#include <linux/types.h>
+#include <linux/list.h>
+#include <linux/rbtree.h>
+#include <linux/rcupdate.h>
+#include <asm/atomic.h>
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/keyboard.h b/ndk/platforms/android-3/include/linux/keyboard.h
new file mode 100644
index 0000000..25e0945
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/keyboard.h
@@ -0,0 +1,446 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __LINUX_KEYBOARD_H
+#define __LINUX_KEYBOARD_H
+
+#include <linux/wait.h>
+
+#define KG_SHIFT 0
+#define KG_CTRL 2
+#define KG_ALT 3
+#define KG_ALTGR 1
+#define KG_SHIFTL 4
+#define KG_KANASHIFT 4
+#define KG_SHIFTR 5
+#define KG_CTRLL 6
+#define KG_CTRLR 7
+#define KG_CAPSSHIFT 8
+
+#define NR_SHIFT 9
+
+#define NR_KEYS 256
+#define MAX_NR_KEYMAPS 256
+
+#define MAX_NR_OF_USER_KEYMAPS 256  
+
+#define MAX_NR_FUNC 256  
+
+#define KT_LATIN 0  
+#define KT_LETTER 11  
+#define KT_FN 1
+#define KT_SPEC 2
+#define KT_PAD 3
+#define KT_DEAD 4
+#define KT_CONS 5
+#define KT_CUR 6
+#define KT_SHIFT 7
+#define KT_META 8
+#define KT_ASCII 9
+#define KT_LOCK 10
+#define KT_SLOCK 12
+#define KT_BRL 14
+
+#define K(t,v) (((t)<<8)|(v))
+#define KTYP(x) ((x) >> 8)
+#define KVAL(x) ((x) & 0xff)
+
+#define K_F1 K(KT_FN,0)
+#define K_F2 K(KT_FN,1)
+#define K_F3 K(KT_FN,2)
+#define K_F4 K(KT_FN,3)
+#define K_F5 K(KT_FN,4)
+#define K_F6 K(KT_FN,5)
+#define K_F7 K(KT_FN,6)
+#define K_F8 K(KT_FN,7)
+#define K_F9 K(KT_FN,8)
+#define K_F10 K(KT_FN,9)
+#define K_F11 K(KT_FN,10)
+#define K_F12 K(KT_FN,11)
+#define K_F13 K(KT_FN,12)
+#define K_F14 K(KT_FN,13)
+#define K_F15 K(KT_FN,14)
+#define K_F16 K(KT_FN,15)
+#define K_F17 K(KT_FN,16)
+#define K_F18 K(KT_FN,17)
+#define K_F19 K(KT_FN,18)
+#define K_F20 K(KT_FN,19)
+#define K_FIND K(KT_FN,20)
+#define K_INSERT K(KT_FN,21)
+#define K_REMOVE K(KT_FN,22)
+#define K_SELECT K(KT_FN,23)
+#define K_PGUP K(KT_FN,24)  
+#define K_PGDN K(KT_FN,25)  
+#define K_MACRO K(KT_FN,26)
+#define K_HELP K(KT_FN,27)
+#define K_DO K(KT_FN,28)
+#define K_PAUSE K(KT_FN,29)
+#define K_F21 K(KT_FN,30)
+#define K_F22 K(KT_FN,31)
+#define K_F23 K(KT_FN,32)
+#define K_F24 K(KT_FN,33)
+#define K_F25 K(KT_FN,34)
+#define K_F26 K(KT_FN,35)
+#define K_F27 K(KT_FN,36)
+#define K_F28 K(KT_FN,37)
+#define K_F29 K(KT_FN,38)
+#define K_F30 K(KT_FN,39)
+#define K_F31 K(KT_FN,40)
+#define K_F32 K(KT_FN,41)
+#define K_F33 K(KT_FN,42)
+#define K_F34 K(KT_FN,43)
+#define K_F35 K(KT_FN,44)
+#define K_F36 K(KT_FN,45)
+#define K_F37 K(KT_FN,46)
+#define K_F38 K(KT_FN,47)
+#define K_F39 K(KT_FN,48)
+#define K_F40 K(KT_FN,49)
+#define K_F41 K(KT_FN,50)
+#define K_F42 K(KT_FN,51)
+#define K_F43 K(KT_FN,52)
+#define K_F44 K(KT_FN,53)
+#define K_F45 K(KT_FN,54)
+#define K_F46 K(KT_FN,55)
+#define K_F47 K(KT_FN,56)
+#define K_F48 K(KT_FN,57)
+#define K_F49 K(KT_FN,58)
+#define K_F50 K(KT_FN,59)
+#define K_F51 K(KT_FN,60)
+#define K_F52 K(KT_FN,61)
+#define K_F53 K(KT_FN,62)
+#define K_F54 K(KT_FN,63)
+#define K_F55 K(KT_FN,64)
+#define K_F56 K(KT_FN,65)
+#define K_F57 K(KT_FN,66)
+#define K_F58 K(KT_FN,67)
+#define K_F59 K(KT_FN,68)
+#define K_F60 K(KT_FN,69)
+#define K_F61 K(KT_FN,70)
+#define K_F62 K(KT_FN,71)
+#define K_F63 K(KT_FN,72)
+#define K_F64 K(KT_FN,73)
+#define K_F65 K(KT_FN,74)
+#define K_F66 K(KT_FN,75)
+#define K_F67 K(KT_FN,76)
+#define K_F68 K(KT_FN,77)
+#define K_F69 K(KT_FN,78)
+#define K_F70 K(KT_FN,79)
+#define K_F71 K(KT_FN,80)
+#define K_F72 K(KT_FN,81)
+#define K_F73 K(KT_FN,82)
+#define K_F74 K(KT_FN,83)
+#define K_F75 K(KT_FN,84)
+#define K_F76 K(KT_FN,85)
+#define K_F77 K(KT_FN,86)
+#define K_F78 K(KT_FN,87)
+#define K_F79 K(KT_FN,88)
+#define K_F80 K(KT_FN,89)
+#define K_F81 K(KT_FN,90)
+#define K_F82 K(KT_FN,91)
+#define K_F83 K(KT_FN,92)
+#define K_F84 K(KT_FN,93)
+#define K_F85 K(KT_FN,94)
+#define K_F86 K(KT_FN,95)
+#define K_F87 K(KT_FN,96)
+#define K_F88 K(KT_FN,97)
+#define K_F89 K(KT_FN,98)
+#define K_F90 K(KT_FN,99)
+#define K_F91 K(KT_FN,100)
+#define K_F92 K(KT_FN,101)
+#define K_F93 K(KT_FN,102)
+#define K_F94 K(KT_FN,103)
+#define K_F95 K(KT_FN,104)
+#define K_F96 K(KT_FN,105)
+#define K_F97 K(KT_FN,106)
+#define K_F98 K(KT_FN,107)
+#define K_F99 K(KT_FN,108)
+#define K_F100 K(KT_FN,109)
+#define K_F101 K(KT_FN,110)
+#define K_F102 K(KT_FN,111)
+#define K_F103 K(KT_FN,112)
+#define K_F104 K(KT_FN,113)
+#define K_F105 K(KT_FN,114)
+#define K_F106 K(KT_FN,115)
+#define K_F107 K(KT_FN,116)
+#define K_F108 K(KT_FN,117)
+#define K_F109 K(KT_FN,118)
+#define K_F110 K(KT_FN,119)
+#define K_F111 K(KT_FN,120)
+#define K_F112 K(KT_FN,121)
+#define K_F113 K(KT_FN,122)
+#define K_F114 K(KT_FN,123)
+#define K_F115 K(KT_FN,124)
+#define K_F116 K(KT_FN,125)
+#define K_F117 K(KT_FN,126)
+#define K_F118 K(KT_FN,127)
+#define K_F119 K(KT_FN,128)
+#define K_F120 K(KT_FN,129)
+#define K_F121 K(KT_FN,130)
+#define K_F122 K(KT_FN,131)
+#define K_F123 K(KT_FN,132)
+#define K_F124 K(KT_FN,133)
+#define K_F125 K(KT_FN,134)
+#define K_F126 K(KT_FN,135)
+#define K_F127 K(KT_FN,136)
+#define K_F128 K(KT_FN,137)
+#define K_F129 K(KT_FN,138)
+#define K_F130 K(KT_FN,139)
+#define K_F131 K(KT_FN,140)
+#define K_F132 K(KT_FN,141)
+#define K_F133 K(KT_FN,142)
+#define K_F134 K(KT_FN,143)
+#define K_F135 K(KT_FN,144)
+#define K_F136 K(KT_FN,145)
+#define K_F137 K(KT_FN,146)
+#define K_F138 K(KT_FN,147)
+#define K_F139 K(KT_FN,148)
+#define K_F140 K(KT_FN,149)
+#define K_F141 K(KT_FN,150)
+#define K_F142 K(KT_FN,151)
+#define K_F143 K(KT_FN,152)
+#define K_F144 K(KT_FN,153)
+#define K_F145 K(KT_FN,154)
+#define K_F146 K(KT_FN,155)
+#define K_F147 K(KT_FN,156)
+#define K_F148 K(KT_FN,157)
+#define K_F149 K(KT_FN,158)
+#define K_F150 K(KT_FN,159)
+#define K_F151 K(KT_FN,160)
+#define K_F152 K(KT_FN,161)
+#define K_F153 K(KT_FN,162)
+#define K_F154 K(KT_FN,163)
+#define K_F155 K(KT_FN,164)
+#define K_F156 K(KT_FN,165)
+#define K_F157 K(KT_FN,166)
+#define K_F158 K(KT_FN,167)
+#define K_F159 K(KT_FN,168)
+#define K_F160 K(KT_FN,169)
+#define K_F161 K(KT_FN,170)
+#define K_F162 K(KT_FN,171)
+#define K_F163 K(KT_FN,172)
+#define K_F164 K(KT_FN,173)
+#define K_F165 K(KT_FN,174)
+#define K_F166 K(KT_FN,175)
+#define K_F167 K(KT_FN,176)
+#define K_F168 K(KT_FN,177)
+#define K_F169 K(KT_FN,178)
+#define K_F170 K(KT_FN,179)
+#define K_F171 K(KT_FN,180)
+#define K_F172 K(KT_FN,181)
+#define K_F173 K(KT_FN,182)
+#define K_F174 K(KT_FN,183)
+#define K_F175 K(KT_FN,184)
+#define K_F176 K(KT_FN,185)
+#define K_F177 K(KT_FN,186)
+#define K_F178 K(KT_FN,187)
+#define K_F179 K(KT_FN,188)
+#define K_F180 K(KT_FN,189)
+#define K_F181 K(KT_FN,190)
+#define K_F182 K(KT_FN,191)
+#define K_F183 K(KT_FN,192)
+#define K_F184 K(KT_FN,193)
+#define K_F185 K(KT_FN,194)
+#define K_F186 K(KT_FN,195)
+#define K_F187 K(KT_FN,196)
+#define K_F188 K(KT_FN,197)
+#define K_F189 K(KT_FN,198)
+#define K_F190 K(KT_FN,199)
+#define K_F191 K(KT_FN,200)
+#define K_F192 K(KT_FN,201)
+#define K_F193 K(KT_FN,202)
+#define K_F194 K(KT_FN,203)
+#define K_F195 K(KT_FN,204)
+#define K_F196 K(KT_FN,205)
+#define K_F197 K(KT_FN,206)
+#define K_F198 K(KT_FN,207)
+#define K_F199 K(KT_FN,208)
+#define K_F200 K(KT_FN,209)
+#define K_F201 K(KT_FN,210)
+#define K_F202 K(KT_FN,211)
+#define K_F203 K(KT_FN,212)
+#define K_F204 K(KT_FN,213)
+#define K_F205 K(KT_FN,214)
+#define K_F206 K(KT_FN,215)
+#define K_F207 K(KT_FN,216)
+#define K_F208 K(KT_FN,217)
+#define K_F209 K(KT_FN,218)
+#define K_F210 K(KT_FN,219)
+#define K_F211 K(KT_FN,220)
+#define K_F212 K(KT_FN,221)
+#define K_F213 K(KT_FN,222)
+#define K_F214 K(KT_FN,223)
+#define K_F215 K(KT_FN,224)
+#define K_F216 K(KT_FN,225)
+#define K_F217 K(KT_FN,226)
+#define K_F218 K(KT_FN,227)
+#define K_F219 K(KT_FN,228)
+#define K_F220 K(KT_FN,229)
+#define K_F221 K(KT_FN,230)
+#define K_F222 K(KT_FN,231)
+#define K_F223 K(KT_FN,232)
+#define K_F224 K(KT_FN,233)
+#define K_F225 K(KT_FN,234)
+#define K_F226 K(KT_FN,235)
+#define K_F227 K(KT_FN,236)
+#define K_F228 K(KT_FN,237)
+#define K_F229 K(KT_FN,238)
+#define K_F230 K(KT_FN,239)
+#define K_F231 K(KT_FN,240)
+#define K_F232 K(KT_FN,241)
+#define K_F233 K(KT_FN,242)
+#define K_F234 K(KT_FN,243)
+#define K_F235 K(KT_FN,244)
+#define K_F236 K(KT_FN,245)
+#define K_F237 K(KT_FN,246)
+#define K_F238 K(KT_FN,247)
+#define K_F239 K(KT_FN,248)
+#define K_F240 K(KT_FN,249)
+#define K_F241 K(KT_FN,250)
+#define K_F242 K(KT_FN,251)
+#define K_F243 K(KT_FN,252)
+#define K_F244 K(KT_FN,253)
+#define K_F245 K(KT_FN,254)
+#define K_UNDO K(KT_FN,255)
+
+#define K_HOLE K(KT_SPEC,0)
+#define K_ENTER K(KT_SPEC,1)
+#define K_SH_REGS K(KT_SPEC,2)
+#define K_SH_MEM K(KT_SPEC,3)
+#define K_SH_STAT K(KT_SPEC,4)
+#define K_BREAK K(KT_SPEC,5)
+#define K_CONS K(KT_SPEC,6)
+#define K_CAPS K(KT_SPEC,7)
+#define K_NUM K(KT_SPEC,8)
+#define K_HOLD K(KT_SPEC,9)
+#define K_SCROLLFORW K(KT_SPEC,10)
+#define K_SCROLLBACK K(KT_SPEC,11)
+#define K_BOOT K(KT_SPEC,12)
+#define K_CAPSON K(KT_SPEC,13)
+#define K_COMPOSE K(KT_SPEC,14)
+#define K_SAK K(KT_SPEC,15)
+#define K_DECRCONSOLE K(KT_SPEC,16)
+#define K_INCRCONSOLE K(KT_SPEC,17)
+#define K_SPAWNCONSOLE K(KT_SPEC,18)
+#define K_BARENUMLOCK K(KT_SPEC,19)
+
+#define K_ALLOCATED K(KT_SPEC,126)  
+#define K_NOSUCHMAP K(KT_SPEC,127)  
+
+#define K_P0 K(KT_PAD,0)
+#define K_P1 K(KT_PAD,1)
+#define K_P2 K(KT_PAD,2)
+#define K_P3 K(KT_PAD,3)
+#define K_P4 K(KT_PAD,4)
+#define K_P5 K(KT_PAD,5)
+#define K_P6 K(KT_PAD,6)
+#define K_P7 K(KT_PAD,7)
+#define K_P8 K(KT_PAD,8)
+#define K_P9 K(KT_PAD,9)
+#define K_PPLUS K(KT_PAD,10)  
+#define K_PMINUS K(KT_PAD,11)  
+#define K_PSTAR K(KT_PAD,12)  
+#define K_PSLASH K(KT_PAD,13)  
+#define K_PENTER K(KT_PAD,14)  
+#define K_PCOMMA K(KT_PAD,15)  
+#define K_PDOT K(KT_PAD,16)  
+#define K_PPLUSMINUS K(KT_PAD,17)  
+#define K_PPARENL K(KT_PAD,18)  
+#define K_PPARENR K(KT_PAD,19)  
+
+#define NR_PAD 20
+
+#define K_DGRAVE K(KT_DEAD,0)
+#define K_DACUTE K(KT_DEAD,1)
+#define K_DCIRCM K(KT_DEAD,2)
+#define K_DTILDE K(KT_DEAD,3)
+#define K_DDIERE K(KT_DEAD,4)
+#define K_DCEDIL K(KT_DEAD,5)
+
+#define NR_DEAD 6
+
+#define K_DOWN K(KT_CUR,0)
+#define K_LEFT K(KT_CUR,1)
+#define K_RIGHT K(KT_CUR,2)
+#define K_UP K(KT_CUR,3)
+
+#define K_SHIFT K(KT_SHIFT,KG_SHIFT)
+#define K_CTRL K(KT_SHIFT,KG_CTRL)
+#define K_ALT K(KT_SHIFT,KG_ALT)
+#define K_ALTGR K(KT_SHIFT,KG_ALTGR)
+#define K_SHIFTL K(KT_SHIFT,KG_SHIFTL)
+#define K_SHIFTR K(KT_SHIFT,KG_SHIFTR)
+#define K_CTRLL K(KT_SHIFT,KG_CTRLL)
+#define K_CTRLR K(KT_SHIFT,KG_CTRLR)
+#define K_CAPSSHIFT K(KT_SHIFT,KG_CAPSSHIFT)
+
+#define K_ASC0 K(KT_ASCII,0)
+#define K_ASC1 K(KT_ASCII,1)
+#define K_ASC2 K(KT_ASCII,2)
+#define K_ASC3 K(KT_ASCII,3)
+#define K_ASC4 K(KT_ASCII,4)
+#define K_ASC5 K(KT_ASCII,5)
+#define K_ASC6 K(KT_ASCII,6)
+#define K_ASC7 K(KT_ASCII,7)
+#define K_ASC8 K(KT_ASCII,8)
+#define K_ASC9 K(KT_ASCII,9)
+#define K_HEX0 K(KT_ASCII,10)
+#define K_HEX1 K(KT_ASCII,11)
+#define K_HEX2 K(KT_ASCII,12)
+#define K_HEX3 K(KT_ASCII,13)
+#define K_HEX4 K(KT_ASCII,14)
+#define K_HEX5 K(KT_ASCII,15)
+#define K_HEX6 K(KT_ASCII,16)
+#define K_HEX7 K(KT_ASCII,17)
+#define K_HEX8 K(KT_ASCII,18)
+#define K_HEX9 K(KT_ASCII,19)
+#define K_HEXa K(KT_ASCII,20)
+#define K_HEXb K(KT_ASCII,21)
+#define K_HEXc K(KT_ASCII,22)
+#define K_HEXd K(KT_ASCII,23)
+#define K_HEXe K(KT_ASCII,24)
+#define K_HEXf K(KT_ASCII,25)
+
+#define NR_ASCII 26
+
+#define K_SHIFTLOCK K(KT_LOCK,KG_SHIFT)
+#define K_CTRLLOCK K(KT_LOCK,KG_CTRL)
+#define K_ALTLOCK K(KT_LOCK,KG_ALT)
+#define K_ALTGRLOCK K(KT_LOCK,KG_ALTGR)
+#define K_SHIFTLLOCK K(KT_LOCK,KG_SHIFTL)
+#define K_SHIFTRLOCK K(KT_LOCK,KG_SHIFTR)
+#define K_CTRLLLOCK K(KT_LOCK,KG_CTRLL)
+#define K_CTRLRLOCK K(KT_LOCK,KG_CTRLR)
+
+#define K_SHIFT_SLOCK K(KT_SLOCK,KG_SHIFT)
+#define K_CTRL_SLOCK K(KT_SLOCK,KG_CTRL)
+#define K_ALT_SLOCK K(KT_SLOCK,KG_ALT)
+#define K_ALTGR_SLOCK K(KT_SLOCK,KG_ALTGR)
+#define K_SHIFTL_SLOCK K(KT_SLOCK,KG_SHIFTL)
+#define K_SHIFTR_SLOCK K(KT_SLOCK,KG_SHIFTR)
+#define K_CTRLL_SLOCK K(KT_SLOCK,KG_CTRLL)
+#define K_CTRLR_SLOCK K(KT_SLOCK,KG_CTRLR)
+
+#define NR_LOCK 8
+
+#define K_BRL_BLANK K(KT_BRL, 0)
+#define K_BRL_DOT1 K(KT_BRL, 1)
+#define K_BRL_DOT2 K(KT_BRL, 2)
+#define K_BRL_DOT3 K(KT_BRL, 3)
+#define K_BRL_DOT4 K(KT_BRL, 4)
+#define K_BRL_DOT5 K(KT_BRL, 5)
+#define K_BRL_DOT6 K(KT_BRL, 6)
+#define K_BRL_DOT7 K(KT_BRL, 7)
+#define K_BRL_DOT8 K(KT_BRL, 8)
+
+#define NR_BRL 9
+
+#define MAX_DIACR 256
+#endif
diff --git a/ndk/platforms/android-3/include/linux/keychord.h b/ndk/platforms/android-3/include/linux/keychord.h
new file mode 100644
index 0000000..9148431
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/keychord.h
@@ -0,0 +1,30 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __LINUX_KEYCHORD_H_
+#define __LINUX_KEYCHORD_H_
+
+#include <linux/input.h>
+
+#define KEYCHORD_VERSION 1
+
+struct input_keychord {
+
+ __u16 version;
+
+ __u16 id;
+
+ __u16 count;
+
+ __u16 keycodes[];
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/klist.h b/ndk/platforms/android-3/include/linux/klist.h
new file mode 100644
index 0000000..0df014f
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/klist.h
@@ -0,0 +1,41 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_KLIST_H
+#define _LINUX_KLIST_H
+
+#include <linux/spinlock.h>
+#include <linux/completion.h>
+#include <linux/kref.h>
+#include <linux/list.h>
+
+struct klist_node;
+struct klist {
+ spinlock_t k_lock;
+ struct list_head k_list;
+ void (*get)(struct klist_node *);
+ void (*put)(struct klist_node *);
+};
+
+struct klist_node {
+ struct klist * n_klist;
+ struct list_head n_node;
+ struct kref n_ref;
+ struct completion n_removed;
+};
+
+struct klist_iter {
+ struct klist * i_klist;
+ struct list_head * i_head;
+ struct klist_node * i_cur;
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/kmod.h b/ndk/platforms/android-3/include/linux/kmod.h
new file mode 100644
index 0000000..d24456d
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/kmod.h
@@ -0,0 +1,23 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __LINUX_KMOD_H__
+#define __LINUX_KMOD_H__
+
+#include <linux/stddef.h>
+#include <linux/errno.h>
+#include <linux/compiler.h>
+
+#define KMOD_PATH_LEN 256
+
+#define try_then_request_module(x, mod...) ((x) ?: (request_module(mod), (x)))
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/kobject.h b/ndk/platforms/android-3/include/linux/kobject.h
new file mode 100644
index 0000000..c61a950
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/kobject.h
@@ -0,0 +1,15 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _KOBJECT_H_
+#define _KOBJECT_H_
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/kref.h b/ndk/platforms/android-3/include/linux/kref.h
new file mode 100644
index 0000000..ee02b7f
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/kref.h
@@ -0,0 +1,15 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _KREF_H_
+#define _KREF_H_
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/ktime.h b/ndk/platforms/android-3/include/linux/ktime.h
new file mode 100644
index 0000000..34f8f0f
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/ktime.h
@@ -0,0 +1,52 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_KTIME_H
+#define _LINUX_KTIME_H
+
+#include <linux/time.h>
+#include <linux/jiffies.h>
+
+typedef union {
+ s64 tv64;
+#if BITS_PER_LONG != (64 && !defined(CONFIG_KTIME_SCALAR))
+ struct {
+#ifdef __BIG_ENDIAN
+ s32 sec, nsec;
+#else
+ s32 nsec, sec;
+#endif
+ } tv;
+#endif
+} ktime_t;
+
+#define KTIME_MAX ((s64)~((u64)1 << 63))
+#define KTIME_SEC_MAX (KTIME_MAX / NSEC_PER_SEC)
+
+#if BITS_PER_LONG == 64
+
+#if BITS_PER_LONG == 64
+#endif
+#define ktime_sub(lhs, rhs)   ({ (ktime_t){ .tv64 = (lhs).tv64 - (rhs).tv64 }; })
+#define ktime_add(lhs, rhs)   ({ (ktime_t){ .tv64 = (lhs).tv64 + (rhs).tv64 }; })
+#define ktime_add_ns(kt, nsval)   ({ (ktime_t){ .tv64 = (kt).tv64 + (nsval) }; })
+#define ktime_to_timespec(kt) ns_to_timespec((kt).tv64)
+#define ktime_to_timeval(kt) ns_to_timeval((kt).tv64)
+#define ktime_to_ns(kt) ((kt).tv64)
+#else
+
+#endif
+#define KTIME_REALTIME_RES (ktime_t){ .tv64 = TICK_NSEC }
+#define KTIME_MONOTONIC_RES (ktime_t){ .tv64 = TICK_NSEC }
+
+#define ktime_get_real_ts(ts) getnstimeofday(ts)
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/limits.h b/ndk/platforms/android-3/include/linux/limits.h
new file mode 100644
index 0000000..5565e30
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/limits.h
@@ -0,0 +1,33 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_LIMITS_H
+#define _LINUX_LIMITS_H
+
+#define NR_OPEN 1024
+
+#define NGROUPS_MAX 65536  
+#define ARG_MAX 131072  
+#define CHILD_MAX 999  
+#define OPEN_MAX 256  
+#define LINK_MAX 127  
+#define MAX_CANON 255  
+#define MAX_INPUT 255  
+#define NAME_MAX 255  
+#define PATH_MAX 4096  
+#define PIPE_BUF 4096  
+#define XATTR_NAME_MAX 255  
+#define XATTR_SIZE_MAX 65536  
+#define XATTR_LIST_MAX 65536  
+
+#define RTSIG_MAX 32
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/linkage.h b/ndk/platforms/android-3/include/linux/linkage.h
new file mode 100644
index 0000000..e0194bc
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/linkage.h
@@ -0,0 +1,66 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_LINKAGE_H
+#define _LINUX_LINKAGE_H
+
+#include <asm/linkage.h>
+
+#ifdef __cplusplus
+#define CPP_ASMLINKAGE extern "C"
+#else
+#define CPP_ASMLINKAGE
+#endif
+
+#ifndef asmlinkage
+#define asmlinkage CPP_ASMLINKAGE
+#endif
+
+#ifndef prevent_tail_call
+#define prevent_tail_call(ret) do { } while (0)
+#endif
+
+#ifndef __ALIGN
+#define __ALIGN .align 4,0x90
+#define __ALIGN_STR ".align 4,0x90"
+#endif
+
+#ifdef __ASSEMBLY__
+
+#define ALIGN __ALIGN
+#define ALIGN_STR __ALIGN_STR
+
+#ifndef ENTRY
+#define ENTRY(name)   .globl name;   ALIGN;   name:
+#endif
+
+#define KPROBE_ENTRY(name)   .section .kprobes.text, "ax";   ENTRY(name)
+
+#ifndef END
+#define END(name)   .size name, .-name
+#endif
+
+#ifndef ENDPROC
+#define ENDPROC(name)   .type name, @function;   END(name)
+#endif
+
+#endif
+
+#define NORET_TYPE  
+#define ATTRIB_NORET __attribute__((noreturn))
+#define NORET_AND noreturn,
+
+#ifndef FASTCALL
+#define FASTCALL(x) x
+#define fastcall
+#endif
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/list.h b/ndk/platforms/android-3/include/linux/list.h
new file mode 100644
index 0000000..d17871d
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/list.h
@@ -0,0 +1,16 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_LIST_H
+#define _LINUX_LIST_H
+
+#warning "don't include kernel headers in userspace"
+#endif
diff --git a/ndk/platforms/android-3/include/linux/lockd/nlm.h b/ndk/platforms/android-3/include/linux/lockd/nlm.h
new file mode 100644
index 0000000..d5d44fe
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/lockd/nlm.h
@@ -0,0 +1,50 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef LINUX_LOCKD_NLM_H
+#define LINUX_LOCKD_NLM_H
+
+#define NLM_OFFSET_MAX ((s32) 0x7fffffff)
+#define NLM4_OFFSET_MAX ((s64) ((~(u64)0) >> 1))
+
+enum {
+ NLM_LCK_GRANTED = 0,
+ NLM_LCK_DENIED = 1,
+ NLM_LCK_DENIED_NOLOCKS = 2,
+ NLM_LCK_BLOCKED = 3,
+ NLM_LCK_DENIED_GRACE_PERIOD = 4,
+};
+
+#define NLM_PROGRAM 100021
+
+#define NLMPROC_NULL 0
+#define NLMPROC_TEST 1
+#define NLMPROC_LOCK 2
+#define NLMPROC_CANCEL 3
+#define NLMPROC_UNLOCK 4
+#define NLMPROC_GRANTED 5
+#define NLMPROC_TEST_MSG 6
+#define NLMPROC_LOCK_MSG 7
+#define NLMPROC_CANCEL_MSG 8
+#define NLMPROC_UNLOCK_MSG 9
+#define NLMPROC_GRANTED_MSG 10
+#define NLMPROC_TEST_RES 11
+#define NLMPROC_LOCK_RES 12
+#define NLMPROC_CANCEL_RES 13
+#define NLMPROC_UNLOCK_RES 14
+#define NLMPROC_GRANTED_RES 15
+#define NLMPROC_NSM_NOTIFY 16  
+#define NLMPROC_SHARE 20
+#define NLMPROC_UNSHARE 21
+#define NLMPROC_NM_LOCK 22
+#define NLMPROC_FREE_ALL 23
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/lockd/xdr.h b/ndk/platforms/android-3/include/linux/lockd/xdr.h
new file mode 100644
index 0000000..75d0308
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/lockd/xdr.h
@@ -0,0 +1,73 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef LOCKD_XDR_H
+#define LOCKD_XDR_H
+
+#include <linux/fs.h>
+#include <linux/nfs.h>
+#include <linux/sunrpc/xdr.h>
+
+#define NLM_MAXCOOKIELEN 32
+#define NLM_MAXSTRLEN 1024
+
+#define nlm_granted __constant_htonl(NLM_LCK_GRANTED)
+#define nlm_lck_denied __constant_htonl(NLM_LCK_DENIED)
+#define nlm_lck_denied_nolocks __constant_htonl(NLM_LCK_DENIED_NOLOCKS)
+#define nlm_lck_blocked __constant_htonl(NLM_LCK_BLOCKED)
+#define nlm_lck_denied_grace_period __constant_htonl(NLM_LCK_DENIED_GRACE_PERIOD)
+
+struct nlm_lock {
+ char * caller;
+ int len;
+ struct nfs_fh fh;
+ struct xdr_netobj oh;
+ u32 svid;
+ struct file_lock fl;
+};
+
+struct nlm_cookie
+{
+ unsigned char data[NLM_MAXCOOKIELEN];
+ unsigned int len;
+};
+
+struct nlm_args {
+ struct nlm_cookie cookie;
+ struct nlm_lock lock;
+ u32 block;
+ u32 reclaim;
+ u32 state;
+ u32 monitor;
+ u32 fsm_access;
+ u32 fsm_mode;
+};
+
+typedef struct nlm_args nlm_args;
+
+struct nlm_res {
+ struct nlm_cookie cookie;
+ u32 status;
+ struct nlm_lock lock;
+};
+
+struct nlm_reboot {
+ char * mon;
+ int len;
+ u32 state;
+ u32 addr;
+ u32 vers;
+ u32 proto;
+};
+
+#define NLMSVC_XDRSIZE sizeof(struct nlm_args)
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/lockdep.h b/ndk/platforms/android-3/include/linux/lockdep.h
new file mode 100644
index 0000000..f5e8634
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/lockdep.h
@@ -0,0 +1,52 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __LINUX_LOCKDEP_H
+#define __LINUX_LOCKDEP_H
+
+#include <linux/linkage.h>
+#include <linux/list.h>
+#include <linux/debug_locks.h>
+#include <linux/stacktrace.h>
+
+#define lock_acquire(l, s, t, r, c, i) do { } while (0)
+#define lock_release(l, n, i) do { } while (0)
+#define lockdep_init() do { } while (0)
+#define lockdep_info() do { } while (0)
+#define lockdep_init_map(lock, name, key) do { (void)(key); } while (0)
+#define lockdep_set_class(lock, key) do { (void)(key); } while (0)
+#define lockdep_set_class_and_name(lock, key, name)   do { (void)(key); } while (0)
+#define INIT_LOCKDEP
+#define lockdep_reset() do { debug_locks = 1; } while (0)
+#define lockdep_free_key_range(start, size) do { } while (0)
+
+#define early_init_irq_lock_class() do { } while (0)
+
+#define early_boot_irqs_off() do { } while (0)
+#define early_boot_irqs_on() do { } while (0)
+
+#define SINGLE_DEPTH_NESTING 1
+
+#define spin_acquire(l, s, t, i) do { } while (0)
+#define spin_release(l, n, i) do { } while (0)
+
+#define rwlock_acquire(l, s, t, i) do { } while (0)
+#define rwlock_acquire_read(l, s, t, i) do { } while (0)
+#define rwlock_release(l, n, i) do { } while (0)
+
+#define mutex_acquire(l, s, t, i) do { } while (0)
+#define mutex_release(l, n, i) do { } while (0)
+
+#define rwsem_acquire(l, s, t, i) do { } while (0)
+#define rwsem_acquire_read(l, s, t, i) do { } while (0)
+#define rwsem_release(l, n, i) do { } while (0)
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/loop.h b/ndk/platforms/android-3/include/linux/loop.h
new file mode 100644
index 0000000..9cdfd38
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/loop.h
@@ -0,0 +1,77 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_LOOP_H
+#define _LINUX_LOOP_H
+
+#define LO_NAME_SIZE 64
+#define LO_KEY_SIZE 32
+
+enum {
+ LO_FLAGS_READ_ONLY = 1,
+ LO_FLAGS_USE_AOPS = 2,
+};
+
+#include <asm/posix_types.h>  
+#include <asm/types.h>  
+
+struct loop_info {
+ int lo_number;
+ __kernel_old_dev_t lo_device;
+ unsigned long lo_inode;
+ __kernel_old_dev_t lo_rdevice;
+ int lo_offset;
+ int lo_encrypt_type;
+ int lo_encrypt_key_size;
+ int lo_flags;
+ char lo_name[LO_NAME_SIZE];
+ unsigned char lo_encrypt_key[LO_KEY_SIZE];
+ unsigned long lo_init[2];
+ char reserved[4];
+};
+
+struct loop_info64 {
+ __u64 lo_device;
+ __u64 lo_inode;
+ __u64 lo_rdevice;
+ __u64 lo_offset;
+ __u64 lo_sizelimit;
+ __u32 lo_number;
+ __u32 lo_encrypt_type;
+ __u32 lo_encrypt_key_size;
+ __u32 lo_flags;
+ __u8 lo_file_name[LO_NAME_SIZE];
+ __u8 lo_crypt_name[LO_NAME_SIZE];
+ __u8 lo_encrypt_key[LO_KEY_SIZE];
+ __u64 lo_init[2];
+};
+
+#define LO_CRYPT_NONE 0
+#define LO_CRYPT_XOR 1
+#define LO_CRYPT_DES 2
+#define LO_CRYPT_FISH2 3  
+#define LO_CRYPT_BLOW 4
+#define LO_CRYPT_CAST128 5
+#define LO_CRYPT_IDEA 6
+#define LO_CRYPT_DUMMY 9
+#define LO_CRYPT_SKIPJACK 10
+#define LO_CRYPT_CRYPTOAPI 18
+#define MAX_LO_CRYPT 20
+
+#define LOOP_SET_FD 0x4C00
+#define LOOP_CLR_FD 0x4C01
+#define LOOP_SET_STATUS 0x4C02
+#define LOOP_GET_STATUS 0x4C03
+#define LOOP_SET_STATUS64 0x4C04
+#define LOOP_GET_STATUS64 0x4C05
+#define LOOP_CHANGE_FD 0x4C06
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/magic.h b/ndk/platforms/android-3/include/linux/magic.h
new file mode 100644
index 0000000..c94f9ce
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/magic.h
@@ -0,0 +1,55 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __LINUX_MAGIC_H__
+#define __LINUX_MAGIC_H__
+
+#define ADFS_SUPER_MAGIC 0xadf5
+#define AFFS_SUPER_MAGIC 0xadff
+#define AFS_SUPER_MAGIC 0x5346414F
+#define AUTOFS_SUPER_MAGIC 0x0187
+#define CODA_SUPER_MAGIC 0x73757245
+#define EFS_SUPER_MAGIC 0x414A53
+#define EXT2_SUPER_MAGIC 0xEF53
+#define EXT3_SUPER_MAGIC 0xEF53
+#define EXT4_SUPER_MAGIC 0xEF53
+#define HPFS_SUPER_MAGIC 0xf995e849
+#define ISOFS_SUPER_MAGIC 0x9660
+#define JFFS2_SUPER_MAGIC 0x72b6
+#define ANON_INODE_FS_MAGIC 0x09041934
+
+#define MINIX_SUPER_MAGIC 0x137F  
+#define MINIX_SUPER_MAGIC2 0x138F  
+#define MINIX2_SUPER_MAGIC 0x2468  
+#define MINIX2_SUPER_MAGIC2 0x2478  
+#define MINIX3_SUPER_MAGIC 0x4d5a  
+
+#define MSDOS_SUPER_MAGIC 0x4d44  
+#define NCP_SUPER_MAGIC 0x564c  
+#define NFS_SUPER_MAGIC 0x6969
+#define OPENPROM_SUPER_MAGIC 0x9fa1
+#define PROC_SUPER_MAGIC 0x9fa0
+#define QNX4_SUPER_MAGIC 0x002f  
+
+#define REISERFS_SUPER_MAGIC 0x52654973  
+
+#define REISERFS_SUPER_MAGIC_STRING "ReIsErFs"
+#define REISER2FS_SUPER_MAGIC_STRING "ReIsEr2Fs"
+#define REISER2FS_JR_SUPER_MAGIC_STRING "ReIsEr3Fs"
+
+#define SMB_SUPER_MAGIC 0x517B
+#define USBDEVICE_SUPER_MAGIC 0x9fa2
+#define CGROUP_SUPER_MAGIC 0x27e0eb
+
+#define FUTEXFS_SUPER_MAGIC 0xBAD1DEA
+#define INOTIFYFS_SUPER_MAGIC 0x2BAD1DEA
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/major.h b/ndk/platforms/android-3/include/linux/major.h
new file mode 100644
index 0000000..e42d698
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/major.h
@@ -0,0 +1,175 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_MAJOR_H
+#define _LINUX_MAJOR_H
+
+#define UNNAMED_MAJOR 0
+#define MEM_MAJOR 1
+#define RAMDISK_MAJOR 1
+#define FLOPPY_MAJOR 2
+#define PTY_MASTER_MAJOR 2
+#define IDE0_MAJOR 3
+#define HD_MAJOR IDE0_MAJOR
+#define PTY_SLAVE_MAJOR 3
+#define TTY_MAJOR 4
+#define TTYAUX_MAJOR 5
+#define LP_MAJOR 6
+#define VCS_MAJOR 7
+#define LOOP_MAJOR 7
+#define SCSI_DISK0_MAJOR 8
+#define SCSI_TAPE_MAJOR 9
+#define MD_MAJOR 9
+#define MISC_MAJOR 10
+#define SCSI_CDROM_MAJOR 11
+#define MUX_MAJOR 11  
+#define XT_DISK_MAJOR 13
+#define INPUT_MAJOR 13
+#define SOUND_MAJOR 14
+#define CDU31A_CDROM_MAJOR 15
+#define JOYSTICK_MAJOR 15
+#define GOLDSTAR_CDROM_MAJOR 16
+#define OPTICS_CDROM_MAJOR 17
+#define SANYO_CDROM_MAJOR 18
+#define CYCLADES_MAJOR 19
+#define CYCLADESAUX_MAJOR 20
+#define MITSUMI_X_CDROM_MAJOR 20
+#define MFM_ACORN_MAJOR 21  
+#define SCSI_GENERIC_MAJOR 21
+#define IDE1_MAJOR 22
+#define DIGICU_MAJOR 22
+#define DIGI_MAJOR 23
+#define MITSUMI_CDROM_MAJOR 23
+#define CDU535_CDROM_MAJOR 24
+#define STL_SERIALMAJOR 24
+#define MATSUSHITA_CDROM_MAJOR 25
+#define STL_CALLOUTMAJOR 25
+#define MATSUSHITA_CDROM2_MAJOR 26
+#define QIC117_TAPE_MAJOR 27
+#define MATSUSHITA_CDROM3_MAJOR 27
+#define MATSUSHITA_CDROM4_MAJOR 28
+#define STL_SIOMEMMAJOR 28
+#define ACSI_MAJOR 28
+#define AZTECH_CDROM_MAJOR 29
+#define GRAPHDEV_MAJOR 29  
+#define CM206_CDROM_MAJOR 32
+#define IDE2_MAJOR 33
+#define IDE3_MAJOR 34
+#define Z8530_MAJOR 34
+#define XPRAM_MAJOR 35  
+#define NETLINK_MAJOR 36
+#define PS2ESDI_MAJOR 36
+#define IDETAPE_MAJOR 37
+#define Z2RAM_MAJOR 37
+#define APBLOCK_MAJOR 38  
+#define DDV_MAJOR 39  
+#define NBD_MAJOR 43  
+#define RISCOM8_NORMAL_MAJOR 48
+#define DAC960_MAJOR 48  
+#define RISCOM8_CALLOUT_MAJOR 49
+#define MKISS_MAJOR 55
+#define DSP56K_MAJOR 55  
+
+#define IDE4_MAJOR 56
+#define IDE5_MAJOR 57
+
+#define SCSI_DISK1_MAJOR 65
+#define SCSI_DISK2_MAJOR 66
+#define SCSI_DISK3_MAJOR 67
+#define SCSI_DISK4_MAJOR 68
+#define SCSI_DISK5_MAJOR 69
+#define SCSI_DISK6_MAJOR 70
+#define SCSI_DISK7_MAJOR 71
+
+#define COMPAQ_SMART2_MAJOR 72
+#define COMPAQ_SMART2_MAJOR1 73
+#define COMPAQ_SMART2_MAJOR2 74
+#define COMPAQ_SMART2_MAJOR3 75
+#define COMPAQ_SMART2_MAJOR4 76
+#define COMPAQ_SMART2_MAJOR5 77
+#define COMPAQ_SMART2_MAJOR6 78
+#define COMPAQ_SMART2_MAJOR7 79
+
+#define SPECIALIX_NORMAL_MAJOR 75
+#define SPECIALIX_CALLOUT_MAJOR 76
+
+#define AURORA_MAJOR 79
+
+#define I2O_MAJOR 80  
+
+#define SHMIQ_MAJOR 85  
+#define SCSI_CHANGER_MAJOR 86
+
+#define IDE6_MAJOR 88
+#define IDE7_MAJOR 89
+#define IDE8_MAJOR 90
+#define IDE9_MAJOR 91
+
+#define DASD_MAJOR 94
+
+#define MDISK_MAJOR 95
+
+#define UBD_MAJOR 98
+
+#define PP_MAJOR 99
+#define JSFD_MAJOR 99
+
+#define PHONE_MAJOR 100
+
+#define COMPAQ_CISS_MAJOR 104
+#define COMPAQ_CISS_MAJOR1 105
+#define COMPAQ_CISS_MAJOR2 106
+#define COMPAQ_CISS_MAJOR3 107
+#define COMPAQ_CISS_MAJOR4 108
+#define COMPAQ_CISS_MAJOR5 109
+#define COMPAQ_CISS_MAJOR6 110
+#define COMPAQ_CISS_MAJOR7 111
+
+#define VIODASD_MAJOR 112
+#define VIOCD_MAJOR 113
+
+#define ATARAID_MAJOR 114
+
+#define SCSI_DISK8_MAJOR 128
+#define SCSI_DISK9_MAJOR 129
+#define SCSI_DISK10_MAJOR 130
+#define SCSI_DISK11_MAJOR 131
+#define SCSI_DISK12_MAJOR 132
+#define SCSI_DISK13_MAJOR 133
+#define SCSI_DISK14_MAJOR 134
+#define SCSI_DISK15_MAJOR 135
+
+#define UNIX98_PTY_MASTER_MAJOR 128
+#define UNIX98_PTY_MAJOR_COUNT 8
+#define UNIX98_PTY_SLAVE_MAJOR (UNIX98_PTY_MASTER_MAJOR+UNIX98_PTY_MAJOR_COUNT)
+
+#define RTF_MAJOR 150
+#define RAW_MAJOR 162
+
+#define USB_ACM_MAJOR 166
+#define USB_ACM_AUX_MAJOR 167
+#define USB_CHAR_MAJOR 180
+
+#define VXVM_MAJOR 199  
+#define VXSPEC_MAJOR 200  
+#define VXDMP_MAJOR 201  
+
+#define MSR_MAJOR 202
+#define CPUID_MAJOR 203
+
+#define OSST_MAJOR 206  
+
+#define IBM_TTY3270_MAJOR 227
+#define IBM_FS3270_MAJOR 228
+
+#define VIOTAPE_MAJOR 230
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/mc146818rtc.h b/ndk/platforms/android-3/include/linux/mc146818rtc.h
new file mode 100644
index 0000000..74436ea
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/mc146818rtc.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _MC146818RTC_H
+#define _MC146818RTC_H
+
+#include <asm/io.h>
+#include <linux/rtc.h>  
+#include <asm/mc146818rtc.h>  
+
+#define RTC_SECONDS 0
+#define RTC_SECONDS_ALARM 1
+#define RTC_MINUTES 2
+#define RTC_MINUTES_ALARM 3
+#define RTC_HOURS 4
+#define RTC_HOURS_ALARM 5
+
+#define RTC_ALARM_DONT_CARE 0xC0
+
+#define RTC_DAY_OF_WEEK 6
+#define RTC_DAY_OF_MONTH 7
+#define RTC_MONTH 8
+#define RTC_YEAR 9
+
+#define RTC_REG_A 10
+#define RTC_REG_B 11
+#define RTC_REG_C 12
+#define RTC_REG_D 13
+
+#define RTC_FREQ_SELECT RTC_REG_A
+
+#define RTC_UIP 0x80
+#define RTC_DIV_CTL 0x70
+
+#define RTC_REF_CLCK_4MHZ 0x00
+#define RTC_REF_CLCK_1MHZ 0x10
+#define RTC_REF_CLCK_32KHZ 0x20
+
+#define RTC_DIV_RESET1 0x60
+#define RTC_DIV_RESET2 0x70
+
+#define RTC_RATE_SELECT 0x0F
+
+#define RTC_CONTROL RTC_REG_B
+#define RTC_SET 0x80  
+#define RTC_PIE 0x40  
+#define RTC_AIE 0x20  
+#define RTC_UIE 0x10  
+#define RTC_SQWE 0x08  
+#define RTC_DM_BINARY 0x04  
+#define RTC_24H 0x02  
+#define RTC_DST_EN 0x01  
+
+#define RTC_INTR_FLAGS RTC_REG_C
+
+#define RTC_IRQF 0x80  
+#define RTC_PF 0x40
+#define RTC_AF 0x20
+#define RTC_UF 0x10
+
+#define RTC_VALID RTC_REG_D
+#define RTC_VRT 0x80  
+
+#ifndef ARCH_RTC_LOCATION
+
+#define RTC_IO_EXTENT 0x8
+#define RTC_IOMAPPED 1  
+
+#endif
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/mca.h b/ndk/platforms/android-3/include/linux/mca.h
new file mode 100644
index 0000000..dfbfc2a
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/mca.h
@@ -0,0 +1,74 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_MCA_H
+#define _LINUX_MCA_H
+
+#include <linux/device.h>
+
+#define MCA_bus 0
+
+typedef int (*MCA_ProcFn)(char* buf, int slot, void* dev);
+
+enum MCA_AdapterStatus {
+ MCA_ADAPTER_NORMAL = 0,
+ MCA_ADAPTER_NONE = 1,
+ MCA_ADAPTER_DISABLED = 2,
+ MCA_ADAPTER_ERROR = 3
+};
+
+struct mca_device {
+ u64 dma_mask;
+ int pos_id;
+ int slot;
+
+ int index;
+
+ int driver_loaded;
+
+ unsigned char pos[8];
+
+ short pos_register;
+
+ enum MCA_AdapterStatus status;
+ struct device dev;
+ char name[32];
+};
+#define to_mca_device(mdev) container_of(mdev, struct mca_device, dev)
+
+struct mca_bus_accessor_functions {
+ unsigned char (*mca_read_pos)(struct mca_device *, int reg);
+ void (*mca_write_pos)(struct mca_device *, int reg,
+ unsigned char byte);
+ int (*mca_transform_irq)(struct mca_device *, int irq);
+ int (*mca_transform_ioport)(struct mca_device *,
+ int region);
+ void * (*mca_transform_memory)(struct mca_device *,
+ void *memory);
+};
+
+struct mca_bus {
+ u64 default_dma_mask;
+ int number;
+ struct mca_bus_accessor_functions f;
+ struct device dev;
+ char name[32];
+};
+#define to_mca_bus(mdev) container_of(mdev, struct mca_bus, dev)
+
+struct mca_driver {
+ const short *id_table;
+ void *driver_data;
+ struct device_driver driver;
+};
+#define to_mca_driver(mdriver) container_of(mdriver, struct mca_driver, driver)
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/mempolicy.h b/ndk/platforms/android-3/include/linux/mempolicy.h
new file mode 100644
index 0000000..6b7b2d4
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/mempolicy.h
@@ -0,0 +1,32 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_MEMPOLICY_H
+#define _LINUX_MEMPOLICY_H 1
+
+#include <linux/errno.h>
+
+#define MPOL_DEFAULT 0
+#define MPOL_PREFERRED 1
+#define MPOL_BIND 2
+#define MPOL_INTERLEAVE 3
+
+#define MPOL_MAX MPOL_INTERLEAVE
+
+#define MPOL_F_NODE (1<<0)  
+#define MPOL_F_ADDR (1<<1)  
+
+#define MPOL_MF_STRICT (1<<0)  
+#define MPOL_MF_MOVE (1<<1)  
+#define MPOL_MF_MOVE_ALL (1<<2)  
+#define MPOL_MF_INTERNAL (1<<3)  
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/mempool.h b/ndk/platforms/android-3/include/linux/mempool.h
new file mode 100644
index 0000000..fa2432b
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/mempool.h
@@ -0,0 +1,34 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_MEMPOOL_H
+#define _LINUX_MEMPOOL_H
+
+#include <linux/wait.h>
+
+struct kmem_cache;
+
+typedef void * (mempool_alloc_t)(gfp_t gfp_mask, void *pool_data);
+typedef void (mempool_free_t)(void *element, void *pool_data);
+
+typedef struct mempool_s {
+ spinlock_t lock;
+ int min_nr;
+ int curr_nr;
+ void **elements;
+
+ void *pool_data;
+ mempool_alloc_t *alloc;
+ mempool_free_t *free;
+ wait_queue_head_t wait;
+} mempool_t;
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/miscdevice.h b/ndk/platforms/android-3/include/linux/miscdevice.h
new file mode 100644
index 0000000..457960a
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/miscdevice.h
@@ -0,0 +1,57 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_MISCDEVICE_H
+#define _LINUX_MISCDEVICE_H
+#include <linux/module.h>
+#include <linux/major.h>
+
+#define PSMOUSE_MINOR 1
+#define MS_BUSMOUSE_MINOR 2
+#define ATIXL_BUSMOUSE_MINOR 3
+
+#define ATARIMOUSE_MINOR 5
+#define SUN_MOUSE_MINOR 6
+#define APOLLO_MOUSE_MINOR 7
+#define PC110PAD_MINOR 9
+
+#define WATCHDOG_MINOR 130  
+#define TEMP_MINOR 131  
+#define RTC_MINOR 135
+#define EFI_RTC_MINOR 136  
+#define SUN_OPENPROM_MINOR 139
+#define DMAPI_MINOR 140  
+#define NVRAM_MINOR 144
+#define SGI_MMTIMER 153
+#define STORE_QUEUE_MINOR 155
+#define I2O_MINOR 166
+#define MICROCODE_MINOR 184
+#define MWAVE_MINOR 219  
+#define MPT_MINOR 220
+#define MISC_DYNAMIC_MINOR 255
+
+#define TUN_MINOR 200
+#define HPET_MINOR 228
+
+struct device;
+struct class_device;
+
+struct miscdevice {
+ int minor;
+ const char *name;
+ const struct file_operations *fops;
+ struct list_head list;
+ struct device *dev;
+ struct class_device *class;
+};
+
+#define MODULE_ALIAS_MISCDEV(minor)   MODULE_ALIAS("char-major-" __stringify(MISC_MAJOR)   "-" __stringify(minor))
+#endif
diff --git a/ndk/platforms/android-3/include/linux/mm.h b/ndk/platforms/android-3/include/linux/mm.h
new file mode 100644
index 0000000..fea293b
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/mm.h
@@ -0,0 +1,19 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_MM_H
+#define _LINUX_MM_H
+
+#include <linux/sched.h>
+#include <linux/errno.h>
+#include <linux/capability.h>
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/mmc/card.h b/ndk/platforms/android-3/include/linux/mmc/card.h
new file mode 100644
index 0000000..94afe21
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/mmc/card.h
@@ -0,0 +1,100 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef LINUX_MMC_CARD_H
+#define LINUX_MMC_CARD_H
+
+#include <linux/mmc/mmc.h>
+
+struct mmc_cid {
+ unsigned int manfid;
+ char prod_name[8];
+ unsigned int serial;
+ unsigned short oemid;
+ unsigned short year;
+ unsigned char hwrev;
+ unsigned char fwrev;
+ unsigned char month;
+};
+
+struct mmc_csd {
+ unsigned char mmca_vsn;
+ unsigned short cmdclass;
+ unsigned short tacc_clks;
+ unsigned int tacc_ns;
+ unsigned int r2w_factor;
+ unsigned int max_dtr;
+ unsigned int read_blkbits;
+ unsigned int write_blkbits;
+ unsigned int capacity;
+ unsigned int read_partial:1,
+ read_misalign:1,
+ write_partial:1,
+ write_misalign:1;
+};
+
+struct sd_scr {
+ unsigned char sda_vsn;
+ unsigned char bus_widths;
+#define SD_SCR_BUS_WIDTH_1 (1<<0)
+#define SD_SCR_BUS_WIDTH_4 (1<<2)
+};
+
+struct mmc_host;
+
+struct mmc_card {
+ struct list_head node;
+ struct mmc_host *host;
+ struct device dev;
+ unsigned int rca;
+ unsigned int state;
+#define MMC_STATE_PRESENT (1<<0)  
+#define MMC_STATE_DEAD (1<<1)  
+#define MMC_STATE_BAD (1<<2)  
+#define MMC_STATE_SDCARD (1<<3)  
+#define MMC_STATE_READONLY (1<<4)  
+ u32 raw_cid[4];
+ u32 raw_csd[4];
+ u32 raw_scr[2];
+ struct mmc_cid cid;
+ struct mmc_csd csd;
+ struct sd_scr scr;
+};
+
+#define mmc_card_present(c) ((c)->state & MMC_STATE_PRESENT)
+#define mmc_card_dead(c) ((c)->state & MMC_STATE_DEAD)
+#define mmc_card_bad(c) ((c)->state & MMC_STATE_BAD)
+#define mmc_card_sd(c) ((c)->state & MMC_STATE_SDCARD)
+#define mmc_card_readonly(c) ((c)->state & MMC_STATE_READONLY)
+
+#define mmc_card_set_present(c) ((c)->state |= MMC_STATE_PRESENT)
+#define mmc_card_set_dead(c) ((c)->state |= MMC_STATE_DEAD)
+#define mmc_card_set_bad(c) ((c)->state |= MMC_STATE_BAD)
+#define mmc_card_set_sd(c) ((c)->state |= MMC_STATE_SDCARD)
+#define mmc_card_set_readonly(c) ((c)->state |= MMC_STATE_READONLY)
+
+#define mmc_card_name(c) ((c)->cid.prod_name)
+#define mmc_card_id(c) ((c)->dev.bus_id)
+
+#define mmc_list_to_card(l) container_of(l, struct mmc_card, node)
+#define mmc_get_drvdata(c) dev_get_drvdata(&(c)->dev)
+#define mmc_set_drvdata(c,d) dev_set_drvdata(&(c)->dev, d)
+
+struct mmc_driver {
+ struct device_driver drv;
+ int (*probe)(struct mmc_card *);
+ void (*remove)(struct mmc_card *);
+ int (*suspend)(struct mmc_card *, pm_message_t);
+ int (*resume)(struct mmc_card *);
+};
+
+#define mmc_card_release_host(c) mmc_release_host((c)->host)
+#endif
diff --git a/ndk/platforms/android-3/include/linux/mmc/host.h b/ndk/platforms/android-3/include/linux/mmc/host.h
new file mode 100644
index 0000000..9433626
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/mmc/host.h
@@ -0,0 +1,120 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef LINUX_MMC_HOST_H
+#define LINUX_MMC_HOST_H
+
+#include <linux/mmc/mmc.h>
+
+struct mmc_ios {
+ unsigned int clock;
+ unsigned short vdd;
+
+#define MMC_VDD_150 0
+#define MMC_VDD_155 1
+#define MMC_VDD_160 2
+#define MMC_VDD_165 3
+#define MMC_VDD_170 4
+#define MMC_VDD_180 5
+#define MMC_VDD_190 6
+#define MMC_VDD_200 7
+#define MMC_VDD_210 8
+#define MMC_VDD_220 9
+#define MMC_VDD_230 10
+#define MMC_VDD_240 11
+#define MMC_VDD_250 12
+#define MMC_VDD_260 13
+#define MMC_VDD_270 14
+#define MMC_VDD_280 15
+#define MMC_VDD_290 16
+#define MMC_VDD_300 17
+#define MMC_VDD_310 18
+#define MMC_VDD_320 19
+#define MMC_VDD_330 20
+#define MMC_VDD_340 21
+#define MMC_VDD_350 22
+#define MMC_VDD_360 23
+
+ unsigned char bus_mode;
+
+#define MMC_BUSMODE_OPENDRAIN 1
+#define MMC_BUSMODE_PUSHPULL 2
+
+ unsigned char chip_select;
+
+#define MMC_CS_DONTCARE 0
+#define MMC_CS_HIGH 1
+#define MMC_CS_LOW 2
+
+ unsigned char power_mode;
+
+#define MMC_POWER_OFF 0
+#define MMC_POWER_UP 1
+#define MMC_POWER_ON 2
+
+ unsigned char bus_width;
+
+#define MMC_BUS_WIDTH_1 0
+#define MMC_BUS_WIDTH_4 2
+};
+
+struct mmc_host_ops {
+ void (*request)(struct mmc_host *host, struct mmc_request *req);
+ void (*set_ios)(struct mmc_host *host, struct mmc_ios *ios);
+ int (*get_ro)(struct mmc_host *host);
+};
+
+struct mmc_card;
+struct device;
+
+struct mmc_host {
+ struct device *dev;
+ struct class_device class_dev;
+ int index;
+ const struct mmc_host_ops *ops;
+ unsigned int f_min;
+ unsigned int f_max;
+ u32 ocr_avail;
+
+ unsigned long caps;
+
+#define MMC_CAP_4_BIT_DATA (1 << 0)  
+
+ unsigned int max_seg_size;
+ unsigned short max_hw_segs;
+ unsigned short max_phys_segs;
+ unsigned short max_sectors;
+ unsigned short unused;
+
+ struct mmc_ios ios;
+ u32 ocr;
+
+ unsigned int mode;
+#define MMC_MODE_MMC 0
+#define MMC_MODE_SD 1
+
+ struct list_head cards;
+
+ wait_queue_head_t wq;
+ spinlock_t lock;
+ struct mmc_card *card_busy;
+ struct mmc_card *card_selected;
+
+ struct work_struct detect;
+
+ unsigned long private[0] ____cacheline_aligned;
+};
+
+#define mmc_dev(x) ((x)->dev)
+#define mmc_hostname(x) ((x)->class_dev.class_id)
+
+#endif
+
diff --git a/ndk/platforms/android-3/include/linux/mmc/mmc.h b/ndk/platforms/android-3/include/linux/mmc/mmc.h
new file mode 100644
index 0000000..089714c
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/mmc/mmc.h
@@ -0,0 +1,99 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef MMC_H
+#define MMC_H
+
+#include <linux/list.h>
+#include <linux/interrupt.h>
+#include <linux/device.h>
+
+struct request;
+struct mmc_data;
+struct mmc_request;
+
+struct mmc_command {
+ u32 opcode;
+ u32 arg;
+ u32 resp[4];
+ unsigned int flags;
+#define MMC_RSP_PRESENT (1 << 0)
+#define MMC_RSP_136 (1 << 1)  
+#define MMC_RSP_CRC (1 << 2)  
+#define MMC_RSP_BUSY (1 << 3)  
+#define MMC_RSP_OPCODE (1 << 4)  
+#define MMC_CMD_MASK (3 << 5)  
+#define MMC_CMD_AC (0 << 5)
+#define MMC_CMD_ADTC (1 << 5)
+#define MMC_CMD_BC (2 << 5)
+#define MMC_CMD_BCR (3 << 5)
+
+#define MMC_RSP_NONE (0)
+#define MMC_RSP_R1 (MMC_RSP_PRESENT|MMC_RSP_CRC|MMC_RSP_OPCODE)
+#define MMC_RSP_R1B (MMC_RSP_PRESENT|MMC_RSP_CRC|MMC_RSP_OPCODE|MMC_RSP_BUSY)
+#define MMC_RSP_R2 (MMC_RSP_PRESENT|MMC_RSP_136|MMC_RSP_CRC)
+#define MMC_RSP_R3 (MMC_RSP_PRESENT)
+#define MMC_RSP_R6 (MMC_RSP_PRESENT|MMC_RSP_CRC)
+
+#define mmc_resp_type(cmd) ((cmd)->flags & (MMC_RSP_PRESENT|MMC_RSP_136|MMC_RSP_CRC|MMC_RSP_BUSY|MMC_RSP_OPCODE))
+
+#define mmc_cmd_type(cmd) ((cmd)->flags & MMC_CMD_MASK)
+
+ unsigned int retries;
+ unsigned int error;
+
+#define MMC_ERR_NONE 0
+#define MMC_ERR_TIMEOUT 1
+#define MMC_ERR_BADCRC 2
+#define MMC_ERR_FIFO 3
+#define MMC_ERR_FAILED 4
+#define MMC_ERR_INVALID 5
+
+ struct mmc_data *data;
+ struct mmc_request *mrq;
+};
+
+struct mmc_data {
+ unsigned int timeout_ns;
+ unsigned int timeout_clks;
+ unsigned int blksz_bits;
+ unsigned int blksz;
+ unsigned int blocks;
+ unsigned int error;
+ unsigned int flags;
+
+#define MMC_DATA_WRITE (1 << 8)
+#define MMC_DATA_READ (1 << 9)
+#define MMC_DATA_STREAM (1 << 10)
+#define MMC_DATA_MULTI (1 << 11)
+
+ unsigned int bytes_xfered;
+
+ struct mmc_command *stop;
+ struct mmc_request *mrq;
+
+ unsigned int sg_len;
+ struct scatterlist *sg;
+};
+
+struct mmc_request {
+ struct mmc_command *cmd;
+ struct mmc_data *data;
+ struct mmc_command *stop;
+
+ void *done_data;
+ void (*done)(struct mmc_request *);
+};
+
+struct mmc_host;
+struct mmc_card;
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/mmzone.h b/ndk/platforms/android-3/include/linux/mmzone.h
new file mode 100644
index 0000000..a81382e
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/mmzone.h
@@ -0,0 +1,15 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_MMZONE_H
+#define _LINUX_MMZONE_H
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/mod_devicetable.h b/ndk/platforms/android-3/include/linux/mod_devicetable.h
new file mode 100644
index 0000000..a3c1de8
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/mod_devicetable.h
@@ -0,0 +1,209 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef LINUX_MOD_DEVICETABLE_H
+#define LINUX_MOD_DEVICETABLE_H
+
+#define PCI_ANY_ID (~0)
+
+struct pci_device_id {
+ __u32 vendor, device;
+ __u32 subvendor, subdevice;
+ __u32 class, class_mask;
+ kernel_ulong_t driver_data;
+};
+
+#define IEEE1394_MATCH_VENDOR_ID 0x0001
+#define IEEE1394_MATCH_MODEL_ID 0x0002
+#define IEEE1394_MATCH_SPECIFIER_ID 0x0004
+#define IEEE1394_MATCH_VERSION 0x0008
+
+struct ieee1394_device_id {
+ __u32 match_flags;
+ __u32 vendor_id;
+ __u32 model_id;
+ __u32 specifier_id;
+ __u32 version;
+ kernel_ulong_t driver_data
+ __attribute__((aligned(sizeof(kernel_ulong_t))));
+};
+
+struct usb_device_id {
+
+ __u16 match_flags;
+
+ __u16 idVendor;
+ __u16 idProduct;
+ __u16 bcdDevice_lo;
+ __u16 bcdDevice_hi;
+
+ __u8 bDeviceClass;
+ __u8 bDeviceSubClass;
+ __u8 bDeviceProtocol;
+
+ __u8 bInterfaceClass;
+ __u8 bInterfaceSubClass;
+ __u8 bInterfaceProtocol;
+
+ kernel_ulong_t driver_info;
+};
+
+#define USB_DEVICE_ID_MATCH_VENDOR 0x0001
+#define USB_DEVICE_ID_MATCH_PRODUCT 0x0002
+#define USB_DEVICE_ID_MATCH_DEV_LO 0x0004
+#define USB_DEVICE_ID_MATCH_DEV_HI 0x0008
+#define USB_DEVICE_ID_MATCH_DEV_CLASS 0x0010
+#define USB_DEVICE_ID_MATCH_DEV_SUBCLASS 0x0020
+#define USB_DEVICE_ID_MATCH_DEV_PROTOCOL 0x0040
+#define USB_DEVICE_ID_MATCH_INT_CLASS 0x0080
+#define USB_DEVICE_ID_MATCH_INT_SUBCLASS 0x0100
+#define USB_DEVICE_ID_MATCH_INT_PROTOCOL 0x0200
+
+struct ccw_device_id {
+ __u16 match_flags;
+
+ __u16 cu_type;
+ __u16 dev_type;
+ __u8 cu_model;
+ __u8 dev_model;
+
+ kernel_ulong_t driver_info;
+};
+
+#define CCW_DEVICE_ID_MATCH_CU_TYPE 0x01
+#define CCW_DEVICE_ID_MATCH_CU_MODEL 0x02
+#define CCW_DEVICE_ID_MATCH_DEVICE_TYPE 0x04
+#define CCW_DEVICE_ID_MATCH_DEVICE_MODEL 0x08
+
+#define PNP_ID_LEN 8
+#define PNP_MAX_DEVICES 8
+
+struct pnp_device_id {
+ __u8 id[PNP_ID_LEN];
+ kernel_ulong_t driver_data;
+};
+
+struct pnp_card_device_id {
+ __u8 id[PNP_ID_LEN];
+ kernel_ulong_t driver_data;
+ struct {
+ __u8 id[PNP_ID_LEN];
+ } devs[PNP_MAX_DEVICES];
+};
+
+#define SERIO_ANY 0xff
+
+struct serio_device_id {
+ __u8 type;
+ __u8 extra;
+ __u8 id;
+ __u8 proto;
+};
+
+struct of_device_id
+{
+ char name[32];
+ char type[32];
+ char compatible[128];
+ kernel_ulong_t data;
+};
+
+struct vio_device_id {
+ char type[32];
+ char compat[32];
+};
+
+struct pcmcia_device_id {
+ __u16 match_flags;
+
+ __u16 manf_id;
+ __u16 card_id;
+
+ __u8 func_id;
+
+ __u8 function;
+
+ __u8 device_no;
+
+ __u32 prod_id_hash[4]
+ __attribute__((aligned(sizeof(__u32))));
+
+ kernel_ulong_t prod_id[4]
+ __attribute__((aligned(sizeof(kernel_ulong_t))));
+
+ kernel_ulong_t driver_info;
+ kernel_ulong_t cisfile;
+};
+
+#define PCMCIA_DEV_ID_MATCH_MANF_ID 0x0001
+#define PCMCIA_DEV_ID_MATCH_CARD_ID 0x0002
+#define PCMCIA_DEV_ID_MATCH_FUNC_ID 0x0004
+#define PCMCIA_DEV_ID_MATCH_FUNCTION 0x0008
+#define PCMCIA_DEV_ID_MATCH_PROD_ID1 0x0010
+#define PCMCIA_DEV_ID_MATCH_PROD_ID2 0x0020
+#define PCMCIA_DEV_ID_MATCH_PROD_ID3 0x0040
+#define PCMCIA_DEV_ID_MATCH_PROD_ID4 0x0080
+#define PCMCIA_DEV_ID_MATCH_DEVICE_NO 0x0100
+#define PCMCIA_DEV_ID_MATCH_FAKE_CIS 0x0200
+#define PCMCIA_DEV_ID_MATCH_ANONYMOUS 0x0400
+
+struct i2c_device_id {
+ __u16 id;
+};
+
+#define INPUT_DEVICE_ID_EV_MAX 0x1f
+#define INPUT_DEVICE_ID_KEY_MAX 0x1ff
+#define INPUT_DEVICE_ID_REL_MAX 0x0f
+#define INPUT_DEVICE_ID_ABS_MAX 0x3f
+#define INPUT_DEVICE_ID_MSC_MAX 0x07
+#define INPUT_DEVICE_ID_LED_MAX 0x0f
+#define INPUT_DEVICE_ID_SND_MAX 0x07
+#define INPUT_DEVICE_ID_FF_MAX 0x7f
+#define INPUT_DEVICE_ID_SW_MAX 0x0f
+
+#define INPUT_DEVICE_ID_MATCH_BUS 1
+#define INPUT_DEVICE_ID_MATCH_VENDOR 2
+#define INPUT_DEVICE_ID_MATCH_PRODUCT 4
+#define INPUT_DEVICE_ID_MATCH_VERSION 8
+
+#define INPUT_DEVICE_ID_MATCH_EVBIT 0x0010
+#define INPUT_DEVICE_ID_MATCH_KEYBIT 0x0020
+#define INPUT_DEVICE_ID_MATCH_RELBIT 0x0040
+#define INPUT_DEVICE_ID_MATCH_ABSBIT 0x0080
+#define INPUT_DEVICE_ID_MATCH_MSCIT 0x0100
+#define INPUT_DEVICE_ID_MATCH_LEDBIT 0x0200
+#define INPUT_DEVICE_ID_MATCH_SNDBIT 0x0400
+#define INPUT_DEVICE_ID_MATCH_FFBIT 0x0800
+#define INPUT_DEVICE_ID_MATCH_SWBIT 0x1000
+
+struct input_device_id {
+
+ kernel_ulong_t flags;
+
+ __u16 bustype;
+ __u16 vendor;
+ __u16 product;
+ __u16 version;
+
+ kernel_ulong_t evbit[INPUT_DEVICE_ID_EV_MAX / BITS_PER_LONG + 1];
+ kernel_ulong_t keybit[INPUT_DEVICE_ID_KEY_MAX / BITS_PER_LONG + 1];
+ kernel_ulong_t relbit[INPUT_DEVICE_ID_REL_MAX / BITS_PER_LONG + 1];
+ kernel_ulong_t absbit[INPUT_DEVICE_ID_ABS_MAX / BITS_PER_LONG + 1];
+ kernel_ulong_t mscbit[INPUT_DEVICE_ID_MSC_MAX / BITS_PER_LONG + 1];
+ kernel_ulong_t ledbit[INPUT_DEVICE_ID_LED_MAX / BITS_PER_LONG + 1];
+ kernel_ulong_t sndbit[INPUT_DEVICE_ID_SND_MAX / BITS_PER_LONG + 1];
+ kernel_ulong_t ffbit[INPUT_DEVICE_ID_FF_MAX / BITS_PER_LONG + 1];
+ kernel_ulong_t swbit[INPUT_DEVICE_ID_SW_MAX / BITS_PER_LONG + 1];
+
+ kernel_ulong_t driver_info;
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/module.h b/ndk/platforms/android-3/include/linux/module.h
new file mode 100644
index 0000000..3c449c6
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/module.h
@@ -0,0 +1,114 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_MODULE_H
+#define _LINUX_MODULE_H
+
+#include <linux/sched.h>
+#include <linux/spinlock.h>
+#include <linux/list.h>
+#include <linux/stat.h>
+#include <linux/compiler.h>
+#include <linux/cache.h>
+#include <linux/kmod.h>
+#include <linux/elf.h>
+#include <linux/stringify.h>
+#include <linux/kobject.h>
+#include <linux/moduleparam.h>
+#include <asm/local.h>
+
+#include <asm/module.h>
+
+#define MODULE_SUPPORTED_DEVICE(name)
+
+#ifndef MODULE_SYMBOL_PREFIX
+#define MODULE_SYMBOL_PREFIX ""
+#endif
+
+#define MODULE_NAME_LEN (64 - sizeof(unsigned long))
+
+struct kernel_symbol
+{
+ unsigned long value;
+ const char *name;
+};
+
+struct modversion_info
+{
+ unsigned long crc;
+ char name[MODULE_NAME_LEN];
+};
+
+struct module;
+
+struct module_attribute {
+ struct attribute attr;
+ ssize_t (*show)(struct module_attribute *, struct module *, char *);
+ ssize_t (*store)(struct module_attribute *, struct module *,
+ const char *, size_t count);
+ void (*setup)(struct module *, const char *);
+ int (*test)(struct module *);
+ void (*free)(struct module *);
+};
+
+struct module_kobject
+{
+ struct kobject kobj;
+ struct module *mod;
+};
+
+struct exception_table_entry;
+
+#ifdef MODULE
+#define MODULE_GENERIC_TABLE(gtype,name)  extern const struct gtype##_id __mod_##gtype##_table   __attribute__ ((unused, alias(__stringify(name))))
+
+#define THIS_MODULE (&__this_module)
+#else
+#define MODULE_GENERIC_TABLE(gtype,name)
+#define THIS_MODULE ((struct module *)0)
+#endif
+
+#define MODULE_INFO(tag, info) __MODULE_INFO(tag, tag, info)
+
+#define MODULE_ALIAS(_alias) MODULE_INFO(alias, _alias)
+
+#define MODULE_LICENSE(_license) MODULE_INFO(license, _license)
+
+#define MODULE_AUTHOR(_author) MODULE_INFO(author, _author)
+
+#define MODULE_DESCRIPTION(_description) MODULE_INFO(description, _description)
+
+#define MODULE_PARM_DESC(_parm, desc)   __MODULE_INFO(parm, _parm, #_parm ":" desc)
+
+#define MODULE_DEVICE_TABLE(type,name)   MODULE_GENERIC_TABLE(type##_device,name)
+
+#define MODULE_VERSION(_version) MODULE_INFO(version, _version)
+
+struct notifier_block;
+
+#define EXPORT_SYMBOL(sym)
+#define EXPORT_SYMBOL_GPL(sym)
+#define EXPORT_SYMBOL_GPL_FUTURE(sym)
+#define EXPORT_UNUSED_SYMBOL(sym)
+#define EXPORT_UNUSED_SYMBOL_GPL(sym)
+
+#define symbol_get(x) ({ extern typeof(x) x __attribute__((weak)); &(x); })
+#define symbol_put(x) do { } while(0)
+#define symbol_put_addr(x) do { } while(0)
+#define module_name(mod) "kernel"
+#define __unsafe(mod)
+#define module_put_and_exit(code) do_exit(code)
+
+struct module;
+
+#define symbol_request(x) try_then_request_module(symbol_get(x), "symbol:" #x)
+#define __MODULE_STRING(x) __stringify(x)
+#endif
diff --git a/ndk/platforms/android-3/include/linux/moduleparam.h b/ndk/platforms/android-3/include/linux/moduleparam.h
new file mode 100644
index 0000000..b46ddd6
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/moduleparam.h
@@ -0,0 +1,101 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_MODULE_PARAMS_H
+#define _LINUX_MODULE_PARAMS_H
+
+#include <linux/init.h>
+#include <linux/stringify.h>
+#include <linux/kernel.h>
+
+#ifdef MODULE
+#define MODULE_PARAM_PREFIX  
+#else
+#define MODULE_PARAM_PREFIX KBUILD_MODNAME "."
+#endif
+
+#ifdef MODULE
+#define ___module_cat(a,b) __mod_ ## a ## b
+#define __module_cat(a,b) ___module_cat(a,b)
+#define __MODULE_INFO(tag, name, info)  static const char __module_cat(name,__LINE__)[]   __attribute_used__   __attribute__((section(".modinfo"),unused)) = __stringify(tag) "=" info
+#else
+#define __MODULE_INFO(tag, name, info)
+#endif
+#define __MODULE_PARM_TYPE(name, _type)   __MODULE_INFO(parmtype, name##type, #name ":" _type)
+
+struct kernel_param;
+
+typedef int (*param_set_fn)(const char *val, struct kernel_param *kp);
+
+typedef int (*param_get_fn)(char *buffer, struct kernel_param *kp);
+
+struct kernel_param {
+ const char *name;
+ unsigned int perm;
+ param_set_fn set;
+ param_get_fn get;
+ void *arg;
+};
+
+struct kparam_string {
+ unsigned int maxlen;
+ char *string;
+};
+
+struct kparam_array
+{
+ unsigned int max;
+ unsigned int *num;
+ param_set_fn set;
+ param_get_fn get;
+ unsigned int elemsize;
+ void *elem;
+};
+
+#define __module_param_call(prefix, name, set, get, arg, perm)   static char __param_str_##name[] = prefix #name;   static struct kernel_param const __param_##name   __attribute_used__   __attribute__ ((unused,__section__ ("__param"),aligned(sizeof(void *))))   = { __param_str_##name, perm, set, get, arg }
+
+#define module_param_call(name, set, get, arg, perm)   __module_param_call(MODULE_PARAM_PREFIX, name, set, get, arg, perm)
+
+#define module_param_named(name, value, type, perm)   param_check_##type(name, &(value));   module_param_call(name, param_set_##type, param_get_##type, &value, perm);   __MODULE_PARM_TYPE(name, #type)
+
+#define module_param(name, type, perm)   module_param_named(name, name, type, perm)
+
+#define module_param_string(name, string, len, perm)   static struct kparam_string __param_string_##name   = { len, string };   module_param_call(name, param_set_copystring, param_get_string,   &__param_string_##name, perm);   __MODULE_PARM_TYPE(name, "string")
+
+#define __param_check(name, p, type)   static inline type *__check_##name(void) { return(p); }
+
+#define param_check_byte(name, p) __param_check(name, p, unsigned char)
+
+#define param_check_short(name, p) __param_check(name, p, short)
+
+#define param_check_ushort(name, p) __param_check(name, p, unsigned short)
+
+#define param_check_int(name, p) __param_check(name, p, int)
+
+#define param_check_uint(name, p) __param_check(name, p, unsigned int)
+
+#define param_check_long(name, p) __param_check(name, p, long)
+
+#define param_check_ulong(name, p) __param_check(name, p, unsigned long)
+
+#define param_check_charp(name, p) __param_check(name, p, char *)
+
+#define param_check_bool(name, p) __param_check(name, p, int)
+
+#define param_check_invbool(name, p) __param_check(name, p, int)
+
+#define module_param_array_named(name, array, type, nump, perm)   static struct kparam_array __param_arr_##name   = { ARRAY_SIZE(array), nump, param_set_##type, param_get_##type,  sizeof(array[0]), array };   module_param_call(name, param_array_set, param_array_get,   &__param_arr_##name, perm);   __MODULE_PARM_TYPE(name, "array of " #type)
+
+#define module_param_array(name, type, nump, perm)   module_param_array_named(name, name, type, nump, perm)
+
+struct module;
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/mount.h b/ndk/platforms/android-3/include/linux/mount.h
new file mode 100644
index 0000000..ee476e0
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/mount.h
@@ -0,0 +1,14 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_MOUNT_H
+#define _LINUX_MOUNT_H
+#endif
diff --git a/ndk/platforms/android-3/include/linux/msdos_fs.h b/ndk/platforms/android-3/include/linux/msdos_fs.h
new file mode 100644
index 0000000..5a4eb0a
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/msdos_fs.h
@@ -0,0 +1,180 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_MSDOS_FS_H
+#define _LINUX_MSDOS_FS_H
+
+#include <linux/magic.h>
+
+#include <asm/byteorder.h>
+
+#define SECTOR_SIZE 512  
+#define SECTOR_BITS 9  
+#define MSDOS_DPB (MSDOS_DPS)  
+#define MSDOS_DPB_BITS 4  
+#define MSDOS_DPS (SECTOR_SIZE / sizeof(struct msdos_dir_entry))
+#define MSDOS_DPS_BITS 4  
+#define CF_LE_W(v) le16_to_cpu(v)
+#define CF_LE_L(v) le32_to_cpu(v)
+#define CT_LE_W(v) cpu_to_le16(v)
+#define CT_LE_L(v) cpu_to_le32(v)
+
+#define MSDOS_ROOT_INO 1  
+#define MSDOS_DIR_BITS 5  
+
+#define FAT_MAX_DIR_ENTRIES (65536)
+#define FAT_MAX_DIR_SIZE (FAT_MAX_DIR_ENTRIES << MSDOS_DIR_BITS)
+
+#define ATTR_NONE 0  
+#define ATTR_RO 1  
+#define ATTR_HIDDEN 2  
+#define ATTR_SYS 4  
+#define ATTR_VOLUME 8  
+#define ATTR_DIR 16  
+#define ATTR_ARCH 32  
+
+#define ATTR_UNUSED (ATTR_VOLUME | ATTR_ARCH | ATTR_SYS | ATTR_HIDDEN)
+
+#define ATTR_EXT (ATTR_RO | ATTR_HIDDEN | ATTR_SYS | ATTR_VOLUME)
+
+#define CASE_LOWER_BASE 8  
+#define CASE_LOWER_EXT 16  
+
+#define DELETED_FLAG 0xe5  
+#define IS_FREE(n) (!*(n) || *(n) == DELETED_FLAG)
+
+#define MSDOS_VALID_MODE (S_IFREG | S_IFDIR | S_IRWXU | S_IRWXG | S_IRWXO)
+
+#define MSDOS_MKMODE(a, m) (m & (a & ATTR_RO ? S_IRUGO|S_IXUGO : S_IRWXUGO))
+
+#define MSDOS_NAME 11  
+#define MSDOS_LONGNAME 256  
+#define MSDOS_SLOTS 21  
+#define MSDOS_DOT ".          "  
+#define MSDOS_DOTDOT "..         "  
+
+#define FAT_VALID_MEDIA(x) ((0xF8 <= (x) && (x) <= 0xFF) || (x) == 0xF0)
+#define FAT_FIRST_ENT(s, x) ((MSDOS_SB(s)->fat_bits == 32 ? 0x0FFFFF00 :   MSDOS_SB(s)->fat_bits == 16 ? 0xFF00 : 0xF00) | (x))
+
+#define FAT_START_ENT 2
+
+#define MAX_FAT12 0xFF4
+#define MAX_FAT16 0xFFF4
+#define MAX_FAT32 0x0FFFFFF6
+#define MAX_FAT(s) (MSDOS_SB(s)->fat_bits == 32 ? MAX_FAT32 :   MSDOS_SB(s)->fat_bits == 16 ? MAX_FAT16 : MAX_FAT12)
+
+#define BAD_FAT12 0xFF7
+#define BAD_FAT16 0xFFF7
+#define BAD_FAT32 0x0FFFFFF7
+
+#define EOF_FAT12 0xFFF
+#define EOF_FAT16 0xFFFF
+#define EOF_FAT32 0x0FFFFFFF
+
+#define FAT_ENT_FREE (0)
+#define FAT_ENT_BAD (BAD_FAT32)
+#define FAT_ENT_EOF (EOF_FAT32)
+
+#define FAT_FSINFO_SIG1 0x41615252
+#define FAT_FSINFO_SIG2 0x61417272
+#define IS_FSINFO(x) (le32_to_cpu((x)->signature1) == FAT_FSINFO_SIG1   && le32_to_cpu((x)->signature2) == FAT_FSINFO_SIG2)
+
+#define VFAT_IOCTL_READDIR_BOTH _IOR('r', 1, struct dirent [2])
+#define VFAT_IOCTL_READDIR_SHORT _IOR('r', 2, struct dirent [2])
+
+#define FAT_IOCTL_GET_ATTRIBUTES _IOR('r', 0x10, __u32)
+#define FAT_IOCTL_SET_ATTRIBUTES _IOW('r', 0x11, __u32)
+#define VFAT_IOCTL_GET_VOLUME_ID _IOR('r', 0x12, __u32)
+
+#define VFAT_SFN_DISPLAY_LOWER 0x0001  
+#define VFAT_SFN_DISPLAY_WIN95 0x0002  
+#define VFAT_SFN_DISPLAY_WINNT 0x0004  
+#define VFAT_SFN_CREATE_WIN95 0x0100  
+#define VFAT_SFN_CREATE_WINNT 0x0200  
+
+struct fat_boot_sector {
+ __u8 ignored[3];
+ __u8 system_id[8];
+ __u8 sector_size[2];
+ __u8 sec_per_clus;
+ __le16 reserved;
+ __u8 fats;
+ __u8 dir_entries[2];
+ __u8 sectors[2];
+ __u8 media;
+ __le16 fat_length;
+ __le16 secs_track;
+ __le16 heads;
+ __le32 hidden;
+ __le32 total_sect;
+
+ __le32 fat32_length;
+ __le16 flags;
+ __u8 version[2];
+ __le32 root_cluster;
+ __le16 info_sector;
+ __le16 backup_boot;
+ __le16 reserved2[6];
+};
+
+struct fat_boot_fsinfo {
+ __le32 signature1;
+ __le32 reserved1[120];
+ __le32 signature2;
+ __le32 free_clusters;
+ __le32 next_cluster;
+ __le32 reserved2[4];
+};
+
+struct fat_boot_bsx {
+ __u8 drive;
+ __u8 reserved1;
+ __u8 signature;
+ __u8 vol_id[4];
+ __u8 vol_label[11];
+ __u8 type[8];
+};
+#define FAT16_BSX_OFFSET 36  
+#define FAT32_BSX_OFFSET 64  
+
+struct msdos_dir_entry {
+ __u8 name[MSDOS_NAME];
+ __u8 attr;
+ __u8 lcase;
+ __u8 ctime_cs;
+ __le16 ctime;
+ __le16 cdate;
+ __le16 adate;
+ __le16 starthi;
+ __le16 time,date,start;
+ __le32 size;
+};
+
+struct msdos_dir_slot {
+ __u8 id;
+ __u8 name0_4[10];
+ __u8 attr;
+ __u8 reserved;
+ __u8 alias_checksum;
+ __u8 name5_10[12];
+ __le16 start;
+ __u8 name11_12[4];
+};
+
+struct fat_slot_info {
+ loff_t i_pos;
+ loff_t slot_off;
+ int nr_slots;
+ struct msdos_dir_entry *de;
+ struct buffer_head *bh;
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/msg.h b/ndk/platforms/android-3/include/linux/msg.h
new file mode 100644
index 0000000..254f1e9
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/msg.h
@@ -0,0 +1,68 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_MSG_H
+#define _LINUX_MSG_H
+
+#include <linux/ipc.h>
+
+#define MSG_STAT 11
+#define MSG_INFO 12
+
+#define MSG_NOERROR 010000  
+#define MSG_EXCEPT 020000  
+
+struct msqid_ds {
+ struct ipc_perm msg_perm;
+ struct msg *msg_first;
+ struct msg *msg_last;
+ __kernel_time_t msg_stime;
+ __kernel_time_t msg_rtime;
+ __kernel_time_t msg_ctime;
+ unsigned long msg_lcbytes;
+ unsigned long msg_lqbytes;
+ unsigned short msg_cbytes;
+ unsigned short msg_qnum;
+ unsigned short msg_qbytes;
+ __kernel_ipc_pid_t msg_lspid;
+ __kernel_ipc_pid_t msg_lrpid;
+};
+
+#include <asm/msgbuf.h>
+
+struct msgbuf {
+ long mtype;
+ char mtext[1];
+};
+
+struct msginfo {
+ int msgpool;
+ int msgmap;
+ int msgmax;
+ int msgmnb;
+ int msgmni;
+ int msgssz;
+ int msgtql;
+ unsigned short msgseg;
+};
+
+#define MSGMNI 16    
+#define MSGMAX 8192    
+#define MSGMNB 16384    
+
+#define MSGPOOL (MSGMNI*MSGMNB/1024)  
+#define MSGTQL MSGMNB  
+#define MSGMAP MSGMNB  
+#define MSGSSZ 16  
+#define __MSGSEG ((MSGPOOL*1024)/ MSGSSZ)  
+#define MSGSEG (__MSGSEG <= 0xffff ? __MSGSEG : 0xffff)
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/msm_adsp.h b/ndk/platforms/android-3/include/linux/msm_adsp.h
new file mode 100644
index 0000000..6f12707
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/msm_adsp.h
@@ -0,0 +1,57 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __LINUX_MSM_ADSP_H
+#define __LINUX_MSM_ADSP_H
+
+#include <linux/types.h>
+#include <linux/ioctl.h>
+#include <asm/sizes.h>
+
+#define ADSP_IOCTL_MAGIC 'q'
+
+struct adsp_command_t {
+ uint16_t queue;
+ uint32_t len;
+ uint8_t *data;
+};
+
+struct adsp_event_t {
+ uint16_t type;
+ uint32_t timeout_ms;
+ uint16_t msg_id;
+ uint16_t flags;
+ uint32_t len;
+ uint8_t *data;
+};
+
+struct adsp_pmem_info_t {
+ int fd;
+ void *vaddr;
+};
+
+#define ADSP_IOCTL_ENABLE   _IOR(ADSP_IOCTL_MAGIC, 1, unsigned)
+
+#define ADSP_IOCTL_DISABLE   _IOR(ADSP_IOCTL_MAGIC, 2, unsigned)
+
+#define ADSP_IOCTL_DISABLE_ACK   _IOR(ADSP_IOCTL_MAGIC, 3, unsigned)
+
+#define ADSP_IOCTL_WRITE_COMMAND   _IOR(ADSP_IOCTL_MAGIC, 4, struct adsp_command_t *)
+
+#define ADSP_IOCTL_GET_EVENT   _IOWR(ADSP_IOCTL_MAGIC, 5, struct adsp_event_data_t *)
+
+#define ADSP_IOCTL_DISABLE_EVENT_RSP   _IOR(ADSP_IOCTL_MAGIC, 10, unsigned)
+
+#define ADSP_IOCTL_REGISTER_PMEM   _IOW(ADSP_IOCTL_MAGIC, 13, struct adsp_pmem_info *)
+
+#define ADSP_IOCTL_ABORT_EVENT_READ   _IOW(ADSP_IOCTL_MAGIC, 15, unsigned)
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/msm_audio.h b/ndk/platforms/android-3/include/linux/msm_audio.h
new file mode 100644
index 0000000..9ac58aa
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/msm_audio.h
@@ -0,0 +1,85 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __LINUX_MSM_AUDIO_H
+#define __LINUX_MSM_AUDIO_H
+
+#include <linux/types.h>
+#include <linux/ioctl.h>
+#include <asm/sizes.h>
+
+#define AUDIO_IOCTL_MAGIC 'a'
+
+#define AUDIO_START _IOW(AUDIO_IOCTL_MAGIC, 0, unsigned)
+#define AUDIO_STOP _IOW(AUDIO_IOCTL_MAGIC, 1, unsigned)
+#define AUDIO_FLUSH _IOW(AUDIO_IOCTL_MAGIC, 2, unsigned)
+#define AUDIO_GET_CONFIG _IOR(AUDIO_IOCTL_MAGIC, 3, unsigned)
+#define AUDIO_SET_CONFIG _IOW(AUDIO_IOCTL_MAGIC, 4, unsigned)
+#define AUDIO_GET_STATS _IOR(AUDIO_IOCTL_MAGIC, 5, unsigned)
+#define AUDIO_ENABLE_AUDPP _IOW(AUDIO_IOCTL_MAGIC, 6, unsigned)
+#define AUDIO_SET_ADRC _IOW(AUDIO_IOCTL_MAGIC, 7, unsigned)
+#define AUDIO_SET_EQ _IOW(AUDIO_IOCTL_MAGIC, 8, unsigned)
+#define AUDIO_SET_RX_IIR _IOW(AUDIO_IOCTL_MAGIC, 9, unsigned)
+#define AUDIO_SET_VOLUME _IOW(AUDIO_IOCTL_MAGIC, 10, unsigned)
+#define AUDIO_ENABLE_AUDPRE _IOW(AUDIO_IOCTL_MAGIC, 11, unsigned)
+#define AUDIO_SET_AGC _IOW(AUDIO_IOCTL_MAGIC, 12, unsigned)
+#define AUDIO_SET_NS _IOW(AUDIO_IOCTL_MAGIC, 13, unsigned)
+#define AUDIO_SET_TX_IIR _IOW(AUDIO_IOCTL_MAGIC, 14, unsigned)
+
+struct msm_audio_config {
+ uint32_t buffer_size;
+ uint32_t buffer_count;
+ uint32_t channel_count;
+ uint32_t sample_rate;
+ uint32_t type;
+ uint32_t unused[3];
+};
+
+struct msm_audio_stats {
+ uint32_t byte_count;
+ uint32_t sample_count;
+ uint32_t unused[2];
+};
+
+#define SND_IOCTL_MAGIC 's'
+
+#define SND_MUTE_UNMUTED 0
+#define SND_MUTE_MUTED 1
+
+struct msm_snd_device_config {
+ uint32_t device;
+ uint32_t ear_mute;
+ uint32_t mic_mute;
+};
+
+#define SND_SET_DEVICE _IOW(SND_IOCTL_MAGIC, 2, struct msm_device_config *)
+
+#define SND_METHOD_VOICE 0
+
+struct msm_snd_volume_config {
+ uint32_t device;
+ uint32_t method;
+ uint32_t volume;
+};
+
+#define SND_SET_VOLUME _IOW(SND_IOCTL_MAGIC, 3, struct msm_snd_volume_config *)
+
+#define SND_GET_NUM_ENDPOINTS _IOR(SND_IOCTL_MAGIC, 4, unsigned *)
+
+struct msm_snd_endpoint {
+ int id;
+ char name[64];
+};
+
+#define SND_GET_ENDPOINT _IOWR(SND_IOCTL_MAGIC, 5, struct msm_snd_endpoint *)
+
+#endif
+
diff --git a/ndk/platforms/android-3/include/linux/msm_mdp.h b/ndk/platforms/android-3/include/linux/msm_mdp.h
new file mode 100644
index 0000000..43fdac3
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/msm_mdp.h
@@ -0,0 +1,83 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _MSM_MDP_H_
+#define _MSM_MDP_H_
+
+#include <linux/types.h>
+
+#define MSMFB_IOCTL_MAGIC 'm'
+#define MSMFB_GRP_DISP _IOW(MSMFB_IOCTL_MAGIC, 1, unsigned int)
+#define MSMFB_BLIT _IOW(MSMFB_IOCTL_MAGIC, 2, unsigned int)
+
+enum {
+ MDP_RGB_565,
+ MDP_XRGB_8888,
+ MDP_Y_CBCR_H2V2,
+ MDP_ARGB_8888,
+ MDP_RGB_888,
+ MDP_Y_CRCB_H2V2,
+ MDP_YCRYCB_H2V1,
+ MDP_Y_CRCB_H2V1,
+ MDP_Y_CBCR_H2V1,
+ MDP_RGBA_8888,
+ MDP_BGRA_8888,
+ MDP_IMGTYPE_LIMIT
+};
+
+enum {
+ PMEM_IMG,
+ FB_IMG,
+};
+
+#define MDP_ROT_NOP 0
+#define MDP_FLIP_LR 0x1
+#define MDP_FLIP_UD 0x2
+#define MDP_ROT_90 0x4
+#define MDP_ROT_180 (MDP_FLIP_UD|MDP_FLIP_LR)
+#define MDP_ROT_270 (MDP_ROT_90|MDP_FLIP_UD|MDP_FLIP_LR)
+#define MDP_DITHER 0x8
+#define MDP_BLUR 0x10
+
+#define MDP_TRANSP_NOP 0xffffffff
+#define MDP_ALPHA_NOP 0xff
+
+struct mdp_rect {
+ uint32_t x;
+ uint32_t y;
+ uint32_t w;
+ uint32_t h;
+};
+
+struct mdp_img {
+ uint32_t width;
+ uint32_t height;
+ uint32_t format;
+ uint32_t offset;
+ int memory_id;
+};
+
+struct mdp_blit_req {
+ struct mdp_img src;
+ struct mdp_img dst;
+ struct mdp_rect src_rect;
+ struct mdp_rect dst_rect;
+ uint32_t alpha;
+ uint32_t transp_mask;
+ uint32_t flags;
+};
+
+struct mdp_blit_req_list {
+ uint32_t count;
+ struct mdp_blit_req req[];
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/mt9t013.h b/ndk/platforms/android-3/include/linux/mt9t013.h
new file mode 100644
index 0000000..821ef21
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/mt9t013.h
@@ -0,0 +1,111 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef CAMERA_MT9T013_H
+#define CAMERA_MT9T013_H
+#include <linux/cdev.h>
+#include <linux/types.h>
+#include <linux/ioctl.h>
+#include <asm/sizes.h>
+
+#define MT9T013_I2C_IOCTL_MAGIC 'm'
+
+#define MT9T013_I2C_IOCTL_W   _IOW(MT9T013_I2C_IOCTL_MAGIC, 0, unsigned)
+
+#define MT9T013_I2C_IOCTL_R   _IOR(MT9T013_I2C_IOCTL_MAGIC, 1, unsigned)
+
+#define MT9T013_I2C_IOCTL_AF_W   _IOW(MT9T013_I2C_IOCTL_MAGIC, 2, unsigned)
+
+#define MT9T013_I2C_IOCTL_CAMIF_PAD_REG_RESET   _IO(MT9T013_I2C_IOCTL_MAGIC, 3)
+
+#define MT9T013_I2C_IOCTL_CAMIF_PAD_REG_RESET_2   _IO(MT9T013_I2C_IOCTL_MAGIC, 4)
+
+#define CAMERA_CONFIGURE_GPIOS   _IO(MT9T013_I2C_IOCTL_MAGIC, 7)
+
+#define CAMERA_UNCONFIGURE_GPIOS   _IO(MT9T013_I2C_IOCTL_MAGIC, 8)
+
+#define CAMERA_LENS_POWER_ON   _IO(MT9T013_I2C_IOCTL_MAGIC, 9)
+
+#define CAMERA_LENS_POWER_OFF   _IO(MT9T013_I2C_IOCTL_MAGIC, 10)
+
+#define MT9T013_I2C_IOCTL_CAMIF_APPS_RESET   _IO(MT9T013_I2C_IOCTL_MAGIC, 11)
+
+#define CAMIO_VFE_MDC_CLK 1  
+#define CAMIO_MDC_CLK 2  
+#define CAMIO_VFE_CLK 3  
+
+#define MT9T013_I2C_IOCTL_CLK_ENABLE   _IOW(MT9T013_I2C_IOCTL_MAGIC, 12, unsigned)
+
+#define MT9T013_I2C_IOCTL_CLK_DISABLE   _IOW(MT9T013_I2C_IOCTL_MAGIC, 13, unsigned)
+
+#define MT9T013_I2C_IOCTL_CLK_SELECT   _IOW(MT9T013_I2C_IOCTL_MAGIC, 14, unsigned)
+
+#define MT9T013_I2C_IOCTL_CLK_FREQ_PROG   _IOW(MT9T013_I2C_IOCTL_MAGIC, 15, unsigned)
+
+#define CAMSENSOR_REG_INIT 0<<0
+#define CAMSENSOR_REG_UPDATE_PERIODIC 1<<0
+#define CAMSENSOR_TYPE_PREVIEW 0<<1
+#define CAMSENSOR_TYPE_SNAPSHOT 1<<1
+
+#define MT9T013_I2C_IOCTL_SENSOR_SETTING   _IOW(MT9T013_I2C_IOCTL_MAGIC, 16, uint32_t)
+
+struct mt9t013_reg_struct
+{
+ uint16_t vt_pix_clk_div;
+ uint16_t vt_sys_clk_div;
+ uint16_t pre_pll_clk_div;
+ uint16_t pll_multiplier;
+ uint16_t op_pix_clk_div;
+ uint16_t op_sys_clk_div;
+ uint16_t scale_m;
+ uint16_t row_speed;
+ uint16_t x_addr_start;
+ uint16_t x_addr_end;
+ uint16_t y_addr_start;
+ uint16_t y_addr_end;
+ uint16_t read_mode;
+ uint16_t x_output_size ;
+ uint16_t y_output_size;
+ uint16_t line_length_pck;
+ uint16_t frame_length_lines;
+ uint16_t coarse_integration_time;
+ uint16_t fine_integration_time;
+};
+
+struct mt9t013_reg_pat {
+ struct mt9t013_reg_struct reg[2];
+};
+
+#define MT9T013_I2C_IOCTL_GET_REGISTERS   _IOR(MT9T013_I2C_IOCTL_MAGIC, 17, struct mt9t013_reg_pat *)
+
+struct mt9t013_exposure_gain {
+ uint16_t gain;
+ uint16_t line;
+ uint32_t mode;
+};
+
+#define MT9T013_I2C_IOCTL_EXPOSURE_GAIN   _IOW(MT9T013_I2C_IOCTL_MAGIC, 18, struct exposure_gain *)
+
+#define MT9T013_I2C_IOCTL_MOVE_FOCUS   _IOW(MT9T013_I2C_IOCTL_MAGIC, 19, uint32_t)
+
+#define MT9T013_I2C_IOCTL_SET_DEFAULT_FOCUS   _IOW(MT9T013_I2C_IOCTL_MAGIC, 20, uint32_t)
+
+#define MT9T013_I2C_IOCTL_POWER_DOWN   _IO(MT9T013_I2C_IOCTL_MAGIC, 21)
+
+struct mt9t013_init {
+ int preview;
+ uint16_t chipid;
+};
+
+#define MT9T013_I2C_IOCTL_INIT   _IOWR(MT9T013_I2C_IOCTL_MAGIC, 22, struct mt9t013_init *)
+
+#endif
+
diff --git a/ndk/platforms/android-3/include/linux/mtd/bbm.h b/ndk/platforms/android-3/include/linux/mtd/bbm.h
new file mode 100644
index 0000000..e311b23
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/mtd/bbm.h
@@ -0,0 +1,75 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __LINUX_MTD_BBM_H
+#define __LINUX_MTD_BBM_H
+
+#define NAND_MAX_CHIPS 8
+
+struct nand_bbt_descr {
+ int options;
+ int pages[NAND_MAX_CHIPS];
+ int offs;
+ int veroffs;
+ uint8_t version[NAND_MAX_CHIPS];
+ int len;
+ int maxblocks;
+ int reserved_block_code;
+ uint8_t *pattern;
+};
+
+#define NAND_BBT_NRBITS_MSK 0x0000000F
+#define NAND_BBT_1BIT 0x00000001
+#define NAND_BBT_2BIT 0x00000002
+#define NAND_BBT_4BIT 0x00000004
+#define NAND_BBT_8BIT 0x00000008
+
+#define NAND_BBT_LASTBLOCK 0x00000010
+
+#define NAND_BBT_ABSPAGE 0x00000020
+
+#define NAND_BBT_SEARCH 0x00000040
+
+#define NAND_BBT_PERCHIP 0x00000080
+
+#define NAND_BBT_VERSION 0x00000100
+
+#define NAND_BBT_CREATE 0x00000200
+
+#define NAND_BBT_SCANALLPAGES 0x00000400
+
+#define NAND_BBT_SCANEMPTY 0x00000800
+
+#define NAND_BBT_WRITE 0x00001000
+
+#define NAND_BBT_SAVECONTENT 0x00002000
+
+#define NAND_BBT_SCAN2NDPAGE 0x00004000
+
+#define NAND_BBT_SCAN_MAXBLOCKS 4
+
+#define ONENAND_BADBLOCK_POS 0
+
+struct bbm_info {
+ int bbt_erase_shift;
+ int badblockpos;
+ int options;
+
+ uint8_t *bbt;
+
+ int (*isbad_bbt)(struct mtd_info *mtd, loff_t ofs, int allowbbt);
+
+ struct nand_bbt_descr *badblock_pattern;
+
+ void *priv;
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/mtd/blktrans.h b/ndk/platforms/android-3/include/linux/mtd/blktrans.h
new file mode 100644
index 0000000..7c40724
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/mtd/blktrans.h
@@ -0,0 +1,63 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __MTD_TRANS_H__
+#define __MTD_TRANS_H__
+
+#include <linux/mutex.h>
+
+struct hd_geometry;
+struct mtd_info;
+struct mtd_blktrans_ops;
+struct file;
+struct inode;
+
+struct mtd_blktrans_dev {
+ struct mtd_blktrans_ops *tr;
+ struct list_head list;
+ struct mtd_info *mtd;
+ struct mutex lock;
+ int devnum;
+ int blksize;
+ unsigned long size;
+ int readonly;
+ void *blkcore_priv;
+};
+
+struct blkcore_priv;
+
+struct mtd_blktrans_ops {
+ char *name;
+ int major;
+ int part_bits;
+
+ int (*readsect)(struct mtd_blktrans_dev *dev,
+ unsigned long block, char *buffer);
+ int (*writesect)(struct mtd_blktrans_dev *dev,
+ unsigned long block, char *buffer);
+
+ int (*getgeo)(struct mtd_blktrans_dev *dev, struct hd_geometry *geo);
+ int (*flush)(struct mtd_blktrans_dev *dev);
+
+ int (*open)(struct mtd_blktrans_dev *dev);
+ int (*release)(struct mtd_blktrans_dev *dev);
+
+ void (*add_mtd)(struct mtd_blktrans_ops *tr, struct mtd_info *mtd);
+ void (*remove_dev)(struct mtd_blktrans_dev *dev);
+
+ struct list_head devs;
+ struct list_head list;
+ struct module *owner;
+
+ struct mtd_blkcore_priv *blkcore_priv;
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/mtd/cfi.h b/ndk/platforms/android-3/include/linux/mtd/cfi.h
new file mode 100644
index 0000000..d7f1ba1
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/mtd/cfi.h
@@ -0,0 +1,187 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __MTD_CFI_H__
+#define __MTD_CFI_H__
+
+#include <linux/delay.h>
+#include <linux/types.h>
+#include <linux/interrupt.h>
+#include <linux/mtd/flashchip.h>
+#include <linux/mtd/map.h>
+#include <linux/mtd/cfi_endian.h>
+
+#define cfi_interleave_is_1(cfi) (0)
+
+#define cfi_interleave_is_2(cfi) (0)
+
+#define cfi_interleave_is_4(cfi) (0)
+
+#define cfi_interleave_is_8(cfi) (0)
+
+#define CFI_DEVICETYPE_X8 (8 / 8)
+#define CFI_DEVICETYPE_X16 (16 / 8)
+#define CFI_DEVICETYPE_X32 (32 / 8)
+#define CFI_DEVICETYPE_X64 (64 / 8)
+
+struct cfi_extquery {
+ uint8_t pri[3];
+ uint8_t MajorVersion;
+ uint8_t MinorVersion;
+} __attribute__((packed));
+
+struct cfi_pri_intelext {
+ uint8_t pri[3];
+ uint8_t MajorVersion;
+ uint8_t MinorVersion;
+ uint32_t FeatureSupport;
+ uint8_t SuspendCmdSupport;
+ uint16_t BlkStatusRegMask;
+ uint8_t VccOptimal;
+ uint8_t VppOptimal;
+ uint8_t NumProtectionFields;
+ uint16_t ProtRegAddr;
+ uint8_t FactProtRegSize;
+ uint8_t UserProtRegSize;
+ uint8_t extra[0];
+} __attribute__((packed));
+
+struct cfi_intelext_otpinfo {
+ uint32_t ProtRegAddr;
+ uint16_t FactGroups;
+ uint8_t FactProtRegSize;
+ uint16_t UserGroups;
+ uint8_t UserProtRegSize;
+} __attribute__((packed));
+
+struct cfi_intelext_blockinfo {
+ uint16_t NumIdentBlocks;
+ uint16_t BlockSize;
+ uint16_t MinBlockEraseCycles;
+ uint8_t BitsPerCell;
+ uint8_t BlockCap;
+} __attribute__((packed));
+
+struct cfi_intelext_regioninfo {
+ uint16_t NumIdentPartitions;
+ uint8_t NumOpAllowed;
+ uint8_t NumOpAllowedSimProgMode;
+ uint8_t NumOpAllowedSimEraMode;
+ uint8_t NumBlockTypes;
+ struct cfi_intelext_blockinfo BlockTypes[1];
+} __attribute__((packed));
+
+struct cfi_intelext_programming_regioninfo {
+ uint8_t ProgRegShift;
+ uint8_t Reserved1;
+ uint8_t ControlValid;
+ uint8_t Reserved2;
+ uint8_t ControlInvalid;
+ uint8_t Reserved3;
+} __attribute__((packed));
+
+struct cfi_pri_amdstd {
+ uint8_t pri[3];
+ uint8_t MajorVersion;
+ uint8_t MinorVersion;
+ uint8_t SiliconRevision;
+ uint8_t EraseSuspend;
+ uint8_t BlkProt;
+ uint8_t TmpBlkUnprotect;
+ uint8_t BlkProtUnprot;
+ uint8_t SimultaneousOps;
+ uint8_t BurstMode;
+ uint8_t PageMode;
+ uint8_t VppMin;
+ uint8_t VppMax;
+ uint8_t TopBottom;
+} __attribute__((packed));
+
+struct cfi_pri_atmel {
+ uint8_t pri[3];
+ uint8_t MajorVersion;
+ uint8_t MinorVersion;
+ uint8_t Features;
+ uint8_t BottomBoot;
+ uint8_t BurstMode;
+ uint8_t PageMode;
+} __attribute__((packed));
+
+struct cfi_pri_query {
+ uint8_t NumFields;
+ uint32_t ProtField[1];
+} __attribute__((packed));
+
+struct cfi_bri_query {
+ uint8_t PageModeReadCap;
+ uint8_t NumFields;
+ uint32_t ConfField[1];
+} __attribute__((packed));
+
+#define P_ID_NONE 0x0000
+#define P_ID_INTEL_EXT 0x0001
+#define P_ID_AMD_STD 0x0002
+#define P_ID_INTEL_STD 0x0003
+#define P_ID_AMD_EXT 0x0004
+#define P_ID_WINBOND 0x0006
+#define P_ID_ST_ADV 0x0020
+#define P_ID_MITSUBISHI_STD 0x0100
+#define P_ID_MITSUBISHI_EXT 0x0101
+#define P_ID_SST_PAGE 0x0102
+#define P_ID_INTEL_PERFORMANCE 0x0200
+#define P_ID_INTEL_DATA 0x0210
+#define P_ID_RESERVED 0xffff
+
+#define CFI_MODE_CFI 1
+#define CFI_MODE_JEDEC 0
+
+struct cfi_private {
+ uint16_t cmdset;
+ void *cmdset_priv;
+ int interleave;
+ int device_type;
+ int cfi_mode;
+ int addr_unlock1;
+ int addr_unlock2;
+ struct mtd_info *(*cmdset_setup)(struct map_info *);
+ struct cfi_ident *cfiq;
+ int mfr, id;
+ int numchips;
+ unsigned long chipshift;
+ const char *im_name;
+ struct flchip chips[0];
+};
+
+#if BITS_PER_LONG >= 64
+#endif
+#define CMD(x) cfi_build_cmd((x), map, cfi)
+#if BITS_PER_LONG >= 64
+#endif
+#define MERGESTATUS(x) cfi_merge_status((x), map, cfi)
+
+struct cfi_fixup {
+ uint16_t mfr;
+ uint16_t id;
+ void (*fixup)(struct mtd_info *mtd, void* param);
+ void* param;
+};
+
+#define CFI_MFR_ANY 0xffff
+#define CFI_ID_ANY 0xffff
+
+#define CFI_MFR_AMD 0x0001
+#define CFI_MFR_ATMEL 0x001F
+#define CFI_MFR_ST 0x0020  
+
+typedef int (*varsize_frob_t)(struct map_info *map, struct flchip *chip,
+ unsigned long adr, int len, void *thunk);
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/mtd/cfi_endian.h b/ndk/platforms/android-3/include/linux/mtd/cfi_endian.h
new file mode 100644
index 0000000..452091e
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/mtd/cfi_endian.h
@@ -0,0 +1,45 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#include <asm/byteorder.h>
+
+#define CFI_HOST_ENDIAN
+
+#ifdef CFI_LITTLE_ENDIAN
+#define cpu_to_cfi8(x) (x)
+#define cfi8_to_cpu(x) (x)
+#define cpu_to_cfi16(x) cpu_to_le16(x)
+#define cpu_to_cfi32(x) cpu_to_le32(x)
+#define cpu_to_cfi64(x) cpu_to_le64(x)
+#define cfi16_to_cpu(x) le16_to_cpu(x)
+#define cfi32_to_cpu(x) le32_to_cpu(x)
+#define cfi64_to_cpu(x) le64_to_cpu(x)
+#elif defined (CFI_BIG_ENDIAN)
+#define cpu_to_cfi8(x) (x)
+#define cfi8_to_cpu(x) (x)
+#define cpu_to_cfi16(x) cpu_to_be16(x)
+#define cpu_to_cfi32(x) cpu_to_be32(x)
+#define cpu_to_cfi64(x) cpu_to_be64(x)
+#define cfi16_to_cpu(x) be16_to_cpu(x)
+#define cfi32_to_cpu(x) be32_to_cpu(x)
+#define cfi64_to_cpu(x) be64_to_cpu(x)
+#elif defined (CFI_HOST_ENDIAN)
+#define cpu_to_cfi8(x) (x)
+#define cfi8_to_cpu(x) (x)
+#define cpu_to_cfi16(x) (x)
+#define cpu_to_cfi32(x) (x)
+#define cpu_to_cfi64(x) (x)
+#define cfi16_to_cpu(x) (x)
+#define cfi32_to_cpu(x) (x)
+#define cfi64_to_cpu(x) (x)
+#else
+#error No CFI endianness defined
+#endif
diff --git a/ndk/platforms/android-3/include/linux/mtd/compatmac.h b/ndk/platforms/android-3/include/linux/mtd/compatmac.h
new file mode 100644
index 0000000..143f46a
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/mtd/compatmac.h
@@ -0,0 +1,15 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __LINUX_MTD_COMPATMAC_H__
+#define __LINUX_MTD_COMPATMAC_H__
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/mtd/flashchip.h b/ndk/platforms/android-3/include/linux/mtd/flashchip.h
new file mode 100644
index 0000000..e441048
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/mtd/flashchip.h
@@ -0,0 +1,68 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __MTD_FLASHCHIP_H__
+#define __MTD_FLASHCHIP_H__
+
+#include <linux/sched.h>
+
+typedef enum {
+ FL_READY,
+ FL_STATUS,
+ FL_CFI_QUERY,
+ FL_JEDEC_QUERY,
+ FL_ERASING,
+ FL_ERASE_SUSPENDING,
+ FL_ERASE_SUSPENDED,
+ FL_WRITING,
+ FL_WRITING_TO_BUFFER,
+ FL_OTP_WRITE,
+ FL_WRITE_SUSPENDING,
+ FL_WRITE_SUSPENDED,
+ FL_PM_SUSPENDED,
+ FL_SYNCING,
+ FL_UNLOADING,
+ FL_LOCKING,
+ FL_UNLOCKING,
+ FL_POINT,
+ FL_XIP_WHILE_ERASING,
+ FL_XIP_WHILE_WRITING,
+ FL_UNKNOWN
+} flstate_t;
+
+struct flchip {
+ unsigned long start;
+
+ int ref_point_counter;
+ flstate_t state;
+ flstate_t oldstate;
+
+ unsigned int write_suspended:1;
+ unsigned int erase_suspended:1;
+ unsigned long in_progress_block_addr;
+
+ spinlock_t *mutex;
+ spinlock_t _spinlock;
+ wait_queue_head_t wq;
+ int word_write_time;
+ int buffer_write_time;
+ int erase_time;
+
+ void *priv;
+};
+
+struct flchip_shared {
+ spinlock_t lock;
+ struct flchip *writing;
+ struct flchip *erasing;
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/mtd/map.h b/ndk/platforms/android-3/include/linux/mtd/map.h
new file mode 100644
index 0000000..87124bc
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/mtd/map.h
@@ -0,0 +1,102 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __LINUX_MTD_MAP_H__
+#define __LINUX_MTD_MAP_H__
+
+#include <linux/types.h>
+#include <linux/list.h>
+#include <linux/string.h>
+
+#include <linux/mtd/compatmac.h>
+
+#include <asm/unaligned.h>
+#include <asm/system.h>
+#include <asm/io.h>
+
+#define map_bankwidth_is_1(map) (0)
+
+#define map_bankwidth_is_2(map) (0)
+
+#define map_bankwidth_is_4(map) (0)
+
+#define map_calc_words(map) ((map_bankwidth(map) + (sizeof(unsigned long)-1))/ sizeof(unsigned long))
+
+#define map_bankwidth_is_8(map) (0)
+
+#define map_bankwidth_is_16(map) (0)
+
+#define map_bankwidth_is_32(map) (0)
+
+#ifndef map_bankwidth
+#error "No bus width supported. What's the point?"
+#endif
+
+#define MAX_MAP_LONGS ( ((MAX_MAP_BANKWIDTH*8) + BITS_PER_LONG - 1) / BITS_PER_LONG )
+
+struct map_info {
+ char *name;
+ unsigned long size;
+ unsigned long phys;
+#define NO_XIP (-1UL)
+
+ void __iomem *virt;
+ void *cached;
+
+ int bankwidth;
+
+ void (*inval_cache)(struct map_info *, unsigned long, ssize_t);
+
+ void (*set_vpp)(struct map_info *, int);
+
+ unsigned long map_priv_1;
+ unsigned long map_priv_2;
+ void *fldrv_priv;
+ struct mtd_chip_driver *fldrv;
+};
+
+struct mtd_chip_driver {
+ struct mtd_info *(*probe)(struct map_info *map);
+ void (*destroy)(struct mtd_info *);
+ struct module *module;
+ char *name;
+ struct list_head list;
+};
+
+struct mtd_info *do_map_probe(const char *name, struct map_info *map);
+
+#define ENABLE_VPP(map) do { if(map->set_vpp) map->set_vpp(map, 1); } while(0)
+#define DISABLE_VPP(map) do { if(map->set_vpp) map->set_vpp(map, 0); } while(0)
+
+#define INVALIDATE_CACHED_RANGE(map, from, size)   do { if(map->inval_cache) map->inval_cache(map, from, size); } while(0)
+
+#define map_word_andequal(m, a, b, z) map_word_equal(m, z, map_word_and(m, a, b))
+#if BITS_PER_LONG >= 64
+#endif
+#ifdef __LITTLE_ENDIAN
+#else
+#endif
+#if BITS_PER_LONG < 64
+#define MAP_FF_LIMIT 4
+#else
+#define MAP_FF_LIMIT 8
+#endif
+#if BITS_PER_LONG >= 64
+#endif
+#if BITS_PER_LONG >= 64
+#endif
+#define map_read(map, ofs) inline_map_read(map, ofs)
+#define map_copy_from(map, to, from, len) inline_map_copy_from(map, to, from, len)
+#define map_write(map, datum, ofs) inline_map_write(map, datum, ofs)
+#define map_copy_to(map, to, from, len) inline_map_copy_to(map, to, from, len)
+#define simple_map_init(map) BUG_ON(!map_bankwidth_supported((map)->bankwidth))
+#define map_is_linear(map) ({ (void)(map); 1; })
+#endif
diff --git a/ndk/platforms/android-3/include/linux/mtd/mtd.h b/ndk/platforms/android-3/include/linux/mtd/mtd.h
new file mode 100644
index 0000000..300813c
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/mtd/mtd.h
@@ -0,0 +1,153 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __MTD_MTD_H__
+#define __MTD_MTD_H__
+
+#error This is a kernel header. Perhaps include mtd-user.h instead?
+
+#include <linux/types.h>
+#include <linux/module.h>
+#include <linux/uio.h>
+#include <linux/notifier.h>
+
+#include <linux/mtd/compatmac.h>
+#include <mtd/mtd-abi.h>
+
+#define MTD_CHAR_MAJOR 90
+#define MTD_BLOCK_MAJOR 31
+#define MAX_MTD_DEVICES 16
+
+#define MTD_ERASE_PENDING 0x01
+#define MTD_ERASING 0x02
+#define MTD_ERASE_SUSPEND 0x04
+#define MTD_ERASE_DONE 0x08
+#define MTD_ERASE_FAILED 0x10
+
+struct erase_info {
+ struct mtd_info *mtd;
+ u_int32_t addr;
+ u_int32_t len;
+ u_int32_t fail_addr;
+ u_long time;
+ u_long retries;
+ u_int dev;
+ u_int cell;
+ void (*callback) (struct erase_info *self);
+ u_long priv;
+ u_char state;
+ struct erase_info *next;
+};
+
+struct mtd_erase_region_info {
+ u_int32_t offset;
+ u_int32_t erasesize;
+ u_int32_t numblocks;
+};
+
+typedef enum {
+ MTD_OOB_PLACE,
+ MTD_OOB_AUTO,
+ MTD_OOB_RAW,
+} mtd_oob_mode_t;
+
+struct mtd_oob_ops {
+ mtd_oob_mode_t mode;
+ size_t len;
+ size_t retlen;
+ size_t ooblen;
+ uint32_t ooboffs;
+ uint8_t *datbuf;
+ uint8_t *oobbuf;
+};
+
+struct mtd_info {
+ u_char type;
+ u_int32_t flags;
+ u_int32_t size;
+
+ u_int32_t erasesize;
+
+ u_int32_t writesize;
+
+ u_int32_t oobsize;
+ u_int32_t ecctype;
+ u_int32_t eccsize;
+
+#define MTD_PROGREGION_CTRLMODE_VALID(mtd) (mtd)->oobsize
+#define MTD_PROGREGION_CTRLMODE_INVALID(mtd) (mtd)->ecctype
+
+ char *name;
+ int index;
+
+ struct nand_ecclayout *ecclayout;
+
+ int numeraseregions;
+ struct mtd_erase_region_info *eraseregions;
+
+ u_int32_t bank_size;
+
+ int (*erase) (struct mtd_info *mtd, struct erase_info *instr);
+
+ int (*point) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char **mtdbuf);
+
+ void (*unpoint) (struct mtd_info *mtd, u_char * addr, loff_t from, size_t len);
+
+ int (*read) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf);
+ int (*write) (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf);
+
+ int (*read_oob) (struct mtd_info *mtd, loff_t from,
+ struct mtd_oob_ops *ops);
+ int (*write_oob) (struct mtd_info *mtd, loff_t to,
+ struct mtd_oob_ops *ops);
+
+ int (*get_fact_prot_info) (struct mtd_info *mtd, struct otp_info *buf, size_t len);
+ int (*read_fact_prot_reg) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf);
+ int (*get_user_prot_info) (struct mtd_info *mtd, struct otp_info *buf, size_t len);
+ int (*read_user_prot_reg) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf);
+ int (*write_user_prot_reg) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf);
+ int (*lock_user_prot_reg) (struct mtd_info *mtd, loff_t from, size_t len);
+
+ int (*writev) (struct mtd_info *mtd, const struct kvec *vecs, unsigned long count, loff_t to, size_t *retlen);
+
+ void (*sync) (struct mtd_info *mtd);
+
+ int (*lock) (struct mtd_info *mtd, loff_t ofs, size_t len);
+ int (*unlock) (struct mtd_info *mtd, loff_t ofs, size_t len);
+
+ int (*suspend) (struct mtd_info *mtd);
+ void (*resume) (struct mtd_info *mtd);
+
+ int (*block_isbad) (struct mtd_info *mtd, loff_t ofs);
+ int (*block_markbad) (struct mtd_info *mtd, loff_t ofs);
+
+ struct notifier_block reboot_notifier;
+
+ struct mtd_ecc_stats ecc_stats;
+
+ void *priv;
+
+ struct module *owner;
+ int usecount;
+};
+
+struct mtd_notifier {
+ void (*add)(struct mtd_info *mtd);
+ void (*remove)(struct mtd_info *mtd);
+ struct list_head list;
+};
+
+#define MTD_DEBUG_LEVEL0 (0)  
+#define MTD_DEBUG_LEVEL1 (1)  
+#define MTD_DEBUG_LEVEL2 (2)  
+#define MTD_DEBUG_LEVEL3 (3)  
+#define DEBUG(n, args...) do { } while(0)
+#endif
diff --git a/ndk/platforms/android-3/include/linux/mtd/nand.h b/ndk/platforms/android-3/include/linux/mtd/nand.h
new file mode 100644
index 0000000..36e9fb4
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/mtd/nand.h
@@ -0,0 +1,319 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __LINUX_MTD_NAND_H
+#define __LINUX_MTD_NAND_H
+
+#include <linux/wait.h>
+#include <linux/spinlock.h>
+#include <linux/mtd/mtd.h>
+
+struct mtd_info;
+
+#define NAND_MAX_CHIPS 8
+
+#define NAND_MAX_OOBSIZE 64
+#define NAND_MAX_PAGESIZE 2048
+
+#define NAND_NCE 0x01
+
+#define NAND_CLE 0x02
+
+#define NAND_ALE 0x04
+
+#define NAND_CTRL_CLE (NAND_NCE | NAND_CLE)
+#define NAND_CTRL_ALE (NAND_NCE | NAND_ALE)
+#define NAND_CTRL_CHANGE 0x80
+
+#define NAND_CMD_READ0 0
+#define NAND_CMD_READ1 1
+#define NAND_CMD_RNDOUT 5
+#define NAND_CMD_PAGEPROG 0x10
+#define NAND_CMD_READOOB 0x50
+#define NAND_CMD_ERASE1 0x60
+#define NAND_CMD_STATUS 0x70
+#define NAND_CMD_STATUS_MULTI 0x71
+#define NAND_CMD_SEQIN 0x80
+#define NAND_CMD_RNDIN 0x85
+#define NAND_CMD_READID 0x90
+#define NAND_CMD_ERASE2 0xd0
+#define NAND_CMD_RESET 0xff
+
+#define NAND_CMD_READSTART 0x30
+#define NAND_CMD_RNDOUTSTART 0xE0
+#define NAND_CMD_CACHEDPROG 0x15
+
+#define NAND_CMD_DEPLETE1 0x100
+#define NAND_CMD_DEPLETE2 0x38
+#define NAND_CMD_STATUS_MULTI 0x71
+#define NAND_CMD_STATUS_ERROR 0x72
+
+#define NAND_CMD_STATUS_ERROR0 0x73
+#define NAND_CMD_STATUS_ERROR1 0x74
+#define NAND_CMD_STATUS_ERROR2 0x75
+#define NAND_CMD_STATUS_ERROR3 0x76
+#define NAND_CMD_STATUS_RESET 0x7f
+#define NAND_CMD_STATUS_CLEAR 0xff
+
+#define NAND_CMD_NONE -1
+
+#define NAND_STATUS_FAIL 0x01
+#define NAND_STATUS_FAIL_N1 0x02
+#define NAND_STATUS_TRUE_READY 0x20
+#define NAND_STATUS_READY 0x40
+#define NAND_STATUS_WP 0x80
+
+typedef enum {
+ NAND_ECC_NONE,
+ NAND_ECC_SOFT,
+ NAND_ECC_HW,
+ NAND_ECC_HW_SYNDROME,
+} nand_ecc_modes_t;
+
+#define NAND_ECC_READ 0
+
+#define NAND_ECC_WRITE 1
+
+#define NAND_ECC_READSYN 2
+
+#define NAND_GET_DEVICE 0x80
+
+#define NAND_NO_AUTOINCR 0x00000001
+
+#define NAND_BUSWIDTH_16 0x00000002
+
+#define NAND_NO_PADDING 0x00000004
+
+#define NAND_CACHEPRG 0x00000008
+
+#define NAND_COPYBACK 0x00000010
+
+#define NAND_IS_AND 0x00000020
+
+#define NAND_4PAGE_ARRAY 0x00000040
+
+#define BBT_AUTO_REFRESH 0x00000080
+
+#define NAND_NO_READRDY 0x00000100
+
+#define NAND_SAMSUNG_LP_OPTIONS   (NAND_NO_PADDING | NAND_CACHEPRG | NAND_COPYBACK)
+
+#define NAND_CANAUTOINCR(chip) (!(chip->options & NAND_NO_AUTOINCR))
+#define NAND_MUST_PAD(chip) (!(chip->options & NAND_NO_PADDING))
+#define NAND_HAS_CACHEPROG(chip) ((chip->options & NAND_CACHEPRG))
+#define NAND_HAS_COPYBACK(chip) ((chip->options & NAND_COPYBACK))
+
+#define NAND_CHIPOPTIONS_MSK (0x0000ffff & ~NAND_NO_AUTOINCR)
+
+#define NAND_USE_FLASH_BBT 0x00010000
+
+#define NAND_SKIP_BBTSCAN 0x00020000
+
+#define NAND_CONTROLLER_ALLOC 0x80000000
+
+typedef enum {
+ FL_READY,
+ FL_READING,
+ FL_WRITING,
+ FL_ERASING,
+ FL_SYNCING,
+ FL_CACHEDPRG,
+ FL_PM_SUSPENDED,
+} nand_state_t;
+
+struct nand_chip;
+
+struct nand_hw_control {
+ spinlock_t lock;
+ struct nand_chip *active;
+ wait_queue_head_t wq;
+};
+
+struct nand_ecc_ctrl {
+ nand_ecc_modes_t mode;
+ int steps;
+ int size;
+ int bytes;
+ int total;
+ int prepad;
+ int postpad;
+ struct nand_ecclayout *layout;
+ void (*hwctl)(struct mtd_info *mtd, int mode);
+ int (*calculate)(struct mtd_info *mtd,
+ const uint8_t *dat,
+ uint8_t *ecc_code);
+ int (*correct)(struct mtd_info *mtd, uint8_t *dat,
+ uint8_t *read_ecc,
+ uint8_t *calc_ecc);
+ int (*read_page)(struct mtd_info *mtd,
+ struct nand_chip *chip,
+ uint8_t *buf);
+ void (*write_page)(struct mtd_info *mtd,
+ struct nand_chip *chip,
+ const uint8_t *buf);
+ int (*read_oob)(struct mtd_info *mtd,
+ struct nand_chip *chip,
+ int page,
+ int sndcmd);
+ int (*write_oob)(struct mtd_info *mtd,
+ struct nand_chip *chip,
+ int page);
+};
+
+struct nand_buffers {
+ uint8_t ecccalc[NAND_MAX_OOBSIZE];
+ uint8_t ecccode[NAND_MAX_OOBSIZE];
+ uint8_t oobwbuf[NAND_MAX_OOBSIZE];
+ uint8_t databuf[NAND_MAX_PAGESIZE];
+ uint8_t oobrbuf[NAND_MAX_OOBSIZE];
+};
+
+struct nand_chip {
+ void __iomem *IO_ADDR_R;
+ void __iomem *IO_ADDR_W;
+
+ uint8_t (*read_byte)(struct mtd_info *mtd);
+ u16 (*read_word)(struct mtd_info *mtd);
+ void (*write_buf)(struct mtd_info *mtd, const uint8_t *buf, int len);
+ void (*read_buf)(struct mtd_info *mtd, uint8_t *buf, int len);
+ int (*verify_buf)(struct mtd_info *mtd, const uint8_t *buf, int len);
+ void (*select_chip)(struct mtd_info *mtd, int chip);
+ int (*block_bad)(struct mtd_info *mtd, loff_t ofs, int getchip);
+ int (*block_markbad)(struct mtd_info *mtd, loff_t ofs);
+ void (*cmd_ctrl)(struct mtd_info *mtd, int dat,
+ unsigned int ctrl);
+ int (*dev_ready)(struct mtd_info *mtd);
+ void (*cmdfunc)(struct mtd_info *mtd, unsigned command, int column, int page_addr);
+ int (*waitfunc)(struct mtd_info *mtd, struct nand_chip *this);
+ void (*erase_cmd)(struct mtd_info *mtd, int page);
+ int (*scan_bbt)(struct mtd_info *mtd);
+ int (*errstat)(struct mtd_info *mtd, struct nand_chip *this, int state, int status, int page);
+
+ int chip_delay;
+ unsigned int options;
+
+ int page_shift;
+ int phys_erase_shift;
+ int bbt_erase_shift;
+ int chip_shift;
+ int numchips;
+ unsigned long chipsize;
+ int pagemask;
+ int pagebuf;
+ int badblockpos;
+
+ nand_state_t state;
+
+ uint8_t *oob_poi;
+ struct nand_hw_control *controller;
+ struct nand_ecclayout *ecclayout;
+
+ struct nand_ecc_ctrl ecc;
+ struct nand_buffers buffers;
+ struct nand_hw_control hwcontrol;
+
+ struct mtd_oob_ops ops;
+
+ uint8_t *bbt;
+ struct nand_bbt_descr *bbt_td;
+ struct nand_bbt_descr *bbt_md;
+
+ struct nand_bbt_descr *badblock_pattern;
+
+ void *priv;
+};
+
+#define NAND_MFR_TOSHIBA 0x98
+#define NAND_MFR_SAMSUNG 0xec
+#define NAND_MFR_FUJITSU 0x04
+#define NAND_MFR_NATIONAL 0x8f
+#define NAND_MFR_RENESAS 0x07
+#define NAND_MFR_STMICRO 0x20
+#define NAND_MFR_HYNIX 0xad
+
+struct nand_flash_dev {
+ char *name;
+ int id;
+ unsigned long pagesize;
+ unsigned long chipsize;
+ unsigned long erasesize;
+ unsigned long options;
+};
+
+struct nand_manufacturers {
+ int id;
+ char * name;
+};
+
+struct nand_bbt_descr {
+ int options;
+ int pages[NAND_MAX_CHIPS];
+ int offs;
+ int veroffs;
+ uint8_t version[NAND_MAX_CHIPS];
+ int len;
+ int maxblocks;
+ int reserved_block_code;
+ uint8_t *pattern;
+};
+
+#define NAND_BBT_NRBITS_MSK 0x0000000F
+#define NAND_BBT_1BIT 0x00000001
+#define NAND_BBT_2BIT 0x00000002
+#define NAND_BBT_4BIT 0x00000004
+#define NAND_BBT_8BIT 0x00000008
+
+#define NAND_BBT_LASTBLOCK 0x00000010
+
+#define NAND_BBT_ABSPAGE 0x00000020
+
+#define NAND_BBT_SEARCH 0x00000040
+
+#define NAND_BBT_PERCHIP 0x00000080
+
+#define NAND_BBT_VERSION 0x00000100
+
+#define NAND_BBT_CREATE 0x00000200
+
+#define NAND_BBT_SCANALLPAGES 0x00000400
+
+#define NAND_BBT_SCANEMPTY 0x00000800
+
+#define NAND_BBT_WRITE 0x00001000
+
+#define NAND_BBT_SAVECONTENT 0x00002000
+
+#define NAND_BBT_SCAN2NDPAGE 0x00004000
+
+#define NAND_BBT_SCAN_MAXBLOCKS 4
+
+#define NAND_SMALL_BADBLOCK_POS 5
+#define NAND_LARGE_BADBLOCK_POS 0
+
+struct platform_nand_chip {
+ int nr_chips;
+ int chip_offset;
+ int nr_partitions;
+ struct mtd_partition *partitions;
+ struct nand_ecclayout *ecclayout;
+ int chip_delay;
+ unsigned int options;
+ void *priv;
+};
+
+struct platform_nand_ctrl {
+ void (*hwcontrol)(struct mtd_info *mtd, int cmd);
+ int (*dev_ready)(struct mtd_info *mtd);
+ void (*select_chip)(struct mtd_info *mtd, int chip);
+ void *priv;
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/mtd/nand_ecc.h b/ndk/platforms/android-3/include/linux/mtd/nand_ecc.h
new file mode 100644
index 0000000..3e817f4
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/mtd/nand_ecc.h
@@ -0,0 +1,17 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __MTD_NAND_ECC_H__
+#define __MTD_NAND_ECC_H__
+
+struct mtd_info;
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/mtd/nftl.h b/ndk/platforms/android-3/include/linux/mtd/nftl.h
new file mode 100644
index 0000000..da7320e
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/mtd/nftl.h
@@ -0,0 +1,55 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __MTD_NFTL_H__
+#define __MTD_NFTL_H__
+
+#include <linux/mtd/mtd.h>
+#include <linux/mtd/blktrans.h>
+
+#include <mtd/nftl-user.h>
+
+#define BLOCK_NIL 0xffff  
+#define BLOCK_FREE 0xfffe  
+#define BLOCK_NOTEXPLORED 0xfffd  
+#define BLOCK_RESERVED 0xfffc  
+
+struct NFTLrecord {
+ struct mtd_blktrans_dev mbd;
+ __u16 MediaUnit, SpareMediaUnit;
+ __u32 EraseSize;
+ struct NFTLMediaHeader MediaHdr;
+ int usecount;
+ unsigned char heads;
+ unsigned char sectors;
+ unsigned short cylinders;
+ __u16 numvunits;
+ __u16 lastEUN;
+ __u16 numfreeEUNs;
+ __u16 LastFreeEUN;
+ int head,sect,cyl;
+ __u16 *EUNtable;
+ __u16 *ReplUnitTable;
+ unsigned int nb_blocks;
+ unsigned int nb_boot_blocks;
+ struct erase_info instr;
+ struct nand_ecclayout oobinfo;
+};
+
+#ifndef NFTL_MAJOR
+#define NFTL_MAJOR 93
+#endif
+
+#define MAX_NFTLS 16
+#define MAX_SECTORS_PER_UNIT 64
+#define NFTL_PARTN_BITS 4
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/mtd/onenand_regs.h b/ndk/platforms/android-3/include/linux/mtd/onenand_regs.h
new file mode 100644
index 0000000..a39c78f
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/mtd/onenand_regs.h
@@ -0,0 +1,143 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ONENAND_REG_H
+#define __ONENAND_REG_H
+
+#define ONENAND_MEMORY_MAP(x) ((x) << 1)
+
+#define ONENAND_BOOTRAM ONENAND_MEMORY_MAP(0x0000)
+#define ONENAND_DATARAM ONENAND_MEMORY_MAP(0x0200)
+#define ONENAND_SPARERAM ONENAND_MEMORY_MAP(0x8010)
+
+#define ONENAND_REG_MANUFACTURER_ID ONENAND_MEMORY_MAP(0xF000)
+#define ONENAND_REG_DEVICE_ID ONENAND_MEMORY_MAP(0xF001)
+#define ONENAND_REG_VERSION_ID ONENAND_MEMORY_MAP(0xF002)
+#define ONENAND_REG_DATA_BUFFER_SIZE ONENAND_MEMORY_MAP(0xF003)
+#define ONENAND_REG_BOOT_BUFFER_SIZE ONENAND_MEMORY_MAP(0xF004)
+#define ONENAND_REG_NUM_BUFFERS ONENAND_MEMORY_MAP(0xF005)
+#define ONENAND_REG_TECHNOLOGY ONENAND_MEMORY_MAP(0xF006)
+
+#define ONENAND_REG_START_ADDRESS1 ONENAND_MEMORY_MAP(0xF100)
+#define ONENAND_REG_START_ADDRESS2 ONENAND_MEMORY_MAP(0xF101)
+#define ONENAND_REG_START_ADDRESS3 ONENAND_MEMORY_MAP(0xF102)
+#define ONENAND_REG_START_ADDRESS4 ONENAND_MEMORY_MAP(0xF103)
+#define ONENAND_REG_START_ADDRESS5 ONENAND_MEMORY_MAP(0xF104)
+#define ONENAND_REG_START_ADDRESS6 ONENAND_MEMORY_MAP(0xF105)
+#define ONENAND_REG_START_ADDRESS7 ONENAND_MEMORY_MAP(0xF106)
+#define ONENAND_REG_START_ADDRESS8 ONENAND_MEMORY_MAP(0xF107)
+
+#define ONENAND_REG_START_BUFFER ONENAND_MEMORY_MAP(0xF200)
+#define ONENAND_REG_COMMAND ONENAND_MEMORY_MAP(0xF220)
+#define ONENAND_REG_SYS_CFG1 ONENAND_MEMORY_MAP(0xF221)
+#define ONENAND_REG_SYS_CFG2 ONENAND_MEMORY_MAP(0xF222)
+#define ONENAND_REG_CTRL_STATUS ONENAND_MEMORY_MAP(0xF240)
+#define ONENAND_REG_INTERRUPT ONENAND_MEMORY_MAP(0xF241)
+#define ONENAND_REG_START_BLOCK_ADDRESS ONENAND_MEMORY_MAP(0xF24C)
+#define ONENAND_REG_END_BLOCK_ADDRESS ONENAND_MEMORY_MAP(0xF24D)
+#define ONENAND_REG_WP_STATUS ONENAND_MEMORY_MAP(0xF24E)
+
+#define ONENAND_REG_ECC_STATUS ONENAND_MEMORY_MAP(0xFF00)
+#define ONENAND_REG_ECC_M0 ONENAND_MEMORY_MAP(0xFF01)
+#define ONENAND_REG_ECC_S0 ONENAND_MEMORY_MAP(0xFF02)
+#define ONENAND_REG_ECC_M1 ONENAND_MEMORY_MAP(0xFF03)
+#define ONENAND_REG_ECC_S1 ONENAND_MEMORY_MAP(0xFF04)
+#define ONENAND_REG_ECC_M2 ONENAND_MEMORY_MAP(0xFF05)
+#define ONENAND_REG_ECC_S2 ONENAND_MEMORY_MAP(0xFF06)
+#define ONENAND_REG_ECC_M3 ONENAND_MEMORY_MAP(0xFF07)
+#define ONENAND_REG_ECC_S3 ONENAND_MEMORY_MAP(0xFF08)
+
+#define ONENAND_DEVICE_DENSITY_SHIFT (4)
+#define ONENAND_DEVICE_IS_DDP (1 << 3)
+#define ONENAND_DEVICE_IS_DEMUX (1 << 2)
+#define ONENAND_DEVICE_VCC_MASK (0x3)
+
+#define ONENAND_DEVICE_DENSITY_512Mb (0x002)
+
+#define ONENAND_VERSION_PROCESS_SHIFT (8)
+
+#define ONENAND_DDP_SHIFT (15)
+
+#define ONENAND_FPA_MASK (0x3f)
+#define ONENAND_FPA_SHIFT (2)
+#define ONENAND_FSA_MASK (0x03)
+
+#define ONENAND_BSA_MASK (0x03)
+#define ONENAND_BSA_SHIFT (8)
+#define ONENAND_BSA_BOOTRAM (0 << 2)
+#define ONENAND_BSA_DATARAM0 (2 << 2)
+#define ONENAND_BSA_DATARAM1 (3 << 2)
+#define ONENAND_BSC_MASK (0x03)
+
+#define ONENAND_CMD_READ (0x00)
+#define ONENAND_CMD_READOOB (0x13)
+#define ONENAND_CMD_PROG (0x80)
+#define ONENAND_CMD_PROGOOB (0x1A)
+#define ONENAND_CMD_UNLOCK (0x23)
+#define ONENAND_CMD_LOCK (0x2A)
+#define ONENAND_CMD_LOCK_TIGHT (0x2C)
+#define ONENAND_CMD_ERASE (0x94)
+#define ONENAND_CMD_RESET (0xF0)
+#define ONENAND_CMD_OTP_ACCESS (0x65)
+#define ONENAND_CMD_READID (0x90)
+
+#define ONENAND_CMD_BUFFERRAM (0x1978)
+
+#define ONENAND_SYS_CFG1_SYNC_READ (1 << 15)
+#define ONENAND_SYS_CFG1_BRL_7 (7 << 12)
+#define ONENAND_SYS_CFG1_BRL_6 (6 << 12)
+#define ONENAND_SYS_CFG1_BRL_5 (5 << 12)
+#define ONENAND_SYS_CFG1_BRL_4 (4 << 12)
+#define ONENAND_SYS_CFG1_BRL_3 (3 << 12)
+#define ONENAND_SYS_CFG1_BRL_10 (2 << 12)
+#define ONENAND_SYS_CFG1_BRL_9 (1 << 12)
+#define ONENAND_SYS_CFG1_BRL_8 (0 << 12)
+#define ONENAND_SYS_CFG1_BRL_SHIFT (12)
+#define ONENAND_SYS_CFG1_BL_32 (4 << 9)
+#define ONENAND_SYS_CFG1_BL_16 (3 << 9)
+#define ONENAND_SYS_CFG1_BL_8 (2 << 9)
+#define ONENAND_SYS_CFG1_BL_4 (1 << 9)
+#define ONENAND_SYS_CFG1_BL_CONT (0 << 9)
+#define ONENAND_SYS_CFG1_BL_SHIFT (9)
+#define ONENAND_SYS_CFG1_NO_ECC (1 << 8)
+#define ONENAND_SYS_CFG1_RDY (1 << 7)
+#define ONENAND_SYS_CFG1_INT (1 << 6)
+#define ONENAND_SYS_CFG1_IOBE (1 << 5)
+#define ONENAND_SYS_CFG1_RDY_CONF (1 << 4)
+
+#define ONENAND_CTRL_ONGO (1 << 15)
+#define ONENAND_CTRL_LOCK (1 << 14)
+#define ONENAND_CTRL_LOAD (1 << 13)
+#define ONENAND_CTRL_PROGRAM (1 << 12)
+#define ONENAND_CTRL_ERASE (1 << 11)
+#define ONENAND_CTRL_ERROR (1 << 10)
+#define ONENAND_CTRL_RSTB (1 << 7)
+#define ONENAND_CTRL_OTP_L (1 << 6)
+#define ONENAND_CTRL_OTP_BL (1 << 5)
+
+#define ONENAND_INT_MASTER (1 << 15)
+#define ONENAND_INT_READ (1 << 7)
+#define ONENAND_INT_WRITE (1 << 6)
+#define ONENAND_INT_ERASE (1 << 5)
+#define ONENAND_INT_RESET (1 << 4)
+#define ONENAND_INT_CLEAR (0 << 0)
+
+#define ONENAND_WP_US (1 << 2)
+#define ONENAND_WP_LS (1 << 1)
+#define ONENAND_WP_LTS (1 << 0)
+
+#define ONENAND_ECC_1BIT (1 << 0)
+#define ONENAND_ECC_2BIT (1 << 1)
+#define ONENAND_ECC_2BIT_ALL (0xAAAA)
+
+#define ONENAND_OTP_LOCK_OFFSET (14)
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/mtd/partitions.h b/ndk/platforms/android-3/include/linux/mtd/partitions.h
new file mode 100644
index 0000000..aeb15e1
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/mtd/partitions.h
@@ -0,0 +1,40 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef MTD_PARTITIONS_H
+#define MTD_PARTITIONS_H
+
+#include <linux/types.h>
+
+struct mtd_partition {
+ char *name;
+ u_int32_t size;
+ u_int32_t offset;
+ u_int32_t mask_flags;
+ struct nand_ecclayout *ecclayout;
+ struct mtd_info **mtdp;
+};
+
+#define MTDPART_OFS_NXTBLK (-2)
+#define MTDPART_OFS_APPEND (-1)
+#define MTDPART_SIZ_FULL (0)
+
+struct mtd_part_parser {
+ struct list_head list;
+ struct module *owner;
+ const char *name;
+ int (*parse_fn)(struct mtd_info *, struct mtd_partition **, unsigned long);
+};
+
+#define put_partition_parser(p) do { module_put((p)->owner); } while(0)
+
+#endif
+
diff --git a/ndk/platforms/android-3/include/linux/mtio.h b/ndk/platforms/android-3/include/linux/mtio.h
new file mode 100644
index 0000000..47a6e2b
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/mtio.h
@@ -0,0 +1,259 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_MTIO_H
+#define _LINUX_MTIO_H
+
+#include <linux/types.h>
+#include <linux/ioctl.h>
+#include <linux/qic117.h>
+
+struct mtop {
+ short mt_op;
+ int mt_count;
+};
+
+#define MTRESET 0  
+#define MTFSF 1  
+#define MTBSF 2  
+#define MTFSR 3  
+#define MTBSR 4  
+#define MTWEOF 5  
+#define MTREW 6  
+#define MTOFFL 7  
+#define MTNOP 8  
+#define MTRETEN 9  
+#define MTBSFM 10  
+#define MTFSFM 11  
+#define MTEOM 12  
+#define MTERASE 13  
+
+#define MTRAS1 14  
+#define MTRAS2 15  
+#define MTRAS3 16  
+
+#define MTSETBLK 20  
+#define MTSETDENSITY 21  
+#define MTSEEK 22  
+#define MTTELL 23  
+#define MTSETDRVBUFFER 24  
+
+#define MTFSS 25  
+#define MTBSS 26  
+#define MTWSM 27  
+
+#define MTLOCK 28  
+#define MTUNLOCK 29  
+#define MTLOAD 30  
+#define MTUNLOAD 31  
+#define MTCOMPRESSION 32 
+#define MTSETPART 33  
+#define MTMKPART 34  
+
+struct mtget {
+ long mt_type;
+ long mt_resid;
+
+ long mt_dsreg;
+ long mt_gstat;
+ long mt_erreg;
+
+ __kernel_daddr_t mt_fileno;
+ __kernel_daddr_t mt_blkno;
+};
+
+#define MT_ISUNKNOWN 0x01
+#define MT_ISQIC02 0x02  
+#define MT_ISWT5150 0x03  
+#define MT_ISARCHIVE_5945L2 0x04  
+#define MT_ISCMSJ500 0x05  
+#define MT_ISTDC3610 0x06  
+#define MT_ISARCHIVE_VP60I 0x07  
+#define MT_ISARCHIVE_2150L 0x08  
+#define MT_ISARCHIVE_2060L 0x09  
+#define MT_ISARCHIVESC499 0x0A  
+#define MT_ISQIC02_ALL_FEATURES 0x0F  
+#define MT_ISWT5099EEN24 0x11  
+#define MT_ISTEAC_MT2ST 0x12  
+#define MT_ISEVEREX_FT40A 0x32  
+#define MT_ISDDS1 0x51  
+#define MT_ISDDS2 0x52  
+#define MT_ISONSTREAM_SC 0x61  
+#define MT_ISSCSI1 0x71  
+#define MT_ISSCSI2 0x72  
+
+#define MT_ISFTAPE_UNKNOWN 0x800000  
+#define MT_ISFTAPE_FLAG 0x800000
+
+struct mt_tape_info {
+ long t_type;
+ char *t_name;
+};
+
+#define MT_TAPE_INFO {   {MT_ISUNKNOWN, "Unknown type of tape device"},   {MT_ISQIC02, "Generic QIC-02 tape streamer"},   {MT_ISWT5150, "Wangtek 5150, QIC-150"},   {MT_ISARCHIVE_5945L2, "Archive 5945L-2"},   {MT_ISCMSJ500, "CMS Jumbo 500"},   {MT_ISTDC3610, "Tandberg TDC 3610, QIC-24"},   {MT_ISARCHIVE_VP60I, "Archive VP60i, QIC-02"},   {MT_ISARCHIVE_2150L, "Archive Viper 2150L"},   {MT_ISARCHIVE_2060L, "Archive Viper 2060L"},   {MT_ISARCHIVESC499, "Archive SC-499 QIC-36 controller"},   {MT_ISQIC02_ALL_FEATURES, "Generic QIC-02 tape, all features"},   {MT_ISWT5099EEN24, "Wangtek 5099-een24, 60MB"},   {MT_ISTEAC_MT2ST, "Teac MT-2ST 155mb data cassette drive"},   {MT_ISEVEREX_FT40A, "Everex FT40A, QIC-40"},   {MT_ISONSTREAM_SC, "OnStream SC-, DI-, DP-, or USB tape drive"},   {MT_ISSCSI1, "Generic SCSI-1 tape"},   {MT_ISSCSI2, "Generic SCSI-2 tape"},   {0, NULL}  }
+
+struct mtpos {
+ long mt_blkno;
+};
+
+struct mtvolinfo {
+ unsigned int mt_volno;
+ unsigned int mt_blksz;
+ unsigned int mt_rawsize;
+ unsigned int mt_size;
+ unsigned int mt_cmpr:1;
+};
+
+#define MT_FT_RD_SINGLE 0
+#define MT_FT_RD_AHEAD 1
+#define MT_FT_WR_ASYNC 0  
+#define MT_FT_WR_MULTI 1  
+#define MT_FT_WR_SINGLE 2  
+#define MT_FT_WR_DELETE 3  
+
+struct mtftseg
+{
+ unsigned mt_segno;
+ unsigned mt_mode;
+ int mt_result;
+ void __user *mt_data;
+};
+
+struct mttapesize {
+ unsigned long mt_capacity;
+ unsigned long mt_used;
+};
+
+#define FTFMT_SET_PARMS 1  
+#define FTFMT_GET_PARMS 2  
+#define FTFMT_FORMAT_TRACK 3  
+#define FTFMT_STATUS 4  
+#define FTFMT_VERIFY 5  
+
+struct ftfmtparms {
+ unsigned char ft_qicstd;
+ unsigned char ft_fmtcode;
+ unsigned char ft_fhm;
+ unsigned char ft_ftm;
+ unsigned short ft_spt;
+ unsigned short ft_tpc;
+};
+
+struct ftfmttrack {
+ unsigned int ft_track;
+ unsigned char ft_gap3;
+};
+
+struct ftfmtstatus {
+ unsigned int ft_segment;
+};
+
+struct ftfmtverify {
+ unsigned int ft_segment;
+ unsigned long ft_bsm;
+};
+
+struct mtftformat {
+ unsigned int fmt_op;
+ union fmt_arg {
+ struct ftfmtparms fmt_parms;
+ struct ftfmttrack fmt_track;
+ struct ftfmtstatus fmt_status;
+ struct ftfmtverify fmt_verify;
+ } fmt_arg;
+};
+
+struct mtftcmd {
+ unsigned int ft_wait_before;
+ qic117_cmd_t ft_cmd;
+ unsigned char ft_parm_cnt;
+ unsigned char ft_parms[3];
+ unsigned int ft_result_bits;
+ unsigned int ft_result;
+ unsigned int ft_wait_after;
+ int ft_status;
+ int ft_error;
+};
+
+#define MTIOCTOP _IOW('m', 1, struct mtop)  
+#define MTIOCGET _IOR('m', 2, struct mtget)  
+#define MTIOCPOS _IOR('m', 3, struct mtpos)  
+
+#define MTIOCGETCONFIG _IOR('m', 4, struct mtconfiginfo)  
+#define MTIOCSETCONFIG _IOW('m', 5, struct mtconfiginfo)  
+
+#define MTIOCRDFTSEG _IOWR('m', 6, struct mtftseg)  
+#define MTIOCWRFTSEG _IOWR('m', 7, struct mtftseg)  
+#define MTIOCVOLINFO _IOR('m', 8, struct mtvolinfo)  
+#define MTIOCGETSIZE _IOR('m', 9, struct mttapesize) 
+#define MTIOCFTFORMAT _IOWR('m', 10, struct mtftformat)  
+#define MTIOCFTCMD _IOWR('m', 11, struct mtftcmd)  
+
+#define GMT_EOF(x) ((x) & 0x80000000)
+#define GMT_BOT(x) ((x) & 0x40000000)
+#define GMT_EOT(x) ((x) & 0x20000000)
+#define GMT_SM(x) ((x) & 0x10000000)  
+#define GMT_EOD(x) ((x) & 0x08000000)  
+#define GMT_WR_PROT(x) ((x) & 0x04000000)
+
+#define GMT_ONLINE(x) ((x) & 0x01000000)
+#define GMT_D_6250(x) ((x) & 0x00800000)
+#define GMT_D_1600(x) ((x) & 0x00400000)
+#define GMT_D_800(x) ((x) & 0x00200000)
+
+#define GMT_DR_OPEN(x) ((x) & 0x00040000)  
+
+#define GMT_IM_REP_EN(x) ((x) & 0x00010000)  
+#define GMT_CLN(x) ((x) & 0x00008000)  
+
+#define MT_ST_BLKSIZE_SHIFT 0
+#define MT_ST_BLKSIZE_MASK 0xffffff
+#define MT_ST_DENSITY_SHIFT 24
+#define MT_ST_DENSITY_MASK 0xff000000
+
+#define MT_ST_SOFTERR_SHIFT 0
+#define MT_ST_SOFTERR_MASK 0xffff
+
+#define MT_ST_OPTIONS 0xf0000000
+#define MT_ST_BOOLEANS 0x10000000
+#define MT_ST_SETBOOLEANS 0x30000000
+#define MT_ST_CLEARBOOLEANS 0x40000000
+#define MT_ST_WRITE_THRESHOLD 0x20000000
+#define MT_ST_DEF_BLKSIZE 0x50000000
+#define MT_ST_DEF_OPTIONS 0x60000000
+#define MT_ST_TIMEOUTS 0x70000000
+#define MT_ST_SET_TIMEOUT (MT_ST_TIMEOUTS | 0x000000)
+#define MT_ST_SET_LONG_TIMEOUT (MT_ST_TIMEOUTS | 0x100000)
+#define MT_ST_SET_CLN 0x80000000
+
+#define MT_ST_BUFFER_WRITES 0x1
+#define MT_ST_ASYNC_WRITES 0x2
+#define MT_ST_READ_AHEAD 0x4
+#define MT_ST_DEBUGGING 0x8
+#define MT_ST_TWO_FM 0x10
+#define MT_ST_FAST_MTEOM 0x20
+#define MT_ST_AUTO_LOCK 0x40
+#define MT_ST_DEF_WRITES 0x80
+#define MT_ST_CAN_BSR 0x100
+#define MT_ST_NO_BLKLIMS 0x200
+#define MT_ST_CAN_PARTITIONS 0x400
+#define MT_ST_SCSI2LOGICAL 0x800
+#define MT_ST_SYSV 0x1000
+#define MT_ST_NOWAIT 0x2000
+
+#define MT_ST_CLEAR_DEFAULT 0xfffff
+#define MT_ST_DEF_DENSITY (MT_ST_DEF_OPTIONS | 0x100000)
+#define MT_ST_DEF_COMPRESSION (MT_ST_DEF_OPTIONS | 0x200000)
+#define MT_ST_DEF_DRVBUFFER (MT_ST_DEF_OPTIONS | 0x300000)
+
+#define MT_ST_HPLOADER_OFFSET 10000
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/mutex-debug.h b/ndk/platforms/android-3/include/linux/mutex-debug.h
new file mode 100644
index 0000000..7065610
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/mutex-debug.h
@@ -0,0 +1,22 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __LINUX_MUTEX_DEBUG_H
+#define __LINUX_MUTEX_DEBUG_H
+
+#include <linux/linkage.h>
+#include <linux/lockdep.h>
+
+#define __DEBUG_MUTEX_INITIALIZER(lockname)   , .magic = &lockname
+
+#define mutex_init(mutex)  do {   static struct lock_class_key __key;     __mutex_init((mutex), #mutex, &__key);  } while (0)
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/mutex.h b/ndk/platforms/android-3/include/linux/mutex.h
new file mode 100644
index 0000000..4b33a8a
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/mutex.h
@@ -0,0 +1,46 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __LINUX_MUTEX_H
+#define __LINUX_MUTEX_H
+
+#include <linux/list.h>
+#include <linux/spinlock_types.h>
+#include <linux/linkage.h>
+#include <linux/lockdep.h>
+
+#include <asm/atomic.h>
+
+struct mutex {
+
+ atomic_t count;
+ spinlock_t wait_lock;
+ struct list_head wait_list;
+};
+
+struct mutex_waiter {
+ struct list_head list;
+ struct task_struct *task;
+};
+
+#define __DEBUG_MUTEX_INITIALIZER(lockname)
+#define mutex_init(mutex)  do {   static struct lock_class_key __key;     __mutex_init((mutex), #mutex, &__key);  } while (0)
+#define mutex_destroy(mutex) do { } while (0)
+
+#define __DEP_MAP_MUTEX_INITIALIZER(lockname)
+
+#define __MUTEX_INITIALIZER(lockname)   { .count = ATOMIC_INIT(1)   , .wait_lock = SPIN_LOCK_UNLOCKED   , .wait_list = LIST_HEAD_INIT(lockname.wait_list)   __DEBUG_MUTEX_INITIALIZER(lockname)   __DEP_MAP_MUTEX_INITIALIZER(lockname) }
+
+#define DEFINE_MUTEX(mutexname)   struct mutex mutexname = __MUTEX_INITIALIZER(mutexname)
+
+#define mutex_lock_nested(lock, subclass) mutex_lock(lock)
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/ncp.h b/ndk/platforms/android-3/include/linux/ncp.h
new file mode 100644
index 0000000..091220a
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/ncp.h
@@ -0,0 +1,193 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_NCP_H
+#define _LINUX_NCP_H
+
+#include <linux/types.h>
+
+#define NCP_PTYPE (0x11)
+#define NCP_PORT (0x0451)
+
+#define NCP_ALLOC_SLOT_REQUEST (0x1111)
+#define NCP_REQUEST (0x2222)
+#define NCP_DEALLOC_SLOT_REQUEST (0x5555)
+
+struct ncp_request_header {
+ __u16 type;
+ __u8 sequence;
+ __u8 conn_low;
+ __u8 task;
+ __u8 conn_high;
+ __u8 function;
+ __u8 data[0];
+} __attribute__((packed));
+
+#define NCP_REPLY (0x3333)
+#define NCP_WATCHDOG (0x3E3E)
+#define NCP_POSITIVE_ACK (0x9999)
+
+struct ncp_reply_header {
+ __u16 type;
+ __u8 sequence;
+ __u8 conn_low;
+ __u8 task;
+ __u8 conn_high;
+ __u8 completion_code;
+ __u8 connection_state;
+ __u8 data[0];
+} __attribute__((packed));
+
+#define NCP_VOLNAME_LEN (16)
+#define NCP_NUMBER_OF_VOLUMES (256)
+struct ncp_volume_info {
+ __u32 total_blocks;
+ __u32 free_blocks;
+ __u32 purgeable_blocks;
+ __u32 not_yet_purgeable_blocks;
+ __u32 total_dir_entries;
+ __u32 available_dir_entries;
+ __u8 sectors_per_block;
+ char volume_name[NCP_VOLNAME_LEN + 1];
+};
+
+#define AR_READ (cpu_to_le16(1))
+#define AR_WRITE (cpu_to_le16(2))
+#define AR_EXCLUSIVE (cpu_to_le16(0x20))
+
+#define NCP_FILE_ID_LEN 6
+
+#define NW_NS_DOS 0
+#define NW_NS_MAC 1
+#define NW_NS_NFS 2
+#define NW_NS_FTAM 3
+#define NW_NS_OS2 4
+
+#define RIM_NAME (cpu_to_le32(1))
+#define RIM_SPACE_ALLOCATED (cpu_to_le32(2))
+#define RIM_ATTRIBUTES (cpu_to_le32(4))
+#define RIM_DATA_SIZE (cpu_to_le32(8))
+#define RIM_TOTAL_SIZE (cpu_to_le32(0x10))
+#define RIM_EXT_ATTR_INFO (cpu_to_le32(0x20))
+#define RIM_ARCHIVE (cpu_to_le32(0x40))
+#define RIM_MODIFY (cpu_to_le32(0x80))
+#define RIM_CREATION (cpu_to_le32(0x100))
+#define RIM_OWNING_NAMESPACE (cpu_to_le32(0x200))
+#define RIM_DIRECTORY (cpu_to_le32(0x400))
+#define RIM_RIGHTS (cpu_to_le32(0x800))
+#define RIM_ALL (cpu_to_le32(0xFFF))
+#define RIM_COMPRESSED_INFO (cpu_to_le32(0x80000000))
+
+#define NSIBM_NFS_NAME 0x0001
+#define NSIBM_NFS_MODE 0x0002
+#define NSIBM_NFS_GID 0x0004
+#define NSIBM_NFS_NLINKS 0x0008
+#define NSIBM_NFS_RDEV 0x0010
+#define NSIBM_NFS_LINK 0x0020
+#define NSIBM_NFS_CREATED 0x0040
+#define NSIBM_NFS_UID 0x0080
+#define NSIBM_NFS_ACSFLAG 0x0100
+#define NSIBM_NFS_MYFLAG 0x0200
+
+#define OC_MODE_OPEN 0x01
+#define OC_MODE_TRUNCATE 0x02
+#define OC_MODE_REPLACE 0x02
+#define OC_MODE_CREATE 0x08
+
+#define OC_ACTION_NONE 0x00
+#define OC_ACTION_OPEN 0x01
+#define OC_ACTION_CREATE 0x02
+#define OC_ACTION_TRUNCATE 0x04
+#define OC_ACTION_REPLACE 0x04
+
+#ifndef AR_READ_ONLY
+#define AR_READ_ONLY 0x0001
+#define AR_WRITE_ONLY 0x0002
+#define AR_DENY_READ 0x0004
+#define AR_DENY_WRITE 0x0008
+#define AR_COMPATIBILITY 0x0010
+#define AR_WRITE_THROUGH 0x0040
+#define AR_OPEN_COMPRESSED 0x0100
+#endif
+
+struct nw_nfs_info {
+ __u32 mode;
+ __u32 rdev;
+};
+
+struct nw_info_struct {
+ __u32 spaceAlloc;
+ __le32 attributes;
+ __u16 flags;
+ __le32 dataStreamSize;
+ __le32 totalStreamSize;
+ __u16 numberOfStreams;
+ __le16 creationTime;
+ __le16 creationDate;
+ __u32 creatorID;
+ __le16 modifyTime;
+ __le16 modifyDate;
+ __u32 modifierID;
+ __le16 lastAccessDate;
+ __u16 archiveTime;
+ __u16 archiveDate;
+ __u32 archiverID;
+ __u16 inheritedRightsMask;
+ __le32 dirEntNum;
+ __le32 DosDirNum;
+ __u32 volNumber;
+ __u32 EADataSize;
+ __u32 EAKeyCount;
+ __u32 EAKeySize;
+ __u32 NSCreator;
+ __u8 nameLen;
+ __u8 entryName[256];
+
+} __attribute__((packed));
+
+#define DM_ATTRIBUTES (cpu_to_le32(0x02))
+#define DM_CREATE_DATE (cpu_to_le32(0x04))
+#define DM_CREATE_TIME (cpu_to_le32(0x08))
+#define DM_CREATOR_ID (cpu_to_le32(0x10))
+#define DM_ARCHIVE_DATE (cpu_to_le32(0x20))
+#define DM_ARCHIVE_TIME (cpu_to_le32(0x40))
+#define DM_ARCHIVER_ID (cpu_to_le32(0x80))
+#define DM_MODIFY_DATE (cpu_to_le32(0x0100))
+#define DM_MODIFY_TIME (cpu_to_le32(0x0200))
+#define DM_MODIFIER_ID (cpu_to_le32(0x0400))
+#define DM_LAST_ACCESS_DATE (cpu_to_le32(0x0800))
+#define DM_INHERITED_RIGHTS_MASK (cpu_to_le32(0x1000))
+#define DM_MAXIMUM_SPACE (cpu_to_le32(0x2000))
+
+struct nw_modify_dos_info {
+ __le32 attributes;
+ __le16 creationDate;
+ __le16 creationTime;
+ __u32 creatorID;
+ __le16 modifyDate;
+ __le16 modifyTime;
+ __u32 modifierID;
+ __u16 archiveDate;
+ __u16 archiveTime;
+ __u32 archiverID;
+ __le16 lastAccessDate;
+ __u16 inheritanceGrantMask;
+ __u16 inheritanceRevokeMask;
+ __u32 maximumSpace;
+} __attribute__((packed));
+
+struct nw_search_sequence {
+ __u8 volNumber;
+ __u32 dirBase;
+ __u32 sequence;
+} __attribute__((packed));
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/ncp_mount.h b/ndk/platforms/android-3/include/linux/ncp_mount.h
new file mode 100644
index 0000000..204869f
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/ncp_mount.h
@@ -0,0 +1,69 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_NCP_MOUNT_H
+#define _LINUX_NCP_MOUNT_H
+
+#include <linux/types.h>
+#include <linux/ncp.h>
+
+#define NCP_MOUNT_VERSION 3  
+
+#define NCP_MOUNT_SOFT 0x0001
+#define NCP_MOUNT_INTR 0x0002
+#define NCP_MOUNT_STRONG 0x0004  
+#define NCP_MOUNT_NO_OS2 0x0008  
+#define NCP_MOUNT_NO_NFS 0x0010  
+#define NCP_MOUNT_EXTRAS 0x0020
+#define NCP_MOUNT_SYMLINKS 0x0040  
+#define NCP_MOUNT_NFS_EXTRAS 0x0080  
+
+struct ncp_mount_data {
+ int version;
+ unsigned int ncp_fd;
+ __kernel_uid_t mounted_uid;
+ __kernel_pid_t wdog_pid;
+
+ unsigned char mounted_vol[NCP_VOLNAME_LEN + 1];
+ unsigned int time_out;
+ unsigned int retry_count;
+ unsigned int flags;
+
+ __kernel_uid_t uid;
+ __kernel_gid_t gid;
+ __kernel_mode_t file_mode;
+ __kernel_mode_t dir_mode;
+};
+
+#define NCP_MOUNT_VERSION_V4 (4)  
+
+struct ncp_mount_data_v4 {
+ int version;
+ unsigned long flags;
+
+ unsigned long mounted_uid;
+
+ long wdog_pid;
+
+ unsigned int ncp_fd;
+ unsigned int time_out;
+ unsigned int retry_count;
+
+ unsigned long uid;
+ unsigned long gid;
+
+ unsigned long file_mode;
+ unsigned long dir_mode;
+};
+
+#define NCP_MOUNT_VERSION_V5 (5)  
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/ncp_no.h b/ndk/platforms/android-3/include/linux/ncp_no.h
new file mode 100644
index 0000000..9afed68
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/ncp_no.h
@@ -0,0 +1,29 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _NCP_NO
+#define _NCP_NO
+
+#define aRONLY (__constant_cpu_to_le32(1))
+#define aHIDDEN (__constant_cpu_to_le32(2))
+#define aSYSTEM (__constant_cpu_to_le32(4))
+#define aEXECUTE (__constant_cpu_to_le32(8))
+#define aDIR (__constant_cpu_to_le32(0x10))
+#define aARCH (__constant_cpu_to_le32(0x20))
+#define aSHARED (__constant_cpu_to_le32(0x80))
+#define aDONTSUBALLOCATE (__constant_cpu_to_le32(1L<<11))
+#define aTRANSACTIONAL (__constant_cpu_to_le32(1L<<12))
+#define aPURGE (__constant_cpu_to_le32(1L<<16))
+#define aRENAMEINHIBIT (__constant_cpu_to_le32(1L<<17))
+#define aDELETEINHIBIT (__constant_cpu_to_le32(1L<<18))
+#define aDONTCOMPRESS (__constant_cpu_to_le32(1L<<27))
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/net.h b/ndk/platforms/android-3/include/linux/net.h
new file mode 100644
index 0000000..29fca2c
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/net.h
@@ -0,0 +1,51 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_NET_H
+#define _LINUX_NET_H
+
+#include <linux/wait.h>
+#include <asm/socket.h>
+
+struct poll_table_struct;
+struct inode;
+
+#define NPROTO 32  
+
+#define SYS_SOCKET 1  
+#define SYS_BIND 2  
+#define SYS_CONNECT 3  
+#define SYS_LISTEN 4  
+#define SYS_ACCEPT 5  
+#define SYS_GETSOCKNAME 6  
+#define SYS_GETPEERNAME 7  
+#define SYS_SOCKETPAIR 8  
+#define SYS_SEND 9  
+#define SYS_RECV 10  
+#define SYS_SENDTO 11  
+#define SYS_RECVFROM 12  
+#define SYS_SHUTDOWN 13  
+#define SYS_SETSOCKOPT 14  
+#define SYS_GETSOCKOPT 15  
+#define SYS_SENDMSG 16  
+#define SYS_RECVMSG 17  
+
+typedef enum {
+ SS_FREE = 0,
+ SS_UNCONNECTED,
+ SS_CONNECTING,
+ SS_CONNECTED,
+ SS_DISCONNECTING
+} socket_state;
+
+#define __SO_ACCEPTCON (1 << 16)  
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netdevice.h b/ndk/platforms/android-3/include/linux/netdevice.h
new file mode 100644
index 0000000..54b58f1
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netdevice.h
@@ -0,0 +1,69 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_NETDEVICE_H
+#define _LINUX_NETDEVICE_H
+
+#include <linux/if.h>
+#include <linux/if_ether.h>
+#include <linux/if_packet.h>
+
+#define MAX_ADDR_LEN 32  
+
+#define NETDEV_TX_OK 0  
+#define NETDEV_TX_BUSY 1  
+#define NETDEV_TX_LOCKED -1  
+
+#define LL_MAX_HEADER 32
+
+#define MAX_HEADER LL_MAX_HEADER
+
+struct net_device_stats
+{
+ unsigned long rx_packets;
+ unsigned long tx_packets;
+ unsigned long rx_bytes;
+ unsigned long tx_bytes;
+ unsigned long rx_errors;
+ unsigned long tx_errors;
+ unsigned long rx_dropped;
+ unsigned long tx_dropped;
+ unsigned long multicast;
+ unsigned long collisions;
+
+ unsigned long rx_length_errors;
+ unsigned long rx_over_errors;
+ unsigned long rx_crc_errors;
+ unsigned long rx_frame_errors;
+ unsigned long rx_fifo_errors;
+ unsigned long rx_missed_errors;
+
+ unsigned long tx_aborted_errors;
+ unsigned long tx_carrier_errors;
+ unsigned long tx_fifo_errors;
+ unsigned long tx_heartbeat_errors;
+ unsigned long tx_window_errors;
+
+ unsigned long rx_compressed;
+ unsigned long tx_compressed;
+};
+
+enum {
+ IF_PORT_UNKNOWN = 0,
+ IF_PORT_10BASE2,
+ IF_PORT_10BASET,
+ IF_PORT_AUI,
+ IF_PORT_100BASET,
+ IF_PORT_100BASETX,
+ IF_PORT_100BASEFX
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter.h b/ndk/platforms/android-3/include/linux/netfilter.h
new file mode 100644
index 0000000..0488344
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter.h
@@ -0,0 +1,36 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __LINUX_NETFILTER_H
+#define __LINUX_NETFILTER_H
+
+#include <linux/compiler.h>
+
+#define NF_DROP 0
+#define NF_ACCEPT 1
+#define NF_STOLEN 2
+#define NF_QUEUE 3
+#define NF_REPEAT 4
+#define NF_STOP 5
+#define NF_MAX_VERDICT NF_STOP
+
+#define NF_VERDICT_MASK 0x0000ffff
+#define NF_VERDICT_BITS 16
+
+#define NF_VERDICT_QMASK 0xffff0000
+#define NF_VERDICT_QBITS 16
+
+#define NF_QUEUE_NR(x) (((x << NF_VERDICT_QBITS) & NF_VERDICT_QMASK) | NF_QUEUE)
+
+#define NFC_UNKNOWN 0x4000
+#define NFC_ALTERED 0x8000
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter/nf_conntrack_common.h b/ndk/platforms/android-3/include/linux/netfilter/nf_conntrack_common.h
new file mode 100644
index 0000000..69177fc
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter/nf_conntrack_common.h
@@ -0,0 +1,114 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _NF_CONNTRACK_COMMON_H
+#define _NF_CONNTRACK_COMMON_H
+
+enum ip_conntrack_info
+{
+
+ IP_CT_ESTABLISHED,
+
+ IP_CT_RELATED,
+
+ IP_CT_NEW,
+
+ IP_CT_IS_REPLY,
+
+ IP_CT_NUMBER = IP_CT_IS_REPLY * 2 - 1
+};
+
+enum ip_conntrack_status {
+
+ IPS_EXPECTED_BIT = 0,
+ IPS_EXPECTED = (1 << IPS_EXPECTED_BIT),
+
+ IPS_SEEN_REPLY_BIT = 1,
+ IPS_SEEN_REPLY = (1 << IPS_SEEN_REPLY_BIT),
+
+ IPS_ASSURED_BIT = 2,
+ IPS_ASSURED = (1 << IPS_ASSURED_BIT),
+
+ IPS_CONFIRMED_BIT = 3,
+ IPS_CONFIRMED = (1 << IPS_CONFIRMED_BIT),
+
+ IPS_SRC_NAT_BIT = 4,
+ IPS_SRC_NAT = (1 << IPS_SRC_NAT_BIT),
+
+ IPS_DST_NAT_BIT = 5,
+ IPS_DST_NAT = (1 << IPS_DST_NAT_BIT),
+
+ IPS_NAT_MASK = (IPS_DST_NAT | IPS_SRC_NAT),
+
+ IPS_SEQ_ADJUST_BIT = 6,
+ IPS_SEQ_ADJUST = (1 << IPS_SEQ_ADJUST_BIT),
+
+ IPS_SRC_NAT_DONE_BIT = 7,
+ IPS_SRC_NAT_DONE = (1 << IPS_SRC_NAT_DONE_BIT),
+
+ IPS_DST_NAT_DONE_BIT = 8,
+ IPS_DST_NAT_DONE = (1 << IPS_DST_NAT_DONE_BIT),
+
+ IPS_NAT_DONE_MASK = (IPS_DST_NAT_DONE | IPS_SRC_NAT_DONE),
+
+ IPS_DYING_BIT = 9,
+ IPS_DYING = (1 << IPS_DYING_BIT),
+
+ IPS_FIXED_TIMEOUT_BIT = 10,
+ IPS_FIXED_TIMEOUT = (1 << IPS_FIXED_TIMEOUT_BIT),
+};
+
+enum ip_conntrack_events
+{
+
+ IPCT_NEW_BIT = 0,
+ IPCT_NEW = (1 << IPCT_NEW_BIT),
+
+ IPCT_RELATED_BIT = 1,
+ IPCT_RELATED = (1 << IPCT_RELATED_BIT),
+
+ IPCT_DESTROY_BIT = 2,
+ IPCT_DESTROY = (1 << IPCT_DESTROY_BIT),
+
+ IPCT_REFRESH_BIT = 3,
+ IPCT_REFRESH = (1 << IPCT_REFRESH_BIT),
+
+ IPCT_STATUS_BIT = 4,
+ IPCT_STATUS = (1 << IPCT_STATUS_BIT),
+
+ IPCT_PROTOINFO_BIT = 5,
+ IPCT_PROTOINFO = (1 << IPCT_PROTOINFO_BIT),
+
+ IPCT_PROTOINFO_VOLATILE_BIT = 6,
+ IPCT_PROTOINFO_VOLATILE = (1 << IPCT_PROTOINFO_VOLATILE_BIT),
+
+ IPCT_HELPER_BIT = 7,
+ IPCT_HELPER = (1 << IPCT_HELPER_BIT),
+
+ IPCT_HELPINFO_BIT = 8,
+ IPCT_HELPINFO = (1 << IPCT_HELPINFO_BIT),
+
+ IPCT_HELPINFO_VOLATILE_BIT = 9,
+ IPCT_HELPINFO_VOLATILE = (1 << IPCT_HELPINFO_VOLATILE_BIT),
+
+ IPCT_NATINFO_BIT = 10,
+ IPCT_NATINFO = (1 << IPCT_NATINFO_BIT),
+
+ IPCT_COUNTER_FILLING_BIT = 11,
+ IPCT_COUNTER_FILLING = (1 << IPCT_COUNTER_FILLING_BIT),
+};
+
+enum ip_conntrack_expect_events {
+ IPEXP_NEW_BIT = 0,
+ IPEXP_NEW = (1 << IPEXP_NEW_BIT),
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter/nf_conntrack_ftp.h b/ndk/platforms/android-3/include/linux/netfilter/nf_conntrack_ftp.h
new file mode 100644
index 0000000..ff815a7
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter/nf_conntrack_ftp.h
@@ -0,0 +1,27 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _NF_CONNTRACK_FTP_H
+#define _NF_CONNTRACK_FTP_H
+
+enum ip_ct_ftp_type
+{
+
+ IP_CT_FTP_PORT,
+
+ IP_CT_FTP_PASV,
+
+ IP_CT_FTP_EPRT,
+
+ IP_CT_FTP_EPSV,
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter/nf_conntrack_sctp.h b/ndk/platforms/android-3/include/linux/netfilter/nf_conntrack_sctp.h
new file mode 100644
index 0000000..15768b2
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter/nf_conntrack_sctp.h
@@ -0,0 +1,37 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _NF_CONNTRACK_SCTP_H
+#define _NF_CONNTRACK_SCTP_H
+
+#include <linux/netfilter/nf_conntrack_tuple_common.h>
+
+enum sctp_conntrack {
+ SCTP_CONNTRACK_NONE,
+ SCTP_CONNTRACK_CLOSED,
+ SCTP_CONNTRACK_COOKIE_WAIT,
+ SCTP_CONNTRACK_COOKIE_ECHOED,
+ SCTP_CONNTRACK_ESTABLISHED,
+ SCTP_CONNTRACK_SHUTDOWN_SENT,
+ SCTP_CONNTRACK_SHUTDOWN_RECD,
+ SCTP_CONNTRACK_SHUTDOWN_ACK_SENT,
+ SCTP_CONNTRACK_MAX
+};
+
+struct ip_ct_sctp
+{
+ enum sctp_conntrack state;
+
+ u_int32_t vtag[IP_CT_DIR_MAX];
+ u_int32_t ttag[IP_CT_DIR_MAX];
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter/nf_conntrack_tcp.h b/ndk/platforms/android-3/include/linux/netfilter/nf_conntrack_tcp.h
new file mode 100644
index 0000000..227f902
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter/nf_conntrack_tcp.h
@@ -0,0 +1,36 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _NF_CONNTRACK_TCP_H
+#define _NF_CONNTRACK_TCP_H
+
+enum tcp_conntrack {
+ TCP_CONNTRACK_NONE,
+ TCP_CONNTRACK_SYN_SENT,
+ TCP_CONNTRACK_SYN_RECV,
+ TCP_CONNTRACK_ESTABLISHED,
+ TCP_CONNTRACK_FIN_WAIT,
+ TCP_CONNTRACK_CLOSE_WAIT,
+ TCP_CONNTRACK_LAST_ACK,
+ TCP_CONNTRACK_TIME_WAIT,
+ TCP_CONNTRACK_CLOSE,
+ TCP_CONNTRACK_LISTEN,
+ TCP_CONNTRACK_MAX,
+ TCP_CONNTRACK_IGNORE
+};
+
+#define IP_CT_TCP_FLAG_WINDOW_SCALE 0x01
+
+#define IP_CT_TCP_FLAG_SACK_PERM 0x02
+
+#define IP_CT_TCP_FLAG_CLOSE_INIT 0x03
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter/nf_conntrack_tuple_common.h b/ndk/platforms/android-3/include/linux/netfilter/nf_conntrack_tuple_common.h
new file mode 100644
index 0000000..f282543
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter/nf_conntrack_tuple_common.h
@@ -0,0 +1,24 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _NF_CONNTRACK_TUPLE_COMMON_H
+#define _NF_CONNTRACK_TUPLE_COMMON_H
+
+enum ip_conntrack_dir
+{
+ IP_CT_DIR_ORIGINAL,
+ IP_CT_DIR_REPLY,
+ IP_CT_DIR_MAX
+};
+
+#define CTINFO2DIR(ctinfo) ((ctinfo) >= IP_CT_IS_REPLY ? IP_CT_DIR_REPLY : IP_CT_DIR_ORIGINAL)
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter/nfnetlink.h b/ndk/platforms/android-3/include/linux/netfilter/nfnetlink.h
new file mode 100644
index 0000000..4544cab
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter/nfnetlink.h
@@ -0,0 +1,84 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _NFNETLINK_H
+#define _NFNETLINK_H
+#include <linux/types.h>
+
+#define NF_NETLINK_CONNTRACK_NEW 0x00000001
+#define NF_NETLINK_CONNTRACK_UPDATE 0x00000002
+#define NF_NETLINK_CONNTRACK_DESTROY 0x00000004
+#define NF_NETLINK_CONNTRACK_EXP_NEW 0x00000008
+#define NF_NETLINK_CONNTRACK_EXP_UPDATE 0x00000010
+#define NF_NETLINK_CONNTRACK_EXP_DESTROY 0x00000020
+
+enum nfnetlink_groups {
+ NFNLGRP_NONE,
+#define NFNLGRP_NONE NFNLGRP_NONE
+ NFNLGRP_CONNTRACK_NEW,
+#define NFNLGRP_CONNTRACK_NEW NFNLGRP_CONNTRACK_NEW
+ NFNLGRP_CONNTRACK_UPDATE,
+#define NFNLGRP_CONNTRACK_UPDATE NFNLGRP_CONNTRACK_UPDATE
+ NFNLGRP_CONNTRACK_DESTROY,
+#define NFNLGRP_CONNTRACK_DESTROY NFNLGRP_CONNTRACK_DESTROY
+ NFNLGRP_CONNTRACK_EXP_NEW,
+#define NFNLGRP_CONNTRACK_EXP_NEW NFNLGRP_CONNTRACK_EXP_NEW
+ NFNLGRP_CONNTRACK_EXP_UPDATE,
+#define NFNLGRP_CONNTRACK_EXP_UPDATE NFNLGRP_CONNTRACK_EXP_UPDATE
+ NFNLGRP_CONNTRACK_EXP_DESTROY,
+#define NFNLGRP_CONNTRACK_EXP_DESTROY NFNLGRP_CONNTRACK_EXP_DESTROY
+ __NFNLGRP_MAX,
+};
+#define NFNLGRP_MAX (__NFNLGRP_MAX - 1)
+
+struct nfattr
+{
+ u_int16_t nfa_len;
+ u_int16_t nfa_type;
+} __attribute__ ((packed));
+
+#define NFNL_NFA_NEST 0x8000
+#define NFA_TYPE(attr) ((attr)->nfa_type & 0x7fff)
+
+#define NFA_ALIGNTO 4
+#define NFA_ALIGN(len) (((len) + NFA_ALIGNTO - 1) & ~(NFA_ALIGNTO - 1))
+#define NFA_OK(nfa,len) ((len) > 0 && (nfa)->nfa_len >= sizeof(struct nfattr)   && (nfa)->nfa_len <= (len))
+#define NFA_NEXT(nfa,attrlen) ((attrlen) -= NFA_ALIGN((nfa)->nfa_len),   (struct nfattr *)(((char *)(nfa)) + NFA_ALIGN((nfa)->nfa_len)))
+#define NFA_LENGTH(len) (NFA_ALIGN(sizeof(struct nfattr)) + (len))
+#define NFA_SPACE(len) NFA_ALIGN(NFA_LENGTH(len))
+#define NFA_DATA(nfa) ((void *)(((char *)(nfa)) + NFA_LENGTH(0)))
+#define NFA_PAYLOAD(nfa) ((int)((nfa)->nfa_len) - NFA_LENGTH(0))
+#define NFA_NEST(skb, type)  ({ struct nfattr *__start = (struct nfattr *) (skb)->tail;   NFA_PUT(skb, (NFNL_NFA_NEST | type), 0, NULL);   __start; })
+#define NFA_NEST_END(skb, start)  ({ (start)->nfa_len = ((skb)->tail - (unsigned char *) (start));   (skb)->len; })
+#define NFA_NEST_CANCEL(skb, start)  ({ if (start)   skb_trim(skb, (unsigned char *) (start) - (skb)->data);   -1; })
+
+struct nfgenmsg {
+ u_int8_t nfgen_family;
+ u_int8_t version;
+ u_int16_t res_id;
+} __attribute__ ((packed));
+
+#define NFNETLINK_V0 0
+
+#define NFM_NFA(n) ((struct nfattr *)(((char *)(n))   + NLMSG_ALIGN(sizeof(struct nfgenmsg))))
+#define NFM_PAYLOAD(n) NLMSG_PAYLOAD(n, sizeof(struct nfgenmsg))
+
+#define NFNL_SUBSYS_ID(x) ((x & 0xff00) >> 8)
+#define NFNL_MSG_TYPE(x) (x & 0x00ff)
+
+#define NFNL_SUBSYS_NONE 0
+#define NFNL_SUBSYS_CTNETLINK 1
+#define NFNL_SUBSYS_CTNETLINK_EXP 2
+#define NFNL_SUBSYS_QUEUE 3
+#define NFNL_SUBSYS_ULOG 4
+#define NFNL_SUBSYS_COUNT 5
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter/nfnetlink_conntrack.h b/ndk/platforms/android-3/include/linux/netfilter/nfnetlink_conntrack.h
new file mode 100644
index 0000000..105dd09
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter/nfnetlink_conntrack.h
@@ -0,0 +1,146 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _IPCONNTRACK_NETLINK_H
+#define _IPCONNTRACK_NETLINK_H
+#include <linux/netfilter/nfnetlink.h>
+
+enum cntl_msg_types {
+ IPCTNL_MSG_CT_NEW,
+ IPCTNL_MSG_CT_GET,
+ IPCTNL_MSG_CT_DELETE,
+ IPCTNL_MSG_CT_GET_CTRZERO,
+
+ IPCTNL_MSG_MAX
+};
+
+enum ctnl_exp_msg_types {
+ IPCTNL_MSG_EXP_NEW,
+ IPCTNL_MSG_EXP_GET,
+ IPCTNL_MSG_EXP_DELETE,
+
+ IPCTNL_MSG_EXP_MAX
+};
+
+enum ctattr_type {
+ CTA_UNSPEC,
+ CTA_TUPLE_ORIG,
+ CTA_TUPLE_REPLY,
+ CTA_STATUS,
+ CTA_PROTOINFO,
+ CTA_HELP,
+ CTA_NAT_SRC,
+#define CTA_NAT CTA_NAT_SRC  
+ CTA_TIMEOUT,
+ CTA_MARK,
+ CTA_COUNTERS_ORIG,
+ CTA_COUNTERS_REPLY,
+ CTA_USE,
+ CTA_ID,
+ CTA_NAT_DST,
+ __CTA_MAX
+};
+#define CTA_MAX (__CTA_MAX - 1)
+
+enum ctattr_tuple {
+ CTA_TUPLE_UNSPEC,
+ CTA_TUPLE_IP,
+ CTA_TUPLE_PROTO,
+ __CTA_TUPLE_MAX
+};
+#define CTA_TUPLE_MAX (__CTA_TUPLE_MAX - 1)
+
+enum ctattr_ip {
+ CTA_IP_UNSPEC,
+ CTA_IP_V4_SRC,
+ CTA_IP_V4_DST,
+ CTA_IP_V6_SRC,
+ CTA_IP_V6_DST,
+ __CTA_IP_MAX
+};
+#define CTA_IP_MAX (__CTA_IP_MAX - 1)
+
+enum ctattr_l4proto {
+ CTA_PROTO_UNSPEC,
+ CTA_PROTO_NUM,
+ CTA_PROTO_SRC_PORT,
+ CTA_PROTO_DST_PORT,
+ CTA_PROTO_ICMP_ID,
+ CTA_PROTO_ICMP_TYPE,
+ CTA_PROTO_ICMP_CODE,
+ CTA_PROTO_ICMPV6_ID,
+ CTA_PROTO_ICMPV6_TYPE,
+ CTA_PROTO_ICMPV6_CODE,
+ __CTA_PROTO_MAX
+};
+#define CTA_PROTO_MAX (__CTA_PROTO_MAX - 1)
+
+enum ctattr_protoinfo {
+ CTA_PROTOINFO_UNSPEC,
+ CTA_PROTOINFO_TCP,
+ __CTA_PROTOINFO_MAX
+};
+#define CTA_PROTOINFO_MAX (__CTA_PROTOINFO_MAX - 1)
+
+enum ctattr_protoinfo_tcp {
+ CTA_PROTOINFO_TCP_UNSPEC,
+ CTA_PROTOINFO_TCP_STATE,
+ __CTA_PROTOINFO_TCP_MAX
+};
+#define CTA_PROTOINFO_TCP_MAX (__CTA_PROTOINFO_TCP_MAX - 1)
+
+enum ctattr_counters {
+ CTA_COUNTERS_UNSPEC,
+ CTA_COUNTERS_PACKETS,
+ CTA_COUNTERS_BYTES,
+ CTA_COUNTERS32_PACKETS,
+ CTA_COUNTERS32_BYTES,
+ __CTA_COUNTERS_MAX
+};
+#define CTA_COUNTERS_MAX (__CTA_COUNTERS_MAX - 1)
+
+enum ctattr_nat {
+ CTA_NAT_UNSPEC,
+ CTA_NAT_MINIP,
+ CTA_NAT_MAXIP,
+ CTA_NAT_PROTO,
+ __CTA_NAT_MAX
+};
+#define CTA_NAT_MAX (__CTA_NAT_MAX - 1)
+
+enum ctattr_protonat {
+ CTA_PROTONAT_UNSPEC,
+ CTA_PROTONAT_PORT_MIN,
+ CTA_PROTONAT_PORT_MAX,
+ __CTA_PROTONAT_MAX
+};
+#define CTA_PROTONAT_MAX (__CTA_PROTONAT_MAX - 1)
+
+enum ctattr_expect {
+ CTA_EXPECT_UNSPEC,
+ CTA_EXPECT_MASTER,
+ CTA_EXPECT_TUPLE,
+ CTA_EXPECT_MASK,
+ CTA_EXPECT_TIMEOUT,
+ CTA_EXPECT_ID,
+ CTA_EXPECT_HELP_NAME,
+ __CTA_EXPECT_MAX
+};
+#define CTA_EXPECT_MAX (__CTA_EXPECT_MAX - 1)
+
+enum ctattr_help {
+ CTA_HELP_UNSPEC,
+ CTA_HELP_NAME,
+ __CTA_HELP_MAX
+};
+#define CTA_HELP_MAX (__CTA_HELP_MAX - 1)
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter/x_tables.h b/ndk/platforms/android-3/include/linux/netfilter/x_tables.h
new file mode 100644
index 0000000..234181f
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter/x_tables.h
@@ -0,0 +1,125 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _X_TABLES_H
+#define _X_TABLES_H
+
+#define XT_FUNCTION_MAXNAMELEN 30
+#define XT_TABLE_MAXNAMELEN 32
+
+struct xt_entry_match
+{
+ union {
+ struct {
+ u_int16_t match_size;
+
+ char name[XT_FUNCTION_MAXNAMELEN-1];
+
+ u_int8_t revision;
+ } user;
+ struct {
+ u_int16_t match_size;
+
+ struct xt_match *match;
+ } kernel;
+
+ u_int16_t match_size;
+ } u;
+
+ unsigned char data[0];
+};
+
+struct xt_entry_target
+{
+ union {
+ struct {
+ u_int16_t target_size;
+
+ char name[XT_FUNCTION_MAXNAMELEN-1];
+
+ u_int8_t revision;
+ } user;
+ struct {
+ u_int16_t target_size;
+
+ struct xt_target *target;
+ } kernel;
+
+ u_int16_t target_size;
+ } u;
+
+ unsigned char data[0];
+};
+
+struct xt_standard_target
+{
+ struct xt_entry_target target;
+ int verdict;
+};
+
+struct xt_get_revision
+{
+ char name[XT_FUNCTION_MAXNAMELEN-1];
+
+ u_int8_t revision;
+};
+
+#define XT_CONTINUE 0xFFFFFFFF
+
+#define XT_RETURN (-NF_REPEAT - 1)
+
+struct _xt_align
+{
+ u_int8_t u8;
+ u_int16_t u16;
+ u_int32_t u32;
+ u_int64_t u64;
+};
+
+#define XT_ALIGN(s) (((s) + (__alignof__(struct _xt_align)-1))   & ~(__alignof__(struct _xt_align)-1))
+
+#define XT_STANDARD_TARGET ""
+
+#define XT_ERROR_TARGET "ERROR"
+
+#define XT_BASE_CTL 64  
+
+#define XT_SO_SET_REPLACE (XT_BASE_CTL)
+#define XT_SO_SET_ADD_COUNTERS (XT_BASE_CTL + 1)
+#define XT_SO_SET_MAX XT_SO_SET_ADD_COUNTERS
+
+#define XT_SO_GET_INFO (XT_BASE_CTL)
+#define XT_SO_GET_ENTRIES (XT_BASE_CTL + 1)
+#define XT_SO_GET_REVISION_MATCH (XT_BASE_CTL + 2)
+#define XT_SO_GET_REVISION_TARGET (XT_BASE_CTL + 3)
+#define XT_SO_GET_MAX XT_SO_GET_REVISION_TARGET
+
+#define SET_COUNTER(c,b,p) do { (c).bcnt = (b); (c).pcnt = (p); } while(0)
+#define ADD_COUNTER(c,b,p) do { (c).bcnt += (b); (c).pcnt += (p); } while(0)
+
+struct xt_counters
+{
+ u_int64_t pcnt, bcnt;
+};
+
+struct xt_counters_info
+{
+
+ char name[XT_TABLE_MAXNAMELEN];
+
+ unsigned int num_counters;
+
+ struct xt_counters counters[0];
+};
+
+#define XT_INV_PROTO 0x40  
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter/xt_CLASSIFY.h b/ndk/platforms/android-3/include/linux/netfilter/xt_CLASSIFY.h
new file mode 100644
index 0000000..1e9f61e
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter/xt_CLASSIFY.h
@@ -0,0 +1,19 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _XT_CLASSIFY_H
+#define _XT_CLASSIFY_H
+
+struct xt_classify_target_info {
+ u_int32_t priority;
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter/xt_CONNSECMARK.h b/ndk/platforms/android-3/include/linux/netfilter/xt_CONNSECMARK.h
new file mode 100644
index 0000000..5e16b2e
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter/xt_CONNSECMARK.h
@@ -0,0 +1,24 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _XT_CONNSECMARK_H_target
+#define _XT_CONNSECMARK_H_target
+
+enum {
+ CONNSECMARK_SAVE = 1,
+ CONNSECMARK_RESTORE,
+};
+
+struct xt_connsecmark_target_info {
+ u_int8_t mode;
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter/xt_NFQUEUE.h b/ndk/platforms/android-3/include/linux/netfilter/xt_NFQUEUE.h
new file mode 100644
index 0000000..1f0cacb
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter/xt_NFQUEUE.h
@@ -0,0 +1,19 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _XT_NFQ_TARGET_H
+#define _XT_NFQ_TARGET_H
+
+struct xt_NFQ_info {
+ u_int16_t queuenum;
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter/xt_SECMARK.h b/ndk/platforms/android-3/include/linux/netfilter/xt_SECMARK.h
new file mode 100644
index 0000000..a91d32c
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter/xt_SECMARK.h
@@ -0,0 +1,30 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _XT_SECMARK_H_target
+#define _XT_SECMARK_H_target
+
+#define SECMARK_MODE_SEL 0x01  
+#define SECMARK_SELCTX_MAX 256
+
+struct xt_secmark_target_selinux_info {
+ u_int32_t selsid;
+ char selctx[SECMARK_SELCTX_MAX];
+};
+
+struct xt_secmark_target_info {
+ u_int8_t mode;
+ union {
+ struct xt_secmark_target_selinux_info sel;
+ } u;
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter/xt_comment.h b/ndk/platforms/android-3/include/linux/netfilter/xt_comment.h
new file mode 100644
index 0000000..6ea26fc
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter/xt_comment.h
@@ -0,0 +1,21 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _XT_COMMENT_H
+#define _XT_COMMENT_H
+
+#define XT_MAX_COMMENT_LEN 256
+
+struct xt_comment_info {
+ unsigned char comment[XT_MAX_COMMENT_LEN];
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter/xt_connbytes.h b/ndk/platforms/android-3/include/linux/netfilter/xt_connbytes.h
new file mode 100644
index 0000000..8cc80e1
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter/xt_connbytes.h
@@ -0,0 +1,36 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _XT_CONNBYTES_H
+#define _XT_CONNBYTES_H
+
+enum xt_connbytes_what {
+ XT_CONNBYTES_PKTS,
+ XT_CONNBYTES_BYTES,
+ XT_CONNBYTES_AVGPKT,
+};
+
+enum xt_connbytes_direction {
+ XT_CONNBYTES_DIR_ORIGINAL,
+ XT_CONNBYTES_DIR_REPLY,
+ XT_CONNBYTES_DIR_BOTH,
+};
+
+struct xt_connbytes_info
+{
+ struct {
+ aligned_u64 from;
+ aligned_u64 to;
+ } count;
+ u_int8_t what;
+ u_int8_t direction;
+};
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter/xt_conntrack.h b/ndk/platforms/android-3/include/linux/netfilter/xt_conntrack.h
new file mode 100644
index 0000000..aa9bde2
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter/xt_conntrack.h
@@ -0,0 +1,66 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _XT_CONNTRACK_H
+#define _XT_CONNTRACK_H
+
+#include <linux/netfilter/nf_conntrack_tuple_common.h>
+#include <linux/in.h>
+
+#define XT_CONNTRACK_STATE_BIT(ctinfo) (1 << ((ctinfo)%IP_CT_IS_REPLY+1))
+#define XT_CONNTRACK_STATE_INVALID (1 << 0)
+
+#define XT_CONNTRACK_STATE_SNAT (1 << (IP_CT_NUMBER + 1))
+#define XT_CONNTRACK_STATE_DNAT (1 << (IP_CT_NUMBER + 2))
+#define XT_CONNTRACK_STATE_UNTRACKED (1 << (IP_CT_NUMBER + 3))
+
+#define XT_CONNTRACK_STATE 0x01
+#define XT_CONNTRACK_PROTO 0x02
+#define XT_CONNTRACK_ORIGSRC 0x04
+#define XT_CONNTRACK_ORIGDST 0x08
+#define XT_CONNTRACK_REPLSRC 0x10
+#define XT_CONNTRACK_REPLDST 0x20
+#define XT_CONNTRACK_STATUS 0x40
+#define XT_CONNTRACK_EXPIRES 0x80
+
+struct ip_conntrack_old_tuple
+{
+ struct {
+ __u32 ip;
+ union {
+ __u16 all;
+ } u;
+ } src;
+
+ struct {
+ __u32 ip;
+ union {
+ __u16 all;
+ } u;
+
+ __u16 protonum;
+ } dst;
+};
+
+struct xt_conntrack_info
+{
+ unsigned int statemask, statusmask;
+
+ struct ip_conntrack_old_tuple tuple[IP_CT_DIR_MAX];
+ struct in_addr sipmsk[IP_CT_DIR_MAX], dipmsk[IP_CT_DIR_MAX];
+
+ unsigned long expires_min, expires_max;
+
+ u_int8_t flags;
+
+ u_int8_t invflags;
+};
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter/xt_dccp.h b/ndk/platforms/android-3/include/linux/netfilter/xt_dccp.h
new file mode 100644
index 0000000..8a10e67
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter/xt_dccp.h
@@ -0,0 +1,34 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _XT_DCCP_H_
+#define _XT_DCCP_H_
+
+#define XT_DCCP_SRC_PORTS 0x01
+#define XT_DCCP_DEST_PORTS 0x02
+#define XT_DCCP_TYPE 0x04
+#define XT_DCCP_OPTION 0x08
+
+#define XT_DCCP_VALID_FLAGS 0x0f
+
+struct xt_dccp_info {
+ u_int16_t dpts[2];
+ u_int16_t spts[2];
+
+ u_int16_t flags;
+ u_int16_t invflags;
+
+ u_int16_t typemask;
+ u_int8_t option;
+};
+
+#endif
+
diff --git a/ndk/platforms/android-3/include/linux/netfilter/xt_esp.h b/ndk/platforms/android-3/include/linux/netfilter/xt_esp.h
new file mode 100644
index 0000000..175c47e
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter/xt_esp.h
@@ -0,0 +1,24 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _XT_ESP_H
+#define _XT_ESP_H
+
+struct xt_esp
+{
+ u_int32_t spis[2];
+ u_int8_t invflags;
+};
+
+#define XT_ESP_INV_SPI 0x01  
+#define XT_ESP_INV_MASK 0x01  
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter/xt_helper.h b/ndk/platforms/android-3/include/linux/netfilter/xt_helper.h
new file mode 100644
index 0000000..6ffa451
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter/xt_helper.h
@@ -0,0 +1,19 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _XT_HELPER_H
+#define _XT_HELPER_H
+
+struct xt_helper_info {
+ int invert;
+ char name[30];
+};
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter/xt_length.h b/ndk/platforms/android-3/include/linux/netfilter/xt_length.h
new file mode 100644
index 0000000..12db6c7
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter/xt_length.h
@@ -0,0 +1,20 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _XT_LENGTH_H
+#define _XT_LENGTH_H
+
+struct xt_length_info {
+ u_int16_t min, max;
+ u_int8_t invert;
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter/xt_limit.h b/ndk/platforms/android-3/include/linux/netfilter/xt_limit.h
new file mode 100644
index 0000000..f9fb37f
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter/xt_limit.h
@@ -0,0 +1,27 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _XT_RATE_H
+#define _XT_RATE_H
+
+#define XT_LIMIT_SCALE 10000
+
+struct xt_rateinfo {
+ u_int32_t avg;
+ u_int32_t burst;
+
+ unsigned long prev;
+ u_int32_t credit;
+ u_int32_t credit_cap, cost;
+
+ struct xt_rateinfo *master;
+};
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter/xt_mac.h b/ndk/platforms/android-3/include/linux/netfilter/xt_mac.h
new file mode 100644
index 0000000..2473aab
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter/xt_mac.h
@@ -0,0 +1,19 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _XT_MAC_H
+#define _XT_MAC_H
+
+struct xt_mac_info {
+ unsigned char srcaddr[ETH_ALEN];
+ int invert;
+};
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter/xt_multiport.h b/ndk/platforms/android-3/include/linux/netfilter/xt_multiport.h
new file mode 100644
index 0000000..f17979a
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter/xt_multiport.h
@@ -0,0 +1,40 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _XT_MULTIPORT_H
+#define _XT_MULTIPORT_H
+
+enum xt_multiport_flags
+{
+ XT_MULTIPORT_SOURCE,
+ XT_MULTIPORT_DESTINATION,
+ XT_MULTIPORT_EITHER
+};
+
+#define XT_MULTI_PORTS 15
+
+struct xt_multiport
+{
+ u_int8_t flags;
+ u_int8_t count;
+ u_int16_t ports[XT_MULTI_PORTS];
+};
+
+struct xt_multiport_v1
+{
+ u_int8_t flags;
+ u_int8_t count;
+ u_int16_t ports[XT_MULTI_PORTS];
+ u_int8_t pflags[XT_MULTI_PORTS];
+ u_int8_t invert;
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter/xt_physdev.h b/ndk/platforms/android-3/include/linux/netfilter/xt_physdev.h
new file mode 100644
index 0000000..d0ca032
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter/xt_physdev.h
@@ -0,0 +1,31 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _XT_PHYSDEV_H
+#define _XT_PHYSDEV_H
+
+#define XT_PHYSDEV_OP_IN 0x01
+#define XT_PHYSDEV_OP_OUT 0x02
+#define XT_PHYSDEV_OP_BRIDGED 0x04
+#define XT_PHYSDEV_OP_ISIN 0x08
+#define XT_PHYSDEV_OP_ISOUT 0x10
+#define XT_PHYSDEV_OP_MASK (0x20 - 1)
+
+struct xt_physdev_info {
+ char physindev[IFNAMSIZ];
+ char in_mask[IFNAMSIZ];
+ char physoutdev[IFNAMSIZ];
+ char out_mask[IFNAMSIZ];
+ u_int8_t invert;
+ u_int8_t bitmask;
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter/xt_pkttype.h b/ndk/platforms/android-3/include/linux/netfilter/xt_pkttype.h
new file mode 100644
index 0000000..32527b8
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter/xt_pkttype.h
@@ -0,0 +1,19 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _XT_PKTTYPE_H
+#define _XT_PKTTYPE_H
+
+struct xt_pkttype_info {
+ int pkttype;
+ int invert;
+};
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter/xt_quota.h b/ndk/platforms/android-3/include/linux/netfilter/xt_quota.h
new file mode 100644
index 0000000..d34752d
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter/xt_quota.h
@@ -0,0 +1,27 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _XT_QUOTA_H
+#define _XT_QUOTA_H
+
+enum xt_quota_flags {
+ XT_QUOTA_INVERT = 0x1,
+};
+#define XT_QUOTA_MASK 0x1
+
+struct xt_quota_info {
+ u_int32_t flags;
+ u_int32_t pad;
+ aligned_u64 quota;
+ struct xt_quota_info *master;
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter/xt_realm.h b/ndk/platforms/android-3/include/linux/netfilter/xt_realm.h
new file mode 100644
index 0000000..1a2a3cf
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter/xt_realm.h
@@ -0,0 +1,21 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _XT_REALM_H
+#define _XT_REALM_H
+
+struct xt_realm_info {
+ u_int32_t id;
+ u_int32_t mask;
+ u_int8_t invert;
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter/xt_sctp.h b/ndk/platforms/android-3/include/linux/netfilter/xt_sctp.h
new file mode 100644
index 0000000..f79c3b6
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter/xt_sctp.h
@@ -0,0 +1,68 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _XT_SCTP_H_
+#define _XT_SCTP_H_
+
+#define XT_SCTP_SRC_PORTS 0x01
+#define XT_SCTP_DEST_PORTS 0x02
+#define XT_SCTP_CHUNK_TYPES 0x04
+
+#define XT_SCTP_VALID_FLAGS 0x07
+
+#define ELEMCOUNT(x) (sizeof(x)/sizeof(x[0]))
+
+struct xt_sctp_flag_info {
+ u_int8_t chunktype;
+ u_int8_t flag;
+ u_int8_t flag_mask;
+};
+
+#define XT_NUM_SCTP_FLAGS 4
+
+struct xt_sctp_info {
+ u_int16_t dpts[2];
+ u_int16_t spts[2];
+
+ u_int32_t chunkmap[256 / sizeof (u_int32_t)];
+
+#define SCTP_CHUNK_MATCH_ANY 0x01  
+#define SCTP_CHUNK_MATCH_ALL 0x02  
+#define SCTP_CHUNK_MATCH_ONLY 0x04  
+
+ u_int32_t chunk_match_type;
+ struct xt_sctp_flag_info flag_info[XT_NUM_SCTP_FLAGS];
+ int flag_count;
+
+ u_int32_t flags;
+ u_int32_t invflags;
+};
+
+#define bytes(type) (sizeof(type) * 8)
+
+#define SCTP_CHUNKMAP_SET(chunkmap, type)   do {   chunkmap[type / bytes(u_int32_t)] |=   1 << (type % bytes(u_int32_t));   } while (0)
+
+#define SCTP_CHUNKMAP_CLEAR(chunkmap, type)   do {   chunkmap[type / bytes(u_int32_t)] &=   ~(1 << (type % bytes(u_int32_t)));   } while (0)
+
+#define SCTP_CHUNKMAP_IS_SET(chunkmap, type)  ({   (chunkmap[type / bytes (u_int32_t)] &   (1 << (type % bytes (u_int32_t)))) ? 1: 0;  })
+
+#define SCTP_CHUNKMAP_RESET(chunkmap)   do {   int i;   for (i = 0; i < ELEMCOUNT(chunkmap); i++)   chunkmap[i] = 0;   } while (0)
+
+#define SCTP_CHUNKMAP_SET_ALL(chunkmap)   do {   int i;   for (i = 0; i < ELEMCOUNT(chunkmap); i++)   chunkmap[i] = ~0;   } while (0)
+
+#define SCTP_CHUNKMAP_COPY(destmap, srcmap)   do {   int i;   for (i = 0; i < ELEMCOUNT(chunkmap); i++)   destmap[i] = srcmap[i];   } while (0)
+
+#define SCTP_CHUNKMAP_IS_CLEAR(chunkmap)  ({   int i;   int flag = 1;   for (i = 0; i < ELEMCOUNT(chunkmap); i++) {   if (chunkmap[i]) {   flag = 0;   break;   }   }   flag;  })
+
+#define SCTP_CHUNKMAP_IS_ALL_SET(chunkmap)  ({   int i;   int flag = 1;   for (i = 0; i < ELEMCOUNT(chunkmap); i++) {   if (chunkmap[i] != ~0) {   flag = 0;   break;   }   }   flag;  })
+
+#endif
+
diff --git a/ndk/platforms/android-3/include/linux/netfilter/xt_state.h b/ndk/platforms/android-3/include/linux/netfilter/xt_state.h
new file mode 100644
index 0000000..6754776
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter/xt_state.h
@@ -0,0 +1,24 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _XT_STATE_H
+#define _XT_STATE_H
+
+#define XT_STATE_BIT(ctinfo) (1 << ((ctinfo)%IP_CT_IS_REPLY+1))
+#define XT_STATE_INVALID (1 << 0)
+
+#define XT_STATE_UNTRACKED (1 << (IP_CT_NUMBER + 1))
+
+struct xt_state_info
+{
+ unsigned int statemask;
+};
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter/xt_statistic.h b/ndk/platforms/android-3/include/linux/netfilter/xt_statistic.h
new file mode 100644
index 0000000..999b0a1
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter/xt_statistic.h
@@ -0,0 +1,43 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _XT_STATISTIC_H
+#define _XT_STATISTIC_H
+
+enum xt_statistic_mode {
+ XT_STATISTIC_MODE_RANDOM,
+ XT_STATISTIC_MODE_NTH,
+ __XT_STATISTIC_MODE_MAX
+};
+#define XT_STATISTIC_MODE_MAX (__XT_STATISTIC_MODE_MAX - 1)
+
+enum xt_statistic_flags {
+ XT_STATISTIC_INVERT = 0x1,
+};
+#define XT_STATISTIC_MASK 0x1
+
+struct xt_statistic_info {
+ u_int16_t mode;
+ u_int16_t flags;
+ union {
+ struct {
+ u_int32_t probability;
+ } random;
+ struct {
+ u_int32_t every;
+ u_int32_t packet;
+ u_int32_t count;
+ } nth;
+ } u;
+ struct xt_statistic_info *master __attribute__((aligned(8)));
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter/xt_string.h b/ndk/platforms/android-3/include/linux/netfilter/xt_string.h
new file mode 100644
index 0000000..a01018f
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter/xt_string.h
@@ -0,0 +1,29 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _XT_STRING_H
+#define _XT_STRING_H
+
+#define XT_STRING_MAX_PATTERN_SIZE 128
+#define XT_STRING_MAX_ALGO_NAME_SIZE 16
+
+struct xt_string_info
+{
+ u_int16_t from_offset;
+ u_int16_t to_offset;
+ char algo[XT_STRING_MAX_ALGO_NAME_SIZE];
+ char pattern[XT_STRING_MAX_PATTERN_SIZE];
+ u_int8_t patlen;
+ u_int8_t invert;
+ struct ts_config __attribute__((aligned(8))) *config;
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter/xt_tcpmss.h b/ndk/platforms/android-3/include/linux/netfilter/xt_tcpmss.h
new file mode 100644
index 0000000..33de0ee
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter/xt_tcpmss.h
@@ -0,0 +1,20 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _XT_TCPMSS_MATCH_H
+#define _XT_TCPMSS_MATCH_H
+
+struct xt_tcpmss_match_info {
+ u_int16_t mss_min, mss_max;
+ u_int8_t invert;
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter/xt_tcpudp.h b/ndk/platforms/android-3/include/linux/netfilter/xt_tcpudp.h
new file mode 100644
index 0000000..476fffb
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter/xt_tcpudp.h
@@ -0,0 +1,42 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _XT_TCPUDP_H
+#define _XT_TCPUDP_H
+
+struct xt_tcp
+{
+ u_int16_t spts[2];
+ u_int16_t dpts[2];
+ u_int8_t option;
+ u_int8_t flg_mask;
+ u_int8_t flg_cmp;
+ u_int8_t invflags;
+};
+
+#define XT_TCP_INV_SRCPT 0x01  
+#define XT_TCP_INV_DSTPT 0x02  
+#define XT_TCP_INV_FLAGS 0x04  
+#define XT_TCP_INV_OPTION 0x08  
+#define XT_TCP_INV_MASK 0x0F  
+
+struct xt_udp
+{
+ u_int16_t spts[2];
+ u_int16_t dpts[2];
+ u_int8_t invflags;
+};
+
+#define XT_UDP_INV_SRCPT 0x01  
+#define XT_UDP_INV_DSTPT 0x02  
+#define XT_UDP_INV_MASK 0x03  
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter_arp.h b/ndk/platforms/android-3/include/linux/netfilter_arp.h
new file mode 100644
index 0000000..08569db
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter_arp.h
@@ -0,0 +1,24 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __LINUX_ARP_NETFILTER_H
+#define __LINUX_ARP_NETFILTER_H
+
+#include <linux/netfilter.h>
+
+#define NF_ARP 0
+
+#define NF_ARP_IN 0
+#define NF_ARP_OUT 1
+#define NF_ARP_FORWARD 2
+#define NF_ARP_NUMHOOKS 3
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter_arp/arp_tables.h b/ndk/platforms/android-3/include/linux/netfilter_arp/arp_tables.h
new file mode 100644
index 0000000..665a347
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter_arp/arp_tables.h
@@ -0,0 +1,159 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ARPTABLES_H
+#define _ARPTABLES_H
+
+#include <linux/compiler.h>
+#include <linux/netfilter_arp.h>
+
+#include <linux/netfilter/x_tables.h>
+
+#define ARPT_FUNCTION_MAXNAMELEN XT_FUNCTION_MAXNAMELEN
+#define ARPT_TABLE_MAXNAMELEN XT_TABLE_MAXNAMELEN
+#define arpt_target xt_target
+#define arpt_table xt_table
+
+#define ARPT_DEV_ADDR_LEN_MAX 16
+
+struct arpt_devaddr_info {
+ char addr[ARPT_DEV_ADDR_LEN_MAX];
+ char mask[ARPT_DEV_ADDR_LEN_MAX];
+};
+
+struct arpt_arp {
+
+ struct in_addr src, tgt;
+
+ struct in_addr smsk, tmsk;
+
+ u_int8_t arhln, arhln_mask;
+ struct arpt_devaddr_info src_devaddr;
+ struct arpt_devaddr_info tgt_devaddr;
+
+ u_int16_t arpop, arpop_mask;
+
+ u_int16_t arhrd, arhrd_mask;
+ u_int16_t arpro, arpro_mask;
+
+ char iniface[IFNAMSIZ], outiface[IFNAMSIZ];
+ unsigned char iniface_mask[IFNAMSIZ], outiface_mask[IFNAMSIZ];
+
+ u_int8_t flags;
+
+ u_int16_t invflags;
+};
+
+#define arpt_entry_target xt_entry_target
+#define arpt_standard_target xt_standard_target
+
+#define ARPT_F_MASK 0x00  
+
+#define ARPT_INV_VIA_IN 0x0001  
+#define ARPT_INV_VIA_OUT 0x0002  
+#define ARPT_INV_SRCIP 0x0004  
+#define ARPT_INV_TGTIP 0x0008  
+#define ARPT_INV_SRCDEVADDR 0x0010  
+#define ARPT_INV_TGTDEVADDR 0x0020  
+#define ARPT_INV_ARPOP 0x0040  
+#define ARPT_INV_ARPHRD 0x0080  
+#define ARPT_INV_ARPPRO 0x0100  
+#define ARPT_INV_ARPHLN 0x0200  
+#define ARPT_INV_MASK 0x03FF  
+
+struct arpt_entry
+{
+ struct arpt_arp arp;
+
+ u_int16_t target_offset;
+
+ u_int16_t next_offset;
+
+ unsigned int comefrom;
+
+ struct xt_counters counters;
+
+ unsigned char elems[0];
+};
+
+#define ARPT_CTL_OFFSET 32
+#define ARPT_BASE_CTL (XT_BASE_CTL+ARPT_CTL_OFFSET)
+
+#define ARPT_SO_SET_REPLACE (XT_SO_SET_REPLACE+ARPT_CTL_OFFSET)
+#define ARPT_SO_SET_ADD_COUNTERS (XT_SO_SET_ADD_COUNTERS+ARPT_CTL_OFFSET)
+#define ARPT_SO_SET_MAX (XT_SO_SET_MAX+ARPT_CTL_OFFSET)
+
+#define ARPT_SO_GET_INFO (XT_SO_GET_INFO+ARPT_CTL_OFFSET)
+#define ARPT_SO_GET_ENTRIES (XT_SO_GET_ENTRIES+ARPT_CTL_OFFSET)
+
+#define ARPT_SO_GET_REVISION_TARGET (XT_SO_GET_REVISION_TARGET+ARPT_CTL_OFFSET)
+#define ARPT_SO_GET_MAX (XT_SO_GET_REVISION_TARGET+ARPT_CTL_OFFSET)
+
+#define ARPT_CONTINUE XT_CONTINUE
+
+#define ARPT_RETURN XT_RETURN
+
+struct arpt_getinfo
+{
+
+ char name[ARPT_TABLE_MAXNAMELEN];
+
+ unsigned int valid_hooks;
+
+ unsigned int hook_entry[NF_ARP_NUMHOOKS];
+
+ unsigned int underflow[NF_ARP_NUMHOOKS];
+
+ unsigned int num_entries;
+
+ unsigned int size;
+};
+
+struct arpt_replace
+{
+
+ char name[ARPT_TABLE_MAXNAMELEN];
+
+ unsigned int valid_hooks;
+
+ unsigned int num_entries;
+
+ unsigned int size;
+
+ unsigned int hook_entry[NF_ARP_NUMHOOKS];
+
+ unsigned int underflow[NF_ARP_NUMHOOKS];
+
+ unsigned int num_counters;
+
+ struct xt_counters __user *counters;
+
+ struct arpt_entry entries[0];
+};
+
+#define arpt_counters_info xt_counters_info
+
+struct arpt_get_entries
+{
+
+ char name[ARPT_TABLE_MAXNAMELEN];
+
+ unsigned int size;
+
+ struct arpt_entry entrytable[0];
+};
+
+#define ARPT_STANDARD_TARGET XT_STANDARD_TARGET
+
+#define ARPT_ERROR_TARGET XT_ERROR_TARGET
+
+#define ARPT_ENTRY_ITERATE(entries, size, fn, args...)  ({   unsigned int __i;   int __ret = 0;   struct arpt_entry *__entry;     for (__i = 0; __i < (size); __i += __entry->next_offset) {   __entry = (void *)(entries) + __i;     __ret = fn(__entry , ## args);   if (__ret != 0)   break;   }   __ret;  })
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter_bridge.h b/ndk/platforms/android-3/include/linux/netfilter_bridge.h
new file mode 100644
index 0000000..22cca55
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter_bridge.h
@@ -0,0 +1,30 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __LINUX_BRIDGE_NETFILTER_H
+#define __LINUX_BRIDGE_NETFILTER_H
+
+#include <linux/netfilter.h>
+
+#define NF_BR_PRE_ROUTING 0
+
+#define NF_BR_LOCAL_IN 1
+
+#define NF_BR_FORWARD 2
+
+#define NF_BR_LOCAL_OUT 3
+
+#define NF_BR_POST_ROUTING 4
+
+#define NF_BR_BROUTING 5
+#define NF_BR_NUMHOOKS 6
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter_ipv4.h b/ndk/platforms/android-3/include/linux/netfilter_ipv4.h
new file mode 100644
index 0000000..17fd451
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter_ipv4.h
@@ -0,0 +1,73 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __LINUX_IP_NETFILTER_H
+#define __LINUX_IP_NETFILTER_H
+
+#include <linux/netfilter.h>
+
+#define NFC_IP_SRC 0x0001
+
+#define NFC_IP_DST 0x0002
+
+#define NFC_IP_IF_IN 0x0004
+
+#define NFC_IP_IF_OUT 0x0008
+
+#define NFC_IP_TOS 0x0010
+
+#define NFC_IP_PROTO 0x0020
+
+#define NFC_IP_OPTIONS 0x0040
+
+#define NFC_IP_FRAG 0x0080
+
+#define NFC_IP_TCPFLAGS 0x0100
+
+#define NFC_IP_SRC_PT 0x0200
+
+#define NFC_IP_DST_PT 0x0400
+
+#define NFC_IP_PROTO_UNKNOWN 0x2000
+
+#define NF_IP_PRE_ROUTING 0
+
+#define NF_IP_LOCAL_IN 1
+
+#define NF_IP_FORWARD 2
+
+#define NF_IP_LOCAL_OUT 3
+
+#define NF_IP_POST_ROUTING 4
+#define NF_IP_NUMHOOKS 5
+
+enum nf_ip_hook_priorities {
+ NF_IP_PRI_FIRST = INT_MIN,
+ NF_IP_PRI_CONNTRACK_DEFRAG = -400,
+ NF_IP_PRI_RAW = -300,
+ NF_IP_PRI_SELINUX_FIRST = -225,
+ NF_IP_PRI_CONNTRACK = -200,
+ NF_IP_PRI_BRIDGE_SABOTAGE_FORWARD = -175,
+ NF_IP_PRI_MANGLE = -150,
+ NF_IP_PRI_NAT_DST = -100,
+ NF_IP_PRI_BRIDGE_SABOTAGE_LOCAL_OUT = -50,
+ NF_IP_PRI_FILTER = 0,
+ NF_IP_PRI_NAT_SRC = 100,
+ NF_IP_PRI_SELINUX_LAST = 225,
+ NF_IP_PRI_CONNTRACK_HELPER = INT_MAX - 2,
+ NF_IP_PRI_NAT_SEQ_ADJUST = INT_MAX - 1,
+ NF_IP_PRI_CONNTRACK_CONFIRM = INT_MAX,
+ NF_IP_PRI_LAST = INT_MAX,
+};
+
+#define SO_ORIGINAL_DST 80
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter_ipv4/ip_conntrack.h b/ndk/platforms/android-3/include/linux/netfilter_ipv4/ip_conntrack.h
new file mode 100644
index 0000000..ef55a61
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter_ipv4/ip_conntrack.h
@@ -0,0 +1,17 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _IP_CONNTRACK_H
+#define _IP_CONNTRACK_H
+
+#include <linux/netfilter/nf_conntrack_common.h>
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter_ipv4/ip_conntrack_tuple.h b/ndk/platforms/android-3/include/linux/netfilter_ipv4/ip_conntrack_tuple.h
new file mode 100644
index 0000000..0c96baf
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter_ipv4/ip_conntrack_tuple.h
@@ -0,0 +1,81 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _IP_CONNTRACK_TUPLE_H
+#define _IP_CONNTRACK_TUPLE_H
+
+#include <linux/types.h>
+#include <linux/netfilter/nf_conntrack_tuple_common.h>
+
+union ip_conntrack_manip_proto
+{
+
+ u_int16_t all;
+
+ struct {
+ __be16 port;
+ } tcp;
+ struct {
+ u_int16_t port;
+ } udp;
+ struct {
+ u_int16_t id;
+ } icmp;
+ struct {
+ u_int16_t port;
+ } sctp;
+ struct {
+ __be16 key;
+ } gre;
+};
+
+struct ip_conntrack_manip
+{
+ u_int32_t ip;
+ union ip_conntrack_manip_proto u;
+};
+
+struct ip_conntrack_tuple
+{
+ struct ip_conntrack_manip src;
+
+ struct {
+ u_int32_t ip;
+ union {
+
+ u_int16_t all;
+
+ struct {
+ u_int16_t port;
+ } tcp;
+ struct {
+ u_int16_t port;
+ } udp;
+ struct {
+ u_int8_t type, code;
+ } icmp;
+ struct {
+ u_int16_t port;
+ } sctp;
+ struct {
+ __be16 key;
+ } gre;
+ } u;
+
+ u_int8_t protonum;
+
+ u_int8_t dir;
+ } dst;
+};
+
+#define IP_CT_TUPLE_U_BLANK(tuple)   do {   (tuple)->src.u.all = 0;   (tuple)->dst.u.all = 0;   } while (0)
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter_ipv4/ip_nat.h b/ndk/platforms/android-3/include/linux/netfilter_ipv4/ip_nat.h
new file mode 100644
index 0000000..7db9da3
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter_ipv4/ip_nat.h
@@ -0,0 +1,55 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _IP_NAT_H
+#define _IP_NAT_H
+#include <linux/netfilter_ipv4.h>
+#include <linux/netfilter_ipv4/ip_conntrack_tuple.h>
+
+#define IP_NAT_MAPPING_TYPE_MAX_NAMELEN 16
+
+enum ip_nat_manip_type
+{
+ IP_NAT_MANIP_SRC,
+ IP_NAT_MANIP_DST
+};
+
+#define HOOK2MANIP(hooknum) ((hooknum) != NF_IP_POST_ROUTING && (hooknum) != NF_IP_LOCAL_IN)
+
+#define IP_NAT_RANGE_MAP_IPS 1
+#define IP_NAT_RANGE_PROTO_SPECIFIED 2
+
+struct ip_nat_seq {
+
+ u_int32_t correction_pos;
+
+ int16_t offset_before, offset_after;
+};
+
+struct ip_nat_range
+{
+
+ unsigned int flags;
+
+ u_int32_t min_ip, max_ip;
+
+ union ip_conntrack_manip_proto min, max;
+};
+
+struct ip_nat_multi_range_compat
+{
+ unsigned int rangesize;
+
+ struct ip_nat_range range[1];
+};
+
+#define ip_nat_multi_range ip_nat_multi_range_compat
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter_ipv4/ip_nat_rule.h b/ndk/platforms/android-3/include/linux/netfilter_ipv4/ip_nat_rule.h
new file mode 100644
index 0000000..b9db0b0
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter_ipv4/ip_nat_rule.h
@@ -0,0 +1,18 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _IP_NAT_RULE_H
+#define _IP_NAT_RULE_H
+#include <linux/netfilter_ipv4/ip_conntrack.h>
+#include <linux/netfilter_ipv4/ip_tables.h>
+#include <linux/netfilter_ipv4/ip_nat.h>
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter_ipv4/ip_queue.h b/ndk/platforms/android-3/include/linux/netfilter_ipv4/ip_queue.h
new file mode 100644
index 0000000..5d17a54
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter_ipv4/ip_queue.h
@@ -0,0 +1,65 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _IP_QUEUE_H
+#define _IP_QUEUE_H
+
+#include <net/if.h>
+
+typedef struct ipq_packet_msg {
+ unsigned long packet_id;
+ unsigned long mark;
+ long timestamp_sec;
+ long timestamp_usec;
+ unsigned int hook;
+ char indev_name[IFNAMSIZ];
+ char outdev_name[IFNAMSIZ];
+ unsigned short hw_protocol;
+ unsigned short hw_type;
+ unsigned char hw_addrlen;
+ unsigned char hw_addr[8];
+ size_t data_len;
+ unsigned char payload[0];
+} ipq_packet_msg_t;
+
+typedef struct ipq_mode_msg {
+ unsigned char value;
+ size_t range;
+} ipq_mode_msg_t;
+
+typedef struct ipq_verdict_msg {
+ unsigned int value;
+ unsigned long id;
+ size_t data_len;
+ unsigned char payload[0];
+} ipq_verdict_msg_t;
+
+typedef struct ipq_peer_msg {
+ union {
+ ipq_verdict_msg_t verdict;
+ ipq_mode_msg_t mode;
+ } msg;
+} ipq_peer_msg_t;
+
+enum {
+ IPQ_COPY_NONE,
+ IPQ_COPY_META,
+ IPQ_COPY_PACKET
+};
+#define IPQ_COPY_MAX IPQ_COPY_PACKET
+
+#define IPQM_BASE 0x10  
+#define IPQM_MODE (IPQM_BASE + 1)  
+#define IPQM_VERDICT (IPQM_BASE + 2)   
+#define IPQM_PACKET (IPQM_BASE + 3)  
+#define IPQM_MAX (IPQM_BASE + 4)
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter_ipv4/ip_tables.h b/ndk/platforms/android-3/include/linux/netfilter_ipv4/ip_tables.h
new file mode 100644
index 0000000..aa48305
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter_ipv4/ip_tables.h
@@ -0,0 +1,180 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _IPTABLES_H
+#define _IPTABLES_H
+
+#include <linux/compiler.h>
+#include <linux/netfilter_ipv4.h>
+
+#include <linux/netfilter/x_tables.h>
+
+#define IPT_FUNCTION_MAXNAMELEN XT_FUNCTION_MAXNAMELEN
+#define IPT_TABLE_MAXNAMELEN XT_FUNCTION_MAXNAMELEN
+#define ipt_match xt_match
+#define ipt_target xt_target
+#define ipt_table xt_table
+#define ipt_get_revision xt_get_revision
+
+struct ipt_ip {
+
+ struct in_addr src, dst;
+
+ struct in_addr smsk, dmsk;
+ char iniface[IFNAMSIZ], outiface[IFNAMSIZ];
+ unsigned char iniface_mask[IFNAMSIZ], outiface_mask[IFNAMSIZ];
+
+ u_int16_t proto;
+
+ u_int8_t flags;
+
+ u_int8_t invflags;
+};
+
+#define ipt_entry_match xt_entry_match
+#define ipt_entry_target xt_entry_target
+#define ipt_standard_target xt_standard_target
+
+#define ipt_counters xt_counters
+
+#define IPT_F_FRAG 0x01  
+#define IPT_F_GOTO 0x02  
+#define IPT_F_MASK 0x03  
+
+#define IPT_INV_VIA_IN 0x01  
+#define IPT_INV_VIA_OUT 0x02  
+#define IPT_INV_TOS 0x04  
+#define IPT_INV_SRCIP 0x08  
+#define IPT_INV_DSTIP 0x10  
+#define IPT_INV_FRAG 0x20  
+#define IPT_INV_PROTO XT_INV_PROTO
+#define IPT_INV_MASK 0x7F  
+
+struct ipt_entry
+{
+ struct ipt_ip ip;
+
+ unsigned int nfcache;
+
+ u_int16_t target_offset;
+
+ u_int16_t next_offset;
+
+ unsigned int comefrom;
+
+ struct xt_counters counters;
+
+ unsigned char elems[0];
+};
+
+#define IPT_BASE_CTL XT_BASE_CTL
+
+#define IPT_SO_SET_REPLACE XT_SO_SET_REPLACE
+#define IPT_SO_SET_ADD_COUNTERS XT_SO_SET_ADD_COUNTERS
+#define IPT_SO_SET_MAX XT_SO_SET_MAX
+
+#define IPT_SO_GET_INFO XT_SO_GET_INFO
+#define IPT_SO_GET_ENTRIES XT_SO_GET_ENTRIES
+#define IPT_SO_GET_REVISION_MATCH XT_SO_GET_REVISION_MATCH
+#define IPT_SO_GET_REVISION_TARGET XT_SO_GET_REVISION_TARGET
+#define IPT_SO_GET_MAX XT_SO_GET_REVISION_TARGET
+
+#define IPT_CONTINUE XT_CONTINUE
+#define IPT_RETURN XT_RETURN
+
+#include <linux/netfilter/xt_tcpudp.h>
+#define ipt_udp xt_udp
+#define ipt_tcp xt_tcp
+
+#define IPT_TCP_INV_SRCPT XT_TCP_INV_SRCPT
+#define IPT_TCP_INV_DSTPT XT_TCP_INV_DSTPT
+#define IPT_TCP_INV_FLAGS XT_TCP_INV_FLAGS
+#define IPT_TCP_INV_OPTION XT_TCP_INV_OPTION
+#define IPT_TCP_INV_MASK XT_TCP_INV_MASK
+
+#define IPT_UDP_INV_SRCPT XT_UDP_INV_SRCPT
+#define IPT_UDP_INV_DSTPT XT_UDP_INV_DSTPT
+#define IPT_UDP_INV_MASK XT_UDP_INV_MASK
+
+struct ipt_icmp
+{
+ u_int8_t type;
+ u_int8_t code[2];
+ u_int8_t invflags;
+};
+
+#define IPT_ICMP_INV 0x01  
+
+struct ipt_getinfo
+{
+
+ char name[IPT_TABLE_MAXNAMELEN];
+
+ unsigned int valid_hooks;
+
+ unsigned int hook_entry[NF_IP_NUMHOOKS];
+
+ unsigned int underflow[NF_IP_NUMHOOKS];
+
+ unsigned int num_entries;
+
+ unsigned int size;
+};
+
+struct ipt_replace
+{
+
+ char name[IPT_TABLE_MAXNAMELEN];
+
+ unsigned int valid_hooks;
+
+ unsigned int num_entries;
+
+ unsigned int size;
+
+ unsigned int hook_entry[NF_IP_NUMHOOKS];
+
+ unsigned int underflow[NF_IP_NUMHOOKS];
+
+ unsigned int num_counters;
+
+ struct xt_counters __user *counters;
+
+ struct ipt_entry entries[0];
+};
+
+#define ipt_counters_info xt_counters_info
+
+struct ipt_get_entries
+{
+
+ char name[IPT_TABLE_MAXNAMELEN];
+
+ unsigned int size;
+
+ struct ipt_entry entrytable[0];
+};
+
+#define IPT_STANDARD_TARGET XT_STANDARD_TARGET
+
+#define IPT_ERROR_TARGET XT_ERROR_TARGET
+
+static __inline__ struct ipt_entry_target *
+ipt_get_target(struct ipt_entry *e)
+{
+ return (void *)e + e->target_offset;
+}
+
+#define IPT_MATCH_ITERATE(e, fn, args...)  ({   unsigned int __i;   int __ret = 0;   struct ipt_entry_match *__match;     for (__i = sizeof(struct ipt_entry);   __i < (e)->target_offset;   __i += __match->u.match_size) {   __match = (void *)(e) + __i;     __ret = fn(__match , ## args);   if (__ret != 0)   break;   }   __ret;  })
+
+#define IPT_ENTRY_ITERATE(entries, size, fn, args...)  ({   unsigned int __i;   int __ret = 0;   struct ipt_entry *__entry;     for (__i = 0; __i < (size); __i += __entry->next_offset) {   __entry = (void *)(entries) + __i;     __ret = fn(__entry , ## args);   if (__ret != 0)   break;   }   __ret;  })
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_CLASSIFY.h b/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_CLASSIFY.h
new file mode 100644
index 0000000..a738edd
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_CLASSIFY.h
@@ -0,0 +1,18 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _IPT_CLASSIFY_H
+#define _IPT_CLASSIFY_H
+
+#include <linux/netfilter/xt_CLASSIFY.h>
+#define ipt_classify_target_info xt_classify_target_info
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_DSCP.h b/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_DSCP.h
new file mode 100644
index 0000000..0271fb2
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_DSCP.h
@@ -0,0 +1,20 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _IPT_DSCP_TARGET_H
+#define _IPT_DSCP_TARGET_H
+#include <linux/netfilter_ipv4/ipt_dscp.h>
+
+struct ipt_DSCP_info {
+ u_int8_t dscp;
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_ECN.h b/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_ECN.h
new file mode 100644
index 0000000..67c16fe
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_ECN.h
@@ -0,0 +1,34 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _IPT_ECN_TARGET_H
+#define _IPT_ECN_TARGET_H
+#include <linux/netfilter_ipv4/ipt_DSCP.h>
+
+#define IPT_ECN_IP_MASK (~IPT_DSCP_MASK)
+
+#define IPT_ECN_OP_SET_IP 0x01  
+#define IPT_ECN_OP_SET_ECE 0x10  
+#define IPT_ECN_OP_SET_CWR 0x20  
+
+#define IPT_ECN_OP_MASK 0xce
+
+struct ipt_ECN_info {
+ u_int8_t operation;
+ u_int8_t ip_ect;
+ union {
+ struct {
+ u_int8_t ece:1, cwr:1;
+ } tcp;
+ } proto;
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_LOG.h b/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_LOG.h
new file mode 100644
index 0000000..dd6fd1b
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_LOG.h
@@ -0,0 +1,28 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _IPT_LOG_H
+#define _IPT_LOG_H
+
+#define IPT_LOG_TCPSEQ 0x01  
+#define IPT_LOG_TCPOPT 0x02  
+#define IPT_LOG_IPOPT 0x04  
+#define IPT_LOG_UID 0x08  
+#define IPT_LOG_NFLOG 0x10  
+#define IPT_LOG_MASK 0x1f
+
+struct ipt_log_info {
+ unsigned char level;
+ unsigned char logflags;
+ char prefix[30];
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_NFQUEUE.h b/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_NFQUEUE.h
new file mode 100644
index 0000000..27ac4a5
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_NFQUEUE.h
@@ -0,0 +1,19 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _IPT_NFQ_TARGET_H
+#define _IPT_NFQ_TARGET_H
+
+#include <linux/netfilter/xt_NFQUEUE.h>
+
+#define ipt_NFQ_info xt_NFQ_info
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_REJECT.h b/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_REJECT.h
new file mode 100644
index 0000000..d3c3965
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_REJECT.h
@@ -0,0 +1,31 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _IPT_REJECT_H
+#define _IPT_REJECT_H
+
+enum ipt_reject_with {
+ IPT_ICMP_NET_UNREACHABLE,
+ IPT_ICMP_HOST_UNREACHABLE,
+ IPT_ICMP_PROT_UNREACHABLE,
+ IPT_ICMP_PORT_UNREACHABLE,
+ IPT_ICMP_ECHOREPLY,
+ IPT_ICMP_NET_PROHIBITED,
+ IPT_ICMP_HOST_PROHIBITED,
+ IPT_TCP_RESET,
+ IPT_ICMP_ADMIN_PROHIBITED
+};
+
+struct ipt_reject_info {
+ enum ipt_reject_with with;
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_TCPMSS.h b/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_TCPMSS.h
new file mode 100644
index 0000000..e924f37
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_TCPMSS.h
@@ -0,0 +1,21 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _IPT_TCPMSS_H
+#define _IPT_TCPMSS_H
+
+struct ipt_tcpmss_info {
+ u_int16_t mss;
+};
+
+#define IPT_TCPMSS_CLAMP_PMTU 0xffff
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_TOS.h b/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_TOS.h
new file mode 100644
index 0000000..1cc2116
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_TOS.h
@@ -0,0 +1,23 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _IPT_TOS_H_target
+#define _IPT_TOS_H_target
+
+#ifndef IPTOS_NORMALSVC
+#define IPTOS_NORMALSVC 0
+#endif
+
+struct ipt_tos_target_info {
+ u_int8_t tos;
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_TTL.h b/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_TTL.h
new file mode 100644
index 0000000..f9e98af
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_TTL.h
@@ -0,0 +1,28 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _IPT_TTL_H
+#define _IPT_TTL_H
+
+enum {
+ IPT_TTL_SET = 0,
+ IPT_TTL_INC,
+ IPT_TTL_DEC
+};
+
+#define IPT_TTL_MAXMODE IPT_TTL_DEC
+
+struct ipt_TTL_info {
+ u_int8_t mode;
+ u_int8_t ttl;
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_ULOG.h b/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_ULOG.h
new file mode 100644
index 0000000..9511cb8
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_ULOG.h
@@ -0,0 +1,48 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _IPT_ULOG_H
+#define _IPT_ULOG_H
+
+#ifndef NETLINK_NFLOG
+#define NETLINK_NFLOG 5
+#endif
+
+#define ULOG_DEFAULT_NLGROUP 1
+#define ULOG_DEFAULT_QTHRESHOLD 1
+
+#define ULOG_MAC_LEN 80
+#define ULOG_PREFIX_LEN 32
+
+#define ULOG_MAX_QLEN 50
+
+struct ipt_ulog_info {
+ unsigned int nl_group;
+ size_t copy_range;
+ size_t qthreshold;
+ char prefix[ULOG_PREFIX_LEN];
+};
+
+typedef struct ulog_packet_msg {
+ unsigned long mark;
+ long timestamp_sec;
+ long timestamp_usec;
+ unsigned int hook;
+ char indev_name[IFNAMSIZ];
+ char outdev_name[IFNAMSIZ];
+ size_t data_len;
+ char prefix[ULOG_PREFIX_LEN];
+ unsigned char mac_len;
+ unsigned char mac[ULOG_MAC_LEN];
+ unsigned char payload[0];
+} ulog_packet_msg_t;
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_addrtype.h b/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_addrtype.h
new file mode 100644
index 0000000..5203b32
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_addrtype.h
@@ -0,0 +1,22 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _IPT_ADDRTYPE_H
+#define _IPT_ADDRTYPE_H
+
+struct ipt_addrtype_info {
+ u_int16_t source;
+ u_int16_t dest;
+ u_int32_t invert_source;
+ u_int32_t invert_dest;
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_ah.h b/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_ah.h
new file mode 100644
index 0000000..11983e2
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_ah.h
@@ -0,0 +1,24 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _IPT_AH_H
+#define _IPT_AH_H
+
+struct ipt_ah
+{
+ u_int32_t spis[2];
+ u_int8_t invflags;
+};
+
+#define IPT_AH_INV_SPI 0x01  
+#define IPT_AH_INV_MASK 0x01  
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_comment.h b/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_comment.h
new file mode 100644
index 0000000..dbd7507
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_comment.h
@@ -0,0 +1,21 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _IPT_COMMENT_H
+#define _IPT_COMMENT_H
+
+#include <linux/netfilter/xt_comment.h>
+
+#define IPT_MAX_COMMENT_LEN XT_MAX_COMMENT_LEN
+
+#define ipt_comment_info xt_comment_info
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_connbytes.h b/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_connbytes.h
new file mode 100644
index 0000000..8ae19c5
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_connbytes.h
@@ -0,0 +1,29 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _IPT_CONNBYTES_H
+#define _IPT_CONNBYTES_H
+
+#include <linux/netfilter/xt_connbytes.h>
+#define ipt_connbytes_what xt_connbytes_what
+
+#define IPT_CONNBYTES_PKTS XT_CONNBYTES_PKTS
+#define IPT_CONNBYTES_BYTES XT_CONNBYTES_BYTES
+#define IPT_CONNBYTES_AVGPKT XT_CONNBYTES_AVGPKT
+
+#define ipt_connbytes_direction xt_connbytes_direction
+#define IPT_CONNBYTES_DIR_ORIGINAL XT_CONNBYTES_DIR_ORIGINAL
+#define IPT_CONNBYTES_DIR_REPLY XT_CONNBYTES_DIR_REPLY
+#define IPT_CONNBYTES_DIR_BOTH XT_CONNBYTES_DIR_BOTH
+
+#define ipt_connbytes_info xt_connbytes_info
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_dccp.h b/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_dccp.h
new file mode 100644
index 0000000..c1212c9
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_dccp.h
@@ -0,0 +1,26 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _IPT_DCCP_H_
+#define _IPT_DCCP_H_
+
+#include <linux/netfilter/xt_dccp.h>
+#define IPT_DCCP_SRC_PORTS XT_DCCP_SRC_PORTS
+#define IPT_DCCP_DEST_PORTS XT_DCCP_DEST_PORTS
+#define IPT_DCCP_TYPE XT_DCCP_TYPE
+#define IPT_DCCP_OPTION XT_DCCP_OPTION
+
+#define IPT_DCCP_VALID_FLAGS XT_DCCP_VALID_FLAGS
+
+#define ipt_dccp_info xt_dccp_info
+
+#endif
+
diff --git a/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_dscp_.h b/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_dscp_.h
new file mode 100644
index 0000000..aba8861
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_dscp_.h
@@ -0,0 +1,24 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _IPT_DSCP_H
+#define _IPT_DSCP_H
+
+#define IPT_DSCP_MASK 0xfc  
+#define IPT_DSCP_SHIFT 2
+#define IPT_DSCP_MAX 0x3f  
+
+struct ipt_dscp_info {
+ u_int8_t dscp;
+ u_int8_t invert;
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_esp.h b/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_esp.h
new file mode 100644
index 0000000..4947e7e
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_esp.h
@@ -0,0 +1,21 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _IPT_ESP_H
+#define _IPT_ESP_H
+
+#include <linux/netfilter/xt_esp.h>
+
+#define ipt_esp xt_esp
+#define IPT_ESP_INV_SPI XT_ESP_INV_SPI
+#define IPT_ESP_INV_MASK XT_ESP_INV_MASK
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_hashlimit.h b/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_hashlimit.h
new file mode 100644
index 0000000..adc1f41
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_hashlimit.h
@@ -0,0 +1,45 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _IPT_HASHLIMIT_H
+#define _IPT_HASHLIMIT_H
+
+#define IPT_HASHLIMIT_SCALE 10000
+
+struct ipt_hashlimit_htable;
+
+#define IPT_HASHLIMIT_HASH_DIP 0x0001
+#define IPT_HASHLIMIT_HASH_DPT 0x0002
+#define IPT_HASHLIMIT_HASH_SIP 0x0004
+#define IPT_HASHLIMIT_HASH_SPT 0x0008
+
+struct hashlimit_cfg {
+ u_int32_t mode;
+ u_int32_t avg;
+ u_int32_t burst;
+
+ u_int32_t size;
+ u_int32_t max;
+ u_int32_t gc_interval;
+ u_int32_t expire;
+};
+
+struct ipt_hashlimit_info {
+ char name [IFNAMSIZ];
+ struct hashlimit_cfg cfg;
+ struct ipt_hashlimit_htable *hinfo;
+
+ union {
+ void *ptr;
+ struct ipt_hashlimit_info *master;
+ } u;
+};
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_helper.h b/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_helper.h
new file mode 100644
index 0000000..576add9
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_helper.h
@@ -0,0 +1,18 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _IPT_HELPER_H
+#define _IPT_HELPER_H
+
+#include <linux/netfilter/xt_helper.h>
+#define ipt_helper_info xt_helper_info
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_iprange.h b/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_iprange.h
new file mode 100644
index 0000000..b4dd603
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_iprange.h
@@ -0,0 +1,33 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _IPT_IPRANGE_H
+#define _IPT_IPRANGE_H
+
+#define IPRANGE_SRC 0x01  
+#define IPRANGE_DST 0x02  
+#define IPRANGE_SRC_INV 0x10  
+#define IPRANGE_DST_INV 0x20  
+
+struct ipt_iprange {
+
+ u_int32_t min_ip, max_ip;
+};
+
+struct ipt_iprange_info
+{
+ struct ipt_iprange src;
+ struct ipt_iprange dst;
+
+ u_int8_t flags;
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_length.h b/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_length.h
new file mode 100644
index 0000000..9610859
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_length.h
@@ -0,0 +1,18 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _IPT_LENGTH_H
+#define _IPT_LENGTH_H
+
+#include <linux/netfilter/xt_length.h>
+#define ipt_length_info xt_length_info
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_mac.h b/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_mac.h
new file mode 100644
index 0000000..89378a3
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_mac.h
@@ -0,0 +1,18 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _IPT_MAC_H
+#define _IPT_MAC_H
+
+#include <linux/netfilter/xt_mac.h>
+#define ipt_mac_info xt_mac_info
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_owner.h b/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_owner.h
new file mode 100644
index 0000000..8b742b1
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_owner.h
@@ -0,0 +1,30 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _IPT_OWNER_H
+#define _IPT_OWNER_H
+
+#define IPT_OWNER_UID 0x01
+#define IPT_OWNER_GID 0x02
+#define IPT_OWNER_PID 0x04
+#define IPT_OWNER_SID 0x08
+#define IPT_OWNER_COMM 0x10
+
+struct ipt_owner_info {
+ uid_t uid;
+ gid_t gid;
+ pid_t pid;
+ pid_t sid;
+ char comm[16];
+ u_int8_t match, invert;
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_physdev.h b/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_physdev.h
new file mode 100644
index 0000000..791cf02
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_physdev.h
@@ -0,0 +1,26 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _IPT_PHYSDEV_H
+#define _IPT_PHYSDEV_H
+
+#include <linux/netfilter/xt_physdev.h>
+
+#define IPT_PHYSDEV_OP_IN XT_PHYSDEV_OP_IN
+#define IPT_PHYSDEV_OP_OUT XT_PHYSDEV_OP_OUT
+#define IPT_PHYSDEV_OP_BRIDGED XT_PHYSDEV_OP_BRIDGED
+#define IPT_PHYSDEV_OP_ISIN XT_PHYSDEV_OP_ISIN
+#define IPT_PHYSDEV_OP_ISOUT XT_PHYSDEV_OP_ISOUT
+#define IPT_PHYSDEV_OP_MASK XT_PHYSDEV_OP_MASK
+
+#define ipt_physdev_info xt_physdev_info
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_pkttype.h b/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_pkttype.h
new file mode 100644
index 0000000..fbb20b1
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_pkttype.h
@@ -0,0 +1,18 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _IPT_PKTTYPE_H
+#define _IPT_PKTTYPE_H
+
+#include <linux/netfilter/xt_pkttype.h>
+#define ipt_pkttype_info xt_pkttype_info
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_realm.h b/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_realm.h
new file mode 100644
index 0000000..9b80faa
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_realm.h
@@ -0,0 +1,18 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _IPT_REALM_H
+#define _IPT_REALM_H
+
+#include <linux/netfilter/xt_realm.h>
+#define ipt_realm_info xt_realm_info
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_recent.h b/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_recent.h
new file mode 100644
index 0000000..45172bd
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_recent.h
@@ -0,0 +1,38 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _IPT_RECENT_H
+#define _IPT_RECENT_H
+
+#define RECENT_NAME "ipt_recent"
+#define RECENT_VER "v0.3.1"
+
+#define IPT_RECENT_CHECK 1
+#define IPT_RECENT_SET 2
+#define IPT_RECENT_UPDATE 4
+#define IPT_RECENT_REMOVE 8
+#define IPT_RECENT_TTL 16
+
+#define IPT_RECENT_SOURCE 0
+#define IPT_RECENT_DEST 1
+
+#define IPT_RECENT_NAME_LEN 200
+
+struct ipt_recent_info {
+ u_int32_t seconds;
+ u_int32_t hit_count;
+ u_int8_t check_set;
+ u_int8_t invert;
+ char name[IPT_RECENT_NAME_LEN];
+ u_int8_t side;
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_sctp.h b/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_sctp.h
new file mode 100644
index 0000000..20f301f
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_sctp.h
@@ -0,0 +1,66 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _IPT_SCTP_H_
+#define _IPT_SCTP_H_
+
+#define IPT_SCTP_SRC_PORTS 0x01
+#define IPT_SCTP_DEST_PORTS 0x02
+#define IPT_SCTP_CHUNK_TYPES 0x04
+
+#define IPT_SCTP_VALID_FLAGS 0x07
+
+struct ipt_sctp_flag_info {
+ u_int8_t chunktype;
+ u_int8_t flag;
+ u_int8_t flag_mask;
+};
+
+#define IPT_NUM_SCTP_FLAGS 4
+
+struct ipt_sctp_info {
+ u_int16_t dpts[2];
+ u_int16_t spts[2];
+
+ u_int32_t chunkmap[256 / sizeof (u_int32_t)];
+
+#define SCTP_CHUNK_MATCH_ANY 0x01  
+#define SCTP_CHUNK_MATCH_ALL 0x02  
+#define SCTP_CHUNK_MATCH_ONLY 0x04  
+
+ u_int32_t chunk_match_type;
+ struct ipt_sctp_flag_info flag_info[IPT_NUM_SCTP_FLAGS];
+ int flag_count;
+
+ u_int32_t flags;
+ u_int32_t invflags;
+};
+
+#define bytes(type) (sizeof(type) * 8)
+
+#define SCTP_CHUNKMAP_SET(chunkmap, type)   do {   chunkmap[type / bytes(u_int32_t)] |=   1 << (type % bytes(u_int32_t));   } while (0)
+
+#define SCTP_CHUNKMAP_CLEAR(chunkmap, type)   do {   chunkmap[type / bytes(u_int32_t)] &=   ~(1 << (type % bytes(u_int32_t)));   } while (0)
+
+#define SCTP_CHUNKMAP_IS_SET(chunkmap, type)  ({   (chunkmap[type / bytes (u_int32_t)] &   (1 << (type % bytes (u_int32_t)))) ? 1: 0;  })
+
+#define SCTP_CHUNKMAP_RESET(chunkmap)   do {   int i;   for (i = 0; i < ARRAY_SIZE(chunkmap); i++)   chunkmap[i] = 0;   } while (0)
+
+#define SCTP_CHUNKMAP_SET_ALL(chunkmap)   do {   int i;   for (i = 0; i < ARRAY_SIZE(chunkmap); i++)   chunkmap[i] = ~0;   } while (0)
+
+#define SCTP_CHUNKMAP_COPY(destmap, srcmap)   do {   int i;   for (i = 0; i < ARRAY_SIZE(chunkmap); i++)   destmap[i] = srcmap[i];   } while (0)
+
+#define SCTP_CHUNKMAP_IS_CLEAR(chunkmap)  ({   int i;   int flag = 1;   for (i = 0; i < ARRAY_SIZE(chunkmap); i++) {   if (chunkmap[i]) {   flag = 0;   break;   }   }   flag;  })
+
+#define SCTP_CHUNKMAP_IS_ALL_SET(chunkmap)  ({   int i;   int flag = 1;   for (i = 0; i < ARRAY_SIZE(chunkmap); i++) {   if (chunkmap[i] != ~0) {   flag = 0;   break;   }   }   flag;  })
+
+#endif
+
diff --git a/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_state.h b/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_state.h
new file mode 100644
index 0000000..bd51990
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_state.h
@@ -0,0 +1,24 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _IPT_STATE_H
+#define _IPT_STATE_H
+
+#include <linux/netfilter/xt_state.h>
+
+#define IPT_STATE_BIT XT_STATE_BIT
+#define IPT_STATE_INVALID XT_STATE_INVALID
+
+#define IPT_STATE_UNTRACKED XT_STATE_UNTRACKED
+
+#define ipt_state_info xt_state_info
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_string.h b/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_string.h
new file mode 100644
index 0000000..60923dd
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_string.h
@@ -0,0 +1,21 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _IPT_STRING_H
+#define _IPT_STRING_H
+
+#include <linux/netfilter/xt_string.h>
+
+#define IPT_STRING_MAX_PATTERN_SIZE XT_STRING_MAX_PATTERN_SIZE
+#define IPT_STRING_MAX_ALGO_NAME_SIZE XT_STRING_MAX_ALGO_NAME_SIZE
+#define ipt_string_info xt_string_info
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_tos_.h b/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_tos_.h
new file mode 100644
index 0000000..789ce22
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter_ipv4/ipt_tos_.h
@@ -0,0 +1,24 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _IPT_TOS_H
+#define _IPT_TOS_H
+
+struct ipt_tos_info {
+ u_int8_t tos;
+ u_int8_t invert;
+};
+
+#ifndef IPTOS_NORMALSVC
+#define IPTOS_NORMALSVC 0
+#endif
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter_ipv6.h b/ndk/platforms/android-3/include/linux/netfilter_ipv6.h
new file mode 100644
index 0000000..0d68cd9
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter_ipv6.h
@@ -0,0 +1,67 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __LINUX_IP6_NETFILTER_H
+#define __LINUX_IP6_NETFILTER_H
+
+#include <linux/netfilter.h>
+
+#define NFC_IP6_SRC 0x0001
+
+#define NFC_IP6_DST 0x0002
+
+#define NFC_IP6_IF_IN 0x0004
+
+#define NFC_IP6_IF_OUT 0x0008
+
+#define NFC_IP6_TOS 0x0010
+
+#define NFC_IP6_PROTO 0x0020
+
+#define NFC_IP6_OPTIONS 0x0040
+
+#define NFC_IP6_FRAG 0x0080
+
+#define NFC_IP6_TCPFLAGS 0x0100
+
+#define NFC_IP6_SRC_PT 0x0200
+
+#define NFC_IP6_DST_PT 0x0400
+
+#define NFC_IP6_PROTO_UNKNOWN 0x2000
+
+#define NF_IP6_PRE_ROUTING 0
+
+#define NF_IP6_LOCAL_IN 1
+
+#define NF_IP6_FORWARD 2
+
+#define NF_IP6_LOCAL_OUT 3
+
+#define NF_IP6_POST_ROUTING 4
+#define NF_IP6_NUMHOOKS 5
+
+enum nf_ip6_hook_priorities {
+ NF_IP6_PRI_FIRST = INT_MIN,
+ NF_IP6_PRI_CONNTRACK_DEFRAG = -400,
+ NF_IP6_PRI_SELINUX_FIRST = -225,
+ NF_IP6_PRI_CONNTRACK = -200,
+ NF_IP6_PRI_BRIDGE_SABOTAGE_FORWARD = -175,
+ NF_IP6_PRI_MANGLE = -150,
+ NF_IP6_PRI_NAT_DST = -100,
+ NF_IP6_PRI_BRIDGE_SABOTAGE_LOCAL_OUT = -50,
+ NF_IP6_PRI_FILTER = 0,
+ NF_IP6_PRI_NAT_SRC = 100,
+ NF_IP6_PRI_SELINUX_LAST = 225,
+ NF_IP6_PRI_LAST = INT_MAX,
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter_ipv6/ip6_tables.h b/ndk/platforms/android-3/include/linux/netfilter_ipv6/ip6_tables.h
new file mode 100644
index 0000000..1687e4f
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter_ipv6/ip6_tables.h
@@ -0,0 +1,178 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _IP6_TABLES_H
+#define _IP6_TABLES_H
+
+#include <linux/compiler.h>
+#include <linux/netfilter_ipv6.h>
+
+#include <linux/netfilter/x_tables.h>
+
+#define IP6T_FUNCTION_MAXNAMELEN XT_FUNCTION_MAXNAMELEN
+#define IP6T_TABLE_MAXNAMELEN XT_TABLE_MAXNAMELEN
+
+#define ip6t_match xt_match
+#define ip6t_target xt_target
+#define ip6t_table xt_table
+#define ip6t_get_revision xt_get_revision
+
+struct ip6t_ip6 {
+
+ struct in6_addr src, dst;
+
+ struct in6_addr smsk, dmsk;
+ char iniface[IFNAMSIZ], outiface[IFNAMSIZ];
+ unsigned char iniface_mask[IFNAMSIZ], outiface_mask[IFNAMSIZ];
+
+ u_int16_t proto;
+
+ u_int8_t tos;
+
+ u_int8_t flags;
+
+ u_int8_t invflags;
+};
+
+#define ip6t_entry_match xt_entry_match
+#define ip6t_entry_target xt_entry_target
+#define ip6t_standard_target xt_standard_target
+
+#define ip6t_counters xt_counters
+
+#define IP6T_F_PROTO 0x01  
+#define IP6T_F_TOS 0x02  
+#define IP6T_F_GOTO 0x04  
+#define IP6T_F_MASK 0x07  
+
+#define IP6T_INV_VIA_IN 0x01  
+#define IP6T_INV_VIA_OUT 0x02  
+#define IP6T_INV_TOS 0x04  
+#define IP6T_INV_SRCIP 0x08  
+#define IP6T_INV_DSTIP 0x10  
+#define IP6T_INV_FRAG 0x20  
+#define IP6T_INV_PROTO XT_INV_PROTO
+#define IP6T_INV_MASK 0x7F  
+
+struct ip6t_entry
+{
+ struct ip6t_ip6 ipv6;
+
+ unsigned int nfcache;
+
+ u_int16_t target_offset;
+
+ u_int16_t next_offset;
+
+ unsigned int comefrom;
+
+ struct xt_counters counters;
+
+ unsigned char elems[0];
+};
+
+#define IP6T_BASE_CTL XT_BASE_CTL
+
+#define IP6T_SO_SET_REPLACE XT_SO_SET_REPLACE
+#define IP6T_SO_SET_ADD_COUNTERS XT_SO_SET_ADD_COUNTERS
+#define IP6T_SO_SET_MAX XT_SO_SET_MAX
+
+#define IP6T_SO_GET_INFO XT_SO_GET_INFO
+#define IP6T_SO_GET_ENTRIES XT_SO_GET_ENTRIES
+#define IP6T_SO_GET_REVISION_MATCH XT_SO_GET_REVISION_MATCH
+#define IP6T_SO_GET_REVISION_TARGET XT_SO_GET_REVISION_TARGET
+#define IP6T_SO_GET_MAX XT_SO_GET_REVISION_TARGET
+
+#define IP6T_CONTINUE XT_CONTINUE
+
+#define IP6T_RETURN XT_RETURN
+
+#include <linux/netfilter/xt_tcpudp.h>
+
+#define ip6t_tcp xt_tcp
+#define ip6t_udp xt_udp
+
+#define IP6T_TCP_INV_SRCPT XT_TCP_INV_SRCPT
+#define IP6T_TCP_INV_DSTPT XT_TCP_INV_DSTPT
+#define IP6T_TCP_INV_FLAGS XT_TCP_INV_FLAGS
+#define IP6T_TCP_INV_OPTION XT_TCP_INV_OPTION
+#define IP6T_TCP_INV_MASK XT_TCP_INV_MASK
+
+#define IP6T_UDP_INV_SRCPT XT_UDP_INV_SRCPT
+#define IP6T_UDP_INV_DSTPT XT_UDP_INV_DSTPT
+#define IP6T_UDP_INV_MASK XT_UDP_INV_MASK
+
+struct ip6t_icmp
+{
+ u_int8_t type;
+ u_int8_t code[2];
+ u_int8_t invflags;
+};
+
+#define IP6T_ICMP_INV 0x01  
+
+struct ip6t_getinfo
+{
+
+ char name[IP6T_TABLE_MAXNAMELEN];
+
+ unsigned int valid_hooks;
+
+ unsigned int hook_entry[NF_IP6_NUMHOOKS];
+
+ unsigned int underflow[NF_IP6_NUMHOOKS];
+
+ unsigned int num_entries;
+
+ unsigned int size;
+};
+
+struct ip6t_replace
+{
+
+ char name[IP6T_TABLE_MAXNAMELEN];
+
+ unsigned int valid_hooks;
+
+ unsigned int num_entries;
+
+ unsigned int size;
+
+ unsigned int hook_entry[NF_IP6_NUMHOOKS];
+
+ unsigned int underflow[NF_IP6_NUMHOOKS];
+
+ unsigned int num_counters;
+
+ struct xt_counters __user *counters;
+
+ struct ip6t_entry entries[0];
+};
+
+#define ip6t_counters_info xt_counters_info
+
+struct ip6t_get_entries
+{
+
+ char name[IP6T_TABLE_MAXNAMELEN];
+
+ unsigned int size;
+
+ struct ip6t_entry entrytable[0];
+};
+
+#define IP6T_STANDARD_TARGET XT_STANDARD_TARGET
+
+#define IP6T_ERROR_TARGET XT_ERROR_TARGET
+
+#define IP6T_MATCH_ITERATE(e, fn, args...)  ({   unsigned int __i;   int __ret = 0;   struct ip6t_entry_match *__m;     for (__i = sizeof(struct ip6t_entry);   __i < (e)->target_offset;   __i += __m->u.match_size) {   __m = (void *)(e) + __i;     __ret = fn(__m , ## args);   if (__ret != 0)   break;   }   __ret;  })
+#define IP6T_ENTRY_ITERATE(entries, size, fn, args...)  ({   unsigned int __i;   int __ret = 0;   struct ip6t_entry *__e;     for (__i = 0; __i < (size); __i += __e->next_offset) {   __e = (void *)(entries) + __i;     __ret = fn(__e , ## args);   if (__ret != 0)   break;   }   __ret;  })
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter_ipv6/ip6t_LOG.h b/ndk/platforms/android-3/include/linux/netfilter_ipv6/ip6t_LOG.h
new file mode 100644
index 0000000..344c133
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter_ipv6/ip6t_LOG.h
@@ -0,0 +1,28 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _IP6T_LOG_H
+#define _IP6T_LOG_H
+
+#define IP6T_LOG_TCPSEQ 0x01  
+#define IP6T_LOG_TCPOPT 0x02  
+#define IP6T_LOG_IPOPT 0x04  
+#define IP6T_LOG_UID 0x08  
+#define IP6T_LOG_NFLOG 0x10  
+#define IP6T_LOG_MASK 0x1f
+
+struct ip6t_log_info {
+ unsigned char level;
+ unsigned char logflags;
+ char prefix[30];
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter_ipv6/ip6t_REJECT.h b/ndk/platforms/android-3/include/linux/netfilter_ipv6/ip6t_REJECT.h
new file mode 100644
index 0000000..b101c85
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter_ipv6/ip6t_REJECT.h
@@ -0,0 +1,29 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _IP6T_REJECT_H
+#define _IP6T_REJECT_H
+
+enum ip6t_reject_with {
+ IP6T_ICMP6_NO_ROUTE,
+ IP6T_ICMP6_ADM_PROHIBITED,
+ IP6T_ICMP6_NOT_NEIGHBOUR,
+ IP6T_ICMP6_ADDR_UNREACH,
+ IP6T_ICMP6_PORT_UNREACH,
+ IP6T_ICMP6_ECHOREPLY,
+ IP6T_TCP_RESET
+};
+
+struct ip6t_reject_info {
+ u_int32_t with;
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter_ipv6/ip6t_ah.h b/ndk/platforms/android-3/include/linux/netfilter_ipv6/ip6t_ah.h
new file mode 100644
index 0000000..7110df5
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter_ipv6/ip6t_ah.h
@@ -0,0 +1,31 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _IP6T_AH_H
+#define _IP6T_AH_H
+
+struct ip6t_ah
+{
+ u_int32_t spis[2];
+ u_int32_t hdrlen;
+ u_int8_t hdrres;
+ u_int8_t invflags;
+};
+
+#define IP6T_AH_SPI 0x01
+#define IP6T_AH_LEN 0x02
+#define IP6T_AH_RES 0x04
+
+#define IP6T_AH_INV_SPI 0x01  
+#define IP6T_AH_INV_LEN 0x02  
+#define IP6T_AH_INV_MASK 0x03  
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter_ipv6/ip6t_esp.h b/ndk/platforms/android-3/include/linux/netfilter_ipv6/ip6t_esp.h
new file mode 100644
index 0000000..0aa7556
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter_ipv6/ip6t_esp.h
@@ -0,0 +1,21 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _IP6T_ESP_H
+#define _IP6T_ESP_H
+
+#include <linux/netfilter/xt_esp.h>
+
+#define ip6t_esp xt_esp
+#define IP6T_ESP_INV_SPI XT_ESP_INV_SPI
+#define IP6T_ESP_INV_MASK XT_ESP_INV_MASK
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter_ipv6/ip6t_frag.h b/ndk/platforms/android-3/include/linux/netfilter_ipv6/ip6t_frag.h
new file mode 100644
index 0000000..134d6bb
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter_ipv6/ip6t_frag.h
@@ -0,0 +1,34 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _IP6T_FRAG_H
+#define _IP6T_FRAG_H
+
+struct ip6t_frag
+{
+ u_int32_t ids[2];
+ u_int32_t hdrlen;
+ u_int8_t flags;
+ u_int8_t invflags;
+};
+
+#define IP6T_FRAG_IDS 0x01
+#define IP6T_FRAG_LEN 0x02
+#define IP6T_FRAG_RES 0x04
+#define IP6T_FRAG_FST 0x08
+#define IP6T_FRAG_MF 0x10
+#define IP6T_FRAG_NMF 0x20
+
+#define IP6T_FRAG_INV_IDS 0x01  
+#define IP6T_FRAG_INV_LEN 0x02  
+#define IP6T_FRAG_INV_MASK 0x03  
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter_ipv6/ip6t_ipv6header.h b/ndk/platforms/android-3/include/linux/netfilter_ipv6/ip6t_ipv6header.h
new file mode 100644
index 0000000..7e83ebc
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter_ipv6/ip6t_ipv6header.h
@@ -0,0 +1,31 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __IPV6HEADER_H
+#define __IPV6HEADER_H
+
+struct ip6t_ipv6header_info
+{
+ u_int8_t matchflags;
+ u_int8_t invflags;
+ u_int8_t modeflag;
+};
+
+#define MASK_HOPOPTS 128
+#define MASK_DSTOPTS 64
+#define MASK_ROUTING 32
+#define MASK_FRAGMENT 16
+#define MASK_AH 8
+#define MASK_ESP 4
+#define MASK_NONE 2
+#define MASK_PROTO 1
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter_ipv6/ip6t_length.h b/ndk/platforms/android-3/include/linux/netfilter_ipv6/ip6t_length.h
new file mode 100644
index 0000000..fdc4c5f
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter_ipv6/ip6t_length.h
@@ -0,0 +1,19 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _IP6T_LENGTH_H
+#define _IP6T_LENGTH_H
+
+#include <linux/netfilter/xt_length.h>
+#define ip6t_length_info xt_length_info
+
+#endif
+
diff --git a/ndk/platforms/android-3/include/linux/netfilter_ipv6/ip6t_mac.h b/ndk/platforms/android-3/include/linux/netfilter_ipv6/ip6t_mac.h
new file mode 100644
index 0000000..58e6023
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter_ipv6/ip6t_mac.h
@@ -0,0 +1,18 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _IP6T_MAC_H
+#define _IP6T_MAC_H
+
+#include <linux/netfilter/xt_mac.h>
+#define ip6t_mac_info xt_mac_info
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter_ipv6/ip6t_opts.h b/ndk/platforms/android-3/include/linux/netfilter_ipv6/ip6t_opts.h
new file mode 100644
index 0000000..1d9db9c
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter_ipv6/ip6t_opts.h
@@ -0,0 +1,33 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _IP6T_OPTS_H
+#define _IP6T_OPTS_H
+
+#define IP6T_OPTS_OPTSNR 16
+
+struct ip6t_opts
+{
+ u_int32_t hdrlen;
+ u_int8_t flags;
+ u_int8_t invflags;
+ u_int16_t opts[IP6T_OPTS_OPTSNR];
+ u_int8_t optsnr;
+};
+
+#define IP6T_OPTS_LEN 0x01
+#define IP6T_OPTS_OPTS 0x02
+#define IP6T_OPTS_NSTRICT 0x04
+
+#define IP6T_OPTS_INV_LEN 0x01  
+#define IP6T_OPTS_INV_MASK 0x01  
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter_ipv6/ip6t_owner.h b/ndk/platforms/android-3/include/linux/netfilter_ipv6/ip6t_owner.h
new file mode 100644
index 0000000..a6126b4
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter_ipv6/ip6t_owner.h
@@ -0,0 +1,28 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _IP6T_OWNER_H
+#define _IP6T_OWNER_H
+
+#define IP6T_OWNER_UID 0x01
+#define IP6T_OWNER_GID 0x02
+#define IP6T_OWNER_PID 0x04
+#define IP6T_OWNER_SID 0x08
+
+struct ip6t_owner_info {
+ uid_t uid;
+ gid_t gid;
+ pid_t pid;
+ pid_t sid;
+ u_int8_t match, invert;
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter_ipv6/ip6t_physdev.h b/ndk/platforms/android-3/include/linux/netfilter_ipv6/ip6t_physdev.h
new file mode 100644
index 0000000..657e2fb
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter_ipv6/ip6t_physdev.h
@@ -0,0 +1,26 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _IP6T_PHYSDEV_H
+#define _IP6T_PHYSDEV_H
+
+#include <linux/netfilter/xt_physdev.h>
+
+#define IP6T_PHYSDEV_OP_IN XT_PHYSDEV_OP_IN
+#define IP6T_PHYSDEV_OP_OUT XT_PHYSDEV_OP_OUT
+#define IP6T_PHYSDEV_OP_BRIDGED XT_PHYSDEV_OP_BRIDGED
+#define IP6T_PHYSDEV_OP_ISIN XT_PHYSDEV_OP_ISIN
+#define IP6T_PHYSDEV_OP_ISOUT XT_PHYSDEV_OP_ISOUT
+#define IP6T_PHYSDEV_OP_MASK XT_PHYSDEV_OP_MASK
+
+#define ip6t_physdev_info xt_physdev_info
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netfilter_ipv6/ip6t_rt.h b/ndk/platforms/android-3/include/linux/netfilter_ipv6/ip6t_rt.h
new file mode 100644
index 0000000..274a7ee
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netfilter_ipv6/ip6t_rt.h
@@ -0,0 +1,41 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _IP6T_RT_H
+#define _IP6T_RT_H
+
+#define IP6T_RT_HOPS 16
+
+struct ip6t_rt
+{
+ u_int32_t rt_type;
+ u_int32_t segsleft[2];
+ u_int32_t hdrlen;
+ u_int8_t flags;
+ u_int8_t invflags;
+ struct in6_addr addrs[IP6T_RT_HOPS];
+ u_int8_t addrnr;
+};
+
+#define IP6T_RT_TYP 0x01
+#define IP6T_RT_SGS 0x02
+#define IP6T_RT_LEN 0x04
+#define IP6T_RT_RES 0x08
+#define IP6T_RT_FST_MASK 0x30
+#define IP6T_RT_FST 0x10
+#define IP6T_RT_FST_NSTRICT 0x20
+
+#define IP6T_RT_INV_TYP 0x01  
+#define IP6T_RT_INV_SGS 0x02  
+#define IP6T_RT_INV_LEN 0x04  
+#define IP6T_RT_INV_MASK 0x07  
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/netlink.h b/ndk/platforms/android-3/include/linux/netlink.h
new file mode 100644
index 0000000..b6f1c06
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/netlink.h
@@ -0,0 +1,119 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __LINUX_NETLINK_H
+#define __LINUX_NETLINK_H
+
+#include <linux/socket.h>  
+#include <linux/types.h>
+
+#define NETLINK_ROUTE 0  
+#define NETLINK_UNUSED 1  
+#define NETLINK_USERSOCK 2  
+#define NETLINK_FIREWALL 3  
+#define NETLINK_INET_DIAG 4  
+#define NETLINK_NFLOG 5  
+#define NETLINK_XFRM 6  
+#define NETLINK_SELINUX 7  
+#define NETLINK_ISCSI 8  
+#define NETLINK_AUDIT 9  
+#define NETLINK_FIB_LOOKUP 10 
+#define NETLINK_CONNECTOR 11
+#define NETLINK_NETFILTER 12  
+#define NETLINK_IP6_FW 13
+#define NETLINK_DNRTMSG 14  
+#define NETLINK_KOBJECT_UEVENT 15  
+#define NETLINK_GENERIC 16
+
+#define MAX_LINKS 32 
+
+struct sockaddr_nl
+{
+ sa_family_t nl_family;
+ unsigned short nl_pad;
+ __u32 nl_pid;
+ __u32 nl_groups;
+};
+
+struct nlmsghdr
+{
+ __u32 nlmsg_len;
+ __u16 nlmsg_type;
+ __u16 nlmsg_flags;
+ __u32 nlmsg_seq;
+ __u32 nlmsg_pid;
+};
+
+#define NLM_F_REQUEST 1  
+#define NLM_F_MULTI 2  
+#define NLM_F_ACK 4  
+#define NLM_F_ECHO 8  
+
+#define NLM_F_ROOT 0x100  
+#define NLM_F_MATCH 0x200  
+#define NLM_F_ATOMIC 0x400  
+#define NLM_F_DUMP (NLM_F_ROOT|NLM_F_MATCH)
+
+#define NLM_F_REPLACE 0x100  
+#define NLM_F_EXCL 0x200  
+#define NLM_F_CREATE 0x400  
+#define NLM_F_APPEND 0x800  
+
+#define NLMSG_ALIGNTO 4
+#define NLMSG_ALIGN(len) ( ((len)+NLMSG_ALIGNTO-1) & ~(NLMSG_ALIGNTO-1) )
+#define NLMSG_HDRLEN ((int) NLMSG_ALIGN(sizeof(struct nlmsghdr)))
+#define NLMSG_LENGTH(len) ((len)+NLMSG_ALIGN(NLMSG_HDRLEN))
+#define NLMSG_SPACE(len) NLMSG_ALIGN(NLMSG_LENGTH(len))
+#define NLMSG_DATA(nlh) ((void*)(((char*)nlh) + NLMSG_LENGTH(0)))
+#define NLMSG_NEXT(nlh,len) ((len) -= NLMSG_ALIGN((nlh)->nlmsg_len),   (struct nlmsghdr*)(((char*)(nlh)) + NLMSG_ALIGN((nlh)->nlmsg_len)))
+#define NLMSG_OK(nlh,len) ((len) >= (int)sizeof(struct nlmsghdr) &&   (nlh)->nlmsg_len >= sizeof(struct nlmsghdr) &&   (nlh)->nlmsg_len <= (len))
+#define NLMSG_PAYLOAD(nlh,len) ((nlh)->nlmsg_len - NLMSG_SPACE((len)))
+
+#define NLMSG_NOOP 0x1  
+#define NLMSG_ERROR 0x2  
+#define NLMSG_DONE 0x3  
+#define NLMSG_OVERRUN 0x4  
+
+#define NLMSG_MIN_TYPE 0x10  
+
+struct nlmsgerr
+{
+ int error;
+ struct nlmsghdr msg;
+};
+
+#define NETLINK_ADD_MEMBERSHIP 1
+#define NETLINK_DROP_MEMBERSHIP 2
+#define NETLINK_PKTINFO 3
+
+struct nl_pktinfo
+{
+ __u32 group;
+};
+
+#define NET_MAJOR 36  
+
+enum {
+ NETLINK_UNCONNECTED = 0,
+ NETLINK_CONNECTED,
+};
+
+struct nlattr
+{
+ __u16 nla_len;
+ __u16 nla_type;
+};
+
+#define NLA_ALIGNTO 4
+#define NLA_ALIGN(len) (((len) + NLA_ALIGNTO - 1) & ~(NLA_ALIGNTO - 1))
+#define NLA_HDRLEN ((int) NLA_ALIGN(sizeof(struct nlattr)))
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/nfs.h b/ndk/platforms/android-3/include/linux/nfs.h
new file mode 100644
index 0000000..d94dc9f
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/nfs.h
@@ -0,0 +1,124 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_NFS_H
+#define _LINUX_NFS_H
+
+#define NFS_PROGRAM 100003
+#define NFS_PORT 2049
+#define NFS_MAXDATA 8192
+#define NFS_MAXPATHLEN 1024
+#define NFS_MAXNAMLEN 255
+#define NFS_MAXGROUPS 16
+#define NFS_FHSIZE 32
+#define NFS_COOKIESIZE 4
+#define NFS_FIFO_DEV (-1)
+#define NFSMODE_FMT 0170000
+#define NFSMODE_DIR 0040000
+#define NFSMODE_CHR 0020000
+#define NFSMODE_BLK 0060000
+#define NFSMODE_REG 0100000
+#define NFSMODE_LNK 0120000
+#define NFSMODE_SOCK 0140000
+#define NFSMODE_FIFO 0010000
+
+#define NFS_MNT_PROGRAM 100005
+#define NFS_MNT_PORT 627
+
+ enum nfs_stat {
+ NFS_OK = 0,
+ NFSERR_PERM = 1,
+ NFSERR_NOENT = 2,
+ NFSERR_IO = 5,
+ NFSERR_NXIO = 6,
+ NFSERR_EAGAIN = 11,
+ NFSERR_ACCES = 13,
+ NFSERR_EXIST = 17,
+ NFSERR_XDEV = 18,
+ NFSERR_NODEV = 19,
+ NFSERR_NOTDIR = 20,
+ NFSERR_ISDIR = 21,
+ NFSERR_INVAL = 22,
+ NFSERR_FBIG = 27,
+ NFSERR_NOSPC = 28,
+ NFSERR_ROFS = 30,
+ NFSERR_MLINK = 31,
+ NFSERR_OPNOTSUPP = 45,
+ NFSERR_NAMETOOLONG = 63,
+ NFSERR_NOTEMPTY = 66,
+ NFSERR_DQUOT = 69,
+ NFSERR_STALE = 70,
+ NFSERR_REMOTE = 71,
+ NFSERR_WFLUSH = 99,
+ NFSERR_BADHANDLE = 10001,
+ NFSERR_NOT_SYNC = 10002,
+ NFSERR_BAD_COOKIE = 10003,
+ NFSERR_NOTSUPP = 10004,
+ NFSERR_TOOSMALL = 10005,
+ NFSERR_SERVERFAULT = 10006,
+ NFSERR_BADTYPE = 10007,
+ NFSERR_JUKEBOX = 10008,
+ NFSERR_SAME = 10009,
+ NFSERR_DENIED = 10010,
+ NFSERR_EXPIRED = 10011,
+ NFSERR_LOCKED = 10012,
+ NFSERR_GRACE = 10013,
+ NFSERR_FHEXPIRED = 10014,
+ NFSERR_SHARE_DENIED = 10015,
+ NFSERR_WRONGSEC = 10016,
+ NFSERR_CLID_INUSE = 10017,
+ NFSERR_RESOURCE = 10018,
+ NFSERR_MOVED = 10019,
+ NFSERR_NOFILEHANDLE = 10020,
+ NFSERR_MINOR_VERS_MISMATCH = 10021,
+ NFSERR_STALE_CLIENTID = 10022,
+ NFSERR_STALE_STATEID = 10023,
+ NFSERR_OLD_STATEID = 10024,
+ NFSERR_BAD_STATEID = 10025,
+ NFSERR_BAD_SEQID = 10026,
+ NFSERR_NOT_SAME = 10027,
+ NFSERR_LOCK_RANGE = 10028,
+ NFSERR_SYMLINK = 10029,
+ NFSERR_RESTOREFH = 10030,
+ NFSERR_LEASE_MOVED = 10031,
+ NFSERR_ATTRNOTSUPP = 10032,
+ NFSERR_NO_GRACE = 10033,
+ NFSERR_RECLAIM_BAD = 10034,
+ NFSERR_RECLAIM_CONFLICT = 10035,
+ NFSERR_BAD_XDR = 10036,
+ NFSERR_LOCKS_HELD = 10037,
+ NFSERR_OPENMODE = 10038,
+ NFSERR_BADOWNER = 10039,
+ NFSERR_BADCHAR = 10040,
+ NFSERR_BADNAME = 10041,
+ NFSERR_BAD_RANGE = 10042,
+ NFSERR_LOCK_NOTSUPP = 10043,
+ NFSERR_OP_ILLEGAL = 10044,
+ NFSERR_DEADLOCK = 10045,
+ NFSERR_FILE_OPEN = 10046,
+ NFSERR_ADMIN_REVOKED = 10047,
+ NFSERR_CB_PATH_DOWN = 10048,
+ NFSERR_REPLAY_ME = 10049
+};
+
+enum nfs_ftype {
+ NFNON = 0,
+ NFREG = 1,
+ NFDIR = 2,
+ NFBLK = 3,
+ NFCHR = 4,
+ NFLNK = 5,
+ NFSOCK = 6,
+ NFBAD = 7,
+ NFFIFO = 8
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/nfs2.h b/ndk/platforms/android-3/include/linux/nfs2.h
new file mode 100644
index 0000000..1bb5df2
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/nfs2.h
@@ -0,0 +1,75 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_NFS2_H
+#define _LINUX_NFS2_H
+
+#define NFS2_PORT 2049
+#define NFS2_MAXDATA 8192
+#define NFS2_MAXPATHLEN 1024
+#define NFS2_MAXNAMLEN 255
+#define NFS2_MAXGROUPS 16
+#define NFS2_FHSIZE 32
+#define NFS2_COOKIESIZE 4
+#define NFS2_FIFO_DEV (-1)
+#define NFS2MODE_FMT 0170000
+#define NFS2MODE_DIR 0040000
+#define NFS2MODE_CHR 0020000
+#define NFS2MODE_BLK 0060000
+#define NFS2MODE_REG 0100000
+#define NFS2MODE_LNK 0120000
+#define NFS2MODE_SOCK 0140000
+#define NFS2MODE_FIFO 0010000
+
+enum nfs2_ftype {
+ NF2NON = 0,
+ NF2REG = 1,
+ NF2DIR = 2,
+ NF2BLK = 3,
+ NF2CHR = 4,
+ NF2LNK = 5,
+ NF2SOCK = 6,
+ NF2BAD = 7,
+ NF2FIFO = 8
+};
+
+struct nfs2_fh {
+ char data[NFS2_FHSIZE];
+};
+
+#define NFS2_VERSION 2
+#define NFSPROC_NULL 0
+#define NFSPROC_GETATTR 1
+#define NFSPROC_SETATTR 2
+#define NFSPROC_ROOT 3
+#define NFSPROC_LOOKUP 4
+#define NFSPROC_READLINK 5
+#define NFSPROC_READ 6
+#define NFSPROC_WRITECACHE 7
+#define NFSPROC_WRITE 8
+#define NFSPROC_CREATE 9
+#define NFSPROC_REMOVE 10
+#define NFSPROC_RENAME 11
+#define NFSPROC_LINK 12
+#define NFSPROC_SYMLINK 13
+#define NFSPROC_MKDIR 14
+#define NFSPROC_RMDIR 15
+#define NFSPROC_READDIR 16
+#define NFSPROC_STATFS 17
+
+#define NFS_MNT_PROGRAM 100005
+#define NFS_MNT_VERSION 1
+#define MNTPROC_NULL 0
+#define MNTPROC_MNT 1
+#define MNTPROC_UMNT 3
+#define MNTPROC_UMNTALL 4
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/nfs3.h b/ndk/platforms/android-3/include/linux/nfs3.h
new file mode 100644
index 0000000..8303459
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/nfs3.h
@@ -0,0 +1,108 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_NFS3_H
+#define _LINUX_NFS3_H
+
+#define NFS3_PORT 2049
+#define NFS3_MAXDATA 32768
+#define NFS3_MAXPATHLEN PATH_MAX
+#define NFS3_MAXNAMLEN NAME_MAX
+#define NFS3_MAXGROUPS 16
+#define NFS3_FHSIZE 64
+#define NFS3_COOKIESIZE 4
+#define NFS3_FIFO_DEV (-1)
+#define NFS3MODE_FMT 0170000
+#define NFS3MODE_DIR 0040000
+#define NFS3MODE_CHR 0020000
+#define NFS3MODE_BLK 0060000
+#define NFS3MODE_REG 0100000
+#define NFS3MODE_LNK 0120000
+#define NFS3MODE_SOCK 0140000
+#define NFS3MODE_FIFO 0010000
+
+#define NFS3_ACCESS_READ 0x0001
+#define NFS3_ACCESS_LOOKUP 0x0002
+#define NFS3_ACCESS_MODIFY 0x0004
+#define NFS3_ACCESS_EXTEND 0x0008
+#define NFS3_ACCESS_DELETE 0x0010
+#define NFS3_ACCESS_EXECUTE 0x0020
+#define NFS3_ACCESS_FULL 0x003f
+
+enum nfs3_createmode {
+ NFS3_CREATE_UNCHECKED = 0,
+ NFS3_CREATE_GUARDED = 1,
+ NFS3_CREATE_EXCLUSIVE = 2
+};
+
+#define NFS3_FSF_LINK 0x0001
+#define NFS3_FSF_SYMLINK 0x0002
+#define NFS3_FSF_HOMOGENEOUS 0x0008
+#define NFS3_FSF_CANSETTIME 0x0010
+
+#define NFS3_FSF_DEFAULT 0x001B
+#define NFS3_FSF_BILLYBOY 0x0018
+#define NFS3_FSF_READONLY 0x0008
+
+enum nfs3_ftype {
+ NF3NON = 0,
+ NF3REG = 1,
+ NF3DIR = 2,
+ NF3BLK = 3,
+ NF3CHR = 4,
+ NF3LNK = 5,
+ NF3SOCK = 6,
+ NF3FIFO = 7,
+ NF3BAD = 8
+};
+
+struct nfs3_fh {
+ unsigned short size;
+ unsigned char data[NFS3_FHSIZE];
+};
+
+#define NFS3_VERSION 3
+#define NFS3PROC_NULL 0
+#define NFS3PROC_GETATTR 1
+#define NFS3PROC_SETATTR 2
+#define NFS3PROC_LOOKUP 3
+#define NFS3PROC_ACCESS 4
+#define NFS3PROC_READLINK 5
+#define NFS3PROC_READ 6
+#define NFS3PROC_WRITE 7
+#define NFS3PROC_CREATE 8
+#define NFS3PROC_MKDIR 9
+#define NFS3PROC_SYMLINK 10
+#define NFS3PROC_MKNOD 11
+#define NFS3PROC_REMOVE 12
+#define NFS3PROC_RMDIR 13
+#define NFS3PROC_RENAME 14
+#define NFS3PROC_LINK 15
+#define NFS3PROC_READDIR 16
+#define NFS3PROC_READDIRPLUS 17
+#define NFS3PROC_FSSTAT 18
+#define NFS3PROC_FSINFO 19
+#define NFS3PROC_PATHCONF 20
+#define NFS3PROC_COMMIT 21
+
+#define NFS_MNT3_PROGRAM 100005
+#define NFS_MNT3_VERSION 3
+#define MOUNTPROC3_NULL 0
+#define MOUNTPROC3_MNT 1
+#define MOUNTPROC3_UMNT 3
+#define MOUNTPROC3_UMNTALL 4
+
+#ifdef NFS_NEED_KERNEL_TYPES
+
+#define NFS3_POST_OP_ATTR_WORDS 22
+
+#endif
+#endif
diff --git a/ndk/platforms/android-3/include/linux/nfs4.h b/ndk/platforms/android-3/include/linux/nfs4.h
new file mode 100644
index 0000000..2e95e45
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/nfs4.h
@@ -0,0 +1,99 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_NFS4_H
+#define _LINUX_NFS4_H
+
+#include <linux/types.h>
+
+#define NFS4_VERIFIER_SIZE 8
+#define NFS4_FHSIZE 128
+#define NFS4_MAXPATHLEN PATH_MAX
+#define NFS4_MAXNAMLEN NAME_MAX
+
+#define NFS4_ACCESS_READ 0x0001
+#define NFS4_ACCESS_LOOKUP 0x0002
+#define NFS4_ACCESS_MODIFY 0x0004
+#define NFS4_ACCESS_EXTEND 0x0008
+#define NFS4_ACCESS_DELETE 0x0010
+#define NFS4_ACCESS_EXECUTE 0x0020
+
+#define NFS4_FH_PERSISTENT 0x0000
+#define NFS4_FH_NOEXPIRE_WITH_OPEN 0x0001
+#define NFS4_FH_VOLATILE_ANY 0x0002
+#define NFS4_FH_VOL_MIGRATION 0x0004
+#define NFS4_FH_VOL_RENAME 0x0008
+
+#define NFS4_OPEN_RESULT_CONFIRM 0x0002
+#define NFS4_OPEN_RESULT_LOCKTYPE_POSIX 0x0004
+
+#define NFS4_SHARE_ACCESS_READ 0x0001
+#define NFS4_SHARE_ACCESS_WRITE 0x0002
+#define NFS4_SHARE_ACCESS_BOTH 0x0003
+#define NFS4_SHARE_DENY_READ 0x0001
+#define NFS4_SHARE_DENY_WRITE 0x0002
+#define NFS4_SHARE_DENY_BOTH 0x0003
+
+#define NFS4_SET_TO_SERVER_TIME 0
+#define NFS4_SET_TO_CLIENT_TIME 1
+
+#define NFS4_ACE_ACCESS_ALLOWED_ACE_TYPE 0
+#define NFS4_ACE_ACCESS_DENIED_ACE_TYPE 1
+#define NFS4_ACE_SYSTEM_AUDIT_ACE_TYPE 2
+#define NFS4_ACE_SYSTEM_ALARM_ACE_TYPE 3
+
+#define ACL4_SUPPORT_ALLOW_ACL 0x01
+#define ACL4_SUPPORT_DENY_ACL 0x02
+#define ACL4_SUPPORT_AUDIT_ACL 0x04
+#define ACL4_SUPPORT_ALARM_ACL 0x08
+
+#define NFS4_ACE_FILE_INHERIT_ACE 0x00000001
+#define NFS4_ACE_DIRECTORY_INHERIT_ACE 0x00000002
+#define NFS4_ACE_NO_PROPAGATE_INHERIT_ACE 0x00000004
+#define NFS4_ACE_INHERIT_ONLY_ACE 0x00000008
+#define NFS4_ACE_SUCCESSFUL_ACCESS_ACE_FLAG 0x00000010
+#define NFS4_ACE_FAILED_ACCESS_ACE_FLAG 0x00000020
+#define NFS4_ACE_IDENTIFIER_GROUP 0x00000040
+#define NFS4_ACE_OWNER 0x00000080
+#define NFS4_ACE_GROUP 0x00000100
+#define NFS4_ACE_EVERYONE 0x00000200
+
+#define NFS4_ACE_READ_DATA 0x00000001
+#define NFS4_ACE_LIST_DIRECTORY 0x00000001
+#define NFS4_ACE_WRITE_DATA 0x00000002
+#define NFS4_ACE_ADD_FILE 0x00000002
+#define NFS4_ACE_APPEND_DATA 0x00000004
+#define NFS4_ACE_ADD_SUBDIRECTORY 0x00000004
+#define NFS4_ACE_READ_NAMED_ATTRS 0x00000008
+#define NFS4_ACE_WRITE_NAMED_ATTRS 0x00000010
+#define NFS4_ACE_EXECUTE 0x00000020
+#define NFS4_ACE_DELETE_CHILD 0x00000040
+#define NFS4_ACE_READ_ATTRIBUTES 0x00000080
+#define NFS4_ACE_WRITE_ATTRIBUTES 0x00000100
+#define NFS4_ACE_DELETE 0x00010000
+#define NFS4_ACE_READ_ACL 0x00020000
+#define NFS4_ACE_WRITE_ACL 0x00040000
+#define NFS4_ACE_WRITE_OWNER 0x00080000
+#define NFS4_ACE_SYNCHRONIZE 0x00100000
+#define NFS4_ACE_GENERIC_READ 0x00120081
+#define NFS4_ACE_GENERIC_WRITE 0x00160106
+#define NFS4_ACE_GENERIC_EXECUTE 0x001200A0
+#define NFS4_ACE_MASK_ALL 0x001F01FF
+
+enum nfs4_acl_whotype {
+ NFS4_ACL_WHO_NAMED = 0,
+ NFS4_ACL_WHO_OWNER,
+ NFS4_ACL_WHO_GROUP,
+ NFS4_ACL_WHO_EVERYONE,
+};
+
+#endif
+
diff --git a/ndk/platforms/android-3/include/linux/nfs_xdr.h b/ndk/platforms/android-3/include/linux/nfs_xdr.h
new file mode 100644
index 0000000..48fe262
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/nfs_xdr.h
@@ -0,0 +1,556 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_NFS_XDR_H
+#define _LINUX_NFS_XDR_H
+
+#include <linux/sunrpc/xprt.h>
+#include <linux/nfsacl.h>
+
+#define NFS_MAX_FILE_IO_SIZE (1048576U)
+#define NFS_DEF_FILE_IO_SIZE (4096U)
+#define NFS_MIN_FILE_IO_SIZE (1024U)
+
+struct nfs_fsid {
+ uint64_t major;
+ uint64_t minor;
+};
+
+#define NFS_ATTR_WCC 0x0001  
+#define NFS_ATTR_FATTR 0x0002  
+#define NFS_ATTR_FATTR_V3 0x0004  
+#define NFS_ATTR_FATTR_V4 0x0008  
+#define NFS_ATTR_FATTR_V4_REFERRAL 0x0010  
+
+struct nfs_fsinfo {
+ struct nfs_fattr *fattr;
+ __u32 rtmax;
+ __u32 rtpref;
+ __u32 rtmult;
+ __u32 wtmax;
+ __u32 wtpref;
+ __u32 wtmult;
+ __u32 dtpref;
+ __u64 maxfilesize;
+ __u32 lease_time;
+};
+
+struct nfs_fsstat {
+ struct nfs_fattr *fattr;
+ __u64 tbytes;
+ __u64 fbytes;
+ __u64 abytes;
+ __u64 tfiles;
+ __u64 ffiles;
+ __u64 afiles;
+};
+
+struct nfs2_fsstat {
+ __u32 tsize;
+ __u32 bsize;
+ __u32 blocks;
+ __u32 bfree;
+ __u32 bavail;
+};
+
+struct nfs_pathconf {
+ struct nfs_fattr *fattr;
+ __u32 max_link;
+ __u32 max_namelen;
+};
+
+struct nfs4_change_info {
+ u32 atomic;
+ u64 before;
+ u64 after;
+};
+
+struct nfs_seqid;
+
+struct nfs_openargs {
+ const struct nfs_fh * fh;
+ struct nfs_seqid * seqid;
+ int open_flags;
+ __u64 clientid;
+ __u32 id;
+ union {
+ struct iattr * attrs;
+ nfs4_verifier verifier;
+ nfs4_stateid delegation;
+ int delegation_type;
+ } u;
+ const struct qstr * name;
+ const struct nfs_server *server;
+ const u32 * bitmask;
+ __u32 claim;
+};
+
+struct nfs_openres {
+ nfs4_stateid stateid;
+ struct nfs_fh fh;
+ struct nfs4_change_info cinfo;
+ __u32 rflags;
+ struct nfs_fattr * f_attr;
+ struct nfs_fattr * dir_attr;
+ const struct nfs_server *server;
+ int delegation_type;
+ nfs4_stateid delegation;
+ __u32 do_recall;
+ __u64 maxsize;
+};
+
+struct nfs_open_confirmargs {
+ const struct nfs_fh * fh;
+ nfs4_stateid * stateid;
+ struct nfs_seqid * seqid;
+};
+
+struct nfs_open_confirmres {
+ nfs4_stateid stateid;
+};
+
+struct nfs_closeargs {
+ struct nfs_fh * fh;
+ nfs4_stateid * stateid;
+ struct nfs_seqid * seqid;
+ int open_flags;
+ const u32 * bitmask;
+};
+
+struct nfs_closeres {
+ nfs4_stateid stateid;
+ struct nfs_fattr * fattr;
+ const struct nfs_server *server;
+};
+
+struct nfs_lowner {
+ __u64 clientid;
+ u32 id;
+};
+
+struct nfs_lock_args {
+ struct nfs_fh * fh;
+ struct file_lock * fl;
+ struct nfs_seqid * lock_seqid;
+ nfs4_stateid * lock_stateid;
+ struct nfs_seqid * open_seqid;
+ nfs4_stateid * open_stateid;
+ struct nfs_lowner lock_owner;
+ unsigned char block : 1;
+ unsigned char reclaim : 1;
+ unsigned char new_lock_owner : 1;
+};
+
+struct nfs_lock_res {
+ nfs4_stateid stateid;
+};
+
+struct nfs_locku_args {
+ struct nfs_fh * fh;
+ struct file_lock * fl;
+ struct nfs_seqid * seqid;
+ nfs4_stateid * stateid;
+};
+
+struct nfs_locku_res {
+ nfs4_stateid stateid;
+};
+
+struct nfs_lockt_args {
+ struct nfs_fh * fh;
+ struct file_lock * fl;
+ struct nfs_lowner lock_owner;
+};
+
+struct nfs_lockt_res {
+ struct file_lock * denied;
+};
+
+struct nfs4_delegreturnargs {
+ const struct nfs_fh *fhandle;
+ const nfs4_stateid *stateid;
+ const u32 * bitmask;
+};
+
+struct nfs4_delegreturnres {
+ struct nfs_fattr * fattr;
+ const struct nfs_server *server;
+};
+
+struct nfs_readargs {
+ struct nfs_fh * fh;
+ struct nfs_open_context *context;
+ __u64 offset;
+ __u32 count;
+ unsigned int pgbase;
+ struct page ** pages;
+};
+
+struct nfs_readres {
+ struct nfs_fattr * fattr;
+ __u32 count;
+ int eof;
+};
+
+struct nfs_writeargs {
+ struct nfs_fh * fh;
+ struct nfs_open_context *context;
+ __u64 offset;
+ __u32 count;
+ enum nfs3_stable_how stable;
+ unsigned int pgbase;
+ struct page ** pages;
+ const u32 * bitmask;
+};
+
+struct nfs_writeverf {
+ enum nfs3_stable_how committed;
+ __u32 verifier[2];
+};
+
+struct nfs_writeres {
+ struct nfs_fattr * fattr;
+ struct nfs_writeverf * verf;
+ __u32 count;
+ const struct nfs_server *server;
+};
+
+struct nfs_entry {
+ __u64 ino;
+ __u64 cookie,
+ prev_cookie;
+ const char * name;
+ unsigned int len;
+ int eof;
+ struct nfs_fh * fh;
+ struct nfs_fattr * fattr;
+};
+
+struct nfs_sattrargs {
+ struct nfs_fh * fh;
+ struct iattr * sattr;
+};
+
+struct nfs_diropargs {
+ struct nfs_fh * fh;
+ const char * name;
+ unsigned int len;
+};
+
+struct nfs_createargs {
+ struct nfs_fh * fh;
+ const char * name;
+ unsigned int len;
+ struct iattr * sattr;
+};
+
+struct nfs_renameargs {
+ struct nfs_fh * fromfh;
+ const char * fromname;
+ unsigned int fromlen;
+ struct nfs_fh * tofh;
+ const char * toname;
+ unsigned int tolen;
+};
+
+struct nfs_setattrargs {
+ struct nfs_fh * fh;
+ nfs4_stateid stateid;
+ struct iattr * iap;
+ const struct nfs_server * server;
+ const u32 * bitmask;
+};
+
+struct nfs_setaclargs {
+ struct nfs_fh * fh;
+ size_t acl_len;
+ unsigned int acl_pgbase;
+ struct page ** acl_pages;
+};
+
+struct nfs_getaclargs {
+ struct nfs_fh * fh;
+ size_t acl_len;
+ unsigned int acl_pgbase;
+ struct page ** acl_pages;
+};
+
+struct nfs_setattrres {
+ struct nfs_fattr * fattr;
+ const struct nfs_server * server;
+};
+
+struct nfs_linkargs {
+ struct nfs_fh * fromfh;
+ struct nfs_fh * tofh;
+ const char * toname;
+ unsigned int tolen;
+};
+
+struct nfs_symlinkargs {
+ struct nfs_fh * fromfh;
+ const char * fromname;
+ unsigned int fromlen;
+ const char * topath;
+ unsigned int tolen;
+ struct iattr * sattr;
+};
+
+struct nfs_readdirargs {
+ struct nfs_fh * fh;
+ __u32 cookie;
+ unsigned int count;
+ struct page ** pages;
+};
+
+struct nfs3_getaclargs {
+ struct nfs_fh * fh;
+ int mask;
+ struct page ** pages;
+};
+
+struct nfs3_setaclargs {
+ struct inode * inode;
+ int mask;
+ struct posix_acl * acl_access;
+ struct posix_acl * acl_default;
+ struct page ** pages;
+};
+
+struct nfs_diropok {
+ struct nfs_fh * fh;
+ struct nfs_fattr * fattr;
+};
+
+struct nfs_readlinkargs {
+ struct nfs_fh * fh;
+ unsigned int pgbase;
+ unsigned int pglen;
+ struct page ** pages;
+};
+
+struct nfs3_sattrargs {
+ struct nfs_fh * fh;
+ struct iattr * sattr;
+ unsigned int guard;
+ struct timespec guardtime;
+};
+
+struct nfs3_diropargs {
+ struct nfs_fh * fh;
+ const char * name;
+ unsigned int len;
+};
+
+struct nfs3_accessargs {
+ struct nfs_fh * fh;
+ __u32 access;
+};
+
+struct nfs3_createargs {
+ struct nfs_fh * fh;
+ const char * name;
+ unsigned int len;
+ struct iattr * sattr;
+ enum nfs3_createmode createmode;
+ __u32 verifier[2];
+};
+
+struct nfs3_mkdirargs {
+ struct nfs_fh * fh;
+ const char * name;
+ unsigned int len;
+ struct iattr * sattr;
+};
+
+struct nfs3_symlinkargs {
+ struct nfs_fh * fromfh;
+ const char * fromname;
+ unsigned int fromlen;
+ const char * topath;
+ unsigned int tolen;
+ struct iattr * sattr;
+};
+
+struct nfs3_mknodargs {
+ struct nfs_fh * fh;
+ const char * name;
+ unsigned int len;
+ enum nfs3_ftype type;
+ struct iattr * sattr;
+ dev_t rdev;
+};
+
+struct nfs3_renameargs {
+ struct nfs_fh * fromfh;
+ const char * fromname;
+ unsigned int fromlen;
+ struct nfs_fh * tofh;
+ const char * toname;
+ unsigned int tolen;
+};
+
+struct nfs3_linkargs {
+ struct nfs_fh * fromfh;
+ struct nfs_fh * tofh;
+ const char * toname;
+ unsigned int tolen;
+};
+
+struct nfs3_readdirargs {
+ struct nfs_fh * fh;
+ __u64 cookie;
+ __u32 verf[2];
+ int plus;
+ unsigned int count;
+ struct page ** pages;
+};
+
+struct nfs3_diropres {
+ struct nfs_fattr * dir_attr;
+ struct nfs_fh * fh;
+ struct nfs_fattr * fattr;
+};
+
+struct nfs3_accessres {
+ struct nfs_fattr * fattr;
+ __u32 access;
+};
+
+struct nfs3_readlinkargs {
+ struct nfs_fh * fh;
+ unsigned int pgbase;
+ unsigned int pglen;
+ struct page ** pages;
+};
+
+struct nfs3_renameres {
+ struct nfs_fattr * fromattr;
+ struct nfs_fattr * toattr;
+};
+
+struct nfs3_linkres {
+ struct nfs_fattr * dir_attr;
+ struct nfs_fattr * fattr;
+};
+
+struct nfs3_readdirres {
+ struct nfs_fattr * dir_attr;
+ __u32 * verf;
+ int plus;
+};
+
+struct nfs3_getaclres {
+ struct nfs_fattr * fattr;
+ int mask;
+ unsigned int acl_access_count;
+ unsigned int acl_default_count;
+ struct posix_acl * acl_access;
+ struct posix_acl * acl_default;
+};
+
+struct nfs_page;
+
+#define NFS_PAGEVEC_SIZE (8U)
+
+struct nfs_read_data {
+ int flags;
+ struct rpc_task task;
+ struct inode *inode;
+ struct rpc_cred *cred;
+ struct nfs_fattr fattr;
+ struct list_head pages;
+ struct nfs_page *req;
+ struct page **pagevec;
+ unsigned int npages;
+ struct nfs_readargs args;
+ struct nfs_readres res;
+ struct page *page_array[NFS_PAGEVEC_SIZE];
+};
+
+struct nfs_write_data {
+ int flags;
+ struct rpc_task task;
+ struct inode *inode;
+ struct rpc_cred *cred;
+ struct nfs_fattr fattr;
+ struct nfs_writeverf verf;
+ struct list_head pages;
+ struct nfs_page *req;
+ struct page **pagevec;
+ unsigned int npages;
+ struct nfs_writeargs args;
+ struct nfs_writeres res;
+ struct page *page_array[NFS_PAGEVEC_SIZE];
+};
+
+struct nfs_access_entry;
+
+struct nfs_rpc_ops {
+ int version;
+ struct dentry_operations *dentry_ops;
+ struct inode_operations *dir_inode_ops;
+ struct inode_operations *file_inode_ops;
+
+ int (*getroot) (struct nfs_server *, struct nfs_fh *,
+ struct nfs_fsinfo *);
+ int (*getattr) (struct nfs_server *, struct nfs_fh *,
+ struct nfs_fattr *);
+ int (*setattr) (struct dentry *, struct nfs_fattr *,
+ struct iattr *);
+ int (*lookup) (struct inode *, struct qstr *,
+ struct nfs_fh *, struct nfs_fattr *);
+ int (*access) (struct inode *, struct nfs_access_entry *);
+ int (*readlink)(struct inode *, struct page *, unsigned int,
+ unsigned int);
+ int (*read) (struct nfs_read_data *);
+ int (*write) (struct nfs_write_data *);
+ int (*commit) (struct nfs_write_data *);
+ int (*create) (struct inode *, struct dentry *,
+ struct iattr *, int, struct nameidata *);
+ int (*remove) (struct inode *, struct qstr *);
+ int (*unlink_setup) (struct rpc_message *,
+ struct dentry *, struct qstr *);
+ int (*unlink_done) (struct dentry *, struct rpc_task *);
+ int (*rename) (struct inode *, struct qstr *,
+ struct inode *, struct qstr *);
+ int (*link) (struct inode *, struct inode *, struct qstr *);
+ int (*symlink) (struct inode *, struct qstr *, struct qstr *,
+ struct iattr *, struct nfs_fh *,
+ struct nfs_fattr *);
+ int (*mkdir) (struct inode *, struct dentry *, struct iattr *);
+ int (*rmdir) (struct inode *, struct qstr *);
+ int (*readdir) (struct dentry *, struct rpc_cred *,
+ u64, struct page *, unsigned int, int);
+ int (*mknod) (struct inode *, struct dentry *, struct iattr *,
+ dev_t);
+ int (*statfs) (struct nfs_server *, struct nfs_fh *,
+ struct nfs_fsstat *);
+ int (*fsinfo) (struct nfs_server *, struct nfs_fh *,
+ struct nfs_fsinfo *);
+ int (*pathconf) (struct nfs_server *, struct nfs_fh *,
+ struct nfs_pathconf *);
+ u32 * (*decode_dirent)(u32 *, struct nfs_entry *, int plus);
+ void (*read_setup) (struct nfs_read_data *);
+ int (*read_done) (struct rpc_task *, struct nfs_read_data *);
+ void (*write_setup) (struct nfs_write_data *, int how);
+ int (*write_done) (struct rpc_task *, struct nfs_write_data *);
+ void (*commit_setup) (struct nfs_write_data *, int how);
+ int (*commit_done) (struct rpc_task *, struct nfs_write_data *);
+ int (*file_open) (struct inode *, struct file *);
+ int (*file_release) (struct inode *, struct file *);
+ int (*lock)(struct file *, int, struct file_lock *);
+ void (*clear_acl_cache)(struct inode *);
+};
+
+#define NFS_CALL(op, inode, args) NFS_PROTO(inode)->op args
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/nfsacl.h b/ndk/platforms/android-3/include/linux/nfsacl.h
new file mode 100644
index 0000000..7dd95ab
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/nfsacl.h
@@ -0,0 +1,32 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __LINUX_NFSACL_H
+#define __LINUX_NFSACL_H
+
+#define NFS_ACL_PROGRAM 100227
+
+#define ACLPROC2_GETACL 1
+#define ACLPROC2_SETACL 2
+#define ACLPROC2_GETATTR 3
+#define ACLPROC2_ACCESS 4
+
+#define ACLPROC3_GETACL 1
+#define ACLPROC3_SETACL 2
+
+#define NFS_ACL 0x0001
+#define NFS_ACLCNT 0x0002
+#define NFS_DFACL 0x0004
+#define NFS_DFACLCNT 0x0008
+
+#define NFS_ACL_DEFAULT 0x1000
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/nfsd/auth.h b/ndk/platforms/android-3/include/linux/nfsd/auth.h
new file mode 100644
index 0000000..f840f0e
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/nfsd/auth.h
@@ -0,0 +1,15 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef LINUX_NFSD_AUTH_H
+#define LINUX_NFSD_AUTH_H
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/nfsd/const.h b/ndk/platforms/android-3/include/linux/nfsd/const.h
new file mode 100644
index 0000000..c345508
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/nfsd/const.h
@@ -0,0 +1,24 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_NFSD_CONST_H
+#define _LINUX_NFSD_CONST_H
+
+#include <linux/nfs.h>
+#include <linux/nfs2.h>
+#include <linux/nfs3.h>
+#include <linux/nfs4.h>
+
+#define NFSSVC_MAXVERS 3
+
+#define NFSSVC_MAXBLKSIZE (32*1024)
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/nfsd/debug.h b/ndk/platforms/android-3/include/linux/nfsd/debug.h
new file mode 100644
index 0000000..9b90f05
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/nfsd/debug.h
@@ -0,0 +1,34 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef LINUX_NFSD_DEBUG_H
+#define LINUX_NFSD_DEBUG_H
+
+#include <linux/sunrpc/debug.h>
+
+#ifdef RPC_DEBUG
+#define NFSD_DEBUG 1
+#endif
+
+#define NFSDDBG_SOCK 0x0001
+#define NFSDDBG_FH 0x0002
+#define NFSDDBG_EXPORT 0x0004
+#define NFSDDBG_SVC 0x0008
+#define NFSDDBG_PROC 0x0010
+#define NFSDDBG_FILEOP 0x0020
+#define NFSDDBG_AUTH 0x0040
+#define NFSDDBG_REPCACHE 0x0080
+#define NFSDDBG_XDR 0x0100
+#define NFSDDBG_LOCKD 0x0200
+#define NFSDDBG_ALL 0x7FFF
+#define NFSDDBG_NOCHANGE 0xFFFF
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/nfsd/export.h b/ndk/platforms/android-3/include/linux/nfsd/export.h
new file mode 100644
index 0000000..932274f
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/nfsd/export.h
@@ -0,0 +1,38 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef NFSD_EXPORT_H
+#define NFSD_EXPORT_H
+
+#include <asm/types.h>
+
+#define NFSCLNT_IDMAX 1024
+#define NFSCLNT_ADDRMAX 16
+#define NFSCLNT_KEYMAX 32
+
+#define NFSEXP_READONLY 0x0001
+#define NFSEXP_INSECURE_PORT 0x0002
+#define NFSEXP_ROOTSQUASH 0x0004
+#define NFSEXP_ALLSQUASH 0x0008
+#define NFSEXP_ASYNC 0x0010
+#define NFSEXP_GATHERED_WRITES 0x0020
+
+#define NFSEXP_NOHIDE 0x0200
+#define NFSEXP_NOSUBTREECHECK 0x0400
+#define NFSEXP_NOAUTHNLM 0x0800  
+#define NFSEXP_MSNFS 0x1000  
+#define NFSEXP_FSID 0x2000
+#define NFSEXP_CROSSMOUNT 0x4000
+#define NFSEXP_NOACL 0x8000  
+#define NFSEXP_ALLFLAGS 0xFE3F
+
+#endif
+
diff --git a/ndk/platforms/android-3/include/linux/nfsd/interface.h b/ndk/platforms/android-3/include/linux/nfsd/interface.h
new file mode 100644
index 0000000..3c3946a
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/nfsd/interface.h
@@ -0,0 +1,15 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef LINUX_NFSD_INTERFACE_H
+#define LINUX_NFSD_INTERFACE_H
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/nfsd/nfsfh.h b/ndk/platforms/android-3/include/linux/nfsd/nfsfh.h
new file mode 100644
index 0000000..13450d2
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/nfsd/nfsfh.h
@@ -0,0 +1,62 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_NFSD_FH_H
+#define _LINUX_NFSD_FH_H
+
+#include <asm/types.h>
+#include <linux/nfsd/const.h>
+#include <linux/nfsd/debug.h>
+
+struct nfs_fhbase_old {
+ __u32 fb_dcookie;
+ __u32 fb_ino;
+ __u32 fb_dirino;
+ __u32 fb_dev;
+ __u32 fb_xdev;
+ __u32 fb_xino;
+ __u32 fb_generation;
+};
+
+struct nfs_fhbase_new {
+ __u8 fb_version;
+ __u8 fb_auth_type;
+ __u8 fb_fsid_type;
+ __u8 fb_fileid_type;
+ __u32 fb_auth[1];
+
+};
+
+struct knfsd_fh {
+ unsigned int fh_size;
+ union {
+ struct nfs_fhbase_old fh_old;
+ __u32 fh_pad[NFS4_FHSIZE/4];
+ struct nfs_fhbase_new fh_new;
+ } fh_base;
+};
+
+#define ofh_dcookie fh_base.fh_old.fb_dcookie
+#define ofh_ino fh_base.fh_old.fb_ino
+#define ofh_dirino fh_base.fh_old.fb_dirino
+#define ofh_dev fh_base.fh_old.fb_dev
+#define ofh_xdev fh_base.fh_old.fb_xdev
+#define ofh_xino fh_base.fh_old.fb_xino
+#define ofh_generation fh_base.fh_old.fb_generation
+
+#define fh_version fh_base.fh_new.fb_version
+#define fh_fsid_type fh_base.fh_new.fb_fsid_type
+#define fh_auth_type fh_base.fh_new.fb_auth_type
+#define fh_fileid_type fh_base.fh_new.fb_fileid_type
+#define fh_auth fh_base.fh_new.fb_auth
+#define fh_fsid fh_base.fh_new.fb_auth
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/nfsd/stats.h b/ndk/platforms/android-3/include/linux/nfsd/stats.h
new file mode 100644
index 0000000..647e65c
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/nfsd/stats.h
@@ -0,0 +1,38 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef LINUX_NFSD_STATS_H
+#define LINUX_NFSD_STATS_H
+
+#include <linux/nfs4.h>
+
+struct nfsd_stats {
+ unsigned int rchits;
+ unsigned int rcmisses;
+ unsigned int rcnocache;
+ unsigned int fh_stale;
+ unsigned int fh_lookup;
+ unsigned int fh_anon;
+ unsigned int fh_nocache_dir;
+ unsigned int fh_nocache_nondir;
+ unsigned int io_read;
+ unsigned int io_write;
+ unsigned int th_cnt;
+ unsigned int th_usage[10];
+ unsigned int th_fullcnt;
+ unsigned int ra_size;
+ unsigned int ra_depth[11];
+
+};
+
+#define NFSD_USAGE_WRAP (HZ*1000000)
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/nfsd/xdr.h b/ndk/platforms/android-3/include/linux/nfsd/xdr.h
new file mode 100644
index 0000000..f94961d
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/nfsd/xdr.h
@@ -0,0 +1,141 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef LINUX_NFSD_H
+#define LINUX_NFSD_H
+
+#include <linux/fs.h>
+#include <linux/vfs.h>
+#include <linux/nfs.h>
+
+struct nfsd_fhandle {
+ struct svc_fh fh;
+};
+
+struct nfsd_sattrargs {
+ struct svc_fh fh;
+ struct iattr attrs;
+};
+
+struct nfsd_diropargs {
+ struct svc_fh fh;
+ char * name;
+ int len;
+};
+
+struct nfsd_readargs {
+ struct svc_fh fh;
+ __u32 offset;
+ __u32 count;
+ struct kvec vec[RPCSVC_MAXPAGES];
+ int vlen;
+};
+
+struct nfsd_writeargs {
+ svc_fh fh;
+ __u32 offset;
+ int len;
+ struct kvec vec[RPCSVC_MAXPAGES];
+ int vlen;
+};
+
+struct nfsd_createargs {
+ struct svc_fh fh;
+ char * name;
+ int len;
+ struct iattr attrs;
+};
+
+struct nfsd_renameargs {
+ struct svc_fh ffh;
+ char * fname;
+ int flen;
+ struct svc_fh tfh;
+ char * tname;
+ int tlen;
+};
+
+struct nfsd_readlinkargs {
+ struct svc_fh fh;
+ char * buffer;
+};
+
+struct nfsd_linkargs {
+ struct svc_fh ffh;
+ struct svc_fh tfh;
+ char * tname;
+ int tlen;
+};
+
+struct nfsd_symlinkargs {
+ struct svc_fh ffh;
+ char * fname;
+ int flen;
+ char * tname;
+ int tlen;
+ struct iattr attrs;
+};
+
+struct nfsd_readdirargs {
+ struct svc_fh fh;
+ __u32 cookie;
+ __u32 count;
+ u32 * buffer;
+};
+
+struct nfsd_attrstat {
+ struct svc_fh fh;
+ struct kstat stat;
+};
+
+struct nfsd_diropres {
+ struct svc_fh fh;
+ struct kstat stat;
+};
+
+struct nfsd_readlinkres {
+ int len;
+};
+
+struct nfsd_readres {
+ struct svc_fh fh;
+ unsigned long count;
+ struct kstat stat;
+};
+
+struct nfsd_readdirres {
+ int count;
+
+ struct readdir_cd common;
+ u32 * buffer;
+ int buflen;
+ u32 * offset;
+};
+
+struct nfsd_statfsres {
+ struct kstatfs stats;
+};
+
+union nfsd_xdrstore {
+ struct nfsd_sattrargs sattr;
+ struct nfsd_diropargs dirop;
+ struct nfsd_readargs read;
+ struct nfsd_writeargs write;
+ struct nfsd_createargs create;
+ struct nfsd_renameargs rename;
+ struct nfsd_linkargs link;
+ struct nfsd_symlinkargs symlink;
+ struct nfsd_readdirargs readdir;
+};
+
+#define NFS2_SVC_XDRSIZE sizeof(union nfsd_xdrstore)
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/node.h b/ndk/platforms/android-3/include/linux/node.h
new file mode 100644
index 0000000..b33bffc
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/node.h
@@ -0,0 +1,23 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_NODE_H_
+#define _LINUX_NODE_H_
+
+#include <linux/sysdev.h>
+#include <linux/cpumask.h>
+
+struct node {
+ struct sys_device sysdev;
+};
+
+#define to_node(sys_device) container_of(sys_device, struct node, sysdev)
+#endif
diff --git a/ndk/platforms/android-3/include/linux/nodemask.h b/ndk/platforms/android-3/include/linux/nodemask.h
new file mode 100644
index 0000000..4ec8632
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/nodemask.h
@@ -0,0 +1,89 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __LINUX_NODEMASK_H
+#define __LINUX_NODEMASK_H
+
+#include <linux/kernel.h>
+#include <linux/threads.h>
+#include <linux/bitmap.h>
+#include <linux/numa.h>
+
+typedef struct { DECLARE_BITMAP(bits, MAX_NUMNODES); } nodemask_t;
+
+#define node_set(node, dst) __node_set((node), &(dst))
+#define node_clear(node, dst) __node_clear((node), &(dst))
+#define nodes_setall(dst) __nodes_setall(&(dst), MAX_NUMNODES)
+#define nodes_clear(dst) __nodes_clear(&(dst), MAX_NUMNODES)
+#define node_isset(node, nodemask) test_bit((node), (nodemask).bits)
+#define node_test_and_set(node, nodemask)   __node_test_and_set((node), &(nodemask))
+#define nodes_and(dst, src1, src2)   __nodes_and(&(dst), &(src1), &(src2), MAX_NUMNODES)
+#define nodes_or(dst, src1, src2)   __nodes_or(&(dst), &(src1), &(src2), MAX_NUMNODES)
+#define nodes_xor(dst, src1, src2)   __nodes_xor(&(dst), &(src1), &(src2), MAX_NUMNODES)
+#define nodes_andnot(dst, src1, src2)   __nodes_andnot(&(dst), &(src1), &(src2), MAX_NUMNODES)
+#define nodes_complement(dst, src)   __nodes_complement(&(dst), &(src), MAX_NUMNODES)
+#define nodes_equal(src1, src2)   __nodes_equal(&(src1), &(src2), MAX_NUMNODES)
+#define nodes_intersects(src1, src2)   __nodes_intersects(&(src1), &(src2), MAX_NUMNODES)
+#define nodes_subset(src1, src2)   __nodes_subset(&(src1), &(src2), MAX_NUMNODES)
+#define nodes_empty(src) __nodes_empty(&(src), MAX_NUMNODES)
+#define nodes_full(nodemask) __nodes_full(&(nodemask), MAX_NUMNODES)
+#define nodes_weight(nodemask) __nodes_weight(&(nodemask), MAX_NUMNODES)
+#define nodes_shift_right(dst, src, n)   __nodes_shift_right(&(dst), &(src), (n), MAX_NUMNODES)
+#define nodes_shift_left(dst, src, n)   __nodes_shift_left(&(dst), &(src), (n), MAX_NUMNODES)
+#define first_node(src) __first_node(&(src))
+#define next_node(n, src) __next_node((n), &(src))
+#define nodemask_of_node(node)  ({   typeof(_unused_nodemask_arg_) m;   if (sizeof(m) == sizeof(unsigned long)) {   m.bits[0] = 1UL<<(node);   } else {   nodes_clear(m);   node_set((node), m);   }   m;  })
+#define first_unset_node(mask) __first_unset_node(&(mask))
+#define NODE_MASK_LAST_WORD BITMAP_LAST_WORD_MASK(MAX_NUMNODES)
+#if MAX_NUMNODES <= BITS_PER_LONG
+#define NODE_MASK_ALL  ((nodemask_t) { {   [BITS_TO_LONGS(MAX_NUMNODES)-1] = NODE_MASK_LAST_WORD  } })
+#else
+#define NODE_MASK_ALL  ((nodemask_t) { {   [0 ... BITS_TO_LONGS(MAX_NUMNODES)-2] = ~0UL,   [BITS_TO_LONGS(MAX_NUMNODES)-1] = NODE_MASK_LAST_WORD  } })
+#endif
+#define NODE_MASK_NONE  ((nodemask_t) { {   [0 ... BITS_TO_LONGS(MAX_NUMNODES)-1] = 0UL  } })
+#define nodes_addr(src) ((src).bits)
+#define nodemask_scnprintf(buf, len, src)   __nodemask_scnprintf((buf), (len), &(src), MAX_NUMNODES)
+#define nodemask_parse(ubuf, ulen, dst)   __nodemask_parse((ubuf), (ulen), &(dst), MAX_NUMNODES)
+#define nodelist_scnprintf(buf, len, src)   __nodelist_scnprintf((buf), (len), &(src), MAX_NUMNODES)
+#define nodelist_parse(buf, dst) __nodelist_parse((buf), &(dst), MAX_NUMNODES)
+#define node_remap(oldbit, old, new)   __node_remap((oldbit), &(old), &(new), MAX_NUMNODES)
+#define nodes_remap(dst, src, old, new)   __nodes_remap(&(dst), &(src), &(old), &(new), MAX_NUMNODES)
+#if MAX_NUMNODES > 1
+#define for_each_node_mask(node, mask)   for ((node) = first_node(mask);   (node) < MAX_NUMNODES;   (node) = next_node((node), (mask)))
+#else
+#define for_each_node_mask(node, mask)   if (!nodes_empty(mask))   for ((node) = 0; (node) < 1; (node)++)
+#endif
+
+#if MAX_NUMNODES > 1
+#define num_online_nodes() nodes_weight(node_online_map)
+#define num_possible_nodes() nodes_weight(node_possible_map)
+#define node_online(node) node_isset((node), node_online_map)
+#define node_possible(node) node_isset((node), node_possible_map)
+#define first_online_node first_node(node_online_map)
+#define next_online_node(nid) next_node((nid), node_online_map)
+#else
+#define num_online_nodes() 1
+#define num_possible_nodes() 1
+#define node_online(node) ((node) == 0)
+#define node_possible(node) ((node) == 0)
+#define first_online_node 0
+#define next_online_node(nid) (MAX_NUMNODES)
+#endif
+
+#define any_online_node(mask)  ({   int node;   for_each_node_mask(node, (mask))   if (node_online(node))   break;   node;  })
+
+#define node_set_online(node) set_bit((node), node_online_map.bits)
+#define node_set_offline(node) clear_bit((node), node_online_map.bits)
+
+#define for_each_node(node) for_each_node_mask((node), node_possible_map)
+#define for_each_online_node(node) for_each_node_mask((node), node_online_map)
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/notifier.h b/ndk/platforms/android-3/include/linux/notifier.h
new file mode 100644
index 0000000..f1fc461
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/notifier.h
@@ -0,0 +1,50 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_NOTIFIER_H
+#define _LINUX_NOTIFIER_H
+#include <linux/errno.h>
+#include <linux/mutex.h>
+#include <linux/rwsem.h>
+
+struct notifier_block {
+ int (*notifier_call)(struct notifier_block *, unsigned long, void *);
+ struct notifier_block *next;
+ int priority;
+};
+
+struct atomic_notifier_head {
+ spinlock_t lock;
+ struct notifier_block *head;
+};
+
+struct blocking_notifier_head {
+ struct rw_semaphore rwsem;
+ struct notifier_block *head;
+};
+
+struct raw_notifier_head {
+ struct notifier_block *head;
+};
+
+#define ATOMIC_INIT_NOTIFIER_HEAD(name) do {   spin_lock_init(&(name)->lock);   (name)->head = NULL;   } while (0)
+#define BLOCKING_INIT_NOTIFIER_HEAD(name) do {   init_rwsem(&(name)->rwsem);   (name)->head = NULL;   } while (0)
+#define RAW_INIT_NOTIFIER_HEAD(name) do {   (name)->head = NULL;   } while (0)
+
+#define ATOMIC_NOTIFIER_INIT(name) {   .lock = __SPIN_LOCK_UNLOCKED(name.lock),   .head = NULL }
+#define BLOCKING_NOTIFIER_INIT(name) {   .rwsem = __RWSEM_INITIALIZER((name).rwsem),   .head = NULL }
+#define RAW_NOTIFIER_INIT(name) {   .head = NULL }
+
+#define ATOMIC_NOTIFIER_HEAD(name)   struct atomic_notifier_head name =   ATOMIC_NOTIFIER_INIT(name)
+#define BLOCKING_NOTIFIER_HEAD(name)   struct blocking_notifier_head name =   BLOCKING_NOTIFIER_INIT(name)
+#define RAW_NOTIFIER_HEAD(name)   struct raw_notifier_head name =   RAW_NOTIFIER_INIT(name)
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/numa.h b/ndk/platforms/android-3/include/linux/numa.h
new file mode 100644
index 0000000..f5d66f5
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/numa.h
@@ -0,0 +1,19 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_NUMA_H
+#define _LINUX_NUMA_H
+
+#define NODES_SHIFT 0
+
+#define MAX_NUMNODES (1 << NODES_SHIFT)
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/nvram.h b/ndk/platforms/android-3/include/linux/nvram.h
new file mode 100644
index 0000000..b358bdb
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/nvram.h
@@ -0,0 +1,24 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_NVRAM_H
+#define _LINUX_NVRAM_H
+
+#include <linux/ioctl.h>
+
+#define NVRAM_INIT _IO('p', 0x40)  
+#define NVRAM_SETCKS _IO('p', 0x41)  
+
+#define NVRAM_FIRST_BYTE 14
+
+#define NVRAM_OFFSET(x) ((x)-NVRAM_FIRST_BYTE)
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/omap_csmi.h b/ndk/platforms/android-3/include/linux/omap_csmi.h
new file mode 100644
index 0000000..6a28d3d
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/omap_csmi.h
@@ -0,0 +1,23 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _OMAP_CSMI_H_
+#define _OMAP_CSMI_H_
+
+#include <asm/ioctl.h>
+
+#define OMAP_CSMI_TTY_ENABLE_ACK _IO('c', 0)
+#define OMAP_CSMI_TTY_DISABLE_ACK _IO('c', 1)
+#define OMAP_CSMI_TTY_READ_UNACKED _IOR('c', 2, int)
+#define OMAP_CSMI_TTY_ACK _IOW('c', 3, int)
+#define OMAP_CSMI_TTY_WAKEUP_AND_ACK _IOW('c', 4, int)
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/pagemap.h b/ndk/platforms/android-3/include/linux/pagemap.h
new file mode 100644
index 0000000..8dd397d
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/pagemap.h
@@ -0,0 +1,33 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_PAGEMAP_H
+#define _LINUX_PAGEMAP_H
+
+#include <linux/mm.h>
+#include <linux/fs.h>
+#include <linux/list.h>
+#include <linux/highmem.h>
+#include <linux/compiler.h>
+#include <asm/uaccess.h>
+#include <linux/gfp.h>
+
+#define AS_EIO (__GFP_BITS_SHIFT + 0)  
+#define AS_ENOSPC (__GFP_BITS_SHIFT + 1)  
+
+#define PAGE_CACHE_SHIFT PAGE_SHIFT
+#define PAGE_CACHE_SIZE PAGE_SIZE
+#define PAGE_CACHE_MASK PAGE_MASK
+#define PAGE_CACHE_ALIGN(addr) (((addr)+PAGE_CACHE_SIZE-1)&PAGE_CACHE_MASK)
+#define page_cache_get(page) get_page(page)
+#define page_cache_release(page) put_page(page)
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/param.h b/ndk/platforms/android-3/include/linux/param.h
new file mode 100644
index 0000000..456695d
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/param.h
@@ -0,0 +1,17 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_PARAM_H
+#define _LINUX_PARAM_H
+
+#include <asm/param.h>
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/patchkey.h b/ndk/platforms/android-3/include/linux/patchkey.h
new file mode 100644
index 0000000..fdf86ce
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/patchkey.h
@@ -0,0 +1,31 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_PATCHKEY_H_INDIRECT
+#error "patchkey.h included directly"
+#endif
+
+#ifndef _LINUX_PATCHKEY_H
+#define _LINUX_PATCHKEY_H
+
+#include <endian.h>
+
+#ifdef __BYTE_ORDER
+#if __BYTE_ORDER == __BIG_ENDIAN
+#define _PATCHKEY(id) (0xfd00|id)
+#elif __BYTE_ORDER == __LITTLE_ENDIAN
+#define _PATCHKEY(id) ((id<<8)|0x00fd)
+#else
+#error "could not determine byte order"
+#endif
+#endif
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/pci.h b/ndk/platforms/android-3/include/linux/pci.h
new file mode 100644
index 0000000..165deb4
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/pci.h
@@ -0,0 +1,29 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef LINUX_PCI_H
+#define LINUX_PCI_H
+
+#include <linux/pci_regs.h>
+
+#include <linux/pci_ids.h>
+
+#define PCI_DEVFN(slot,func) ((((slot) & 0x1f) << 3) | ((func) & 0x07))
+#define PCI_SLOT(devfn) (((devfn) >> 3) & 0x1f)
+#define PCI_FUNC(devfn) ((devfn) & 0x07)
+
+#define PCIIOC_BASE ('P' << 24 | 'C' << 16 | 'I' << 8)
+#define PCIIOC_CONTROLLER (PCIIOC_BASE | 0x00)  
+#define PCIIOC_MMAP_IS_IO (PCIIOC_BASE | 0x01)  
+#define PCIIOC_MMAP_IS_MEM (PCIIOC_BASE | 0x02)  
+#define PCIIOC_WRITE_COMBINE (PCIIOC_BASE | 0x03)  
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/pci_ids.h b/ndk/platforms/android-3/include/linux/pci_ids.h
new file mode 100644
index 0000000..ec5adfb
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/pci_ids.h
@@ -0,0 +1,2270 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#define PCI_CLASS_NOT_DEFINED 0x0000
+#define PCI_CLASS_NOT_DEFINED_VGA 0x0001
+
+#define PCI_BASE_CLASS_STORAGE 0x01
+#define PCI_CLASS_STORAGE_SCSI 0x0100
+#define PCI_CLASS_STORAGE_IDE 0x0101
+#define PCI_CLASS_STORAGE_FLOPPY 0x0102
+#define PCI_CLASS_STORAGE_IPI 0x0103
+#define PCI_CLASS_STORAGE_RAID 0x0104
+#define PCI_CLASS_STORAGE_SAS 0x0107
+#define PCI_CLASS_STORAGE_OTHER 0x0180
+
+#define PCI_BASE_CLASS_NETWORK 0x02
+#define PCI_CLASS_NETWORK_ETHERNET 0x0200
+#define PCI_CLASS_NETWORK_TOKEN_RING 0x0201
+#define PCI_CLASS_NETWORK_FDDI 0x0202
+#define PCI_CLASS_NETWORK_ATM 0x0203
+#define PCI_CLASS_NETWORK_OTHER 0x0280
+
+#define PCI_BASE_CLASS_DISPLAY 0x03
+#define PCI_CLASS_DISPLAY_VGA 0x0300
+#define PCI_CLASS_DISPLAY_XGA 0x0301
+#define PCI_CLASS_DISPLAY_3D 0x0302
+#define PCI_CLASS_DISPLAY_OTHER 0x0380
+
+#define PCI_BASE_CLASS_MULTIMEDIA 0x04
+#define PCI_CLASS_MULTIMEDIA_VIDEO 0x0400
+#define PCI_CLASS_MULTIMEDIA_AUDIO 0x0401
+#define PCI_CLASS_MULTIMEDIA_PHONE 0x0402
+#define PCI_CLASS_MULTIMEDIA_OTHER 0x0480
+
+#define PCI_BASE_CLASS_MEMORY 0x05
+#define PCI_CLASS_MEMORY_RAM 0x0500
+#define PCI_CLASS_MEMORY_FLASH 0x0501
+#define PCI_CLASS_MEMORY_OTHER 0x0580
+
+#define PCI_BASE_CLASS_BRIDGE 0x06
+#define PCI_CLASS_BRIDGE_HOST 0x0600
+#define PCI_CLASS_BRIDGE_ISA 0x0601
+#define PCI_CLASS_BRIDGE_EISA 0x0602
+#define PCI_CLASS_BRIDGE_MC 0x0603
+#define PCI_CLASS_BRIDGE_PCI 0x0604
+#define PCI_CLASS_BRIDGE_PCMCIA 0x0605
+#define PCI_CLASS_BRIDGE_NUBUS 0x0606
+#define PCI_CLASS_BRIDGE_CARDBUS 0x0607
+#define PCI_CLASS_BRIDGE_RACEWAY 0x0608
+#define PCI_CLASS_BRIDGE_OTHER 0x0680
+
+#define PCI_BASE_CLASS_COMMUNICATION 0x07
+#define PCI_CLASS_COMMUNICATION_SERIAL 0x0700
+#define PCI_CLASS_COMMUNICATION_PARALLEL 0x0701
+#define PCI_CLASS_COMMUNICATION_MULTISERIAL 0x0702
+#define PCI_CLASS_COMMUNICATION_MODEM 0x0703
+#define PCI_CLASS_COMMUNICATION_OTHER 0x0780
+
+#define PCI_BASE_CLASS_SYSTEM 0x08
+#define PCI_CLASS_SYSTEM_PIC 0x0800
+#define PCI_CLASS_SYSTEM_PIC_IOAPIC 0x080010
+#define PCI_CLASS_SYSTEM_PIC_IOXAPIC 0x080020
+#define PCI_CLASS_SYSTEM_DMA 0x0801
+#define PCI_CLASS_SYSTEM_TIMER 0x0802
+#define PCI_CLASS_SYSTEM_RTC 0x0803
+#define PCI_CLASS_SYSTEM_PCI_HOTPLUG 0x0804
+#define PCI_CLASS_SYSTEM_SDHCI 0x0805
+#define PCI_CLASS_SYSTEM_OTHER 0x0880
+
+#define PCI_BASE_CLASS_INPUT 0x09
+#define PCI_CLASS_INPUT_KEYBOARD 0x0900
+#define PCI_CLASS_INPUT_PEN 0x0901
+#define PCI_CLASS_INPUT_MOUSE 0x0902
+#define PCI_CLASS_INPUT_SCANNER 0x0903
+#define PCI_CLASS_INPUT_GAMEPORT 0x0904
+#define PCI_CLASS_INPUT_OTHER 0x0980
+
+#define PCI_BASE_CLASS_DOCKING 0x0a
+#define PCI_CLASS_DOCKING_GENERIC 0x0a00
+#define PCI_CLASS_DOCKING_OTHER 0x0a80
+
+#define PCI_BASE_CLASS_PROCESSOR 0x0b
+#define PCI_CLASS_PROCESSOR_386 0x0b00
+#define PCI_CLASS_PROCESSOR_486 0x0b01
+#define PCI_CLASS_PROCESSOR_PENTIUM 0x0b02
+#define PCI_CLASS_PROCESSOR_ALPHA 0x0b10
+#define PCI_CLASS_PROCESSOR_POWERPC 0x0b20
+#define PCI_CLASS_PROCESSOR_MIPS 0x0b30
+#define PCI_CLASS_PROCESSOR_CO 0x0b40
+
+#define PCI_BASE_CLASS_SERIAL 0x0c
+#define PCI_CLASS_SERIAL_FIREWIRE 0x0c00
+#define PCI_CLASS_SERIAL_ACCESS 0x0c01
+#define PCI_CLASS_SERIAL_SSA 0x0c02
+#define PCI_CLASS_SERIAL_USB 0x0c03
+#define PCI_CLASS_SERIAL_USB_UHCI 0x0c0300
+#define PCI_CLASS_SERIAL_USB_OHCI 0x0c0310
+#define PCI_CLASS_SERIAL_USB_EHCI 0x0c0320
+#define PCI_CLASS_SERIAL_FIBER 0x0c04
+#define PCI_CLASS_SERIAL_SMBUS 0x0c05
+
+#define PCI_BASE_CLASS_INTELLIGENT 0x0e
+#define PCI_CLASS_INTELLIGENT_I2O 0x0e00
+
+#define PCI_BASE_CLASS_SATELLITE 0x0f
+#define PCI_CLASS_SATELLITE_TV 0x0f00
+#define PCI_CLASS_SATELLITE_AUDIO 0x0f01
+#define PCI_CLASS_SATELLITE_VOICE 0x0f03
+#define PCI_CLASS_SATELLITE_DATA 0x0f04
+
+#define PCI_BASE_CLASS_CRYPT 0x10
+#define PCI_CLASS_CRYPT_NETWORK 0x1000
+#define PCI_CLASS_CRYPT_ENTERTAINMENT 0x1001
+#define PCI_CLASS_CRYPT_OTHER 0x1080
+
+#define PCI_BASE_CLASS_SIGNAL_PROCESSING 0x11
+#define PCI_CLASS_SP_DPIO 0x1100
+#define PCI_CLASS_SP_OTHER 0x1180
+
+#define PCI_CLASS_OTHERS 0xff
+
+#define PCI_VENDOR_ID_DYNALINK 0x0675
+#define PCI_DEVICE_ID_DYNALINK_IS64PH 0x1702
+
+#define PCI_VENDOR_ID_BERKOM 0x0871
+#define PCI_DEVICE_ID_BERKOM_A1T 0xffa1
+#define PCI_DEVICE_ID_BERKOM_T_CONCEPT 0xffa2
+#define PCI_DEVICE_ID_BERKOM_A4T 0xffa4
+#define PCI_DEVICE_ID_BERKOM_SCITEL_QUADRO 0xffa8
+
+#define PCI_VENDOR_ID_COMPAQ 0x0e11
+#define PCI_DEVICE_ID_COMPAQ_TOKENRING 0x0508
+#define PCI_DEVICE_ID_COMPAQ_TACHYON 0xa0fc
+#define PCI_DEVICE_ID_COMPAQ_SMART2P 0xae10
+#define PCI_DEVICE_ID_COMPAQ_NETEL100 0xae32
+#define PCI_DEVICE_ID_COMPAQ_NETEL10 0xae34
+#define PCI_DEVICE_ID_COMPAQ_TRIFLEX_IDE 0xae33
+#define PCI_DEVICE_ID_COMPAQ_NETFLEX3I 0xae35
+#define PCI_DEVICE_ID_COMPAQ_NETEL100D 0xae40
+#define PCI_DEVICE_ID_COMPAQ_NETEL100PI 0xae43
+#define PCI_DEVICE_ID_COMPAQ_NETEL100I 0xb011
+#define PCI_DEVICE_ID_COMPAQ_CISS 0xb060
+#define PCI_DEVICE_ID_COMPAQ_CISSB 0xb178
+#define PCI_DEVICE_ID_COMPAQ_CISSC 0x46
+#define PCI_DEVICE_ID_COMPAQ_THUNDER 0xf130
+#define PCI_DEVICE_ID_COMPAQ_NETFLEX3B 0xf150
+
+#define PCI_VENDOR_ID_NCR 0x1000
+#define PCI_VENDOR_ID_LSI_LOGIC 0x1000
+#define PCI_DEVICE_ID_NCR_53C810 0x0001
+#define PCI_DEVICE_ID_NCR_53C820 0x0002
+#define PCI_DEVICE_ID_NCR_53C825 0x0003
+#define PCI_DEVICE_ID_NCR_53C815 0x0004
+#define PCI_DEVICE_ID_LSI_53C810AP 0x0005
+#define PCI_DEVICE_ID_NCR_53C860 0x0006
+#define PCI_DEVICE_ID_LSI_53C1510 0x000a
+#define PCI_DEVICE_ID_NCR_53C896 0x000b
+#define PCI_DEVICE_ID_NCR_53C895 0x000c
+#define PCI_DEVICE_ID_NCR_53C885 0x000d
+#define PCI_DEVICE_ID_NCR_53C875 0x000f
+#define PCI_DEVICE_ID_NCR_53C1510 0x0010
+#define PCI_DEVICE_ID_LSI_53C895A 0x0012
+#define PCI_DEVICE_ID_LSI_53C875A 0x0013
+#define PCI_DEVICE_ID_LSI_53C1010_33 0x0020
+#define PCI_DEVICE_ID_LSI_53C1010_66 0x0021
+#define PCI_DEVICE_ID_LSI_53C1030 0x0030
+#define PCI_DEVICE_ID_LSI_1030_53C1035 0x0032
+#define PCI_DEVICE_ID_LSI_53C1035 0x0040
+#define PCI_DEVICE_ID_NCR_53C875J 0x008f
+#define PCI_DEVICE_ID_LSI_FC909 0x0621
+#define PCI_DEVICE_ID_LSI_FC929 0x0622
+#define PCI_DEVICE_ID_LSI_FC929_LAN 0x0623
+#define PCI_DEVICE_ID_LSI_FC919 0x0624
+#define PCI_DEVICE_ID_LSI_FC919_LAN 0x0625
+#define PCI_DEVICE_ID_LSI_FC929X 0x0626
+#define PCI_DEVICE_ID_LSI_FC939X 0x0642
+#define PCI_DEVICE_ID_LSI_FC949X 0x0640
+#define PCI_DEVICE_ID_LSI_FC949ES 0x0646
+#define PCI_DEVICE_ID_LSI_FC919X 0x0628
+#define PCI_DEVICE_ID_NCR_YELLOWFIN 0x0701
+#define PCI_DEVICE_ID_LSI_61C102 0x0901
+#define PCI_DEVICE_ID_LSI_63C815 0x1000
+#define PCI_DEVICE_ID_LSI_SAS1064 0x0050
+#define PCI_DEVICE_ID_LSI_SAS1064R 0x0411
+#define PCI_DEVICE_ID_LSI_SAS1066 0x005E
+#define PCI_DEVICE_ID_LSI_SAS1068 0x0054
+#define PCI_DEVICE_ID_LSI_SAS1064A 0x005C
+#define PCI_DEVICE_ID_LSI_SAS1064E 0x0056
+#define PCI_DEVICE_ID_LSI_SAS1066E 0x005A
+#define PCI_DEVICE_ID_LSI_SAS1068E 0x0058
+#define PCI_DEVICE_ID_LSI_SAS1078 0x0060
+
+#define PCI_VENDOR_ID_ATI 0x1002
+
+#define PCI_DEVICE_ID_ATI_68800 0x4158
+#define PCI_DEVICE_ID_ATI_215CT222 0x4354
+#define PCI_DEVICE_ID_ATI_210888CX 0x4358
+#define PCI_DEVICE_ID_ATI_215ET222 0x4554
+
+#define PCI_DEVICE_ID_ATI_215GB 0x4742
+#define PCI_DEVICE_ID_ATI_215GD 0x4744
+#define PCI_DEVICE_ID_ATI_215GI 0x4749
+#define PCI_DEVICE_ID_ATI_215GP 0x4750
+#define PCI_DEVICE_ID_ATI_215GQ 0x4751
+#define PCI_DEVICE_ID_ATI_215XL 0x4752
+#define PCI_DEVICE_ID_ATI_215GT 0x4754
+#define PCI_DEVICE_ID_ATI_215GTB 0x4755
+#define PCI_DEVICE_ID_ATI_215_IV 0x4756
+#define PCI_DEVICE_ID_ATI_215_IW 0x4757
+#define PCI_DEVICE_ID_ATI_215_IZ 0x475A
+#define PCI_DEVICE_ID_ATI_210888GX 0x4758
+#define PCI_DEVICE_ID_ATI_215_LB 0x4c42
+#define PCI_DEVICE_ID_ATI_215_LD 0x4c44
+#define PCI_DEVICE_ID_ATI_215_LG 0x4c47
+#define PCI_DEVICE_ID_ATI_215_LI 0x4c49
+#define PCI_DEVICE_ID_ATI_215_LM 0x4c4D
+#define PCI_DEVICE_ID_ATI_215_LN 0x4c4E
+#define PCI_DEVICE_ID_ATI_215_LR 0x4c52
+#define PCI_DEVICE_ID_ATI_215_LS 0x4c53
+#define PCI_DEVICE_ID_ATI_264_LT 0x4c54
+
+#define PCI_DEVICE_ID_ATI_264VT 0x5654
+#define PCI_DEVICE_ID_ATI_264VU 0x5655
+#define PCI_DEVICE_ID_ATI_264VV 0x5656
+
+#define PCI_DEVICE_ID_ATI_RAGE128_RE 0x5245
+#define PCI_DEVICE_ID_ATI_RAGE128_RF 0x5246
+#define PCI_DEVICE_ID_ATI_RAGE128_RG 0x5247
+
+#define PCI_DEVICE_ID_ATI_RAGE128_RK 0x524b
+#define PCI_DEVICE_ID_ATI_RAGE128_RL 0x524c
+#define PCI_DEVICE_ID_ATI_RAGE128_SE 0x5345
+#define PCI_DEVICE_ID_ATI_RAGE128_SF 0x5346
+#define PCI_DEVICE_ID_ATI_RAGE128_SG 0x5347
+#define PCI_DEVICE_ID_ATI_RAGE128_SH 0x5348
+#define PCI_DEVICE_ID_ATI_RAGE128_SK 0x534b
+#define PCI_DEVICE_ID_ATI_RAGE128_SL 0x534c
+#define PCI_DEVICE_ID_ATI_RAGE128_SM 0x534d
+#define PCI_DEVICE_ID_ATI_RAGE128_SN 0x534e
+
+#define PCI_DEVICE_ID_ATI_RAGE128_TF 0x5446
+#define PCI_DEVICE_ID_ATI_RAGE128_TL 0x544c
+#define PCI_DEVICE_ID_ATI_RAGE128_TR 0x5452
+#define PCI_DEVICE_ID_ATI_RAGE128_TS 0x5453
+#define PCI_DEVICE_ID_ATI_RAGE128_TT 0x5454
+#define PCI_DEVICE_ID_ATI_RAGE128_TU 0x5455
+
+#define PCI_DEVICE_ID_ATI_RAGE128_LE 0x4c45
+#define PCI_DEVICE_ID_ATI_RAGE128_LF 0x4c46
+
+#define PCI_DEVICE_ID_ATI_RAGE128_MF 0x4d46
+#define PCI_DEVICE_ID_ATI_RAGE128_ML 0x4d4c
+
+#define PCI_DEVICE_ID_ATI_RAGE128_PA 0x5041
+#define PCI_DEVICE_ID_ATI_RAGE128_PB 0x5042
+#define PCI_DEVICE_ID_ATI_RAGE128_PC 0x5043
+#define PCI_DEVICE_ID_ATI_RAGE128_PD 0x5044
+#define PCI_DEVICE_ID_ATI_RAGE128_PE 0x5045
+#define PCI_DEVICE_ID_ATI_RAGE128_PF 0x5046
+
+#define PCI_DEVICE_ID_ATI_RAGE128_PG 0x5047
+#define PCI_DEVICE_ID_ATI_RAGE128_PH 0x5048
+#define PCI_DEVICE_ID_ATI_RAGE128_PI 0x5049
+#define PCI_DEVICE_ID_ATI_RAGE128_PJ 0x504A
+#define PCI_DEVICE_ID_ATI_RAGE128_PK 0x504B
+#define PCI_DEVICE_ID_ATI_RAGE128_PL 0x504C
+#define PCI_DEVICE_ID_ATI_RAGE128_PM 0x504D
+#define PCI_DEVICE_ID_ATI_RAGE128_PN 0x504E
+#define PCI_DEVICE_ID_ATI_RAGE128_PO 0x504F
+#define PCI_DEVICE_ID_ATI_RAGE128_PP 0x5050
+#define PCI_DEVICE_ID_ATI_RAGE128_PQ 0x5051
+#define PCI_DEVICE_ID_ATI_RAGE128_PR 0x5052
+#define PCI_DEVICE_ID_ATI_RAGE128_PS 0x5053
+#define PCI_DEVICE_ID_ATI_RAGE128_PT 0x5054
+#define PCI_DEVICE_ID_ATI_RAGE128_PU 0x5055
+#define PCI_DEVICE_ID_ATI_RAGE128_PV 0x5056
+#define PCI_DEVICE_ID_ATI_RAGE128_PW 0x5057
+#define PCI_DEVICE_ID_ATI_RAGE128_PX 0x5058
+
+#define PCI_DEVICE_ID_ATI_RADEON_QD 0x5144
+#define PCI_DEVICE_ID_ATI_RADEON_QE 0x5145
+#define PCI_DEVICE_ID_ATI_RADEON_QF 0x5146
+#define PCI_DEVICE_ID_ATI_RADEON_QG 0x5147
+
+#define PCI_DEVICE_ID_ATI_RADEON_QY 0x5159
+#define PCI_DEVICE_ID_ATI_RADEON_QZ 0x515a
+
+#define PCI_DEVICE_ID_ATI_RADEON_QL 0x514c
+#define PCI_DEVICE_ID_ATI_RADEON_QN 0x514e
+#define PCI_DEVICE_ID_ATI_RADEON_QO 0x514f
+#define PCI_DEVICE_ID_ATI_RADEON_Ql 0x516c
+#define PCI_DEVICE_ID_ATI_RADEON_BB 0x4242
+
+#define PCI_DEVICE_ID_ATI_RADEON_QM 0x514d
+
+#define PCI_DEVICE_ID_ATI_RADEON_QW 0x5157
+#define PCI_DEVICE_ID_ATI_RADEON_QX 0x5158
+
+#define PCI_DEVICE_ID_ATI_RADEON_Id 0x4964
+#define PCI_DEVICE_ID_ATI_RADEON_Ie 0x4965
+#define PCI_DEVICE_ID_ATI_RADEON_If 0x4966
+#define PCI_DEVICE_ID_ATI_RADEON_Ig 0x4967
+
+#define PCI_DEVICE_ID_ATI_RADEON_Ya 0x5961
+#define PCI_DEVICE_ID_ATI_RADEON_Yd 0x5964
+
+#define PCI_DEVICE_ID_ATI_RADEON_ND 0x4e44
+#define PCI_DEVICE_ID_ATI_RADEON_NE 0x4e45
+#define PCI_DEVICE_ID_ATI_RADEON_NF 0x4e46
+#define PCI_DEVICE_ID_ATI_RADEON_NG 0x4e47
+
+#define PCI_DEVICE_ID_ATI_RADEON_LY 0x4c59
+#define PCI_DEVICE_ID_ATI_RADEON_LZ 0x4c5a
+
+#define PCI_DEVICE_ID_ATI_RADEON_LW 0x4c57
+#define PCI_DEVICE_ID_ATI_RADEON_LX 0x4c58
+
+#define PCI_DEVICE_ID_ATI_RADEON_Ld 0x4c64
+#define PCI_DEVICE_ID_ATI_RADEON_Le 0x4c65
+#define PCI_DEVICE_ID_ATI_RADEON_Lf 0x4c66
+#define PCI_DEVICE_ID_ATI_RADEON_Lg 0x4c67
+
+#define PCI_DEVICE_ID_ATI_RS100 0xcab0
+#define PCI_DEVICE_ID_ATI_RS200 0xcab2
+#define PCI_DEVICE_ID_ATI_RS200_B 0xcbb2
+#define PCI_DEVICE_ID_ATI_RS250 0xcab3
+#define PCI_DEVICE_ID_ATI_RS300_100 0x5830
+#define PCI_DEVICE_ID_ATI_RS300_133 0x5831
+#define PCI_DEVICE_ID_ATI_RS300_166 0x5832
+#define PCI_DEVICE_ID_ATI_RS300_200 0x5833
+#define PCI_DEVICE_ID_ATI_RS350_100 0x7830
+#define PCI_DEVICE_ID_ATI_RS350_133 0x7831
+#define PCI_DEVICE_ID_ATI_RS350_166 0x7832
+#define PCI_DEVICE_ID_ATI_RS350_200 0x7833
+#define PCI_DEVICE_ID_ATI_RS400_100 0x5a30
+#define PCI_DEVICE_ID_ATI_RS400_133 0x5a31
+#define PCI_DEVICE_ID_ATI_RS400_166 0x5a32
+#define PCI_DEVICE_ID_ATI_RS400_200 0x5a33
+#define PCI_DEVICE_ID_ATI_RS480 0x5950
+
+#define PCI_DEVICE_ID_ATI_IXP200_IDE 0x4349
+#define PCI_DEVICE_ID_ATI_IXP200_SMBUS 0x4353
+#define PCI_DEVICE_ID_ATI_IXP300_SMBUS 0x4363
+#define PCI_DEVICE_ID_ATI_IXP300_IDE 0x4369
+#define PCI_DEVICE_ID_ATI_IXP300_SATA 0x436e
+#define PCI_DEVICE_ID_ATI_IXP400_SMBUS 0x4372
+#define PCI_DEVICE_ID_ATI_IXP400_IDE 0x4376
+#define PCI_DEVICE_ID_ATI_IXP400_SATA 0x4379
+#define PCI_DEVICE_ID_ATI_IXP400_SATA2 0x437a
+#define PCI_DEVICE_ID_ATI_IXP600_SATA 0x4380
+#define PCI_DEVICE_ID_ATI_IXP600_SRAID 0x4381
+#define PCI_DEVICE_ID_ATI_IXP600_IDE 0x438c
+
+#define PCI_VENDOR_ID_VLSI 0x1004
+#define PCI_DEVICE_ID_VLSI_82C592 0x0005
+#define PCI_DEVICE_ID_VLSI_82C593 0x0006
+#define PCI_DEVICE_ID_VLSI_82C594 0x0007
+#define PCI_DEVICE_ID_VLSI_82C597 0x0009
+#define PCI_DEVICE_ID_VLSI_82C541 0x000c
+#define PCI_DEVICE_ID_VLSI_82C543 0x000d
+#define PCI_DEVICE_ID_VLSI_82C532 0x0101
+#define PCI_DEVICE_ID_VLSI_82C534 0x0102
+#define PCI_DEVICE_ID_VLSI_82C535 0x0104
+#define PCI_DEVICE_ID_VLSI_82C147 0x0105
+#define PCI_DEVICE_ID_VLSI_VAS96011 0x0702
+
+#define PCI_VENDOR_ID_ADL 0x1005
+#define PCI_DEVICE_ID_ADL_2301 0x2301
+
+#define PCI_VENDOR_ID_NS 0x100b
+#define PCI_DEVICE_ID_NS_87415 0x0002
+#define PCI_DEVICE_ID_NS_87560_LIO 0x000e
+#define PCI_DEVICE_ID_NS_87560_USB 0x0012
+#define PCI_DEVICE_ID_NS_83815 0x0020
+#define PCI_DEVICE_ID_NS_83820 0x0022
+#define PCI_DEVICE_ID_NS_CS5535_ISA 0x002b
+#define PCI_DEVICE_ID_NS_CS5535_IDE 0x002d
+#define PCI_DEVICE_ID_NS_CS5535_AUDIO 0x002e
+#define PCI_DEVICE_ID_NS_CS5535_USB 0x002f
+#define PCI_DEVICE_ID_NS_CS5535_VIDEO 0x0030
+#define PCI_DEVICE_ID_NS_SATURN 0x0035
+#define PCI_DEVICE_ID_NS_SCx200_BRIDGE 0x0500
+#define PCI_DEVICE_ID_NS_SCx200_SMI 0x0501
+#define PCI_DEVICE_ID_NS_SCx200_IDE 0x0502
+#define PCI_DEVICE_ID_NS_SCx200_AUDIO 0x0503
+#define PCI_DEVICE_ID_NS_SCx200_VIDEO 0x0504
+#define PCI_DEVICE_ID_NS_SCx200_XBUS 0x0505
+#define PCI_DEVICE_ID_NS_SC1100_BRIDGE 0x0510
+#define PCI_DEVICE_ID_NS_SC1100_SMI 0x0511
+#define PCI_DEVICE_ID_NS_SC1100_XBUS 0x0515
+#define PCI_DEVICE_ID_NS_87410 0xd001
+
+#define PCI_DEVICE_ID_NS_CS5535_HOST_BRIDGE 0x0028
+#define PCI_DEVICE_ID_NS_CS5535_ISA_BRIDGE 0x002b
+
+#define PCI_VENDOR_ID_TSENG 0x100c
+#define PCI_DEVICE_ID_TSENG_W32P_2 0x3202
+#define PCI_DEVICE_ID_TSENG_W32P_b 0x3205
+#define PCI_DEVICE_ID_TSENG_W32P_c 0x3206
+#define PCI_DEVICE_ID_TSENG_W32P_d 0x3207
+#define PCI_DEVICE_ID_TSENG_ET6000 0x3208
+
+#define PCI_VENDOR_ID_WEITEK 0x100e
+#define PCI_DEVICE_ID_WEITEK_P9000 0x9001
+#define PCI_DEVICE_ID_WEITEK_P9100 0x9100
+
+#define PCI_VENDOR_ID_DEC 0x1011
+#define PCI_DEVICE_ID_DEC_BRD 0x0001
+#define PCI_DEVICE_ID_DEC_TULIP 0x0002
+#define PCI_DEVICE_ID_DEC_TGA 0x0004
+#define PCI_DEVICE_ID_DEC_TULIP_FAST 0x0009
+#define PCI_DEVICE_ID_DEC_TGA2 0x000D
+#define PCI_DEVICE_ID_DEC_FDDI 0x000F
+#define PCI_DEVICE_ID_DEC_TULIP_PLUS 0x0014
+#define PCI_DEVICE_ID_DEC_21142 0x0019
+#define PCI_DEVICE_ID_DEC_21052 0x0021
+#define PCI_DEVICE_ID_DEC_21150 0x0022
+#define PCI_DEVICE_ID_DEC_21152 0x0024
+#define PCI_DEVICE_ID_DEC_21153 0x0025
+#define PCI_DEVICE_ID_DEC_21154 0x0026
+#define PCI_DEVICE_ID_DEC_21285 0x1065
+#define PCI_DEVICE_ID_COMPAQ_42XX 0x0046
+
+#define PCI_VENDOR_ID_CIRRUS 0x1013
+#define PCI_DEVICE_ID_CIRRUS_7548 0x0038
+#define PCI_DEVICE_ID_CIRRUS_5430 0x00a0
+#define PCI_DEVICE_ID_CIRRUS_5434_4 0x00a4
+#define PCI_DEVICE_ID_CIRRUS_5434_8 0x00a8
+#define PCI_DEVICE_ID_CIRRUS_5436 0x00ac
+#define PCI_DEVICE_ID_CIRRUS_5446 0x00b8
+#define PCI_DEVICE_ID_CIRRUS_5480 0x00bc
+#define PCI_DEVICE_ID_CIRRUS_5462 0x00d0
+#define PCI_DEVICE_ID_CIRRUS_5464 0x00d4
+#define PCI_DEVICE_ID_CIRRUS_5465 0x00d6
+#define PCI_DEVICE_ID_CIRRUS_6729 0x1100
+#define PCI_DEVICE_ID_CIRRUS_6832 0x1110
+#define PCI_DEVICE_ID_CIRRUS_7543 0x1202
+#define PCI_DEVICE_ID_CIRRUS_4610 0x6001
+#define PCI_DEVICE_ID_CIRRUS_4612 0x6003
+#define PCI_DEVICE_ID_CIRRUS_4615 0x6004
+
+#define PCI_VENDOR_ID_IBM 0x1014
+#define PCI_DEVICE_ID_IBM_TR 0x0018
+#define PCI_DEVICE_ID_IBM_TR_WAKE 0x003e
+#define PCI_DEVICE_ID_IBM_CPC710_PCI64 0x00fc
+#define PCI_DEVICE_ID_IBM_SNIPE 0x0180
+#define PCI_DEVICE_ID_IBM_CITRINE 0x028C
+#define PCI_DEVICE_ID_IBM_GEMSTONE 0xB166
+#define PCI_DEVICE_ID_IBM_OBSIDIAN 0x02BD
+#define PCI_DEVICE_ID_IBM_ICOM_DEV_ID_1 0x0031
+#define PCI_DEVICE_ID_IBM_ICOM_DEV_ID_2 0x0219
+#define PCI_DEVICE_ID_IBM_ICOM_V2_TWO_PORTS_RVX 0x021A
+#define PCI_DEVICE_ID_IBM_ICOM_V2_ONE_PORT_RVX_ONE_PORT_MDM 0x0251
+#define PCI_DEVICE_ID_IBM_ICOM_FOUR_PORT_MODEL 0x252
+
+#define PCI_VENDOR_ID_COMPEX2 0x101a  
+#define PCI_DEVICE_ID_COMPEX2_100VG 0x0005
+
+#define PCI_VENDOR_ID_WD 0x101c
+#define PCI_DEVICE_ID_WD_90C 0xc24a
+
+#define PCI_VENDOR_ID_AMI 0x101e
+#define PCI_DEVICE_ID_AMI_MEGARAID3 0x1960
+#define PCI_DEVICE_ID_AMI_MEGARAID 0x9010
+#define PCI_DEVICE_ID_AMI_MEGARAID2 0x9060
+
+#define PCI_VENDOR_ID_AMD 0x1022
+#define PCI_DEVICE_ID_AMD_K8_NB 0x1100
+#define PCI_DEVICE_ID_AMD_LANCE 0x2000
+#define PCI_DEVICE_ID_AMD_LANCE_HOME 0x2001
+#define PCI_DEVICE_ID_AMD_SCSI 0x2020
+#define PCI_DEVICE_ID_AMD_SERENADE 0x36c0
+#define PCI_DEVICE_ID_AMD_FE_GATE_7006 0x7006
+#define PCI_DEVICE_ID_AMD_FE_GATE_7007 0x7007
+#define PCI_DEVICE_ID_AMD_FE_GATE_700C 0x700C
+#define PCI_DEVICE_ID_AMD_FE_GATE_700E 0x700E
+#define PCI_DEVICE_ID_AMD_COBRA_7401 0x7401
+#define PCI_DEVICE_ID_AMD_VIPER_7409 0x7409
+#define PCI_DEVICE_ID_AMD_VIPER_740B 0x740B
+#define PCI_DEVICE_ID_AMD_VIPER_7410 0x7410
+#define PCI_DEVICE_ID_AMD_VIPER_7411 0x7411
+#define PCI_DEVICE_ID_AMD_VIPER_7413 0x7413
+#define PCI_DEVICE_ID_AMD_VIPER_7440 0x7440
+#define PCI_DEVICE_ID_AMD_OPUS_7441 0x7441
+#define PCI_DEVICE_ID_AMD_OPUS_7443 0x7443
+#define PCI_DEVICE_ID_AMD_VIPER_7443 0x7443
+#define PCI_DEVICE_ID_AMD_OPUS_7445 0x7445
+#define PCI_DEVICE_ID_AMD_8111_LPC 0x7468
+#define PCI_DEVICE_ID_AMD_8111_IDE 0x7469
+#define PCI_DEVICE_ID_AMD_8111_SMBUS2 0x746a
+#define PCI_DEVICE_ID_AMD_8111_SMBUS 0x746b
+#define PCI_DEVICE_ID_AMD_8111_AUDIO 0x746d
+#define PCI_DEVICE_ID_AMD_8151_0 0x7454
+#define PCI_DEVICE_ID_AMD_8131_BRIDGE 0x7450
+#define PCI_DEVICE_ID_AMD_8131_APIC 0x7451
+#define PCI_DEVICE_ID_AMD_CS5536_ISA 0x2090
+#define PCI_DEVICE_ID_AMD_CS5536_FLASH 0x2091
+#define PCI_DEVICE_ID_AMD_CS5536_AUDIO 0x2093
+#define PCI_DEVICE_ID_AMD_CS5536_OHC 0x2094
+#define PCI_DEVICE_ID_AMD_CS5536_EHC 0x2095
+#define PCI_DEVICE_ID_AMD_CS5536_UDC 0x2096
+#define PCI_DEVICE_ID_AMD_CS5536_UOC 0x2097
+#define PCI_DEVICE_ID_AMD_CS5536_IDE 0x209A
+
+#define PCI_DEVICE_ID_AMD_LX_VIDEO 0x2081
+#define PCI_DEVICE_ID_AMD_LX_AES 0x2082
+
+#define PCI_VENDOR_ID_TRIDENT 0x1023
+#define PCI_DEVICE_ID_TRIDENT_4DWAVE_DX 0x2000
+#define PCI_DEVICE_ID_TRIDENT_4DWAVE_NX 0x2001
+#define PCI_DEVICE_ID_TRIDENT_9320 0x9320
+#define PCI_DEVICE_ID_TRIDENT_9388 0x9388
+#define PCI_DEVICE_ID_TRIDENT_9397 0x9397
+#define PCI_DEVICE_ID_TRIDENT_939A 0x939A
+#define PCI_DEVICE_ID_TRIDENT_9520 0x9520
+#define PCI_DEVICE_ID_TRIDENT_9525 0x9525
+#define PCI_DEVICE_ID_TRIDENT_9420 0x9420
+#define PCI_DEVICE_ID_TRIDENT_9440 0x9440
+#define PCI_DEVICE_ID_TRIDENT_9660 0x9660
+#define PCI_DEVICE_ID_TRIDENT_9750 0x9750
+#define PCI_DEVICE_ID_TRIDENT_9850 0x9850
+#define PCI_DEVICE_ID_TRIDENT_9880 0x9880
+#define PCI_DEVICE_ID_TRIDENT_8400 0x8400
+#define PCI_DEVICE_ID_TRIDENT_8420 0x8420
+#define PCI_DEVICE_ID_TRIDENT_8500 0x8500
+
+#define PCI_VENDOR_ID_AI 0x1025
+#define PCI_DEVICE_ID_AI_M1435 0x1435
+
+#define PCI_VENDOR_ID_DELL 0x1028
+#define PCI_DEVICE_ID_DELL_RACIII 0x0008
+#define PCI_DEVICE_ID_DELL_RAC4 0x0012
+#define PCI_DEVICE_ID_DELL_PERC5 0x0015
+
+#define PCI_VENDOR_ID_MATROX 0x102B
+#define PCI_DEVICE_ID_MATROX_MGA_2 0x0518
+#define PCI_DEVICE_ID_MATROX_MIL 0x0519
+#define PCI_DEVICE_ID_MATROX_MYS 0x051A
+#define PCI_DEVICE_ID_MATROX_MIL_2 0x051b
+#define PCI_DEVICE_ID_MATROX_MYS_AGP 0x051e
+#define PCI_DEVICE_ID_MATROX_MIL_2_AGP 0x051f
+#define PCI_DEVICE_ID_MATROX_MGA_IMP 0x0d10
+#define PCI_DEVICE_ID_MATROX_G100_MM 0x1000
+#define PCI_DEVICE_ID_MATROX_G100_AGP 0x1001
+#define PCI_DEVICE_ID_MATROX_G200_PCI 0x0520
+#define PCI_DEVICE_ID_MATROX_G200_AGP 0x0521
+#define PCI_DEVICE_ID_MATROX_G400 0x0525
+#define PCI_DEVICE_ID_MATROX_G550 0x2527
+#define PCI_DEVICE_ID_MATROX_VIA 0x4536
+
+#define PCI_VENDOR_ID_CT 0x102c
+#define PCI_DEVICE_ID_CT_69000 0x00c0
+#define PCI_DEVICE_ID_CT_65545 0x00d8
+#define PCI_DEVICE_ID_CT_65548 0x00dc
+#define PCI_DEVICE_ID_CT_65550 0x00e0
+#define PCI_DEVICE_ID_CT_65554 0x00e4
+#define PCI_DEVICE_ID_CT_65555 0x00e5
+
+#define PCI_VENDOR_ID_MIRO 0x1031
+#define PCI_DEVICE_ID_MIRO_36050 0x5601
+#define PCI_DEVICE_ID_MIRO_DC10PLUS 0x7efe
+#define PCI_DEVICE_ID_MIRO_DC30PLUS 0xd801
+
+#define PCI_VENDOR_ID_NEC 0x1033
+#define PCI_DEVICE_ID_NEC_CBUS_1 0x0001  
+#define PCI_DEVICE_ID_NEC_LOCAL 0x0002  
+#define PCI_DEVICE_ID_NEC_ATM 0x0003  
+#define PCI_DEVICE_ID_NEC_R4000 0x0004  
+#define PCI_DEVICE_ID_NEC_486 0x0005  
+#define PCI_DEVICE_ID_NEC_ACCEL_1 0x0006  
+#define PCI_DEVICE_ID_NEC_UXBUS 0x0007  
+#define PCI_DEVICE_ID_NEC_ACCEL_2 0x0008  
+#define PCI_DEVICE_ID_NEC_GRAPH 0x0009  
+#define PCI_DEVICE_ID_NEC_VL 0x0016  
+#define PCI_DEVICE_ID_NEC_STARALPHA2 0x002c  
+#define PCI_DEVICE_ID_NEC_CBUS_2 0x002d  
+#define PCI_DEVICE_ID_NEC_USB 0x0035  
+#define PCI_DEVICE_ID_NEC_CBUS_3 0x003b
+#define PCI_DEVICE_ID_NEC_NAPCCARD 0x003e
+#define PCI_DEVICE_ID_NEC_PCX2 0x0046  
+#define PCI_DEVICE_ID_NEC_NILE4 0x005a
+#define PCI_DEVICE_ID_NEC_VRC5476 0x009b
+#define PCI_DEVICE_ID_NEC_VRC4173 0x00a5
+#define PCI_DEVICE_ID_NEC_VRC5477_AC97 0x00a6
+#define PCI_DEVICE_ID_NEC_PC9821CS01 0x800c  
+#define PCI_DEVICE_ID_NEC_PC9821NRB06 0x800d  
+
+#define PCI_VENDOR_ID_FD 0x1036
+#define PCI_DEVICE_ID_FD_36C70 0x0000
+
+#define PCI_VENDOR_ID_SI 0x1039
+#define PCI_DEVICE_ID_SI_5591_AGP 0x0001
+#define PCI_DEVICE_ID_SI_6202 0x0002
+#define PCI_DEVICE_ID_SI_503 0x0008
+#define PCI_DEVICE_ID_SI_ACPI 0x0009
+#define PCI_DEVICE_ID_SI_SMBUS 0x0016
+#define PCI_DEVICE_ID_SI_LPC 0x0018
+#define PCI_DEVICE_ID_SI_5597_VGA 0x0200
+#define PCI_DEVICE_ID_SI_6205 0x0205
+#define PCI_DEVICE_ID_SI_501 0x0406
+#define PCI_DEVICE_ID_SI_496 0x0496
+#define PCI_DEVICE_ID_SI_300 0x0300
+#define PCI_DEVICE_ID_SI_315H 0x0310
+#define PCI_DEVICE_ID_SI_315 0x0315
+#define PCI_DEVICE_ID_SI_315PRO 0x0325
+#define PCI_DEVICE_ID_SI_530 0x0530
+#define PCI_DEVICE_ID_SI_540 0x0540
+#define PCI_DEVICE_ID_SI_550 0x0550
+#define PCI_DEVICE_ID_SI_540_VGA 0x5300
+#define PCI_DEVICE_ID_SI_550_VGA 0x5315
+#define PCI_DEVICE_ID_SI_620 0x0620
+#define PCI_DEVICE_ID_SI_630 0x0630
+#define PCI_DEVICE_ID_SI_633 0x0633
+#define PCI_DEVICE_ID_SI_635 0x0635
+#define PCI_DEVICE_ID_SI_640 0x0640
+#define PCI_DEVICE_ID_SI_645 0x0645
+#define PCI_DEVICE_ID_SI_646 0x0646
+#define PCI_DEVICE_ID_SI_648 0x0648
+#define PCI_DEVICE_ID_SI_650 0x0650
+#define PCI_DEVICE_ID_SI_651 0x0651
+#define PCI_DEVICE_ID_SI_655 0x0655
+#define PCI_DEVICE_ID_SI_661 0x0661
+#define PCI_DEVICE_ID_SI_730 0x0730
+#define PCI_DEVICE_ID_SI_733 0x0733
+#define PCI_DEVICE_ID_SI_630_VGA 0x6300
+#define PCI_DEVICE_ID_SI_735 0x0735
+#define PCI_DEVICE_ID_SI_740 0x0740
+#define PCI_DEVICE_ID_SI_741 0x0741
+#define PCI_DEVICE_ID_SI_745 0x0745
+#define PCI_DEVICE_ID_SI_746 0x0746
+#define PCI_DEVICE_ID_SI_755 0x0755
+#define PCI_DEVICE_ID_SI_760 0x0760
+#define PCI_DEVICE_ID_SI_900 0x0900
+#define PCI_DEVICE_ID_SI_961 0x0961
+#define PCI_DEVICE_ID_SI_962 0x0962
+#define PCI_DEVICE_ID_SI_963 0x0963
+#define PCI_DEVICE_ID_SI_965 0x0965
+#define PCI_DEVICE_ID_SI_966 0x0966
+#define PCI_DEVICE_ID_SI_968 0x0968
+#define PCI_DEVICE_ID_SI_5511 0x5511
+#define PCI_DEVICE_ID_SI_5513 0x5513
+#define PCI_DEVICE_ID_SI_5517 0x5517
+#define PCI_DEVICE_ID_SI_5518 0x5518
+#define PCI_DEVICE_ID_SI_5571 0x5571
+#define PCI_DEVICE_ID_SI_5581 0x5581
+#define PCI_DEVICE_ID_SI_5582 0x5582
+#define PCI_DEVICE_ID_SI_5591 0x5591
+#define PCI_DEVICE_ID_SI_5596 0x5596
+#define PCI_DEVICE_ID_SI_5597 0x5597
+#define PCI_DEVICE_ID_SI_5598 0x5598
+#define PCI_DEVICE_ID_SI_5600 0x5600
+#define PCI_DEVICE_ID_SI_7012 0x7012
+#define PCI_DEVICE_ID_SI_7013 0x7013
+#define PCI_DEVICE_ID_SI_7016 0x7016
+#define PCI_DEVICE_ID_SI_7018 0x7018
+
+#define PCI_VENDOR_ID_HP 0x103c
+#define PCI_DEVICE_ID_HP_VISUALIZE_EG 0x1005
+#define PCI_DEVICE_ID_HP_VISUALIZE_FX6 0x1006
+#define PCI_DEVICE_ID_HP_VISUALIZE_FX4 0x1008
+#define PCI_DEVICE_ID_HP_VISUALIZE_FX2 0x100a
+#define PCI_DEVICE_ID_HP_TACHYON 0x1028
+#define PCI_DEVICE_ID_HP_TACHLITE 0x1029
+#define PCI_DEVICE_ID_HP_J2585A 0x1030
+#define PCI_DEVICE_ID_HP_J2585B 0x1031
+#define PCI_DEVICE_ID_HP_J2973A 0x1040
+#define PCI_DEVICE_ID_HP_J2970A 0x1042
+#define PCI_DEVICE_ID_HP_DIVA 0x1048
+#define PCI_DEVICE_ID_HP_DIVA_TOSCA1 0x1049
+#define PCI_DEVICE_ID_HP_DIVA_TOSCA2 0x104A
+#define PCI_DEVICE_ID_HP_DIVA_MAESTRO 0x104B
+#define PCI_DEVICE_ID_HP_REO_IOC 0x10f1
+#define PCI_DEVICE_ID_HP_VISUALIZE_FXE 0x108b
+#define PCI_DEVICE_ID_HP_DIVA_HALFDOME 0x1223
+#define PCI_DEVICE_ID_HP_DIVA_KEYSTONE 0x1226
+#define PCI_DEVICE_ID_HP_DIVA_POWERBAR 0x1227
+#define PCI_DEVICE_ID_HP_ZX1_IOC 0x122a
+#define PCI_DEVICE_ID_HP_PCIX_LBA 0x122e
+#define PCI_DEVICE_ID_HP_SX1000_IOC 0x127c
+#define PCI_DEVICE_ID_HP_DIVA_EVEREST 0x1282
+#define PCI_DEVICE_ID_HP_DIVA_AUX 0x1290
+#define PCI_DEVICE_ID_HP_DIVA_RMP3 0x1301
+#define PCI_DEVICE_ID_HP_DIVA_HURRICANE 0x132a
+#define PCI_DEVICE_ID_HP_CISSA 0x3220
+#define PCI_DEVICE_ID_HP_CISSC 0x3230
+#define PCI_DEVICE_ID_HP_CISSD 0x3238
+#define PCI_DEVICE_ID_HP_ZX2_IOC 0x4031
+
+#define PCI_VENDOR_ID_PCTECH 0x1042
+#define PCI_DEVICE_ID_PCTECH_RZ1000 0x1000
+#define PCI_DEVICE_ID_PCTECH_RZ1001 0x1001
+#define PCI_DEVICE_ID_PCTECH_SAMURAI_IDE 0x3020
+
+#define PCI_VENDOR_ID_ASUSTEK 0x1043
+#define PCI_DEVICE_ID_ASUSTEK_0675 0x0675
+
+#define PCI_VENDOR_ID_DPT 0x1044
+#define PCI_DEVICE_ID_DPT 0xa400
+
+#define PCI_VENDOR_ID_OPTI 0x1045
+#define PCI_DEVICE_ID_OPTI_82C558 0xc558
+#define PCI_DEVICE_ID_OPTI_82C621 0xc621
+#define PCI_DEVICE_ID_OPTI_82C700 0xc700
+#define PCI_DEVICE_ID_OPTI_82C825 0xd568
+
+#define PCI_VENDOR_ID_ELSA 0x1048
+#define PCI_DEVICE_ID_ELSA_MICROLINK 0x1000
+#define PCI_DEVICE_ID_ELSA_QS3000 0x3000
+
+#define PCI_VENDOR_ID_BUSLOGIC 0x104B
+#define PCI_DEVICE_ID_BUSLOGIC_MULTIMASTER_NC 0x0140
+#define PCI_DEVICE_ID_BUSLOGIC_MULTIMASTER 0x1040
+#define PCI_DEVICE_ID_BUSLOGIC_FLASHPOINT 0x8130
+
+#define PCI_VENDOR_ID_TI 0x104c
+#define PCI_DEVICE_ID_TI_TVP4020 0x3d07
+#define PCI_DEVICE_ID_TI_4450 0x8011
+#define PCI_DEVICE_ID_TI_XX21_XX11 0x8031
+#define PCI_DEVICE_ID_TI_XX21_XX11_SD 0x8034
+#define PCI_DEVICE_ID_TI_X515 0x8036
+#define PCI_DEVICE_ID_TI_XX12 0x8039
+#define PCI_DEVICE_ID_TI_1130 0xac12
+#define PCI_DEVICE_ID_TI_1031 0xac13
+#define PCI_DEVICE_ID_TI_1131 0xac15
+#define PCI_DEVICE_ID_TI_1250 0xac16
+#define PCI_DEVICE_ID_TI_1220 0xac17
+#define PCI_DEVICE_ID_TI_1221 0xac19
+#define PCI_DEVICE_ID_TI_1210 0xac1a
+#define PCI_DEVICE_ID_TI_1450 0xac1b
+#define PCI_DEVICE_ID_TI_1225 0xac1c
+#define PCI_DEVICE_ID_TI_1251A 0xac1d
+#define PCI_DEVICE_ID_TI_1211 0xac1e
+#define PCI_DEVICE_ID_TI_1251B 0xac1f
+#define PCI_DEVICE_ID_TI_4410 0xac41
+#define PCI_DEVICE_ID_TI_4451 0xac42
+#define PCI_DEVICE_ID_TI_4510 0xac44
+#define PCI_DEVICE_ID_TI_4520 0xac46
+#define PCI_DEVICE_ID_TI_7510 0xac47
+#define PCI_DEVICE_ID_TI_7610 0xac48
+#define PCI_DEVICE_ID_TI_7410 0xac49
+#define PCI_DEVICE_ID_TI_1410 0xac50
+#define PCI_DEVICE_ID_TI_1420 0xac51
+#define PCI_DEVICE_ID_TI_1451A 0xac52
+#define PCI_DEVICE_ID_TI_1620 0xac54
+#define PCI_DEVICE_ID_TI_1520 0xac55
+#define PCI_DEVICE_ID_TI_1510 0xac56
+#define PCI_DEVICE_ID_TI_X620 0xac8d
+#define PCI_DEVICE_ID_TI_X420 0xac8e
+
+#define PCI_VENDOR_ID_SONY 0x104d
+
+#define PCI_VENDOR_ID_WINBOND2 0x1050
+#define PCI_DEVICE_ID_WINBOND2_89C940F 0x5a5a
+#define PCI_DEVICE_ID_WINBOND2_6692 0x6692
+
+#define PCI_VENDOR_ID_ANIGMA 0x1051
+#define PCI_DEVICE_ID_ANIGMA_MC145575 0x0100
+
+#define PCI_VENDOR_ID_EFAR 0x1055
+#define PCI_DEVICE_ID_EFAR_SLC90E66_1 0x9130
+#define PCI_DEVICE_ID_EFAR_SLC90E66_3 0x9463
+
+#define PCI_VENDOR_ID_MOTOROLA 0x1057
+#define PCI_DEVICE_ID_MOTOROLA_MPC105 0x0001
+#define PCI_DEVICE_ID_MOTOROLA_MPC106 0x0002
+#define PCI_DEVICE_ID_MOTOROLA_MPC107 0x0004
+#define PCI_DEVICE_ID_MOTOROLA_RAVEN 0x4801
+#define PCI_DEVICE_ID_MOTOROLA_FALCON 0x4802
+#define PCI_DEVICE_ID_MOTOROLA_HAWK 0x4803
+#define PCI_DEVICE_ID_MOTOROLA_HARRIER 0x480b
+#define PCI_DEVICE_ID_MOTOROLA_MPC5200 0x5803
+#define PCI_DEVICE_ID_MOTOROLA_MPC5200B 0x5809
+
+#define PCI_VENDOR_ID_PROMISE 0x105a
+#define PCI_DEVICE_ID_PROMISE_20265 0x0d30
+#define PCI_DEVICE_ID_PROMISE_20267 0x4d30
+#define PCI_DEVICE_ID_PROMISE_20246 0x4d33
+#define PCI_DEVICE_ID_PROMISE_20262 0x4d38
+#define PCI_DEVICE_ID_PROMISE_20263 0x0D38
+#define PCI_DEVICE_ID_PROMISE_20268 0x4d68
+#define PCI_DEVICE_ID_PROMISE_20269 0x4d69
+#define PCI_DEVICE_ID_PROMISE_20270 0x6268
+#define PCI_DEVICE_ID_PROMISE_20271 0x6269
+#define PCI_DEVICE_ID_PROMISE_20275 0x1275
+#define PCI_DEVICE_ID_PROMISE_20276 0x5275
+#define PCI_DEVICE_ID_PROMISE_20277 0x7275
+
+#define PCI_VENDOR_ID_UMC 0x1060
+#define PCI_DEVICE_ID_UMC_UM8673F 0x0101
+#define PCI_DEVICE_ID_UMC_UM8886BF 0x673a
+#define PCI_DEVICE_ID_UMC_UM8886A 0x886a
+
+#define PCI_VENDOR_ID_MYLEX 0x1069
+#define PCI_DEVICE_ID_MYLEX_DAC960_P 0x0001
+#define PCI_DEVICE_ID_MYLEX_DAC960_PD 0x0002
+#define PCI_DEVICE_ID_MYLEX_DAC960_PG 0x0010
+#define PCI_DEVICE_ID_MYLEX_DAC960_LA 0x0020
+#define PCI_DEVICE_ID_MYLEX_DAC960_LP 0x0050
+#define PCI_DEVICE_ID_MYLEX_DAC960_BA 0xBA56
+#define PCI_DEVICE_ID_MYLEX_DAC960_GEM 0xB166
+
+#define PCI_VENDOR_ID_APPLE 0x106b
+#define PCI_DEVICE_ID_APPLE_BANDIT 0x0001
+#define PCI_DEVICE_ID_APPLE_HYDRA 0x000e
+#define PCI_DEVICE_ID_APPLE_UNI_N_FW 0x0018
+#define PCI_DEVICE_ID_APPLE_UNI_N_AGP 0x0020
+#define PCI_DEVICE_ID_APPLE_UNI_N_GMAC 0x0021
+#define PCI_DEVICE_ID_APPLE_UNI_N_GMACP 0x0024
+#define PCI_DEVICE_ID_APPLE_UNI_N_AGP_P 0x0027
+#define PCI_DEVICE_ID_APPLE_UNI_N_AGP15 0x002d
+#define PCI_DEVICE_ID_APPLE_UNI_N_PCI15 0x002e
+#define PCI_DEVICE_ID_APPLE_UNI_N_GMAC2 0x0032
+#define PCI_DEVICE_ID_APPLE_UNI_N_ATA 0x0033
+#define PCI_DEVICE_ID_APPLE_UNI_N_AGP2 0x0034
+#define PCI_DEVICE_ID_APPLE_IPID_ATA100 0x003b
+#define PCI_DEVICE_ID_APPLE_K2_ATA100 0x0043
+#define PCI_DEVICE_ID_APPLE_U3_AGP 0x004b
+#define PCI_DEVICE_ID_APPLE_K2_GMAC 0x004c
+#define PCI_DEVICE_ID_APPLE_SH_ATA 0x0050
+#define PCI_DEVICE_ID_APPLE_SH_SUNGEM 0x0051
+#define PCI_DEVICE_ID_APPLE_U3L_AGP 0x0058
+#define PCI_DEVICE_ID_APPLE_U3H_AGP 0x0059
+#define PCI_DEVICE_ID_APPLE_IPID2_AGP 0x0066
+#define PCI_DEVICE_ID_APPLE_IPID2_ATA 0x0069
+#define PCI_DEVICE_ID_APPLE_IPID2_FW 0x006a
+#define PCI_DEVICE_ID_APPLE_IPID2_GMAC 0x006b
+#define PCI_DEVICE_ID_APPLE_TIGON3 0x1645
+
+#define PCI_VENDOR_ID_YAMAHA 0x1073
+#define PCI_DEVICE_ID_YAMAHA_724 0x0004
+#define PCI_DEVICE_ID_YAMAHA_724F 0x000d
+#define PCI_DEVICE_ID_YAMAHA_740 0x000a
+#define PCI_DEVICE_ID_YAMAHA_740C 0x000c
+#define PCI_DEVICE_ID_YAMAHA_744 0x0010
+#define PCI_DEVICE_ID_YAMAHA_754 0x0012
+
+#define PCI_VENDOR_ID_QLOGIC 0x1077
+#define PCI_DEVICE_ID_QLOGIC_ISP10160 0x1016
+#define PCI_DEVICE_ID_QLOGIC_ISP1020 0x1020
+#define PCI_DEVICE_ID_QLOGIC_ISP1080 0x1080
+#define PCI_DEVICE_ID_QLOGIC_ISP12160 0x1216
+#define PCI_DEVICE_ID_QLOGIC_ISP1240 0x1240
+#define PCI_DEVICE_ID_QLOGIC_ISP1280 0x1280
+#define PCI_DEVICE_ID_QLOGIC_ISP2100 0x2100
+#define PCI_DEVICE_ID_QLOGIC_ISP2200 0x2200
+#define PCI_DEVICE_ID_QLOGIC_ISP2300 0x2300
+#define PCI_DEVICE_ID_QLOGIC_ISP2312 0x2312
+#define PCI_DEVICE_ID_QLOGIC_ISP2322 0x2322
+#define PCI_DEVICE_ID_QLOGIC_ISP6312 0x6312
+#define PCI_DEVICE_ID_QLOGIC_ISP6322 0x6322
+#define PCI_DEVICE_ID_QLOGIC_ISP2422 0x2422
+#define PCI_DEVICE_ID_QLOGIC_ISP2432 0x2432
+#define PCI_DEVICE_ID_QLOGIC_ISP2512 0x2512
+#define PCI_DEVICE_ID_QLOGIC_ISP2522 0x2522
+#define PCI_DEVICE_ID_QLOGIC_ISP5422 0x5422
+#define PCI_DEVICE_ID_QLOGIC_ISP5432 0x5432
+
+#define PCI_VENDOR_ID_CYRIX 0x1078
+#define PCI_DEVICE_ID_CYRIX_5510 0x0000
+#define PCI_DEVICE_ID_CYRIX_PCI_MASTER 0x0001
+#define PCI_DEVICE_ID_CYRIX_5520 0x0002
+#define PCI_DEVICE_ID_CYRIX_5530_LEGACY 0x0100
+#define PCI_DEVICE_ID_CYRIX_5530_IDE 0x0102
+#define PCI_DEVICE_ID_CYRIX_5530_AUDIO 0x0103
+#define PCI_DEVICE_ID_CYRIX_5530_VIDEO 0x0104
+
+#define PCI_VENDOR_ID_CONTAQ 0x1080
+#define PCI_DEVICE_ID_CONTAQ_82C693 0xc693
+
+#define PCI_VENDOR_ID_OLICOM 0x108d
+#define PCI_DEVICE_ID_OLICOM_OC2325 0x0012
+#define PCI_DEVICE_ID_OLICOM_OC2183 0x0013
+#define PCI_DEVICE_ID_OLICOM_OC2326 0x0014
+
+#define PCI_VENDOR_ID_SUN 0x108e
+#define PCI_DEVICE_ID_SUN_EBUS 0x1000
+#define PCI_DEVICE_ID_SUN_HAPPYMEAL 0x1001
+#define PCI_DEVICE_ID_SUN_RIO_EBUS 0x1100
+#define PCI_DEVICE_ID_SUN_RIO_GEM 0x1101
+#define PCI_DEVICE_ID_SUN_RIO_1394 0x1102
+#define PCI_DEVICE_ID_SUN_RIO_USB 0x1103
+#define PCI_DEVICE_ID_SUN_GEM 0x2bad
+#define PCI_DEVICE_ID_SUN_SIMBA 0x5000
+#define PCI_DEVICE_ID_SUN_PBM 0x8000
+#define PCI_DEVICE_ID_SUN_SCHIZO 0x8001
+#define PCI_DEVICE_ID_SUN_SABRE 0xa000
+#define PCI_DEVICE_ID_SUN_HUMMINGBIRD 0xa001
+#define PCI_DEVICE_ID_SUN_TOMATILLO 0xa801
+#define PCI_DEVICE_ID_SUN_CASSINI 0xabba
+
+#define PCI_VENDOR_ID_CMD 0x1095
+#define PCI_DEVICE_ID_CMD_643 0x0643
+#define PCI_DEVICE_ID_CMD_646 0x0646
+#define PCI_DEVICE_ID_CMD_648 0x0648
+#define PCI_DEVICE_ID_CMD_649 0x0649
+
+#define PCI_DEVICE_ID_SII_680 0x0680
+#define PCI_DEVICE_ID_SII_3112 0x3112
+#define PCI_DEVICE_ID_SII_1210SA 0x0240
+
+#define PCI_VENDOR_ID_BROOKTREE 0x109e
+#define PCI_DEVICE_ID_BROOKTREE_878 0x0878
+#define PCI_DEVICE_ID_BROOKTREE_879 0x0879
+
+#define PCI_VENDOR_ID_SGI 0x10a9
+#define PCI_DEVICE_ID_SGI_IOC3 0x0003
+#define PCI_DEVICE_ID_SGI_IOC4 0x100a
+#define PCI_VENDOR_ID_SGI_LITHIUM 0x1002
+
+#define PCI_VENDOR_ID_WINBOND 0x10ad
+#define PCI_DEVICE_ID_WINBOND_82C105 0x0105
+#define PCI_DEVICE_ID_WINBOND_83C553 0x0565
+
+#define PCI_VENDOR_ID_PLX 0x10b5
+#define PCI_DEVICE_ID_PLX_R685 0x1030
+#define PCI_DEVICE_ID_PLX_ROMULUS 0x106a
+#define PCI_DEVICE_ID_PLX_SPCOM800 0x1076
+#define PCI_DEVICE_ID_PLX_1077 0x1077
+#define PCI_DEVICE_ID_PLX_SPCOM200 0x1103
+#define PCI_DEVICE_ID_PLX_DJINN_ITOO 0x1151
+#define PCI_DEVICE_ID_PLX_R753 0x1152
+#define PCI_DEVICE_ID_PLX_OLITEC 0x1187
+#define PCI_DEVICE_ID_PLX_PCI200SYN 0x3196
+#define PCI_DEVICE_ID_PLX_9050 0x9050
+#define PCI_DEVICE_ID_PLX_9080 0x9080
+#define PCI_DEVICE_ID_PLX_GTEK_SERIAL2 0xa001
+
+#define PCI_VENDOR_ID_MADGE 0x10b6
+#define PCI_DEVICE_ID_MADGE_MK2 0x0002
+
+#define PCI_VENDOR_ID_3COM 0x10b7
+#define PCI_DEVICE_ID_3COM_3C985 0x0001
+#define PCI_DEVICE_ID_3COM_3C940 0x1700
+#define PCI_DEVICE_ID_3COM_3C339 0x3390
+#define PCI_DEVICE_ID_3COM_3C359 0x3590
+#define PCI_DEVICE_ID_3COM_3C940B 0x80eb
+#define PCI_DEVICE_ID_3COM_3CR990 0x9900
+#define PCI_DEVICE_ID_3COM_3CR990_TX_95 0x9902
+#define PCI_DEVICE_ID_3COM_3CR990_TX_97 0x9903
+#define PCI_DEVICE_ID_3COM_3CR990B 0x9904
+#define PCI_DEVICE_ID_3COM_3CR990_FX 0x9905
+#define PCI_DEVICE_ID_3COM_3CR990SVR95 0x9908
+#define PCI_DEVICE_ID_3COM_3CR990SVR97 0x9909
+#define PCI_DEVICE_ID_3COM_3CR990SVR 0x990a
+
+#define PCI_VENDOR_ID_AL 0x10b9
+#define PCI_DEVICE_ID_AL_M1533 0x1533
+#define PCI_DEVICE_ID_AL_M1535 0x1535
+#define PCI_DEVICE_ID_AL_M1541 0x1541
+#define PCI_DEVICE_ID_AL_M1563 0x1563
+#define PCI_DEVICE_ID_AL_M1621 0x1621
+#define PCI_DEVICE_ID_AL_M1631 0x1631
+#define PCI_DEVICE_ID_AL_M1632 0x1632
+#define PCI_DEVICE_ID_AL_M1641 0x1641
+#define PCI_DEVICE_ID_AL_M1644 0x1644
+#define PCI_DEVICE_ID_AL_M1647 0x1647
+#define PCI_DEVICE_ID_AL_M1651 0x1651
+#define PCI_DEVICE_ID_AL_M1671 0x1671
+#define PCI_DEVICE_ID_AL_M1681 0x1681
+#define PCI_DEVICE_ID_AL_M1683 0x1683
+#define PCI_DEVICE_ID_AL_M1689 0x1689
+#define PCI_DEVICE_ID_AL_M5219 0x5219
+#define PCI_DEVICE_ID_AL_M5228 0x5228
+#define PCI_DEVICE_ID_AL_M5229 0x5229
+#define PCI_DEVICE_ID_AL_M5451 0x5451
+#define PCI_DEVICE_ID_AL_M7101 0x7101
+
+#define PCI_VENDOR_ID_NEOMAGIC 0x10c8
+#define PCI_DEVICE_ID_NEOMAGIC_NM256AV_AUDIO 0x8005
+#define PCI_DEVICE_ID_NEOMAGIC_NM256ZX_AUDIO 0x8006
+#define PCI_DEVICE_ID_NEOMAGIC_NM256XL_PLUS_AUDIO 0x8016
+
+#define PCI_VENDOR_ID_TCONRAD 0x10da
+#define PCI_DEVICE_ID_TCONRAD_TOKENRING 0x0508
+
+#define PCI_VENDOR_ID_NVIDIA 0x10de
+#define PCI_DEVICE_ID_NVIDIA_TNT 0x0020
+#define PCI_DEVICE_ID_NVIDIA_TNT2 0x0028
+#define PCI_DEVICE_ID_NVIDIA_UTNT2 0x0029
+#define PCI_DEVICE_ID_NVIDIA_TNT_UNKNOWN 0x002a
+#define PCI_DEVICE_ID_NVIDIA_VTNT2 0x002C
+#define PCI_DEVICE_ID_NVIDIA_UVTNT2 0x002D
+#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_SMBUS 0x0034
+#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_IDE 0x0035
+#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_SATA 0x0036
+#define PCI_DEVICE_ID_NVIDIA_NVENET_10 0x0037
+#define PCI_DEVICE_ID_NVIDIA_NVENET_11 0x0038
+#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_SATA2 0x003e
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE_6800_ULTRA 0x0040
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE_6800 0x0041
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE_6800_LE 0x0042
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE_6800_GT 0x0045
+#define PCI_DEVICE_ID_NVIDIA_QUADRO_FX_4000 0x004E
+#define PCI_DEVICE_ID_NVIDIA_NFORCE4_SMBUS 0x0052
+#define PCI_DEVICE_ID_NVIDIA_NFORCE_CK804_IDE 0x0053
+#define PCI_DEVICE_ID_NVIDIA_NFORCE_CK804_SATA 0x0054
+#define PCI_DEVICE_ID_NVIDIA_NFORCE_CK804_SATA2 0x0055
+#define PCI_DEVICE_ID_NVIDIA_NVENET_8 0x0056
+#define PCI_DEVICE_ID_NVIDIA_NVENET_9 0x0057
+#define PCI_DEVICE_ID_NVIDIA_CK804_AUDIO 0x0059
+#define PCI_DEVICE_ID_NVIDIA_CK804_PCIE 0x005d
+#define PCI_DEVICE_ID_NVIDIA_NFORCE2_SMBUS 0x0064
+#define PCI_DEVICE_ID_NVIDIA_NFORCE2_IDE 0x0065
+#define PCI_DEVICE_ID_NVIDIA_NVENET_2 0x0066
+#define PCI_DEVICE_ID_NVIDIA_MCP2_MODEM 0x0069
+#define PCI_DEVICE_ID_NVIDIA_MCP2_AUDIO 0x006a
+#define PCI_DEVICE_ID_NVIDIA_NFORCE2S_SMBUS 0x0084
+#define PCI_DEVICE_ID_NVIDIA_NFORCE2S_IDE 0x0085
+#define PCI_DEVICE_ID_NVIDIA_NVENET_4 0x0086
+#define PCI_DEVICE_ID_NVIDIA_MCP2S_MODEM 0x0089
+#define PCI_DEVICE_ID_NVIDIA_CK8_AUDIO 0x008a
+#define PCI_DEVICE_ID_NVIDIA_NVENET_5 0x008c
+#define PCI_DEVICE_ID_NVIDIA_NFORCE2S_SATA 0x008e
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE_7800_GT 0x0090
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE_7800_GTX 0x0091
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE_GO_7800 0x0098
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE_GO_7800_GTX 0x0099
+#define PCI_DEVICE_ID_NVIDIA_ITNT2 0x00A0
+#define PCI_DEVICE_ID_GEFORCE_6800A 0x00c1
+#define PCI_DEVICE_ID_GEFORCE_6800A_LE 0x00c2
+#define PCI_DEVICE_ID_GEFORCE_GO_6800 0x00c8
+#define PCI_DEVICE_ID_GEFORCE_GO_6800_ULTRA 0x00c9
+#define PCI_DEVICE_ID_QUADRO_FX_GO1400 0x00cc
+#define PCI_DEVICE_ID_QUADRO_FX_1400 0x00ce
+#define PCI_DEVICE_ID_NVIDIA_NFORCE3 0x00d1
+#define PCI_DEVICE_ID_NVIDIA_NFORCE3_SMBUS 0x00d4
+#define PCI_DEVICE_ID_NVIDIA_NFORCE3_IDE 0x00d5
+#define PCI_DEVICE_ID_NVIDIA_NVENET_3 0x00d6
+#define PCI_DEVICE_ID_NVIDIA_MCP3_MODEM 0x00d9
+#define PCI_DEVICE_ID_NVIDIA_MCP3_AUDIO 0x00da
+#define PCI_DEVICE_ID_NVIDIA_NVENET_7 0x00df
+#define PCI_DEVICE_ID_NVIDIA_NFORCE3S 0x00e1
+#define PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA 0x00e3
+#define PCI_DEVICE_ID_NVIDIA_NFORCE3S_SMBUS 0x00e4
+#define PCI_DEVICE_ID_NVIDIA_NFORCE3S_IDE 0x00e5
+#define PCI_DEVICE_ID_NVIDIA_NVENET_6 0x00e6
+#define PCI_DEVICE_ID_NVIDIA_CK8S_AUDIO 0x00ea
+#define PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA2 0x00ee
+#define PCIE_DEVICE_ID_NVIDIA_GEFORCE_6800_ALT1 0x00f0
+#define PCIE_DEVICE_ID_NVIDIA_GEFORCE_6600_ALT1 0x00f1
+#define PCIE_DEVICE_ID_NVIDIA_GEFORCE_6600_ALT2 0x00f2
+#define PCIE_DEVICE_ID_NVIDIA_GEFORCE_6200_ALT1 0x00f3
+#define PCIE_DEVICE_ID_NVIDIA_GEFORCE_6800_GT 0x00f9
+#define PCIE_DEVICE_ID_NVIDIA_QUADRO_NVS280 0x00fd
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE_SDR 0x0100
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE_DDR 0x0101
+#define PCI_DEVICE_ID_NVIDIA_QUADRO 0x0103
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE2_MX 0x0110
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE2_MX2 0x0111
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE2_GO 0x0112
+#define PCI_DEVICE_ID_NVIDIA_QUADRO2_MXR 0x0113
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE_6600_GT 0x0140
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE_6600 0x0141
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE_6610_XL 0x0145
+#define PCI_DEVICE_ID_NVIDIA_QUADRO_FX_540 0x014E
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE_6200 0x014F
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE2_GTS 0x0150
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE2_GTS2 0x0151
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE2_ULTRA 0x0152
+#define PCI_DEVICE_ID_NVIDIA_QUADRO2_PRO 0x0153
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE_6200_TURBOCACHE 0x0161
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE_GO_6200 0x0164
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE_GO_6250 0x0166
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE_GO_6200_1 0x0167
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE_GO_6250_1 0x0168
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_MX_460 0x0170
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_MX_440 0x0171
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_MX_420 0x0172
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_MX_440_SE 0x0173
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_440_GO 0x0174
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_420_GO 0x0175
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_420_GO_M32 0x0176
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_460_GO 0x0177
+#define PCI_DEVICE_ID_NVIDIA_QUADRO4_500XGL 0x0178
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_440_GO_M64 0x0179
+#define PCI_DEVICE_ID_NVIDIA_QUADRO4_200 0x017A
+#define PCI_DEVICE_ID_NVIDIA_QUADRO4_550XGL 0x017B
+#define PCI_DEVICE_ID_NVIDIA_QUADRO4_500_GOGL 0x017C
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_410_GO_M16 0x017D
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_MX_440_8X 0x0181
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_MX_440SE_8X 0x0182
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_MX_420_8X 0x0183
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_MX_4000 0x0185
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_448_GO 0x0186
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_488_GO 0x0187
+#define PCI_DEVICE_ID_NVIDIA_QUADRO4_580_XGL 0x0188
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_MX_MAC 0x0189
+#define PCI_DEVICE_ID_NVIDIA_QUADRO4_280_NVS 0x018A
+#define PCI_DEVICE_ID_NVIDIA_QUADRO4_380_XGL 0x018B
+#define PCI_DEVICE_ID_NVIDIA_IGEFORCE2 0x01a0
+#define PCI_DEVICE_ID_NVIDIA_NFORCE 0x01a4
+#define PCI_DEVICE_ID_NVIDIA_MCP1_AUDIO 0x01b1
+#define PCI_DEVICE_ID_NVIDIA_NFORCE_SMBUS 0x01b4
+#define PCI_DEVICE_ID_NVIDIA_NFORCE_IDE 0x01bc
+#define PCI_DEVICE_ID_NVIDIA_MCP1_MODEM 0x01c1
+#define PCI_DEVICE_ID_NVIDIA_NVENET_1 0x01c3
+#define PCI_DEVICE_ID_NVIDIA_NFORCE2 0x01e0
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE3 0x0200
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE3_1 0x0201
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE3_2 0x0202
+#define PCI_DEVICE_ID_NVIDIA_QUADRO_DDC 0x0203
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE_6800B 0x0211
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE_6800B_LE 0x0212
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE_6800B_GT 0x0215
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_TI_4600 0x0250
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_TI_4400 0x0251
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_TI_4200 0x0253
+#define PCI_DEVICE_ID_NVIDIA_QUADRO4_900XGL 0x0258
+#define PCI_DEVICE_ID_NVIDIA_QUADRO4_750XGL 0x0259
+#define PCI_DEVICE_ID_NVIDIA_QUADRO4_700XGL 0x025B
+#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SMBUS 0x0264
+#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_IDE 0x0265
+#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA 0x0266
+#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA2 0x0267
+#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SMBUS 0x0368
+#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_IDE 0x036E
+#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA 0x037E
+#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA2 0x037F
+#define PCI_DEVICE_ID_NVIDIA_NVENET_12 0x0268
+#define PCI_DEVICE_ID_NVIDIA_NVENET_13 0x0269
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_TI_4800 0x0280
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_TI_4800_8X 0x0281
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_TI_4800SE 0x0282
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_4200_GO 0x0286
+#define PCI_DEVICE_ID_NVIDIA_QUADRO4_980_XGL 0x0288
+#define PCI_DEVICE_ID_NVIDIA_QUADRO4_780_XGL 0x0289
+#define PCI_DEVICE_ID_NVIDIA_QUADRO4_700_GOGL 0x028C
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE_FX_5800_ULTRA 0x0301
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE_FX_5800 0x0302
+#define PCI_DEVICE_ID_NVIDIA_QUADRO_FX_2000 0x0308
+#define PCI_DEVICE_ID_NVIDIA_QUADRO_FX_1000 0x0309
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE_FX_5600_ULTRA 0x0311
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE_FX_5600 0x0312
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE_FX_5600SE 0x0314
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE_FX_GO5600 0x031A
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE_FX_GO5650 0x031B
+#define PCI_DEVICE_ID_NVIDIA_QUADRO_FX_GO700 0x031C
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE_FX_5200 0x0320
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE_FX_5200_ULTRA 0x0321
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE_FX_5200_1 0x0322
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE_FX_5200SE 0x0323
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE_FX_GO5200 0x0324
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE_FX_GO5250 0x0325
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE_FX_5500 0x0326
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE_FX_5100 0x0327
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE_FX_GO5250_32 0x0328
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE_FX_GO_5200 0x0329
+#define PCI_DEVICE_ID_NVIDIA_QUADRO_NVS_280_PCI 0x032A
+#define PCI_DEVICE_ID_NVIDIA_QUADRO_FX_500 0x032B
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE_FX_GO5300 0x032C
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE_FX_GO5100 0x032D
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE_FX_5900_ULTRA 0x0330
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE_FX_5900 0x0331
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE_FX_5900XT 0x0332
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE_FX_5950_ULTRA 0x0333
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE_FX_5900ZT 0x0334
+#define PCI_DEVICE_ID_NVIDIA_QUADRO_FX_3000 0x0338
+#define PCI_DEVICE_ID_NVIDIA_QUADRO_FX_700 0x033F
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE_FX_5700_ULTRA 0x0341
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE_FX_5700 0x0342
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE_FX_5700LE 0x0343
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE_FX_5700VE 0x0344
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE_FX_GO5700_1 0x0347
+#define PCI_DEVICE_ID_NVIDIA_GEFORCE_FX_GO5700_2 0x0348
+#define PCI_DEVICE_ID_NVIDIA_QUADRO_FX_GO1000 0x034C
+#define PCI_DEVICE_ID_NVIDIA_QUADRO_FX_1100 0x034E
+#define PCI_DEVICE_ID_NVIDIA_NVENET_14 0x0372
+#define PCI_DEVICE_ID_NVIDIA_NVENET_15 0x0373
+#define PCI_DEVICE_ID_NVIDIA_NVENET_16 0x03E5
+#define PCI_DEVICE_ID_NVIDIA_NVENET_17 0x03E6
+#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA 0x03E7
+#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_IDE 0x03EC
+#define PCI_DEVICE_ID_NVIDIA_NVENET_18 0x03EE
+#define PCI_DEVICE_ID_NVIDIA_NVENET_19 0x03EF
+#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA2 0x03F6
+#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA3 0x03F7
+#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP65_IDE 0x0448
+#define PCI_DEVICE_ID_NVIDIA_NVENET_20 0x0450
+#define PCI_DEVICE_ID_NVIDIA_NVENET_21 0x0451
+#define PCI_DEVICE_ID_NVIDIA_NVENET_22 0x0452
+#define PCI_DEVICE_ID_NVIDIA_NVENET_23 0x0453
+
+#define PCI_VENDOR_ID_IMS 0x10e0
+#define PCI_DEVICE_ID_IMS_TT128 0x9128
+#define PCI_DEVICE_ID_IMS_TT3D 0x9135
+
+#define PCI_VENDOR_ID_INTERG 0x10ea
+#define PCI_DEVICE_ID_INTERG_1682 0x1682
+#define PCI_DEVICE_ID_INTERG_2000 0x2000
+#define PCI_DEVICE_ID_INTERG_2010 0x2010
+#define PCI_DEVICE_ID_INTERG_5000 0x5000
+#define PCI_DEVICE_ID_INTERG_5050 0x5050
+
+#define PCI_VENDOR_ID_REALTEK 0x10ec
+#define PCI_DEVICE_ID_REALTEK_8139 0x8139
+
+#define PCI_VENDOR_ID_XILINX 0x10ee
+#define PCI_DEVICE_ID_RME_DIGI96 0x3fc0
+#define PCI_DEVICE_ID_RME_DIGI96_8 0x3fc1
+#define PCI_DEVICE_ID_RME_DIGI96_8_PRO 0x3fc2
+#define PCI_DEVICE_ID_RME_DIGI96_8_PAD_OR_PST 0x3fc3
+#define PCI_DEVICE_ID_XILINX_HAMMERFALL_DSP 0x3fc5
+#define PCI_DEVICE_ID_XILINX_HAMMERFALL_DSP_MADI 0x3fc6
+
+#define PCI_VENDOR_ID_INIT 0x1101
+
+#define PCI_VENDOR_ID_CREATIVE 0x1102  
+#define PCI_DEVICE_ID_CREATIVE_EMU10K1 0x0002
+
+#define PCI_VENDOR_ID_ECTIVA 0x1102  
+#define PCI_DEVICE_ID_ECTIVA_EV1938 0x8938
+
+#define PCI_VENDOR_ID_TTI 0x1103
+#define PCI_DEVICE_ID_TTI_HPT343 0x0003
+#define PCI_DEVICE_ID_TTI_HPT366 0x0004
+#define PCI_DEVICE_ID_TTI_HPT372 0x0005
+#define PCI_DEVICE_ID_TTI_HPT302 0x0006
+#define PCI_DEVICE_ID_TTI_HPT371 0x0007
+#define PCI_DEVICE_ID_TTI_HPT374 0x0008
+#define PCI_DEVICE_ID_TTI_HPT372N 0x0009  
+
+#define PCI_VENDOR_ID_VIA 0x1106
+#define PCI_DEVICE_ID_VIA_8763_0 0x0198
+#define PCI_DEVICE_ID_VIA_8380_0 0x0204
+#define PCI_DEVICE_ID_VIA_3238_0 0x0238
+#define PCI_DEVICE_ID_VIA_PT880 0x0258
+#define PCI_DEVICE_ID_VIA_PT880ULTRA 0x0308
+#define PCI_DEVICE_ID_VIA_PX8X0_0 0x0259
+#define PCI_DEVICE_ID_VIA_3269_0 0x0269
+#define PCI_DEVICE_ID_VIA_K8T800PRO_0 0x0282
+#define PCI_DEVICE_ID_VIA_3296_0 0x0296
+#define PCI_DEVICE_ID_VIA_8363_0 0x0305
+#define PCI_DEVICE_ID_VIA_P4M800CE 0x0314
+#define PCI_DEVICE_ID_VIA_8371_0 0x0391
+#define PCI_DEVICE_ID_VIA_8501_0 0x0501
+#define PCI_DEVICE_ID_VIA_82C561 0x0561
+#define PCI_DEVICE_ID_VIA_82C586_1 0x0571
+#define PCI_DEVICE_ID_VIA_82C576 0x0576
+#define PCI_DEVICE_ID_VIA_SATA_EIDE 0x0581
+#define PCI_DEVICE_ID_VIA_82C586_0 0x0586
+#define PCI_DEVICE_ID_VIA_82C596 0x0596
+#define PCI_DEVICE_ID_VIA_82C597_0 0x0597
+#define PCI_DEVICE_ID_VIA_82C598_0 0x0598
+#define PCI_DEVICE_ID_VIA_8601_0 0x0601
+#define PCI_DEVICE_ID_VIA_8605_0 0x0605
+#define PCI_DEVICE_ID_VIA_82C686 0x0686
+#define PCI_DEVICE_ID_VIA_82C691_0 0x0691
+#define PCI_DEVICE_ID_VIA_82C576_1 0x1571
+#define PCI_DEVICE_ID_VIA_82C586_2 0x3038
+#define PCI_DEVICE_ID_VIA_82C586_3 0x3040
+#define PCI_DEVICE_ID_VIA_82C596_3 0x3050
+#define PCI_DEVICE_ID_VIA_82C596B_3 0x3051
+#define PCI_DEVICE_ID_VIA_82C686_4 0x3057
+#define PCI_DEVICE_ID_VIA_82C686_5 0x3058
+#define PCI_DEVICE_ID_VIA_8233_5 0x3059
+#define PCI_DEVICE_ID_VIA_8233_0 0x3074
+#define PCI_DEVICE_ID_VIA_8633_0 0x3091
+#define PCI_DEVICE_ID_VIA_8367_0 0x3099
+#define PCI_DEVICE_ID_VIA_8653_0 0x3101
+#define PCI_DEVICE_ID_VIA_8622 0x3102
+#define PCI_DEVICE_ID_VIA_8235_USB_2 0x3104
+#define PCI_DEVICE_ID_VIA_8233C_0 0x3109
+#define PCI_DEVICE_ID_VIA_8361 0x3112
+#define PCI_DEVICE_ID_VIA_XM266 0x3116
+#define PCI_DEVICE_ID_VIA_612X 0x3119
+#define PCI_DEVICE_ID_VIA_862X_0 0x3123
+#define PCI_DEVICE_ID_VIA_8753_0 0x3128
+#define PCI_DEVICE_ID_VIA_8233A 0x3147
+#define PCI_DEVICE_ID_VIA_8703_51_0 0x3148
+#define PCI_DEVICE_ID_VIA_8237_SATA 0x3149
+#define PCI_DEVICE_ID_VIA_XN266 0x3156
+#define PCI_DEVICE_ID_VIA_6410 0x3164
+#define PCI_DEVICE_ID_VIA_8754C_0 0x3168
+#define PCI_DEVICE_ID_VIA_8235 0x3177
+#define PCI_DEVICE_ID_VIA_8385_0 0x3188
+#define PCI_DEVICE_ID_VIA_8377_0 0x3189
+#define PCI_DEVICE_ID_VIA_8378_0 0x3205
+#define PCI_DEVICE_ID_VIA_8783_0 0x3208
+#define PCI_DEVICE_ID_VIA_8237 0x3227
+#define PCI_DEVICE_ID_VIA_8251 0x3287
+#define PCI_DEVICE_ID_VIA_8237A 0x3337
+#define PCI_DEVICE_ID_VIA_8231 0x8231
+#define PCI_DEVICE_ID_VIA_8231_4 0x8235
+#define PCI_DEVICE_ID_VIA_8365_1 0x8305
+#define PCI_DEVICE_ID_VIA_CX700 0x8324
+#define PCI_DEVICE_ID_VIA_8371_1 0x8391
+#define PCI_DEVICE_ID_VIA_82C598_1 0x8598
+#define PCI_DEVICE_ID_VIA_838X_1 0xB188
+#define PCI_DEVICE_ID_VIA_83_87XX_1 0xB198
+
+#define PCI_VENDOR_ID_SIEMENS 0x110A
+#define PCI_DEVICE_ID_SIEMENS_DSCC4 0x2102
+
+#define PCI_VENDOR_ID_VORTEX 0x1119
+#define PCI_DEVICE_ID_VORTEX_GDT60x0 0x0000
+#define PCI_DEVICE_ID_VORTEX_GDT6000B 0x0001
+#define PCI_DEVICE_ID_VORTEX_GDT6x10 0x0002
+#define PCI_DEVICE_ID_VORTEX_GDT6x20 0x0003
+#define PCI_DEVICE_ID_VORTEX_GDT6530 0x0004
+#define PCI_DEVICE_ID_VORTEX_GDT6550 0x0005
+#define PCI_DEVICE_ID_VORTEX_GDT6x17 0x0006
+#define PCI_DEVICE_ID_VORTEX_GDT6x27 0x0007
+#define PCI_DEVICE_ID_VORTEX_GDT6537 0x0008
+#define PCI_DEVICE_ID_VORTEX_GDT6557 0x0009
+#define PCI_DEVICE_ID_VORTEX_GDT6x15 0x000a
+#define PCI_DEVICE_ID_VORTEX_GDT6x25 0x000b
+#define PCI_DEVICE_ID_VORTEX_GDT6535 0x000c
+#define PCI_DEVICE_ID_VORTEX_GDT6555 0x000d
+#define PCI_DEVICE_ID_VORTEX_GDT6x17RP 0x0100
+#define PCI_DEVICE_ID_VORTEX_GDT6x27RP 0x0101
+#define PCI_DEVICE_ID_VORTEX_GDT6537RP 0x0102
+#define PCI_DEVICE_ID_VORTEX_GDT6557RP 0x0103
+#define PCI_DEVICE_ID_VORTEX_GDT6x11RP 0x0104
+#define PCI_DEVICE_ID_VORTEX_GDT6x21RP 0x0105
+
+#define PCI_VENDOR_ID_EF 0x111a
+#define PCI_DEVICE_ID_EF_ATM_FPGA 0x0000
+#define PCI_DEVICE_ID_EF_ATM_ASIC 0x0002
+#define PCI_VENDOR_ID_EF_ATM_LANAI2 0x0003
+#define PCI_VENDOR_ID_EF_ATM_LANAIHB 0x0005
+
+#define PCI_VENDOR_ID_IDT 0x111d
+#define PCI_DEVICE_ID_IDT_IDT77201 0x0001
+
+#define PCI_VENDOR_ID_FORE 0x1127
+#define PCI_DEVICE_ID_FORE_PCA200E 0x0300
+
+#define PCI_VENDOR_ID_PHILIPS 0x1131
+#define PCI_DEVICE_ID_PHILIPS_SAA7146 0x7146
+#define PCI_DEVICE_ID_PHILIPS_SAA9730 0x9730
+
+#define PCI_VENDOR_ID_EICON 0x1133
+#define PCI_DEVICE_ID_EICON_DIVA20 0xe002
+#define PCI_DEVICE_ID_EICON_DIVA20_U 0xe004
+#define PCI_DEVICE_ID_EICON_DIVA201 0xe005
+#define PCI_DEVICE_ID_EICON_DIVA202 0xe00b
+#define PCI_DEVICE_ID_EICON_MAESTRA 0xe010
+#define PCI_DEVICE_ID_EICON_MAESTRAQ 0xe012
+#define PCI_DEVICE_ID_EICON_MAESTRAQ_U 0xe013
+#define PCI_DEVICE_ID_EICON_MAESTRAP 0xe014
+
+#define PCI_VENDOR_ID_ZIATECH 0x1138
+#define PCI_DEVICE_ID_ZIATECH_5550_HC 0x5550
+
+#define PCI_VENDOR_ID_SYSKONNECT 0x1148
+#define PCI_DEVICE_ID_SYSKONNECT_TR 0x4200
+#define PCI_DEVICE_ID_SYSKONNECT_GE 0x4300
+#define PCI_DEVICE_ID_SYSKONNECT_YU 0x4320
+#define PCI_DEVICE_ID_SYSKONNECT_9DXX 0x4400
+#define PCI_DEVICE_ID_SYSKONNECT_9MXX 0x4500
+
+#define PCI_VENDOR_ID_DIGI 0x114f
+#define PCI_DEVICE_ID_DIGI_DF_M_IOM2_E 0x0070
+#define PCI_DEVICE_ID_DIGI_DF_M_E 0x0071
+#define PCI_DEVICE_ID_DIGI_DF_M_IOM2_A 0x0072
+#define PCI_DEVICE_ID_DIGI_DF_M_A 0x0073
+#define PCI_DEVICE_ID_NEO_2DB9 0x00C8
+#define PCI_DEVICE_ID_NEO_2DB9PRI 0x00C9
+#define PCI_DEVICE_ID_NEO_2RJ45 0x00CA
+#define PCI_DEVICE_ID_NEO_2RJ45PRI 0x00CB
+
+#define PCI_VENDOR_ID_XIRCOM 0x115d
+#define PCI_DEVICE_ID_XIRCOM_RBM56G 0x0101
+#define PCI_DEVICE_ID_XIRCOM_X3201_MDM 0x0103
+
+#define PCI_VENDOR_ID_SERVERWORKS 0x1166
+#define PCI_DEVICE_ID_SERVERWORKS_HE 0x0008
+#define PCI_DEVICE_ID_SERVERWORKS_LE 0x0009
+#define PCI_DEVICE_ID_SERVERWORKS_GCNB_LE 0x0017
+#define PCI_DEVICE_ID_SERVERWORKS_EPB 0x0103
+#define PCI_DEVICE_ID_SERVERWORKS_OSB4 0x0200
+#define PCI_DEVICE_ID_SERVERWORKS_CSB5 0x0201
+#define PCI_DEVICE_ID_SERVERWORKS_CSB6 0x0203
+#define PCI_DEVICE_ID_SERVERWORKS_HT1000SB 0x0205
+#define PCI_DEVICE_ID_SERVERWORKS_OSB4IDE 0x0211
+#define PCI_DEVICE_ID_SERVERWORKS_CSB5IDE 0x0212
+#define PCI_DEVICE_ID_SERVERWORKS_CSB6IDE 0x0213
+#define PCI_DEVICE_ID_SERVERWORKS_HT1000IDE 0x0214
+#define PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2 0x0217
+#define PCI_DEVICE_ID_SERVERWORKS_CSB6LPC 0x0227
+
+#define PCI_VENDOR_ID_SBE 0x1176
+#define PCI_DEVICE_ID_SBE_WANXL100 0x0301
+#define PCI_DEVICE_ID_SBE_WANXL200 0x0302
+#define PCI_DEVICE_ID_SBE_WANXL400 0x0104
+
+#define PCI_VENDOR_ID_TOSHIBA 0x1179
+#define PCI_DEVICE_ID_TOSHIBA_PICCOLO 0x0102
+#define PCI_DEVICE_ID_TOSHIBA_PICCOLO_1 0x0103
+#define PCI_DEVICE_ID_TOSHIBA_PICCOLO_2 0x0105
+#define PCI_DEVICE_ID_TOSHIBA_TOPIC95 0x060a
+#define PCI_DEVICE_ID_TOSHIBA_TOPIC97 0x060f
+#define PCI_DEVICE_ID_TOSHIBA_TOPIC100 0x0617
+
+#define PCI_VENDOR_ID_TOSHIBA_2 0x102f
+#define PCI_DEVICE_ID_TOSHIBA_TC35815CF 0x0030
+#define PCI_DEVICE_ID_TOSHIBA_TC86C001_MISC 0x0108
+#define PCI_DEVICE_ID_TOSHIBA_SPIDER_NET 0x01b3
+
+#define PCI_VENDOR_ID_RICOH 0x1180
+#define PCI_DEVICE_ID_RICOH_RL5C465 0x0465
+#define PCI_DEVICE_ID_RICOH_RL5C466 0x0466
+#define PCI_DEVICE_ID_RICOH_RL5C475 0x0475
+#define PCI_DEVICE_ID_RICOH_RL5C476 0x0476
+#define PCI_DEVICE_ID_RICOH_RL5C478 0x0478
+#define PCI_DEVICE_ID_RICOH_R5C822 0x0822
+
+#define PCI_VENDOR_ID_DLINK 0x1186
+#define PCI_DEVICE_ID_DLINK_DGE510T 0x4c00
+
+#define PCI_VENDOR_ID_ARTOP 0x1191
+#define PCI_DEVICE_ID_ARTOP_ATP850UF 0x0005
+#define PCI_DEVICE_ID_ARTOP_ATP860 0x0006
+#define PCI_DEVICE_ID_ARTOP_ATP860R 0x0007
+#define PCI_DEVICE_ID_ARTOP_ATP865 0x0008
+#define PCI_DEVICE_ID_ARTOP_ATP865R 0x0009
+#define PCI_DEVICE_ID_ARTOP_AEC7610 0x8002
+#define PCI_DEVICE_ID_ARTOP_AEC7612UW 0x8010
+#define PCI_DEVICE_ID_ARTOP_AEC7612U 0x8020
+#define PCI_DEVICE_ID_ARTOP_AEC7612S 0x8030
+#define PCI_DEVICE_ID_ARTOP_AEC7612D 0x8040
+#define PCI_DEVICE_ID_ARTOP_AEC7612SUW 0x8050
+#define PCI_DEVICE_ID_ARTOP_8060 0x8060
+
+#define PCI_VENDOR_ID_ZEITNET 0x1193
+#define PCI_DEVICE_ID_ZEITNET_1221 0x0001
+#define PCI_DEVICE_ID_ZEITNET_1225 0x0002
+
+#define PCI_VENDOR_ID_FUJITSU_ME 0x119e
+#define PCI_DEVICE_ID_FUJITSU_FS155 0x0001
+#define PCI_DEVICE_ID_FUJITSU_FS50 0x0003
+
+#define PCI_SUBVENDOR_ID_KEYSPAN 0x11a9
+#define PCI_SUBDEVICE_ID_KEYSPAN_SX2 0x5334
+
+#define PCI_VENDOR_ID_MARVELL 0x11ab
+#define PCI_DEVICE_ID_MARVELL_GT64111 0x4146
+#define PCI_DEVICE_ID_MARVELL_GT64260 0x6430
+#define PCI_DEVICE_ID_MARVELL_MV64360 0x6460
+#define PCI_DEVICE_ID_MARVELL_MV64460 0x6480
+#define PCI_DEVICE_ID_MARVELL_GT96100 0x9652
+#define PCI_DEVICE_ID_MARVELL_GT96100A 0x9653
+
+#define PCI_VENDOR_ID_V3 0x11b0
+#define PCI_DEVICE_ID_V3_V960 0x0001
+#define PCI_DEVICE_ID_V3_V351 0x0002
+
+#define PCI_VENDOR_ID_ATT 0x11c1
+#define PCI_DEVICE_ID_ATT_VENUS_MODEM 0x480
+
+#define PCI_VENDOR_ID_SPECIALIX 0x11cb
+#define PCI_DEVICE_ID_SPECIALIX_IO8 0x2000
+#define PCI_DEVICE_ID_SPECIALIX_RIO 0x8000
+#define PCI_SUBDEVICE_ID_SPECIALIX_SPEED4 0xa004
+
+#define PCI_VENDOR_ID_ANALOG_DEVICES 0x11d4
+#define PCI_DEVICE_ID_AD1889JS 0x1889
+
+#define PCI_DEVICE_ID_SEGA_BBA 0x1234
+
+#define PCI_VENDOR_ID_ZORAN 0x11de
+#define PCI_DEVICE_ID_ZORAN_36057 0x6057
+#define PCI_DEVICE_ID_ZORAN_36120 0x6120
+
+#define PCI_VENDOR_ID_COMPEX 0x11f6
+#define PCI_DEVICE_ID_COMPEX_ENET100VG4 0x0112
+
+#define PCI_VENDOR_ID_RP 0x11fe
+#define PCI_DEVICE_ID_RP32INTF 0x0001
+#define PCI_DEVICE_ID_RP8INTF 0x0002
+#define PCI_DEVICE_ID_RP16INTF 0x0003
+#define PCI_DEVICE_ID_RP4QUAD 0x0004
+#define PCI_DEVICE_ID_RP8OCTA 0x0005
+#define PCI_DEVICE_ID_RP8J 0x0006
+#define PCI_DEVICE_ID_RP4J 0x0007
+#define PCI_DEVICE_ID_RP8SNI 0x0008 
+#define PCI_DEVICE_ID_RP16SNI 0x0009 
+#define PCI_DEVICE_ID_RPP4 0x000A
+#define PCI_DEVICE_ID_RPP8 0x000B
+#define PCI_DEVICE_ID_RP4M 0x000D
+#define PCI_DEVICE_ID_RP2_232 0x000E
+#define PCI_DEVICE_ID_RP2_422 0x000F
+#define PCI_DEVICE_ID_URP32INTF 0x0801
+#define PCI_DEVICE_ID_URP8INTF 0x0802
+#define PCI_DEVICE_ID_URP16INTF 0x0803
+#define PCI_DEVICE_ID_URP8OCTA 0x0805
+#define PCI_DEVICE_ID_UPCI_RM3_8PORT 0x080C 
+#define PCI_DEVICE_ID_UPCI_RM3_4PORT 0x080D
+#define PCI_DEVICE_ID_CRP16INTF 0x0903 
+
+#define PCI_VENDOR_ID_CYCLADES 0x120e
+#define PCI_DEVICE_ID_CYCLOM_Y_Lo 0x0100
+#define PCI_DEVICE_ID_CYCLOM_Y_Hi 0x0101
+#define PCI_DEVICE_ID_CYCLOM_4Y_Lo 0x0102
+#define PCI_DEVICE_ID_CYCLOM_4Y_Hi 0x0103
+#define PCI_DEVICE_ID_CYCLOM_8Y_Lo 0x0104
+#define PCI_DEVICE_ID_CYCLOM_8Y_Hi 0x0105
+#define PCI_DEVICE_ID_CYCLOM_Z_Lo 0x0200
+#define PCI_DEVICE_ID_CYCLOM_Z_Hi 0x0201
+#define PCI_DEVICE_ID_PC300_RX_2 0x0300
+#define PCI_DEVICE_ID_PC300_RX_1 0x0301
+#define PCI_DEVICE_ID_PC300_TE_2 0x0310
+#define PCI_DEVICE_ID_PC300_TE_1 0x0311
+#define PCI_DEVICE_ID_PC300_TE_M_2 0x0320
+#define PCI_DEVICE_ID_PC300_TE_M_1 0x0321
+
+#define PCI_VENDOR_ID_ESSENTIAL 0x120f
+#define PCI_DEVICE_ID_ESSENTIAL_ROADRUNNER 0x0001
+
+#define PCI_VENDOR_ID_O2 0x1217
+#define PCI_DEVICE_ID_O2_6729 0x6729
+#define PCI_DEVICE_ID_O2_6730 0x673a
+#define PCI_DEVICE_ID_O2_6832 0x6832
+#define PCI_DEVICE_ID_O2_6836 0x6836
+
+#define PCI_VENDOR_ID_3DFX 0x121a
+#define PCI_DEVICE_ID_3DFX_VOODOO 0x0001
+#define PCI_DEVICE_ID_3DFX_VOODOO2 0x0002
+#define PCI_DEVICE_ID_3DFX_BANSHEE 0x0003
+#define PCI_DEVICE_ID_3DFX_VOODOO3 0x0005
+#define PCI_DEVICE_ID_3DFX_VOODOO5 0x0009
+
+#define PCI_VENDOR_ID_AVM 0x1244
+#define PCI_DEVICE_ID_AVM_B1 0x0700
+#define PCI_DEVICE_ID_AVM_C4 0x0800
+#define PCI_DEVICE_ID_AVM_A1 0x0a00
+#define PCI_DEVICE_ID_AVM_A1_V2 0x0e00
+#define PCI_DEVICE_ID_AVM_C2 0x1100
+#define PCI_DEVICE_ID_AVM_T1 0x1200
+
+#define PCI_VENDOR_ID_STALLION 0x124d
+
+#define PCI_VENDOR_ID_AT 0x1259
+#define PCI_SUBDEVICE_ID_AT_2700FX 0x2701
+#define PCI_SUBDEVICE_ID_AT_2701FX 0x2703
+
+#define PCI_VENDOR_ID_ESS 0x125d
+#define PCI_DEVICE_ID_ESS_ESS1968 0x1968
+#define PCI_DEVICE_ID_ESS_ESS1978 0x1978
+#define PCI_DEVICE_ID_ESS_ALLEGRO_1 0x1988
+#define PCI_DEVICE_ID_ESS_ALLEGRO 0x1989
+#define PCI_DEVICE_ID_ESS_CANYON3D_2LE 0x1990
+#define PCI_DEVICE_ID_ESS_CANYON3D_2 0x1992
+#define PCI_DEVICE_ID_ESS_MAESTRO3 0x1998
+#define PCI_DEVICE_ID_ESS_MAESTRO3_1 0x1999
+#define PCI_DEVICE_ID_ESS_MAESTRO3_HW 0x199a
+#define PCI_DEVICE_ID_ESS_MAESTRO3_2 0x199b
+
+#define PCI_VENDOR_ID_SATSAGEM 0x1267
+#define PCI_DEVICE_ID_SATSAGEM_NICCY 0x1016
+
+#define PCI_VENDOR_ID_ENSONIQ 0x1274
+#define PCI_DEVICE_ID_ENSONIQ_CT5880 0x5880
+#define PCI_DEVICE_ID_ENSONIQ_ES1370 0x5000
+#define PCI_DEVICE_ID_ENSONIQ_ES1371 0x1371
+
+#define PCI_VENDOR_ID_TRANSMETA 0x1279
+#define PCI_DEVICE_ID_EFFICEON 0x0060
+
+#define PCI_VENDOR_ID_ROCKWELL 0x127A
+
+#define PCI_VENDOR_ID_ITE 0x1283
+#define PCI_DEVICE_ID_ITE_IT8172G 0x8172
+#define PCI_DEVICE_ID_ITE_IT8172G_AUDIO 0x0801
+#define PCI_DEVICE_ID_ITE_8211 0x8211
+#define PCI_DEVICE_ID_ITE_8212 0x8212
+#define PCI_DEVICE_ID_ITE_8872 0x8872
+#define PCI_DEVICE_ID_ITE_IT8330G_0 0xe886
+
+#define PCI_DEVICE_ID_ESS_ESS0100 0x0100
+
+#define PCI_VENDOR_ID_ALTEON 0x12ae
+
+#define PCI_SUBVENDOR_ID_CONNECT_TECH 0x12c4
+#define PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_232 0x0001
+#define PCI_SUBDEVICE_ID_CONNECT_TECH_BH4_232 0x0002
+#define PCI_SUBDEVICE_ID_CONNECT_TECH_BH2_232 0x0003
+#define PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_485 0x0004
+#define PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_485_4_4 0x0005
+#define PCI_SUBDEVICE_ID_CONNECT_TECH_BH4_485 0x0006
+#define PCI_SUBDEVICE_ID_CONNECT_TECH_BH4_485_2_2 0x0007
+#define PCI_SUBDEVICE_ID_CONNECT_TECH_BH2_485 0x0008
+#define PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_485_2_6 0x0009
+#define PCI_SUBDEVICE_ID_CONNECT_TECH_BH081101V1 0x000A
+#define PCI_SUBDEVICE_ID_CONNECT_TECH_BH041101V1 0x000B
+#define PCI_SUBDEVICE_ID_CONNECT_TECH_BH2_20MHZ 0x000C
+#define PCI_SUBDEVICE_ID_CONNECT_TECH_BH2_PTM 0x000D
+#define PCI_SUBDEVICE_ID_CONNECT_TECH_NT960PCI 0x0100
+#define PCI_SUBDEVICE_ID_CONNECT_TECH_TITAN_2 0x0201
+#define PCI_SUBDEVICE_ID_CONNECT_TECH_TITAN_4 0x0202
+#define PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_2_232 0x0300
+#define PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_4_232 0x0301
+#define PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_8_232 0x0302
+#define PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_1_1 0x0310
+#define PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_2_2 0x0311
+#define PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_4_4 0x0312
+#define PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_2 0x0320
+#define PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_4 0x0321
+#define PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_8 0x0322
+#define PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_2_485 0x0330
+#define PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_4_485 0x0331
+#define PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_8_485 0x0332
+
+#define PCI_VENDOR_ID_NVIDIA_SGS 0x12d2
+#define PCI_DEVICE_ID_NVIDIA_SGS_RIVA128 0x0018
+
+#define PCI_SUBVENDOR_ID_CHASE_PCIFAST 0x12E0
+#define PCI_SUBDEVICE_ID_CHASE_PCIFAST4 0x0031
+#define PCI_SUBDEVICE_ID_CHASE_PCIFAST8 0x0021
+#define PCI_SUBDEVICE_ID_CHASE_PCIFAST16 0x0011
+#define PCI_SUBDEVICE_ID_CHASE_PCIFAST16FMC 0x0041
+#define PCI_SUBVENDOR_ID_CHASE_PCIRAS 0x124D
+#define PCI_SUBDEVICE_ID_CHASE_PCIRAS4 0xF001
+#define PCI_SUBDEVICE_ID_CHASE_PCIRAS8 0xF010
+
+#define PCI_VENDOR_ID_AUREAL 0x12eb
+#define PCI_DEVICE_ID_AUREAL_VORTEX_1 0x0001
+#define PCI_DEVICE_ID_AUREAL_VORTEX_2 0x0002
+#define PCI_DEVICE_ID_AUREAL_ADVANTAGE 0x0003
+
+#define PCI_VENDOR_ID_ELECTRONICDESIGNGMBH 0x12f8
+#define PCI_DEVICE_ID_LML_33R10 0x8a02
+
+#define PCI_VENDOR_ID_SIIG 0x131f
+#define PCI_SUBVENDOR_ID_SIIG 0x131f
+#define PCI_DEVICE_ID_SIIG_1S_10x_550 0x1000
+#define PCI_DEVICE_ID_SIIG_1S_10x_650 0x1001
+#define PCI_DEVICE_ID_SIIG_1S_10x_850 0x1002
+#define PCI_DEVICE_ID_SIIG_1S1P_10x_550 0x1010
+#define PCI_DEVICE_ID_SIIG_1S1P_10x_650 0x1011
+#define PCI_DEVICE_ID_SIIG_1S1P_10x_850 0x1012
+#define PCI_DEVICE_ID_SIIG_1P_10x 0x1020
+#define PCI_DEVICE_ID_SIIG_2P_10x 0x1021
+#define PCI_DEVICE_ID_SIIG_2S_10x_550 0x1030
+#define PCI_DEVICE_ID_SIIG_2S_10x_650 0x1031
+#define PCI_DEVICE_ID_SIIG_2S_10x_850 0x1032
+#define PCI_DEVICE_ID_SIIG_2S1P_10x_550 0x1034
+#define PCI_DEVICE_ID_SIIG_2S1P_10x_650 0x1035
+#define PCI_DEVICE_ID_SIIG_2S1P_10x_850 0x1036
+#define PCI_DEVICE_ID_SIIG_4S_10x_550 0x1050
+#define PCI_DEVICE_ID_SIIG_4S_10x_650 0x1051
+#define PCI_DEVICE_ID_SIIG_4S_10x_850 0x1052
+#define PCI_DEVICE_ID_SIIG_1S_20x_550 0x2000
+#define PCI_DEVICE_ID_SIIG_1S_20x_650 0x2001
+#define PCI_DEVICE_ID_SIIG_1S_20x_850 0x2002
+#define PCI_DEVICE_ID_SIIG_1P_20x 0x2020
+#define PCI_DEVICE_ID_SIIG_2P_20x 0x2021
+#define PCI_DEVICE_ID_SIIG_2S_20x_550 0x2030
+#define PCI_DEVICE_ID_SIIG_2S_20x_650 0x2031
+#define PCI_DEVICE_ID_SIIG_2S_20x_850 0x2032
+#define PCI_DEVICE_ID_SIIG_2P1S_20x_550 0x2040
+#define PCI_DEVICE_ID_SIIG_2P1S_20x_650 0x2041
+#define PCI_DEVICE_ID_SIIG_2P1S_20x_850 0x2042
+#define PCI_DEVICE_ID_SIIG_1S1P_20x_550 0x2010
+#define PCI_DEVICE_ID_SIIG_1S1P_20x_650 0x2011
+#define PCI_DEVICE_ID_SIIG_1S1P_20x_850 0x2012
+#define PCI_DEVICE_ID_SIIG_4S_20x_550 0x2050
+#define PCI_DEVICE_ID_SIIG_4S_20x_650 0x2051
+#define PCI_DEVICE_ID_SIIG_4S_20x_850 0x2052
+#define PCI_DEVICE_ID_SIIG_2S1P_20x_550 0x2060
+#define PCI_DEVICE_ID_SIIG_2S1P_20x_650 0x2061
+#define PCI_DEVICE_ID_SIIG_2S1P_20x_850 0x2062
+#define PCI_DEVICE_ID_SIIG_8S_20x_550 0x2080
+#define PCI_DEVICE_ID_SIIG_8S_20x_650 0x2081
+#define PCI_DEVICE_ID_SIIG_8S_20x_850 0x2082
+#define PCI_SUBDEVICE_ID_SIIG_QUARTET_SERIAL 0x2050
+
+#define PCI_VENDOR_ID_RADISYS 0x1331
+
+#define PCI_VENDOR_ID_DOMEX 0x134a
+#define PCI_DEVICE_ID_DOMEX_DMX3191D 0x0001
+
+#define PCI_VENDOR_ID_INTASHIELD 0x135a
+#define PCI_DEVICE_ID_INTASHIELD_IS200 0x0d80
+
+#define PCI_VENDOR_ID_QUATECH 0x135C
+#define PCI_DEVICE_ID_QUATECH_QSC100 0x0010
+#define PCI_DEVICE_ID_QUATECH_DSC100 0x0020
+#define PCI_DEVICE_ID_QUATECH_ESC100D 0x0050
+#define PCI_DEVICE_ID_QUATECH_ESC100M 0x0060
+
+#define PCI_VENDOR_ID_SEALEVEL 0x135e
+#define PCI_DEVICE_ID_SEALEVEL_U530 0x7101
+#define PCI_DEVICE_ID_SEALEVEL_UCOMM2 0x7201
+#define PCI_DEVICE_ID_SEALEVEL_UCOMM422 0x7402
+#define PCI_DEVICE_ID_SEALEVEL_UCOMM232 0x7202
+#define PCI_DEVICE_ID_SEALEVEL_COMM4 0x7401
+#define PCI_DEVICE_ID_SEALEVEL_COMM8 0x7801
+#define PCI_DEVICE_ID_SEALEVEL_UCOMM8 0x7804
+
+#define PCI_VENDOR_ID_HYPERCOPE 0x1365
+#define PCI_DEVICE_ID_HYPERCOPE_PLX 0x9050
+#define PCI_SUBDEVICE_ID_HYPERCOPE_OLD_ERGO 0x0104
+#define PCI_SUBDEVICE_ID_HYPERCOPE_ERGO 0x0106
+#define PCI_SUBDEVICE_ID_HYPERCOPE_METRO 0x0107
+#define PCI_SUBDEVICE_ID_HYPERCOPE_CHAMP2 0x0108
+
+#define PCI_VENDOR_ID_KAWASAKI 0x136b
+#define PCI_DEVICE_ID_MCHIP_KL5A72002 0xff01
+
+#define PCI_VENDOR_ID_CNET 0x1371
+#define PCI_DEVICE_ID_CNET_GIGACARD 0x434e
+
+#define PCI_VENDOR_ID_LMC 0x1376
+#define PCI_DEVICE_ID_LMC_HSSI 0x0003
+#define PCI_DEVICE_ID_LMC_DS3 0x0004
+#define PCI_DEVICE_ID_LMC_SSI 0x0005
+#define PCI_DEVICE_ID_LMC_T1 0x0006
+
+#define PCI_VENDOR_ID_NETGEAR 0x1385
+#define PCI_DEVICE_ID_NETGEAR_GA620 0x620a
+
+#define PCI_VENDOR_ID_APPLICOM 0x1389
+#define PCI_DEVICE_ID_APPLICOM_PCIGENERIC 0x0001
+#define PCI_DEVICE_ID_APPLICOM_PCI2000IBS_CAN 0x0002
+#define PCI_DEVICE_ID_APPLICOM_PCI2000PFB 0x0003
+
+#define PCI_VENDOR_ID_MOXA 0x1393
+#define PCI_DEVICE_ID_MOXA_RC7000 0x0001
+#define PCI_DEVICE_ID_MOXA_CP102 0x1020
+#define PCI_DEVICE_ID_MOXA_CP102UL 0x1021
+#define PCI_DEVICE_ID_MOXA_CP102U 0x1022
+#define PCI_DEVICE_ID_MOXA_C104 0x1040
+#define PCI_DEVICE_ID_MOXA_CP104U 0x1041
+#define PCI_DEVICE_ID_MOXA_CP104JU 0x1042
+#define PCI_DEVICE_ID_MOXA_CT114 0x1140
+#define PCI_DEVICE_ID_MOXA_CP114 0x1141
+#define PCI_DEVICE_ID_MOXA_CP118U 0x1180
+#define PCI_DEVICE_ID_MOXA_CP132 0x1320
+#define PCI_DEVICE_ID_MOXA_CP132U 0x1321
+#define PCI_DEVICE_ID_MOXA_CP134U 0x1340
+#define PCI_DEVICE_ID_MOXA_C168 0x1680
+#define PCI_DEVICE_ID_MOXA_CP168U 0x1681
+
+#define PCI_VENDOR_ID_CCD 0x1397
+#define PCI_DEVICE_ID_CCD_2BD0 0x2bd0
+#define PCI_DEVICE_ID_CCD_B000 0xb000
+#define PCI_DEVICE_ID_CCD_B006 0xb006
+#define PCI_DEVICE_ID_CCD_B007 0xb007
+#define PCI_DEVICE_ID_CCD_B008 0xb008
+#define PCI_DEVICE_ID_CCD_B009 0xb009
+#define PCI_DEVICE_ID_CCD_B00A 0xb00a
+#define PCI_DEVICE_ID_CCD_B00B 0xb00b
+#define PCI_DEVICE_ID_CCD_B00C 0xb00c
+#define PCI_DEVICE_ID_CCD_B100 0xb100
+#define PCI_DEVICE_ID_CCD_B700 0xb700
+#define PCI_DEVICE_ID_CCD_B701 0xb701
+
+#define PCI_VENDOR_ID_EXAR 0x13a8
+#define PCI_DEVICE_ID_EXAR_XR17C152 0x0152
+#define PCI_DEVICE_ID_EXAR_XR17C154 0x0154
+#define PCI_DEVICE_ID_EXAR_XR17C158 0x0158
+
+#define PCI_VENDOR_ID_MICROGATE 0x13c0
+#define PCI_DEVICE_ID_MICROGATE_USC 0x0010
+#define PCI_DEVICE_ID_MICROGATE_SCA 0x0030
+
+#define PCI_VENDOR_ID_3WARE 0x13C1
+#define PCI_DEVICE_ID_3WARE_1000 0x1000
+#define PCI_DEVICE_ID_3WARE_7000 0x1001
+#define PCI_DEVICE_ID_3WARE_9000 0x1002
+
+#define PCI_VENDOR_ID_IOMEGA 0x13ca
+#define PCI_DEVICE_ID_IOMEGA_BUZ 0x4231
+
+#define PCI_VENDOR_ID_ABOCOM 0x13D1
+#define PCI_DEVICE_ID_ABOCOM_2BD1 0x2BD1
+
+#define PCI_VENDOR_ID_CMEDIA 0x13f6
+#define PCI_DEVICE_ID_CMEDIA_CM8338A 0x0100
+#define PCI_DEVICE_ID_CMEDIA_CM8338B 0x0101
+#define PCI_DEVICE_ID_CMEDIA_CM8738 0x0111
+#define PCI_DEVICE_ID_CMEDIA_CM8738B 0x0112
+
+#define PCI_VENDOR_ID_LAVA 0x1407
+#define PCI_DEVICE_ID_LAVA_DSERIAL 0x0100  
+#define PCI_DEVICE_ID_LAVA_QUATRO_A 0x0101  
+#define PCI_DEVICE_ID_LAVA_QUATRO_B 0x0102  
+#define PCI_DEVICE_ID_LAVA_OCTO_A 0x0180  
+#define PCI_DEVICE_ID_LAVA_OCTO_B 0x0181  
+#define PCI_DEVICE_ID_LAVA_PORT_PLUS 0x0200  
+#define PCI_DEVICE_ID_LAVA_QUAD_A 0x0201  
+#define PCI_DEVICE_ID_LAVA_QUAD_B 0x0202  
+#define PCI_DEVICE_ID_LAVA_SSERIAL 0x0500  
+#define PCI_DEVICE_ID_LAVA_PORT_650 0x0600  
+#define PCI_DEVICE_ID_LAVA_PARALLEL 0x8000
+#define PCI_DEVICE_ID_LAVA_DUAL_PAR_A 0x8002  
+#define PCI_DEVICE_ID_LAVA_DUAL_PAR_B 0x8003  
+#define PCI_DEVICE_ID_LAVA_BOCA_IOPPAR 0x8800
+
+#define PCI_VENDOR_ID_TIMEDIA 0x1409
+#define PCI_DEVICE_ID_TIMEDIA_1889 0x7168
+
+#define PCI_VENDOR_ID_ICE 0x1412
+#define PCI_DEVICE_ID_ICE_1712 0x1712
+#define PCI_DEVICE_ID_VT1724 0x1724
+
+#define PCI_VENDOR_ID_OXSEMI 0x1415
+#define PCI_DEVICE_ID_OXSEMI_12PCI840 0x8403
+#define PCI_DEVICE_ID_OXSEMI_16PCI954 0x9501
+#define PCI_DEVICE_ID_OXSEMI_16PCI95N 0x9511
+#define PCI_DEVICE_ID_OXSEMI_16PCI954PP 0x9513
+#define PCI_DEVICE_ID_OXSEMI_16PCI952 0x9521
+
+#define PCI_VENDOR_ID_SAMSUNG 0x144d
+
+#define PCI_VENDOR_ID_MYRICOM 0x14c1
+
+#define PCI_VENDOR_ID_TITAN 0x14D2
+#define PCI_DEVICE_ID_TITAN_010L 0x8001
+#define PCI_DEVICE_ID_TITAN_100L 0x8010
+#define PCI_DEVICE_ID_TITAN_110L 0x8011
+#define PCI_DEVICE_ID_TITAN_200L 0x8020
+#define PCI_DEVICE_ID_TITAN_210L 0x8021
+#define PCI_DEVICE_ID_TITAN_400L 0x8040
+#define PCI_DEVICE_ID_TITAN_800L 0x8080
+#define PCI_DEVICE_ID_TITAN_100 0xA001
+#define PCI_DEVICE_ID_TITAN_200 0xA005
+#define PCI_DEVICE_ID_TITAN_400 0xA003
+#define PCI_DEVICE_ID_TITAN_800B 0xA004
+
+#define PCI_VENDOR_ID_PANACOM 0x14d4
+#define PCI_DEVICE_ID_PANACOM_QUADMODEM 0x0400
+#define PCI_DEVICE_ID_PANACOM_DUALMODEM 0x0402
+
+#define PCI_VENDOR_ID_AFAVLAB 0x14db
+#define PCI_DEVICE_ID_AFAVLAB_P028 0x2180
+#define PCI_DEVICE_ID_AFAVLAB_P030 0x2182
+#define PCI_SUBDEVICE_ID_AFAVLAB_P061 0x2150
+
+#define PCI_VENDOR_ID_BROADCOM 0x14e4
+#define PCI_DEVICE_ID_TIGON3_5752 0x1600
+#define PCI_DEVICE_ID_TIGON3_5752M 0x1601
+#define PCI_DEVICE_ID_TIGON3_5700 0x1644
+#define PCI_DEVICE_ID_TIGON3_5701 0x1645
+#define PCI_DEVICE_ID_TIGON3_5702 0x1646
+#define PCI_DEVICE_ID_TIGON3_5703 0x1647
+#define PCI_DEVICE_ID_TIGON3_5704 0x1648
+#define PCI_DEVICE_ID_TIGON3_5704S_2 0x1649
+#define PCI_DEVICE_ID_NX2_5706 0x164a
+#define PCI_DEVICE_ID_NX2_5708 0x164c
+#define PCI_DEVICE_ID_TIGON3_5702FE 0x164d
+#define PCI_DEVICE_ID_TIGON3_5705 0x1653
+#define PCI_DEVICE_ID_TIGON3_5705_2 0x1654
+#define PCI_DEVICE_ID_TIGON3_5720 0x1658
+#define PCI_DEVICE_ID_TIGON3_5721 0x1659
+#define PCI_DEVICE_ID_TIGON3_5705M 0x165d
+#define PCI_DEVICE_ID_TIGON3_5705M_2 0x165e
+#define PCI_DEVICE_ID_TIGON3_5714 0x1668
+#define PCI_DEVICE_ID_TIGON3_5714S 0x1669
+#define PCI_DEVICE_ID_TIGON3_5780 0x166a
+#define PCI_DEVICE_ID_TIGON3_5780S 0x166b
+#define PCI_DEVICE_ID_TIGON3_5705F 0x166e
+#define PCI_DEVICE_ID_TIGON3_5754M 0x1672
+#define PCI_DEVICE_ID_TIGON3_5755M 0x1673
+#define PCI_DEVICE_ID_TIGON3_5750 0x1676
+#define PCI_DEVICE_ID_TIGON3_5751 0x1677
+#define PCI_DEVICE_ID_TIGON3_5715 0x1678
+#define PCI_DEVICE_ID_TIGON3_5715S 0x1679
+#define PCI_DEVICE_ID_TIGON3_5754 0x167a
+#define PCI_DEVICE_ID_TIGON3_5755 0x167b
+#define PCI_DEVICE_ID_TIGON3_5750M 0x167c
+#define PCI_DEVICE_ID_TIGON3_5751M 0x167d
+#define PCI_DEVICE_ID_TIGON3_5751F 0x167e
+#define PCI_DEVICE_ID_TIGON3_5787M 0x1693
+#define PCI_DEVICE_ID_TIGON3_5782 0x1696
+#define PCI_DEVICE_ID_TIGON3_5786 0x169a
+#define PCI_DEVICE_ID_TIGON3_5787 0x169b
+#define PCI_DEVICE_ID_TIGON3_5788 0x169c
+#define PCI_DEVICE_ID_TIGON3_5789 0x169d
+#define PCI_DEVICE_ID_TIGON3_5702X 0x16a6
+#define PCI_DEVICE_ID_TIGON3_5703X 0x16a7
+#define PCI_DEVICE_ID_TIGON3_5704S 0x16a8
+#define PCI_DEVICE_ID_NX2_5706S 0x16aa
+#define PCI_DEVICE_ID_NX2_5708S 0x16ac
+#define PCI_DEVICE_ID_TIGON3_5702A3 0x16c6
+#define PCI_DEVICE_ID_TIGON3_5703A3 0x16c7
+#define PCI_DEVICE_ID_TIGON3_5781 0x16dd
+#define PCI_DEVICE_ID_TIGON3_5753 0x16f7
+#define PCI_DEVICE_ID_TIGON3_5753M 0x16fd
+#define PCI_DEVICE_ID_TIGON3_5753F 0x16fe
+#define PCI_DEVICE_ID_TIGON3_5901 0x170d
+#define PCI_DEVICE_ID_BCM4401B1 0x170c
+#define PCI_DEVICE_ID_TIGON3_5901_2 0x170e
+#define PCI_DEVICE_ID_BCM4401 0x4401
+#define PCI_DEVICE_ID_BCM4401B0 0x4402
+
+#define PCI_VENDOR_ID_TOPIC 0x151f
+#define PCI_DEVICE_ID_TOPIC_TP560 0x0000
+
+#define PCI_VENDOR_ID_ENE 0x1524
+#define PCI_DEVICE_ID_ENE_1211 0x1211
+#define PCI_DEVICE_ID_ENE_1225 0x1225
+#define PCI_DEVICE_ID_ENE_1410 0x1410
+#define PCI_DEVICE_ID_ENE_710 0x1411
+#define PCI_DEVICE_ID_ENE_712 0x1412
+#define PCI_DEVICE_ID_ENE_1420 0x1420
+#define PCI_DEVICE_ID_ENE_720 0x1421
+#define PCI_DEVICE_ID_ENE_722 0x1422
+
+#define PCI_VENDOR_ID_CHELSIO 0x1425
+
+#define PCI_VENDOR_ID_SYBA 0x1592
+#define PCI_DEVICE_ID_SYBA_2P_EPP 0x0782
+#define PCI_DEVICE_ID_SYBA_1P_ECP 0x0783
+
+#define PCI_VENDOR_ID_MORETON 0x15aa
+#define PCI_DEVICE_ID_RASTEL_2PORT 0x2000
+
+#define PCI_VENDOR_ID_ZOLTRIX 0x15b0
+#define PCI_DEVICE_ID_ZOLTRIX_2BD0 0x2bd0 
+
+#define PCI_VENDOR_ID_MELLANOX 0x15b3
+#define PCI_DEVICE_ID_MELLANOX_TAVOR 0x5a44
+#define PCI_DEVICE_ID_MELLANOX_TAVOR_BRIDGE 0x5a46
+#define PCI_DEVICE_ID_MELLANOX_ARBEL_COMPAT 0x6278
+#define PCI_DEVICE_ID_MELLANOX_ARBEL 0x6282
+#define PCI_DEVICE_ID_MELLANOX_SINAI_OLD 0x5e8c
+#define PCI_DEVICE_ID_MELLANOX_SINAI 0x6274
+
+#define PCI_VENDOR_ID_PDC 0x15e9
+
+#define PCI_VENDOR_ID_FARSITE 0x1619
+#define PCI_DEVICE_ID_FARSITE_T2P 0x0400
+#define PCI_DEVICE_ID_FARSITE_T4P 0x0440
+#define PCI_DEVICE_ID_FARSITE_T1U 0x0610
+#define PCI_DEVICE_ID_FARSITE_T2U 0x0620
+#define PCI_DEVICE_ID_FARSITE_T4U 0x0640
+#define PCI_DEVICE_ID_FARSITE_TE1 0x1610
+#define PCI_DEVICE_ID_FARSITE_TE1C 0x1612
+
+#define PCI_VENDOR_ID_SIBYTE 0x166d
+#define PCI_DEVICE_ID_BCM1250_HT 0x0002
+
+#define PCI_VENDOR_ID_NETCELL 0x169c
+#define PCI_DEVICE_ID_REVOLUTION 0x0044
+
+#define PCI_VENDOR_ID_VITESSE 0x1725
+#define PCI_DEVICE_ID_VITESSE_VSC7174 0x7174
+
+#define PCI_VENDOR_ID_LINKSYS 0x1737
+#define PCI_DEVICE_ID_LINKSYS_EG1064 0x1064
+
+#define PCI_VENDOR_ID_ALTIMA 0x173b
+#define PCI_DEVICE_ID_ALTIMA_AC1000 0x03e8
+#define PCI_DEVICE_ID_ALTIMA_AC1001 0x03e9
+#define PCI_DEVICE_ID_ALTIMA_AC9100 0x03ea
+#define PCI_DEVICE_ID_ALTIMA_AC1003 0x03eb
+
+#define PCI_VENDOR_ID_S2IO 0x17d5
+#define PCI_DEVICE_ID_S2IO_WIN 0x5731
+#define PCI_DEVICE_ID_S2IO_UNI 0x5831
+#define PCI_DEVICE_ID_HERC_WIN 0x5732
+#define PCI_DEVICE_ID_HERC_UNI 0x5832
+
+#define PCI_VENDOR_ID_SITECOM 0x182d
+#define PCI_DEVICE_ID_SITECOM_DC105V2 0x3069
+
+#define PCI_VENDOR_ID_TOPSPIN 0x1867
+
+#define PCI_VENDOR_ID_TDI 0x192E
+#define PCI_DEVICE_ID_TDI_EHCI 0x0101
+
+#define PCI_VENDOR_ID_JMICRON 0x197B
+#define PCI_DEVICE_ID_JMICRON_JMB360 0x2360
+#define PCI_DEVICE_ID_JMICRON_JMB361 0x2361
+#define PCI_DEVICE_ID_JMICRON_JMB363 0x2363
+#define PCI_DEVICE_ID_JMICRON_JMB365 0x2365
+#define PCI_DEVICE_ID_JMICRON_JMB366 0x2366
+#define PCI_DEVICE_ID_JMICRON_JMB368 0x2368
+
+#define PCI_VENDOR_ID_TEKRAM 0x1de1
+#define PCI_DEVICE_ID_TEKRAM_DC290 0xdc29
+
+#define PCI_VENDOR_ID_HINT 0x3388
+#define PCI_DEVICE_ID_HINT_VXPROII_IDE 0x8013
+
+#define PCI_VENDOR_ID_3DLABS 0x3d3d
+#define PCI_DEVICE_ID_3DLABS_PERMEDIA2 0x0007
+#define PCI_DEVICE_ID_3DLABS_PERMEDIA2V 0x0009
+
+#define PCI_VENDOR_ID_AKS 0x416c
+#define PCI_DEVICE_ID_AKS_ALADDINCARD 0x0100
+
+#define PCI_VENDOR_ID_S3 0x5333
+#define PCI_DEVICE_ID_S3_TRIO 0x8811
+#define PCI_DEVICE_ID_S3_868 0x8880
+#define PCI_DEVICE_ID_S3_968 0x88f0
+#define PCI_DEVICE_ID_S3_SAVAGE4 0x8a25
+#define PCI_DEVICE_ID_S3_PROSAVAGE8 0x8d04
+#define PCI_DEVICE_ID_S3_SONICVIBES 0xca00
+
+#define PCI_VENDOR_ID_DUNORD 0x5544
+#define PCI_DEVICE_ID_DUNORD_I3000 0x0001
+
+#define PCI_VENDOR_ID_DCI 0x6666
+#define PCI_DEVICE_ID_DCI_PCCOM4 0x0001
+#define PCI_DEVICE_ID_DCI_PCCOM8 0x0002
+#define PCI_DEVICE_ID_DCI_PCCOM2 0x0004
+
+#define PCI_VENDOR_ID_INTEL 0x8086
+#define PCI_DEVICE_ID_INTEL_EESSC 0x0008
+#define PCI_DEVICE_ID_INTEL_PXHD_0 0x0320
+#define PCI_DEVICE_ID_INTEL_PXHD_1 0x0321
+#define PCI_DEVICE_ID_INTEL_PXH_0 0x0329
+#define PCI_DEVICE_ID_INTEL_PXH_1 0x032A
+#define PCI_DEVICE_ID_INTEL_PXHV 0x032C
+#define PCI_DEVICE_ID_INTEL_82375 0x0482
+#define PCI_DEVICE_ID_INTEL_82424 0x0483
+#define PCI_DEVICE_ID_INTEL_82378 0x0484
+#define PCI_DEVICE_ID_INTEL_I960 0x0960
+#define PCI_DEVICE_ID_INTEL_I960RM 0x0962
+#define PCI_DEVICE_ID_INTEL_82815_MC 0x1130
+#define PCI_DEVICE_ID_INTEL_82815_CGC 0x1132
+#define PCI_DEVICE_ID_INTEL_82092AA_0 0x1221
+#define PCI_DEVICE_ID_INTEL_7505_0 0x2550 
+#define PCI_DEVICE_ID_INTEL_7205_0 0x255d
+#define PCI_DEVICE_ID_INTEL_82437 0x122d
+#define PCI_DEVICE_ID_INTEL_82371FB_0 0x122e
+#define PCI_DEVICE_ID_INTEL_82371FB_1 0x1230
+#define PCI_DEVICE_ID_INTEL_82371MX 0x1234
+#define PCI_DEVICE_ID_INTEL_82441 0x1237
+#define PCI_DEVICE_ID_INTEL_82380FB 0x124b
+#define PCI_DEVICE_ID_INTEL_82439 0x1250
+#define PCI_DEVICE_ID_INTEL_80960_RP 0x1960
+#define PCI_DEVICE_ID_INTEL_82840_HB 0x1a21
+#define PCI_DEVICE_ID_INTEL_82845_HB 0x1a30
+#define PCI_DEVICE_ID_INTEL_IOAT 0x1a38
+#define PCI_DEVICE_ID_INTEL_82801AA_0 0x2410
+#define PCI_DEVICE_ID_INTEL_82801AA_1 0x2411
+#define PCI_DEVICE_ID_INTEL_82801AA_3 0x2413
+#define PCI_DEVICE_ID_INTEL_82801AA_5 0x2415
+#define PCI_DEVICE_ID_INTEL_82801AA_6 0x2416
+#define PCI_DEVICE_ID_INTEL_82801AA_8 0x2418
+#define PCI_DEVICE_ID_INTEL_82801AB_0 0x2420
+#define PCI_DEVICE_ID_INTEL_82801AB_1 0x2421
+#define PCI_DEVICE_ID_INTEL_82801AB_3 0x2423
+#define PCI_DEVICE_ID_INTEL_82801AB_5 0x2425
+#define PCI_DEVICE_ID_INTEL_82801AB_6 0x2426
+#define PCI_DEVICE_ID_INTEL_82801AB_8 0x2428
+#define PCI_DEVICE_ID_INTEL_82801BA_0 0x2440
+#define PCI_DEVICE_ID_INTEL_82801BA_2 0x2443
+#define PCI_DEVICE_ID_INTEL_82801BA_4 0x2445
+#define PCI_DEVICE_ID_INTEL_82801BA_6 0x2448
+#define PCI_DEVICE_ID_INTEL_82801BA_8 0x244a
+#define PCI_DEVICE_ID_INTEL_82801BA_9 0x244b
+#define PCI_DEVICE_ID_INTEL_82801BA_10 0x244c
+#define PCI_DEVICE_ID_INTEL_82801BA_11 0x244e
+#define PCI_DEVICE_ID_INTEL_82801E_0 0x2450
+#define PCI_DEVICE_ID_INTEL_82801E_11 0x245b
+#define PCI_DEVICE_ID_INTEL_82801CA_0 0x2480
+#define PCI_DEVICE_ID_INTEL_82801CA_3 0x2483
+#define PCI_DEVICE_ID_INTEL_82801CA_5 0x2485
+#define PCI_DEVICE_ID_INTEL_82801CA_6 0x2486
+#define PCI_DEVICE_ID_INTEL_82801CA_10 0x248a
+#define PCI_DEVICE_ID_INTEL_82801CA_11 0x248b
+#define PCI_DEVICE_ID_INTEL_82801CA_12 0x248c
+#define PCI_DEVICE_ID_INTEL_82801DB_0 0x24c0
+#define PCI_DEVICE_ID_INTEL_82801DB_1 0x24c1
+#define PCI_DEVICE_ID_INTEL_82801DB_3 0x24c3
+#define PCI_DEVICE_ID_INTEL_82801DB_5 0x24c5
+#define PCI_DEVICE_ID_INTEL_82801DB_6 0x24c6
+#define PCI_DEVICE_ID_INTEL_82801DB_9 0x24c9
+#define PCI_DEVICE_ID_INTEL_82801DB_10 0x24ca
+#define PCI_DEVICE_ID_INTEL_82801DB_11 0x24cb
+#define PCI_DEVICE_ID_INTEL_82801DB_12 0x24cc
+#define PCI_DEVICE_ID_INTEL_82801EB_0 0x24d0
+#define PCI_DEVICE_ID_INTEL_82801EB_1 0x24d1
+#define PCI_DEVICE_ID_INTEL_82801EB_3 0x24d3
+#define PCI_DEVICE_ID_INTEL_82801EB_5 0x24d5
+#define PCI_DEVICE_ID_INTEL_82801EB_6 0x24d6
+#define PCI_DEVICE_ID_INTEL_82801EB_11 0x24db
+#define PCI_DEVICE_ID_INTEL_82801EB_13 0x24dd
+#define PCI_DEVICE_ID_INTEL_ESB_1 0x25a1
+#define PCI_DEVICE_ID_INTEL_ESB_2 0x25a2
+#define PCI_DEVICE_ID_INTEL_ESB_4 0x25a4
+#define PCI_DEVICE_ID_INTEL_ESB_5 0x25a6
+#define PCI_DEVICE_ID_INTEL_ESB_9 0x25ab
+#define PCI_DEVICE_ID_INTEL_82820_HB 0x2500
+#define PCI_DEVICE_ID_INTEL_82820_UP_HB 0x2501
+#define PCI_DEVICE_ID_INTEL_82850_HB 0x2530
+#define PCI_DEVICE_ID_INTEL_82860_HB 0x2531
+#define PCI_DEVICE_ID_INTEL_E7501_MCH 0x254c
+#define PCI_DEVICE_ID_INTEL_82845G_HB 0x2560
+#define PCI_DEVICE_ID_INTEL_82845G_IG 0x2562
+#define PCI_DEVICE_ID_INTEL_82865_HB 0x2570
+#define PCI_DEVICE_ID_INTEL_82865_IG 0x2572
+#define PCI_DEVICE_ID_INTEL_82875_HB 0x2578
+#define PCI_DEVICE_ID_INTEL_82915G_HB 0x2580
+#define PCI_DEVICE_ID_INTEL_82915G_IG 0x2582
+#define PCI_DEVICE_ID_INTEL_82915GM_HB 0x2590
+#define PCI_DEVICE_ID_INTEL_82915GM_IG 0x2592
+#define PCI_DEVICE_ID_INTEL_82945G_HB 0x2770
+#define PCI_DEVICE_ID_INTEL_82945G_IG 0x2772
+#define PCI_DEVICE_ID_INTEL_82945GM_HB 0x27A0
+#define PCI_DEVICE_ID_INTEL_82945GM_IG 0x27A2
+#define PCI_DEVICE_ID_INTEL_ICH6_0 0x2640
+#define PCI_DEVICE_ID_INTEL_ICH6_1 0x2641
+#define PCI_DEVICE_ID_INTEL_ICH6_2 0x2642
+#define PCI_DEVICE_ID_INTEL_ICH6_16 0x266a
+#define PCI_DEVICE_ID_INTEL_ICH6_17 0x266d
+#define PCI_DEVICE_ID_INTEL_ICH6_18 0x266e
+#define PCI_DEVICE_ID_INTEL_ICH6_19 0x266f
+#define PCI_DEVICE_ID_INTEL_ESB2_0 0x2670
+#define PCI_DEVICE_ID_INTEL_ESB2_14 0x2698
+#define PCI_DEVICE_ID_INTEL_ESB2_17 0x269b
+#define PCI_DEVICE_ID_INTEL_ESB2_18 0x269e
+#define PCI_DEVICE_ID_INTEL_ICH7_0 0x27b8
+#define PCI_DEVICE_ID_INTEL_ICH7_1 0x27b9
+#define PCI_DEVICE_ID_INTEL_ICH7_30 0x27b0
+#define PCI_DEVICE_ID_INTEL_ICH7_31 0x27bd
+#define PCI_DEVICE_ID_INTEL_ICH7_17 0x27da
+#define PCI_DEVICE_ID_INTEL_ICH7_19 0x27dd
+#define PCI_DEVICE_ID_INTEL_ICH7_20 0x27de
+#define PCI_DEVICE_ID_INTEL_ICH7_21 0x27df
+#define PCI_DEVICE_ID_INTEL_ICH8_0 0x2810
+#define PCI_DEVICE_ID_INTEL_ICH8_1 0x2811
+#define PCI_DEVICE_ID_INTEL_ICH8_2 0x2812
+#define PCI_DEVICE_ID_INTEL_ICH8_3 0x2814
+#define PCI_DEVICE_ID_INTEL_ICH8_4 0x2815
+#define PCI_DEVICE_ID_INTEL_ICH8_5 0x283e
+#define PCI_DEVICE_ID_INTEL_ICH8_6 0x2850
+#define PCI_DEVICE_ID_INTEL_82855PM_HB 0x3340
+#define PCI_DEVICE_ID_INTEL_82830_HB 0x3575
+#define PCI_DEVICE_ID_INTEL_82830_CGC 0x3577
+#define PCI_DEVICE_ID_INTEL_82855GM_HB 0x3580
+#define PCI_DEVICE_ID_INTEL_82855GM_IG 0x3582
+#define PCI_DEVICE_ID_INTEL_E7520_MCH 0x3590
+#define PCI_DEVICE_ID_INTEL_E7320_MCH 0x3592
+#define PCI_DEVICE_ID_INTEL_MCH_PA 0x3595
+#define PCI_DEVICE_ID_INTEL_MCH_PA1 0x3596
+#define PCI_DEVICE_ID_INTEL_MCH_PB 0x3597
+#define PCI_DEVICE_ID_INTEL_MCH_PB1 0x3598
+#define PCI_DEVICE_ID_INTEL_MCH_PC 0x3599
+#define PCI_DEVICE_ID_INTEL_MCH_PC1 0x359a
+#define PCI_DEVICE_ID_INTEL_E7525_MCH 0x359e
+#define PCI_DEVICE_ID_INTEL_82371SB_0 0x7000
+#define PCI_DEVICE_ID_INTEL_82371SB_1 0x7010
+#define PCI_DEVICE_ID_INTEL_82371SB_2 0x7020
+#define PCI_DEVICE_ID_INTEL_82437VX 0x7030
+#define PCI_DEVICE_ID_INTEL_82439TX 0x7100
+#define PCI_DEVICE_ID_INTEL_82371AB_0 0x7110
+#define PCI_DEVICE_ID_INTEL_82371AB 0x7111
+#define PCI_DEVICE_ID_INTEL_82371AB_2 0x7112
+#define PCI_DEVICE_ID_INTEL_82371AB_3 0x7113
+#define PCI_DEVICE_ID_INTEL_82810_MC1 0x7120
+#define PCI_DEVICE_ID_INTEL_82810_IG1 0x7121
+#define PCI_DEVICE_ID_INTEL_82810_MC3 0x7122
+#define PCI_DEVICE_ID_INTEL_82810_IG3 0x7123
+#define PCI_DEVICE_ID_INTEL_82810E_MC 0x7124
+#define PCI_DEVICE_ID_INTEL_82810E_IG 0x7125
+#define PCI_DEVICE_ID_INTEL_82443LX_0 0x7180
+#define PCI_DEVICE_ID_INTEL_82443LX_1 0x7181
+#define PCI_DEVICE_ID_INTEL_82443BX_0 0x7190
+#define PCI_DEVICE_ID_INTEL_82443BX_1 0x7191
+#define PCI_DEVICE_ID_INTEL_82443BX_2 0x7192
+#define PCI_DEVICE_ID_INTEL_440MX 0x7195
+#define PCI_DEVICE_ID_INTEL_440MX_6 0x7196
+#define PCI_DEVICE_ID_INTEL_82443MX_0 0x7198
+#define PCI_DEVICE_ID_INTEL_82443MX_1 0x7199
+#define PCI_DEVICE_ID_INTEL_82443MX_3 0x719b
+#define PCI_DEVICE_ID_INTEL_82443GX_0 0x71a0
+#define PCI_DEVICE_ID_INTEL_82443GX_2 0x71a2
+#define PCI_DEVICE_ID_INTEL_82372FB_1 0x7601
+#define PCI_DEVICE_ID_INTEL_82454GX 0x84c4
+#define PCI_DEVICE_ID_INTEL_82450GX 0x84c5
+#define PCI_DEVICE_ID_INTEL_82451NX 0x84ca
+#define PCI_DEVICE_ID_INTEL_82454NX 0x84cb
+#define PCI_DEVICE_ID_INTEL_84460GX 0x84ea
+#define PCI_DEVICE_ID_INTEL_IXP4XX 0x8500
+#define PCI_DEVICE_ID_INTEL_IXP2800 0x9004
+#define PCI_DEVICE_ID_INTEL_S21152BB 0xb152
+
+#define PCI_VENDOR_ID_SCALEMP 0x8686
+#define PCI_DEVICE_ID_SCALEMP_VSMP_CTL 0x1010
+
+#define PCI_VENDOR_ID_COMPUTONE 0x8e0e
+#define PCI_DEVICE_ID_COMPUTONE_IP2EX 0x0291
+#define PCI_DEVICE_ID_COMPUTONE_PG 0x0302
+#define PCI_SUBVENDOR_ID_COMPUTONE 0x8e0e
+#define PCI_SUBDEVICE_ID_COMPUTONE_PG4 0x0001
+#define PCI_SUBDEVICE_ID_COMPUTONE_PG8 0x0002
+#define PCI_SUBDEVICE_ID_COMPUTONE_PG6 0x0003
+
+#define PCI_VENDOR_ID_KTI 0x8e2e
+
+#define PCI_VENDOR_ID_ADAPTEC 0x9004
+#define PCI_DEVICE_ID_ADAPTEC_7810 0x1078
+#define PCI_DEVICE_ID_ADAPTEC_7821 0x2178
+#define PCI_DEVICE_ID_ADAPTEC_38602 0x3860
+#define PCI_DEVICE_ID_ADAPTEC_7850 0x5078
+#define PCI_DEVICE_ID_ADAPTEC_7855 0x5578
+#define PCI_DEVICE_ID_ADAPTEC_3860 0x6038
+#define PCI_DEVICE_ID_ADAPTEC_1480A 0x6075
+#define PCI_DEVICE_ID_ADAPTEC_7860 0x6078
+#define PCI_DEVICE_ID_ADAPTEC_7861 0x6178
+#define PCI_DEVICE_ID_ADAPTEC_7870 0x7078
+#define PCI_DEVICE_ID_ADAPTEC_7871 0x7178
+#define PCI_DEVICE_ID_ADAPTEC_7872 0x7278
+#define PCI_DEVICE_ID_ADAPTEC_7873 0x7378
+#define PCI_DEVICE_ID_ADAPTEC_7874 0x7478
+#define PCI_DEVICE_ID_ADAPTEC_7895 0x7895
+#define PCI_DEVICE_ID_ADAPTEC_7880 0x8078
+#define PCI_DEVICE_ID_ADAPTEC_7881 0x8178
+#define PCI_DEVICE_ID_ADAPTEC_7882 0x8278
+#define PCI_DEVICE_ID_ADAPTEC_7883 0x8378
+#define PCI_DEVICE_ID_ADAPTEC_7884 0x8478
+#define PCI_DEVICE_ID_ADAPTEC_7885 0x8578
+#define PCI_DEVICE_ID_ADAPTEC_7886 0x8678
+#define PCI_DEVICE_ID_ADAPTEC_7887 0x8778
+#define PCI_DEVICE_ID_ADAPTEC_7888 0x8878
+
+#define PCI_VENDOR_ID_ADAPTEC2 0x9005
+#define PCI_DEVICE_ID_ADAPTEC2_2940U2 0x0010
+#define PCI_DEVICE_ID_ADAPTEC2_2930U2 0x0011
+#define PCI_DEVICE_ID_ADAPTEC2_7890B 0x0013
+#define PCI_DEVICE_ID_ADAPTEC2_7890 0x001f
+#define PCI_DEVICE_ID_ADAPTEC2_3940U2 0x0050
+#define PCI_DEVICE_ID_ADAPTEC2_3950U2D 0x0051
+#define PCI_DEVICE_ID_ADAPTEC2_7896 0x005f
+#define PCI_DEVICE_ID_ADAPTEC2_7892A 0x0080
+#define PCI_DEVICE_ID_ADAPTEC2_7892B 0x0081
+#define PCI_DEVICE_ID_ADAPTEC2_7892D 0x0083
+#define PCI_DEVICE_ID_ADAPTEC2_7892P 0x008f
+#define PCI_DEVICE_ID_ADAPTEC2_7899A 0x00c0
+#define PCI_DEVICE_ID_ADAPTEC2_7899B 0x00c1
+#define PCI_DEVICE_ID_ADAPTEC2_7899D 0x00c3
+#define PCI_DEVICE_ID_ADAPTEC2_7899P 0x00cf
+#define PCI_DEVICE_ID_ADAPTEC2_OBSIDIAN 0x0500
+#define PCI_DEVICE_ID_ADAPTEC2_SCAMP 0x0503
+
+#define PCI_VENDOR_ID_HOLTEK 0x9412
+#define PCI_DEVICE_ID_HOLTEK_6565 0x6565
+
+#define PCI_VENDOR_ID_NETMOS 0x9710
+#define PCI_DEVICE_ID_NETMOS_9705 0x9705
+#define PCI_DEVICE_ID_NETMOS_9715 0x9715
+#define PCI_DEVICE_ID_NETMOS_9735 0x9735
+#define PCI_DEVICE_ID_NETMOS_9745 0x9745
+#define PCI_DEVICE_ID_NETMOS_9755 0x9755
+#define PCI_DEVICE_ID_NETMOS_9805 0x9805
+#define PCI_DEVICE_ID_NETMOS_9815 0x9815
+#define PCI_DEVICE_ID_NETMOS_9835 0x9835
+#define PCI_DEVICE_ID_NETMOS_9845 0x9845
+#define PCI_DEVICE_ID_NETMOS_9855 0x9855
+
+#define PCI_SUBVENDOR_ID_EXSYS 0xd84d
+#define PCI_SUBDEVICE_ID_EXSYS_4014 0x4014
+#define PCI_SUBDEVICE_ID_EXSYS_4055 0x4055
+
+#define PCI_VENDOR_ID_TIGERJET 0xe159
+#define PCI_DEVICE_ID_TIGERJET_300 0x0001
+#define PCI_DEVICE_ID_TIGERJET_100 0x0002
+
+#define PCI_VENDOR_ID_TTTECH 0x0357
+#define PCI_DEVICE_ID_TTTECH_MC322 0x000A
+
+#define PCI_VENDOR_ID_XILINX_RME 0xea60
+#define PCI_DEVICE_ID_RME_DIGI32 0x9896
+#define PCI_DEVICE_ID_RME_DIGI32_PRO 0x9897
+#define PCI_DEVICE_ID_RME_DIGI32_8 0x9898
+
diff --git a/ndk/platforms/android-3/include/linux/pci_regs.h b/ndk/platforms/android-3/include/linux/pci_regs.h
new file mode 100644
index 0000000..93a21be
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/pci_regs.h
@@ -0,0 +1,422 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef LINUX_PCI_REGS_H
+#define LINUX_PCI_REGS_H
+
+#define PCI_VENDOR_ID 0x00  
+#define PCI_DEVICE_ID 0x02  
+#define PCI_COMMAND 0x04  
+#define PCI_COMMAND_IO 0x1  
+#define PCI_COMMAND_MEMORY 0x2  
+#define PCI_COMMAND_MASTER 0x4  
+#define PCI_COMMAND_SPECIAL 0x8  
+#define PCI_COMMAND_INVALIDATE 0x10  
+#define PCI_COMMAND_VGA_PALETTE 0x20  
+#define PCI_COMMAND_PARITY 0x40  
+#define PCI_COMMAND_WAIT 0x80  
+#define PCI_COMMAND_SERR 0x100  
+#define PCI_COMMAND_FAST_BACK 0x200  
+#define PCI_COMMAND_INTX_DISABLE 0x400  
+
+#define PCI_STATUS 0x06  
+#define PCI_STATUS_CAP_LIST 0x10  
+#define PCI_STATUS_66MHZ 0x20  
+#define PCI_STATUS_UDF 0x40  
+#define PCI_STATUS_FAST_BACK 0x80  
+#define PCI_STATUS_PARITY 0x100  
+#define PCI_STATUS_DEVSEL_MASK 0x600  
+#define PCI_STATUS_DEVSEL_FAST 0x000
+#define PCI_STATUS_DEVSEL_MEDIUM 0x200
+#define PCI_STATUS_DEVSEL_SLOW 0x400
+#define PCI_STATUS_SIG_TARGET_ABORT 0x800  
+#define PCI_STATUS_REC_TARGET_ABORT 0x1000  
+#define PCI_STATUS_REC_MASTER_ABORT 0x2000  
+#define PCI_STATUS_SIG_SYSTEM_ERROR 0x4000  
+#define PCI_STATUS_DETECTED_PARITY 0x8000  
+
+#define PCI_CLASS_REVISION 0x08  
+#define PCI_REVISION_ID 0x08  
+#define PCI_CLASS_PROG 0x09  
+#define PCI_CLASS_DEVICE 0x0a  
+
+#define PCI_CACHE_LINE_SIZE 0x0c  
+#define PCI_LATENCY_TIMER 0x0d  
+#define PCI_HEADER_TYPE 0x0e  
+#define PCI_HEADER_TYPE_NORMAL 0
+#define PCI_HEADER_TYPE_BRIDGE 1
+#define PCI_HEADER_TYPE_CARDBUS 2
+
+#define PCI_BIST 0x0f  
+#define PCI_BIST_CODE_MASK 0x0f  
+#define PCI_BIST_START 0x40  
+#define PCI_BIST_CAPABLE 0x80  
+
+#define PCI_BASE_ADDRESS_0 0x10  
+#define PCI_BASE_ADDRESS_1 0x14  
+#define PCI_BASE_ADDRESS_2 0x18  
+#define PCI_BASE_ADDRESS_3 0x1c  
+#define PCI_BASE_ADDRESS_4 0x20  
+#define PCI_BASE_ADDRESS_5 0x24  
+#define PCI_BASE_ADDRESS_SPACE 0x01  
+#define PCI_BASE_ADDRESS_SPACE_IO 0x01
+#define PCI_BASE_ADDRESS_SPACE_MEMORY 0x00
+#define PCI_BASE_ADDRESS_MEM_TYPE_MASK 0x06
+#define PCI_BASE_ADDRESS_MEM_TYPE_32 0x00  
+#define PCI_BASE_ADDRESS_MEM_TYPE_1M 0x02  
+#define PCI_BASE_ADDRESS_MEM_TYPE_64 0x04  
+#define PCI_BASE_ADDRESS_MEM_PREFETCH 0x08  
+#define PCI_BASE_ADDRESS_MEM_MASK (~0x0fUL)
+#define PCI_BASE_ADDRESS_IO_MASK (~0x03UL)
+
+#define PCI_CARDBUS_CIS 0x28
+#define PCI_SUBSYSTEM_VENDOR_ID 0x2c
+#define PCI_SUBSYSTEM_ID 0x2e
+#define PCI_ROM_ADDRESS 0x30  
+#define PCI_ROM_ADDRESS_ENABLE 0x01
+#define PCI_ROM_ADDRESS_MASK (~0x7ffUL)
+
+#define PCI_CAPABILITY_LIST 0x34  
+
+#define PCI_INTERRUPT_LINE 0x3c  
+#define PCI_INTERRUPT_PIN 0x3d  
+#define PCI_MIN_GNT 0x3e  
+#define PCI_MAX_LAT 0x3f  
+
+#define PCI_PRIMARY_BUS 0x18  
+#define PCI_SECONDARY_BUS 0x19  
+#define PCI_SUBORDINATE_BUS 0x1a  
+#define PCI_SEC_LATENCY_TIMER 0x1b  
+#define PCI_IO_BASE 0x1c  
+#define PCI_IO_LIMIT 0x1d
+#define PCI_IO_RANGE_TYPE_MASK 0x0fUL  
+#define PCI_IO_RANGE_TYPE_16 0x00
+#define PCI_IO_RANGE_TYPE_32 0x01
+#define PCI_IO_RANGE_MASK (~0x0fUL)
+#define PCI_SEC_STATUS 0x1e  
+#define PCI_MEMORY_BASE 0x20  
+#define PCI_MEMORY_LIMIT 0x22
+#define PCI_MEMORY_RANGE_TYPE_MASK 0x0fUL
+#define PCI_MEMORY_RANGE_MASK (~0x0fUL)
+#define PCI_PREF_MEMORY_BASE 0x24  
+#define PCI_PREF_MEMORY_LIMIT 0x26
+#define PCI_PREF_RANGE_TYPE_MASK 0x0fUL
+#define PCI_PREF_RANGE_TYPE_32 0x00
+#define PCI_PREF_RANGE_TYPE_64 0x01
+#define PCI_PREF_RANGE_MASK (~0x0fUL)
+#define PCI_PREF_BASE_UPPER32 0x28  
+#define PCI_PREF_LIMIT_UPPER32 0x2c
+#define PCI_IO_BASE_UPPER16 0x30  
+#define PCI_IO_LIMIT_UPPER16 0x32
+
+#define PCI_ROM_ADDRESS1 0x38  
+
+#define PCI_BRIDGE_CONTROL 0x3e
+#define PCI_BRIDGE_CTL_PARITY 0x01  
+#define PCI_BRIDGE_CTL_SERR 0x02  
+#define PCI_BRIDGE_CTL_NO_ISA 0x04  
+#define PCI_BRIDGE_CTL_VGA 0x08  
+#define PCI_BRIDGE_CTL_MASTER_ABORT 0x20  
+#define PCI_BRIDGE_CTL_BUS_RESET 0x40  
+#define PCI_BRIDGE_CTL_FAST_BACK 0x80  
+
+#define PCI_CB_CAPABILITY_LIST 0x14
+
+#define PCI_CB_SEC_STATUS 0x16  
+#define PCI_CB_PRIMARY_BUS 0x18  
+#define PCI_CB_CARD_BUS 0x19  
+#define PCI_CB_SUBORDINATE_BUS 0x1a  
+#define PCI_CB_LATENCY_TIMER 0x1b  
+#define PCI_CB_MEMORY_BASE_0 0x1c
+#define PCI_CB_MEMORY_LIMIT_0 0x20
+#define PCI_CB_MEMORY_BASE_1 0x24
+#define PCI_CB_MEMORY_LIMIT_1 0x28
+#define PCI_CB_IO_BASE_0 0x2c
+#define PCI_CB_IO_BASE_0_HI 0x2e
+#define PCI_CB_IO_LIMIT_0 0x30
+#define PCI_CB_IO_LIMIT_0_HI 0x32
+#define PCI_CB_IO_BASE_1 0x34
+#define PCI_CB_IO_BASE_1_HI 0x36
+#define PCI_CB_IO_LIMIT_1 0x38
+#define PCI_CB_IO_LIMIT_1_HI 0x3a
+#define PCI_CB_IO_RANGE_MASK (~0x03UL)
+
+#define PCI_CB_BRIDGE_CONTROL 0x3e
+#define PCI_CB_BRIDGE_CTL_PARITY 0x01  
+#define PCI_CB_BRIDGE_CTL_SERR 0x02
+#define PCI_CB_BRIDGE_CTL_ISA 0x04
+#define PCI_CB_BRIDGE_CTL_VGA 0x08
+#define PCI_CB_BRIDGE_CTL_MASTER_ABORT 0x20
+#define PCI_CB_BRIDGE_CTL_CB_RESET 0x40  
+#define PCI_CB_BRIDGE_CTL_16BIT_INT 0x80  
+#define PCI_CB_BRIDGE_CTL_PREFETCH_MEM0 0x100  
+#define PCI_CB_BRIDGE_CTL_PREFETCH_MEM1 0x200
+#define PCI_CB_BRIDGE_CTL_POST_WRITES 0x400
+#define PCI_CB_SUBSYSTEM_VENDOR_ID 0x40
+#define PCI_CB_SUBSYSTEM_ID 0x42
+#define PCI_CB_LEGACY_MODE_BASE 0x44  
+
+#define PCI_CAP_LIST_ID 0  
+#define PCI_CAP_ID_PM 0x01  
+#define PCI_CAP_ID_AGP 0x02  
+#define PCI_CAP_ID_VPD 0x03  
+#define PCI_CAP_ID_SLOTID 0x04  
+#define PCI_CAP_ID_MSI 0x05  
+#define PCI_CAP_ID_CHSWP 0x06  
+#define PCI_CAP_ID_PCIX 0x07  
+#define PCI_CAP_ID_HT_IRQCONF 0x08  
+#define PCI_CAP_ID_VNDR 0x09  
+#define PCI_CAP_ID_SHPC 0x0C  
+#define PCI_CAP_ID_EXP 0x10  
+#define PCI_CAP_ID_MSIX 0x11  
+#define PCI_CAP_LIST_NEXT 1  
+#define PCI_CAP_FLAGS 2  
+#define PCI_CAP_SIZEOF 4
+
+#define PCI_PM_PMC 2  
+#define PCI_PM_CAP_VER_MASK 0x0007  
+#define PCI_PM_CAP_PME_CLOCK 0x0008  
+#define PCI_PM_CAP_RESERVED 0x0010  
+#define PCI_PM_CAP_DSI 0x0020  
+#define PCI_PM_CAP_AUX_POWER 0x01C0  
+#define PCI_PM_CAP_D1 0x0200  
+#define PCI_PM_CAP_D2 0x0400  
+#define PCI_PM_CAP_PME 0x0800  
+#define PCI_PM_CAP_PME_MASK 0xF800  
+#define PCI_PM_CAP_PME_D0 0x0800  
+#define PCI_PM_CAP_PME_D1 0x1000  
+#define PCI_PM_CAP_PME_D2 0x2000  
+#define PCI_PM_CAP_PME_D3 0x4000  
+#define PCI_PM_CAP_PME_D3cold 0x8000  
+#define PCI_PM_CTRL 4  
+#define PCI_PM_CTRL_STATE_MASK 0x0003  
+#define PCI_PM_CTRL_NO_SOFT_RESET 0x0004  
+#define PCI_PM_CTRL_PME_ENABLE 0x0100  
+#define PCI_PM_CTRL_DATA_SEL_MASK 0x1e00  
+#define PCI_PM_CTRL_DATA_SCALE_MASK 0x6000  
+#define PCI_PM_CTRL_PME_STATUS 0x8000  
+#define PCI_PM_PPB_EXTENSIONS 6  
+#define PCI_PM_PPB_B2_B3 0x40  
+#define PCI_PM_BPCC_ENABLE 0x80  
+#define PCI_PM_DATA_REGISTER 7  
+#define PCI_PM_SIZEOF 8
+
+#define PCI_AGP_VERSION 2  
+#define PCI_AGP_RFU 3  
+#define PCI_AGP_STATUS 4  
+#define PCI_AGP_STATUS_RQ_MASK 0xff000000  
+#define PCI_AGP_STATUS_SBA 0x0200  
+#define PCI_AGP_STATUS_64BIT 0x0020  
+#define PCI_AGP_STATUS_FW 0x0010  
+#define PCI_AGP_STATUS_RATE4 0x0004  
+#define PCI_AGP_STATUS_RATE2 0x0002  
+#define PCI_AGP_STATUS_RATE1 0x0001  
+#define PCI_AGP_COMMAND 8  
+#define PCI_AGP_COMMAND_RQ_MASK 0xff000000  
+#define PCI_AGP_COMMAND_SBA 0x0200  
+#define PCI_AGP_COMMAND_AGP 0x0100  
+#define PCI_AGP_COMMAND_64BIT 0x0020  
+#define PCI_AGP_COMMAND_FW 0x0010  
+#define PCI_AGP_COMMAND_RATE4 0x0004  
+#define PCI_AGP_COMMAND_RATE2 0x0002  
+#define PCI_AGP_COMMAND_RATE1 0x0001  
+#define PCI_AGP_SIZEOF 12
+
+#define PCI_VPD_ADDR 2  
+#define PCI_VPD_ADDR_MASK 0x7fff  
+#define PCI_VPD_ADDR_F 0x8000  
+#define PCI_VPD_DATA 4  
+
+#define PCI_SID_ESR 2  
+#define PCI_SID_ESR_NSLOTS 0x1f  
+#define PCI_SID_ESR_FIC 0x20  
+#define PCI_SID_CHASSIS_NR 3  
+
+#define PCI_MSI_FLAGS 2  
+#define PCI_MSI_FLAGS_64BIT 0x80  
+#define PCI_MSI_FLAGS_QSIZE 0x70  
+#define PCI_MSI_FLAGS_QMASK 0x0e  
+#define PCI_MSI_FLAGS_ENABLE 0x01  
+#define PCI_MSI_FLAGS_MASKBIT 0x100  
+#define PCI_MSI_RFU 3  
+#define PCI_MSI_ADDRESS_LO 4  
+#define PCI_MSI_ADDRESS_HI 8  
+#define PCI_MSI_DATA_32 8  
+#define PCI_MSI_DATA_64 12  
+#define PCI_MSI_MASK_BIT 16  
+
+#define PCI_CHSWP_CSR 2  
+#define PCI_CHSWP_DHA 0x01  
+#define PCI_CHSWP_EIM 0x02  
+#define PCI_CHSWP_PIE 0x04  
+#define PCI_CHSWP_LOO 0x08  
+#define PCI_CHSWP_PI 0x30  
+#define PCI_CHSWP_EXT 0x40  
+#define PCI_CHSWP_INS 0x80  
+
+#define PCI_X_CMD 2  
+#define PCI_X_CMD_DPERR_E 0x0001  
+#define PCI_X_CMD_ERO 0x0002  
+#define PCI_X_CMD_MAX_READ 0x000c  
+#define PCI_X_CMD_MAX_SPLIT 0x0070  
+#define PCI_X_CMD_VERSION(x) (((x) >> 12) & 3)  
+#define PCI_X_STATUS 4  
+#define PCI_X_STATUS_DEVFN 0x000000ff  
+#define PCI_X_STATUS_BUS 0x0000ff00  
+#define PCI_X_STATUS_64BIT 0x00010000  
+#define PCI_X_STATUS_133MHZ 0x00020000  
+#define PCI_X_STATUS_SPL_DISC 0x00040000  
+#define PCI_X_STATUS_UNX_SPL 0x00080000  
+#define PCI_X_STATUS_COMPLEX 0x00100000  
+#define PCI_X_STATUS_MAX_READ 0x00600000  
+#define PCI_X_STATUS_MAX_SPLIT 0x03800000  
+#define PCI_X_STATUS_MAX_CUM 0x1c000000  
+#define PCI_X_STATUS_SPL_ERR 0x20000000  
+#define PCI_X_STATUS_266MHZ 0x40000000  
+#define PCI_X_STATUS_533MHZ 0x80000000  
+
+#define PCI_EXP_FLAGS 2  
+#define PCI_EXP_FLAGS_VERS 0x000f  
+#define PCI_EXP_FLAGS_TYPE 0x00f0  
+#define PCI_EXP_TYPE_ENDPOINT 0x0  
+#define PCI_EXP_TYPE_LEG_END 0x1  
+#define PCI_EXP_TYPE_ROOT_PORT 0x4  
+#define PCI_EXP_TYPE_UPSTREAM 0x5  
+#define PCI_EXP_TYPE_DOWNSTREAM 0x6  
+#define PCI_EXP_TYPE_PCI_BRIDGE 0x7  
+#define PCI_EXP_FLAGS_SLOT 0x0100  
+#define PCI_EXP_FLAGS_IRQ 0x3e00  
+#define PCI_EXP_DEVCAP 4  
+#define PCI_EXP_DEVCAP_PAYLOAD 0x07  
+#define PCI_EXP_DEVCAP_PHANTOM 0x18  
+#define PCI_EXP_DEVCAP_EXT_TAG 0x20  
+#define PCI_EXP_DEVCAP_L0S 0x1c0  
+#define PCI_EXP_DEVCAP_L1 0xe00  
+#define PCI_EXP_DEVCAP_ATN_BUT 0x1000  
+#define PCI_EXP_DEVCAP_ATN_IND 0x2000  
+#define PCI_EXP_DEVCAP_PWR_IND 0x4000  
+#define PCI_EXP_DEVCAP_PWR_VAL 0x3fc0000  
+#define PCI_EXP_DEVCAP_PWR_SCL 0xc000000  
+#define PCI_EXP_DEVCTL 8  
+#define PCI_EXP_DEVCTL_CERE 0x0001  
+#define PCI_EXP_DEVCTL_NFERE 0x0002  
+#define PCI_EXP_DEVCTL_FERE 0x0004  
+#define PCI_EXP_DEVCTL_URRE 0x0008  
+#define PCI_EXP_DEVCTL_RELAX_EN 0x0010  
+#define PCI_EXP_DEVCTL_PAYLOAD 0x00e0  
+#define PCI_EXP_DEVCTL_EXT_TAG 0x0100  
+#define PCI_EXP_DEVCTL_PHANTOM 0x0200  
+#define PCI_EXP_DEVCTL_AUX_PME 0x0400  
+#define PCI_EXP_DEVCTL_NOSNOOP_EN 0x0800  
+#define PCI_EXP_DEVCTL_READRQ 0x7000  
+#define PCI_EXP_DEVSTA 10  
+#define PCI_EXP_DEVSTA_CED 0x01  
+#define PCI_EXP_DEVSTA_NFED 0x02  
+#define PCI_EXP_DEVSTA_FED 0x04  
+#define PCI_EXP_DEVSTA_URD 0x08  
+#define PCI_EXP_DEVSTA_AUXPD 0x10  
+#define PCI_EXP_DEVSTA_TRPND 0x20  
+#define PCI_EXP_LNKCAP 12  
+#define PCI_EXP_LNKCTL 16  
+#define PCI_EXP_LNKSTA 18  
+#define PCI_EXP_SLTCAP 20  
+#define PCI_EXP_SLTCTL 24  
+#define PCI_EXP_SLTSTA 26  
+#define PCI_EXP_RTCTL 28  
+#define PCI_EXP_RTCTL_SECEE 0x01  
+#define PCI_EXP_RTCTL_SENFEE 0x02  
+#define PCI_EXP_RTCTL_SEFEE 0x04  
+#define PCI_EXP_RTCTL_PMEIE 0x08  
+#define PCI_EXP_RTCTL_CRSSVE 0x10  
+#define PCI_EXP_RTCAP 30  
+#define PCI_EXP_RTSTA 32  
+
+#define PCI_EXT_CAP_ID(header) (header & 0x0000ffff)
+#define PCI_EXT_CAP_VER(header) ((header >> 16) & 0xf)
+#define PCI_EXT_CAP_NEXT(header) ((header >> 20) & 0xffc)
+
+#define PCI_EXT_CAP_ID_ERR 1
+#define PCI_EXT_CAP_ID_VC 2
+#define PCI_EXT_CAP_ID_DSN 3
+#define PCI_EXT_CAP_ID_PWR 4
+
+#define PCI_ERR_UNCOR_STATUS 4  
+#define PCI_ERR_UNC_TRAIN 0x00000001  
+#define PCI_ERR_UNC_DLP 0x00000010  
+#define PCI_ERR_UNC_POISON_TLP 0x00001000  
+#define PCI_ERR_UNC_FCP 0x00002000  
+#define PCI_ERR_UNC_COMP_TIME 0x00004000  
+#define PCI_ERR_UNC_COMP_ABORT 0x00008000  
+#define PCI_ERR_UNC_UNX_COMP 0x00010000  
+#define PCI_ERR_UNC_RX_OVER 0x00020000  
+#define PCI_ERR_UNC_MALF_TLP 0x00040000  
+#define PCI_ERR_UNC_ECRC 0x00080000  
+#define PCI_ERR_UNC_UNSUP 0x00100000  
+#define PCI_ERR_UNCOR_MASK 8  
+
+#define PCI_ERR_UNCOR_SEVER 12  
+
+#define PCI_ERR_COR_STATUS 16  
+#define PCI_ERR_COR_RCVR 0x00000001  
+#define PCI_ERR_COR_BAD_TLP 0x00000040  
+#define PCI_ERR_COR_BAD_DLLP 0x00000080  
+#define PCI_ERR_COR_REP_ROLL 0x00000100  
+#define PCI_ERR_COR_REP_TIMER 0x00001000  
+#define PCI_ERR_COR_MASK 20  
+
+#define PCI_ERR_CAP 24  
+#define PCI_ERR_CAP_FEP(x) ((x) & 31)  
+#define PCI_ERR_CAP_ECRC_GENC 0x00000020  
+#define PCI_ERR_CAP_ECRC_GENE 0x00000040  
+#define PCI_ERR_CAP_ECRC_CHKC 0x00000080  
+#define PCI_ERR_CAP_ECRC_CHKE 0x00000100  
+#define PCI_ERR_HEADER_LOG 28  
+#define PCI_ERR_ROOT_COMMAND 44  
+
+#define PCI_ERR_ROOT_CMD_COR_EN 0x00000001
+
+#define PCI_ERR_ROOT_CMD_NONFATAL_EN 0x00000002
+
+#define PCI_ERR_ROOT_CMD_FATAL_EN 0x00000004
+#define PCI_ERR_ROOT_STATUS 48
+#define PCI_ERR_ROOT_COR_RCV 0x00000001  
+
+#define PCI_ERR_ROOT_MULTI_COR_RCV 0x00000002
+
+#define PCI_ERR_ROOT_UNCOR_RCV 0x00000004
+
+#define PCI_ERR_ROOT_MULTI_UNCOR_RCV 0x00000008
+#define PCI_ERR_ROOT_FIRST_FATAL 0x00000010  
+#define PCI_ERR_ROOT_NONFATAL_RCV 0x00000020  
+#define PCI_ERR_ROOT_FATAL_RCV 0x00000040  
+#define PCI_ERR_ROOT_COR_SRC 52
+#define PCI_ERR_ROOT_SRC 54
+
+#define PCI_VC_PORT_REG1 4
+#define PCI_VC_PORT_REG2 8
+#define PCI_VC_PORT_CTRL 12
+#define PCI_VC_PORT_STATUS 14
+#define PCI_VC_RES_CAP 16
+#define PCI_VC_RES_CTRL 20
+#define PCI_VC_RES_STATUS 26
+
+#define PCI_PWR_DSR 4  
+#define PCI_PWR_DATA 8  
+#define PCI_PWR_DATA_BASE(x) ((x) & 0xff)  
+#define PCI_PWR_DATA_SCALE(x) (((x) >> 8) & 3)  
+#define PCI_PWR_DATA_PM_SUB(x) (((x) >> 10) & 7)  
+#define PCI_PWR_DATA_PM_STATE(x) (((x) >> 13) & 3)  
+#define PCI_PWR_DATA_TYPE(x) (((x) >> 15) & 7)  
+#define PCI_PWR_DATA_RAIL(x) (((x) >> 18) & 7)  
+#define PCI_PWR_CAP 12  
+#define PCI_PWR_CAP_BUDGET(x) ((x) & 1)  
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/percpu.h b/ndk/platforms/android-3/include/linux/percpu.h
new file mode 100644
index 0000000..c195616
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/percpu.h
@@ -0,0 +1,30 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __LINUX_PERCPU_H
+#define __LINUX_PERCPU_H
+#include <linux/spinlock.h>  
+#include <linux/slab.h>  
+#include <linux/smp.h>
+#include <linux/string.h>  
+#include <asm/percpu.h>
+
+#ifndef PERCPU_ENOUGH_ROOM
+#define PERCPU_ENOUGH_ROOM 32768
+#endif
+
+#define get_cpu_var(var) (*({ preempt_disable(); &__get_cpu_var(var); }))
+#define put_cpu_var(var) preempt_enable()
+
+#define per_cpu_ptr(ptr, cpu) ({ (void)(cpu); (ptr); })
+
+#define alloc_percpu(type) ((type *)(__alloc_percpu(sizeof(type))))
+#endif
diff --git a/ndk/platforms/android-3/include/linux/percpu_counter.h b/ndk/platforms/android-3/include/linux/percpu_counter.h
new file mode 100644
index 0000000..112375c
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/percpu_counter.h
@@ -0,0 +1,25 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_PERCPU_COUNTER_H
+#define _LINUX_PERCPU_COUNTER_H
+
+#include <linux/spinlock.h>
+#include <linux/smp.h>
+#include <linux/threads.h>
+#include <linux/percpu.h>
+#include <linux/types.h>
+
+struct percpu_counter {
+ s64 count;
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/personality.h b/ndk/platforms/android-3/include/linux/personality.h
new file mode 100644
index 0000000..1f84b4e
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/personality.h
@@ -0,0 +1,83 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_PERSONALITY_H
+#define _LINUX_PERSONALITY_H
+
+struct exec_domain;
+struct pt_regs;
+
+enum {
+ ADDR_NO_RANDOMIZE = 0x0040000,
+ FDPIC_FUNCPTRS = 0x0080000,
+ MMAP_PAGE_ZERO = 0x0100000,
+ ADDR_COMPAT_LAYOUT = 0x0200000,
+ READ_IMPLIES_EXEC = 0x0400000,
+ ADDR_LIMIT_32BIT = 0x0800000,
+ SHORT_INODE = 0x1000000,
+ WHOLE_SECONDS = 0x2000000,
+ STICKY_TIMEOUTS = 0x4000000,
+ ADDR_LIMIT_3GB = 0x8000000,
+};
+
+#define PER_CLEAR_ON_SETID (READ_IMPLIES_EXEC|ADDR_NO_RANDOMIZE)
+
+enum {
+ PER_LINUX = 0x0000,
+ PER_LINUX_32BIT = 0x0000 | ADDR_LIMIT_32BIT,
+ PER_LINUX_FDPIC = 0x0000 | FDPIC_FUNCPTRS,
+ PER_SVR4 = 0x0001 | STICKY_TIMEOUTS | MMAP_PAGE_ZERO,
+ PER_SVR3 = 0x0002 | STICKY_TIMEOUTS | SHORT_INODE,
+ PER_SCOSVR3 = 0x0003 | STICKY_TIMEOUTS |
+ WHOLE_SECONDS | SHORT_INODE,
+ PER_OSR5 = 0x0003 | STICKY_TIMEOUTS | WHOLE_SECONDS,
+ PER_WYSEV386 = 0x0004 | STICKY_TIMEOUTS | SHORT_INODE,
+ PER_ISCR4 = 0x0005 | STICKY_TIMEOUTS,
+ PER_BSD = 0x0006,
+ PER_SUNOS = 0x0006 | STICKY_TIMEOUTS,
+ PER_XENIX = 0x0007 | STICKY_TIMEOUTS | SHORT_INODE,
+ PER_LINUX32 = 0x0008,
+ PER_LINUX32_3GB = 0x0008 | ADDR_LIMIT_3GB,
+ PER_IRIX32 = 0x0009 | STICKY_TIMEOUTS,
+ PER_IRIXN32 = 0x000a | STICKY_TIMEOUTS,
+ PER_IRIX64 = 0x000b | STICKY_TIMEOUTS,
+ PER_RISCOS = 0x000c,
+ PER_SOLARIS = 0x000d | STICKY_TIMEOUTS,
+ PER_UW7 = 0x000e | STICKY_TIMEOUTS | MMAP_PAGE_ZERO,
+ PER_OSF4 = 0x000f,
+ PER_HPUX = 0x0010,
+ PER_MASK = 0x00ff,
+};
+
+typedef void (*handler_t)(int, struct pt_regs *);
+
+struct exec_domain {
+ const char *name;
+ handler_t handler;
+ unsigned char pers_low;
+ unsigned char pers_high;
+ unsigned long *signal_map;
+ unsigned long *signal_invmap;
+ struct map_segment *err_map;
+ struct map_segment *socktype_map;
+ struct map_segment *sockopt_map;
+ struct map_segment *af_map;
+ struct module *module;
+ struct exec_domain *next;
+};
+
+#define personality(pers) (pers & PER_MASK)
+
+#define get_personality (current->personality)
+
+#define set_personality(pers)   ((current->personality == pers) ? 0 : __set_personality(pers))
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/pfkeyv2.h b/ndk/platforms/android-3/include/linux/pfkeyv2.h
new file mode 100644
index 0000000..3ac9488
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/pfkeyv2.h
@@ -0,0 +1,306 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_PFKEY2_H
+#define _LINUX_PFKEY2_H
+
+#include <linux/types.h>
+
+#define PF_KEY_V2 2
+#define PFKEYV2_REVISION 199806L
+
+struct sadb_msg {
+ uint8_t sadb_msg_version;
+ uint8_t sadb_msg_type;
+ uint8_t sadb_msg_errno;
+ uint8_t sadb_msg_satype;
+ uint16_t sadb_msg_len;
+ uint16_t sadb_msg_reserved;
+ uint32_t sadb_msg_seq;
+ uint32_t sadb_msg_pid;
+} __attribute__((packed));
+
+struct sadb_ext {
+ uint16_t sadb_ext_len;
+ uint16_t sadb_ext_type;
+} __attribute__((packed));
+
+struct sadb_sa {
+ uint16_t sadb_sa_len;
+ uint16_t sadb_sa_exttype;
+ uint32_t sadb_sa_spi;
+ uint8_t sadb_sa_replay;
+ uint8_t sadb_sa_state;
+ uint8_t sadb_sa_auth;
+ uint8_t sadb_sa_encrypt;
+ uint32_t sadb_sa_flags;
+} __attribute__((packed));
+
+struct sadb_lifetime {
+ uint16_t sadb_lifetime_len;
+ uint16_t sadb_lifetime_exttype;
+ uint32_t sadb_lifetime_allocations;
+ uint64_t sadb_lifetime_bytes;
+ uint64_t sadb_lifetime_addtime;
+ uint64_t sadb_lifetime_usetime;
+} __attribute__((packed));
+
+struct sadb_address {
+ uint16_t sadb_address_len;
+ uint16_t sadb_address_exttype;
+ uint8_t sadb_address_proto;
+ uint8_t sadb_address_prefixlen;
+ uint16_t sadb_address_reserved;
+} __attribute__((packed));
+
+struct sadb_key {
+ uint16_t sadb_key_len;
+ uint16_t sadb_key_exttype;
+ uint16_t sadb_key_bits;
+ uint16_t sadb_key_reserved;
+} __attribute__((packed));
+
+struct sadb_ident {
+ uint16_t sadb_ident_len;
+ uint16_t sadb_ident_exttype;
+ uint16_t sadb_ident_type;
+ uint16_t sadb_ident_reserved;
+ uint64_t sadb_ident_id;
+} __attribute__((packed));
+
+struct sadb_sens {
+ uint16_t sadb_sens_len;
+ uint16_t sadb_sens_exttype;
+ uint32_t sadb_sens_dpd;
+ uint8_t sadb_sens_sens_level;
+ uint8_t sadb_sens_sens_len;
+ uint8_t sadb_sens_integ_level;
+ uint8_t sadb_sens_integ_len;
+ uint32_t sadb_sens_reserved;
+} __attribute__((packed));
+
+struct sadb_prop {
+ uint16_t sadb_prop_len;
+ uint16_t sadb_prop_exttype;
+ uint8_t sadb_prop_replay;
+ uint8_t sadb_prop_reserved[3];
+} __attribute__((packed));
+
+struct sadb_comb {
+ uint8_t sadb_comb_auth;
+ uint8_t sadb_comb_encrypt;
+ uint16_t sadb_comb_flags;
+ uint16_t sadb_comb_auth_minbits;
+ uint16_t sadb_comb_auth_maxbits;
+ uint16_t sadb_comb_encrypt_minbits;
+ uint16_t sadb_comb_encrypt_maxbits;
+ uint32_t sadb_comb_reserved;
+ uint32_t sadb_comb_soft_allocations;
+ uint32_t sadb_comb_hard_allocations;
+ uint64_t sadb_comb_soft_bytes;
+ uint64_t sadb_comb_hard_bytes;
+ uint64_t sadb_comb_soft_addtime;
+ uint64_t sadb_comb_hard_addtime;
+ uint64_t sadb_comb_soft_usetime;
+ uint64_t sadb_comb_hard_usetime;
+} __attribute__((packed));
+
+struct sadb_supported {
+ uint16_t sadb_supported_len;
+ uint16_t sadb_supported_exttype;
+ uint32_t sadb_supported_reserved;
+} __attribute__((packed));
+
+struct sadb_alg {
+ uint8_t sadb_alg_id;
+ uint8_t sadb_alg_ivlen;
+ uint16_t sadb_alg_minbits;
+ uint16_t sadb_alg_maxbits;
+ uint16_t sadb_alg_reserved;
+} __attribute__((packed));
+
+struct sadb_spirange {
+ uint16_t sadb_spirange_len;
+ uint16_t sadb_spirange_exttype;
+ uint32_t sadb_spirange_min;
+ uint32_t sadb_spirange_max;
+ uint32_t sadb_spirange_reserved;
+} __attribute__((packed));
+
+struct sadb_x_kmprivate {
+ uint16_t sadb_x_kmprivate_len;
+ uint16_t sadb_x_kmprivate_exttype;
+ uint32_t sadb_x_kmprivate_reserved;
+} __attribute__((packed));
+
+struct sadb_x_sa2 {
+ uint16_t sadb_x_sa2_len;
+ uint16_t sadb_x_sa2_exttype;
+ uint8_t sadb_x_sa2_mode;
+ uint8_t sadb_x_sa2_reserved1;
+ uint16_t sadb_x_sa2_reserved2;
+ uint32_t sadb_x_sa2_sequence;
+ uint32_t sadb_x_sa2_reqid;
+} __attribute__((packed));
+
+struct sadb_x_policy {
+ uint16_t sadb_x_policy_len;
+ uint16_t sadb_x_policy_exttype;
+ uint16_t sadb_x_policy_type;
+ uint8_t sadb_x_policy_dir;
+ uint8_t sadb_x_policy_reserved;
+ uint32_t sadb_x_policy_id;
+ uint32_t sadb_x_policy_priority;
+} __attribute__((packed));
+
+struct sadb_x_ipsecrequest {
+ uint16_t sadb_x_ipsecrequest_len;
+ uint16_t sadb_x_ipsecrequest_proto;
+ uint8_t sadb_x_ipsecrequest_mode;
+ uint8_t sadb_x_ipsecrequest_level;
+ uint16_t sadb_x_ipsecrequest_reserved1;
+ uint32_t sadb_x_ipsecrequest_reqid;
+ uint32_t sadb_x_ipsecrequest_reserved2;
+} __attribute__((packed));
+
+struct sadb_x_nat_t_type {
+ uint16_t sadb_x_nat_t_type_len;
+ uint16_t sadb_x_nat_t_type_exttype;
+ uint8_t sadb_x_nat_t_type_type;
+ uint8_t sadb_x_nat_t_type_reserved[3];
+} __attribute__((packed));
+
+struct sadb_x_nat_t_port {
+ uint16_t sadb_x_nat_t_port_len;
+ uint16_t sadb_x_nat_t_port_exttype;
+ uint16_t sadb_x_nat_t_port_port;
+ uint16_t sadb_x_nat_t_port_reserved;
+} __attribute__((packed));
+
+struct sadb_x_sec_ctx {
+ uint16_t sadb_x_sec_len;
+ uint16_t sadb_x_sec_exttype;
+ uint8_t sadb_x_ctx_alg;
+ uint8_t sadb_x_ctx_doi;
+ uint16_t sadb_x_ctx_len;
+} __attribute__((packed));
+
+#define SADB_RESERVED 0
+#define SADB_GETSPI 1
+#define SADB_UPDATE 2
+#define SADB_ADD 3
+#define SADB_DELETE 4
+#define SADB_GET 5
+#define SADB_ACQUIRE 6
+#define SADB_REGISTER 7
+#define SADB_EXPIRE 8
+#define SADB_FLUSH 9
+#define SADB_DUMP 10
+#define SADB_X_PROMISC 11
+#define SADB_X_PCHANGE 12
+#define SADB_X_SPDUPDATE 13
+#define SADB_X_SPDADD 14
+#define SADB_X_SPDDELETE 15
+#define SADB_X_SPDGET 16
+#define SADB_X_SPDACQUIRE 17
+#define SADB_X_SPDDUMP 18
+#define SADB_X_SPDFLUSH 19
+#define SADB_X_SPDSETIDX 20
+#define SADB_X_SPDEXPIRE 21
+#define SADB_X_SPDDELETE2 22
+#define SADB_X_NAT_T_NEW_MAPPING 23
+#define SADB_MAX 23
+
+#define SADB_SAFLAGS_PFS 1
+#define SADB_SAFLAGS_NOPMTUDISC 0x20000000
+#define SADB_SAFLAGS_DECAP_DSCP 0x40000000
+#define SADB_SAFLAGS_NOECN 0x80000000
+
+#define SADB_SASTATE_LARVAL 0
+#define SADB_SASTATE_MATURE 1
+#define SADB_SASTATE_DYING 2
+#define SADB_SASTATE_DEAD 3
+#define SADB_SASTATE_MAX 3
+
+#define SADB_SATYPE_UNSPEC 0
+#define SADB_SATYPE_AH 2
+#define SADB_SATYPE_ESP 3
+#define SADB_SATYPE_RSVP 5
+#define SADB_SATYPE_OSPFV2 6
+#define SADB_SATYPE_RIPV2 7
+#define SADB_SATYPE_MIP 8
+#define SADB_X_SATYPE_IPCOMP 9
+#define SADB_SATYPE_MAX 9
+
+#define SADB_AALG_NONE 0
+#define SADB_AALG_MD5HMAC 2
+#define SADB_AALG_SHA1HMAC 3
+#define SADB_X_AALG_SHA2_256HMAC 5
+#define SADB_X_AALG_SHA2_384HMAC 6
+#define SADB_X_AALG_SHA2_512HMAC 7
+#define SADB_X_AALG_RIPEMD160HMAC 8
+#define SADB_X_AALG_NULL 251  
+#define SADB_AALG_MAX 251
+
+#define SADB_EALG_NONE 0
+#define SADB_EALG_DESCBC 2
+#define SADB_EALG_3DESCBC 3
+#define SADB_X_EALG_CASTCBC 6
+#define SADB_X_EALG_BLOWFISHCBC 7
+#define SADB_EALG_NULL 11
+#define SADB_X_EALG_AESCBC 12
+#define SADB_EALG_MAX 253  
+
+#define SADB_X_EALG_SERPENTCBC 252  
+#define SADB_X_EALG_TWOFISHCBC 253  
+
+#define SADB_X_CALG_NONE 0
+#define SADB_X_CALG_OUI 1
+#define SADB_X_CALG_DEFLATE 2
+#define SADB_X_CALG_LZS 3
+#define SADB_X_CALG_LZJH 4
+#define SADB_X_CALG_MAX 4
+
+#define SADB_EXT_RESERVED 0
+#define SADB_EXT_SA 1
+#define SADB_EXT_LIFETIME_CURRENT 2
+#define SADB_EXT_LIFETIME_HARD 3
+#define SADB_EXT_LIFETIME_SOFT 4
+#define SADB_EXT_ADDRESS_SRC 5
+#define SADB_EXT_ADDRESS_DST 6
+#define SADB_EXT_ADDRESS_PROXY 7
+#define SADB_EXT_KEY_AUTH 8
+#define SADB_EXT_KEY_ENCRYPT 9
+#define SADB_EXT_IDENTITY_SRC 10
+#define SADB_EXT_IDENTITY_DST 11
+#define SADB_EXT_SENSITIVITY 12
+#define SADB_EXT_PROPOSAL 13
+#define SADB_EXT_SUPPORTED_AUTH 14
+#define SADB_EXT_SUPPORTED_ENCRYPT 15
+#define SADB_EXT_SPIRANGE 16
+#define SADB_X_EXT_KMPRIVATE 17
+#define SADB_X_EXT_POLICY 18
+#define SADB_X_EXT_SA2 19
+
+#define SADB_X_EXT_NAT_T_TYPE 20
+#define SADB_X_EXT_NAT_T_SPORT 21
+#define SADB_X_EXT_NAT_T_DPORT 22
+#define SADB_X_EXT_NAT_T_OA 23
+#define SADB_X_EXT_SEC_CTX 24
+#define SADB_EXT_MAX 24
+
+#define SADB_IDENTTYPE_RESERVED 0
+#define SADB_IDENTTYPE_PREFIX 1
+#define SADB_IDENTTYPE_FQDN 2
+#define SADB_IDENTTYPE_USERFQDN 3
+#define SADB_IDENTTYPE_MAX 3
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/pkt_cls.h b/ndk/platforms/android-3/include/linux/pkt_cls.h
new file mode 100644
index 0000000..601a683
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/pkt_cls.h
@@ -0,0 +1,372 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __LINUX_PKT_CLS_H
+#define __LINUX_PKT_CLS_H
+
+#include <linux/pkt_sched.h>
+
+#define _TC_MAKE32(x) ((x))
+
+#define _TC_MAKEMASK1(n) (_TC_MAKE32(1) << _TC_MAKE32(n))
+#define _TC_MAKEMASK(v,n) (_TC_MAKE32((_TC_MAKE32(1)<<(v))-1) << _TC_MAKE32(n))
+#define _TC_MAKEVALUE(v,n) (_TC_MAKE32(v) << _TC_MAKE32(n))
+#define _TC_GETVALUE(v,n,m) ((_TC_MAKE32(v) & _TC_MAKE32(m)) >> _TC_MAKE32(n))
+
+#define TC_MUNGED _TC_MAKEMASK1(0)
+#define SET_TC_MUNGED(v) ( TC_MUNGED | (v & ~TC_MUNGED))
+#define CLR_TC_MUNGED(v) ( v & ~TC_MUNGED)
+
+#define TC_OK2MUNGE _TC_MAKEMASK1(1)
+#define SET_TC_OK2MUNGE(v) ( TC_OK2MUNGE | (v & ~TC_OK2MUNGE))
+#define CLR_TC_OK2MUNGE(v) ( v & ~TC_OK2MUNGE)
+
+#define S_TC_VERD _TC_MAKE32(2)
+#define M_TC_VERD _TC_MAKEMASK(4,S_TC_VERD)
+#define G_TC_VERD(x) _TC_GETVALUE(x,S_TC_VERD,M_TC_VERD)
+#define V_TC_VERD(x) _TC_MAKEVALUE(x,S_TC_VERD)
+#define SET_TC_VERD(v,n) ((V_TC_VERD(n)) | (v & ~M_TC_VERD))
+
+#define S_TC_FROM _TC_MAKE32(6)
+#define M_TC_FROM _TC_MAKEMASK(2,S_TC_FROM)
+#define G_TC_FROM(x) _TC_GETVALUE(x,S_TC_FROM,M_TC_FROM)
+#define V_TC_FROM(x) _TC_MAKEVALUE(x,S_TC_FROM)
+#define SET_TC_FROM(v,n) ((V_TC_FROM(n)) | (v & ~M_TC_FROM))
+#define AT_STACK 0x0
+#define AT_INGRESS 0x1
+#define AT_EGRESS 0x2
+
+#define TC_NCLS _TC_MAKEMASK1(8)
+#define SET_TC_NCLS(v) ( TC_NCLS | (v & ~TC_NCLS))
+#define CLR_TC_NCLS(v) ( v & ~TC_NCLS)
+
+#define S_TC_RTTL _TC_MAKE32(9)
+#define M_TC_RTTL _TC_MAKEMASK(3,S_TC_RTTL)
+#define G_TC_RTTL(x) _TC_GETVALUE(x,S_TC_RTTL,M_TC_RTTL)
+#define V_TC_RTTL(x) _TC_MAKEVALUE(x,S_TC_RTTL)
+#define SET_TC_RTTL(v,n) ((V_TC_RTTL(n)) | (v & ~M_TC_RTTL))
+
+#define S_TC_AT _TC_MAKE32(12)
+#define M_TC_AT _TC_MAKEMASK(2,S_TC_AT)
+#define G_TC_AT(x) _TC_GETVALUE(x,S_TC_AT,M_TC_AT)
+#define V_TC_AT(x) _TC_MAKEVALUE(x,S_TC_AT)
+#define SET_TC_AT(v,n) ((V_TC_AT(n)) | (v & ~M_TC_AT))
+
+enum
+{
+ TCA_ACT_UNSPEC,
+ TCA_ACT_KIND,
+ TCA_ACT_OPTIONS,
+ TCA_ACT_INDEX,
+ TCA_ACT_STATS,
+ __TCA_ACT_MAX
+};
+
+#define TCA_ACT_MAX __TCA_ACT_MAX
+#define TCA_OLD_COMPAT (TCA_ACT_MAX+1)
+#define TCA_ACT_MAX_PRIO 32
+#define TCA_ACT_BIND 1
+#define TCA_ACT_NOBIND 0
+#define TCA_ACT_UNBIND 1
+#define TCA_ACT_NOUNBIND 0
+#define TCA_ACT_REPLACE 1
+#define TCA_ACT_NOREPLACE 0
+#define MAX_REC_LOOP 4
+#define MAX_RED_LOOP 4
+
+#define TC_ACT_UNSPEC (-1)
+#define TC_ACT_OK 0
+#define TC_ACT_RECLASSIFY 1
+#define TC_ACT_SHOT 2
+#define TC_ACT_PIPE 3
+#define TC_ACT_STOLEN 4
+#define TC_ACT_QUEUED 5
+#define TC_ACT_REPEAT 6
+#define TC_ACT_JUMP 0x10000000
+
+enum
+{
+ TCA_ID_UNSPEC=0,
+ TCA_ID_POLICE=1,
+
+ __TCA_ID_MAX=255
+};
+
+#define TCA_ID_MAX __TCA_ID_MAX
+
+struct tc_police
+{
+ __u32 index;
+ int action;
+#define TC_POLICE_UNSPEC TC_ACT_UNSPEC
+#define TC_POLICE_OK TC_ACT_OK
+#define TC_POLICE_RECLASSIFY TC_ACT_RECLASSIFY
+#define TC_POLICE_SHOT TC_ACT_SHOT
+#define TC_POLICE_PIPE TC_ACT_PIPE
+
+ __u32 limit;
+ __u32 burst;
+ __u32 mtu;
+ struct tc_ratespec rate;
+ struct tc_ratespec peakrate;
+ int refcnt;
+ int bindcnt;
+ __u32 capab;
+};
+
+struct tcf_t
+{
+ __u64 install;
+ __u64 lastuse;
+ __u64 expires;
+};
+
+struct tc_cnt
+{
+ int refcnt;
+ int bindcnt;
+};
+
+#define tc_gen   __u32 index;   __u32 capab;   int action;   int refcnt;   int bindcnt
+
+enum
+{
+ TCA_POLICE_UNSPEC,
+ TCA_POLICE_TBF,
+ TCA_POLICE_RATE,
+ TCA_POLICE_PEAKRATE,
+ TCA_POLICE_AVRATE,
+ TCA_POLICE_RESULT,
+ __TCA_POLICE_MAX
+#define TCA_POLICE_RESULT TCA_POLICE_RESULT
+};
+
+#define TCA_POLICE_MAX (__TCA_POLICE_MAX - 1)
+
+#define TC_U32_HTID(h) ((h)&0xFFF00000)
+#define TC_U32_USERHTID(h) (TC_U32_HTID(h)>>20)
+#define TC_U32_HASH(h) (((h)>>12)&0xFF)
+#define TC_U32_NODE(h) ((h)&0xFFF)
+#define TC_U32_KEY(h) ((h)&0xFFFFF)
+#define TC_U32_UNSPEC 0
+#define TC_U32_ROOT (0xFFF00000)
+
+enum
+{
+ TCA_U32_UNSPEC,
+ TCA_U32_CLASSID,
+ TCA_U32_HASH,
+ TCA_U32_LINK,
+ TCA_U32_DIVISOR,
+ TCA_U32_SEL,
+ TCA_U32_POLICE,
+ TCA_U32_ACT,
+ TCA_U32_INDEV,
+ TCA_U32_PCNT,
+ TCA_U32_MARK,
+ __TCA_U32_MAX
+};
+
+#define TCA_U32_MAX (__TCA_U32_MAX - 1)
+
+struct tc_u32_key
+{
+ __u32 mask;
+ __u32 val;
+ int off;
+ int offmask;
+};
+
+struct tc_u32_sel
+{
+ unsigned char flags;
+ unsigned char offshift;
+ unsigned char nkeys;
+
+ __u16 offmask;
+ __u16 off;
+ short offoff;
+
+ short hoff;
+ __u32 hmask;
+ struct tc_u32_key keys[0];
+};
+
+struct tc_u32_mark
+{
+ __u32 val;
+ __u32 mask;
+ __u32 success;
+};
+
+struct tc_u32_pcnt
+{
+ __u64 rcnt;
+ __u64 rhit;
+ __u64 kcnts[0];
+};
+
+#define TC_U32_TERMINAL 1
+#define TC_U32_OFFSET 2
+#define TC_U32_VAROFFSET 4
+#define TC_U32_EAT 8
+
+#define TC_U32_MAXDEPTH 8
+
+enum
+{
+ TCA_RSVP_UNSPEC,
+ TCA_RSVP_CLASSID,
+ TCA_RSVP_DST,
+ TCA_RSVP_SRC,
+ TCA_RSVP_PINFO,
+ TCA_RSVP_POLICE,
+ TCA_RSVP_ACT,
+ __TCA_RSVP_MAX
+};
+
+#define TCA_RSVP_MAX (__TCA_RSVP_MAX - 1 )
+
+struct tc_rsvp_gpi
+{
+ __u32 key;
+ __u32 mask;
+ int offset;
+};
+
+struct tc_rsvp_pinfo
+{
+ struct tc_rsvp_gpi dpi;
+ struct tc_rsvp_gpi spi;
+ __u8 protocol;
+ __u8 tunnelid;
+ __u8 tunnelhdr;
+ __u8 pad;
+};
+
+enum
+{
+ TCA_ROUTE4_UNSPEC,
+ TCA_ROUTE4_CLASSID,
+ TCA_ROUTE4_TO,
+ TCA_ROUTE4_FROM,
+ TCA_ROUTE4_IIF,
+ TCA_ROUTE4_POLICE,
+ TCA_ROUTE4_ACT,
+ __TCA_ROUTE4_MAX
+};
+
+#define TCA_ROUTE4_MAX (__TCA_ROUTE4_MAX - 1)
+
+enum
+{
+ TCA_FW_UNSPEC,
+ TCA_FW_CLASSID,
+ TCA_FW_POLICE,
+ TCA_FW_INDEV,
+ TCA_FW_ACT,
+ __TCA_FW_MAX
+};
+
+#define TCA_FW_MAX (__TCA_FW_MAX - 1)
+
+enum
+{
+ TCA_TCINDEX_UNSPEC,
+ TCA_TCINDEX_HASH,
+ TCA_TCINDEX_MASK,
+ TCA_TCINDEX_SHIFT,
+ TCA_TCINDEX_FALL_THROUGH,
+ TCA_TCINDEX_CLASSID,
+ TCA_TCINDEX_POLICE,
+ TCA_TCINDEX_ACT,
+ __TCA_TCINDEX_MAX
+};
+
+#define TCA_TCINDEX_MAX (__TCA_TCINDEX_MAX - 1)
+
+enum
+{
+ TCA_BASIC_UNSPEC,
+ TCA_BASIC_CLASSID,
+ TCA_BASIC_EMATCHES,
+ TCA_BASIC_ACT,
+ TCA_BASIC_POLICE,
+ __TCA_BASIC_MAX
+};
+
+#define TCA_BASIC_MAX (__TCA_BASIC_MAX - 1)
+
+struct tcf_ematch_tree_hdr
+{
+ __u16 nmatches;
+ __u16 progid;
+};
+
+enum
+{
+ TCA_EMATCH_TREE_UNSPEC,
+ TCA_EMATCH_TREE_HDR,
+ TCA_EMATCH_TREE_LIST,
+ __TCA_EMATCH_TREE_MAX
+};
+#define TCA_EMATCH_TREE_MAX (__TCA_EMATCH_TREE_MAX - 1)
+
+struct tcf_ematch_hdr
+{
+ __u16 matchid;
+ __u16 kind;
+ __u16 flags;
+ __u16 pad;
+};
+
+#define TCF_EM_REL_END 0
+#define TCF_EM_REL_AND (1<<0)
+#define TCF_EM_REL_OR (1<<1)
+#define TCF_EM_INVERT (1<<2)
+#define TCF_EM_SIMPLE (1<<3)
+
+#define TCF_EM_REL_MASK 3
+#define TCF_EM_REL_VALID(v) (((v) & TCF_EM_REL_MASK) != TCF_EM_REL_MASK)
+
+enum
+{
+ TCF_LAYER_LINK,
+ TCF_LAYER_NETWORK,
+ TCF_LAYER_TRANSPORT,
+ __TCF_LAYER_MAX
+};
+#define TCF_LAYER_MAX (__TCF_LAYER_MAX - 1)
+
+enum
+{
+ TCF_EM_CONTAINER,
+ TCF_EM_CMP,
+ TCF_EM_NBYTE,
+ TCF_EM_U32,
+ TCF_EM_META,
+ TCF_EM_TEXT,
+ __TCF_EM_MAX
+};
+
+enum
+{
+ TCF_EM_PROG_TC
+};
+
+enum
+{
+ TCF_EM_OPND_EQ,
+ TCF_EM_OPND_GT,
+ TCF_EM_OPND_LT
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/pkt_sched.h b/ndk/platforms/android-3/include/linux/pkt_sched.h
new file mode 100644
index 0000000..1e15d83
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/pkt_sched.h
@@ -0,0 +1,405 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __LINUX_PKT_SCHED_H
+#define __LINUX_PKT_SCHED_H
+
+#define TC_PRIO_BESTEFFORT 0
+#define TC_PRIO_FILLER 1
+#define TC_PRIO_BULK 2
+#define TC_PRIO_INTERACTIVE_BULK 4
+#define TC_PRIO_INTERACTIVE 6
+#define TC_PRIO_CONTROL 7
+
+#define TC_PRIO_MAX 15
+
+struct tc_stats
+{
+ __u64 bytes;
+ __u32 packets;
+ __u32 drops;
+ __u32 overlimits;
+ __u32 bps;
+ __u32 pps;
+ __u32 qlen;
+ __u32 backlog;
+};
+
+struct tc_estimator
+{
+ signed char interval;
+ unsigned char ewma_log;
+};
+
+#define TC_H_MAJ_MASK (0xFFFF0000U)
+#define TC_H_MIN_MASK (0x0000FFFFU)
+#define TC_H_MAJ(h) ((h)&TC_H_MAJ_MASK)
+#define TC_H_MIN(h) ((h)&TC_H_MIN_MASK)
+#define TC_H_MAKE(maj,min) (((maj)&TC_H_MAJ_MASK)|((min)&TC_H_MIN_MASK))
+
+#define TC_H_UNSPEC (0U)
+#define TC_H_ROOT (0xFFFFFFFFU)
+#define TC_H_INGRESS (0xFFFFFFF1U)
+
+struct tc_ratespec
+{
+ unsigned char cell_log;
+ unsigned char __reserved;
+ unsigned short feature;
+ short addend;
+ unsigned short mpu;
+ __u32 rate;
+};
+
+struct tc_fifo_qopt
+{
+ __u32 limit;
+};
+
+#define TCQ_PRIO_BANDS 16
+#define TCQ_MIN_PRIO_BANDS 2
+
+struct tc_prio_qopt
+{
+ int bands;
+ __u8 priomap[TC_PRIO_MAX+1];
+};
+
+struct tc_tbf_qopt
+{
+ struct tc_ratespec rate;
+ struct tc_ratespec peakrate;
+ __u32 limit;
+ __u32 buffer;
+ __u32 mtu;
+};
+
+enum
+{
+ TCA_TBF_UNSPEC,
+ TCA_TBF_PARMS,
+ TCA_TBF_RTAB,
+ TCA_TBF_PTAB,
+ __TCA_TBF_MAX,
+};
+
+#define TCA_TBF_MAX (__TCA_TBF_MAX - 1)
+
+struct tc_sfq_qopt
+{
+ unsigned quantum;
+ int perturb_period;
+ __u32 limit;
+ unsigned divisor;
+ unsigned flows;
+};
+
+enum
+{
+ TCA_RED_UNSPEC,
+ TCA_RED_PARMS,
+ TCA_RED_STAB,
+ __TCA_RED_MAX,
+};
+
+#define TCA_RED_MAX (__TCA_RED_MAX - 1)
+
+struct tc_red_qopt
+{
+ __u32 limit;
+ __u32 qth_min;
+ __u32 qth_max;
+ unsigned char Wlog;
+ unsigned char Plog;
+ unsigned char Scell_log;
+ unsigned char flags;
+#define TC_RED_ECN 1
+#define TC_RED_HARDDROP 2
+};
+
+struct tc_red_xstats
+{
+ __u32 early;
+ __u32 pdrop;
+ __u32 other;
+ __u32 marked;
+};
+
+#define MAX_DPs 16
+
+enum
+{
+ TCA_GRED_UNSPEC,
+ TCA_GRED_PARMS,
+ TCA_GRED_STAB,
+ TCA_GRED_DPS,
+ __TCA_GRED_MAX,
+};
+
+#define TCA_GRED_MAX (__TCA_GRED_MAX - 1)
+
+struct tc_gred_qopt
+{
+ __u32 limit;
+ __u32 qth_min;
+ __u32 qth_max;
+ __u32 DP;
+ __u32 backlog;
+ __u32 qave;
+ __u32 forced;
+ __u32 early;
+ __u32 other;
+ __u32 pdrop;
+ __u8 Wlog;
+ __u8 Plog;
+ __u8 Scell_log;
+ __u8 prio;
+ __u32 packets;
+ __u32 bytesin;
+};
+
+struct tc_gred_sopt
+{
+ __u32 DPs;
+ __u32 def_DP;
+ __u8 grio;
+ __u8 flags;
+ __u16 pad1;
+};
+
+#define TC_HTB_NUMPRIO 8
+#define TC_HTB_MAXDEPTH 8
+#define TC_HTB_PROTOVER 3  
+
+struct tc_htb_opt
+{
+ struct tc_ratespec rate;
+ struct tc_ratespec ceil;
+ __u32 buffer;
+ __u32 cbuffer;
+ __u32 quantum;
+ __u32 level;
+ __u32 prio;
+};
+struct tc_htb_glob
+{
+ __u32 version;
+ __u32 rate2quantum;
+ __u32 defcls;
+ __u32 debug;
+
+ __u32 direct_pkts;
+};
+enum
+{
+ TCA_HTB_UNSPEC,
+ TCA_HTB_PARMS,
+ TCA_HTB_INIT,
+ TCA_HTB_CTAB,
+ TCA_HTB_RTAB,
+ __TCA_HTB_MAX,
+};
+
+#define TCA_HTB_MAX (__TCA_HTB_MAX - 1)
+
+struct tc_htb_xstats
+{
+ __u32 lends;
+ __u32 borrows;
+ __u32 giants;
+ __u32 tokens;
+ __u32 ctokens;
+};
+
+struct tc_hfsc_qopt
+{
+ __u16 defcls;
+};
+
+struct tc_service_curve
+{
+ __u32 m1;
+ __u32 d;
+ __u32 m2;
+};
+
+struct tc_hfsc_stats
+{
+ __u64 work;
+ __u64 rtwork;
+ __u32 period;
+ __u32 level;
+};
+
+enum
+{
+ TCA_HFSC_UNSPEC,
+ TCA_HFSC_RSC,
+ TCA_HFSC_FSC,
+ TCA_HFSC_USC,
+ __TCA_HFSC_MAX,
+};
+
+#define TCA_HFSC_MAX (__TCA_HFSC_MAX - 1)
+
+#define TC_CBQ_MAXPRIO 8
+#define TC_CBQ_MAXLEVEL 8
+#define TC_CBQ_DEF_EWMA 5
+
+struct tc_cbq_lssopt
+{
+ unsigned char change;
+ unsigned char flags;
+#define TCF_CBQ_LSS_BOUNDED 1
+#define TCF_CBQ_LSS_ISOLATED 2
+ unsigned char ewma_log;
+ unsigned char level;
+#define TCF_CBQ_LSS_FLAGS 1
+#define TCF_CBQ_LSS_EWMA 2
+#define TCF_CBQ_LSS_MAXIDLE 4
+#define TCF_CBQ_LSS_MINIDLE 8
+#define TCF_CBQ_LSS_OFFTIME 0x10
+#define TCF_CBQ_LSS_AVPKT 0x20
+ __u32 maxidle;
+ __u32 minidle;
+ __u32 offtime;
+ __u32 avpkt;
+};
+
+struct tc_cbq_wrropt
+{
+ unsigned char flags;
+ unsigned char priority;
+ unsigned char cpriority;
+ unsigned char __reserved;
+ __u32 allot;
+ __u32 weight;
+};
+
+struct tc_cbq_ovl
+{
+ unsigned char strategy;
+#define TC_CBQ_OVL_CLASSIC 0
+#define TC_CBQ_OVL_DELAY 1
+#define TC_CBQ_OVL_LOWPRIO 2
+#define TC_CBQ_OVL_DROP 3
+#define TC_CBQ_OVL_RCLASSIC 4
+ unsigned char priority2;
+ __u16 pad;
+ __u32 penalty;
+};
+
+struct tc_cbq_police
+{
+ unsigned char police;
+ unsigned char __res1;
+ unsigned short __res2;
+};
+
+struct tc_cbq_fopt
+{
+ __u32 split;
+ __u32 defmap;
+ __u32 defchange;
+};
+
+struct tc_cbq_xstats
+{
+ __u32 borrows;
+ __u32 overactions;
+ __s32 avgidle;
+ __s32 undertime;
+};
+
+enum
+{
+ TCA_CBQ_UNSPEC,
+ TCA_CBQ_LSSOPT,
+ TCA_CBQ_WRROPT,
+ TCA_CBQ_FOPT,
+ TCA_CBQ_OVL_STRATEGY,
+ TCA_CBQ_RATE,
+ TCA_CBQ_RTAB,
+ TCA_CBQ_POLICE,
+ __TCA_CBQ_MAX,
+};
+
+#define TCA_CBQ_MAX (__TCA_CBQ_MAX - 1)
+
+enum {
+ TCA_DSMARK_UNSPEC,
+ TCA_DSMARK_INDICES,
+ TCA_DSMARK_DEFAULT_INDEX,
+ TCA_DSMARK_SET_TC_INDEX,
+ TCA_DSMARK_MASK,
+ TCA_DSMARK_VALUE,
+ __TCA_DSMARK_MAX,
+};
+
+#define TCA_DSMARK_MAX (__TCA_DSMARK_MAX - 1)
+
+enum {
+ TCA_ATM_UNSPEC,
+ TCA_ATM_FD,
+ TCA_ATM_PTR,
+ TCA_ATM_HDR,
+ TCA_ATM_EXCESS,
+ TCA_ATM_ADDR,
+ TCA_ATM_STATE,
+ __TCA_ATM_MAX,
+};
+
+#define TCA_ATM_MAX (__TCA_ATM_MAX - 1)
+
+enum
+{
+ TCA_NETEM_UNSPEC,
+ TCA_NETEM_CORR,
+ TCA_NETEM_DELAY_DIST,
+ TCA_NETEM_REORDER,
+ TCA_NETEM_CORRUPT,
+ __TCA_NETEM_MAX,
+};
+
+#define TCA_NETEM_MAX (__TCA_NETEM_MAX - 1)
+
+struct tc_netem_qopt
+{
+ __u32 latency;
+ __u32 limit;
+ __u32 loss;
+ __u32 gap;
+ __u32 duplicate;
+ __u32 jitter;
+};
+
+struct tc_netem_corr
+{
+ __u32 delay_corr;
+ __u32 loss_corr;
+ __u32 dup_corr;
+};
+
+struct tc_netem_reorder
+{
+ __u32 probability;
+ __u32 correlation;
+};
+
+struct tc_netem_corrupt
+{
+ __u32 probability;
+ __u32 correlation;
+};
+
+#define NETEM_DIST_SCALE 8192
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/platform_device.h b/ndk/platforms/android-3/include/linux/platform_device.h
new file mode 100644
index 0000000..a761b5b
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/platform_device.h
@@ -0,0 +1,39 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _PLATFORM_DEVICE_H_
+#define _PLATFORM_DEVICE_H_
+
+#include <linux/device.h>
+
+struct platform_device {
+ const char * name;
+ u32 id;
+ struct device dev;
+ u32 num_resources;
+ struct resource * resource;
+};
+
+#define to_platform_device(x) container_of((x), struct platform_device, dev)
+
+struct platform_driver {
+ int (*probe)(struct platform_device *);
+ int (*remove)(struct platform_device *);
+ void (*shutdown)(struct platform_device *);
+ int (*suspend)(struct platform_device *, pm_message_t state);
+ int (*resume)(struct platform_device *);
+ struct device_driver driver;
+};
+
+#define platform_get_drvdata(_dev) dev_get_drvdata(&(_dev)->dev)
+#define platform_set_drvdata(_dev,data) dev_set_drvdata(&(_dev)->dev, (data))
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/plist.h b/ndk/platforms/android-3/include/linux/plist.h
new file mode 100644
index 0000000..5d65783
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/plist.h
@@ -0,0 +1,44 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_PLIST_H_
+#define _LINUX_PLIST_H_
+
+#include <linux/kernel.h>
+#include <linux/list.h>
+#include <linux/spinlock_types.h>
+
+struct plist_head {
+ struct list_head prio_list;
+ struct list_head node_list;
+};
+
+struct plist_node {
+ int prio;
+ struct plist_head plist;
+};
+
+#define PLIST_HEAD_LOCK_INIT(_lock)
+
+#define PLIST_HEAD_INIT(head, _lock)  {   .prio_list = LIST_HEAD_INIT((head).prio_list),   .node_list = LIST_HEAD_INIT((head).node_list),   PLIST_HEAD_LOCK_INIT(&(_lock))  }
+
+#define PLIST_NODE_INIT(node, __prio)  {   .prio = (__prio),   .plist = PLIST_HEAD_INIT((node).plist, NULL),  }
+
+#define plist_for_each(pos, head)   list_for_each_entry(pos, &(head)->node_list, plist.node_list)
+
+#define plist_for_each_safe(pos, n, head)   list_for_each_entry_safe(pos, n, &(head)->node_list, plist.node_list)
+
+#define plist_for_each_entry(pos, head, mem)   list_for_each_entry(pos, &(head)->node_list, mem.plist.node_list)
+
+#define plist_for_each_entry_safe(pos, n, head, m)   list_for_each_entry_safe(pos, n, &(head)->node_list, m.plist.node_list)
+
+#define plist_first_entry(head, type, member)   container_of(plist_first(head), type, member)
+#endif
diff --git a/ndk/platforms/android-3/include/linux/pm.h b/ndk/platforms/android-3/include/linux/pm.h
new file mode 100644
index 0000000..0548791
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/pm.h
@@ -0,0 +1,15 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_PM_H
+#define _LINUX_PM_H
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/pnp.h b/ndk/platforms/android-3/include/linux/pnp.h
new file mode 100644
index 0000000..30b0af7
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/pnp.h
@@ -0,0 +1,15 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_PNP_H
+#define _LINUX_PNP_H
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/poll.h b/ndk/platforms/android-3/include/linux/poll.h
new file mode 100644
index 0000000..6822509
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/poll.h
@@ -0,0 +1,17 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_POLL_H
+#define _LINUX_POLL_H
+
+#include <asm/poll.h>
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/posix_acl.h b/ndk/platforms/android-3/include/linux/posix_acl.h
new file mode 100644
index 0000000..bdaee5b
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/posix_acl.h
@@ -0,0 +1,47 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __LINUX_POSIX_ACL_H
+#define __LINUX_POSIX_ACL_H
+
+#include <linux/slab.h>
+
+#define ACL_UNDEFINED_ID (-1)
+
+#define ACL_TYPE_ACCESS (0x8000)
+#define ACL_TYPE_DEFAULT (0x4000)
+
+#define ACL_USER_OBJ (0x01)
+#define ACL_USER (0x02)
+#define ACL_GROUP_OBJ (0x04)
+#define ACL_GROUP (0x08)
+#define ACL_MASK (0x10)
+#define ACL_OTHER (0x20)
+
+#define ACL_READ (0x04)
+#define ACL_WRITE (0x02)
+#define ACL_EXECUTE (0x01)
+
+struct posix_acl_entry {
+ short e_tag;
+ unsigned short e_perm;
+ unsigned int e_id;
+};
+
+struct posix_acl {
+ atomic_t a_refcount;
+ unsigned int a_count;
+ struct posix_acl_entry a_entries[0];
+};
+
+#define FOREACH_ACL_ENTRY(pa, acl, pe)   for(pa=(acl)->a_entries, pe=pa+(acl)->a_count; pa<pe; pa++)
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/posix_types.h b/ndk/platforms/android-3/include/linux/posix_types.h
new file mode 100644
index 0000000..d7d0ad2
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/posix_types.h
@@ -0,0 +1,43 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_POSIX_TYPES_H
+#define _LINUX_POSIX_TYPES_H
+
+#include <linux/stddef.h>
+
+#undef __NFDBITS
+#define __NFDBITS (8 * sizeof(unsigned long))
+
+#undef __FD_SETSIZE
+#define __FD_SETSIZE 1024
+
+#undef __FDSET_LONGS
+#define __FDSET_LONGS (__FD_SETSIZE/__NFDBITS)
+
+#undef __FDELT
+#define __FDELT(d) ((d) / __NFDBITS)
+
+#undef __FDMASK
+#define __FDMASK(d) (1UL << ((d) % __NFDBITS))
+
+typedef struct {
+ unsigned long fds_bits [__FDSET_LONGS];
+} __kernel_fd_set;
+
+typedef void (*__kernel_sighandler_t)(int);
+
+typedef int __kernel_key_t;
+typedef int __kernel_mqd_t;
+
+#include <asm/posix_types.h>
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/ppdev.h b/ndk/platforms/android-3/include/linux/ppdev.h
new file mode 100644
index 0000000..c43f8b9
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/ppdev.h
@@ -0,0 +1,71 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#define PP_IOCTL 'p'
+
+#define PPSETMODE _IOW(PP_IOCTL, 0x80, int)
+
+#define PPRSTATUS _IOR(PP_IOCTL, 0x81, unsigned char)
+#define PPWSTATUS OBSOLETE__IOW(PP_IOCTL, 0x82, unsigned char)
+
+#define PPRCONTROL _IOR(PP_IOCTL, 0x83, unsigned char)
+#define PPWCONTROL _IOW(PP_IOCTL, 0x84, unsigned char)
+
+struct ppdev_frob_struct {
+ unsigned char mask;
+ unsigned char val;
+};
+#define PPFCONTROL _IOW(PP_IOCTL, 0x8e, struct ppdev_frob_struct)
+
+#define PPRDATA _IOR(PP_IOCTL, 0x85, unsigned char)
+#define PPWDATA _IOW(PP_IOCTL, 0x86, unsigned char)
+
+#define PPRECONTROL OBSOLETE__IOR(PP_IOCTL, 0x87, unsigned char)
+#define PPWECONTROL OBSOLETE__IOW(PP_IOCTL, 0x88, unsigned char)
+
+#define PPRFIFO OBSOLETE__IOR(PP_IOCTL, 0x89, unsigned char)
+#define PPWFIFO OBSOLETE__IOW(PP_IOCTL, 0x8a, unsigned char)
+
+#define PPCLAIM _IO(PP_IOCTL, 0x8b)
+
+#define PPRELEASE _IO(PP_IOCTL, 0x8c)
+
+#define PPYIELD _IO(PP_IOCTL, 0x8d)
+
+#define PPEXCL _IO(PP_IOCTL, 0x8f)
+
+#define PPDATADIR _IOW(PP_IOCTL, 0x90, int)
+
+#define PPNEGOT _IOW(PP_IOCTL, 0x91, int)
+
+#define PPWCTLONIRQ _IOW(PP_IOCTL, 0x92, unsigned char)
+
+#define PPCLRIRQ _IOR(PP_IOCTL, 0x93, int)
+
+#define PPSETPHASE _IOW(PP_IOCTL, 0x94, int)
+
+#define PPGETTIME _IOR(PP_IOCTL, 0x95, struct timeval)
+#define PPSETTIME _IOW(PP_IOCTL, 0x96, struct timeval)
+
+#define PPGETMODES _IOR(PP_IOCTL, 0x97, unsigned int)
+
+#define PPGETMODE _IOR(PP_IOCTL, 0x98, int)
+#define PPGETPHASE _IOR(PP_IOCTL, 0x99, int)
+
+#define PPGETFLAGS _IOR(PP_IOCTL, 0x9a, int)
+#define PPSETFLAGS _IOW(PP_IOCTL, 0x9b, int)
+
+#define PP_FASTWRITE (1<<2)
+#define PP_FASTREAD (1<<3)
+#define PP_W91284PIC (1<<4)
+
+#define PP_FLAGMASK (PP_FASTWRITE | PP_FASTREAD | PP_W91284PIC)
+
diff --git a/ndk/platforms/android-3/include/linux/ppp_defs.h b/ndk/platforms/android-3/include/linux/ppp_defs.h
new file mode 100644
index 0000000..da54ac7
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/ppp_defs.h
@@ -0,0 +1,121 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _PPP_DEFS_H_
+#define _PPP_DEFS_H_
+
+#define PPP_HDRLEN 4  
+#define PPP_FCSLEN 2  
+#define PPP_MRU 1500  
+
+#define PPP_ADDRESS(p) (((__u8 *)(p))[0])
+#define PPP_CONTROL(p) (((__u8 *)(p))[1])
+#define PPP_PROTOCOL(p) ((((__u8 *)(p))[2] << 8) + ((__u8 *)(p))[3])
+
+#define PPP_ALLSTATIONS 0xff  
+#define PPP_UI 0x03  
+#define PPP_FLAG 0x7e  
+#define PPP_ESCAPE 0x7d  
+#define PPP_TRANS 0x20  
+
+#define PPP_IP 0x21  
+#define PPP_AT 0x29  
+#define PPP_IPX 0x2b  
+#define PPP_VJC_COMP 0x2d  
+#define PPP_VJC_UNCOMP 0x2f  
+#define PPP_MP 0x3d  
+#define PPP_IPV6 0x57  
+#define PPP_COMPFRAG 0xfb  
+#define PPP_COMP 0xfd  
+#define PPP_MPLS_UC 0x0281  
+#define PPP_MPLS_MC 0x0283  
+#define PPP_IPCP 0x8021  
+#define PPP_ATCP 0x8029  
+#define PPP_IPXCP 0x802b  
+#define PPP_IPV6CP 0x8057  
+#define PPP_CCPFRAG 0x80fb  
+#define PPP_CCP 0x80fd  
+#define PPP_MPLSCP 0x80fd  
+#define PPP_LCP 0xc021  
+#define PPP_PAP 0xc023  
+#define PPP_LQR 0xc025  
+#define PPP_CHAP 0xc223  
+#define PPP_CBCP 0xc029  
+
+#define PPP_INITFCS 0xffff  
+#define PPP_GOODFCS 0xf0b8  
+
+typedef __u32 ext_accm[8];
+
+enum NPmode {
+ NPMODE_PASS,
+ NPMODE_DROP,
+ NPMODE_ERROR,
+ NPMODE_QUEUE
+};
+
+struct pppstat {
+ __u32 ppp_discards;
+
+ __u32 ppp_ibytes;
+ __u32 ppp_ioctects;
+ __u32 ppp_ipackets;
+ __u32 ppp_ierrors;
+ __u32 ppp_ilqrs;
+
+ __u32 ppp_obytes;
+ __u32 ppp_ooctects;
+ __u32 ppp_opackets;
+ __u32 ppp_oerrors;
+ __u32 ppp_olqrs;
+};
+
+struct vjstat {
+ __u32 vjs_packets;
+ __u32 vjs_compressed;
+ __u32 vjs_searches;
+ __u32 vjs_misses;
+ __u32 vjs_uncompressedin;
+ __u32 vjs_compressedin;
+ __u32 vjs_errorin;
+ __u32 vjs_tossed;
+};
+
+struct compstat {
+ __u32 unc_bytes;
+ __u32 unc_packets;
+ __u32 comp_bytes;
+ __u32 comp_packets;
+ __u32 inc_bytes;
+ __u32 inc_packets;
+
+ __u32 in_count;
+ __u32 bytes_out;
+
+ double ratio;
+};
+
+struct ppp_stats {
+ struct pppstat p;
+ struct vjstat vj;
+};
+
+struct ppp_comp_stats {
+ struct compstat c;
+ struct compstat d;
+};
+
+struct ppp_idle {
+ time_t xmit_idle;
+ time_t recv_idle;
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/prctl.h b/ndk/platforms/android-3/include/linux/prctl.h
new file mode 100644
index 0000000..a7631a2
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/prctl.h
@@ -0,0 +1,61 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_PRCTL_H
+#define _LINUX_PRCTL_H
+
+#define PR_SET_PDEATHSIG 1  
+#define PR_GET_PDEATHSIG 2  
+
+#define PR_GET_DUMPABLE 3
+#define PR_SET_DUMPABLE 4
+
+#define PR_GET_UNALIGN 5
+#define PR_SET_UNALIGN 6
+#define PR_UNALIGN_NOPRINT 1  
+#define PR_UNALIGN_SIGBUS 2  
+
+#define PR_GET_KEEPCAPS 7
+#define PR_SET_KEEPCAPS 8
+
+#define PR_GET_FPEMU 9
+#define PR_SET_FPEMU 10
+#define PR_FPEMU_NOPRINT 1  
+#define PR_FPEMU_SIGFPE 2  
+
+#define PR_GET_FPEXC 11
+#define PR_SET_FPEXC 12
+#define PR_FP_EXC_SW_ENABLE 0x80  
+#define PR_FP_EXC_DIV 0x010000  
+#define PR_FP_EXC_OVF 0x020000  
+#define PR_FP_EXC_UND 0x040000  
+#define PR_FP_EXC_RES 0x080000  
+#define PR_FP_EXC_INV 0x100000  
+#define PR_FP_EXC_DISABLED 0  
+#define PR_FP_EXC_NONRECOV 1  
+#define PR_FP_EXC_ASYNC 2  
+#define PR_FP_EXC_PRECISE 3  
+
+#define PR_GET_TIMING 13
+#define PR_SET_TIMING 14
+#define PR_TIMING_STATISTICAL 0  
+#define PR_TIMING_TIMESTAMP 1  
+
+#define PR_SET_NAME 15  
+#define PR_GET_NAME 16  
+
+#define PR_GET_ENDIAN 19
+#define PR_SET_ENDIAN 20
+#define PR_ENDIAN_BIG 0
+#define PR_ENDIAN_LITTLE 1  
+#define PR_ENDIAN_PPC_LITTLE 2  
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/preempt.h b/ndk/platforms/android-3/include/linux/preempt.h
new file mode 100644
index 0000000..b703dd3
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/preempt.h
@@ -0,0 +1,31 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __LINUX_PREEMPT_H
+#define __LINUX_PREEMPT_H
+
+#include <linux/thread_info.h>
+#include <linux/linkage.h>
+
+#define add_preempt_count(val) do { preempt_count() += (val); } while (0)
+#define sub_preempt_count(val) do { preempt_count() -= (val); } while (0)
+
+#define inc_preempt_count() add_preempt_count(1)
+#define dec_preempt_count() sub_preempt_count(1)
+
+#define preempt_count() (current_thread_info()->preempt_count)
+
+#define preempt_disable() do { } while (0)
+#define preempt_enable_no_resched() do { } while (0)
+#define preempt_enable() do { } while (0)
+#define preempt_check_resched() do { } while (0)
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/proc_fs.h b/ndk/platforms/android-3/include/linux/proc_fs.h
new file mode 100644
index 0000000..ccb22ac
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/proc_fs.h
@@ -0,0 +1,77 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_PROC_FS_H
+#define _LINUX_PROC_FS_H
+
+#include <linux/slab.h>
+#include <linux/fs.h>
+#include <linux/spinlock.h>
+#include <asm/atomic.h>
+
+#define FIRST_PROCESS_ENTRY 256
+
+enum {
+ PROC_ROOT_INO = 1,
+};
+
+#define PROC_SUPER_MAGIC 0x9fa0
+
+typedef int (read_proc_t)(char *page, char **start, off_t off,
+ int count, int *eof, void *data);
+typedef int (write_proc_t)(struct file *file, const char __user *buffer,
+ unsigned long count, void *data);
+typedef int (get_info_t)(char *, char **, off_t, int);
+
+struct proc_dir_entry {
+ unsigned int low_ino;
+ unsigned short namelen;
+ const char *name;
+ mode_t mode;
+ nlink_t nlink;
+ uid_t uid;
+ gid_t gid;
+ loff_t size;
+ struct inode_operations * proc_iops;
+ const struct file_operations * proc_fops;
+ get_info_t *get_info;
+ struct module *owner;
+ struct proc_dir_entry *next, *parent, *subdir;
+ void *data;
+ read_proc_t *read_proc;
+ write_proc_t *write_proc;
+ atomic_t count;
+ int deleted;
+ void *set;
+};
+
+struct kcore_list {
+ struct kcore_list *next;
+ unsigned long addr;
+ size_t size;
+};
+
+struct vmcore {
+ struct list_head list;
+ unsigned long long paddr;
+ unsigned long long size;
+ loff_t offset;
+};
+
+#define proc_root_driver NULL
+#define proc_net NULL
+#define proc_bus NULL
+
+#define proc_net_fops_create(name, mode, fops) ({ (void)(mode), NULL; })
+#define proc_net_create(name, mode, info) ({ (void)(mode), NULL; })
+#define remove_proc_entry(name, parent) do {} while (0)
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/ptrace.h b/ndk/platforms/android-3/include/linux/ptrace.h
new file mode 100644
index 0000000..079c0c8
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/ptrace.h
@@ -0,0 +1,55 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_PTRACE_H
+#define _LINUX_PTRACE_H
+
+#define PTRACE_TRACEME 0
+#define PTRACE_PEEKTEXT 1
+#define PTRACE_PEEKDATA 2
+#define PTRACE_PEEKUSR 3
+#define PTRACE_POKETEXT 4
+#define PTRACE_POKEDATA 5
+#define PTRACE_POKEUSR 6
+#define PTRACE_CONT 7
+#define PTRACE_KILL 8
+#define PTRACE_SINGLESTEP 9
+
+#define PTRACE_ATTACH 0x10
+#define PTRACE_DETACH 0x11
+
+#define PTRACE_SYSCALL 24
+
+#define PTRACE_SETOPTIONS 0x4200
+#define PTRACE_GETEVENTMSG 0x4201
+#define PTRACE_GETSIGINFO 0x4202
+#define PTRACE_SETSIGINFO 0x4203
+
+#define PTRACE_O_TRACESYSGOOD 0x00000001
+#define PTRACE_O_TRACEFORK 0x00000002
+#define PTRACE_O_TRACEVFORK 0x00000004
+#define PTRACE_O_TRACECLONE 0x00000008
+#define PTRACE_O_TRACEEXEC 0x00000010
+#define PTRACE_O_TRACEVFORKDONE 0x00000020
+#define PTRACE_O_TRACEEXIT 0x00000040
+
+#define PTRACE_O_MASK 0x0000007f
+
+#define PTRACE_EVENT_FORK 1
+#define PTRACE_EVENT_VFORK 2
+#define PTRACE_EVENT_CLONE 3
+#define PTRACE_EVENT_EXEC 4
+#define PTRACE_EVENT_VFORK_DONE 5
+#define PTRACE_EVENT_EXIT 6
+
+#include <asm/ptrace.h>
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/qic117.h b/ndk/platforms/android-3/include/linux/qic117.h
new file mode 100644
index 0000000..e077090
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/qic117.h
@@ -0,0 +1,123 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _QIC117_H
+#define _QIC117_H
+
+typedef enum {
+ QIC_NO_COMMAND = 0,
+ QIC_RESET = 1,
+ QIC_REPORT_NEXT_BIT = 2,
+ QIC_PAUSE = 3,
+ QIC_MICRO_STEP_PAUSE = 4,
+ QIC_ALTERNATE_TIMEOUT = 5,
+ QIC_REPORT_DRIVE_STATUS = 6,
+ QIC_REPORT_ERROR_CODE = 7,
+ QIC_REPORT_DRIVE_CONFIGURATION = 8,
+ QIC_REPORT_ROM_VERSION = 9,
+ QIC_LOGICAL_FORWARD = 10,
+ QIC_PHYSICAL_REVERSE = 11,
+ QIC_PHYSICAL_FORWARD = 12,
+ QIC_SEEK_HEAD_TO_TRACK = 13,
+ QIC_SEEK_LOAD_POINT = 14,
+ QIC_ENTER_FORMAT_MODE = 15,
+ QIC_WRITE_REFERENCE_BURST = 16,
+ QIC_ENTER_VERIFY_MODE = 17,
+ QIC_STOP_TAPE = 18,
+
+ QIC_MICRO_STEP_HEAD_UP = 21,
+ QIC_MICRO_STEP_HEAD_DOWN = 22,
+ QIC_SOFT_SELECT = 23,
+ QIC_SOFT_DESELECT = 24,
+ QIC_SKIP_REVERSE = 25,
+ QIC_SKIP_FORWARD = 26,
+ QIC_SELECT_RATE = 27,
+
+ QIC_ENTER_DIAGNOSTIC_1 = 28,
+ QIC_ENTER_DIAGNOSTIC_2 = 29,
+ QIC_ENTER_PRIMARY_MODE = 30,
+
+ QIC_REPORT_VENDOR_ID = 32,
+ QIC_REPORT_TAPE_STATUS = 33,
+ QIC_SKIP_EXTENDED_REVERSE = 34,
+ QIC_SKIP_EXTENDED_FORWARD = 35,
+ QIC_CALIBRATE_TAPE_LENGTH = 36,
+ QIC_REPORT_FORMAT_SEGMENTS = 37,
+ QIC_SET_FORMAT_SEGMENTS = 38,
+
+ QIC_PHANTOM_SELECT = 46,
+ QIC_PHANTOM_DESELECT = 47
+} qic117_cmd_t;
+
+typedef enum {
+ discretional = 0, required, ccs1, ccs2
+} qic_compatibility;
+
+typedef enum {
+ unused, mode, motion, report
+} command_types;
+
+struct qic117_command_table {
+ char *name;
+ __u8 mask;
+ __u8 state;
+ __u8 cmd_type;
+ __u8 non_intr;
+ __u8 level;
+};
+
+#define QIC117_COMMANDS {         {NULL, 0x00, 0x00, mode, 0, discretional},   {"soft reset", 0x00, 0x00, motion, 1, required},   {"report next bit", 0x00, 0x00, report, 0, required},   {"pause", 0x36, 0x24, motion, 1, required},   {"micro step pause", 0x36, 0x24, motion, 1, required},   {"alternate command timeout", 0x00, 0x00, mode, 0, required},   {"report drive status", 0x00, 0x00, report, 0, required},   {"report error code", 0x01, 0x01, report, 0, required},   {"report drive configuration",0x00, 0x00, report, 0, required},   {"report rom version", 0x00, 0x00, report, 0, required},   {"logical forward", 0x37, 0x25, motion, 0, required},   {"physical reverse", 0x17, 0x05, motion, 0, required},   {"physical forward", 0x17, 0x05, motion, 0, required},   {"seek head to track", 0x37, 0x25, motion, 0, required},   {"seek load point", 0x17, 0x05, motion, 1, required},   {"enter format mode", 0x1f, 0x05, mode, 0, required},   {"write reference burst", 0x1f, 0x05, motion, 1, required},   {"enter verify mode", 0x37, 0x25, mode, 0, required},   {"stop tape", 0x00, 0x00, motion, 1, required},   {"reserved (19)", 0x00, 0x00, unused, 0, discretional},   {"reserved (20)", 0x00, 0x00, unused, 0, discretional},   {"micro step head up", 0x02, 0x00, motion, 0, required},   {"micro step head down", 0x02, 0x00, motion, 0, required},   {"soft select", 0x00, 0x00, mode, 0, discretional},   {"soft deselect", 0x00, 0x00, mode, 0, discretional},   {"skip segments reverse", 0x36, 0x24, motion, 1, required},   {"skip segments forward", 0x36, 0x24, motion, 1, required},   {"select rate or format", 0x03, 0x01, mode, 0, required  },   {"enter diag mode 1", 0x00, 0x00, mode, 0, discretional},   {"enter diag mode 2", 0x00, 0x00, mode, 0, discretional},   {"enter primary mode", 0x00, 0x00, mode, 0, required},   {"vendor unique (31)", 0x00, 0x00, unused, 0, discretional},   {"report vendor id", 0x00, 0x00, report, 0, required},   {"report tape status", 0x04, 0x04, report, 0, ccs1},   {"skip extended reverse", 0x36, 0x24, motion, 1, ccs1},   {"skip extended forward", 0x36, 0x24, motion, 1, ccs1},   {"calibrate tape length", 0x17, 0x05, motion, 1, ccs2},   {"report format segments", 0x17, 0x05, report, 0, ccs2},   {"set format segments", 0x17, 0x05, mode, 0, ccs2},   {"reserved (39)", 0x00, 0x00, unused, 0, discretional},   {"vendor unique (40)", 0x00, 0x00, unused, 0, discretional},   {"vendor unique (41)", 0x00, 0x00, unused, 0, discretional},   {"vendor unique (42)", 0x00, 0x00, unused, 0, discretional},   {"vendor unique (43)", 0x00, 0x00, unused, 0, discretional},   {"vendor unique (44)", 0x00, 0x00, unused, 0, discretional},   {"vendor unique (45)", 0x00, 0x00, unused, 0, discretional},   {"phantom select", 0x00, 0x00, mode, 0, discretional},   {"phantom deselect", 0x00, 0x00, mode, 0, discretional}, }
+
+#define QIC_STATUS_READY 0x01  
+#define QIC_STATUS_ERROR 0x02  
+#define QIC_STATUS_CARTRIDGE_PRESENT 0x04  
+#define QIC_STATUS_WRITE_PROTECT 0x08  
+#define QIC_STATUS_NEW_CARTRIDGE 0x10  
+#define QIC_STATUS_REFERENCED 0x20  
+#define QIC_STATUS_AT_BOT 0x40  
+#define QIC_STATUS_AT_EOT 0x80  
+
+#define QIC_CONFIG_RATE_MASK 0x18
+#define QIC_CONFIG_RATE_SHIFT 3
+#define QIC_CONFIG_RATE_250 0
+#define QIC_CONFIG_RATE_500 2
+#define QIC_CONFIG_RATE_1000 3
+#define QIC_CONFIG_RATE_2000 1
+#define QIC_CONFIG_RATE_4000 0  
+
+#define QIC_CONFIG_LONG 0x40  
+#define QIC_CONFIG_80 0x80  
+
+#define QIC_TAPE_STD_MASK 0x0f
+#define QIC_TAPE_QIC40 0x01
+#define QIC_TAPE_QIC80 0x02
+#define QIC_TAPE_QIC3020 0x03
+#define QIC_TAPE_QIC3010 0x04
+
+#define QIC_TAPE_LEN_MASK 0x70
+#define QIC_TAPE_205FT 0x10
+#define QIC_TAPE_307FT 0x20
+#define QIC_TAPE_VARIABLE 0x30
+#define QIC_TAPE_1100FT 0x40
+#define QIC_TAPE_FLEX 0x60
+
+#define QIC_TAPE_WIDE 0x80
+
+#define QIC_TOP_TAPE_LEN 1500
+
+typedef struct {
+ char *message;
+ unsigned int fatal:1;
+} ftape_error;
+
+#define QIC117_ERRORS {    { "No error", 0, },    { "Command Received while Drive Not Ready", 0, },    { "Cartridge Not Present or Removed", 1, },    { "Motor Speed Error (not within 1%)", 1, },    { "Motor Speed Fault (jammed, or gross speed error", 1, },    { "Cartridge Write Protected", 1, },    { "Undefined or Reserved Command Code", 1, },    { "Illegal Track Address Specified for Seek", 1, },    { "Illegal Command in Report Subcontext", 0, },    { "Illegal Entry into a Diagnostic Mode", 1, },    { "Broken Tape Detected (based on hole sensor)", 1, },    { "Warning--Read Gain Setting Error", 1, },    { "Command Received While Error Status Pending (obs)", 1, },    { "Command Received While New Cartridge Pending", 1, },    { "Command Illegal or Undefined in Primary Mode", 1, },    { "Command Illegal or Undefined in Format Mode", 1, },    { "Command Illegal or Undefined in Verify Mode", 1, },    { "Logical Forward Not at Logical BOT or no Format Segments in Format Mode", 1, },    { "Logical EOT Before All Segments generated", 1, },    { "Command Illegal When Cartridge Not Referenced", 1, },    { "Self-Diagnostic Failed (cannot be cleared)", 1, },    { "Warning EEPROM Not Initialized, Defaults Set", 1, },    { "EEPROM Corrupted or Hardware Failure", 1, },    { "Motion Time-out Error", 1, },    { "Data Segment Too Long -- Logical Forward or Pause", 1, },    { "Transmit Overrun (obs)", 1, },    { "Power On Reset Occurred", 0, },    { "Software Reset Occurred", 0, },    { "Diagnostic Mode 1 Error", 1, },    { "Diagnostic Mode 2 Error", 1, },    { "Command Received During Non-Interruptible Process", 1, },    { "Rate or Format Selection Error", 1, },    { "Illegal Command While in High Speed Mode", 1, },    { "Illegal Seek Segment Value", 1, },    { "Invalid Media", 1, },    { "Head Positioning Failure", 1, },    { "Write Reference Burst Failure", 1, },    { "Prom Code Missing", 1, },    { "Invalid Format", 1, },    { "EOT/BOT System Failure", 1, },    { "Prom A Checksum Error", 1, },    { "Drive Wakeup Reset Occurred", 1, },    { "Prom B Checksum Error", 1, },    { "Illegal Entry into Format Mode", 1, }, }
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/qnxtypes.h b/ndk/platforms/android-3/include/linux/qnxtypes.h
new file mode 100644
index 0000000..53cd20c
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/qnxtypes.h
@@ -0,0 +1,29 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _QNX4TYPES_H
+#define _QNX4TYPES_H
+
+typedef __le16 qnx4_nxtnt_t;
+typedef __u8 qnx4_ftype_t;
+
+typedef struct {
+ __le32 xtnt_blk;
+ __le32 xtnt_size;
+} qnx4_xtnt_t;
+
+typedef __le16 qnx4_mode_t;
+typedef __le16 qnx4_muid_t;
+typedef __le16 qnx4_mgid_t;
+typedef __le32 qnx4_off_t;
+typedef __le16 qnx4_nlink_t;
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/quota.h b/ndk/platforms/android-3/include/linux/quota.h
new file mode 100644
index 0000000..054af5a
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/quota.h
@@ -0,0 +1,87 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_QUOTA_
+#define _LINUX_QUOTA_
+
+#include <linux/errno.h>
+#include <linux/types.h>
+
+#define __DQUOT_VERSION__ "dquot_6.5.1"
+#define __DQUOT_NUM_VERSION__ 6*10000+5*100+1
+
+typedef __kernel_uid32_t qid_t;
+typedef __u64 qsize_t;
+
+#define QUOTABLOCK_BITS 10
+#define QUOTABLOCK_SIZE (1 << QUOTABLOCK_BITS)
+
+#define qb2kb(x) ((x) << (QUOTABLOCK_BITS-10))
+#define kb2qb(x) ((x) >> (QUOTABLOCK_BITS-10))
+#define toqb(x) (((x) + QUOTABLOCK_SIZE - 1) >> QUOTABLOCK_BITS)
+
+#define MAXQUOTAS 2
+#define USRQUOTA 0  
+#define GRPQUOTA 1  
+
+#define INITQFNAMES {   "user",     "group",     "undefined",  };
+
+#define SUBCMDMASK 0x00ff
+#define SUBCMDSHIFT 8
+#define QCMD(cmd, type) (((cmd) << SUBCMDSHIFT) | ((type) & SUBCMDMASK))
+
+#define Q_SYNC 0x800001  
+#define Q_QUOTAON 0x800002  
+#define Q_QUOTAOFF 0x800003  
+#define Q_GETFMT 0x800004  
+#define Q_GETINFO 0x800005  
+#define Q_SETINFO 0x800006  
+#define Q_GETQUOTA 0x800007  
+#define Q_SETQUOTA 0x800008  
+
+#define QIF_BLIMITS 1
+#define QIF_SPACE 2
+#define QIF_ILIMITS 4
+#define QIF_INODES 8
+#define QIF_BTIME 16
+#define QIF_ITIME 32
+#define QIF_LIMITS (QIF_BLIMITS | QIF_ILIMITS)
+#define QIF_USAGE (QIF_SPACE | QIF_INODES)
+#define QIF_TIMES (QIF_BTIME | QIF_ITIME)
+#define QIF_ALL (QIF_LIMITS | QIF_USAGE | QIF_TIMES)
+
+struct if_dqblk {
+ __u64 dqb_bhardlimit;
+ __u64 dqb_bsoftlimit;
+ __u64 dqb_curspace;
+ __u64 dqb_ihardlimit;
+ __u64 dqb_isoftlimit;
+ __u64 dqb_curinodes;
+ __u64 dqb_btime;
+ __u64 dqb_itime;
+ __u32 dqb_valid;
+};
+
+#define IIF_BGRACE 1
+#define IIF_IGRACE 2
+#define IIF_FLAGS 4
+#define IIF_ALL (IIF_BGRACE | IIF_IGRACE | IIF_FLAGS)
+
+struct if_dqinfo {
+ __u64 dqi_bgrace;
+ __u64 dqi_igrace;
+ __u32 dqi_flags;
+ __u32 dqi_valid;
+};
+
+#include <sys/cdefs.h>
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/raid/md.h b/ndk/platforms/android-3/include/linux/raid/md.h
new file mode 100644
index 0000000..d609c06
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/raid/md.h
@@ -0,0 +1,49 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _MD_H
+#define _MD_H
+
+#include <linux/blkdev.h>
+#include <asm/semaphore.h>
+#include <linux/major.h>
+#include <linux/ioctl.h>
+#include <linux/types.h>
+#include <linux/bitops.h>
+#include <linux/module.h>
+#include <linux/hdreg.h>
+#include <linux/proc_fs.h>
+#include <linux/seq_file.h>
+#include <linux/smp_lock.h>
+#include <linux/delay.h>
+#include <net/checksum.h>
+#include <linux/random.h>
+#include <linux/kernel_stat.h>
+#include <asm/io.h>
+#include <linux/completion.h>
+#include <linux/mempool.h>
+#include <linux/list.h>
+#include <linux/reboot.h>
+#include <linux/vmalloc.h>
+#include <linux/blkpg.h>
+#include <linux/bio.h>
+
+#include <linux/raid/md_p.h>
+#include <linux/raid/md_u.h>
+#include <linux/raid/md_k.h>
+
+#define MD_MAJOR_VERSION 0
+#define MD_MINOR_VERSION 90
+
+#define MD_PATCHLEVEL_VERSION 3
+
+#endif
+
diff --git a/ndk/platforms/android-3/include/linux/raid/md_k.h b/ndk/platforms/android-3/include/linux/raid/md_k.h
new file mode 100644
index 0000000..c8b858c
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/raid/md_k.h
@@ -0,0 +1,184 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _MD_K_H
+#define _MD_K_H
+
+#include "../../../drivers/md/dm-bio-list.h"
+
+#define LEVEL_MULTIPATH (-4)
+#define LEVEL_LINEAR (-1)
+#define LEVEL_FAULTY (-5)
+
+#define LEVEL_NONE (-1000000)
+
+#define MaxSector (~(sector_t)0)
+#define MD_THREAD_NAME_MAX 14
+
+typedef struct mddev_s mddev_t;
+typedef struct mdk_rdev_s mdk_rdev_t;
+
+#define MAX_MD_DEVS 256  
+
+#define MAX_CHUNK_SIZE (1<<30)
+
+struct mdk_rdev_s
+{
+ struct list_head same_set;
+
+ sector_t size;
+ mddev_t *mddev;
+ unsigned long last_events;
+
+ struct block_device *bdev;
+
+ struct page *sb_page;
+ int sb_loaded;
+ __u64 sb_events;
+ sector_t data_offset;
+ sector_t sb_offset;
+ int sb_size;
+ int preferred_minor;
+
+ struct kobject kobj;
+
+ unsigned long flags;
+#define Faulty 1  
+#define In_sync 2  
+#define WriteMostly 4  
+#define BarriersNotsupp 5  
+
+ int desc_nr;
+ int raid_disk;
+ int saved_raid_disk;
+ sector_t recovery_offset;
+
+ atomic_t nr_pending;
+ atomic_t read_errors;
+ atomic_t corrected_errors;
+};
+
+struct mddev_s
+{
+ void *private;
+ struct mdk_personality *pers;
+ dev_t unit;
+ int md_minor;
+ struct list_head disks;
+ int sb_dirty;
+ int ro;
+
+ struct gendisk *gendisk;
+
+ struct kobject kobj;
+
+ int major_version,
+ minor_version,
+ patch_version;
+ int persistent;
+ int chunk_size;
+ time_t ctime, utime;
+ int level, layout;
+ char clevel[16];
+ int raid_disks;
+ int max_disks;
+ sector_t size;
+ sector_t array_size;
+ __u64 events;
+
+ char uuid[16];
+
+ sector_t reshape_position;
+ int delta_disks, new_level, new_layout, new_chunk;
+
+ struct mdk_thread_s *thread;
+ struct mdk_thread_s *sync_thread;
+ sector_t curr_resync;
+ unsigned long resync_mark;
+ sector_t resync_mark_cnt;
+ sector_t curr_mark_cnt;
+
+ sector_t resync_max_sectors;
+
+ sector_t resync_mismatches;
+
+ sector_t suspend_lo;
+ sector_t suspend_hi;
+
+ int sync_speed_min;
+ int sync_speed_max;
+
+ int ok_start_degraded;
+
+#define MD_RECOVERY_RUNNING 0
+#define MD_RECOVERY_SYNC 1
+#define MD_RECOVERY_ERR 2
+#define MD_RECOVERY_INTR 3
+#define MD_RECOVERY_DONE 4
+#define MD_RECOVERY_NEEDED 5
+#define MD_RECOVERY_REQUESTED 6
+#define MD_RECOVERY_CHECK 7
+#define MD_RECOVERY_RESHAPE 8
+#define MD_RECOVERY_FROZEN 9
+
+ unsigned long recovery;
+
+ int in_sync;
+ struct mutex reconfig_mutex;
+ atomic_t active;
+
+ int changed;
+ int degraded;
+ int barriers_work;
+ struct bio *biolist;
+
+ atomic_t recovery_active;
+ wait_queue_head_t recovery_wait;
+ sector_t recovery_cp;
+
+ spinlock_t write_lock;
+ wait_queue_head_t sb_wait;
+ atomic_t pending_writes;
+
+ unsigned int safemode;
+ unsigned int safemode_delay;
+ struct timer_list safemode_timer;
+ atomic_t writes_pending;
+ request_queue_t *queue;
+
+ atomic_t write_behind;
+ unsigned int max_write_behind;
+
+ struct bitmap *bitmap;
+ struct file *bitmap_file;
+ long bitmap_offset;
+ long default_bitmap_offset;
+
+ struct list_head all_mddevs;
+};
+
+struct md_sysfs_entry {
+ struct attribute attr;
+ ssize_t (*show)(mddev_t *, char *);
+ ssize_t (*store)(mddev_t *, const char *, size_t);
+};
+
+#define ITERATE_RDEV_GENERIC(head,rdev,tmp)     for ((tmp) = (head).next;   (rdev) = (list_entry((tmp), mdk_rdev_t, same_set)),   (tmp) = (tmp)->next, (tmp)->prev != &(head)   ; )
+#define ITERATE_RDEV(mddev,rdev,tmp)   ITERATE_RDEV_GENERIC((mddev)->disks,rdev,tmp)
+#define ITERATE_RDEV_PENDING(rdev,tmp)   ITERATE_RDEV_GENERIC(pending_raid_disks,rdev,tmp)
+
+#define THREAD_WAKEUP 0
+
+#define __wait_event_lock_irq(wq, condition, lock, cmd)  do {   wait_queue_t __wait;   init_waitqueue_entry(&__wait, current);     add_wait_queue(&wq, &__wait);   for (;;) {   set_current_state(TASK_UNINTERRUPTIBLE);   if (condition)   break;   spin_unlock_irq(&lock);   cmd;   schedule();   spin_lock_irq(&lock);   }   current->state = TASK_RUNNING;   remove_wait_queue(&wq, &__wait);  } while (0)
+
+#define wait_event_lock_irq(wq, condition, lock, cmd)  do {   if (condition)   break;   __wait_event_lock_irq(wq, condition, lock, cmd);  } while (0)
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/raid/md_p.h b/ndk/platforms/android-3/include/linux/raid/md_p.h
new file mode 100644
index 0000000..ab856a7
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/raid/md_p.h
@@ -0,0 +1,135 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _MD_P_H
+#define _MD_P_H
+
+#define MD_RESERVED_BYTES (64 * 1024)
+#define MD_RESERVED_SECTORS (MD_RESERVED_BYTES / 512)
+#define MD_RESERVED_BLOCKS (MD_RESERVED_BYTES / BLOCK_SIZE)
+
+#define MD_NEW_SIZE_SECTORS(x) ((x & ~(MD_RESERVED_SECTORS - 1)) - MD_RESERVED_SECTORS)
+#define MD_NEW_SIZE_BLOCKS(x) ((x & ~(MD_RESERVED_BLOCKS - 1)) - MD_RESERVED_BLOCKS)
+
+#define MD_SB_BYTES 4096
+#define MD_SB_WORDS (MD_SB_BYTES / 4)
+#define MD_SB_BLOCKS (MD_SB_BYTES / BLOCK_SIZE)
+#define MD_SB_SECTORS (MD_SB_BYTES / 512)
+
+#define MD_SB_GENERIC_OFFSET 0
+#define MD_SB_PERSONALITY_OFFSET 64
+#define MD_SB_DISKS_OFFSET 128
+#define MD_SB_DESCRIPTOR_OFFSET 992
+
+#define MD_SB_GENERIC_CONSTANT_WORDS 32
+#define MD_SB_GENERIC_STATE_WORDS 32
+#define MD_SB_GENERIC_WORDS (MD_SB_GENERIC_CONSTANT_WORDS + MD_SB_GENERIC_STATE_WORDS)
+#define MD_SB_PERSONALITY_WORDS 64
+#define MD_SB_DESCRIPTOR_WORDS 32
+#define MD_SB_DISKS 27
+#define MD_SB_DISKS_WORDS (MD_SB_DISKS*MD_SB_DESCRIPTOR_WORDS)
+#define MD_SB_RESERVED_WORDS (1024 - MD_SB_GENERIC_WORDS - MD_SB_PERSONALITY_WORDS - MD_SB_DISKS_WORDS - MD_SB_DESCRIPTOR_WORDS)
+#define MD_SB_EQUAL_WORDS (MD_SB_GENERIC_WORDS + MD_SB_PERSONALITY_WORDS + MD_SB_DISKS_WORDS)
+
+#define MD_DISK_FAULTY 0  
+#define MD_DISK_ACTIVE 1  
+#define MD_DISK_SYNC 2  
+#define MD_DISK_REMOVED 3  
+
+#define MD_DISK_WRITEMOSTLY 9  
+
+typedef struct mdp_device_descriptor_s {
+ __u32 number;
+ __u32 major;
+ __u32 minor;
+ __u32 raid_disk;
+ __u32 state;
+ __u32 reserved[MD_SB_DESCRIPTOR_WORDS - 5];
+} mdp_disk_t;
+
+#define MD_SB_MAGIC 0xa92b4efc
+
+#define MD_SB_CLEAN 0
+#define MD_SB_ERRORS 1
+
+#define MD_SB_BITMAP_PRESENT 8  
+
+typedef struct mdp_superblock_s {
+
+ __u32 md_magic;
+ __u32 major_version;
+ __u32 minor_version;
+ __u32 patch_version;
+ __u32 gvalid_words;
+ __u32 set_uuid0;
+ __u32 ctime;
+ __u32 level;
+ __u32 size;
+ __u32 nr_disks;
+ __u32 raid_disks;
+ __u32 md_minor;
+ __u32 not_persistent;
+ __u32 set_uuid1;
+ __u32 set_uuid2;
+ __u32 set_uuid3;
+ __u32 gstate_creserved[MD_SB_GENERIC_CONSTANT_WORDS - 16];
+
+ __u32 utime;
+ __u32 state;
+ __u32 active_disks;
+ __u32 working_disks;
+ __u32 failed_disks;
+ __u32 spare_disks;
+ __u32 sb_csum;
+#ifdef __BIG_ENDIAN
+ __u32 events_hi;
+ __u32 events_lo;
+ __u32 cp_events_hi;
+ __u32 cp_events_lo;
+#else
+ __u32 events_lo;
+ __u32 events_hi;
+ __u32 cp_events_lo;
+ __u32 cp_events_hi;
+#endif
+ __u32 recovery_cp;
+
+ __u64 reshape_position;
+ __u32 new_level;
+ __u32 delta_disks;
+ __u32 new_layout;
+ __u32 new_chunk;
+ __u32 gstate_sreserved[MD_SB_GENERIC_STATE_WORDS - 18];
+
+ __u32 layout;
+ __u32 chunk_size;
+ __u32 root_pv;
+ __u32 root_block;
+ __u32 pstate_reserved[MD_SB_PERSONALITY_WORDS - 4];
+
+ mdp_disk_t disks[MD_SB_DISKS];
+
+ __u32 reserved[MD_SB_RESERVED_WORDS];
+
+ mdp_disk_t this_disk;
+
+} mdp_super_t;
+
+#define WriteMostly1 1  
+
+#define MD_FEATURE_BITMAP_OFFSET 1
+#define MD_FEATURE_RECOVERY_OFFSET 2  
+#define MD_FEATURE_RESHAPE_ACTIVE 4
+
+#define MD_FEATURE_ALL (1|2|4)
+
+#endif
+
diff --git a/ndk/platforms/android-3/include/linux/raid/md_u.h b/ndk/platforms/android-3/include/linux/raid/md_u.h
new file mode 100644
index 0000000..3671187
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/raid/md_u.h
@@ -0,0 +1,104 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _MD_U_H
+#define _MD_U_H
+
+#define RAID_VERSION _IOR (MD_MAJOR, 0x10, mdu_version_t)
+#define GET_ARRAY_INFO _IOR (MD_MAJOR, 0x11, mdu_array_info_t)
+#define GET_DISK_INFO _IOR (MD_MAJOR, 0x12, mdu_disk_info_t)
+#define PRINT_RAID_DEBUG _IO (MD_MAJOR, 0x13)
+#define RAID_AUTORUN _IO (MD_MAJOR, 0x14)
+#define GET_BITMAP_FILE _IOR (MD_MAJOR, 0x15, mdu_bitmap_file_t)
+
+#define CLEAR_ARRAY _IO (MD_MAJOR, 0x20)
+#define ADD_NEW_DISK _IOW (MD_MAJOR, 0x21, mdu_disk_info_t)
+#define HOT_REMOVE_DISK _IO (MD_MAJOR, 0x22)
+#define SET_ARRAY_INFO _IOW (MD_MAJOR, 0x23, mdu_array_info_t)
+#define SET_DISK_INFO _IO (MD_MAJOR, 0x24)
+#define WRITE_RAID_INFO _IO (MD_MAJOR, 0x25)
+#define UNPROTECT_ARRAY _IO (MD_MAJOR, 0x26)
+#define PROTECT_ARRAY _IO (MD_MAJOR, 0x27)
+#define HOT_ADD_DISK _IO (MD_MAJOR, 0x28)
+#define SET_DISK_FAULTY _IO (MD_MAJOR, 0x29)
+#define HOT_GENERATE_ERROR _IO (MD_MAJOR, 0x2a)
+#define SET_BITMAP_FILE _IOW (MD_MAJOR, 0x2b, int)
+
+#define RUN_ARRAY _IOW (MD_MAJOR, 0x30, mdu_param_t)
+#define START_ARRAY _IO (MD_MAJOR, 0x31)
+#define STOP_ARRAY _IO (MD_MAJOR, 0x32)
+#define STOP_ARRAY_RO _IO (MD_MAJOR, 0x33)
+#define RESTART_ARRAY_RW _IO (MD_MAJOR, 0x34)
+
+typedef struct mdu_version_s {
+ int major;
+ int minor;
+ int patchlevel;
+} mdu_version_t;
+
+typedef struct mdu_array_info_s {
+
+ int major_version;
+ int minor_version;
+ int patch_version;
+ int ctime;
+ int level;
+ int size;
+ int nr_disks;
+ int raid_disks;
+ int md_minor;
+ int not_persistent;
+
+ int utime;
+ int state;
+ int active_disks;
+ int working_disks;
+ int failed_disks;
+ int spare_disks;
+
+ int layout;
+ int chunk_size;
+
+} mdu_array_info_t;
+
+typedef struct mdu_disk_info_s {
+
+ int number;
+ int major;
+ int minor;
+ int raid_disk;
+ int state;
+
+} mdu_disk_info_t;
+
+typedef struct mdu_start_info_s {
+
+ int major;
+ int minor;
+ int raid_disk;
+ int state;
+
+} mdu_start_info_t;
+
+typedef struct mdu_bitmap_file_s
+{
+ char pathname[4096];
+} mdu_bitmap_file_t;
+
+typedef struct mdu_param_s
+{
+ int personality;
+ int chunk_size;
+ int max_fault;
+} mdu_param_t;
+
+#endif
+
diff --git a/ndk/platforms/android-3/include/linux/raid/xor.h b/ndk/platforms/android-3/include/linux/raid/xor.h
new file mode 100644
index 0000000..01e9f45
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/raid/xor.h
@@ -0,0 +1,32 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _XOR_H
+#define _XOR_H
+
+#include <linux/raid/md.h>
+
+#define MAX_XOR_BLOCKS 5
+
+struct xor_block_template {
+ struct xor_block_template *next;
+ const char *name;
+ int speed;
+ void (*do_2)(unsigned long, unsigned long *, unsigned long *);
+ void (*do_3)(unsigned long, unsigned long *, unsigned long *,
+ unsigned long *);
+ void (*do_4)(unsigned long, unsigned long *, unsigned long *,
+ unsigned long *, unsigned long *);
+ void (*do_5)(unsigned long, unsigned long *, unsigned long *,
+ unsigned long *, unsigned long *, unsigned long *);
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/random.h b/ndk/platforms/android-3/include/linux/random.h
new file mode 100644
index 0000000..d2bef97
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/random.h
@@ -0,0 +1,35 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_RANDOM_H
+#define _LINUX_RANDOM_H
+
+#include <linux/ioctl.h>
+
+#define RNDGETENTCNT _IOR( 'R', 0x00, int )
+
+#define RNDADDTOENTCNT _IOW( 'R', 0x01, int )
+
+#define RNDGETPOOL _IOR( 'R', 0x02, int [2] )
+
+#define RNDADDENTROPY _IOW( 'R', 0x03, int [2] )
+
+#define RNDZAPENTCNT _IO( 'R', 0x04 )
+
+#define RNDCLEARPOOL _IO( 'R', 0x06 )
+
+struct rand_pool_info {
+ int entropy_count;
+ int buf_size;
+ __u32 buf[0];
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/rbtree.h b/ndk/platforms/android-3/include/linux/rbtree.h
new file mode 100644
index 0000000..714ffe9
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/rbtree.h
@@ -0,0 +1,45 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_RBTREE_H
+#define _LINUX_RBTREE_H
+
+#include <linux/kernel.h>
+#include <linux/stddef.h>
+
+struct rb_node
+{
+ unsigned long rb_parent_color;
+#define RB_RED 0
+#define RB_BLACK 1
+ struct rb_node *rb_right;
+ struct rb_node *rb_left;
+} __attribute__((aligned(sizeof(long))));
+
+struct rb_root
+{
+ struct rb_node *rb_node;
+};
+
+#define rb_parent(r) ((struct rb_node *)((r)->rb_parent_color & ~3))
+#define rb_color(r) ((r)->rb_parent_color & 1)
+#define rb_is_red(r) (!rb_color(r))
+#define rb_is_black(r) rb_color(r)
+#define rb_set_red(r) do { (r)->rb_parent_color &= ~1; } while (0)
+#define rb_set_black(r) do { (r)->rb_parent_color |= 1; } while (0)
+
+#define RB_ROOT (struct rb_root) { NULL, }
+#define rb_entry(ptr, type, member) container_of(ptr, type, member)
+#define RB_EMPTY_ROOT(root) ((root)->rb_node == NULL)
+#define RB_EMPTY_NODE(node) (rb_parent(node) != node)
+#define RB_CLEAR_NODE(node) (rb_set_parent(node, node))
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/rcupdate.h b/ndk/platforms/android-3/include/linux/rcupdate.h
new file mode 100644
index 0000000..5547a4d
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/rcupdate.h
@@ -0,0 +1,15 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __LINUX_RCUPDATE_H
+#define __LINUX_RCUPDATE_H
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/reboot.h b/ndk/platforms/android-3/include/linux/reboot.h
new file mode 100644
index 0000000..e10ff14
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/reboot.h
@@ -0,0 +1,30 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_REBOOT_H
+#define _LINUX_REBOOT_H
+
+#define LINUX_REBOOT_MAGIC1 0xfee1dead
+#define LINUX_REBOOT_MAGIC2 672274793
+#define LINUX_REBOOT_MAGIC2A 85072278
+#define LINUX_REBOOT_MAGIC2B 369367448
+#define LINUX_REBOOT_MAGIC2C 537993216
+
+#define LINUX_REBOOT_CMD_RESTART 0x01234567
+#define LINUX_REBOOT_CMD_HALT 0xCDEF0123
+#define LINUX_REBOOT_CMD_CAD_ON 0x89ABCDEF
+#define LINUX_REBOOT_CMD_CAD_OFF 0x00000000
+#define LINUX_REBOOT_CMD_POWER_OFF 0x4321FEDC
+#define LINUX_REBOOT_CMD_RESTART2 0xA1B2C3D4
+#define LINUX_REBOOT_CMD_SW_SUSPEND 0xD000FCE2
+#define LINUX_REBOOT_CMD_KEXEC 0x45584543
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/relay.h b/ndk/platforms/android-3/include/linux/relay.h
new file mode 100644
index 0000000..09f7219
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/relay.h
@@ -0,0 +1,91 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_RELAY_H
+#define _LINUX_RELAY_H
+
+#include <linux/types.h>
+#include <linux/sched.h>
+#include <linux/wait.h>
+#include <linux/list.h>
+#include <linux/fs.h>
+#include <linux/poll.h>
+#include <linux/kref.h>
+
+#define FIX_SIZE(x) ((((x) - 1) & PAGE_MASK) + PAGE_SIZE)
+
+#define RELAYFS_CHANNEL_VERSION 6
+
+struct rchan_buf
+{
+ void *start;
+ void *data;
+ size_t offset;
+ size_t subbufs_produced;
+ size_t subbufs_consumed;
+ struct rchan *chan;
+ wait_queue_head_t read_wait;
+ struct work_struct wake_readers;
+ struct dentry *dentry;
+ struct kref kref;
+ struct page **page_array;
+ unsigned int page_count;
+ unsigned int finalized;
+ size_t *padding;
+ size_t prev_padding;
+ size_t bytes_consumed;
+ unsigned int cpu;
+} ____cacheline_aligned;
+
+struct rchan
+{
+ u32 version;
+ size_t subbuf_size;
+ size_t n_subbufs;
+ size_t alloc_size;
+ struct rchan_callbacks *cb;
+ struct kref kref;
+ void *private_data;
+ size_t last_toobig;
+ struct rchan_buf *buf[NR_CPUS];
+};
+
+struct rchan_callbacks
+{
+
+ int (*subbuf_start) (struct rchan_buf *buf,
+ void *subbuf,
+ void *prev_subbuf,
+ size_t prev_padding);
+
+ void (*buf_mapped)(struct rchan_buf *buf,
+ struct file *filp);
+
+ void (*buf_unmapped)(struct rchan_buf *buf,
+ struct file *filp);
+
+ struct dentry *(*create_buf_file)(const char *filename,
+ struct dentry *parent,
+ int mode,
+ struct rchan_buf *buf,
+ int *is_global);
+
+ int (*remove_buf_file)(struct dentry *dentry);
+};
+
+struct rchan *relay_open(const char *base_filename,
+ struct dentry *parent,
+ size_t subbuf_size,
+ size_t n_subbufs,
+ struct rchan_callbacks *cb);
+
+#endif
+
diff --git a/ndk/platforms/android-3/include/linux/resource.h b/ndk/platforms/android-3/include/linux/resource.h
new file mode 100644
index 0000000..347b524
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/resource.h
@@ -0,0 +1,60 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_RESOURCE_H
+#define _LINUX_RESOURCE_H
+
+#include <linux/time.h>
+
+struct task_struct;
+
+#define RUSAGE_SELF 0
+#define RUSAGE_CHILDREN (-1)
+#define RUSAGE_BOTH (-2)  
+
+struct rusage {
+ struct timeval ru_utime;
+ struct timeval ru_stime;
+ long ru_maxrss;
+ long ru_ixrss;
+ long ru_idrss;
+ long ru_isrss;
+ long ru_minflt;
+ long ru_majflt;
+ long ru_nswap;
+ long ru_inblock;
+ long ru_oublock;
+ long ru_msgsnd;
+ long ru_msgrcv;
+ long ru_nsignals;
+ long ru_nvcsw;
+ long ru_nivcsw;
+};
+
+struct rlimit {
+ unsigned long rlim_cur;
+ unsigned long rlim_max;
+};
+
+#define PRIO_MIN (-20)
+#define PRIO_MAX 20
+
+#define PRIO_PROCESS 0
+#define PRIO_PGRP 1
+#define PRIO_USER 2
+
+#define _STK_LIM (8*1024*1024)
+
+#define MLOCK_LIMIT (8 * PAGE_SIZE)
+
+#include <asm/resource.h>
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/route.h b/ndk/platforms/android-3/include/linux/route.h
new file mode 100644
index 0000000..cdb8744
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/route.h
@@ -0,0 +1,49 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_ROUTE_H
+#define _LINUX_ROUTE_H
+
+#include <linux/if.h>
+#include <linux/compiler.h>
+
+struct rtentry
+{
+ unsigned long rt_pad1;
+ struct sockaddr rt_dst;
+ struct sockaddr rt_gateway;
+ struct sockaddr rt_genmask;
+ unsigned short rt_flags;
+ short rt_pad2;
+ unsigned long rt_pad3;
+ void *rt_pad4;
+ short rt_metric;
+ char __user *rt_dev;
+ unsigned long rt_mtu;
+#define rt_mss rt_mtu  
+ unsigned long rt_window;
+ unsigned short rt_irtt;
+};
+
+#define RTF_UP 0x0001  
+#define RTF_GATEWAY 0x0002  
+#define RTF_HOST 0x0004  
+#define RTF_REINSTATE 0x0008  
+#define RTF_DYNAMIC 0x0010  
+#define RTF_MODIFIED 0x0020  
+#define RTF_MTU 0x0040  
+#define RTF_MSS RTF_MTU  
+#define RTF_WINDOW 0x0080  
+#define RTF_IRTT 0x0100  
+#define RTF_REJECT 0x0200  
+
+#endif
+
diff --git a/ndk/platforms/android-3/include/linux/rtc.h b/ndk/platforms/android-3/include/linux/rtc.h
new file mode 100644
index 0000000..b51bc71
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/rtc.h
@@ -0,0 +1,72 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_RTC_H_
+#define _LINUX_RTC_H_
+
+struct rtc_time {
+ int tm_sec;
+ int tm_min;
+ int tm_hour;
+ int tm_mday;
+ int tm_mon;
+ int tm_year;
+ int tm_wday;
+ int tm_yday;
+ int tm_isdst;
+};
+
+struct rtc_wkalrm {
+ unsigned char enabled;
+ unsigned char pending;
+ struct rtc_time time;
+};
+
+struct rtc_pll_info {
+ int pll_ctrl;
+ int pll_value;
+ int pll_max;
+ int pll_min;
+ int pll_posmult;
+ int pll_negmult;
+ long pll_clock;
+};
+
+#define RTC_AIE_ON _IO('p', 0x01)  
+#define RTC_AIE_OFF _IO('p', 0x02)  
+#define RTC_UIE_ON _IO('p', 0x03)  
+#define RTC_UIE_OFF _IO('p', 0x04)  
+#define RTC_PIE_ON _IO('p', 0x05)  
+#define RTC_PIE_OFF _IO('p', 0x06)  
+#define RTC_WIE_ON _IO('p', 0x0f)  
+#define RTC_WIE_OFF _IO('p', 0x10)  
+
+#define RTC_ALM_SET _IOW('p', 0x07, struct rtc_time)  
+#define RTC_ALM_READ _IOR('p', 0x08, struct rtc_time)  
+#define RTC_RD_TIME _IOR('p', 0x09, struct rtc_time)  
+#define RTC_SET_TIME _IOW('p', 0x0a, struct rtc_time)  
+#define RTC_IRQP_READ _IOR('p', 0x0b, unsigned long)  
+#define RTC_IRQP_SET _IOW('p', 0x0c, unsigned long)  
+#define RTC_EPOCH_READ _IOR('p', 0x0d, unsigned long)  
+#define RTC_EPOCH_SET _IOW('p', 0x0e, unsigned long)  
+
+#define RTC_WKALM_SET _IOW('p', 0x0f, struct rtc_wkalrm) 
+#define RTC_WKALM_RD _IOR('p', 0x10, struct rtc_wkalrm) 
+
+#define RTC_PLL_GET _IOR('p', 0x11, struct rtc_pll_info)  
+#define RTC_PLL_SET _IOW('p', 0x12, struct rtc_pll_info)  
+
+#define RTC_IRQF 0x80  
+#define RTC_PF 0x40
+#define RTC_AF 0x20
+#define RTC_UF 0x10
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/rtnetlink.h b/ndk/platforms/android-3/include/linux/rtnetlink.h
new file mode 100644
index 0000000..ddcffaa
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/rtnetlink.h
@@ -0,0 +1,723 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __LINUX_RTNETLINK_H
+#define __LINUX_RTNETLINK_H
+
+#include <linux/netlink.h>
+
+enum {
+ RTM_BASE = 16,
+#define RTM_BASE RTM_BASE
+
+ RTM_NEWLINK = 16,
+#define RTM_NEWLINK RTM_NEWLINK
+ RTM_DELLINK,
+#define RTM_DELLINK RTM_DELLINK
+ RTM_GETLINK,
+#define RTM_GETLINK RTM_GETLINK
+ RTM_SETLINK,
+#define RTM_SETLINK RTM_SETLINK
+
+ RTM_NEWADDR = 20,
+#define RTM_NEWADDR RTM_NEWADDR
+ RTM_DELADDR,
+#define RTM_DELADDR RTM_DELADDR
+ RTM_GETADDR,
+#define RTM_GETADDR RTM_GETADDR
+
+ RTM_NEWROUTE = 24,
+#define RTM_NEWROUTE RTM_NEWROUTE
+ RTM_DELROUTE,
+#define RTM_DELROUTE RTM_DELROUTE
+ RTM_GETROUTE,
+#define RTM_GETROUTE RTM_GETROUTE
+
+ RTM_NEWNEIGH = 28,
+#define RTM_NEWNEIGH RTM_NEWNEIGH
+ RTM_DELNEIGH,
+#define RTM_DELNEIGH RTM_DELNEIGH
+ RTM_GETNEIGH,
+#define RTM_GETNEIGH RTM_GETNEIGH
+
+ RTM_NEWRULE = 32,
+#define RTM_NEWRULE RTM_NEWRULE
+ RTM_DELRULE,
+#define RTM_DELRULE RTM_DELRULE
+ RTM_GETRULE,
+#define RTM_GETRULE RTM_GETRULE
+
+ RTM_NEWQDISC = 36,
+#define RTM_NEWQDISC RTM_NEWQDISC
+ RTM_DELQDISC,
+#define RTM_DELQDISC RTM_DELQDISC
+ RTM_GETQDISC,
+#define RTM_GETQDISC RTM_GETQDISC
+
+ RTM_NEWTCLASS = 40,
+#define RTM_NEWTCLASS RTM_NEWTCLASS
+ RTM_DELTCLASS,
+#define RTM_DELTCLASS RTM_DELTCLASS
+ RTM_GETTCLASS,
+#define RTM_GETTCLASS RTM_GETTCLASS
+
+ RTM_NEWTFILTER = 44,
+#define RTM_NEWTFILTER RTM_NEWTFILTER
+ RTM_DELTFILTER,
+#define RTM_DELTFILTER RTM_DELTFILTER
+ RTM_GETTFILTER,
+#define RTM_GETTFILTER RTM_GETTFILTER
+
+ RTM_NEWACTION = 48,
+#define RTM_NEWACTION RTM_NEWACTION
+ RTM_DELACTION,
+#define RTM_DELACTION RTM_DELACTION
+ RTM_GETACTION,
+#define RTM_GETACTION RTM_GETACTION
+
+ RTM_NEWPREFIX = 52,
+#define RTM_NEWPREFIX RTM_NEWPREFIX
+ RTM_GETPREFIX = 54,
+#define RTM_GETPREFIX RTM_GETPREFIX
+
+ RTM_GETMULTICAST = 58,
+#define RTM_GETMULTICAST RTM_GETMULTICAST
+
+ RTM_GETANYCAST = 62,
+#define RTM_GETANYCAST RTM_GETANYCAST
+
+ RTM_NEWNEIGHTBL = 64,
+#define RTM_NEWNEIGHTBL RTM_NEWNEIGHTBL
+ RTM_GETNEIGHTBL = 66,
+#define RTM_GETNEIGHTBL RTM_GETNEIGHTBL
+ RTM_SETNEIGHTBL,
+#define RTM_SETNEIGHTBL RTM_SETNEIGHTBL
+
+ __RTM_MAX,
+#define RTM_MAX (((__RTM_MAX + 3) & ~3) - 1)
+};
+
+#define RTM_NR_MSGTYPES (RTM_MAX + 1 - RTM_BASE)
+#define RTM_NR_FAMILIES (RTM_NR_MSGTYPES >> 2)
+#define RTM_FAM(cmd) (((cmd) - RTM_BASE) >> 2)
+
+struct rtattr
+{
+ unsigned short rta_len;
+ unsigned short rta_type;
+};
+
+#define RTA_ALIGNTO 4
+#define RTA_ALIGN(len) ( ((len)+RTA_ALIGNTO-1) & ~(RTA_ALIGNTO-1) )
+#define RTA_OK(rta,len) ((len) >= (int)sizeof(struct rtattr) &&   (rta)->rta_len >= sizeof(struct rtattr) &&   (rta)->rta_len <= (len))
+#define RTA_NEXT(rta,attrlen) ((attrlen) -= RTA_ALIGN((rta)->rta_len),   (struct rtattr*)(((char*)(rta)) + RTA_ALIGN((rta)->rta_len)))
+#define RTA_LENGTH(len) (RTA_ALIGN(sizeof(struct rtattr)) + (len))
+#define RTA_SPACE(len) RTA_ALIGN(RTA_LENGTH(len))
+#define RTA_DATA(rta) ((void*)(((char*)(rta)) + RTA_LENGTH(0)))
+#define RTA_PAYLOAD(rta) ((int)((rta)->rta_len) - RTA_LENGTH(0))
+
+struct rtmsg
+{
+ unsigned char rtm_family;
+ unsigned char rtm_dst_len;
+ unsigned char rtm_src_len;
+ unsigned char rtm_tos;
+
+ unsigned char rtm_table;
+ unsigned char rtm_protocol;
+ unsigned char rtm_scope;
+ unsigned char rtm_type;
+
+ unsigned rtm_flags;
+};
+
+enum
+{
+ RTN_UNSPEC,
+ RTN_UNICAST,
+ RTN_LOCAL,
+ RTN_BROADCAST,
+ RTN_ANYCAST,
+ RTN_MULTICAST,
+ RTN_BLACKHOLE,
+ RTN_UNREACHABLE,
+ RTN_PROHIBIT,
+ RTN_THROW,
+ RTN_NAT,
+ RTN_XRESOLVE,
+ __RTN_MAX
+};
+
+#define RTN_MAX (__RTN_MAX - 1)
+
+#define RTPROT_UNSPEC 0
+#define RTPROT_REDIRECT 1  
+#define RTPROT_KERNEL 2  
+#define RTPROT_BOOT 3  
+#define RTPROT_STATIC 4  
+
+#define RTPROT_GATED 8  
+#define RTPROT_RA 9  
+#define RTPROT_MRT 10  
+#define RTPROT_ZEBRA 11  
+#define RTPROT_BIRD 12  
+#define RTPROT_DNROUTED 13  
+#define RTPROT_XORP 14  
+#define RTPROT_NTK 15  
+
+enum rt_scope_t
+{
+ RT_SCOPE_UNIVERSE=0,
+
+ RT_SCOPE_SITE=200,
+ RT_SCOPE_LINK=253,
+ RT_SCOPE_HOST=254,
+ RT_SCOPE_NOWHERE=255
+};
+
+#define RTM_F_NOTIFY 0x100  
+#define RTM_F_CLONED 0x200  
+#define RTM_F_EQUALIZE 0x400  
+#define RTM_F_PREFIX 0x800  
+
+enum rt_class_t
+{
+ RT_TABLE_UNSPEC=0,
+
+ RT_TABLE_DEFAULT=253,
+ RT_TABLE_MAIN=254,
+ RT_TABLE_LOCAL=255,
+ __RT_TABLE_MAX
+};
+#define RT_TABLE_MAX (__RT_TABLE_MAX - 1)
+
+enum rtattr_type_t
+{
+ RTA_UNSPEC,
+ RTA_DST,
+ RTA_SRC,
+ RTA_IIF,
+ RTA_OIF,
+ RTA_GATEWAY,
+ RTA_PRIORITY,
+ RTA_PREFSRC,
+ RTA_METRICS,
+ RTA_MULTIPATH,
+ RTA_PROTOINFO,
+ RTA_FLOW,
+ RTA_CACHEINFO,
+ RTA_SESSION,
+ RTA_MP_ALGO,
+ __RTA_MAX
+};
+
+#define RTA_MAX (__RTA_MAX - 1)
+
+#define RTM_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct rtmsg))))
+#define RTM_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct rtmsg))
+
+struct rtnexthop
+{
+ unsigned short rtnh_len;
+ unsigned char rtnh_flags;
+ unsigned char rtnh_hops;
+ int rtnh_ifindex;
+};
+
+#define RTNH_F_DEAD 1  
+#define RTNH_F_PERVASIVE 2  
+#define RTNH_F_ONLINK 4  
+
+#define RTNH_ALIGNTO 4
+#define RTNH_ALIGN(len) ( ((len)+RTNH_ALIGNTO-1) & ~(RTNH_ALIGNTO-1) )
+#define RTNH_OK(rtnh,len) ((rtnh)->rtnh_len >= sizeof(struct rtnexthop) &&   ((int)(rtnh)->rtnh_len) <= (len))
+#define RTNH_NEXT(rtnh) ((struct rtnexthop*)(((char*)(rtnh)) + RTNH_ALIGN((rtnh)->rtnh_len)))
+#define RTNH_LENGTH(len) (RTNH_ALIGN(sizeof(struct rtnexthop)) + (len))
+#define RTNH_SPACE(len) RTNH_ALIGN(RTNH_LENGTH(len))
+#define RTNH_DATA(rtnh) ((struct rtattr*)(((char*)(rtnh)) + RTNH_LENGTH(0)))
+
+struct rta_cacheinfo
+{
+ __u32 rta_clntref;
+ __u32 rta_lastuse;
+ __s32 rta_expires;
+ __u32 rta_error;
+ __u32 rta_used;
+
+#define RTNETLINK_HAVE_PEERINFO 1
+ __u32 rta_id;
+ __u32 rta_ts;
+ __u32 rta_tsage;
+};
+
+enum
+{
+ RTAX_UNSPEC,
+#define RTAX_UNSPEC RTAX_UNSPEC
+ RTAX_LOCK,
+#define RTAX_LOCK RTAX_LOCK
+ RTAX_MTU,
+#define RTAX_MTU RTAX_MTU
+ RTAX_WINDOW,
+#define RTAX_WINDOW RTAX_WINDOW
+ RTAX_RTT,
+#define RTAX_RTT RTAX_RTT
+ RTAX_RTTVAR,
+#define RTAX_RTTVAR RTAX_RTTVAR
+ RTAX_SSTHRESH,
+#define RTAX_SSTHRESH RTAX_SSTHRESH
+ RTAX_CWND,
+#define RTAX_CWND RTAX_CWND
+ RTAX_ADVMSS,
+#define RTAX_ADVMSS RTAX_ADVMSS
+ RTAX_REORDERING,
+#define RTAX_REORDERING RTAX_REORDERING
+ RTAX_HOPLIMIT,
+#define RTAX_HOPLIMIT RTAX_HOPLIMIT
+ RTAX_INITCWND,
+#define RTAX_INITCWND RTAX_INITCWND
+ RTAX_FEATURES,
+#define RTAX_FEATURES RTAX_FEATURES
+ __RTAX_MAX
+};
+
+#define RTAX_MAX (__RTAX_MAX - 1)
+
+#define RTAX_FEATURE_ECN 0x00000001
+#define RTAX_FEATURE_SACK 0x00000002
+#define RTAX_FEATURE_TIMESTAMP 0x00000004
+#define RTAX_FEATURE_ALLFRAG 0x00000008
+
+struct rta_session
+{
+ __u8 proto;
+ __u8 pad1;
+ __u16 pad2;
+
+ union {
+ struct {
+ __u16 sport;
+ __u16 dport;
+ } ports;
+
+ struct {
+ __u8 type;
+ __u8 code;
+ __u16 ident;
+ } icmpt;
+
+ __u32 spi;
+ } u;
+};
+
+struct ifaddrmsg
+{
+ unsigned char ifa_family;
+ unsigned char ifa_prefixlen;
+ unsigned char ifa_flags;
+ unsigned char ifa_scope;
+ int ifa_index;
+};
+
+enum
+{
+ IFA_UNSPEC,
+ IFA_ADDRESS,
+ IFA_LOCAL,
+ IFA_LABEL,
+ IFA_BROADCAST,
+ IFA_ANYCAST,
+ IFA_CACHEINFO,
+ IFA_MULTICAST,
+ __IFA_MAX
+};
+
+#define IFA_MAX (__IFA_MAX - 1)
+
+#define IFA_F_SECONDARY 0x01
+#define IFA_F_TEMPORARY IFA_F_SECONDARY
+
+#define IFA_F_DEPRECATED 0x20
+#define IFA_F_TENTATIVE 0x40
+#define IFA_F_PERMANENT 0x80
+
+struct ifa_cacheinfo
+{
+ __u32 ifa_prefered;
+ __u32 ifa_valid;
+ __u32 cstamp;
+ __u32 tstamp;
+};
+
+#define IFA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifaddrmsg))))
+#define IFA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifaddrmsg))
+
+struct ndmsg
+{
+ unsigned char ndm_family;
+ unsigned char ndm_pad1;
+ unsigned short ndm_pad2;
+ int ndm_ifindex;
+ __u16 ndm_state;
+ __u8 ndm_flags;
+ __u8 ndm_type;
+};
+
+enum
+{
+ NDA_UNSPEC,
+ NDA_DST,
+ NDA_LLADDR,
+ NDA_CACHEINFO,
+ NDA_PROBES,
+ __NDA_MAX
+};
+
+#define NDA_MAX (__NDA_MAX - 1)
+
+#define NDA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ndmsg))))
+#define NDA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ndmsg))
+
+#define NTF_PROXY 0x08  
+#define NTF_ROUTER 0x80
+
+#define NUD_INCOMPLETE 0x01
+#define NUD_REACHABLE 0x02
+#define NUD_STALE 0x04
+#define NUD_DELAY 0x08
+#define NUD_PROBE 0x10
+#define NUD_FAILED 0x20
+
+#define NUD_NOARP 0x40
+#define NUD_PERMANENT 0x80
+#define NUD_NONE 0x00
+
+struct nda_cacheinfo
+{
+ __u32 ndm_confirmed;
+ __u32 ndm_used;
+ __u32 ndm_updated;
+ __u32 ndm_refcnt;
+};
+
+struct ndt_stats
+{
+ __u64 ndts_allocs;
+ __u64 ndts_destroys;
+ __u64 ndts_hash_grows;
+ __u64 ndts_res_failed;
+ __u64 ndts_lookups;
+ __u64 ndts_hits;
+ __u64 ndts_rcv_probes_mcast;
+ __u64 ndts_rcv_probes_ucast;
+ __u64 ndts_periodic_gc_runs;
+ __u64 ndts_forced_gc_runs;
+};
+
+enum {
+ NDTPA_UNSPEC,
+ NDTPA_IFINDEX,
+ NDTPA_REFCNT,
+ NDTPA_REACHABLE_TIME,
+ NDTPA_BASE_REACHABLE_TIME,
+ NDTPA_RETRANS_TIME,
+ NDTPA_GC_STALETIME,
+ NDTPA_DELAY_PROBE_TIME,
+ NDTPA_QUEUE_LEN,
+ NDTPA_APP_PROBES,
+ NDTPA_UCAST_PROBES,
+ NDTPA_MCAST_PROBES,
+ NDTPA_ANYCAST_DELAY,
+ NDTPA_PROXY_DELAY,
+ NDTPA_PROXY_QLEN,
+ NDTPA_LOCKTIME,
+ __NDTPA_MAX
+};
+#define NDTPA_MAX (__NDTPA_MAX - 1)
+
+struct ndtmsg
+{
+ __u8 ndtm_family;
+ __u8 ndtm_pad1;
+ __u16 ndtm_pad2;
+};
+
+struct ndt_config
+{
+ __u16 ndtc_key_len;
+ __u16 ndtc_entry_size;
+ __u32 ndtc_entries;
+ __u32 ndtc_last_flush;
+ __u32 ndtc_last_rand;
+ __u32 ndtc_hash_rnd;
+ __u32 ndtc_hash_mask;
+ __u32 ndtc_hash_chain_gc;
+ __u32 ndtc_proxy_qlen;
+};
+
+enum {
+ NDTA_UNSPEC,
+ NDTA_NAME,
+ NDTA_THRESH1,
+ NDTA_THRESH2,
+ NDTA_THRESH3,
+ NDTA_CONFIG,
+ NDTA_PARMS,
+ NDTA_STATS,
+ NDTA_GC_INTERVAL,
+ __NDTA_MAX
+};
+#define NDTA_MAX (__NDTA_MAX - 1)
+
+#define NDTA_RTA(r) ((struct rtattr*)(((char*)(r)) +   NLMSG_ALIGN(sizeof(struct ndtmsg))))
+#define NDTA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ndtmsg))
+
+struct rtgenmsg
+{
+ unsigned char rtgen_family;
+};
+
+struct ifinfomsg
+{
+ unsigned char ifi_family;
+ unsigned char __ifi_pad;
+ unsigned short ifi_type;
+ int ifi_index;
+ unsigned ifi_flags;
+ unsigned ifi_change;
+};
+
+struct prefixmsg
+{
+ unsigned char prefix_family;
+ unsigned char prefix_pad1;
+ unsigned short prefix_pad2;
+ int prefix_ifindex;
+ unsigned char prefix_type;
+ unsigned char prefix_len;
+ unsigned char prefix_flags;
+ unsigned char prefix_pad3;
+};
+
+enum
+{
+ PREFIX_UNSPEC,
+ PREFIX_ADDRESS,
+ PREFIX_CACHEINFO,
+ __PREFIX_MAX
+};
+
+#define PREFIX_MAX (__PREFIX_MAX - 1)
+
+struct prefix_cacheinfo
+{
+ __u32 preferred_time;
+ __u32 valid_time;
+};
+
+struct rtnl_link_stats
+{
+ __u32 rx_packets;
+ __u32 tx_packets;
+ __u32 rx_bytes;
+ __u32 tx_bytes;
+ __u32 rx_errors;
+ __u32 tx_errors;
+ __u32 rx_dropped;
+ __u32 tx_dropped;
+ __u32 multicast;
+ __u32 collisions;
+
+ __u32 rx_length_errors;
+ __u32 rx_over_errors;
+ __u32 rx_crc_errors;
+ __u32 rx_frame_errors;
+ __u32 rx_fifo_errors;
+ __u32 rx_missed_errors;
+
+ __u32 tx_aborted_errors;
+ __u32 tx_carrier_errors;
+ __u32 tx_fifo_errors;
+ __u32 tx_heartbeat_errors;
+ __u32 tx_window_errors;
+
+ __u32 rx_compressed;
+ __u32 tx_compressed;
+};
+
+struct rtnl_link_ifmap
+{
+ __u64 mem_start;
+ __u64 mem_end;
+ __u64 base_addr;
+ __u16 irq;
+ __u8 dma;
+ __u8 port;
+};
+
+enum
+{
+ IFLA_UNSPEC,
+ IFLA_ADDRESS,
+ IFLA_BROADCAST,
+ IFLA_IFNAME,
+ IFLA_MTU,
+ IFLA_LINK,
+ IFLA_QDISC,
+ IFLA_STATS,
+ IFLA_COST,
+#define IFLA_COST IFLA_COST
+ IFLA_PRIORITY,
+#define IFLA_PRIORITY IFLA_PRIORITY
+ IFLA_MASTER,
+#define IFLA_MASTER IFLA_MASTER
+ IFLA_WIRELESS,
+#define IFLA_WIRELESS IFLA_WIRELESS
+ IFLA_PROTINFO,
+#define IFLA_PROTINFO IFLA_PROTINFO
+ IFLA_TXQLEN,
+#define IFLA_TXQLEN IFLA_TXQLEN
+ IFLA_MAP,
+#define IFLA_MAP IFLA_MAP
+ IFLA_WEIGHT,
+#define IFLA_WEIGHT IFLA_WEIGHT
+ IFLA_OPERSTATE,
+ IFLA_LINKMODE,
+ __IFLA_MAX
+};
+
+#define IFLA_MAX (__IFLA_MAX - 1)
+
+#define IFLA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifinfomsg))))
+#define IFLA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifinfomsg))
+
+enum
+{
+ IFLA_INET6_UNSPEC,
+ IFLA_INET6_FLAGS,
+ IFLA_INET6_CONF,
+ IFLA_INET6_STATS,
+ IFLA_INET6_MCAST,
+ IFLA_INET6_CACHEINFO,
+ __IFLA_INET6_MAX
+};
+
+#define IFLA_INET6_MAX (__IFLA_INET6_MAX - 1)
+
+struct ifla_cacheinfo
+{
+ __u32 max_reasm_len;
+ __u32 tstamp;
+ __u32 reachable_time;
+ __u32 retrans_time;
+};
+
+struct tcmsg
+{
+ unsigned char tcm_family;
+ unsigned char tcm__pad1;
+ unsigned short tcm__pad2;
+ int tcm_ifindex;
+ __u32 tcm_handle;
+ __u32 tcm_parent;
+ __u32 tcm_info;
+};
+
+enum
+{
+ TCA_UNSPEC,
+ TCA_KIND,
+ TCA_OPTIONS,
+ TCA_STATS,
+ TCA_XSTATS,
+ TCA_RATE,
+ TCA_FCNT,
+ TCA_STATS2,
+ __TCA_MAX
+};
+
+#define TCA_MAX (__TCA_MAX - 1)
+
+#define TCA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct tcmsg))))
+#define TCA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct tcmsg))
+
+#define RTMGRP_LINK 1
+#define RTMGRP_NOTIFY 2
+#define RTMGRP_NEIGH 4
+#define RTMGRP_TC 8
+
+#define RTMGRP_IPV4_IFADDR 0x10
+#define RTMGRP_IPV4_MROUTE 0x20
+#define RTMGRP_IPV4_ROUTE 0x40
+#define RTMGRP_IPV4_RULE 0x80
+
+#define RTMGRP_IPV6_IFADDR 0x100
+#define RTMGRP_IPV6_MROUTE 0x200
+#define RTMGRP_IPV6_ROUTE 0x400
+#define RTMGRP_IPV6_IFINFO 0x800
+
+#define RTMGRP_DECnet_IFADDR 0x1000
+#define RTMGRP_DECnet_ROUTE 0x4000
+
+#define RTMGRP_IPV6_PREFIX 0x20000
+
+enum rtnetlink_groups {
+ RTNLGRP_NONE,
+#define RTNLGRP_NONE RTNLGRP_NONE
+ RTNLGRP_LINK,
+#define RTNLGRP_LINK RTNLGRP_LINK
+ RTNLGRP_NOTIFY,
+#define RTNLGRP_NOTIFY RTNLGRP_NOTIFY
+ RTNLGRP_NEIGH,
+#define RTNLGRP_NEIGH RTNLGRP_NEIGH
+ RTNLGRP_TC,
+#define RTNLGRP_TC RTNLGRP_TC
+ RTNLGRP_IPV4_IFADDR,
+#define RTNLGRP_IPV4_IFADDR RTNLGRP_IPV4_IFADDR
+ RTNLGRP_IPV4_MROUTE,
+#define RTNLGRP_IPV4_MROUTE RTNLGRP_IPV4_MROUTE
+ RTNLGRP_IPV4_ROUTE,
+#define RTNLGRP_IPV4_ROUTE RTNLGRP_IPV4_ROUTE
+ RTNLGRP_IPV4_RULE,
+#define RTNLGRP_IPV4_RULE RTNLGRP_IPV4_RULE
+ RTNLGRP_IPV6_IFADDR,
+#define RTNLGRP_IPV6_IFADDR RTNLGRP_IPV6_IFADDR
+ RTNLGRP_IPV6_MROUTE,
+#define RTNLGRP_IPV6_MROUTE RTNLGRP_IPV6_MROUTE
+ RTNLGRP_IPV6_ROUTE,
+#define RTNLGRP_IPV6_ROUTE RTNLGRP_IPV6_ROUTE
+ RTNLGRP_IPV6_IFINFO,
+#define RTNLGRP_IPV6_IFINFO RTNLGRP_IPV6_IFINFO
+ RTNLGRP_DECnet_IFADDR,
+#define RTNLGRP_DECnet_IFADDR RTNLGRP_DECnet_IFADDR
+ RTNLGRP_NOP2,
+ RTNLGRP_DECnet_ROUTE,
+#define RTNLGRP_DECnet_ROUTE RTNLGRP_DECnet_ROUTE
+ RTNLGRP_NOP3,
+ RTNLGRP_NOP4,
+ RTNLGRP_IPV6_PREFIX,
+#define RTNLGRP_IPV6_PREFIX RTNLGRP_IPV6_PREFIX
+ __RTNLGRP_MAX
+};
+#define RTNLGRP_MAX (__RTNLGRP_MAX - 1)
+
+struct tcamsg
+{
+ unsigned char tca_family;
+ unsigned char tca__pad1;
+ unsigned short tca__pad2;
+};
+#define TA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct tcamsg))))
+#define TA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct tcamsg))
+#define TCA_ACT_TAB 1   
+#define TCAA_MAX 1
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/rwsem.h b/ndk/platforms/android-3/include/linux/rwsem.h
new file mode 100644
index 0000000..e64c4c8
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/rwsem.h
@@ -0,0 +1,17 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_RWSEM_H
+#define _LINUX_RWSEM_H
+
+#include <linux/linkage.h>
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/sched.h b/ndk/platforms/android-3/include/linux/sched.h
new file mode 100644
index 0000000..6b781eb
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/sched.h
@@ -0,0 +1,41 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_SCHED_H
+#define _LINUX_SCHED_H
+
+#include <linux/auxvec.h>  
+
+#define CSIGNAL 0x000000ff  
+#define CLONE_VM 0x00000100  
+#define CLONE_FS 0x00000200  
+#define CLONE_FILES 0x00000400  
+#define CLONE_SIGHAND 0x00000800  
+#define CLONE_PTRACE 0x00002000  
+#define CLONE_VFORK 0x00004000  
+#define CLONE_PARENT 0x00008000  
+#define CLONE_THREAD 0x00010000  
+#define CLONE_NEWNS 0x00020000  
+#define CLONE_SYSVSEM 0x00040000  
+#define CLONE_SETTLS 0x00080000  
+#define CLONE_PARENT_SETTID 0x00100000  
+#define CLONE_CHILD_CLEARTID 0x00200000  
+#define CLONE_DETACHED 0x00400000  
+#define CLONE_UNTRACED 0x00800000  
+#define CLONE_CHILD_SETTID 0x01000000  
+#define CLONE_STOPPED 0x02000000  
+
+#define SCHED_NORMAL 0
+#define SCHED_FIFO 1
+#define SCHED_RR 2
+#define SCHED_BATCH 3
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/sem.h b/ndk/platforms/android-3/include/linux/sem.h
new file mode 100644
index 0000000..dfa531b
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/sem.h
@@ -0,0 +1,82 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_SEM_H
+#define _LINUX_SEM_H
+
+#include <linux/ipc.h>
+
+#define SEM_UNDO 0x1000  
+
+#define GETPID 11  
+#define GETVAL 12  
+#define GETALL 13  
+#define GETNCNT 14  
+#define GETZCNT 15  
+#define SETVAL 16  
+#define SETALL 17  
+
+#define SEM_STAT 18
+#define SEM_INFO 19
+
+struct semid_ds {
+ struct ipc_perm sem_perm;
+ __kernel_time_t sem_otime;
+ __kernel_time_t sem_ctime;
+ struct sem *sem_base;
+ struct sem_queue *sem_pending;
+ struct sem_queue **sem_pending_last;
+ struct sem_undo *undo;
+ unsigned short sem_nsems;
+};
+
+#include <asm/sembuf.h>
+
+struct sembuf {
+ unsigned short sem_num;
+ short sem_op;
+ short sem_flg;
+};
+
+union semun {
+ int val;
+ struct semid_ds __user *buf;
+ unsigned short __user *array;
+ struct seminfo __user *__buf;
+ void __user *__pad;
+};
+
+struct seminfo {
+ int semmap;
+ int semmni;
+ int semmns;
+ int semmnu;
+ int semmsl;
+ int semopm;
+ int semume;
+ int semusz;
+ int semvmx;
+ int semaem;
+};
+
+#define SEMMNI 128  
+#define SEMMSL 250  
+#define SEMMNS (SEMMNI*SEMMSL)  
+#define SEMOPM 32  
+#define SEMVMX 32767  
+#define SEMAEM SEMVMX  
+
+#define SEMUME SEMOPM  
+#define SEMMNU SEMMNS  
+#define SEMMAP SEMMNS  
+#define SEMUSZ 20  
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/seq_file.h b/ndk/platforms/android-3/include/linux/seq_file.h
new file mode 100644
index 0000000..81e314d
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/seq_file.h
@@ -0,0 +1,14 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_SEQ_FILE_H
+#define _LINUX_SEQ_FILE_H
+#endif
diff --git a/ndk/platforms/android-3/include/linux/seqlock.h b/ndk/platforms/android-3/include/linux/seqlock.h
new file mode 100644
index 0000000..a1e05d4
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/seqlock.h
@@ -0,0 +1,42 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __LINUX_SEQLOCK_H
+#define __LINUX_SEQLOCK_H
+
+#include <linux/spinlock.h>
+#include <linux/preempt.h>
+
+typedef struct {
+ unsigned sequence;
+ spinlock_t lock;
+} seqlock_t;
+
+#define __SEQLOCK_UNLOCKED(lockname)   { 0, __SPIN_LOCK_UNLOCKED(lockname) }
+
+#define SEQLOCK_UNLOCKED   __SEQLOCK_UNLOCKED(old_style_seqlock_init)
+
+#define seqlock_init(x)   do { *(x) = (seqlock_t) __SEQLOCK_UNLOCKED(x); } while (0)
+
+#define DEFINE_SEQLOCK(x)   seqlock_t x = __SEQLOCK_UNLOCKED(x)
+
+#define SEQCNT_ZERO { 0 }
+#define seqcount_init(x) do { *(x) = (seqcount_t) SEQCNT_ZERO; } while (0)
+
+#define write_seqlock_irqsave(lock, flags)   do { local_irq_save(flags); write_seqlock(lock); } while (0)
+#define write_seqlock_irq(lock)   do { local_irq_disable(); write_seqlock(lock); } while (0)
+#define write_seqlock_bh(lock)   do { local_bh_disable(); write_seqlock(lock); } while (0)
+#define write_sequnlock_irqrestore(lock, flags)   do { write_sequnlock(lock); local_irq_restore(flags); } while(0)
+#define write_sequnlock_irq(lock)   do { write_sequnlock(lock); local_irq_enable(); } while(0)
+#define write_sequnlock_bh(lock)   do { write_sequnlock(lock); local_bh_enable(); } while(0)
+#define read_seqbegin_irqsave(lock, flags)   ({ local_irq_save(flags); read_seqbegin(lock); })
+#define read_seqretry_irqrestore(lock, iv, flags)   ({   int ret = read_seqretry(lock, iv);   local_irq_restore(flags);   ret;   })
+#endif
diff --git a/ndk/platforms/android-3/include/linux/serial_core.h b/ndk/platforms/android-3/include/linux/serial_core.h
new file mode 100644
index 0000000..79f0375
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/serial_core.h
@@ -0,0 +1,95 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef LINUX_SERIAL_CORE_H
+#define LINUX_SERIAL_CORE_H
+
+#define PORT_UNKNOWN 0
+#define PORT_8250 1
+#define PORT_16450 2
+#define PORT_16550 3
+#define PORT_16550A 4
+#define PORT_CIRRUS 5
+#define PORT_16650 6
+#define PORT_16650V2 7
+#define PORT_16750 8
+#define PORT_STARTECH 9
+#define PORT_16C950 10
+#define PORT_16654 11
+#define PORT_16850 12
+#define PORT_RSA 13
+#define PORT_NS16550A 14
+#define PORT_XSCALE 15
+#define PORT_MAX_8250 15  
+
+#define PORT_PXA 31
+#define PORT_AMBA 32
+#define PORT_CLPS711X 33
+#define PORT_SA1100 34
+#define PORT_UART00 35
+#define PORT_21285 37
+
+#define PORT_SUNZILOG 38
+#define PORT_SUNSAB 39
+
+#define PORT_V850E_UART 40
+
+#define PORT_DZ 47
+
+#define PORT_MUX 48
+
+#define PORT_AT91 49
+
+#define PORT_MAC_ZILOG 50  
+#define PORT_PMAC_ZILOG 51
+
+#define PORT_SCI 52
+#define PORT_SCIF 53
+#define PORT_IRDA 54
+
+#define PORT_S3C2410 55
+
+#define PORT_IP22ZILOG 56
+
+#define PORT_LH7A40X 57
+
+#define PORT_CPM 58
+
+#define PORT_MPC52xx 59
+
+#define PORT_ICOM 60
+
+#define PORT_S3C2440 61
+
+#define PORT_IMX 62
+
+#define PORT_MPSC 63
+
+#define PORT_TXX9 64
+
+#define PORT_VR41XX_SIU 65
+#define PORT_VR41XX_DSIU 66
+
+#define PORT_S3C2400 67
+
+#define PORT_M32R_SIO 68
+
+#define PORT_JSM 69
+
+#define PORT_IP3106 70
+
+#define PORT_NETX 71
+
+#define PORT_SUNHV 72
+
+#define PORT_S3C2412 73
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/serial_reg.h b/ndk/platforms/android-3/include/linux/serial_reg.h
new file mode 100644
index 0000000..97b149a
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/serial_reg.h
@@ -0,0 +1,249 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_SERIAL_REG_H
+#define _LINUX_SERIAL_REG_H
+
+#define UART_RX 0  
+#define UART_TX 0  
+
+#define UART_IER 1  
+#define UART_IER_MSI 0x08  
+#define UART_IER_RLSI 0x04  
+#define UART_IER_THRI 0x02  
+#define UART_IER_RDI 0x01  
+
+#define UART_IERX_SLEEP 0x10  
+
+#define UART_IIR 2  
+#define UART_IIR_NO_INT 0x01  
+#define UART_IIR_ID 0x06  
+#define UART_IIR_MSI 0x00  
+#define UART_IIR_THRI 0x02  
+#define UART_IIR_RDI 0x04  
+#define UART_IIR_RLSI 0x06  
+
+#define UART_FCR 2  
+#define UART_FCR_ENABLE_FIFO 0x01  
+#define UART_FCR_CLEAR_RCVR 0x02  
+#define UART_FCR_CLEAR_XMIT 0x04  
+#define UART_FCR_DMA_SELECT 0x08  
+
+#define UART_FCR_R_TRIG_00 0x00
+#define UART_FCR_R_TRIG_01 0x40
+#define UART_FCR_R_TRIG_10 0x80
+#define UART_FCR_R_TRIG_11 0xc0
+#define UART_FCR_T_TRIG_00 0x00
+#define UART_FCR_T_TRIG_01 0x10
+#define UART_FCR_T_TRIG_10 0x20
+#define UART_FCR_T_TRIG_11 0x30
+
+#define UART_FCR_TRIGGER_MASK 0xC0  
+#define UART_FCR_TRIGGER_1 0x00  
+#define UART_FCR_TRIGGER_4 0x40  
+#define UART_FCR_TRIGGER_8 0x80  
+#define UART_FCR_TRIGGER_14 0xC0  
+
+#define UART_FCR6_R_TRIGGER_8 0x00  
+#define UART_FCR6_R_TRIGGER_16 0x40  
+#define UART_FCR6_R_TRIGGER_24 0x80  
+#define UART_FCR6_R_TRIGGER_28 0xC0  
+#define UART_FCR6_T_TRIGGER_16 0x00  
+#define UART_FCR6_T_TRIGGER_8 0x10  
+#define UART_FCR6_T_TRIGGER_24 0x20  
+#define UART_FCR6_T_TRIGGER_30 0x30  
+#define UART_FCR7_64BYTE 0x20  
+
+#define UART_LCR 3  
+
+#define UART_LCR_DLAB 0x80  
+#define UART_LCR_SBC 0x40  
+#define UART_LCR_SPAR 0x20  
+#define UART_LCR_EPAR 0x10  
+#define UART_LCR_PARITY 0x08  
+#define UART_LCR_STOP 0x04  
+#define UART_LCR_WLEN5 0x00  
+#define UART_LCR_WLEN6 0x01  
+#define UART_LCR_WLEN7 0x02  
+#define UART_LCR_WLEN8 0x03  
+
+#define UART_MCR 4  
+#define UART_MCR_CLKSEL 0x80  
+#define UART_MCR_TCRTLR 0x40  
+#define UART_MCR_XONANY 0x20  
+#define UART_MCR_AFE 0x20  
+#define UART_MCR_LOOP 0x10  
+#define UART_MCR_OUT2 0x08  
+#define UART_MCR_OUT1 0x04  
+#define UART_MCR_RTS 0x02  
+#define UART_MCR_DTR 0x01  
+
+#define UART_LSR 5  
+#define UART_LSR_TEMT 0x40  
+#define UART_LSR_THRE 0x20  
+#define UART_LSR_BI 0x10  
+#define UART_LSR_FE 0x08  
+#define UART_LSR_PE 0x04  
+#define UART_LSR_OE 0x02  
+#define UART_LSR_DR 0x01  
+
+#define UART_MSR 6  
+#define UART_MSR_DCD 0x80  
+#define UART_MSR_RI 0x40  
+#define UART_MSR_DSR 0x20  
+#define UART_MSR_CTS 0x10  
+#define UART_MSR_DDCD 0x08  
+#define UART_MSR_TERI 0x04  
+#define UART_MSR_DDSR 0x02  
+#define UART_MSR_DCTS 0x01  
+#define UART_MSR_ANY_DELTA 0x0F  
+
+#define UART_SCR 7  
+
+#define UART_DLL 0  
+#define UART_DLM 1  
+
+#define UART_EFR 2  
+#define UART_EFR_CTS 0x80  
+#define UART_EFR_RTS 0x40  
+#define UART_EFR_SCD 0x20  
+#define UART_EFR_ECB 0x10  
+
+#define UART_XON1 4  
+#define UART_XON2 5  
+#define UART_XOFF1 6  
+#define UART_XOFF2 7  
+
+#define UART_TI752_TCR 6  
+#define UART_TI752_TLR 7  
+
+#define UART_TRG 0  
+
+#define UART_TRG_1 0x01
+#define UART_TRG_4 0x04
+#define UART_TRG_8 0x08
+#define UART_TRG_16 0x10
+#define UART_TRG_32 0x20
+#define UART_TRG_64 0x40
+#define UART_TRG_96 0x60
+#define UART_TRG_120 0x78
+#define UART_TRG_128 0x80
+
+#define UART_FCTR 1  
+#define UART_FCTR_RTS_NODELAY 0x00  
+#define UART_FCTR_RTS_4DELAY 0x01
+#define UART_FCTR_RTS_6DELAY 0x02
+#define UART_FCTR_RTS_8DELAY 0x03
+#define UART_FCTR_IRDA 0x04  
+#define UART_FCTR_TX_INT 0x08  
+#define UART_FCTR_TRGA 0x00  
+#define UART_FCTR_TRGB 0x10  
+#define UART_FCTR_TRGC 0x20  
+#define UART_FCTR_TRGD 0x30  
+#define UART_FCTR_SCR_SWAP 0x40  
+#define UART_FCTR_RX 0x00  
+#define UART_FCTR_TX 0x80  
+
+#define UART_EMSR 7  
+#define UART_EMSR_FIFO_COUNT 0x01  
+#define UART_EMSR_ALT_COUNT 0x02  
+
+#define UART_IER_DMAE 0x80  
+#define UART_IER_UUE 0x40  
+#define UART_IER_NRZE 0x20  
+#define UART_IER_RTOIE 0x10  
+
+#define UART_IIR_TOD 0x08  
+
+#define UART_FCR_PXAR1 0x00  
+#define UART_FCR_PXAR8 0x40  
+#define UART_FCR_PXAR16 0x80  
+#define UART_FCR_PXAR32 0xc0  
+
+#define UART_ASR 0x01  
+#define UART_RFL 0x03  
+#define UART_TFL 0x04  
+#define UART_ICR 0x05  
+
+#define UART_ACR 0x00  
+#define UART_CPR 0x01  
+#define UART_TCR 0x02  
+#define UART_CKS 0x03  
+#define UART_TTL 0x04  
+#define UART_RTL 0x05  
+#define UART_FCL 0x06  
+#define UART_FCH 0x07  
+#define UART_ID1 0x08  
+#define UART_ID2 0x09  
+#define UART_ID3 0x0A  
+#define UART_REV 0x0B  
+#define UART_CSR 0x0C  
+#define UART_NMR 0x0D  
+#define UART_CTR 0xFF
+
+#define UART_ACR_RXDIS 0x01  
+#define UART_ACR_TXDIS 0x02  
+#define UART_ACR_DSRFC 0x04  
+#define UART_ACR_TLENB 0x20  
+#define UART_ACR_ICRRD 0x40  
+#define UART_ACR_ASREN 0x80  
+
+#define UART_RSA_BASE (-8)
+
+#define UART_RSA_MSR ((UART_RSA_BASE) + 0)  
+
+#define UART_RSA_MSR_SWAP (1 << 0)  
+#define UART_RSA_MSR_FIFO (1 << 2)  
+#define UART_RSA_MSR_FLOW (1 << 3)  
+#define UART_RSA_MSR_ITYP (1 << 4)  
+
+#define UART_RSA_IER ((UART_RSA_BASE) + 1)  
+
+#define UART_RSA_IER_Rx_FIFO_H (1 << 0)  
+#define UART_RSA_IER_Tx_FIFO_H (1 << 1)  
+#define UART_RSA_IER_Tx_FIFO_E (1 << 2)  
+#define UART_RSA_IER_Rx_TOUT (1 << 3)  
+#define UART_RSA_IER_TIMER (1 << 4)  
+
+#define UART_RSA_SRR ((UART_RSA_BASE) + 2)  
+
+#define UART_RSA_SRR_Tx_FIFO_NEMP (1 << 0)  
+#define UART_RSA_SRR_Tx_FIFO_NHFL (1 << 1)  
+#define UART_RSA_SRR_Tx_FIFO_NFUL (1 << 2)  
+#define UART_RSA_SRR_Rx_FIFO_NEMP (1 << 3)  
+#define UART_RSA_SRR_Rx_FIFO_NHFL (1 << 4)  
+#define UART_RSA_SRR_Rx_FIFO_NFUL (1 << 5)  
+#define UART_RSA_SRR_Rx_TOUT (1 << 6)  
+#define UART_RSA_SRR_TIMER (1 << 7)  
+
+#define UART_RSA_FRR ((UART_RSA_BASE) + 2)  
+
+#define UART_RSA_TIVSR ((UART_RSA_BASE) + 3)  
+
+#define UART_RSA_TCR ((UART_RSA_BASE) + 4)  
+
+#define UART_RSA_TCR_SWITCH (1 << 0)  
+
+#define SERIAL_RSA_BAUD_BASE (921600)
+#define SERIAL_RSA_BAUD_BASE_LO (SERIAL_RSA_BAUD_BASE / 8)
+
+#define UART_OMAP_MDR1 0x08  
+#define UART_OMAP_MDR2 0x09  
+#define UART_OMAP_SCR 0x10  
+#define UART_OMAP_SSR 0x11  
+#define UART_OMAP_EBLR 0x12  
+#define UART_OMAP_OSC_12M_SEL 0x13  
+#define UART_OMAP_MVER 0x14  
+#define UART_OMAP_SYSC 0x15  
+#define UART_OMAP_SYSS 0x16  
+
+#endif
+
diff --git a/ndk/platforms/android-3/include/linux/serio.h b/ndk/platforms/android-3/include/linux/serio.h
new file mode 100644
index 0000000..7f04987
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/serio.h
@@ -0,0 +1,60 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _SERIO_H
+#define _SERIO_H
+
+#include <linux/ioctl.h>
+
+#define SPIOCSTYPE _IOW('q', 0x01, unsigned long)
+
+#define SERIO_TIMEOUT 1
+#define SERIO_PARITY 2
+#define SERIO_FRAME 4
+
+#define SERIO_XT 0x00
+#define SERIO_8042 0x01
+#define SERIO_RS232 0x02
+#define SERIO_HIL_MLC 0x03
+#define SERIO_PS_PSTHRU 0x05
+#define SERIO_8042_XL 0x06
+
+#define SERIO_UNKNOWN 0x00
+#define SERIO_MSC 0x01
+#define SERIO_SUN 0x02
+#define SERIO_MS 0x03
+#define SERIO_MP 0x04
+#define SERIO_MZ 0x05
+#define SERIO_MZP 0x06
+#define SERIO_MZPP 0x07
+#define SERIO_VSXXXAA 0x08
+#define SERIO_SUNKBD 0x10
+#define SERIO_WARRIOR 0x18
+#define SERIO_SPACEORB 0x19
+#define SERIO_MAGELLAN 0x1a
+#define SERIO_SPACEBALL 0x1b
+#define SERIO_GUNZE 0x1c
+#define SERIO_IFORCE 0x1d
+#define SERIO_STINGER 0x1e
+#define SERIO_NEWTON 0x1f
+#define SERIO_STOWAWAY 0x20
+#define SERIO_H3600 0x21
+#define SERIO_PS2SER 0x22
+#define SERIO_TWIDKBD 0x23
+#define SERIO_TWIDJOY 0x24
+#define SERIO_HIL 0x25
+#define SERIO_SNES232 0x26
+#define SERIO_SEMTECH 0x27
+#define SERIO_LKKBD 0x28
+#define SERIO_ELO 0x29
+#define SERIO_MICROTOUCH 0x30
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/shm.h b/ndk/platforms/android-3/include/linux/shm.h
new file mode 100644
index 0000000..a7056db
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/shm.h
@@ -0,0 +1,74 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_SHM_H_
+#define _LINUX_SHM_H_
+
+#include <linux/ipc.h>
+#include <linux/errno.h>
+#include <asm/page.h>
+
+#define SHMMAX 0x2000000  
+#define SHMMIN 1  
+#define SHMMNI 4096  
+#define SHMALL (SHMMAX/PAGE_SIZE*(SHMMNI/16))  
+#define SHMSEG SHMMNI  
+
+#include <asm/shmparam.h>
+
+struct shmid_ds {
+ struct ipc_perm shm_perm;
+ int shm_segsz;
+ __kernel_time_t shm_atime;
+ __kernel_time_t shm_dtime;
+ __kernel_time_t shm_ctime;
+ __kernel_ipc_pid_t shm_cpid;
+ __kernel_ipc_pid_t shm_lpid;
+ unsigned short shm_nattch;
+ unsigned short shm_unused;
+ void *shm_unused2;
+ void *shm_unused3;
+};
+
+#include <asm/shmbuf.h>
+
+#define SHM_R 0400  
+#define SHM_W 0200  
+
+#define SHM_RDONLY 010000  
+#define SHM_RND 020000  
+#define SHM_REMAP 040000  
+#define SHM_EXEC 0100000  
+
+#define SHM_LOCK 11
+#define SHM_UNLOCK 12
+
+#define SHM_STAT 13
+#define SHM_INFO 14
+
+struct shminfo {
+ int shmmax;
+ int shmmin;
+ int shmmni;
+ int shmseg;
+ int shmall;
+};
+
+struct shm_info {
+ int used_ids;
+ unsigned long shm_tot;
+ unsigned long shm_rss;
+ unsigned long shm_swp;
+ unsigned long swap_attempts;
+ unsigned long swap_successes;
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/signal.h b/ndk/platforms/android-3/include/linux/signal.h
new file mode 100644
index 0000000..4577e54
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/signal.h
@@ -0,0 +1,18 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_SIGNAL_H
+#define _LINUX_SIGNAL_H
+
+#include <asm/signal.h>
+#include <asm/siginfo.h>
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/skbuff.h b/ndk/platforms/android-3/include/linux/skbuff.h
new file mode 100644
index 0000000..82140a6
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/skbuff.h
@@ -0,0 +1,164 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_SKBUFF_H
+#define _LINUX_SKBUFF_H
+
+#include <linux/kernel.h>
+#include <linux/compiler.h>
+#include <linux/time.h>
+#include <linux/cache.h>
+
+#include <asm/atomic.h>
+#include <asm/types.h>
+#include <linux/spinlock.h>
+#include <linux/mm.h>
+#include <linux/highmem.h>
+#include <linux/poll.h>
+#include <linux/net.h>
+#include <linux/textsearch.h>
+#include <net/checksum.h>
+#include <linux/dmaengine.h>
+
+#define HAVE_ALLOC_SKB  
+#define HAVE_ALIGNABLE_SKB  
+
+#define CHECKSUM_NONE 0
+#define CHECKSUM_HW 1
+#define CHECKSUM_UNNECESSARY 2
+
+#define SKB_DATA_ALIGN(X) (((X) + (SMP_CACHE_BYTES - 1)) &   ~(SMP_CACHE_BYTES - 1))
+#define SKB_MAX_ORDER(X, ORDER) (((PAGE_SIZE << (ORDER)) - (X) -   sizeof(struct skb_shared_info)) &   ~(SMP_CACHE_BYTES - 1))
+#define SKB_MAX_HEAD(X) (SKB_MAX_ORDER((X), 0))
+#define SKB_MAX_ALLOC (SKB_MAX_ORDER(0, 2))
+
+struct net_device;
+
+struct sk_buff_head {
+
+ struct sk_buff *next;
+ struct sk_buff *prev;
+
+ __u32 qlen;
+ spinlock_t lock;
+};
+
+struct sk_buff;
+
+#define MAX_SKB_FRAGS (65536/PAGE_SIZE + 2)
+
+typedef struct skb_frag_struct skb_frag_t;
+
+struct skb_frag_struct {
+ struct page *page;
+ __u16 page_offset;
+ __u16 size;
+};
+
+struct skb_shared_info {
+ atomic_t dataref;
+ unsigned short nr_frags;
+ unsigned short gso_size;
+
+ unsigned short gso_segs;
+ unsigned short gso_type;
+ unsigned int ip6_frag_id;
+ struct sk_buff *frag_list;
+ skb_frag_t frags[MAX_SKB_FRAGS];
+};
+
+#define SKB_DATAREF_SHIFT 16
+#define SKB_DATAREF_MASK ((1 << SKB_DATAREF_SHIFT) - 1)
+
+struct skb_timeval {
+ u32 off_sec;
+ u32 off_usec;
+};
+
+enum {
+ SKB_FCLONE_UNAVAILABLE,
+ SKB_FCLONE_ORIG,
+ SKB_FCLONE_CLONE,
+};
+
+enum {
+ SKB_GSO_TCPV4 = 1 << 0,
+ SKB_GSO_UDP = 1 << 1,
+
+ SKB_GSO_DODGY = 1 << 2,
+
+ SKB_GSO_TCP_ECN = 1 << 3,
+
+ SKB_GSO_TCPV6 = 1 << 4,
+};
+
+struct sk_buff {
+
+ struct sk_buff *next;
+ struct sk_buff *prev;
+
+ struct sock *sk;
+ struct skb_timeval tstamp;
+ struct net_device *dev;
+ struct net_device *input_dev;
+
+ union {
+ struct tcphdr *th;
+ struct udphdr *uh;
+ struct icmphdr *icmph;
+ struct igmphdr *igmph;
+ struct iphdr *ipiph;
+ struct ipv6hdr *ipv6h;
+ unsigned char *raw;
+ } h;
+
+ union {
+ struct iphdr *iph;
+ struct ipv6hdr *ipv6h;
+ struct arphdr *arph;
+ unsigned char *raw;
+ } nh;
+
+ union {
+ unsigned char *raw;
+ } mac;
+
+ struct dst_entry *dst;
+ struct sec_path *sp;
+
+ char cb[48];
+
+ unsigned int len,
+ data_len,
+ mac_len,
+ csum;
+ __u32 priority;
+ __u8 local_df:1,
+ cloned:1,
+ ip_summed:2,
+ nohdr:1,
+ nfctinfo:3;
+ __u8 pkt_type:3,
+ fclone:2,
+ ipvs_property:1;
+ __be16 protocol;
+
+ void (*destructor)(struct sk_buff *skb);
+
+ unsigned int truesize;
+ atomic_t users;
+ unsigned char *head,
+ *data,
+ *tail,
+ *end;
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/slab.h b/ndk/platforms/android-3/include/linux/slab.h
new file mode 100644
index 0000000..f165a93
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/slab.h
@@ -0,0 +1,15 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_SLAB_H
+#define _LINUX_SLAB_H
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/smb.h b/ndk/platforms/android-3/include/linux/smb.h
new file mode 100644
index 0000000..72c8967
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/smb.h
@@ -0,0 +1,61 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_SMB_H
+#define _LINUX_SMB_H
+
+#include <linux/types.h>
+
+enum smb_protocol {
+ SMB_PROTOCOL_NONE,
+ SMB_PROTOCOL_CORE,
+ SMB_PROTOCOL_COREPLUS,
+ SMB_PROTOCOL_LANMAN1,
+ SMB_PROTOCOL_LANMAN2,
+ SMB_PROTOCOL_NT1
+};
+
+enum smb_case_hndl {
+ SMB_CASE_DEFAULT,
+ SMB_CASE_LOWER,
+ SMB_CASE_UPPER
+};
+
+struct smb_dskattr {
+ __u16 total;
+ __u16 allocblocks;
+ __u16 blocksize;
+ __u16 free;
+};
+
+struct smb_conn_opt {
+
+ unsigned int fd;
+
+ enum smb_protocol protocol;
+ enum smb_case_hndl case_handling;
+
+ __u32 max_xmit;
+ __u16 server_uid;
+ __u16 tid;
+
+ __u16 secmode;
+ __u16 maxmux;
+ __u16 maxvcs;
+ __u16 rawmode;
+ __u32 sesskey;
+
+ __u32 maxraw;
+ __u32 capabilities;
+ __s16 serverzone;
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/smp.h b/ndk/platforms/android-3/include/linux/smp.h
new file mode 100644
index 0000000..ab4982d
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/smp.h
@@ -0,0 +1,26 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __LINUX_SMP_H
+#define __LINUX_SMP_H
+
+#define raw_smp_processor_id() 0
+#define hard_smp_processor_id() 0
+#define smp_call_function(func,info,retry,wait) (up_smp_call_function())
+#define on_each_cpu(func,info,retry,wait)   ({   local_irq_disable();   func(info);   local_irq_enable();   0;   })
+#define num_booting_cpus() 1
+#define smp_prepare_boot_cpu() do {} while (0)
+#define smp_processor_id() raw_smp_processor_id()
+#define get_cpu() ({ preempt_disable(); smp_processor_id(); })
+#define put_cpu() preempt_enable()
+#define put_cpu_no_resched() preempt_enable_no_resched()
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/smp_lock.h b/ndk/platforms/android-3/include/linux/smp_lock.h
new file mode 100644
index 0000000..523a970
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/smp_lock.h
@@ -0,0 +1,21 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __LINUX_SMPLOCK_H
+#define __LINUX_SMPLOCK_H
+
+#define lock_kernel() do { } while(0)
+#define unlock_kernel() do { } while(0)
+#define release_kernel_lock(task) do { } while(0)
+#define reacquire_kernel_lock(task) 0
+#define kernel_locked() 1
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/socket.h b/ndk/platforms/android-3/include/linux/socket.h
new file mode 100644
index 0000000..b578df9
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/socket.h
@@ -0,0 +1,227 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_SOCKET_H
+#define _LINUX_SOCKET_H
+
+#define _K_SS_MAXSIZE 128  
+#define _K_SS_ALIGNSIZE (__alignof__ (struct sockaddr *))
+
+struct __kernel_sockaddr_storage {
+ unsigned short ss_family;
+
+ char __data[_K_SS_MAXSIZE - sizeof(unsigned short)];
+
+} __attribute__ ((aligned(_K_SS_ALIGNSIZE)));
+
+#if !defined(__GLIBC__) || __GLIBC__ < 2
+
+#include <asm/socket.h>  
+#include <linux/sockios.h>  
+#include <linux/uio.h>  
+#include <linux/types.h>  
+#include <linux/compiler.h>  
+
+typedef unsigned short sa_family_t;
+
+struct sockaddr {
+ sa_family_t sa_family;
+ char sa_data[14];
+};
+
+struct linger {
+ int l_onoff;
+ int l_linger;
+};
+
+#define sockaddr_storage __kernel_sockaddr_storage
+
+struct msghdr {
+ void * msg_name;
+ int msg_namelen;
+ struct iovec * msg_iov;
+ __kernel_size_t msg_iovlen;
+ void * msg_control;
+ __kernel_size_t msg_controllen;
+ unsigned msg_flags;
+};
+
+struct cmsghdr {
+ __kernel_size_t cmsg_len;
+ int cmsg_level;
+ int cmsg_type;
+};
+
+#define __CMSG_NXTHDR(ctl, len, cmsg) __cmsg_nxthdr((ctl),(len),(cmsg))
+#define CMSG_NXTHDR(mhdr, cmsg) cmsg_nxthdr((mhdr), (cmsg))
+
+#define CMSG_ALIGN(len) ( ((len)+sizeof(long)-1) & ~(sizeof(long)-1) )
+
+#define CMSG_DATA(cmsg) ((void *)((char *)(cmsg) + CMSG_ALIGN(sizeof(struct cmsghdr))))
+#define CMSG_SPACE(len) (CMSG_ALIGN(sizeof(struct cmsghdr)) + CMSG_ALIGN(len))
+#define CMSG_LEN(len) (CMSG_ALIGN(sizeof(struct cmsghdr)) + (len))
+
+#define __CMSG_FIRSTHDR(ctl,len) ((len) >= sizeof(struct cmsghdr) ?   (struct cmsghdr *)(ctl) :   (struct cmsghdr *)NULL)
+#define CMSG_FIRSTHDR(msg) __CMSG_FIRSTHDR((msg)->msg_control, (msg)->msg_controllen)
+#define CMSG_OK(mhdr, cmsg) ((cmsg)->cmsg_len >= sizeof(struct cmsghdr) &&   (cmsg)->cmsg_len <= (unsigned long)   ((mhdr)->msg_controllen -   ((char *)(cmsg) - (char *)(mhdr)->msg_control)))
+
+#ifdef __GNUC__
+#define __KINLINE static __inline__
+#elif defined(__cplusplus)
+#define __KINLINE static inline
+#else
+#define __KINLINE static
+#endif
+
+__KINLINE struct cmsghdr * __cmsg_nxthdr(void *__ctl, __kernel_size_t __size,
+ struct cmsghdr *__cmsg)
+{
+ struct cmsghdr * __ptr;
+
+ __ptr = (struct cmsghdr*)(((unsigned char *) __cmsg) + CMSG_ALIGN(__cmsg->cmsg_len));
+ if ((unsigned long)((char*)(__ptr+1) - (char *) __ctl) > __size)
+ return (struct cmsghdr *)0;
+
+ return __ptr;
+}
+
+__KINLINE struct cmsghdr * cmsg_nxthdr (struct msghdr *__msg, struct cmsghdr *__cmsg)
+{
+ return __cmsg_nxthdr(__msg->msg_control, __msg->msg_controllen, __cmsg);
+}
+
+#define SCM_RIGHTS 0x01  
+#define SCM_CREDENTIALS 0x02  
+#define SCM_SECURITY 0x03  
+
+struct ucred {
+ __u32 pid;
+ __u32 uid;
+ __u32 gid;
+};
+
+#define AF_UNSPEC 0
+#define AF_UNIX 1  
+#define AF_LOCAL 1  
+#define AF_INET 2  
+#define AF_AX25 3  
+#define AF_IPX 4  
+#define AF_APPLETALK 5  
+#define AF_NETROM 6  
+#define AF_BRIDGE 7  
+#define AF_ATMPVC 8  
+#define AF_X25 9  
+#define AF_INET6 10  
+#define AF_ROSE 11  
+#define AF_DECnet 12  
+#define AF_NETBEUI 13  
+#define AF_SECURITY 14  
+#define AF_KEY 15  
+#define AF_NETLINK 16
+#define AF_ROUTE AF_NETLINK  
+#define AF_PACKET 17  
+#define AF_ASH 18  
+#define AF_ECONET 19  
+#define AF_ATMSVC 20  
+#define AF_SNA 22  
+#define AF_IRDA 23  
+#define AF_PPPOX 24  
+#define AF_WANPIPE 25  
+#define AF_LLC 26  
+#define AF_TIPC 30  
+#define AF_BLUETOOTH 31  
+#define AF_MAX 32  
+
+#define PF_UNSPEC AF_UNSPEC
+#define PF_UNIX AF_UNIX
+#define PF_LOCAL AF_LOCAL
+#define PF_INET AF_INET
+#define PF_AX25 AF_AX25
+#define PF_IPX AF_IPX
+#define PF_APPLETALK AF_APPLETALK
+#define PF_NETROM AF_NETROM
+#define PF_BRIDGE AF_BRIDGE
+#define PF_ATMPVC AF_ATMPVC
+#define PF_X25 AF_X25
+#define PF_INET6 AF_INET6
+#define PF_ROSE AF_ROSE
+#define PF_DECnet AF_DECnet
+#define PF_NETBEUI AF_NETBEUI
+#define PF_SECURITY AF_SECURITY
+#define PF_KEY AF_KEY
+#define PF_NETLINK AF_NETLINK
+#define PF_ROUTE AF_ROUTE
+#define PF_PACKET AF_PACKET
+#define PF_ASH AF_ASH
+#define PF_ECONET AF_ECONET
+#define PF_ATMSVC AF_ATMSVC
+#define PF_SNA AF_SNA
+#define PF_IRDA AF_IRDA
+#define PF_PPPOX AF_PPPOX
+#define PF_WANPIPE AF_WANPIPE
+#define PF_LLC AF_LLC
+#define PF_TIPC AF_TIPC
+#define PF_BLUETOOTH AF_BLUETOOTH
+#define PF_MAX AF_MAX
+
+#define SOMAXCONN 128
+
+#define MSG_OOB 1
+#define MSG_PEEK 2
+#define MSG_DONTROUTE 4
+#define MSG_TRYHARD 4  
+#define MSG_CTRUNC 8
+#define MSG_PROBE 0x10  
+#define MSG_TRUNC 0x20
+#define MSG_DONTWAIT 0x40  
+#define MSG_EOR 0x80  
+#define MSG_WAITALL 0x100  
+#define MSG_FIN 0x200
+#define MSG_SYN 0x400
+#define MSG_CONFIRM 0x800  
+#define MSG_RST 0x1000
+#define MSG_ERRQUEUE 0x2000  
+#define MSG_NOSIGNAL 0x4000  
+#define MSG_MORE 0x8000  
+
+#define MSG_EOF MSG_FIN
+
+#define MSG_CMSG_COMPAT 0  
+
+#define SOL_IP 0
+
+#define SOL_TCP 6
+#define SOL_UDP 17
+#define SOL_IPV6 41
+#define SOL_ICMPV6 58
+#define SOL_SCTP 132
+#define SOL_RAW 255
+#define SOL_IPX 256
+#define SOL_AX25 257
+#define SOL_ATALK 258
+#define SOL_NETROM 259
+#define SOL_ROSE 260
+#define SOL_DECNET 261
+#define SOL_X25 262
+#define SOL_PACKET 263
+#define SOL_ATM 264  
+#define SOL_AAL 265  
+#define SOL_IRDA 266
+#define SOL_NETBEUI 267
+#define SOL_LLC 268
+#define SOL_DCCP 269
+#define SOL_NETLINK 270
+#define SOL_TIPC 271
+
+#define IPX_TYPE 1
+
+#endif
+#endif
diff --git a/ndk/platforms/android-3/include/linux/sockios.h b/ndk/platforms/android-3/include/linux/sockios.h
new file mode 100644
index 0000000..d111359
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/sockios.h
@@ -0,0 +1,107 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_SOCKIOS_H
+#define _LINUX_SOCKIOS_H
+
+#include <asm/sockios.h>
+
+#define SIOCINQ FIONREAD
+#define SIOCOUTQ TIOCOUTQ
+
+#define SIOCADDRT 0x890B  
+#define SIOCDELRT 0x890C  
+#define SIOCRTMSG 0x890D  
+
+#define SIOCGIFNAME 0x8910  
+#define SIOCSIFLINK 0x8911  
+#define SIOCGIFCONF 0x8912  
+#define SIOCGIFFLAGS 0x8913  
+#define SIOCSIFFLAGS 0x8914  
+#define SIOCGIFADDR 0x8915  
+#define SIOCSIFADDR 0x8916  
+#define SIOCGIFDSTADDR 0x8917  
+#define SIOCSIFDSTADDR 0x8918  
+#define SIOCGIFBRDADDR 0x8919  
+#define SIOCSIFBRDADDR 0x891a  
+#define SIOCGIFNETMASK 0x891b  
+#define SIOCSIFNETMASK 0x891c  
+#define SIOCGIFMETRIC 0x891d  
+#define SIOCSIFMETRIC 0x891e  
+#define SIOCGIFMEM 0x891f  
+#define SIOCSIFMEM 0x8920  
+#define SIOCGIFMTU 0x8921  
+#define SIOCSIFMTU 0x8922  
+#define SIOCSIFNAME 0x8923  
+#define SIOCSIFHWADDR 0x8924  
+#define SIOCGIFENCAP 0x8925  
+#define SIOCSIFENCAP 0x8926 
+#define SIOCGIFHWADDR 0x8927  
+#define SIOCGIFSLAVE 0x8929  
+#define SIOCSIFSLAVE 0x8930
+#define SIOCADDMULTI 0x8931  
+#define SIOCDELMULTI 0x8932
+#define SIOCGIFINDEX 0x8933  
+#define SIOGIFINDEX SIOCGIFINDEX  
+#define SIOCSIFPFLAGS 0x8934  
+#define SIOCGIFPFLAGS 0x8935
+#define SIOCDIFADDR 0x8936  
+#define SIOCSIFHWBROADCAST 0x8937  
+#define SIOCGIFCOUNT 0x8938  
+#define SIOCKILLADDR 0x8939  
+
+#define SIOCGIFBR 0x8940  
+#define SIOCSIFBR 0x8941  
+
+#define SIOCGIFTXQLEN 0x8942  
+#define SIOCSIFTXQLEN 0x8943  
+
+#define SIOCETHTOOL 0x8946  
+
+#define SIOCGMIIPHY 0x8947  
+#define SIOCGMIIREG 0x8948  
+#define SIOCSMIIREG 0x8949  
+
+#define SIOCWANDEV 0x894A  
+
+#define SIOCDARP 0x8953  
+#define SIOCGARP 0x8954  
+#define SIOCSARP 0x8955  
+
+#define SIOCDRARP 0x8960  
+#define SIOCGRARP 0x8961  
+#define SIOCSRARP 0x8962  
+
+#define SIOCGIFMAP 0x8970  
+#define SIOCSIFMAP 0x8971  
+
+#define SIOCADDDLCI 0x8980  
+#define SIOCDELDLCI 0x8981  
+
+#define SIOCGIFVLAN 0x8982  
+#define SIOCSIFVLAN 0x8983  
+
+#define SIOCBONDENSLAVE 0x8990  
+#define SIOCBONDRELEASE 0x8991  
+#define SIOCBONDSETHWADDR 0x8992  
+#define SIOCBONDSLAVEINFOQUERY 0x8993  
+#define SIOCBONDINFOQUERY 0x8994  
+#define SIOCBONDCHANGEACTIVE 0x8995  
+
+#define SIOCBRADDBR 0x89a0  
+#define SIOCBRDELBR 0x89a1  
+#define SIOCBRADDIF 0x89a2  
+#define SIOCBRDELIF 0x89a3  
+
+#define SIOCDEVPRIVATE 0x89F0  
+
+#define SIOCPROTOPRIVATE 0x89E0  
+#endif
diff --git a/ndk/platforms/android-3/include/linux/soundcard.h b/ndk/platforms/android-3/include/linux/soundcard.h
new file mode 100644
index 0000000..8c69c28
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/soundcard.h
@@ -0,0 +1,831 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef SOUNDCARD_H
+#define SOUNDCARD_H
+
+#define SOUND_VERSION 0x030802
+#define OPEN_SOUND_SYSTEM
+
+#include <linux/ioctl.h>
+
+#include <endian.h>
+
+#define SNDCARD_ADLIB 1
+#define SNDCARD_SB 2
+#define SNDCARD_PAS 3
+#define SNDCARD_GUS 4
+#define SNDCARD_MPU401 5
+#define SNDCARD_SB16 6
+#define SNDCARD_SB16MIDI 7
+#define SNDCARD_UART6850 8
+#define SNDCARD_GUS16 9
+#define SNDCARD_MSS 10
+#define SNDCARD_PSS 11
+#define SNDCARD_SSCAPE 12
+#define SNDCARD_PSS_MPU 13
+#define SNDCARD_PSS_MSS 14
+#define SNDCARD_SSCAPE_MSS 15
+#define SNDCARD_TRXPRO 16
+#define SNDCARD_TRXPRO_SB 17
+#define SNDCARD_TRXPRO_MPU 18
+#define SNDCARD_MAD16 19
+#define SNDCARD_MAD16_MPU 20
+#define SNDCARD_CS4232 21
+#define SNDCARD_CS4232_MPU 22
+#define SNDCARD_MAUI 23
+#define SNDCARD_PSEUDO_MSS 24
+#define SNDCARD_GUSPNP 25
+#define SNDCARD_UART401 26
+
+#ifndef _SIOWR
+#if defined(_IOWR) && (defined(_AIX) || !defined(sun) && !defined(sparc) && !defined(__sparc__) && !defined(__INCioctlh) && !defined(__Lynx__))
+
+#define SIOCPARM_MASK IOCPARM_MASK
+#define SIOC_VOID IOC_VOID
+#define SIOC_OUT IOC_OUT
+#define SIOC_IN IOC_IN
+#define SIOC_INOUT IOC_INOUT
+#define _SIOC_SIZE _IOC_SIZE
+#define _SIOC_DIR _IOC_DIR
+#define _SIOC_NONE _IOC_NONE
+#define _SIOC_READ _IOC_READ
+#define _SIOC_WRITE _IOC_WRITE
+#define _SIO _IO
+#define _SIOR _IOR
+#define _SIOW _IOW
+#define _SIOWR _IOWR
+#else
+
+#define SIOCPARM_MASK 0x1fff  
+#define SIOC_VOID 0x00000000  
+#define SIOC_OUT 0x20000000  
+#define SIOC_IN 0x40000000  
+#define SIOC_INOUT (SIOC_IN|SIOC_OUT)
+
+#define _SIO(x,y) ((int)(SIOC_VOID|(x<<8)|y))
+#define _SIOR(x,y,t) ((int)(SIOC_OUT|((sizeof(t)&SIOCPARM_MASK)<<16)|(x<<8)|y))
+#define _SIOW(x,y,t) ((int)(SIOC_IN|((sizeof(t)&SIOCPARM_MASK)<<16)|(x<<8)|y))
+
+#define _SIOWR(x,y,t) ((int)(SIOC_INOUT|((sizeof(t)&SIOCPARM_MASK)<<16)|(x<<8)|y))
+#define _SIOC_SIZE(x) ((x>>16)&SIOCPARM_MASK) 
+#define _SIOC_DIR(x) (x & 0xf0000000)
+#define _SIOC_NONE SIOC_VOID
+#define _SIOC_READ SIOC_OUT
+#define _SIOC_WRITE SIOC_IN
+#endif
+#endif
+
+#define SNDCTL_SEQ_RESET _SIO ('Q', 0)
+#define SNDCTL_SEQ_SYNC _SIO ('Q', 1)
+#define SNDCTL_SYNTH_INFO _SIOWR('Q', 2, struct synth_info)
+#define SNDCTL_SEQ_CTRLRATE _SIOWR('Q', 3, int)  
+#define SNDCTL_SEQ_GETOUTCOUNT _SIOR ('Q', 4, int)
+#define SNDCTL_SEQ_GETINCOUNT _SIOR ('Q', 5, int)
+#define SNDCTL_SEQ_PERCMODE _SIOW ('Q', 6, int)
+#define SNDCTL_FM_LOAD_INSTR _SIOW ('Q', 7, struct sbi_instrument)  
+#define SNDCTL_SEQ_TESTMIDI _SIOW ('Q', 8, int)
+#define SNDCTL_SEQ_RESETSAMPLES _SIOW ('Q', 9, int)
+#define SNDCTL_SEQ_NRSYNTHS _SIOR ('Q',10, int)
+#define SNDCTL_SEQ_NRMIDIS _SIOR ('Q',11, int)
+#define SNDCTL_MIDI_INFO _SIOWR('Q',12, struct midi_info)
+#define SNDCTL_SEQ_THRESHOLD _SIOW ('Q',13, int)
+#define SNDCTL_SYNTH_MEMAVL _SIOWR('Q',14, int)  
+#define SNDCTL_FM_4OP_ENABLE _SIOW ('Q',15, int)  
+#define SNDCTL_SEQ_PANIC _SIO ('Q',17)
+#define SNDCTL_SEQ_OUTOFBAND _SIOW ('Q',18, struct seq_event_rec)
+#define SNDCTL_SEQ_GETTIME _SIOR ('Q',19, int)
+#define SNDCTL_SYNTH_ID _SIOWR('Q',20, struct synth_info)
+#define SNDCTL_SYNTH_CONTROL _SIOWR('Q',21, struct synth_control)
+#define SNDCTL_SYNTH_REMOVESAMPLE _SIOWR('Q',22, struct remove_sample)
+
+typedef struct synth_control
+{
+ int devno;
+ char data[4000];
+}synth_control;
+
+typedef struct remove_sample
+{
+ int devno;
+ int bankno;
+ int instrno;
+} remove_sample;
+
+typedef struct seq_event_rec {
+ unsigned char arr[8];
+} seq_event_rec;
+
+#define SNDCTL_TMR_TIMEBASE _SIOWR('T', 1, int)
+#define SNDCTL_TMR_START _SIO ('T', 2)
+#define SNDCTL_TMR_STOP _SIO ('T', 3)
+#define SNDCTL_TMR_CONTINUE _SIO ('T', 4)
+#define SNDCTL_TMR_TEMPO _SIOWR('T', 5, int)
+#define SNDCTL_TMR_SOURCE _SIOWR('T', 6, int)
+#define TMR_INTERNAL 0x00000001
+#define TMR_EXTERNAL 0x00000002
+#define TMR_MODE_MIDI 0x00000010
+#define TMR_MODE_FSK 0x00000020
+#define TMR_MODE_CLS 0x00000040
+#define TMR_MODE_SMPTE 0x00000080
+#define SNDCTL_TMR_METRONOME _SIOW ('T', 7, int)
+#define SNDCTL_TMR_SELECT _SIOW ('T', 8, int)
+
+#define _LINUX_PATCHKEY_H_INDIRECT
+#include <linux/patchkey.h>
+#undef _LINUX_PATCHKEY_H_INDIRECT
+
+#ifdef __BYTE_ORDER
+#if __BYTE_ORDER == __BIG_ENDIAN
+#define AFMT_S16_NE AFMT_S16_BE
+#elif __BYTE_ORDER == __LITTLE_ENDIAN
+#define AFMT_S16_NE AFMT_S16_LE
+#else
+#error "could not determine byte order"
+#endif
+#endif
+
+struct patch_info {
+ unsigned short key;
+#define WAVE_PATCH _PATCHKEY(0x04)
+#define GUS_PATCH WAVE_PATCH
+#define WAVEFRONT_PATCH _PATCHKEY(0x06)
+
+ short device_no;
+ short instr_no;
+
+ unsigned int mode;
+
+#define WAVE_16_BITS 0x01  
+#define WAVE_UNSIGNED 0x02  
+#define WAVE_LOOPING 0x04  
+#define WAVE_BIDIR_LOOP 0x08  
+#define WAVE_LOOP_BACK 0x10  
+#define WAVE_SUSTAIN_ON 0x20  
+#define WAVE_ENVELOPES 0x40  
+#define WAVE_FAST_RELEASE 0x80  
+
+#define WAVE_VIBRATO 0x00010000  
+#define WAVE_TREMOLO 0x00020000  
+#define WAVE_SCALE 0x00040000  
+#define WAVE_FRACTIONS 0x00080000  
+
+#define WAVE_ROM 0x40000000  
+#define WAVE_MULAW 0x20000000  
+
+ int len;
+ int loop_start, loop_end;
+
+ unsigned int base_freq;
+ unsigned int base_note;
+ unsigned int high_note;
+ unsigned int low_note;
+ int panning;
+ int detuning;
+
+ unsigned char env_rate[ 6 ];
+ unsigned char env_offset[ 6 ];
+
+ unsigned char tremolo_sweep;
+ unsigned char tremolo_rate;
+ unsigned char tremolo_depth;
+
+ unsigned char vibrato_sweep;
+ unsigned char vibrato_rate;
+ unsigned char vibrato_depth;
+
+ int scale_frequency;
+ unsigned int scale_factor;
+
+ int volume;
+ int fractions;
+ int reserved1;
+ int spare[2];
+ char data[1];
+ };
+
+struct sysex_info {
+ short key;
+#define SYSEX_PATCH _PATCHKEY(0x05)
+#define MAUI_PATCH _PATCHKEY(0x06)
+ short device_no;
+ int len;
+ unsigned char data[1];
+ };
+
+#define SEQ_NOTEOFF 0
+#define SEQ_FMNOTEOFF SEQ_NOTEOFF  
+#define SEQ_NOTEON 1
+#define SEQ_FMNOTEON SEQ_NOTEON
+#define SEQ_WAIT TMR_WAIT_ABS
+#define SEQ_PGMCHANGE 3
+#define SEQ_FMPGMCHANGE SEQ_PGMCHANGE
+#define SEQ_SYNCTIMER TMR_START
+#define SEQ_MIDIPUTC 5
+#define SEQ_DRUMON 6  
+#define SEQ_DRUMOFF 7  
+#define SEQ_ECHO TMR_ECHO  
+#define SEQ_AFTERTOUCH 9
+#define SEQ_CONTROLLER 10
+
+#define CTL_BANK_SELECT 0x00
+#define CTL_MODWHEEL 0x01
+#define CTL_BREATH 0x02
+
+#define CTL_FOOT 0x04
+#define CTL_PORTAMENTO_TIME 0x05
+#define CTL_DATA_ENTRY 0x06
+#define CTL_MAIN_VOLUME 0x07
+#define CTL_BALANCE 0x08
+
+#define CTL_PAN 0x0a
+#define CTL_EXPRESSION 0x0b
+
+#define CTL_GENERAL_PURPOSE1 0x10
+#define CTL_GENERAL_PURPOSE2 0x11
+#define CTL_GENERAL_PURPOSE3 0x12
+#define CTL_GENERAL_PURPOSE4 0x13
+
+#define CTL_DAMPER_PEDAL 0x40
+#define CTL_SUSTAIN 0x40  
+#define CTL_HOLD 0x40  
+#define CTL_PORTAMENTO 0x41
+#define CTL_SOSTENUTO 0x42
+#define CTL_SOFT_PEDAL 0x43
+
+#define CTL_HOLD2 0x45
+
+#define CTL_GENERAL_PURPOSE5 0x50
+#define CTL_GENERAL_PURPOSE6 0x51
+#define CTL_GENERAL_PURPOSE7 0x52
+#define CTL_GENERAL_PURPOSE8 0x53
+
+#define CTL_EXT_EFF_DEPTH 0x5b
+#define CTL_TREMOLO_DEPTH 0x5c
+#define CTL_CHORUS_DEPTH 0x5d
+#define CTL_DETUNE_DEPTH 0x5e
+#define CTL_CELESTE_DEPTH 0x5e  
+#define CTL_PHASER_DEPTH 0x5f
+#define CTL_DATA_INCREMENT 0x60
+#define CTL_DATA_DECREMENT 0x61
+#define CTL_NONREG_PARM_NUM_LSB 0x62
+#define CTL_NONREG_PARM_NUM_MSB 0x63
+#define CTL_REGIST_PARM_NUM_LSB 0x64
+#define CTL_REGIST_PARM_NUM_MSB 0x65
+
+#define CTRL_PITCH_BENDER 255
+#define CTRL_PITCH_BENDER_RANGE 254
+#define CTRL_EXPRESSION 253  
+#define CTRL_MAIN_VOLUME 252  
+#define SEQ_BALANCE 11
+#define SEQ_VOLMODE 12
+
+#define VOL_METHOD_ADAGIO 1
+#define VOL_METHOD_LINEAR 2
+
+#define SEQ_FULLSIZE 0xfd  
+
+#define SEQ_PRIVATE 0xfe  
+#define SEQ_EXTENDED 0xff  
+
+typedef unsigned char sbi_instr_data[32];
+
+struct sbi_instrument {
+ unsigned short key;
+#define FM_PATCH _PATCHKEY(0x01)
+#define OPL3_PATCH _PATCHKEY(0x03)
+ short device;
+ int channel;
+ sbi_instr_data operators;
+ };
+
+struct synth_info {
+ char name[30];
+ int device;
+ int synth_type;
+#define SYNTH_TYPE_FM 0
+#define SYNTH_TYPE_SAMPLE 1
+#define SYNTH_TYPE_MIDI 2  
+
+ int synth_subtype;
+#define FM_TYPE_ADLIB 0x00
+#define FM_TYPE_OPL3 0x01
+#define MIDI_TYPE_MPU401 0x401
+
+#define SAMPLE_TYPE_BASIC 0x10
+#define SAMPLE_TYPE_GUS SAMPLE_TYPE_BASIC
+#define SAMPLE_TYPE_WAVEFRONT 0x11
+
+ int perc_mode;
+ int nr_voices;
+ int nr_drums;
+ int instr_bank_size;
+ unsigned int capabilities;
+#define SYNTH_CAP_PERCMODE 0x00000001  
+#define SYNTH_CAP_OPL3 0x00000002  
+#define SYNTH_CAP_INPUT 0x00000004  
+ int dummies[19];
+ };
+
+struct sound_timer_info {
+ char name[32];
+ int caps;
+ };
+
+#define MIDI_CAP_MPU401 1  
+
+struct midi_info {
+ char name[30];
+ int device;
+ unsigned int capabilities;
+ int dev_type;
+ int dummies[18];
+ };
+
+typedef struct {
+ unsigned char cmd;
+ char nr_args, nr_returns;
+ unsigned char data[30];
+ } mpu_command_rec;
+
+#define SNDCTL_MIDI_PRETIME _SIOWR('m', 0, int)
+#define SNDCTL_MIDI_MPUMODE _SIOWR('m', 1, int)
+#define SNDCTL_MIDI_MPUCMD _SIOWR('m', 2, mpu_command_rec)
+
+#define SNDCTL_DSP_RESET _SIO ('P', 0)
+#define SNDCTL_DSP_SYNC _SIO ('P', 1)
+#define SNDCTL_DSP_SPEED _SIOWR('P', 2, int)
+#define SNDCTL_DSP_STEREO _SIOWR('P', 3, int)
+#define SNDCTL_DSP_GETBLKSIZE _SIOWR('P', 4, int)
+#define SNDCTL_DSP_SAMPLESIZE SNDCTL_DSP_SETFMT
+#define SNDCTL_DSP_CHANNELS _SIOWR('P', 6, int)
+#define SOUND_PCM_WRITE_CHANNELS SNDCTL_DSP_CHANNELS
+#define SOUND_PCM_WRITE_FILTER _SIOWR('P', 7, int)
+#define SNDCTL_DSP_POST _SIO ('P', 8)
+#define SNDCTL_DSP_SUBDIVIDE _SIOWR('P', 9, int)
+#define SNDCTL_DSP_SETFRAGMENT _SIOWR('P',10, int)
+
+#define SNDCTL_DSP_GETFMTS _SIOR ('P',11, int)  
+#define SNDCTL_DSP_SETFMT _SIOWR('P',5, int)  
+#define AFMT_QUERY 0x00000000  
+#define AFMT_MU_LAW 0x00000001
+#define AFMT_A_LAW 0x00000002
+#define AFMT_IMA_ADPCM 0x00000004
+#define AFMT_U8 0x00000008
+#define AFMT_S16_LE 0x00000010  
+#define AFMT_S16_BE 0x00000020  
+#define AFMT_S8 0x00000040
+#define AFMT_U16_LE 0x00000080  
+#define AFMT_U16_BE 0x00000100  
+#define AFMT_MPEG 0x00000200  
+#define AFMT_AC3 0x00000400  
+
+typedef struct audio_buf_info {
+ int fragments;
+ int fragstotal;
+ int fragsize;
+
+ int bytes;
+
+ } audio_buf_info;
+
+#define SNDCTL_DSP_GETOSPACE _SIOR ('P',12, audio_buf_info)
+#define SNDCTL_DSP_GETISPACE _SIOR ('P',13, audio_buf_info)
+#define SNDCTL_DSP_NONBLOCK _SIO ('P',14)
+#define SNDCTL_DSP_GETCAPS _SIOR ('P',15, int)
+#define DSP_CAP_REVISION 0x000000ff  
+#define DSP_CAP_DUPLEX 0x00000100  
+#define DSP_CAP_REALTIME 0x00000200  
+#define DSP_CAP_BATCH 0x00000400  
+
+#define DSP_CAP_COPROC 0x00000800  
+
+#define DSP_CAP_TRIGGER 0x00001000  
+#define DSP_CAP_MMAP 0x00002000  
+#define DSP_CAP_MULTI 0x00004000  
+#define DSP_CAP_BIND 0x00008000  
+
+#define SNDCTL_DSP_GETTRIGGER _SIOR ('P',16, int)
+#define SNDCTL_DSP_SETTRIGGER _SIOW ('P',16, int)
+#define PCM_ENABLE_INPUT 0x00000001
+#define PCM_ENABLE_OUTPUT 0x00000002
+
+typedef struct count_info {
+ int bytes;
+ int blocks;
+ int ptr;
+ } count_info;
+
+#define SNDCTL_DSP_GETIPTR _SIOR ('P',17, count_info)
+#define SNDCTL_DSP_GETOPTR _SIOR ('P',18, count_info)
+
+typedef struct buffmem_desc {
+ unsigned *buffer;
+ int size;
+ } buffmem_desc;
+#define SNDCTL_DSP_MAPINBUF _SIOR ('P', 19, buffmem_desc)
+#define SNDCTL_DSP_MAPOUTBUF _SIOR ('P', 20, buffmem_desc)
+#define SNDCTL_DSP_SETSYNCRO _SIO ('P', 21)
+#define SNDCTL_DSP_SETDUPLEX _SIO ('P', 22)
+#define SNDCTL_DSP_GETODELAY _SIOR ('P', 23, int)
+
+#define SNDCTL_DSP_GETCHANNELMASK _SIOWR('P', 64, int)
+#define SNDCTL_DSP_BIND_CHANNEL _SIOWR('P', 65, int)
+#define DSP_BIND_QUERY 0x00000000
+#define DSP_BIND_FRONT 0x00000001
+#define DSP_BIND_SURR 0x00000002
+#define DSP_BIND_CENTER_LFE 0x00000004
+#define DSP_BIND_HANDSET 0x00000008
+#define DSP_BIND_MIC 0x00000010
+#define DSP_BIND_MODEM1 0x00000020
+#define DSP_BIND_MODEM2 0x00000040
+#define DSP_BIND_I2S 0x00000080
+#define DSP_BIND_SPDIF 0x00000100
+
+#define SNDCTL_DSP_SETSPDIF _SIOW ('P', 66, int)
+#define SNDCTL_DSP_GETSPDIF _SIOR ('P', 67, int)
+#define SPDIF_PRO 0x0001
+#define SPDIF_N_AUD 0x0002
+#define SPDIF_COPY 0x0004
+#define SPDIF_PRE 0x0008
+#define SPDIF_CC 0x07f0
+#define SPDIF_L 0x0800
+#define SPDIF_DRS 0x4000
+#define SPDIF_V 0x8000
+
+#define SNDCTL_DSP_PROFILE _SIOW ('P', 23, int)
+#define APF_NORMAL 0  
+#define APF_NETWORK 1  
+#define APF_CPUINTENS 2  
+
+#define SOUND_PCM_READ_RATE _SIOR ('P', 2, int)
+#define SOUND_PCM_READ_CHANNELS _SIOR ('P', 6, int)
+#define SOUND_PCM_READ_BITS _SIOR ('P', 5, int)
+#define SOUND_PCM_READ_FILTER _SIOR ('P', 7, int)
+
+#define SOUND_PCM_WRITE_BITS SNDCTL_DSP_SETFMT
+#define SOUND_PCM_WRITE_RATE SNDCTL_DSP_SPEED
+#define SOUND_PCM_POST SNDCTL_DSP_POST
+#define SOUND_PCM_RESET SNDCTL_DSP_RESET
+#define SOUND_PCM_SYNC SNDCTL_DSP_SYNC
+#define SOUND_PCM_SUBDIVIDE SNDCTL_DSP_SUBDIVIDE
+#define SOUND_PCM_SETFRAGMENT SNDCTL_DSP_SETFRAGMENT
+#define SOUND_PCM_GETFMTS SNDCTL_DSP_GETFMTS
+#define SOUND_PCM_SETFMT SNDCTL_DSP_SETFMT
+#define SOUND_PCM_GETOSPACE SNDCTL_DSP_GETOSPACE
+#define SOUND_PCM_GETISPACE SNDCTL_DSP_GETISPACE
+#define SOUND_PCM_NONBLOCK SNDCTL_DSP_NONBLOCK
+#define SOUND_PCM_GETCAPS SNDCTL_DSP_GETCAPS
+#define SOUND_PCM_GETTRIGGER SNDCTL_DSP_GETTRIGGER
+#define SOUND_PCM_SETTRIGGER SNDCTL_DSP_SETTRIGGER
+#define SOUND_PCM_SETSYNCRO SNDCTL_DSP_SETSYNCRO
+#define SOUND_PCM_GETIPTR SNDCTL_DSP_GETIPTR
+#define SOUND_PCM_GETOPTR SNDCTL_DSP_GETOPTR
+#define SOUND_PCM_MAPINBUF SNDCTL_DSP_MAPINBUF
+#define SOUND_PCM_MAPOUTBUF SNDCTL_DSP_MAPOUTBUF
+
+typedef struct copr_buffer {
+ int command;
+ int flags;
+#define CPF_NONE 0x0000
+#define CPF_FIRST 0x0001  
+#define CPF_LAST 0x0002  
+ int len;
+ int offs;
+
+ unsigned char data[4000];
+ } copr_buffer;
+
+typedef struct copr_debug_buf {
+ int command;
+ int parm1;
+ int parm2;
+ int flags;
+ int len;
+ } copr_debug_buf;
+
+typedef struct copr_msg {
+ int len;
+ unsigned char data[4000];
+ } copr_msg;
+
+#define SNDCTL_COPR_RESET _SIO ('C', 0)
+#define SNDCTL_COPR_LOAD _SIOWR('C', 1, copr_buffer)
+#define SNDCTL_COPR_RDATA _SIOWR('C', 2, copr_debug_buf)
+#define SNDCTL_COPR_RCODE _SIOWR('C', 3, copr_debug_buf)
+#define SNDCTL_COPR_WDATA _SIOW ('C', 4, copr_debug_buf)
+#define SNDCTL_COPR_WCODE _SIOW ('C', 5, copr_debug_buf)
+#define SNDCTL_COPR_RUN _SIOWR('C', 6, copr_debug_buf)
+#define SNDCTL_COPR_HALT _SIOWR('C', 7, copr_debug_buf)
+#define SNDCTL_COPR_SENDMSG _SIOWR('C', 8, copr_msg)
+#define SNDCTL_COPR_RCVMSG _SIOR ('C', 9, copr_msg)
+
+#define SOUND_MIXER_NRDEVICES 25
+#define SOUND_MIXER_VOLUME 0
+#define SOUND_MIXER_BASS 1
+#define SOUND_MIXER_TREBLE 2
+#define SOUND_MIXER_SYNTH 3
+#define SOUND_MIXER_PCM 4
+#define SOUND_MIXER_SPEAKER 5
+#define SOUND_MIXER_LINE 6
+#define SOUND_MIXER_MIC 7
+#define SOUND_MIXER_CD 8
+#define SOUND_MIXER_IMIX 9  
+#define SOUND_MIXER_ALTPCM 10
+#define SOUND_MIXER_RECLEV 11  
+#define SOUND_MIXER_IGAIN 12  
+#define SOUND_MIXER_OGAIN 13  
+
+#define SOUND_MIXER_LINE1 14  
+#define SOUND_MIXER_LINE2 15  
+#define SOUND_MIXER_LINE3 16  
+#define SOUND_MIXER_DIGITAL1 17  
+#define SOUND_MIXER_DIGITAL2 18  
+#define SOUND_MIXER_DIGITAL3 19  
+#define SOUND_MIXER_PHONEIN 20  
+#define SOUND_MIXER_PHONEOUT 21  
+#define SOUND_MIXER_VIDEO 22  
+#define SOUND_MIXER_RADIO 23  
+#define SOUND_MIXER_MONITOR 24  
+
+#define SOUND_ONOFF_MIN 28
+#define SOUND_ONOFF_MAX 30
+
+#define SOUND_MIXER_NONE 31
+
+#define SOUND_MIXER_ENHANCE SOUND_MIXER_NONE
+#define SOUND_MIXER_MUTE SOUND_MIXER_NONE
+#define SOUND_MIXER_LOUD SOUND_MIXER_NONE
+
+#define SOUND_DEVICE_LABELS {"Vol  ", "Bass ", "Trebl", "Synth", "Pcm  ", "Spkr ", "Line ",   "Mic  ", "CD   ", "Mix  ", "Pcm2 ", "Rec  ", "IGain", "OGain",   "Line1", "Line2", "Line3", "Digital1", "Digital2", "Digital3",   "PhoneIn", "PhoneOut", "Video", "Radio", "Monitor"}
+
+#define SOUND_DEVICE_NAMES {"vol", "bass", "treble", "synth", "pcm", "speaker", "line",   "mic", "cd", "mix", "pcm2", "rec", "igain", "ogain",   "line1", "line2", "line3", "dig1", "dig2", "dig3",   "phin", "phout", "video", "radio", "monitor"}
+
+#define SOUND_MIXER_RECSRC 0xff  
+#define SOUND_MIXER_DEVMASK 0xfe  
+#define SOUND_MIXER_RECMASK 0xfd  
+#define SOUND_MIXER_CAPS 0xfc
+#define SOUND_CAP_EXCL_INPUT 0x00000001  
+#define SOUND_MIXER_STEREODEVS 0xfb  
+#define SOUND_MIXER_OUTSRC 0xfa  
+#define SOUND_MIXER_OUTMASK 0xf9  
+
+#define SOUND_MASK_VOLUME (1 << SOUND_MIXER_VOLUME)
+#define SOUND_MASK_BASS (1 << SOUND_MIXER_BASS)
+#define SOUND_MASK_TREBLE (1 << SOUND_MIXER_TREBLE)
+#define SOUND_MASK_SYNTH (1 << SOUND_MIXER_SYNTH)
+#define SOUND_MASK_PCM (1 << SOUND_MIXER_PCM)
+#define SOUND_MASK_SPEAKER (1 << SOUND_MIXER_SPEAKER)
+#define SOUND_MASK_LINE (1 << SOUND_MIXER_LINE)
+#define SOUND_MASK_MIC (1 << SOUND_MIXER_MIC)
+#define SOUND_MASK_CD (1 << SOUND_MIXER_CD)
+#define SOUND_MASK_IMIX (1 << SOUND_MIXER_IMIX)
+#define SOUND_MASK_ALTPCM (1 << SOUND_MIXER_ALTPCM)
+#define SOUND_MASK_RECLEV (1 << SOUND_MIXER_RECLEV)
+#define SOUND_MASK_IGAIN (1 << SOUND_MIXER_IGAIN)
+#define SOUND_MASK_OGAIN (1 << SOUND_MIXER_OGAIN)
+#define SOUND_MASK_LINE1 (1 << SOUND_MIXER_LINE1)
+#define SOUND_MASK_LINE2 (1 << SOUND_MIXER_LINE2)
+#define SOUND_MASK_LINE3 (1 << SOUND_MIXER_LINE3)
+#define SOUND_MASK_DIGITAL1 (1 << SOUND_MIXER_DIGITAL1)
+#define SOUND_MASK_DIGITAL2 (1 << SOUND_MIXER_DIGITAL2)
+#define SOUND_MASK_DIGITAL3 (1 << SOUND_MIXER_DIGITAL3)
+#define SOUND_MASK_PHONEIN (1 << SOUND_MIXER_PHONEIN)
+#define SOUND_MASK_PHONEOUT (1 << SOUND_MIXER_PHONEOUT)
+#define SOUND_MASK_RADIO (1 << SOUND_MIXER_RADIO)
+#define SOUND_MASK_VIDEO (1 << SOUND_MIXER_VIDEO)
+#define SOUND_MASK_MONITOR (1 << SOUND_MIXER_MONITOR)
+
+#define SOUND_MASK_MUTE (1 << SOUND_MIXER_MUTE)
+#define SOUND_MASK_ENHANCE (1 << SOUND_MIXER_ENHANCE)
+#define SOUND_MASK_LOUD (1 << SOUND_MIXER_LOUD)
+
+#define MIXER_READ(dev) _SIOR('M', dev, int)
+#define SOUND_MIXER_READ_VOLUME MIXER_READ(SOUND_MIXER_VOLUME)
+#define SOUND_MIXER_READ_BASS MIXER_READ(SOUND_MIXER_BASS)
+#define SOUND_MIXER_READ_TREBLE MIXER_READ(SOUND_MIXER_TREBLE)
+#define SOUND_MIXER_READ_SYNTH MIXER_READ(SOUND_MIXER_SYNTH)
+#define SOUND_MIXER_READ_PCM MIXER_READ(SOUND_MIXER_PCM)
+#define SOUND_MIXER_READ_SPEAKER MIXER_READ(SOUND_MIXER_SPEAKER)
+#define SOUND_MIXER_READ_LINE MIXER_READ(SOUND_MIXER_LINE)
+#define SOUND_MIXER_READ_MIC MIXER_READ(SOUND_MIXER_MIC)
+#define SOUND_MIXER_READ_CD MIXER_READ(SOUND_MIXER_CD)
+#define SOUND_MIXER_READ_IMIX MIXER_READ(SOUND_MIXER_IMIX)
+#define SOUND_MIXER_READ_ALTPCM MIXER_READ(SOUND_MIXER_ALTPCM)
+#define SOUND_MIXER_READ_RECLEV MIXER_READ(SOUND_MIXER_RECLEV)
+#define SOUND_MIXER_READ_IGAIN MIXER_READ(SOUND_MIXER_IGAIN)
+#define SOUND_MIXER_READ_OGAIN MIXER_READ(SOUND_MIXER_OGAIN)
+#define SOUND_MIXER_READ_LINE1 MIXER_READ(SOUND_MIXER_LINE1)
+#define SOUND_MIXER_READ_LINE2 MIXER_READ(SOUND_MIXER_LINE2)
+#define SOUND_MIXER_READ_LINE3 MIXER_READ(SOUND_MIXER_LINE3)
+
+#define SOUND_MIXER_READ_MUTE MIXER_READ(SOUND_MIXER_MUTE)
+#define SOUND_MIXER_READ_ENHANCE MIXER_READ(SOUND_MIXER_ENHANCE)
+#define SOUND_MIXER_READ_LOUD MIXER_READ(SOUND_MIXER_LOUD)
+
+#define SOUND_MIXER_READ_RECSRC MIXER_READ(SOUND_MIXER_RECSRC)
+#define SOUND_MIXER_READ_DEVMASK MIXER_READ(SOUND_MIXER_DEVMASK)
+#define SOUND_MIXER_READ_RECMASK MIXER_READ(SOUND_MIXER_RECMASK)
+#define SOUND_MIXER_READ_STEREODEVS MIXER_READ(SOUND_MIXER_STEREODEVS)
+#define SOUND_MIXER_READ_CAPS MIXER_READ(SOUND_MIXER_CAPS)
+
+#define MIXER_WRITE(dev) _SIOWR('M', dev, int)
+#define SOUND_MIXER_WRITE_VOLUME MIXER_WRITE(SOUND_MIXER_VOLUME)
+#define SOUND_MIXER_WRITE_BASS MIXER_WRITE(SOUND_MIXER_BASS)
+#define SOUND_MIXER_WRITE_TREBLE MIXER_WRITE(SOUND_MIXER_TREBLE)
+#define SOUND_MIXER_WRITE_SYNTH MIXER_WRITE(SOUND_MIXER_SYNTH)
+#define SOUND_MIXER_WRITE_PCM MIXER_WRITE(SOUND_MIXER_PCM)
+#define SOUND_MIXER_WRITE_SPEAKER MIXER_WRITE(SOUND_MIXER_SPEAKER)
+#define SOUND_MIXER_WRITE_LINE MIXER_WRITE(SOUND_MIXER_LINE)
+#define SOUND_MIXER_WRITE_MIC MIXER_WRITE(SOUND_MIXER_MIC)
+#define SOUND_MIXER_WRITE_CD MIXER_WRITE(SOUND_MIXER_CD)
+#define SOUND_MIXER_WRITE_IMIX MIXER_WRITE(SOUND_MIXER_IMIX)
+#define SOUND_MIXER_WRITE_ALTPCM MIXER_WRITE(SOUND_MIXER_ALTPCM)
+#define SOUND_MIXER_WRITE_RECLEV MIXER_WRITE(SOUND_MIXER_RECLEV)
+#define SOUND_MIXER_WRITE_IGAIN MIXER_WRITE(SOUND_MIXER_IGAIN)
+#define SOUND_MIXER_WRITE_OGAIN MIXER_WRITE(SOUND_MIXER_OGAIN)
+#define SOUND_MIXER_WRITE_LINE1 MIXER_WRITE(SOUND_MIXER_LINE1)
+#define SOUND_MIXER_WRITE_LINE2 MIXER_WRITE(SOUND_MIXER_LINE2)
+#define SOUND_MIXER_WRITE_LINE3 MIXER_WRITE(SOUND_MIXER_LINE3)
+
+#define SOUND_MIXER_WRITE_MUTE MIXER_WRITE(SOUND_MIXER_MUTE)
+#define SOUND_MIXER_WRITE_ENHANCE MIXER_WRITE(SOUND_MIXER_ENHANCE)
+#define SOUND_MIXER_WRITE_LOUD MIXER_WRITE(SOUND_MIXER_LOUD)
+
+#define SOUND_MIXER_WRITE_RECSRC MIXER_WRITE(SOUND_MIXER_RECSRC)
+
+typedef struct mixer_info
+{
+ char id[16];
+ char name[32];
+ int modify_counter;
+ int fillers[10];
+} mixer_info;
+
+typedef struct _old_mixer_info
+{
+ char id[16];
+ char name[32];
+} _old_mixer_info;
+
+#define SOUND_MIXER_INFO _SIOR ('M', 101, mixer_info)
+#define SOUND_OLD_MIXER_INFO _SIOR ('M', 101, _old_mixer_info)
+
+typedef unsigned char mixer_record[128];
+
+#define SOUND_MIXER_ACCESS _SIOWR('M', 102, mixer_record)
+
+#define SOUND_MIXER_AGC _SIOWR('M', 103, int)
+#define SOUND_MIXER_3DSE _SIOWR('M', 104, int)
+
+#define SOUND_MIXER_PRIVATE1 _SIOWR('M', 111, int)
+#define SOUND_MIXER_PRIVATE2 _SIOWR('M', 112, int)
+#define SOUND_MIXER_PRIVATE3 _SIOWR('M', 113, int)
+#define SOUND_MIXER_PRIVATE4 _SIOWR('M', 114, int)
+#define SOUND_MIXER_PRIVATE5 _SIOWR('M', 115, int)
+
+typedef struct mixer_vol_table {
+ int num;
+ char name[32];
+ int levels[32];
+} mixer_vol_table;
+
+#define SOUND_MIXER_GETLEVELS _SIOWR('M', 116, mixer_vol_table)
+#define SOUND_MIXER_SETLEVELS _SIOWR('M', 117, mixer_vol_table)
+
+#define OSS_GETVERSION _SIOR ('M', 118, int)
+
+#define EV_SEQ_LOCAL 0x80
+#define EV_TIMING 0x81
+#define EV_CHN_COMMON 0x92
+#define EV_CHN_VOICE 0x93
+#define EV_SYSEX 0x94
+
+#define MIDI_NOTEOFF 0x80
+#define MIDI_NOTEON 0x90
+#define MIDI_KEY_PRESSURE 0xA0
+
+#define MIDI_CTL_CHANGE 0xB0
+#define MIDI_PGM_CHANGE 0xC0
+#define MIDI_CHN_PRESSURE 0xD0
+#define MIDI_PITCH_BEND 0xE0
+
+#define MIDI_SYSTEM_PREFIX 0xF0
+
+#define TMR_WAIT_REL 1  
+#define TMR_WAIT_ABS 2  
+#define TMR_STOP 3
+#define TMR_START 4
+#define TMR_CONTINUE 5
+#define TMR_TEMPO 6
+#define TMR_ECHO 8
+#define TMR_CLOCK 9  
+#define TMR_SPP 10  
+#define TMR_TIMESIG 11  
+
+#define LOCL_STARTAUDIO 1
+
+#if !defined(__KERNEL__) && !defined(KERNEL) && !defined(INKERNEL) && !defined(_KERNEL) || defined(USE_SEQ_MACROS)
+
+#define SEQ_DECLAREBUF() SEQ_USE_EXTBUF()
+
+#define SEQ_PM_DEFINES int __foo_bar___
+#ifdef OSSLIB
+#define SEQ_USE_EXTBUF()   extern unsigned char *_seqbuf;   extern int _seqbuflen;extern int _seqbufptr
+#define SEQ_DEFINEBUF(len) SEQ_USE_EXTBUF();static int _requested_seqbuflen=len
+#define _SEQ_ADVBUF(len) OSS_seq_advbuf(len, seqfd, _seqbuf, _seqbuflen)
+#define _SEQ_NEEDBUF(len) OSS_seq_needbuf(len, seqfd, _seqbuf, _seqbuflen)
+#define SEQ_DUMPBUF() OSS_seqbuf_dump(seqfd, _seqbuf, _seqbuflen)
+
+#define SEQ_LOAD_GMINSTR(dev, instr)   OSS_patch_caching(dev, -1, instr, seqfd, _seqbuf, _seqbuflen)
+#define SEQ_LOAD_GMDRUM(dev, drum)   OSS_drum_caching(dev, -1, drum, seqfd, _seqbuf, _seqbuflen)
+#else
+
+#define SEQ_LOAD_GMINSTR(dev, instr)
+#define SEQ_LOAD_GMDRUM(dev, drum)
+
+#define SEQ_USE_EXTBUF()   extern unsigned char _seqbuf[];   extern int _seqbuflen;extern int _seqbufptr
+
+#ifndef USE_SIMPLE_MACROS
+
+#define SEQ_DEFINEBUF(len) unsigned char _seqbuf[len]; int _seqbuflen = len;int _seqbufptr = 0
+#define _SEQ_NEEDBUF(len) if ((_seqbufptr+(len)) > _seqbuflen) seqbuf_dump()
+#define _SEQ_ADVBUF(len) _seqbufptr += len
+#define SEQ_DUMPBUF seqbuf_dump
+#else
+
+#define _SEQ_NEEDBUF(len)  
+#endif
+#endif
+
+#define SEQ_VOLUME_MODE(dev, mode) {_SEQ_NEEDBUF(8);  _seqbuf[_seqbufptr] = SEQ_EXTENDED;  _seqbuf[_seqbufptr+1] = SEQ_VOLMODE;  _seqbuf[_seqbufptr+2] = (dev);  _seqbuf[_seqbufptr+3] = (mode);  _seqbuf[_seqbufptr+4] = 0;  _seqbuf[_seqbufptr+5] = 0;  _seqbuf[_seqbufptr+6] = 0;  _seqbuf[_seqbufptr+7] = 0;  _SEQ_ADVBUF(8);}
+
+#define _CHN_VOICE(dev, event, chn, note, parm)   {_SEQ_NEEDBUF(8);  _seqbuf[_seqbufptr] = EV_CHN_VOICE;  _seqbuf[_seqbufptr+1] = (dev);  _seqbuf[_seqbufptr+2] = (event);  _seqbuf[_seqbufptr+3] = (chn);  _seqbuf[_seqbufptr+4] = (note);  _seqbuf[_seqbufptr+5] = (parm);  _seqbuf[_seqbufptr+6] = (0);  _seqbuf[_seqbufptr+7] = 0;  _SEQ_ADVBUF(8);}
+
+#define SEQ_START_NOTE(dev, chn, note, vol)   _CHN_VOICE(dev, MIDI_NOTEON, chn, note, vol)
+
+#define SEQ_STOP_NOTE(dev, chn, note, vol)   _CHN_VOICE(dev, MIDI_NOTEOFF, chn, note, vol)
+
+#define SEQ_KEY_PRESSURE(dev, chn, note, pressure)   _CHN_VOICE(dev, MIDI_KEY_PRESSURE, chn, note, pressure)
+
+#define _CHN_COMMON(dev, event, chn, p1, p2, w14)   {_SEQ_NEEDBUF(8);  _seqbuf[_seqbufptr] = EV_CHN_COMMON;  _seqbuf[_seqbufptr+1] = (dev);  _seqbuf[_seqbufptr+2] = (event);  _seqbuf[_seqbufptr+3] = (chn);  _seqbuf[_seqbufptr+4] = (p1);  _seqbuf[_seqbufptr+5] = (p2);  *(short *)&_seqbuf[_seqbufptr+6] = (w14);  _SEQ_ADVBUF(8);}
+
+#define SEQ_SYSEX(dev, buf, len)   {int ii, ll=(len);   unsigned char *bufp=buf;  if (ll>6)ll=6;  _SEQ_NEEDBUF(8);  _seqbuf[_seqbufptr] = EV_SYSEX;  _seqbuf[_seqbufptr+1] = (dev);  for(ii=0;ii<ll;ii++)  _seqbuf[_seqbufptr+ii+2] = bufp[ii];  for(ii=ll;ii<6;ii++)  _seqbuf[_seqbufptr+ii+2] = 0xff;  _SEQ_ADVBUF(8);}
+
+#define SEQ_CHN_PRESSURE(dev, chn, pressure)   _CHN_COMMON(dev, MIDI_CHN_PRESSURE, chn, pressure, 0, 0)
+
+#define SEQ_SET_PATCH SEQ_PGM_CHANGE
+#ifdef OSSLIB
+#define SEQ_PGM_CHANGE(dev, chn, patch)   {OSS_patch_caching(dev, chn, patch, seqfd, _seqbuf, _seqbuflen);   _CHN_COMMON(dev, MIDI_PGM_CHANGE, chn, patch, 0, 0);}
+#else
+#define SEQ_PGM_CHANGE(dev, chn, patch)   _CHN_COMMON(dev, MIDI_PGM_CHANGE, chn, patch, 0, 0)
+#endif
+
+#define SEQ_CONTROL(dev, chn, controller, value)   _CHN_COMMON(dev, MIDI_CTL_CHANGE, chn, controller, 0, value)
+
+#define SEQ_BENDER(dev, chn, value)   _CHN_COMMON(dev, MIDI_PITCH_BEND, chn, 0, 0, value)
+
+#define SEQ_V2_X_CONTROL(dev, voice, controller, value) {_SEQ_NEEDBUF(8);  _seqbuf[_seqbufptr] = SEQ_EXTENDED;  _seqbuf[_seqbufptr+1] = SEQ_CONTROLLER;  _seqbuf[_seqbufptr+2] = (dev);  _seqbuf[_seqbufptr+3] = (voice);  _seqbuf[_seqbufptr+4] = (controller);  _seqbuf[_seqbufptr+5] = ((value)&0xff);  _seqbuf[_seqbufptr+6] = ((value>>8)&0xff);  _seqbuf[_seqbufptr+7] = 0;  _SEQ_ADVBUF(8);}
+
+#define SEQ_PITCHBEND(dev, voice, value) SEQ_V2_X_CONTROL(dev, voice, CTRL_PITCH_BENDER, value)
+#define SEQ_BENDER_RANGE(dev, voice, value) SEQ_V2_X_CONTROL(dev, voice, CTRL_PITCH_BENDER_RANGE, value)
+#define SEQ_EXPRESSION(dev, voice, value) SEQ_CONTROL(dev, voice, CTL_EXPRESSION, value*128)
+#define SEQ_MAIN_VOLUME(dev, voice, value) SEQ_CONTROL(dev, voice, CTL_MAIN_VOLUME, (value*16383)/100)
+#define SEQ_PANNING(dev, voice, pos) SEQ_CONTROL(dev, voice, CTL_PAN, (pos+128) / 2)
+
+#define _TIMER_EVENT(ev, parm) {_SEQ_NEEDBUF(8);  _seqbuf[_seqbufptr+0] = EV_TIMING;   _seqbuf[_seqbufptr+1] = (ev);   _seqbuf[_seqbufptr+2] = 0;  _seqbuf[_seqbufptr+3] = 0;  *(unsigned int *)&_seqbuf[_seqbufptr+4] = (parm);   _SEQ_ADVBUF(8);}
+
+#define SEQ_START_TIMER() _TIMER_EVENT(TMR_START, 0)
+#define SEQ_STOP_TIMER() _TIMER_EVENT(TMR_STOP, 0)
+#define SEQ_CONTINUE_TIMER() _TIMER_EVENT(TMR_CONTINUE, 0)
+#define SEQ_WAIT_TIME(ticks) _TIMER_EVENT(TMR_WAIT_ABS, ticks)
+#define SEQ_DELTA_TIME(ticks) _TIMER_EVENT(TMR_WAIT_REL, ticks)
+#define SEQ_ECHO_BACK(key) _TIMER_EVENT(TMR_ECHO, key)
+#define SEQ_SET_TEMPO(value) _TIMER_EVENT(TMR_TEMPO, value)
+#define SEQ_SONGPOS(pos) _TIMER_EVENT(TMR_SPP, pos)
+#define SEQ_TIME_SIGNATURE(sig) _TIMER_EVENT(TMR_TIMESIG, sig)
+
+#define _LOCAL_EVENT(ev, parm) {_SEQ_NEEDBUF(8);  _seqbuf[_seqbufptr+0] = EV_SEQ_LOCAL;   _seqbuf[_seqbufptr+1] = (ev);   _seqbuf[_seqbufptr+2] = 0;  _seqbuf[_seqbufptr+3] = 0;  *(unsigned int *)&_seqbuf[_seqbufptr+4] = (parm);   _SEQ_ADVBUF(8);}
+
+#define SEQ_PLAYAUDIO(devmask) _LOCAL_EVENT(LOCL_STARTAUDIO, devmask)
+
+#define SEQ_MIDIOUT(device, byte) {_SEQ_NEEDBUF(4);  _seqbuf[_seqbufptr] = SEQ_MIDIPUTC;  _seqbuf[_seqbufptr+1] = (byte);  _seqbuf[_seqbufptr+2] = (device);  _seqbuf[_seqbufptr+3] = 0;  _SEQ_ADVBUF(4);}
+
+#ifdef OSSLIB
+#define SEQ_WRPATCH(patchx, len)   OSS_write_patch(seqfd, (char*)(patchx), len)
+#define SEQ_WRPATCH2(patchx, len)   OSS_write_patch2(seqfd, (char*)(patchx), len)
+#else
+#define SEQ_WRPATCH(patchx, len)   {if (_seqbufptr) SEQ_DUMPBUF();  if (write(seqfd, (char*)(patchx), len)==-1)   perror("Write patch: /dev/sequencer");}
+#define SEQ_WRPATCH2(patchx, len)   (SEQ_DUMPBUF(), write(seqfd, (char*)(patchx), len))
+#endif
+
+#endif
+#endif
diff --git a/ndk/platforms/android-3/include/linux/spinlock.h b/ndk/platforms/android-3/include/linux/spinlock.h
new file mode 100644
index 0000000..5504c9e
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/spinlock.h
@@ -0,0 +1,112 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __LINUX_SPINLOCK_H
+#define __LINUX_SPINLOCK_H
+
+#include <linux/preempt.h>
+#include <linux/linkage.h>
+#include <linux/compiler.h>
+#include <linux/thread_info.h>
+#include <linux/kernel.h>
+#include <linux/stringify.h>
+
+#include <asm/system.h>
+
+#define LOCK_SECTION_NAME ".text.lock."KBUILD_BASENAME
+
+#define LOCK_SECTION_START(extra)   ".subsection 1\n\t"   extra   ".ifndef " LOCK_SECTION_NAME "\n\t"   LOCK_SECTION_NAME ":\n\t"   ".endif\n"
+
+#define LOCK_SECTION_END   ".previous\n\t"
+
+#define __lockfunc fastcall __attribute__((section(".spinlock.text")))
+
+#include <linux/spinlock_types.h>
+
+#include <linux/spinlock_up.h>
+
+#define spin_lock_init(lock)   do { *(lock) = SPIN_LOCK_UNLOCKED; } while (0)
+
+#define rwlock_init(lock)   do { *(lock) = RW_LOCK_UNLOCKED; } while (0)
+
+#define spin_is_locked(lock) __raw_spin_is_locked(&(lock)->raw_lock)
+
+#define spin_unlock_wait(lock) __raw_spin_unlock_wait(&(lock)->raw_lock)
+
+#include <linux/spinlock_api_up.h>
+
+#define _raw_spin_lock(lock) __raw_spin_lock(&(lock)->raw_lock)
+#define _raw_spin_lock_flags(lock, flags)   __raw_spin_lock_flags(&(lock)->raw_lock, *(flags))
+#define _raw_spin_trylock(lock) __raw_spin_trylock(&(lock)->raw_lock)
+#define _raw_spin_unlock(lock) __raw_spin_unlock(&(lock)->raw_lock)
+#define _raw_read_lock(rwlock) __raw_read_lock(&(rwlock)->raw_lock)
+#define _raw_read_trylock(rwlock) __raw_read_trylock(&(rwlock)->raw_lock)
+#define _raw_read_unlock(rwlock) __raw_read_unlock(&(rwlock)->raw_lock)
+#define _raw_write_lock(rwlock) __raw_write_lock(&(rwlock)->raw_lock)
+#define _raw_write_trylock(rwlock) __raw_write_trylock(&(rwlock)->raw_lock)
+#define _raw_write_unlock(rwlock) __raw_write_unlock(&(rwlock)->raw_lock)
+
+#define read_can_lock(rwlock) __raw_read_can_lock(&(rwlock)->raw_lock)
+#define write_can_lock(rwlock) __raw_write_can_lock(&(rwlock)->raw_lock)
+
+#define spin_trylock(lock) __cond_lock(_spin_trylock(lock))
+#define read_trylock(lock) __cond_lock(_read_trylock(lock))
+#define write_trylock(lock) __cond_lock(_write_trylock(lock))
+
+#define spin_lock(lock) _spin_lock(lock)
+
+#define spin_lock_nested(lock, subclass) _spin_lock(lock)
+
+#define write_lock(lock) _write_lock(lock)
+#define read_lock(lock) _read_lock(lock)
+
+#define spin_lock_irqsave(lock, flags) _spin_lock_irqsave(lock, flags)
+#define read_lock_irqsave(lock, flags) _read_lock_irqsave(lock, flags)
+#define write_lock_irqsave(lock, flags) _write_lock_irqsave(lock, flags)
+
+#define spin_lock_irq(lock) _spin_lock_irq(lock)
+#define spin_lock_bh(lock) _spin_lock_bh(lock)
+
+#define read_lock_irq(lock) _read_lock_irq(lock)
+#define read_lock_bh(lock) _read_lock_bh(lock)
+
+#define write_lock_irq(lock) _write_lock_irq(lock)
+#define write_lock_bh(lock) _write_lock_bh(lock)
+
+#define spin_unlock(lock) _spin_unlock(lock)
+#define read_unlock(lock) _read_unlock(lock)
+#define write_unlock(lock) _write_unlock(lock)
+#define spin_unlock_irq(lock) _spin_unlock_irq(lock)
+#define read_unlock_irq(lock) _read_unlock_irq(lock)
+#define write_unlock_irq(lock) _write_unlock_irq(lock)
+
+#define spin_unlock_irqrestore(lock, flags)   _spin_unlock_irqrestore(lock, flags)
+#define spin_unlock_bh(lock) _spin_unlock_bh(lock)
+
+#define read_unlock_irqrestore(lock, flags)   _read_unlock_irqrestore(lock, flags)
+#define read_unlock_bh(lock) _read_unlock_bh(lock)
+
+#define write_unlock_irqrestore(lock, flags)   _write_unlock_irqrestore(lock, flags)
+#define write_unlock_bh(lock) _write_unlock_bh(lock)
+
+#define spin_trylock_bh(lock) __cond_lock(_spin_trylock_bh(lock))
+
+#define spin_trylock_irq(lock)  ({   local_irq_disable();   _spin_trylock(lock) ?   1 : ({ local_irq_enable(); 0; });  })
+
+#define spin_trylock_irqsave(lock, flags)  ({   local_irq_save(flags);   _spin_trylock(lock) ?   1 : ({ local_irq_restore(flags); 0; });  })
+
+#include <asm/atomic.h>
+
+#define atomic_dec_and_lock(atomic, lock)   __cond_lock(_atomic_dec_and_lock(atomic, lock))
+
+#define spin_can_lock(lock) (!spin_is_locked(lock))
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/spinlock_api_smp.h b/ndk/platforms/android-3/include/linux/spinlock_api_smp.h
new file mode 100644
index 0000000..74d8cc9
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/spinlock_api_smp.h
@@ -0,0 +1,21 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __LINUX_SPINLOCK_API_SMP_H
+#define __LINUX_SPINLOCK_API_SMP_H
+
+#ifndef __LINUX_SPINLOCK_H
+#error "please don't include this file directly"
+#endif
+
+#define assert_spin_locked(x) BUG_ON(!spin_is_locked(x))
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/spinlock_api_up.h b/ndk/platforms/android-3/include/linux/spinlock_api_up.h
new file mode 100644
index 0000000..c9a5c01
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/spinlock_api_up.h
@@ -0,0 +1,69 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __LINUX_SPINLOCK_API_UP_H
+#define __LINUX_SPINLOCK_API_UP_H
+
+#ifndef __LINUX_SPINLOCK_H
+#error "please don't include this file directly"
+#endif
+
+#define in_lock_functions(ADDR) 0
+
+#define assert_spin_locked(lock) do { (void)(lock); } while (0)
+
+#define __LOCK(lock)   do { preempt_disable(); __acquire(lock); (void)(lock); } while (0)
+
+#define __LOCK_BH(lock)   do { local_bh_disable(); __LOCK(lock); } while (0)
+
+#define __LOCK_IRQ(lock)   do { local_irq_disable(); __LOCK(lock); } while (0)
+
+#define __LOCK_IRQSAVE(lock, flags)   do { local_irq_save(flags); __LOCK(lock); } while (0)
+
+#define __UNLOCK(lock)   do { preempt_enable(); __release(lock); (void)(lock); } while (0)
+
+#define __UNLOCK_BH(lock)   do { preempt_enable_no_resched(); local_bh_enable(); __release(lock); (void)(lock); } while (0)
+
+#define __UNLOCK_IRQ(lock)   do { local_irq_enable(); __UNLOCK(lock); } while (0)
+
+#define __UNLOCK_IRQRESTORE(lock, flags)   do { local_irq_restore(flags); __UNLOCK(lock); } while (0)
+
+#define _spin_lock(lock) __LOCK(lock)
+#define _spin_lock_nested(lock, subclass) __LOCK(lock)
+#define _read_lock(lock) __LOCK(lock)
+#define _write_lock(lock) __LOCK(lock)
+#define _spin_lock_bh(lock) __LOCK_BH(lock)
+#define _read_lock_bh(lock) __LOCK_BH(lock)
+#define _write_lock_bh(lock) __LOCK_BH(lock)
+#define _spin_lock_irq(lock) __LOCK_IRQ(lock)
+#define _read_lock_irq(lock) __LOCK_IRQ(lock)
+#define _write_lock_irq(lock) __LOCK_IRQ(lock)
+#define _spin_lock_irqsave(lock, flags) __LOCK_IRQSAVE(lock, flags)
+#define _read_lock_irqsave(lock, flags) __LOCK_IRQSAVE(lock, flags)
+#define _write_lock_irqsave(lock, flags) __LOCK_IRQSAVE(lock, flags)
+#define _spin_trylock(lock) ({ __LOCK(lock); 1; })
+#define _read_trylock(lock) ({ __LOCK(lock); 1; })
+#define _write_trylock(lock) ({ __LOCK(lock); 1; })
+#define _spin_trylock_bh(lock) ({ __LOCK_BH(lock); 1; })
+#define _spin_unlock(lock) __UNLOCK(lock)
+#define _read_unlock(lock) __UNLOCK(lock)
+#define _write_unlock(lock) __UNLOCK(lock)
+#define _spin_unlock_bh(lock) __UNLOCK_BH(lock)
+#define _write_unlock_bh(lock) __UNLOCK_BH(lock)
+#define _read_unlock_bh(lock) __UNLOCK_BH(lock)
+#define _spin_unlock_irq(lock) __UNLOCK_IRQ(lock)
+#define _read_unlock_irq(lock) __UNLOCK_IRQ(lock)
+#define _write_unlock_irq(lock) __UNLOCK_IRQ(lock)
+#define _spin_unlock_irqrestore(lock, flags) __UNLOCK_IRQRESTORE(lock, flags)
+#define _read_unlock_irqrestore(lock, flags) __UNLOCK_IRQRESTORE(lock, flags)
+#define _write_unlock_irqrestore(lock, flags) __UNLOCK_IRQRESTORE(lock, flags)
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/spinlock_types.h b/ndk/platforms/android-3/include/linux/spinlock_types.h
new file mode 100644
index 0000000..0938b51
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/spinlock_types.h
@@ -0,0 +1,46 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __LINUX_SPINLOCK_TYPES_H
+#define __LINUX_SPINLOCK_TYPES_H
+
+#include <linux/lockdep.h>
+
+#include <linux/spinlock_types_up.h>
+
+typedef struct {
+ raw_spinlock_t raw_lock;
+} spinlock_t;
+
+#define SPINLOCK_MAGIC 0xdead4ead
+
+typedef struct {
+ raw_rwlock_t raw_lock;
+} rwlock_t;
+
+#define RWLOCK_MAGIC 0xdeaf1eed
+
+#define SPINLOCK_OWNER_INIT ((void *)-1L)
+
+#define SPIN_DEP_MAP_INIT(lockname)
+
+#define RW_DEP_MAP_INIT(lockname)
+
+#define __SPIN_LOCK_UNLOCKED(lockname)   (spinlock_t) { .raw_lock = __RAW_SPIN_LOCK_UNLOCKED,   SPIN_DEP_MAP_INIT(lockname) }
+#define __RW_LOCK_UNLOCKED(lockname)   (rwlock_t) { .raw_lock = __RAW_RW_LOCK_UNLOCKED,   RW_DEP_MAP_INIT(lockname) }
+
+#define SPIN_LOCK_UNLOCKED __SPIN_LOCK_UNLOCKED(old_style_spin_init)
+#define RW_LOCK_UNLOCKED __RW_LOCK_UNLOCKED(old_style_rw_init)
+
+#define DEFINE_SPINLOCK(x) spinlock_t x = __SPIN_LOCK_UNLOCKED(x)
+#define DEFINE_RWLOCK(x) rwlock_t x = __RW_LOCK_UNLOCKED(x)
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/spinlock_types_up.h b/ndk/platforms/android-3/include/linux/spinlock_types_up.h
new file mode 100644
index 0000000..0db3037
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/spinlock_types_up.h
@@ -0,0 +1,29 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __LINUX_SPINLOCK_TYPES_UP_H
+#define __LINUX_SPINLOCK_TYPES_UP_H
+
+#ifndef __LINUX_SPINLOCK_TYPES_H
+#error "please don't include this file directly"
+#endif
+
+typedef struct { } raw_spinlock_t;
+
+#define __RAW_SPIN_LOCK_UNLOCKED { }
+
+typedef struct {
+
+} raw_rwlock_t;
+
+#define __RAW_RW_LOCK_UNLOCKED { }
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/spinlock_up.h b/ndk/platforms/android-3/include/linux/spinlock_up.h
new file mode 100644
index 0000000..b4958dc
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/spinlock_up.h
@@ -0,0 +1,30 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __LINUX_SPINLOCK_UP_H
+#define __LINUX_SPINLOCK_UP_H
+
+#ifndef __LINUX_SPINLOCK_H
+#error "please don't include this file directly"
+#endif
+
+#define __raw_spin_is_locked(lock) ((void)(lock), 0)
+
+#define __raw_spin_lock(lock) do { (void)(lock); } while (0)
+#define __raw_spin_unlock(lock) do { (void)(lock); } while (0)
+#define __raw_spin_trylock(lock) ({ (void)(lock); 1; })
+
+#define __raw_read_can_lock(lock) (((void)(lock), 1))
+#define __raw_write_can_lock(lock) (((void)(lock), 1))
+
+#define __raw_spin_unlock_wait(lock)   do { cpu_relax(); } while (__raw_spin_is_locked(lock))
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/stacktrace.h b/ndk/platforms/android-3/include/linux/stacktrace.h
new file mode 100644
index 0000000..af7ecc8
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/stacktrace.h
@@ -0,0 +1,18 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __LINUX_STACKTRACE_H
+#define __LINUX_STACKTRACE_H
+
+#define save_stack_trace(trace, task, all, skip) do { } while (0)
+#define print_stack_trace(trace) do { } while (0)
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/stat.h b/ndk/platforms/android-3/include/linux/stat.h
new file mode 100644
index 0000000..0d757f4
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/stat.h
@@ -0,0 +1,54 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_STAT_H
+#define _LINUX_STAT_H
+
+#if !defined(__GLIBC__) || __GLIBC__ < 2
+
+#define S_IFMT 00170000
+#define S_IFSOCK 0140000
+#define S_IFLNK 0120000
+#define S_IFREG 0100000
+#define S_IFBLK 0060000
+#define S_IFDIR 0040000
+#define S_IFCHR 0020000
+#define S_IFIFO 0010000
+#define S_ISUID 0004000
+#define S_ISGID 0002000
+#define S_ISVTX 0001000
+
+#define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
+#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
+#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
+#define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
+#define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
+#define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
+#define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
+
+#define S_IRWXU 00700
+#define S_IRUSR 00400
+#define S_IWUSR 00200
+#define S_IXUSR 00100
+
+#define S_IRWXG 00070
+#define S_IRGRP 00040
+#define S_IWGRP 00020
+#define S_IXGRP 00010
+
+#define S_IRWXO 00007
+#define S_IROTH 00004
+#define S_IWOTH 00002
+#define S_IXOTH 00001
+
+#endif
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/statfs.h b/ndk/platforms/android-3/include/linux/statfs.h
new file mode 100644
index 0000000..43a5d70
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/statfs.h
@@ -0,0 +1,33 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_STATFS_H
+#define _LINUX_STATFS_H
+
+#include <linux/types.h>
+
+#include <asm/statfs.h>
+
+struct kstatfs {
+ long f_type;
+ long f_bsize;
+ u64 f_blocks;
+ u64 f_bfree;
+ u64 f_bavail;
+ u64 f_files;
+ u64 f_ffree;
+ __kernel_fsid_t f_fsid;
+ long f_namelen;
+ long f_frsize;
+ long f_spare[5];
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/stddef.h b/ndk/platforms/android-3/include/linux/stddef.h
new file mode 100644
index 0000000..5412f47
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/stddef.h
@@ -0,0 +1,31 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_STDDEF_H
+#define _LINUX_STDDEF_H
+
+#include <linux/compiler.h>
+
+#undef NULL
+#ifdef __cplusplus
+#define NULL 0
+#else
+#define NULL ((void *)0)
+#endif
+
+#undef offsetof
+#ifdef __compiler_offsetof
+#define offsetof(TYPE,MEMBER) __compiler_offsetof(TYPE,MEMBER)
+#else
+#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
+#endif
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/string.h b/ndk/platforms/android-3/include/linux/string.h
new file mode 100644
index 0000000..6759068
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/string.h
@@ -0,0 +1,15 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_STRING_H_
+#define _LINUX_STRING_H_
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/stringify.h b/ndk/platforms/android-3/include/linux/stringify.h
new file mode 100644
index 0000000..cbb9e5b
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/stringify.h
@@ -0,0 +1,18 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __LINUX_STRINGIFY_H
+#define __LINUX_STRINGIFY_H
+
+#define __stringify_1(x) #x
+#define __stringify(x) __stringify_1(x)
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/sunrpc/auth.h b/ndk/platforms/android-3/include/linux/sunrpc/auth.h
new file mode 100644
index 0000000..ae0a3d0
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/sunrpc/auth.h
@@ -0,0 +1,15 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_SUNRPC_AUTH_H
+#define _LINUX_SUNRPC_AUTH_H
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/sunrpc/auth_gss.h b/ndk/platforms/android-3/include/linux/sunrpc/auth_gss.h
new file mode 100644
index 0000000..a64f1f8
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/sunrpc/auth_gss.h
@@ -0,0 +1,16 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_SUNRPC_AUTH_GSS_H
+#define _LINUX_SUNRPC_AUTH_GSS_H
+
+#endif
+
diff --git a/ndk/platforms/android-3/include/linux/sunrpc/clnt.h b/ndk/platforms/android-3/include/linux/sunrpc/clnt.h
new file mode 100644
index 0000000..a562ad9
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/sunrpc/clnt.h
@@ -0,0 +1,103 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_SUNRPC_CLNT_H
+#define _LINUX_SUNRPC_CLNT_H
+
+#include <linux/sunrpc/msg_prot.h>
+#include <linux/sunrpc/sched.h>
+#include <linux/sunrpc/xprt.h>
+#include <linux/sunrpc/auth.h>
+#include <linux/sunrpc/stats.h>
+#include <linux/sunrpc/xdr.h>
+#include <linux/sunrpc/timer.h>
+#include <asm/signal.h>
+
+struct rpc_portmap {
+ __u32 pm_prog;
+ __u32 pm_vers;
+ __u32 pm_prot;
+ __u16 pm_port;
+ unsigned char pm_binding : 1;
+ struct rpc_wait_queue pm_bindwait;
+};
+
+struct rpc_inode;
+
+struct rpc_clnt {
+ atomic_t cl_count;
+ atomic_t cl_users;
+ struct rpc_xprt * cl_xprt;
+ struct rpc_procinfo * cl_procinfo;
+ u32 cl_maxproc;
+
+ char * cl_server;
+ char * cl_protname;
+ struct rpc_auth * cl_auth;
+ struct rpc_stat * cl_stats;
+ struct rpc_iostats * cl_metrics;
+
+ unsigned int cl_softrtry : 1,
+ cl_intr : 1,
+ cl_autobind : 1,
+ cl_oneshot : 1,
+ cl_dead : 1;
+
+ struct rpc_rtt * cl_rtt;
+ struct rpc_portmap * cl_pmap;
+
+ int cl_nodelen;
+ char cl_nodename[UNX_MAXNODENAME];
+ char cl_pathname[30];
+ struct vfsmount * cl_vfsmnt;
+ struct dentry * cl_dentry;
+ struct rpc_clnt * cl_parent;
+ struct rpc_rtt cl_rtt_default;
+ struct rpc_portmap cl_pmap_default;
+ char cl_inline_name[32];
+};
+#define cl_timeout cl_xprt->timeout
+#define cl_prog cl_pmap->pm_prog
+#define cl_vers cl_pmap->pm_vers
+#define cl_port cl_pmap->pm_port
+#define cl_prot cl_pmap->pm_prot
+
+#define RPC_MAXVERSION 4
+struct rpc_program {
+ char * name;
+ u32 number;
+ unsigned int nrvers;
+ struct rpc_version ** version;
+ struct rpc_stat * stats;
+ char * pipe_dir_name;
+};
+
+struct rpc_version {
+ u32 number;
+ unsigned int nrprocs;
+ struct rpc_procinfo * procs;
+};
+
+struct rpc_procinfo {
+ u32 p_proc;
+ kxdrproc_t p_encode;
+ kxdrproc_t p_decode;
+ unsigned int p_bufsiz;
+ unsigned int p_count;
+ unsigned int p_timer;
+ u32 p_statidx;
+ char * p_name;
+};
+
+#define RPC_CONGESTED(clnt) (RPCXPRT_CONGESTED((clnt)->cl_xprt))
+#define RPC_PEERADDR(clnt) (&(clnt)->cl_xprt->addr)
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/sunrpc/debug.h b/ndk/platforms/android-3/include/linux/sunrpc/debug.h
new file mode 100644
index 0000000..e2689f1
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/sunrpc/debug.h
@@ -0,0 +1,42 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_SUNRPC_DEBUG_H_
+#define _LINUX_SUNRPC_DEBUG_H_
+
+#define RPCDBG_XPRT 0x0001
+#define RPCDBG_CALL 0x0002
+#define RPCDBG_DEBUG 0x0004
+#define RPCDBG_NFS 0x0008
+#define RPCDBG_AUTH 0x0010
+#define RPCDBG_PMAP 0x0020
+#define RPCDBG_SCHED 0x0040
+#define RPCDBG_TRANS 0x0080
+#define RPCDBG_SVCSOCK 0x0100
+#define RPCDBG_SVCDSP 0x0200
+#define RPCDBG_MISC 0x0400
+#define RPCDBG_CACHE 0x0800
+#define RPCDBG_ALL 0x7fff
+
+#define CTL_SUNRPC 7249  
+
+enum {
+ CTL_RPCDEBUG = 1,
+ CTL_NFSDEBUG,
+ CTL_NFSDDEBUG,
+ CTL_NLMDEBUG,
+ CTL_SLOTTABLE_UDP,
+ CTL_SLOTTABLE_TCP,
+ CTL_MIN_RESVPORT,
+ CTL_MAX_RESVPORT,
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/sunrpc/gss_api.h b/ndk/platforms/android-3/include/linux/sunrpc/gss_api.h
new file mode 100644
index 0000000..cbc77c2
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/sunrpc/gss_api.h
@@ -0,0 +1,16 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_SUNRPC_GSS_API_H
+#define _LINUX_SUNRPC_GSS_API_H
+
+#endif
+
diff --git a/ndk/platforms/android-3/include/linux/sunrpc/gss_asn1.h b/ndk/platforms/android-3/include/linux/sunrpc/gss_asn1.h
new file mode 100644
index 0000000..8f18ba0
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/sunrpc/gss_asn1.h
@@ -0,0 +1,35 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#include <linux/sunrpc/gss_api.h>
+
+#define SIZEOF_INT 4
+
+#define G_BAD_SERVICE_NAME (-2045022976L)
+#define G_BAD_STRING_UID (-2045022975L)
+#define G_NOUSER (-2045022974L)
+#define G_VALIDATE_FAILED (-2045022973L)
+#define G_BUFFER_ALLOC (-2045022972L)
+#define G_BAD_MSG_CTX (-2045022971L)
+#define G_WRONG_SIZE (-2045022970L)
+#define G_BAD_USAGE (-2045022969L)
+#define G_UNKNOWN_QOP (-2045022968L)
+#define G_NO_HOSTNAME (-2045022967L)
+#define G_BAD_HOSTNAME (-2045022966L)
+#define G_WRONG_MECH (-2045022965L)
+#define G_BAD_TOK_HEADER (-2045022964L)
+#define G_BAD_DIRECTION (-2045022963L)
+#define G_TOK_TRUNC (-2045022962L)
+#define G_REFLECT (-2045022961L)
+#define G_WRONG_TOKID (-2045022960L)
+
+#define g_OID_equal(o1,o2)   (((o1)->len == (o2)->len) &&   (memcmp((o1)->data,(o2)->data,(int) (o1)->len) == 0))
+
diff --git a/ndk/platforms/android-3/include/linux/sunrpc/gss_err.h b/ndk/platforms/android-3/include/linux/sunrpc/gss_err.h
new file mode 100644
index 0000000..01fb1b4
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/sunrpc/gss_err.h
@@ -0,0 +1,15 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_SUNRPC_GSS_ERR_H
+#define _LINUX_SUNRPC_GSS_ERR_H
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/sunrpc/msg_prot.h b/ndk/platforms/android-3/include/linux/sunrpc/msg_prot.h
new file mode 100644
index 0000000..52f4e76
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/sunrpc/msg_prot.h
@@ -0,0 +1,15 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_SUNRPC_MSGPROT_H_
+#define _LINUX_SUNRPC_MSGPROT_H_
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/sunrpc/sched.h b/ndk/platforms/android-3/include/linux/sunrpc/sched.h
new file mode 100644
index 0000000..859b2d8
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/sunrpc/sched.h
@@ -0,0 +1,182 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_SUNRPC_SCHED_H_
+#define _LINUX_SUNRPC_SCHED_H_
+
+#include <linux/timer.h>
+#include <linux/sunrpc/types.h>
+#include <linux/spinlock.h>
+#include <linux/wait.h>
+#include <linux/workqueue.h>
+#include <linux/sunrpc/xdr.h>
+
+struct rpc_procinfo;
+struct rpc_message {
+ struct rpc_procinfo * rpc_proc;
+ void * rpc_argp;
+ void * rpc_resp;
+ struct rpc_cred * rpc_cred;
+};
+
+struct rpc_call_ops;
+struct rpc_wait_queue;
+struct rpc_wait {
+ struct list_head list;
+ struct list_head links;
+ struct rpc_wait_queue * rpc_waitq;
+};
+
+struct rpc_task {
+#ifdef RPC_DEBUG
+ unsigned long tk_magic;
+#endif
+ atomic_t tk_count;
+ struct list_head tk_task;
+ struct rpc_clnt * tk_client;
+ struct rpc_rqst * tk_rqstp;
+ int tk_status;
+
+ struct rpc_message tk_msg;
+ __u8 tk_garb_retry;
+ __u8 tk_cred_retry;
+
+ unsigned long tk_cookie;
+
+ void (*tk_timeout_fn)(struct rpc_task *);
+ void (*tk_callback)(struct rpc_task *);
+ void (*tk_action)(struct rpc_task *);
+ const struct rpc_call_ops *tk_ops;
+ void * tk_calldata;
+
+ struct timer_list tk_timer;
+ unsigned long tk_timeout;
+ unsigned short tk_flags;
+ unsigned char tk_priority : 2;
+ unsigned long tk_runstate;
+ struct workqueue_struct *tk_workqueue;
+ union {
+ struct work_struct tk_work;
+ struct rpc_wait tk_wait;
+ } u;
+
+ unsigned short tk_timeouts;
+ size_t tk_bytes_sent;
+ unsigned long tk_start;
+ long tk_rtt;
+
+#ifdef RPC_DEBUG
+ unsigned short tk_pid;
+#endif
+};
+#define tk_auth tk_client->cl_auth
+#define tk_xprt tk_client->cl_xprt
+
+#define task_for_each(task, pos, head)   list_for_each(pos, head)   if ((task=list_entry(pos, struct rpc_task, u.tk_wait.list)),1)
+
+#define task_for_first(task, head)   if (!list_empty(head) &&   ((task=list_entry((head)->next, struct rpc_task, u.tk_wait.list)),1))
+
+#define alltask_for_each(task, pos, head)   list_for_each(pos, head)   if ((task=list_entry(pos, struct rpc_task, tk_task)),1)
+
+typedef void (*rpc_action)(struct rpc_task *);
+
+struct rpc_call_ops {
+ void (*rpc_call_prepare)(struct rpc_task *, void *);
+ void (*rpc_call_done)(struct rpc_task *, void *);
+ void (*rpc_release)(void *);
+};
+
+#define RPC_TASK_ASYNC 0x0001  
+#define RPC_TASK_SWAPPER 0x0002  
+#define RPC_TASK_CHILD 0x0008  
+#define RPC_CALL_MAJORSEEN 0x0020  
+#define RPC_TASK_ROOTCREDS 0x0040  
+#define RPC_TASK_DYNAMIC 0x0080  
+#define RPC_TASK_KILLED 0x0100  
+#define RPC_TASK_SOFT 0x0200  
+#define RPC_TASK_NOINTR 0x0400  
+
+#define RPC_IS_ASYNC(t) ((t)->tk_flags & RPC_TASK_ASYNC)
+#define RPC_IS_CHILD(t) ((t)->tk_flags & RPC_TASK_CHILD)
+#define RPC_IS_SWAPPER(t) ((t)->tk_flags & RPC_TASK_SWAPPER)
+#define RPC_DO_ROOTOVERRIDE(t) ((t)->tk_flags & RPC_TASK_ROOTCREDS)
+#define RPC_ASSASSINATED(t) ((t)->tk_flags & RPC_TASK_KILLED)
+#define RPC_DO_CALLBACK(t) ((t)->tk_callback != NULL)
+#define RPC_IS_SOFT(t) ((t)->tk_flags & RPC_TASK_SOFT)
+#define RPC_TASK_UNINTERRUPTIBLE(t) ((t)->tk_flags & RPC_TASK_NOINTR)
+
+#define RPC_TASK_RUNNING 0
+#define RPC_TASK_QUEUED 1
+#define RPC_TASK_WAKEUP 2
+#define RPC_TASK_HAS_TIMER 3
+#define RPC_TASK_ACTIVE 4
+
+#define RPC_IS_RUNNING(t) (test_bit(RPC_TASK_RUNNING, &(t)->tk_runstate))
+#define rpc_set_running(t) (set_bit(RPC_TASK_RUNNING, &(t)->tk_runstate))
+#define rpc_test_and_set_running(t)   (test_and_set_bit(RPC_TASK_RUNNING, &(t)->tk_runstate))
+#define rpc_clear_running(t)   do {   smp_mb__before_clear_bit();   clear_bit(RPC_TASK_RUNNING, &(t)->tk_runstate);   smp_mb__after_clear_bit();   } while (0)
+
+#define RPC_IS_QUEUED(t) (test_bit(RPC_TASK_QUEUED, &(t)->tk_runstate))
+#define rpc_set_queued(t) (set_bit(RPC_TASK_QUEUED, &(t)->tk_runstate))
+#define rpc_clear_queued(t)   do {   smp_mb__before_clear_bit();   clear_bit(RPC_TASK_QUEUED, &(t)->tk_runstate);   smp_mb__after_clear_bit();   } while (0)
+
+#define rpc_start_wakeup(t)   (test_and_set_bit(RPC_TASK_WAKEUP, &(t)->tk_runstate) == 0)
+#define rpc_finish_wakeup(t)   do {   smp_mb__before_clear_bit();   clear_bit(RPC_TASK_WAKEUP, &(t)->tk_runstate);   smp_mb__after_clear_bit();   } while (0)
+
+#define RPC_IS_ACTIVATED(t) (test_bit(RPC_TASK_ACTIVE, &(t)->tk_runstate))
+#define rpc_set_active(t) (set_bit(RPC_TASK_ACTIVE, &(t)->tk_runstate))
+#define rpc_clear_active(t)   do {   smp_mb__before_clear_bit();   clear_bit(RPC_TASK_ACTIVE, &(t)->tk_runstate);   smp_mb__after_clear_bit();   } while(0)
+
+#define RPC_PRIORITY_LOW 0
+#define RPC_PRIORITY_NORMAL 1
+#define RPC_PRIORITY_HIGH 2
+#define RPC_NR_PRIORITY (RPC_PRIORITY_HIGH+1)
+
+struct rpc_wait_queue {
+ spinlock_t lock;
+ struct list_head tasks[RPC_NR_PRIORITY];
+ unsigned long cookie;
+ unsigned char maxpriority;
+ unsigned char priority;
+ unsigned char count;
+ unsigned char nr;
+ unsigned short qlen;
+#ifdef RPC_DEBUG
+ const char * name;
+#endif
+};
+
+#define RPC_BATCH_COUNT 16
+
+#ifndef RPC_DEBUG
+#define RPC_WAITQ_INIT(var,qname) {   .lock = SPIN_LOCK_UNLOCKED,   .tasks = {   [0] = LIST_HEAD_INIT(var.tasks[0]),   [1] = LIST_HEAD_INIT(var.tasks[1]),   [2] = LIST_HEAD_INIT(var.tasks[2]),   },   }
+#else
+#define RPC_WAITQ_INIT(var,qname) {   .lock = SPIN_LOCK_UNLOCKED,   .tasks = {   [0] = LIST_HEAD_INIT(var.tasks[0]),   [1] = LIST_HEAD_INIT(var.tasks[1]),   [2] = LIST_HEAD_INIT(var.tasks[2]),   },   .name = qname,   }
+#endif
+#define RPC_WAITQ(var,qname) struct rpc_wait_queue var = RPC_WAITQ_INIT(var,qname)
+
+#define RPC_IS_PRIORITY(q) ((q)->maxpriority > 0)
+
+struct rpc_task *rpc_new_task(struct rpc_clnt *, int flags,
+ const struct rpc_call_ops *ops, void *data);
+struct rpc_task *rpc_run_task(struct rpc_clnt *clnt, int flags,
+ const struct rpc_call_ops *ops, void *data);
+struct rpc_task *rpc_new_child(struct rpc_clnt *, struct rpc_task *parent);
+
+struct rpc_task *rpc_wake_up_next(struct rpc_wait_queue *);
+
+#ifdef RPC_DEBUG
+
+#endif
+
+#ifdef RPC_DEBUG
+#endif
+#endif
diff --git a/ndk/platforms/android-3/include/linux/sunrpc/stats.h b/ndk/platforms/android-3/include/linux/sunrpc/stats.h
new file mode 100644
index 0000000..03e7338
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/sunrpc/stats.h
@@ -0,0 +1,49 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_SUNRPC_STATS_H
+#define _LINUX_SUNRPC_STATS_H
+
+#include <linux/proc_fs.h>
+
+struct rpc_stat {
+ struct rpc_program * program;
+
+ unsigned int netcnt,
+ netudpcnt,
+ nettcpcnt,
+ nettcpconn,
+ netreconn;
+ unsigned int rpccnt,
+ rpcretrans,
+ rpcauthrefresh,
+ rpcgarbage;
+};
+
+struct svc_stat {
+ struct svc_program * program;
+
+ unsigned int netcnt,
+ netudpcnt,
+ nettcpcnt,
+ nettcpconn;
+ unsigned int rpccnt,
+ rpcbadfmt,
+ rpcbadauth,
+ rpcbadclnt;
+};
+
+#ifdef MODULE
+
+#endif
+
+#define proc_net_rpc NULL
+#endif
diff --git a/ndk/platforms/android-3/include/linux/sunrpc/svc.h b/ndk/platforms/android-3/include/linux/sunrpc/svc.h
new file mode 100644
index 0000000..7a0cc2d
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/sunrpc/svc.h
@@ -0,0 +1,82 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef SUNRPC_SVC_H
+#define SUNRPC_SVC_H
+
+#include <linux/in.h>
+#include <linux/sunrpc/types.h>
+#include <linux/sunrpc/xdr.h>
+#include <linux/sunrpc/svcauth.h>
+#include <linux/wait.h>
+#include <linux/mm.h>
+
+struct svc_serv {
+ struct list_head sv_threads;
+ struct list_head sv_sockets;
+ struct svc_program * sv_program;
+ struct svc_stat * sv_stats;
+ spinlock_t sv_lock;
+ unsigned int sv_nrthreads;
+ unsigned int sv_bufsz;
+ unsigned int sv_xdrsize;
+
+ struct list_head sv_permsocks;
+ struct list_head sv_tempsocks;
+ int sv_tmpcnt;
+
+ char * sv_name;
+};
+
+#define RPCSVC_MAXPAYLOAD (64*1024u)
+
+#define RPCSVC_MAXPAGES ((RPCSVC_MAXPAYLOAD+PAGE_SIZE-1)/PAGE_SIZE + 2)
+
+struct svc_program {
+ struct svc_program * pg_next;
+ u32 pg_prog;
+ unsigned int pg_lovers;
+ unsigned int pg_hivers;
+ unsigned int pg_nvers;
+ struct svc_version ** pg_vers;
+ char * pg_name;
+ char * pg_class;
+ struct svc_stat * pg_stats;
+ int (*pg_authenticate)(struct svc_rqst *);
+};
+
+struct svc_version {
+ u32 vs_vers;
+ u32 vs_nproc;
+ struct svc_procedure * vs_proc;
+ u32 vs_xdrsize;
+
+ int (*vs_dispatch)(struct svc_rqst *, u32 *);
+};
+
+typedef int (*svc_procfunc)(struct svc_rqst *, void *argp, void *resp);
+struct svc_procedure {
+ svc_procfunc pc_func;
+ kxdrproc_t pc_decode;
+ kxdrproc_t pc_encode;
+ kxdrproc_t pc_release;
+ unsigned int pc_argsize;
+ unsigned int pc_ressize;
+ unsigned int pc_count;
+ unsigned int pc_cachetype;
+ unsigned int pc_xdrressize;
+};
+
+typedef void (*svc_thread_fn)(struct svc_rqst *);
+
+struct svc_serv * svc_create(struct svc_program *, unsigned int);
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/sunrpc/svcauth.h b/ndk/platforms/android-3/include/linux/sunrpc/svcauth.h
new file mode 100644
index 0000000..9b414d7
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/sunrpc/svcauth.h
@@ -0,0 +1,15 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_SUNRPC_SVCAUTH_H_
+#define _LINUX_SUNRPC_SVCAUTH_H_
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/sunrpc/timer.h b/ndk/platforms/android-3/include/linux/sunrpc/timer.h
new file mode 100644
index 0000000..8fb78e5
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/sunrpc/timer.h
@@ -0,0 +1,24 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_SUNRPC_TIMER_H
+#define _LINUX_SUNRPC_TIMER_H
+
+#include <asm/atomic.h>
+
+struct rpc_rtt {
+ unsigned long timeo;
+ unsigned long srtt[5];
+ unsigned long sdrtt[5];
+ int ntimeouts[5];
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/sunrpc/types.h b/ndk/platforms/android-3/include/linux/sunrpc/types.h
new file mode 100644
index 0000000..ce52052
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/sunrpc/types.h
@@ -0,0 +1,22 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_SUNRPC_TYPES_H_
+#define _LINUX_SUNRPC_TYPES_H_
+
+#include <linux/timer.h>
+#include <linux/workqueue.h>
+#include <linux/sunrpc/debug.h>
+#include <linux/list.h>
+
+#define signalled() (signal_pending(current))
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/sunrpc/xdr.h b/ndk/platforms/android-3/include/linux/sunrpc/xdr.h
new file mode 100644
index 0000000..d513843
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/sunrpc/xdr.h
@@ -0,0 +1,15 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _SUNRPC_XDR_H_
+#define _SUNRPC_XDR_H_
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/sunrpc/xprt.h b/ndk/platforms/android-3/include/linux/sunrpc/xprt.h
new file mode 100644
index 0000000..145a26d
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/sunrpc/xprt.h
@@ -0,0 +1,172 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_SUNRPC_XPRT_H
+#define _LINUX_SUNRPC_XPRT_H
+
+#include <linux/uio.h>
+#include <linux/socket.h>
+#include <linux/in.h>
+#include <linux/sunrpc/sched.h>
+#include <linux/sunrpc/xdr.h>
+
+#define RPC_MIN_SLOT_TABLE (2U)
+#define RPC_DEF_SLOT_TABLE (16U)
+#define RPC_MAX_SLOT_TABLE (128U)
+
+#define RPC_CALLHDRSIZE 6
+#define RPC_REPHDRSIZE 4
+
+#define RPC_MIN_RESVPORT (1U)
+#define RPC_MAX_RESVPORT (65535U)
+#define RPC_DEF_MIN_RESVPORT (665U)
+#define RPC_DEF_MAX_RESVPORT (1023U)
+
+struct rpc_timeout {
+ unsigned long to_initval,
+ to_maxval,
+ to_increment;
+ unsigned int to_retries;
+ unsigned char to_exponential;
+};
+
+struct rpc_task;
+struct rpc_xprt;
+struct seq_file;
+
+struct rpc_rqst {
+
+ struct rpc_xprt * rq_xprt;
+ struct xdr_buf rq_snd_buf;
+ struct xdr_buf rq_rcv_buf;
+
+ struct rpc_task * rq_task;
+ __u32 rq_xid;
+ int rq_cong;
+ int rq_received;
+ u32 rq_seqno;
+ int rq_enc_pages_num;
+ struct page **rq_enc_pages;
+ void (*rq_release_snd_buf)(struct rpc_rqst *);
+ struct list_head rq_list;
+
+ __u32 * rq_buffer;
+ size_t rq_bufsize;
+
+ struct xdr_buf rq_private_buf;
+ unsigned long rq_majortimeo;
+ unsigned long rq_timeout;
+ unsigned int rq_retries;
+
+ u32 rq_bytes_sent;
+
+ unsigned long rq_xtime;
+ int rq_ntrans;
+};
+#define rq_svec rq_snd_buf.head
+#define rq_slen rq_snd_buf.len
+
+struct rpc_xprt_ops {
+ void (*set_buffer_size)(struct rpc_xprt *xprt, size_t sndsize, size_t rcvsize);
+ int (*reserve_xprt)(struct rpc_task *task);
+ void (*release_xprt)(struct rpc_xprt *xprt, struct rpc_task *task);
+ void (*set_port)(struct rpc_xprt *xprt, unsigned short port);
+ void (*connect)(struct rpc_task *task);
+ void * (*buf_alloc)(struct rpc_task *task, size_t size);
+ void (*buf_free)(struct rpc_task *task);
+ int (*send_request)(struct rpc_task *task);
+ void (*set_retrans_timeout)(struct rpc_task *task);
+ void (*timer)(struct rpc_task *task);
+ void (*release_request)(struct rpc_task *task);
+ void (*close)(struct rpc_xprt *xprt);
+ void (*destroy)(struct rpc_xprt *xprt);
+ void (*print_stats)(struct rpc_xprt *xprt, struct seq_file *seq);
+};
+
+struct rpc_xprt {
+ struct rpc_xprt_ops * ops;
+ struct socket * sock;
+ struct sock * inet;
+
+ struct rpc_timeout timeout;
+ struct sockaddr_in addr;
+ int prot;
+
+ unsigned long cong;
+ unsigned long cwnd;
+
+ size_t rcvsize,
+ sndsize;
+
+ size_t max_payload;
+ unsigned int tsh_size;
+
+ struct rpc_wait_queue sending;
+ struct rpc_wait_queue resend;
+ struct rpc_wait_queue pending;
+ struct rpc_wait_queue backlog;
+ struct list_head free;
+ struct rpc_rqst * slot;
+ unsigned int max_reqs;
+ unsigned long state;
+ unsigned char shutdown : 1,
+ resvport : 1;
+
+ __u32 xid;
+
+ u32 tcp_recm,
+ tcp_xid,
+ tcp_reclen,
+ tcp_offset;
+ unsigned long tcp_copied,
+ tcp_flags;
+
+ unsigned long connect_timeout,
+ bind_timeout,
+ reestablish_timeout;
+ struct work_struct connect_worker;
+ unsigned short port;
+
+ struct work_struct task_cleanup;
+ struct timer_list timer;
+ unsigned long last_used,
+ idle_timeout;
+
+ spinlock_t transport_lock;
+ spinlock_t reserve_lock;
+ struct rpc_task * snd_task;
+
+ struct list_head recv;
+
+ struct {
+ unsigned long bind_count,
+ connect_count,
+ connect_start,
+ connect_time,
+ sends,
+ recvs,
+ bad_xids;
+
+ unsigned long long req_u,
+ bklog_u;
+ } stat;
+
+ void (*old_data_ready)(struct sock *, int);
+ void (*old_state_change)(struct sock *);
+ void (*old_write_space)(struct sock *);
+};
+
+#define XPRT_LAST_FRAG (1 << 0)
+#define XPRT_COPY_RECM (1 << 1)
+#define XPRT_COPY_XID (1 << 2)
+#define XPRT_COPY_DATA (1 << 3)
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/swap.h b/ndk/platforms/android-3/include/linux/swap.h
new file mode 100644
index 0000000..63ba556
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/swap.h
@@ -0,0 +1,39 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_SWAP_H
+#define _LINUX_SWAP_H
+
+#include <linux/spinlock.h>
+#include <linux/linkage.h>
+#include <linux/mmzone.h>
+#include <linux/list.h>
+#include <linux/sched.h>
+
+#include <asm/atomic.h>
+#include <asm/page.h>
+
+#define SWAP_FLAG_PREFER 0x8000  
+#define SWAP_FLAG_PRIO_MASK 0x7fff
+#define SWAP_FLAG_PRIO_SHIFT 0
+
+#define MAX_SWAPFILES_SHIFT 5
+#define MAX_SWAPFILES (1 << MAX_SWAPFILES_SHIFT)
+
+typedef struct {
+ unsigned long val;
+} swp_entry_t;
+
+struct reclaim_state {
+ unsigned long reclaimed_slab;
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/sysctl.h b/ndk/platforms/android-3/include/linux/sysctl.h
new file mode 100644
index 0000000..329e561
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/sysctl.h
@@ -0,0 +1,824 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_SYSCTL_H
+#define _LINUX_SYSCTL_H
+
+#include <linux/kernel.h>
+#include <linux/types.h>
+#include <linux/compiler.h>
+
+struct file;
+struct completion;
+
+#define CTL_MAXNAME 10  
+
+struct __sysctl_args {
+ int __user *name;
+ int nlen;
+ void __user *oldval;
+ size_t __user *oldlenp;
+ void __user *newval;
+ size_t newlen;
+ unsigned long __unused[4];
+};
+
+enum
+{
+ CTL_KERN=1,
+ CTL_VM=2,
+ CTL_NET=3,
+
+ CTL_FS=5,
+ CTL_DEBUG=6,
+ CTL_DEV=7,
+ CTL_BUS=8,
+ CTL_ABI=9,
+ CTL_CPU=10
+};
+
+enum
+{
+ CTL_BUS_ISA=1
+};
+
+enum
+{
+ INOTIFY_MAX_USER_INSTANCES=1,
+ INOTIFY_MAX_USER_WATCHES=2,
+ INOTIFY_MAX_QUEUED_EVENTS=3
+};
+
+enum
+{
+ KERN_OSTYPE=1,
+ KERN_OSRELEASE=2,
+ KERN_OSREV=3,
+ KERN_VERSION=4,
+ KERN_SECUREMASK=5,
+ KERN_PROF=6,
+ KERN_NODENAME=7,
+ KERN_DOMAINNAME=8,
+
+ KERN_CAP_BSET=14,
+ KERN_PANIC=15,
+ KERN_REALROOTDEV=16,
+
+ KERN_SPARC_REBOOT=21,
+ KERN_CTLALTDEL=22,
+ KERN_PRINTK=23,
+ KERN_NAMETRANS=24,
+ KERN_PPC_HTABRECLAIM=25,
+ KERN_PPC_ZEROPAGED=26,
+ KERN_PPC_POWERSAVE_NAP=27,
+ KERN_MODPROBE=28,
+ KERN_SG_BIG_BUFF=29,
+ KERN_ACCT=30,
+ KERN_PPC_L2CR=31,
+
+ KERN_RTSIGNR=32,
+ KERN_RTSIGMAX=33,
+
+ KERN_SHMMAX=34,
+ KERN_MSGMAX=35,
+ KERN_MSGMNB=36,
+ KERN_MSGPOOL=37,
+ KERN_SYSRQ=38,
+ KERN_MAX_THREADS=39,
+ KERN_RANDOM=40,
+ KERN_SHMALL=41,
+ KERN_MSGMNI=42,
+ KERN_SEM=43,
+ KERN_SPARC_STOP_A=44,
+ KERN_SHMMNI=45,
+ KERN_OVERFLOWUID=46,
+ KERN_OVERFLOWGID=47,
+ KERN_SHMPATH=48,
+ KERN_HOTPLUG=49,
+ KERN_IEEE_EMULATION_WARNINGS=50,
+ KERN_S390_USER_DEBUG_LOGGING=51,
+ KERN_CORE_USES_PID=52,
+ KERN_TAINTED=53,
+ KERN_CADPID=54,
+ KERN_PIDMAX=55,
+ KERN_CORE_PATTERN=56,
+ KERN_PANIC_ON_OOPS=57,
+ KERN_HPPA_PWRSW=58,
+ KERN_HPPA_UNALIGNED=59,
+ KERN_PRINTK_RATELIMIT=60,
+ KERN_PRINTK_RATELIMIT_BURST=61,
+ KERN_PTY=62,
+ KERN_NGROUPS_MAX=63,
+ KERN_SPARC_SCONS_PWROFF=64,
+ KERN_HZ_TIMER=65,
+ KERN_UNKNOWN_NMI_PANIC=66,
+ KERN_BOOTLOADER_TYPE=67,
+ KERN_RANDOMIZE=68,
+ KERN_SETUID_DUMPABLE=69,
+ KERN_SPIN_RETRY=70,
+ KERN_ACPI_VIDEO_FLAGS=71,
+ KERN_IA64_UNALIGNED=72,
+ KERN_COMPAT_LOG=73,
+ KERN_MAX_LOCK_DEPTH=74,
+};
+
+enum
+{
+ VM_UNUSED1=1,
+ VM_UNUSED2=2,
+ VM_UNUSED3=3,
+ VM_UNUSED4=4,
+ VM_OVERCOMMIT_MEMORY=5,
+ VM_UNUSED5=6,
+ VM_UNUSED7=7,
+ VM_UNUSED8=8,
+ VM_UNUSED9=9,
+ VM_PAGE_CLUSTER=10,
+ VM_DIRTY_BACKGROUND=11,
+ VM_DIRTY_RATIO=12,
+ VM_DIRTY_WB_CS=13,
+ VM_DIRTY_EXPIRE_CS=14,
+ VM_NR_PDFLUSH_THREADS=15,
+ VM_OVERCOMMIT_RATIO=16,
+ VM_PAGEBUF=17,
+ VM_HUGETLB_PAGES=18,
+ VM_SWAPPINESS=19,
+ VM_LOWMEM_RESERVE_RATIO=20,
+ VM_MIN_FREE_KBYTES=21,
+ VM_MAX_MAP_COUNT=22,
+ VM_LAPTOP_MODE=23,
+ VM_BLOCK_DUMP=24,
+ VM_HUGETLB_GROUP=25,
+ VM_VFS_CACHE_PRESSURE=26,
+ VM_LEGACY_VA_LAYOUT=27,
+ VM_SWAP_TOKEN_TIMEOUT=28,
+ VM_DROP_PAGECACHE=29,
+ VM_PERCPU_PAGELIST_FRACTION=30,
+ VM_ZONE_RECLAIM_MODE=31,
+ VM_MIN_UNMAPPED=32,
+ VM_PANIC_ON_OOM=33,
+ VM_VDSO_ENABLED=34,
+};
+
+enum
+{
+ NET_CORE=1,
+ NET_ETHER=2,
+ NET_802=3,
+ NET_UNIX=4,
+ NET_IPV4=5,
+ NET_IPX=6,
+ NET_ATALK=7,
+ NET_NETROM=8,
+ NET_AX25=9,
+ NET_BRIDGE=10,
+ NET_ROSE=11,
+ NET_IPV6=12,
+ NET_X25=13,
+ NET_TR=14,
+ NET_DECNET=15,
+ NET_ECONET=16,
+ NET_SCTP=17,
+ NET_LLC=18,
+ NET_NETFILTER=19,
+ NET_DCCP=20,
+};
+
+enum
+{
+ RANDOM_POOLSIZE=1,
+ RANDOM_ENTROPY_COUNT=2,
+ RANDOM_READ_THRESH=3,
+ RANDOM_WRITE_THRESH=4,
+ RANDOM_BOOT_ID=5,
+ RANDOM_UUID=6
+};
+
+enum
+{
+ PTY_MAX=1,
+ PTY_NR=2
+};
+
+enum
+{
+ BUS_ISA_MEM_BASE=1,
+ BUS_ISA_PORT_BASE=2,
+ BUS_ISA_PORT_SHIFT=3
+};
+
+enum
+{
+ NET_CORE_WMEM_MAX=1,
+ NET_CORE_RMEM_MAX=2,
+ NET_CORE_WMEM_DEFAULT=3,
+ NET_CORE_RMEM_DEFAULT=4,
+
+ NET_CORE_MAX_BACKLOG=6,
+ NET_CORE_FASTROUTE=7,
+ NET_CORE_MSG_COST=8,
+ NET_CORE_MSG_BURST=9,
+ NET_CORE_OPTMEM_MAX=10,
+ NET_CORE_HOT_LIST_LENGTH=11,
+ NET_CORE_DIVERT_VERSION=12,
+ NET_CORE_NO_CONG_THRESH=13,
+ NET_CORE_NO_CONG=14,
+ NET_CORE_LO_CONG=15,
+ NET_CORE_MOD_CONG=16,
+ NET_CORE_DEV_WEIGHT=17,
+ NET_CORE_SOMAXCONN=18,
+ NET_CORE_BUDGET=19,
+ NET_CORE_AEVENT_ETIME=20,
+ NET_CORE_AEVENT_RSEQTH=21,
+};
+
+enum
+{
+ NET_UNIX_DESTROY_DELAY=1,
+ NET_UNIX_DELETE_DELAY=2,
+ NET_UNIX_MAX_DGRAM_QLEN=3,
+};
+
+enum
+{
+ NET_NF_CONNTRACK_MAX=1,
+ NET_NF_CONNTRACK_TCP_TIMEOUT_SYN_SENT=2,
+ NET_NF_CONNTRACK_TCP_TIMEOUT_SYN_RECV=3,
+ NET_NF_CONNTRACK_TCP_TIMEOUT_ESTABLISHED=4,
+ NET_NF_CONNTRACK_TCP_TIMEOUT_FIN_WAIT=5,
+ NET_NF_CONNTRACK_TCP_TIMEOUT_CLOSE_WAIT=6,
+ NET_NF_CONNTRACK_TCP_TIMEOUT_LAST_ACK=7,
+ NET_NF_CONNTRACK_TCP_TIMEOUT_TIME_WAIT=8,
+ NET_NF_CONNTRACK_TCP_TIMEOUT_CLOSE=9,
+ NET_NF_CONNTRACK_UDP_TIMEOUT=10,
+ NET_NF_CONNTRACK_UDP_TIMEOUT_STREAM=11,
+ NET_NF_CONNTRACK_ICMP_TIMEOUT=12,
+ NET_NF_CONNTRACK_GENERIC_TIMEOUT=13,
+ NET_NF_CONNTRACK_BUCKETS=14,
+ NET_NF_CONNTRACK_LOG_INVALID=15,
+ NET_NF_CONNTRACK_TCP_TIMEOUT_MAX_RETRANS=16,
+ NET_NF_CONNTRACK_TCP_LOOSE=17,
+ NET_NF_CONNTRACK_TCP_BE_LIBERAL=18,
+ NET_NF_CONNTRACK_TCP_MAX_RETRANS=19,
+ NET_NF_CONNTRACK_SCTP_TIMEOUT_CLOSED=20,
+ NET_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_WAIT=21,
+ NET_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_ECHOED=22,
+ NET_NF_CONNTRACK_SCTP_TIMEOUT_ESTABLISHED=23,
+ NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_SENT=24,
+ NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_RECD=25,
+ NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_ACK_SENT=26,
+ NET_NF_CONNTRACK_COUNT=27,
+ NET_NF_CONNTRACK_ICMPV6_TIMEOUT=28,
+ NET_NF_CONNTRACK_FRAG6_TIMEOUT=29,
+ NET_NF_CONNTRACK_FRAG6_LOW_THRESH=30,
+ NET_NF_CONNTRACK_FRAG6_HIGH_THRESH=31,
+ NET_NF_CONNTRACK_CHECKSUM=32,
+};
+
+enum
+{
+
+ NET_IPV4_FORWARD=8,
+ NET_IPV4_DYNADDR=9,
+
+ NET_IPV4_CONF=16,
+ NET_IPV4_NEIGH=17,
+ NET_IPV4_ROUTE=18,
+ NET_IPV4_FIB_HASH=19,
+ NET_IPV4_NETFILTER=20,
+
+ NET_IPV4_TCP_TIMESTAMPS=33,
+ NET_IPV4_TCP_WINDOW_SCALING=34,
+ NET_IPV4_TCP_SACK=35,
+ NET_IPV4_TCP_RETRANS_COLLAPSE=36,
+ NET_IPV4_DEFAULT_TTL=37,
+ NET_IPV4_AUTOCONFIG=38,
+ NET_IPV4_NO_PMTU_DISC=39,
+ NET_IPV4_TCP_SYN_RETRIES=40,
+ NET_IPV4_IPFRAG_HIGH_THRESH=41,
+ NET_IPV4_IPFRAG_LOW_THRESH=42,
+ NET_IPV4_IPFRAG_TIME=43,
+ NET_IPV4_TCP_MAX_KA_PROBES=44,
+ NET_IPV4_TCP_KEEPALIVE_TIME=45,
+ NET_IPV4_TCP_KEEPALIVE_PROBES=46,
+ NET_IPV4_TCP_RETRIES1=47,
+ NET_IPV4_TCP_RETRIES2=48,
+ NET_IPV4_TCP_FIN_TIMEOUT=49,
+ NET_IPV4_IP_MASQ_DEBUG=50,
+ NET_TCP_SYNCOOKIES=51,
+ NET_TCP_STDURG=52,
+ NET_TCP_RFC1337=53,
+ NET_TCP_SYN_TAILDROP=54,
+ NET_TCP_MAX_SYN_BACKLOG=55,
+ NET_IPV4_LOCAL_PORT_RANGE=56,
+ NET_IPV4_ICMP_ECHO_IGNORE_ALL=57,
+ NET_IPV4_ICMP_ECHO_IGNORE_BROADCASTS=58,
+ NET_IPV4_ICMP_SOURCEQUENCH_RATE=59,
+ NET_IPV4_ICMP_DESTUNREACH_RATE=60,
+ NET_IPV4_ICMP_TIMEEXCEED_RATE=61,
+ NET_IPV4_ICMP_PARAMPROB_RATE=62,
+ NET_IPV4_ICMP_ECHOREPLY_RATE=63,
+ NET_IPV4_ICMP_IGNORE_BOGUS_ERROR_RESPONSES=64,
+ NET_IPV4_IGMP_MAX_MEMBERSHIPS=65,
+ NET_TCP_TW_RECYCLE=66,
+ NET_IPV4_ALWAYS_DEFRAG=67,
+ NET_IPV4_TCP_KEEPALIVE_INTVL=68,
+ NET_IPV4_INET_PEER_THRESHOLD=69,
+ NET_IPV4_INET_PEER_MINTTL=70,
+ NET_IPV4_INET_PEER_MAXTTL=71,
+ NET_IPV4_INET_PEER_GC_MINTIME=72,
+ NET_IPV4_INET_PEER_GC_MAXTIME=73,
+ NET_TCP_ORPHAN_RETRIES=74,
+ NET_TCP_ABORT_ON_OVERFLOW=75,
+ NET_TCP_SYNACK_RETRIES=76,
+ NET_TCP_MAX_ORPHANS=77,
+ NET_TCP_MAX_TW_BUCKETS=78,
+ NET_TCP_FACK=79,
+ NET_TCP_REORDERING=80,
+ NET_TCP_ECN=81,
+ NET_TCP_DSACK=82,
+ NET_TCP_MEM=83,
+ NET_TCP_WMEM=84,
+ NET_TCP_RMEM=85,
+ NET_TCP_APP_WIN=86,
+ NET_TCP_ADV_WIN_SCALE=87,
+ NET_IPV4_NONLOCAL_BIND=88,
+ NET_IPV4_ICMP_RATELIMIT=89,
+ NET_IPV4_ICMP_RATEMASK=90,
+ NET_TCP_TW_REUSE=91,
+ NET_TCP_FRTO=92,
+ NET_TCP_LOW_LATENCY=93,
+ NET_IPV4_IPFRAG_SECRET_INTERVAL=94,
+ NET_IPV4_IGMP_MAX_MSF=96,
+ NET_TCP_NO_METRICS_SAVE=97,
+ NET_TCP_DEFAULT_WIN_SCALE=105,
+ NET_TCP_MODERATE_RCVBUF=106,
+ NET_TCP_TSO_WIN_DIVISOR=107,
+ NET_TCP_BIC_BETA=108,
+ NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR=109,
+ NET_TCP_CONG_CONTROL=110,
+ NET_TCP_ABC=111,
+ NET_IPV4_IPFRAG_MAX_DIST=112,
+ NET_TCP_MTU_PROBING=113,
+ NET_TCP_BASE_MSS=114,
+ NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS=115,
+ NET_TCP_DMA_COPYBREAK=116,
+ NET_TCP_SLOW_START_AFTER_IDLE=117,
+};
+
+enum {
+ NET_IPV4_ROUTE_FLUSH=1,
+ NET_IPV4_ROUTE_MIN_DELAY=2,
+ NET_IPV4_ROUTE_MAX_DELAY=3,
+ NET_IPV4_ROUTE_GC_THRESH=4,
+ NET_IPV4_ROUTE_MAX_SIZE=5,
+ NET_IPV4_ROUTE_GC_MIN_INTERVAL=6,
+ NET_IPV4_ROUTE_GC_TIMEOUT=7,
+ NET_IPV4_ROUTE_GC_INTERVAL=8,
+ NET_IPV4_ROUTE_REDIRECT_LOAD=9,
+ NET_IPV4_ROUTE_REDIRECT_NUMBER=10,
+ NET_IPV4_ROUTE_REDIRECT_SILENCE=11,
+ NET_IPV4_ROUTE_ERROR_COST=12,
+ NET_IPV4_ROUTE_ERROR_BURST=13,
+ NET_IPV4_ROUTE_GC_ELASTICITY=14,
+ NET_IPV4_ROUTE_MTU_EXPIRES=15,
+ NET_IPV4_ROUTE_MIN_PMTU=16,
+ NET_IPV4_ROUTE_MIN_ADVMSS=17,
+ NET_IPV4_ROUTE_SECRET_INTERVAL=18,
+ NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS=19,
+};
+
+enum
+{
+ NET_PROTO_CONF_ALL=-2,
+ NET_PROTO_CONF_DEFAULT=-3
+
+};
+
+enum
+{
+ NET_IPV4_CONF_FORWARDING=1,
+ NET_IPV4_CONF_MC_FORWARDING=2,
+ NET_IPV4_CONF_PROXY_ARP=3,
+ NET_IPV4_CONF_ACCEPT_REDIRECTS=4,
+ NET_IPV4_CONF_SECURE_REDIRECTS=5,
+ NET_IPV4_CONF_SEND_REDIRECTS=6,
+ NET_IPV4_CONF_SHARED_MEDIA=7,
+ NET_IPV4_CONF_RP_FILTER=8,
+ NET_IPV4_CONF_ACCEPT_SOURCE_ROUTE=9,
+ NET_IPV4_CONF_BOOTP_RELAY=10,
+ NET_IPV4_CONF_LOG_MARTIANS=11,
+ NET_IPV4_CONF_TAG=12,
+ NET_IPV4_CONF_ARPFILTER=13,
+ NET_IPV4_CONF_MEDIUM_ID=14,
+ NET_IPV4_CONF_NOXFRM=15,
+ NET_IPV4_CONF_NOPOLICY=16,
+ NET_IPV4_CONF_FORCE_IGMP_VERSION=17,
+ NET_IPV4_CONF_ARP_ANNOUNCE=18,
+ NET_IPV4_CONF_ARP_IGNORE=19,
+ NET_IPV4_CONF_PROMOTE_SECONDARIES=20,
+ NET_IPV4_CONF_ARP_ACCEPT=21,
+ __NET_IPV4_CONF_MAX
+};
+
+enum
+{
+ NET_IPV4_NF_CONNTRACK_MAX=1,
+ NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_SYN_SENT=2,
+ NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_SYN_RECV=3,
+ NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_ESTABLISHED=4,
+ NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_FIN_WAIT=5,
+ NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_CLOSE_WAIT=6,
+ NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_LAST_ACK=7,
+ NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_TIME_WAIT=8,
+ NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_CLOSE=9,
+ NET_IPV4_NF_CONNTRACK_UDP_TIMEOUT=10,
+ NET_IPV4_NF_CONNTRACK_UDP_TIMEOUT_STREAM=11,
+ NET_IPV4_NF_CONNTRACK_ICMP_TIMEOUT=12,
+ NET_IPV4_NF_CONNTRACK_GENERIC_TIMEOUT=13,
+ NET_IPV4_NF_CONNTRACK_BUCKETS=14,
+ NET_IPV4_NF_CONNTRACK_LOG_INVALID=15,
+ NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_MAX_RETRANS=16,
+ NET_IPV4_NF_CONNTRACK_TCP_LOOSE=17,
+ NET_IPV4_NF_CONNTRACK_TCP_BE_LIBERAL=18,
+ NET_IPV4_NF_CONNTRACK_TCP_MAX_RETRANS=19,
+ NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_CLOSED=20,
+ NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_WAIT=21,
+ NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_ECHOED=22,
+ NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_ESTABLISHED=23,
+ NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_SENT=24,
+ NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_RECD=25,
+ NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_ACK_SENT=26,
+ NET_IPV4_NF_CONNTRACK_COUNT=27,
+ NET_IPV4_NF_CONNTRACK_CHECKSUM=28,
+};
+
+enum {
+ NET_IPV6_CONF=16,
+ NET_IPV6_NEIGH=17,
+ NET_IPV6_ROUTE=18,
+ NET_IPV6_ICMP=19,
+ NET_IPV6_BINDV6ONLY=20,
+ NET_IPV6_IP6FRAG_HIGH_THRESH=21,
+ NET_IPV6_IP6FRAG_LOW_THRESH=22,
+ NET_IPV6_IP6FRAG_TIME=23,
+ NET_IPV6_IP6FRAG_SECRET_INTERVAL=24,
+ NET_IPV6_MLD_MAX_MSF=25,
+};
+
+enum {
+ NET_IPV6_ROUTE_FLUSH=1,
+ NET_IPV6_ROUTE_GC_THRESH=2,
+ NET_IPV6_ROUTE_MAX_SIZE=3,
+ NET_IPV6_ROUTE_GC_MIN_INTERVAL=4,
+ NET_IPV6_ROUTE_GC_TIMEOUT=5,
+ NET_IPV6_ROUTE_GC_INTERVAL=6,
+ NET_IPV6_ROUTE_GC_ELASTICITY=7,
+ NET_IPV6_ROUTE_MTU_EXPIRES=8,
+ NET_IPV6_ROUTE_MIN_ADVMSS=9,
+ NET_IPV6_ROUTE_GC_MIN_INTERVAL_MS=10
+};
+
+enum {
+ NET_IPV6_FORWARDING=1,
+ NET_IPV6_HOP_LIMIT=2,
+ NET_IPV6_MTU=3,
+ NET_IPV6_ACCEPT_RA=4,
+ NET_IPV6_ACCEPT_REDIRECTS=5,
+ NET_IPV6_AUTOCONF=6,
+ NET_IPV6_DAD_TRANSMITS=7,
+ NET_IPV6_RTR_SOLICITS=8,
+ NET_IPV6_RTR_SOLICIT_INTERVAL=9,
+ NET_IPV6_RTR_SOLICIT_DELAY=10,
+ NET_IPV6_USE_TEMPADDR=11,
+ NET_IPV6_TEMP_VALID_LFT=12,
+ NET_IPV6_TEMP_PREFERED_LFT=13,
+ NET_IPV6_REGEN_MAX_RETRY=14,
+ NET_IPV6_MAX_DESYNC_FACTOR=15,
+ NET_IPV6_MAX_ADDRESSES=16,
+ NET_IPV6_FORCE_MLD_VERSION=17,
+ NET_IPV6_ACCEPT_RA_DEFRTR=18,
+ NET_IPV6_ACCEPT_RA_PINFO=19,
+ NET_IPV6_ACCEPT_RA_RTR_PREF=20,
+ NET_IPV6_RTR_PROBE_INTERVAL=21,
+ NET_IPV6_ACCEPT_RA_RT_INFO_MAX_PLEN=22,
+ __NET_IPV6_MAX
+};
+
+enum {
+ NET_IPV6_ICMP_RATELIMIT=1
+};
+
+enum {
+ NET_NEIGH_MCAST_SOLICIT=1,
+ NET_NEIGH_UCAST_SOLICIT=2,
+ NET_NEIGH_APP_SOLICIT=3,
+ NET_NEIGH_RETRANS_TIME=4,
+ NET_NEIGH_REACHABLE_TIME=5,
+ NET_NEIGH_DELAY_PROBE_TIME=6,
+ NET_NEIGH_GC_STALE_TIME=7,
+ NET_NEIGH_UNRES_QLEN=8,
+ NET_NEIGH_PROXY_QLEN=9,
+ NET_NEIGH_ANYCAST_DELAY=10,
+ NET_NEIGH_PROXY_DELAY=11,
+ NET_NEIGH_LOCKTIME=12,
+ NET_NEIGH_GC_INTERVAL=13,
+ NET_NEIGH_GC_THRESH1=14,
+ NET_NEIGH_GC_THRESH2=15,
+ NET_NEIGH_GC_THRESH3=16,
+ NET_NEIGH_RETRANS_TIME_MS=17,
+ NET_NEIGH_REACHABLE_TIME_MS=18,
+ __NET_NEIGH_MAX
+};
+
+enum {
+ NET_DCCP_DEFAULT=1,
+};
+
+enum {
+ NET_DCCP_DEFAULT_SEQ_WINDOW = 1,
+ NET_DCCP_DEFAULT_RX_CCID = 2,
+ NET_DCCP_DEFAULT_TX_CCID = 3,
+ NET_DCCP_DEFAULT_ACK_RATIO = 4,
+ NET_DCCP_DEFAULT_SEND_ACKVEC = 5,
+ NET_DCCP_DEFAULT_SEND_NDP = 6,
+};
+
+enum {
+ NET_IPX_PPROP_BROADCASTING=1,
+ NET_IPX_FORWARDING=2
+};
+
+enum {
+ NET_LLC2=1,
+ NET_LLC_STATION=2,
+};
+
+enum {
+ NET_LLC2_TIMEOUT=1,
+};
+
+enum {
+ NET_LLC_STATION_ACK_TIMEOUT=1,
+};
+
+enum {
+ NET_LLC2_ACK_TIMEOUT=1,
+ NET_LLC2_P_TIMEOUT=2,
+ NET_LLC2_REJ_TIMEOUT=3,
+ NET_LLC2_BUSY_TIMEOUT=4,
+};
+
+enum {
+ NET_ATALK_AARP_EXPIRY_TIME=1,
+ NET_ATALK_AARP_TICK_TIME=2,
+ NET_ATALK_AARP_RETRANSMIT_LIMIT=3,
+ NET_ATALK_AARP_RESOLVE_TIME=4
+};
+
+enum {
+ NET_NETROM_DEFAULT_PATH_QUALITY=1,
+ NET_NETROM_OBSOLESCENCE_COUNT_INITIALISER=2,
+ NET_NETROM_NETWORK_TTL_INITIALISER=3,
+ NET_NETROM_TRANSPORT_TIMEOUT=4,
+ NET_NETROM_TRANSPORT_MAXIMUM_TRIES=5,
+ NET_NETROM_TRANSPORT_ACKNOWLEDGE_DELAY=6,
+ NET_NETROM_TRANSPORT_BUSY_DELAY=7,
+ NET_NETROM_TRANSPORT_REQUESTED_WINDOW_SIZE=8,
+ NET_NETROM_TRANSPORT_NO_ACTIVITY_TIMEOUT=9,
+ NET_NETROM_ROUTING_CONTROL=10,
+ NET_NETROM_LINK_FAILS_COUNT=11,
+ NET_NETROM_RESET=12
+};
+
+enum {
+ NET_AX25_IP_DEFAULT_MODE=1,
+ NET_AX25_DEFAULT_MODE=2,
+ NET_AX25_BACKOFF_TYPE=3,
+ NET_AX25_CONNECT_MODE=4,
+ NET_AX25_STANDARD_WINDOW=5,
+ NET_AX25_EXTENDED_WINDOW=6,
+ NET_AX25_T1_TIMEOUT=7,
+ NET_AX25_T2_TIMEOUT=8,
+ NET_AX25_T3_TIMEOUT=9,
+ NET_AX25_IDLE_TIMEOUT=10,
+ NET_AX25_N2=11,
+ NET_AX25_PACLEN=12,
+ NET_AX25_PROTOCOL=13,
+ NET_AX25_DAMA_SLAVE_TIMEOUT=14
+};
+
+enum {
+ NET_ROSE_RESTART_REQUEST_TIMEOUT=1,
+ NET_ROSE_CALL_REQUEST_TIMEOUT=2,
+ NET_ROSE_RESET_REQUEST_TIMEOUT=3,
+ NET_ROSE_CLEAR_REQUEST_TIMEOUT=4,
+ NET_ROSE_ACK_HOLD_BACK_TIMEOUT=5,
+ NET_ROSE_ROUTING_CONTROL=6,
+ NET_ROSE_LINK_FAIL_TIMEOUT=7,
+ NET_ROSE_MAX_VCS=8,
+ NET_ROSE_WINDOW_SIZE=9,
+ NET_ROSE_NO_ACTIVITY_TIMEOUT=10
+};
+
+enum {
+ NET_X25_RESTART_REQUEST_TIMEOUT=1,
+ NET_X25_CALL_REQUEST_TIMEOUT=2,
+ NET_X25_RESET_REQUEST_TIMEOUT=3,
+ NET_X25_CLEAR_REQUEST_TIMEOUT=4,
+ NET_X25_ACK_HOLD_BACK_TIMEOUT=5
+};
+
+enum
+{
+ NET_TR_RIF_TIMEOUT=1
+};
+
+enum {
+ NET_DECNET_NODE_TYPE = 1,
+ NET_DECNET_NODE_ADDRESS = 2,
+ NET_DECNET_NODE_NAME = 3,
+ NET_DECNET_DEFAULT_DEVICE = 4,
+ NET_DECNET_TIME_WAIT = 5,
+ NET_DECNET_DN_COUNT = 6,
+ NET_DECNET_DI_COUNT = 7,
+ NET_DECNET_DR_COUNT = 8,
+ NET_DECNET_DST_GC_INTERVAL = 9,
+ NET_DECNET_CONF = 10,
+ NET_DECNET_NO_FC_MAX_CWND = 11,
+ NET_DECNET_MEM = 12,
+ NET_DECNET_RMEM = 13,
+ NET_DECNET_WMEM = 14,
+ NET_DECNET_DEBUG_LEVEL = 255
+};
+
+enum {
+ NET_DECNET_CONF_LOOPBACK = -2,
+ NET_DECNET_CONF_DDCMP = -3,
+ NET_DECNET_CONF_PPP = -4,
+ NET_DECNET_CONF_X25 = -5,
+ NET_DECNET_CONF_GRE = -6,
+ NET_DECNET_CONF_ETHER = -7
+
+};
+
+enum {
+ NET_DECNET_CONF_DEV_PRIORITY = 1,
+ NET_DECNET_CONF_DEV_T1 = 2,
+ NET_DECNET_CONF_DEV_T2 = 3,
+ NET_DECNET_CONF_DEV_T3 = 4,
+ NET_DECNET_CONF_DEV_FORWARDING = 5,
+ NET_DECNET_CONF_DEV_BLKSIZE = 6,
+ NET_DECNET_CONF_DEV_STATE = 7
+};
+
+enum {
+ NET_SCTP_RTO_INITIAL = 1,
+ NET_SCTP_RTO_MIN = 2,
+ NET_SCTP_RTO_MAX = 3,
+ NET_SCTP_RTO_ALPHA = 4,
+ NET_SCTP_RTO_BETA = 5,
+ NET_SCTP_VALID_COOKIE_LIFE = 6,
+ NET_SCTP_ASSOCIATION_MAX_RETRANS = 7,
+ NET_SCTP_PATH_MAX_RETRANS = 8,
+ NET_SCTP_MAX_INIT_RETRANSMITS = 9,
+ NET_SCTP_HB_INTERVAL = 10,
+ NET_SCTP_PRESERVE_ENABLE = 11,
+ NET_SCTP_MAX_BURST = 12,
+ NET_SCTP_ADDIP_ENABLE = 13,
+ NET_SCTP_PRSCTP_ENABLE = 14,
+ NET_SCTP_SNDBUF_POLICY = 15,
+ NET_SCTP_SACK_TIMEOUT = 16,
+ NET_SCTP_RCVBUF_POLICY = 17,
+};
+
+enum {
+ NET_BRIDGE_NF_CALL_ARPTABLES = 1,
+ NET_BRIDGE_NF_CALL_IPTABLES = 2,
+ NET_BRIDGE_NF_CALL_IP6TABLES = 3,
+ NET_BRIDGE_NF_FILTER_VLAN_TAGGED = 4,
+};
+
+enum
+{
+ FS_NRINODE=1,
+ FS_STATINODE=2,
+ FS_MAXINODE=3,
+ FS_NRDQUOT=4,
+ FS_MAXDQUOT=5,
+ FS_NRFILE=6,
+ FS_MAXFILE=7,
+ FS_DENTRY=8,
+ FS_NRSUPER=9,
+ FS_MAXSUPER=10,
+ FS_OVERFLOWUID=11,
+ FS_OVERFLOWGID=12,
+ FS_LEASES=13,
+ FS_DIR_NOTIFY=14,
+ FS_LEASE_TIME=15,
+ FS_DQSTATS=16,
+ FS_XFS=17,
+ FS_AIO_NR=18,
+ FS_AIO_MAX_NR=19,
+ FS_INOTIFY=20,
+};
+
+enum {
+ FS_DQ_LOOKUPS = 1,
+ FS_DQ_DROPS = 2,
+ FS_DQ_READS = 3,
+ FS_DQ_WRITES = 4,
+ FS_DQ_CACHE_HITS = 5,
+ FS_DQ_ALLOCATED = 6,
+ FS_DQ_FREE = 7,
+ FS_DQ_SYNCS = 8,
+ FS_DQ_WARNINGS = 9,
+};
+
+enum {
+ DEV_CDROM=1,
+ DEV_HWMON=2,
+ DEV_PARPORT=3,
+ DEV_RAID=4,
+ DEV_MAC_HID=5,
+ DEV_SCSI=6,
+ DEV_IPMI=7,
+};
+
+enum {
+ DEV_CDROM_INFO=1,
+ DEV_CDROM_AUTOCLOSE=2,
+ DEV_CDROM_AUTOEJECT=3,
+ DEV_CDROM_DEBUG=4,
+ DEV_CDROM_LOCK=5,
+ DEV_CDROM_CHECK_MEDIA=6
+};
+
+enum {
+ DEV_PARPORT_DEFAULT=-3
+};
+
+enum {
+ DEV_RAID_SPEED_LIMIT_MIN=1,
+ DEV_RAID_SPEED_LIMIT_MAX=2
+};
+
+enum {
+ DEV_PARPORT_DEFAULT_TIMESLICE=1,
+ DEV_PARPORT_DEFAULT_SPINTIME=2
+};
+
+enum {
+ DEV_PARPORT_SPINTIME=1,
+ DEV_PARPORT_BASE_ADDR=2,
+ DEV_PARPORT_IRQ=3,
+ DEV_PARPORT_DMA=4,
+ DEV_PARPORT_MODES=5,
+ DEV_PARPORT_DEVICES=6,
+ DEV_PARPORT_AUTOPROBE=16
+};
+
+enum {
+ DEV_PARPORT_DEVICES_ACTIVE=-3,
+};
+
+enum {
+ DEV_PARPORT_DEVICE_TIMESLICE=1,
+};
+
+enum {
+ DEV_MAC_HID_KEYBOARD_SENDS_LINUX_KEYCODES=1,
+ DEV_MAC_HID_KEYBOARD_LOCK_KEYCODES=2,
+ DEV_MAC_HID_MOUSE_BUTTON_EMULATION=3,
+ DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE=4,
+ DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE=5,
+ DEV_MAC_HID_ADB_MOUSE_SENDS_KEYCODES=6
+};
+
+enum {
+ DEV_SCSI_LOGGING_LEVEL=1,
+};
+
+enum {
+ DEV_IPMI_POWEROFF_POWERCYCLE=1,
+};
+
+enum
+{
+ ABI_DEFHANDLER_COFF=1,
+ ABI_DEFHANDLER_ELF=2,
+ ABI_DEFHANDLER_LCALL7=3,
+ ABI_DEFHANDLER_LIBCSO=4,
+ ABI_TRACE=5,
+ ABI_FAKE_UTSNAME=6,
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/sysdev.h b/ndk/platforms/android-3/include/linux/sysdev.h
new file mode 100644
index 0000000..6ae2b26
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/sysdev.h
@@ -0,0 +1,60 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _SYSDEV_H_
+#define _SYSDEV_H_
+
+#include <linux/kobject.h>
+#include <linux/pm.h>
+
+struct sys_device;
+
+struct sysdev_class {
+ struct list_head drivers;
+
+ int (*shutdown)(struct sys_device *);
+ int (*suspend)(struct sys_device *, pm_message_t state);
+ int (*resume)(struct sys_device *);
+ struct kset kset;
+};
+
+struct sysdev_class_attribute {
+ struct attribute attr;
+ ssize_t (*show)(struct sysdev_class *, char *);
+ ssize_t (*store)(struct sysdev_class *, const char *, size_t);
+};
+
+#define SYSDEV_CLASS_ATTR(_name,_mode,_show,_store)  struct sysdev_class_attribute attr_##_name = {   .attr = {.name = __stringify(_name), .mode = _mode },   .show = _show,   .store = _store,  };
+
+struct sysdev_driver {
+ struct list_head entry;
+ int (*add)(struct sys_device *);
+ int (*remove)(struct sys_device *);
+ int (*shutdown)(struct sys_device *);
+ int (*suspend)(struct sys_device *, pm_message_t state);
+ int (*resume)(struct sys_device *);
+};
+
+struct sys_device {
+ u32 id;
+ struct sysdev_class * cls;
+ struct kobject kobj;
+};
+
+struct sysdev_attribute {
+ struct attribute attr;
+ ssize_t (*show)(struct sys_device *, char *);
+ ssize_t (*store)(struct sys_device *, const char *, size_t);
+};
+
+#define SYSDEV_ATTR(_name,_mode,_show,_store)  struct sysdev_attribute attr_##_name = {   .attr = {.name = __stringify(_name), .mode = _mode },   .show = _show,   .store = _store,  };
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/sysfs.h b/ndk/platforms/android-3/include/linux/sysfs.h
new file mode 100644
index 0000000..00b5f5a
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/sysfs.h
@@ -0,0 +1,76 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _SYSFS_H_
+#define _SYSFS_H_
+
+#include <asm/atomic.h>
+
+struct kobject;
+struct module;
+
+struct attribute {
+ const char * name;
+ struct module * owner;
+ mode_t mode;
+};
+
+struct attribute_group {
+ const char * name;
+ struct attribute ** attrs;
+};
+
+#define __ATTR(_name,_mode,_show,_store) {   .attr = {.name = __stringify(_name), .mode = _mode, .owner = THIS_MODULE },   .show = _show,   .store = _store,  }
+
+#define __ATTR_RO(_name) {   .attr = { .name = __stringify(_name), .mode = 0444, .owner = THIS_MODULE },   .show = _name##_show,  }
+
+#define __ATTR_NULL { .attr = { .name = NULL } }
+
+#define attr_name(_attr) (_attr).attr.name
+
+struct vm_area_struct;
+
+struct bin_attribute {
+ struct attribute attr;
+ size_t size;
+ void *private;
+ ssize_t (*read)(struct kobject *, char *, loff_t, size_t);
+ ssize_t (*write)(struct kobject *, char *, loff_t, size_t);
+ int (*mmap)(struct kobject *, struct bin_attribute *attr,
+ struct vm_area_struct *vma);
+};
+
+struct sysfs_ops {
+ ssize_t (*show)(struct kobject *, struct attribute *,char *);
+ ssize_t (*store)(struct kobject *,struct attribute *,const char *, size_t);
+};
+
+struct sysfs_dirent {
+ atomic_t s_count;
+ struct list_head s_sibling;
+ struct list_head s_children;
+ void * s_element;
+ int s_type;
+ umode_t s_mode;
+ struct dentry * s_dentry;
+ struct iattr * s_iattr;
+ atomic_t s_event;
+};
+
+#define SYSFS_ROOT 0x0001
+#define SYSFS_DIR 0x0002
+#define SYSFS_KOBJ_ATTR 0x0004
+#define SYSFS_KOBJ_BIN_ATTR 0x0008
+#define SYSFS_KOBJ_DEVICE 0x0010
+#define SYSFS_KOBJ_LINK 0x0020
+#define SYSFS_NOT_PINNED (SYSFS_KOBJ_ATTR | SYSFS_KOBJ_BIN_ATTR | SYSFS_KOBJ_DEVICE | SYSFS_KOBJ_LINK)
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/taskstats.h b/ndk/platforms/android-3/include/linux/taskstats.h
new file mode 100644
index 0000000..3e8ae4a
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/taskstats.h
@@ -0,0 +1,72 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_TASKSTATS_H
+#define _LINUX_TASKSTATS_H
+
+#define TASKSTATS_VERSION 1
+
+struct taskstats {
+
+ __u16 version;
+ __u16 padding[3];
+
+ __u64 cpu_count;
+ __u64 cpu_delay_total;
+
+ __u64 blkio_count;
+ __u64 blkio_delay_total;
+
+ __u64 swapin_count;
+ __u64 swapin_delay_total;
+
+ __u64 cpu_run_real_total;
+
+ __u64 cpu_run_virtual_total;
+
+};
+
+enum {
+ TASKSTATS_CMD_UNSPEC = 0,
+ TASKSTATS_CMD_GET,
+ TASKSTATS_CMD_NEW,
+ __TASKSTATS_CMD_MAX,
+};
+
+#define TASKSTATS_CMD_MAX (__TASKSTATS_CMD_MAX - 1)
+
+enum {
+ TASKSTATS_TYPE_UNSPEC = 0,
+ TASKSTATS_TYPE_PID,
+ TASKSTATS_TYPE_TGID,
+ TASKSTATS_TYPE_STATS,
+ TASKSTATS_TYPE_AGGR_PID,
+ TASKSTATS_TYPE_AGGR_TGID,
+ __TASKSTATS_TYPE_MAX,
+};
+
+#define TASKSTATS_TYPE_MAX (__TASKSTATS_TYPE_MAX - 1)
+
+enum {
+ TASKSTATS_CMD_ATTR_UNSPEC = 0,
+ TASKSTATS_CMD_ATTR_PID,
+ TASKSTATS_CMD_ATTR_TGID,
+ TASKSTATS_CMD_ATTR_REGISTER_CPUMASK,
+ TASKSTATS_CMD_ATTR_DEREGISTER_CPUMASK,
+ __TASKSTATS_CMD_ATTR_MAX,
+};
+
+#define TASKSTATS_CMD_ATTR_MAX (__TASKSTATS_CMD_ATTR_MAX - 1)
+
+#define TASKSTATS_GENL_NAME "TASKSTATS"
+#define TASKSTATS_GENL_VERSION 0x1
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/taskstats_kern.h b/ndk/platforms/android-3/include/linux/taskstats_kern.h
new file mode 100644
index 0000000..4948410
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/taskstats_kern.h
@@ -0,0 +1,19 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_TASKSTATS_KERN_H
+#define _LINUX_TASKSTATS_KERN_H
+
+#include <linux/taskstats.h>
+#include <linux/sched.h>
+#include <net/genetlink.h>
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/tcp.h b/ndk/platforms/android-3/include/linux/tcp.h
new file mode 100644
index 0000000..3fa95f8
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/tcp.h
@@ -0,0 +1,147 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_TCP_H
+#define _LINUX_TCP_H
+
+#include <linux/types.h>
+#include <asm/byteorder.h>
+
+struct tcphdr {
+ __u16 source;
+ __u16 dest;
+ __u32 seq;
+ __u32 ack_seq;
+#ifdef __LITTLE_ENDIAN_BITFIELD
+ __u16 res1:4,
+ doff:4,
+ fin:1,
+ syn:1,
+ rst:1,
+ psh:1,
+ ack:1,
+ urg:1,
+ ece:1,
+ cwr:1;
+#elif defined(__BIG_ENDIAN_BITFIELD)
+ __u16 doff:4,
+ res1:4,
+ cwr:1,
+ ece:1,
+ urg:1,
+ ack:1,
+ psh:1,
+ rst:1,
+ syn:1,
+ fin:1;
+#else
+#error "Adjust your <asm/byteorder.h> defines"
+#endif
+ __u16 window;
+ __u16 check;
+ __u16 urg_ptr;
+};
+
+union tcp_word_hdr {
+ struct tcphdr hdr;
+ __u32 words[5];
+};
+
+#define tcp_flag_word(tp) ( ((union tcp_word_hdr *)(tp))->words [3]) 
+
+enum {
+ TCP_FLAG_CWR = __constant_htonl(0x00800000),
+ TCP_FLAG_ECE = __constant_htonl(0x00400000),
+ TCP_FLAG_URG = __constant_htonl(0x00200000),
+ TCP_FLAG_ACK = __constant_htonl(0x00100000),
+ TCP_FLAG_PSH = __constant_htonl(0x00080000),
+ TCP_FLAG_RST = __constant_htonl(0x00040000),
+ TCP_FLAG_SYN = __constant_htonl(0x00020000),
+ TCP_FLAG_FIN = __constant_htonl(0x00010000),
+ TCP_RESERVED_BITS = __constant_htonl(0x0F000000),
+ TCP_DATA_OFFSET = __constant_htonl(0xF0000000)
+};
+
+#define TCP_NODELAY 1  
+#define TCP_MAXSEG 2  
+#define TCP_CORK 3  
+#define TCP_KEEPIDLE 4  
+#define TCP_KEEPINTVL 5  
+#define TCP_KEEPCNT 6  
+#define TCP_SYNCNT 7  
+#define TCP_LINGER2 8  
+#define TCP_DEFER_ACCEPT 9  
+#define TCP_WINDOW_CLAMP 10  
+#define TCP_INFO 11  
+#define TCP_QUICKACK 12  
+#define TCP_CONGESTION 13  
+
+#define TCPI_OPT_TIMESTAMPS 1
+#define TCPI_OPT_SACK 2
+#define TCPI_OPT_WSCALE 4
+#define TCPI_OPT_ECN 8
+
+enum tcp_ca_state
+{
+ TCP_CA_Open = 0,
+#define TCPF_CA_Open (1<<TCP_CA_Open)
+ TCP_CA_Disorder = 1,
+#define TCPF_CA_Disorder (1<<TCP_CA_Disorder)
+ TCP_CA_CWR = 2,
+#define TCPF_CA_CWR (1<<TCP_CA_CWR)
+ TCP_CA_Recovery = 3,
+#define TCPF_CA_Recovery (1<<TCP_CA_Recovery)
+ TCP_CA_Loss = 4
+#define TCPF_CA_Loss (1<<TCP_CA_Loss)
+};
+
+struct tcp_info
+{
+ __u8 tcpi_state;
+ __u8 tcpi_ca_state;
+ __u8 tcpi_retransmits;
+ __u8 tcpi_probes;
+ __u8 tcpi_backoff;
+ __u8 tcpi_options;
+ __u8 tcpi_snd_wscale : 4, tcpi_rcv_wscale : 4;
+
+ __u32 tcpi_rto;
+ __u32 tcpi_ato;
+ __u32 tcpi_snd_mss;
+ __u32 tcpi_rcv_mss;
+
+ __u32 tcpi_unacked;
+ __u32 tcpi_sacked;
+ __u32 tcpi_lost;
+ __u32 tcpi_retrans;
+ __u32 tcpi_fackets;
+
+ __u32 tcpi_last_data_sent;
+ __u32 tcpi_last_ack_sent;
+ __u32 tcpi_last_data_recv;
+ __u32 tcpi_last_ack_recv;
+
+ __u32 tcpi_pmtu;
+ __u32 tcpi_rcv_ssthresh;
+ __u32 tcpi_rtt;
+ __u32 tcpi_rttvar;
+ __u32 tcpi_snd_ssthresh;
+ __u32 tcpi_snd_cwnd;
+ __u32 tcpi_advmss;
+ __u32 tcpi_reordering;
+
+ __u32 tcpi_rcv_rtt;
+ __u32 tcpi_rcv_space;
+
+ __u32 tcpi_total_retrans;
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/telephony.h b/ndk/platforms/android-3/include/linux/telephony.h
new file mode 100644
index 0000000..0c1d83d
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/telephony.h
@@ -0,0 +1,172 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef TELEPHONY_H
+#define TELEPHONY_H
+
+#define TELEPHONY_VERSION 3013
+
+#define PHONE_VENDOR_IXJ 1
+#define PHONE_VENDOR_QUICKNET PHONE_VENDOR_IXJ
+#define PHONE_VENDOR_VOICETRONIX 2
+#define PHONE_VENDOR_ACULAB 3
+#define PHONE_VENDOR_DIGI 4
+#define PHONE_VENDOR_FRANKLIN 5
+
+#define QTI_PHONEJACK 100
+#define QTI_LINEJACK 300
+#define QTI_PHONEJACK_LITE 400
+#define QTI_PHONEJACK_PCI 500
+#define QTI_PHONECARD 600
+
+typedef enum {
+ vendor = 0,
+ device,
+ port,
+ codec,
+ dsp
+} phone_cap;
+
+struct phone_capability {
+ char desc[80];
+ phone_cap captype;
+ int cap;
+ int handle;
+};
+
+typedef enum {
+ pots = 0,
+ pstn,
+ handset,
+ speaker
+} phone_ports;
+
+#define PHONE_CAPABILITIES _IO ('q', 0x80)
+#define PHONE_CAPABILITIES_LIST _IOR ('q', 0x81, struct phone_capability *)
+#define PHONE_CAPABILITIES_CHECK _IOW ('q', 0x82, struct phone_capability *)
+
+typedef struct {
+ char month[3];
+ char day[3];
+ char hour[3];
+ char min[3];
+ int numlen;
+ char number[11];
+ int namelen;
+ char name[80];
+} PHONE_CID;
+
+#define PHONE_RING _IO ('q', 0x83)
+#define PHONE_HOOKSTATE _IO ('q', 0x84)
+#define PHONE_MAXRINGS _IOW ('q', 0x85, char)
+#define PHONE_RING_CADENCE _IOW ('q', 0x86, short)
+#define OLD_PHONE_RING_START _IO ('q', 0x87)
+#define PHONE_RING_START _IOW ('q', 0x87, PHONE_CID *)
+#define PHONE_RING_STOP _IO ('q', 0x88)
+
+#define USA_RING_CADENCE 0xC0C0
+
+#define PHONE_REC_CODEC _IOW ('q', 0x89, int)
+#define PHONE_REC_START _IO ('q', 0x8A)
+#define PHONE_REC_STOP _IO ('q', 0x8B)
+#define PHONE_REC_DEPTH _IOW ('q', 0x8C, int)
+#define PHONE_FRAME _IOW ('q', 0x8D, int)
+#define PHONE_REC_VOLUME _IOW ('q', 0x8E, int)
+#define PHONE_REC_VOLUME_LINEAR _IOW ('q', 0xDB, int)
+#define PHONE_REC_LEVEL _IO ('q', 0x8F)
+
+#define PHONE_PLAY_CODEC _IOW ('q', 0x90, int)
+#define PHONE_PLAY_START _IO ('q', 0x91)
+#define PHONE_PLAY_STOP _IO ('q', 0x92)
+#define PHONE_PLAY_DEPTH _IOW ('q', 0x93, int)
+#define PHONE_PLAY_VOLUME _IOW ('q', 0x94, int)
+#define PHONE_PLAY_VOLUME_LINEAR _IOW ('q', 0xDC, int)
+#define PHONE_PLAY_LEVEL _IO ('q', 0x95)
+#define PHONE_DTMF_READY _IOR ('q', 0x96, int)
+#define PHONE_GET_DTMF _IOR ('q', 0x97, int)
+#define PHONE_GET_DTMF_ASCII _IOR ('q', 0x98, int)
+#define PHONE_DTMF_OOB _IOW ('q', 0x99, int)
+#define PHONE_EXCEPTION _IOR ('q', 0x9A, int)
+#define PHONE_PLAY_TONE _IOW ('q', 0x9B, char)
+#define PHONE_SET_TONE_ON_TIME _IOW ('q', 0x9C, int)
+#define PHONE_SET_TONE_OFF_TIME _IOW ('q', 0x9D, int)
+#define PHONE_GET_TONE_ON_TIME _IO ('q', 0x9E)
+#define PHONE_GET_TONE_OFF_TIME _IO ('q', 0x9F)
+#define PHONE_GET_TONE_STATE _IO ('q', 0xA0)
+#define PHONE_BUSY _IO ('q', 0xA1)
+#define PHONE_RINGBACK _IO ('q', 0xA2)
+#define PHONE_DIALTONE _IO ('q', 0xA3)
+#define PHONE_CPT_STOP _IO ('q', 0xA4)
+
+#define PHONE_PSTN_SET_STATE _IOW ('q', 0xA4, int)
+#define PHONE_PSTN_GET_STATE _IO ('q', 0xA5)
+
+#define PSTN_ON_HOOK 0
+#define PSTN_RINGING 1
+#define PSTN_OFF_HOOK 2
+#define PSTN_PULSE_DIAL 3
+
+#define PHONE_WINK_DURATION _IOW ('q', 0xA6, int)
+#define PHONE_WINK _IOW ('q', 0xAA, int)
+
+typedef enum {
+ G723_63 = 1,
+ G723_53 = 2,
+ TS85 = 3,
+ TS48 = 4,
+ TS41 = 5,
+ G728 = 6,
+ G729 = 7,
+ ULAW = 8,
+ ALAW = 9,
+ LINEAR16 = 10,
+ LINEAR8 = 11,
+ WSS = 12,
+ G729B = 13
+} phone_codec;
+
+struct phone_codec_data
+{
+ phone_codec type;
+ unsigned short buf_min, buf_opt, buf_max;
+};
+
+#define PHONE_QUERY_CODEC _IOWR ('q', 0xA7, struct phone_codec_data *)
+#define PHONE_PSTN_LINETEST _IO ('q', 0xA8)
+
+#define PHONE_VAD _IOW ('q', 0xA9, int)
+
+struct phone_except
+{
+ unsigned int dtmf_ready:1;
+ unsigned int hookstate:1;
+ unsigned int pstn_ring:1;
+ unsigned int caller_id:1;
+ unsigned int pstn_wink:1;
+ unsigned int f0:1;
+ unsigned int f1:1;
+ unsigned int f2:1;
+ unsigned int f3:1;
+ unsigned int flash:1;
+ unsigned int fc0:1;
+ unsigned int fc1:1;
+ unsigned int fc2:1;
+ unsigned int fc3:1;
+ unsigned int reserved:18;
+};
+
+union telephony_exception {
+ struct phone_except bits;
+ unsigned int bytes;
+};
+
+#endif
+
diff --git a/ndk/platforms/android-3/include/linux/termios.h b/ndk/platforms/android-3/include/linux/termios.h
new file mode 100644
index 0000000..e28439d
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/termios.h
@@ -0,0 +1,18 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_TERMIOS_H
+#define _LINUX_TERMIOS_H
+
+#include <linux/types.h>
+#include <asm/termios.h>
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/textsearch.h b/ndk/platforms/android-3/include/linux/textsearch.h
new file mode 100644
index 0000000..a921cdd
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/textsearch.h
@@ -0,0 +1,15 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __LINUX_TEXTSEARCH_H
+#define __LINUX_TEXTSEARCH_H
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/thread_info.h b/ndk/platforms/android-3/include/linux/thread_info.h
new file mode 100644
index 0000000..074a1f9
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/thread_info.h
@@ -0,0 +1,23 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_THREAD_INFO_H
+#define _LINUX_THREAD_INFO_H
+
+struct restart_block {
+ long (*fn)(struct restart_block *);
+ unsigned long arg0, arg1, arg2, arg3;
+};
+
+#include <linux/bitops.h>
+#include <asm/thread_info.h>
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/threads.h b/ndk/platforms/android-3/include/linux/threads.h
new file mode 100644
index 0000000..5d85878
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/threads.h
@@ -0,0 +1,23 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_THREADS_H
+#define _LINUX_THREADS_H
+
+#define NR_CPUS 1
+
+#define MIN_THREADS_LEFT_FOR_ROOT 4
+
+#define PID_MAX_DEFAULT (CONFIG_BASE_SMALL ? 0x1000 : 0x8000)
+
+#define PID_MAX_LIMIT (CONFIG_BASE_SMALL ? PAGE_SIZE * 8 :   (sizeof(long) > 4 ? 4 * 1024 * 1024 : PID_MAX_DEFAULT))
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/time.h b/ndk/platforms/android-3/include/linux/time.h
new file mode 100644
index 0000000..3e6e440
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/time.h
@@ -0,0 +1,69 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_TIME_H
+#define _LINUX_TIME_H
+
+#include <linux/types.h>
+
+#ifndef _STRUCT_TIMESPEC
+#define _STRUCT_TIMESPEC
+struct timespec {
+ time_t tv_sec;
+ long tv_nsec;
+};
+#endif
+
+struct timeval {
+ time_t tv_sec;
+ suseconds_t tv_usec;
+};
+
+struct timezone {
+ int tz_minuteswest;
+ int tz_dsttime;
+};
+
+#define NFDBITS __NFDBITS
+
+#define FD_SETSIZE __FD_SETSIZE
+#define FD_SET(fd,fdsetp) __FD_SET(fd,fdsetp)
+#define FD_CLR(fd,fdsetp) __FD_CLR(fd,fdsetp)
+#define FD_ISSET(fd,fdsetp) __FD_ISSET(fd,fdsetp)
+#define FD_ZERO(fdsetp) __FD_ZERO(fdsetp)
+
+#define ITIMER_REAL 0
+#define ITIMER_VIRTUAL 1
+#define ITIMER_PROF 2
+
+struct itimerspec {
+ struct timespec it_interval;
+ struct timespec it_value;
+};
+
+struct itimerval {
+ struct timeval it_interval;
+ struct timeval it_value;
+};
+
+#define CLOCK_REALTIME 0
+#define CLOCK_MONOTONIC 1
+#define CLOCK_PROCESS_CPUTIME_ID 2
+#define CLOCK_THREAD_CPUTIME_ID 3
+
+#define CLOCK_SGI_CYCLE 10
+#define MAX_CLOCKS 16
+#define CLOCKS_MASK (CLOCK_REALTIME | CLOCK_MONOTONIC)
+#define CLOCKS_MONO CLOCK_MONOTONIC
+
+#define TIMER_ABSTIME 0x01
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/timer.h b/ndk/platforms/android-3/include/linux/timer.h
new file mode 100644
index 0000000..071a759
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/timer.h
@@ -0,0 +1,41 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_TIMER_H
+#define _LINUX_TIMER_H
+
+#include <linux/list.h>
+#include <linux/spinlock.h>
+#include <linux/stddef.h>
+
+struct tvec_t_base_s;
+
+struct timer_list {
+ struct list_head entry;
+ unsigned long expires;
+
+ void (*function)(unsigned long);
+ unsigned long data;
+
+ struct tvec_t_base_s *base;
+};
+
+#define TIMER_INITIALIZER(_function, _expires, _data) {   .function = (_function),   .expires = (_expires),   .data = (_data),   .base = &boot_tvec_bases,   }
+
+#define DEFINE_TIMER(_name, _function, _expires, _data)   struct timer_list _name =   TIMER_INITIALIZER(_function, _expires, _data)
+
+#define try_to_del_timer_sync(t) del_timer(t)
+#define del_timer_sync(t) del_timer(t)
+#define del_singleshot_timer_sync(t) del_timer_sync(t)
+
+struct hrtimer;
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/times.h b/ndk/platforms/android-3/include/linux/times.h
new file mode 100644
index 0000000..4ae415c
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/times.h
@@ -0,0 +1,24 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_TIMES_H
+#define _LINUX_TIMES_H
+
+#include <linux/types.h>
+
+struct tms {
+ clock_t tms_utime;
+ clock_t tms_stime;
+ clock_t tms_cutime;
+ clock_t tms_cstime;
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/timex.h b/ndk/platforms/android-3/include/linux/timex.h
new file mode 100644
index 0000000..342470b
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/timex.h
@@ -0,0 +1,108 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_TIMEX_H
+#define _LINUX_TIMEX_H
+
+#include <linux/compiler.h>
+#include <linux/time.h>
+
+#include <asm/param.h>
+
+#define SHIFT_KG 6  
+#define SHIFT_KF 16  
+#define SHIFT_KH 2  
+#define MAXTC 6  
+
+#define SHIFT_SCALE 22  
+#define SHIFT_UPDATE (SHIFT_KG + MAXTC)  
+#define SHIFT_USEC 16  
+#define FINENSEC (1L << (SHIFT_SCALE - 10))  
+
+#define MAXPHASE 512000L  
+#define MAXFREQ (512L << SHIFT_USEC)  
+#define MINSEC 16L  
+#define MAXSEC 1200L  
+#define NTP_PHASE_LIMIT (MAXPHASE << 5)  
+
+struct timex {
+ unsigned int modes;
+ long offset;
+ long freq;
+ long maxerror;
+ long esterror;
+ int status;
+ long constant;
+ long precision;
+ long tolerance;
+ struct timeval time;
+ long tick;
+
+ long ppsfreq;
+ long jitter;
+ int shift;
+ long stabil;
+ long jitcnt;
+ long calcnt;
+ long errcnt;
+ long stbcnt;
+
+ int :32; int :32; int :32; int :32;
+ int :32; int :32; int :32; int :32;
+ int :32; int :32; int :32; int :32;
+};
+
+#define ADJ_OFFSET 0x0001  
+#define ADJ_FREQUENCY 0x0002  
+#define ADJ_MAXERROR 0x0004  
+#define ADJ_ESTERROR 0x0008  
+#define ADJ_STATUS 0x0010  
+#define ADJ_TIMECONST 0x0020  
+#define ADJ_TICK 0x4000  
+#define ADJ_OFFSET_SINGLESHOT 0x8001  
+
+#define MOD_OFFSET ADJ_OFFSET
+#define MOD_FREQUENCY ADJ_FREQUENCY
+#define MOD_MAXERROR ADJ_MAXERROR
+#define MOD_ESTERROR ADJ_ESTERROR
+#define MOD_STATUS ADJ_STATUS
+#define MOD_TIMECONST ADJ_TIMECONST
+#define MOD_CLKB ADJ_TICK
+#define MOD_CLKA ADJ_OFFSET_SINGLESHOT  
+
+#define STA_PLL 0x0001  
+#define STA_PPSFREQ 0x0002  
+#define STA_PPSTIME 0x0004  
+#define STA_FLL 0x0008  
+
+#define STA_INS 0x0010  
+#define STA_DEL 0x0020  
+#define STA_UNSYNC 0x0040  
+#define STA_FREQHOLD 0x0080  
+
+#define STA_PPSSIGNAL 0x0100  
+#define STA_PPSJITTER 0x0200  
+#define STA_PPSWANDER 0x0400  
+#define STA_PPSERROR 0x0800  
+
+#define STA_CLOCKERR 0x1000  
+
+#define STA_RONLY (STA_PPSSIGNAL | STA_PPSJITTER | STA_PPSWANDER |   STA_PPSERROR | STA_CLOCKERR)  
+
+#define TIME_OK 0  
+#define TIME_INS 1  
+#define TIME_DEL 2  
+#define TIME_OOP 3  
+#define TIME_WAIT 4  
+#define TIME_ERROR 5  
+#define TIME_BAD TIME_ERROR  
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/tiocl.h b/ndk/platforms/android-3/include/linux/tiocl.h
new file mode 100644
index 0000000..db15a8d
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/tiocl.h
@@ -0,0 +1,47 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_TIOCL_H
+#define _LINUX_TIOCL_H
+
+#define TIOCL_SETSEL 2  
+#define TIOCL_SELCHAR 0  
+#define TIOCL_SELWORD 1  
+#define TIOCL_SELLINE 2  
+#define TIOCL_SELPOINTER 3  
+#define TIOCL_SELCLEAR 4  
+#define TIOCL_SELMOUSEREPORT 16  
+#define TIOCL_SELBUTTONMASK 15  
+
+struct tiocl_selection {
+ unsigned short xs;
+ unsigned short ys;
+ unsigned short xe;
+ unsigned short ye;
+ unsigned short sel_mode;
+};
+
+#define TIOCL_PASTESEL 3  
+#define TIOCL_UNBLANKSCREEN 4  
+
+#define TIOCL_SELLOADLUT 5
+
+#define TIOCL_GETSHIFTSTATE 6  
+#define TIOCL_GETMOUSEREPORTING 7  
+#define TIOCL_SETVESABLANK 10  
+#define TIOCL_SETKMSGREDIRECT 11  
+#define TIOCL_GETFGCONSOLE 12  
+#define TIOCL_SCROLLCONSOLE 13  
+#define TIOCL_BLANKSCREEN 14  
+#define TIOCL_BLANKEDSCREEN 15  
+#define TIOCL_GETKMSGREDIRECT 17  
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/transport_class.h b/ndk/platforms/android-3/include/linux/transport_class.h
new file mode 100644
index 0000000..71ad084
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/transport_class.h
@@ -0,0 +1,48 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _TRANSPORT_CLASS_H_
+#define _TRANSPORT_CLASS_H_
+
+#include <linux/device.h>
+#include <linux/attribute_container.h>
+
+struct transport_container;
+
+struct transport_class {
+ struct class class;
+ int (*setup)(struct transport_container *, struct device *,
+ struct class_device *);
+ int (*configure)(struct transport_container *, struct device *,
+ struct class_device *);
+ int (*remove)(struct transport_container *, struct device *,
+ struct class_device *);
+};
+
+#define DECLARE_TRANSPORT_CLASS(cls, nm, su, rm, cfg)  struct transport_class cls = {   .class = {   .name = nm,   },   .setup = su,   .remove = rm,   .configure = cfg,  }
+
+struct anon_transport_class {
+ struct transport_class tclass;
+ struct attribute_container container;
+};
+
+#define DECLARE_ANON_TRANSPORT_CLASS(cls, mtch, cfg)  struct anon_transport_class cls = {   .tclass = {   .configure = cfg,   },   . container = {   .match = mtch,   },  }
+
+#define class_to_transport_class(x)   container_of(x, struct transport_class, class)
+
+struct transport_container {
+ struct attribute_container ac;
+ struct attribute_group *statistics;
+};
+
+#define attribute_container_to_transport_container(x)   container_of(x, struct transport_container, ac)
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/tty.h b/ndk/platforms/android-3/include/linux/tty.h
new file mode 100644
index 0000000..b28791c
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/tty.h
@@ -0,0 +1,15 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_TTY_H
+#define _LINUX_TTY_H
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/types.h b/ndk/platforms/android-3/include/linux/types.h
new file mode 100644
index 0000000..b118db0
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/types.h
@@ -0,0 +1,37 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_TYPES_H
+#define _LINUX_TYPES_H
+
+#include <linux/posix_types.h>
+#include <asm/types.h>
+
+#define __bitwise__
+#define __bitwise
+
+typedef __u16 __bitwise __le16;
+typedef __u16 __bitwise __be16;
+typedef __u32 __bitwise __le32;
+typedef __u32 __bitwise __be32;
+#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
+typedef __u64 __bitwise __le64;
+typedef __u64 __bitwise __be64;
+#endif
+
+struct ustat {
+ __kernel_daddr_t f_tfree;
+ __kernel_ino_t f_tinode;
+ char f_fname[6];
+ char f_fpack[6];
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/udp.h b/ndk/platforms/android-3/include/linux/udp.h
new file mode 100644
index 0000000..e4bf864
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/udp.h
@@ -0,0 +1,30 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_UDP_H
+#define _LINUX_UDP_H
+
+#include <linux/types.h>
+
+struct udphdr {
+ __u16 source;
+ __u16 dest;
+ __u16 len;
+ __u16 check;
+};
+
+#define UDP_CORK 1  
+#define UDP_ENCAP 100  
+
+#define UDP_ENCAP_ESPINUDP_NON_IKE 1  
+#define UDP_ENCAP_ESPINUDP 2  
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/ufs_fs_i.h b/ndk/platforms/android-3/include/linux/ufs_fs_i.h
new file mode 100644
index 0000000..d71adb6
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/ufs_fs_i.h
@@ -0,0 +1,33 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_UFS_FS_I_H
+#define _LINUX_UFS_FS_I_H
+
+struct ufs_inode_info {
+ union {
+ __fs32 i_data[15];
+ __u8 i_symlink[4*15];
+ __fs64 u2_i_data[15];
+ } i_u1;
+ __u32 i_flags;
+ __u32 i_gen;
+ __u32 i_shadow;
+ __u32 i_unused1;
+ __u32 i_unused2;
+ __u32 i_oeftflag;
+ __u16 i_osync;
+ __u32 i_lastfrag;
+ __u32 i_dir_start_lookup;
+ struct inode vfs_inode;
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/ufs_fs_sb.h b/ndk/platforms/android-3/include/linux/ufs_fs_sb.h
new file mode 100644
index 0000000..9c7226d
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/ufs_fs_sb.h
@@ -0,0 +1,35 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __LINUX_UFS_FS_SB_H
+#define __LINUX_UFS_FS_SB_H
+
+#define UFS_MAX_GROUP_LOADED 8
+#define UFS_CGNO_EMPTY ((unsigned)-1)
+
+struct ufs_sb_private_info;
+struct ufs_cg_private_info;
+struct ufs_csum;
+#define UFS_MAXCSBUFS 31
+
+struct ufs_sb_info {
+ struct ufs_sb_private_info * s_uspi;
+ struct ufs_csum * s_csp;
+ unsigned s_bytesex;
+ unsigned s_flags;
+ struct buffer_head ** s_ucg;
+ struct ufs_cg_private_info * s_ucpi[UFS_MAX_GROUP_LOADED];
+ unsigned s_cgno[UFS_MAX_GROUP_LOADED];
+ unsigned short s_cg_loaded;
+ unsigned s_mount_opt;
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/uio.h b/ndk/platforms/android-3/include/linux/uio.h
new file mode 100644
index 0000000..b0895af
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/uio.h
@@ -0,0 +1,27 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __LINUX_UIO_H
+#define __LINUX_UIO_H
+
+#include <linux/compiler.h>
+#include <linux/types.h>
+
+struct iovec
+{
+ void __user *iov_base;
+ __kernel_size_t iov_len;
+};
+
+#define UIO_FASTIOV 8
+#define UIO_MAXIOV 1024
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/un.h b/ndk/platforms/android-3/include/linux/un.h
new file mode 100644
index 0000000..5b51b7c
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/un.h
@@ -0,0 +1,22 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_UN_H
+#define _LINUX_UN_H
+
+#define UNIX_PATH_MAX 108
+
+struct sockaddr_un {
+ sa_family_t sun_family;
+ char sun_path[UNIX_PATH_MAX];
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/unistd.h b/ndk/platforms/android-3/include/linux/unistd.h
new file mode 100644
index 0000000..6a3ec4c
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/unistd.h
@@ -0,0 +1,17 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_UNISTD_H_
+#define _LINUX_UNISTD_H_
+
+#include <asm/unistd.h>
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/usb.h b/ndk/platforms/android-3/include/linux/usb.h
new file mode 100644
index 0000000..ceee194
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/usb.h
@@ -0,0 +1,21 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __LINUX_USB_H
+#define __LINUX_USB_H
+
+#include <linux/mod_devicetable.h>
+#include <linux/usb_ch9.h>
+
+#define USB_MAJOR 180
+#define USB_DEVICE_MAJOR 189
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/usb_ch9.h b/ndk/platforms/android-3/include/linux/usb_ch9.h
new file mode 100644
index 0000000..74e31e7
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/usb_ch9.h
@@ -0,0 +1,388 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __LINUX_USB_CH9_H
+#define __LINUX_USB_CH9_H
+
+#include <linux/types.h>  
+
+#define USB_DIR_OUT 0  
+#define USB_DIR_IN 0x80  
+
+#define USB_TYPE_MASK (0x03 << 5)
+#define USB_TYPE_STANDARD (0x00 << 5)
+#define USB_TYPE_CLASS (0x01 << 5)
+#define USB_TYPE_VENDOR (0x02 << 5)
+#define USB_TYPE_RESERVED (0x03 << 5)
+
+#define USB_RECIP_MASK 0x1f
+#define USB_RECIP_DEVICE 0x00
+#define USB_RECIP_INTERFACE 0x01
+#define USB_RECIP_ENDPOINT 0x02
+#define USB_RECIP_OTHER 0x03
+
+#define USB_RECIP_PORT 0x04
+#define USB_RECIP_RPIPE 0x05
+
+#define USB_REQ_GET_STATUS 0x00
+#define USB_REQ_CLEAR_FEATURE 0x01
+#define USB_REQ_SET_FEATURE 0x03
+#define USB_REQ_SET_ADDRESS 0x05
+#define USB_REQ_GET_DESCRIPTOR 0x06
+#define USB_REQ_SET_DESCRIPTOR 0x07
+#define USB_REQ_GET_CONFIGURATION 0x08
+#define USB_REQ_SET_CONFIGURATION 0x09
+#define USB_REQ_GET_INTERFACE 0x0A
+#define USB_REQ_SET_INTERFACE 0x0B
+#define USB_REQ_SYNCH_FRAME 0x0C
+
+#define USB_REQ_SET_ENCRYPTION 0x0D  
+#define USB_REQ_GET_ENCRYPTION 0x0E
+#define USB_REQ_RPIPE_ABORT 0x0E
+#define USB_REQ_SET_HANDSHAKE 0x0F
+#define USB_REQ_RPIPE_RESET 0x0F
+#define USB_REQ_GET_HANDSHAKE 0x10
+#define USB_REQ_SET_CONNECTION 0x11
+#define USB_REQ_SET_SECURITY_DATA 0x12
+#define USB_REQ_GET_SECURITY_DATA 0x13
+#define USB_REQ_SET_WUSB_DATA 0x14
+#define USB_REQ_LOOPBACK_DATA_WRITE 0x15
+#define USB_REQ_LOOPBACK_DATA_READ 0x16
+#define USB_REQ_SET_INTERFACE_DS 0x17
+
+#define USB_DEVICE_SELF_POWERED 0  
+#define USB_DEVICE_REMOTE_WAKEUP 1  
+#define USB_DEVICE_TEST_MODE 2  
+#define USB_DEVICE_BATTERY 2  
+#define USB_DEVICE_B_HNP_ENABLE 3  
+#define USB_DEVICE_WUSB_DEVICE 3  
+#define USB_DEVICE_A_HNP_SUPPORT 4  
+#define USB_DEVICE_A_ALT_HNP_SUPPORT 5  
+#define USB_DEVICE_DEBUG_MODE 6  
+
+#define USB_ENDPOINT_HALT 0  
+
+struct usb_ctrlrequest {
+ __u8 bRequestType;
+ __u8 bRequest;
+ __le16 wValue;
+ __le16 wIndex;
+ __le16 wLength;
+} __attribute__ ((packed));
+
+#define USB_DT_DEVICE 0x01
+#define USB_DT_CONFIG 0x02
+#define USB_DT_STRING 0x03
+#define USB_DT_INTERFACE 0x04
+#define USB_DT_ENDPOINT 0x05
+#define USB_DT_DEVICE_QUALIFIER 0x06
+#define USB_DT_OTHER_SPEED_CONFIG 0x07
+#define USB_DT_INTERFACE_POWER 0x08
+
+#define USB_DT_OTG 0x09
+#define USB_DT_DEBUG 0x0a
+#define USB_DT_INTERFACE_ASSOCIATION 0x0b
+
+#define USB_DT_SECURITY 0x0c
+#define USB_DT_KEY 0x0d
+#define USB_DT_ENCRYPTION_TYPE 0x0e
+#define USB_DT_BOS 0x0f
+#define USB_DT_DEVICE_CAPABILITY 0x10
+#define USB_DT_WIRELESS_ENDPOINT_COMP 0x11
+#define USB_DT_WIRE_ADAPTER 0x21
+#define USB_DT_RPIPE 0x22
+
+#define USB_DT_CS_DEVICE 0x21
+#define USB_DT_CS_CONFIG 0x22
+#define USB_DT_CS_STRING 0x23
+#define USB_DT_CS_INTERFACE 0x24
+#define USB_DT_CS_ENDPOINT 0x25
+
+struct usb_descriptor_header {
+ __u8 bLength;
+ __u8 bDescriptorType;
+} __attribute__ ((packed));
+
+struct usb_device_descriptor {
+ __u8 bLength;
+ __u8 bDescriptorType;
+
+ __le16 bcdUSB;
+ __u8 bDeviceClass;
+ __u8 bDeviceSubClass;
+ __u8 bDeviceProtocol;
+ __u8 bMaxPacketSize0;
+ __le16 idVendor;
+ __le16 idProduct;
+ __le16 bcdDevice;
+ __u8 iManufacturer;
+ __u8 iProduct;
+ __u8 iSerialNumber;
+ __u8 bNumConfigurations;
+} __attribute__ ((packed));
+
+#define USB_DT_DEVICE_SIZE 18
+
+#define USB_CLASS_PER_INTERFACE 0  
+#define USB_CLASS_AUDIO 1
+#define USB_CLASS_COMM 2
+#define USB_CLASS_HID 3
+#define USB_CLASS_PHYSICAL 5
+#define USB_CLASS_STILL_IMAGE 6
+#define USB_CLASS_PRINTER 7
+#define USB_CLASS_MASS_STORAGE 8
+#define USB_CLASS_HUB 9
+#define USB_CLASS_CDC_DATA 0x0a
+#define USB_CLASS_CSCID 0x0b  
+#define USB_CLASS_CONTENT_SEC 0x0d  
+#define USB_CLASS_VIDEO 0x0e
+#define USB_CLASS_WIRELESS_CONTROLLER 0xe0
+#define USB_CLASS_APP_SPEC 0xfe
+#define USB_CLASS_VENDOR_SPEC 0xff
+
+struct usb_config_descriptor {
+ __u8 bLength;
+ __u8 bDescriptorType;
+
+ __le16 wTotalLength;
+ __u8 bNumInterfaces;
+ __u8 bConfigurationValue;
+ __u8 iConfiguration;
+ __u8 bmAttributes;
+ __u8 bMaxPower;
+} __attribute__ ((packed));
+
+#define USB_DT_CONFIG_SIZE 9
+
+#define USB_CONFIG_ATT_ONE (1 << 7)  
+#define USB_CONFIG_ATT_SELFPOWER (1 << 6)  
+#define USB_CONFIG_ATT_WAKEUP (1 << 5)  
+#define USB_CONFIG_ATT_BATTERY (1 << 4)  
+
+struct usb_string_descriptor {
+ __u8 bLength;
+ __u8 bDescriptorType;
+
+ __le16 wData[1];
+} __attribute__ ((packed));
+
+struct usb_interface_descriptor {
+ __u8 bLength;
+ __u8 bDescriptorType;
+
+ __u8 bInterfaceNumber;
+ __u8 bAlternateSetting;
+ __u8 bNumEndpoints;
+ __u8 bInterfaceClass;
+ __u8 bInterfaceSubClass;
+ __u8 bInterfaceProtocol;
+ __u8 iInterface;
+} __attribute__ ((packed));
+
+#define USB_DT_INTERFACE_SIZE 9
+
+struct usb_endpoint_descriptor {
+ __u8 bLength;
+ __u8 bDescriptorType;
+
+ __u8 bEndpointAddress;
+ __u8 bmAttributes;
+ __le16 wMaxPacketSize;
+ __u8 bInterval;
+
+ __u8 bRefresh;
+ __u8 bSynchAddress;
+} __attribute__ ((packed));
+
+#define USB_DT_ENDPOINT_SIZE 7
+#define USB_DT_ENDPOINT_AUDIO_SIZE 9  
+
+#define USB_ENDPOINT_NUMBER_MASK 0x0f  
+#define USB_ENDPOINT_DIR_MASK 0x80
+
+#define USB_ENDPOINT_XFERTYPE_MASK 0x03  
+#define USB_ENDPOINT_XFER_CONTROL 0
+#define USB_ENDPOINT_XFER_ISOC 1
+#define USB_ENDPOINT_XFER_BULK 2
+#define USB_ENDPOINT_XFER_INT 3
+#define USB_ENDPOINT_MAX_ADJUSTABLE 0x80
+
+struct usb_qualifier_descriptor {
+ __u8 bLength;
+ __u8 bDescriptorType;
+
+ __le16 bcdUSB;
+ __u8 bDeviceClass;
+ __u8 bDeviceSubClass;
+ __u8 bDeviceProtocol;
+ __u8 bMaxPacketSize0;
+ __u8 bNumConfigurations;
+ __u8 bRESERVED;
+} __attribute__ ((packed));
+
+struct usb_otg_descriptor {
+ __u8 bLength;
+ __u8 bDescriptorType;
+
+ __u8 bmAttributes;
+} __attribute__ ((packed));
+
+#define USB_OTG_SRP (1 << 0)
+#define USB_OTG_HNP (1 << 1)  
+
+struct usb_debug_descriptor {
+ __u8 bLength;
+ __u8 bDescriptorType;
+
+ __u8 bDebugInEndpoint;
+ __u8 bDebugOutEndpoint;
+};
+
+struct usb_interface_assoc_descriptor {
+ __u8 bLength;
+ __u8 bDescriptorType;
+
+ __u8 bFirstInterface;
+ __u8 bInterfaceCount;
+ __u8 bFunctionClass;
+ __u8 bFunctionSubClass;
+ __u8 bFunctionProtocol;
+ __u8 iFunction;
+} __attribute__ ((packed));
+
+struct usb_security_descriptor {
+ __u8 bLength;
+ __u8 bDescriptorType;
+
+ __le16 wTotalLength;
+ __u8 bNumEncryptionTypes;
+};
+
+struct usb_key_descriptor {
+ __u8 bLength;
+ __u8 bDescriptorType;
+
+ __u8 tTKID[3];
+ __u8 bReserved;
+ __u8 bKeyData[0];
+};
+
+struct usb_encryption_descriptor {
+ __u8 bLength;
+ __u8 bDescriptorType;
+
+ __u8 bEncryptionType;
+#define USB_ENC_TYPE_UNSECURE 0
+#define USB_ENC_TYPE_WIRED 1  
+#define USB_ENC_TYPE_CCM_1 2  
+#define USB_ENC_TYPE_RSA_1 3  
+ __u8 bEncryptionValue;
+ __u8 bAuthKeyIndex;
+};
+
+struct usb_bos_descriptor {
+ __u8 bLength;
+ __u8 bDescriptorType;
+
+ __le16 wTotalLength;
+ __u8 bNumDeviceCaps;
+};
+
+struct usb_dev_cap_header {
+ __u8 bLength;
+ __u8 bDescriptorType;
+ __u8 bDevCapabilityType;
+};
+
+#define USB_CAP_TYPE_WIRELESS_USB 1
+
+struct usb_wireless_cap_descriptor {
+ __u8 bLength;
+ __u8 bDescriptorType;
+ __u8 bDevCapabilityType;
+
+ __u8 bmAttributes;
+#define USB_WIRELESS_P2P_DRD (1 << 1)
+#define USB_WIRELESS_BEACON_MASK (3 << 2)
+#define USB_WIRELESS_BEACON_SELF (1 << 2)
+#define USB_WIRELESS_BEACON_DIRECTED (2 << 2)
+#define USB_WIRELESS_BEACON_NONE (3 << 2)
+ __le16 wPHYRates;
+#define USB_WIRELESS_PHY_53 (1 << 0)  
+#define USB_WIRELESS_PHY_80 (1 << 1)
+#define USB_WIRELESS_PHY_107 (1 << 2)  
+#define USB_WIRELESS_PHY_160 (1 << 3)
+#define USB_WIRELESS_PHY_200 (1 << 4)  
+#define USB_WIRELESS_PHY_320 (1 << 5)
+#define USB_WIRELESS_PHY_400 (1 << 6)
+#define USB_WIRELESS_PHY_480 (1 << 7)
+ __u8 bmTFITXPowerInfo;
+ __u8 bmFFITXPowerInfo;
+ __le16 bmBandGroup;
+ __u8 bReserved;
+};
+
+struct usb_wireless_ep_comp_descriptor {
+ __u8 bLength;
+ __u8 bDescriptorType;
+
+ __u8 bMaxBurst;
+ __u8 bMaxSequence;
+ __le16 wMaxStreamDelay;
+ __le16 wOverTheAirPacketSize;
+ __u8 bOverTheAirInterval;
+ __u8 bmCompAttributes;
+#define USB_ENDPOINT_SWITCH_MASK 0x03  
+#define USB_ENDPOINT_SWITCH_NO 0
+#define USB_ENDPOINT_SWITCH_SWITCH 1
+#define USB_ENDPOINT_SWITCH_SCALE 2
+};
+
+struct usb_handshake {
+ __u8 bMessageNumber;
+ __u8 bStatus;
+ __u8 tTKID[3];
+ __u8 bReserved;
+ __u8 CDID[16];
+ __u8 nonce[16];
+ __u8 MIC[8];
+};
+
+struct usb_connection_context {
+ __u8 CHID[16];
+ __u8 CDID[16];
+ __u8 CK[16];
+};
+
+enum usb_device_speed {
+ USB_SPEED_UNKNOWN = 0,
+ USB_SPEED_LOW, USB_SPEED_FULL,
+ USB_SPEED_HIGH,
+ USB_SPEED_VARIABLE,
+};
+
+enum usb_device_state {
+
+ USB_STATE_NOTATTACHED = 0,
+
+ USB_STATE_ATTACHED,
+ USB_STATE_POWERED,
+ USB_STATE_UNAUTHENTICATED,
+ USB_STATE_RECONNECTING,
+ USB_STATE_DEFAULT,
+ USB_STATE_ADDRESS,
+ USB_STATE_CONFIGURED,
+
+ USB_STATE_SUSPENDED
+
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/usbdevice_fs.h b/ndk/platforms/android-3/include/linux/usbdevice_fs.h
new file mode 100644
index 0000000..f36efdc
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/usbdevice_fs.h
@@ -0,0 +1,123 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_USBDEVICE_FS_H
+#define _LINUX_USBDEVICE_FS_H
+
+#include <linux/types.h>
+
+#define USBDEVICE_SUPER_MAGIC 0x9fa2
+
+struct usbdevfs_ctrltransfer {
+ __u8 bRequestType;
+ __u8 bRequest;
+ __u16 wValue;
+ __u16 wIndex;
+ __u16 wLength;
+ __u32 timeout;
+ void __user *data;
+};
+
+struct usbdevfs_bulktransfer {
+ unsigned int ep;
+ unsigned int len;
+ unsigned int timeout;
+ void __user *data;
+};
+
+struct usbdevfs_setinterface {
+ unsigned int interface;
+ unsigned int altsetting;
+};
+
+struct usbdevfs_disconnectsignal {
+ unsigned int signr;
+ void __user *context;
+};
+
+#define USBDEVFS_MAXDRIVERNAME 255
+
+struct usbdevfs_getdriver {
+ unsigned int interface;
+ char driver[USBDEVFS_MAXDRIVERNAME + 1];
+};
+
+struct usbdevfs_connectinfo {
+ unsigned int devnum;
+ unsigned char slow;
+};
+
+#define USBDEVFS_URB_SHORT_NOT_OK 1
+#define USBDEVFS_URB_ISO_ASAP 2
+
+#define USBDEVFS_URB_TYPE_ISO 0
+#define USBDEVFS_URB_TYPE_INTERRUPT 1
+#define USBDEVFS_URB_TYPE_CONTROL 2
+#define USBDEVFS_URB_TYPE_BULK 3
+
+struct usbdevfs_iso_packet_desc {
+ unsigned int length;
+ unsigned int actual_length;
+ unsigned int status;
+};
+
+struct usbdevfs_urb {
+ unsigned char type;
+ unsigned char endpoint;
+ int status;
+ unsigned int flags;
+ void __user *buffer;
+ int buffer_length;
+ int actual_length;
+ int start_frame;
+ int number_of_packets;
+ int error_count;
+ unsigned int signr;
+ void *usercontext;
+ struct usbdevfs_iso_packet_desc iso_frame_desc[0];
+};
+
+struct usbdevfs_ioctl {
+ int ifno;
+ int ioctl_code;
+ void __user *data;
+};
+
+struct usbdevfs_hub_portinfo {
+ char nports;
+ char port [127];
+};
+
+#define USBDEVFS_CONTROL _IOWR('U', 0, struct usbdevfs_ctrltransfer)
+#define USBDEVFS_BULK _IOWR('U', 2, struct usbdevfs_bulktransfer)
+#define USBDEVFS_RESETEP _IOR('U', 3, unsigned int)
+#define USBDEVFS_SETINTERFACE _IOR('U', 4, struct usbdevfs_setinterface)
+#define USBDEVFS_SETCONFIGURATION _IOR('U', 5, unsigned int)
+#define USBDEVFS_GETDRIVER _IOW('U', 8, struct usbdevfs_getdriver)
+#define USBDEVFS_SUBMITURB _IOR('U', 10, struct usbdevfs_urb)
+#define USBDEVFS_SUBMITURB32 _IOR('U', 10, struct usbdevfs_urb32)
+#define USBDEVFS_DISCARDURB _IO('U', 11)
+#define USBDEVFS_REAPURB _IOW('U', 12, void *)
+#define USBDEVFS_REAPURB32 _IOW('U', 12, u32)
+#define USBDEVFS_REAPURBNDELAY _IOW('U', 13, void *)
+#define USBDEVFS_REAPURBNDELAY32 _IOW('U', 13, u32)
+#define USBDEVFS_DISCSIGNAL _IOR('U', 14, struct usbdevfs_disconnectsignal)
+#define USBDEVFS_CLAIMINTERFACE _IOR('U', 15, unsigned int)
+#define USBDEVFS_RELEASEINTERFACE _IOR('U', 16, unsigned int)
+#define USBDEVFS_CONNECTINFO _IOW('U', 17, struct usbdevfs_connectinfo)
+#define USBDEVFS_IOCTL _IOWR('U', 18, struct usbdevfs_ioctl)
+#define USBDEVFS_IOCTL32 _IOWR('U', 18, struct usbdevfs_ioctl32)
+#define USBDEVFS_HUB_PORTINFO _IOR('U', 19, struct usbdevfs_hub_portinfo)
+#define USBDEVFS_RESET _IO('U', 20)
+#define USBDEVFS_CLEAR_HALT _IOR('U', 21, unsigned int)
+#define USBDEVFS_DISCONNECT _IO('U', 22)
+#define USBDEVFS_CONNECT _IO('U', 23)
+#endif
diff --git a/ndk/platforms/android-3/include/linux/user.h b/ndk/platforms/android-3/include/linux/user.h
new file mode 100644
index 0000000..1c0b9cb
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/user.h
@@ -0,0 +1,12 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#include <asm/user.h>
diff --git a/ndk/platforms/android-3/include/linux/utime.h b/ndk/platforms/android-3/include/linux/utime.h
new file mode 100644
index 0000000..4b1ba9c
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/utime.h
@@ -0,0 +1,20 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_UTIME_H
+#define _LINUX_UTIME_H
+
+struct utimbuf {
+ time_t actime;
+ time_t modtime;
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/utsname.h b/ndk/platforms/android-3/include/linux/utsname.h
new file mode 100644
index 0000000..ea6ee89
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/utsname.h
@@ -0,0 +1,44 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_UTSNAME_H
+#define _LINUX_UTSNAME_H
+
+#define __OLD_UTS_LEN 8
+
+struct oldold_utsname {
+ char sysname[9];
+ char nodename[9];
+ char release[9];
+ char version[9];
+ char machine[9];
+};
+
+#define __NEW_UTS_LEN 64
+
+struct old_utsname {
+ char sysname[65];
+ char nodename[65];
+ char release[65];
+ char version[65];
+ char machine[65];
+};
+
+struct new_utsname {
+ char sysname[65];
+ char nodename[65];
+ char release[65];
+ char version[65];
+ char machine[65];
+ char domainname[65];
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/version.h b/ndk/platforms/android-3/include/linux/version.h
new file mode 100644
index 0000000..beff0ed
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/version.h
@@ -0,0 +1,13 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#define LINUX_VERSION_CODE 132626
+#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
diff --git a/ndk/platforms/android-3/include/linux/vfs.h b/ndk/platforms/android-3/include/linux/vfs.h
new file mode 100644
index 0000000..70636e9
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/vfs.h
@@ -0,0 +1,17 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_VFS_H
+#define _LINUX_VFS_H
+
+#include <linux/statfs.h>
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/videodev.h b/ndk/platforms/android-3/include/linux/videodev.h
new file mode 100644
index 0000000..1f37fde
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/videodev.h
@@ -0,0 +1,327 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __LINUX_VIDEODEV_H
+#define __LINUX_VIDEODEV_H
+
+#include <linux/videodev2.h>
+
+struct video_capability
+{
+ char name[32];
+ int type;
+ int channels;
+ int audios;
+ int maxwidth;
+ int maxheight;
+ int minwidth;
+ int minheight;
+};
+
+struct video_channel
+{
+ int channel;
+ char name[32];
+ int tuners;
+ __u32 flags;
+#define VIDEO_VC_TUNER 1  
+#define VIDEO_VC_AUDIO 2  
+ __u16 type;
+#define VIDEO_TYPE_TV 1
+#define VIDEO_TYPE_CAMERA 2
+ __u16 norm;
+};
+
+struct video_tuner
+{
+ int tuner;
+ char name[32];
+ unsigned long rangelow, rangehigh;
+ __u32 flags;
+#define VIDEO_TUNER_PAL 1
+#define VIDEO_TUNER_NTSC 2
+#define VIDEO_TUNER_SECAM 4
+#define VIDEO_TUNER_LOW 8  
+#define VIDEO_TUNER_NORM 16  
+#define VIDEO_TUNER_STEREO_ON 128  
+#define VIDEO_TUNER_RDS_ON 256  
+#define VIDEO_TUNER_MBS_ON 512  
+ __u16 mode;
+#define VIDEO_MODE_PAL 0
+#define VIDEO_MODE_NTSC 1
+#define VIDEO_MODE_SECAM 2
+#define VIDEO_MODE_AUTO 3
+ __u16 signal;
+};
+
+struct video_picture
+{
+ __u16 brightness;
+ __u16 hue;
+ __u16 colour;
+ __u16 contrast;
+ __u16 whiteness;
+ __u16 depth;
+ __u16 palette;
+#define VIDEO_PALETTE_GREY 1  
+#define VIDEO_PALETTE_HI240 2  
+#define VIDEO_PALETTE_RGB565 3  
+#define VIDEO_PALETTE_RGB24 4  
+#define VIDEO_PALETTE_RGB32 5  
+#define VIDEO_PALETTE_RGB555 6  
+#define VIDEO_PALETTE_YUV422 7  
+#define VIDEO_PALETTE_YUYV 8
+#define VIDEO_PALETTE_UYVY 9  
+#define VIDEO_PALETTE_YUV420 10
+#define VIDEO_PALETTE_YUV411 11  
+#define VIDEO_PALETTE_RAW 12  
+#define VIDEO_PALETTE_YUV422P 13  
+#define VIDEO_PALETTE_YUV411P 14  
+#define VIDEO_PALETTE_YUV420P 15  
+#define VIDEO_PALETTE_YUV410P 16  
+#define VIDEO_PALETTE_PLANAR 13  
+#define VIDEO_PALETTE_COMPONENT 7  
+};
+
+struct video_audio
+{
+ int audio;
+ __u16 volume;
+ __u16 bass, treble;
+ __u32 flags;
+#define VIDEO_AUDIO_MUTE 1
+#define VIDEO_AUDIO_MUTABLE 2
+#define VIDEO_AUDIO_VOLUME 4
+#define VIDEO_AUDIO_BASS 8
+#define VIDEO_AUDIO_TREBLE 16
+#define VIDEO_AUDIO_BALANCE 32
+ char name[16];
+#define VIDEO_SOUND_MONO 1
+#define VIDEO_SOUND_STEREO 2
+#define VIDEO_SOUND_LANG1 4
+#define VIDEO_SOUND_LANG2 8
+ __u16 mode;
+ __u16 balance;
+ __u16 step;
+};
+
+struct video_clip
+{
+ __s32 x,y;
+ __s32 width, height;
+ struct video_clip *next;
+};
+
+struct video_window
+{
+ __u32 x,y;
+ __u32 width,height;
+ __u32 chromakey;
+ __u32 flags;
+ struct video_clip __user *clips;
+ int clipcount;
+#define VIDEO_WINDOW_INTERLACE 1
+#define VIDEO_WINDOW_CHROMAKEY 16  
+#define VIDEO_CLIP_BITMAP -1
+
+#define VIDEO_CLIPMAP_SIZE (128 * 625)
+};
+
+struct video_capture
+{
+ __u32 x,y;
+ __u32 width, height;
+ __u16 decimation;
+ __u16 flags;
+#define VIDEO_CAPTURE_ODD 0  
+#define VIDEO_CAPTURE_EVEN 1
+};
+
+struct video_buffer
+{
+ void *base;
+ int height,width;
+ int depth;
+ int bytesperline;
+};
+
+struct video_mmap
+{
+ unsigned int frame;
+ int height,width;
+ unsigned int format;
+};
+
+struct video_key
+{
+ __u8 key[8];
+ __u32 flags;
+};
+
+struct video_mbuf
+{
+ int size;
+ int frames;
+ int offsets[VIDEO_MAX_FRAME];
+};
+
+#define VIDEO_NO_UNIT (-1)
+
+struct video_unit
+{
+ int video;
+ int vbi;
+ int radio;
+ int audio;
+ int teletext;
+};
+
+struct vbi_format {
+ __u32 sampling_rate;
+ __u32 samples_per_line;
+ __u32 sample_format;
+ __s32 start[2];
+ __u32 count[2];
+ __u32 flags;
+#define VBI_UNSYNC 1  
+#define VBI_INTERLACED 2  
+};
+
+struct video_info
+{
+ __u32 frame_count;
+ __u32 h_size;
+ __u32 v_size;
+ __u32 smpte_timecode;
+ __u32 picture_type;
+ __u32 temporal_reference;
+ __u8 user_data[256];
+
+};
+
+struct video_play_mode
+{
+ int mode;
+ int p1;
+ int p2;
+};
+
+struct video_code
+{
+ char loadwhat[16];
+ int datasize;
+ __u8 *data;
+};
+
+#define VIDIOCGCAP _IOR('v',1,struct video_capability)  
+#define VIDIOCGCHAN _IOWR('v',2,struct video_channel)  
+#define VIDIOCSCHAN _IOW('v',3,struct video_channel)  
+#define VIDIOCGTUNER _IOWR('v',4,struct video_tuner)  
+#define VIDIOCSTUNER _IOW('v',5,struct video_tuner)  
+#define VIDIOCGPICT _IOR('v',6,struct video_picture)  
+#define VIDIOCSPICT _IOW('v',7,struct video_picture)  
+#define VIDIOCCAPTURE _IOW('v',8,int)  
+#define VIDIOCGWIN _IOR('v',9, struct video_window)  
+#define VIDIOCSWIN _IOW('v',10, struct video_window)  
+#define VIDIOCGFBUF _IOR('v',11, struct video_buffer)  
+#define VIDIOCSFBUF _IOW('v',12, struct video_buffer)  
+#define VIDIOCKEY _IOR('v',13, struct video_key)  
+#define VIDIOCGFREQ _IOR('v',14, unsigned long)  
+#define VIDIOCSFREQ _IOW('v',15, unsigned long)  
+#define VIDIOCGAUDIO _IOR('v',16, struct video_audio)  
+#define VIDIOCSAUDIO _IOW('v',17, struct video_audio)  
+#define VIDIOCSYNC _IOW('v',18, int)  
+#define VIDIOCMCAPTURE _IOW('v',19, struct video_mmap)  
+#define VIDIOCGMBUF _IOR('v',20, struct video_mbuf)  
+#define VIDIOCGUNIT _IOR('v',21, struct video_unit)  
+#define VIDIOCGCAPTURE _IOR('v',22, struct video_capture)  
+#define VIDIOCSCAPTURE _IOW('v',23, struct video_capture)  
+#define VIDIOCSPLAYMODE _IOW('v',24, struct video_play_mode)  
+#define VIDIOCSWRITEMODE _IOW('v',25, int)  
+#define VIDIOCGPLAYINFO _IOR('v',26, struct video_info)  
+#define VIDIOCSMICROCODE _IOW('v',27, struct video_code)  
+#define VIDIOCGVBIFMT _IOR('v',28, struct vbi_format)  
+#define VIDIOCSVBIFMT _IOW('v',29, struct vbi_format)  
+
+#define BASE_VIDIOCPRIVATE 192  
+
+#define VID_WRITE_MPEG_AUD 0
+#define VID_WRITE_MPEG_VID 1
+#define VID_WRITE_OSD 2
+#define VID_WRITE_TTX 3
+#define VID_WRITE_CC 4
+#define VID_WRITE_MJPEG 5
+
+#define VID_PLAY_VID_OUT_MODE 0
+
+#define VID_PLAY_GENLOCK 1
+
+#define VID_PLAY_NORMAL 2
+#define VID_PLAY_PAUSE 3
+#define VID_PLAY_SINGLE_FRAME 4
+#define VID_PLAY_FAST_FORWARD 5
+#define VID_PLAY_SLOW_MOTION 6
+#define VID_PLAY_IMMEDIATE_NORMAL 7
+#define VID_PLAY_SWITCH_CHANNELS 8
+#define VID_PLAY_FREEZE_FRAME 9
+#define VID_PLAY_STILL_MODE 10
+#define VID_PLAY_MASTER_MODE 11
+
+#define VID_PLAY_MASTER_NONE 1
+#define VID_PLAY_MASTER_VIDEO 2
+#define VID_PLAY_MASTER_AUDIO 3
+#define VID_PLAY_ACTIVE_SCANLINES 12
+
+#define VID_PLAY_RESET 13
+#define VID_PLAY_END_MARK 14
+
+#define VID_HARDWARE_BT848 1
+#define VID_HARDWARE_QCAM_BW 2
+#define VID_HARDWARE_PMS 3
+#define VID_HARDWARE_QCAM_C 4
+#define VID_HARDWARE_PSEUDO 5
+#define VID_HARDWARE_SAA5249 6
+#define VID_HARDWARE_AZTECH 7
+#define VID_HARDWARE_SF16MI 8
+#define VID_HARDWARE_RTRACK 9
+#define VID_HARDWARE_ZOLTRIX 10
+#define VID_HARDWARE_SAA7146 11
+#define VID_HARDWARE_VIDEUM 12  
+#define VID_HARDWARE_RTRACK2 13
+#define VID_HARDWARE_PERMEDIA2 14  
+#define VID_HARDWARE_RIVA128 15  
+#define VID_HARDWARE_PLANB 16  
+#define VID_HARDWARE_BROADWAY 17  
+#define VID_HARDWARE_GEMTEK 18
+#define VID_HARDWARE_TYPHOON 19
+#define VID_HARDWARE_VINO 20  
+#define VID_HARDWARE_CADET 21  
+#define VID_HARDWARE_TRUST 22  
+#define VID_HARDWARE_TERRATEC 23  
+#define VID_HARDWARE_CPIA 24
+#define VID_HARDWARE_ZR36120 25  
+#define VID_HARDWARE_ZR36067 26  
+#define VID_HARDWARE_OV511 27
+#define VID_HARDWARE_ZR356700 28  
+#define VID_HARDWARE_W9966 29
+#define VID_HARDWARE_SE401 30  
+#define VID_HARDWARE_PWC 31  
+#define VID_HARDWARE_MEYE 32  
+#define VID_HARDWARE_CPIA2 33
+#define VID_HARDWARE_VICAM 34
+#define VID_HARDWARE_SF16FMR2 35
+#define VID_HARDWARE_W9968CF 36
+#define VID_HARDWARE_SAA7114H 37
+#define VID_HARDWARE_SN9C102 38
+#define VID_HARDWARE_ARV 39
+
+#endif
+
diff --git a/ndk/platforms/android-3/include/linux/videodev2.h b/ndk/platforms/android-3/include/linux/videodev2.h
new file mode 100644
index 0000000..dae4e93
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/videodev2.h
@@ -0,0 +1,963 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __LINUX_VIDEODEV2_H
+#define __LINUX_VIDEODEV2_H
+#define __user
+#include <linux/types.h>
+
+#define VIDEO_MAX_FRAME 32
+
+#define VID_TYPE_CAPTURE 1  
+#define VID_TYPE_TUNER 2  
+#define VID_TYPE_TELETEXT 4  
+#define VID_TYPE_OVERLAY 8  
+#define VID_TYPE_CHROMAKEY 16  
+#define VID_TYPE_CLIPPING 32  
+#define VID_TYPE_FRAMERAM 64  
+#define VID_TYPE_SCALES 128  
+#define VID_TYPE_MONOCHROME 256  
+#define VID_TYPE_SUBCAPTURE 512  
+#define VID_TYPE_MPEG_DECODER 1024  
+#define VID_TYPE_MPEG_ENCODER 2048  
+#define VID_TYPE_MJPEG_DECODER 4096  
+#define VID_TYPE_MJPEG_ENCODER 8192  
+
+#define v4l2_fourcc(a,b,c,d)  (((__u32)(a)<<0)|((__u32)(b)<<8)|((__u32)(c)<<16)|((__u32)(d)<<24))
+
+enum v4l2_field {
+ V4L2_FIELD_ANY = 0,
+ V4L2_FIELD_NONE = 1,
+ V4L2_FIELD_TOP = 2,
+ V4L2_FIELD_BOTTOM = 3,
+ V4L2_FIELD_INTERLACED = 4,
+ V4L2_FIELD_SEQ_TB = 5,
+ V4L2_FIELD_SEQ_BT = 6,
+ V4L2_FIELD_ALTERNATE = 7,
+};
+#define V4L2_FIELD_HAS_TOP(field)   ((field) == V4L2_FIELD_TOP ||  (field) == V4L2_FIELD_INTERLACED ||  (field) == V4L2_FIELD_SEQ_TB ||  (field) == V4L2_FIELD_SEQ_BT)
+#define V4L2_FIELD_HAS_BOTTOM(field)   ((field) == V4L2_FIELD_BOTTOM ||  (field) == V4L2_FIELD_INTERLACED ||  (field) == V4L2_FIELD_SEQ_TB ||  (field) == V4L2_FIELD_SEQ_BT)
+#define V4L2_FIELD_HAS_BOTH(field)   ((field) == V4L2_FIELD_INTERLACED ||  (field) == V4L2_FIELD_SEQ_TB ||  (field) == V4L2_FIELD_SEQ_BT)
+
+enum v4l2_buf_type {
+ V4L2_BUF_TYPE_VIDEO_CAPTURE = 1,
+ V4L2_BUF_TYPE_VIDEO_OUTPUT = 2,
+ V4L2_BUF_TYPE_VIDEO_OVERLAY = 3,
+ V4L2_BUF_TYPE_VBI_CAPTURE = 4,
+ V4L2_BUF_TYPE_VBI_OUTPUT = 5,
+
+ V4L2_BUF_TYPE_SLICED_VBI_CAPTURE = 6,
+ V4L2_BUF_TYPE_SLICED_VBI_OUTPUT = 7,
+ V4L2_BUF_TYPE_PRIVATE = 0x80,
+};
+
+enum v4l2_ctrl_type {
+ V4L2_CTRL_TYPE_INTEGER = 1,
+ V4L2_CTRL_TYPE_BOOLEAN = 2,
+ V4L2_CTRL_TYPE_MENU = 3,
+ V4L2_CTRL_TYPE_BUTTON = 4,
+ V4L2_CTRL_TYPE_INTEGER64 = 5,
+ V4L2_CTRL_TYPE_CTRL_CLASS = 6,
+};
+
+enum v4l2_tuner_type {
+ V4L2_TUNER_RADIO = 1,
+ V4L2_TUNER_ANALOG_TV = 2,
+ V4L2_TUNER_DIGITAL_TV = 3,
+};
+
+enum v4l2_memory {
+ V4L2_MEMORY_MMAP = 1,
+ V4L2_MEMORY_USERPTR = 2,
+ V4L2_MEMORY_OVERLAY = 3,
+};
+
+enum v4l2_colorspace {
+
+ V4L2_COLORSPACE_SMPTE170M = 1,
+
+ V4L2_COLORSPACE_SMPTE240M = 2,
+
+ V4L2_COLORSPACE_REC709 = 3,
+
+ V4L2_COLORSPACE_BT878 = 4,
+
+ V4L2_COLORSPACE_470_SYSTEM_M = 5,
+ V4L2_COLORSPACE_470_SYSTEM_BG = 6,
+
+ V4L2_COLORSPACE_JPEG = 7,
+
+ V4L2_COLORSPACE_SRGB = 8,
+};
+
+enum v4l2_priority {
+ V4L2_PRIORITY_UNSET = 0,
+ V4L2_PRIORITY_BACKGROUND = 1,
+ V4L2_PRIORITY_INTERACTIVE = 2,
+ V4L2_PRIORITY_RECORD = 3,
+ V4L2_PRIORITY_DEFAULT = V4L2_PRIORITY_INTERACTIVE,
+};
+
+struct v4l2_rect {
+ __s32 left;
+ __s32 top;
+ __s32 width;
+ __s32 height;
+};
+
+struct v4l2_fract {
+ __u32 numerator;
+ __u32 denominator;
+};
+
+struct v4l2_capability
+{
+ __u8 driver[16];
+ __u8 card[32];
+ __u8 bus_info[32];
+ __u32 version;
+ __u32 capabilities;
+ __u32 reserved[4];
+};
+
+#define V4L2_CAP_VIDEO_CAPTURE 0x00000001  
+#define V4L2_CAP_VIDEO_OUTPUT 0x00000002  
+#define V4L2_CAP_VIDEO_OVERLAY 0x00000004  
+#define V4L2_CAP_VBI_CAPTURE 0x00000010  
+#define V4L2_CAP_VBI_OUTPUT 0x00000020  
+#define V4L2_CAP_SLICED_VBI_CAPTURE 0x00000040  
+#define V4L2_CAP_SLICED_VBI_OUTPUT 0x00000080  
+#define V4L2_CAP_RDS_CAPTURE 0x00000100  
+
+#define V4L2_CAP_TUNER 0x00010000  
+#define V4L2_CAP_AUDIO 0x00020000  
+#define V4L2_CAP_RADIO 0x00040000  
+
+#define V4L2_CAP_READWRITE 0x01000000  
+#define V4L2_CAP_ASYNCIO 0x02000000  
+#define V4L2_CAP_STREAMING 0x04000000  
+
+struct v4l2_pix_format
+{
+ __u32 width;
+ __u32 height;
+ __u32 pixelformat;
+ enum v4l2_field field;
+ __u32 bytesperline;
+ __u32 sizeimage;
+ enum v4l2_colorspace colorspace;
+ __u32 priv;
+};
+
+#define V4L2_PIX_FMT_RGB332 v4l2_fourcc('R','G','B','1')  
+#define V4L2_PIX_FMT_RGB555 v4l2_fourcc('R','G','B','O')  
+#define V4L2_PIX_FMT_RGB565 v4l2_fourcc('R','G','B','P')  
+#define V4L2_PIX_FMT_RGB555X v4l2_fourcc('R','G','B','Q')  
+#define V4L2_PIX_FMT_RGB565X v4l2_fourcc('R','G','B','R')  
+#define V4L2_PIX_FMT_BGR24 v4l2_fourcc('B','G','R','3')  
+#define V4L2_PIX_FMT_RGB24 v4l2_fourcc('R','G','B','3')  
+#define V4L2_PIX_FMT_BGR32 v4l2_fourcc('B','G','R','4')  
+#define V4L2_PIX_FMT_RGB32 v4l2_fourcc('R','G','B','4')  
+#define V4L2_PIX_FMT_GREY v4l2_fourcc('G','R','E','Y')  
+#define V4L2_PIX_FMT_YVU410 v4l2_fourcc('Y','V','U','9')  
+#define V4L2_PIX_FMT_YVU420 v4l2_fourcc('Y','V','1','2')  
+#define V4L2_PIX_FMT_YUYV v4l2_fourcc('Y','U','Y','V')  
+#define V4L2_PIX_FMT_UYVY v4l2_fourcc('U','Y','V','Y')  
+#define V4L2_PIX_FMT_YUV422P v4l2_fourcc('4','2','2','P')  
+#define V4L2_PIX_FMT_YUV411P v4l2_fourcc('4','1','1','P')  
+#define V4L2_PIX_FMT_Y41P v4l2_fourcc('Y','4','1','P')  
+
+#define V4L2_PIX_FMT_NV12 v4l2_fourcc('N','V','1','2')  
+#define V4L2_PIX_FMT_NV21 v4l2_fourcc('N','V','2','1')  
+
+#define V4L2_PIX_FMT_YUV410 v4l2_fourcc('Y','U','V','9')  
+#define V4L2_PIX_FMT_YUV420 v4l2_fourcc('Y','U','1','2')  
+#define V4L2_PIX_FMT_YYUV v4l2_fourcc('Y','Y','U','V')  
+#define V4L2_PIX_FMT_HI240 v4l2_fourcc('H','I','2','4')  
+#define V4L2_PIX_FMT_HM12 v4l2_fourcc('H','M','1','2')  
+
+#define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B','A','8','1')  
+
+#define V4L2_PIX_FMT_MJPEG v4l2_fourcc('M','J','P','G')  
+#define V4L2_PIX_FMT_JPEG v4l2_fourcc('J','P','E','G')  
+#define V4L2_PIX_FMT_DV v4l2_fourcc('d','v','s','d')  
+#define V4L2_PIX_FMT_MPEG v4l2_fourcc('M','P','E','G')  
+
+#define V4L2_PIX_FMT_WNVA v4l2_fourcc('W','N','V','A')  
+#define V4L2_PIX_FMT_SN9C10X v4l2_fourcc('S','9','1','0')  
+#define V4L2_PIX_FMT_PWC1 v4l2_fourcc('P','W','C','1')  
+#define V4L2_PIX_FMT_PWC2 v4l2_fourcc('P','W','C','2')  
+#define V4L2_PIX_FMT_ET61X251 v4l2_fourcc('E','6','2','5')  
+
+struct v4l2_fmtdesc
+{
+ __u32 index;
+ enum v4l2_buf_type type;
+ __u32 flags;
+ __u8 description[32];
+ __u32 pixelformat;
+ __u32 reserved[4];
+};
+
+#define V4L2_FMT_FLAG_COMPRESSED 0x0001
+
+struct v4l2_timecode
+{
+ __u32 type;
+ __u32 flags;
+ __u8 frames;
+ __u8 seconds;
+ __u8 minutes;
+ __u8 hours;
+ __u8 userbits[4];
+};
+
+#define V4L2_TC_TYPE_24FPS 1
+#define V4L2_TC_TYPE_25FPS 2
+#define V4L2_TC_TYPE_30FPS 3
+#define V4L2_TC_TYPE_50FPS 4
+#define V4L2_TC_TYPE_60FPS 5
+
+#define V4L2_TC_FLAG_DROPFRAME 0x0001  
+#define V4L2_TC_FLAG_COLORFRAME 0x0002
+#define V4L2_TC_USERBITS_field 0x000C
+#define V4L2_TC_USERBITS_USERDEFINED 0x0000
+#define V4L2_TC_USERBITS_8BITCHARS 0x0008
+
+struct v4l2_jpegcompression
+{
+ int quality;
+
+ int APPn;
+ int APP_len;
+ char APP_data[60];
+
+ int COM_len;
+ char COM_data[60];
+
+ __u32 jpeg_markers;
+
+#define V4L2_JPEG_MARKER_DHT (1<<3)  
+#define V4L2_JPEG_MARKER_DQT (1<<4)  
+#define V4L2_JPEG_MARKER_DRI (1<<5)  
+#define V4L2_JPEG_MARKER_COM (1<<6)  
+#define V4L2_JPEG_MARKER_APP (1<<7)  
+};
+
+struct v4l2_requestbuffers
+{
+ __u32 count;
+ enum v4l2_buf_type type;
+ enum v4l2_memory memory;
+ __u32 reserved[2];
+};
+
+struct v4l2_buffer
+{
+ __u32 index;
+ enum v4l2_buf_type type;
+ __u32 bytesused;
+ __u32 flags;
+ enum v4l2_field field;
+ struct timeval timestamp;
+ struct v4l2_timecode timecode;
+ __u32 sequence;
+
+ enum v4l2_memory memory;
+ union {
+ __u32 offset;
+ unsigned long userptr;
+ } m;
+ __u32 length;
+ __u32 input;
+ __u32 reserved;
+};
+
+#define V4L2_BUF_FLAG_MAPPED 0x0001  
+#define V4L2_BUF_FLAG_QUEUED 0x0002  
+#define V4L2_BUF_FLAG_DONE 0x0004  
+#define V4L2_BUF_FLAG_KEYFRAME 0x0008  
+#define V4L2_BUF_FLAG_PFRAME 0x0010  
+#define V4L2_BUF_FLAG_BFRAME 0x0020  
+#define V4L2_BUF_FLAG_TIMECODE 0x0100  
+#define V4L2_BUF_FLAG_INPUT 0x0200  
+
+struct v4l2_framebuffer
+{
+ __u32 capability;
+ __u32 flags;
+
+ void* base;
+ struct v4l2_pix_format fmt;
+};
+
+#define V4L2_FBUF_CAP_EXTERNOVERLAY 0x0001
+#define V4L2_FBUF_CAP_CHROMAKEY 0x0002
+#define V4L2_FBUF_CAP_LIST_CLIPPING 0x0004
+#define V4L2_FBUF_CAP_BITMAP_CLIPPING 0x0008
+
+#define V4L2_FBUF_FLAG_PRIMARY 0x0001
+#define V4L2_FBUF_FLAG_OVERLAY 0x0002
+#define V4L2_FBUF_FLAG_CHROMAKEY 0x0004
+
+struct v4l2_clip
+{
+ struct v4l2_rect c;
+ struct v4l2_clip __user *next;
+};
+
+struct v4l2_window
+{
+ struct v4l2_rect w;
+ enum v4l2_field field;
+ __u32 chromakey;
+ struct v4l2_clip __user *clips;
+ __u32 clipcount;
+ void __user *bitmap;
+};
+
+struct v4l2_captureparm
+{
+ __u32 capability;
+ __u32 capturemode;
+ struct v4l2_fract timeperframe;
+ __u32 extendedmode;
+ __u32 readbuffers;
+ __u32 reserved[4];
+};
+
+#define V4L2_MODE_HIGHQUALITY 0x0001  
+#define V4L2_CAP_TIMEPERFRAME 0x1000  
+
+struct v4l2_outputparm
+{
+ __u32 capability;
+ __u32 outputmode;
+ struct v4l2_fract timeperframe;
+ __u32 extendedmode;
+ __u32 writebuffers;
+ __u32 reserved[4];
+};
+
+struct v4l2_cropcap {
+ enum v4l2_buf_type type;
+ struct v4l2_rect bounds;
+ struct v4l2_rect defrect;
+ struct v4l2_fract pixelaspect;
+};
+
+struct v4l2_crop {
+ enum v4l2_buf_type type;
+ struct v4l2_rect c;
+};
+
+typedef __u64 v4l2_std_id;
+
+#define V4L2_STD_PAL_B ((v4l2_std_id)0x00000001)
+#define V4L2_STD_PAL_B1 ((v4l2_std_id)0x00000002)
+#define V4L2_STD_PAL_G ((v4l2_std_id)0x00000004)
+#define V4L2_STD_PAL_H ((v4l2_std_id)0x00000008)
+#define V4L2_STD_PAL_I ((v4l2_std_id)0x00000010)
+#define V4L2_STD_PAL_D ((v4l2_std_id)0x00000020)
+#define V4L2_STD_PAL_D1 ((v4l2_std_id)0x00000040)
+#define V4L2_STD_PAL_K ((v4l2_std_id)0x00000080)
+
+#define V4L2_STD_PAL_M ((v4l2_std_id)0x00000100)
+#define V4L2_STD_PAL_N ((v4l2_std_id)0x00000200)
+#define V4L2_STD_PAL_Nc ((v4l2_std_id)0x00000400)
+#define V4L2_STD_PAL_60 ((v4l2_std_id)0x00000800)
+
+#define V4L2_STD_NTSC_M ((v4l2_std_id)0x00001000)
+#define V4L2_STD_NTSC_M_JP ((v4l2_std_id)0x00002000)
+#define V4L2_STD_NTSC_443 ((v4l2_std_id)0x00004000)
+#define V4L2_STD_NTSC_M_KR ((v4l2_std_id)0x00008000)
+
+#define V4L2_STD_SECAM_B ((v4l2_std_id)0x00010000)
+#define V4L2_STD_SECAM_D ((v4l2_std_id)0x00020000)
+#define V4L2_STD_SECAM_G ((v4l2_std_id)0x00040000)
+#define V4L2_STD_SECAM_H ((v4l2_std_id)0x00080000)
+#define V4L2_STD_SECAM_K ((v4l2_std_id)0x00100000)
+#define V4L2_STD_SECAM_K1 ((v4l2_std_id)0x00200000)
+#define V4L2_STD_SECAM_L ((v4l2_std_id)0x00400000)
+#define V4L2_STD_SECAM_LC ((v4l2_std_id)0x00800000)
+
+#define V4L2_STD_ATSC_8_VSB ((v4l2_std_id)0x01000000)
+#define V4L2_STD_ATSC_16_VSB ((v4l2_std_id)0x02000000)
+
+#define V4L2_STD_MN (V4L2_STD_PAL_M|V4L2_STD_PAL_N|V4L2_STD_PAL_Nc|V4L2_STD_NTSC)
+#define V4L2_STD_B (V4L2_STD_PAL_B|V4L2_STD_PAL_B1|V4L2_STD_SECAM_B)
+#define V4L2_STD_GH (V4L2_STD_PAL_G|V4L2_STD_PAL_H|V4L2_STD_SECAM_G|V4L2_STD_SECAM_H)
+#define V4L2_STD_DK (V4L2_STD_PAL_DK|V4L2_STD_SECAM_DK)
+
+#define V4L2_STD_PAL_BG (V4L2_STD_PAL_B |  V4L2_STD_PAL_B1 |  V4L2_STD_PAL_G)
+#define V4L2_STD_PAL_DK (V4L2_STD_PAL_D |  V4L2_STD_PAL_D1 |  V4L2_STD_PAL_K)
+#define V4L2_STD_PAL (V4L2_STD_PAL_BG |  V4L2_STD_PAL_DK |  V4L2_STD_PAL_H |  V4L2_STD_PAL_I)
+#define V4L2_STD_NTSC (V4L2_STD_NTSC_M |  V4L2_STD_NTSC_M_JP |  V4L2_STD_NTSC_M_KR)
+#define V4L2_STD_SECAM_DK (V4L2_STD_SECAM_D |  V4L2_STD_SECAM_K |  V4L2_STD_SECAM_K1)
+#define V4L2_STD_SECAM (V4L2_STD_SECAM_B |  V4L2_STD_SECAM_G |  V4L2_STD_SECAM_H |  V4L2_STD_SECAM_DK |  V4L2_STD_SECAM_L |  V4L2_STD_SECAM_LC)
+
+#define V4L2_STD_525_60 (V4L2_STD_PAL_M |  V4L2_STD_PAL_60 |  V4L2_STD_NTSC |  V4L2_STD_NTSC_443)
+#define V4L2_STD_625_50 (V4L2_STD_PAL |  V4L2_STD_PAL_N |  V4L2_STD_PAL_Nc |  V4L2_STD_SECAM)
+#define V4L2_STD_ATSC (V4L2_STD_ATSC_8_VSB |  V4L2_STD_ATSC_16_VSB)
+
+#define V4L2_STD_UNKNOWN 0
+#define V4L2_STD_ALL (V4L2_STD_525_60 |  V4L2_STD_625_50)
+
+struct v4l2_standard
+{
+ __u32 index;
+ v4l2_std_id id;
+ __u8 name[24];
+ struct v4l2_fract frameperiod;
+ __u32 framelines;
+ __u32 reserved[4];
+};
+
+struct v4l2_input
+{
+ __u32 index;
+ __u8 name[32];
+ __u32 type;
+ __u32 audioset;
+ __u32 tuner;
+ v4l2_std_id std;
+ __u32 status;
+ __u32 reserved[4];
+};
+
+#define V4L2_INPUT_TYPE_TUNER 1
+#define V4L2_INPUT_TYPE_CAMERA 2
+
+#define V4L2_IN_ST_NO_POWER 0x00000001  
+#define V4L2_IN_ST_NO_SIGNAL 0x00000002
+#define V4L2_IN_ST_NO_COLOR 0x00000004
+
+#define V4L2_IN_ST_NO_H_LOCK 0x00000100  
+#define V4L2_IN_ST_COLOR_KILL 0x00000200  
+
+#define V4L2_IN_ST_NO_SYNC 0x00010000  
+#define V4L2_IN_ST_NO_EQU 0x00020000  
+#define V4L2_IN_ST_NO_CARRIER 0x00040000  
+
+#define V4L2_IN_ST_MACROVISION 0x01000000  
+#define V4L2_IN_ST_NO_ACCESS 0x02000000  
+#define V4L2_IN_ST_VTR 0x04000000  
+
+struct v4l2_output
+{
+ __u32 index;
+ __u8 name[32];
+ __u32 type;
+ __u32 audioset;
+ __u32 modulator;
+ v4l2_std_id std;
+ __u32 reserved[4];
+};
+
+#define V4L2_OUTPUT_TYPE_MODULATOR 1
+#define V4L2_OUTPUT_TYPE_ANALOG 2
+#define V4L2_OUTPUT_TYPE_ANALOGVGAOVERLAY 3
+
+struct v4l2_control
+{
+ __u32 id;
+ __s32 value;
+};
+
+struct v4l2_ext_control
+{
+ __u32 id;
+ __u32 reserved2[2];
+ union {
+ __s32 value;
+ __s64 value64;
+ void *reserved;
+ };
+} __attribute__ ((packed));
+
+struct v4l2_ext_controls
+{
+ __u32 ctrl_class;
+ __u32 count;
+ __u32 error_idx;
+ __u32 reserved[2];
+ struct v4l2_ext_control *controls;
+};
+
+#define V4L2_CTRL_CLASS_USER 0x00980000  
+#define V4L2_CTRL_CLASS_MPEG 0x00990000  
+
+#define V4L2_CTRL_ID_MASK (0x0fffffff)
+#define V4L2_CTRL_ID2CLASS(id) ((id) & 0x0fff0000UL)
+#define V4L2_CTRL_DRIVER_PRIV(id) (((id) & 0xffff) >= 0x1000)
+
+struct v4l2_queryctrl
+{
+ __u32 id;
+ enum v4l2_ctrl_type type;
+ __u8 name[32];
+ __s32 minimum;
+ __s32 maximum;
+ __s32 step;
+ __s32 default_value;
+ __u32 flags;
+ __u32 reserved[2];
+};
+
+struct v4l2_querymenu
+{
+ __u32 id;
+ __u32 index;
+ __u8 name[32];
+ __u32 reserved;
+};
+
+#define V4L2_CTRL_FLAG_DISABLED 0x0001
+#define V4L2_CTRL_FLAG_GRABBED 0x0002
+#define V4L2_CTRL_FLAG_READ_ONLY 0x0004
+#define V4L2_CTRL_FLAG_UPDATE 0x0008
+#define V4L2_CTRL_FLAG_INACTIVE 0x0010
+#define V4L2_CTRL_FLAG_SLIDER 0x0020
+
+#define V4L2_CTRL_FLAG_NEXT_CTRL 0x80000000
+
+#define V4L2_CID_BASE (V4L2_CTRL_CLASS_USER | 0x900)
+#define V4L2_CID_USER_BASE V4L2_CID_BASE
+
+#define V4L2_CID_PRIVATE_BASE 0x08000000
+
+#define V4L2_CID_USER_CLASS (V4L2_CTRL_CLASS_USER | 1)
+#define V4L2_CID_BRIGHTNESS (V4L2_CID_BASE+0)
+#define V4L2_CID_CONTRAST (V4L2_CID_BASE+1)
+#define V4L2_CID_SATURATION (V4L2_CID_BASE+2)
+#define V4L2_CID_HUE (V4L2_CID_BASE+3)
+#define V4L2_CID_AUDIO_VOLUME (V4L2_CID_BASE+5)
+#define V4L2_CID_AUDIO_BALANCE (V4L2_CID_BASE+6)
+#define V4L2_CID_AUDIO_BASS (V4L2_CID_BASE+7)
+#define V4L2_CID_AUDIO_TREBLE (V4L2_CID_BASE+8)
+#define V4L2_CID_AUDIO_MUTE (V4L2_CID_BASE+9)
+#define V4L2_CID_AUDIO_LOUDNESS (V4L2_CID_BASE+10)
+#define V4L2_CID_BLACK_LEVEL (V4L2_CID_BASE+11)
+#define V4L2_CID_AUTO_WHITE_BALANCE (V4L2_CID_BASE+12)
+#define V4L2_CID_DO_WHITE_BALANCE (V4L2_CID_BASE+13)
+#define V4L2_CID_RED_BALANCE (V4L2_CID_BASE+14)
+#define V4L2_CID_BLUE_BALANCE (V4L2_CID_BASE+15)
+#define V4L2_CID_GAMMA (V4L2_CID_BASE+16)
+#define V4L2_CID_WHITENESS (V4L2_CID_GAMMA)  
+#define V4L2_CID_EXPOSURE (V4L2_CID_BASE+17)
+#define V4L2_CID_AUTOGAIN (V4L2_CID_BASE+18)
+#define V4L2_CID_GAIN (V4L2_CID_BASE+19)
+#define V4L2_CID_HFLIP (V4L2_CID_BASE+20)
+#define V4L2_CID_VFLIP (V4L2_CID_BASE+21)
+#define V4L2_CID_HCENTER (V4L2_CID_BASE+22)
+#define V4L2_CID_VCENTER (V4L2_CID_BASE+23)
+#define V4L2_CID_LASTP1 (V4L2_CID_BASE+24)  
+
+#define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900)
+#define V4L2_CID_MPEG_CLASS (V4L2_CTRL_CLASS_MPEG | 1)
+
+#define V4L2_CID_MPEG_STREAM_TYPE (V4L2_CID_MPEG_BASE+0)
+enum v4l2_mpeg_stream_type {
+ V4L2_MPEG_STREAM_TYPE_MPEG2_PS = 0,
+ V4L2_MPEG_STREAM_TYPE_MPEG2_TS = 1,
+ V4L2_MPEG_STREAM_TYPE_MPEG1_SS = 2,
+ V4L2_MPEG_STREAM_TYPE_MPEG2_DVD = 3,
+ V4L2_MPEG_STREAM_TYPE_MPEG1_VCD = 4,
+ V4L2_MPEG_STREAM_TYPE_MPEG2_SVCD = 5,
+};
+#define V4L2_CID_MPEG_STREAM_PID_PMT (V4L2_CID_MPEG_BASE+1)
+#define V4L2_CID_MPEG_STREAM_PID_AUDIO (V4L2_CID_MPEG_BASE+2)
+#define V4L2_CID_MPEG_STREAM_PID_VIDEO (V4L2_CID_MPEG_BASE+3)
+#define V4L2_CID_MPEG_STREAM_PID_PCR (V4L2_CID_MPEG_BASE+4)
+#define V4L2_CID_MPEG_STREAM_PES_ID_AUDIO (V4L2_CID_MPEG_BASE+5)
+#define V4L2_CID_MPEG_STREAM_PES_ID_VIDEO (V4L2_CID_MPEG_BASE+6)
+#define V4L2_CID_MPEG_STREAM_VBI_FMT (V4L2_CID_MPEG_BASE+7)
+enum v4l2_mpeg_stream_vbi_fmt {
+ V4L2_MPEG_STREAM_VBI_FMT_NONE = 0,
+ V4L2_MPEG_STREAM_VBI_FMT_IVTV = 1,
+};
+
+#define V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ (V4L2_CID_MPEG_BASE+100)
+enum v4l2_mpeg_audio_sampling_freq {
+ V4L2_MPEG_AUDIO_SAMPLING_FREQ_44100 = 0,
+ V4L2_MPEG_AUDIO_SAMPLING_FREQ_48000 = 1,
+ V4L2_MPEG_AUDIO_SAMPLING_FREQ_32000 = 2,
+};
+#define V4L2_CID_MPEG_AUDIO_ENCODING (V4L2_CID_MPEG_BASE+101)
+enum v4l2_mpeg_audio_encoding {
+ V4L2_MPEG_AUDIO_ENCODING_LAYER_1 = 0,
+ V4L2_MPEG_AUDIO_ENCODING_LAYER_2 = 1,
+ V4L2_MPEG_AUDIO_ENCODING_LAYER_3 = 2,
+};
+#define V4L2_CID_MPEG_AUDIO_L1_BITRATE (V4L2_CID_MPEG_BASE+102)
+enum v4l2_mpeg_audio_l1_bitrate {
+ V4L2_MPEG_AUDIO_L1_BITRATE_32K = 0,
+ V4L2_MPEG_AUDIO_L1_BITRATE_64K = 1,
+ V4L2_MPEG_AUDIO_L1_BITRATE_96K = 2,
+ V4L2_MPEG_AUDIO_L1_BITRATE_128K = 3,
+ V4L2_MPEG_AUDIO_L1_BITRATE_160K = 4,
+ V4L2_MPEG_AUDIO_L1_BITRATE_192K = 5,
+ V4L2_MPEG_AUDIO_L1_BITRATE_224K = 6,
+ V4L2_MPEG_AUDIO_L1_BITRATE_256K = 7,
+ V4L2_MPEG_AUDIO_L1_BITRATE_288K = 8,
+ V4L2_MPEG_AUDIO_L1_BITRATE_320K = 9,
+ V4L2_MPEG_AUDIO_L1_BITRATE_352K = 10,
+ V4L2_MPEG_AUDIO_L1_BITRATE_384K = 11,
+ V4L2_MPEG_AUDIO_L1_BITRATE_416K = 12,
+ V4L2_MPEG_AUDIO_L1_BITRATE_448K = 13,
+};
+#define V4L2_CID_MPEG_AUDIO_L2_BITRATE (V4L2_CID_MPEG_BASE+103)
+enum v4l2_mpeg_audio_l2_bitrate {
+ V4L2_MPEG_AUDIO_L2_BITRATE_32K = 0,
+ V4L2_MPEG_AUDIO_L2_BITRATE_48K = 1,
+ V4L2_MPEG_AUDIO_L2_BITRATE_56K = 2,
+ V4L2_MPEG_AUDIO_L2_BITRATE_64K = 3,
+ V4L2_MPEG_AUDIO_L2_BITRATE_80K = 4,
+ V4L2_MPEG_AUDIO_L2_BITRATE_96K = 5,
+ V4L2_MPEG_AUDIO_L2_BITRATE_112K = 6,
+ V4L2_MPEG_AUDIO_L2_BITRATE_128K = 7,
+ V4L2_MPEG_AUDIO_L2_BITRATE_160K = 8,
+ V4L2_MPEG_AUDIO_L2_BITRATE_192K = 9,
+ V4L2_MPEG_AUDIO_L2_BITRATE_224K = 10,
+ V4L2_MPEG_AUDIO_L2_BITRATE_256K = 11,
+ V4L2_MPEG_AUDIO_L2_BITRATE_320K = 12,
+ V4L2_MPEG_AUDIO_L2_BITRATE_384K = 13,
+};
+#define V4L2_CID_MPEG_AUDIO_L3_BITRATE (V4L2_CID_MPEG_BASE+104)
+enum v4l2_mpeg_audio_l3_bitrate {
+ V4L2_MPEG_AUDIO_L3_BITRATE_32K = 0,
+ V4L2_MPEG_AUDIO_L3_BITRATE_40K = 1,
+ V4L2_MPEG_AUDIO_L3_BITRATE_48K = 2,
+ V4L2_MPEG_AUDIO_L3_BITRATE_56K = 3,
+ V4L2_MPEG_AUDIO_L3_BITRATE_64K = 4,
+ V4L2_MPEG_AUDIO_L3_BITRATE_80K = 5,
+ V4L2_MPEG_AUDIO_L3_BITRATE_96K = 6,
+ V4L2_MPEG_AUDIO_L3_BITRATE_112K = 7,
+ V4L2_MPEG_AUDIO_L3_BITRATE_128K = 8,
+ V4L2_MPEG_AUDIO_L3_BITRATE_160K = 9,
+ V4L2_MPEG_AUDIO_L3_BITRATE_192K = 10,
+ V4L2_MPEG_AUDIO_L3_BITRATE_224K = 11,
+ V4L2_MPEG_AUDIO_L3_BITRATE_256K = 12,
+ V4L2_MPEG_AUDIO_L3_BITRATE_320K = 13,
+};
+#define V4L2_CID_MPEG_AUDIO_MODE (V4L2_CID_MPEG_BASE+105)
+enum v4l2_mpeg_audio_mode {
+ V4L2_MPEG_AUDIO_MODE_STEREO = 0,
+ V4L2_MPEG_AUDIO_MODE_JOINT_STEREO = 1,
+ V4L2_MPEG_AUDIO_MODE_DUAL = 2,
+ V4L2_MPEG_AUDIO_MODE_MONO = 3,
+};
+#define V4L2_CID_MPEG_AUDIO_MODE_EXTENSION (V4L2_CID_MPEG_BASE+106)
+enum v4l2_mpeg_audio_mode_extension {
+ V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_4 = 0,
+ V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_8 = 1,
+ V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_12 = 2,
+ V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_16 = 3,
+};
+#define V4L2_CID_MPEG_AUDIO_EMPHASIS (V4L2_CID_MPEG_BASE+107)
+enum v4l2_mpeg_audio_emphasis {
+ V4L2_MPEG_AUDIO_EMPHASIS_NONE = 0,
+ V4L2_MPEG_AUDIO_EMPHASIS_50_DIV_15_uS = 1,
+ V4L2_MPEG_AUDIO_EMPHASIS_CCITT_J17 = 2,
+};
+#define V4L2_CID_MPEG_AUDIO_CRC (V4L2_CID_MPEG_BASE+108)
+enum v4l2_mpeg_audio_crc {
+ V4L2_MPEG_AUDIO_CRC_NONE = 0,
+ V4L2_MPEG_AUDIO_CRC_CRC16 = 1,
+};
+
+#define V4L2_CID_MPEG_VIDEO_ENCODING (V4L2_CID_MPEG_BASE+200)
+enum v4l2_mpeg_video_encoding {
+ V4L2_MPEG_VIDEO_ENCODING_MPEG_1 = 0,
+ V4L2_MPEG_VIDEO_ENCODING_MPEG_2 = 1,
+};
+#define V4L2_CID_MPEG_VIDEO_ASPECT (V4L2_CID_MPEG_BASE+201)
+enum v4l2_mpeg_video_aspect {
+ V4L2_MPEG_VIDEO_ASPECT_1x1 = 0,
+ V4L2_MPEG_VIDEO_ASPECT_4x3 = 1,
+ V4L2_MPEG_VIDEO_ASPECT_16x9 = 2,
+ V4L2_MPEG_VIDEO_ASPECT_221x100 = 3,
+};
+#define V4L2_CID_MPEG_VIDEO_B_FRAMES (V4L2_CID_MPEG_BASE+202)
+#define V4L2_CID_MPEG_VIDEO_GOP_SIZE (V4L2_CID_MPEG_BASE+203)
+#define V4L2_CID_MPEG_VIDEO_GOP_CLOSURE (V4L2_CID_MPEG_BASE+204)
+#define V4L2_CID_MPEG_VIDEO_PULLDOWN (V4L2_CID_MPEG_BASE+205)
+#define V4L2_CID_MPEG_VIDEO_BITRATE_MODE (V4L2_CID_MPEG_BASE+206)
+enum v4l2_mpeg_video_bitrate_mode {
+ V4L2_MPEG_VIDEO_BITRATE_MODE_VBR = 0,
+ V4L2_MPEG_VIDEO_BITRATE_MODE_CBR = 1,
+};
+#define V4L2_CID_MPEG_VIDEO_BITRATE (V4L2_CID_MPEG_BASE+207)
+#define V4L2_CID_MPEG_VIDEO_BITRATE_PEAK (V4L2_CID_MPEG_BASE+208)
+#define V4L2_CID_MPEG_VIDEO_TEMPORAL_DECIMATION (V4L2_CID_MPEG_BASE+209)
+
+#define V4L2_CID_MPEG_CX2341X_BASE (V4L2_CTRL_CLASS_MPEG | 0x1000)
+#define V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE (V4L2_CID_MPEG_CX2341X_BASE+0)
+enum v4l2_mpeg_cx2341x_video_spatial_filter_mode {
+ V4L2_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE_MANUAL = 0,
+ V4L2_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE_AUTO = 1,
+};
+#define V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER (V4L2_CID_MPEG_CX2341X_BASE+1)
+#define V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE (V4L2_CID_MPEG_CX2341X_BASE+2)
+enum v4l2_mpeg_cx2341x_video_luma_spatial_filter_type {
+ V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_OFF = 0,
+ V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_1D_HOR = 1,
+ V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_1D_VERT = 2,
+ V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_2D_HV_SEPARABLE = 3,
+ V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_2D_SYM_NON_SEPARABLE = 4,
+};
+#define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE (V4L2_CID_MPEG_CX2341X_BASE+3)
+enum v4l2_mpeg_cx2341x_video_chroma_spatial_filter_type {
+ V4L2_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE_OFF = 0,
+ V4L2_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE_1D_HOR = 1,
+};
+#define V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE (V4L2_CID_MPEG_CX2341X_BASE+4)
+enum v4l2_mpeg_cx2341x_video_temporal_filter_mode {
+ V4L2_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE_MANUAL = 0,
+ V4L2_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE_AUTO = 1,
+};
+#define V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER (V4L2_CID_MPEG_CX2341X_BASE+5)
+#define V4L2_CID_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE (V4L2_CID_MPEG_CX2341X_BASE+6)
+enum v4l2_mpeg_cx2341x_video_median_filter_type {
+ V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_OFF = 0,
+ V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_HOR = 1,
+ V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_VERT = 2,
+ V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_HOR_VERT = 3,
+ V4L2_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE_DIAG = 4,
+};
+#define V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_MEDIAN_FILTER_BOTTOM (V4L2_CID_MPEG_CX2341X_BASE+7)
+#define V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_MEDIAN_FILTER_TOP (V4L2_CID_MPEG_CX2341X_BASE+8)
+#define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_BOTTOM (V4L2_CID_MPEG_CX2341X_BASE+9)
+#define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_TOP (V4L2_CID_MPEG_CX2341X_BASE+10)
+
+struct v4l2_tuner
+{
+ __u32 index;
+ __u8 name[32];
+ enum v4l2_tuner_type type;
+ __u32 capability;
+ __u32 rangelow;
+ __u32 rangehigh;
+ __u32 rxsubchans;
+ __u32 audmode;
+ __s32 signal;
+ __s32 afc;
+ __u32 reserved[4];
+};
+
+struct v4l2_modulator
+{
+ __u32 index;
+ __u8 name[32];
+ __u32 capability;
+ __u32 rangelow;
+ __u32 rangehigh;
+ __u32 txsubchans;
+ __u32 reserved[4];
+};
+
+#define V4L2_TUNER_CAP_LOW 0x0001
+#define V4L2_TUNER_CAP_NORM 0x0002
+#define V4L2_TUNER_CAP_STEREO 0x0010
+#define V4L2_TUNER_CAP_LANG2 0x0020
+#define V4L2_TUNER_CAP_SAP 0x0020
+#define V4L2_TUNER_CAP_LANG1 0x0040
+
+#define V4L2_TUNER_SUB_MONO 0x0001
+#define V4L2_TUNER_SUB_STEREO 0x0002
+#define V4L2_TUNER_SUB_LANG2 0x0004
+#define V4L2_TUNER_SUB_SAP 0x0004
+#define V4L2_TUNER_SUB_LANG1 0x0008
+
+#define V4L2_TUNER_MODE_MONO 0x0000
+#define V4L2_TUNER_MODE_STEREO 0x0001
+#define V4L2_TUNER_MODE_LANG2 0x0002
+#define V4L2_TUNER_MODE_SAP 0x0002
+#define V4L2_TUNER_MODE_LANG1 0x0003
+#define V4L2_TUNER_MODE_LANG1_LANG2 0x0004
+
+struct v4l2_frequency
+{
+ __u32 tuner;
+ enum v4l2_tuner_type type;
+ __u32 frequency;
+ __u32 reserved[8];
+};
+
+struct v4l2_audio
+{
+ __u32 index;
+ __u8 name[32];
+ __u32 capability;
+ __u32 mode;
+ __u32 reserved[2];
+};
+
+#define V4L2_AUDCAP_STEREO 0x00001
+#define V4L2_AUDCAP_AVL 0x00002
+
+#define V4L2_AUDMODE_AVL 0x00001
+
+struct v4l2_audioout
+{
+ __u32 index;
+ __u8 name[32];
+ __u32 capability;
+ __u32 mode;
+ __u32 reserved[2];
+};
+
+struct v4l2_vbi_format
+{
+ __u32 sampling_rate;
+ __u32 offset;
+ __u32 samples_per_line;
+ __u32 sample_format;
+ __s32 start[2];
+ __u32 count[2];
+ __u32 flags;
+ __u32 reserved[2];
+};
+
+#define V4L2_VBI_UNSYNC (1<< 0)
+#define V4L2_VBI_INTERLACED (1<< 1)
+
+struct v4l2_sliced_vbi_format
+{
+ __u16 service_set;
+
+ __u16 service_lines[2][24];
+ __u32 io_size;
+ __u32 reserved[2];
+};
+
+#define V4L2_SLICED_TELETEXT_B (0x0001)
+
+#define V4L2_SLICED_VPS (0x0400)
+
+#define V4L2_SLICED_CAPTION_525 (0x1000)
+
+#define V4L2_SLICED_WSS_625 (0x4000)
+
+#define V4L2_SLICED_VBI_525 (V4L2_SLICED_CAPTION_525)
+#define V4L2_SLICED_VBI_625 (V4L2_SLICED_TELETEXT_B | V4L2_SLICED_VPS | V4L2_SLICED_WSS_625)
+
+struct v4l2_sliced_vbi_cap
+{
+ __u16 service_set;
+
+ __u16 service_lines[2][24];
+ __u32 reserved[4];
+};
+
+struct v4l2_sliced_vbi_data
+{
+ __u32 id;
+ __u32 field;
+ __u32 line;
+ __u32 reserved;
+ __u8 data[48];
+};
+
+struct v4l2_format
+{
+ enum v4l2_buf_type type;
+ union
+ {
+ struct v4l2_pix_format pix;
+ struct v4l2_window win;
+ struct v4l2_vbi_format vbi;
+ struct v4l2_sliced_vbi_format sliced;
+ __u8 raw_data[200];
+ } fmt;
+};
+
+struct v4l2_streamparm
+{
+ enum v4l2_buf_type type;
+ union
+ {
+ struct v4l2_captureparm capture;
+ struct v4l2_outputparm output;
+ __u8 raw_data[200];
+ } parm;
+};
+
+#define VIDIOC_QUERYCAP _IOR ('V', 0, struct v4l2_capability)
+#define VIDIOC_RESERVED _IO ('V', 1)
+#define VIDIOC_ENUM_FMT _IOWR ('V', 2, struct v4l2_fmtdesc)
+#define VIDIOC_G_FMT _IOWR ('V', 4, struct v4l2_format)
+#define VIDIOC_S_FMT _IOWR ('V', 5, struct v4l2_format)
+#define VIDIOC_REQBUFS _IOWR ('V', 8, struct v4l2_requestbuffers)
+#define VIDIOC_QUERYBUF _IOWR ('V', 9, struct v4l2_buffer)
+#define VIDIOC_G_FBUF _IOR ('V', 10, struct v4l2_framebuffer)
+#define VIDIOC_S_FBUF _IOW ('V', 11, struct v4l2_framebuffer)
+#define VIDIOC_OVERLAY _IOW ('V', 14, int)
+#define VIDIOC_QBUF _IOWR ('V', 15, struct v4l2_buffer)
+#define VIDIOC_DQBUF _IOWR ('V', 17, struct v4l2_buffer)
+#define VIDIOC_STREAMON _IOW ('V', 18, int)
+#define VIDIOC_STREAMOFF _IOW ('V', 19, int)
+#define VIDIOC_G_PARM _IOWR ('V', 21, struct v4l2_streamparm)
+#define VIDIOC_S_PARM _IOWR ('V', 22, struct v4l2_streamparm)
+#define VIDIOC_G_STD _IOR ('V', 23, v4l2_std_id)
+#define VIDIOC_S_STD _IOW ('V', 24, v4l2_std_id)
+#define VIDIOC_ENUMSTD _IOWR ('V', 25, struct v4l2_standard)
+#define VIDIOC_ENUMINPUT _IOWR ('V', 26, struct v4l2_input)
+#define VIDIOC_G_CTRL _IOWR ('V', 27, struct v4l2_control)
+#define VIDIOC_S_CTRL _IOWR ('V', 28, struct v4l2_control)
+#define VIDIOC_G_TUNER _IOWR ('V', 29, struct v4l2_tuner)
+#define VIDIOC_S_TUNER _IOW ('V', 30, struct v4l2_tuner)
+#define VIDIOC_G_AUDIO _IOR ('V', 33, struct v4l2_audio)
+#define VIDIOC_S_AUDIO _IOW ('V', 34, struct v4l2_audio)
+#define VIDIOC_QUERYCTRL _IOWR ('V', 36, struct v4l2_queryctrl)
+#define VIDIOC_QUERYMENU _IOWR ('V', 37, struct v4l2_querymenu)
+#define VIDIOC_G_INPUT _IOR ('V', 38, int)
+#define VIDIOC_S_INPUT _IOWR ('V', 39, int)
+#define VIDIOC_G_OUTPUT _IOR ('V', 46, int)
+#define VIDIOC_S_OUTPUT _IOWR ('V', 47, int)
+#define VIDIOC_ENUMOUTPUT _IOWR ('V', 48, struct v4l2_output)
+#define VIDIOC_G_AUDOUT _IOR ('V', 49, struct v4l2_audioout)
+#define VIDIOC_S_AUDOUT _IOW ('V', 50, struct v4l2_audioout)
+#define VIDIOC_G_MODULATOR _IOWR ('V', 54, struct v4l2_modulator)
+#define VIDIOC_S_MODULATOR _IOW ('V', 55, struct v4l2_modulator)
+#define VIDIOC_G_FREQUENCY _IOWR ('V', 56, struct v4l2_frequency)
+#define VIDIOC_S_FREQUENCY _IOW ('V', 57, struct v4l2_frequency)
+#define VIDIOC_CROPCAP _IOWR ('V', 58, struct v4l2_cropcap)
+#define VIDIOC_G_CROP _IOWR ('V', 59, struct v4l2_crop)
+#define VIDIOC_S_CROP _IOW ('V', 60, struct v4l2_crop)
+#define VIDIOC_G_JPEGCOMP _IOR ('V', 61, struct v4l2_jpegcompression)
+#define VIDIOC_S_JPEGCOMP _IOW ('V', 62, struct v4l2_jpegcompression)
+#define VIDIOC_QUERYSTD _IOR ('V', 63, v4l2_std_id)
+#define VIDIOC_TRY_FMT _IOWR ('V', 64, struct v4l2_format)
+#define VIDIOC_ENUMAUDIO _IOWR ('V', 65, struct v4l2_audio)
+#define VIDIOC_ENUMAUDOUT _IOWR ('V', 66, struct v4l2_audioout)
+#define VIDIOC_G_PRIORITY _IOR ('V', 67, enum v4l2_priority)
+#define VIDIOC_S_PRIORITY _IOW ('V', 68, enum v4l2_priority)
+#define VIDIOC_G_SLICED_VBI_CAP _IOR ('V', 69, struct v4l2_sliced_vbi_cap)
+#define VIDIOC_LOG_STATUS _IO ('V', 70)
+#define VIDIOC_G_EXT_CTRLS _IOWR ('V', 71, struct v4l2_ext_controls)
+#define VIDIOC_S_EXT_CTRLS _IOWR ('V', 72, struct v4l2_ext_controls)
+#define VIDIOC_TRY_EXT_CTRLS _IOWR ('V', 73, struct v4l2_ext_controls)
+
+#ifdef __OLD_VIDIOC_
+
+#define VIDIOC_OVERLAY_OLD _IOWR ('V', 14, int)
+#define VIDIOC_S_PARM_OLD _IOW ('V', 22, struct v4l2_streamparm)
+#define VIDIOC_S_CTRL_OLD _IOW ('V', 28, struct v4l2_control)
+#define VIDIOC_G_AUDIO_OLD _IOWR ('V', 33, struct v4l2_audio)
+#define VIDIOC_G_AUDOUT_OLD _IOWR ('V', 49, struct v4l2_audioout)
+#define VIDIOC_CROPCAP_OLD _IOR ('V', 58, struct v4l2_cropcap)
+#endif
+
+#define BASE_VIDIOC_PRIVATE 192  
+
+#endif
+
diff --git a/ndk/platforms/android-3/include/linux/vmalloc.h b/ndk/platforms/android-3/include/linux/vmalloc.h
new file mode 100644
index 0000000..c7fd103
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/vmalloc.h
@@ -0,0 +1,40 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_VMALLOC_H
+#define _LINUX_VMALLOC_H
+
+#include <linux/spinlock.h>
+#include <asm/page.h>  
+
+struct vm_area_struct;
+
+#define VM_IOREMAP 0x00000001  
+#define VM_ALLOC 0x00000002  
+#define VM_MAP 0x00000004  
+#define VM_USERMAP 0x00000008  
+#define VM_VPAGES 0x00000010  
+
+#ifndef IOREMAP_MAX_ORDER
+#define IOREMAP_MAX_ORDER (7 + PAGE_SHIFT)  
+#endif
+
+struct vm_struct {
+ void *addr;
+ unsigned long size;
+ unsigned long flags;
+ struct page **pages;
+ unsigned int nr_pages;
+ unsigned long phys_addr;
+ struct vm_struct *next;
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/vt.h b/ndk/platforms/android-3/include/linux/vt.h
new file mode 100644
index 0000000..9992b3a
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/vt.h
@@ -0,0 +1,68 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_VT_H
+#define _LINUX_VT_H
+
+#define MIN_NR_CONSOLES 1  
+#define MAX_NR_CONSOLES 63  
+#define MAX_NR_USER_CONSOLES 63  
+
+#define VT_OPENQRY 0x5600  
+
+struct vt_mode {
+ char mode;
+ char waitv;
+ short relsig;
+ short acqsig;
+ short frsig;
+};
+#define VT_GETMODE 0x5601  
+#define VT_SETMODE 0x5602  
+#define VT_AUTO 0x00  
+#define VT_PROCESS 0x01  
+#define VT_ACKACQ 0x02  
+
+struct vt_stat {
+ unsigned short v_active;
+ unsigned short v_signal;
+ unsigned short v_state;
+};
+#define VT_GETSTATE 0x5603  
+#define VT_SENDSIG 0x5604  
+
+#define VT_RELDISP 0x5605  
+
+#define VT_ACTIVATE 0x5606  
+#define VT_WAITACTIVE 0x5607  
+#define VT_DISALLOCATE 0x5608  
+
+struct vt_sizes {
+ unsigned short v_rows;
+ unsigned short v_cols;
+ unsigned short v_scrollsize;
+};
+#define VT_RESIZE 0x5609  
+
+struct vt_consize {
+ unsigned short v_rows;
+ unsigned short v_cols;
+ unsigned short v_vlin;
+ unsigned short v_clin;
+ unsigned short v_vcol;
+ unsigned short v_ccol;
+};
+#define VT_RESIZEX 0x560A  
+#define VT_LOCKSWITCH 0x560B  
+#define VT_UNLOCKSWITCH 0x560C  
+#define VT_GETHIFONTMASK 0x560D  
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/vt_buffer.h b/ndk/platforms/android-3/include/linux/vt_buffer.h
new file mode 100644
index 0000000..46ce79d
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/vt_buffer.h
@@ -0,0 +1,30 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_VT_BUFFER_H_
+#define _LINUX_VT_BUFFER_H_
+
+#ifndef VT_BUF_HAVE_RW
+#define scr_writew(val, addr) (*(addr) = (val))
+#define scr_readw(addr) (*(addr))
+#define scr_memcpyw(d, s, c) memcpy(d, s, c)
+#define scr_memmovew(d, s, c) memmove(d, s, c)
+#define VT_BUF_HAVE_MEMCPYW
+#define VT_BUF_HAVE_MEMMOVEW
+#endif
+
+#ifndef VT_BUF_HAVE_MEMSETW
+#endif
+#ifndef VT_BUF_HAVE_MEMCPYW
+#endif
+#ifndef VT_BUF_HAVE_MEMMOVEW
+#endif
+#endif
diff --git a/ndk/platforms/android-3/include/linux/wait.h b/ndk/platforms/android-3/include/linux/wait.h
new file mode 100644
index 0000000..7d9aa68
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/wait.h
@@ -0,0 +1,30 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_WAIT_H
+#define _LINUX_WAIT_H
+
+#define WNOHANG 0x00000001
+#define WUNTRACED 0x00000002
+#define WSTOPPED WUNTRACED
+#define WEXITED 0x00000004
+#define WCONTINUED 0x00000008
+#define WNOWAIT 0x01000000  
+
+#define __WNOTHREAD 0x20000000  
+#define __WALL 0x40000000  
+#define __WCLONE 0x80000000  
+
+#define P_ALL 0
+#define P_PID 1
+#define P_PGID 2
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/wanrouter.h b/ndk/platforms/android-3/include/linux/wanrouter.h
new file mode 100644
index 0000000..8f25a86
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/wanrouter.h
@@ -0,0 +1,356 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ROUTER_H
+#define _ROUTER_H
+
+#define ROUTER_NAME "wanrouter"  
+#define ROUTER_VERSION 1  
+#define ROUTER_RELEASE 1  
+#define ROUTER_IOCTL 'W'  
+#define ROUTER_MAGIC 0x524D4157L  
+
+enum router_ioctls
+{
+ ROUTER_SETUP = ROUTER_IOCTL<<8,
+ ROUTER_DOWN,
+ ROUTER_STAT,
+ ROUTER_IFNEW,
+ ROUTER_IFDEL,
+ ROUTER_IFSTAT,
+ ROUTER_USER = (ROUTER_IOCTL<<8)+16,
+ ROUTER_USER_MAX = (ROUTER_IOCTL<<8)+31
+};
+
+#define PROC_DATA_PORT_0 0x8000  
+#define PROC_DATA_PORT_1 0x8001  
+
+#define NLPID_IP 0xCC  
+#define NLPID_SNAP 0x80  
+#define NLPID_CLNP 0x81  
+#define NLPID_ESIS 0x82  
+#define NLPID_ISIS 0x83  
+#define NLPID_Q933 0x08  
+
+#define WAN_IFNAME_SZ 15  
+#define WAN_DRVNAME_SZ 15  
+#define WAN_ADDRESS_SZ 31  
+#define USED_BY_FIELD 8  
+
+#define UDP_PTPIPE_TYPE 0x01
+#define UDP_FPIPE_TYPE 0x02
+#define UDP_CPIPE_TYPE 0x03
+#define UDP_DRVSTATS_TYPE 0x04
+#define UDP_INVALID_TYPE 0x05
+
+#define CMD_OK 0  
+#define CMD_TIMEOUT 0xFF  
+
+#define UDP_PKT_FRM_STACK 0x00
+#define UDP_PKT_FRM_NETWORK 0x01
+
+#define MAX_INTR_TEST_COUNTER 100
+
+#define CRITICAL_IN_ISR 0xA1
+#define CRITICAL_INTR_HANDLED 0xB1
+
+typedef struct wan_x25_conf
+{
+ unsigned lo_pvc;
+ unsigned hi_pvc;
+ unsigned lo_svc;
+ unsigned hi_svc;
+ unsigned hdlc_window;
+ unsigned pkt_window;
+ unsigned t1;
+ unsigned t2;
+ unsigned t4;
+ unsigned n2;
+ unsigned t10_t20;
+ unsigned t11_t21;
+ unsigned t12_t22;
+ unsigned t13_t23;
+ unsigned t16_t26;
+ unsigned t28;
+ unsigned r10_r20;
+ unsigned r12_r22;
+ unsigned r13_r23;
+ unsigned ccitt_compat;
+ unsigned x25_conf_opt;
+ unsigned char LAPB_hdlc_only;
+ unsigned char logging;
+ unsigned char oob_on_modem;
+} wan_x25_conf_t;
+
+typedef struct wan_fr_conf
+{
+ unsigned signalling;
+ unsigned t391;
+ unsigned t392;
+ unsigned n391;
+ unsigned n392;
+ unsigned n393;
+ unsigned dlci_num;
+ unsigned dlci[100];
+} wan_fr_conf_t;
+
+typedef struct wan_ppp_conf
+{
+ unsigned restart_tmr;
+ unsigned auth_rsrt_tmr;
+ unsigned auth_wait_tmr;
+ unsigned mdm_fail_tmr;
+ unsigned dtr_drop_tmr;
+ unsigned connect_tmout;
+ unsigned conf_retry;
+ unsigned term_retry;
+ unsigned fail_retry;
+ unsigned auth_retry;
+ unsigned auth_options;
+ unsigned ip_options;
+ char authenticator;
+ char ip_mode;
+} wan_ppp_conf_t;
+
+typedef struct wan_chdlc_conf
+{
+ unsigned char ignore_dcd;
+ unsigned char ignore_cts;
+ unsigned char ignore_keepalive;
+ unsigned char hdlc_streaming;
+ unsigned char receive_only;
+ unsigned keepalive_tx_tmr;
+ unsigned keepalive_rx_tmr;
+ unsigned keepalive_err_margin;
+ unsigned slarp_timer;
+} wan_chdlc_conf_t;
+
+typedef struct wandev_conf
+{
+ unsigned magic;
+ unsigned config_id;
+
+ unsigned ioport;
+ unsigned long maddr;
+ unsigned msize;
+ int irq;
+ int dma;
+ char S514_CPU_no[1];
+ unsigned PCI_slot_no;
+ char auto_pci_cfg;
+ char comm_port;
+ unsigned bps;
+ unsigned mtu;
+ unsigned udp_port;
+ unsigned char ttl;
+ unsigned char ft1;
+ char interface;
+ char clocking;
+ char line_coding;
+ char station;
+ char connection;
+ char read_mode;
+ char receive_only;
+ char tty;
+ unsigned tty_major;
+ unsigned tty_minor;
+ unsigned tty_mode;
+ char backup;
+ unsigned hw_opt[4];
+ unsigned reserved[4];
+
+ unsigned data_size;
+ void* data;
+ union
+ {
+ wan_x25_conf_t x25;
+ wan_ppp_conf_t ppp;
+ wan_fr_conf_t fr;
+ wan_chdlc_conf_t chdlc;
+ } u;
+} wandev_conf_t;
+
+#define WANCONFIG_X25 101  
+#define WANCONFIG_FR 102  
+#define WANCONFIG_PPP 103  
+#define WANCONFIG_CHDLC 104  
+#define WANCONFIG_BSC 105  
+#define WANCONFIG_HDLC 106  
+#define WANCONFIG_MPPP 107  
+
+#define WANOPT_OFF 0
+#define WANOPT_ON 1
+#define WANOPT_NO 0
+#define WANOPT_YES 1
+
+#define WANOPT_RS232 0
+#define WANOPT_V35 1
+
+#define WANOPT_NRZ 0
+#define WANOPT_NRZI 1
+#define WANOPT_FM0 2
+#define WANOPT_FM1 3
+
+#define WANOPT_POINTTOPOINT 0  
+#define WANOPT_MULTIDROP 1  
+
+#define WANOPT_EXTERNAL 0
+#define WANOPT_INTERNAL 1
+
+#define WANOPT_DTE 0
+#define WANOPT_DCE 1
+#define WANOPT_CPE 0
+#define WANOPT_NODE 1
+#define WANOPT_SECONDARY 0
+#define WANOPT_PRIMARY 1
+
+#define WANOPT_PERMANENT 0  
+#define WANOPT_SWITCHED 1  
+#define WANOPT_ONDEMAND 2  
+
+#define WANOPT_FR_ANSI 1  
+#define WANOPT_FR_Q933 2  
+#define WANOPT_FR_LMI 3  
+
+#define WANOPT_PPP_STATIC 0
+#define WANOPT_PPP_HOST 1
+#define WANOPT_PPP_PEER 2
+
+#define WANOPT_ONE 1
+#define WANOPT_TWO 2
+#define WANOPT_ONE_AND_HALF 3
+
+#define WANOPT_NONE 0
+#define WANOPT_ODD 1
+#define WANOPT_EVEN 2
+
+#define WANOPT_PRI 0
+#define WANOPT_SEC 1
+
+#define WANOPT_INTR 0
+#define WANOPT_POLL 1
+
+#define WANOPT_TTY_SYNC 0
+#define WANOPT_TTY_ASYNC 1
+
+typedef struct wandev_stat
+{
+ unsigned state;
+ unsigned ndev;
+
+ unsigned connection;
+ unsigned media_type;
+ unsigned mtu;
+
+ unsigned modem_status;
+ unsigned rx_frames;
+ unsigned rx_overruns;
+ unsigned rx_crc_err;
+ unsigned rx_aborts;
+ unsigned rx_bad_length;
+ unsigned rx_dropped;
+ unsigned tx_frames;
+ unsigned tx_underruns;
+ unsigned tx_timeouts;
+ unsigned tx_rejects;
+
+ unsigned rx_bad_format;
+ unsigned rx_bad_addr;
+ unsigned tx_retries;
+ unsigned reserved[16];
+} wandev_stat_t;
+
+enum wan_states
+{
+ WAN_UNCONFIGURED,
+ WAN_DISCONNECTED,
+ WAN_CONNECTING,
+ WAN_CONNECTED,
+ WAN_LIMIT,
+ WAN_DUALPORT,
+ WAN_DISCONNECTING,
+ WAN_FT1_READY
+};
+
+enum {
+ WAN_LOCAL_IP,
+ WAN_POINTOPOINT_IP,
+ WAN_NETMASK_IP,
+ WAN_BROADCAST_IP
+};
+
+#define WAN_MODEM_CTS 0x0001  
+#define WAN_MODEM_DCD 0x0002  
+#define WAN_MODEM_DTR 0x0010  
+#define WAN_MODEM_RTS 0x0020  
+
+typedef struct wanif_conf
+{
+ unsigned magic;
+ unsigned config_id;
+ char name[WAN_IFNAME_SZ+1];
+ char addr[WAN_ADDRESS_SZ+1];
+ char usedby[USED_BY_FIELD];
+ unsigned idle_timeout;
+ unsigned hold_timeout;
+ unsigned cir;
+ unsigned bc;
+ unsigned be;
+ unsigned char enable_IPX;
+ unsigned char inarp;
+ unsigned inarp_interval;
+ unsigned long network_number;
+ char mc;
+ char local_addr[WAN_ADDRESS_SZ+1];
+ unsigned char port;
+ unsigned char protocol;
+ char pap;
+ char chap;
+ unsigned char userid[511];
+ unsigned char passwd[511];
+ unsigned char sysname[31];
+ unsigned char ignore_dcd;
+ unsigned char ignore_cts;
+ unsigned char ignore_keepalive;
+ unsigned char hdlc_streaming;
+ unsigned keepalive_tx_tmr;
+ unsigned keepalive_rx_tmr;
+ unsigned keepalive_err_margin;
+ unsigned slarp_timer;
+ unsigned char ttl;
+ char interface;
+ char clocking;
+ unsigned bps;
+ unsigned mtu;
+ unsigned char if_down;
+ unsigned char gateway;
+ unsigned char true_if_encoding;
+
+ unsigned char asy_data_trans;
+ unsigned char rts_hs_for_receive;
+ unsigned char xon_xoff_hs_for_receive;
+ unsigned char xon_xoff_hs_for_transmit;
+ unsigned char dcd_hs_for_transmit;
+ unsigned char cts_hs_for_transmit;
+ unsigned char async_mode;
+ unsigned tx_bits_per_char;
+ unsigned rx_bits_per_char;
+ unsigned stop_bits;
+ unsigned char parity;
+ unsigned break_timer;
+ unsigned inter_char_timer;
+ unsigned rx_complete_length;
+ unsigned xon_char;
+ unsigned xoff_char;
+ unsigned char receive_only;
+} wanif_conf_t;
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/wireless.h b/ndk/platforms/android-3/include/linux/wireless.h
new file mode 100644
index 0000000..81ceb75
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/wireless.h
@@ -0,0 +1,542 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_WIRELESS_H
+#define _LINUX_WIRELESS_H
+
+#include <linux/types.h>  
+#include <linux/socket.h>  
+#include <linux/if.h>  
+
+#define WIRELESS_EXT 20
+
+#define SIOCSIWCOMMIT 0x8B00  
+#define SIOCGIWNAME 0x8B01  
+
+#define SIOCSIWNWID 0x8B02  
+#define SIOCGIWNWID 0x8B03  
+#define SIOCSIWFREQ 0x8B04  
+#define SIOCGIWFREQ 0x8B05  
+#define SIOCSIWMODE 0x8B06  
+#define SIOCGIWMODE 0x8B07  
+#define SIOCSIWSENS 0x8B08  
+#define SIOCGIWSENS 0x8B09  
+
+#define SIOCSIWRANGE 0x8B0A  
+#define SIOCGIWRANGE 0x8B0B  
+#define SIOCSIWPRIV 0x8B0C  
+#define SIOCGIWPRIV 0x8B0D  
+#define SIOCSIWSTATS 0x8B0E  
+#define SIOCGIWSTATS 0x8B0F  
+
+#define SIOCSIWSPY 0x8B10  
+#define SIOCGIWSPY 0x8B11  
+#define SIOCSIWTHRSPY 0x8B12  
+#define SIOCGIWTHRSPY 0x8B13  
+
+#define SIOCSIWAP 0x8B14  
+#define SIOCGIWAP 0x8B15  
+#define SIOCGIWAPLIST 0x8B17  
+#define SIOCSIWSCAN 0x8B18  
+#define SIOCGIWSCAN 0x8B19  
+
+#define SIOCSIWESSID 0x8B1A  
+#define SIOCGIWESSID 0x8B1B  
+#define SIOCSIWNICKN 0x8B1C  
+#define SIOCGIWNICKN 0x8B1D  
+
+#define SIOCSIWRATE 0x8B20  
+#define SIOCGIWRATE 0x8B21  
+#define SIOCSIWRTS 0x8B22  
+#define SIOCGIWRTS 0x8B23  
+#define SIOCSIWFRAG 0x8B24  
+#define SIOCGIWFRAG 0x8B25  
+#define SIOCSIWTXPOW 0x8B26  
+#define SIOCGIWTXPOW 0x8B27  
+#define SIOCSIWRETRY 0x8B28  
+#define SIOCGIWRETRY 0x8B29  
+
+#define SIOCSIWENCODE 0x8B2A  
+#define SIOCGIWENCODE 0x8B2B  
+
+#define SIOCSIWPOWER 0x8B2C  
+#define SIOCGIWPOWER 0x8B2D  
+
+#define SIOCSIWGENIE 0x8B30  
+#define SIOCGIWGENIE 0x8B31  
+
+#define SIOCSIWMLME 0x8B16  
+
+#define SIOCSIWAUTH 0x8B32  
+#define SIOCGIWAUTH 0x8B33  
+
+#define SIOCSIWENCODEEXT 0x8B34  
+#define SIOCGIWENCODEEXT 0x8B35  
+
+#define SIOCSIWPMKSA 0x8B36  
+
+#define SIOCIWFIRSTPRIV 0x8BE0
+#define SIOCIWLASTPRIV 0x8BFF
+
+#define SIOCIWFIRST 0x8B00
+#define SIOCIWLAST SIOCIWLASTPRIV  
+#define IW_IOCTL_IDX(cmd) ((cmd) - SIOCIWFIRST)
+
+#define IW_IS_SET(cmd) (!((cmd) & 0x1))
+#define IW_IS_GET(cmd) ((cmd) & 0x1)
+
+#define IWEVTXDROP 0x8C00  
+#define IWEVQUAL 0x8C01  
+#define IWEVCUSTOM 0x8C02  
+#define IWEVREGISTERED 0x8C03  
+#define IWEVEXPIRED 0x8C04  
+#define IWEVGENIE 0x8C05  
+#define IWEVMICHAELMICFAILURE 0x8C06  
+#define IWEVASSOCREQIE 0x8C07  
+#define IWEVASSOCRESPIE 0x8C08  
+#define IWEVPMKIDCAND 0x8C09  
+
+#define IWEVFIRST 0x8C00
+#define IW_EVENT_IDX(cmd) ((cmd) - IWEVFIRST)
+
+#define IW_PRIV_TYPE_MASK 0x7000  
+#define IW_PRIV_TYPE_NONE 0x0000
+#define IW_PRIV_TYPE_BYTE 0x1000  
+#define IW_PRIV_TYPE_CHAR 0x2000  
+#define IW_PRIV_TYPE_INT 0x4000  
+#define IW_PRIV_TYPE_FLOAT 0x5000  
+#define IW_PRIV_TYPE_ADDR 0x6000  
+
+#define IW_PRIV_SIZE_FIXED 0x0800  
+
+#define IW_PRIV_SIZE_MASK 0x07FF  
+
+#define IW_MAX_FREQUENCIES 32
+
+#define IW_MAX_BITRATES 32
+
+#define IW_MAX_TXPOWER 8
+
+#define IW_MAX_SPY 8
+
+#define IW_MAX_AP 64
+
+#define IW_ESSID_MAX_SIZE 32
+
+#define IW_MODE_AUTO 0  
+#define IW_MODE_ADHOC 1  
+#define IW_MODE_INFRA 2  
+#define IW_MODE_MASTER 3  
+#define IW_MODE_REPEAT 4  
+#define IW_MODE_SECOND 5  
+#define IW_MODE_MONITOR 6  
+
+#define IW_QUAL_QUAL_UPDATED 0x01  
+#define IW_QUAL_LEVEL_UPDATED 0x02
+#define IW_QUAL_NOISE_UPDATED 0x04
+#define IW_QUAL_ALL_UPDATED 0x07
+#define IW_QUAL_DBM 0x08  
+#define IW_QUAL_QUAL_INVALID 0x10  
+#define IW_QUAL_LEVEL_INVALID 0x20
+#define IW_QUAL_NOISE_INVALID 0x40
+#define IW_QUAL_ALL_INVALID 0x70
+
+#define IW_FREQ_AUTO 0x00  
+#define IW_FREQ_FIXED 0x01  
+
+#define IW_MAX_ENCODING_SIZES 8
+
+#define IW_ENCODING_TOKEN_MAX 64  
+
+#define IW_ENCODE_INDEX 0x00FF  
+#define IW_ENCODE_FLAGS 0xFF00  
+#define IW_ENCODE_MODE 0xF000  
+#define IW_ENCODE_DISABLED 0x8000  
+#define IW_ENCODE_ENABLED 0x0000  
+#define IW_ENCODE_RESTRICTED 0x4000  
+#define IW_ENCODE_OPEN 0x2000  
+#define IW_ENCODE_NOKEY 0x0800  
+#define IW_ENCODE_TEMP 0x0400  
+
+#define IW_POWER_ON 0x0000  
+#define IW_POWER_TYPE 0xF000  
+#define IW_POWER_PERIOD 0x1000  
+#define IW_POWER_TIMEOUT 0x2000  
+#define IW_POWER_MODE 0x0F00  
+#define IW_POWER_UNICAST_R 0x0100  
+#define IW_POWER_MULTICAST_R 0x0200  
+#define IW_POWER_ALL_R 0x0300  
+#define IW_POWER_FORCE_S 0x0400  
+#define IW_POWER_REPEATER 0x0800  
+#define IW_POWER_MODIFIER 0x000F  
+#define IW_POWER_MIN 0x0001  
+#define IW_POWER_MAX 0x0002  
+#define IW_POWER_RELATIVE 0x0004  
+
+#define IW_TXPOW_TYPE 0x00FF  
+#define IW_TXPOW_DBM 0x0000  
+#define IW_TXPOW_MWATT 0x0001  
+#define IW_TXPOW_RELATIVE 0x0002  
+#define IW_TXPOW_RANGE 0x1000  
+
+#define IW_RETRY_ON 0x0000  
+#define IW_RETRY_TYPE 0xF000  
+#define IW_RETRY_LIMIT 0x1000  
+#define IW_RETRY_LIFETIME 0x2000  
+#define IW_RETRY_MODIFIER 0x000F  
+#define IW_RETRY_MIN 0x0001  
+#define IW_RETRY_MAX 0x0002  
+#define IW_RETRY_RELATIVE 0x0004  
+
+#define IW_SCAN_DEFAULT 0x0000  
+#define IW_SCAN_ALL_ESSID 0x0001  
+#define IW_SCAN_THIS_ESSID 0x0002  
+#define IW_SCAN_ALL_FREQ 0x0004  
+#define IW_SCAN_THIS_FREQ 0x0008  
+#define IW_SCAN_ALL_MODE 0x0010  
+#define IW_SCAN_THIS_MODE 0x0020  
+#define IW_SCAN_ALL_RATE 0x0040  
+#define IW_SCAN_THIS_RATE 0x0080  
+
+#define IW_SCAN_TYPE_ACTIVE 0
+#define IW_SCAN_TYPE_PASSIVE 1
+
+#define IW_SCAN_MAX_DATA 4096  
+
+#define IW_CUSTOM_MAX 256  
+
+#define IW_GENERIC_IE_MAX 1024
+
+#define IW_MLME_DEAUTH 0
+#define IW_MLME_DISASSOC 1
+
+#define IW_AUTH_INDEX 0x0FFF
+#define IW_AUTH_FLAGS 0xF000
+
+#define IW_AUTH_WPA_VERSION 0
+#define IW_AUTH_CIPHER_PAIRWISE 1
+#define IW_AUTH_CIPHER_GROUP 2
+#define IW_AUTH_KEY_MGMT 3
+#define IW_AUTH_TKIP_COUNTERMEASURES 4
+#define IW_AUTH_DROP_UNENCRYPTED 5
+#define IW_AUTH_80211_AUTH_ALG 6
+#define IW_AUTH_WPA_ENABLED 7
+#define IW_AUTH_RX_UNENCRYPTED_EAPOL 8
+#define IW_AUTH_ROAMING_CONTROL 9
+#define IW_AUTH_PRIVACY_INVOKED 10
+
+#define IW_AUTH_WPA_VERSION_DISABLED 0x00000001
+#define IW_AUTH_WPA_VERSION_WPA 0x00000002
+#define IW_AUTH_WPA_VERSION_WPA2 0x00000004
+
+#define IW_AUTH_CIPHER_NONE 0x00000001
+#define IW_AUTH_CIPHER_WEP40 0x00000002
+#define IW_AUTH_CIPHER_TKIP 0x00000004
+#define IW_AUTH_CIPHER_CCMP 0x00000008
+#define IW_AUTH_CIPHER_WEP104 0x00000010
+
+#define IW_AUTH_KEY_MGMT_802_1X 1
+#define IW_AUTH_KEY_MGMT_PSK 2
+
+#define IW_AUTH_ALG_OPEN_SYSTEM 0x00000001
+#define IW_AUTH_ALG_SHARED_KEY 0x00000002
+#define IW_AUTH_ALG_LEAP 0x00000004
+
+#define IW_AUTH_ROAMING_ENABLE 0  
+#define IW_AUTH_ROAMING_DISABLE 1  
+
+#define IW_ENCODE_SEQ_MAX_SIZE 8
+
+#define IW_ENCODE_ALG_NONE 0
+#define IW_ENCODE_ALG_WEP 1
+#define IW_ENCODE_ALG_TKIP 2
+#define IW_ENCODE_ALG_CCMP 3
+
+#define IW_ENCODE_EXT_TX_SEQ_VALID 0x00000001
+#define IW_ENCODE_EXT_RX_SEQ_VALID 0x00000002
+#define IW_ENCODE_EXT_GROUP_KEY 0x00000004
+#define IW_ENCODE_EXT_SET_TX_KEY 0x00000008
+
+#define IW_MICFAILURE_KEY_ID 0x00000003  
+#define IW_MICFAILURE_GROUP 0x00000004
+#define IW_MICFAILURE_PAIRWISE 0x00000008
+#define IW_MICFAILURE_STAKEY 0x00000010
+#define IW_MICFAILURE_COUNT 0x00000060  
+
+#define IW_ENC_CAPA_WPA 0x00000001
+#define IW_ENC_CAPA_WPA2 0x00000002
+#define IW_ENC_CAPA_CIPHER_TKIP 0x00000004
+#define IW_ENC_CAPA_CIPHER_CCMP 0x00000008
+
+#define IW_EVENT_CAPA_BASE(cmd) ((cmd >= SIOCIWFIRSTPRIV) ?   (cmd - SIOCIWFIRSTPRIV + 0x60) :   (cmd - SIOCSIWCOMMIT))
+#define IW_EVENT_CAPA_INDEX(cmd) (IW_EVENT_CAPA_BASE(cmd) >> 5)
+#define IW_EVENT_CAPA_MASK(cmd) (1 << (IW_EVENT_CAPA_BASE(cmd) & 0x1F))
+
+#define IW_EVENT_CAPA_K_0 (IW_EVENT_CAPA_MASK(0x8B04) |   IW_EVENT_CAPA_MASK(0x8B06) |   IW_EVENT_CAPA_MASK(0x8B1A))
+#define IW_EVENT_CAPA_K_1 (IW_EVENT_CAPA_MASK(0x8B2A))
+
+#define IW_EVENT_CAPA_SET(event_capa, cmd) (event_capa[IW_EVENT_CAPA_INDEX(cmd)] |= IW_EVENT_CAPA_MASK(cmd))
+#define IW_EVENT_CAPA_SET_KERNEL(event_capa) {event_capa[0] |= IW_EVENT_CAPA_K_0; event_capa[1] |= IW_EVENT_CAPA_K_1; }
+
+struct iw_param
+{
+ __s32 value;
+ __u8 fixed;
+ __u8 disabled;
+ __u16 flags;
+};
+
+struct iw_point
+{
+ void __user *pointer;
+ __u16 length;
+ __u16 flags;
+};
+
+struct iw_freq
+{
+ __s32 m;
+ __s16 e;
+ __u8 i;
+ __u8 flags;
+};
+
+struct iw_quality
+{
+ __u8 qual;
+ __u8 level;
+ __u8 noise;
+ __u8 updated;
+};
+
+struct iw_discarded
+{
+ __u32 nwid;
+ __u32 code;
+ __u32 fragment;
+ __u32 retries;
+ __u32 misc;
+};
+
+struct iw_missed
+{
+ __u32 beacon;
+};
+
+struct iw_thrspy
+{
+ struct sockaddr addr;
+ struct iw_quality qual;
+ struct iw_quality low;
+ struct iw_quality high;
+};
+
+struct iw_scan_req
+{
+ __u8 scan_type;
+ __u8 essid_len;
+ __u8 num_channels;
+ __u8 flags;
+ struct sockaddr bssid;
+
+ __u8 essid[IW_ESSID_MAX_SIZE];
+
+ __u32 min_channel_time;
+ __u32 max_channel_time;
+
+ struct iw_freq channel_list[IW_MAX_FREQUENCIES];
+};
+
+struct iw_encode_ext
+{
+ __u32 ext_flags;
+ __u8 tx_seq[IW_ENCODE_SEQ_MAX_SIZE];
+ __u8 rx_seq[IW_ENCODE_SEQ_MAX_SIZE];
+ struct sockaddr addr;
+ __u16 alg;
+ __u16 key_len;
+ __u8 key[0];
+};
+
+struct iw_mlme
+{
+ __u16 cmd;
+ __u16 reason_code;
+ struct sockaddr addr;
+};
+
+#define IW_PMKSA_ADD 1
+#define IW_PMKSA_REMOVE 2
+#define IW_PMKSA_FLUSH 3
+
+#define IW_PMKID_LEN 16
+
+struct iw_pmksa
+{
+ __u32 cmd;
+ struct sockaddr bssid;
+ __u8 pmkid[IW_PMKID_LEN];
+};
+
+struct iw_michaelmicfailure
+{
+ __u32 flags;
+ struct sockaddr src_addr;
+ __u8 tsc[IW_ENCODE_SEQ_MAX_SIZE];
+};
+
+#define IW_PMKID_CAND_PREAUTH 0x00000001  
+struct iw_pmkid_cand
+{
+ __u32 flags;
+ __u32 index;
+ struct sockaddr bssid;
+};
+
+struct iw_statistics
+{
+ __u16 status;
+
+ struct iw_quality qual;
+ struct iw_discarded discard;
+ struct iw_missed miss;
+};
+
+union iwreq_data
+{
+
+ char name[IFNAMSIZ];
+
+ struct iw_point essid;
+ struct iw_param nwid;
+ struct iw_freq freq;
+
+ struct iw_param sens;
+ struct iw_param bitrate;
+ struct iw_param txpower;
+ struct iw_param rts;
+ struct iw_param frag;
+ __u32 mode;
+ struct iw_param retry;
+
+ struct iw_point encoding;
+ struct iw_param power;
+ struct iw_quality qual;
+
+ struct sockaddr ap_addr;
+ struct sockaddr addr;
+
+ struct iw_param param;
+ struct iw_point data;
+};
+
+struct iwreq
+{
+ union
+ {
+ char ifrn_name[IFNAMSIZ];
+ } ifr_ifrn;
+
+ union iwreq_data u;
+};
+
+struct iw_range
+{
+
+ __u32 throughput;
+
+ __u32 min_nwid;
+ __u32 max_nwid;
+
+ __u16 old_num_channels;
+ __u8 old_num_frequency;
+
+ __u32 event_capa[6];
+
+ __s32 sensitivity;
+
+ struct iw_quality max_qual;
+
+ struct iw_quality avg_qual;
+
+ __u8 num_bitrates;
+ __s32 bitrate[IW_MAX_BITRATES];
+
+ __s32 min_rts;
+ __s32 max_rts;
+
+ __s32 min_frag;
+ __s32 max_frag;
+
+ __s32 min_pmp;
+ __s32 max_pmp;
+ __s32 min_pmt;
+ __s32 max_pmt;
+ __u16 pmp_flags;
+ __u16 pmt_flags;
+ __u16 pm_capa;
+
+ __u16 encoding_size[IW_MAX_ENCODING_SIZES];
+ __u8 num_encoding_sizes;
+ __u8 max_encoding_tokens;
+
+ __u8 encoding_login_index;
+
+ __u16 txpower_capa;
+ __u8 num_txpower;
+ __s32 txpower[IW_MAX_TXPOWER];
+
+ __u8 we_version_compiled;
+ __u8 we_version_source;
+
+ __u16 retry_capa;
+ __u16 retry_flags;
+ __u16 r_time_flags;
+ __s32 min_retry;
+ __s32 max_retry;
+ __s32 min_r_time;
+ __s32 max_r_time;
+
+ __u16 num_channels;
+ __u8 num_frequency;
+ struct iw_freq freq[IW_MAX_FREQUENCIES];
+
+ __u32 enc_capa;
+};
+
+struct iw_priv_args
+{
+ __u32 cmd;
+ __u16 set_args;
+ __u16 get_args;
+ char name[IFNAMSIZ];
+};
+
+struct iw_event
+{
+ __u16 len;
+ __u16 cmd;
+ union iwreq_data u;
+};
+
+#define IW_EV_LCP_LEN (sizeof(struct iw_event) - sizeof(union iwreq_data))
+
+#define IW_EV_CHAR_LEN (IW_EV_LCP_LEN + IFNAMSIZ)
+#define IW_EV_UINT_LEN (IW_EV_LCP_LEN + sizeof(__u32))
+#define IW_EV_FREQ_LEN (IW_EV_LCP_LEN + sizeof(struct iw_freq))
+#define IW_EV_PARAM_LEN (IW_EV_LCP_LEN + sizeof(struct iw_param))
+#define IW_EV_ADDR_LEN (IW_EV_LCP_LEN + sizeof(struct sockaddr))
+#define IW_EV_QUAL_LEN (IW_EV_LCP_LEN + sizeof(struct iw_quality))
+
+#define IW_EV_POINT_OFF (((char *) &(((struct iw_point *) NULL)->length)) -   (char *) NULL)
+#define IW_EV_POINT_LEN (IW_EV_LCP_LEN + sizeof(struct iw_point) -   IW_EV_POINT_OFF)
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/workqueue.h b/ndk/platforms/android-3/include/linux/workqueue.h
new file mode 100644
index 0000000..12fab2c
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/workqueue.h
@@ -0,0 +1,45 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_WORKQUEUE_H
+#define _LINUX_WORKQUEUE_H
+
+#include <linux/timer.h>
+#include <linux/linkage.h>
+#include <linux/bitops.h>
+
+struct workqueue_struct;
+
+struct work_struct {
+ unsigned long pending;
+ struct list_head entry;
+ void (*func)(void *);
+ void *data;
+ void *wq_data;
+ struct timer_list timer;
+};
+
+struct execute_work {
+ struct work_struct work;
+};
+
+#define __WORK_INITIALIZER(n, f, d) {   .entry = { &(n).entry, &(n).entry },   .func = (f),   .data = (d),   .timer = TIMER_INITIALIZER(NULL, 0, 0),   }
+
+#define DECLARE_WORK(n, f, d)   struct work_struct n = __WORK_INITIALIZER(n, f, d)
+
+#define PREPARE_WORK(_work, _func, _data)   do {   (_work)->func = _func;   (_work)->data = _data;   } while (0)
+
+#define INIT_WORK(_work, _func, _data)   do {   INIT_LIST_HEAD(&(_work)->entry);   (_work)->pending = 0;   PREPARE_WORK((_work), (_func), (_data));   init_timer(&(_work)->timer);   } while (0)
+
+#define create_workqueue(name) __create_workqueue((name), 0)
+#define create_singlethread_workqueue(name) __create_workqueue((name), 1)
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/xattr.h b/ndk/platforms/android-3/include/linux/xattr.h
new file mode 100644
index 0000000..f5f640d
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/xattr.h
@@ -0,0 +1,43 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_XATTR_H
+#define _LINUX_XATTR_H
+
+#define XATTR_CREATE 0x1  
+#define XATTR_REPLACE 0x2  
+
+#define XATTR_OS2_PREFIX "os2."
+#define XATTR_OS2_PREFIX_LEN (sizeof (XATTR_OS2_PREFIX) - 1)
+
+#define XATTR_SECURITY_PREFIX "security."
+#define XATTR_SECURITY_PREFIX_LEN (sizeof (XATTR_SECURITY_PREFIX) - 1)
+
+#define XATTR_SYSTEM_PREFIX "system."
+#define XATTR_SYSTEM_PREFIX_LEN (sizeof (XATTR_SYSTEM_PREFIX) - 1)
+
+#define XATTR_TRUSTED_PREFIX "trusted."
+#define XATTR_TRUSTED_PREFIX_LEN (sizeof (XATTR_TRUSTED_PREFIX) - 1)
+
+#define XATTR_USER_PREFIX "user."
+#define XATTR_USER_PREFIX_LEN (sizeof (XATTR_USER_PREFIX) - 1)
+
+struct xattr_handler {
+ char *prefix;
+ size_t (*list)(struct inode *inode, char *list, size_t list_size,
+ const char *name, size_t name_len);
+ int (*get)(struct inode *inode, const char *name, void *buffer,
+ size_t size);
+ int (*set)(struct inode *inode, const char *name, const void *buffer,
+ size_t size, int flags);
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/zconf.h b/ndk/platforms/android-3/include/linux/zconf.h
new file mode 100644
index 0000000..18ea78c
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/zconf.h
@@ -0,0 +1,38 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ZCONF_H
+#define _ZCONF_H
+
+#ifndef MAX_MEM_LEVEL
+#define MAX_MEM_LEVEL 8
+#endif
+
+#ifndef MAX_WBITS
+#define MAX_WBITS 15  
+#endif
+
+#ifndef DEF_WBITS
+#define DEF_WBITS MAX_WBITS
+#endif
+
+#if MAX_MEM_LEVEL >= 8
+#define DEF_MEM_LEVEL 8
+#else
+#define DEF_MEM_LEVEL MAX_MEM_LEVEL
+#endif
+
+typedef unsigned char Byte;
+typedef unsigned int uInt;
+typedef unsigned long uLong;
+typedef void *voidp;
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/zlib.h b/ndk/platforms/android-3/include/linux/zlib.h
new file mode 100644
index 0000000..052adfe
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/zlib.h
@@ -0,0 +1,80 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ZLIB_H
+#define _ZLIB_H
+
+#include <linux/zconf.h>
+
+struct internal_state;
+
+typedef struct z_stream_s {
+ Byte *next_in;
+ uInt avail_in;
+ uLong total_in;
+
+ Byte *next_out;
+ uInt avail_out;
+ uLong total_out;
+
+ char *msg;
+ struct internal_state *state;
+
+ void *workspace;
+
+ int data_type;
+ uLong adler;
+ uLong reserved;
+} z_stream;
+
+typedef z_stream *z_streamp;
+
+#define Z_NO_FLUSH 0
+#define Z_PARTIAL_FLUSH 1  
+#define Z_PACKET_FLUSH 2
+#define Z_SYNC_FLUSH 3
+#define Z_FULL_FLUSH 4
+#define Z_FINISH 5
+#define Z_BLOCK 6  
+
+#define Z_OK 0
+#define Z_STREAM_END 1
+#define Z_NEED_DICT 2
+#define Z_ERRNO (-1)
+#define Z_STREAM_ERROR (-2)
+#define Z_DATA_ERROR (-3)
+#define Z_MEM_ERROR (-4)
+#define Z_BUF_ERROR (-5)
+#define Z_VERSION_ERROR (-6)
+
+#define Z_NO_COMPRESSION 0
+#define Z_BEST_SPEED 1
+#define Z_BEST_COMPRESSION 9
+#define Z_DEFAULT_COMPRESSION (-1)
+
+#define Z_FILTERED 1
+#define Z_HUFFMAN_ONLY 2
+#define Z_DEFAULT_STRATEGY 0
+
+#define Z_BINARY 0
+#define Z_ASCII 1
+#define Z_UNKNOWN 2
+
+#define Z_DEFLATED 8
+
+#define zlib_deflateInit(strm, level)   zlib_deflateInit2((strm), (level), Z_DEFLATED, MAX_WBITS,   DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY)
+#define zlib_inflateInit(strm)   zlib_inflateInit2((strm), DEF_WBITS)
+
+#if !defined(_Z_UTIL_H) && !defined(NO_DUMMY_DECL)
+ struct internal_state {int dummy;};
+#endif
+
+#endif
diff --git a/ndk/platforms/android-3/include/linux/zorro_ids.h b/ndk/platforms/android-3/include/linux/zorro_ids.h
new file mode 100644
index 0000000..e6b1d48
--- /dev/null
+++ b/ndk/platforms/android-3/include/linux/zorro_ids.h
@@ -0,0 +1,549 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#define ZORRO_MANUF_PACIFIC_PERIPHERALS 0x00D3
+#define ZORRO_PROD_PACIFIC_PERIPHERALS_SE_2000_A500 ZORRO_ID(PACIFIC_PERIPHERALS, 0x00, 0)
+#define ZORRO_PROD_PACIFIC_PERIPHERALS_SCSI ZORRO_ID(PACIFIC_PERIPHERALS, 0x0A, 0)
+
+#define ZORRO_MANUF_MACROSYSTEMS_USA_2 0x0100
+#define ZORRO_PROD_MACROSYSTEMS_WARP_ENGINE ZORRO_ID(MACROSYSTEMS_USA_2, 0x13, 0)
+
+#define ZORRO_MANUF_KUPKE_1 0x00DD
+#define ZORRO_PROD_KUPKE_GOLEM_RAM_BOX_2MB ZORRO_ID(KUPKE_1, 0x00, 0)
+
+#define ZORRO_MANUF_MEMPHIS 0x0100
+#define ZORRO_PROD_MEMPHIS_STORMBRINGER ZORRO_ID(MEMPHIS, 0x00, 0)
+
+#define ZORRO_MANUF_3_STATE 0x0200
+#define ZORRO_PROD_3_STATE_MEGAMIX_2000 ZORRO_ID(3_STATE, 0x02, 0)
+
+#define ZORRO_MANUF_COMMODORE_BRAUNSCHWEIG 0x0201
+#define ZORRO_PROD_CBM_A2088_A2286 ZORRO_ID(COMMODORE_BRAUNSCHWEIG, 0x01, 0)
+#define ZORRO_PROD_CBM_A2286 ZORRO_ID(COMMODORE_BRAUNSCHWEIG, 0x02, 0)
+#define ZORRO_PROD_CBM_A4091_1 ZORRO_ID(COMMODORE_BRAUNSCHWEIG, 0x54, 0)
+#define ZORRO_PROD_CBM_A2386SX_1 ZORRO_ID(COMMODORE_BRAUNSCHWEIG, 0x67, 0)
+
+#define ZORRO_MANUF_COMMODORE_WEST_CHESTER_1 0x0202
+#define ZORRO_PROD_CBM_A2090A ZORRO_ID(COMMODORE_WEST_CHESTER_1, 0x01, 0)
+#define ZORRO_PROD_CBM_A590_A2091_1 ZORRO_ID(COMMODORE_WEST_CHESTER_1, 0x02, 0)
+#define ZORRO_PROD_CBM_A590_A2091_2 ZORRO_ID(COMMODORE_WEST_CHESTER_1, 0x03, 0)
+#define ZORRO_PROD_CBM_A2090B ZORRO_ID(COMMODORE_WEST_CHESTER_1, 0x04, 0)
+#define ZORRO_PROD_CBM_A2060 ZORRO_ID(COMMODORE_WEST_CHESTER_1, 0x09, 0)
+#define ZORRO_PROD_CBM_A590_A2052_A2058_A2091 ZORRO_ID(COMMODORE_WEST_CHESTER_1, 0x0A, 0)
+#define ZORRO_PROD_CBM_A560_RAM ZORRO_ID(COMMODORE_WEST_CHESTER_1, 0x20, 0)
+#define ZORRO_PROD_CBM_A2232_PROTOTYPE ZORRO_ID(COMMODORE_WEST_CHESTER_1, 0x45, 0)
+#define ZORRO_PROD_CBM_A2232 ZORRO_ID(COMMODORE_WEST_CHESTER_1, 0x46, 0)
+#define ZORRO_PROD_CBM_A2620 ZORRO_ID(COMMODORE_WEST_CHESTER_1, 0x50, 0)
+#define ZORRO_PROD_CBM_A2630 ZORRO_ID(COMMODORE_WEST_CHESTER_1, 0x51, 0)
+#define ZORRO_PROD_CBM_A4091_2 ZORRO_ID(COMMODORE_WEST_CHESTER_1, 0x54, 0)
+#define ZORRO_PROD_CBM_A2065_1 ZORRO_ID(COMMODORE_WEST_CHESTER_1, 0x5A, 0)
+#define ZORRO_PROD_CBM_ROMULATOR ZORRO_ID(COMMODORE_WEST_CHESTER_1, 0x60, 0)
+#define ZORRO_PROD_CBM_A3000_TEST_FIXTURE ZORRO_ID(COMMODORE_WEST_CHESTER_1, 0x61, 0)
+#define ZORRO_PROD_CBM_A2386SX_2 ZORRO_ID(COMMODORE_WEST_CHESTER_1, 0x67, 0)
+#define ZORRO_PROD_CBM_A2065_2 ZORRO_ID(COMMODORE_WEST_CHESTER_1, 0x70, 0)
+
+#define ZORRO_MANUF_COMMODORE_WEST_CHESTER_2 0x0203
+#define ZORRO_PROD_CBM_A2090A_CM ZORRO_ID(COMMODORE_WEST_CHESTER_2, 0x03, 0)
+
+#define ZORRO_MANUF_PROGRESSIVE_PERIPHERALS_AND_SYSTEMS_2 0x02F4
+#define ZORRO_PROD_PPS_EXP8000 ZORRO_ID(PROGRESSIVE_PERIPHERALS_AND_SYSTEMS_2, 0x02, 0)
+
+#define ZORRO_MANUF_KOLFF_COMPUTER_SUPPLIES 0x02FF
+#define ZORRO_PROD_KCS_POWER_PC_BOARD ZORRO_ID(KOLFF_COMPUTER_SUPPLIES, 0x00, 0)
+
+#define ZORRO_MANUF_CARDCO_1 0x03EC
+#define ZORRO_PROD_CARDCO_KRONOS_2000_1 ZORRO_ID(CARDCO_1, 0x04, 0)
+#define ZORRO_PROD_CARDCO_A1000_1 ZORRO_ID(CARDCO_1, 0x0C, 0)
+#define ZORRO_PROD_CARDCO_ESCORT ZORRO_ID(CARDCO_1, 0x0E, 0)
+#define ZORRO_PROD_CARDCO_A2410 ZORRO_ID(CARDCO_1, 0xF5, 0)
+
+#define ZORRO_MANUF_A_SQUARED 0x03ED
+#define ZORRO_PROD_A_SQUARED_LIVE_2000 ZORRO_ID(A_SQUARED, 0x01, 0)
+
+#define ZORRO_MANUF_COMSPEC_COMMUNICATIONS 0x03EE
+#define ZORRO_PROD_COMSPEC_COMMUNICATIONS_AX2000 ZORRO_ID(COMSPEC_COMMUNICATIONS, 0x01, 0)
+
+#define ZORRO_MANUF_ANAKIN_RESEARCH 0x03F1
+#define ZORRO_PROD_ANAKIN_RESEARCH_EASYL ZORRO_ID(ANAKIN_RESEARCH, 0x01, 0)
+
+#define ZORRO_MANUF_MICROBOTICS 0x03F2
+#define ZORRO_PROD_MICROBOTICS_STARBOARD_II ZORRO_ID(MICROBOTICS, 0x00, 0)
+#define ZORRO_PROD_MICROBOTICS_STARDRIVE ZORRO_ID(MICROBOTICS, 0x02, 0)
+#define ZORRO_PROD_MICROBOTICS_8_UP_A ZORRO_ID(MICROBOTICS, 0x03, 0)
+#define ZORRO_PROD_MICROBOTICS_8_UP_Z ZORRO_ID(MICROBOTICS, 0x04, 0)
+#define ZORRO_PROD_MICROBOTICS_DELTA_RAM ZORRO_ID(MICROBOTICS, 0x20, 0)
+#define ZORRO_PROD_MICROBOTICS_8_STAR_RAM ZORRO_ID(MICROBOTICS, 0x40, 0)
+#define ZORRO_PROD_MICROBOTICS_8_STAR ZORRO_ID(MICROBOTICS, 0x41, 0)
+#define ZORRO_PROD_MICROBOTICS_VXL_RAM_32 ZORRO_ID(MICROBOTICS, 0x44, 0)
+#define ZORRO_PROD_MICROBOTICS_VXL_68030 ZORRO_ID(MICROBOTICS, 0x45, 0)
+#define ZORRO_PROD_MICROBOTICS_DELTA ZORRO_ID(MICROBOTICS, 0x60, 0)
+#define ZORRO_PROD_MICROBOTICS_MBX_1200_1200Z_RAM ZORRO_ID(MICROBOTICS, 0x81, 0)
+#define ZORRO_PROD_MICROBOTICS_HARDFRAME_2000_1 ZORRO_ID(MICROBOTICS, 0x96, 0)
+#define ZORRO_PROD_MICROBOTICS_HARDFRAME_2000_2 ZORRO_ID(MICROBOTICS, 0x9E, 0)
+#define ZORRO_PROD_MICROBOTICS_MBX_1200_1200Z ZORRO_ID(MICROBOTICS, 0xC1, 0)
+
+#define ZORRO_MANUF_ACCESS_ASSOCIATES_ALEGRA 0x03F4
+
+#define ZORRO_MANUF_EXPANSION_TECHNOLOGIES 0x03F6
+
+#define ZORRO_MANUF_ASDG 0x03FF
+#define ZORRO_PROD_ASDG_MEMORY_1 ZORRO_ID(ASDG, 0x01, 0)
+#define ZORRO_PROD_ASDG_MEMORY_2 ZORRO_ID(ASDG, 0x02, 0)
+#define ZORRO_PROD_ASDG_EB920_LAN_ROVER ZORRO_ID(ASDG, 0xFE, 0)
+#define ZORRO_PROD_ASDG_GPIB_DUALIEEE488_TWIN_X ZORRO_ID(ASDG, 0xFF, 0)
+
+#define ZORRO_MANUF_IMTRONICS_1 0x0404
+#define ZORRO_PROD_IMTRONICS_HURRICANE_2800_1 ZORRO_ID(IMTRONICS_1, 0x39, 0)
+#define ZORRO_PROD_IMTRONICS_HURRICANE_2800_2 ZORRO_ID(IMTRONICS_1, 0x57, 0)
+
+#define ZORRO_MANUF_CBM_UNIVERSITY_OF_LOWELL 0x0406
+#define ZORRO_PROD_CBM_A2410 ZORRO_ID(CBM_UNIVERSITY_OF_LOWELL, 0x00, 0)
+
+#define ZORRO_MANUF_AMERISTAR 0x041D
+#define ZORRO_PROD_AMERISTAR_A2065 ZORRO_ID(AMERISTAR, 0x01, 0)
+#define ZORRO_PROD_AMERISTAR_A560 ZORRO_ID(AMERISTAR, 0x09, 0)
+#define ZORRO_PROD_AMERISTAR_A4066 ZORRO_ID(AMERISTAR, 0x0A, 0)
+
+#define ZORRO_MANUF_SUPRA 0x0420
+#define ZORRO_PROD_SUPRA_SUPRADRIVE_4x4 ZORRO_ID(SUPRA, 0x01, 0)
+#define ZORRO_PROD_SUPRA_1000_RAM ZORRO_ID(SUPRA, 0x02, 0)
+#define ZORRO_PROD_SUPRA_2000_DMA ZORRO_ID(SUPRA, 0x03, 0)
+#define ZORRO_PROD_SUPRA_500 ZORRO_ID(SUPRA, 0x05, 0)
+#define ZORRO_PROD_SUPRA_500_SCSI ZORRO_ID(SUPRA, 0x08, 0)
+#define ZORRO_PROD_SUPRA_500XP_2000_RAM ZORRO_ID(SUPRA, 0x09, 0)
+#define ZORRO_PROD_SUPRA_500RX_2000_RAM ZORRO_ID(SUPRA, 0x0A, 0)
+#define ZORRO_PROD_SUPRA_2400ZI ZORRO_ID(SUPRA, 0x0B, 0)
+#define ZORRO_PROD_SUPRA_500XP_SUPRADRIVE_WORDSYNC ZORRO_ID(SUPRA, 0x0C, 0)
+#define ZORRO_PROD_SUPRA_SUPRADRIVE_WORDSYNC_II ZORRO_ID(SUPRA, 0x0D, 0)
+#define ZORRO_PROD_SUPRA_2400ZIPLUS ZORRO_ID(SUPRA, 0x10, 0)
+
+#define ZORRO_MANUF_COMPUTER_SYSTEMS_ASSOCIATES 0x0422
+#define ZORRO_PROD_CSA_MAGNUM ZORRO_ID(COMPUTER_SYSTEMS_ASSOCIATES, 0x11, 0)
+#define ZORRO_PROD_CSA_12_GAUGE ZORRO_ID(COMPUTER_SYSTEMS_ASSOCIATES, 0x15, 0)
+
+#define ZORRO_MANUF_MARC_MICHAEL_GROTH 0x0439
+
+#define ZORRO_MANUF_M_TECH 0x0502
+#define ZORRO_PROD_MTEC_AT500_1 ZORRO_ID(M_TECH, 0x03, 0)
+
+#define ZORRO_MANUF_GREAT_VALLEY_PRODUCTS_1 0x06E1
+#define ZORRO_PROD_GVP_IMPACT_SERIES_I ZORRO_ID(GREAT_VALLEY_PRODUCTS_1, 0x08, 0)
+
+#define ZORRO_MANUF_BYTEBOX 0x07DA
+#define ZORRO_PROD_BYTEBOX_A500 ZORRO_ID(BYTEBOX, 0x00, 0)
+
+#define ZORRO_MANUF_DKB_POWER_COMPUTING 0x07DC
+#define ZORRO_PROD_DKB_POWER_COMPUTING_SECUREKEY ZORRO_ID(DKB_POWER_COMPUTING, 0x09, 0)
+#define ZORRO_PROD_DKB_POWER_COMPUTING_DKM_3128 ZORRO_ID(DKB_POWER_COMPUTING, 0x0E, 0)
+#define ZORRO_PROD_DKB_POWER_COMPUTING_RAPID_FIRE ZORRO_ID(DKB_POWER_COMPUTING, 0x0F, 0)
+#define ZORRO_PROD_DKB_POWER_COMPUTING_DKM_1202 ZORRO_ID(DKB_POWER_COMPUTING, 0x10, 0)
+#define ZORRO_PROD_DKB_POWER_COMPUTING_COBRA_VIPER_II_68EC030 ZORRO_ID(DKB_POWER_COMPUTING, 0x12, 0)
+#define ZORRO_PROD_DKB_POWER_COMPUTING_WILDFIRE_060_1 ZORRO_ID(DKB_POWER_COMPUTING, 0x17, 0)
+#define ZORRO_PROD_DKB_POWER_COMPUTING_WILDFIRE_060_2 ZORRO_ID(DKB_POWER_COMPUTING, 0xFF, 0)
+
+#define ZORRO_MANUF_GREAT_VALLEY_PRODUCTS_2 0x07E1
+#define ZORRO_PROD_GVP_IMPACT_SERIES_I_4K ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x01, 0)
+#define ZORRO_PROD_GVP_IMPACT_SERIES_I_16K_2 ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x02, 0)
+#define ZORRO_PROD_GVP_IMPACT_SERIES_I_16K_3 ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x03, 0)
+#define ZORRO_PROD_GVP_IMPACT_3001_IDE_1 ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x08, 0)
+#define ZORRO_PROD_GVP_IMPACT_3001_RAM ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x09, 0)
+#define ZORRO_PROD_GVP_IMPACT_SERIES_II_RAM_1 ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x0A, 0)
+#define ZORRO_PROD_GVP_EPC_BASE ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x0B, 0)
+#define ZORRO_PROD_GVP_GFORCE_040_1 ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x0B, 0x20)
+#define ZORRO_PROD_GVP_GFORCE_040_SCSI_1 ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x0B, 0x30)
+#define ZORRO_PROD_GVP_A1291 ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x0B, 0x40)
+#define ZORRO_PROD_GVP_COMBO_030_R4 ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x0B, 0x60)
+#define ZORRO_PROD_GVP_COMBO_030_R4_SCSI ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x0B, 0x70)
+#define ZORRO_PROD_GVP_PHONEPAK ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x0B, 0x78)
+#define ZORRO_PROD_GVP_IO_EXTENDER ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x0B, 0x98)
+#define ZORRO_PROD_GVP_GFORCE_030 ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x0B, 0xa0)
+#define ZORRO_PROD_GVP_GFORCE_030_SCSI ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x0B, 0xb0)
+#define ZORRO_PROD_GVP_A530 ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x0B, 0xc0)
+#define ZORRO_PROD_GVP_A530_SCSI ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x0B, 0xd0)
+#define ZORRO_PROD_GVP_COMBO_030_R3 ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x0B, 0xe0)
+#define ZORRO_PROD_GVP_COMBO_030_R3_SCSI ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x0B, 0xf0)
+#define ZORRO_PROD_GVP_SERIES_II ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x0B, 0xf8)
+#define ZORRO_PROD_GVP_IMPACT_3001_IDE_2 ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x0D, 0)
+
+#define ZORRO_PROD_GVP_GFORCE_040_060 ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x16, 0)
+#define ZORRO_PROD_GVP_IMPACT_VISION_24 ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0x20, 0)
+#define ZORRO_PROD_GVP_GFORCE_040_2 ZORRO_ID(GREAT_VALLEY_PRODUCTS_2, 0xFF, 0)
+
+#define ZORRO_MANUF_CALIFORNIA_ACCESS_SYNERGY 0x07E5
+#define ZORRO_PROD_CALIFORNIA_ACCESS_SYNERGY_MALIBU ZORRO_ID(CALIFORNIA_ACCESS_SYNERGY, 0x01, 0)
+
+#define ZORRO_MANUF_XETEC 0x07E6
+#define ZORRO_PROD_XETEC_FASTCARD ZORRO_ID(XETEC, 0x01, 0)
+#define ZORRO_PROD_XETEC_FASTCARD_RAM ZORRO_ID(XETEC, 0x02, 0)
+#define ZORRO_PROD_XETEC_FASTCARD_PLUS ZORRO_ID(XETEC, 0x03, 0)
+
+#define ZORRO_MANUF_PROGRESSIVE_PERIPHERALS_AND_SYSTEMS 0x07EA
+#define ZORRO_PROD_PPS_MERCURY ZORRO_ID(PROGRESSIVE_PERIPHERALS_AND_SYSTEMS, 0x00, 0)
+#define ZORRO_PROD_PPS_A3000_68040 ZORRO_ID(PROGRESSIVE_PERIPHERALS_AND_SYSTEMS, 0x01, 0)
+#define ZORRO_PROD_PPS_A2000_68040 ZORRO_ID(PROGRESSIVE_PERIPHERALS_AND_SYSTEMS, 0x69, 0)
+#define ZORRO_PROD_PPS_ZEUS ZORRO_ID(PROGRESSIVE_PERIPHERALS_AND_SYSTEMS, 0x96, 0)
+#define ZORRO_PROD_PPS_A500_68040 ZORRO_ID(PROGRESSIVE_PERIPHERALS_AND_SYSTEMS, 0xBB, 0)
+
+#define ZORRO_MANUF_XEBEC 0x07EC
+
+#define ZORRO_MANUF_SPIRIT_TECHNOLOGY 0x07F2
+#define ZORRO_PROD_SPIRIT_TECHNOLOGY_INSIDER_IN1000 ZORRO_ID(SPIRIT_TECHNOLOGY, 0x01, 0)
+#define ZORRO_PROD_SPIRIT_TECHNOLOGY_INSIDER_IN500 ZORRO_ID(SPIRIT_TECHNOLOGY, 0x02, 0)
+#define ZORRO_PROD_SPIRIT_TECHNOLOGY_SIN500 ZORRO_ID(SPIRIT_TECHNOLOGY, 0x03, 0)
+#define ZORRO_PROD_SPIRIT_TECHNOLOGY_HDA_506 ZORRO_ID(SPIRIT_TECHNOLOGY, 0x04, 0)
+#define ZORRO_PROD_SPIRIT_TECHNOLOGY_AX_S ZORRO_ID(SPIRIT_TECHNOLOGY, 0x05, 0)
+#define ZORRO_PROD_SPIRIT_TECHNOLOGY_OCTABYTE ZORRO_ID(SPIRIT_TECHNOLOGY, 0x06, 0)
+#define ZORRO_PROD_SPIRIT_TECHNOLOGY_INMATE ZORRO_ID(SPIRIT_TECHNOLOGY, 0x08, 0)
+
+#define ZORRO_MANUF_SPIRIT_TECHNOLOGY_2 0x07F3
+
+#define ZORRO_MANUF_BSC_ALFADATA_1 0x07FE
+#define ZORRO_PROD_BSC_ALF_3_1 ZORRO_ID(BSC_ALFADATA_1, 0x03, 0)
+
+#define ZORRO_MANUF_BSC_ALFADATA_2 0x0801
+#define ZORRO_PROD_BSC_ALF_2_1 ZORRO_ID(BSC_ALFADATA_2, 0x01, 0)
+#define ZORRO_PROD_BSC_ALF_2_2 ZORRO_ID(BSC_ALFADATA_2, 0x02, 0)
+#define ZORRO_PROD_BSC_ALF_3_2 ZORRO_ID(BSC_ALFADATA_2, 0x03, 0)
+
+#define ZORRO_MANUF_CARDCO_2 0x0802
+#define ZORRO_PROD_CARDCO_KRONOS_2000_2 ZORRO_ID(CARDCO_2, 0x04, 0)
+#define ZORRO_PROD_CARDCO_A1000_2 ZORRO_ID(CARDCO_2, 0x0C, 0)
+
+#define ZORRO_MANUF_JOCHHEIM 0x0804
+#define ZORRO_PROD_JOCHHEIM_RAM ZORRO_ID(JOCHHEIM, 0x01, 0)
+
+#define ZORRO_MANUF_CHECKPOINT_TECHNOLOGIES 0x0807
+#define ZORRO_PROD_CHECKPOINT_TECHNOLOGIES_SERIAL_SOLUTION ZORRO_ID(CHECKPOINT_TECHNOLOGIES, 0x00, 0)
+
+#define ZORRO_MANUF_EDOTRONIK 0x0810
+#define ZORRO_PROD_EDOTRONIK_IEEE_488 ZORRO_ID(EDOTRONIK, 0x01, 0)
+#define ZORRO_PROD_EDOTRONIK_8032 ZORRO_ID(EDOTRONIK, 0x02, 0)
+#define ZORRO_PROD_EDOTRONIK_MULTISERIAL ZORRO_ID(EDOTRONIK, 0x03, 0)
+#define ZORRO_PROD_EDOTRONIK_VIDEODIGITIZER ZORRO_ID(EDOTRONIK, 0x04, 0)
+#define ZORRO_PROD_EDOTRONIK_PARALLEL_IO ZORRO_ID(EDOTRONIK, 0x05, 0)
+#define ZORRO_PROD_EDOTRONIK_PIC_PROTOYPING ZORRO_ID(EDOTRONIK, 0x06, 0)
+#define ZORRO_PROD_EDOTRONIK_ADC ZORRO_ID(EDOTRONIK, 0x07, 0)
+#define ZORRO_PROD_EDOTRONIK_VME ZORRO_ID(EDOTRONIK, 0x08, 0)
+#define ZORRO_PROD_EDOTRONIK_DSP96000 ZORRO_ID(EDOTRONIK, 0x09, 0)
+
+#define ZORRO_MANUF_NES_INC 0x0813
+#define ZORRO_PROD_NES_INC_RAM ZORRO_ID(NES_INC, 0x00, 0)
+
+#define ZORRO_MANUF_ICD 0x0817
+#define ZORRO_PROD_ICD_ADVANTAGE_2000_SCSI ZORRO_ID(ICD, 0x01, 0)
+#define ZORRO_PROD_ICD_ADVANTAGE_IDE ZORRO_ID(ICD, 0x03, 0)
+#define ZORRO_PROD_ICD_ADVANTAGE_2080_RAM ZORRO_ID(ICD, 0x04, 0)
+
+#define ZORRO_MANUF_KUPKE_2 0x0819
+#define ZORRO_PROD_KUPKE_OMTI ZORRO_ID(KUPKE_2, 0x01, 0)
+#define ZORRO_PROD_KUPKE_SCSI_II ZORRO_ID(KUPKE_2, 0x02, 0)
+#define ZORRO_PROD_KUPKE_GOLEM_BOX ZORRO_ID(KUPKE_2, 0x03, 0)
+#define ZORRO_PROD_KUPKE_030_882 ZORRO_ID(KUPKE_2, 0x04, 0)
+#define ZORRO_PROD_KUPKE_SCSI_AT ZORRO_ID(KUPKE_2, 0x05, 0)
+
+#define ZORRO_MANUF_GREAT_VALLEY_PRODUCTS_3 0x081D
+#define ZORRO_PROD_GVP_A2000_RAM8 ZORRO_ID(GREAT_VALLEY_PRODUCTS_3, 0x09, 0)
+#define ZORRO_PROD_GVP_IMPACT_SERIES_II_RAM_2 ZORRO_ID(GREAT_VALLEY_PRODUCTS_3, 0x0A, 0)
+
+#define ZORRO_MANUF_INTERWORKS_NETWORK 0x081E
+
+#define ZORRO_MANUF_HARDITAL_SYNTHESIS 0x0820
+#define ZORRO_PROD_HARDITAL_SYNTHESIS_TQM_68030_68882 ZORRO_ID(HARDITAL_SYNTHESIS, 0x14, 0)
+
+#define ZORRO_MANUF_APPLIED_ENGINEERING 0x0828
+#define ZORRO_PROD_APPLIED_ENGINEERING_DL2000 ZORRO_ID(APPLIED_ENGINEERING, 0x10, 0)
+#define ZORRO_PROD_APPLIED_ENGINEERING_RAM_WORKS ZORRO_ID(APPLIED_ENGINEERING, 0xE0, 0)
+
+#define ZORRO_MANUF_BSC_ALFADATA_3 0x082C
+#define ZORRO_PROD_BSC_OKTAGON_2008 ZORRO_ID(BSC_ALFADATA_3, 0x05, 0)
+#define ZORRO_PROD_BSC_TANDEM_AT_2008_508 ZORRO_ID(BSC_ALFADATA_3, 0x06, 0)
+#define ZORRO_PROD_BSC_ALFA_RAM_1200 ZORRO_ID(BSC_ALFADATA_3, 0x07, 0)
+#define ZORRO_PROD_BSC_OKTAGON_2008_RAM ZORRO_ID(BSC_ALFADATA_3, 0x08, 0)
+#define ZORRO_PROD_BSC_MULTIFACE_I ZORRO_ID(BSC_ALFADATA_3, 0x10, 0)
+#define ZORRO_PROD_BSC_MULTIFACE_II ZORRO_ID(BSC_ALFADATA_3, 0x11, 0)
+#define ZORRO_PROD_BSC_MULTIFACE_III ZORRO_ID(BSC_ALFADATA_3, 0x12, 0)
+#define ZORRO_PROD_BSC_FRAMEMASTER_II ZORRO_ID(BSC_ALFADATA_3, 0x20, 0)
+#define ZORRO_PROD_BSC_GRAFFITI_RAM ZORRO_ID(BSC_ALFADATA_3, 0x21, 0)
+#define ZORRO_PROD_BSC_GRAFFITI_REG ZORRO_ID(BSC_ALFADATA_3, 0x22, 0)
+#define ZORRO_PROD_BSC_ISDN_MASTERCARD ZORRO_ID(BSC_ALFADATA_3, 0x40, 0)
+#define ZORRO_PROD_BSC_ISDN_MASTERCARD_II ZORRO_ID(BSC_ALFADATA_3, 0x41, 0)
+
+#define ZORRO_MANUF_PHOENIX 0x0835
+#define ZORRO_PROD_PHOENIX_ST506 ZORRO_ID(PHOENIX, 0x21, 0)
+#define ZORRO_PROD_PHOENIX_SCSI ZORRO_ID(PHOENIX, 0x22, 0)
+#define ZORRO_PROD_PHOENIX_RAM ZORRO_ID(PHOENIX, 0xBE, 0)
+
+#define ZORRO_MANUF_ADVANCED_STORAGE_SYSTEMS 0x0836
+#define ZORRO_PROD_ADVANCED_STORAGE_SYSTEMS_NEXUS ZORRO_ID(ADVANCED_STORAGE_SYSTEMS, 0x01, 0)
+#define ZORRO_PROD_ADVANCED_STORAGE_SYSTEMS_NEXUS_RAM ZORRO_ID(ADVANCED_STORAGE_SYSTEMS, 0x08, 0)
+
+#define ZORRO_MANUF_IMPULSE 0x0838
+#define ZORRO_PROD_IMPULSE_FIRECRACKER_24 ZORRO_ID(IMPULSE, 0x00, 0)
+
+#define ZORRO_MANUF_IVS 0x0840
+#define ZORRO_PROD_IVS_GRANDSLAM_PIC_2 ZORRO_ID(IVS, 0x02, 0)
+#define ZORRO_PROD_IVS_GRANDSLAM_PIC_1 ZORRO_ID(IVS, 0x04, 0)
+#define ZORRO_PROD_IVS_OVERDRIVE ZORRO_ID(IVS, 0x10, 0)
+#define ZORRO_PROD_IVS_TRUMPCARD_CLASSIC ZORRO_ID(IVS, 0x30, 0)
+#define ZORRO_PROD_IVS_TRUMPCARD_PRO_GRANDSLAM ZORRO_ID(IVS, 0x34, 0)
+#define ZORRO_PROD_IVS_META_4 ZORRO_ID(IVS, 0x40, 0)
+#define ZORRO_PROD_IVS_WAVETOOLS ZORRO_ID(IVS, 0xBF, 0)
+#define ZORRO_PROD_IVS_VECTOR_1 ZORRO_ID(IVS, 0xF3, 0)
+#define ZORRO_PROD_IVS_VECTOR_2 ZORRO_ID(IVS, 0xF4, 0)
+
+#define ZORRO_MANUF_VECTOR_1 0x0841
+#define ZORRO_PROD_VECTOR_CONNECTION_1 ZORRO_ID(VECTOR_1, 0xE3, 0)
+
+#define ZORRO_MANUF_XPERT_PRODEV 0x0845
+#define ZORRO_PROD_XPERT_PRODEV_VISIONA_RAM ZORRO_ID(XPERT_PRODEV, 0x01, 0)
+#define ZORRO_PROD_XPERT_PRODEV_VISIONA_REG ZORRO_ID(XPERT_PRODEV, 0x02, 0)
+#define ZORRO_PROD_XPERT_PRODEV_MERLIN_RAM ZORRO_ID(XPERT_PRODEV, 0x03, 0)
+#define ZORRO_PROD_XPERT_PRODEV_MERLIN_REG_1 ZORRO_ID(XPERT_PRODEV, 0x04, 0)
+#define ZORRO_PROD_XPERT_PRODEV_MERLIN_REG_2 ZORRO_ID(XPERT_PRODEV, 0xC9, 0)
+
+#define ZORRO_MANUF_HYDRA_SYSTEMS 0x0849
+#define ZORRO_PROD_HYDRA_SYSTEMS_AMIGANET ZORRO_ID(HYDRA_SYSTEMS, 0x01, 0)
+
+#define ZORRO_MANUF_SUNRIZE_INDUSTRIES 0x084F
+#define ZORRO_PROD_SUNRIZE_INDUSTRIES_AD1012 ZORRO_ID(SUNRIZE_INDUSTRIES, 0x01, 0)
+#define ZORRO_PROD_SUNRIZE_INDUSTRIES_AD516 ZORRO_ID(SUNRIZE_INDUSTRIES, 0x02, 0)
+#define ZORRO_PROD_SUNRIZE_INDUSTRIES_DD512 ZORRO_ID(SUNRIZE_INDUSTRIES, 0x03, 0)
+
+#define ZORRO_MANUF_TRICERATOPS 0x0850
+#define ZORRO_PROD_TRICERATOPS_MULTI_IO ZORRO_ID(TRICERATOPS, 0x01, 0)
+
+#define ZORRO_MANUF_APPLIED_MAGIC 0x0851
+#define ZORRO_PROD_APPLIED_MAGIC_DMI_RESOLVER ZORRO_ID(APPLIED_MAGIC, 0x01, 0)
+#define ZORRO_PROD_APPLIED_MAGIC_DIGITAL_BROADCASTER ZORRO_ID(APPLIED_MAGIC, 0x06, 0)
+
+#define ZORRO_MANUF_GFX_BASE 0x085E
+#define ZORRO_PROD_GFX_BASE_GDA_1_VRAM ZORRO_ID(GFX_BASE, 0x00, 0)
+#define ZORRO_PROD_GFX_BASE_GDA_1 ZORRO_ID(GFX_BASE, 0x01, 0)
+
+#define ZORRO_MANUF_ROCTEC 0x0860
+#define ZORRO_PROD_ROCTEC_RH_800C ZORRO_ID(ROCTEC, 0x01, 0)
+#define ZORRO_PROD_ROCTEC_RH_800C_RAM ZORRO_ID(ROCTEC, 0x01, 0)
+
+#define ZORRO_MANUF_KATO 0x0861
+#define ZORRO_PROD_KATO_MELODY ZORRO_ID(KATO, 0x80, 0)
+
+#define ZORRO_MANUF_HELFRICH_1 0x0861
+#define ZORRO_PROD_HELFRICH_RAINBOW_II ZORRO_ID(HELFRICH_1, 0x20, 0)
+#define ZORRO_PROD_HELFRICH_RAINBOW_III ZORRO_ID(HELFRICH_1, 0x21, 0)
+
+#define ZORRO_MANUF_ATLANTIS 0x0862
+
+#define ZORRO_MANUF_PROTAR 0x0864
+
+#define ZORRO_MANUF_ACS 0x0865
+
+#define ZORRO_MANUF_SOFTWARE_RESULTS_ENTERPRISES 0x0866
+#define ZORRO_PROD_SOFTWARE_RESULTS_ENTERPRISES_GOLDEN_GATE_2_BUS_PLUS ZORRO_ID(SOFTWARE_RESULTS_ENTERPRISES, 0x01, 0)
+
+#define ZORRO_MANUF_MASOBOSHI 0x086D
+#define ZORRO_PROD_MASOBOSHI_MASTER_CARD_SC201 ZORRO_ID(MASOBOSHI, 0x03, 0)
+#define ZORRO_PROD_MASOBOSHI_MASTER_CARD_MC702 ZORRO_ID(MASOBOSHI, 0x04, 0)
+#define ZORRO_PROD_MASOBOSHI_MVD_819 ZORRO_ID(MASOBOSHI, 0x07, 0)
+
+#define ZORRO_MANUF_MAINHATTAN_DATA 0x086F
+#define ZORRO_PROD_MAINHATTAN_DATA_IDE ZORRO_ID(MAINHATTAN_DATA, 0x01, 0)
+
+#define ZORRO_MANUF_VILLAGE_TRONIC 0x0877
+#define ZORRO_PROD_VILLAGE_TRONIC_DOMINO_RAM ZORRO_ID(VILLAGE_TRONIC, 0x01, 0)
+#define ZORRO_PROD_VILLAGE_TRONIC_DOMINO_REG ZORRO_ID(VILLAGE_TRONIC, 0x02, 0)
+#define ZORRO_PROD_VILLAGE_TRONIC_DOMINO_16M_PROTOTYPE ZORRO_ID(VILLAGE_TRONIC, 0x03, 0)
+#define ZORRO_PROD_VILLAGE_TRONIC_PICASSO_II_II_PLUS_RAM ZORRO_ID(VILLAGE_TRONIC, 0x0B, 0)
+#define ZORRO_PROD_VILLAGE_TRONIC_PICASSO_II_II_PLUS_REG ZORRO_ID(VILLAGE_TRONIC, 0x0C, 0)
+#define ZORRO_PROD_VILLAGE_TRONIC_PICASSO_II_II_PLUS_SEGMENTED_MODE ZORRO_ID(VILLAGE_TRONIC, 0x0D, 0)
+#define ZORRO_PROD_VILLAGE_TRONIC_PICASSO_IV_Z2_MEM1 ZORRO_ID(VILLAGE_TRONIC, 0x15, 0)
+#define ZORRO_PROD_VILLAGE_TRONIC_PICASSO_IV_Z2_MEM2 ZORRO_ID(VILLAGE_TRONIC, 0x16, 0)
+#define ZORRO_PROD_VILLAGE_TRONIC_PICASSO_IV_Z2_REG ZORRO_ID(VILLAGE_TRONIC, 0x17, 0)
+#define ZORRO_PROD_VILLAGE_TRONIC_PICASSO_IV_Z3 ZORRO_ID(VILLAGE_TRONIC, 0x18, 0)
+#define ZORRO_PROD_VILLAGE_TRONIC_ARIADNE ZORRO_ID(VILLAGE_TRONIC, 0xC9, 0)
+#define ZORRO_PROD_VILLAGE_TRONIC_ARIADNE2 ZORRO_ID(VILLAGE_TRONIC, 0xCA, 0)
+
+#define ZORRO_MANUF_UTILITIES_UNLIMITED 0x087B
+#define ZORRO_PROD_UTILITIES_UNLIMITED_EMPLANT_DELUXE ZORRO_ID(UTILITIES_UNLIMITED, 0x15, 0)
+#define ZORRO_PROD_UTILITIES_UNLIMITED_EMPLANT_DELUXE2 ZORRO_ID(UTILITIES_UNLIMITED, 0x20, 0)
+
+#define ZORRO_MANUF_AMITRIX 0x0880
+#define ZORRO_PROD_AMITRIX_MULTI_IO ZORRO_ID(AMITRIX, 0x01, 0)
+#define ZORRO_PROD_AMITRIX_CD_RAM ZORRO_ID(AMITRIX, 0x02, 0)
+
+#define ZORRO_MANUF_ARMAX 0x0885
+#define ZORRO_PROD_ARMAX_OMNIBUS ZORRO_ID(ARMAX, 0x00, 0)
+
+#define ZORRO_MANUF_ZEUS 0x088D
+#define ZORRO_PROD_ZEUS_SPIDER ZORRO_ID(ZEUS, 0x04, 0)
+
+#define ZORRO_MANUF_NEWTEK 0x088F
+#define ZORRO_PROD_NEWTEK_VIDEOTOASTER ZORRO_ID(NEWTEK, 0x00, 0)
+
+#define ZORRO_MANUF_M_TECH_GERMANY 0x0890
+#define ZORRO_PROD_MTEC_AT500_2 ZORRO_ID(M_TECH_GERMANY, 0x01, 0)
+#define ZORRO_PROD_MTEC_68030 ZORRO_ID(M_TECH_GERMANY, 0x03, 0)
+#define ZORRO_PROD_MTEC_68020I ZORRO_ID(M_TECH_GERMANY, 0x06, 0)
+#define ZORRO_PROD_MTEC_A1200_T68030_RTC ZORRO_ID(M_TECH_GERMANY, 0x20, 0)
+#define ZORRO_PROD_MTEC_VIPER_MK_V_E_MATRIX_530 ZORRO_ID(M_TECH_GERMANY, 0x21, 0)
+#define ZORRO_PROD_MTEC_8_MB_RAM ZORRO_ID(M_TECH_GERMANY, 0x22, 0)
+#define ZORRO_PROD_MTEC_VIPER_MK_V_E_MATRIX_530_SCSI_IDE ZORRO_ID(M_TECH_GERMANY, 0x24, 0)
+
+#define ZORRO_MANUF_GREAT_VALLEY_PRODUCTS_4 0x0891
+#define ZORRO_PROD_GVP_EGS_28_24_SPECTRUM_RAM ZORRO_ID(GREAT_VALLEY_PRODUCTS_4, 0x01, 0)
+#define ZORRO_PROD_GVP_EGS_28_24_SPECTRUM_REG ZORRO_ID(GREAT_VALLEY_PRODUCTS_4, 0x02, 0)
+
+#define ZORRO_MANUF_APOLLO_1 0x0892
+#define ZORRO_PROD_APOLLO_A1200 ZORRO_ID(APOLLO_1, 0x01, 0)
+
+#define ZORRO_MANUF_HELFRICH_2 0x0893
+#define ZORRO_PROD_HELFRICH_PICCOLO_RAM ZORRO_ID(HELFRICH_2, 0x05, 0)
+#define ZORRO_PROD_HELFRICH_PICCOLO_REG ZORRO_ID(HELFRICH_2, 0x06, 0)
+#define ZORRO_PROD_HELFRICH_PEGGY_PLUS_MPEG ZORRO_ID(HELFRICH_2, 0x07, 0)
+#define ZORRO_PROD_HELFRICH_VIDEOCRUNCHER ZORRO_ID(HELFRICH_2, 0x08, 0)
+#define ZORRO_PROD_HELFRICH_SD64_RAM ZORRO_ID(HELFRICH_2, 0x0A, 0)
+#define ZORRO_PROD_HELFRICH_SD64_REG ZORRO_ID(HELFRICH_2, 0x0B, 0)
+
+#define ZORRO_MANUF_MACROSYSTEMS_USA 0x089B
+#define ZORRO_PROD_MACROSYSTEMS_WARP_ENGINE_40xx ZORRO_ID(MACROSYSTEMS_USA, 0x13, 0)
+
+#define ZORRO_MANUF_ELBOX_COMPUTER 0x089E
+#define ZORRO_PROD_ELBOX_COMPUTER_1200_4 ZORRO_ID(ELBOX_COMPUTER, 0x06, 0)
+
+#define ZORRO_MANUF_HARMS_PROFESSIONAL 0x0A00
+#define ZORRO_PROD_HARMS_PROFESSIONAL_030_PLUS ZORRO_ID(HARMS_PROFESSIONAL, 0x10, 0)
+#define ZORRO_PROD_HARMS_PROFESSIONAL_3500 ZORRO_ID(HARMS_PROFESSIONAL, 0xD0, 0)
+
+#define ZORRO_MANUF_MICRONIK 0x0A50
+#define ZORRO_PROD_MICRONIK_RCA_120 ZORRO_ID(MICRONIK, 0x0A, 0)
+
+#define ZORRO_MANUF_MICRONIK2 0x0F0F
+#define ZORRO_PROD_MICRONIK2_Z3I ZORRO_ID(MICRONIK2, 0x01, 0)
+
+#define ZORRO_MANUF_MEGAMICRO 0x1000
+#define ZORRO_PROD_MEGAMICRO_SCRAM_500 ZORRO_ID(MEGAMICRO, 0x03, 0)
+#define ZORRO_PROD_MEGAMICRO_SCRAM_500_RAM ZORRO_ID(MEGAMICRO, 0x04, 0)
+
+#define ZORRO_MANUF_IMTRONICS_2 0x1028
+#define ZORRO_PROD_IMTRONICS_HURRICANE_2800_3 ZORRO_ID(IMTRONICS_2, 0x39, 0)
+#define ZORRO_PROD_IMTRONICS_HURRICANE_2800_4 ZORRO_ID(IMTRONICS_2, 0x57, 0)
+
+#define ZORRO_MANUF_INDIVIDUAL_COMPUTERS 0x1212
+#define ZORRO_PROD_INDIVIDUAL_COMPUTERS_BUDDHA ZORRO_ID(INDIVIDUAL_COMPUTERS, 0x00, 0)
+#define ZORRO_PROD_INDIVIDUAL_COMPUTERS_X_SURF ZORRO_ID(INDIVIDUAL_COMPUTERS, 0x17, 0)
+#define ZORRO_PROD_INDIVIDUAL_COMPUTERS_CATWEASEL ZORRO_ID(INDIVIDUAL_COMPUTERS, 0x2A, 0)
+
+#define ZORRO_MANUF_KUPKE_3 0x1248
+#define ZORRO_PROD_KUPKE_GOLEM_HD_3000 ZORRO_ID(KUPKE_3, 0x01, 0)
+
+#define ZORRO_MANUF_ITH 0x1388
+#define ZORRO_PROD_ITH_ISDN_MASTER_II ZORRO_ID(ITH, 0x01, 0)
+
+#define ZORRO_MANUF_VMC 0x1389
+#define ZORRO_PROD_VMC_ISDN_BLASTER_Z2 ZORRO_ID(VMC, 0x01, 0)
+#define ZORRO_PROD_VMC_HYPERCOM_4 ZORRO_ID(VMC, 0x02, 0)
+
+#define ZORRO_MANUF_INFORMATION 0x157C
+#define ZORRO_PROD_INFORMATION_ISDN_ENGINE_I ZORRO_ID(INFORMATION, 0x64, 0)
+
+#define ZORRO_MANUF_VORTEX 0x2017
+#define ZORRO_PROD_VORTEX_GOLDEN_GATE_80386SX ZORRO_ID(VORTEX, 0x07, 0)
+#define ZORRO_PROD_VORTEX_GOLDEN_GATE_RAM ZORRO_ID(VORTEX, 0x08, 0)
+#define ZORRO_PROD_VORTEX_GOLDEN_GATE_80486 ZORRO_ID(VORTEX, 0x09, 0)
+
+#define ZORRO_MANUF_EXPANSION_SYSTEMS 0x2062
+#define ZORRO_PROD_EXPANSION_SYSTEMS_DATAFLYER_4000SX ZORRO_ID(EXPANSION_SYSTEMS, 0x01, 0)
+#define ZORRO_PROD_EXPANSION_SYSTEMS_DATAFLYER_4000SX_RAM ZORRO_ID(EXPANSION_SYSTEMS, 0x02, 0)
+
+#define ZORRO_MANUF_READYSOFT 0x2100
+#define ZORRO_PROD_READYSOFT_AMAX_II_IV ZORRO_ID(READYSOFT, 0x01, 0)
+
+#define ZORRO_MANUF_PHASE5 0x2140
+#define ZORRO_PROD_PHASE5_BLIZZARD_RAM ZORRO_ID(PHASE5, 0x01, 0)
+#define ZORRO_PROD_PHASE5_BLIZZARD ZORRO_ID(PHASE5, 0x02, 0)
+#define ZORRO_PROD_PHASE5_BLIZZARD_1220_IV ZORRO_ID(PHASE5, 0x06, 0)
+#define ZORRO_PROD_PHASE5_FASTLANE_Z3_RAM ZORRO_ID(PHASE5, 0x0A, 0)
+#define ZORRO_PROD_PHASE5_BLIZZARD_1230_II_FASTLANE_Z3_CYBERSCSI_CYBERSTORM060 ZORRO_ID(PHASE5, 0x0B, 0)
+#define ZORRO_PROD_PHASE5_BLIZZARD_1220_CYBERSTORM ZORRO_ID(PHASE5, 0x0C, 0)
+#define ZORRO_PROD_PHASE5_BLIZZARD_1230 ZORRO_ID(PHASE5, 0x0D, 0)
+#define ZORRO_PROD_PHASE5_BLIZZARD_1230_IV_1260 ZORRO_ID(PHASE5, 0x11, 0)
+#define ZORRO_PROD_PHASE5_BLIZZARD_2060 ZORRO_ID(PHASE5, 0x18, 0)
+#define ZORRO_PROD_PHASE5_CYBERSTORM_MK_II ZORRO_ID(PHASE5, 0x19, 0)
+#define ZORRO_PROD_PHASE5_CYBERVISION64 ZORRO_ID(PHASE5, 0x22, 0)
+#define ZORRO_PROD_PHASE5_CYBERVISION64_3D_PROTOTYPE ZORRO_ID(PHASE5, 0x32, 0)
+#define ZORRO_PROD_PHASE5_CYBERVISION64_3D ZORRO_ID(PHASE5, 0x43, 0)
+#define ZORRO_PROD_PHASE5_CYBERSTORM_MK_III ZORRO_ID(PHASE5, 0x64, 0)
+#define ZORRO_PROD_PHASE5_BLIZZARD_603E_PLUS ZORRO_ID(PHASE5, 0x6e, 0)
+
+#define ZORRO_MANUF_DPS 0x2169
+#define ZORRO_PROD_DPS_PERSONAL_ANIMATION_RECORDER ZORRO_ID(DPS, 0x01, 0)
+
+#define ZORRO_MANUF_APOLLO_2 0x2200
+#define ZORRO_PROD_APOLLO_A620_68020_1 ZORRO_ID(APOLLO_2, 0x00, 0)
+#define ZORRO_PROD_APOLLO_A620_68020_2 ZORRO_ID(APOLLO_2, 0x01, 0)
+
+#define ZORRO_MANUF_APOLLO_3 0x2222
+#define ZORRO_PROD_APOLLO_AT_APOLLO ZORRO_ID(APOLLO_3, 0x22, 0)
+#define ZORRO_PROD_APOLLO_1230_1240_1260_2030_4040_4060 ZORRO_ID(APOLLO_3, 0x23, 0)
+
+#define ZORRO_MANUF_PETSOFF_LP 0x38A5
+#define ZORRO_PROD_PETSOFF_LP_DELFINA ZORRO_ID(PETSOFF_LP, 0x00, 0)
+#define ZORRO_PROD_PETSOFF_LP_DELFINA_LITE ZORRO_ID(PETSOFF_LP, 0x01, 0)
+
+#define ZORRO_MANUF_UWE_GERLACH 0x3FF7
+#define ZORRO_PROD_UWE_GERLACH_RAM_ROM ZORRO_ID(UWE_GERLACH, 0xd4, 0)
+
+#define ZORRO_MANUF_ACT 0x4231
+#define ZORRO_PROD_ACT_PRELUDE ZORRO_ID(ACT, 0x01, 0)
+
+#define ZORRO_MANUF_MACROSYSTEMS_GERMANY 0x4754
+#define ZORRO_PROD_MACROSYSTEMS_MAESTRO ZORRO_ID(MACROSYSTEMS_GERMANY, 0x03, 0)
+#define ZORRO_PROD_MACROSYSTEMS_VLAB ZORRO_ID(MACROSYSTEMS_GERMANY, 0x04, 0)
+#define ZORRO_PROD_MACROSYSTEMS_MAESTRO_PRO ZORRO_ID(MACROSYSTEMS_GERMANY, 0x05, 0)
+#define ZORRO_PROD_MACROSYSTEMS_RETINA ZORRO_ID(MACROSYSTEMS_GERMANY, 0x06, 0)
+#define ZORRO_PROD_MACROSYSTEMS_MULTI_EVOLUTION ZORRO_ID(MACROSYSTEMS_GERMANY, 0x08, 0)
+#define ZORRO_PROD_MACROSYSTEMS_TOCCATA ZORRO_ID(MACROSYSTEMS_GERMANY, 0x0C, 0)
+#define ZORRO_PROD_MACROSYSTEMS_RETINA_Z3 ZORRO_ID(MACROSYSTEMS_GERMANY, 0x10, 0)
+#define ZORRO_PROD_MACROSYSTEMS_VLAB_MOTION ZORRO_ID(MACROSYSTEMS_GERMANY, 0x12, 0)
+#define ZORRO_PROD_MACROSYSTEMS_ALTAIS ZORRO_ID(MACROSYSTEMS_GERMANY, 0x13, 0)
+#define ZORRO_PROD_MACROSYSTEMS_FALCON_040 ZORRO_ID(MACROSYSTEMS_GERMANY, 0xFD, 0)
+
+#define ZORRO_MANUF_COMBITEC 0x6766
+
+#define ZORRO_MANUF_SKI_PERIPHERALS 0x8000
+#define ZORRO_PROD_SKI_PERIPHERALS_MAST_FIREBALL ZORRO_ID(SKI_PERIPHERALS, 0x08, 0)
+#define ZORRO_PROD_SKI_PERIPHERALS_SCSI_DUAL_SERIAL ZORRO_ID(SKI_PERIPHERALS, 0x80, 0)
+
+#define ZORRO_MANUF_REIS_WARE_2 0xA9AD
+#define ZORRO_PROD_REIS_WARE_SCAN_KING ZORRO_ID(REIS_WARE_2, 0x11, 0)
+
+#define ZORRO_MANUF_CAMERON 0xAA01
+#define ZORRO_PROD_CAMERON_PERSONAL_A4 ZORRO_ID(CAMERON, 0x10, 0)
+
+#define ZORRO_MANUF_REIS_WARE 0xAA11
+#define ZORRO_PROD_REIS_WARE_HANDYSCANNER ZORRO_ID(REIS_WARE, 0x11, 0)
+
+#define ZORRO_MANUF_PHOENIX_2 0xB5A8
+#define ZORRO_PROD_PHOENIX_ST506_2 ZORRO_ID(PHOENIX_2, 0x21, 0)
+#define ZORRO_PROD_PHOENIX_SCSI_2 ZORRO_ID(PHOENIX_2, 0x22, 0)
+#define ZORRO_PROD_PHOENIX_RAM_2 ZORRO_ID(PHOENIX_2, 0xBE, 0)
+
+#define ZORRO_MANUF_COMBITEC_2 0xC008
+#define ZORRO_PROD_COMBITEC_HD ZORRO_ID(COMBITEC_2, 0x2A, 0)
+#define ZORRO_PROD_COMBITEC_SRAM ZORRO_ID(COMBITEC_2, 0x2B, 0)
+
+#define ZORRO_MANUF_HACKER 0x07DB
+#define ZORRO_PROD_GENERAL_PROTOTYPE ZORRO_ID(HACKER, 0x00, 0)
+#define ZORRO_PROD_HACKER_SCSI ZORRO_ID(HACKER, 0x01, 0)
+#define ZORRO_PROD_RESOURCE_MANAGEMENT_FORCE_QUICKNET_QN2000 ZORRO_ID(HACKER, 0x02, 0)
+#define ZORRO_PROD_VECTOR_CONNECTION_2 ZORRO_ID(HACKER, 0xE0, 0)
+#define ZORRO_PROD_VECTOR_CONNECTION_3 ZORRO_ID(HACKER, 0xE1, 0)
+#define ZORRO_PROD_VECTOR_CONNECTION_4 ZORRO_ID(HACKER, 0xE2, 0)
+#define ZORRO_PROD_VECTOR_CONNECTION_5 ZORRO_ID(HACKER, 0xE3, 0)
diff --git a/ndk/platforms/android-3/include/locale.h b/ndk/platforms/android-3/include/locale.h
new file mode 100644
index 0000000..4259ddd
--- /dev/null
+++ b/ndk/platforms/android-3/include/locale.h
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _LOCALE_H_
+#define _LOCALE_H_
+
+#include <sys/cdefs.h>
+
+__BEGIN_DECLS
+
+enum {
+    LC_CTYPE     = 0,
+    LC_NUMERIC   = 1,
+    LC_TIME      = 2,
+    LC_COLLATE   = 3,
+    LC_MONETARY  = 4,
+    LC_MESSAGES  = 5,
+    LC_ALL       = 6,
+    LC_PAPER     = 7,
+    LC_NAME      = 8,
+    LC_ADDRESS   = 9,
+
+    LC_TELEPHONE      = 10,
+    LC_MEASUREMENT    = 11,
+    LC_IDENTIFICATION = 12
+};
+
+extern char *setlocale(int category, const char *locale);
+
+#if 1 /* MISSING FROM BIONIC - DEFINED TO MAKE libstdc++-v3 happy */
+struct lconv { };
+struct lconv *localeconv(void);
+#endif /* MISSING */
+
+__END_DECLS
+
+#endif /* _LOCALE_H_ */
diff --git a/ndk/platforms/android-3/include/malloc.h b/ndk/platforms/android-3/include/malloc.h
new file mode 100644
index 0000000..a864286
--- /dev/null
+++ b/ndk/platforms/android-3/include/malloc.h
@@ -0,0 +1,104 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _MALLOC_H_
+#define _MALLOC_H_
+
+#include <sys/cdefs.h>
+#include <stddef.h>
+
+__BEGIN_DECLS
+
+extern __mallocfunc void*  malloc(size_t);
+extern __mallocfunc void*  calloc(size_t, size_t);
+extern __mallocfunc void*  realloc(void *, size_t);
+extern                void   free(void *);
+
+extern void*   memalign(size_t  alignment, size_t  bytesize);
+extern void*   valloc(size_t  bytesize);
+extern void*   pvalloc(size_t  bytesize);
+extern int     mallopt(int  param_number, int  param_value);
+extern size_t  malloc_footprint(void);
+extern size_t  malloc_max_footprint(void);
+
+struct mallinfo {
+    size_t arena;    /* non-mmapped space allocated from system */
+    size_t ordblks;  /* number of free chunks */
+    size_t smblks;   /* always 0 */
+    size_t hblks;    /* always 0 */
+    size_t hblkhd;   /* space in mmapped regions */
+    size_t usmblks;  /* maximum total allocated space */
+    size_t fsmblks;  /* always 0 */
+    size_t uordblks; /* total allocated space */
+    size_t fordblks; /* total free space */
+    size_t keepcost; /* releasable (via malloc_trim) space */
+};
+
+extern struct mallinfo  mallinfo(void);
+
+
+/*
+  malloc_usable_size(void* p);
+
+  Returns the number of bytes you can actually use in
+  an allocated chunk, which may be more than you requested (although
+  often not) due to alignment and minimum size constraints.
+  You can use this many bytes without worrying about
+  overwriting other allocated objects. This is not a particularly great
+  programming practice. malloc_usable_size can be more useful in
+  debugging and assertions, for example:
+
+  p = malloc(n);
+  assert(malloc_usable_size(p) >= 256);
+*/
+extern size_t malloc_usable_size(void*  block);
+
+/*
+  malloc_stats();
+  Prints on stderr the amount of space obtained from the system (both
+  via sbrk and mmap), the maximum amount (which may be more than
+  current if malloc_trim and/or munmap got called), and the current
+  number of bytes allocated via malloc (or realloc, etc) but not yet
+  freed. Note that this is the number of bytes allocated, not the
+  number requested. It will be larger than the number requested
+  because of alignment and bookkeeping overhead. Because it includes
+  alignment wastage as being in use, this figure may be greater than
+  zero even when no user-level chunks are allocated.
+
+  The reported current and maximum system memory can be inaccurate if
+  a program makes other calls to system memory allocation functions
+  (normally sbrk) outside of malloc.
+
+  malloc_stats prints only the most commonly interesting statistics.
+  More information can be obtained by calling mallinfo.
+*/
+extern void  malloc_stats(void);
+
+__END_DECLS
+
+#endif /* _MALLOC_H_ */
+
diff --git a/ndk/platforms/android-3/include/math.h b/ndk/platforms/android-3/include/math.h
new file mode 100644
index 0000000..ef6a9e6
--- /dev/null
+++ b/ndk/platforms/android-3/include/math.h
@@ -0,0 +1,486 @@
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ */
+
+/*
+ * from: @(#)fdlibm.h 5.1 93/09/24
+ * $FreeBSD: src/lib/msun/src/math.h,v 1.61 2005/04/16 21:12:47 das Exp $
+ */
+
+#ifndef _MATH_H_
+#define	_MATH_H_
+
+#include <sys/cdefs.h>
+#include <sys/types.h>
+#include <limits.h>
+
+#define __pure2
+
+/*
+ * ANSI/POSIX
+ */
+extern const union __infinity_un {
+	unsigned char	__uc[8];
+	double		__ud;
+} __infinity;
+
+extern const union __nan_un {
+	unsigned char	__uc[sizeof(float)];
+	float		__uf;
+} __nan;
+
+/* #if __GNUC_PREREQ__(3, 3) || (defined(__INTEL_COMPILER) && __INTEL_COMPILER >= 800) */
+#if 1
+#define	__MATH_BUILTIN_CONSTANTS
+#endif
+
+/* #if __GNUC_PREREQ__(3, 0) && !defined(__INTEL_COMPILER) */
+#if 1
+#define	__MATH_BUILTIN_RELOPS
+#endif
+
+/* #ifdef __MATH_BUILTIN_CONSTANTS */
+#if 1
+#define	HUGE_VAL	__builtin_huge_val()
+#else
+#define	HUGE_VAL	(__infinity.__ud)
+#endif
+
+/* #if __ISO_C_VISIBLE >= 1999 */
+#if 0
+#define	FP_ILOGB0	(-__INT_MAX)
+#define	FP_ILOGBNAN	__INT_MAX
+#else
+#define	FP_ILOGB0	(-INT_MAX)
+#define	FP_ILOGBNAN	INT_MAX
+#endif
+
+#ifdef __MATH_BUILTIN_CONSTANTS
+#define	HUGE_VALF	__builtin_huge_valf()
+#define	HUGE_VALL	__builtin_huge_vall()
+#define	INFINITY	__builtin_inf()
+#define	NAN		__builtin_nan("")
+#else
+#define	HUGE_VALF	(float)HUGE_VAL
+#define	HUGE_VALL	(long double)HUGE_VAL
+#define	INFINITY	HUGE_VALF
+#define	NAN		(__nan.__uf)
+#endif /* __MATH_BUILTIN_CONSTANTS */
+
+#define	MATH_ERRNO	1
+#define	MATH_ERREXCEPT	2
+#define	math_errhandling	MATH_ERREXCEPT
+
+/* XXX We need a <machine/math.h>. */
+#if defined(__ia64__) || defined(__sparc64__)
+#define	FP_FAST_FMA
+#endif
+#ifdef __ia64__
+#define	FP_FAST_FMAL
+#endif
+#define	FP_FAST_FMAF
+
+/* Symbolic constants to classify floating point numbers. */
+#define	FP_INFINITE	0x01
+#define	FP_NAN		0x02
+#define	FP_NORMAL	0x04
+#define	FP_SUBNORMAL	0x08
+#define	FP_ZERO		0x10
+#define	fpclassify(x) \
+    ((sizeof (x) == sizeof (float)) ? __fpclassifyf(x) \
+    : (sizeof (x) == sizeof (double)) ? __fpclassifyd(x) \
+    : __fpclassifyl(x))
+
+#define	isfinite(x)					\
+    ((sizeof (x) == sizeof (float)) ? __isfinitef(x)	\
+    : (sizeof (x) == sizeof (double)) ? __isfinite(x)	\
+    : __isfinitel(x))
+#define	isinf(x)					\
+    ((sizeof (x) == sizeof (float)) ? __isinff(x)	\
+    : (sizeof (x) == sizeof (double)) ? __isinf(x)	\
+    : __isinfl(x))
+#define	isnan(x)					\
+    ((sizeof (x) == sizeof (float)) ? isnanf(x)		\
+    : (sizeof (x) == sizeof (double)) ? isnan(x)	\
+    : __isnanl(x))
+#define	isnormal(x)					\
+    ((sizeof (x) == sizeof (float)) ? __isnormalf(x)	\
+    : (sizeof (x) == sizeof (double)) ? __isnormal(x)	\
+    : __isnormall(x))
+
+#ifdef __MATH_BUILTIN_RELOPS
+#define	isgreater(x, y)		__builtin_isgreater((x), (y))
+#define	isgreaterequal(x, y)	__builtin_isgreaterequal((x), (y))
+#define	isless(x, y)		__builtin_isless((x), (y))
+#define	islessequal(x, y)	__builtin_islessequal((x), (y))
+#define	islessgreater(x, y)	__builtin_islessgreater((x), (y))
+#define	isunordered(x, y)	__builtin_isunordered((x), (y))
+#else
+#define	isgreater(x, y)		(!isunordered((x), (y)) && (x) > (y))
+#define	isgreaterequal(x, y)	(!isunordered((x), (y)) && (x) >= (y))
+#define	isless(x, y)		(!isunordered((x), (y)) && (x) < (y))
+#define	islessequal(x, y)	(!isunordered((x), (y)) && (x) <= (y))
+#define	islessgreater(x, y)	(!isunordered((x), (y)) && \
+					((x) > (y) || (y) > (x)))
+#define	isunordered(x, y)	(isnan(x) || isnan(y))
+#endif /* __MATH_BUILTIN_RELOPS */
+
+#define	signbit(x)					\
+    ((sizeof (x) == sizeof (float)) ? __signbitf(x)	\
+    : (sizeof (x) == sizeof (double)) ? __signbit(x)	\
+    : __signbitl(x))
+
+#if 0
+typedef	__double_t	double_t;
+typedef	__float_t	float_t;
+#endif 
+/* #endif */ /* __ISO_C_VISIBLE >= 1999 */
+
+/*
+ * XOPEN/SVID
+ */
+/* #if __BSD_VISIBLE || __XSI_VISIBLE */
+#define	M_E		2.7182818284590452354	/* e */
+#define	M_LOG2E		1.4426950408889634074	/* log 2e */
+#define	M_LOG10E	0.43429448190325182765	/* log 10e */
+#define	M_LN2		0.69314718055994530942	/* log e2 */
+#define	M_LN10		2.30258509299404568402	/* log e10 */
+#define	M_PI		3.14159265358979323846	/* pi */
+#define	M_PI_2		1.57079632679489661923	/* pi/2 */
+#define	M_PI_4		0.78539816339744830962	/* pi/4 */
+#define	M_1_PI		0.31830988618379067154	/* 1/pi */
+#define	M_2_PI		0.63661977236758134308	/* 2/pi */
+#define	M_2_SQRTPI	1.12837916709551257390	/* 2/sqrt(pi) */
+#define	M_SQRT2		1.41421356237309504880	/* sqrt(2) */
+#define	M_SQRT1_2	0.70710678118654752440	/* 1/sqrt(2) */
+
+#define	MAXFLOAT	((float)3.40282346638528860e+38)
+extern int signgam;
+/* #endif */ /* __BSD_VISIBLE || __XSI_VISIBLE */
+
+#if __BSD_VISIBLE
+#if 0
+/* Old value from 4.4BSD-Lite math.h; this is probably better. */
+#define	HUGE		HUGE_VAL
+#else
+#define	HUGE		MAXFLOAT
+#endif
+#endif /* __BSD_VISIBLE */
+
+/*
+ * Most of these functions depend on the rounding mode and have the side
+ * effect of raising floating-point exceptions, so they are not declared
+ * as __pure2.  In C99, FENV_ACCESS affects the purity of these functions.
+ */
+__BEGIN_DECLS
+/*
+ * ANSI/POSIX
+ */
+int	__fpclassifyd(double) __pure2;
+int	__fpclassifyf(float) __pure2;
+int	__fpclassifyl(long double) __pure2;
+int	__isfinitef(float) __pure2;
+int	__isfinite(double) __pure2;
+int	__isfinitel(long double) __pure2;
+int	__isinff(float) __pure2;
+int     __isinf(double) __pure2;
+int	__isinfl(long double) __pure2;
+int	__isnanl(long double) __pure2;
+int	__isnormalf(float) __pure2;
+int	__isnormal(double) __pure2;
+int	__isnormall(long double) __pure2;
+int	__signbit(double) __pure2;
+int	__signbitf(float) __pure2;
+int	__signbitl(long double) __pure2;
+
+double	acos(double);
+double	asin(double);
+double	atan(double);
+double	atan2(double, double);
+double	cos(double);
+double	sin(double);
+double	tan(double);
+
+double	cosh(double);
+double	sinh(double);
+double	tanh(double);
+
+double	exp(double);
+double	frexp(double, int *);	/* fundamentally !__pure2 */
+double	ldexp(double, int);
+double	log(double);
+double	log10(double);
+double	modf(double, double *);	/* fundamentally !__pure2 */
+
+double	pow(double, double);
+double	sqrt(double);
+
+double	ceil(double);
+double	fabs(double) __pure2;
+double	floor(double);
+double	fmod(double, double);
+
+/*
+ * These functions are not in C90.
+ */
+/* #if __BSD_VISIBLE || __ISO_C_VISIBLE >= 1999 || __XSI_VISIBLE */
+double	acosh(double);
+double	asinh(double);
+double	atanh(double);
+double	cbrt(double);
+double	erf(double);
+double	erfc(double);
+double	exp2(double);
+double	expm1(double);
+double	fma(double, double, double);
+double	hypot(double, double);
+int	ilogb(double) __pure2;
+/* int	(isinf)(double) __pure2; */
+int	(isnan)(double) __pure2;
+double	lgamma(double);
+long long llrint(double);
+long long llround(double);
+double	log1p(double);
+double	logb(double);
+long	lrint(double);
+long	lround(double);
+double	nextafter(double, double);
+double	remainder(double, double);
+double	remquo(double, double, int *);
+double	rint(double);
+/* #endif */ /* __BSD_VISIBLE || __ISO_C_VISIBLE >= 1999 || __XSI_VISIBLE */
+
+/* #if __BSD_VISIBLE || __XSI_VISIBLE */
+double	j0(double);
+double	j1(double);
+double	jn(int, double);
+double	scalb(double, double);
+double	y0(double);
+double	y1(double);
+double	yn(int, double);
+
+/* #if __XSI_VISIBLE <= 500 || __BSD_VISIBLE */
+double	gamma(double);
+/* #endif */
+/* #endif */ /* __BSD_VISIBLE || __XSI_VISIBLE */
+
+/* #if __BSD_VISIBLE || __ISO_C_VISIBLE >= 1999 */
+double	copysign(double, double) __pure2;
+double	fdim(double, double);
+double	fmax(double, double) __pure2;
+double	fmin(double, double) __pure2;
+double	nearbyint(double);
+double	round(double);
+double	scalbln(double, long);
+double	scalbn(double, int);
+double	tgamma(double);
+double	trunc(double);
+/* #endif */
+
+/*
+ * BSD math library entry points
+ */
+/* #if __BSD_VISIBLE */
+double	drem(double, double);
+int	finite(double) __pure2;
+int	isnanf(float) __pure2;
+
+/*
+ * Reentrant version of gamma & lgamma; passes signgam back by reference
+ * as the second argument; user must allocate space for signgam.
+ */
+double	gamma_r(double, int *);
+double	lgamma_r(double, int *);
+
+/*
+ * IEEE Test Vector
+ */
+double	significand(double);
+/* #endif */ /* __BSD_VISIBLE */
+
+/* float versions of ANSI/POSIX functions */
+/*#if __ISO_C_VISIBLE >= 1999 */
+float	acosf(float);
+float	asinf(float);
+float	atanf(float);
+float	atan2f(float, float);
+float	cosf(float);
+float	sinf(float);
+float	tanf(float);
+
+float	coshf(float);
+float	sinhf(float);
+float	tanhf(float);
+
+float	exp2f(float);
+float	expf(float);
+float	expm1f(float);
+float	frexpf(float, int *);	/* fundamentally !__pure2 */
+int	ilogbf(float) __pure2;
+float	ldexpf(float, int);
+float	log10f(float);
+float	log1pf(float);
+float	logf(float);
+float	modff(float, float *);	/* fundamentally !__pure2 */
+
+float	powf(float, float);
+float	sqrtf(float);
+
+float	ceilf(float);
+float	fabsf(float) __pure2;
+float	floorf(float);
+float	fmodf(float, float);
+float	roundf(float);
+
+float	erff(float);
+float	erfcf(float);
+float	hypotf(float, float);
+float	lgammaf(float);
+
+float	acoshf(float);
+float	asinhf(float);
+float	atanhf(float);
+float	cbrtf(float);
+float	logbf(float);
+float	copysignf(float, float) __pure2;
+long long llrintf(float);
+long long llroundf(float);
+long	lrintf(float);
+long	lroundf(float);
+float	nearbyintf(float);
+float	nextafterf(float, float);
+float	remainderf(float, float);
+float	remquof(float, float, int *);
+float	rintf(float);
+float	scalblnf(float, long);
+float	scalbnf(float, int);
+float	truncf(float);
+
+float	fdimf(float, float);
+float	fmaf(float, float, float);
+float	fmaxf(float, float) __pure2;
+float	fminf(float, float) __pure2;
+/* #endif */
+
+/*
+ * float versions of BSD math library entry points
+ */
+/* #if __BSD_VISIBLE */
+float	dremf(float, float);
+int	finitef(float) __pure2;
+float	gammaf(float);
+float	j0f(float);
+float	j1f(float);
+float	jnf(int, float);
+float	scalbf(float, float);
+float	y0f(float);
+float	y1f(float);
+float	ynf(int, float);
+
+/*
+ * Float versions of reentrant version of gamma & lgamma; passes
+ * signgam back by reference as the second argument; user must
+ * allocate space for signgam.
+ */
+float	gammaf_r(float, int *);
+float	lgammaf_r(float, int *);
+
+/*
+ * float version of IEEE Test Vector
+ */
+float	significandf(float);
+/* #endif */	/* __BSD_VISIBLE */ 
+
+/*
+ * long double versions of ISO/POSIX math functions
+ */
+/* #if __ISO_C_VISIBLE >= 1999 */
+#if 0
+long double	acoshl(long double);
+long double	acosl(long double);
+long double	asinhl(long double);
+long double	asinl(long double);
+long double	atan2l(long double, long double);
+long double	atanhl(long double);
+long double	atanl(long double);
+long double	cbrtl(long double);
+#endif
+long double	ceill(long double);
+long double	copysignl(long double, long double) __pure2;
+#if 0
+long double	coshl(long double);
+long double	cosl(long double);
+long double	erfcl(long double);
+long double	erfl(long double);
+long double	exp2l(long double);
+long double	expl(long double);
+long double	expm1l(long double);
+#endif
+long double	fabsl(long double) __pure2;
+long double	fdiml(long double, long double);
+long double	floorl(long double);
+long double	fmal(long double, long double, long double);
+long double	fmaxl(long double, long double) __pure2;
+long double	fminl(long double, long double) __pure2;
+#if 0
+long double	fmodl(long double, long double);
+#endif
+long double	frexpl(long double value, int *); /* fundamentally !__pure2 */
+#if 0
+long double	hypotl(long double, long double);
+#endif
+int		ilogbl(long double) __pure2;
+long double	ldexpl(long double, int);
+#if 0
+long double	lgammal(long double);
+long long	llrintl(long double);
+#endif
+long long	llroundl(long double);
+#if 0
+long double	log10l(long double);
+long double	log1pl(long double);
+long double	log2l(long double);
+long double	logbl(long double);
+long double	logl(long double);
+long		lrintl(long double);
+#endif
+long		lroundl(long double);
+#if 0
+long double	modfl(long double, long double *); /* fundamentally !__pure2 */
+long double	nanl(const char *) __pure2;
+long double	nearbyintl(long double);
+#endif
+long double	nextafterl(long double, long double);
+double		nexttoward(double, long double);
+float		nexttowardf(float, long double);
+long double	nexttowardl(long double, long double);
+#if 0
+long double	powl(long double, long double);
+long double	remainderl(long double, long double);
+long double	remquol(long double, long double, int *);
+long double	rintl(long double);
+#endif
+long double	roundl(long double);
+long double	scalblnl(long double, long);
+long double	scalbnl(long double, int);
+#if 0
+long double	sinhl(long double);
+long double	sinl(long double);
+long double	sqrtl(long double);
+long double	tanhl(long double);
+long double	tanl(long double);
+long double	tgammal(long double);
+#endif
+long double	truncl(long double);
+
+/* #endif */ /* __ISO_C_VISIBLE >= 1999 */
+__END_DECLS
+
+#endif /* !_MATH_H_ */
diff --git a/tools/zoneinfo/tzdata2009s/MODULE_LICENSE_PUBLIC_DOMAIN b/ndk/platforms/android-3/include/memory.h
similarity index 100%
copy from tools/zoneinfo/tzdata2009s/MODULE_LICENSE_PUBLIC_DOMAIN
copy to ndk/platforms/android-3/include/memory.h
diff --git a/ndk/platforms/android-3/include/mntent.h b/ndk/platforms/android-3/include/mntent.h
new file mode 100644
index 0000000..b83da1f
--- /dev/null
+++ b/ndk/platforms/android-3/include/mntent.h
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _MNTENT_H_
+#define _MNTENT_H_
+
+#include <stdio.h>
+
+#define MNTTYPE_IGNORE "ignore"
+
+struct mntent
+{
+    char* mnt_fsname;
+    char* mnt_dir;
+    char* mnt_type;
+    char* mnt_opts;
+    int mnt_freq;
+    int mnt_passno;
+};
+
+
+__BEGIN_DECLS
+
+
+struct mntent* getmntent(FILE*);
+
+__END_DECLS
+
+#endif
diff --git a/ndk/platforms/android-3/include/mtd/mtd-abi.h b/ndk/platforms/android-3/include/mtd/mtd-abi.h
new file mode 100644
index 0000000..0ae2263
--- /dev/null
+++ b/ndk/platforms/android-3/include/mtd/mtd-abi.h
@@ -0,0 +1,133 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __MTD_ABI_H__
+#define __MTD_ABI_H__
+
+struct erase_info_user {
+ uint32_t start;
+ uint32_t length;
+};
+
+struct mtd_oob_buf {
+ uint32_t start;
+ uint32_t length;
+ unsigned char __user *ptr;
+};
+
+#define MTD_ABSENT 0
+#define MTD_RAM 1
+#define MTD_ROM 2
+#define MTD_NORFLASH 3
+#define MTD_NANDFLASH 4
+#define MTD_DATAFLASH 6
+
+#define MTD_WRITEABLE 0x400  
+#define MTD_BIT_WRITEABLE 0x800  
+#define MTD_NO_ERASE 0x1000  
+#define MTD_STUPID_LOCK 0x2000  
+
+#define MTD_CAP_ROM 0
+#define MTD_CAP_RAM (MTD_WRITEABLE | MTD_BIT_WRITEABLE | MTD_NO_ERASE)
+#define MTD_CAP_NORFLASH (MTD_WRITEABLE | MTD_BIT_WRITEABLE)
+#define MTD_CAP_NANDFLASH (MTD_WRITEABLE)
+
+#define MTD_NANDECC_OFF 0 
+#define MTD_NANDECC_PLACE 1 
+#define MTD_NANDECC_AUTOPLACE 2 
+#define MTD_NANDECC_PLACEONLY 3 
+#define MTD_NANDECC_AUTOPL_USR 4 
+
+#define MTD_OTP_OFF 0
+#define MTD_OTP_FACTORY 1
+#define MTD_OTP_USER 2
+
+struct mtd_info_user {
+ uint8_t type;
+ uint32_t flags;
+ uint32_t size;
+ uint32_t erasesize;
+ uint32_t writesize;
+ uint32_t oobsize;
+
+ uint32_t ecctype;
+ uint32_t eccsize;
+};
+
+struct region_info_user {
+ uint32_t offset;
+ uint32_t erasesize;
+ uint32_t numblocks;
+ uint32_t regionindex;
+};
+
+struct otp_info {
+ uint32_t start;
+ uint32_t length;
+ uint32_t locked;
+};
+
+#define MEMGETINFO _IOR('M', 1, struct mtd_info_user)
+#define MEMERASE _IOW('M', 2, struct erase_info_user)
+#define MEMWRITEOOB _IOWR('M', 3, struct mtd_oob_buf)
+#define MEMREADOOB _IOWR('M', 4, struct mtd_oob_buf)
+#define MEMLOCK _IOW('M', 5, struct erase_info_user)
+#define MEMUNLOCK _IOW('M', 6, struct erase_info_user)
+#define MEMGETREGIONCOUNT _IOR('M', 7, int)
+#define MEMGETREGIONINFO _IOWR('M', 8, struct region_info_user)
+#define MEMSETOOBSEL _IOW('M', 9, struct nand_oobinfo)
+#define MEMGETOOBSEL _IOR('M', 10, struct nand_oobinfo)
+#define MEMGETBADBLOCK _IOW('M', 11, loff_t)
+#define MEMSETBADBLOCK _IOW('M', 12, loff_t)
+#define OTPSELECT _IOR('M', 13, int)
+#define OTPGETREGIONCOUNT _IOW('M', 14, int)
+#define OTPGETREGIONINFO _IOW('M', 15, struct otp_info)
+#define OTPLOCK _IOR('M', 16, struct otp_info)
+#define ECCGETLAYOUT _IOR('M', 17, struct nand_ecclayout)
+#define ECCGETSTATS _IOR('M', 18, struct mtd_ecc_stats)
+#define MTDFILEMODE _IO('M', 19)
+
+struct nand_oobinfo {
+ uint32_t useecc;
+ uint32_t eccbytes;
+ uint32_t oobfree[8][2];
+ uint32_t eccpos[32];
+};
+
+struct nand_oobfree {
+ uint32_t offset;
+ uint32_t length;
+};
+
+#define MTD_MAX_OOBFREE_ENTRIES 8
+
+struct nand_ecclayout {
+ uint32_t eccbytes;
+ uint32_t eccpos[64];
+ uint32_t oobavail;
+ struct nand_oobfree oobfree[MTD_MAX_OOBFREE_ENTRIES];
+};
+
+struct mtd_ecc_stats {
+ uint32_t corrected;
+ uint32_t failed;
+ uint32_t badblocks;
+ uint32_t bbtblocks;
+};
+
+enum mtd_file_modes {
+ MTD_MODE_NORMAL = MTD_OTP_OFF,
+ MTD_MODE_OTP_FACTORY = MTD_OTP_FACTORY,
+ MTD_MODE_OTP_USER = MTD_OTP_USER,
+ MTD_MODE_RAW,
+};
+
+#endif
diff --git a/ndk/platforms/android-3/include/mtd/mtd-user.h b/ndk/platforms/android-3/include/mtd/mtd-user.h
new file mode 100644
index 0000000..1d37dc1
--- /dev/null
+++ b/ndk/platforms/android-3/include/mtd/mtd-user.h
@@ -0,0 +1,25 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __MTD_USER_H__
+#define __MTD_USER_H__
+
+#include <stdint.h>
+
+#include <mtd/mtd-abi.h>
+
+typedef struct mtd_info_user mtd_info_t;
+typedef struct erase_info_user erase_info_t;
+typedef struct region_info_user region_info_t;
+typedef struct nand_oobinfo nand_oobinfo_t;
+typedef struct nand_ecclayout nand_ecclayout_t;
+
+#endif
diff --git a/ndk/platforms/android-3/include/net/ethertypes.h b/ndk/platforms/android-3/include/net/ethertypes.h
new file mode 100644
index 0000000..1cfd2cd
--- /dev/null
+++ b/ndk/platforms/android-3/include/net/ethertypes.h
@@ -0,0 +1,313 @@
+/*	$NetBSD: ethertypes.h,v 1.17 2005/12/10 23:21:38 elad Exp $	*/
+
+/*
+ * Copyright (c) 1982, 1986, 1993
+ *	The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ * 3. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
+ *
+ *	@(#)if_ether.h	8.1 (Berkeley) 6/10/93
+ */
+
+/*
+ * Ethernet protocol types.
+ *
+ * According to "assigned numbers", the Ethernet protocol numbers are also
+ * used as ARP protocol type numbers.
+ *
+ * I factor them out here to avoid pulling all the Ethernet header file
+ * into the hardware independent ARP code. -is
+ *
+ * Additional sources of information:
+ *	http://www.mit.edu/~map/Ethernet/Ethernet.txt
+ *	ftp://venera.isi.edu/in-notes/iana/assignments/ethernet-numbers
+ *
+ */
+
+#ifndef _NET_ETHERTYPES_H_
+#define	_NET_ETHERTYPES_H_
+
+/*
+ *  NOTE: 0x0000-0x05DC (0..1500) are generally IEEE 802.3 length fields.
+ *  However, there are some conflicts.
+ */
+
+#define	ETHERTYPE_8023		0x0004	/* IEEE 802.3 packet */
+		   /* 0x0101 .. 0x1FF	   Experimental */
+#define	ETHERTYPE_PUP		0x0200	/* Xerox PUP protocol - see 0A00 */
+#define	ETHERTYPE_PUPAT		0x0200	/* PUP Address Translation - see 0A01 */
+#define	ETHERTYPE_SPRITE	0x0500	/* ??? */
+			     /* 0x0400	   Nixdorf */
+#define	ETHERTYPE_NS		0x0600	/* XNS */
+#define	ETHERTYPE_NSAT		0x0601	/* XNS Address Translation (3Mb only) */
+#define	ETHERTYPE_DLOG1 	0x0660	/* DLOG (?) */
+#define	ETHERTYPE_DLOG2 	0x0661	/* DLOG (?) */
+#define	ETHERTYPE_IP		0x0800	/* IP protocol */
+#define	ETHERTYPE_X75		0x0801	/* X.75 Internet */
+#define	ETHERTYPE_NBS		0x0802	/* NBS Internet */
+#define	ETHERTYPE_ECMA		0x0803	/* ECMA Internet */
+#define	ETHERTYPE_CHAOS 	0x0804	/* CHAOSnet */
+#define	ETHERTYPE_X25		0x0805	/* X.25 Level 3 */
+#define	ETHERTYPE_ARP		0x0806	/* Address resolution protocol */
+#define	ETHERTYPE_NSCOMPAT	0x0807	/* XNS Compatibility */
+#define	ETHERTYPE_FRARP 	0x0808	/* Frame Relay ARP (RFC1701) */
+			     /* 0x081C	   Symbolics Private */
+		    /* 0x0888 - 0x088A	   Xyplex */
+#define	ETHERTYPE_UBDEBUG	0x0900	/* Ungermann-Bass network debugger */
+#define	ETHERTYPE_IEEEPUP	0x0A00	/* Xerox IEEE802.3 PUP */
+#define	ETHERTYPE_IEEEPUPAT	0x0A01	/* Xerox IEEE802.3 PUP Address Translation */
+#define	ETHERTYPE_VINES 	0x0BAD	/* Banyan VINES */
+#define	ETHERTYPE_VINESLOOP	0x0BAE	/* Banyan VINES Loopback */
+#define	ETHERTYPE_VINESECHO	0x0BAF	/* Banyan VINES Echo */
+
+/*		       0x1000 - 0x100F	   Berkeley Trailer */
+/*
+ * The ETHERTYPE_NTRAILER packet types starting at ETHERTYPE_TRAIL have
+ * (type-ETHERTYPE_TRAIL)*512 bytes of data followed
+ * by an ETHER type (as given above) and then the (variable-length) header.
+ */
+#define	ETHERTYPE_TRAIL		0x1000	/* Trailer packet */
+#define	ETHERTYPE_NTRAILER	16
+
+#define	ETHERTYPE_DCA		0x1234	/* DCA - Multicast */
+#define	ETHERTYPE_VALID 	0x1600	/* VALID system protocol */
+#define	ETHERTYPE_DOGFIGHT	0x1989	/* Artificial Horizons ("Aviator" dogfight simulator [on Sun]) */
+#define	ETHERTYPE_RCL		0x1995	/* Datapoint Corporation (RCL lan protocol) */
+
+					/* The following 3C0x types
+					   are unregistered: */
+#define	ETHERTYPE_NBPVCD	0x3C00	/* 3Com NBP virtual circuit datagram (like XNS SPP) not registered */
+#define	ETHERTYPE_NBPSCD	0x3C01	/* 3Com NBP System control datagram not registered */
+#define	ETHERTYPE_NBPCREQ	0x3C02	/* 3Com NBP Connect request (virtual cct) not registered */
+#define	ETHERTYPE_NBPCRSP	0x3C03	/* 3Com NBP Connect repsonse not registered */
+#define	ETHERTYPE_NBPCC		0x3C04	/* 3Com NBP Connect complete not registered */
+#define	ETHERTYPE_NBPCLREQ	0x3C05	/* 3Com NBP Close request (virtual cct) not registered */
+#define	ETHERTYPE_NBPCLRSP	0x3C06	/* 3Com NBP Close response not registered */
+#define	ETHERTYPE_NBPDG		0x3C07	/* 3Com NBP Datagram (like XNS IDP) not registered */
+#define	ETHERTYPE_NBPDGB	0x3C08	/* 3Com NBP Datagram broadcast not registered */
+#define	ETHERTYPE_NBPCLAIM	0x3C09	/* 3Com NBP Claim NetBIOS name not registered */
+#define	ETHERTYPE_NBPDLTE	0x3C0A	/* 3Com NBP Delete Netbios name not registered */
+#define	ETHERTYPE_NBPRAS	0x3C0B	/* 3Com NBP Remote adaptor status request not registered */
+#define	ETHERTYPE_NBPRAR	0x3C0C	/* 3Com NBP Remote adaptor response not registered */
+#define	ETHERTYPE_NBPRST	0x3C0D	/* 3Com NBP Reset not registered */
+
+#define	ETHERTYPE_PCS		0x4242	/* PCS Basic Block Protocol */
+#define	ETHERTYPE_IMLBLDIAG	0x424C	/* Information Modes Little Big LAN diagnostic */
+#define	ETHERTYPE_DIDDLE	0x4321	/* THD - Diddle */
+#define	ETHERTYPE_IMLBL		0x4C42	/* Information Modes Little Big LAN */
+#define	ETHERTYPE_SIMNET	0x5208	/* BBN Simnet Private */
+#define	ETHERTYPE_DECEXPER	0x6000	/* DEC Unassigned, experimental */
+#define	ETHERTYPE_MOPDL		0x6001	/* DEC MOP dump/load */
+#define	ETHERTYPE_MOPRC		0x6002	/* DEC MOP remote console */
+#define	ETHERTYPE_DECnet	0x6003	/* DEC DECNET Phase IV route */
+#define	ETHERTYPE_DN		ETHERTYPE_DECnet	/* libpcap, tcpdump */
+#define	ETHERTYPE_LAT		0x6004	/* DEC LAT */
+#define	ETHERTYPE_DECDIAG	0x6005	/* DEC diagnostic protocol (at interface initialization?) */
+#define	ETHERTYPE_DECCUST	0x6006	/* DEC customer protocol */
+#define	ETHERTYPE_SCA		0x6007	/* DEC LAVC, SCA */
+#define	ETHERTYPE_AMBER		0x6008	/* DEC AMBER */
+#define	ETHERTYPE_DECMUMPS	0x6009	/* DEC MUMPS */
+		    /* 0x6010 - 0x6014	   3Com Corporation */
+#define	ETHERTYPE_TRANSETHER	0x6558	/* Trans Ether Bridging (RFC1701)*/
+#define	ETHERTYPE_RAWFR		0x6559	/* Raw Frame Relay (RFC1701) */
+#define	ETHERTYPE_UBDL		0x7000	/* Ungermann-Bass download */
+#define	ETHERTYPE_UBNIU		0x7001	/* Ungermann-Bass NIUs */
+#define	ETHERTYPE_UBDIAGLOOP	0x7002	/* Ungermann-Bass diagnostic/loopback */
+#define	ETHERTYPE_UBNMC		0x7003	/* Ungermann-Bass ??? (NMC to/from UB Bridge) */
+#define	ETHERTYPE_UBBST		0x7005	/* Ungermann-Bass Bridge Spanning Tree */
+#define	ETHERTYPE_OS9		0x7007	/* OS/9 Microware */
+#define	ETHERTYPE_OS9NET	0x7009	/* OS/9 Net? */
+		    /* 0x7020 - 0x7029	   LRT (England) (now Sintrom) */
+#define	ETHERTYPE_RACAL		0x7030	/* Racal-Interlan */
+#define	ETHERTYPE_PRIMENTS	0x7031	/* Prime NTS (Network Terminal Service) */
+#define	ETHERTYPE_CABLETRON	0x7034	/* Cabletron */
+#define	ETHERTYPE_CRONUSVLN	0x8003	/* Cronus VLN */
+#define	ETHERTYPE_CRONUS	0x8004	/* Cronus Direct */
+#define	ETHERTYPE_HP		0x8005	/* HP Probe */
+#define	ETHERTYPE_NESTAR	0x8006	/* Nestar */
+#define	ETHERTYPE_ATTSTANFORD	0x8008	/* AT&T/Stanford (local use) */
+#define	ETHERTYPE_EXCELAN	0x8010	/* Excelan */
+#define	ETHERTYPE_SG_DIAG	0x8013	/* SGI diagnostic type */
+#define	ETHERTYPE_SG_NETGAMES	0x8014	/* SGI network games */
+#define	ETHERTYPE_SG_RESV	0x8015	/* SGI reserved type */
+#define	ETHERTYPE_SG_BOUNCE	0x8016	/* SGI bounce server */
+#define	ETHERTYPE_APOLLODOMAIN	0x8019	/* Apollo DOMAIN */
+#define	ETHERTYPE_TYMSHARE	0x802E	/* Tymeshare */
+#define	ETHERTYPE_TIGAN		0x802F	/* Tigan, Inc. */
+#define	ETHERTYPE_REVARP	0x8035	/* Reverse addr resolution protocol */
+#define	ETHERTYPE_AEONIC	0x8036	/* Aeonic Systems */
+#define	ETHERTYPE_IPXNEW	0x8037	/* IPX (Novell Netware?) */
+#define	ETHERTYPE_LANBRIDGE	0x8038	/* DEC LANBridge */
+#define	ETHERTYPE_DSMD	0x8039	/* DEC DSM/DDP */
+#define	ETHERTYPE_ARGONAUT	0x803A	/* DEC Argonaut Console */
+#define	ETHERTYPE_VAXELN	0x803B	/* DEC VAXELN */
+#define	ETHERTYPE_DECDNS	0x803C	/* DEC DNS Naming Service */
+#define	ETHERTYPE_ENCRYPT	0x803D	/* DEC Ethernet Encryption */
+#define	ETHERTYPE_DECDTS	0x803E	/* DEC Distributed Time Service */
+#define	ETHERTYPE_DECLTM	0x803F	/* DEC LAN Traffic Monitor */
+#define	ETHERTYPE_DECNETBIOS	0x8040	/* DEC PATHWORKS DECnet NETBIOS Emulation */
+#define	ETHERTYPE_DECLAST	0x8041	/* DEC Local Area System Transport */
+			     /* 0x8042	   DEC Unassigned */
+#define	ETHERTYPE_PLANNING	0x8044	/* Planning Research Corp. */
+		    /* 0x8046 - 0x8047	   AT&T */
+#define	ETHERTYPE_DECAM		0x8048	/* DEC Availability Manager for Distributed Systems DECamds (but someone at DEC says not) */
+#define	ETHERTYPE_EXPERDATA	0x8049	/* ExperData */
+#define	ETHERTYPE_VEXP		0x805B	/* Stanford V Kernel exp. */
+#define	ETHERTYPE_VPROD		0x805C	/* Stanford V Kernel prod. */
+#define	ETHERTYPE_ES		0x805D	/* Evans & Sutherland */
+#define	ETHERTYPE_LITTLE	0x8060	/* Little Machines */
+#define	ETHERTYPE_COUNTERPOINT	0x8062	/* Counterpoint Computers */
+		    /* 0x8065 - 0x8066	   Univ. of Mass @ Amherst */
+#define	ETHERTYPE_VEECO		0x8067	/* Veeco Integrated Auto. */
+#define	ETHERTYPE_GENDYN	0x8068	/* General Dynamics */
+#define	ETHERTYPE_ATT		0x8069	/* AT&T */
+#define	ETHERTYPE_AUTOPHON	0x806A	/* Autophon */
+#define	ETHERTYPE_COMDESIGN	0x806C	/* ComDesign */
+#define	ETHERTYPE_COMPUGRAPHIC	0x806D	/* Compugraphic Corporation */
+		    /* 0x806E - 0x8077	   Landmark Graphics Corp. */
+#define	ETHERTYPE_MATRA		0x807A	/* Matra */
+#define	ETHERTYPE_DDE		0x807B	/* Dansk Data Elektronik */
+#define	ETHERTYPE_MERIT		0x807C	/* Merit Internodal (or Univ of Michigan?) */
+		    /* 0x807D - 0x807F	   Vitalink Communications */
+#define	ETHERTYPE_VLTLMAN	0x8080	/* Vitalink TransLAN III Management */
+		    /* 0x8081 - 0x8083	   Counterpoint Computers */
+		    /* 0x8088 - 0x808A	   Xyplex */
+#define	ETHERTYPE_ATALK		0x809B	/* AppleTalk */
+#define	ETHERTYPE_AT		ETHERTYPE_ATALK		/* old NetBSD */
+#define	ETHERTYPE_APPLETALK	ETHERTYPE_ATALK		/* HP-UX */
+		    /* 0x809C - 0x809E	   Datability */
+#define	ETHERTYPE_SPIDER	0x809F	/* Spider Systems Ltd. */
+			     /* 0x80A3	   Nixdorf */
+		    /* 0x80A4 - 0x80B3	   Siemens Gammasonics Inc. */
+		    /* 0x80C0 - 0x80C3	   DCA (Digital Comm. Assoc.) Data Exchange Cluster */
+		    /* 0x80C4 - 0x80C5	   Banyan Systems */
+#define	ETHERTYPE_PACER		0x80C6	/* Pacer Software */
+#define	ETHERTYPE_APPLITEK	0x80C7	/* Applitek Corporation */
+		    /* 0x80C8 - 0x80CC	   Intergraph Corporation */
+		    /* 0x80CD - 0x80CE	   Harris Corporation */
+		    /* 0x80CF - 0x80D2	   Taylor Instrument */
+		    /* 0x80D3 - 0x80D4	   Rosemount Corporation */
+#define	ETHERTYPE_SNA		0x80D5	/* IBM SNA Services over Ethernet */
+#define	ETHERTYPE_VARIAN	0x80DD	/* Varian Associates */
+		    /* 0x80DE - 0x80DF	   TRFS (Integrated Solutions Transparent Remote File System) */
+		    /* 0x80E0 - 0x80E3	   Allen-Bradley */
+		    /* 0x80E4 - 0x80F0	   Datability */
+#define	ETHERTYPE_RETIX		0x80F2	/* Retix */
+#define	ETHERTYPE_AARP		0x80F3	/* AppleTalk AARP */
+		    /* 0x80F4 - 0x80F5	   Kinetics */
+#define	ETHERTYPE_APOLLO	0x80F7	/* Apollo Computer */
+#define ETHERTYPE_VLAN		0x8100	/* IEEE 802.1Q VLAN tagging (XXX conflicts) */
+		    /* 0x80FF - 0x8101	   Wellfleet Communications (XXX conflicts) */
+#define	ETHERTYPE_BOFL		0x8102	/* Wellfleet; BOFL (Breath OF Life) pkts [every 5-10 secs.] */
+#define	ETHERTYPE_WELLFLEET	0x8103	/* Wellfleet Communications */
+		    /* 0x8107 - 0x8109	   Symbolics Private */
+#define	ETHERTYPE_TALARIS	0x812B	/* Talaris */
+#define	ETHERTYPE_WATERLOO	0x8130	/* Waterloo Microsystems Inc. (XXX which?) */
+#define	ETHERTYPE_HAYES		0x8130	/* Hayes Microcomputers (XXX which?) */
+#define	ETHERTYPE_VGLAB		0x8131	/* VG Laboratory Systems */
+		    /* 0x8132 - 0x8137	   Bridge Communications */
+#define	ETHERTYPE_IPX		0x8137	/* Novell (old) NetWare IPX (ECONFIG E option) */
+#define	ETHERTYPE_NOVELL	0x8138	/* Novell, Inc. */
+		    /* 0x8139 - 0x813D	   KTI */
+#define	ETHERTYPE_MUMPS		0x813F	/* M/MUMPS data sharing */
+#define	ETHERTYPE_AMOEBA	0x8145	/* Vrije Universiteit (NL) Amoeba 4 RPC (obsolete) */
+#define	ETHERTYPE_FLIP		0x8146	/* Vrije Universiteit (NL) FLIP (Fast Local Internet Protocol) */
+#define	ETHERTYPE_VURESERVED	0x8147	/* Vrije Universiteit (NL) [reserved] */
+#define	ETHERTYPE_LOGICRAFT	0x8148	/* Logicraft */
+#define	ETHERTYPE_NCD		0x8149	/* Network Computing Devices */
+#define	ETHERTYPE_ALPHA		0x814A	/* Alpha Micro */
+#define	ETHERTYPE_SNMP		0x814C	/* SNMP over Ethernet (see RFC1089) */
+		    /* 0x814D - 0x814E	   BIIN */
+#define	ETHERTYPE_TEC	0x814F	/* Technically Elite Concepts */
+#define	ETHERTYPE_RATIONAL	0x8150	/* Rational Corp */
+		    /* 0x8151 - 0x8153	   Qualcomm */
+		    /* 0x815C - 0x815E	   Computer Protocol Pty Ltd */
+		    /* 0x8164 - 0x8166	   Charles River Data Systems */
+#define	ETHERTYPE_XTP		0x817D	/* Protocol Engines XTP */
+#define	ETHERTYPE_SGITW		0x817E	/* SGI/Time Warner prop. */
+#define	ETHERTYPE_HIPPI_FP	0x8180	/* HIPPI-FP encapsulation */
+#define	ETHERTYPE_STP		0x8181	/* Scheduled Transfer STP, HIPPI-ST */
+		    /* 0x8182 - 0x8183	   Reserved for HIPPI-6400 */
+		    /* 0x8184 - 0x818C	   SGI prop. */
+#define	ETHERTYPE_MOTOROLA	0x818D	/* Motorola */
+#define	ETHERTYPE_NETBEUI	0x8191	/* PowerLAN NetBIOS/NetBEUI (PC) */
+		    /* 0x819A - 0x81A3	   RAD Network Devices */
+		    /* 0x81B7 - 0x81B9	   Xyplex */
+		    /* 0x81CC - 0x81D5	   Apricot Computers */
+		    /* 0x81D6 - 0x81DD	   Artisoft Lantastic */
+		    /* 0x81E6 - 0x81EF	   Polygon */
+		    /* 0x81F0 - 0x81F2	   Comsat Labs */
+		    /* 0x81F3 - 0x81F5	   SAIC */
+		    /* 0x81F6 - 0x81F8	   VG Analytical */
+		    /* 0x8203 - 0x8205	   QNX Software Systems Ltd. */
+		    /* 0x8221 - 0x8222	   Ascom Banking Systems */
+		    /* 0x823E - 0x8240	   Advanced Encryption Systems */
+		    /* 0x8263 - 0x826A	   Charles River Data Systems */
+		    /* 0x827F - 0x8282	   Athena Programming */
+		    /* 0x829A - 0x829B	   Inst Ind Info Tech */
+		    /* 0x829C - 0x82AB	   Taurus Controls */
+		    /* 0x82AC - 0x8693	   Walker Richer & Quinn */
+#define	ETHERTYPE_ACCTON	0x8390	/* Accton Technologies (unregistered) */
+#define	ETHERTYPE_TALARISMC	0x852B	/* Talaris multicast */
+#define	ETHERTYPE_KALPANA	0x8582	/* Kalpana */
+		    /* 0x8694 - 0x869D	   Idea Courier */
+		    /* 0x869E - 0x86A1	   Computer Network Tech */
+		    /* 0x86A3 - 0x86AC	   Gateway Communications */
+#define	ETHERTYPE_SECTRA	0x86DB	/* SECTRA */
+#define	ETHERTYPE_IPV6		0x86DD	/* IP protocol version 6 */
+#define	ETHERTYPE_DELTACON	0x86DE	/* Delta Controls */
+#define	ETHERTYPE_ATOMIC	0x86DF	/* ATOMIC */
+		    /* 0x86E0 - 0x86EF	   Landis & Gyr Powers */
+		    /* 0x8700 - 0x8710	   Motorola */
+#define	ETHERTYPE_RDP		0x8739	/* Control Technology Inc. RDP Without IP */
+#define	ETHERTYPE_MICP		0x873A	/* Control Technology Inc. Mcast Industrial Ctrl Proto. */
+		    /* 0x873B - 0x873C	   Control Technology Inc. Proprietary */
+#define	ETHERTYPE_TCPCOMP	0x876B	/* TCP/IP Compression (RFC1701) */
+#define	ETHERTYPE_IPAS		0x876C	/* IP Autonomous Systems (RFC1701) */
+#define	ETHERTYPE_SECUREDATA	0x876D	/* Secure Data (RFC1701) */
+#define	ETHERTYPE_FLOWCONTROL	0x8808	/* 802.3x flow control packet */
+#define	ETHERTYPE_SLOWPROTOCOLS	0x8809	/* Slow protocols */
+#define	ETHERTYPE_PPP		0x880B	/* PPP (obsolete by PPPOE) */
+#define	ETHERTYPE_HITACHI	0x8820	/* Hitachi Cable (Optoelectronic Systems Laboratory) */
+#define	ETHERTYPE_MPLS		0x8847	/* MPLS Unicast */
+#define	ETHERTYPE_MPLS_MCAST	0x8848	/* MPLS Multicast */
+#define	ETHERTYPE_AXIS		0x8856	/* Axis Communications AB proprietary bootstrap/config */
+#define	ETHERTYPE_PPPOEDISC	0x8863	/* PPP Over Ethernet Discovery Stage */
+#define	ETHERTYPE_PPPOE		0x8864	/* PPP Over Ethernet Session Stage */
+#define	ETHERTYPE_LANPROBE	0x8888	/* HP LanProbe test? */
+#define	ETHERTYPE_PAE		0x888e	/* EAPOL PAE/802.1x */
+#define	ETHERTYPE_LOOPBACK	0x9000	/* Loopback */
+#define	ETHERTYPE_LBACK		ETHERTYPE_LOOPBACK	/* DEC MOP loopback */
+#define	ETHERTYPE_XNSSM		0x9001	/* 3Com (Formerly Bridge Communications), XNS Systems Management */
+#define	ETHERTYPE_TCPSM		0x9002	/* 3Com (Formerly Bridge Communications), TCP/IP Systems Management */
+#define	ETHERTYPE_BCLOOP	0x9003	/* 3Com (Formerly Bridge Communications), loopback detection */
+#define	ETHERTYPE_DEBNI		0xAAAA	/* DECNET? Used by VAX 6220 DEBNI */
+#define	ETHERTYPE_SONIX		0xFAF5	/* Sonix Arpeggio */
+#define	ETHERTYPE_VITAL		0xFF00	/* BBN VITAL-LanBridge cache wakeups */
+		    /* 0xFF00 - 0xFFOF	   ISC Bunker Ramo */
+
+#define	ETHERTYPE_MAX		0xFFFF	/* Maximum valid ethernet type, reserved */
+
+#endif /* !_NET_ETHERTYPES_H_ */
diff --git a/ndk/platforms/android-3/include/net/if.h b/ndk/platforms/android-3/include/net/if.h
new file mode 100644
index 0000000..9044fc5
--- /dev/null
+++ b/ndk/platforms/android-3/include/net/if.h
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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.
+ */
+#include <linux/if.h>
+#include <sys/cdefs.h>
+#ifndef IF_NAMESIZE
+#define IF_NAMESIZE IFNAMSIZ
+#endif
+
+__BEGIN_DECLS
+
+/*
+ * Map an interface name into its corresponding index.
+ */
+extern unsigned int if_nametoindex(const char *);
+extern char*        if_indextoname(unsigned ifindex, char *ifname);
+
+__END_DECLS
diff --git a/ndk/platforms/android-3/include/net/if_arp.h b/ndk/platforms/android-3/include/net/if_arp.h
new file mode 100644
index 0000000..a25f1b4
--- /dev/null
+++ b/ndk/platforms/android-3/include/net/if_arp.h
@@ -0,0 +1 @@
+#include <linux/if_arp.h>
diff --git a/ndk/platforms/android-3/include/net/if_dl.h b/ndk/platforms/android-3/include/net/if_dl.h
new file mode 100644
index 0000000..1f0c080
--- /dev/null
+++ b/ndk/platforms/android-3/include/net/if_dl.h
@@ -0,0 +1,87 @@
+/*	$NetBSD: if_dl.h,v 1.18 2005/12/11 23:05:24 thorpej Exp $	*/
+
+/*
+ * Copyright (c) 1990, 1993
+ *	The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ * 3. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
+ *
+ *	@(#)if_dl.h	8.1 (Berkeley) 6/10/93
+ */
+
+/*
+ * A Link-Level Sockaddr may specify the interface in one of two
+ * ways: either by means of a system-provided index number (computed
+ * anew and possibly differently on every reboot), or by a human-readable
+ * string such as "il0" (for managerial convenience).
+ *
+ * Census taking actions, such as something akin to SIOCGCONF would return
+ * both the index and the human name.
+ *
+ * High volume transactions (such as giving a link-level ``from'' address
+ * in a recvfrom or recvmsg call) may be likely only to provide the indexed
+ * form, (which requires fewer copy operations and less space).
+ *
+ * The form and interpretation  of the link-level address is purely a matter
+ * of convention between the device driver and its consumers; however, it is
+ * expected that all drivers for an interface of a given if_type will agree.
+ */
+
+#ifndef _NET_IF_DL_H_
+#define _NET_IF_DL_H_
+
+#include <sys/socket.h>
+
+/*
+ * Structure of a Link-Level sockaddr:
+ */
+struct sockaddr_dl {
+	u_char	    sdl_len;	/* Total length of sockaddr */
+	sa_family_t sdl_family;	/* AF_LINK */
+	u_int16_t   sdl_index;	/* if != 0, system given index for interface */
+	u_char	    sdl_type;	/* interface type */
+	u_char	    sdl_nlen;	/* interface name length, no trailing 0 reqd. */
+	u_char	    sdl_alen;	/* link level address length */
+	u_char	    sdl_slen;	/* link layer selector length */
+	char	    sdl_data[12]; /* minimum work area, can be larger;
+				     contains both if name and ll address */
+};
+
+/* We do arithmetic directly with these, so keep them char instead of void */
+#define LLADDR(s) ((char *)((s)->sdl_data + (s)->sdl_nlen))
+#define CLLADDR(s) ((const char *)((s)->sdl_data + (s)->sdl_nlen))
+
+#ifndef _KERNEL
+
+#include <sys/cdefs.h>
+
+__BEGIN_DECLS
+void	link_addr(const char *, struct sockaddr_dl *);
+char	*link_ntoa(const struct sockaddr_dl *);
+__END_DECLS
+
+#endif /* !_KERNEL */
+
+#endif /* !_NET_IF_DL_H_ */
diff --git a/ndk/platforms/android-3/include/net/if_ether.h b/ndk/platforms/android-3/include/net/if_ether.h
new file mode 100644
index 0000000..121f9ac
--- /dev/null
+++ b/ndk/platforms/android-3/include/net/if_ether.h
@@ -0,0 +1,217 @@
+/*	$NetBSD: if_ether.h,v 1.43 2006/11/24 01:04:30 rpaulo Exp $	*/
+
+/*
+ * Copyright (c) 1982, 1986, 1993
+ *	The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ * 3. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
+ *
+ *	@(#)if_ether.h	8.1 (Berkeley) 6/10/93
+ */
+
+#ifndef _NET_IF_ETHER_H_
+#define _NET_IF_ETHER_H_
+
+#ifdef _KERNEL
+#ifdef _KERNEL_OPT
+#include "opt_mbuftrace.h"
+#endif
+#include <sys/mbuf.h>
+#endif
+
+/*
+ * Some basic Ethernet constants.
+ */
+#define	ETHER_ADDR_LEN	6	/* length of an Ethernet address */
+#define	ETHER_TYPE_LEN	2	/* length of the Ethernet type field */
+#define	ETHER_CRC_LEN	4	/* length of the Ethernet CRC */
+#define	ETHER_HDR_LEN	((ETHER_ADDR_LEN * 2) + ETHER_TYPE_LEN)
+#define	ETHER_MIN_LEN	64	/* minimum frame length, including CRC */
+#define	ETHER_MAX_LEN	1518	/* maximum frame length, including CRC */
+#define	ETHER_MAX_LEN_JUMBO 9018 /* maximum jumbo frame len, including CRC */
+
+/*
+ * Some Ethernet extensions.
+ */
+#define	ETHER_VLAN_ENCAP_LEN 4	/* length of 802.1Q VLAN encapsulation */
+
+/*
+ * Ethernet address - 6 octets
+ * this is only used by the ethers(3) functions.
+ */
+struct ether_addr {
+	u_int8_t ether_addr_octet[ETHER_ADDR_LEN];
+} __attribute__((__packed__));
+
+/*
+ * Structure of a 10Mb/s Ethernet header.
+ */
+struct	ether_header {
+	u_int8_t  ether_dhost[ETHER_ADDR_LEN];
+	u_int8_t  ether_shost[ETHER_ADDR_LEN];
+	u_int16_t ether_type;
+} __attribute__((__packed__));
+
+#include <net/ethertypes.h>
+
+#define	ETHER_IS_MULTICAST(addr) (*(addr) & 0x01) /* is address mcast/bcast? */
+
+#define	ETHERMTU_JUMBO	(ETHER_MAX_LEN_JUMBO - ETHER_HDR_LEN - ETHER_CRC_LEN)
+#define	ETHERMTU	(ETHER_MAX_LEN - ETHER_HDR_LEN - ETHER_CRC_LEN)
+#define	ETHERMIN	(ETHER_MIN_LEN - ETHER_HDR_LEN - ETHER_CRC_LEN)
+
+/*
+ * Compute the maximum frame size based on ethertype (i.e. possible
+ * encapsulation) and whether or not an FCS is present.
+ */
+#define	ETHER_MAX_FRAME(ifp, etype, hasfcs)				\
+	((ifp)->if_mtu + ETHER_HDR_LEN +				\
+	 ((hasfcs) ? ETHER_CRC_LEN : 0) +				\
+	 (((etype) == ETHERTYPE_VLAN) ? ETHER_VLAN_ENCAP_LEN : 0))
+
+/*
+ * Ethernet CRC32 polynomials (big- and little-endian verions).
+ */
+#define	ETHER_CRC_POLY_LE	0xedb88320
+#define	ETHER_CRC_POLY_BE	0x04c11db6
+
+#ifndef _STANDALONE
+
+/*
+ * Ethernet-specific mbuf flags.
+ */
+#define	M_HASFCS	M_LINK0	/* FCS included at end of frame */
+#define	M_PROMISC	M_LINK1	/* this packet is not for us */
+
+#ifdef _KERNEL
+/*
+ * Macro to map an IP multicast address to an Ethernet multicast address.
+ * The high-order 25 bits of the Ethernet address are statically assigned,
+ * and the low-order 23 bits are taken from the low end of the IP address.
+ */
+#define ETHER_MAP_IP_MULTICAST(ipaddr, enaddr)				\
+	/* struct in_addr *ipaddr; */					\
+	/* u_int8_t enaddr[ETHER_ADDR_LEN]; */				\
+{									\
+	(enaddr)[0] = 0x01;						\
+	(enaddr)[1] = 0x00;						\
+	(enaddr)[2] = 0x5e;						\
+	(enaddr)[3] = ((u_int8_t *)ipaddr)[1] & 0x7f;			\
+	(enaddr)[4] = ((u_int8_t *)ipaddr)[2];				\
+	(enaddr)[5] = ((u_int8_t *)ipaddr)[3];				\
+}
+/*
+ * Macro to map an IP6 multicast address to an Ethernet multicast address.
+ * The high-order 16 bits of the Ethernet address are statically assigned,
+ * and the low-order 32 bits are taken from the low end of the IP6 address.
+ */
+#define ETHER_MAP_IPV6_MULTICAST(ip6addr, enaddr)			\
+	/* struct in6_addr *ip6addr; */					\
+	/* u_int8_t enaddr[ETHER_ADDR_LEN]; */				\
+{                                                                       \
+	(enaddr)[0] = 0x33;						\
+	(enaddr)[1] = 0x33;						\
+	(enaddr)[2] = ((u_int8_t *)ip6addr)[12];			\
+	(enaddr)[3] = ((u_int8_t *)ip6addr)[13];			\
+	(enaddr)[4] = ((u_int8_t *)ip6addr)[14];			\
+	(enaddr)[5] = ((u_int8_t *)ip6addr)[15];			\
+}
+#endif
+
+#define	ETHERCAP_VLAN_MTU	0x00000001	/* VLAN-compatible MTU */
+#define	ETHERCAP_VLAN_HWTAGGING	0x00000002	/* hardware VLAN tag support */
+#define	ETHERCAP_JUMBO_MTU	0x00000004	/* 9000 byte MTU supported */
+
+#ifdef	_KERNEL
+extern const uint8_t etherbroadcastaddr[ETHER_ADDR_LEN];
+extern const uint8_t ethermulticastaddr_slowprotocols[ETHER_ADDR_LEN];
+extern const uint8_t ether_ipmulticast_min[ETHER_ADDR_LEN];
+extern const uint8_t ether_ipmulticast_max[ETHER_ADDR_LEN];
+
+int	ether_ioctl(struct ifnet *, u_long, caddr_t);
+int	ether_addmulti (struct ifreq *, struct ethercom *);
+int	ether_delmulti (struct ifreq *, struct ethercom *);
+int	ether_changeaddr (struct ifreq *, struct ethercom *);
+int	ether_multiaddr(struct sockaddr *, u_int8_t[], u_int8_t[]);
+
+/*
+ * Ethernet 802.1Q VLAN structures.
+ */
+
+/* add VLAN tag to input/received packet */
+#define	VLAN_INPUT_TAG(ifp, m, vlanid, _errcase)	\
+	do {								\
+                struct m_tag *mtag =					\
+                    m_tag_get(PACKET_TAG_VLAN, sizeof(u_int), M_NOWAIT);\
+                if (mtag == NULL) {					\
+			ifp->if_ierrors++;				\
+                        printf("%s: unable to allocate VLAN tag\n",	\
+                            ifp->if_xname);				\
+                        m_freem(m);					\
+                        _errcase;					\
+                }							\
+                *(u_int *)(mtag + 1) = vlanid;				\
+                m_tag_prepend(m, mtag);					\
+	} while(0)
+
+/* extract VLAN tag from output/trasmit packet */
+#define VLAN_OUTPUT_TAG(ec, m0)			\
+	VLAN_ATTACHED(ec) ? m_tag_find((m0), PACKET_TAG_VLAN, NULL) : NULL
+
+/* extract VLAN ID value from a VLAN tag */
+#define VLAN_TAG_VALUE(mtag)	\
+	((*(u_int *)(mtag + 1)) & 4095)
+
+/* test if any VLAN is configured for this interface */
+#define VLAN_ATTACHED(ec)	((ec)->ec_nvlans > 0)
+
+void	ether_ifattach(struct ifnet *, const u_int8_t *);
+void	ether_ifdetach(struct ifnet *);
+
+char	*ether_sprintf(const u_int8_t *);
+char	*ether_snprintf(char *, size_t, const u_int8_t *);
+
+u_int32_t ether_crc32_le(const u_int8_t *, size_t);
+u_int32_t ether_crc32_be(const u_int8_t *, size_t);
+
+int	ether_nonstatic_aton(u_char *, char *);
+#else
+/*
+ * Prototype ethers(3) functions.
+ */
+#include <sys/cdefs.h>
+__BEGIN_DECLS
+char *	ether_ntoa __P((const struct ether_addr *));
+struct ether_addr *
+	ether_aton __P((const char *));
+int	ether_ntohost __P((char *, const struct ether_addr *));
+int	ether_hostton __P((const char *, struct ether_addr *));
+int	ether_line __P((const char *, struct ether_addr *, char *));
+__END_DECLS
+#endif
+
+#endif /* _STANDALONE */
+
+#endif /* !_NET_IF_ETHER_H_ */
diff --git a/ndk/platforms/android-3/include/net/if_ieee1394.h b/ndk/platforms/android-3/include/net/if_ieee1394.h
new file mode 100644
index 0000000..5a61581
--- /dev/null
+++ b/ndk/platforms/android-3/include/net/if_ieee1394.h
@@ -0,0 +1,127 @@
+/*	$NetBSD: if_ieee1394.h,v 1.6 2005/12/10 23:21:38 elad Exp $	*/
+
+/*
+ * Copyright (c) 2000 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Atsushi Onoe.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *	This product includes software developed by the NetBSD
+ *	Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``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 FOUNDATION OR CONTRIBUTORS
+ * 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 _NET_IF_IEEE1394_H_
+#define _NET_IF_IEEE1394_H_
+
+/* hardware address information for arp / nd */
+struct ieee1394_hwaddr {
+	u_int8_t	iha_uid[8];		/* node unique ID */
+	u_int8_t	iha_maxrec;		/* max_rec in the config ROM */
+	u_int8_t	iha_speed;		/* min of link/PHY speed */
+	u_int8_t	iha_offset[6];		/* unicast FIFO address */
+};
+
+/*
+ * BPF wants to see one of these.
+ */
+struct ieee1394_bpfhdr {
+	uint8_t		ibh_dhost[8];
+	uint8_t		ibh_shost[8];
+	uint16_t	ibh_type;
+};
+
+#ifdef _KERNEL
+
+/* pseudo header */
+struct ieee1394_header {
+	u_int8_t	ih_uid[8];		/* dst/src uid */
+	u_int8_t	ih_maxrec;		/* dst maxrec for tx */
+	u_int8_t	ih_speed;		/* speed */
+	u_int8_t	ih_offset[6];		/* dst offset */
+};
+
+/* unfragment encapsulation header */
+struct ieee1394_unfraghdr {
+	u_int16_t	iuh_ft;			/* fragment type == 0 */
+	u_int16_t	iuh_etype;		/* ether_type */
+};
+
+/* fragmented encapsulation header */
+struct ieee1394_fraghdr {
+	u_int16_t	ifh_ft_size;		/* fragment type, data size-1 */
+	u_int16_t	ifh_etype_off;		/* etype for first fragment */
+						/* offset for subseq frag */
+	u_int16_t	ifh_dgl;		/* datagram label */
+	u_int16_t	ifh_reserved;
+};
+
+#define	IEEE1394_FT_SUBSEQ	0x8000
+#define	IEEE1394_FT_MORE	0x4000
+
+#define	IEEE1394MTU		1500
+
+#define	IEEE1394_GASP_LEN	8		/* GASP header for Stream */
+#define	IEEE1394_ADDR_LEN	8
+#define	IEEE1394_CRC_LEN	4
+
+struct ieee1394_reass_pkt {
+	LIST_ENTRY(ieee1394_reass_pkt) rp_next;
+	struct mbuf	*rp_m;
+	u_int16_t	rp_size;
+	u_int16_t	rp_etype;
+	u_int16_t	rp_off;
+	u_int16_t	rp_dgl;
+	u_int16_t	rp_len;
+	u_int16_t	rp_ttl;
+};
+
+struct ieee1394_reassq {
+	LIST_ENTRY(ieee1394_reassq) rq_node;
+	LIST_HEAD(, ieee1394_reass_pkt) rq_pkt;
+	u_int32_t	fr_id;
+};
+
+struct ieee1394com {
+	struct ifnet	fc_if;
+	struct ieee1394_hwaddr ic_hwaddr;
+	u_int16_t	ic_dgl;
+	LIST_HEAD(, ieee1394_reassq) ic_reassq;
+};
+
+const char *ieee1394_sprintf(const u_int8_t *);
+void ieee1394_input(struct ifnet *, struct mbuf *, u_int16_t);
+void ieee1394_ifattach(struct ifnet *, const struct ieee1394_hwaddr *);
+void ieee1394_ifdetach(struct ifnet *);
+int  ieee1394_ioctl(struct ifnet *, u_long, caddr_t);
+struct mbuf * ieee1394_fragment(struct ifnet *, struct mbuf *, int, u_int16_t);
+void ieee1394_drain(struct ifnet *);
+void ieee1394_watchdog(struct ifnet *);
+#endif /* _KERNEL */
+
+#endif /* !_NET_IF_IEEE1394_H_ */
diff --git a/ndk/platforms/android-3/include/net/if_packet.h b/ndk/platforms/android-3/include/net/if_packet.h
new file mode 100644
index 0000000..b5e8e0e
--- /dev/null
+++ b/ndk/platforms/android-3/include/net/if_packet.h
@@ -0,0 +1 @@
+#include <linux/if_packet.h>
diff --git a/ndk/platforms/android-3/include/net/if_types.h b/ndk/platforms/android-3/include/net/if_types.h
new file mode 100644
index 0000000..f0a04f7
--- /dev/null
+++ b/ndk/platforms/android-3/include/net/if_types.h
@@ -0,0 +1,267 @@
+/*	$NetBSD: if_types.h,v 1.24 2005/12/10 23:21:38 elad Exp $	*/
+
+/*
+ * Copyright (c) 1989, 1993, 1994
+ *	The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ * 3. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
+ *
+ *	@(#)if_types.h	8.3 (Berkeley) 4/28/95
+ */
+
+#ifndef _NET_IF_TYPES_H_
+#define _NET_IF_TYPES_H_
+
+/*
+ * Interface types for benefit of parsing media address headers.
+ * This list is derived from the SNMP list of ifTypes, originally
+ * documented in RFC1573, now maintained as:
+ *
+ * <URL:http://www.iana.org/assignments/smi-numbers>
+ */
+
+#define	IFT_OTHER	0x1		/* none of the following */
+#define	IFT_1822	0x2		/* old-style arpanet imp */
+#define	IFT_HDH1822	0x3		/* HDH arpanet imp */
+#define	IFT_X25DDN	0x4		/* x25 to imp */
+#define	IFT_X25		0x5		/* PDN X25 interface (RFC877) */
+#define	IFT_ETHER	0x6		/* Ethernet CSMA/CD */
+#define	IFT_ISO88023	0x7		/* CSMA/CD */
+#define	IFT_ISO88024	0x8		/* Token Bus */
+#define	IFT_ISO88025	0x9		/* Token Ring */
+#define	IFT_ISO88026	0xa		/* MAN */
+#define	IFT_STARLAN	0xb
+#define	IFT_P10		0xc		/* Proteon 10MBit ring */
+#define	IFT_P80		0xd		/* Proteon 80MBit ring */
+#define	IFT_HY		0xe		/* Hyperchannel */
+#define	IFT_FDDI	0xf
+#define	IFT_LAPB	0x10
+#define	IFT_SDLC	0x11
+#define	IFT_T1		0x12
+#define	IFT_CEPT	0x13		/* E1 - european T1 */
+#define	IFT_ISDNBASIC	0x14
+#define	IFT_ISDNPRIMARY	0x15
+#define	IFT_PTPSERIAL	0x16		/* Proprietary PTP serial */
+#define	IFT_PPP		0x17		/* RFC 1331 */
+#define	IFT_LOOP	0x18		/* loopback */
+#define	IFT_EON		0x19		/* ISO over IP */
+#define	IFT_XETHER	0x1a		/* obsolete 3MB experimental ethernet */
+#define	IFT_NSIP	0x1b		/* XNS over IP */
+#define	IFT_SLIP	0x1c		/* IP over generic TTY */
+#define	IFT_ULTRA	0x1d		/* Ultra Technologies */
+#define	IFT_DS3		0x1e		/* Generic T3 */
+#define	IFT_SIP		0x1f		/* SMDS */
+#define	IFT_FRELAY	0x20		/* Frame Relay DTE only */
+#define	IFT_RS232	0x21
+#define	IFT_PARA	0x22		/* parallel-port */
+#define	IFT_ARCNET	0x23
+#define	IFT_ARCNETPLUS	0x24
+#define	IFT_ATM		0x25		/* ATM cells */
+#define	IFT_MIOX25	0x26
+#define	IFT_SONET	0x27		/* SONET or SDH */
+#define	IFT_X25PLE	0x28
+#define	IFT_ISO88022LLC	0x29
+#define	IFT_LOCALTALK	0x2a
+#define	IFT_SMDSDXI	0x2b
+#define	IFT_FRELAYDCE	0x2c		/* Frame Relay DCE */
+#define	IFT_V35		0x2d
+#define	IFT_HSSI	0x2e
+#define	IFT_HIPPI	0x2f
+#define	IFT_MODEM	0x30		/* Generic Modem */
+#define	IFT_AAL5	0x31		/* AAL5 over ATM */
+#define	IFT_SONETPATH	0x32
+#define	IFT_SONETVT	0x33
+#define	IFT_SMDSICIP	0x34		/* SMDS InterCarrier Interface */
+#define	IFT_PROPVIRTUAL	0x35		/* Proprietary Virtual/internal */
+#define	IFT_PROPMUX	0x36		/* Proprietary Multiplexing */
+#define IFT_IEEE80212		   0x37 /* 100BaseVG */
+#define IFT_FIBRECHANNEL	   0x38 /* Fibre Channel */
+#define IFT_HIPPIINTERFACE	   0x39 /* HIPPI interfaces	 */
+#define IFT_FRAMERELAYINTERCONNECT 0x3a /* Obsolete, use either 0x20 or 0x2c */
+#define IFT_AFLANE8023		   0x3b /* ATM Emulated LAN for 802.3 */
+#define IFT_AFLANE8025		   0x3c /* ATM Emulated LAN for 802.5 */
+#define IFT_CCTEMUL		   0x3d /* ATM Emulated circuit		  */
+#define IFT_FASTETHER		   0x3e /* Fast Ethernet (100BaseT) */
+#define IFT_ISDN		   0x3f /* ISDN and X.25	    */
+#define IFT_V11			   0x40 /* CCITT V.11/X.21		*/
+#define IFT_V36			   0x41 /* CCITT V.36			*/
+#define IFT_G703AT64K		   0x42 /* CCITT G703 at 64Kbps */
+#define IFT_G703AT2MB		   0x43 /* Obsolete see DS1-MIB */
+#define IFT_QLLC		   0x44 /* SNA QLLC			*/
+#define IFT_FASTETHERFX		   0x45 /* Fast Ethernet (100BaseFX)	*/
+#define IFT_CHANNEL		   0x46 /* channel			*/
+#define IFT_IEEE80211		   0x47 /* radio spread spectrum	*/
+#define IFT_IBM370PARCHAN	   0x48 /* IBM System 360/370 OEMI Channel */
+#define IFT_ESCON		   0x49 /* IBM Enterprise Systems Connection */
+#define IFT_DLSW		   0x4a /* Data Link Switching */
+#define IFT_ISDNS		   0x4b /* ISDN S/T interface */
+#define IFT_ISDNU		   0x4c /* ISDN U interface */
+#define IFT_LAPD		   0x4d /* Link Access Protocol D */
+#define IFT_IPSWITCH		   0x4e /* IP Switching Objects */
+#define IFT_RSRB		   0x4f /* Remote Source Route Bridging */
+#define IFT_ATMLOGICAL		   0x50 /* ATM Logical Port */
+#define IFT_DS0			   0x51 /* Digital Signal Level 0 */
+#define IFT_DS0BUNDLE		   0x52 /* group of ds0s on the same ds1 */
+#define IFT_BSC			   0x53 /* Bisynchronous Protocol */
+#define IFT_ASYNC		   0x54 /* Asynchronous Protocol */
+#define IFT_CNR			   0x55 /* Combat Net Radio */
+#define IFT_ISO88025DTR		   0x56 /* ISO 802.5r DTR */
+#define IFT_EPLRS		   0x57 /* Ext Pos Loc Report Sys */
+#define IFT_ARAP		   0x58 /* Appletalk Remote Access Protocol */
+#define IFT_PROPCNLS		   0x59 /* Proprietary Connectionless Protocol*/
+#define IFT_HOSTPAD		   0x5a /* CCITT-ITU X.29 PAD Protocol */
+#define IFT_TERMPAD		   0x5b /* CCITT-ITU X.3 PAD Facility */
+#define IFT_FRAMERELAYMPI	   0x5c /* Multiproto Interconnect over FR */
+#define IFT_X213		   0x5d /* CCITT-ITU X213 */
+#define IFT_ADSL		   0x5e /* Asymmetric Digital Subscriber Loop */
+#define IFT_RADSL		   0x5f /* Rate-Adapt. Digital Subscriber Loop*/
+#define IFT_SDSL		   0x60 /* Symmetric Digital Subscriber Loop */
+#define IFT_VDSL		   0x61 /* Very H-Speed Digital Subscrib. Loop*/
+#define IFT_ISO88025CRFPINT	   0x62 /* ISO 802.5 CRFP */
+#define IFT_MYRINET		   0x63 /* Myricom Myrinet */
+#define IFT_VOICEEM		   0x64 /* voice recEive and transMit */
+#define IFT_VOICEFXO		   0x65 /* voice Foreign Exchange Office */
+#define IFT_VOICEFXS		   0x66 /* voice Foreign Exchange Station */
+#define IFT_VOICEENCAP		   0x67 /* voice encapsulation */
+#define IFT_VOICEOVERIP		   0x68 /* voice over IP encapsulation */
+#define IFT_ATMDXI		   0x69 /* ATM DXI */
+#define IFT_ATMFUNI		   0x6a /* ATM FUNI */
+#define IFT_ATMIMA		   0x6b /* ATM IMA		      */
+#define IFT_PPPMULTILINKBUNDLE	   0x6c /* PPP Multilink Bundle */
+#define IFT_IPOVERCDLC		   0x6d /* IBM ipOverCdlc */
+#define IFT_IPOVERCLAW		   0x6e /* IBM Common Link Access to Workstn */
+#define IFT_STACKTOSTACK	   0x6f /* IBM stackToStack */
+#define IFT_VIRTUALIPADDRESS	   0x70 /* IBM VIPA */
+#define IFT_MPC			   0x71 /* IBM multi-protocol channel support */
+#define IFT_IPOVERATM		   0x72 /* IBM ipOverAtm */
+#define IFT_ISO88025FIBER	   0x73 /* ISO 802.5j Fiber Token Ring */
+#define IFT_TDLC		   0x74 /* IBM twinaxial data link control */
+#define IFT_GIGABITETHERNET	   0x75 /* Gigabit Ethernet */
+#define IFT_HDLC		   0x76 /* HDLC */
+#define IFT_LAPF		   0x77 /* LAP F */
+#define IFT_V37			   0x78 /* V.37 */
+#define IFT_X25MLP		   0x79 /* Multi-Link Protocol */
+#define IFT_X25HUNTGROUP	   0x7a /* X25 Hunt Group */
+#define IFT_TRANSPHDLC		   0x7b /* Transp HDLC */
+#define IFT_INTERLEAVE		   0x7c /* Interleave channel */
+#define IFT_FAST		   0x7d /* Fast channel */
+#define IFT_IP			   0x7e /* IP (for APPN HPR in IP networks) */
+#define IFT_DOCSCABLEMACLAYER	   0x7f /* CATV Mac Layer */
+#define IFT_DOCSCABLEDOWNSTREAM	   0x80 /* CATV Downstream interface */
+#define IFT_DOCSCABLEUPSTREAM	   0x81 /* CATV Upstream interface */
+#define IFT_A12MPPSWITCH	   0x82	/* Avalon Parallel Processor */
+#define IFT_TUNNEL		   0x83	/* Encapsulation interface */
+#define IFT_COFFEE		   0x84	/* coffee pot */
+#define IFT_CES			   0x85	/* Circiut Emulation Service */
+#define IFT_ATMSUBINTERFACE	   0x86	/* (x)  ATM Sub Interface */
+#define IFT_L2VLAN		   0x87	/* Layer 2 Virtual LAN using 802.1Q */
+#define IFT_L3IPVLAN		   0x88	/* Layer 3 Virtual LAN - IP Protocol */
+#define IFT_L3IPXVLAN		   0x89	/* Layer 3 Virtual LAN - IPX Prot. */
+#define IFT_DIGITALPOWERLINE	   0x8a	/* IP over Power Lines */
+#define IFT_MEDIAMAILOVERIP	   0x8b	/* (xxx)  Multimedia Mail over IP */
+#define IFT_DTM			   0x8c	/* Dynamic synchronous Transfer Mode */
+#define IFT_DCN			   0x8d	/* Data Communications Network */
+#define IFT_IPFORWARD		   0x8e	/* IP Forwarding Interface */
+#define IFT_MSDSL		   0x8f	/* Multi-rate Symmetric DSL */
+#define IFT_IEEE1394		   0x90	/* IEEE1394 High Performance SerialBus*/
+#define IFT_IFGSN		   0x91	/* HIPPI-6400 */
+#define IFT_DVBRCCMACLAYER	   0x92	/* DVB-RCC MAC Layer */
+#define IFT_DVBRCCDOWNSTREAM	   0x93	/* DVB-RCC Downstream Channel */
+#define IFT_DVBRCCUPSTREAM	   0x94	/* DVB-RCC Upstream Channel */
+#define IFT_ATMVIRTUAL		   0x95	/* ATM Virtual Interface */
+#define IFT_MPLSTUNNEL		   0x96	/* MPLS Tunnel Virtual Interface */
+#define IFT_SRP			   0x97	/* Spatial Reuse Protocol */
+#define IFT_VOICEOVERATM	   0x98	/* Voice over ATM */
+#define IFT_VOICEOVERFRAMERELAY	   0x99	/* Voice Over Frame Relay */
+#define IFT_IDSL		   0x9a	/* Digital Subscriber Loop over ISDN */
+#define IFT_COMPOSITELINK	   0x9b	/* Avici Composite Link Interface */
+#define IFT_SS7SIGLINK		   0x9c	/* SS7 Signaling Link */
+#define IFT_PROPWIRELESSP2P	   0x9d	/* Prop. P2P wireless interface */
+#define IFT_FRFORWARD		   0x9e	/* Frame forward Interface */
+#define IFT_RFC1483		   0x9f	/* Multiprotocol over ATM AAL5 */
+#define IFT_USB			   0xa0	/* USB Interface */
+#define IFT_IEEE8023ADLAG	   0xa1	/* IEEE 802.3ad Link Aggregate*/
+#define IFT_BGPPOLICYACCOUNTING	   0xa2	/* BGP Policy Accounting */
+#define IFT_FRF16MFRBUNDLE	   0xa3	/* FRF.16 Multilik Frame Relay*/
+#define IFT_H323GATEKEEPER	   0xa4	/* H323 Gatekeeper */
+#define IFT_H323PROXY		   0xa5	/* H323 Voice and Video Proxy */
+#define IFT_MPLS		   0xa6	/* MPLS */
+#define IFT_MFSIGLINK		   0xa7	/* Multi-frequency signaling link */
+#define IFT_HDSL2		   0xa8	/* High Bit-Rate DSL, 2nd gen. */
+#define IFT_SHDSL		   0xa9	/* Multirate HDSL2 */
+#define IFT_DS1FDL		   0xaa	/* Facility Data Link (4Kbps) on a DS1*/
+#define IFT_POS			   0xab	/* Packet over SONET/SDH Interface */
+#define IFT_DVBASILN		   0xac	/* DVB-ASI Input */
+#define IFT_DVBASIOUT		   0xad	/* DVB-ASI Output */
+#define IFT_PLC			   0xae	/* Power Line Communications */
+#define IFT_NFAS		   0xaf	/* Non-Facility Associated Signaling */
+#define IFT_TR008		   0xb0	/* TROO8 */
+#define IFT_GR303RDT		   0xb1	/* Remote Digital Terminal */
+#define IFT_GR303IDT		   0xb2	/* Integrated Digital Terminal */
+#define IFT_ISUP		   0xb3	/* ISUP */
+#define IFT_PROPDOCSWIRELESSMACLAYER	   0xb4	/* prop/Wireless MAC Layer */
+#define IFT_PROPDOCSWIRELESSDOWNSTREAM	   0xb5	/* prop/Wireless Downstream */
+#define IFT_PROPDOCSWIRELESSUPSTREAM	   0xb6	/* prop/Wireless Upstream */
+#define IFT_HIPERLAN2		   0xb7	/* HIPERLAN Type 2 Radio Interface */
+#define IFT_PROPBWAP2MP		   0xb8	/* PropBroadbandWirelessAccess P2MP*/
+#define IFT_SONETOVERHEADCHANNEL   0xb9	/* SONET Overhead Channel */
+#define IFT_DIGITALWRAPPEROVERHEADCHANNEL  0xba	/* Digital Wrapper Overhead */
+#define IFT_AAL2		   0xbb	/* ATM adaptation layer 2 */
+#define IFT_RADIOMAC		   0xbc	/* MAC layer over radio links */
+#define IFT_ATMRADIO		   0xbd	/* ATM over radio links */
+#define IFT_IMT			   0xbe /* Inter-Machine Trunks */
+#define IFT_MVL			   0xbf /* Multiple Virtual Lines DSL */
+#define IFT_REACHDSL		   0xc0 /* Long Reach DSL */
+#define IFT_FRDLCIENDPT		   0xc1 /* Frame Relay DLCI End Point */
+#define IFT_ATMVCIENDPT		   0xc2 /* ATM VCI End Point */
+#define IFT_OPTICALCHANNEL	   0xc3 /* Optical Channel */
+#define IFT_OPTICALTRANSPORT	   0xc4 /* Optical Transport */
+#define IFT_PROPATM		   0xc5 /* Proprietary ATM */
+#define IFT_VOICEOVERCABLE	   0xc6 /* Voice Over Cable Interface */
+#define IFT_INFINIBAND		   0xc7 /* Infiniband */
+#define IFT_TELINK		   0xc8 /* TE Link */
+#define IFT_Q2931		   0xc9 /* Q.2931 */
+#define IFT_VIRTUALTG		   0xca /* Virtual Trunk Group */
+#define IFT_SIPTG		   0xcb /* SIP Trunk Group */
+#define IFT_SIPSIG		   0xcc /* SIP Signaling */
+#define IFT_DOCSCABLEUPSTREAMCHANNEL 0xcd /* CATV Upstream Channel */
+#define IFT_ECONET		   0xce /* Acorn Econet */
+#define IFT_PON155		   0xcf /* FSAN 155Mb Symetrical PON interface */
+#define IFT_PON622		   0xd0 /* FSAN 622Mb Symetrical PON interface */*/
+#define IFT_BRIDGE		   0xd1 /* Transparent bridge interface */
+#define IFT_LINEGROUP		   0xd2 /* Interface common to multiple lines */
+#define IFT_VOICEEMFGD		   0xd3 /* voice E&M Feature Group D */
+#define IFT_VOICEFGDEANA	   0xd4 /* voice FGD Exchange Access North American */
+#define IFT_VOICEDID		   0xd5 /* voice Direct Inward Dialing */
+#define IFT_STF			   0xd7	/* 6to4 interface */
+
+/* not based on IANA assignments - how should we treat these? */
+#define IFT_GIF		0xf0
+#define IFT_PVC		0xf1
+#define IFT_FAITH	0xf2
+#define IFT_PFLOG	0xf5		/* Packet filter logging */
+#define IFT_PFSYNC	0xf6		/* Packet filter state syncing */
+
+#endif /* !_NET_IF_TYPES_H_ */
diff --git a/ndk/platforms/android-3/include/net/route.h b/ndk/platforms/android-3/include/net/route.h
new file mode 100644
index 0000000..a60df24
--- /dev/null
+++ b/ndk/platforms/android-3/include/net/route.h
@@ -0,0 +1 @@
+#include <linux/route.h>
diff --git a/ndk/platforms/android-3/include/netdb.h b/ndk/platforms/android-3/include/netdb.h
new file mode 100644
index 0000000..8d3996a
--- /dev/null
+++ b/ndk/platforms/android-3/include/netdb.h
@@ -0,0 +1,256 @@
+/*-
+ * Copyright (c) 1980, 1983, 1988, 1993
+ *	The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *	This product includes software developed by the University of
+ *	California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
+ *
+ * -
+ * Portions Copyright (c) 1993 by Digital Equipment Corporation.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies, and that
+ * the name of Digital Equipment Corporation not be used in advertising or
+ * publicity pertaining to distribution of the document or software without
+ * specific, written prior permission.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
+ * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS.   IN NO EVENT SHALL DIGITAL EQUIPMENT
+ * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ * -
+ * --Copyright--
+ */
+
+/*
+ *      @(#)netdb.h	8.1 (Berkeley) 6/2/93
+ *      From: Id: netdb.h,v 8.9 1996/11/19 08:39:29 vixie Exp $
+ * $FreeBSD: /repoman/r/ncvs/src/include/netdb.h,v 1.41 2006/04/15 16:20:26 ume Exp $
+ */
+
+#ifndef _NETDB_H_
+#define _NETDB_H_
+
+#include <sys/cdefs.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+
+#ifndef _PATH_HEQUIV
+# define	_PATH_HEQUIV	"/system/etc/hosts.equiv"
+#endif
+#define	_PATH_HOSTS	"/system/etc/hosts"
+#define	_PATH_NETWORKS	"/system/etc/networks"
+#define	_PATH_PROTOCOLS	"/system/etc/protocols"
+#define	_PATH_SERVICES	"/system/etc/services"
+
+#define  MAXHOSTNAMELEN  256
+
+
+/*
+ * Structures returned by network data base library.  All addresses are
+ * supplied in host order, and returned in network order (suitable for
+ * use in system calls).
+ */
+struct hostent {
+	char	*h_name;	/* official name of host */
+	char	**h_aliases;	/* alias list */
+	int	h_addrtype;	/* host address type */
+	int	h_length;	/* length of address */
+	char	**h_addr_list;	/* list of addresses from name server */
+#define	h_addr	h_addr_list[0]	/* address, for backward compatibility */
+};
+
+struct netent {
+	char		*n_name;	/* official name of net */
+	char		**n_aliases;	/* alias list */
+	int		n_addrtype;	/* net address type */
+	uint32_t	n_net;		/* network # */
+};
+
+struct servent {
+	char	*s_name;	/* official service name */
+	char	**s_aliases;	/* alias list */
+	int	s_port;		/* port # */
+	char	*s_proto;	/* protocol to use */
+};
+
+struct protoent {
+	char	*p_name;	/* official protocol name */
+	char	**p_aliases;	/* alias list */
+	int	p_proto;	/* protocol # */
+};
+
+struct addrinfo {
+	int	ai_flags;	/* AI_PASSIVE, AI_CANONNAME, AI_NUMERICHOST */
+	int	ai_family;	/* PF_xxx */
+	int	ai_socktype;	/* SOCK_xxx */
+	int	ai_protocol;	/* 0 or IPPROTO_xxx for IPv4 and IPv6 */
+	socklen_t ai_addrlen;	/* length of ai_addr */
+	char	*ai_canonname;	/* canonical name for hostname */
+	struct	sockaddr *ai_addr;	/* binary address */
+	struct	addrinfo *ai_next;	/* next structure in linked list */
+};
+
+/*
+ * Error return codes from gethostbyname() and gethostbyaddr()
+ * (left in h_errno).
+ */
+
+#define	NETDB_INTERNAL	-1	/* see errno */
+#define	NETDB_SUCCESS	0	/* no problem */
+#define	HOST_NOT_FOUND	1 /* Authoritative Answer Host not found */
+#define	TRY_AGAIN	2 /* Non-Authoritative Host not found, or SERVERFAIL */
+#define	NO_RECOVERY	3 /* Non recoverable errors, FORMERR, REFUSED, NOTIMP */
+#define	NO_DATA		4 /* Valid name, no data record of requested type */
+#define	NO_ADDRESS	NO_DATA		/* no address, look for MX record */
+
+/*
+ * Error return codes from getaddrinfo()
+ */
+#if 0
+/* obsoleted */
+#define	EAI_ADDRFAMILY	 1	/* address family for hostname not supported */
+#endif
+#define	EAI_AGAIN	 2	/* temporary failure in name resolution */
+#define	EAI_BADFLAGS	 3	/* invalid value for ai_flags */
+#define	EAI_FAIL	 4	/* non-recoverable failure in name resolution */
+#define	EAI_FAMILY	 5	/* ai_family not supported */
+#define	EAI_MEMORY	 6	/* memory allocation failure */
+#define	EAI_NODATA	 7	/* no address associated with hostname */
+#define	EAI_NONAME	 8	/* hostname nor servname provided, or not known */
+#define	EAI_SERVICE	 9	/* servname not supported for ai_socktype */
+#define	EAI_SOCKTYPE	10	/* ai_socktype not supported */
+#define	EAI_SYSTEM	11	/* system error returned in errno */
+#define	EAI_BADHINTS	12	/* invalid value for hints */
+#define	EAI_PROTOCOL	13	/* resolved protocol is unknown */
+#define	EAI_OVERFLOW	14	/* argument buffer overflow */
+#define	EAI_MAX		15
+
+/*
+ * Flag values for getaddrinfo()
+ */
+#define	AI_PASSIVE	0x00000001 /* get address to use bind() */
+#define	AI_CANONNAME	0x00000002 /* fill ai_canonname */
+#define	AI_NUMERICHOST	0x00000004 /* prevent host name resolution */
+#define	AI_NUMERICSERV	0x00000008 /* prevent service name resolution */
+/* valid flags for addrinfo (not a standard def, apps should not use it) */
+#define AI_MASK \
+    (AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST | AI_NUMERICSERV | \
+    AI_ADDRCONFIG)
+
+#define	AI_ALL		0x00000100 /* IPv6 and IPv4-mapped (with AI_V4MAPPED) */
+#define	AI_V4MAPPED_CFG	0x00000200 /* accept IPv4-mapped if kernel supports */
+#define	AI_ADDRCONFIG	0x00000400 /* only if any address is assigned */
+#define	AI_V4MAPPED	0x00000800 /* accept IPv4-mapped IPv6 address */
+/* special recommended flags for getipnodebyname */
+#define	AI_DEFAULT	(AI_V4MAPPED_CFG | AI_ADDRCONFIG)
+
+/*
+ * Constants for getnameinfo()
+ */
+#define	NI_MAXHOST	1025
+#define	NI_MAXSERV	32
+
+/*
+ * Flag values for getnameinfo()
+ */
+#define	NI_NOFQDN	0x00000001
+#define	NI_NUMERICHOST	0x00000002
+#define	NI_NAMEREQD	0x00000004
+#define	NI_NUMERICSERV	0x00000008
+#define	NI_DGRAM	0x00000010
+#if 0 /* obsolete */
+#define NI_WITHSCOPEID	0x00000020
+#endif
+
+/*
+ * Scope delimit character
+ */
+#define	SCOPE_DELIMITER	'%'
+
+__BEGIN_DECLS
+/* BIONIC-BEGIN */
+#define  h_errno   (*__get_h_errno())
+int*  __get_h_errno(void);
+/* BIONIC-END */
+void endservent(void);
+struct hostent	*gethostbyaddr(const char *, int, int);
+struct hostent	*gethostbyname(const char *);
+int gethostbyname_r(const char *, struct hostent *, char *, size_t, struct hostent **, int *);
+struct hostent	*gethostbyname2(const char *, int);
+struct hostent	*gethostent(void);
+struct netent	*getnetbyaddr(uint32_t, int);
+struct netent	*getnetbyname(const char *);
+struct protoent	*getprotobyname(const char *);
+struct protoent	*getprotobynumber(int);
+struct servent	*getservbyname(const char *, const char *);
+struct servent	*getservbyport(int, const char *);
+struct servent	*getservent(void);
+void herror(const char *);
+const char	*hstrerror(int);
+int getaddrinfo(const char *, const char *, const struct addrinfo *, struct addrinfo **);
+int getnameinfo(const struct sockaddr *, socklen_t, char *, size_t, char *, size_t, int);
+void freeaddrinfo(struct addrinfo *);
+const char	*gai_strerror(int);
+void setservent(int);
+
+#if 0 /* MISSING FROM BIONIC */
+void endhostent(void);
+void endnetent(void);
+void endnetgrent(void);
+void endprotoent(void);
+void freehostent(struct hostent *);
+int gethostbyaddr_r(const char *, int, int, struct hostent *, char *, size_t, struct hostent **, int *);
+int gethostbyname2_r(const char *, int, struct hostent *, char *, size_t, struct hostent **, int *);
+int gethostent_r(struct hostent *, char *, size_t, struct hostent **, int *);
+struct hostent   *getipnodebyaddr(const void *, size_t, int, int *);
+struct hostent   *getipnodebyname(const char *, int, int, int *);
+int getnetbyaddr_r(uint32_t, int, struct netent *, char *, size_t, struct netent**, int *);
+int getnetbyname_r(const char *, struct netent *, char *, size_t, struct netent **, int *);
+int getnetent_r(struct netent *, char *, size_t, struct netent **, int *);
+int getnetgrent(char **, char **, char **);
+int getprotobyname_r(const char *, struct protoent *, char *, size_t, struct protoent **);
+int getprotobynumber_r(int, struct protoent *, char *, size_t, struct protoent **);
+struct protoent  *getprotoent(void);
+int getprotoent_r(struct protoent *, char *, size_t, struct protoent **);
+int innetgr(const char *, const char *, const char *, const char *);
+void sethostent(int);
+void setnetent(int);
+void setprotoent(int);
+struct netent   *getnetent(void);
+void setnetgrent(const char *);
+#endif /* MISSING */
+
+__END_DECLS
+
+#endif /* !_NETDB_H_ */
diff --git a/ndk/platforms/android-3/include/netinet/ether.h b/ndk/platforms/android-3/include/netinet/ether.h
new file mode 100644
index 0000000..a1c9cbb
--- /dev/null
+++ b/ndk/platforms/android-3/include/netinet/ether.h
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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.
+ */
+#include <net/if_ether.h>
diff --git a/ndk/platforms/android-3/include/netinet/if_ether.h b/ndk/platforms/android-3/include/netinet/if_ether.h
new file mode 100644
index 0000000..700b9db
--- /dev/null
+++ b/ndk/platforms/android-3/include/netinet/if_ether.h
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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.
+ */
+#include <linux/if_ether.h>
+#include <linux/if_arp.h>
+#ifndef ETHER_ADDR_LEN
+#define ETHER_ADDR_LEN ETH_ALEN
+#include <net/ethertypes.h>
+#endif
diff --git a/ndk/platforms/android-3/include/netinet/in.h b/ndk/platforms/android-3/include/netinet/in.h
new file mode 100644
index 0000000..0ebd926
--- /dev/null
+++ b/ndk/platforms/android-3/include/netinet/in.h
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _NETINET_IN_H_
+#define _NETINET_IN_H_
+
+#include <endian.h>
+#include <linux/socket.h>
+#include <linux/in.h>
+#include <linux/in6.h>
+#include <netinet/in6.h>
+
+__BEGIN_DECLS
+
+#define IPPORT_RESERVED  1024
+
+extern int bindresvport (int sd, struct sockaddr_in *sin);
+
+static const struct in6_addr in6addr_any = IN6ADDR_ANY_INIT;
+static const struct in6_addr in6addr_loopback = IN6ADDR_LOOPBACK_INIT;
+
+__END_DECLS
+
+#endif /* _NETINET_IN_H_ */
diff --git a/ndk/platforms/android-3/include/netinet/in6.h b/ndk/platforms/android-3/include/netinet/in6.h
new file mode 100644
index 0000000..2f5fee1
--- /dev/null
+++ b/ndk/platforms/android-3/include/netinet/in6.h
@@ -0,0 +1,101 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _NETINET_IN6_H
+#define _NETINET_IN6_H
+
+#include <linux/in6.h>
+
+#define IN6_IS_ADDR_UNSPECIFIED(a)	\
+	((*(const uint32_t *)(const void *)(&(a)->s6_addr[0]) == 0) &&	\
+	 (*(const uint32_t *)(const void *)(&(a)->s6_addr[4]) == 0) &&	\
+	 (*(const uint32_t *)(const void *)(&(a)->s6_addr[8]) == 0) &&	\
+	 (*(const uint32_t *)(const void *)(&(a)->s6_addr[12]) == 0))
+
+#define IN6_IS_ADDR_LOOPBACK(a)		\
+	((*(const uint32_t *)(const void *)(&(a)->s6_addr[0]) == 0) &&	\
+	 (*(const uint32_t *)(const void *)(&(a)->s6_addr[4]) == 0) &&	\
+	 (*(const uint32_t *)(const void *)(&(a)->s6_addr[8]) == 0) &&	\
+	 (*(const uint32_t *)(const void *)(&(a)->s6_addr[12]) == ntohl(1)))
+
+#define IN6_IS_ADDR_V4COMPAT(a)		\
+	((*(const uint32_t *)(const void *)(&(a)->s6_addr[0]) == 0) &&	\
+	 (*(const uint32_t *)(const void *)(&(a)->s6_addr[4]) == 0) &&	\
+	 (*(const uint32_t *)(const void *)(&(a)->s6_addr[8]) == 0) &&	\
+	 (*(const uint32_t *)(const void *)(&(a)->s6_addr[12]) != 0) &&	\
+	 (*(const uint32_t *)(const void *)(&(a)->s6_addr[12]) != ntohl(1)))
+
+#define IN6_IS_ADDR_V4MAPPED(a)		      \
+	((*(const uint32_t *)(const void *)(&(a)->s6_addr[0]) == 0) &&	\
+	 (*(const uint32_t *)(const void *)(&(a)->s6_addr[4]) == 0) &&	\
+	 (*(const uint32_t *)(const void *)(&(a)->s6_addr[8]) == ntohl(0x0000ffff)))
+
+#define IN6_IS_ADDR_LINKLOCAL(a)	\
+	(((a)->s6_addr[0] == 0xfe) && (((a)->s6_addr[1] & 0xc0) == 0x80))
+
+#define IN6_IS_ADDR_SITELOCAL(a)	\
+	(((a)->s6_addr[0] == 0xfe) && (((a)->s6_addr[1] & 0xc0) == 0xc0))
+
+#define IN6_IS_ADDR_MULTICAST(a)	\
+	(((__const uint8_t *) (a))[0] == 0xff)
+
+
+#define IPV6_ADDR_SCOPE_NODELOCAL       0x01
+#define IPV6_ADDR_SCOPE_INTFACELOCAL    0x01
+#define IPV6_ADDR_SCOPE_LINKLOCAL       0x02
+#define IPV6_ADDR_SCOPE_SITELOCAL       0x05
+#define IPV6_ADDR_SCOPE_ORGLOCAL        0x08
+#define IPV6_ADDR_SCOPE_GLOBAL          0x0e
+
+#define IPV6_ADDR_MC_SCOPE(a)	\
+	((a)->s6_addr[1] & 0x0f)
+
+#define IN6_IS_ADDR_MC_LINKLOCAL(a)	\
+	(IN6_IS_ADDR_MULTICAST(a) &&  \
+	 (IPV6_ADDR_MC_SCOPE(a) == IPV6_ADDR_SCOPE_LINKLOCAL))
+#define IN6_IS_ADDR_MC_SITELOCAL(a)     \
+	(IN6_IS_ADDR_MULTICAST(a) &&  \
+	 (IPV6_ADDR_MC_SCOPE(a) == IPV6_ADDR_SCOPE_SITELOCAL))
+#define IN6_IS_ADDR_MC_ORGLOCAL(a)     \
+	(IN6_IS_ADDR_MULTICAST(a) &&  \
+	 (IPV6_ADDR_MC_SCOPE(a) == IPV6_ADDR_SCOPE_ORGLOCAL))
+
+
+#define IN6_ARE_ADDR_EQUAL(a, b)			\
+    (memcmp(&(a)->s6_addr[0], &(b)->s6_addr[0], sizeof(struct in6_addr)) == 0)
+
+#define INET6_ADDRSTRLEN 46
+
+#define IPV6_JOIN_GROUP IPV6_ADD_MEMBERSHIP
+#define IPV6_LEAVE_GROUP IPV6_DROP_MEMBERSHIP
+
+#define IN6ADDR_ANY_INIT {{{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}}}
+
+#define ipv6mr_interface ipv6mr_ifindex
+
+
+#endif /* _NETINET_IN6_H */
diff --git a/ndk/platforms/android-3/include/netinet/in_systm.h b/ndk/platforms/android-3/include/netinet/in_systm.h
new file mode 100644
index 0000000..ff53fb7
--- /dev/null
+++ b/ndk/platforms/android-3/include/netinet/in_systm.h
@@ -0,0 +1,59 @@
+/*	$NetBSD: in_systm.h,v 1.13 2005/12/10 23:36:23 elad Exp $	*/
+
+/*
+ * Copyright (c) 1982, 1986, 1993
+ *	The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ * 3. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
+ *
+ *	@(#)in_systm.h	8.1 (Berkeley) 6/10/93
+ */
+
+#ifndef _NETINET_IN_SYSTM_H_
+#define _NETINET_IN_SYSTM_H_
+
+/*
+ * Miscellaneous internetwork
+ * definitions for kernel.
+ */
+
+/*
+ * Network types.
+ *
+ * Internally the system keeps counters in the headers with the bytes
+ * swapped so that VAX instructions will work on them.  It reverses
+ * the bytes before transmission at each protocol level.  The n_ types
+ * represent the types with the bytes in ``high-ender'' order.
+ */
+typedef u_int16_t n_short;		/* short as received from the net */
+typedef u_int32_t n_long;		/* long as received from the net */
+
+typedef u_int32_t n_time;		/* ms since 00:00 GMT, byte rev */
+
+#ifdef _KERNEL
+n_time	 iptime (void);
+#endif
+
+#endif /* !_NETINET_IN_SYSTM_H_ */
diff --git a/ndk/platforms/android-3/include/netinet/ip.h b/ndk/platforms/android-3/include/netinet/ip.h
new file mode 100644
index 0000000..541905c
--- /dev/null
+++ b/ndk/platforms/android-3/include/netinet/ip.h
@@ -0,0 +1,275 @@
+/*	$OpenBSD: ip.h,v 1.12 2006/04/27 02:19:32 tedu Exp $	*/
+/*	$NetBSD: ip.h,v 1.9 1995/05/15 01:22:44 cgd Exp $	*/
+
+/*
+ * Copyright (c) 1982, 1986, 1993
+ *	The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ * 3. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
+ *
+ *	@(#)ip.h	8.1 (Berkeley) 6/10/93
+ */
+
+#ifndef _NETINET_IP_H_
+#define _NETINET_IP_H_
+
+#include <sys/cdefs.h>
+#include <sys/types.h>
+#include <endian.h>
+#include <netinet/in.h>
+#include <netinet/in_systm.h>
+
+__BEGIN_DECLS
+
+/*
+ * Definitions for internet protocol version 4.
+ * Per RFC 791, September 1981.
+ */
+#define	IPVERSION	4
+
+/*
+ * Structure of an internet header, naked of options.
+ */
+struct ip {
+#if BYTE_ORDER == LITTLE_ENDIAN
+	u_int32_t ip_hl:4,		/* header length */
+		  ip_v:4;		/* version */
+#endif
+#if BYTE_ORDER == BIG_ENDIAN
+	u_int32_t ip_v:4,		/* version */
+		  ip_hl:4;		/* header length */
+#endif
+	u_int8_t  ip_tos;		/* type of service */
+	u_int16_t ip_len;		/* total length */
+	u_int16_t ip_id;		/* identification */
+	u_int16_t ip_off;		/* fragment offset field */
+#define	IP_RF 0x8000			/* reserved fragment flag */
+#define	IP_DF 0x4000			/* dont fragment flag */
+#define	IP_MF 0x2000			/* more fragments flag */
+#define	IP_OFFMASK 0x1fff		/* mask for fragmenting bits */
+	u_int8_t  ip_ttl;		/* time to live */
+	u_int8_t  ip_p;			/* protocol */
+	u_int16_t ip_sum;		/* checksum */
+	struct	  in_addr ip_src, ip_dst; /* source and dest address */
+};
+
+#define	IP_MAXPACKET	65535		/* maximum packet size */
+
+/*
+ * Definitions for IP type of service (ip_tos)
+ */
+#define	IPTOS_LOWDELAY		0x10
+#define	IPTOS_THROUGHPUT	0x08
+#define	IPTOS_RELIABILITY	0x04
+/*	IPTOS_LOWCOST		0x02 XXX */
+#if 1
+/* ECN RFC3168 obsoletes RFC2481, and these will be deprecated soon. */
+#define IPTOS_CE		0x01	/* congestion experienced */
+#define IPTOS_ECT		0x02	/* ECN-capable transport */
+#endif
+
+/*
+ * Definitions for IP precedence (also in ip_tos) (hopefully unused)
+ */
+#define	IPTOS_PREC_NETCONTROL		0xe0
+#define	IPTOS_PREC_INTERNETCONTROL	0xc0
+#define	IPTOS_PREC_CRITIC_ECP		0xa0
+#define	IPTOS_PREC_FLASHOVERRIDE	0x80
+#define	IPTOS_PREC_FLASH		0x60
+#define	IPTOS_PREC_IMMEDIATE		0x40
+#define	IPTOS_PREC_PRIORITY		0x20
+#define	IPTOS_PREC_ROUTINE		0x00
+
+/*
+ * ECN (Explicit Congestion Notification) codepoints in RFC3168
+ * mapped to the lower 2 bits of the TOS field.
+ */
+#define	IPTOS_ECN_NOTECT	0x00	/* not-ECT */
+#define	IPTOS_ECN_ECT1		0x01	/* ECN-capable transport (1) */
+#define	IPTOS_ECN_ECT0		0x02	/* ECN-capable transport (0) */
+#define	IPTOS_ECN_CE		0x03	/* congestion experienced */
+#define	IPTOS_ECN_MASK		0x03	/* ECN field mask */
+
+/*
+ * Definitions for options.
+ */
+#define	IPOPT_COPIED(o)		((o)&0x80)
+#define	IPOPT_CLASS(o)		((o)&0x60)
+#define	IPOPT_NUMBER(o)		((o)&0x1f)
+
+#define	IPOPT_CONTROL		0x00
+#define	IPOPT_RESERVED1		0x20
+#define	IPOPT_DEBMEAS		0x40
+#define	IPOPT_RESERVED2		0x60
+
+#define	IPOPT_EOL		0		/* end of option list */
+#define	IPOPT_NOP		1		/* no operation */
+
+#define	IPOPT_RR		7		/* record packet route */
+#define	IPOPT_TS		68		/* timestamp */
+#define	IPOPT_SECURITY		130		/* provide s,c,h,tcc */
+#define	IPOPT_LSRR		131		/* loose source route */
+#define	IPOPT_SATID		136		/* satnet id */
+#define	IPOPT_SSRR		137		/* strict source route */
+
+/*
+ * Offsets to fields in options other than EOL and NOP.
+ */
+#define	IPOPT_OPTVAL		0		/* option ID */
+#define	IPOPT_OLEN		1		/* option length */
+#define	IPOPT_OFFSET		2		/* offset within option */
+#define	IPOPT_MINOFF		4		/* min value of above */
+
+/*
+ * Time stamp option structure.
+ */
+struct	ip_timestamp {
+	u_int8_t ipt_code;		/* IPOPT_TS */
+	u_int8_t ipt_len;		/* size of structure (variable) */
+	u_int8_t ipt_ptr;		/* index of current entry */
+#if _BYTE_ORDER == _LITTLE_ENDIAN
+	u_int32_t ipt_flg:4,		/* flags, see below */
+		  ipt_oflw:4;		/* overflow counter */
+#endif
+#if _BYTE_ORDER == _BIG_ENDIAN
+	u_int32_t ipt_oflw:4,		/* overflow counter */
+		  ipt_flg:4;		/* flags, see below */
+#endif
+	union ipt_timestamp {
+	n_time	ipt_time[1];
+	struct	ipt_ta {
+		struct in_addr ipt_addr;
+		n_time ipt_time;
+	} ipt_ta[1];
+	} ipt_timestamp;
+};
+
+/* flag bits for ipt_flg */
+#define	IPOPT_TS_TSONLY		0		/* timestamps only */
+#define	IPOPT_TS_TSANDADDR	1		/* timestamps and addresses */
+#define	IPOPT_TS_PRESPEC	3		/* specified modules only */
+
+/* bits for security (not byte swapped) */
+#define	IPOPT_SECUR_UNCLASS	0x0000
+#define	IPOPT_SECUR_CONFID	0xf135
+#define	IPOPT_SECUR_EFTO	0x789a
+#define	IPOPT_SECUR_MMMM	0xbc4d
+#define	IPOPT_SECUR_RESTR	0xaf13
+#define	IPOPT_SECUR_SECRET	0xd788
+#define	IPOPT_SECUR_TOPSECRET	0x6bc5
+
+/*
+ * Internet implementation parameters.
+ */
+#define	MAXTTL		255		/* maximum time to live (seconds) */
+#define	IPDEFTTL	64		/* default ttl, from RFC 1340 */
+#define	IPFRAGTTL	60		/* time to live for frags, slowhz */
+#define	IPTTLDEC	1		/* subtracted when forwarding */
+
+#define	IP_MSS		576		/* default maximum segment size */
+
+/*
+ * This is the real IPv4 pseudo header, used for computing the TCP and UDP
+ * checksums. For the Internet checksum, struct ipovly can be used instead.
+ * For stronger checksums, the real thing must be used.
+ */
+struct ippseudo {
+	struct    in_addr ippseudo_src;	/* source internet address */
+	struct    in_addr ippseudo_dst;	/* destination internet address */
+	u_int8_t  ippseudo_pad;		/* pad, must be zero */
+	u_int8_t  ippseudo_p;		/* protocol */
+	u_int16_t ippseudo_len;		/* protocol length */
+};
+
+/* BIONIC addition: declarations matching the Linux kernel */
+/*                  some programs expect these...          */
+
+#define IPOPT_OPTVAL 0
+#define IPOPT_OLEN   1
+#define IPOPT_OFFSET 2
+#define IPOPT_MINOFF 4
+#define MAX_IPOPTLEN 40
+
+#define IPOPT_COPY		0x80
+#define IPOPT_CLASS_MASK	0x60
+#define IPOPT_NUMBER_MASK	0x1f
+
+#define	IPOPT_CONTROL		0x00
+#define	IPOPT_RESERVED1		0x20
+#define	IPOPT_MEASUREMENT	0x40
+#define	IPOPT_RESERVED2		0x60
+
+#define IPOPT_END	(0 |IPOPT_CONTROL)
+#define IPOPT_NOOP	(1 |IPOPT_CONTROL)
+#define IPOPT_SEC	(2 |IPOPT_CONTROL|IPOPT_COPY)
+#define IPOPT_TIMESTAMP	(4 |IPOPT_MEASUREMENT)
+#define IPOPT_SID	(8 |IPOPT_CONTROL|IPOPT_COPY)
+#define IPOPT_RA	(20|IPOPT_CONTROL|IPOPT_COPY)
+
+struct iphdr {
+#if defined(__LITTLE_ENDIAN_BITFIELD)
+	uint8_t  ihl    :4,
+		 version:4;
+#elif defined (__BIG_ENDIAN_BITFIELD)
+	uint8_t  version:4,
+  		 ihl    :4;
+#else
+#error	"Please fix <asm/byteorder.h>"
+#endif
+	uint8_t	  tos;
+	uint16_t  tot_len;
+	uint16_t  id;
+	uint16_t  frag_off;
+	uint8_t   ttl;
+	uint8_t   protocol;
+	uint16_t  check;
+	int32_t   saddr;
+	int32_t   daddr;
+};
+
+struct ip_auth_hdr {
+	uint8_t  nexthdr;
+	uint8_t  hdrlen;
+	uint16_t reserved;
+	uint32_t spi;
+	uint32_t seq_no;
+	uint8_t  auth_data[0];
+};
+
+struct ip_esp_hdr {
+	uint32_t spi;
+	uint32_t seq_no;
+	uint8_t  enc_data[0];
+};
+
+struct ip_comp_hdr {
+	uint8_t  nexthdr;
+	uint8_t  flags;
+	uint16_t cpi;
+};
+
+__END_DECLS
+
+#endif /* _NETINET_IP_H_ */
diff --git a/ndk/platforms/android-3/include/netinet/ip_icmp.h b/ndk/platforms/android-3/include/netinet/ip_icmp.h
new file mode 100644
index 0000000..7510592
--- /dev/null
+++ b/ndk/platforms/android-3/include/netinet/ip_icmp.h
@@ -0,0 +1,214 @@
+/*	$OpenBSD: ip_icmp.h,v 1.21 2005/07/31 03:30:55 pascoe Exp $	*/
+/*	$NetBSD: ip_icmp.h,v 1.10 1996/02/13 23:42:28 christos Exp $	*/
+
+/*
+ * Copyright (c) 1982, 1986, 1993
+ *	The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ * 3. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
+ *
+ *	@(#)ip_icmp.h	8.1 (Berkeley) 6/10/93
+ */
+
+#ifndef _NETINET_IP_ICMP_H_
+#define _NETINET_IP_ICMP_H_
+
+#include <netinet/ip.h>
+#include <sys/cdefs.h>
+
+__BEGIN_DECLS
+
+/*
+ * Interface Control Message Protocol Definitions.
+ * Per RFC 792, September 1981.
+ * RFC 950, August 1985. (Address Mask Request / Reply)
+ * RFC 1256, September 1991. (Router Advertisement and Solicitation)
+ * RFC 1108, November 1991. (Param Problem, Missing Req. Option)
+ * RFC 1393, January 1993. (Traceroute)
+ * RFC 1475, June 1993. (Datagram Conversion Error)
+ * RFC 1812, June 1995. (adm prohib, host precedence, precedence cutoff)
+ * RFC 2002, October 1996. (Mobility changes to Router Advertisement)
+ */
+
+/*
+ * ICMP Router Advertisement data
+ */
+struct icmp_ra_addr {
+	uint32_t  ira_addr;
+	uint32_t  ira_preference;
+};
+
+/*
+ * Structure of an icmp header.
+ */
+struct icmp {
+	uint8_t  icmp_type;		/* type of message, see below */
+	uint8_t  icmp_code;		/* type sub code */
+	uint16_t icmp_cksum;		/* ones complement cksum of struct */
+	union {
+		uint8_t   ih_pptr;		/* ICMP_PARAMPROB */
+		struct in_addr ih_gwaddr;	/* ICMP_REDIRECT */
+		struct ih_idseq {
+			  uint16_t  icd_id;
+			  uint16_t  icd_seq;
+		} ih_idseq;
+		int32_t   ih_void;
+
+		/* ICMP_UNREACH_NEEDFRAG -- Path MTU Discovery (RFC1191) */
+		struct ih_pmtu {
+			  uint16_t  ipm_void;
+			  uint16_t  ipm_nextmtu;
+		} ih_pmtu;
+
+		struct ih_rtradv {
+			uint8_t   irt_num_addrs;
+			uint8_t   irt_wpa;
+			uint16_t  irt_lifetime;
+		} ih_rtradv;
+	} icmp_hun;
+#define	icmp_pptr	  icmp_hun.ih_pptr
+#define	icmp_gwaddr	  icmp_hun.ih_gwaddr
+#define	icmp_id		  icmp_hun.ih_idseq.icd_id
+#define	icmp_seq	  icmp_hun.ih_idseq.icd_seq
+#define	icmp_void	  icmp_hun.ih_void
+#define	icmp_pmvoid	  icmp_hun.ih_pmtu.ipm_void
+#define	icmp_nextmtu	  icmp_hun.ih_pmtu.ipm_nextmtu
+#define	icmp_num_addrs	  icmp_hun.ih_rtradv.irt_num_addrs
+#define	icmp_wpa	  icmp_hun.ih_rtradv.irt_wpa
+#define	icmp_lifetime	  icmp_hun.ih_rtradv.irt_lifetime
+	union {
+		struct id_ts {
+			  uint32_t  its_otime;
+			  uint32_t  its_rtime;
+			  uint32_t  its_ttime;
+		} id_ts;
+		struct id_ip  {
+			  struct ip idi_ip;
+			  /* options and then 64 bits of data */
+		} id_ip;
+		uint32_t  id_mask;
+		int8_t	  id_data[1];
+	} icmp_dun;
+#define	icmp_otime	  icmp_dun.id_ts.its_otime
+#define	icmp_rtime	  icmp_dun.id_ts.its_rtime
+#define	icmp_ttime	  icmp_dun.id_ts.its_ttime
+#define	icmp_ip		  icmp_dun.id_ip.idi_ip
+#define	icmp_mask	  icmp_dun.id_mask
+#define	icmp_data	  icmp_dun.id_data
+};
+
+/*
+ * For IPv6 transition related ICMP errors.
+ */
+#define	ICMP_V6ADVLENMIN	(8 + sizeof(struct ip) + 40)
+#define	ICMP_V6ADVLEN(p)	(8 + ((p)->icmp_ip.ip_hl << 2) + 40)
+
+/*
+ * Lower bounds on packet lengths for various types.
+ * For the error advice packets must first insure that the
+ * packet is large enough to contain the returned ip header.
+ * Only then can we do the check to see if 64 bits of packet
+ * data have been returned, since we need to check the returned
+ * ip header length.
+ */
+#define	ICMP_MINLEN	8				/* abs minimum */
+#define	ICMP_TSLEN	(8 + 3 * sizeof (n_time))	/* timestamp */
+#define	ICMP_MASKLEN	12				/* address mask */
+#define	ICMP_ADVLENMIN	(8 + sizeof (struct ip) + 8)	/* min */
+#define	ICMP_ADVLEN(p)	(8 + ((p)->icmp_ip.ip_hl << 2) + 8)
+	/* N.B.: must separately check that ip_hl >= 5 */
+
+/*
+ * Definition of type and code field values.
+ *	http://www.iana.org/assignments/icmp-parameters
+ */
+#define	ICMP_ECHOREPLY		0		/* echo reply */
+#define	ICMP_UNREACH		3		/* dest unreachable, codes: */
+#define	ICMP_UNREACH_NET		0	/* bad net */
+#define	ICMP_UNREACH_HOST		1	/* bad host */
+#define	ICMP_UNREACH_PROTOCOL		2	/* bad protocol */
+#define	ICMP_UNREACH_PORT		3	/* bad port */
+#define	ICMP_UNREACH_NEEDFRAG		4	/* IP_DF caused drop */
+#define	ICMP_UNREACH_SRCFAIL		5	/* src route failed */
+#define	ICMP_UNREACH_NET_UNKNOWN	6	/* unknown net */
+#define	ICMP_UNREACH_HOST_UNKNOWN	7	/* unknown host */
+#define	ICMP_UNREACH_ISOLATED		8	/* src host isolated */
+#define	ICMP_UNREACH_NET_PROHIB		9	/* for crypto devs */
+#define	ICMP_UNREACH_HOST_PROHIB	10	/* ditto */
+#define	ICMP_UNREACH_TOSNET		11	/* bad tos for net */
+#define	ICMP_UNREACH_TOSHOST		12	/* bad tos for host */
+#define	ICMP_UNREACH_FILTER_PROHIB	13	/* prohibited access */
+#define	ICMP_UNREACH_HOST_PRECEDENCE	14	/* precedence violat'n*/
+#define	ICMP_UNREACH_PRECEDENCE_CUTOFF	15	/* precedence cutoff */
+#define	ICMP_SOURCEQUENCH	4		/* packet lost, slow down */
+#define	ICMP_REDIRECT		5		/* shorter route, codes: */
+#define	ICMP_REDIRECT_NET	0		/* for network */
+#define	ICMP_REDIRECT_HOST	1		/* for host */
+#define	ICMP_REDIRECT_TOSNET	2		/* for tos and net */
+#define	ICMP_REDIRECT_TOSHOST	3		/* for tos and host */
+#define	ICMP_ALTHOSTADDR	6		/* alternate host address */
+#define	ICMP_ECHO		8		/* echo service */
+#define	ICMP_ROUTERADVERT	9		/* router advertisement */
+#define	ICMP_ROUTERADVERT_NORMAL		0	/* normal advertisement */
+#define	ICMP_ROUTERADVERT_NOROUTE_COMMON	16	/* selective routing */
+#define	ICMP_ROUTERSOLICIT	10		/* router solicitation */
+#define	ICMP_TIMXCEED		11		/* time exceeded, code: */
+#define	ICMP_TIMXCEED_INTRANS	0		/* ttl==0 in transit */
+#define	ICMP_TIMXCEED_REASS	1		/* ttl==0 in reass */
+#define	ICMP_PARAMPROB		12		/* ip header bad */
+#define	ICMP_PARAMPROB_ERRATPTR 0		/* req. opt. absent */
+#define	ICMP_PARAMPROB_OPTABSENT 1		/* req. opt. absent */
+#define	ICMP_PARAMPROB_LENGTH	2		/* bad length */
+#define	ICMP_TSTAMP		13		/* timestamp request */
+#define	ICMP_TSTAMPREPLY	14		/* timestamp reply */
+#define	ICMP_IREQ		15		/* information request */
+#define	ICMP_IREQREPLY		16		/* information reply */
+#define	ICMP_MASKREQ		17		/* address mask request */
+#define	ICMP_MASKREPLY		18		/* address mask reply */
+#define	ICMP_TRACEROUTE		30		/* traceroute */
+#define	ICMP_DATACONVERR	31		/* data conversion error */
+#define	ICMP_MOBILE_REDIRECT	32		/* mobile host redirect */
+#define	ICMP_IPV6_WHEREAREYOU	33		/* IPv6 where-are-you */
+#define	ICMP_IPV6_IAMHERE	34		/* IPv6 i-am-here */
+#define	ICMP_MOBILE_REGREQUEST	35		/* mobile registration req */
+#define	ICMP_MOBILE_REGREPLY	36		/* mobile registration reply */
+#define	ICMP_SKIP		39		/* SKIP */
+#define	ICMP_PHOTURIS		40		/* Photuris */
+#define	ICMP_PHOTURIS_UNKNOWN_INDEX	1	/* unknown sec index */
+#define	ICMP_PHOTURIS_AUTH_FAILED	2	/* auth failed */
+#define	ICMP_PHOTURIS_DECRYPT_FAILED	3	/* decrypt failed */
+
+#define	ICMP_MAXTYPE		40
+
+#define	ICMP_INFOTYPE(type) \
+	((type) == ICMP_ECHOREPLY || (type) == ICMP_ECHO || \
+	(type) == ICMP_ROUTERADVERT || (type) == ICMP_ROUTERSOLICIT || \
+	(type) == ICMP_TSTAMP || (type) == ICMP_TSTAMPREPLY || \
+	(type) == ICMP_IREQ || (type) == ICMP_IREQREPLY || \
+	(type) == ICMP_MASKREQ || (type) == ICMP_MASKREPLY)
+
+__END_DECLS
+
+#endif /* _NETINET_IP_ICMP_H_ */
diff --git a/ndk/platforms/android-3/include/netinet/tcp.h b/ndk/platforms/android-3/include/netinet/tcp.h
new file mode 100644
index 0000000..9adf904
--- /dev/null
+++ b/ndk/platforms/android-3/include/netinet/tcp.h
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _NETINET_TCP_H
+#define _NETINET_TCP_H
+
+#include <endian.h>		/* Include *before* linux/tcp.h */
+#include <linux/tcp.h>
+
+#endif /* _NETINET_TCP_H */
diff --git a/ndk/platforms/android-3/include/netinet/udp.h b/ndk/platforms/android-3/include/netinet/udp.h
new file mode 100644
index 0000000..25e0dfc
--- /dev/null
+++ b/ndk/platforms/android-3/include/netinet/udp.h
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _NETINET_UDP_H
+#define _NETINET_UDP_H
+
+/*
+ * We would include linux/udp.h, but it brings in too much other stuff
+ */
+
+#ifdef __FAVOR_BSD
+
+struct udphdr {
+    u_int16_t uh_sport;	/* source port */
+    u_int16_t uh_dport;	/* destination port */
+    u_int16_t uh_ulen;	/* udp length */
+    u_int16_t uh_sum;	/* udp checksum */
+};
+
+#else
+
+struct udphdr {
+    __u16  source;
+    __u16  dest;
+    __u16  len;
+    __u16  check;
+};
+
+#endif /* __FAVOR_BSD */
+
+#endif /* _NETINET_UDP_H */
diff --git a/ndk/platforms/android-3/include/netpacket/packet.h b/ndk/platforms/android-3/include/netpacket/packet.h
new file mode 100644
index 0000000..b5e8e0e
--- /dev/null
+++ b/ndk/platforms/android-3/include/netpacket/packet.h
@@ -0,0 +1 @@
+#include <linux/if_packet.h>
diff --git a/ndk/platforms/android-3/include/nsswitch.h b/ndk/platforms/android-3/include/nsswitch.h
new file mode 100644
index 0000000..0ddc74e
--- /dev/null
+++ b/ndk/platforms/android-3/include/nsswitch.h
@@ -0,0 +1,237 @@
+/*	$NetBSD: nsswitch.h,v 1.18 2005/11/29 03:12:58 christos Exp $	*/
+
+/*-
+ * Copyright (c) 1997, 1998, 1999, 2004 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Luke Mewburn.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *        This product includes software developed by the NetBSD
+ *        Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``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 FOUNDATION OR CONTRIBUTORS
+ * 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 _NSSWITCH_H
+#define _NSSWITCH_H	1
+
+#include <sys/types.h>
+#include <stdarg.h>
+
+#define	NSS_MODULE_INTERFACE_VERSION	0
+
+#ifndef _PATH_NS_CONF
+#define _PATH_NS_CONF	"/etc/nsswitch.conf"
+#endif
+
+#define	NS_CONTINUE	0
+#define	NS_RETURN	1
+
+/*
+ * Layout of:
+ *	uint32_t ns_src.flags
+ */
+	/* nsswitch.conf status codes and nsdispatch(3) return values */
+#define	NS_SUCCESS	(1<<0)		/* entry was found */
+#define	NS_UNAVAIL	(1<<1)		/* source not responding, or corrupt */
+#define	NS_NOTFOUND	(1<<2)		/* source responded 'no such entry' */
+#define	NS_TRYAGAIN	(1<<3)		/* source busy, may respond to retrys */
+#define	NS_STATUSMASK	0x000000ff	/* bitmask to get the status flags */
+
+	/* internal nsdispatch(3) flags; not settable in nsswitch.conf(5)  */
+#define	NS_FORCEALL	(1<<8)		/* force all methods to be invoked; */
+
+/*
+ * Currently implemented sources.
+ */
+#define NSSRC_FILES	"files"		/* local files */
+#define	NSSRC_DNS	"dns"		/* DNS; IN for hosts, HS for others */
+#define	NSSRC_NIS	"nis"		/* YP/NIS */
+#define	NSSRC_COMPAT	"compat"	/* passwd,group in YP compat mode */
+
+/*
+ * Currently implemented databases.
+ */
+#define NSDB_HOSTS		"hosts"
+#define NSDB_GROUP		"group"
+#define NSDB_GROUP_COMPAT	"group_compat"
+#define NSDB_NETGROUP		"netgroup"
+#define NSDB_NETWORKS		"networks"
+#define NSDB_PASSWD		"passwd"
+#define NSDB_PASSWD_COMPAT	"passwd_compat"
+#define NSDB_SHELLS		"shells"
+
+/*
+ * Suggested databases to implement.
+ */
+#define NSDB_ALIASES		"aliases"
+#define NSDB_AUTH		"auth"
+#define NSDB_AUTOMOUNT		"automount"
+#define NSDB_BOOTPARAMS		"bootparams"
+#define NSDB_ETHERS		"ethers"
+#define NSDB_EXPORTS		"exports"
+#define NSDB_NETMASKS		"netmasks"
+#define NSDB_PHONES		"phones"
+#define NSDB_PRINTCAP		"printcap"
+#define NSDB_PROTOCOLS		"protocols"
+#define NSDB_REMOTE		"remote"
+#define NSDB_RPC		"rpc"
+#define NSDB_SENDMAILVARS	"sendmailvars"
+#define NSDB_SERVICES		"services"
+#define NSDB_TERMCAP		"termcap"
+#define NSDB_TTYS		"ttys"
+
+/*
+ * ns_dtab `callback' function signature.
+ */
+typedef	int (*nss_method)(void *, void *, va_list);
+
+/*
+ * ns_dtab - `nsswitch dispatch table'
+ * Contains an entry for each source and the appropriate function to call.
+ */
+typedef struct {
+	const char	 *src;
+	nss_method	 callback;
+	void		 *cb_data;
+} ns_dtab;
+
+/*
+ * Macros to help build an ns_dtab[]
+ */
+#define NS_FILES_CB(F,C)	{ NSSRC_FILES,	F,	__UNCONST(C) },
+#define NS_COMPAT_CB(F,C)	{ NSSRC_COMPAT,	F,	__UNCONST(C) },
+
+#ifdef HESIOD
+#   define NS_DNS_CB(F,C)	{ NSSRC_DNS,	F,	__UNCONST(C) },
+#else
+#   define NS_DNS_CB(F,C)
+#endif
+
+#ifdef YP
+#   define NS_NIS_CB(F,C)	{ NSSRC_NIS,	F,	__UNCONST(C) },
+#else
+#   define NS_NIS_CB(F,C)
+#endif
+
+/*
+ * ns_src - `nsswitch source'
+ * Used by the nsparser routines to store a mapping between a source
+ * and its dispatch control flags for a given database.
+ */
+typedef struct {
+	const char	*name;
+	uint32_t	 flags;
+} ns_src;
+
+
+/*
+ * Default sourcelists (if nsswitch.conf is missing, corrupt,
+ * or the requested database doesn't have an entry)
+ */
+#if 0 /* MISSING FROM BIONIC */
+extern const ns_src __nsdefaultsrc[];
+extern const ns_src __nsdefaultcompat[];
+extern const ns_src __nsdefaultcompat_forceall[];
+extern const ns_src __nsdefaultfiles[];
+extern const ns_src __nsdefaultfiles_forceall[];
+extern const ns_src __nsdefaultnis[];
+extern const ns_src __nsdefaultnis_forceall[];
+#endif /* MISSING */
+
+/*
+ * ns_mtab - `nsswitch method table'
+ * An nsswitch module provides a mapping from (database name, method name)
+ * tuples to the nss_method and associated callback data.  Effectively,
+ * ns_dtab, but used for dynamically loaded modules.
+ */
+typedef struct {
+	const char	*database;
+	const char	*name;
+	nss_method	 method;
+	void		*mdata;
+} ns_mtab;
+
+/*
+ * nss_module_register_fn - module registration function
+ *	called at module load
+ * nss_module_unregister_fn - module un-registration function
+ *	called at module unload
+ */
+typedef	void (*nss_module_unregister_fn)(ns_mtab *, u_int);
+typedef	ns_mtab *(*nss_module_register_fn)(const char *, u_int *,
+					   nss_module_unregister_fn *);
+
+#ifdef _NS_PRIVATE
+
+/*
+ * Private data structures for back-end nsswitch implementation.
+ */
+
+/*
+ * ns_dbt - `nsswitch database thang'
+ * For each database in /etc/nsswitch.conf there is a ns_dbt, with its
+ * name and a list of ns_src's containing the source information.
+ */
+typedef struct {
+	const char	*name;		/* name of database */
+	ns_src		*srclist;	/* list of sources */
+	u_int		 srclistsize;	/* size of srclist */
+} ns_dbt;
+
+/*
+ * ns_mod - `nsswitch module'
+ */
+typedef struct {
+	const char	*name;		/* module name */
+	void		*handle;	/* handle from dlopen() */
+	ns_mtab		*mtab;		/* method table */
+	u_int		 mtabsize;	/* size of mtab */
+					/* called to unload module */
+	nss_module_unregister_fn unregister;
+} ns_mod;
+
+#endif /* _NS_PRIVATE */
+
+
+#include <sys/cdefs.h>
+
+__BEGIN_DECLS
+int	nsdispatch(void *, const ns_dtab [], const char *,
+			const char *, const ns_src [], ...);
+
+#ifdef _NS_PRIVATE
+int		 _nsdbtaddsrc(ns_dbt *, const ns_src *);
+void		 _nsdbtdump(const ns_dbt *);
+int		 _nsdbtput(const ns_dbt *);
+void		 _nsyyerror(const char *);
+int		 _nsyylex(void);
+#endif /* _NS_PRIVATE */
+
+__END_DECLS
+
+#endif /* !_NSSWITCH_H */
diff --git a/ndk/platforms/android-3/include/pathconf.h b/ndk/platforms/android-3/include/pathconf.h
new file mode 100644
index 0000000..94f9787
--- /dev/null
+++ b/ndk/platforms/android-3/include/pathconf.h
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _PATHCONF_H_
+#define _PATHCONF_H_
+
+#include <sys/cdefs.h>
+
+__BEGIN_DECLS
+
+/* constants to be used for the 'name' paremeter of pathconf/fpathconf */
+
+#define  _PC_FILESIZEBITS       0x0000
+#define  _PC_LINK_MAX           0x0001
+#define  _PC_MAX_CANON          0x0002
+#define  _PC_MAX_INPUT          0x0003
+#define  _PC_NAME_MAX           0x0004
+#define  _PC_PATH_MAX           0x0005
+#define  _PC_PIPE_BUF           0x0006
+#define  _PC_2_SYMLINKS         0x0007
+#define  _PC_ALLOC_SIZE_MIN     0x0008
+#define  _PC_REC_INCR_XFER_SIZE 0x0009
+#define  _PC_REC_MAX_XFER_SIZE  0x000a
+#define  _PC_REC_MIN_XFER_SIZE  0x000b
+#define  _PC_REC_XFER_ALIGN     0x000c
+#define  _PC_SYMLINK_MAX        0x000d
+#define  _PC_CHOWN_RESTRICTED   0x000e
+#define  _PC_NO_TRUNC           0x000f
+#define  _PC_VDISABLE           0x0010
+#define  _PC_ASYNC_IO           0x0011
+#define  _PC_PRIO_IO            0x0012
+#define  _PC_SYNC_IO            0x0013
+
+extern long fpathconf(int fildes, int name);
+extern long pathconf(const char *path, int name);
+
+__END_DECLS
+
+#endif /* _PATHCONF_H_ */
+
diff --git a/ndk/platforms/android-3/include/paths.h b/ndk/platforms/android-3/include/paths.h
new file mode 100644
index 0000000..a72162f
--- /dev/null
+++ b/ndk/platforms/android-3/include/paths.h
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 1989, 1993
+ *	The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
+ *
+ *	@(#)paths.h	8.1 (Berkeley) 6/2/93
+ */
+
+#ifndef _PATHS_H_
+#define	_PATHS_H_
+
+/* Default search path. */
+#define	_PATH_DEFPATH	"/usr/bin:/bin"
+/* All standard utilities path. */
+#define	_PATH_STDPATH \
+	"/usr/bin:/bin:/usr/sbin:/sbin"
+
+#define	_PATH_BSHELL	"/system/bin/sh"
+#define	_PATH_CONSOLE	"/dev/console"
+#define	_PATH_CSHELL	"/bin/csh"
+#define	_PATH_DEVDB	"/var/run/dev.db"
+#define	_PATH_DEVNULL	"/dev/null"
+#define	_PATH_DRUM	"/dev/drum"
+#define	_PATH_KLOG	"/proc/kmsg"
+#define	_PATH_KMEM	"/dev/kmem"
+#define	_PATH_LASTLOG	"/var/log/lastlog"
+#define	_PATH_MAILDIR	"/var/mail"
+#define	_PATH_MAN	"/usr/share/man"
+#define	_PATH_MEM	"/dev/mem"
+#define	_PATH_MNTTAB	"/etc/fstab"
+#define	_PATH_MOUNTED	"/etc/mtab"
+#define	_PATH_NOLOGIN	"/etc/nologin"
+#define	_PATH_PRESERVE	"/var/lib"
+#define	_PATH_RWHODIR	"/var/spool/rwho"
+#define	_PATH_SENDMAIL	"/usr/sbin/sendmail"
+#define	_PATH_SHADOW	"/etc/shadow"
+#define	_PATH_SHELLS	"/etc/shells"
+#define	_PATH_TTY	"/dev/tty"
+#define	_PATH_UNIX	"/boot/vmlinux"
+#define _PATH_UTMP	"/var/run/utmp"
+#define	_PATH_VI	"/bin/vi"
+#define _PATH_WTMP	"/var/log/wtmp"
+
+/* Provide trailing slash, since mostly used for building pathnames. */
+#define	_PATH_DEV	"/dev/"
+#define	_PATH_TMP	"/tmp/"
+#define	_PATH_VARDB	"/var/db/"
+#define	_PATH_VARRUN	"/var/run/"
+#define	_PATH_VARTMP	"/var/tmp/"
+
+#endif /* !_PATHS_H_ */
diff --git a/ndk/platforms/android-3/include/poll.h b/ndk/platforms/android-3/include/poll.h
new file mode 100644
index 0000000..560be89
--- /dev/null
+++ b/ndk/platforms/android-3/include/poll.h
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _POLL_H_
+#define _POLL_H_
+
+#include <sys/cdefs.h>
+#include <linux/poll.h>
+
+__BEGIN_DECLS
+
+typedef unsigned int  nfds_t;
+
+/* POSIX specifies "int" for the timeout, Linux seems to use long... */
+extern int poll(struct pollfd *, nfds_t, long);
+
+__END_DECLS
+
+#endif /* _POLL_H_ */
diff --git a/ndk/platforms/android-3/include/pthread.h b/ndk/platforms/android-3/include/pthread.h
new file mode 100644
index 0000000..e3afdae
--- /dev/null
+++ b/ndk/platforms/android-3/include/pthread.h
@@ -0,0 +1,243 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _PTHREAD_H_
+#define _PTHREAD_H_
+
+#include <time.h>
+#include <signal.h>
+#include <sched.h>
+#include <limits.h>
+#include <sys/types.h>
+
+/*
+ * Types
+ */
+typedef struct
+{
+    int volatile value;
+} pthread_mutex_t;
+
+#define  PTHREAD_MUTEX_INITIALIZER             {0}
+#define  PTHREAD_RECURSIVE_MUTEX_INITIALIZER   {0x4000}
+#define  PTHREAD_ERRORCHECK_MUTEX_INITIALIZER  {0x8000}
+
+enum {
+    PTHREAD_MUTEX_NORMAL = 0,
+    PTHREAD_MUTEX_RECURSIVE = 1,
+    PTHREAD_MUTEX_ERRORCHECK = 2,
+
+    PTHREAD_MUTEX_ERRORCHECK_NP = PTHREAD_MUTEX_ERRORCHECK,
+    PTHREAD_MUTEX_RECURSIVE_NP  = PTHREAD_MUTEX_RECURSIVE,
+
+    PTHREAD_MUTEX_DEFAULT = PTHREAD_MUTEX_NORMAL
+};
+
+
+
+typedef struct
+{
+    int volatile value;
+} pthread_cond_t;
+
+typedef struct
+{
+    uint32_t flags;
+    void * stack_base;
+    size_t stack_size;
+    size_t guard_size;
+    int32_t sched_policy;
+    int32_t sched_priority;
+} pthread_attr_t;
+
+typedef long pthread_mutexattr_t;
+typedef long pthread_condattr_t;
+
+typedef int pthread_key_t;
+typedef long pthread_t;
+
+typedef volatile int  pthread_once_t;
+
+/*
+ * Defines
+ */
+#define PTHREAD_COND_INITIALIZER  {0}
+
+#define PTHREAD_STACK_MIN (2 * PAGE_SIZE)
+
+#define PTHREAD_CREATE_DETACHED  0x00000001
+#define PTHREAD_CREATE_JOINABLE  0x00000000
+
+#define PTHREAD_ONCE_INIT    0
+
+#define PTHREAD_PROCESS_PRIVATE  0
+#define PTHREAD_PROCESS_SHARED   1
+
+#define PTHREAD_SCOPE_SYSTEM     0
+#define PTHREAD_SCOPE_PROCESS    1
+
+/*
+ * Prototypes
+ */
+#if __cplusplus
+extern "C" {
+#endif
+
+int pthread_attr_init(pthread_attr_t * attr);
+int pthread_attr_destroy(pthread_attr_t * attr);
+
+int pthread_attr_setdetachstate(pthread_attr_t * attr, int state);
+int pthread_attr_getdetachstate(pthread_attr_t const * attr, int * state);
+
+int pthread_attr_setschedpolicy(pthread_attr_t * attr, int policy);
+int pthread_attr_getschedpolicy(pthread_attr_t const * attr, int * policy);
+
+int pthread_attr_setschedparam(pthread_attr_t * attr, struct sched_param const * param);
+int pthread_attr_getschedparam(pthread_attr_t const * attr, struct sched_param * param);
+
+int pthread_attr_setstacksize(pthread_attr_t * attr, size_t stack_size);
+int pthread_attr_getstacksize(pthread_attr_t const * attr, size_t * stack_size);
+
+int pthread_attr_setstackaddr(pthread_attr_t * attr, void * stackaddr);
+int pthread_attr_getstackaddr(pthread_attr_t const * attr, void ** stackaddr);
+
+int pthread_attr_setstack(pthread_attr_t * attr, void * stackaddr, size_t stack_size);
+int pthread_attr_getstack(pthread_attr_t const * attr, void ** stackaddr, size_t * stack_size);
+
+int pthread_attr_setguardsize(pthread_attr_t * attr, size_t guard_size);
+int pthread_attr_getguardsize(pthread_attr_t const * attr, size_t * guard_size);
+
+int pthread_attr_setscope(pthread_attr_t *attr, int  scope);
+int pthread_attr_getscope(pthread_attr_t const *attr);
+
+int pthread_getattr_np(pthread_t thid, pthread_attr_t * attr);
+
+int pthread_create(pthread_t *thread, pthread_attr_t const * attr,
+                   void *(*start_routine)(void *), void * arg);
+void pthread_exit(void * retval);
+int pthread_join(pthread_t thid, void ** ret_val);
+int pthread_detach(pthread_t  thid);
+
+pthread_t pthread_self(void);
+int pthread_equal(pthread_t one, pthread_t two);
+
+int pthread_getschedparam(pthread_t thid, int * policy,
+                          struct sched_param * param);
+int pthread_setschedparam(pthread_t thid, int poilcy,
+                          struct sched_param const * param);
+
+int pthread_mutexattr_init(pthread_mutexattr_t *attr);
+int pthread_mutexattr_destroy(pthread_mutexattr_t *attr);
+int pthread_mutexattr_gettype(const pthread_mutexattr_t *attr, int *type);
+int pthread_mutexattr_settype(pthread_mutexattr_t *attr, int type);
+int pthread_mutexattr_setpshared(pthread_mutexattr_t *attr, int  pshared);
+int pthread_mutexattr_getpshared(pthread_mutexattr_t *attr, int *pshared);
+
+int pthread_mutex_init(pthread_mutex_t *mutex,
+                       const pthread_mutexattr_t *attr);
+int pthread_mutex_destroy(pthread_mutex_t *mutex);
+int pthread_mutex_lock(pthread_mutex_t *mutex);
+int pthread_mutex_unlock(pthread_mutex_t *mutex);
+int pthread_mutex_trylock(pthread_mutex_t *mutex);
+int pthread_mutex_timedlock(pthread_mutex_t *mutex, struct timespec*  ts);
+
+int pthread_cond_init(pthread_cond_t *cond,
+                      const pthread_condattr_t *attr);
+int pthread_cond_destroy(pthread_cond_t *cond);
+int pthread_cond_broadcast(pthread_cond_t *cond);
+int pthread_cond_signal(pthread_cond_t *cond);
+int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex);
+int pthread_cond_timedwait(pthread_cond_t *cond,
+                           pthread_mutex_t * mutex,
+                           const struct timespec *abstime);
+
+/* BIONIC: same as pthread_cond_timedwait, except the 'abstime' given refers
+ *         to the CLOCK_MONOTONIC clock instead, to avoid any problems when
+ *         the wall-clock time is changed brutally
+ */
+int pthread_cond_timedwait_monotonic(pthread_cond_t         *cond,
+                                     pthread_mutex_t        *mutex,
+                                     const struct timespec  *abstime);
+
+int pthread_cond_timeout_np(pthread_cond_t *cond,
+                            pthread_mutex_t * mutex,
+                            unsigned msecs);
+
+int pthread_key_create(pthread_key_t *key, void (*destructor_function)(void *));
+int pthread_key_delete (pthread_key_t);
+int pthread_setspecific(pthread_key_t key, const void *value);
+void *pthread_getspecific(pthread_key_t key);
+
+int pthread_kill(pthread_t tid, int sig);
+int pthread_sigmask(int how, const sigset_t *set, sigset_t *oset);
+
+int pthread_getcpuclockid(pthread_t  tid, clockid_t  *clockid);
+
+int pthread_once(pthread_once_t  *once_control, void (*init_routine)(void));
+
+typedef void  (*__pthread_cleanup_func_t)(void*);
+
+typedef struct __pthread_cleanup_t {
+    struct __pthread_cleanup_t*   __cleanup_prev;
+    __pthread_cleanup_func_t      __cleanup_routine;
+    void*                         __cleanup_arg;
+} __pthread_cleanup_t;
+
+extern void  __pthread_cleanup_push(__pthread_cleanup_t*      c,
+                                    __pthread_cleanup_func_t  routine,
+                                    void*                     arg);
+
+extern void  __pthread_cleanup_pop(__pthread_cleanup_t*  c,
+                                   int                   execute);
+
+/* Believe or not, the definitions of pthread_cleanup_push and
+ * pthread_cleanup_pop below are correct. Posix states that these
+ * can be implemented as macros that might introduce opening and
+ * closing braces, and that using setjmp/longjmp/return/break/continue
+ * between them results in undefined behaviour.
+ *
+ * And indeed, GLibc and other C libraries use a similar definition
+ */
+#define  pthread_cleanup_push(routine, arg)                      \
+    do {                                                         \
+        __pthread_cleanup_t  __cleanup;                          \
+        __pthread_cleanup_push( &__cleanup, (routine), (arg) );  \
+
+#define  pthread_cleanup_pop(execute)                  \
+        __pthread_cleanup_pop( &__cleanup, (execute)); \
+    } while (0);
+
+#if __cplusplus
+} /* extern "C" */
+#endif
+
+/************ TO FIX ************/
+
+#define LONG_LONG_MAX __LONG_LONG_MAX__
+#define LONG_LONG_MIN (-__LONG_LONG_MAX__ - 1)
+
+#endif // _PTHREAD_H_
diff --git a/ndk/platforms/android-3/include/pwd.h b/ndk/platforms/android-3/include/pwd.h
new file mode 100644
index 0000000..1e85efd
--- /dev/null
+++ b/ndk/platforms/android-3/include/pwd.h
@@ -0,0 +1,127 @@
+/*-
+ * Copyright (c) 1989, 1993
+ *	The Regents of the University of California.  All rights reserved.
+ * (c) UNIX System Laboratories, Inc.
+ * All or some portions of this file are derived from material licensed
+ * to the University of California by American Telephone and Telegraph
+ * Co. or Unix System Laboratories, Inc. and are reproduced herein with
+ * the permission of UNIX System Laboratories, Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ * 3. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
+ *
+ *	@(#)pwd.h	8.2 (Berkeley) 1/21/94
+ */
+
+/*-
+ * Portions Copyright(C) 1995, Jason Downs.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``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(S) 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 _PWD_H_
+#define _PWD_H_
+
+#include <sys/cdefs.h>
+#include <sys/types.h>
+
+#define _PATH_PASSWD        "/etc/passwd"
+#define _PATH_MASTERPASSWD  "/etc/master.passwd"
+#define _PATH_MASTERPASSWD_LOCK "/etc/ptmp"
+
+#define _PATH_PASSWD_CONF   "/etc/passwd.conf"
+#define _PATH_PASSWDCONF    _PATH_PASSWD_CONF   /* XXX: compat */
+#define _PATH_USERMGMT_CONF "/etc/usermgmt.conf"
+
+#define _PATH_MP_DB     "/etc/pwd.db"
+#define _PATH_SMP_DB        "/etc/spwd.db"
+
+#define _PATH_PWD_MKDB      "/usr/sbin/pwd_mkdb"
+
+#define _PW_KEYBYNAME       '1' /* stored by name */
+#define _PW_KEYBYNUM        '2' /* stored by entry in the "file" */
+#define _PW_KEYBYUID        '3' /* stored by uid */
+
+#define _PASSWORD_EFMT1     '_' /* extended DES encryption format */
+#define _PASSWORD_NONDES    '$' /* non-DES encryption formats */
+
+#define _PASSWORD_LEN       128 /* max length, not counting NUL */
+
+#define _PASSWORD_NOUID     0x01    /* flag for no specified uid. */
+#define _PASSWORD_NOGID     0x02    /* flag for no specified gid. */
+#define _PASSWORD_NOCHG     0x04    /* flag for no specified change. */
+#define _PASSWORD_NOEXP     0x08    /* flag for no specified expire. */
+
+#define _PASSWORD_OLDFMT    0x10    /* flag to expect an old style entry */
+#define _PASSWORD_NOWARN    0x20    /* no warnings for bad entries */
+
+#define _PASSWORD_WARNDAYS  14  /* days to warn about expiry */
+#define _PASSWORD_CHGNOW    -1  /* special day to force password change at next login */
+
+struct passwd
+{
+    char* pw_name;
+    char* pw_passwd;
+    uid_t pw_uid;
+    gid_t pw_gid;
+    char* pw_dir;
+    char* pw_shell;
+};
+
+__BEGIN_DECLS
+
+struct passwd* getpwnam(const char*);
+struct passwd* getpwuid(uid_t);
+
+void endpwent(void);
+
+#if 0 /* MISSING FROM BIONIC */
+int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);
+int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);
+struct passwd* getpwent(void);
+int setpwent(void);
+#endif /* MISSING */
+
+__END_DECLS
+
+#endif
diff --git a/ndk/platforms/android-3/include/resolv.h b/ndk/platforms/android-3/include/resolv.h
new file mode 100644
index 0000000..4247d68
--- /dev/null
+++ b/ndk/platforms/android-3/include/resolv.h
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _RESOLV_H_
+#define _RESOLV_H_
+
+#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/cdefs.h>
+#include <sys/socket.h>
+#include <stdio.h>
+#include <arpa/nameser.h>
+
+__BEGIN_DECLS
+
+struct res_state;
+
+extern struct __res_state *__res_state(void);
+#define _res (*__res_state())
+
+/* Base-64 functions - because some code expects it there */
+
+#define b64_ntop        __b64_ntop
+#define b64_pton        __b64_pton
+extern int   b64_ntop(u_char const *, size_t, char *, size_t);
+extern int   b64_pton(char const *, u_char *, size_t);
+
+__END_DECLS
+
+#endif /* _RESOLV_H_ */
diff --git a/ndk/platforms/android-3/include/sched.h b/ndk/platforms/android-3/include/sched.h
new file mode 100644
index 0000000..2be511b
--- /dev/null
+++ b/ndk/platforms/android-3/include/sched.h
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _SCHED_H_
+#define _SCHED_H_
+
+#include <sys/cdefs.h>
+#include <sys/time.h>
+
+__BEGIN_DECLS
+
+#define SCHED_NORMAL            0
+#define SCHED_OTHER             0
+#define SCHED_FIFO              1
+#define SCHED_RR                2
+
+struct sched_param {
+    int sched_priority;
+};
+
+extern int sched_setscheduler(pid_t, int, const struct sched_param *);
+extern int sched_getscheduler(pid_t);
+extern int sched_yield(void);
+extern int sched_get_priority_max(int policy);
+extern int sched_get_priority_min(int policy);
+extern int sched_setparam(pid_t, const struct sched_param *);
+extern int sched_getparam(pid_t, struct sched_param *);
+extern int sched_rr_get_interval(pid_t pid, struct timespec *tp);
+
+__END_DECLS
+
+#endif /* _SCHED_H_ */
diff --git a/ndk/platforms/android-3/include/semaphore.h b/ndk/platforms/android-3/include/semaphore.h
new file mode 100644
index 0000000..30e3123
--- /dev/null
+++ b/ndk/platforms/android-3/include/semaphore.h
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _SEMAPHORE_H
+#define _SEMAPHORE_H
+
+#include <sys/cdefs.h>
+
+__BEGIN_DECLS
+
+typedef struct {
+    volatile unsigned int  count;
+} sem_t;
+
+#define  SEM_FAILED  NULL
+
+extern int sem_init(sem_t *sem, int pshared, unsigned int value);
+
+extern int    sem_close(sem_t *);
+extern int    sem_destroy(sem_t *);
+extern int    sem_getvalue(sem_t *, int *);
+extern int    sem_init(sem_t *, int, unsigned int);
+extern sem_t *sem_open(const char *, int, ...);
+extern int    sem_post(sem_t *);
+extern int    sem_trywait(sem_t *);
+extern int    sem_unlink(const char *);
+extern int    sem_wait(sem_t *);
+
+struct timespec;
+extern int    sem_timedwait(sem_t *sem, const struct timespec *abs_timeout);
+
+__END_DECLS
+
+#endif /* _SEMAPHORE_H */
diff --git a/ndk/platforms/android-3/include/setjmp.h b/ndk/platforms/android-3/include/setjmp.h
new file mode 100644
index 0000000..68fdcef
--- /dev/null
+++ b/ndk/platforms/android-3/include/setjmp.h
@@ -0,0 +1,63 @@
+/*	$OpenBSD: setjmp.h,v 1.5 2005/12/13 00:35:22 millert Exp $	*/
+/*	$NetBSD: setjmp.h,v 1.11 1994/12/20 10:35:44 cgd Exp $	*/
+
+/*-
+ * Copyright (c) 1990, 1993
+ *	The Regents of the University of California.  All rights reserved.
+ * (c) UNIX System Laboratories, Inc.
+ * All or some portions of this file are derived from material licensed
+ * to the University of California by American Telephone and Telegraph
+ * Co. or Unix System Laboratories, Inc. and are reproduced herein with
+ * the permission of UNIX System Laboratories, Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ * 3. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
+ *
+ *	@(#)setjmp.h	8.2 (Berkeley) 1/21/94
+ */
+
+#ifndef _SETJMP_H_
+#define _SETJMP_H_
+
+#include <sys/cdefs.h>
+#include <machine/setjmp.h>
+
+typedef long sigjmp_buf[_JBLEN + 1];
+typedef long jmp_buf[_JBLEN];
+
+__BEGIN_DECLS
+
+int     _setjmp(jmp_buf);
+void    _longjmp(jmp_buf, int);
+void    longjmperror(void);
+
+int     setjmp(jmp_buf);
+void    longjmp(jmp_buf, int);
+
+int     sigsetjmp(sigjmp_buf, int);
+void    siglongjmp(sigjmp_buf, int);
+
+__END_DECLS
+
+#endif /* !_SETJMP_H_ */
diff --git a/ndk/platforms/android-3/include/sgtty.h b/ndk/platforms/android-3/include/sgtty.h
new file mode 100644
index 0000000..d433266
--- /dev/null
+++ b/ndk/platforms/android-3/include/sgtty.h
@@ -0,0 +1,50 @@
+/*	$NetBSD: sgtty.h,v 1.8 2005/02/03 04:39:32 perry Exp $	*/
+
+/*
+ * Copyright (c) 1985, 1993
+ *	The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ * 3. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
+ *
+ *	@(#)sgtty.h	8.1 (Berkeley) 6/2/93
+ */
+
+#ifndef _SGTTY_H_
+#define _SGTTY_H_
+
+#ifndef USE_OLD_TTY
+#define	USE_OLD_TTY
+#endif
+#include <sys/ioctl.h>
+#include <sys/cdefs.h>
+
+__BEGIN_DECLS
+#if 0 /* MISSING FROM BIONIC */
+int gtty(int, struct sgttyb *);
+int stty(int, struct sgttyb *);
+#endif /* MISSING */
+__END_DECLS
+
+#endif /* _SGTTY_H_ */
diff --git a/ndk/platforms/android-3/include/sha1.h b/ndk/platforms/android-3/include/sha1.h
new file mode 100644
index 0000000..f7ada46
--- /dev/null
+++ b/ndk/platforms/android-3/include/sha1.h
@@ -0,0 +1,31 @@
+/*	$NetBSD: sha1.h,v 1.13 2005/12/26 18:41:36 perry Exp $	*/
+
+/*
+ * SHA-1 in C
+ * By Steve Reid <steve@edmweb.com>
+ * 100% Public Domain
+ */
+
+#ifndef _SYS_SHA1_H_
+#define	_SYS_SHA1_H_
+
+#include <sys/cdefs.h>
+#include <sys/types.h>
+
+#define SHA1_DIGEST_LENGTH		20
+#define SHA1_DIGEST_STRING_LENGTH	41
+
+typedef struct {
+	uint32_t state[5];
+	uint32_t count[2];
+	u_char buffer[64];
+} SHA1_CTX;
+
+__BEGIN_DECLS
+void	SHA1Transform(uint32_t[5], const u_char[64]);
+void	SHA1Init(SHA1_CTX *);
+void	SHA1Update(SHA1_CTX *, const u_char *, u_int);
+void	SHA1Final(u_char[SHA1_DIGEST_LENGTH], SHA1_CTX *);
+__END_DECLS
+
+#endif /* _SYS_SHA1_H_ */
diff --git a/ndk/platforms/android-3/include/signal.h b/ndk/platforms/android-3/include/signal.h
new file mode 100644
index 0000000..5540847
--- /dev/null
+++ b/ndk/platforms/android-3/include/signal.h
@@ -0,0 +1,125 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _SIGNAL_H_
+#define _SIGNAL_H_
+
+#include <sys/cdefs.h>
+#include <limits.h>		/* For LONG_BIT */
+#include <string.h>		/* For memset() */
+#include <sys/types.h>
+#include <asm/signal.h>
+
+#define __ARCH_SI_UID_T __kernel_uid32_t
+#include <asm/siginfo.h>
+#undef __ARCH_SI_UID_T
+
+__BEGIN_DECLS
+
+typedef int sig_atomic_t;
+
+/* crepy NIG / _NSIG handling, just to be safe */
+#ifndef NSIG
+#  define NSIG  _NSIG
+#endif
+#ifndef _NSIG
+#  define _NSIG  NSIG
+#endif
+
+extern const char * const sys_siglist[];
+
+static __inline__ int sigismember(sigset_t *set, int signum)
+{
+    unsigned long *local_set = (unsigned long *)set;
+    signum--;
+    return (int)((local_set[signum/LONG_BIT] >> (signum%LONG_BIT)) & 1);
+}
+
+
+static __inline__ int sigaddset(sigset_t *set, int signum)
+{
+    unsigned long *local_set = (unsigned long *)set;
+    signum--;
+    local_set[signum/LONG_BIT] |= 1UL << (signum%LONG_BIT);
+    return 0;
+}
+
+
+static __inline__ int sigdelset(sigset_t *set, int signum)
+{
+    unsigned long *local_set = (unsigned long *)set;
+    signum--;
+    local_set[signum/LONG_BIT] &= ~(1UL << (signum%LONG_BIT));
+    return 0;
+}
+
+
+static __inline__ int sigemptyset(sigset_t *set)
+{
+    memset(set, 0, sizeof *set);
+    return 0;
+}
+
+static __inline__ int sigfillset(sigset_t *set)
+{
+    memset(set, ~0, sizeof *set);
+    return 0;
+}
+
+
+/* compatibility types */
+typedef void  (*sig_t)(int);
+typedef sig_t sighandler_t;
+
+/* differentiater between sysv and bsd behaviour 8*/
+extern __sighandler_t sysv_signal(int, __sighandler_t);
+extern __sighandler_t bsd_signal(int, __sighandler_t);
+
+/* the default is bsd */
+static __inline__ __sighandler_t signal(int s, __sighandler_t f)
+{
+    return bsd_signal(s,f);
+}
+
+/* the syscall itself */
+extern __sighandler_t __signal(int, __sighandler_t, int);
+
+extern int sigprocmask(int, const sigset_t *, sigset_t *);
+extern int sigaction(int, const struct sigaction *, struct sigaction *);
+
+extern int sigpending(sigset_t *);
+extern int sigsuspend(const sigset_t *);
+extern int sigwait(const sigset_t *set, int *sig);
+extern int siginterrupt(int  sig, int  flag);
+
+extern int raise(int);
+extern int kill(pid_t, int);
+
+
+__END_DECLS
+
+#endif /* _SIGNAL_H_ */
diff --git a/ndk/platforms/android-3/include/stdint.h b/ndk/platforms/android-3/include/stdint.h
new file mode 100644
index 0000000..237baa2
--- /dev/null
+++ b/ndk/platforms/android-3/include/stdint.h
@@ -0,0 +1,266 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _STDINT_H
+#define _STDINT_H
+
+#include <stddef.h>
+#include <sys/_types.h>
+
+
+
+#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS)
+#  define __STDINT_LIMITS
+#endif
+
+#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS)
+#  define  __STDINT_MACROS
+#endif
+
+/* the definitions of STDINT_LIMITS depend on those of STDINT_MACROS */
+#if defined __STDINT_LIMITS && !defined __STDINT_MACROS
+#  define  __STDINT_MACROS
+#endif
+
+#if !defined __STRICT_ANSI__ || __STDC_VERSION__ >= 199901L
+#  define __STDC_INT64__
+#endif
+
+typedef __int8_t      int8_t;
+typedef __uint8_t     uint8_t;
+typedef __int16_t     int16_t;
+typedef __uint16_t    uint16_t;
+typedef __int32_t     int32_t;
+typedef __uint32_t    uint32_t;
+#if defined(__STDC_INT64__)
+typedef __int64_t     int64_t;
+typedef __uint64_t    uint64_t;
+#endif
+
+/*
+ * int8_t & uint8_t
+ */
+
+typedef int8_t        int_least8_t;
+typedef int8_t        int_fast8_t;
+
+typedef uint8_t       uint_least8_t;
+typedef uint8_t       uint_fast8_t;
+
+#ifdef __STDINT_LIMITS
+#  define INT8_MIN         (-128)
+#  define INT8_MAX         (127)
+#  define INT_LEAST8_MIN   INT8_MIN
+#  define INT_LEAST8_MAX   INT8_MAX
+#  define INT_FAST8_MIN    INT8_MIN
+#  define INT_FAST8_MAX    INT8_MAX
+
+#  define UINT8_MAX           (255U)
+#  define UINT_LEAST8_MAX     UINT8_MAX
+#  define UINT_FAST8_MAX      UINT8_MAX
+#endif
+
+#ifdef __STDINT_MACROS
+#  define INT8_C(c)	c
+#  define INT_LEAST8_C(c)	 INT8_C(c)
+#  define INT_FAST8_C(c)	INT8_C(c)
+
+#  define UINT8_C(c)	c ## U
+#  define UINT_LEAST8_C(c)  UINT8_C(c)
+#  define UINT_FAST8_C(c)  UINT8_C(c)
+#endif
+
+/*
+ * int16_t & uint16_t
+ */
+
+
+typedef int16_t       int_least16_t;
+typedef int32_t       int_fast16_t;
+
+typedef uint16_t      uint_least16_t;
+typedef uint32_t      uint_fast16_t;
+
+#ifdef __STDINT_LIMITS
+#  define INT16_MIN	(-32768)
+#  define INT16_MAX	(32767)
+#  define INT_LEAST16_MIN	INT16_MIN
+#  define INT_LEAST16_MAX	INT16_MAX
+#  define INT_FAST16_MIN	INT32_MIN
+#  define INT_FAST16_MAX	INT32_MAX
+
+#  define UINT16_MAX	(65535U)
+#  define UINT_LEAST16_MAX UINT16_MAX
+#  define UINT_FAST16_MAX UINT32_MAX
+#endif
+
+#ifdef __STDINT_MACROS
+#  define INT16_C(c)	c
+#  define INT_LEAST16_C(c) INT16_C(c)
+#  define INT_FAST16_C(c)	 INT32_C(c)
+
+#  define UINT16_C(c)	c ## U
+#  define UINT_LEAST16_C(c) UINT16_C(c)
+#  define UINT_FAST16_C(c) UINT32_C(c)
+#endif
+
+/*
+ * int32_t & uint32_t
+ */
+
+typedef int32_t       int_least32_t;
+typedef int32_t       int_fast32_t;
+
+typedef uint32_t      uint_least32_t;
+typedef uint32_t      uint_fast32_t;
+
+#ifdef __STDINT_LIMITS
+#  define INT32_MIN	(-2147483647-1)
+#  define INT32_MAX	(2147483647)
+#  define INT_LEAST32_MIN	INT32_MIN
+#  define INT_LEAST32_MAX	INT32_MAX
+#  define INT_FAST32_MIN	INT32_MIN
+#  define INT_FAST32_MAX	INT32_MAX
+
+#  define UINT32_MAX	(4294967295U)
+#  define UINT_LEAST32_MAX UINT32_MAX
+#  define UINT_FAST32_MAX UINT32_MAX
+#endif
+
+#ifdef __STDINT_MACROS
+#  define INT32_C(c)	c
+#  define INT_LEAST32_C(c) INT32_C(c)
+#  define INT_FAST32_C(c)  INT32_C(c)
+
+#  define UINT32_C(c)	c ## U
+#  define UINT_LEAST32_C(c) UINT32_C(c)
+#  define UINT_FAST32_C(c) UINT32_C(c)
+#endif
+
+#if defined(__STDC_INT64__)
+/*
+ *  int64_t
+ */
+typedef int64_t       int_least64_t;
+typedef int64_t       int_fast64_t;
+
+typedef uint64_t      uint_least64_t;
+typedef uint64_t      uint_fast64_t;
+
+
+#ifdef __STDINT_LIMITS
+#  define INT64_MIN        (__INT64_C(-9223372036854775807)-1)
+#  define INT64_MAX        (__INT64_C(9223372036854775807))
+#  define INT_LEAST64_MIN  INT64_MIN
+#  define INT_LEAST64_MAX  INT64_MAX
+#  define INT_FAST64_MIN   INT64_MIN
+#  define INT_FAST64_MAX   INT64_MAX
+#  define UINT64_MAX       (__UINT64_C(18446744073709551615))
+
+#  define UINT_LEAST64_MAX UINT64_MAX
+#  define UINT_FAST64_MAX UINT64_MAX
+#endif
+
+#ifdef __STDINT_MACROS
+#  define __INT64_C(c)     c ## LL
+#  define INT64_C(c)       __INT64_C(c)
+#  define INT_LEAST64_C(c) INT64_C(c)
+#  define INT_FAST64_C(c)  INT64_C(c)
+
+#  define __UINT64_C(c)     c ## ULL
+#  define UINT64_C(c)       __UINT64_C(c)
+#  define UINT_LEAST64_C(c) UINT64_C(c)
+#  define UINT_FAST64_C(c)  UINT64_C(c)
+#endif
+
+
+#  define __PRI64_RANK   "ll"
+#  define __PRIFAST_RANK ""
+#  define __PRIPTR_RANK  ""
+
+#endif /* __STDC_INT64__ */
+
+/*
+ * intptr_t & uintptr_t
+ */
+
+typedef int           intptr_t;
+typedef unsigned int  uintptr_t;
+
+#  define INTPTR_MIN    INT32_MIN
+#  define INTPTR_MAX    INT32_MAX
+#  define UINTPTR_MAX   UINT32_MAX
+#  define INTPTR_C(c)   INT32_C(c)
+#  define UINTPTR_C(c)  UINT32_C(c)
+#  define PTRDIFF_C(c)  INT32_C(c)
+#  define PTRDIFF_MIN   INT32_MIN
+#  define PTRDIFF_MAX   INT32_MAX
+
+
+/*
+ *  intmax_t & uintmax_t
+ */
+
+#if defined(__STDC_INT64__)
+
+typedef uint64_t uintmax_t;
+typedef int64_t  intmax_t;
+
+#define INTMAX_MIN	INT64_MIN
+#define INTMAX_MAX	INT64_MAX
+#define UINTMAX_MAX	UINT64_MAX
+
+#define INTMAX_C(c)	INT64_C(c)
+#define UINTMAX_C(c)	UINT64_C(c)
+
+#else /* !__STDC_INT64__ */
+
+typedef uint32_t  uintmax_t;
+typedef int32_t   intmax_t;
+
+#define  INTMAX_MIN    INT32_MIN
+#define  INTMAX_MAX    INT32_MAX
+#define  UINTMAX_MAX   UINT32_MAX
+
+#define INTMAX_C(c)	INT32_C(c)
+#define UINTMAX_C(c)	UINT32_C(c)
+
+#endif /* !__STDC_INT64__ */
+
+
+/* size_t is defined by the GCC-specific <stddef.h> */
+#ifndef _SSIZE_T_DEFINED_
+#define _SSIZE_T_DEFINED_
+typedef long int  ssize_t;
+#endif
+
+#define _BITSIZE 32
+
+/* Keep the kernel from trying to define these types... */
+#define __BIT_TYPES_DEFINED__
+
+#endif /* _STDINT_H */
diff --git a/ndk/platforms/android-3/include/stdio.h b/ndk/platforms/android-3/include/stdio.h
new file mode 100644
index 0000000..273f630
--- /dev/null
+++ b/ndk/platforms/android-3/include/stdio.h
@@ -0,0 +1,442 @@
+/*	$OpenBSD: stdio.h,v 1.35 2006/01/13 18:10:09 miod Exp $	*/
+/*	$NetBSD: stdio.h,v 1.18 1996/04/25 18:29:21 jtc Exp $	*/
+
+/*-
+ * Copyright (c) 1990 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Chris Torek.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ * 3. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
+ *
+ *	@(#)stdio.h	5.17 (Berkeley) 6/3/91
+ */
+
+#ifndef	_STDIO_H_
+#define	_STDIO_H_
+
+#include <sys/cdefs.h>
+#include <sys/_types.h>
+
+/* va_list and size_t must be defined by stdio.h according to Posix */
+#define __need___va_list
+#include <stdarg.h>
+
+/* note that this forces stddef.h to *only* define size_t */
+#define __need_size_t
+#include <stddef.h>
+
+#include <stddef.h>
+
+#if __BSD_VISIBLE || __POSIX_VISIBLE || __XPG_VISIBLE
+#include <sys/types.h>	/* XXX should be removed */
+#endif
+
+#ifndef	_SIZE_T_DEFINED_
+#define	_SIZE_T_DEFINED_
+typedef	unsigned long    size_t;
+#endif
+
+#ifndef	_OFF_T_DEFINED_
+#define	_OFF_T_DEFINED_
+typedef	long    off_t;
+#endif
+
+#ifndef NULL
+#ifdef 	__GNUG__
+#define	NULL	__null
+#else
+#define	NULL	0L
+#endif
+#endif
+
+#define	_FSTDIO			/* Define for new stdio with functions. */
+
+typedef off_t fpos_t;		/* stdio file position type */
+
+/*
+ * NB: to fit things in six character monocase externals, the stdio
+ * code uses the prefix `__s' for stdio objects, typically followed
+ * by a three-character attempt at a mnemonic.
+ */
+
+/* stdio buffers */
+struct __sbuf {
+	unsigned char *_base;
+	int	_size;
+};
+
+/*
+ * stdio state variables.
+ *
+ * The following always hold:
+ *
+ *	if (_flags&(__SLBF|__SWR)) == (__SLBF|__SWR),
+ *		_lbfsize is -_bf._size, else _lbfsize is 0
+ *	if _flags&__SRD, _w is 0
+ *	if _flags&__SWR, _r is 0
+ *
+ * This ensures that the getc and putc macros (or inline functions) never
+ * try to write or read from a file that is in `read' or `write' mode.
+ * (Moreover, they can, and do, automatically switch from read mode to
+ * write mode, and back, on "r+" and "w+" files.)
+ *
+ * _lbfsize is used only to make the inline line-buffered output stream
+ * code as compact as possible.
+ *
+ * _ub, _up, and _ur are used when ungetc() pushes back more characters
+ * than fit in the current _bf, or when ungetc() pushes back a character
+ * that does not match the previous one in _bf.  When this happens,
+ * _ub._base becomes non-nil (i.e., a stream has ungetc() data iff
+ * _ub._base!=NULL) and _up and _ur save the current values of _p and _r.
+ *
+ * NOTE: if you change this structure, you also need to update the
+ * std() initializer in findfp.c.
+ */
+typedef	struct __sFILE {
+	unsigned char *_p;	/* current position in (some) buffer */
+	int	_r;		/* read space left for getc() */
+	int	_w;		/* write space left for putc() */
+	short	_flags;		/* flags, below; this FILE is free if 0 */
+	short	_file;		/* fileno, if Unix descriptor, else -1 */
+	struct	__sbuf _bf;	/* the buffer (at least 1 byte, if !NULL) */
+	int	_lbfsize;	/* 0 or -_bf._size, for inline putc */
+
+	/* operations */
+	void	*_cookie;	/* cookie passed to io functions */
+	int	(*_close)(void *);
+	int	(*_read)(void *, char *, int);
+	fpos_t	(*_seek)(void *, fpos_t, int);
+	int	(*_write)(void *, const char *, int);
+
+	/* extension data, to avoid further ABI breakage */
+	struct	__sbuf _ext;
+	/* data for long sequences of ungetc() */
+	unsigned char *_up;	/* saved _p when _p is doing ungetc data */
+	int	_ur;		/* saved _r when _r is counting ungetc data */
+
+	/* tricks to meet minimum requirements even when malloc() fails */
+	unsigned char _ubuf[3];	/* guarantee an ungetc() buffer */
+	unsigned char _nbuf[1];	/* guarantee a getc() buffer */
+
+	/* separate buffer for fgetln() when line crosses buffer boundary */
+	struct	__sbuf _lb;	/* buffer for fgetln() */
+
+	/* Unix stdio files get aligned to block boundaries on fseek() */
+	int	_blksize;	/* stat.st_blksize (may be != _bf._size) */
+	fpos_t	_offset;	/* current lseek offset */
+} FILE;
+
+__BEGIN_DECLS
+extern FILE __sF[];
+__END_DECLS
+
+#define	__SLBF	0x0001		/* line buffered */
+#define	__SNBF	0x0002		/* unbuffered */
+#define	__SRD	0x0004		/* OK to read */
+#define	__SWR	0x0008		/* OK to write */
+	/* RD and WR are never simultaneously asserted */
+#define	__SRW	0x0010		/* open for reading & writing */
+#define	__SEOF	0x0020		/* found EOF */
+#define	__SERR	0x0040		/* found error */
+#define	__SMBF	0x0080		/* _buf is from malloc */
+#define	__SAPP	0x0100		/* fdopen()ed in append mode */
+#define	__SSTR	0x0200		/* this is an sprintf/snprintf string */
+#define	__SOPT	0x0400		/* do fseek() optimisation */
+#define	__SNPT	0x0800		/* do not do fseek() optimisation */
+#define	__SOFF	0x1000		/* set iff _offset is in fact correct */
+#define	__SMOD	0x2000		/* true => fgetln modified _p text */
+#define	__SALC	0x4000		/* allocate string space dynamically */
+
+/*
+ * The following three definitions are for ANSI C, which took them
+ * from System V, which brilliantly took internal interface macros and
+ * made them official arguments to setvbuf(), without renaming them.
+ * Hence, these ugly _IOxxx names are *supposed* to appear in user code.
+ *
+ * Although numbered as their counterparts above, the implementation
+ * does not rely on this.
+ */
+#define	_IOFBF	0		/* setvbuf should set fully buffered */
+#define	_IOLBF	1		/* setvbuf should set line buffered */
+#define	_IONBF	2		/* setvbuf should set unbuffered */
+
+#define	BUFSIZ	1024		/* size of buffer used by setbuf */
+
+#define	EOF	(-1)
+
+/*
+ * FOPEN_MAX is a minimum maximum, and should be the number of descriptors
+ * that the kernel can provide without allocation of a resource that can
+ * fail without the process sleeping.  Do not use this for anything.
+ */
+#define	FOPEN_MAX	20	/* must be <= OPEN_MAX <sys/syslimits.h> */
+#define	FILENAME_MAX	1024	/* must be <= PATH_MAX <sys/syslimits.h> */
+
+/* System V/ANSI C; this is the wrong way to do this, do *not* use these. */
+#if __BSD_VISIBLE || __XPG_VISIBLE
+#define	P_tmpdir	"/tmp/"
+#endif
+#define	L_tmpnam	1024	/* XXX must be == PATH_MAX */
+#define	TMP_MAX		308915776
+
+#ifndef SEEK_SET
+#define	SEEK_SET	0	/* set file offset to offset */
+#endif
+#ifndef SEEK_CUR
+#define	SEEK_CUR	1	/* set file offset to current plus offset */
+#endif
+#ifndef SEEK_END
+#define	SEEK_END	2	/* set file offset to EOF plus offset */
+#endif
+
+#define	stdin	(&__sF[0])
+#define	stdout	(&__sF[1])
+#define	stderr	(&__sF[2])
+
+/*
+ * Functions defined in ANSI C standard.
+ */
+__BEGIN_DECLS
+void	 clearerr(FILE *);
+int	 fclose(FILE *);
+int	 feof(FILE *);
+int	 ferror(FILE *);
+int	 fflush(FILE *);
+int	 fgetc(FILE *);
+int	 fgetpos(FILE *, fpos_t *);
+char	*fgets(char *, int, FILE *);
+FILE	*fopen(const char *, const char *);
+int	 fprintf(FILE *, const char *, ...);
+int	 fputc(int, FILE *);
+int	 fputs(const char *, FILE *);
+size_t	 fread(void *, size_t, size_t, FILE *);
+FILE	*freopen(const char *, const char *, FILE *);
+int	 fscanf(FILE *, const char *, ...);
+int	 fseek(FILE *, long, int);
+int	 fseeko(FILE *, off_t, int);
+int	 fsetpos(FILE *, const fpos_t *);
+long	 ftell(FILE *);
+off_t	 ftello(FILE *);
+size_t	 fwrite(const void *, size_t, size_t, FILE *);
+int	 getc(FILE *);
+int	 getchar(void);
+char	*gets(char *);
+#if __BSD_VISIBLE && !defined(__SYS_ERRLIST)
+#define __SYS_ERRLIST
+
+extern int sys_nerr;			/* perror(3) external variables */
+extern char *sys_errlist[];
+#endif
+void	 perror(const char *);
+int	 printf(const char *, ...);
+int	 putc(int, FILE *);
+int	 putchar(int);
+int	 puts(const char *);
+int	 remove(const char *);
+int	 rename(const char *, const char *);
+void	 rewind(FILE *);
+int	 scanf(const char *, ...);
+void	 setbuf(FILE *, char *);
+int	 setvbuf(FILE *, char *, int, size_t);
+int	 sprintf(char *, const char *, ...);
+int	 sscanf(const char *, const char *, ...);
+FILE	*tmpfile(void);
+char	*tmpnam(char *);
+int	 ungetc(int, FILE *);
+int	 vfprintf(FILE *, const char *, __va_list);
+int	 vprintf(const char *, __va_list);
+int	 vsprintf(char *, const char *, __va_list);
+
+#if __ISO_C_VISIBLE >= 1999 || __BSD_VISIBLE
+int	 snprintf(char *, size_t, const char *, ...)
+		__attribute__((__format__ (printf, 3, 4)))
+		__attribute__((__nonnull__ (3)));
+int	 vfscanf(FILE *, const char *, __va_list)
+		__attribute__((__format__ (scanf, 2, 0)))
+		__attribute__((__nonnull__ (2)));
+int	 vscanf(const char *, __va_list)
+		__attribute__((__format__ (scanf, 1, 0)))
+		__attribute__((__nonnull__ (1)));
+int	 vsnprintf(char *, size_t, const char *, __va_list)
+		__attribute__((__format__ (printf, 3, 0)))
+		__attribute__((__nonnull__ (3)));
+int	 vsscanf(const char *, const char *, __va_list)
+		__attribute__((__format__ (scanf, 2, 0)))
+		__attribute__((__nonnull__ (2)));
+#endif /* __ISO_C_VISIBLE >= 1999 || __BSD_VISIBLE */
+
+__END_DECLS
+
+
+/*
+ * Functions defined in POSIX 1003.1.
+ */
+#if __BSD_VISIBLE || __POSIX_VISIBLE || __XPG_VISIBLE
+#define	L_ctermid	1024	/* size for ctermid(); PATH_MAX */
+#define L_cuserid	9	/* size for cuserid(); UT_NAMESIZE + 1 */
+
+__BEGIN_DECLS
+#if 0 /* MISSING FROM BIONIC */
+char	*ctermid(char *);
+char	*cuserid(char *);
+#endif /* MISSING */
+FILE	*fdopen(int, const char *);
+int	 fileno(FILE *);
+
+#if (__POSIX_VISIBLE >= 199209)
+int	 pclose(FILE *);
+FILE	*popen(const char *, const char *);
+#endif
+
+#if __POSIX_VISIBLE >= 199506
+void	 flockfile(FILE *);
+int	 ftrylockfile(FILE *);
+void	 funlockfile(FILE *);
+
+/*
+ * These are normally used through macros as defined below, but POSIX
+ * requires functions as well.
+ */
+int	 getc_unlocked(FILE *);
+int	 getchar_unlocked(void);
+int	 putc_unlocked(int, FILE *);
+int	 putchar_unlocked(int);
+#endif /* __POSIX_VISIBLE >= 199506 */
+
+#if __XPG_VISIBLE
+char	*tempnam(const char *, const char *);
+#endif
+__END_DECLS
+
+#endif /* __BSD_VISIBLE || __POSIX_VISIBLE || __XPG_VISIBLE */
+
+/*
+ * Routines that are purely local.
+ */
+#if __BSD_VISIBLE
+__BEGIN_DECLS
+int	 asprintf(char **, const char *, ...)
+		__attribute__((__format__ (printf, 2, 3)))
+		__attribute__((__nonnull__ (2)));
+char	*fgetln(FILE *, size_t *);
+int	 fpurge(FILE *);
+int	 getw(FILE *);
+int	 putw(int, FILE *);
+void	 setbuffer(FILE *, char *, int);
+int	 setlinebuf(FILE *);
+int	 vasprintf(char **, const char *, __va_list)
+		__attribute__((__format__ (printf, 2, 0)))
+		__attribute__((__nonnull__ (2)));
+__END_DECLS
+
+/*
+ * Stdio function-access interface.
+ */
+__BEGIN_DECLS
+FILE	*funopen(const void *,
+		int (*)(void *, char *, int),
+		int (*)(void *, const char *, int),
+		fpos_t (*)(void *, fpos_t, int),
+		int (*)(void *));
+__END_DECLS
+#define	fropen(cookie, fn) funopen(cookie, fn, 0, 0, 0)
+#define	fwopen(cookie, fn) funopen(cookie, 0, fn, 0, 0)
+#endif /* __BSD_VISIBLE */
+
+/*
+ * Functions internal to the implementation.
+ */
+__BEGIN_DECLS
+int	__srget(FILE *);
+int	__swbuf(int, FILE *);
+__END_DECLS
+
+/*
+ * The __sfoo macros are here so that we can
+ * define function versions in the C library.
+ */
+#define	__sgetc(p) (--(p)->_r < 0 ? __srget(p) : (int)(*(p)->_p++))
+#if defined(__GNUC__)
+static __inline int __sputc(int _c, FILE *_p) {
+	if (--_p->_w >= 0 || (_p->_w >= _p->_lbfsize && (char)_c != '\n'))
+		return (*_p->_p++ = _c);
+	else
+		return (__swbuf(_c, _p));
+}
+#else
+/*
+ * This has been tuned to generate reasonable code on the vax using pcc.
+ */
+#define	__sputc(c, p) \
+	(--(p)->_w < 0 ? \
+		(p)->_w >= (p)->_lbfsize ? \
+			(*(p)->_p = (c)), *(p)->_p != '\n' ? \
+				(int)*(p)->_p++ : \
+				__swbuf('\n', p) : \
+			__swbuf((int)(c), p) : \
+		(*(p)->_p = (c), (int)*(p)->_p++))
+#endif
+
+#define	__sfeof(p)	(((p)->_flags & __SEOF) != 0)
+#define	__sferror(p)	(((p)->_flags & __SERR) != 0)
+#define	__sclearerr(p)	((void)((p)->_flags &= ~(__SERR|__SEOF)))
+#define	__sfileno(p)	((p)->_file)
+
+#define	feof(p)		__sfeof(p)
+#define	ferror(p)	__sferror(p)
+
+#ifndef _POSIX_THREADS
+#define	clearerr(p)	__sclearerr(p)
+#endif
+
+#if __POSIX_VISIBLE
+#define	fileno(p)	__sfileno(p)
+#endif
+
+#ifndef lint
+#ifndef _POSIX_THREADS
+#define	getc(fp)	__sgetc(fp)
+#endif /* _POSIX_THREADS */
+#define	getc_unlocked(fp)	__sgetc(fp)
+/*
+ * The macro implementations of putc and putc_unlocked are not
+ * fully POSIX compliant; they do not set errno on failure
+ */
+#if __BSD_VISIBLE
+#ifndef _POSIX_THREADS
+#define putc(x, fp)	__sputc(x, fp)
+#endif /* _POSIX_THREADS */
+#define putc_unlocked(x, fp)	__sputc(x, fp)
+#endif /* __BSD_VISIBLE */
+#endif /* lint */
+
+#define	getchar()	getc(stdin)
+#define	putchar(x)	putc(x, stdout)
+#define getchar_unlocked()	getc_unlocked(stdin)
+#define putchar_unlocked(c)	putc_unlocked(c, stdout)
+
+#endif /* _STDIO_H_ */
diff --git a/ndk/platforms/android-3/include/stdlib.h b/ndk/platforms/android-3/include/stdlib.h
new file mode 100644
index 0000000..424adb4
--- /dev/null
+++ b/ndk/platforms/android-3/include/stdlib.h
@@ -0,0 +1,185 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _STDLIB_H_
+#define _STDLIB_H_
+
+#include <sys/cdefs.h>
+
+/* wchar_t is required in stdlib.h according to POSIX.
+ * note that defining __need_wchar_t prevents stddef.h
+ * to define all other symbols it does normally */
+#define __need_wchar_t
+#include <stddef.h>
+
+#include <stddef.h>
+#include <string.h>
+#include <alloca.h>
+#include <strings.h>
+#include <memory.h>
+
+__BEGIN_DECLS
+
+#define EXIT_FAILURE 1
+#define EXIT_SUCCESS 0
+
+extern __noreturn void exit(int);
+extern __noreturn void abort(void);
+extern int atexit(void (*)(void));
+
+extern char *getenv(const char *);
+extern int putenv(const char *);
+extern int setenv(const char *, const char *, int);
+extern int unsetenv(const char *);
+
+extern char *mktemp (char *);
+extern int mkstemp (char *);
+
+extern long strtol(const char *, char **, int);
+extern long long strtoll(const char *, char **, int);
+extern unsigned long strtoul(const char *, char **, int);
+extern unsigned long long strtoull(const char *, char **, int);
+extern double strtod(const char *nptr, char **endptr);
+
+static __inline__ float strtof(const char *nptr, char **endptr)
+{
+    return (float)strtod(nptr, endptr);
+}
+
+extern int atoi(const char *);
+extern long atol(const char *);
+extern long long atoll(const char *);
+
+static __inline__ double atof(const char *nptr)
+{
+    return (strtod(nptr, NULL));
+}
+
+static __inline__ int abs(int __n) {
+    return (__n < 0) ? -__n : __n;
+}
+
+static __inline__ long labs(long __n) {
+    return (__n < 0L) ? -__n : __n;
+}
+
+static __inline__ long long llabs(long long __n) {
+    return (__n < 0LL) ? -__n : __n;
+}
+
+extern char * realpath(const char *path, char *resolved);
+extern int system(const char * string);
+
+extern void * bsearch(const void *key, const void *base0,
+	size_t nmemb, size_t size,
+	int (*compar)(const void *, const void *));
+
+extern void qsort(void *, size_t, size_t, int (*)(const void *, const void *));
+
+extern long jrand48(unsigned short *);
+extern long mrand48(void);
+extern long nrand48(unsigned short *);
+extern long lrand48(void);
+extern unsigned short *seed48(unsigned short*);
+extern double erand48(unsigned short xsubi[3]);
+extern double drand48(void);
+extern void srand48(long);
+extern unsigned int arc4random(void);
+extern void arc4random_stir(void);
+extern void arc4random_addrandom(unsigned char *, int);
+
+#define RAND_MAX 0x7fffffff
+static __inline__ int rand(void) {
+    return (int)lrand48();
+}
+static __inline__ void srand(unsigned int __s) {
+    srand48(__s);
+}
+static __inline__ long random(void)
+{
+    return lrand48();
+}
+static __inline__ void srandom(unsigned int __s)
+{
+    srand48(__s);
+}
+
+/* Basic PTY functions.  These only work if devpts is mounted! */
+
+extern int    unlockpt(int);
+extern char*  ptsname(int);
+extern char*  ptsname_r(int, char*, size_t);
+extern int    getpt(void);
+
+static __inline__ int grantpt(int __fd)
+{
+  (void)__fd;
+  return 0;     /* devpts does this all for us! */
+}
+
+typedef struct {
+    int  quot;
+    int  rem;
+} div_t;
+
+extern div_t   div(int, int);
+
+typedef struct {
+    long int  quot;
+    long int  rem;
+} ldiv_t;
+
+extern ldiv_t   ldiv(long, long);
+
+typedef struct {
+    long long int  quot;
+    long long int  rem;
+} lldiv_t;
+
+extern lldiv_t   lldiv(long long, long long);
+
+#if 1 /* MISSING FROM BIONIC - ENABLED FOR STLPort and libstdc++-v3 */
+/* make STLPort happy */
+extern int      mblen(const char *, size_t);
+extern size_t   mbstowcs(wchar_t *, const char *, size_t);
+extern int      mbtowc(wchar_t *, const char *, size_t);
+
+/* Likewise, make libstdc++-v3 happy.  */
+extern int	wctomb(char *, wchar_t);
+extern size_t	wcstombs(char *, const wchar_t *, size_t);
+#endif /* MISSING */
+
+#define MB_CUR_MAX 1
+
+#if 0 /* MISSING FROM BIONIC */
+extern int on_exit(void (*)(int, void *), void *);
+extern int clearenv(void);
+#endif /* MISSING */
+
+__END_DECLS
+
+#endif /* _STDLIB_H_ */
diff --git a/ndk/platforms/android-3/include/string.h b/ndk/platforms/android-3/include/string.h
new file mode 100644
index 0000000..613dcd7
--- /dev/null
+++ b/ndk/platforms/android-3/include/string.h
@@ -0,0 +1,90 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _STRING_H_
+#define _STRING_H_
+
+#include <sys/cdefs.h>
+#include <stddef.h>
+#include <malloc.h>
+
+__BEGIN_DECLS
+
+extern void*  memccpy(void *, const void *, int, size_t);
+extern void*  memchr(const void *, int, size_t);
+extern void*  memrchr(const void *, int, size_t);
+extern int    memcmp(const void *, const void *, size_t);
+extern void*  memcpy(void *, const void *, size_t);
+extern void*  memmove(void *, const void *, size_t);
+extern void*  memset(void *, int, size_t);
+extern void*  memmem(const void *, size_t, const void *, size_t);
+extern void   memswap(void *, void *, size_t);
+
+extern char*  index(const char *, int);
+extern char*  rindex(const char *, int);
+extern char*  strchr(const char *, int);
+extern char*  strrchr(const char *, int);
+
+extern size_t strlen(const char *);
+extern int    strcmp(const char *, const char *);
+extern char*  strcpy(char *, const char *);
+extern char*  strcat(char *, const char *);
+
+extern int    strcasecmp(const char *, const char *);
+extern int    strncasecmp(const char *, const char *, size_t);
+extern char*  strdup(const char *);
+
+extern char*  strstr(const char *, const char *);
+extern char*  strcasestr(const char *haystack, const char *needle);
+extern char*  strtok(char *, const char *);
+extern char*  strtok_r(char *, const char *, char**);
+
+extern char*  strerror(int);
+extern int    strerror_r(int errnum, char *buf, size_t n);
+
+extern size_t strnlen(const char *, size_t);
+extern char*  strncat(char *, const char *, size_t);
+extern char*  strndup(const char *, size_t);
+extern int    strncmp(const char *, const char *, size_t);
+extern char*  strncpy(char *, const char *, size_t);
+
+extern size_t strlcat(char *, const char *, size_t);
+extern size_t strlcpy(char *, const char *, size_t);
+
+extern size_t strcspn(const char *, const char *);
+extern char*  strpbrk(const char *, const char *);
+extern char*  strsep(char **, const char *);
+extern size_t strspn(const char *, const char *);
+
+extern char*  strsignal(int  sig);
+
+extern int    strcoll(const char *, const char *);
+extern size_t strxfrm(char *, const char *, size_t);
+
+__END_DECLS
+
+#endif /* _STRING_H_ */
diff --git a/ndk/platforms/android-3/include/strings.h b/ndk/platforms/android-3/include/strings.h
new file mode 100644
index 0000000..7f5b328
--- /dev/null
+++ b/ndk/platforms/android-3/include/strings.h
@@ -0,0 +1,58 @@
+/*	$NetBSD: strings.h,v 1.10 2005/02/03 04:39:32 perry Exp $	*/
+
+/*-
+ * Copyright (c) 1998 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Klaus Klein.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *        This product includes software developed by the NetBSD
+ *        Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``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 FOUNDATION OR CONTRIBUTORS
+ * 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 _STRINGS_H_
+#define _STRINGS_H_
+
+#include <sys/types.h>
+#include <sys/cdefs.h>
+
+__BEGIN_DECLS
+void	 bcopy(const void *, void *, size_t);
+void	 bzero(void *, size_t);
+int	 ffs(int);
+char	*index(const char *, int);
+int	 strcasecmp(const char *, const char *);
+int	 strncasecmp(const char *, const char *, size_t);
+#if 0 /* MISSING FROM BIONIC */
+int      bcmp(const void *, const void *, size_t);
+char    *rindex(const char *, int);
+#endif /* MISSING */
+__END_DECLS
+
+#endif /* !defined(_STRINGS_H_) */
diff --git a/ndk/platforms/android-3/include/sys/_errdefs.h b/ndk/platforms/android-3/include/sys/_errdefs.h
new file mode 100644
index 0000000..e27ab7a
--- /dev/null
+++ b/ndk/platforms/android-3/include/sys/_errdefs.h
@@ -0,0 +1,172 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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.
+ */
+
+/* the following corresponds to the error codes of the Linux kernel used by the Android platform
+ * these are distinct from the OpenBSD ones, which is why we need to redeclare them here
+ *
+ * this file may be included several times to define either error constants or their
+ * string representation
+ */
+
+#ifndef __BIONIC_ERRDEF
+#error "__BIONIC_ERRDEF must be defined before including this file"
+#endif
+__BIONIC_ERRDEF( EPERM          ,   1, "Operation not permitted" )
+__BIONIC_ERRDEF( ENOENT         ,   2, "No such file or directory" )
+__BIONIC_ERRDEF( ESRCH          ,   3, "No such process" )
+__BIONIC_ERRDEF( EINTR          ,   4, "Interrupted system call" )
+__BIONIC_ERRDEF( EIO            ,   5, "I/O error" )
+__BIONIC_ERRDEF( ENXIO          ,   6, "No such device or address" )
+__BIONIC_ERRDEF( E2BIG          ,   7, "Argument list too long" )
+__BIONIC_ERRDEF( ENOEXEC        ,   8, "Exec format error" )
+__BIONIC_ERRDEF( EBADF          ,   9, "Bad file number" )
+__BIONIC_ERRDEF( ECHILD         ,  10, "No child processes" )
+__BIONIC_ERRDEF( EAGAIN         ,  11, "Try again" )
+__BIONIC_ERRDEF( ENOMEM         ,  12, "Out of memory" )
+__BIONIC_ERRDEF( EACCES         ,  13, "Permission denied" )
+__BIONIC_ERRDEF( EFAULT         ,  14, "Bad address" )
+__BIONIC_ERRDEF( ENOTBLK        ,  15, "Block device required" )
+__BIONIC_ERRDEF( EBUSY          ,  16, "Device or resource busy" )
+__BIONIC_ERRDEF( EEXIST         ,  17, "File exists" )
+__BIONIC_ERRDEF( EXDEV          ,  18, "Cross-device link" )
+__BIONIC_ERRDEF( ENODEV         ,  19, "No such device" )
+__BIONIC_ERRDEF( ENOTDIR        ,  20, "Not a directory" )
+__BIONIC_ERRDEF( EISDIR         ,  21, "Is a directory" )
+__BIONIC_ERRDEF( EINVAL         ,  22, "Invalid argument" )
+__BIONIC_ERRDEF( ENFILE         ,  23, "File table overflow" )
+__BIONIC_ERRDEF( EMFILE         ,  24, "Too many open files" )
+__BIONIC_ERRDEF( ENOTTY         ,  25, "Not a typewriter" )
+__BIONIC_ERRDEF( ETXTBSY        ,  26, "Text file busy" )
+__BIONIC_ERRDEF( EFBIG          ,  27, "File too large" )
+__BIONIC_ERRDEF( ENOSPC         ,  28, "No space left on device" )
+__BIONIC_ERRDEF( ESPIPE         ,  29, "Illegal seek" )
+__BIONIC_ERRDEF( EROFS          ,  30, "Read-only file system" )
+__BIONIC_ERRDEF( EMLINK         ,  31, "Too many links" )
+__BIONIC_ERRDEF( EPIPE          ,  32, "Broken pipe" )
+__BIONIC_ERRDEF( EDOM           ,  33, "Math argument out of domain of func" )
+__BIONIC_ERRDEF( ERANGE         ,  34, "Math result not representable" )
+__BIONIC_ERRDEF( EDEADLK        ,  35, "Resource deadlock would occur" )
+__BIONIC_ERRDEF( ENAMETOOLONG   ,  36, "File name too long" )
+__BIONIC_ERRDEF( ENOLCK         ,  37, "No record locks available" )
+__BIONIC_ERRDEF( ENOSYS         ,  38, "Function not implemented" )
+__BIONIC_ERRDEF( ENOTEMPTY      ,  39, "Directory not empty" )
+__BIONIC_ERRDEF( ELOOP          ,  40, "Too many symbolic links encountered" )
+__BIONIC_ERRDEF( ENOMSG         ,  42, "No message of desired type" )
+__BIONIC_ERRDEF( EIDRM          ,  43, "Identifier removed" )
+__BIONIC_ERRDEF( ECHRNG         ,  44, "Channel number out of range" )
+__BIONIC_ERRDEF( EL2NSYNC       ,  45, "Level 2 not synchronized" )
+__BIONIC_ERRDEF( EL3HLT         ,  46, "Level 3 halted" )
+__BIONIC_ERRDEF( EL3RST         ,  47, "Level 3 reset" )
+__BIONIC_ERRDEF( ELNRNG         ,  48, "Link number out of range" )
+__BIONIC_ERRDEF( EUNATCH        ,  49, "Protocol driver not attached" )
+__BIONIC_ERRDEF( ENOCSI         ,  50, "No CSI structure available" )
+__BIONIC_ERRDEF( EL2HLT         ,  51, "Level 2 halted" )
+__BIONIC_ERRDEF( EBADE          ,  52, "Invalid exchange" )
+__BIONIC_ERRDEF( EBADR          ,  53, "Invalid request descriptor" )
+__BIONIC_ERRDEF( EXFULL         ,  54, "Exchange full" )
+__BIONIC_ERRDEF( ENOANO         ,  55, "No anode" )
+__BIONIC_ERRDEF( EBADRQC        ,  56, "Invalid request code" )
+__BIONIC_ERRDEF( EBADSLT        ,  57, "Invalid slot" )
+__BIONIC_ERRDEF( EBFONT         ,  59, "Bad font file format" )
+__BIONIC_ERRDEF( ENOSTR         ,  60, "Device not a stream" )
+__BIONIC_ERRDEF( ENODATA        ,  61, "No data available" )
+__BIONIC_ERRDEF( ETIME          ,  62, "Timer expired" )
+__BIONIC_ERRDEF( ENOSR          ,  63, "Out of streams resources" )
+__BIONIC_ERRDEF( ENONET         ,  64, "Machine is not on the network" )
+__BIONIC_ERRDEF( ENOPKG         ,  65, "Package not installed" )
+__BIONIC_ERRDEF( EREMOTE        ,  66, "Object is remote" )
+__BIONIC_ERRDEF( ENOLINK        ,  67, "Link has been severed" )
+__BIONIC_ERRDEF( EADV           ,  68, "Advertise error" )
+__BIONIC_ERRDEF( ESRMNT         ,  69, "Srmount error" )
+__BIONIC_ERRDEF( ECOMM          ,  70, "Communication error on send" )
+__BIONIC_ERRDEF( EPROTO         ,  71, "Protocol error" )
+__BIONIC_ERRDEF( EMULTIHOP      ,  72, "Multihop attempted" )
+__BIONIC_ERRDEF( EDOTDOT        ,  73, "RFS specific error" )
+__BIONIC_ERRDEF( EBADMSG        ,  74, "Not a data message" )
+__BIONIC_ERRDEF( EOVERFLOW      ,  75, "Value too large for defined data type" )
+__BIONIC_ERRDEF( ENOTUNIQ       ,  76, "Name not unique on network" )
+__BIONIC_ERRDEF( EBADFD         ,  77, "File descriptor in bad state" )
+__BIONIC_ERRDEF( EREMCHG        ,  78, "Remote address changed" )
+__BIONIC_ERRDEF( ELIBACC        ,  79, "Can not access a needed shared library" )
+__BIONIC_ERRDEF( ELIBBAD        ,  80, "Accessing a corrupted shared library" )
+__BIONIC_ERRDEF( ELIBSCN        ,  81, ".lib section in a.out corrupted" )
+__BIONIC_ERRDEF( ELIBMAX        ,  82, "Attempting to link in too many shared libraries" )
+__BIONIC_ERRDEF( ELIBEXEC       ,  83, "Cannot exec a shared library directly" )
+__BIONIC_ERRDEF( EILSEQ         ,  84, "Illegal byte sequence" )
+__BIONIC_ERRDEF( ERESTART       ,  85, "Interrupted system call should be restarted" )
+__BIONIC_ERRDEF( ESTRPIPE       ,  86, "Streams pipe error" )
+__BIONIC_ERRDEF( EUSERS         ,  87, "Too many users" )
+__BIONIC_ERRDEF( ENOTSOCK       ,  88, "Socket operation on non-socket" )
+__BIONIC_ERRDEF( EDESTADDRREQ   ,  89, "Destination address required" )
+__BIONIC_ERRDEF( EMSGSIZE       ,  90, "Message too long" )
+__BIONIC_ERRDEF( EPROTOTYPE     ,  91, "Protocol wrong type for socket" )
+__BIONIC_ERRDEF( ENOPROTOOPT    ,  92, "Protocol not available" )
+__BIONIC_ERRDEF( EPROTONOSUPPORT,  93, "Protocol not supported" )
+__BIONIC_ERRDEF( ESOCKTNOSUPPORT,  94, "Socket type not supported" )
+__BIONIC_ERRDEF( EOPNOTSUPP     ,  95, "Operation not supported on transport endpoint" )
+__BIONIC_ERRDEF( EPFNOSUPPORT   ,  96, "Protocol family not supported" )
+__BIONIC_ERRDEF( EAFNOSUPPORT   ,  97, "Address family not supported by protocol" )
+__BIONIC_ERRDEF( EADDRINUSE     ,  98, "Address already in use" )
+__BIONIC_ERRDEF( EADDRNOTAVAIL  ,  99, "Cannot assign requested address" )
+__BIONIC_ERRDEF( ENETDOWN       , 100, "Network is down" )
+__BIONIC_ERRDEF( ENETUNREACH    , 101, "Network is unreachable" )
+__BIONIC_ERRDEF( ENETRESET      , 102, "Network dropped connection because of reset" )
+__BIONIC_ERRDEF( ECONNABORTED   , 103, "Software caused connection abort" )
+__BIONIC_ERRDEF( ECONNRESET     , 104, "Connection reset by peer" )
+__BIONIC_ERRDEF( ENOBUFS        , 105, "No buffer space available" )
+__BIONIC_ERRDEF( EISCONN        , 106, "Transport endpoint is already connected" )
+__BIONIC_ERRDEF( ENOTCONN       , 107, "Transport endpoint is not connected" )
+__BIONIC_ERRDEF( ESHUTDOWN      , 108, "Cannot send after transport endpoint shutdown" )
+__BIONIC_ERRDEF( ETOOMANYREFS   , 109, "Too many references: cannot splice" )
+__BIONIC_ERRDEF( ETIMEDOUT      , 110, "Connection timed out" )
+__BIONIC_ERRDEF( ECONNREFUSED   , 111, "Connection refused" )
+__BIONIC_ERRDEF( EHOSTDOWN      , 112, "Host is down" )
+__BIONIC_ERRDEF( EHOSTUNREACH   , 113, "No route to host" )
+__BIONIC_ERRDEF( EALREADY       , 114, "Operation already in progress" )
+__BIONIC_ERRDEF( EINPROGRESS    , 115, "Operation now in progress" )
+__BIONIC_ERRDEF( ESTALE         , 116, "Stale NFS file handle" )
+__BIONIC_ERRDEF( EUCLEAN        , 117, "Structure needs cleaning" )
+__BIONIC_ERRDEF( ENOTNAM        , 118, "Not a XENIX named type file" )
+__BIONIC_ERRDEF( ENAVAIL        , 119, "No XENIX semaphores available" )
+__BIONIC_ERRDEF( EISNAM         , 120, "Is a named type file" )
+__BIONIC_ERRDEF( EREMOTEIO      , 121, "Remote I/O error" )
+__BIONIC_ERRDEF( EDQUOT         , 122, "Quota exceeded" )
+__BIONIC_ERRDEF( ENOMEDIUM      , 123, "No medium found" )
+__BIONIC_ERRDEF( EMEDIUMTYPE    , 124, "Wrong medium type" )
+__BIONIC_ERRDEF( ECANCELED      , 125, "Operation Canceled" )
+__BIONIC_ERRDEF( ENOKEY         , 126, "Required key not available" )
+__BIONIC_ERRDEF( EKEYEXPIRED    , 127, "Key has expired" )
+__BIONIC_ERRDEF( EKEYREVOKED    , 128, "Key has been revoked" )
+__BIONIC_ERRDEF( EKEYREJECTED   , 129, "Key was rejected by service" )
+__BIONIC_ERRDEF( EOWNERDEAD     , 130, "Owner died" )
+__BIONIC_ERRDEF( ENOTRECOVERABLE, 131, "State not recoverable" )
+
+/* the following is not defined by Linux but needed for the BSD portions of the C library */
+__BIONIC_ERRDEF( EFTYPE, 1000, "Stupid C library hack !!" )
+
+#undef __BIONIC_ERRDEF
diff --git a/ndk/platforms/android-3/include/sys/_sigdefs.h b/ndk/platforms/android-3/include/sys/_sigdefs.h
new file mode 100644
index 0000000..a3cb7a3
--- /dev/null
+++ b/ndk/platforms/android-3/include/sys/_sigdefs.h
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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.
+ */
+/* this header is used to define signal constants and names; it might be included several times */
+#ifndef __BIONIC_SIGDEF
+#error __BIONIC_SIGDEF not defined
+#endif
+
+__BIONIC_SIGDEF(SIGHUP,1,"Hangup")
+__BIONIC_SIGDEF(SIGINT,2,"Interrupt")
+__BIONIC_SIGDEF(SIGQUIT,3,"Quit")
+__BIONIC_SIGDEF(SIGILL,4,"Illegal instruction")
+__BIONIC_SIGDEF(SIGTRAP,5,"Trap")
+__BIONIC_SIGDEF(SIGABRT,6,"Aborted")
+__BIONIC_SIGDEF(SIGBUS,7,"Bus error")
+__BIONIC_SIGDEF(SIGFPE,8,"Floating point exception")
+__BIONIC_SIGDEF(SIGKILL,9,"Killed")
+__BIONIC_SIGDEF(SIGUSR1,10,"User signal 1")
+__BIONIC_SIGDEF(SIGSEGV,11,"Segmentation fault")
+__BIONIC_SIGDEF(SIGUSR2,12,"User signal 2")
+__BIONIC_SIGDEF(SIGPIPE,13,"Broken pipe")
+__BIONIC_SIGDEF(SIGALRM,14,"Alarm clock")
+__BIONIC_SIGDEF(SIGTERM,15,"Terminated")
+__BIONIC_SIGDEF(SIGSTKFLT,16,"Stack fault")
+__BIONIC_SIGDEF(SIGCHLD,17,"Child exited")
+__BIONIC_SIGDEF(SIGCONT,18,"Continue")
+__BIONIC_SIGDEF(SIGSTOP,19,"Stopped (signal)")
+__BIONIC_SIGDEF(SIGTSTP,20,"Stopped")
+__BIONIC_SIGDEF(SIGTTIN,21,"Stopped (tty input)")
+__BIONIC_SIGDEF(SIGTTOU,22,"Stopper (tty output)")
+__BIONIC_SIGDEF(SIGURG,23,"Urgent I/O condition")
+__BIONIC_SIGDEF(SIGXCPU,24,"CPU time limit exceeded")
+__BIONIC_SIGDEF(SIGXFSZ,25,"File size limit exceeded")
+__BIONIC_SIGDEF(SIGVTALRM,26,"Virtual timer expired")
+__BIONIC_SIGDEF(SIGPROF,27,"Profiling timer expired")
+__BIONIC_SIGDEF(SIGWINCH,28,"Window size changed")
+__BIONIC_SIGDEF(SIGIO,29,"I/O possible")
+__BIONIC_SIGDEF(SIGPWR,30,"Power failure")
+__BIONIC_SIGDEF(SIGSYS,31,"Bad system call")
+
+#undef __BIONIC_SIGDEF
diff --git a/ndk/platforms/android-3/include/sys/_system_properties.h b/ndk/platforms/android-3/include/sys/_system_properties.h
new file mode 100644
index 0000000..42a7f6c
--- /dev/null
+++ b/ndk/platforms/android-3/include/sys/_system_properties.h
@@ -0,0 +1,108 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _INCLUDE_SYS__SYSTEM_PROPERTIES_H
+#define _INCLUDE_SYS__SYSTEM_PROPERTIES_H
+
+#ifndef _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_
+#error you should #include <sys/system_properties.h> instead
+#else
+#include <sys/system_properties.h>
+
+typedef struct prop_area prop_area;
+typedef struct prop_msg prop_msg;
+
+#define PROP_AREA_MAGIC   0x504f5250
+#define PROP_AREA_VERSION 0x45434f76
+
+#define PROP_SERVICE_NAME "property_service"
+
+/* #define PROP_MAX_ENTRIES 247 */
+/* 247 -> 32620 bytes (<32768) */
+
+#define TOC_NAME_LEN(toc)       ((toc) >> 24)
+#define TOC_TO_INFO(area, toc)  ((prop_info*) (((char*) area) + ((toc) & 0xFFFFFF)))
+
+struct prop_area {
+    unsigned volatile count;
+    unsigned volatile serial;
+    unsigned magic;
+    unsigned version;
+    unsigned reserved[4];
+    unsigned toc[1];
+};
+
+#define SERIAL_VALUE_LEN(serial) ((serial) >> 24)
+#define SERIAL_DIRTY(serial) ((serial) & 1)
+
+struct prop_info {
+    char name[PROP_NAME_MAX];
+    unsigned volatile serial;
+    char value[PROP_VALUE_MAX];
+};
+
+struct prop_msg 
+{
+    unsigned cmd;
+    char name[PROP_NAME_MAX];
+    char value[PROP_VALUE_MAX];
+};
+
+#define PROP_MSG_SETPROP 1
+    
+/*
+** Rules:
+**
+** - there is only one writer, but many readers
+** - prop_area.count will never decrease in value
+** - once allocated, a prop_info's name will not change
+** - once allocated, a prop_info's offset will not change
+** - reading a value requires the following steps
+**   1. serial = pi->serial
+**   2. if SERIAL_DIRTY(serial), wait*, then goto 1
+**   3. memcpy(local, pi->value, SERIAL_VALUE_LEN(serial) + 1)
+**   4. if pi->serial != serial, goto 2
+**
+** - writing a value requires the following steps
+**   1. pi->serial = pi->serial | 1
+**   2. memcpy(pi->value, local_value, value_len)
+**   3. pi->serial = (value_len << 24) | ((pi->serial + 1) & 0xffffff)
+**
+** Improvements:
+** - maintain the toc sorted by pi->name to allow lookup
+**   by binary search
+**
+*/
+
+#define PROP_PATH_RAMDISK_DEFAULT  "/default.prop"
+#define PROP_PATH_SYSTEM_BUILD     "/system/build.prop"
+#define PROP_PATH_SYSTEM_DEFAULT   "/system/default.prop"
+#define PROP_PATH_LOCAL_OVERRIDE   "/data/local.prop"
+
+#endif
+#endif
diff --git a/ndk/platforms/android-3/include/sys/_types.h b/ndk/platforms/android-3/include/sys/_types.h
new file mode 100644
index 0000000..7b99e06
--- /dev/null
+++ b/ndk/platforms/android-3/include/sys/_types.h
@@ -0,0 +1,77 @@
+/*	$OpenBSD: _types.h,v 1.1 2006/01/06 18:53:05 millert Exp $	*/
+
+/*-
+ * Copyright (c) 1990, 1993
+ *	The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ * 3. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
+ *
+ *	@(#)types.h	8.3 (Berkeley) 1/5/94
+ */
+
+#ifndef _SYS__TYPES_H_
+#define	_SYS__TYPES_H_
+
+#undef  __KERNEL_STRICT_NAMES
+#define __KERNEL_STRICT_NAMES  1
+
+#include <machine/_types.h>
+
+typedef	unsigned long	__cpuid_t;	/* CPU id */
+typedef	__int32_t	__dev_t;	/* device number */
+typedef	__uint32_t	__fixpt_t;	/* fixed point number */
+typedef	__uint32_t	__gid_t;	/* group id */
+typedef	__uint32_t	__id_t;		/* may contain pid, uid or gid */
+typedef __uint32_t	__in_addr_t;	/* base type for internet address */
+typedef __uint16_t	__in_port_t;	/* IP port type */
+typedef	__uint32_t	__ino_t;	/* inode number */
+typedef	long		__key_t;	/* IPC key (for Sys V IPC) */
+typedef	__uint32_t	__mode_t;	/* permissions */
+typedef	__uint32_t	__nlink_t;	/* link count */
+typedef	__int32_t	__pid_t;	/* process id */
+typedef __uint64_t	__rlim_t;	/* resource limit */
+typedef __uint16_t	__sa_family_t;	/* sockaddr address family type */
+typedef	__int32_t	__segsz_t;	/* segment size */
+typedef __uint32_t	__socklen_t;	/* length type for network syscalls */
+typedef	__int32_t	__swblk_t;	/* swap offset */
+typedef	__uint32_t	__uid_t;	/* user id */
+typedef	__uint32_t	__useconds_t;	/* microseconds */
+typedef	__int32_t	__suseconds_t;	/* microseconds (signed) */
+
+/*
+ * mbstate_t is an opaque object to keep conversion state, during multibyte
+ * stream conversions. The content must not be referenced by user programs.
+ */
+typedef union {
+	char __mbstate8[128];
+	__int64_t __mbstateL;			/* for alignment */
+} __mbstate_t;
+
+/* BIONIC: if we're using non-cleaned up user-level kernel headers, 
+ *         this will prevent many type declaration conflicts
+ */
+#define  __KERNEL_STRICT_NAMES  1
+
+#endif /* !_SYS__TYPES_H_ */
diff --git a/ndk/platforms/android-3/include/sys/atomics.h b/ndk/platforms/android-3/include/sys/atomics.h
new file mode 100644
index 0000000..d3fa145
--- /dev/null
+++ b/ndk/platforms/android-3/include/sys/atomics.h
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _SYS_ATOMICS_H
+#define _SYS_ATOMICS_H
+
+#include <sys/cdefs.h>
+#include <sys/time.h>
+
+__BEGIN_DECLS
+
+extern int __atomic_cmpxchg(int old, int _new, volatile int *ptr);
+extern int __atomic_swap(int _new, volatile int *ptr);
+extern int __atomic_dec(volatile int *ptr);
+extern int __atomic_inc(volatile int *ptr);
+
+int __futex_wait(volatile void *ftx, int val, const struct timespec *timeout);
+int __futex_wake(volatile void *ftx, int count);
+
+__END_DECLS
+
+#endif /* _SYS_ATOMICS_H */
diff --git a/ndk/platforms/android-3/include/sys/cdefs.h b/ndk/platforms/android-3/include/sys/cdefs.h
new file mode 100644
index 0000000..2389437
--- /dev/null
+++ b/ndk/platforms/android-3/include/sys/cdefs.h
@@ -0,0 +1,507 @@
+/*	$NetBSD: cdefs.h,v 1.58 2004/12/11 05:59:00 christos Exp $	*/
+
+/*
+ * Copyright (c) 1991, 1993
+ *	The Regents of the University of California.  All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Berkeley Software Design, Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ * 3. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
+ *
+ *	@(#)cdefs.h	8.8 (Berkeley) 1/9/95
+ */
+
+#ifndef	_SYS_CDEFS_H_
+#define	_SYS_CDEFS_H_
+
+
+/* our implementation of wchar_t is only 8-bit - die die non-portable code */
+#undef  __WCHAR_TYPE__
+#define __WCHAR_TYPE__  unsigned char
+
+
+/*
+ * Macro to test if we're using a GNU C compiler of a specific vintage
+ * or later, for e.g. features that appeared in a particular version
+ * of GNU C.  Usage:
+ *
+ *	#if __GNUC_PREREQ__(major, minor)
+ *	...cool feature...
+ *	#else
+ *	...delete feature...
+ *	#endif
+ */
+#ifdef __GNUC__
+#define	__GNUC_PREREQ__(x, y)						\
+	((__GNUC__ == (x) && __GNUC_MINOR__ >= (y)) ||			\
+	 (__GNUC__ > (x)))
+#else
+#define	__GNUC_PREREQ__(x, y)	0
+#endif
+
+#include <sys/cdefs_elf.h>
+
+#if defined(__cplusplus)
+#define	__BEGIN_DECLS		extern "C" {
+#define	__END_DECLS		}
+#define	__static_cast(x,y)	static_cast<x>(y)
+#else
+#define	__BEGIN_DECLS
+#define	__END_DECLS
+#define	__static_cast(x,y)	(x)y
+#endif
+
+/*
+ * The __CONCAT macro is used to concatenate parts of symbol names, e.g.
+ * with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfoo.
+ * The __CONCAT macro is a bit tricky -- make sure you don't put spaces
+ * in between its arguments.  __CONCAT can also concatenate double-quoted
+ * strings produced by the __STRING macro, but this only works with ANSI C.
+ */
+
+#define	___STRING(x)	__STRING(x)
+#define	___CONCAT(x,y)	__CONCAT(x,y)
+
+#if __STDC__ || defined(__cplusplus)
+#define	__P(protos)	protos		/* full-blown ANSI C */
+#define	__CONCAT(x,y)	x ## y
+#define	__STRING(x)	#x
+
+#define	__const		const		/* define reserved names to standard */
+#define	__signed	signed
+#define	__volatile	volatile
+#if defined(__cplusplus)
+#define	__inline	inline		/* convert to C++ keyword */
+#else
+#if !defined(__GNUC__) && !defined(__lint__)
+#define	__inline			/* delete GCC keyword */
+#endif /* !__GNUC__  && !__lint__ */
+#endif /* !__cplusplus */
+
+#else	/* !(__STDC__ || __cplusplus) */
+#define	__P(protos)	()		/* traditional C preprocessor */
+#define	__CONCAT(x,y)	x/**/y
+#define	__STRING(x)	"x"
+
+#ifndef __GNUC__
+#define	__const				/* delete pseudo-ANSI C keywords */
+#define	__inline
+#define	__signed
+#define	__volatile
+#endif	/* !__GNUC__ */
+
+/*
+ * In non-ANSI C environments, new programs will want ANSI-only C keywords
+ * deleted from the program and old programs will want them left alone.
+ * Programs using the ANSI C keywords const, inline etc. as normal
+ * identifiers should define -DNO_ANSI_KEYWORDS.
+ */
+#ifndef	NO_ANSI_KEYWORDS
+#define	const		__const		/* convert ANSI C keywords */
+#define	inline		__inline
+#define	signed		__signed
+#define	volatile	__volatile
+#endif /* !NO_ANSI_KEYWORDS */
+#endif	/* !(__STDC__ || __cplusplus) */
+
+/*
+ * Used for internal auditing of the NetBSD source tree.
+ */
+#ifdef __AUDIT__
+#define	__aconst	__const
+#else
+#define	__aconst
+#endif
+
+/*
+ * The following macro is used to remove const cast-away warnings
+ * from gcc -Wcast-qual; it should be used with caution because it
+ * can hide valid errors; in particular most valid uses are in
+ * situations where the API requires it, not to cast away string
+ * constants. We don't use *intptr_t on purpose here and we are
+ * explicit about unsigned long so that we don't have additional
+ * dependencies.
+ */
+#define __UNCONST(a)	((void *)(unsigned long)(const void *)(a))
+
+/*
+ * GCC2 provides __extension__ to suppress warnings for various GNU C
+ * language extensions under "-ansi -pedantic".
+ */
+#if !__GNUC_PREREQ__(2, 0)
+#define	__extension__		/* delete __extension__ if non-gcc or gcc1 */
+#endif
+
+/*
+ * GCC1 and some versions of GCC2 declare dead (non-returning) and
+ * pure (no side effects) functions using "volatile" and "const";
+ * unfortunately, these then cause warnings under "-ansi -pedantic".
+ * GCC2 uses a new, peculiar __attribute__((attrs)) style.  All of
+ * these work for GNU C++ (modulo a slight glitch in the C++ grammar
+ * in the distribution version of 2.5.5).
+ */
+#if !__GNUC_PREREQ__(2, 5)
+#define	__attribute__(x)	/* delete __attribute__ if non-gcc or gcc1 */
+#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
+#define	__dead		__volatile
+#define	__pure		__const
+#endif
+#endif
+
+/* Delete pseudo-keywords wherever they are not available or needed. */
+#ifndef __dead
+#define	__dead
+#define	__pure
+#endif
+
+#if __GNUC_PREREQ__(2, 7)
+#define	__unused	__attribute__((__unused__))
+#else
+#define	__unused	/* delete */
+#endif
+
+#if __GNUC_PREREQ__(3, 1)
+#define	__used		__attribute__((__used__))
+#else
+#define	__used		/* delete */
+#endif
+
+#if __GNUC_PREREQ__(2, 7)
+#define	__packed	__attribute__((__packed__))
+#define	__aligned(x)	__attribute__((__aligned__(x)))
+#define	__section(x)	__attribute__((__section__(x)))
+#elif defined(__lint__)
+#define	__packed	/* delete */
+#define	__aligned(x)	/* delete */
+#define	__section(x)	/* delete */
+#else
+#define	__packed	error: no __packed for this compiler
+#define	__aligned(x)	error: no __aligned for this compiler
+#define	__section(x)	error: no __section for this compiler
+#endif
+
+#if !__GNUC_PREREQ__(2, 8)
+#define	__extension__
+#endif
+
+#if __GNUC_PREREQ__(2, 8)
+#define __statement(x)	__extension__(x)
+#elif defined(lint)
+#define __statement(x)	(0)
+#else
+#define __statement(x)	(x)
+#endif
+
+/*
+ * C99 defines the restrict type qualifier keyword, which was made available
+ * in GCC 2.92.
+ */
+#if __STDC_VERSION__ >= 199901L
+#define	__restrict	restrict
+#else
+#if !__GNUC_PREREQ__(2, 92)
+#define	__restrict	/* delete __restrict when not supported */
+#endif
+#endif
+
+/*
+ * C99 defines __func__ predefined identifier, which was made available
+ * in GCC 2.95.
+ */
+#if !(__STDC_VERSION__ >= 199901L)
+#if __GNUC_PREREQ__(2, 6)
+#define	__func__	__PRETTY_FUNCTION__
+#elif __GNUC_PREREQ__(2, 4)
+#define	__func__	__FUNCTION__
+#else
+#define	__func__	""
+#endif
+#endif /* !(__STDC_VERSION__ >= 199901L) */
+
+#if defined(_KERNEL)
+#if defined(NO_KERNEL_RCSIDS)
+#undef __KERNEL_RCSID
+#define	__KERNEL_RCSID(_n, _s)		/* nothing */
+#endif /* NO_KERNEL_RCSIDS */
+#endif /* _KERNEL */
+
+#if !defined(_STANDALONE) && !defined(_KERNEL)
+#ifdef __GNUC__
+#define	__RENAME(x)	___RENAME(x)
+#else
+#ifdef __lint__
+#define	__RENAME(x)	__symbolrename(x)
+#else
+#error "No function renaming possible"
+#endif /* __lint__ */
+#endif /* __GNUC__ */
+#else /* _STANDALONE || _KERNEL */
+#define	__RENAME(x)	no renaming in kernel or standalone environment
+#endif
+
+/*
+ * A barrier to stop the optimizer from moving code or assume live
+ * register values. This is gcc specific, the version is more or less
+ * arbitrary, might work with older compilers.
+ */
+#if __GNUC_PREREQ__(2, 95)
+#define	__insn_barrier()	__asm __volatile("":::"memory")
+#else
+#define	__insn_barrier()	/* */
+#endif
+
+/*
+ * GNU C version 2.96 adds explicit branch prediction so that
+ * the CPU back-end can hint the processor and also so that
+ * code blocks can be reordered such that the predicted path
+ * sees a more linear flow, thus improving cache behavior, etc.
+ *
+ * The following two macros provide us with a way to use this
+ * compiler feature.  Use __predict_true() if you expect the expression
+ * to evaluate to true, and __predict_false() if you expect the
+ * expression to evaluate to false.
+ *
+ * A few notes about usage:
+ *
+ *	* Generally, __predict_false() error condition checks (unless
+ *	  you have some _strong_ reason to do otherwise, in which case
+ *	  document it), and/or __predict_true() `no-error' condition
+ *	  checks, assuming you want to optimize for the no-error case.
+ *
+ *	* Other than that, if you don't know the likelihood of a test
+ *	  succeeding from empirical or other `hard' evidence, don't
+ *	  make predictions.
+ *
+ *	* These are meant to be used in places that are run `a lot'.
+ *	  It is wasteful to make predictions in code that is run
+ *	  seldomly (e.g. at subsystem initialization time) as the
+ *	  basic block reordering that this affects can often generate
+ *	  larger code.
+ */
+#if __GNUC_PREREQ__(2, 96)
+#define	__predict_true(exp)	__builtin_expect((exp) != 0, 1)
+#define	__predict_false(exp)	__builtin_expect((exp) != 0, 0)
+#else
+#define	__predict_true(exp)	(exp)
+#define	__predict_false(exp)	(exp)
+#endif
+
+#if __GNUC_PREREQ__(2, 96)
+#define __noreturn    __attribute__((__noreturn__))
+#define __mallocfunc  __attribute__((malloc))
+#else
+#define __noreturn
+#define __mallocfunc
+#endif
+
+/*
+ * Macros for manipulating "link sets".  Link sets are arrays of pointers
+ * to objects, which are gathered up by the linker.
+ *
+ * Object format-specific code has provided us with the following macros:
+ *
+ *	__link_set_add_text(set, sym)
+ *		Add a reference to the .text symbol `sym' to `set'.
+ *
+ *	__link_set_add_rodata(set, sym)
+ *		Add a reference to the .rodata symbol `sym' to `set'.
+ *
+ *	__link_set_add_data(set, sym)
+ *		Add a reference to the .data symbol `sym' to `set'.
+ *
+ *	__link_set_add_bss(set, sym)
+ *		Add a reference to the .bss symbol `sym' to `set'.
+ *
+ *	__link_set_decl(set, ptype)
+ *		Provide an extern declaration of the set `set', which
+ *		contains an array of the pointer type `ptype'.  This
+ *		macro must be used by any code which wishes to reference
+ *		the elements of a link set.
+ *
+ *	__link_set_start(set)
+ *		This points to the first slot in the link set.
+ *
+ *	__link_set_end(set)
+ *		This points to the (non-existent) slot after the last
+ *		entry in the link set.
+ *
+ *	__link_set_count(set)
+ *		Count the number of entries in link set `set'.
+ *
+ * In addition, we provide the following macros for accessing link sets:
+ *
+ *	__link_set_foreach(pvar, set)
+ *		Iterate over the link set `set'.  Because a link set is
+ *		an array of pointers, pvar must be declared as "type **pvar",
+ *		and the actual entry accessed as "*pvar".
+ *
+ *	__link_set_entry(set, idx)
+ *		Access the link set entry at index `idx' from set `set'.
+ */
+#define	__link_set_foreach(pvar, set)					\
+	for (pvar = __link_set_start(set); pvar < __link_set_end(set); pvar++)
+
+#define	__link_set_entry(set, idx)	(__link_set_begin(set)[idx])
+
+/*
+ * Some of the recend FreeBSD sources used in Bionic need this.
+ * Originally, this is used to embed the rcs versions of each source file
+ * in the generated binary. We certainly don't want this in Bionic.
+ */
+#define	__FBSDID(s)	struct __hack
+
+/*-
+ * The following definitions are an extension of the behavior originally
+ * implemented in <sys/_posix.h>, but with a different level of granularity.
+ * POSIX.1 requires that the macros we test be defined before any standard
+ * header file is included.
+ *
+ * Here's a quick run-down of the versions:
+ *  defined(_POSIX_SOURCE)		1003.1-1988
+ *  _POSIX_C_SOURCE == 1		1003.1-1990
+ *  _POSIX_C_SOURCE == 2		1003.2-1992 C Language Binding Option
+ *  _POSIX_C_SOURCE == 199309		1003.1b-1993
+ *  _POSIX_C_SOURCE == 199506		1003.1c-1995, 1003.1i-1995,
+ *					and the omnibus ISO/IEC 9945-1: 1996
+ *  _POSIX_C_SOURCE == 200112		1003.1-2001
+ *  _POSIX_C_SOURCE == 200809		1003.1-2008
+ *
+ * In addition, the X/Open Portability Guide, which is now the Single UNIX
+ * Specification, defines a feature-test macro which indicates the version of
+ * that specification, and which subsumes _POSIX_C_SOURCE.
+ *
+ * Our macros begin with two underscores to avoid namespace screwage.
+ */
+
+/* Deal with IEEE Std. 1003.1-1990, in which _POSIX_C_SOURCE == 1. */
+#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE == 1
+#undef _POSIX_C_SOURCE		/* Probably illegal, but beyond caring now. */
+#define	_POSIX_C_SOURCE		199009
+#endif
+
+/* Deal with IEEE Std. 1003.2-1992, in which _POSIX_C_SOURCE == 2. */
+#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE == 2
+#undef _POSIX_C_SOURCE
+#define	_POSIX_C_SOURCE		199209
+#endif
+
+/* Deal with various X/Open Portability Guides and Single UNIX Spec. */
+#ifdef _XOPEN_SOURCE
+#if _XOPEN_SOURCE - 0 >= 700
+#define	__XSI_VISIBLE		700
+#undef _POSIX_C_SOURCE
+#define	_POSIX_C_SOURCE		200809
+#elif _XOPEN_SOURCE - 0 >= 600
+#define	__XSI_VISIBLE		600
+#undef _POSIX_C_SOURCE
+#define	_POSIX_C_SOURCE		200112
+#elif _XOPEN_SOURCE - 0 >= 500
+#define	__XSI_VISIBLE		500
+#undef _POSIX_C_SOURCE
+#define	_POSIX_C_SOURCE		199506
+#endif
+#endif
+
+/*
+ * Deal with all versions of POSIX.  The ordering relative to the tests above is
+ * important.
+ */
+#if defined(_POSIX_SOURCE) && !defined(_POSIX_C_SOURCE)
+#define	_POSIX_C_SOURCE		198808
+#endif
+#ifdef _POSIX_C_SOURCE
+#if _POSIX_C_SOURCE >= 200809
+#define	__POSIX_VISIBLE		200809
+#define	__ISO_C_VISIBLE		1999
+#elif _POSIX_C_SOURCE >= 200112
+#define	__POSIX_VISIBLE		200112
+#define	__ISO_C_VISIBLE		1999
+#elif _POSIX_C_SOURCE >= 199506
+#define	__POSIX_VISIBLE		199506
+#define	__ISO_C_VISIBLE		1990
+#elif _POSIX_C_SOURCE >= 199309
+#define	__POSIX_VISIBLE		199309
+#define	__ISO_C_VISIBLE		1990
+#elif _POSIX_C_SOURCE >= 199209
+#define	__POSIX_VISIBLE		199209
+#define	__ISO_C_VISIBLE		1990
+#elif _POSIX_C_SOURCE >= 199009
+#define	__POSIX_VISIBLE		199009
+#define	__ISO_C_VISIBLE		1990
+#else
+#define	__POSIX_VISIBLE		198808
+#define	__ISO_C_VISIBLE		0
+#endif /* _POSIX_C_SOURCE */
+#else
+/*-
+ * Deal with _ANSI_SOURCE:
+ * If it is defined, and no other compilation environment is explicitly
+ * requested, then define our internal feature-test macros to zero.  This
+ * makes no difference to the preprocessor (undefined symbols in preprocessing
+ * expressions are defined to have value zero), but makes it more convenient for
+ * a test program to print out the values.
+ *
+ * If a program mistakenly defines _ANSI_SOURCE and some other macro such as
+ * _POSIX_C_SOURCE, we will assume that it wants the broader compilation
+ * environment (and in fact we will never get here).
+ */
+#if defined(_ANSI_SOURCE)	/* Hide almost everything. */
+#define	__POSIX_VISIBLE		0
+#define	__XSI_VISIBLE		0
+#define	__BSD_VISIBLE		0
+#define	__ISO_C_VISIBLE		1990
+#elif defined(_C99_SOURCE)	/* Localism to specify strict C99 env. */
+#define	__POSIX_VISIBLE		0
+#define	__XSI_VISIBLE		0
+#define	__BSD_VISIBLE		0
+#define	__ISO_C_VISIBLE		1999
+#else				/* Default environment: show everything. */
+#define	__POSIX_VISIBLE		200809
+#define	__XSI_VISIBLE		700
+#define	__BSD_VISIBLE		1
+#define	__ISO_C_VISIBLE		1999
+#endif
+#endif
+
+/*
+ * Default values.
+ */
+#ifndef __XPG_VISIBLE
+# define __XPG_VISIBLE          700
+#endif
+#ifndef __POSIX_VISIBLE
+# define __POSIX_VISIBLE        200809
+#endif
+#ifndef __ISO_C_VISIBLE
+# define __ISO_C_VISIBLE        1999
+#endif
+#ifndef __BSD_VISIBLE
+# define __BSD_VISIBLE          1
+#endif
+
+#define  __BIONIC__   1
+
+#endif /* !_SYS_CDEFS_H_ */
diff --git a/ndk/platforms/android-3/include/sys/cdefs_elf.h b/ndk/platforms/android-3/include/sys/cdefs_elf.h
new file mode 100644
index 0000000..e051b1d
--- /dev/null
+++ b/ndk/platforms/android-3/include/sys/cdefs_elf.h
@@ -0,0 +1,152 @@
+/*	$NetBSD: cdefs_elf.h,v 1.22 2005/02/26 22:25:34 perry Exp $	*/
+
+/*
+ * Copyright (c) 1995, 1996 Carnegie-Mellon University.
+ * All rights reserved.
+ *
+ * Author: Chris G. Demetriou
+ *
+ * Permission to use, copy, modify and distribute this software and
+ * its documentation is hereby granted, provided that both the copyright
+ * notice and this permission notice appear in all copies of the
+ * software, derivative works or modified versions, and any portions
+ * thereof, and that both notices appear in supporting documentation.
+ *
+ * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
+ * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
+ * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
+ *
+ * Carnegie Mellon requests users of this software to return to
+ *
+ *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
+ *  School of Computer Science
+ *  Carnegie Mellon University
+ *  Pittsburgh PA 15213-3890
+ *
+ * any improvements or extensions that they make and grant Carnegie the
+ * rights to redistribute these changes.
+ */
+
+#ifndef _SYS_CDEFS_ELF_H_
+#define	_SYS_CDEFS_ELF_H_
+
+#ifdef __LEADING_UNDERSCORE
+#define	_C_LABEL(x)	__CONCAT(_,x)
+#define _C_LABEL_STRING(x)	"_"x
+#else
+#define	_C_LABEL(x)	x
+#define _C_LABEL_STRING(x)	x
+#endif
+
+#if __STDC__
+#define	___RENAME(x)	__asm__(___STRING(_C_LABEL(x)))
+#else
+#ifdef __LEADING_UNDERSCORE
+#define	___RENAME(x)	____RENAME(_/**/x)
+#define	____RENAME(x)	__asm__(___STRING(x))
+#else
+#define	___RENAME(x)	__asm__(___STRING(x))
+#endif
+#endif
+
+#define	__indr_reference(sym,alias)	/* nada, since we do weak refs */
+
+#if __STDC__
+#define	__strong_alias(alias,sym)	       				\
+    __asm__(".global " _C_LABEL_STRING(#alias) "\n"			\
+	    _C_LABEL_STRING(#alias) " = " _C_LABEL_STRING(#sym));
+
+#define	__weak_alias(alias,sym)						\
+    __asm__(".weak " _C_LABEL_STRING(#alias) "\n"			\
+	    _C_LABEL_STRING(#alias) " = " _C_LABEL_STRING(#sym));
+#define	__weak_extern(sym)						\
+    __asm__(".weak " _C_LABEL_STRING(#sym));
+#define	__warn_references(sym,msg)					\
+    __asm__(".section .gnu.warning." #sym "\n\t.ascii \"" msg "\"\n\t.text");
+
+#else /* !__STDC__ */
+
+#ifdef __LEADING_UNDERSCORE
+#define __weak_alias(alias,sym) ___weak_alias(_/**/alias,_/**/sym)
+#define	___weak_alias(alias,sym)					\
+    __asm__(".weak alias\nalias = sym");
+#else
+#define	__weak_alias(alias,sym)						\
+    __asm__(".weak alias\nalias = sym");
+#endif
+#ifdef __LEADING_UNDERSCORE
+#define __weak_extern(sym) ___weak_extern(_/**/sym)
+#define	___weak_extern(sym)						\
+    __asm__(".weak sym");
+#else
+#define	__weak_extern(sym)						\
+    __asm__(".weak sym");
+#endif
+#define	__warn_references(sym,msg)					\
+    __asm__(".section .gnu.warning.sym\n\t.ascii msg ; .text");
+
+#endif /* !__STDC__ */
+
+#if __STDC__
+#define	__SECTIONSTRING(_sec, _str)					\
+	__asm__(".section " #_sec "\n\t.asciz \"" _str "\"\n\t.previous")
+#else
+#define	__SECTIONSTRING(_sec, _str)					\
+	__asm__(".section _sec\n\t.asciz _str\n\t.previous")
+#endif
+
+#define	__IDSTRING(_n,_s)		__SECTIONSTRING(.ident,_s)
+
+#define	__RCSID(_s)			__IDSTRING(rcsid,_s)
+#define	__SCCSID(_s)
+#define __SCCSID2(_s)
+#if 0	/* XXX userland __COPYRIGHTs have \ns in them */
+#define	__COPYRIGHT(_s)			__SECTIONSTRING(.copyright,_s)
+#else
+#define	__COPYRIGHT(_s)							\
+	static const char copyright[]					\
+	    __attribute__((__unused__,__section__(".copyright"))) = _s
+#endif
+
+#define	__KERNEL_RCSID(_n, _s)		__RCSID(_s)
+#define	__KERNEL_SCCSID(_n, _s)
+#if 0	/* XXX see above */
+#define	__KERNEL_COPYRIGHT(_n, _s)	__COPYRIGHT(_s)
+#else
+#define	__KERNEL_COPYRIGHT(_n, _s)	__SECTIONSTRING(.copyright, _s)
+#endif
+
+#ifndef __lint__
+#define	__link_set_make_entry(set, sym)					\
+	static void const * const __link_set_##set##_sym_##sym		\
+	    __section("link_set_" #set) __used = &sym
+#define	__link_set_make_entry2(set, sym, n)				\
+	static void const * const __link_set_##set##_sym_##sym##_##n	\
+	    __section("link_set_" #set) __used = &sym[n]
+#else
+#define	__link_set_make_entry(set, sym)					\
+	extern void const * const __link_set_##set##_sym_##sym
+#define	__link_set_make_entry2(set, sym, n)				\
+	extern void const * const __link_set_##set##_sym_##sym##_##n
+#endif /* __lint__ */
+
+#define	__link_set_add_text(set, sym)	__link_set_make_entry(set, sym)
+#define	__link_set_add_rodata(set, sym)	__link_set_make_entry(set, sym)
+#define	__link_set_add_data(set, sym)	__link_set_make_entry(set, sym)
+#define	__link_set_add_bss(set, sym)	__link_set_make_entry(set, sym)
+#define	__link_set_add_text2(set, sym, n)   __link_set_make_entry2(set, sym, n)
+#define	__link_set_add_rodata2(set, sym, n) __link_set_make_entry2(set, sym, n)
+#define	__link_set_add_data2(set, sym, n)   __link_set_make_entry2(set, sym, n)
+#define	__link_set_add_bss2(set, sym, n)    __link_set_make_entry2(set, sym, n)
+
+#define	__link_set_decl(set, ptype)					\
+	extern ptype * const __start_link_set_##set[];			\
+	extern ptype * const __stop_link_set_##set[]			\
+
+#define	__link_set_start(set)	(__start_link_set_##set)
+#define	__link_set_end(set)	(__stop_link_set_##set)
+
+#define	__link_set_count(set)						\
+	(__link_set_end(set) - __link_set_start(set))
+
+#endif /* !_SYS_CDEFS_ELF_H_ */
diff --git a/ndk/platforms/android-3/include/sys/dirent.h b/ndk/platforms/android-3/include/sys/dirent.h
new file mode 100644
index 0000000..da96f5e
--- /dev/null
+++ b/ndk/platforms/android-3/include/sys/dirent.h
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _SYS_DIRENT_H_
+#define _SYS_DIRENT_H_
+
+#include <stdint.h>
+#include <sys/cdefs.h>
+
+__BEGIN_DECLS
+
+/* this corresponds to the kernel dirent64 */
+struct dirent {
+  uint64_t          d_ino;
+  int64_t           d_off;
+  unsigned short    d_reclen;
+  unsigned char     d_type;
+  char              d_name[256];
+};
+
+extern int getdents(unsigned int, struct dirent *, unsigned int);
+
+__END_DECLS
+
+#endif /* _SYS_DIRENT_H_ */
diff --git a/ndk/platforms/android-3/include/sys/endian.h b/ndk/platforms/android-3/include/sys/endian.h
new file mode 100644
index 0000000..00f4839
--- /dev/null
+++ b/ndk/platforms/android-3/include/sys/endian.h
@@ -0,0 +1,273 @@
+/*	$OpenBSD: endian.h,v 1.17 2006/01/06 18:53:05 millert Exp $	*/
+
+/*-
+ * Copyright (c) 1997 Niklas Hallqvist.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * 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.
+ */
+
+/*
+ * Generic definitions for little- and big-endian systems.  Other endianesses
+ * has to be dealt with in the specific machine/endian.h file for that port.
+ *
+ * This file is meant to be included from a little- or big-endian port's
+ * machine/endian.h after setting _BYTE_ORDER to either 1234 for little endian
+ * or 4321 for big..
+ */
+
+#ifndef _SYS_ENDIAN_H_
+#define _SYS_ENDIAN_H_
+
+#include <sys/cdefs.h>
+#include <machine/_types.h>
+
+#define _LITTLE_ENDIAN	1234
+#define _BIG_ENDIAN	4321
+#define _PDP_ENDIAN	3412
+
+#if __BSD_VISIBLE
+#define LITTLE_ENDIAN	_LITTLE_ENDIAN
+#define BIG_ENDIAN	_BIG_ENDIAN
+#define PDP_ENDIAN	_PDP_ENDIAN
+#define BYTE_ORDER	_BYTE_ORDER
+#endif
+
+#ifdef __GNUC__
+
+#define __swap16gen(x) __statement({					\
+	__uint16_t __swap16gen_x = (x);					\
+									\
+	(__uint16_t)((__swap16gen_x & 0xff) << 8 |			\
+	    (__swap16gen_x & 0xff00) >> 8);				\
+})
+
+#define __swap32gen(x) __statement({					\
+	__uint32_t __swap32gen_x = (x);					\
+									\
+	(__uint32_t)((__swap32gen_x & 0xff) << 24 |			\
+	    (__swap32gen_x & 0xff00) << 8 |				\
+	    (__swap32gen_x & 0xff0000) >> 8 |				\
+	    (__swap32gen_x & 0xff000000) >> 24);			\
+})
+
+#define __swap64gen(x) __statement({					\
+	__uint64_t __swap64gen_x = (x);					\
+									\
+	(__uint64_t)((__swap64gen_x & 0xff) << 56 |			\
+	    (__swap64gen_x & 0xff00ULL) << 40 |				\
+	    (__swap64gen_x & 0xff0000ULL) << 24 |			\
+	    (__swap64gen_x & 0xff000000ULL) << 8 |			\
+	    (__swap64gen_x & 0xff00000000ULL) >> 8 |			\
+	    (__swap64gen_x & 0xff0000000000ULL) >> 24 |			\
+	    (__swap64gen_x & 0xff000000000000ULL) >> 40 |		\
+	    (__swap64gen_x & 0xff00000000000000ULL) >> 56);		\
+})
+
+#else /* __GNUC__ */
+
+/* Note that these macros evaluate their arguments several times.  */
+#define __swap16gen(x)							\
+    (__uint16_t)(((__uint16_t)(x) & 0xff) << 8 | ((__uint16_t)(x) & 0xff00) >> 8)
+
+#define __swap32gen(x)							\
+    (__uint32_t)(((__uint32_t)(x) & 0xff) << 24 |			\
+    ((__uint32_t)(x) & 0xff00) << 8 | ((__uint32_t)(x) & 0xff0000) >> 8 |\
+    ((__uint32_t)(x) & 0xff000000) >> 24)
+
+#define __swap64gen(x)							\
+	(__uint64_t)((((__uint64_t)(x) & 0xff) << 56) |			\
+	    ((__uint64_t)(x) & 0xff00ULL) << 40 |			\
+	    ((__uint64_t)(x) & 0xff0000ULL) << 24 |			\
+	    ((__uint64_t)(x) & 0xff000000ULL) << 8 |			\
+	    ((__uint64_t)(x) & 0xff00000000ULL) >> 8 |			\
+	    ((__uint64_t)(x) & 0xff0000000000ULL) >> 24 |		\
+	    ((__uint64_t)(x) & 0xff000000000000ULL) >> 40 |		\
+	    ((__uint64_t)(x) & 0xff00000000000000ULL) >> 56)
+
+#endif /* __GNUC__ */
+
+/*
+ * Define MD_SWAP if you provide swap{16,32}md functions/macros that are
+ * optimized for your architecture,  These will be used for swap{16,32}
+ * unless the argument is a constant and we are using GCC, where we can
+ * take advantage of the CSE phase much better by using the generic version.
+ */
+#ifdef MD_SWAP
+#if __GNUC__
+
+#define __swap16(x) __statement({					\
+	__uint16_t __swap16_x = (x);					\
+									\
+	__builtin_constant_p(x) ? __swap16gen(__swap16_x) :		\
+	    __swap16md(__swap16_x);					\
+})
+
+#define __swap32(x) __statement({					\
+	__uint32_t __swap32_x = (x);					\
+									\
+	__builtin_constant_p(x) ? __swap32gen(__swap32_x) :		\
+	    __swap32md(__swap32_x);					\
+})
+
+#define __swap64(x) __statement({					\
+	__uint64_t __swap64_x = (x);					\
+									\
+	__builtin_constant_p(x) ? __swap64gen(__swap64_x) :		\
+	    __swap64md(__swap64_x);					\
+})
+
+#endif /* __GNUC__  */
+
+#else /* MD_SWAP */
+#define __swap16 __swap16gen
+#define __swap32 __swap32gen
+#define __swap64 __swap64gen
+#endif /* MD_SWAP */
+
+#define __swap16_multi(v, n) do {						\
+	__size_t __swap16_multi_n = (n);				\
+	__uint16_t *__swap16_multi_v = (v);				\
+									\
+	while (__swap16_multi_n) {					\
+		*__swap16_multi_v = swap16(*__swap16_multi_v);		\
+		__swap16_multi_v++;					\
+		__swap16_multi_n--;					\
+	}								\
+} while (0)
+
+#if __BSD_VISIBLE
+#define swap16 __swap16
+#define swap32 __swap32
+#define swap64 __swap64
+#define swap16_multi __swap16_multi
+
+__BEGIN_DECLS
+__uint64_t	htobe64(__uint64_t);
+__uint32_t	htobe32(__uint32_t);
+__uint16_t	htobe16(__uint16_t);
+__uint64_t	betoh64(__uint64_t);
+__uint32_t	betoh32(__uint32_t);
+__uint16_t	betoh16(__uint16_t);
+
+__uint64_t	htole64(__uint64_t);
+__uint32_t	htole32(__uint32_t);
+__uint16_t	htole16(__uint16_t);
+__uint64_t	letoh64(__uint64_t);
+__uint32_t	letoh32(__uint32_t);
+__uint16_t	letoh16(__uint16_t);
+__END_DECLS
+#endif /* __BSD_VISIBLE */
+
+#if _BYTE_ORDER == _LITTLE_ENDIAN
+
+/* Can be overridden by machine/endian.h before inclusion of this file.  */
+#ifndef _QUAD_HIGHWORD
+#define _QUAD_HIGHWORD 1
+#endif
+#ifndef _QUAD_LOWWORD
+#define _QUAD_LOWWORD 0
+#endif
+
+#if __BSD_VISIBLE
+#define htobe16 __swap16
+#define htobe32 __swap32
+#define htobe64 __swap64
+#define betoh16 __swap16
+#define betoh32 __swap32
+#define betoh64 __swap64
+
+#define htole16(x) (x)
+#define htole32(x) (x)
+#define htole64(x) (x)
+#define letoh16(x) (x)
+#define letoh32(x) (x)
+#define letoh64(x) (x)
+#endif /* __BSD_VISIBLE */
+
+#define htons(x) __swap16(x)
+#define htonl(x) __swap32(x)
+#define ntohs(x) __swap16(x)
+#define ntohl(x) __swap32(x)
+
+/* Bionic additions */
+#define ntohq(x) __swap64(x)
+#define htonq(x) __swap64(x)
+
+#define __LITTLE_ENDIAN_BITFIELD
+
+#endif /* _BYTE_ORDER */
+
+#if _BYTE_ORDER == _BIG_ENDIAN
+
+/* Can be overridden by machine/endian.h before inclusion of this file.  */
+#ifndef _QUAD_HIGHWORD
+#define _QUAD_HIGHWORD 0
+#endif
+#ifndef _QUAD_LOWWORD
+#define _QUAD_LOWWORD 1
+#endif
+
+#if __BSD_VISIBLE
+#define htole16 __swap16
+#define htole32 __swap32
+#define htole64 __swap64
+#define letoh16 __swap16
+#define letoh32 __swap32
+#define letoh64 __swap64
+
+#define htobe16(x) (x)
+#define htobe32(x) (x)
+#define htobe64(x) (x)
+#define betoh16(x) (x)
+#define betoh32(x) (x)
+#define betoh64(x) (x)
+#endif /* __BSD_VISIBLE */
+
+#define htons(x) (x)
+#define htonl(x) (x)
+#define ntohs(x) (x)
+#define ntohl(x) (x)
+
+/* Bionic additions */
+#define ntohq(x) (x)
+#define htonq(x) (x)
+
+#define __BIG_ENDIAN_BITFIELD
+
+#endif /* _BYTE_ORDER */
+
+#if __BSD_VISIBLE
+#define	NTOHL(x) (x) = ntohl((u_int32_t)(x))
+#define	NTOHS(x) (x) = ntohs((u_int16_t)(x))
+#define	HTONL(x) (x) = htonl((u_int32_t)(x))
+#define	HTONS(x) (x) = htons((u_int16_t)(x))
+#endif
+
+
+#define  __BYTE_ORDER       _BYTE_ORDER
+#ifndef  __LITTLE_ENDIAN
+#define  __LITTLE_ENDIAN    _LITTLE_ENDIAN
+#endif
+#ifndef  __BIG_ENDIAN
+#define  __BIG_ENDIAN       _BIG_ENDIAN
+#endif
+
+#endif /* _SYS_ENDIAN_H_ */
diff --git a/ndk/platforms/android-3/include/sys/epoll.h b/ndk/platforms/android-3/include/sys/epoll.h
new file mode 100644
index 0000000..decdb46
--- /dev/null
+++ b/ndk/platforms/android-3/include/sys/epoll.h
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _SYS_EPOLL_H_
+#define _SYS_EPOLL_H_
+
+#include <sys/cdefs.h>
+
+__BEGIN_DECLS
+
+#define EPOLLIN          0x00000001
+#define EPOLLPRI         0x00000002
+#define EPOLLOUT         0x00000004
+#define EPOLLERR         0x00000008
+#define EPOLLHUP         0x00000010
+#define EPOLLRDNORM      0x00000040
+#define EPOLLRDBAND      0x00000080
+#define EPOLLWRNORM      0x00000100
+#define EPOLLWRBAND      0x00000200
+#define EPOLLMSG         0x00000400
+#define EPOLLET          0x80000000
+
+#define EPOLL_CTL_ADD    1
+#define EPOLL_CTL_DEL    2
+#define EPOLL_CTL_MOD    3
+
+typedef union epoll_data 
+{
+    void *ptr;
+    int fd;
+    unsigned int u32;
+    unsigned long long u64;
+} epoll_data_t;
+
+struct epoll_event 
+{
+    unsigned int events;
+    epoll_data_t data;
+};
+
+int epoll_create(int size);
+int epoll_ctl(int epfd, int op, int fd, struct epoll_event *event);
+int epoll_wait(int epfd, struct epoll_event *events, int max, int timeout);
+
+__END_DECLS
+
+#endif  /* _SYS_EPOLL_H_ */
+
diff --git a/ndk/platforms/android-3/include/sys/errno.h b/ndk/platforms/android-3/include/sys/errno.h
new file mode 100644
index 0000000..339f4fc
--- /dev/null
+++ b/ndk/platforms/android-3/include/sys/errno.h
@@ -0,0 +1 @@
+#include <errno.h>
diff --git a/ndk/platforms/android-3/include/sys/exec_elf.h b/ndk/platforms/android-3/include/sys/exec_elf.h
new file mode 100644
index 0000000..f72f81e
--- /dev/null
+++ b/ndk/platforms/android-3/include/sys/exec_elf.h
@@ -0,0 +1,625 @@
+/*	$OpenBSD: exec_elf.h,v 1.41 2006/01/06 18:53:05 millert Exp $	*/
+/*
+ * Copyright (c) 1995, 1996 Erik Theisen.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ * 3. 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.
+ */
+
+/*
+ * This is the ELF ABI header file
+ * formerly known as "elf_abi.h".
+ */
+
+#ifndef _SYS_EXEC_ELF_H_
+#define _SYS_EXEC_ELF_H_
+
+#include <machine/_types.h>
+#include <machine/exec.h>
+
+typedef __uint8_t	Elf_Byte;
+
+typedef __uint32_t	Elf32_Addr;	/* Unsigned program address */
+typedef __uint32_t	Elf32_Off;	/* Unsigned file offset */
+typedef __int32_t	Elf32_Sword;	/* Signed large integer */
+typedef __uint32_t	Elf32_Word;	/* Unsigned large integer */
+typedef __uint16_t	Elf32_Half;	/* Unsigned medium integer */
+
+typedef __uint64_t	Elf64_Addr;
+typedef __uint64_t	Elf64_Off;
+typedef __int32_t	Elf64_Shalf;
+
+#ifdef __alpha__
+typedef __int64_t	Elf64_Sword;
+typedef __uint64_t	Elf64_Word;
+#else
+typedef __int32_t	Elf64_Sword;
+typedef __uint32_t	Elf64_Word;
+#endif
+
+typedef __int64_t	Elf64_Sxword;
+typedef __uint64_t	Elf64_Xword;
+
+typedef __uint32_t	Elf64_Half;
+typedef __uint16_t	Elf64_Quarter;
+
+/*
+ * e_ident[] identification indexes 
+ * See http://www.caldera.com/developers/gabi/2000-07-17/ch4.eheader.html
+ */
+#define EI_MAG0		0		/* file ID */
+#define EI_MAG1		1		/* file ID */
+#define EI_MAG2		2		/* file ID */
+#define EI_MAG3		3		/* file ID */
+#define EI_CLASS	4		/* file class */
+#define EI_DATA		5		/* data encoding */
+#define EI_VERSION	6		/* ELF header version */
+#define EI_OSABI	7		/* OS/ABI ID */
+#define EI_ABIVERSION	8		/* ABI version */ 
+#define EI_PAD		9		/* start of pad bytes */
+#define EI_NIDENT	16		/* Size of e_ident[] */
+
+/* e_ident[] magic number */
+#define	ELFMAG0		0x7f		/* e_ident[EI_MAG0] */
+#define	ELFMAG1		'E'		/* e_ident[EI_MAG1] */
+#define	ELFMAG2		'L'		/* e_ident[EI_MAG2] */
+#define	ELFMAG3		'F'		/* e_ident[EI_MAG3] */
+#define	ELFMAG		"\177ELF"	/* magic */
+#define	SELFMAG		4		/* size of magic */
+
+/* e_ident[] file class */
+#define	ELFCLASSNONE	0		/* invalid */
+#define	ELFCLASS32	1		/* 32-bit objs */
+#define	ELFCLASS64	2		/* 64-bit objs */
+#define	ELFCLASSNUM	3		/* number of classes */
+
+/* e_ident[] data encoding */
+#define ELFDATANONE	0		/* invalid */
+#define ELFDATA2LSB	1		/* Little-Endian */
+#define ELFDATA2MSB	2		/* Big-Endian */
+#define ELFDATANUM	3		/* number of data encode defines */
+
+/* e_ident[] Operating System/ABI */
+#define ELFOSABI_SYSV		0	/* UNIX System V ABI */
+#define ELFOSABI_HPUX		1	/* HP-UX operating system */
+#define ELFOSABI_NETBSD		2	/* NetBSD */
+#define ELFOSABI_LINUX		3	/* GNU/Linux */
+#define ELFOSABI_HURD		4	/* GNU/Hurd */
+#define ELFOSABI_86OPEN		5	/* 86Open common IA32 ABI */
+#define ELFOSABI_SOLARIS	6	/* Solaris */
+#define ELFOSABI_MONTEREY	7	/* Monterey */
+#define ELFOSABI_IRIX		8	/* IRIX */
+#define ELFOSABI_FREEBSD	9	/* FreeBSD */
+#define ELFOSABI_TRU64		10	/* TRU64 UNIX */
+#define ELFOSABI_MODESTO	11	/* Novell Modesto */
+#define ELFOSABI_OPENBSD	12	/* OpenBSD */
+#define ELFOSABI_ARM		97	/* ARM */
+#define ELFOSABI_STANDALONE	255	/* Standalone (embedded) application */
+
+/* e_ident */
+#define IS_ELF(ehdr) ((ehdr).e_ident[EI_MAG0] == ELFMAG0 && \
+                      (ehdr).e_ident[EI_MAG1] == ELFMAG1 && \
+                      (ehdr).e_ident[EI_MAG2] == ELFMAG2 && \
+                      (ehdr).e_ident[EI_MAG3] == ELFMAG3)
+
+/* ELF Header */
+typedef struct elfhdr {
+	unsigned char	e_ident[EI_NIDENT]; /* ELF Identification */
+	Elf32_Half	e_type;		/* object file type */
+	Elf32_Half	e_machine;	/* machine */
+	Elf32_Word	e_version;	/* object file version */
+	Elf32_Addr	e_entry;	/* virtual entry point */
+	Elf32_Off	e_phoff;	/* program header table offset */
+	Elf32_Off	e_shoff;	/* section header table offset */
+	Elf32_Word	e_flags;	/* processor-specific flags */
+	Elf32_Half	e_ehsize;	/* ELF header size */
+	Elf32_Half	e_phentsize;	/* program header entry size */
+	Elf32_Half	e_phnum;	/* number of program header entries */
+	Elf32_Half	e_shentsize;	/* section header entry size */
+	Elf32_Half	e_shnum;	/* number of section header entries */
+	Elf32_Half	e_shstrndx;	/* section header table's "section 
+					   header string table" entry offset */
+} Elf32_Ehdr;
+
+typedef struct {
+	unsigned char	e_ident[EI_NIDENT];	/* Id bytes */
+	Elf64_Quarter	e_type;			/* file type */
+	Elf64_Quarter	e_machine;		/* machine type */
+	Elf64_Half	e_version;		/* version number */
+	Elf64_Addr	e_entry;		/* entry point */
+	Elf64_Off	e_phoff;		/* Program hdr offset */
+	Elf64_Off	e_shoff;		/* Section hdr offset */
+	Elf64_Half	e_flags;		/* Processor flags */
+	Elf64_Quarter	e_ehsize;		/* sizeof ehdr */
+	Elf64_Quarter	e_phentsize;		/* Program header entry size */
+	Elf64_Quarter	e_phnum;		/* Number of program headers */
+	Elf64_Quarter	e_shentsize;		/* Section header entry size */
+	Elf64_Quarter	e_shnum;		/* Number of section headers */
+	Elf64_Quarter	e_shstrndx;		/* String table index */
+} Elf64_Ehdr;
+
+/* e_type */
+#define ET_NONE		0		/* No file type */
+#define ET_REL		1		/* relocatable file */
+#define ET_EXEC		2		/* executable file */
+#define ET_DYN		3		/* shared object file */
+#define ET_CORE		4		/* core file */
+#define ET_NUM		5		/* number of types */
+#define ET_LOPROC	0xff00		/* reserved range for processor */
+#define ET_HIPROC	0xffff		/*  specific e_type */
+
+/* e_machine */
+#define EM_NONE		0		/* No Machine */
+#define EM_M32		1		/* AT&T WE 32100 */
+#define EM_SPARC	2		/* SPARC */
+#define EM_386		3		/* Intel 80386 */
+#define EM_68K		4		/* Motorola 68000 */
+#define EM_88K		5		/* Motorola 88000 */
+#define EM_486		6		/* Intel 80486 - unused? */
+#define EM_860		7		/* Intel 80860 */
+#define EM_MIPS		8		/* MIPS R3000 Big-Endian only */
+/* 
+ * Don't know if EM_MIPS_RS4_BE,
+ * EM_SPARC64, EM_PARISC,
+ * or EM_PPC are ABI compliant
+ */
+#define EM_MIPS_RS4_BE	10		/* MIPS R4000 Big-Endian */
+#define EM_SPARC64	11		/* SPARC v9 64-bit unoffical */
+#define EM_PARISC	15		/* HPPA */
+#define EM_SPARC32PLUS	18		/* Enhanced instruction set SPARC */
+#define EM_PPC		20		/* PowerPC */
+#define EM_ARM		40		/* Advanced RISC Machines ARM */
+#define EM_ALPHA	41		/* DEC ALPHA */
+#define EM_SPARCV9	43		/* SPARC version 9 */
+#define EM_ALPHA_EXP	0x9026		/* DEC ALPHA */
+#define EM_AMD64	62		/* AMD64 architecture */
+#define EM_VAX		75		/* DEC VAX */
+#define EM_NUM		15		/* number of machine types */
+
+/* Version */
+#define EV_NONE		0		/* Invalid */
+#define EV_CURRENT	1		/* Current */
+#define EV_NUM		2		/* number of versions */
+
+/* Section Header */
+typedef struct {
+	Elf32_Word	sh_name;	/* name - index into section header
+					   string table section */
+	Elf32_Word	sh_type;	/* type */
+	Elf32_Word	sh_flags;	/* flags */
+	Elf32_Addr	sh_addr;	/* address */
+	Elf32_Off	sh_offset;	/* file offset */
+	Elf32_Word	sh_size;	/* section size */
+	Elf32_Word	sh_link;	/* section header table index link */
+	Elf32_Word	sh_info;	/* extra information */
+	Elf32_Word	sh_addralign;	/* address alignment */
+	Elf32_Word	sh_entsize;	/* section entry size */
+} Elf32_Shdr;
+
+typedef struct {
+	Elf64_Half	sh_name;	/* section name */
+	Elf64_Half	sh_type;	/* section type */
+	Elf64_Xword	sh_flags;	/* section flags */
+	Elf64_Addr	sh_addr;	/* virtual address */
+	Elf64_Off	sh_offset;	/* file offset */
+	Elf64_Xword	sh_size;	/* section size */
+	Elf64_Half	sh_link;	/* link to another */
+	Elf64_Half	sh_info;	/* misc info */
+	Elf64_Xword	sh_addralign;	/* memory alignment */
+	Elf64_Xword	sh_entsize;	/* table entry size */
+} Elf64_Shdr;
+
+/* Special Section Indexes */
+#define SHN_UNDEF	0		/* undefined */
+#define SHN_LORESERVE	0xff00		/* lower bounds of reserved indexes */
+#define SHN_LOPROC	0xff00		/* reserved range for processor */
+#define SHN_HIPROC	0xff1f		/*   specific section indexes */
+#define SHN_ABS		0xfff1		/* absolute value */
+#define SHN_COMMON	0xfff2		/* common symbol */
+#define SHN_HIRESERVE	0xffff		/* upper bounds of reserved indexes */
+
+/* sh_type */
+#define SHT_NULL	0		/* inactive */
+#define SHT_PROGBITS	1		/* program defined information */
+#define SHT_SYMTAB	2		/* symbol table section */
+#define SHT_STRTAB	3		/* string table section */
+#define SHT_RELA	4		/* relocation section with addends*/
+#define SHT_HASH	5		/* symbol hash table section */
+#define SHT_DYNAMIC	6		/* dynamic section */
+#define SHT_NOTE	7		/* note section */
+#define SHT_NOBITS	8		/* no space section */
+#define SHT_REL		9		/* relation section without addends */
+#define SHT_SHLIB	10		/* reserved - purpose unknown */
+#define SHT_DYNSYM	11		/* dynamic symbol table section */
+#define SHT_NUM		12		/* number of section types */
+#define SHT_LOPROC	0x70000000	/* reserved range for processor */
+#define SHT_HIPROC	0x7fffffff	/*  specific section header types */
+#define SHT_LOUSER	0x80000000	/* reserved range for application */
+#define SHT_HIUSER	0xffffffff	/*  specific indexes */
+
+/* Section names */
+#define ELF_BSS         ".bss"		/* uninitialized data */
+#define ELF_DATA        ".data"		/* initialized data */
+#define ELF_DEBUG       ".debug"	/* debug */
+#define ELF_DYNAMIC     ".dynamic"	/* dynamic linking information */
+#define ELF_DYNSTR      ".dynstr"	/* dynamic string table */
+#define ELF_DYNSYM      ".dynsym"	/* dynamic symbol table */
+#define ELF_FINI        ".fini"		/* termination code */
+#define ELF_GOT         ".got"		/* global offset table */
+#define ELF_HASH        ".hash"		/* symbol hash table */
+#define ELF_INIT        ".init"		/* initialization code */
+#define ELF_REL_DATA    ".rel.data"	/* relocation data */
+#define ELF_REL_FINI    ".rel.fini"	/* relocation termination code */
+#define ELF_REL_INIT    ".rel.init"	/* relocation initialization code */
+#define ELF_REL_DYN     ".rel.dyn"	/* relocaltion dynamic link info */
+#define ELF_REL_RODATA  ".rel.rodata"	/* relocation read-only data */
+#define ELF_REL_TEXT    ".rel.text"	/* relocation code */
+#define ELF_RODATA      ".rodata"	/* read-only data */
+#define ELF_SHSTRTAB    ".shstrtab"	/* section header string table */
+#define ELF_STRTAB      ".strtab"	/* string table */
+#define ELF_SYMTAB      ".symtab"	/* symbol table */
+#define ELF_TEXT        ".text"		/* code */
+
+
+/* Section Attribute Flags - sh_flags */
+#define SHF_WRITE	0x1		/* Writable */
+#define SHF_ALLOC	0x2		/* occupies memory */
+#define SHF_EXECINSTR	0x4		/* executable */
+#define SHF_MASKPROC	0xf0000000	/* reserved bits for processor */
+					/*  specific section attributes */
+
+/* Symbol Table Entry */
+typedef struct elf32_sym {
+	Elf32_Word	st_name;	/* name - index into string table */
+	Elf32_Addr	st_value;	/* symbol value */
+	Elf32_Word	st_size;	/* symbol size */
+	unsigned char	st_info;	/* type and binding */
+	unsigned char	st_other;	/* 0 - no defined meaning */
+	Elf32_Half	st_shndx;	/* section header index */
+} Elf32_Sym;
+
+typedef struct {
+	Elf64_Half	st_name;	/* Symbol name index in str table */
+	Elf_Byte	st_info;	/* type / binding attrs */
+	Elf_Byte	st_other;	/* unused */
+	Elf64_Quarter	st_shndx;	/* section index of symbol */
+	Elf64_Xword	st_value;	/* value of symbol */
+	Elf64_Xword	st_size;	/* size of symbol */
+} Elf64_Sym;
+
+/* Symbol table index */
+#define STN_UNDEF	0		/* undefined */
+
+/* Extract symbol info - st_info */
+#define ELF32_ST_BIND(x)	((x) >> 4)
+#define ELF32_ST_TYPE(x)	(((unsigned int) x) & 0xf)
+#define ELF32_ST_INFO(b,t)	(((b) << 4) + ((t) & 0xf))
+
+#define ELF64_ST_BIND(x)	((x) >> 4)
+#define ELF64_ST_TYPE(x)	(((unsigned int) x) & 0xf)
+#define ELF64_ST_INFO(b,t)	(((b) << 4) + ((t) & 0xf))
+
+/* Symbol Binding - ELF32_ST_BIND - st_info */
+#define STB_LOCAL	0		/* Local symbol */
+#define STB_GLOBAL	1		/* Global symbol */
+#define STB_WEAK	2		/* like global - lower precedence */
+#define STB_NUM		3		/* number of symbol bindings */
+#define STB_LOPROC	13		/* reserved range for processor */
+#define STB_HIPROC	15		/*  specific symbol bindings */
+
+/* Symbol type - ELF32_ST_TYPE - st_info */
+#define STT_NOTYPE	0		/* not specified */
+#define STT_OBJECT	1		/* data object */
+#define STT_FUNC	2		/* function */
+#define STT_SECTION	3		/* section */
+#define STT_FILE	4		/* file */
+#define STT_NUM		5		/* number of symbol types */
+#define STT_LOPROC	13		/* reserved range for processor */
+#define STT_HIPROC	15		/*  specific symbol types */
+
+/* Relocation entry with implicit addend */
+typedef struct {
+	Elf32_Addr	r_offset;	/* offset of relocation */
+	Elf32_Word	r_info;		/* symbol table index and type */
+} Elf32_Rel;
+
+/* Relocation entry with explicit addend */
+typedef struct {
+	Elf32_Addr	r_offset;	/* offset of relocation */
+	Elf32_Word	r_info;		/* symbol table index and type */
+	Elf32_Sword	r_addend;
+} Elf32_Rela;
+
+/* Extract relocation info - r_info */
+#define ELF32_R_SYM(i)		((i) >> 8)
+#define ELF32_R_TYPE(i)		((unsigned char) (i))
+#define ELF32_R_INFO(s,t) 	(((s) << 8) + (unsigned char)(t))
+
+typedef struct {
+	Elf64_Xword	r_offset;	/* where to do it */
+	Elf64_Xword	r_info;		/* index & type of relocation */
+} Elf64_Rel;
+
+typedef struct {
+	Elf64_Xword	r_offset;	/* where to do it */
+	Elf64_Xword	r_info;		/* index & type of relocation */
+	Elf64_Sxword	r_addend;	/* adjustment value */
+} Elf64_Rela;
+
+#define	ELF64_R_SYM(info)	((info) >> 32)
+#define	ELF64_R_TYPE(info)	((info) & 0xFFFFFFFF)
+#define ELF64_R_INFO(s,t) 	(((s) << 32) + (__uint32_t)(t))
+
+/* Program Header */
+typedef struct {
+	Elf32_Word	p_type;		/* segment type */
+	Elf32_Off	p_offset;	/* segment offset */
+	Elf32_Addr	p_vaddr;	/* virtual address of segment */
+	Elf32_Addr	p_paddr;	/* physical address - ignored? */
+	Elf32_Word	p_filesz;	/* number of bytes in file for seg. */
+	Elf32_Word	p_memsz;	/* number of bytes in mem. for seg. */
+	Elf32_Word	p_flags;	/* flags */
+	Elf32_Word	p_align;	/* memory alignment */
+} Elf32_Phdr;
+
+typedef struct {
+	Elf64_Half	p_type;		/* entry type */
+	Elf64_Half	p_flags;	/* flags */
+	Elf64_Off	p_offset;	/* offset */
+	Elf64_Addr	p_vaddr;	/* virtual address */
+	Elf64_Addr	p_paddr;	/* physical address */
+	Elf64_Xword	p_filesz;	/* file size */
+	Elf64_Xword	p_memsz;	/* memory size */
+	Elf64_Xword	p_align;	/* memory & file alignment */
+} Elf64_Phdr;
+
+/* Segment types - p_type */
+#define PT_NULL		0		/* unused */
+#define PT_LOAD		1		/* loadable segment */
+#define PT_DYNAMIC	2		/* dynamic linking section */
+#define PT_INTERP	3		/* the RTLD */
+#define PT_NOTE		4		/* auxiliary information */
+#define PT_SHLIB	5		/* reserved - purpose undefined */
+#define PT_PHDR		6		/* program header */
+#define PT_NUM		7		/* Number of segment types */
+#define PT_LOOS		0x60000000	/* reserved range for OS */
+#define PT_HIOS		0x6fffffff	/*  specific segment types */
+#define PT_LOPROC	0x70000000	/* reserved range for processor */
+#define PT_HIPROC	0x7fffffff	/*  specific segment types */
+
+/* Segment flags - p_flags */
+#define PF_X		0x1		/* Executable */
+#define PF_W		0x2		/* Writable */
+#define PF_R		0x4		/* Readable */
+#define PF_MASKPROC	0xf0000000	/* reserved bits for processor */
+					/*  specific segment flags */
+
+/* Dynamic structure */
+typedef struct {
+	Elf32_Sword	d_tag;		/* controls meaning of d_val */
+	union {
+		Elf32_Word	d_val;	/* Multiple meanings - see d_tag */
+		Elf32_Addr	d_ptr;	/* program virtual address */
+	} d_un;
+} Elf32_Dyn;
+
+typedef struct {
+	Elf64_Xword	d_tag;		/* controls meaning of d_val */
+	union {
+		Elf64_Addr	d_ptr;
+		Elf64_Xword	d_val;
+	} d_un;
+} Elf64_Dyn;
+
+/* Dynamic Array Tags - d_tag */
+#define DT_NULL		0		/* marks end of _DYNAMIC array */
+#define DT_NEEDED	1		/* string table offset of needed lib */
+#define DT_PLTRELSZ	2		/* size of relocation entries in PLT */
+#define DT_PLTGOT	3		/* address PLT/GOT */
+#define DT_HASH		4		/* address of symbol hash table */
+#define DT_STRTAB	5		/* address of string table */
+#define DT_SYMTAB	6		/* address of symbol table */
+#define DT_RELA		7		/* address of relocation table */
+#define DT_RELASZ	8		/* size of relocation table */
+#define DT_RELAENT	9		/* size of relocation entry */
+#define DT_STRSZ	10		/* size of string table */
+#define DT_SYMENT	11		/* size of symbol table entry */
+#define DT_INIT		12		/* address of initialization func. */
+#define DT_FINI		13		/* address of termination function */
+#define DT_SONAME	14		/* string table offset of shared obj */
+#define DT_RPATH	15		/* string table offset of library
+					   search path */
+#define DT_SYMBOLIC	16		/* start sym search in shared obj. */
+#define DT_REL		17		/* address of rel. tbl. w addends */
+#define DT_RELSZ	18		/* size of DT_REL relocation table */
+#define DT_RELENT	19		/* size of DT_REL relocation entry */
+#define DT_PLTREL	20		/* PLT referenced relocation entry */
+#define DT_DEBUG	21		/* bugger */
+#define DT_TEXTREL	22		/* Allow rel. mod. to unwritable seg */
+#define DT_JMPREL	23		/* add. of PLT's relocation entries */
+#define DT_BIND_NOW	24		/* Bind now regardless of env setting */
+#define DT_NUM		25		/* Number used. */
+#define DT_LOPROC	0x70000000	/* reserved range for processor */
+#define DT_HIPROC	0x7fffffff	/*  specific dynamic array tags */
+	
+/* Standard ELF hashing function */
+unsigned int elf_hash(const unsigned char *name);
+
+/*
+ * Note Definitions
+ */
+typedef struct {
+	Elf32_Word namesz;
+	Elf32_Word descsz;
+	Elf32_Word type;
+} Elf32_Note;
+
+typedef struct {
+	Elf64_Half namesz;
+	Elf64_Half descsz;
+	Elf64_Half type;
+} Elf64_Note;
+
+/*
+ * XXX - these _KERNEL items aren't part of the ABI!
+ */
+#if defined(_KERNEL) || defined(_DYN_LOADER)
+
+#define ELF32_NO_ADDR	((u_long) ~0)	/* Indicates addr. not yet filled in */
+#define ELF_AUX_ENTRIES	8		/* Size of aux array passed to loader */
+
+typedef struct {
+	Elf32_Sword	au_id;				/* 32-bit id */
+	Elf32_Word	au_v;				/* 32-bit value */
+} Aux32Info;
+
+#define ELF64_NO_ADDR	((__uint64_t) ~0)/* Indicates addr. not yet filled in */
+#define ELF64_AUX_ENTRIES	8	/* Size of aux array passed to loader */
+
+typedef struct {
+	Elf64_Shalf	au_id;				/* 32-bit id */
+	Elf64_Xword	au_v;				/* 64-bit id */
+} Aux64Info;
+
+enum AuxID {
+	AUX_null = 0,
+	AUX_ignore = 1,
+	AUX_execfd = 2,
+	AUX_phdr = 3,			/* &phdr[0] */
+	AUX_phent = 4,			/* sizeof(phdr[0]) */
+	AUX_phnum = 5,			/* # phdr entries */
+	AUX_pagesz = 6,			/* PAGESIZE */
+	AUX_base = 7,			/* ld.so base addr */
+	AUX_flags = 8,			/* processor flags */
+	AUX_entry = 9,			/* a.out entry */
+	AUX_sun_uid = 2000,		/* euid */
+	AUX_sun_ruid = 2001,		/* ruid */
+	AUX_sun_gid = 2002,		/* egid */
+	AUX_sun_rgid = 2003		/* rgid */
+};
+
+struct elf_args {
+        u_long  arg_entry;		/* program entry point */
+        u_long  arg_interp;		/* Interpreter load address */
+        u_long  arg_phaddr;		/* program header address */
+        u_long  arg_phentsize;		/* Size of program header */
+        u_long  arg_phnum;		/* Number of program headers */
+        u_long  arg_os;			/* OS tag */
+};
+
+#endif
+
+#if !defined(ELFSIZE) && defined(ARCH_ELFSIZE)
+#define ELFSIZE ARCH_ELFSIZE
+#endif
+
+#if defined(ELFSIZE)
+#define CONCAT(x,y)	__CONCAT(x,y)
+#define ELFNAME(x)	CONCAT(elf,CONCAT(ELFSIZE,CONCAT(_,x)))
+#define ELFNAME2(x,y)	CONCAT(x,CONCAT(_elf,CONCAT(ELFSIZE,CONCAT(_,y))))
+#define ELFNAMEEND(x)	CONCAT(x,CONCAT(_elf,ELFSIZE))
+#define ELFDEFNNAME(x)	CONCAT(ELF,CONCAT(ELFSIZE,CONCAT(_,x)))
+#endif
+
+#if defined(ELFSIZE) && (ELFSIZE == 32)
+#define Elf_Ehdr	Elf32_Ehdr
+#define Elf_Phdr	Elf32_Phdr
+#define Elf_Shdr	Elf32_Shdr
+#define Elf_Sym		Elf32_Sym
+#define Elf_Rel		Elf32_Rel
+#define Elf_RelA	Elf32_Rela
+#define Elf_Dyn		Elf32_Dyn
+#define Elf_Half	Elf32_Half
+#define Elf_Word	Elf32_Word
+#define Elf_Sword	Elf32_Sword
+#define Elf_Addr	Elf32_Addr
+#define Elf_Off		Elf32_Off
+#define Elf_Nhdr	Elf32_Nhdr
+#define Elf_Note	Elf32_Note
+
+#define ELF_R_SYM	ELF32_R_SYM
+#define ELF_R_TYPE	ELF32_R_TYPE
+#define ELF_R_INFO	ELF32_R_INFO
+#define ELFCLASS	ELFCLASS32
+
+#define ELF_ST_BIND	ELF32_ST_BIND
+#define ELF_ST_TYPE	ELF32_ST_TYPE
+#define ELF_ST_INFO	ELF32_ST_INFO
+
+#define AuxInfo		Aux32Info
+#elif defined(ELFSIZE) && (ELFSIZE == 64)
+#define Elf_Ehdr	Elf64_Ehdr
+#define Elf_Phdr	Elf64_Phdr
+#define Elf_Shdr	Elf64_Shdr
+#define Elf_Sym		Elf64_Sym
+#define Elf_Rel		Elf64_Rel
+#define Elf_RelA	Elf64_Rela
+#define Elf_Dyn		Elf64_Dyn
+#define Elf_Half	Elf64_Half
+#define Elf_Word	Elf64_Word
+#define Elf_Sword	Elf64_Sword
+#define Elf_Addr	Elf64_Addr
+#define Elf_Off		Elf64_Off
+#define Elf_Nhdr	Elf64_Nhdr
+#define Elf_Note	Elf64_Note
+
+#define ELF_R_SYM	ELF64_R_SYM
+#define ELF_R_TYPE	ELF64_R_TYPE
+#define ELF_R_INFO	ELF64_R_INFO
+#define ELFCLASS	ELFCLASS64
+
+#define ELF_ST_BIND	ELF64_ST_BIND
+#define ELF_ST_TYPE	ELF64_ST_TYPE
+#define ELF_ST_INFO	ELF64_ST_INFO
+
+#define AuxInfo		Aux64Info
+#endif
+
+#ifndef _KERNEL
+extern Elf_Dyn		_DYNAMIC[];
+#endif
+
+#ifdef	_KERNEL
+#ifdef _KERN_DO_ELF64
+int exec_elf64_makecmds(struct proc *, struct exec_package *);
+void *elf64_copyargs(struct exec_package *, struct ps_strings *,
+        void *, void *);
+int exec_elf64_fixup(struct proc *, struct exec_package *);
+char *elf64_check_brand(Elf64_Ehdr *);
+int elf64_os_pt_note(struct proc *, struct exec_package *, Elf64_Ehdr *,
+	char *, size_t, size_t);
+#endif
+#ifdef _KERN_DO_ELF
+int exec_elf32_makecmds(struct proc *, struct exec_package *);
+void *elf32_copyargs(struct exec_package *, struct ps_strings *,
+        void *, void *);
+int exec_elf32_fixup(struct proc *, struct exec_package *);
+char *elf32_check_brand(Elf32_Ehdr *);
+int elf32_os_pt_note(struct proc *, struct exec_package *, Elf32_Ehdr *,
+	char *, size_t, size_t);
+#endif
+
+#endif /* _KERNEL */
+
+#define ELF_TARG_VER	1	/* The ver for which this code is intended */
+
+#endif /* _SYS_EXEC_ELF_H_ */
diff --git a/ndk/platforms/android-3/include/sys/file.h b/ndk/platforms/android-3/include/sys/file.h
new file mode 100644
index 0000000..cf2f4b1
--- /dev/null
+++ b/ndk/platforms/android-3/include/sys/file.h
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _SYS_FILE_H_
+#define _SYS_FILE_H_
+
+#include <sys/cdefs.h>
+#include <sys/types.h>
+
+/* ANDROID: needed for flock() */
+#include <unistd.h>
+#include <fcntl.h>
+
+#endif /* _SYS_FILE_H_ */
diff --git a/ndk/platforms/android-3/include/sys/fsuid.h b/ndk/platforms/android-3/include/sys/fsuid.h
new file mode 100644
index 0000000..bc47e3d
--- /dev/null
+++ b/ndk/platforms/android-3/include/sys/fsuid.h
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _SYS_FSUID_H_
+#define _SYS_FSUID_H_
+
+#include <sys/cdefs.h>
+#include <sys/types.h>
+
+__BEGIN_DECLS
+
+#if 0 /* MISSING FROM BIONIC */
+extern int setfsuid(uid_t);
+extern int setfsgid(gid_t);
+#endif /* MISSING */
+
+__END_DECLS
+
+#endif /* _SYS_FSUID_H_ */
diff --git a/ndk/platforms/android-3/include/sys/inotify.h b/ndk/platforms/android-3/include/sys/inotify.h
new file mode 100644
index 0000000..33f9e74
--- /dev/null
+++ b/ndk/platforms/android-3/include/sys/inotify.h
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _SYS_INOTIFY_H_
+#define _SYS_INOTIFY_H_
+
+#include <sys/cdefs.h>
+#include <sys/types.h>
+#include <linux/inotify.h>
+
+__BEGIN_DECLS
+
+extern int inotify_init(void);
+extern int inotify_add_watch(int, const char *, __u32);
+extern int inotify_rm_watch(int, __u32);
+
+__END_DECLS
+
+#endif /* _SYS_INOTIFY_H_ */
diff --git a/ndk/platforms/android-3/include/sys/ioctl.h b/ndk/platforms/android-3/include/sys/ioctl.h
new file mode 100644
index 0000000..9f68510
--- /dev/null
+++ b/ndk/platforms/android-3/include/sys/ioctl.h
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _SYS_IOCTL_H_
+#define _SYS_IOCTL_H_
+
+#include <sys/cdefs.h>
+#include <linux/ioctl.h>
+#include <asm/ioctls.h>
+#include <asm/termbits.h>
+#include <sys/ioctl_compat.h>
+
+__BEGIN_DECLS
+
+extern int ioctl(int, int, ...);
+
+__END_DECLS
+
+#endif /* _SYS_IOCTL_H_ */
diff --git a/ndk/platforms/android-3/include/sys/ioctl_compat.h b/ndk/platforms/android-3/include/sys/ioctl_compat.h
new file mode 100644
index 0000000..cab5c80
--- /dev/null
+++ b/ndk/platforms/android-3/include/sys/ioctl_compat.h
@@ -0,0 +1,168 @@
+/*	$NetBSD: ioctl_compat.h,v 1.15 2005/12/03 17:10:46 christos Exp $	*/
+
+/*
+ * Copyright (c) 1990, 1993
+ *	The Regents of the University of California.  All rights reserved.
+ * (c) UNIX System Laboratories, Inc.
+ * All or some portions of this file are derived from material licensed
+ * to the University of California by American Telephone and Telegraph
+ * Co. or Unix System Laboratories, Inc. and are reproduced herein with
+ * the permission of UNIX System Laboratories, Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ * 3. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
+ *
+ *	@(#)ioctl_compat.h	8.4 (Berkeley) 1/21/94
+ */
+
+#ifndef _SYS_IOCTL_COMPAT_H_
+#define	_SYS_IOCTL_COMPAT_H_
+
+/*#include <sys/ttychars.h>*/
+/*#include <sys/ttydev.h>*/
+
+struct tchars {
+	char	t_intrc;	/* interrupt */
+	char	t_quitc;	/* quit */
+	char	t_startc;	/* start output */
+	char	t_stopc;	/* stop output */
+	char	t_eofc;		/* end-of-file */
+	char	t_brkc;		/* input delimiter (like nl) */
+};
+
+struct ltchars {
+	char	t_suspc;	/* stop process signal */
+	char	t_dsuspc;	/* delayed stop process signal */
+	char	t_rprntc;	/* reprint line */
+	char	t_flushc;	/* flush output (toggles) */
+	char	t_werasc;	/* word erase */
+	char	t_lnextc;	/* literal next character */
+};
+
+/*
+ * Structure for TIOCGETP and TIOCSETP ioctls.
+ */
+#ifndef _SGTTYB_
+#define	_SGTTYB_
+struct sgttyb {
+	char	sg_ispeed;		/* input speed */
+	char	sg_ospeed;		/* output speed */
+	char	sg_erase;		/* erase character */
+	char	sg_kill;		/* kill character */
+	short	sg_flags;		/* mode flags */
+};
+#endif
+
+#ifdef USE_OLD_TTY
+# undef  TIOCGETD
+# define TIOCGETD	_IOR('t', 0, int)	/* get line discipline */
+# undef  TIOCSETD
+# define TIOCSETD	_IOW('t', 1, int)	/* set line discipline */
+#else
+# define OTIOCGETD	_IOR('t', 0, int)	/* get line discipline */
+# define OTIOCSETD	_IOW('t', 1, int)	/* set line discipline */
+#endif
+#define	TIOCHPCL	_IO('t', 2)		/* hang up on last close */
+#define	TIOCGETP	_IOR('t', 8,struct sgttyb)/* get parameters -- gtty */
+#define	TIOCSETP	_IOW('t', 9,struct sgttyb)/* set parameters -- stty */
+#define	TIOCSETN	_IOW('t',10,struct sgttyb)/* as above, but no flushtty*/
+#define	TIOCSETC	_IOW('t',17,struct tchars)/* set special characters */
+#define	TIOCGETC	_IOR('t',18,struct tchars)/* get special characters */
+#if 0
+/* BUG: a bunch of these conflict with #defines in asm/termbits.h */
+#define		TANDEM		0x00000001	/* send stopc on out q full */
+#define		CBREAK		0x00000002	/* half-cooked mode */
+#define		LCASE		0x00000004	/* simulate lower case */
+#define		ECHO		0x00000008	/* enable echoing */
+#define		CRMOD		0x00000010	/* map \r to \r\n on output */
+#define		RAW		0x00000020	/* no i/o processing */
+#define		ODDP		0x00000040	/* get/send odd parity */
+#define		EVENP		0x00000080	/* get/send even parity */
+#define		ANYP		0x000000c0	/* get any parity/send none */
+#define		NLDELAY		0x00000300	/* \n delay */
+#define			NL0	0x00000000
+#define			NL1	0x00000100	/* tty 37 */
+#define			NL2	0x00000200	/* vt05 */
+#define			NL3	0x00000300
+#define		TBDELAY		0x00000c00	/* horizontal tab delay */
+#define			TAB0	0x00000000
+#define			TAB1	0x00000400	/* tty 37 */
+#define			TAB2	0x00000800
+#define		XTABS		0x00000c00	/* expand tabs on output */
+#define		CRDELAY		0x00003000	/* \r delay */
+#define			CR0	0x00000000
+#define			CR1	0x00001000	/* tn 300 */
+#define			CR2	0x00002000	/* tty 37 */
+#define			CR3	0x00003000	/* concept 100 */
+#define		VTDELAY		0x00004000	/* vertical tab delay */
+#define			FF0	0x00000000
+#define			FF1	0x00004000	/* tty 37 */
+#define		BSDELAY		0x00008000	/* \b delay */
+#define			BS0	0x00000000
+#define			BS1	0x00008000
+#define		ALLDELAY	(NLDELAY|TBDELAY|CRDELAY|VTDELAY|BSDELAY)
+#define		CRTBS		0x00010000	/* do backspacing for crt */
+#define		PRTERA		0x00020000	/* \ ... / erase */
+#define		CRTERA		0x00040000	/* " \b " to wipe out char */
+#define		TILDE		0x00080000	/* hazeltine tilde kludge */
+#define		MDMBUF		0x00100000	/* DTR/DCD hardware flow control */
+#define		LITOUT		0x00200000	/* literal output */
+#define		TOSTOP		0x00400000	/* stop background jobs on output */
+#define		FLUSHO		0x00800000	/* output being flushed (state) */
+#define		NOHANG		0x01000000	/* (no-op) was no SIGHUP on carrier drop */
+#define		L001000		0x02000000
+#define		CRTKIL		0x04000000	/* kill line with " \b " */
+#define		PASS8		0x08000000
+#define		CTLECH		0x10000000	/* echo control chars as ^X */
+#define		PENDIN		0x20000000	/* re-echo input buffer at next read */
+#define		DECCTQ		0x40000000	/* only ^Q starts after ^S */
+#define		NOFLSH		0x80000000	/* don't flush output on signal */
+#endif
+#define	TIOCLBIS	_IOW('t', 127, int)	/* bis local mode bits */
+#define	TIOCLBIC	_IOW('t', 126, int)	/* bic local mode bits */
+#define	TIOCLSET	_IOW('t', 125, int)	/* set entire local mode word */
+#define	TIOCLGET	_IOR('t', 124, int)	/* get local modes */
+#define		LCRTBS		(CRTBS>>16)
+#define		LPRTERA		(PRTERA>>16)
+#define		LCRTERA		(CRTERA>>16)
+#define		LTILDE		(TILDE>>16)
+#define		LMDMBUF		(MDMBUF>>16)
+#define		LLITOUT		(LITOUT>>16)
+#define		LTOSTOP		(TOSTOP>>16)
+#define		LFLUSHO		(FLUSHO>>16)
+#define		LNOHANG		(NOHANG>>16)
+#define		LCRTKIL		(CRTKIL>>16)
+#define		LPASS8		(PASS8>>16)
+#define		LCTLECH		(CTLECH>>16)
+#define		LPENDIN		(PENDIN>>16)
+#define		LDECCTQ		(DECCTQ>>16)
+#define		LNOFLSH		(NOFLSH>>16)
+#define	TIOCSLTC	_IOW('t',117,struct ltchars)/* set local special chars*/
+#define	TIOCGLTC	_IOR('t',116,struct ltchars)/* get local special chars*/
+#define OTIOCCONS	_IO('t', 98)	/* for hp300 -- sans int arg */
+#define	OTTYDISC	0
+#define	NETLDISC	1
+#define	NTTYDISC	2
+
+#endif /* !_SYS_IOCTL_COMPAT_H_ */
diff --git a/ndk/platforms/android-3/include/sys/ipc.h b/ndk/platforms/android-3/include/sys/ipc.h
new file mode 100644
index 0000000..c0ae0ba
--- /dev/null
+++ b/ndk/platforms/android-3/include/sys/ipc.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _SYS_IPC_H
+#define _SYS_IPC_H
+
+#include <sys/cdefs.h>
+#include <sys/types.h>
+#include <linux/ipc.h>
+
+__BEGIN_DECLS
+
+extern key_t  ftok(const char*  path, int  id);
+
+__END_DECLS
+
+#endif /* _SYS_IPC_H */
diff --git a/ndk/platforms/android-3/include/sys/klog.h b/ndk/platforms/android-3/include/sys/klog.h
new file mode 100644
index 0000000..21bb7d9
--- /dev/null
+++ b/ndk/platforms/android-3/include/sys/klog.h
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _SYS_KLOG_H_
+#define _SYS_KLOG_H_
+
+#include <sys/cdefs.h>
+
+__BEGIN_DECLS
+
+#define KLOG_CLOSE      0
+#define KLOG_OPEN       1
+#define KLOG_READ       2
+#define KLOG_READ_ALL   3
+#define KLOG_READ_CLEAR 4
+#define KLOG_CLEAR      5
+#define KLOG_DISABLE    6
+#define KLOG_ENABLE     7
+#define KLOG_SETLEVEL   8
+#define KLOG_UNREADSIZE 9
+#define KLOG_WRITE      10
+
+extern int klogctl(int, char *, int);
+
+__END_DECLS
+
+#endif /* _SYS_KLOG_H_ */
diff --git a/ndk/platforms/android-3/include/sys/limits.h b/ndk/platforms/android-3/include/sys/limits.h
new file mode 100644
index 0000000..41d02ff
--- /dev/null
+++ b/ndk/platforms/android-3/include/sys/limits.h
@@ -0,0 +1,179 @@
+/* $OpenBSD: limits.h,v 1.6 2005/12/13 00:35:23 millert Exp $ */
+/*
+ * Copyright (c) 2002 Marc Espie.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OPENBSD PROJECT AND CONTRIBUTORS
+ * ``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 OPENBSD
+ * PROJECT OR CONTRIBUTORS 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 _SYS_LIMITS_H_
+#define _SYS_LIMITS_H_
+
+#include <sys/cdefs.h>
+#include <linux/limits.h>
+
+/* Common definitions for limits.h. */
+
+/*
+ * <machine/internal_types.h> is meant to describe a specific architecture,
+ * but to be a safe include, that doesn't ever define anything that is
+ * user-visible (only typedefs and #define names that stays in the __xxx
+ * namespace).
+ *
+ *   __machine_has_unsigned_chars	(default is signed chars)
+ *   __FLT_xxx/__DBL_xxx		non standard values for floating
+ *   					points limits.
+ */
+#include <machine/internal_types.h>
+
+/* Legacy */
+#include <machine/limits.h>
+
+#define	CHAR_BIT	8		/* number of bits in a char */
+
+#define	SCHAR_MAX	0x7f		/* max value for a signed char */
+#define SCHAR_MIN	(-0x7f-1)	/* min value for a signed char */
+
+#define	UCHAR_MAX	0xffU		/* max value for an unsigned char */
+#ifdef __machine_has_unsigned_chars
+# define CHAR_MIN	0		/* min value for a char */
+# define CHAR_MAX	0xff		/* max value for a char */
+#else
+# define CHAR_MAX	0x7f
+# define CHAR_MIN	(-0x7f-1)
+#endif
+
+#define	USHRT_MAX	0xffffU		/* max value for an unsigned short */
+#define	SHRT_MAX	0x7fff		/* max value for a short */
+#define SHRT_MIN        (-0x7fff-1)     /* min value for a short */
+
+#define	UINT_MAX	0xffffffffU	/* max value for an unsigned int */
+#define	INT_MAX		0x7fffffff	/* max value for an int */
+#define	INT_MIN		(-0x7fffffff-1)	/* min value for an int */
+
+#ifdef __LP64__
+# define ULONG_MAX	0xffffffffffffffffUL
+					/* max value for unsigned long */
+# define LONG_MAX	0x7fffffffffffffffL
+					/* max value for a signed long */
+# define LONG_MIN	(-0x7fffffffffffffffL-1)
+					/* min value for a signed long */
+#else
+# define ULONG_MAX	0xffffffffUL	/* max value for an unsigned long */
+# define LONG_MAX	0x7fffffffL	/* max value for a long */
+# define LONG_MIN	(-0x7fffffffL-1)/* min value for a long */
+#endif
+
+#if __BSD_VISIBLE || __ISO_C_VISIBLE >= 1999
+# define ULLONG_MAX	0xffffffffffffffffULL
+					/* max value for unsigned long long */
+# define LLONG_MAX	0x7fffffffffffffffLL
+					/* max value for a signed long long */
+# define LLONG_MIN	(-0x7fffffffffffffffLL-1)
+					/* min value for a signed long long */
+#endif
+
+#if __BSD_VISIBLE
+# define UID_MAX	UINT_MAX	/* max value for a uid_t */
+# define GID_MAX	UINT_MAX	/* max value for a gid_t */
+#endif
+
+
+#ifdef __LP64__
+# define LONG_BIT	64
+#else
+# define LONG_BIT	32
+#endif
+
+/* float.h defines these as well */
+# if !defined(DBL_DIG)
+#  if defined(__DBL_DIG)
+#   define DBL_DIG	__DBL_DIG
+#   define DBL_MAX	__DBL_MAX
+#   define DBL_MIN	__DBL_MIN
+
+#   define FLT_DIG	__FLT_DIG
+#   define FLT_MAX	__FLT_MAX
+#   define FLT_MIN	__FLT_MIN
+#  else
+#   define DBL_DIG	15
+#   define DBL_MAX	1.7976931348623157E+308
+#   define DBL_MIN	2.2250738585072014E-308
+
+#   define FLT_DIG	6
+#   define FLT_MAX	3.40282347E+38F
+#   define FLT_MIN	1.17549435E-38F
+#  endif
+# endif
+
+/* Bionic: the following has been optimized out from our processed kernel headers */
+
+#define  CHILD_MAX   999
+#define  OPEN_MAX    256
+
+/* Bionic-specific definitions */
+
+#define  _POSIX_VERSION             200112L   /* Posix C language bindings version */
+#define  _POSIX2_VERSION            -1        /* we don't support Posix command-line tools */
+#define  _POSIX2_C_VERSION          _POSIX_VERSION
+#define  _XOPEN_VERSION             500       /* by Posix definition */
+#define  _XOPEN_XCU_VERSION         -1        /* we don't support command-line utilities */
+
+/* tell what we implement legacy stuff when appropriate */
+#if _POSIX_VERSION > 0
+#define  _XOPEN_XPG2                1
+#define  _XOPEN_XPG3                1
+#define  _XOPEN_XPG4                1
+#define  _XOPEN_UNIX                1
+#endif
+
+#define  _XOPEN_ENH_I18N          -1  /* we don't support internationalization in the C library */
+#define  _XOPEN_CRYPT             -1  /* don't support X/Open Encryption */
+#define  _XOPEN_LEGACY            -1  /* don't claim we support these, we have some of them but not all */
+#define  _XOPEN_REALTIME          -1 /* we don't support all these functions */
+#define  _XOPEN_REALTIME_THREADS  -1  /* same here */
+
+#define  _POSIX_REALTIME_SIGNALS    -1  /* for now, this is not supported */
+#define  _POSIX_PRIORITY_SCHEDULING  1  /* priority scheduling is a Linux feature */
+#define  _POSIX_TIMERS               1  /* Posix timers are supported */
+#undef   _POSIX_ASYNCHRONOUS_IO         /* aio_ functions are not supported */
+#define  _POSIX_SYNCHRONIZED_IO      1  /* synchronized i/o supported */
+#define  _POSIX_FSYNC                1  /* fdatasync() supported */
+#define  _POSIX_MAPPED_FILES         1  /* mmap-ed files supported */
+
+/* XXX: TODO: complete and check list here */
+
+
+#define  _POSIX_THREADS             1    /* we support threads */
+#define  _POSIX_THREAD_STACKADDR    1    /* we support thread stack address */
+#define  _POSIX_THREAD_STACKSIZE    1    /* we support thread stack size */
+#define  _POSIX_THREAD_PRIO_INHERIT 200112L   /* linux feature */
+#define  _POSIX_THREAD_PRIO_PROTECT 200112L   /* linux feature */
+
+#undef   _POSIX_PROCESS_SHARED           /* we don't support process-shared synchronization */
+#undef   _POSIX_THREAD_SAFE_FUNCTIONS    /* most functions are, but not everything yet */
+#define  _POSIX_CHOWN_RESTRICTED    1    /* yes, chown requires appropriate priviledges */
+#define  _POSIX_NO_TRUNC            1    /* very long pathnames generate an error */
+#define  _POSIX_SAVED_IDS           1    /* saved user ids is a Linux feature */
+#define  _POSIX_JOB_CONTROL         1    /* job control is a Linux feature */
+
+
+
+#endif
diff --git a/ndk/platforms/android-3/include/sys/linux-syscalls.h b/ndk/platforms/android-3/include/sys/linux-syscalls.h
new file mode 100644
index 0000000..7772f1e
--- /dev/null
+++ b/ndk/platforms/android-3/include/sys/linux-syscalls.h
@@ -0,0 +1,223 @@
+/* auto-generated by gensyscalls.py, do not touch */
+#ifndef _BIONIC_LINUX_SYSCALLS_H_
+
+#if !defined __ASM_ARM_UNISTD_H && !defined __ASM_I386_UNISTD_H
+#if defined __arm__ && !defined __ARM_EABI__ && !defined __thumb__
+  #  define __NR_SYSCALL_BASE  0x900000
+  #else
+  #  define  __NR_SYSCALL_BASE  0
+  #endif
+
+#define __NR_exit                         (__NR_SYSCALL_BASE + 1)
+#define __NR_fork                         (__NR_SYSCALL_BASE + 2)
+#define __NR_clone                        (__NR_SYSCALL_BASE + 120)
+#define __NR_execve                       (__NR_SYSCALL_BASE + 11)
+#define __NR_setuid32                     (__NR_SYSCALL_BASE + 213)
+#define __NR_getuid32                     (__NR_SYSCALL_BASE + 199)
+#define __NR_getgid32                     (__NR_SYSCALL_BASE + 200)
+#define __NR_geteuid32                    (__NR_SYSCALL_BASE + 201)
+#define __NR_getegid32                    (__NR_SYSCALL_BASE + 202)
+#define __NR_getresuid32                  (__NR_SYSCALL_BASE + 209)
+#define __NR_getresgid32                  (__NR_SYSCALL_BASE + 211)
+#define __NR_gettid                       (__NR_SYSCALL_BASE + 224)
+#define __NR_getgroups32                  (__NR_SYSCALL_BASE + 205)
+#define __NR_getpgid                      (__NR_SYSCALL_BASE + 132)
+#define __NR_getppid                      (__NR_SYSCALL_BASE + 64)
+#define __NR_setsid                       (__NR_SYSCALL_BASE + 66)
+#define __NR_setgid32                     (__NR_SYSCALL_BASE + 214)
+#define __NR_setreuid32                   (__NR_SYSCALL_BASE + 203)
+#define __NR_setresuid32                  (__NR_SYSCALL_BASE + 208)
+#define __NR_setresgid32                  (__NR_SYSCALL_BASE + 210)
+#define __NR_brk                          (__NR_SYSCALL_BASE + 45)
+#define __NR_ptrace                       (__NR_SYSCALL_BASE + 26)
+#define __NR_getpriority                  (__NR_SYSCALL_BASE + 96)
+#define __NR_setpriority                  (__NR_SYSCALL_BASE + 97)
+#define __NR_setrlimit                    (__NR_SYSCALL_BASE + 75)
+#define __NR_ugetrlimit                   (__NR_SYSCALL_BASE + 191)
+#define __NR_getrusage                    (__NR_SYSCALL_BASE + 77)
+#define __NR_setgroups32                  (__NR_SYSCALL_BASE + 206)
+#define __NR_setpgid                      (__NR_SYSCALL_BASE + 57)
+#define __NR_setregid32                   (__NR_SYSCALL_BASE + 204)
+#define __NR_chroot                       (__NR_SYSCALL_BASE + 61)
+#define __NR_prctl                        (__NR_SYSCALL_BASE + 172)
+#define __NR_capget                       (__NR_SYSCALL_BASE + 184)
+#define __NR_capset                       (__NR_SYSCALL_BASE + 185)
+#define __NR_acct                         (__NR_SYSCALL_BASE + 51)
+#define __NR_read                         (__NR_SYSCALL_BASE + 3)
+#define __NR_write                        (__NR_SYSCALL_BASE + 4)
+#define __NR_pread64                      (__NR_SYSCALL_BASE + 180)
+#define __NR_pwrite64                     (__NR_SYSCALL_BASE + 181)
+#define __NR_open                         (__NR_SYSCALL_BASE + 5)
+#define __NR_close                        (__NR_SYSCALL_BASE + 6)
+#define __NR_lseek                        (__NR_SYSCALL_BASE + 19)
+#define __NR__llseek                      (__NR_SYSCALL_BASE + 140)
+#define __NR_getpid                       (__NR_SYSCALL_BASE + 20)
+#define __NR_mmap2                        (__NR_SYSCALL_BASE + 192)
+#define __NR_munmap                       (__NR_SYSCALL_BASE + 91)
+#define __NR_mremap                       (__NR_SYSCALL_BASE + 163)
+#define __NR_msync                        (__NR_SYSCALL_BASE + 144)
+#define __NR_mprotect                     (__NR_SYSCALL_BASE + 125)
+#define __NR_mlock                        (__NR_SYSCALL_BASE + 150)
+#define __NR_munlock                      (__NR_SYSCALL_BASE + 151)
+#define __NR_ioctl                        (__NR_SYSCALL_BASE + 54)
+#define __NR_readv                        (__NR_SYSCALL_BASE + 145)
+#define __NR_writev                       (__NR_SYSCALL_BASE + 146)
+#define __NR_fcntl                        (__NR_SYSCALL_BASE + 55)
+#define __NR_flock                        (__NR_SYSCALL_BASE + 143)
+#define __NR_fchmod                       (__NR_SYSCALL_BASE + 94)
+#define __NR_dup                          (__NR_SYSCALL_BASE + 41)
+#define __NR_pipe                         (__NR_SYSCALL_BASE + 42)
+#define __NR_dup2                         (__NR_SYSCALL_BASE + 63)
+#define __NR__newselect                   (__NR_SYSCALL_BASE + 142)
+#define __NR_ftruncate                    (__NR_SYSCALL_BASE + 93)
+#define __NR_fsync                        (__NR_SYSCALL_BASE + 118)
+#define __NR_fchown32                     (__NR_SYSCALL_BASE + 207)
+#define __NR_sync                         (__NR_SYSCALL_BASE + 36)
+#define __NR_fcntl64                      (__NR_SYSCALL_BASE + 221)
+#define __NR_sendfile                     (__NR_SYSCALL_BASE + 187)
+#define __NR_link                         (__NR_SYSCALL_BASE + 9)
+#define __NR_unlink                       (__NR_SYSCALL_BASE + 10)
+#define __NR_chdir                        (__NR_SYSCALL_BASE + 12)
+#define __NR_mknod                        (__NR_SYSCALL_BASE + 14)
+#define __NR_chmod                        (__NR_SYSCALL_BASE + 15)
+#define __NR_chown32                      (__NR_SYSCALL_BASE + 212)
+#define __NR_lchown32                     (__NR_SYSCALL_BASE + 198)
+#define __NR_mount                        (__NR_SYSCALL_BASE + 21)
+#define __NR_umount2                      (__NR_SYSCALL_BASE + 52)
+#define __NR_fstat64                      (__NR_SYSCALL_BASE + 197)
+#define __NR_stat64                       (__NR_SYSCALL_BASE + 195)
+#define __NR_lstat64                      (__NR_SYSCALL_BASE + 196)
+#define __NR_mkdir                        (__NR_SYSCALL_BASE + 39)
+#define __NR_readlink                     (__NR_SYSCALL_BASE + 85)
+#define __NR_rmdir                        (__NR_SYSCALL_BASE + 40)
+#define __NR_rename                       (__NR_SYSCALL_BASE + 38)
+#define __NR_getcwd                       (__NR_SYSCALL_BASE + 183)
+#define __NR_access                       (__NR_SYSCALL_BASE + 33)
+#define __NR_symlink                      (__NR_SYSCALL_BASE + 83)
+#define __NR_fchdir                       (__NR_SYSCALL_BASE + 133)
+#define __NR_truncate                     (__NR_SYSCALL_BASE + 92)
+#define __NR_pause                        (__NR_SYSCALL_BASE + 29)
+#define __NR_gettimeofday                 (__NR_SYSCALL_BASE + 78)
+#define __NR_settimeofday                 (__NR_SYSCALL_BASE + 79)
+#define __NR_times                        (__NR_SYSCALL_BASE + 43)
+#define __NR_nanosleep                    (__NR_SYSCALL_BASE + 162)
+#define __NR_getitimer                    (__NR_SYSCALL_BASE + 105)
+#define __NR_setitimer                    (__NR_SYSCALL_BASE + 104)
+#define __NR_sigaction                    (__NR_SYSCALL_BASE + 67)
+#define __NR_sigprocmask                  (__NR_SYSCALL_BASE + 126)
+#define __NR_sigsuspend                   (__NR_SYSCALL_BASE + 72)
+#define __NR_rt_sigaction                 (__NR_SYSCALL_BASE + 174)
+#define __NR_rt_sigprocmask               (__NR_SYSCALL_BASE + 175)
+#define __NR_rt_sigtimedwait              (__NR_SYSCALL_BASE + 177)
+#define __NR_sigpending                   (__NR_SYSCALL_BASE + 73)
+#define __NR_sched_setscheduler           (__NR_SYSCALL_BASE + 156)
+#define __NR_sched_getscheduler           (__NR_SYSCALL_BASE + 157)
+#define __NR_sched_yield                  (__NR_SYSCALL_BASE + 158)
+#define __NR_sched_setparam               (__NR_SYSCALL_BASE + 154)
+#define __NR_sched_getparam               (__NR_SYSCALL_BASE + 155)
+#define __NR_sched_get_priority_max       (__NR_SYSCALL_BASE + 159)
+#define __NR_sched_get_priority_min       (__NR_SYSCALL_BASE + 160)
+#define __NR_sched_rr_get_interval        (__NR_SYSCALL_BASE + 161)
+#define __NR_uname                        (__NR_SYSCALL_BASE + 122)
+#define __NR_wait4                        (__NR_SYSCALL_BASE + 114)
+#define __NR_umask                        (__NR_SYSCALL_BASE + 60)
+#define __NR_reboot                       (__NR_SYSCALL_BASE + 88)
+#define __NR_syslog                       (__NR_SYSCALL_BASE + 103)
+#define __NR_init_module                  (__NR_SYSCALL_BASE + 128)
+#define __NR_delete_module                (__NR_SYSCALL_BASE + 129)
+#define __NR_syslog                       (__NR_SYSCALL_BASE + 103)
+#define __NR_futex                        (__NR_SYSCALL_BASE + 240)
+#define __NR_poll                         (__NR_SYSCALL_BASE + 168)
+
+#ifdef __arm__
+#define __NR_exit_group                   (__NR_SYSCALL_BASE + 248)
+#define __NR_waitid                       (__NR_SYSCALL_BASE + 280)
+#define __NR_vfork                        (__NR_SYSCALL_BASE + 190)
+#define __NR_openat                       (__NR_SYSCALL_BASE + 322)
+#define __NR_madvise                      (__NR_SYSCALL_BASE + 220)
+#define __NR_mincore                      (__NR_SYSCALL_BASE + 219)
+#define __NR_getdents64                   (__NR_SYSCALL_BASE + 217)
+#define __NR_fstatfs64                    (__NR_SYSCALL_BASE + 267)
+#define __NR_fstatat64                    (__NR_SYSCALL_BASE + 327)
+#define __NR_mkdirat                      (__NR_SYSCALL_BASE + 323)
+#define __NR_fchownat                     (__NR_SYSCALL_BASE + 325)
+#define __NR_fchmodat                     (__NR_SYSCALL_BASE + 333)
+#define __NR_renameat                     (__NR_SYSCALL_BASE + 329)
+#define __NR_unlinkat                     (__NR_SYSCALL_BASE + 328)
+#define __NR_statfs64                     (__NR_SYSCALL_BASE + 266)
+#define __NR_clock_gettime                (__NR_SYSCALL_BASE + 263)
+#define __NR_clock_settime                (__NR_SYSCALL_BASE + 262)
+#define __NR_clock_getres                 (__NR_SYSCALL_BASE + 264)
+#define __NR_clock_nanosleep              (__NR_SYSCALL_BASE + 265)
+#define __NR_timer_create                 (__NR_SYSCALL_BASE + 257)
+#define __NR_timer_settime                (__NR_SYSCALL_BASE + 258)
+#define __NR_timer_gettime                (__NR_SYSCALL_BASE + 259)
+#define __NR_timer_getoverrun             (__NR_SYSCALL_BASE + 260)
+#define __NR_timer_delete                 (__NR_SYSCALL_BASE + 261)
+#define __NR_utimes                       (__NR_SYSCALL_BASE + 269)
+#define __NR_socket                       (__NR_SYSCALL_BASE + 281)
+#define __NR_socketpair                   (__NR_SYSCALL_BASE + 288)
+#define __NR_bind                         (__NR_SYSCALL_BASE + 282)
+#define __NR_connect                      (__NR_SYSCALL_BASE + 283)
+#define __NR_listen                       (__NR_SYSCALL_BASE + 284)
+#define __NR_accept                       (__NR_SYSCALL_BASE + 285)
+#define __NR_getsockname                  (__NR_SYSCALL_BASE + 286)
+#define __NR_getpeername                  (__NR_SYSCALL_BASE + 287)
+#define __NR_sendto                       (__NR_SYSCALL_BASE + 290)
+#define __NR_recvfrom                     (__NR_SYSCALL_BASE + 292)
+#define __NR_shutdown                     (__NR_SYSCALL_BASE + 293)
+#define __NR_setsockopt                   (__NR_SYSCALL_BASE + 294)
+#define __NR_getsockopt                   (__NR_SYSCALL_BASE + 295)
+#define __NR_sendmsg                      (__NR_SYSCALL_BASE + 296)
+#define __NR_recvmsg                      (__NR_SYSCALL_BASE + 297)
+#define __NR_epoll_create                 (__NR_SYSCALL_BASE + 250)
+#define __NR_epoll_ctl                    (__NR_SYSCALL_BASE + 251)
+#define __NR_epoll_wait                   (__NR_SYSCALL_BASE + 252)
+#define __NR_inotify_init                 (__NR_SYSCALL_BASE + 316)
+#define __NR_inotify_add_watch            (__NR_SYSCALL_BASE + 317)
+#define __NR_inotify_rm_watch             (__NR_SYSCALL_BASE + 318)
+#define __NR_ARM_set_tls                  (__NR_SYSCALL_BASE + 983045)
+#define __NR_ARM_cacheflush               (__NR_SYSCALL_BASE + 983042)
+#endif
+
+#ifdef __i386__
+#define __NR_exit_group                   (__NR_SYSCALL_BASE + 252)
+#define __NR_waitpid                      (__NR_SYSCALL_BASE + 7)
+#define __NR_waitid                       (__NR_SYSCALL_BASE + 284)
+#define __NR_kill                         (__NR_SYSCALL_BASE + 37)
+#define __NR_tkill                        (__NR_SYSCALL_BASE + 238)
+#define __NR_set_thread_area              (__NR_SYSCALL_BASE + 243)
+#define __NR_openat                       (__NR_SYSCALL_BASE + 295)
+#define __NR_madvise                      (__NR_SYSCALL_BASE + 219)
+#define __NR_mincore                      (__NR_SYSCALL_BASE + 218)
+#define __NR_getdents64                   (__NR_SYSCALL_BASE + 220)
+#define __NR_fstatfs64                    (__NR_SYSCALL_BASE + 269)
+#define __NR_fstatat64                    (__NR_SYSCALL_BASE + 300)
+#define __NR_mkdirat                      (__NR_SYSCALL_BASE + 296)
+#define __NR_fchownat                     (__NR_SYSCALL_BASE + 298)
+#define __NR_fchmodat                     (__NR_SYSCALL_BASE + 306)
+#define __NR_renameat                     (__NR_SYSCALL_BASE + 302)
+#define __NR_unlinkat                     (__NR_SYSCALL_BASE + 301)
+#define __NR_statfs64                     (__NR_SYSCALL_BASE + 268)
+#define __NR_clock_gettime                (__NR_SYSCALL_BASE + 265)
+#define __NR_clock_settime                (__NR_SYSCALL_BASE + 264)
+#define __NR_clock_getres                 (__NR_SYSCALL_BASE + 266)
+#define __NR_clock_nanosleep              (__NR_SYSCALL_BASE + 267)
+#define __NR_timer_create                 (__NR_SYSCALL_BASE + 259)
+#define __NR_timer_settime                (__NR_SYSCALL_BASE + 260)
+#define __NR_timer_gettime                (__NR_SYSCALL_BASE + 261)
+#define __NR_timer_getoverrun             (__NR_SYSCALL_BASE + 262)
+#define __NR_timer_delete                 (__NR_SYSCALL_BASE + 263)
+#define __NR_utimes                       (__NR_SYSCALL_BASE + 271)
+#define __NR_socketcall                   (__NR_SYSCALL_BASE + 102)
+#define __NR_epoll_create                 (__NR_SYSCALL_BASE + 254)
+#define __NR_epoll_ctl                    (__NR_SYSCALL_BASE + 255)
+#define __NR_epoll_wait                   (__NR_SYSCALL_BASE + 256)
+#define __NR_inotify_init                 (__NR_SYSCALL_BASE + 291)
+#define __NR_inotify_add_watch            (__NR_SYSCALL_BASE + 292)
+#define __NR_inotify_rm_watch             (__NR_SYSCALL_BASE + 293)
+#endif
+
+#endif
+
+#endif /* _BIONIC_LINUX_SYSCALLS_H_ */
diff --git a/ndk/platforms/android-3/include/sys/linux-unistd.h b/ndk/platforms/android-3/include/sys/linux-unistd.h
new file mode 100644
index 0000000..789271e
--- /dev/null
+++ b/ndk/platforms/android-3/include/sys/linux-unistd.h
@@ -0,0 +1,204 @@
+/* auto-generated by gensyscalls.py, do not touch */
+#ifndef _BIONIC_LINUX_UNISTD_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void             _exit (int);
+void             _exit_thread (int);
+pid_t            __fork (void);
+pid_t            _waitpid (pid_t, int*, int, struct rusage*);
+int              waitid (int, pid_t, struct siginfo_t*, int,void*);
+pid_t            __clone (int (*fn)(void*), void *child_stack, int flags, void *arg);
+int              execve (const char*, char* const*, char* const*);
+int              setuid (uid_t);
+uid_t            getuid (void);
+gid_t            getgid (void);
+uid_t            geteuid (void);
+gid_t            getegid (void);
+uid_t            getresuid (void);
+gid_t            getresgid (void);
+pid_t            gettid (void);
+int              getgroups (int, gid_t *);
+pid_t            getpgid (pid_t);
+pid_t            getppid (void);
+pid_t            setsid (void);
+int              setgid (gid_t);
+int              seteuid (uid_t);
+int              setreuid (uid_t, uid_t);
+int              setresuid (uid_t, uid_t, uid_t);
+int              setresgid (gid_t, gid_t, gid_t);
+void*            __brk (void*);
+int              kill (pid_t, int);
+int              tkill (pid_t tid, int sig);
+int              __ptrace (int request, int pid, void* addr, void* data);
+int              __set_thread_area (void*  user_desc);
+int              __getpriority (int, int);
+int              setpriority (int, int, int);
+int              setrlimit (int resource, const struct rlimit *rlp);
+int              getrlimit (int resource, struct rlimit *rlp);
+int              getrusage (int who, struct rusage*  r_usage);
+int              setgroups (int, const gid_t *);
+pid_t            getpgrp (void);
+int              setpgid (pid_t, pid_t);
+pid_t            vfork (void);
+int              setregid (gid_t, gid_t);
+int              chroot (const char *);
+int              prctl (int option, unsigned int arg2, unsigned int arg3, unsigned int arg4, unsigned int arg5);
+int              capget (cap_user_header_t header, cap_user_data_t data);
+int              capset (cap_user_header_t header, const cap_user_data_t data);
+int              acct (const char*  filepath);
+ssize_t          read (int, void*, size_t);
+ssize_t          write (int, const void*, size_t);
+ssize_t          __pread64 (int, void *, size_t, off_t, off_t);
+ssize_t          __pwrite64 (int, void *, size_t, off_t, off_t);
+int              __open (const char*, int, mode_t);
+int              __openat (int, const char*, int, mode_t);
+int              close (int);
+int              creat (const char*, mode_t);
+off_t            lseek (int, off_t, int);
+int              __llseek (int, unsigned long, unsigned long, loff_t*, int);
+pid_t            getpid (void);
+void *           mmap (void *, size_t, int, int, int, long);
+void *           __mmap2 (void*, size_t, int, int, int, long);
+int              munmap (void *, size_t);
+void *           mremap (void *, size_t, size_t, unsigned long);
+int              msync (const void *, size_t, int);
+int              mprotect (const void *, size_t, int);
+int              madvise (const void *, size_t, int);
+int              mlock (const void *addr, size_t len);
+int              munlock (const void *addr, size_t len);
+int              mincore (void*  start, size_t  length, unsigned char*  vec);
+int              __ioctl (int, int, void *);
+int              readv (int, const struct iovec *, int);
+int              writev (int, const struct iovec *, int);
+int              __fcntl (int, int, void*);
+int              flock (int, int);
+int              fchmod (int, mode_t);
+int              dup (int);
+int              pipe (int *);
+int              dup2 (int, int);
+int              select (int, struct fd_set *, struct fd_set *, struct fd_set *, struct timeval *);
+int              ftruncate (int, off_t);
+int              getdents (unsigned int, struct dirent *, unsigned int);
+int              fsync (int);
+int              fchown (int, uid_t, gid_t);
+void             sync (void);
+int              __fcntl64 (int, int, void *);
+int              fstatfs (int, size_t, struct statfs *);
+ssize_t          sendfile (int out_fd, int in_fd, off_t *offset, size_t count);
+int              fstatat (int dirfd, const char *path, struct stat *buf, int flags);
+int              mkdirat (int dirfd, const char *pathname, mode_t mode);
+int              fchownat (int dirfd, const char *path, uid_t owner, gid_t group, int flags);
+int              fchmodat (int dirfd, const char *path, mode_t mode, int flags);
+int              renameat (int olddirfd, const char *oldpath, int newdirfd, const char *newpath);
+int              link (const char*, const char*);
+int              unlink (const char*);
+int              unlinkat (int, const char *, int);
+int              chdir (const char*);
+int              mknod (const char*, mode_t, dev_t);
+int              chmod (const char*,mode_t);
+int              chown (const char *, uid_t, gid_t);
+int              lchown (const char*, uid_t, gid_t);
+int              mount (const char*, const char*, const char*, unsigned long, const void*);
+int              umount (const char*);
+int              umount2 (const char*, int);
+int              fstat (int, struct stat*);
+int              stat (const char *, struct stat *);
+int              lstat (const char *, struct stat *);
+int              mkdir (const char *, mode_t);
+int              readlink (const char *, char *, size_t);
+int              rmdir (const char *);
+int              rename (const char *, const char *);
+int              __getcwd (char * buf, size_t size);
+int              access (const char *, int);
+int              symlink (const char *, const char *);
+int              fchdir (int);
+int              truncate (const char*, off_t);
+int              __statfs64 (const char *, size_t, struct statfs *);
+int              pause (void);
+int              gettimeofday (struct timeval*, struct timezone*);
+int              settimeofday (const struct timeval*, const struct timezone*);
+clock_t          times (struct tms *);
+int              nanosleep (const struct timespec *, struct timespec *);
+int              clock_gettime (clockid_t clk_id, struct timespec *tp);
+int              clock_settime (clockid_t clk_id, const struct timespec *tp);
+int              clock_getres (clockid_t clk_id, struct timespec *res);
+int              clock_nanosleep (const struct timespec *req, struct timespec *rem);
+int              getitimer (int, const struct itimerval *);
+int              setitimer (int, const struct itimerval *, struct itimerval *);
+int              __timer_create (clockid_t clockid, struct sigevent *evp, timer_t *timerid);
+int              __timer_settime (timer_t, int, const struct itimerspec*, struct itimerspec*);
+int              __timer_gettime (timer_t, struct itimerspec*);
+int              __timer_getoverrun (timer_t);
+int              __timer_delete (timer_t);
+int              utimes (const char*, const struct timeval tvp[2]);
+int              sigaction (int, const struct sigaction *, struct sigaction *);
+int              sigprocmask (int, const sigset_t *, sigset_t *);
+int              __sigsuspend (int unused1, int unused2, unsigned mask);
+int              __rt_sigaction (int sig, const struct sigaction *act, struct sigaction *oact, size_t sigsetsize);
+int              __rt_sigprocmask (int  how, const sigset_t *set, sigset_t *oset, size_t sigsetsize);
+int              __rt_sigtimedwait (const sigset_t *set, struct siginfo_t  *info, struct timespec_t  *timeout, size_t  sigset_size);
+int              sigpending (sigset_t *);
+int              socket (int, int, int);
+int              socketpair (int, int, int, int*);
+int              bind (int, struct sockaddr *, int);
+int              connect (int, struct sockaddr *, socklen_t);
+int              listen (int, int);
+int              accept (int, struct sockaddr *, socklen_t *);
+int              getsockname (int, struct sockaddr *, socklen_t *);
+int              getpeername (int, struct sockaddr *, socklen_t *);
+int              sendto (int, const void *, size_t, int, const struct sockaddr *, socklen_t);
+int              recvfrom (int, void *, size_t, unsigned int, struct sockaddr *, socklen_t *);
+int              shutdown (int, int);
+int              setsockopt (int, int, int, const void *, socklen_t);
+int              getsockopt (int, int, int, void *, socklen_t *);
+int              sendmsg (int, const struct msghdr *, unsigned int);
+int              recvmsg (int, struct msghdr *, unsigned int);
+int              socket (int, int, int);
+int              bind (int, struct sockaddr *, int);
+int              connect (int, struct sockaddr *, socklen_t);
+int              listen (int, int);
+int              accept (int, struct sockaddr *, socklen_t *);
+int              getsockname (int, struct sockaddr *, socklen_t *);
+int              getpeername (int, struct sockaddr *, socklen_t *);
+int              socketpair (int, int, int, int*);
+int              sendto (int, const void *, size_t, int, const struct sockaddr *, socklen_t);
+int              recvfrom (int, void *, size_t, unsigned int, struct sockaddr *, socklen_t *);
+int              shutdown (int, int);
+int              setsockopt (int, int, int, const void *, socklen_t);
+int              getsockopt (int, int, int, void *, socklen_t *);
+int              sendmsg (int, const struct msghdr *, unsigned int);
+int              recvmsg (int, struct msghdr *, unsigned int);
+int              sched_setscheduler (pid_t pid, int policy, const struct sched_param *param);
+int              sched_getscheduler (pid_t pid);
+int              sched_yield (void);
+int              sched_setparam (pid_t pid, const struct sched_param *param);
+int              sched_getparam (pid_t pid, struct sched_param *param);
+int              sched_get_priority_max (int policy);
+int              sched_get_priority_min (int policy);
+int              sched_rr_get_interval (pid_t pid, struct timespec *interval);
+int              uname (struct utsname *);
+pid_t            __wait4 (pid_t pid, int *status, int options, struct rusage *rusage);
+mode_t           umask (mode_t);
+int              __reboot (int, int, int, void *);
+int              __syslog (int, char *, int);
+int              init_module (void *, unsigned long, const char *);
+int              delete_module (const char*, unsigned int);
+int              klogctl (int, char *, int);
+int              futex (void *, int, int, void *, void *, int);
+int              epoll_create (int size);
+int              epoll_ctl (int epfd, int op, int fd, struct epoll_event *event);
+int              epoll_wait (int epfd, struct epoll_event *events, int max, int timeout);
+int              inotify_init (void);
+int              inotify_add_watch (int, const char *, unsigned int);
+int              inotify_rm_watch (int, unsigned int);
+int              poll (struct pollfd *, unsigned int, long);
+int              __set_tls (void*);
+int              cacheflush (long start, long end, long flags);
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _BIONIC_LINUX_UNISTD_H_ */
diff --git a/ndk/platforms/android-3/include/sys/mman.h b/ndk/platforms/android-3/include/sys/mman.h
new file mode 100644
index 0000000..7a32974
--- /dev/null
+++ b/ndk/platforms/android-3/include/sys/mman.h
@@ -0,0 +1,66 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _SYS_MMAN_H_
+#define _SYS_MMAN_H_
+
+#include <sys/cdefs.h>
+#include <sys/types.h>
+#include <asm/mman.h>
+#include <asm/page.h>
+
+__BEGIN_DECLS
+
+#ifndef MAP_ANON
+#define MAP_ANON  MAP_ANONYMOUS
+#endif
+
+#define MAP_FAILED ((void *)-1)
+
+#define MREMAP_MAYMOVE  1
+#define MREMAP_FIXED    2
+
+extern void*  mmap(void *, size_t, int, int, int, off_t);
+extern int    munmap(void *, size_t);
+extern int    msync(const void *, size_t, int);
+extern int    mprotect(const void *, size_t, int);
+extern void*  mremap(void *, size_t, size_t, unsigned long);
+
+extern int    mlockall(int);
+extern int    munlockall(void);
+extern int    mlock(const void *, size_t);
+extern int    munlock(const void *, size_t);
+extern int    madvise(const void *, size_t, int);
+
+extern int    mlock(const void *addr, size_t len);
+extern int    munlock(const void *addr, size_t len);
+
+extern int    mincore(void*  start, size_t  length, unsigned char*  vec);
+
+__END_DECLS
+
+#endif /* _SYS_MMAN_H_ */
diff --git a/ndk/platforms/android-3/include/sys/mount.h b/ndk/platforms/android-3/include/sys/mount.h
new file mode 100644
index 0000000..ba88447
--- /dev/null
+++ b/ndk/platforms/android-3/include/sys/mount.h
@@ -0,0 +1,102 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _SYS_MOUNT_H
+#define _SYS_MOUNT_H
+
+#include <sys/cdefs.h>
+#include <sys/ioctl.h>
+
+__BEGIN_DECLS
+
+/*
+ * These are the fs-independent mount-flags: up to 32 flags are supported
+ */
+#define MS_RDONLY        1      /* Mount read-only */
+#define MS_NOSUID        2      /* Ignore suid and sgid bits */
+#define MS_NODEV         4      /* Disallow access to device special files */
+#define MS_NOEXEC        8      /* Disallow program execution */
+#define MS_SYNCHRONOUS  16      /* Writes are synced at once */
+#define MS_REMOUNT      32      /* Alter flags of a mounted FS */
+#define MS_MANDLOCK     64      /* Allow mandatory locks on an FS */
+#define MS_DIRSYNC      128     /* Directory modifications are synchronous */
+#define MS_NOATIME      1024    /* Do not update access times. */
+#define MS_NODIRATIME   2048    /* Do not update directory access times */
+#define MS_BIND         4096
+#define MS_MOVE         8192
+#define MS_REC          16384
+#define MS_VERBOSE      32768
+#define MS_POSIXACL     (1<<16) /* VFS does not apply the umask */
+#define MS_ONE_SECOND   (1<<17) /* fs has 1 sec a/m/ctime resolution */
+#define MS_ACTIVE       (1<<30)
+#define MS_NOUSER       (1<<31)
+
+/*
+ * Superblock flags that can be altered by MS_REMOUNT
+ */
+#define MS_RMT_MASK     (MS_RDONLY|MS_SYNCHRONOUS|MS_MANDLOCK|MS_NOATIME|MS_NODIRATIME)
+
+/*
+ * Old magic mount flag and mask
+ */
+#define MS_MGC_VAL 0xC0ED0000
+#define MS_MGC_MSK 0xffff0000
+
+/*
+ * umount2() flags
+ */
+#define MNT_FORCE	1	/* Forcibly unmount */
+#define MNT_DETACH	2	/* Detach from tree only */
+#define MNT_EXPIRE	4	/* Mark for expiry */
+
+/*
+ * Block device ioctls
+ */
+#define BLKROSET   _IO(0x12, 93) /* Set device read-only (0 = read-write).  */
+#define BLKROGET   _IO(0x12, 94) /* Get read-only status (0 = read_write).  */
+#define BLKRRPART  _IO(0x12, 95) /* Re-read partition table.  */
+#define BLKGETSIZE _IO(0x12, 96) /* Return device size.  */
+#define BLKFLSBUF  _IO(0x12, 97) /* Flush buffer cache.  */
+#define BLKRASET   _IO(0x12, 98) /* Set read ahead for block device.  */
+#define BLKRAGET   _IO(0x12, 99) /* Get current read ahead setting.  */
+
+/*
+ * Prototypes
+ */
+extern int mount(const char *, const char *,
+		   const char *, unsigned long,
+		   const void *);
+extern int umount(const char *);
+extern int umount2(const char *, int);
+
+#if 0 /* MISSING FROM BIONIC */
+extern int pivot_root(const char *, const char *);
+#endif /* MISSING */
+
+__END_DECLS
+
+#endif /* _SYS_MOUNT_H */
diff --git a/ndk/platforms/android-3/include/sys/param.h b/ndk/platforms/android-3/include/sys/param.h
new file mode 100644
index 0000000..3a815cb
--- /dev/null
+++ b/ndk/platforms/android-3/include/sys/param.h
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _SYS_PARAM_H_
+#define _SYS_PARAM_H_
+
+#include <limits.h>
+#include <linux/param.h>
+
+#define MAXPATHLEN  PATH_MAX
+#define MAXSYMLINKS 8
+
+#define ALIGNBYTES  3
+#define ALIGN(p)    (((unsigned int)(p) + ALIGNBYTES) &~ ALIGNBYTES)
+
+#endif /* _SYS_PARAM_H_ */
diff --git a/ndk/platforms/android-3/include/sys/poll.h b/ndk/platforms/android-3/include/sys/poll.h
new file mode 100644
index 0000000..779ec77
--- /dev/null
+++ b/ndk/platforms/android-3/include/sys/poll.h
@@ -0,0 +1 @@
+#include <poll.h>
diff --git a/ndk/platforms/android-3/include/sys/prctl.h b/ndk/platforms/android-3/include/sys/prctl.h
new file mode 100644
index 0000000..ce85bf7
--- /dev/null
+++ b/ndk/platforms/android-3/include/sys/prctl.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _SYS_PRCTL_H
+#define _SYS_PRCTL_H
+
+#include <linux/prctl.h>
+
+__BEGIN_DECLS
+
+extern int prctl(int option, unsigned long arg2, unsigned long arg3 , unsigned
+               long arg4, unsigned long arg5);
+
+__END_DECLS
+
+#endif /* _SYS_PRCTL_H */
+
diff --git a/ndk/platforms/android-3/include/sys/ptrace.h b/ndk/platforms/android-3/include/sys/ptrace.h
new file mode 100644
index 0000000..848416b
--- /dev/null
+++ b/ndk/platforms/android-3/include/sys/ptrace.h
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _SYS_PTRACE_H_
+#define _SYS_PTRACE_H_
+
+#include <sys/cdefs.h>
+#include <sys/types.h>
+/* For all of the defines */
+#include <linux/ptrace.h>
+
+__BEGIN_DECLS
+
+#define PTRACE_POKEUSER     PTRACE_POKEUSR
+#define PTRACE_PEEKUSER     PTRACE_PEEKUSR
+
+extern long ptrace(int request, pid_t pid, void *addr, void *data);
+
+__END_DECLS
+
+#endif /* _SYS_PTRACE_H_ */
diff --git a/ndk/platforms/android-3/include/sys/queue.h b/ndk/platforms/android-3/include/sys/queue.h
new file mode 100644
index 0000000..b0e6b38
--- /dev/null
+++ b/ndk/platforms/android-3/include/sys/queue.h
@@ -0,0 +1,557 @@
+/*
+ * Copyright (c) 1991, 1993
+ *	The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ * 3. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
+ *
+ *	@(#)queue.h	8.5 (Berkeley) 8/20/94
+ */
+
+#ifndef	_SYS_QUEUE_H_
+#define	_SYS_QUEUE_H_
+
+/*
+ * This file defines five types of data structures: singly-linked lists,
+ * lists, simple queues, tail queues, and circular queues.
+ *
+ * A singly-linked list is headed by a single forward pointer. The
+ * elements are singly linked for minimum space and pointer manipulation
+ * overhead at the expense of O(n) removal for arbitrary elements. New
+ * elements can be added to the list after an existing element or at the
+ * head of the list.  Elements being removed from the head of the list
+ * should use the explicit macro for this purpose for optimum
+ * efficiency. A singly-linked list may only be traversed in the forward
+ * direction.  Singly-linked lists are ideal for applications with large
+ * datasets and few or no removals or for implementing a LIFO queue.
+ *
+ * A list is headed by a single forward pointer (or an array of forward
+ * pointers for a hash table header). The elements are doubly linked
+ * so that an arbitrary element can be removed without a need to
+ * traverse the list. New elements can be added to the list before
+ * or after an existing element or at the head of the list. A list
+ * may only be traversed in the forward direction.
+ *
+ * A simple queue is headed by a pair of pointers, one the head of the
+ * list and the other to the tail of the list. The elements are singly
+ * linked to save space, so elements can only be removed from the
+ * head of the list. New elements can be added to the list after
+ * an existing element, at the head of the list, or at the end of the
+ * list. A simple queue may only be traversed in the forward direction.
+ *
+ * A tail queue is headed by a pair of pointers, one to the head of the
+ * list and the other to the tail of the list. The elements are doubly
+ * linked so that an arbitrary element can be removed without a need to
+ * traverse the list. New elements can be added to the list before or
+ * after an existing element, at the head of the list, or at the end of
+ * the list. A tail queue may be traversed in either direction.
+ *
+ * A circle queue is headed by a pair of pointers, one to the head of the
+ * list and the other to the tail of the list. The elements are doubly
+ * linked so that an arbitrary element can be removed without a need to
+ * traverse the list. New elements can be added to the list before or after
+ * an existing element, at the head of the list, or at the end of the list.
+ * A circle queue may be traversed in either direction, but has a more
+ * complex end of list detection.
+ *
+ * For details on the use of these macros, see the queue(3) manual page.
+ */
+
+/*
+ * List definitions.
+ */
+#define	LIST_HEAD(name, type)						\
+struct name {								\
+	struct type *lh_first;	/* first element */			\
+}
+
+#define	LIST_HEAD_INITIALIZER(head)					\
+	{ NULL }
+
+#define	LIST_ENTRY(type)						\
+struct {								\
+	struct type *le_next;	/* next element */			\
+	struct type **le_prev;	/* address of previous next element */	\
+}
+
+/*
+ * List functions.
+ */
+#define	LIST_INIT(head) do {						\
+	(head)->lh_first = NULL;					\
+} while (/*CONSTCOND*/0)
+
+#define	LIST_INSERT_AFTER(listelm, elm, field) do {			\
+	if (((elm)->field.le_next = (listelm)->field.le_next) != NULL)	\
+		(listelm)->field.le_next->field.le_prev =		\
+		    &(elm)->field.le_next;				\
+	(listelm)->field.le_next = (elm);				\
+	(elm)->field.le_prev = &(listelm)->field.le_next;		\
+} while (/*CONSTCOND*/0)
+
+#define	LIST_INSERT_BEFORE(listelm, elm, field) do {			\
+	(elm)->field.le_prev = (listelm)->field.le_prev;		\
+	(elm)->field.le_next = (listelm);				\
+	*(listelm)->field.le_prev = (elm);				\
+	(listelm)->field.le_prev = &(elm)->field.le_next;		\
+} while (/*CONSTCOND*/0)
+
+#define	LIST_INSERT_HEAD(head, elm, field) do {				\
+	if (((elm)->field.le_next = (head)->lh_first) != NULL)		\
+		(head)->lh_first->field.le_prev = &(elm)->field.le_next;\
+	(head)->lh_first = (elm);					\
+	(elm)->field.le_prev = &(head)->lh_first;			\
+} while (/*CONSTCOND*/0)
+
+#define	LIST_REMOVE(elm, field) do {					\
+	if ((elm)->field.le_next != NULL)				\
+		(elm)->field.le_next->field.le_prev = 			\
+		    (elm)->field.le_prev;				\
+	*(elm)->field.le_prev = (elm)->field.le_next;			\
+} while (/*CONSTCOND*/0)
+
+#define	LIST_FOREACH(var, head, field)					\
+	for ((var) = ((head)->lh_first);				\
+		(var);							\
+		(var) = ((var)->field.le_next))
+
+/*
+ * List access methods.
+ */
+#define	LIST_EMPTY(head)		((head)->lh_first == NULL)
+#define	LIST_FIRST(head)		((head)->lh_first)
+#define	LIST_NEXT(elm, field)		((elm)->field.le_next)
+
+
+/*
+ * Singly-linked List definitions.
+ */
+#define	SLIST_HEAD(name, type)						\
+struct name {								\
+	struct type *slh_first;	/* first element */			\
+}
+
+#define	SLIST_HEAD_INITIALIZER(head)					\
+	{ NULL }
+
+#define	SLIST_ENTRY(type)						\
+struct {								\
+	struct type *sle_next;	/* next element */			\
+}
+
+/*
+ * Singly-linked List functions.
+ */
+#define	SLIST_INIT(head) do {						\
+	(head)->slh_first = NULL;					\
+} while (/*CONSTCOND*/0)
+
+#define	SLIST_INSERT_AFTER(slistelm, elm, field) do {			\
+	(elm)->field.sle_next = (slistelm)->field.sle_next;		\
+	(slistelm)->field.sle_next = (elm);				\
+} while (/*CONSTCOND*/0)
+
+#define	SLIST_INSERT_HEAD(head, elm, field) do {			\
+	(elm)->field.sle_next = (head)->slh_first;			\
+	(head)->slh_first = (elm);					\
+} while (/*CONSTCOND*/0)
+
+#define	SLIST_REMOVE_HEAD(head, field) do {				\
+	(head)->slh_first = (head)->slh_first->field.sle_next;		\
+} while (/*CONSTCOND*/0)
+
+#define	SLIST_REMOVE(head, elm, type, field) do {			\
+	if ((head)->slh_first == (elm)) {				\
+		SLIST_REMOVE_HEAD((head), field);			\
+	}								\
+	else {								\
+		struct type *curelm = (head)->slh_first;		\
+		while(curelm->field.sle_next != (elm))			\
+			curelm = curelm->field.sle_next;		\
+		curelm->field.sle_next =				\
+		    curelm->field.sle_next->field.sle_next;		\
+	}								\
+} while (/*CONSTCOND*/0)
+
+#define	SLIST_FOREACH(var, head, field)					\
+	for((var) = (head)->slh_first; (var); (var) = (var)->field.sle_next)
+
+/*
+ * Singly-linked List access methods.
+ */
+#define	SLIST_EMPTY(head)	((head)->slh_first == NULL)
+#define	SLIST_FIRST(head)	((head)->slh_first)
+#define	SLIST_NEXT(elm, field)	((elm)->field.sle_next)
+
+
+/*
+ * Singly-linked Tail queue declarations.
+ */
+#define	STAILQ_HEAD(name, type)					\
+struct name {								\
+	struct type *stqh_first;	/* first element */			\
+	struct type **stqh_last;	/* addr of last next element */		\
+}
+
+#define	STAILQ_HEAD_INITIALIZER(head)					\
+	{ NULL, &(head).stqh_first }
+
+#define	STAILQ_ENTRY(type)						\
+struct {								\
+	struct type *stqe_next;	/* next element */			\
+}
+
+/*
+ * Singly-linked Tail queue functions.
+ */
+#define	STAILQ_INIT(head) do {						\
+	(head)->stqh_first = NULL;					\
+	(head)->stqh_last = &(head)->stqh_first;				\
+} while (/*CONSTCOND*/0)
+
+#define	STAILQ_INSERT_HEAD(head, elm, field) do {			\
+	if (((elm)->field.stqe_next = (head)->stqh_first) == NULL)	\
+		(head)->stqh_last = &(elm)->field.stqe_next;		\
+	(head)->stqh_first = (elm);					\
+} while (/*CONSTCOND*/0)
+
+#define	STAILQ_INSERT_TAIL(head, elm, field) do {			\
+	(elm)->field.stqe_next = NULL;					\
+	*(head)->stqh_last = (elm);					\
+	(head)->stqh_last = &(elm)->field.stqe_next;			\
+} while (/*CONSTCOND*/0)
+
+#define	STAILQ_INSERT_AFTER(head, listelm, elm, field) do {		\
+	if (((elm)->field.stqe_next = (listelm)->field.stqe_next) == NULL)\
+		(head)->stqh_last = &(elm)->field.stqe_next;		\
+	(listelm)->field.stqe_next = (elm);				\
+} while (/*CONSTCOND*/0)
+
+#define	STAILQ_REMOVE_HEAD(head, field) do {				\
+	if (((head)->stqh_first = (head)->stqh_first->field.stqe_next) == NULL) \
+		(head)->stqh_last = &(head)->stqh_first;			\
+} while (/*CONSTCOND*/0)
+
+#define	STAILQ_REMOVE(head, elm, type, field) do {			\
+	if ((head)->stqh_first == (elm)) {				\
+		STAILQ_REMOVE_HEAD((head), field);			\
+	} else {							\
+		struct type *curelm = (head)->stqh_first;		\
+		while (curelm->field.stqe_next != (elm))			\
+			curelm = curelm->field.stqe_next;		\
+		if ((curelm->field.stqe_next =				\
+			curelm->field.stqe_next->field.stqe_next) == NULL) \
+			    (head)->stqh_last = &(curelm)->field.stqe_next; \
+	}								\
+} while (/*CONSTCOND*/0)
+
+#define	STAILQ_FOREACH(var, head, field)				\
+	for ((var) = ((head)->stqh_first);				\
+		(var);							\
+		(var) = ((var)->field.stqe_next))
+
+/*
+ * Singly-linked Tail queue access methods.
+ */
+#define	STAILQ_EMPTY(head)	((head)->stqh_first == NULL)
+#define	STAILQ_FIRST(head)	((head)->stqh_first)
+#define	STAILQ_NEXT(elm, field)	((elm)->field.stqe_next)
+
+
+/*
+ * Simple queue definitions.
+ */
+#define	SIMPLEQ_HEAD(name, type)					\
+struct name {								\
+	struct type *sqh_first;	/* first element */			\
+	struct type **sqh_last;	/* addr of last next element */		\
+}
+
+#define	SIMPLEQ_HEAD_INITIALIZER(head)					\
+	{ NULL, &(head).sqh_first }
+
+#define	SIMPLEQ_ENTRY(type)						\
+struct {								\
+	struct type *sqe_next;	/* next element */			\
+}
+
+/*
+ * Simple queue functions.
+ */
+#define	SIMPLEQ_INIT(head) do {						\
+	(head)->sqh_first = NULL;					\
+	(head)->sqh_last = &(head)->sqh_first;				\
+} while (/*CONSTCOND*/0)
+
+#define	SIMPLEQ_INSERT_HEAD(head, elm, field) do {			\
+	if (((elm)->field.sqe_next = (head)->sqh_first) == NULL)	\
+		(head)->sqh_last = &(elm)->field.sqe_next;		\
+	(head)->sqh_first = (elm);					\
+} while (/*CONSTCOND*/0)
+
+#define	SIMPLEQ_INSERT_TAIL(head, elm, field) do {			\
+	(elm)->field.sqe_next = NULL;					\
+	*(head)->sqh_last = (elm);					\
+	(head)->sqh_last = &(elm)->field.sqe_next;			\
+} while (/*CONSTCOND*/0)
+
+#define	SIMPLEQ_INSERT_AFTER(head, listelm, elm, field) do {		\
+	if (((elm)->field.sqe_next = (listelm)->field.sqe_next) == NULL)\
+		(head)->sqh_last = &(elm)->field.sqe_next;		\
+	(listelm)->field.sqe_next = (elm);				\
+} while (/*CONSTCOND*/0)
+
+#define	SIMPLEQ_REMOVE_HEAD(head, field) do {				\
+	if (((head)->sqh_first = (head)->sqh_first->field.sqe_next) == NULL) \
+		(head)->sqh_last = &(head)->sqh_first;			\
+} while (/*CONSTCOND*/0)
+
+#define	SIMPLEQ_REMOVE(head, elm, type, field) do {			\
+	if ((head)->sqh_first == (elm)) {				\
+		SIMPLEQ_REMOVE_HEAD((head), field);			\
+	} else {							\
+		struct type *curelm = (head)->sqh_first;		\
+		while (curelm->field.sqe_next != (elm))			\
+			curelm = curelm->field.sqe_next;		\
+		if ((curelm->field.sqe_next =				\
+			curelm->field.sqe_next->field.sqe_next) == NULL) \
+			    (head)->sqh_last = &(curelm)->field.sqe_next; \
+	}								\
+} while (/*CONSTCOND*/0)
+
+#define	SIMPLEQ_FOREACH(var, head, field)				\
+	for ((var) = ((head)->sqh_first);				\
+		(var);							\
+		(var) = ((var)->field.sqe_next))
+
+/*
+ * Simple queue access methods.
+ */
+#define	SIMPLEQ_EMPTY(head)		((head)->sqh_first == NULL)
+#define	SIMPLEQ_FIRST(head)		((head)->sqh_first)
+#define	SIMPLEQ_NEXT(elm, field)	((elm)->field.sqe_next)
+
+
+/*
+ * Tail queue definitions.
+ */
+#define	_TAILQ_HEAD(name, type, qual)					\
+struct name {								\
+	qual type *tqh_first;		/* first element */		\
+	qual type *qual *tqh_last;	/* addr of last next element */	\
+}
+#define TAILQ_HEAD(name, type)	_TAILQ_HEAD(name, struct type,)
+
+#define	TAILQ_HEAD_INITIALIZER(head)					\
+	{ NULL, &(head).tqh_first }
+
+#define	_TAILQ_ENTRY(type, qual)					\
+struct {								\
+	qual type *tqe_next;		/* next element */		\
+	qual type *qual *tqe_prev;	/* address of previous next element */\
+}
+#define TAILQ_ENTRY(type)	_TAILQ_ENTRY(struct type,)
+
+/*
+ * Tail queue functions.
+ */
+#define	TAILQ_INIT(head) do {						\
+	(head)->tqh_first = NULL;					\
+	(head)->tqh_last = &(head)->tqh_first;				\
+} while (/*CONSTCOND*/0)
+
+#define	TAILQ_INSERT_HEAD(head, elm, field) do {			\
+	if (((elm)->field.tqe_next = (head)->tqh_first) != NULL)	\
+		(head)->tqh_first->field.tqe_prev =			\
+		    &(elm)->field.tqe_next;				\
+	else								\
+		(head)->tqh_last = &(elm)->field.tqe_next;		\
+	(head)->tqh_first = (elm);					\
+	(elm)->field.tqe_prev = &(head)->tqh_first;			\
+} while (/*CONSTCOND*/0)
+
+#define	TAILQ_INSERT_TAIL(head, elm, field) do {			\
+	(elm)->field.tqe_next = NULL;					\
+	(elm)->field.tqe_prev = (head)->tqh_last;			\
+	*(head)->tqh_last = (elm);					\
+	(head)->tqh_last = &(elm)->field.tqe_next;			\
+} while (/*CONSTCOND*/0)
+
+#define	TAILQ_INSERT_AFTER(head, listelm, elm, field) do {		\
+	if (((elm)->field.tqe_next = (listelm)->field.tqe_next) != NULL)\
+		(elm)->field.tqe_next->field.tqe_prev = 		\
+		    &(elm)->field.tqe_next;				\
+	else								\
+		(head)->tqh_last = &(elm)->field.tqe_next;		\
+	(listelm)->field.tqe_next = (elm);				\
+	(elm)->field.tqe_prev = &(listelm)->field.tqe_next;		\
+} while (/*CONSTCOND*/0)
+
+#define	TAILQ_INSERT_BEFORE(listelm, elm, field) do {			\
+	(elm)->field.tqe_prev = (listelm)->field.tqe_prev;		\
+	(elm)->field.tqe_next = (listelm);				\
+	*(listelm)->field.tqe_prev = (elm);				\
+	(listelm)->field.tqe_prev = &(elm)->field.tqe_next;		\
+} while (/*CONSTCOND*/0)
+
+#define	TAILQ_REMOVE(head, elm, field) do {				\
+	if (((elm)->field.tqe_next) != NULL)				\
+		(elm)->field.tqe_next->field.tqe_prev = 		\
+		    (elm)->field.tqe_prev;				\
+	else								\
+		(head)->tqh_last = (elm)->field.tqe_prev;		\
+	*(elm)->field.tqe_prev = (elm)->field.tqe_next;			\
+} while (/*CONSTCOND*/0)
+
+#define	TAILQ_FOREACH(var, head, field)					\
+	for ((var) = ((head)->tqh_first);				\
+		(var);							\
+		(var) = ((var)->field.tqe_next))
+
+#define	TAILQ_FOREACH_REVERSE(var, head, headname, field)		\
+	for ((var) = (*(((struct headname *)((head)->tqh_last))->tqh_last));	\
+		(var);							\
+		(var) = (*(((struct headname *)((var)->field.tqe_prev))->tqh_last)))
+
+/*
+ * Tail queue access methods.
+ */
+#define	TAILQ_EMPTY(head)		((head)->tqh_first == NULL)
+#define	TAILQ_FIRST(head)		((head)->tqh_first)
+#define	TAILQ_NEXT(elm, field)		((elm)->field.tqe_next)
+
+#define	TAILQ_LAST(head, headname) \
+	(*(((struct headname *)((head)->tqh_last))->tqh_last))
+#define	TAILQ_PREV(elm, headname, field) \
+	(*(((struct headname *)((elm)->field.tqe_prev))->tqh_last))
+
+
+/*
+ * Circular queue definitions.
+ */
+#define	CIRCLEQ_HEAD(name, type)					\
+struct name {								\
+	struct type *cqh_first;		/* first element */		\
+	struct type *cqh_last;		/* last element */		\
+}
+
+#define	CIRCLEQ_HEAD_INITIALIZER(head)					\
+	{ (void *)&head, (void *)&head }
+
+#define	CIRCLEQ_ENTRY(type)						\
+struct {								\
+	struct type *cqe_next;		/* next element */		\
+	struct type *cqe_prev;		/* previous element */		\
+}
+
+/*
+ * Circular queue functions.
+ */
+#define	CIRCLEQ_INIT(head) do {						\
+	(head)->cqh_first = (void *)(head);				\
+	(head)->cqh_last = (void *)(head);				\
+} while (/*CONSTCOND*/0)
+
+#define	CIRCLEQ_INSERT_AFTER(head, listelm, elm, field) do {		\
+	(elm)->field.cqe_next = (listelm)->field.cqe_next;		\
+	(elm)->field.cqe_prev = (listelm);				\
+	if ((listelm)->field.cqe_next == (void *)(head))		\
+		(head)->cqh_last = (elm);				\
+	else								\
+		(listelm)->field.cqe_next->field.cqe_prev = (elm);	\
+	(listelm)->field.cqe_next = (elm);				\
+} while (/*CONSTCOND*/0)
+
+#define	CIRCLEQ_INSERT_BEFORE(head, listelm, elm, field) do {		\
+	(elm)->field.cqe_next = (listelm);				\
+	(elm)->field.cqe_prev = (listelm)->field.cqe_prev;		\
+	if ((listelm)->field.cqe_prev == (void *)(head))		\
+		(head)->cqh_first = (elm);				\
+	else								\
+		(listelm)->field.cqe_prev->field.cqe_next = (elm);	\
+	(listelm)->field.cqe_prev = (elm);				\
+} while (/*CONSTCOND*/0)
+
+#define	CIRCLEQ_INSERT_HEAD(head, elm, field) do {			\
+	(elm)->field.cqe_next = (head)->cqh_first;			\
+	(elm)->field.cqe_prev = (void *)(head);				\
+	if ((head)->cqh_last == (void *)(head))				\
+		(head)->cqh_last = (elm);				\
+	else								\
+		(head)->cqh_first->field.cqe_prev = (elm);		\
+	(head)->cqh_first = (elm);					\
+} while (/*CONSTCOND*/0)
+
+#define	CIRCLEQ_INSERT_TAIL(head, elm, field) do {			\
+	(elm)->field.cqe_next = (void *)(head);				\
+	(elm)->field.cqe_prev = (head)->cqh_last;			\
+	if ((head)->cqh_first == (void *)(head))			\
+		(head)->cqh_first = (elm);				\
+	else								\
+		(head)->cqh_last->field.cqe_next = (elm);		\
+	(head)->cqh_last = (elm);					\
+} while (/*CONSTCOND*/0)
+
+#define	CIRCLEQ_REMOVE(head, elm, field) do {				\
+	if ((elm)->field.cqe_next == (void *)(head))			\
+		(head)->cqh_last = (elm)->field.cqe_prev;		\
+	else								\
+		(elm)->field.cqe_next->field.cqe_prev =			\
+		    (elm)->field.cqe_prev;				\
+	if ((elm)->field.cqe_prev == (void *)(head))			\
+		(head)->cqh_first = (elm)->field.cqe_next;		\
+	else								\
+		(elm)->field.cqe_prev->field.cqe_next =			\
+		    (elm)->field.cqe_next;				\
+} while (/*CONSTCOND*/0)
+
+#define	CIRCLEQ_FOREACH(var, head, field)				\
+	for ((var) = ((head)->cqh_first);				\
+		(var) != (const void *)(head);				\
+		(var) = ((var)->field.cqe_next))
+
+#define	CIRCLEQ_FOREACH_REVERSE(var, head, field)			\
+	for ((var) = ((head)->cqh_last);				\
+		(var) != (const void *)(head);				\
+		(var) = ((var)->field.cqe_prev))
+
+/*
+ * Circular queue access methods.
+ */
+#define	CIRCLEQ_EMPTY(head)		((head)->cqh_first == (void *)(head))
+#define	CIRCLEQ_FIRST(head)		((head)->cqh_first)
+#define	CIRCLEQ_LAST(head)		((head)->cqh_last)
+#define	CIRCLEQ_NEXT(elm, field)	((elm)->field.cqe_next)
+#define	CIRCLEQ_PREV(elm, field)	((elm)->field.cqe_prev)
+
+#define CIRCLEQ_LOOP_NEXT(head, elm, field)				\
+	(((elm)->field.cqe_next == (void *)(head))			\
+	    ? ((head)->cqh_first)					\
+	    : (elm->field.cqe_next))
+#define CIRCLEQ_LOOP_PREV(head, elm, field)				\
+	(((elm)->field.cqe_prev == (void *)(head))			\
+	    ? ((head)->cqh_last)					\
+	    : (elm->field.cqe_prev))
+
+#endif	/* sys/queue.h */
diff --git a/ndk/platforms/android-3/include/sys/reboot.h b/ndk/platforms/android-3/include/sys/reboot.h
new file mode 100644
index 0000000..df81139
--- /dev/null
+++ b/ndk/platforms/android-3/include/sys/reboot.h
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _SYS_REBOOT_H_
+#define _SYS_REBOOT_H_
+
+#include <sys/cdefs.h>
+#include <linux/reboot.h>
+
+__BEGIN_DECLS
+
+/* use glibc names as well */
+
+#define RB_AUTOBOOT     LINUX_REBOOT_CMD_RESTART
+#define RB_HALT_SYSTEM  LINUX_REBOOT_CMD_HALT
+#define RB_ENABLE_CAD   LINUX_REBOOT_CMD_CAD_ON
+#define RB_DISABLE_CAD  LINUX_REBOOT_CMD_CAD_OFF
+#define RB_POWER_OFF    LINUX_REBOOT_CMD_POWER_OFF
+
+extern int reboot(int  reboot_type);
+extern int __reboot(int, int, int, void *);
+
+__END_DECLS
+
+#endif /* _SYS_REBOOT_H_ */
diff --git a/ndk/platforms/android-3/include/sys/resource.h b/ndk/platforms/android-3/include/sys/resource.h
new file mode 100644
index 0000000..ef325c7
--- /dev/null
+++ b/ndk/platforms/android-3/include/sys/resource.h
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _SYS_RESOURCE_H_
+#define _SYS_RESOURCE_H_
+
+#include <sys/cdefs.h>
+#include <sys/types.h>     /* MUST be included before linux/resource.h */
+
+/* TRICK AHEAD: <linux/resource.h> defines a getrusage function with
+ *              a non-standard signature. this is surprising because the
+ *              syscall seems to use the standard one instead.
+ *              once again, creative macro usage saves the days
+ */
+#define  getrusage   __kernel_getrusage
+#include <linux/resource.h>
+#undef   getrusage
+
+typedef unsigned long rlim_t;
+
+__BEGIN_DECLS
+
+extern int getpriority(int, int);
+extern int setpriority(int, int, int);
+extern int getrlimit(int resource, struct rlimit *rlp);
+extern int setrlimit(int resource, const struct rlimit *rlp);
+extern int getrusage(int  who, struct rusage*  r_usage);
+
+__END_DECLS
+
+#endif /* _SYS_RESOURCE_H_ */
diff --git a/ndk/platforms/android-3/include/sys/select.h b/ndk/platforms/android-3/include/sys/select.h
new file mode 100644
index 0000000..9d11ee8
--- /dev/null
+++ b/ndk/platforms/android-3/include/sys/select.h
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _SYS_SELECT_H_
+#define _SYS_SELECT_H_
+
+#include <sys/cdefs.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <signal.h>
+
+__BEGIN_DECLS
+
+typedef __kernel_fd_set   fd_set;
+
+extern int select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
+extern int pselect(int n, fd_set *readfds, fd_set *writefds, fd_set *errfds,
+                   const struct timespec *timeout, const sigset_t *sigmask);
+
+__END_DECLS
+
+#endif /* _SYS_SELECT_H_ */
diff --git a/ndk/platforms/android-3/include/sys/sendfile.h b/ndk/platforms/android-3/include/sys/sendfile.h
new file mode 100644
index 0000000..d5aba26
--- /dev/null
+++ b/ndk/platforms/android-3/include/sys/sendfile.h
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _SYS_SENDFILE_H_
+#define _SYS_SENDFILE_H_
+
+#include <sys/cdefs.h>
+#include <sys/types.h>
+
+__BEGIN_DECLS
+
+extern ssize_t sendfile(int out_fd, int in_fd, off_t *offset, size_t count);
+
+__END_DECLS
+
+#endif /* _SYS_SENDFILE_H_ */
diff --git a/ndk/platforms/android-3/include/sys/socket.h b/ndk/platforms/android-3/include/sys/socket.h
new file mode 100644
index 0000000..208663e
--- /dev/null
+++ b/ndk/platforms/android-3/include/sys/socket.h
@@ -0,0 +1,87 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _SYS_SOCKET_H_
+#define _SYS_SOCKET_H_
+
+#include <sys/cdefs.h>
+#include <sys/types.h>
+#include <linux/socket.h>
+
+__BEGIN_DECLS
+
+#define SOCK_STREAM      1
+#define SOCK_DGRAM       2
+#define SOCK_RAW         3
+#define SOCK_RDM         4
+#define SOCK_SEQPACKET   5
+#define SOCK_PACKET      10
+
+#ifdef __i386__
+# define __socketcall extern __attribute__((__cdecl__))
+#else
+# define __socketcall extern
+#endif
+
+/* BIONIC: second argument to shutdown() */
+enum {
+    SHUT_RD = 0,        /* no more receptions */
+#define SHUT_RD         SHUT_RD
+    SHUT_WR,            /* no more transmissions */
+#define SHUT_WR         SHUT_WR
+    SHUT_RDWR           /* no more receptions or transmissions */
+#define SHUT_RDWR       SHUT_RDWR
+};
+
+
+typedef int socklen_t;
+
+__socketcall int socket(int, int, int);
+__socketcall int bind(int, const struct sockaddr *, int);
+__socketcall int connect(int, const struct sockaddr *, socklen_t);
+__socketcall int listen(int, int);
+__socketcall int accept(int, struct sockaddr *, socklen_t *);
+__socketcall int getsockname(int, struct sockaddr *, socklen_t *);
+__socketcall int getpeername(int, struct sockaddr *, socklen_t *);
+__socketcall int socketpair(int, int, int, int *);
+__socketcall int shutdown(int, int);
+__socketcall int setsockopt(int, int, int, const void *, socklen_t);
+__socketcall int getsockopt(int, int, int, void *, socklen_t *);
+__socketcall int sendmsg(int, const struct msghdr *, unsigned int);
+__socketcall int recvmsg(int, struct msghdr *, unsigned int);
+
+extern  ssize_t  send(int, const void *, size_t, unsigned int);
+extern  ssize_t  recv(int, void *, size_t, unsigned int);
+
+__socketcall ssize_t sendto(int, const void *, size_t, int, const struct sockaddr *, socklen_t);
+__socketcall ssize_t recvfrom(int, void *, size_t, unsigned int, const struct sockaddr *, socklen_t *);
+
+#undef __socketcall
+
+__END_DECLS
+
+#endif /* _SYS_SOCKET_H */
diff --git a/ndk/platforms/android-3/include/sys/socketcalls.h b/ndk/platforms/android-3/include/sys/socketcalls.h
new file mode 100644
index 0000000..c74f463
--- /dev/null
+++ b/ndk/platforms/android-3/include/sys/socketcalls.h
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _SYS_SOCKETCALLS_H_
+#define _SYS_SOCKETCALLS_H_
+
+/* socketcalls by number */
+
+#define SYS_SOCKET      1               /* sys_socket(2)                */
+#define SYS_BIND        2               /* sys_bind(2)                  */
+#define SYS_CONNECT     3               /* sys_connect(2)               */
+#define SYS_LISTEN      4               /* sys_listen(2)                */
+#define SYS_ACCEPT      5               /* sys_accept(2)                */
+#define SYS_GETSOCKNAME 6               /* sys_getsockname(2)           */
+#define SYS_GETPEERNAME 7               /* sys_getpeername(2)           */
+#define SYS_SOCKETPAIR  8               /* sys_socketpair(2)            */
+#define SYS_SEND        9               /* sys_send(2)                  */
+#define SYS_RECV        10              /* sys_recv(2)                  */
+#define SYS_SENDTO      11              /* sys_sendto(2)                */
+#define SYS_RECVFROM    12              /* sys_recvfrom(2)              */
+#define SYS_SHUTDOWN    13              /* sys_shutdown(2)              */
+#define SYS_SETSOCKOPT  14              /* sys_setsockopt(2)            */
+#define SYS_GETSOCKOPT  15              /* sys_getsockopt(2)            */
+#define SYS_SENDMSG     16              /* sys_sendmsg(2)               */
+#define SYS_RECVMSG     17              /* sys_recvmsg(2)               */
+
+#endif /* _SYS_SOCKETCALLS_H_ */
diff --git a/ndk/platforms/android-3/include/sys/stat.h b/ndk/platforms/android-3/include/sys/stat.h
new file mode 100644
index 0000000..091ee6d
--- /dev/null
+++ b/ndk/platforms/android-3/include/sys/stat.h
@@ -0,0 +1,108 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _SYS_STAT_H_
+#define _SYS_STAT_H_
+
+#include <sys/cdefs.h>
+#include <sys/types.h>
+#include <sys/time.h>
+#include <linux/stat.h>
+
+#include <endian.h>
+
+__BEGIN_DECLS
+
+/* really matches stat64 in the kernel, hence the padding
+ * Note: The kernel zero's the padded region because glibc might read them
+ * in the hope that the kernel has stretched to using larger sizes.
+ */
+struct stat {
+    unsigned long long  st_dev;
+    unsigned char       __pad0[4];
+
+    unsigned long       __st_ino;
+    unsigned int        st_mode;
+    unsigned int        st_nlink;
+
+    unsigned long       st_uid;
+    unsigned long       st_gid;
+
+    unsigned long long  st_rdev;
+    unsigned char       __pad3[4];
+
+    long long           st_size;
+    unsigned long	st_blksize;
+    unsigned long long  st_blocks;
+
+    unsigned long       st_atime;
+    unsigned long       st_atime_nsec;
+
+    unsigned long       st_mtime;
+    unsigned long       st_mtime_nsec;
+
+    unsigned long       st_ctime;
+    unsigned long       st_ctime_nsec;
+
+    unsigned long long  st_ino;
+};
+
+/* For compatibility with GLibc, we provide macro aliases
+ * for the non-Posix nano-seconds accessors.
+ */
+#define  st_atimensec  st_atime_nsec
+#define  st_mtimensec  st_mtime_nsec
+#define  st_ctimensec  st_ctime_nsec
+
+extern int    chmod(const char *, mode_t);
+extern int    fchmod(int, mode_t);
+extern int    mkdir(const char *, mode_t);
+
+extern int    stat(const char *, struct stat *);
+extern int    fstat(int, struct stat *);
+extern int    lstat(const char *, struct stat *);
+extern int    mknod(const char *, mode_t, dev_t);
+extern mode_t umask(mode_t);
+
+#define  stat64    stat
+#define  fstat64   fstat
+#define  lstat64   lstat
+
+static __inline__ int mkfifo(const char *__p, mode_t __m)
+{
+  return mknod(__p, (__m & ~S_IFMT) | S_IFIFO, (dev_t)0);
+}
+
+extern int  fstatat(int dirfd, const char *path, struct stat *buf, int flags);
+extern int  mkdirat(int dirfd, const char *pathname, mode_t mode);
+extern int fchownat(int dirfd, const char *path, uid_t owner, gid_t group, int flags);
+extern int fchmodat(int dirfd, const char *path, mode_t mode, int flags);
+extern int renameat(int olddirfd, const char *oldpath, int newdirfd, const char *newpath);
+
+__END_DECLS
+
+#endif /* _SYS_STAT_H_ */
diff --git a/ndk/platforms/android-3/include/sys/statfs.h b/ndk/platforms/android-3/include/sys/statfs.h
new file mode 100644
index 0000000..53b3b5e
--- /dev/null
+++ b/ndk/platforms/android-3/include/sys/statfs.h
@@ -0,0 +1 @@
+#include <sys/vfs.h>
diff --git a/ndk/platforms/android-3/include/sys/syscall.h b/ndk/platforms/android-3/include/sys/syscall.h
new file mode 100644
index 0000000..7055518
--- /dev/null
+++ b/ndk/platforms/android-3/include/sys/syscall.h
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _SYS_SYSCALL_H_
+#define _SYS_SYSCALL_H_
+
+#include <errno.h>
+#include <sys/cdefs.h>
+#include <sys/types.h>
+#include <asm/unistd.h>
+
+__BEGIN_DECLS
+
+int syscall(int number, ...);
+
+__END_DECLS
+
+#endif /* _SYS_SYSCALL_H_ */
diff --git a/ndk/platforms/android-3/include/sys/sysconf.h b/ndk/platforms/android-3/include/sys/sysconf.h
new file mode 100644
index 0000000..2fc1b08
--- /dev/null
+++ b/ndk/platforms/android-3/include/sys/sysconf.h
@@ -0,0 +1,135 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _SYS_SYSCONF_H_
+#define _SYS_SYSCONF_H_
+
+#include <sys/cdefs.h>
+
+__BEGIN_DECLS
+
+/* as listed by Posix sysconf() description */
+/* most of these will return -1 and ENOSYS  */
+
+#define _SC_ARG_MAX             0x0000
+#define _SC_BC_BASE_MAX         0x0001
+#define _SC_BC_DIM_MAX          0x0002
+#define _SC_BC_SCALE_MAX        0x0003
+#define _SC_BC_STRING_MAX       0x0004
+#define _SC_CHILD_MAX           0x0005
+#define _SC_CLK_TCK             0x0006
+#define _SC_COLL_WEIGHTS_MAX    0x0007
+#define _SC_EXPR_NEST_MAX       0x0008
+#define _SC_LINE_MAX            0x0009
+#define _SC_NGROUPS_MAX         0x000a
+#define _SC_OPEN_MAX            0x000b
+#define _SC_PASS_MAX            0x000c
+#define _SC_2_C_BIND            0x000d
+#define _SC_2_C_DEV             0x000e
+#define _SC_2_C_VERSION         0x000f
+#define _SC_2_CHAR_TERM         0x0010
+#define _SC_2_FORT_DEV          0x0011
+#define _SC_2_FORT_RUN          0x0012
+#define _SC_2_LOCALEDEF         0x0013
+#define _SC_2_SW_DEV            0x0014
+#define _SC_2_UPE               0x0015
+#define _SC_2_VERSION           0x0016
+#define _SC_JOB_CONTROL         0x0017
+#define _SC_SAVED_IDS           0x0018
+#define _SC_VERSION             0x0019
+#define _SC_RE_DUP_MAX          0x001a
+#define _SC_STREAM_MAX          0x001b
+#define _SC_TZNAME_MAX          0x001c
+#define _SC_XOPEN_CRYPT         0x001d
+#define _SC_XOPEN_ENH_I18N      0x001e
+#define _SC_XOPEN_SHM           0x001f
+#define _SC_XOPEN_VERSION       0x0020
+#define _SC_XOPEN_XCU_VERSION   0x0021
+#define _SC_XOPEN_REALTIME      0x0022
+#define _SC_XOPEN_REALTIME_THREADS  0x0023
+#define _SC_XOPEN_LEGACY        0x0024
+#define _SC_ATEXIT_MAX          0x0025
+#define _SC_IOV_MAX             0x0026
+#define _SC_PAGESIZE            0x0027
+#define _SC_PAGE_SIZE           0x0028
+#define _SC_XOPEN_UNIX          0x0029
+#define _SC_XBS5_ILP32_OFF32    0x002a
+#define _SC_XBS5_ILP32_OFFBIG   0x002b
+#define _SC_XBS5_LP64_OFF64     0x002c
+#define _SC_XBS5_LPBIG_OFFBIG   0x002d
+#define _SC_AIO_LISTIO_MAX      0x002e
+#define _SC_AIO_MAX             0x002f
+#define _SC_AIO_PRIO_DELTA_MAX  0x0030
+#define _SC_DELAYTIMER_MAX      0x0031
+#define _SC_MQ_OPEN_MAX         0x0032
+#define _SC_MQ_PRIO_MAX         0x0033
+#define _SC_RTSIG_MAX           0x0034
+#define _SC_SEM_NSEMS_MAX       0x0035
+#define _SC_SEM_VALUE_MAX       0x0036
+#define _SC_SIGQUEUE_MAX        0x0037
+#define _SC_TIMER_MAX           0x0038
+#define _SC_ASYNCHRONOUS_IO     0x0039
+#define _SC_FSYNC               0x003a
+#define _SC_MAPPED_FILES        0x003b
+#define _SC_MEMLOCK             0x003c
+#define _SC_MEMLOCK_RANGE       0x003d
+#define _SC_MEMORY_PROTECTION   0x003e
+#define _SC_MESSAGE_PASSING     0x003f
+#define _SC_PRIORITIZED_IO      0x0040
+#define _SC_PRIORITY_SCHEDULING 0x0041
+#define _SC_REALTIME_SIGNALS    0x0042
+#define _SC_SEMAPHORES          0x0043
+#define _SC_SHARED_MEMORY_OBJECTS  0x0044
+#define _SC_SYNCHRONIZED_IO     0x0045
+#define _SC_TIMERS              0x0046
+#define _SC_GETGR_R_SIZE_MAX    0x0047
+#define _SC_GETPW_R_SIZE_MAX    0x0048
+#define _SC_LOGIN_NAME_MAX      0x0049
+#define _SC_THREAD_DESTRUCTOR_ITERATIONS  0x004a
+#define _SC_THREAD_KEYS_MAX     0x004b
+#define _SC_THREAD_STACK_MIN    0x004c
+#define _SC_THREAD_THREADS_MAX  0x004d
+#define _SC_TTY_NAME_MAX        0x004e
+
+#define _SC_THREADS                     0x004f
+#define _SC_THREAD_ATTR_STACKADDR       0x0050
+#define _SC_THREAD_ATTR_STACKSIZE       0x0051
+#define _SC_THREAD_PRIORITY_SCHEDULING  0x0052
+#define _SC_THREAD_PRIO_INHERIT         0x0053
+#define _SC_THREAD_PRIO_PROTECT         0x0054
+#define _SC_THREAD_SAFE_FUNCTIONS       0x0055
+
+#define _SC_NPROCESSORS_CONF            0x0060
+#define _SC_NPROCESSORS_ONLN            0x0061
+#define _SC_PHYS_PAGES                  0x0062
+#define _SC_AVPHYS_PAGES                0x0063
+
+extern int sysconf (int  name);
+
+__END_DECLS
+
+#endif /* _SYS_SYSCONF_H_ */
diff --git a/ndk/platforms/android-3/include/sys/sysinfo.h b/ndk/platforms/android-3/include/sys/sysinfo.h
new file mode 100644
index 0000000..d5d1c6e
--- /dev/null
+++ b/ndk/platforms/android-3/include/sys/sysinfo.h
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _SYS_SYSINFO_H_
+#define _SYS_SYSINFO_H_
+
+#include <sys/cdefs.h>
+#include <linux/kernel.h>
+
+__BEGIN_DECLS
+
+#if 0 /* MISSING FROM BIONIC */
+extern int sysinfo (struct sysinfo *info);
+#endif /* MISSING */
+
+__END_DECLS
+
+#endif /* _SYS_SYSINFO_H_ */
diff --git a/tools/zoneinfo/tzdata2009s/MODULE_LICENSE_PUBLIC_DOMAIN b/ndk/platforms/android-3/include/sys/syslimits.h
similarity index 100%
copy from tools/zoneinfo/tzdata2009s/MODULE_LICENSE_PUBLIC_DOMAIN
copy to ndk/platforms/android-3/include/sys/syslimits.h
diff --git a/ndk/platforms/android-3/include/sys/sysmacros.h b/ndk/platforms/android-3/include/sys/sysmacros.h
new file mode 100644
index 0000000..6f053a8
--- /dev/null
+++ b/ndk/platforms/android-3/include/sys/sysmacros.h
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _SYS_SYSMACROS_H_
+#define _SYS_SYSMACROS_H_
+
+/* some rogue code includes this file directly :-( */
+#ifndef _SYS_TYPES_H_
+# include <sys/types.h>
+#endif
+
+static __inline__ int major(dev_t _dev)
+{
+  return (_dev >> 8) & 0xfff;
+}
+
+static __inline__ int minor(dev_t _dev)
+{
+  return (_dev & 0xff) | ((_dev >> 12) & 0xfff00);
+}
+
+static __inline__ dev_t makedev(int __ma, int __mi)
+{
+  return ((__ma & 0xfff) << 8) | (__mi & 0xff) | ((__mi & 0xfff00) << 12);
+}
+
+#endif /* _SYS_SYSMACROS_H_ */
+
diff --git a/ndk/platforms/android-3/include/sys/system_properties.h b/ndk/platforms/android-3/include/sys/system_properties.h
new file mode 100644
index 0000000..4fdc944
--- /dev/null
+++ b/ndk/platforms/android-3/include/sys/system_properties.h
@@ -0,0 +1,85 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _INCLUDE_SYS_SYSTEM_PROPERTIES_H
+#define _INCLUDE_SYS_SYSTEM_PROPERTIES_H
+
+#include <sys/cdefs.h>
+
+__BEGIN_DECLS
+
+typedef struct prop_info prop_info;
+
+#define PROP_NAME_MAX   32
+#define PROP_VALUE_MAX  92
+
+/* Look up a system property by name, copying its value and a
+** \0 terminator to the provided pointer.  The total bytes
+** copied will be no greater than PROP_VALUE_MAX.  Returns
+** the string length of the value.  A property that is not
+** defined is identical to a property with a length 0 value.
+*/
+int __system_property_get(const char *name, char *value);
+
+/* Return a pointer to the system property named name, if it
+** exists, or NULL if there is no such property.  Use 
+** __system_property_read() to obtain the string value from
+** the returned prop_info pointer.
+**
+** It is safe to cache the prop_info pointer to avoid future
+** lookups.  These returned pointers will remain valid for
+** the lifetime of the system.
+*/
+const prop_info *__system_property_find(const char *name);
+
+/* Read the value of a system property.  Returns the length
+** of the value.  Copies the value and \0 terminator into
+** the provided value pointer.  Total length (including
+** terminator) will be no greater that PROP_VALUE_MAX.
+**
+** If name is nonzero, up to PROP_NAME_MAX bytes will be
+** copied into the provided name pointer.  The name will
+** be \0 terminated.
+*/
+int __system_property_read(const prop_info *pi, char *name, char *value);
+
+/* Return a prop_info for the nth system property, or NULL if 
+** there is no nth property.  Use __system_property_read() to
+** read the value of this property.
+**
+** This method is for inspecting and debugging the property 
+** system.  Please use __system_property_find() instead.
+**
+** Order of results may change from call to call.  This is
+** not a bug.
+*/ 
+const prop_info *__system_property_find_nth(unsigned n);
+
+__END_DECLS
+
+#endif
diff --git a/ndk/platforms/android-3/include/sys/time.h b/ndk/platforms/android-3/include/sys/time.h
new file mode 100644
index 0000000..1f010d4
--- /dev/null
+++ b/ndk/platforms/android-3/include/sys/time.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _SYS_TIME_H_
+#define _SYS_TIME_H_
+
+#include <sys/cdefs.h>
+#include <sys/types.h>
+#include <linux/time.h>
+
+__BEGIN_DECLS
+
+extern int gettimeofday(struct timeval *, struct timezone *);
+extern int settimeofday(const struct timeval *, const struct timezone *);
+
+extern int getitimer(int, struct itimerval *);
+extern int setitimer(int, const struct itimerval *, struct itimerval *);
+
+extern int utimes(const char *, const struct timeval *);
+
+#define timerclear(a)   \
+        ((a)->tv_sec = (a)->tv_usec = 0)
+
+#define timerisset(a)    \
+        ((a)->tv_sec != 0 || (a)->tv_usec != 0)
+
+#define timercmp(a, b, op)               \
+        ((a)->tv_sec == (b)->tv_sec      \
+        ? (a)->tv_usec op (b)->tv_usec   \
+        : (a)->tv_sec op (b)->tv_sec)
+
+#define timeradd(a, b, res)                           \
+    do {                                              \
+        (res)->tv_sec  = (a)->tv_sec  + (b)->tv_sec;  \
+        (res)->tv_usec = (a)->tv_usec + (b)->tv_usec; \
+        if ((res)->tv_usec >= 1000000) {              \
+            (res)->tv_usec -= 1000000;                \
+            (res)->tv_sec  += 1;                      \
+        }                                             \
+    } while (0)
+
+#define timersub(a, b, res)                           \
+    do {                                              \
+        (res)->tv_sec  = (a)->tv_sec  - (b)->tv_sec;  \
+        (res)->tv_usec = (a)->tv_usec - (b)->tv_usec; \
+        if ((res)->tv_usec < 0) {                     \
+            (res)->tv_usec += 1000000;                \
+            (res)->tv_sec  -= 1;                      \
+        }                                             \
+    } while (0)
+
+__END_DECLS
+
+#endif /* _SYS_TIME_H_ */
diff --git a/ndk/platforms/android-3/include/sys/timeb.h b/ndk/platforms/android-3/include/sys/timeb.h
new file mode 100644
index 0000000..f2cc39c
--- /dev/null
+++ b/ndk/platforms/android-3/include/sys/timeb.h
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _SYS_TIMEB_H
+#define _SYS_TIMEB_H
+
+#include <sys/time.h>
+
+__BEGIN_DECLS
+
+struct timeb {
+    time_t          time;
+    unsigned short  millitm;
+    short           timezone;
+    short           dstflag;
+};
+
+extern int  ftime(struct timeb*  timebuf);
+
+__END_DECLS
+
+#endif /* _SYS_TIMEB_H */
diff --git a/ndk/platforms/android-3/include/sys/times.h b/ndk/platforms/android-3/include/sys/times.h
new file mode 100644
index 0000000..1b9b8b2
--- /dev/null
+++ b/ndk/platforms/android-3/include/sys/times.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _SYS_TIMES_H_
+#define _SYS_TIMES_H_
+
+#include <sys/cdefs.h>
+#include <sys/types.h>
+#include <linux/times.h>
+
+__BEGIN_DECLS
+
+extern clock_t times(struct tms *);
+
+__END_DECLS
+
+#endif /* _SYS_TIMES_H_ */
diff --git a/tools/zoneinfo/tzdata2009s/MODULE_LICENSE_PUBLIC_DOMAIN b/ndk/platforms/android-3/include/sys/ttychars.h
similarity index 100%
copy from tools/zoneinfo/tzdata2009s/MODULE_LICENSE_PUBLIC_DOMAIN
copy to ndk/platforms/android-3/include/sys/ttychars.h
diff --git a/tools/zoneinfo/tzdata2009s/MODULE_LICENSE_PUBLIC_DOMAIN b/ndk/platforms/android-3/include/sys/ttydev.h
similarity index 100%
copy from tools/zoneinfo/tzdata2009s/MODULE_LICENSE_PUBLIC_DOMAIN
copy to ndk/platforms/android-3/include/sys/ttydev.h
diff --git a/ndk/platforms/android-3/include/sys/types.h b/ndk/platforms/android-3/include/sys/types.h
new file mode 100644
index 0000000..33fe30e
--- /dev/null
+++ b/ndk/platforms/android-3/include/sys/types.h
@@ -0,0 +1,127 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _SYS_TYPES_H_
+#define _SYS_TYPES_H_
+
+#define __need_size_t
+#define __need_ptrdiff_t
+#include <stddef.h>
+#include <stdint.h>
+#include <sys/cdefs.h>
+
+#include <linux/posix_types.h>
+#include <asm/types.h>
+#include <linux/types.h>
+#include <machine/kernel.h>
+
+typedef __u32    __kernel_dev_t;
+
+/* be careful with __kernel_gid_t and __kernel_uid_t
+ * these are defined as 16-bit for legacy reason, but
+ * the kernel uses 32-bits instead.
+ *
+ * 32-bit valuea are required for Android, so use
+ * __kernel_uid32_t and __kernel_gid32_t
+ */
+
+typedef __kernel_blkcnt_t    blkcnt_t;
+typedef __kernel_blksize_t   blksize_t;
+typedef __kernel_clock_t     clock_t;
+typedef __kernel_clockid_t   clockid_t;
+typedef __kernel_dev_t       dev_t;
+typedef __kernel_fsblkcnt_t  fsblkcnt_t;
+typedef __kernel_fsfilcnt_t  fsfilcnt_t;
+typedef __kernel_gid32_t     gid_t;
+typedef __kernel_id_t        id_t;
+typedef __kernel_ino_t       ino_t;
+typedef __kernel_key_t       key_t;
+typedef __kernel_mode_t      mode_t;
+typedef __kernel_nlink_t	 nlink_t;
+#ifndef _OFF_T_DEFINED_
+#define _OFF_T_DEFINED_
+typedef __kernel_off_t       off_t;
+#endif
+typedef __kernel_loff_t      loff_t;
+typedef loff_t               off64_t;  /* GLibc-specific */
+
+typedef __kernel_pid_t		 pid_t;
+
+/* while POSIX wants these in <sys/types.h>, we
+ * declare then in <pthread.h> instead */
+#if 0
+typedef  .... pthread_attr_t;
+typedef  .... pthread_cond_t;
+typedef  .... pthread_condattr_t;
+typedef  .... pthread_key_t;
+typedef  .... pthread_mutex_t;
+typedef  .... pthread_once_t;
+typedef  .... pthread_rwlock_t;
+typedef  .... pthread_rwlock_attr_t;
+typedef  .... pthread_t;
+#endif
+
+#ifndef _SIZE_T_DEFINED_
+#define _SIZE_T_DEFINED_
+typedef unsigned int  size_t;
+#endif
+
+/* size_t is defined by the GCC-specific <stddef.h> */
+#ifndef _SSIZE_T_DEFINED_
+#define _SSIZE_T_DEFINED_
+typedef long int  ssize_t;
+#endif
+
+typedef __kernel_suseconds_t  suseconds_t;
+typedef __kernel_time_t       time_t;
+typedef __kernel_uid32_t        uid_t;
+typedef signed long           useconds_t;
+
+typedef __kernel_daddr_t	daddr_t;
+typedef __kernel_timer_t	timer_t;
+typedef __kernel_mqd_t		mqd_t;
+
+typedef __kernel_caddr_t    caddr_t;
+typedef unsigned int        uint_t;
+typedef unsigned int        uint;
+
+/* for some applications */
+#include <sys/sysmacros.h>
+
+#ifdef __BSD_VISIBLE
+typedef	unsigned char	u_char;
+typedef	unsigned short	u_short;
+typedef	unsigned int	u_int;
+typedef	unsigned long	u_long;
+
+typedef uint32_t       u_int32_t;
+typedef uint16_t       u_int16_t;
+typedef uint8_t        u_int8_t;
+typedef uint64_t       u_int64_t;
+#endif
+
+#endif
diff --git a/ndk/platforms/android-3/include/sys/uio.h b/ndk/platforms/android-3/include/sys/uio.h
new file mode 100644
index 0000000..0251716
--- /dev/null
+++ b/ndk/platforms/android-3/include/sys/uio.h
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _SYS_UIO_H_
+#define _SYS_UIO_H_
+
+#include <sys/cdefs.h>
+#include <sys/types.h>
+#include <linux/uio.h>
+
+__BEGIN_DECLS
+
+int readv(int, const struct iovec *, int);
+int writev(int, const struct iovec *, int);
+
+__END_DECLS
+
+#endif /* _SYS_UIO_H_ */
diff --git a/ndk/platforms/android-3/include/sys/un.h b/ndk/platforms/android-3/include/sys/un.h
new file mode 100644
index 0000000..973861f
--- /dev/null
+++ b/ndk/platforms/android-3/include/sys/un.h
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _SYS_UN_H_
+#define _SYS_UN_H_
+
+#include <linux/un.h>
+
+#endif /* _SYS_UN_H_ */
diff --git a/ndk/platforms/android-3/include/sys/utime.h b/ndk/platforms/android-3/include/sys/utime.h
new file mode 100644
index 0000000..9f8810e
--- /dev/null
+++ b/ndk/platforms/android-3/include/sys/utime.h
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _SYS_UTIME_H_
+#define _SYS_UTIME_H_
+
+#include <linux/utime.h>
+
+#endif /* _SYS_UTIME_H_ */
diff --git a/ndk/platforms/android-3/include/sys/utsname.h b/ndk/platforms/android-3/include/sys/utsname.h
new file mode 100644
index 0000000..d54a994
--- /dev/null
+++ b/ndk/platforms/android-3/include/sys/utsname.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _SYS_UTSNAME_H_
+#define _SYS_UTSNAME_H_
+
+#include <sys/cdefs.h>
+
+__BEGIN_DECLS
+
+#define SYS_NMLN 65
+
+struct utsname {
+    char  sysname   [SYS_NMLN];
+    char  nodename  [SYS_NMLN];
+    char  release   [SYS_NMLN];
+    char  version   [SYS_NMLN];
+    char  machine   [SYS_NMLN];
+    char  domainname[SYS_NMLN];
+};
+
+extern int uname(struct utsname *);
+
+__END_DECLS
+
+#endif /* _SYS_UTSNAME_H_ */
diff --git a/ndk/platforms/android-3/include/sys/vfs.h b/ndk/platforms/android-3/include/sys/vfs.h
new file mode 100644
index 0000000..4adaf5f
--- /dev/null
+++ b/ndk/platforms/android-3/include/sys/vfs.h
@@ -0,0 +1,102 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _SYS_VFS_H_
+#define _SYS_VFS_H_
+
+#include <stdint.h>
+#include <sys/cdefs.h>
+#include <sys/types.h>
+
+__BEGIN_DECLS
+
+/* note: this corresponds to the kernel's statfs64 type */
+struct statfs {
+    uint32_t        f_type;
+    uint32_t        f_bsize;
+    uint64_t        f_blocks;
+    uint64_t        f_bfree;
+    uint64_t        f_bavail;
+    uint64_t        f_files;
+    uint64_t        f_ffree;
+    __kernel_fsid_t f_fsid;
+    uint32_t        f_namelen;
+    uint32_t        f_frsize;
+    uint32_t        f_spare[5];
+};
+
+#define  ADFS_SUPER_MAGIC      0xadf5
+#define  AFFS_SUPER_MAGIC      0xADFF
+#define  BEFS_SUPER_MAGIC      0x42465331
+#define  BFS_MAGIC             0x1BADFACE
+#define  CIFS_MAGIC_NUMBER     0xFF534D42
+#define  CODA_SUPER_MAGIC      0x73757245
+#define  COH_SUPER_MAGIC       0x012FF7B7
+#define  CRAMFS_MAGIC          0x28cd3d45
+#define  DEVFS_SUPER_MAGIC     0x1373
+#define  EFS_SUPER_MAGIC       0x00414A53
+#define  EXT_SUPER_MAGIC       0x137D
+#define  EXT2_OLD_SUPER_MAGIC  0xEF51
+#define  EXT2_SUPER_MAGIC      0xEF53
+#define  EXT3_SUPER_MAGIC      0xEF53
+#define  HFS_SUPER_MAGIC       0x4244
+#define  HPFS_SUPER_MAGIC      0xF995E849
+#define  HUGETLBFS_MAGIC       0x958458f6
+#define  ISOFS_SUPER_MAGIC     0x9660
+#define  JFFS2_SUPER_MAGIC     0x72b6
+#define  JFS_SUPER_MAGIC       0x3153464a
+#define  MINIX_SUPER_MAGIC     0x137F /* orig. minix */
+#define  MINIX_SUPER_MAGIC2    0x138F /* 30 char minix */
+#define  MINIX2_SUPER_MAGIC    0x2468 /* minix V2 */
+#define  MINIX2_SUPER_MAGIC2   0x2478 /* minix V2, 30 char names */
+#define  MSDOS_SUPER_MAGIC     0x4d44
+#define  NCP_SUPER_MAGIC       0x564c
+#define  NFS_SUPER_MAGIC       0x6969
+#define  NTFS_SB_MAGIC         0x5346544e
+#define  OPENPROM_SUPER_MAGIC  0x9fa1
+#define  PROC_SUPER_MAGIC      0x9fa0
+#define  QNX4_SUPER_MAGIC      0x002f
+#define  REISERFS_SUPER_MAGIC  0x52654973
+#define  ROMFS_MAGIC           0x7275
+#define  SMB_SUPER_MAGIC       0x517B
+#define  SYSV2_SUPER_MAGIC     0x012FF7B6
+#define  SYSV4_SUPER_MAGIC     0x012FF7B5
+#define  TMPFS_MAGIC           0x01021994
+#define  UDF_SUPER_MAGIC       0x15013346
+#define  UFS_MAGIC             0x00011954
+#define  USBDEVICE_SUPER_MAGIC 0x9fa2
+#define  VXFS_SUPER_MAGIC      0xa501FCF5
+#define  XENIX_SUPER_MAGIC     0x012FF7B4
+#define  XFS_SUPER_MAGIC       0x58465342
+#define  _XIAFS_SUPER_MAGIC    0x012FD16D
+
+extern int statfs(const char *, struct statfs *);
+extern int fstatfs(int, struct statfs *);
+
+__END_DECLS
+
+#endif /* _SYS_VFS_H_ */
diff --git a/ndk/platforms/android-3/include/sys/vt.h b/ndk/platforms/android-3/include/sys/vt.h
new file mode 100644
index 0000000..b37a869
--- /dev/null
+++ b/ndk/platforms/android-3/include/sys/vt.h
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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.
+ */
+#include <linux/vt.h>
diff --git a/ndk/platforms/android-3/include/sys/wait.h b/ndk/platforms/android-3/include/sys/wait.h
new file mode 100644
index 0000000..8ba1837
--- /dev/null
+++ b/ndk/platforms/android-3/include/sys/wait.h
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _SYS_WAIT_H_
+#define _SYS_WAIT_H_
+
+#include <sys/cdefs.h>
+#include <sys/types.h>
+#include <sys/resource.h>
+#include <linux/wait.h>
+
+__BEGIN_DECLS
+
+#define WEXITSTATUS(s)  (((s) & 0xff00) >> 8)
+#define WCOREDUMP(s)    ((s) & 0x80)
+#define WTERMSIG(s)     ((s) & 0x7f)
+#define WSTOPSIG(s)     WEXITSTATUS(s)
+
+#define WIFEXITED(s)    (WTERMSIG(s) == 0)
+#define WIFSTOPPED(s)   (WTERMSIG(s) == 0x7f)
+#define WIFSIGNALED(s)  (WTERMSIG((s)+1) >= 2)
+
+extern pid_t  wait(int *);
+extern pid_t  waitpid(pid_t, int *, int);
+extern pid_t  wait3(int *, int, struct rusage *);
+extern pid_t  wait4(pid_t, int *, int, struct rusage *);
+
+__END_DECLS
+
+#endif /* _SYS_WAIT_H_ */
diff --git a/ndk/platforms/android-3/include/syslog.h b/ndk/platforms/android-3/include/syslog.h
new file mode 100644
index 0000000..d35bc79
--- /dev/null
+++ b/ndk/platforms/android-3/include/syslog.h
@@ -0,0 +1,116 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _SYSLOG_H
+#define _SYSLOG_H
+
+#include <stdio.h>
+#include <sys/cdefs.h>
+#include <stdarg.h>
+
+__BEGIN_DECLS
+
+/* Alert levels */
+#define LOG_EMERG	0
+#define LOG_ALERT	1
+#define LOG_CRIT	2
+#define LOG_ERR		3
+#define LOG_WARNING	4
+#define LOG_NOTICE	5
+#define LOG_INFO	6
+#define LOG_DEBUG	7
+
+#define LOG_PRIMASK	7
+#define LOG_PRI(x)	((x) & LOG_PRIMASK)
+
+
+/* Facilities; not actually used */
+#define LOG_KERN	0000
+#define LOG_USER	0010
+#define LOG_MAIL	0020
+#define LOG_DAEMON	0030
+#define LOG_AUTH	0040
+#define LOG_SYSLOG	0050
+#define LOG_LPR		0060
+#define LOG_NEWS	0070
+#define LOG_UUCP	0100
+#define LOG_CRON	0110
+#define LOG_AUTHPRIV	0120
+#define LOG_FTP		0130
+#define LOG_LOCAL0	0200
+#define LOG_LOCAL1	0210
+#define LOG_LOCAL2	0220
+#define LOG_LOCAL3	0230
+#define LOG_LOCAL4	0240
+#define LOG_LOCAL5	0250
+#define LOG_LOCAL6	0260
+#define LOG_LOCAL7	0270
+
+#define LOG_FACMASK	01770
+#define LOG_FAC(x)	(((x) >> 3) & (LOG_FACMASK >> 3))
+
+#define	LOG_MASK(pri)	(1 << (pri))		/* mask for one priority */
+#define	LOG_UPTO(pri)	((1 << ((pri)+1)) - 1)	/* all priorities through pri */
+
+/* openlog() flags; only LOG_PID and LOG_PERROR supported */
+#define        LOG_PID         0x01    /* include pid with message */
+#define        LOG_CONS        0x02    /* write to console on logger error */
+#define        LOG_ODELAY      0x04    /* delay connection until syslog() */
+#define        LOG_NDELAY      0x08    /* open connection immediately */
+#define        LOG_NOWAIT      0x10    /* wait for child processes (unused on linux) */
+#define        LOG_PERROR      0x20    /* additional logging to stderr */
+
+/* BIONIC: the following definitions are from OpenBSD's sys/syslog.h
+ */
+struct syslog_data {
+	int	log_file;
+        int	connected;
+        int	opened;
+        int	log_stat;
+        const char 	*log_tag;
+        int 	log_fac;
+        int 	log_mask;
+};
+
+#define SYSLOG_DATA_INIT {-1, 0, 0, 0, (const char *)0, LOG_USER, 0xff}
+
+#define _PATH_LOG  "/dev/kmsg"
+
+extern void	closelog(void);
+extern void	openlog(const char *, int, int);
+extern int	setlogmask(int);
+extern void	syslog(int, const char *, ...);
+extern void	vsyslog(int, const char *, va_list);
+extern void	closelog_r(struct syslog_data *);
+extern void	openlog_r(const char *, int, int, struct syslog_data *);
+extern int	setlogmask_r(int, struct syslog_data *);
+extern void	syslog_r(int, struct syslog_data *, const char *, ...);
+extern void	vsyslog_r(int, struct syslog_data *, const char *, va_list);
+
+__END_DECLS
+
+#endif /* _SYSLOG_H */
diff --git a/ndk/platforms/android-3/include/termio.h b/ndk/platforms/android-3/include/termio.h
new file mode 100644
index 0000000..99d3630
--- /dev/null
+++ b/ndk/platforms/android-3/include/termio.h
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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.
+ */
+
+/* All definitions related to termio are in Linux kernel headers
+ * that are already included by <termios.h>
+ */
+#include <termios.h>
diff --git a/ndk/platforms/android-3/include/termios.h b/ndk/platforms/android-3/include/termios.h
new file mode 100644
index 0000000..ad19089
--- /dev/null
+++ b/ndk/platforms/android-3/include/termios.h
@@ -0,0 +1,113 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _TERMIOS_H_
+#define _TERMIOS_H_
+
+#include <sys/cdefs.h>
+#include <sys/ioctl.h>
+#include <sys/types.h>
+#include <stdint.h>
+#include <linux/termios.h>
+
+__BEGIN_DECLS
+
+/* Redefine these to match their ioctl number */
+#undef  TCSANOW
+#define TCSANOW    TCSETS
+
+#undef  TCSADRAIN
+#define TCSADRAIN  TCSETSW
+
+#undef  TCSAFLUSH
+#define TCSAFLUSH  TCSETSF
+
+static __inline__ int tcgetattr(int fd, struct termios *s)
+{
+    return ioctl(fd, TCGETS, s);
+}
+
+static __inline__ int tcsetattr(int fd, int __opt, const struct termios *s)
+{
+    return ioctl(fd, __opt, (void *)s);
+}
+
+static __inline__ int tcflow(int fd, int action)
+{
+    return ioctl(fd, TCXONC, (void *)(intptr_t)action);
+}
+
+static __inline__ int tcflush(int fd, int __queue)
+{
+    return ioctl(fd, TCFLSH, (void *)(intptr_t)__queue);
+}
+
+static __inline__ pid_t tcgetsid(int fd)
+{
+    pid_t _pid;
+    return ioctl(fd, TIOCGSID, &_pid) ? (pid_t)-1 : _pid;
+}
+
+static __inline__ int tcsendbreak(int fd, int __duration)
+{
+    return ioctl(fd, TCSBRKP, (void *)(uintptr_t)__duration);
+}
+
+static __inline__ speed_t cfgetospeed(const struct termios *s)
+{
+    return (speed_t)(s->c_cflag & CBAUD);
+}
+
+static __inline__ int cfsetospeed(struct termios *s, speed_t  speed)
+{
+    s->c_cflag = (s->c_cflag & ~CBAUD) | (speed & CBAUD);
+    return 0;
+}
+
+static __inline__ speed_t cfgetispeed(const struct termios *s)
+{
+    return (speed_t)(s->c_cflag & CBAUD);
+}
+
+static __inline__ int cfsetispeed(struct termios *s, speed_t  speed)
+{
+    s->c_cflag = (s->c_cflag & ~CBAUD) | (speed & CBAUD);
+  return 0;
+}
+
+static __inline__ void cfmakeraw(struct termios *s)
+{
+    s->c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL|IXON);
+    s->c_oflag &= ~OPOST;
+    s->c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN);
+    s->c_cflag &= ~(CSIZE|PARENB);
+    s->c_cflag |= CS8;
+}
+
+__END_DECLS
+
+#endif /* _TERMIOS_H_ */
diff --git a/ndk/platforms/android-3/include/thread_db.h b/ndk/platforms/android-3/include/thread_db.h
new file mode 100644
index 0000000..9c76d40
--- /dev/null
+++ b/ndk/platforms/android-3/include/thread_db.h
@@ -0,0 +1,143 @@
+/*
+ * Copyright 2006 The Android Open Source Project
+ */
+
+#ifndef _LIBTHREAD_DB__THREAD_DB_H
+#define _LIBTHREAD_DB__THREAD_DB_H
+
+#include <pthread.h>
+#include <signal.h>
+#include <stdint.h>
+#include <sys/types.h>
+
+
+#define TD_THR_ANY_USER_FLAGS       0xffffffff
+#define TD_THR_LOWEST_PRIORITY      -20
+#define TD_SIGNO_MASK               NULL
+
+/* td_err_e values */
+enum {
+    TD_OK,
+    TD_ERR,
+    TD_NOTHR,
+    TD_NOSV,
+    TD_NOLWP,
+    TD_BADPH,
+    TD_BADTH,
+    TD_BADSH,
+    TD_BADTA,
+    TD_BADKEY,
+    TD_NOMSG,
+    TD_NOFPREGS,
+    TD_NOLIBTHREAD,
+    TD_NOEVENT,
+    TD_NOCAPAB,
+    TD_DBERR,
+    TD_NOAPLIC,
+    TD_NOTSD,
+    TD_MALLOC,
+    TD_PARTIALREG,
+    TD_NOXREGS,
+    TD_VERSION
+};
+
+/*
+ * td_event_e values 
+ * NOTE: There is a max of 32 events
+ */
+enum {
+    TD_CREATE,
+    TD_DEATH
+};
+
+/* td_thr_state_e values */
+enum {
+    TD_THR_ANY_STATE,
+    TD_THR_UNKNOWN,
+    TD_THR_SLEEP,
+    TD_THR_ZOMBIE
+};
+
+typedef int32_t td_err_e;
+typedef uint32_t td_event_e;
+typedef uint32_t td_notify_e;
+typedef uint32_t td_thr_state_e;
+typedef pthread_t thread_t;
+
+typedef struct
+{
+    pid_t pid;
+} td_thragent_t;
+
+typedef struct
+{
+    pid_t pid;
+    pid_t tid;
+} td_thrhandle_t;
+
+typedef struct
+{
+    td_event_e event;
+    td_thrhandle_t const * th_p;
+    union {
+        void * data;
+    } msg;
+} td_event_msg_t;
+
+typedef struct
+{
+    uint32_t events;
+} td_thr_events_t;
+
+typedef struct
+{
+    union {
+        void * bptaddr;
+    } u;
+} td_notify_t;
+
+typedef struct
+{
+    td_thr_state_e ti_state;
+    thread_t ti_tid; // pthread's id for the thread
+    int32_t ti_lid; // the kernel's id for the thread
+} td_thrinfo_t;
+
+
+#define td_event_emptyset(set) \
+    (set)->events = 0
+
+#define td_event_fillset(set) \
+    (set)->events = 0xffffffff
+
+#define td_event_addset(set, n) \
+    (set)->events |= (1 << n)
+
+
+typedef int td_thr_iter_f(td_thrhandle_t const *, void *);
+
+
+struct ps_prochandle;
+
+#ifdef __cplusplus
+extern "C"{
+#endif
+
+extern td_err_e td_ta_new(struct ps_prochandle const * proc_handle, td_thragent_t ** thread_agent);
+
+extern td_err_e td_ta_set_event(td_thragent_t const * agent, td_thr_events_t * event);
+
+extern td_err_e td_ta_event_addr(td_thragent_t const * agent, td_event_e event, td_notify_t * notify);
+
+extern td_err_e td_ta_event_getmsg(td_thragent_t const * agent, td_event_msg_t * event);
+
+extern td_err_e td_ta_thr_iter(td_thragent_t const * agent, td_thr_iter_f * func, void * cookie,
+                               td_thr_state_e state, int32_t prio, sigset_t * sigmask, uint32_t user_flags);
+
+extern char const ** td_symbol_list(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/ndk/platforms/android-3/include/time.h b/ndk/platforms/android-3/include/time.h
new file mode 100644
index 0000000..b5227d7
--- /dev/null
+++ b/ndk/platforms/android-3/include/time.h
@@ -0,0 +1,117 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _TIME_H_
+#define _TIME_H_
+
+#include <sys/cdefs.h>
+#include <sys/time.h>
+
+#define __ARCH_SI_UID_T __kernel_uid32_t
+#include <asm/siginfo.h>
+#undef __ARCH_SI_UID_T
+
+__BEGIN_DECLS
+
+extern time_t   time(time_t *);
+extern int      nanosleep(const struct timespec *, struct timespec *);
+
+extern char *strtotimeval(const char *str, struct timeval *tv);
+
+struct tm {
+   int     tm_sec;         /* seconds */
+   int     tm_min;         /* minutes */
+   int     tm_hour;        /* hours */
+   int     tm_mday;        /* day of the month */
+   int     tm_mon;         /* month */
+   int     tm_year;        /* year */
+   int     tm_wday;        /* day of the week */
+   int     tm_yday;        /* day in the year */
+   int     tm_isdst;       /* daylight saving time */
+
+   long int tm_gmtoff;     /* Seconds east of UTC.  */
+   const char *tm_zone;    /* Timezone abbreviation.  */
+
+};
+
+/* defining TM_ZONE indicates that we have a "timezone abbreviation" field in
+ * struct tm, the value should be the field name
+ */
+#define   TM_ZONE   tm_zone
+
+extern char* asctime(const struct tm* a);
+extern char* asctime_r(const struct tm* a, char* buf);
+
+/* Return the difference between TIME1 and TIME0.  */
+extern double difftime (time_t __time1, time_t __time0);
+extern time_t mktime (struct tm *a);
+
+extern struct tm*  localtime(const time_t *t);
+extern struct tm*  localtime_r(const time_t *timep, struct tm *result);
+
+extern struct tm*  gmtime(const time_t *timep);
+extern struct tm*  gmtime_r(const time_t *timep, struct tm *result);
+
+extern char*       strptime(const char *buf, const char *fmt, struct tm *tm);
+extern size_t      strftime(char *s, size_t max, const char *format, const struct tm *tm);
+
+extern char *ctime(const time_t *timep);
+extern char *ctime_r(const time_t *timep, char *buf);
+
+extern void  tzset(void);
+
+/* global includes */
+extern char*     tzname[];
+#if 0 /* MISSING FROM BIONIC */
+extern int       daylight;
+extern long int  timezone;
+#endif /* MISSING */
+
+#define CLOCKS_PER_SEC     1000000
+
+extern clock_t   clock(void);
+
+/* BIONIC: extra linux clock goodies */
+extern int clock_getres(int, struct timespec *);
+extern int clock_gettime(int, struct timespec *);
+
+#define CLOCK_REALTIME             0
+#define CLOCK_MONOTONIC            1
+#define CLOCK_PROCESS_CPUTIME_ID   2
+#define CLOCK_THREAD_CPUTIME_ID    3
+#define CLOCK_REALTIME_HR          4
+#define CLOCK_MONOTONIC_HR         5
+
+extern int  timer_create(int, struct sigevent*, timer_t*);
+extern int  timer_delete(timer_t);
+extern int  timer_settime(timer_t timerid, int flags, const struct itimerspec *value, struct itimerspec *ovalue);
+extern int  timer_gettime(timer_t timerid, struct itimerspec *value);
+extern int  timer_getoverrun(timer_t  timerid);
+
+__END_DECLS
+
+#endif /* _TIME_H_ */
diff --git a/ndk/platforms/android-3/include/time64.h b/ndk/platforms/android-3/include/time64.h
new file mode 100644
index 0000000..7ec05af
--- /dev/null
+++ b/ndk/platforms/android-3/include/time64.h
@@ -0,0 +1,59 @@
+/*
+
+Copyright (c) 2007-2008  Michael G Schwern
+
+This software originally derived from Paul Sheer's pivotal_gmtime_r.c.
+
+The MIT License:
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
+Origin: http://code.google.com/p/y2038
+Modified for Bionic by the Android Open Source Project
+
+*/
+#ifndef TIME64_H
+#define TIME64_H
+
+#include <sys/cdefs.h>
+#include <time.h>
+#include <stdint.h>
+
+__BEGIN_DECLS
+
+typedef int64_t  time64_t;
+
+struct tm *gmtime64_r (const time64_t *, struct tm *);
+struct tm *localtime64_r (const time64_t *, struct tm *);
+struct tm *gmtime64 (const time64_t *);
+struct tm *localtime64 (const time64_t *);
+
+char *asctime64 (const struct tm *);
+char *asctime64_r (const struct tm *, char *);
+
+char *ctime64 (const time64_t*);
+char *ctime64_r (const time64_t*, char*);
+
+time64_t timegm64 (const struct tm *);
+time64_t mktime64 (const struct tm *);
+time64_t timelocal64 (const struct tm *);
+
+__END_DECLS
+
+#endif /* TIME64_H */
diff --git a/ndk/platforms/android-3/include/unistd.h b/ndk/platforms/android-3/include/unistd.h
new file mode 100644
index 0000000..6d0515a
--- /dev/null
+++ b/ndk/platforms/android-3/include/unistd.h
@@ -0,0 +1,207 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _UNISTD_H_
+#define _UNISTD_H_
+
+#include <stddef.h>
+#include <sys/cdefs.h>
+#include <sys/types.h>
+#include <sys/select.h>
+#include <sys/sysconf.h>
+#include <linux/capability.h>
+#include <pathconf.h>
+
+__BEGIN_DECLS
+
+/* Standard file descriptor numbers. */
+#define STDIN_FILENO	0
+#define STDOUT_FILENO	1
+#define STDERR_FILENO	2
+
+/* Values for whence in fseek and lseek */
+#define SEEK_SET 0
+#define SEEK_CUR 1
+#define SEEK_END 2
+
+extern char **environ;
+extern __noreturn void _exit(int);
+
+extern pid_t  fork(void);
+extern pid_t  vfork(void);
+extern pid_t  getpid(void);
+extern pid_t  gettid(void);
+extern pid_t  getpgid(pid_t);
+extern int    setpgid(pid_t, pid_t);
+extern pid_t  getppid(void);
+extern pid_t  getpgrp(void);
+extern int    setpgrp(void);
+extern pid_t  setsid(void);
+
+extern int execv(const char *, char * const *);
+extern int execvp(const char *, char * const *);
+extern int execve(const char *, char * const *, char * const *);
+extern int execl(const char *, const char *, ...);
+extern int execlp(const char *, const char *, ...);
+extern int execle(const char *, const char *, ...);
+extern int capget(cap_user_header_t hdrp, cap_user_data_t datap);
+extern int capset(cap_user_header_t hdrp, const cap_user_data_t datap);
+extern int prctl(int  option,  unsigned long arg2, unsigned long arg3,
+                 unsigned long arg4, unsigned long arg5);
+
+extern int nice(int);
+
+extern int setuid(uid_t);
+extern uid_t getuid(void);
+extern int seteuid(uid_t);
+extern uid_t geteuid(void);
+extern int setgid(gid_t);
+extern gid_t getgid(void);
+extern int setegid(gid_t);
+extern gid_t getegid(void);
+extern int getgroups(int, gid_t *);
+extern int setgroups(size_t, const gid_t *);
+extern int setreuid(uid_t, uid_t);
+extern int setregid(gid_t, gid_t);
+extern int setresuid(uid_t, uid_t, uid_t);
+extern int setresgid(gid_t, gid_t, gid_t);
+extern int getresuid(uid_t *ruid, uid_t *euid, uid_t *suid);
+extern int getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid);
+extern int issetugid(void);
+extern char* getlogin(void);
+
+
+/* Macros for access() */
+#define R_OK  4  /* Read */
+#define W_OK  2  /* Write */
+#define X_OK  1  /* Execute */
+#define F_OK  0  /* Existence */
+
+extern int access(const char *, int);
+extern int link(const char *, const char *);
+extern int unlink(const char *);
+extern int chdir(const char *);
+extern int fchdir(int);
+extern int rmdir(const char *);
+extern int pipe(int *);
+extern int chroot(const char *);
+extern int symlink(const char *, const char *);
+extern int readlink(const char *, char *, size_t);
+extern int chown(const char *, uid_t, gid_t);
+extern int fchown(int, uid_t, gid_t);
+extern int lchown(const char *, uid_t, gid_t);
+extern int truncate(const char *, off_t);
+extern char *getcwd(char *, size_t);
+
+extern int sync(void);
+
+extern int close(int);
+extern off_t lseek(int, off_t, int);
+extern loff_t lseek64(int, loff_t, int);
+
+extern ssize_t read(int, void *, size_t);
+extern ssize_t write(int, const void *, size_t);
+extern ssize_t pread(int, void *, size_t, off_t);
+extern ssize_t pwrite(int, void *, size_t, off_t);
+
+extern int dup(int);
+extern int dup2(int, int);
+extern int fcntl(int, int, ...);
+extern int ioctl(int, int, ...);
+extern int flock(int, int);
+extern int fsync(int);
+extern int ftruncate(int, off_t);
+
+extern int pause(void);
+extern unsigned int alarm(unsigned int);
+extern unsigned int sleep(unsigned int);
+extern void usleep(unsigned long);
+
+extern int gethostname(char *, size_t);
+
+extern int getdtablesize(void);
+
+extern void *__brk(void *);
+extern int brk(void *);
+extern void *sbrk(ptrdiff_t);
+
+extern int getopt(int, char * const *, const char *);
+extern char *optarg;
+extern int optind, opterr, optopt;
+
+extern int isatty(int);
+extern char* ttyname(int);
+
+extern int  acct(const char*  filepath);
+
+static __inline__ int getpagesize(void) {
+  extern unsigned int __page_size;
+  return __page_size;
+}
+static __inline__ int __getpageshift(void) {
+  extern unsigned int __page_shift;
+  return __page_shift;
+}
+
+extern int sysconf(int  name);
+
+extern int daemon(int, int);
+
+/* A special syscall that is only available on the ARM, not x86 function. */
+extern int cacheflush(long start, long end, long flags);
+
+extern pid_t tcgetpgrp(int fd);
+extern int   tcsetpgrp(int fd, pid_t _pid);
+
+#if 0 /* MISSING FROM BIONIC */
+extern pid_t  getsid(pid_t);
+extern int execvpe(const char *, char * const *, char * const *);
+extern int execlpe(const char *, const char *, ...);
+extern int getfsuid(uid_t);
+extern int setfsuid(uid_t);
+extern int fdatasync(int);
+extern int getlogin_r(char* name, size_t namesize);
+extern char* getusershell(void);
+extern void setusershell(void);
+extern void endusershell(void);
+extern int sethostname(const char *, size_t);
+extern int getdomainname(char *, size_t);
+extern int setdomainname(const char *, size_t);
+extern int ttyname_r(int, char*, size_t);
+#endif /* MISSING */
+
+/* Used to retry syscalls that can return EINTR. */
+#define TEMP_FAILURE_RETRY(exp) ({         \
+    typeof (exp) _rc;                      \
+    do {                                   \
+        _rc = (exp);                       \
+    } while (_rc == -1 && errno == EINTR); \
+    _rc; })
+
+__END_DECLS
+
+#endif /* _UNISTD_H_ */
diff --git a/tools/zoneinfo/tzdata2009s/MODULE_LICENSE_PUBLIC_DOMAIN b/ndk/platforms/android-3/include/util.h
similarity index 100%
copy from tools/zoneinfo/tzdata2009s/MODULE_LICENSE_PUBLIC_DOMAIN
copy to ndk/platforms/android-3/include/util.h
diff --git a/ndk/platforms/android-3/include/utime.h b/ndk/platforms/android-3/include/utime.h
new file mode 100644
index 0000000..fa7cd2f
--- /dev/null
+++ b/ndk/platforms/android-3/include/utime.h
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _UTIME_H_
+#define _UTIME_H_
+
+#include <sys/cdefs.h>
+#include <sys/types.h>
+#include <linux/utime.h>
+
+__BEGIN_DECLS
+
+extern int  utime(const char *, const struct utimbuf *);
+
+__END_DECLS
+
+#endif /* _UTIME_H_ */
+
diff --git a/ndk/platforms/android-3/include/utmp.h b/ndk/platforms/android-3/include/utmp.h
new file mode 100644
index 0000000..ffd3c92
--- /dev/null
+++ b/ndk/platforms/android-3/include/utmp.h
@@ -0,0 +1,90 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _UTMP_H_
+#define _UTMP_H_
+
+#include <sys/cdefs.h>
+#include <sys/types.h>
+#include <time.h>
+
+#define _PATH_UTMP      "/var/run/utmp"
+#define _PATH_WTMP      "/var/log/wtmp"
+#define _PATH_LASTLOG   "/var/log/lastlog"
+
+#define	UT_NAMESIZE	8
+#define	UT_LINESIZE	8
+#define	UT_HOSTSIZE	16
+
+#define USER_PROCESS 7
+
+struct lastlog
+{
+    time_t ll_time;
+    char ll_line[UT_LINESIZE];
+    char ll_host[UT_HOSTSIZE];
+};
+
+struct exit_status
+{
+    short int e_termination;
+    short int e_exit;
+};
+
+
+struct utmp
+{
+    short int ut_type;
+    pid_t ut_pid;
+    char ut_line[UT_LINESIZE];
+    char ut_id[4];
+    char ut_user[UT_NAMESIZE];
+    char ut_host[UT_HOSTSIZE];
+
+    struct exit_status ut_exit;
+
+    long int ut_session;
+    struct timeval ut_tv;
+
+    int32_t ut_addr_v6[4];
+    char unsed[20];
+};
+
+
+#define ut_name ut_user
+#define ut_time ut_tv.tv_sec
+#define ut_addr ut_addr_v6[0]
+
+__BEGIN_DECLS
+
+int utmpname(const char*);
+void setutent();
+struct utmp* getutent();
+
+__END_DECLS
+
+#endif /* _UTMP_H_ */
diff --git a/ndk/platforms/android-3/include/wchar.h b/ndk/platforms/android-3/include/wchar.h
new file mode 100644
index 0000000..e2feb60
--- /dev/null
+++ b/ndk/platforms/android-3/include/wchar.h
@@ -0,0 +1,155 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _WCHAR_H_
+#define _WCHAR_H_
+
+#include <sys/cdefs.h>
+#include <stdio.h>
+
+/* wchar_t is required in stdlib.h according to POSIX */
+#define __need___wchar_t
+#include <stddef.h>
+
+#include <stdarg.h>
+#include <time.h>
+#include <malloc.h>
+
+#include <stddef.h>
+
+/* IMPORTANT: Any code that relies on wide character support is essentially
+ *            non-portable and/or broken. the only reason this header exist
+ *            is because I'm really a nice guy. However, I'm not nice enough
+ *            to provide you with a real implementation. instead wchar_t == char
+ *            and all wc functions are stubs to their "normal" equivalent...
+ */
+
+__BEGIN_DECLS
+
+typedef int                     wint_t;
+typedef struct { int  dummy; }  mbstate_t;
+
+typedef enum {
+    WC_TYPE_INVALID = 0,
+    WC_TYPE_ALNUM,
+    WC_TYPE_ALPHA,
+    WC_TYPE_BLANK,
+    WC_TYPE_CNTRL,
+    WC_TYPE_DIGIT,
+    WC_TYPE_GRAPH,
+    WC_TYPE_LOWER,
+    WC_TYPE_PRINT,
+    WC_TYPE_PUNCT,
+    WC_TYPE_SPACE,
+    WC_TYPE_UPPER,
+    WC_TYPE_XDIGIT,
+    WC_TYPE_MAX
+} wctype_t;
+
+#define  WCHAR_MAX   255
+#define  WCHAR_MIN   0
+#define  WEOF        (-1)
+
+extern wint_t            btowc(int);
+extern int               fwprintf(FILE *, const wchar_t *, ...);
+extern int               fwscanf(FILE *, const wchar_t *, ...);
+extern int               iswalnum(wint_t);
+extern int               iswalpha(wint_t);
+extern int               iswcntrl(wint_t);
+extern int               iswdigit(wint_t);
+extern int               iswgraph(wint_t);
+extern int               iswlower(wint_t);
+extern int               iswprint(wint_t);
+extern int               iswpunct(wint_t);
+extern int               iswspace(wint_t);
+extern int               iswupper(wint_t);
+extern int               iswxdigit(wint_t);
+extern int               iswctype(wint_t, wctype_t);
+extern wint_t            fgetwc(FILE *);
+extern wchar_t          *fgetws(wchar_t *, int, FILE *);
+extern wint_t            fputwc(wchar_t, FILE *);
+extern int               fputws(const wchar_t *, FILE *);
+extern int               fwide(FILE *, int);
+extern wint_t            getwc(FILE *);
+extern wint_t            getwchar(void);
+extern int               mbsinit(const mbstate_t *);
+extern size_t            mbrlen(const char *, size_t, mbstate_t *);
+extern size_t            mbrtowc(wchar_t *, const char *, size_t, mbstate_t *);
+extern size_t            mbsrtowcs(wchar_t *, const char **, size_t, mbstate_t *);
+extern wint_t            putwc(wchar_t, FILE *);
+extern wint_t            putwchar(wchar_t);
+extern int               swprintf(wchar_t *, size_t, const wchar_t *, ...);
+extern int               swscanf(const wchar_t *, const wchar_t *, ...);
+extern wint_t            towlower(wint_t);
+extern wint_t            towupper(wint_t);
+extern wint_t            ungetwc(wint_t, FILE *);
+extern int               vfwprintf(FILE *, const wchar_t *, va_list);
+extern int               vwprintf(const wchar_t *, va_list);
+extern int               vswprintf(wchar_t *, size_t, const wchar_t *, va_list);
+extern size_t            wcrtomb(char *, wchar_t, mbstate_t *);
+extern wchar_t          *wcscat(wchar_t *, const wchar_t *);
+extern wchar_t          *wcschr(const wchar_t *, wchar_t);
+extern int               wcscmp(const wchar_t *, const wchar_t *);
+extern int               wcscoll(const wchar_t *, const wchar_t *);
+extern wchar_t          *wcscpy(wchar_t *, const wchar_t *);
+extern size_t            wcscspn(const wchar_t *, const wchar_t *);
+extern size_t            wcsftime(wchar_t *, size_t, const wchar_t *, const struct tm *);
+extern size_t            wcslen(const wchar_t *);
+extern wchar_t          *wcsncat(wchar_t *, const wchar_t *, size_t);
+extern int               wcsncmp(const wchar_t *, const wchar_t *, size_t);
+extern wchar_t          *wcsncpy(wchar_t *, const wchar_t *, size_t);
+extern wchar_t          *wcspbrk(const wchar_t *, const wchar_t *);
+extern wchar_t          *wcsrchr(const wchar_t *, wchar_t);
+extern size_t            wcsrtombs(char *, const wchar_t **, size_t, mbstate_t *);
+extern size_t            wcsspn(const wchar_t *, const wchar_t *);
+extern wchar_t          *wcsstr(const wchar_t *, const wchar_t *);
+extern double            wcstod(const wchar_t *, wchar_t **);
+extern wchar_t          *wcstok(wchar_t *, const wchar_t *, wchar_t **);
+extern long int          wcstol(const wchar_t *, wchar_t **, int);
+extern unsigned long int wcstoul(const wchar_t *, wchar_t **, int);
+extern wchar_t          *wcswcs(const wchar_t *, const wchar_t *);
+extern int               wcswidth(const wchar_t *, size_t);
+extern size_t            wcsxfrm(wchar_t *, const wchar_t *, size_t);
+extern int               wctob(wint_t);
+extern wctype_t          wctype(const char *);
+extern int               wcwidth(wchar_t);
+extern wchar_t          *wmemchr(const wchar_t *, wchar_t, size_t);
+extern int               wmemcmp(const wchar_t *, const wchar_t *, size_t);
+extern wchar_t          *wmemcpy(wchar_t *, const wchar_t *, size_t);
+extern wchar_t          *wmemmove(wchar_t *, const wchar_t *, size_t);
+extern wchar_t          *wmemset(wchar_t *, wchar_t, size_t);
+extern int               wprintf(const wchar_t *, ...);
+extern int               wscanf(const wchar_t *, ...);
+
+/* No really supported.  These are just for making libstdc++-v3 happy.  */
+typedef void *wctrans_t;
+extern wint_t		 towctrans(wint_t, wctrans_t);
+extern wctrans_t	 wctrans (const char *);
+
+__END_DECLS
+
+#endif /* _WCHAR_H_ */
diff --git a/ndk/platforms/android-3/include/wctype.h b/ndk/platforms/android-3/include/wctype.h
new file mode 100644
index 0000000..b5f18a0
--- /dev/null
+++ b/ndk/platforms/android-3/include/wctype.h
@@ -0,0 +1 @@
+#include <wchar.h>
diff --git a/ndk/platforms/android-3/include/zconf.h b/ndk/platforms/android-3/include/zconf.h
new file mode 100644
index 0000000..03a9431
--- /dev/null
+++ b/ndk/platforms/android-3/include/zconf.h
@@ -0,0 +1,332 @@
+/* zconf.h -- configuration of the zlib compression library
+ * Copyright (C) 1995-2005 Jean-loup Gailly.
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* @(#) $Id$ */
+
+#ifndef ZCONF_H
+#define ZCONF_H
+
+/*
+ * If you *really* need a unique prefix for all types and library functions,
+ * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
+ */
+#ifdef Z_PREFIX
+#  define deflateInit_          z_deflateInit_
+#  define deflate               z_deflate
+#  define deflateEnd            z_deflateEnd
+#  define inflateInit_          z_inflateInit_
+#  define inflate               z_inflate
+#  define inflateEnd            z_inflateEnd
+#  define deflateInit2_         z_deflateInit2_
+#  define deflateSetDictionary  z_deflateSetDictionary
+#  define deflateCopy           z_deflateCopy
+#  define deflateReset          z_deflateReset
+#  define deflateParams         z_deflateParams
+#  define deflateBound          z_deflateBound
+#  define deflatePrime          z_deflatePrime
+#  define inflateInit2_         z_inflateInit2_
+#  define inflateSetDictionary  z_inflateSetDictionary
+#  define inflateSync           z_inflateSync
+#  define inflateSyncPoint      z_inflateSyncPoint
+#  define inflateCopy           z_inflateCopy
+#  define inflateReset          z_inflateReset
+#  define inflateBack           z_inflateBack
+#  define inflateBackEnd        z_inflateBackEnd
+#  define compress              z_compress
+#  define compress2             z_compress2
+#  define compressBound         z_compressBound
+#  define uncompress            z_uncompress
+#  define adler32               z_adler32
+#  define crc32                 z_crc32
+#  define get_crc_table         z_get_crc_table
+#  define zError                z_zError
+
+#  define alloc_func            z_alloc_func
+#  define free_func             z_free_func
+#  define in_func               z_in_func
+#  define out_func              z_out_func
+#  define Byte                  z_Byte
+#  define uInt                  z_uInt
+#  define uLong                 z_uLong
+#  define Bytef                 z_Bytef
+#  define charf                 z_charf
+#  define intf                  z_intf
+#  define uIntf                 z_uIntf
+#  define uLongf                z_uLongf
+#  define voidpf                z_voidpf
+#  define voidp                 z_voidp
+#endif
+
+#if defined(__MSDOS__) && !defined(MSDOS)
+#  define MSDOS
+#endif
+#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
+#  define OS2
+#endif
+#if defined(_WINDOWS) && !defined(WINDOWS)
+#  define WINDOWS
+#endif
+#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
+#  ifndef WIN32
+#    define WIN32
+#  endif
+#endif
+#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
+#  if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
+#    ifndef SYS16BIT
+#      define SYS16BIT
+#    endif
+#  endif
+#endif
+
+/*
+ * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
+ * than 64k bytes at a time (needed on systems with 16-bit int).
+ */
+#ifdef SYS16BIT
+#  define MAXSEG_64K
+#endif
+#ifdef MSDOS
+#  define UNALIGNED_OK
+#endif
+
+#ifdef __STDC_VERSION__
+#  ifndef STDC
+#    define STDC
+#  endif
+#  if __STDC_VERSION__ >= 199901L
+#    ifndef STDC99
+#      define STDC99
+#    endif
+#  endif
+#endif
+#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
+#  define STDC
+#endif
+#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
+#  define STDC
+#endif
+#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
+#  define STDC
+#endif
+#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
+#  define STDC
+#endif
+
+#if defined(__OS400__) && !defined(STDC)    /* iSeries (formerly AS/400). */
+#  define STDC
+#endif
+
+#ifndef STDC
+#  ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
+#    define const       /* note: need a more gentle solution here */
+#  endif
+#endif
+
+/* Some Mac compilers merge all .h files incorrectly: */
+#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
+#  define NO_DUMMY_DECL
+#endif
+
+/* Maximum value for memLevel in deflateInit2 */
+#ifndef MAX_MEM_LEVEL
+#  ifdef MAXSEG_64K
+#    define MAX_MEM_LEVEL 8
+#  else
+#    define MAX_MEM_LEVEL 9
+#  endif
+#endif
+
+/* Maximum value for windowBits in deflateInit2 and inflateInit2.
+ * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
+ * created by gzip. (Files created by minigzip can still be extracted by
+ * gzip.)
+ */
+#ifndef MAX_WBITS
+#  define MAX_WBITS   15 /* 32K LZ77 window */
+#endif
+
+/* The memory requirements for deflate are (in bytes):
+            (1 << (windowBits+2)) +  (1 << (memLevel+9))
+ that is: 128K for windowBits=15  +  128K for memLevel = 8  (default values)
+ plus a few kilobytes for small objects. For example, if you want to reduce
+ the default memory requirements from 256K to 128K, compile with
+     make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
+ Of course this will generally degrade compression (there's no free lunch).
+
+   The memory requirements for inflate are (in bytes) 1 << windowBits
+ that is, 32K for windowBits=15 (default value) plus a few kilobytes
+ for small objects.
+*/
+
+                        /* Type declarations */
+
+#ifndef OF /* function prototypes */
+#  ifdef STDC
+#    define OF(args)  args
+#  else
+#    define OF(args)  ()
+#  endif
+#endif
+
+/* The following definitions for FAR are needed only for MSDOS mixed
+ * model programming (small or medium model with some far allocations).
+ * This was tested only with MSC; for other MSDOS compilers you may have
+ * to define NO_MEMCPY in zutil.h.  If you don't need the mixed model,
+ * just define FAR to be empty.
+ */
+#ifdef SYS16BIT
+#  if defined(M_I86SM) || defined(M_I86MM)
+     /* MSC small or medium model */
+#    define SMALL_MEDIUM
+#    ifdef _MSC_VER
+#      define FAR _far
+#    else
+#      define FAR far
+#    endif
+#  endif
+#  if (defined(__SMALL__) || defined(__MEDIUM__))
+     /* Turbo C small or medium model */
+#    define SMALL_MEDIUM
+#    ifdef __BORLANDC__
+#      define FAR _far
+#    else
+#      define FAR far
+#    endif
+#  endif
+#endif
+
+#if defined(WINDOWS) || defined(WIN32)
+   /* If building or using zlib as a DLL, define ZLIB_DLL.
+    * This is not mandatory, but it offers a little performance increase.
+    */
+#  ifdef ZLIB_DLL
+#    if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
+#      ifdef ZLIB_INTERNAL
+#        define ZEXTERN extern __declspec(dllexport)
+#      else
+#        define ZEXTERN extern __declspec(dllimport)
+#      endif
+#    endif
+#  endif  /* ZLIB_DLL */
+   /* If building or using zlib with the WINAPI/WINAPIV calling convention,
+    * define ZLIB_WINAPI.
+    * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
+    */
+#  ifdef ZLIB_WINAPI
+#    ifdef FAR
+#      undef FAR
+#    endif
+#    include <windows.h>
+     /* No need for _export, use ZLIB.DEF instead. */
+     /* For complete Windows compatibility, use WINAPI, not __stdcall. */
+#    define ZEXPORT WINAPI
+#    ifdef WIN32
+#      define ZEXPORTVA WINAPIV
+#    else
+#      define ZEXPORTVA FAR CDECL
+#    endif
+#  endif
+#endif
+
+#if defined (__BEOS__)
+#  ifdef ZLIB_DLL
+#    ifdef ZLIB_INTERNAL
+#      define ZEXPORT   __declspec(dllexport)
+#      define ZEXPORTVA __declspec(dllexport)
+#    else
+#      define ZEXPORT   __declspec(dllimport)
+#      define ZEXPORTVA __declspec(dllimport)
+#    endif
+#  endif
+#endif
+
+#ifndef ZEXTERN
+#  define ZEXTERN extern
+#endif
+#ifndef ZEXPORT
+#  define ZEXPORT
+#endif
+#ifndef ZEXPORTVA
+#  define ZEXPORTVA
+#endif
+
+#ifndef FAR
+#  define FAR
+#endif
+
+#if !defined(__MACTYPES__)
+typedef unsigned char  Byte;  /* 8 bits */
+#endif
+typedef unsigned int   uInt;  /* 16 bits or more */
+typedef unsigned long  uLong; /* 32 bits or more */
+
+#ifdef SMALL_MEDIUM
+   /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
+#  define Bytef Byte FAR
+#else
+   typedef Byte  FAR Bytef;
+#endif
+typedef char  FAR charf;
+typedef int   FAR intf;
+typedef uInt  FAR uIntf;
+typedef uLong FAR uLongf;
+
+#ifdef STDC
+   typedef void const *voidpc;
+   typedef void FAR   *voidpf;
+   typedef void       *voidp;
+#else
+   typedef Byte const *voidpc;
+   typedef Byte FAR   *voidpf;
+   typedef Byte       *voidp;
+#endif
+
+#if 0           /* HAVE_UNISTD_H -- this line is updated by ./configure */
+#  include <sys/types.h> /* for off_t */
+#  include <unistd.h>    /* for SEEK_* and off_t */
+#  ifdef VMS
+#    include <unixio.h>   /* for off_t */
+#  endif
+#  define z_off_t off_t
+#endif
+#ifndef SEEK_SET
+#  define SEEK_SET        0       /* Seek from beginning of file.  */
+#  define SEEK_CUR        1       /* Seek from current position.  */
+#  define SEEK_END        2       /* Set file pointer to EOF plus "offset" */
+#endif
+#ifndef z_off_t
+#  define z_off_t long
+#endif
+
+#if defined(__OS400__)
+#  define NO_vsnprintf
+#endif
+
+#if defined(__MVS__)
+#  define NO_vsnprintf
+#  ifdef FAR
+#    undef FAR
+#  endif
+#endif
+
+/* MVS linker does not support external names larger than 8 bytes */
+#if defined(__MVS__)
+#   pragma map(deflateInit_,"DEIN")
+#   pragma map(deflateInit2_,"DEIN2")
+#   pragma map(deflateEnd,"DEEND")
+#   pragma map(deflateBound,"DEBND")
+#   pragma map(inflateInit_,"ININ")
+#   pragma map(inflateInit2_,"ININ2")
+#   pragma map(inflateEnd,"INEND")
+#   pragma map(inflateSync,"INSY")
+#   pragma map(inflateSetDictionary,"INSEDI")
+#   pragma map(compressBound,"CMBND")
+#   pragma map(inflate_table,"INTABL")
+#   pragma map(inflate_fast,"INFA")
+#   pragma map(inflate_copyright,"INCOPY")
+#endif
+
+#endif /* ZCONF_H */
diff --git a/ndk/platforms/android-3/include/zlib.h b/ndk/platforms/android-3/include/zlib.h
new file mode 100644
index 0000000..0228179
--- /dev/null
+++ b/ndk/platforms/android-3/include/zlib.h
@@ -0,0 +1,1357 @@
+/* zlib.h -- interface of the 'zlib' general purpose compression library
+  version 1.2.3, July 18th, 2005
+
+  Copyright (C) 1995-2005 Jean-loup Gailly and Mark Adler
+
+  This software is provided 'as-is', without any express or implied
+  warranty.  In no event will the authors be held liable for any damages
+  arising from the use of this software.
+
+  Permission is granted to anyone to use this software for any purpose,
+  including commercial applications, and to alter it and redistribute it
+  freely, subject to the following restrictions:
+
+  1. The origin of this software must not be misrepresented; you must not
+     claim that you wrote the original software. If you use this software
+     in a product, an acknowledgment in the product documentation would be
+     appreciated but is not required.
+  2. Altered source versions must be plainly marked as such, and must not be
+     misrepresented as being the original software.
+  3. This notice may not be removed or altered from any source distribution.
+
+  Jean-loup Gailly        Mark Adler
+  jloup@gzip.org          madler@alumni.caltech.edu
+
+
+  The data format used by the zlib library is described by RFCs (Request for
+  Comments) 1950 to 1952 in the files http://www.ietf.org/rfc/rfc1950.txt
+  (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format).
+*/
+
+#ifndef ZLIB_H
+#define ZLIB_H
+
+#include "zconf.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define ZLIB_VERSION "1.2.3"
+#define ZLIB_VERNUM 0x1230
+
+/*
+     The 'zlib' compression library provides in-memory compression and
+  decompression functions, including integrity checks of the uncompressed
+  data.  This version of the library supports only one compression method
+  (deflation) but other algorithms will be added later and will have the same
+  stream interface.
+
+     Compression can be done in a single step if the buffers are large
+  enough (for example if an input file is mmap'ed), or can be done by
+  repeated calls of the compression function.  In the latter case, the
+  application must provide more input and/or consume the output
+  (providing more output space) before each call.
+
+     The compressed data format used by default by the in-memory functions is
+  the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped
+  around a deflate stream, which is itself documented in RFC 1951.
+
+     The library also supports reading and writing files in gzip (.gz) format
+  with an interface similar to that of stdio using the functions that start
+  with "gz".  The gzip format is different from the zlib format.  gzip is a
+  gzip wrapper, documented in RFC 1952, wrapped around a deflate stream.
+
+     This library can optionally read and write gzip streams in memory as well.
+
+     The zlib format was designed to be compact and fast for use in memory
+  and on communications channels.  The gzip format was designed for single-
+  file compression on file systems, has a larger header than zlib to maintain
+  directory information, and uses a different, slower check method than zlib.
+
+     The library does not install any signal handler. The decoder checks
+  the consistency of the compressed data, so the library should never
+  crash even in case of corrupted input.
+*/
+
+typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size));
+typedef void   (*free_func)  OF((voidpf opaque, voidpf address));
+
+struct internal_state;
+
+typedef struct z_stream_s {
+    Bytef    *next_in;  /* next input byte */
+    uInt     avail_in;  /* number of bytes available at next_in */
+    uLong    total_in;  /* total nb of input bytes read so far */
+
+    Bytef    *next_out; /* next output byte should be put there */
+    uInt     avail_out; /* remaining free space at next_out */
+    uLong    total_out; /* total nb of bytes output so far */
+
+    char     *msg;      /* last error message, NULL if no error */
+    struct internal_state FAR *state; /* not visible by applications */
+
+    alloc_func zalloc;  /* used to allocate the internal state */
+    free_func  zfree;   /* used to free the internal state */
+    voidpf     opaque;  /* private data object passed to zalloc and zfree */
+
+    int     data_type;  /* best guess about the data type: binary or text */
+    uLong   adler;      /* adler32 value of the uncompressed data */
+    uLong   reserved;   /* reserved for future use */
+} z_stream;
+
+typedef z_stream FAR *z_streamp;
+
+/*
+     gzip header information passed to and from zlib routines.  See RFC 1952
+  for more details on the meanings of these fields.
+*/
+typedef struct gz_header_s {
+    int     text;       /* true if compressed data believed to be text */
+    uLong   time;       /* modification time */
+    int     xflags;     /* extra flags (not used when writing a gzip file) */
+    int     os;         /* operating system */
+    Bytef   *extra;     /* pointer to extra field or Z_NULL if none */
+    uInt    extra_len;  /* extra field length (valid if extra != Z_NULL) */
+    uInt    extra_max;  /* space at extra (only when reading header) */
+    Bytef   *name;      /* pointer to zero-terminated file name or Z_NULL */
+    uInt    name_max;   /* space at name (only when reading header) */
+    Bytef   *comment;   /* pointer to zero-terminated comment or Z_NULL */
+    uInt    comm_max;   /* space at comment (only when reading header) */
+    int     hcrc;       /* true if there was or will be a header crc */
+    int     done;       /* true when done reading gzip header (not used
+                           when writing a gzip file) */
+} gz_header;
+
+typedef gz_header FAR *gz_headerp;
+
+/*
+   The application must update next_in and avail_in when avail_in has
+   dropped to zero. It must update next_out and avail_out when avail_out
+   has dropped to zero. The application must initialize zalloc, zfree and
+   opaque before calling the init function. All other fields are set by the
+   compression library and must not be updated by the application.
+
+   The opaque value provided by the application will be passed as the first
+   parameter for calls of zalloc and zfree. This can be useful for custom
+   memory management. The compression library attaches no meaning to the
+   opaque value.
+
+   zalloc must return Z_NULL if there is not enough memory for the object.
+   If zlib is used in a multi-threaded application, zalloc and zfree must be
+   thread safe.
+
+   On 16-bit systems, the functions zalloc and zfree must be able to allocate
+   exactly 65536 bytes, but will not be required to allocate more than this
+   if the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS,
+   pointers returned by zalloc for objects of exactly 65536 bytes *must*
+   have their offset normalized to zero. The default allocation function
+   provided by this library ensures this (see zutil.c). To reduce memory
+   requirements and avoid any allocation of 64K objects, at the expense of
+   compression ratio, compile the library with -DMAX_WBITS=14 (see zconf.h).
+
+   The fields total_in and total_out can be used for statistics or
+   progress reports. After compression, total_in holds the total size of
+   the uncompressed data and may be saved for use in the decompressor
+   (particularly if the decompressor wants to decompress everything in
+   a single step).
+*/
+
+                        /* constants */
+
+#define Z_NO_FLUSH      0
+#define Z_PARTIAL_FLUSH 1 /* will be removed, use Z_SYNC_FLUSH instead */
+#define Z_SYNC_FLUSH    2
+#define Z_FULL_FLUSH    3
+#define Z_FINISH        4
+#define Z_BLOCK         5
+/* Allowed flush values; see deflate() and inflate() below for details */
+
+#define Z_OK            0
+#define Z_STREAM_END    1
+#define Z_NEED_DICT     2
+#define Z_ERRNO        (-1)
+#define Z_STREAM_ERROR (-2)
+#define Z_DATA_ERROR   (-3)
+#define Z_MEM_ERROR    (-4)
+#define Z_BUF_ERROR    (-5)
+#define Z_VERSION_ERROR (-6)
+/* Return codes for the compression/decompression functions. Negative
+ * values are errors, positive values are used for special but normal events.
+ */
+
+#define Z_NO_COMPRESSION         0
+#define Z_BEST_SPEED             1
+#define Z_BEST_COMPRESSION       9
+#define Z_DEFAULT_COMPRESSION  (-1)
+/* compression levels */
+
+#define Z_FILTERED            1
+#define Z_HUFFMAN_ONLY        2
+#define Z_RLE                 3
+#define Z_FIXED               4
+#define Z_DEFAULT_STRATEGY    0
+/* compression strategy; see deflateInit2() below for details */
+
+#define Z_BINARY   0
+#define Z_TEXT     1
+#define Z_ASCII    Z_TEXT   /* for compatibility with 1.2.2 and earlier */
+#define Z_UNKNOWN  2
+/* Possible values of the data_type field (though see inflate()) */
+
+#define Z_DEFLATED   8
+/* The deflate compression method (the only one supported in this version) */
+
+#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
+
+#define zlib_version zlibVersion()
+/* for compatibility with versions < 1.0.2 */
+
+                        /* basic functions */
+
+ZEXTERN const char * ZEXPORT zlibVersion OF((void));
+/* The application can compare zlibVersion and ZLIB_VERSION for consistency.
+   If the first character differs, the library code actually used is
+   not compatible with the zlib.h header file used by the application.
+   This check is automatically made by deflateInit and inflateInit.
+ */
+
+/*
+ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level));
+
+     Initializes the internal stream state for compression. The fields
+   zalloc, zfree and opaque must be initialized before by the caller.
+   If zalloc and zfree are set to Z_NULL, deflateInit updates them to
+   use default allocation functions.
+
+     The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9:
+   1 gives best speed, 9 gives best compression, 0 gives no compression at
+   all (the input data is simply copied a block at a time).
+   Z_DEFAULT_COMPRESSION requests a default compromise between speed and
+   compression (currently equivalent to level 6).
+
+     deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not
+   enough memory, Z_STREAM_ERROR if level is not a valid compression level,
+   Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible
+   with the version assumed by the caller (ZLIB_VERSION).
+   msg is set to null if there is no error message.  deflateInit does not
+   perform any compression: this will be done by deflate().
+*/
+
+
+ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush));
+/*
+    deflate compresses as much data as possible, and stops when the input
+  buffer becomes empty or the output buffer becomes full. It may introduce some
+  output latency (reading input without producing any output) except when
+  forced to flush.
+
+    The detailed semantics are as follows. deflate performs one or both of the
+  following actions:
+
+  - Compress more input starting at next_in and update next_in and avail_in
+    accordingly. If not all input can be processed (because there is not
+    enough room in the output buffer), next_in and avail_in are updated and
+    processing will resume at this point for the next call of deflate().
+
+  - Provide more output starting at next_out and update next_out and avail_out
+    accordingly. This action is forced if the parameter flush is non zero.
+    Forcing flush frequently degrades the compression ratio, so this parameter
+    should be set only when necessary (in interactive applications).
+    Some output may be provided even if flush is not set.
+
+  Before the call of deflate(), the application should ensure that at least
+  one of the actions is possible, by providing more input and/or consuming
+  more output, and updating avail_in or avail_out accordingly; avail_out
+  should never be zero before the call. The application can consume the
+  compressed output when it wants, for example when the output buffer is full
+  (avail_out == 0), or after each call of deflate(). If deflate returns Z_OK
+  and with zero avail_out, it must be called again after making room in the
+  output buffer because there might be more output pending.
+
+    Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to
+  decide how much data to accumualte before producing output, in order to
+  maximize compression.
+
+    If the parameter flush is set to Z_SYNC_FLUSH, all pending output is
+  flushed to the output buffer and the output is aligned on a byte boundary, so
+  that the decompressor can get all input data available so far. (In particular
+  avail_in is zero after the call if enough output space has been provided
+  before the call.)  Flushing may degrade compression for some compression
+  algorithms and so it should be used only when necessary.
+
+    If flush is set to Z_FULL_FLUSH, all output is flushed as with
+  Z_SYNC_FLUSH, and the compression state is reset so that decompression can
+  restart from this point if previous compressed data has been damaged or if
+  random access is desired. Using Z_FULL_FLUSH too often can seriously degrade
+  compression.
+
+    If deflate returns with avail_out == 0, this function must be called again
+  with the same value of the flush parameter and more output space (updated
+  avail_out), until the flush is complete (deflate returns with non-zero
+  avail_out). In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that
+  avail_out is greater than six to avoid repeated flush markers due to
+  avail_out == 0 on return.
+
+    If the parameter flush is set to Z_FINISH, pending input is processed,
+  pending output is flushed and deflate returns with Z_STREAM_END if there
+  was enough output space; if deflate returns with Z_OK, this function must be
+  called again with Z_FINISH and more output space (updated avail_out) but no
+  more input data, until it returns with Z_STREAM_END or an error. After
+  deflate has returned Z_STREAM_END, the only possible operations on the
+  stream are deflateReset or deflateEnd.
+
+    Z_FINISH can be used immediately after deflateInit if all the compression
+  is to be done in a single step. In this case, avail_out must be at least
+  the value returned by deflateBound (see below). If deflate does not return
+  Z_STREAM_END, then it must be called again as described above.
+
+    deflate() sets strm->adler to the adler32 checksum of all input read
+  so far (that is, total_in bytes).
+
+    deflate() may update strm->data_type if it can make a good guess about
+  the input data type (Z_BINARY or Z_TEXT). In doubt, the data is considered
+  binary. This field is only for information purposes and does not affect
+  the compression algorithm in any manner.
+
+    deflate() returns Z_OK if some progress has been made (more input
+  processed or more output produced), Z_STREAM_END if all input has been
+  consumed and all output has been produced (only when flush is set to
+  Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example
+  if next_in or next_out was NULL), Z_BUF_ERROR if no progress is possible
+  (for example avail_in or avail_out was zero). Note that Z_BUF_ERROR is not
+  fatal, and deflate() can be called again with more input and more output
+  space to continue compressing.
+*/
+
+
+ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm));
+/*
+     All dynamically allocated data structures for this stream are freed.
+   This function discards any unprocessed input and does not flush any
+   pending output.
+
+     deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the
+   stream state was inconsistent, Z_DATA_ERROR if the stream was freed
+   prematurely (some input or output was discarded). In the error case,
+   msg may be set but then points to a static string (which must not be
+   deallocated).
+*/
+
+
+/*
+ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm));
+
+     Initializes the internal stream state for decompression. The fields
+   next_in, avail_in, zalloc, zfree and opaque must be initialized before by
+   the caller. If next_in is not Z_NULL and avail_in is large enough (the exact
+   value depends on the compression method), inflateInit determines the
+   compression method from the zlib header and allocates all data structures
+   accordingly; otherwise the allocation will be deferred to the first call of
+   inflate.  If zalloc and zfree are set to Z_NULL, inflateInit updates them to
+   use default allocation functions.
+
+     inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough
+   memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
+   version assumed by the caller.  msg is set to null if there is no error
+   message. inflateInit does not perform any decompression apart from reading
+   the zlib header if present: this will be done by inflate().  (So next_in and
+   avail_in may be modified, but next_out and avail_out are unchanged.)
+*/
+
+
+ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush));
+/*
+    inflate decompresses as much data as possible, and stops when the input
+  buffer becomes empty or the output buffer becomes full. It may introduce
+  some output latency (reading input without producing any output) except when
+  forced to flush.
+
+  The detailed semantics are as follows. inflate performs one or both of the
+  following actions:
+
+  - Decompress more input starting at next_in and update next_in and avail_in
+    accordingly. If not all input can be processed (because there is not
+    enough room in the output buffer), next_in is updated and processing
+    will resume at this point for the next call of inflate().
+
+  - Provide more output starting at next_out and update next_out and avail_out
+    accordingly.  inflate() provides as much output as possible, until there
+    is no more input data or no more space in the output buffer (see below
+    about the flush parameter).
+
+  Before the call of inflate(), the application should ensure that at least
+  one of the actions is possible, by providing more input and/or consuming
+  more output, and updating the next_* and avail_* values accordingly.
+  The application can consume the uncompressed output when it wants, for
+  example when the output buffer is full (avail_out == 0), or after each
+  call of inflate(). If inflate returns Z_OK and with zero avail_out, it
+  must be called again after making room in the output buffer because there
+  might be more output pending.
+
+    The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH,
+  Z_FINISH, or Z_BLOCK. Z_SYNC_FLUSH requests that inflate() flush as much
+  output as possible to the output buffer. Z_BLOCK requests that inflate() stop
+  if and when it gets to the next deflate block boundary. When decoding the
+  zlib or gzip format, this will cause inflate() to return immediately after
+  the header and before the first block. When doing a raw inflate, inflate()
+  will go ahead and process the first block, and will return when it gets to
+  the end of that block, or when it runs out of data.
+
+    The Z_BLOCK option assists in appending to or combining deflate streams.
+  Also to assist in this, on return inflate() will set strm->data_type to the
+  number of unused bits in the last byte taken from strm->next_in, plus 64
+  if inflate() is currently decoding the last block in the deflate stream,
+  plus 128 if inflate() returned immediately after decoding an end-of-block
+  code or decoding the complete header up to just before the first byte of the
+  deflate stream. The end-of-block will not be indicated until all of the
+  uncompressed data from that block has been written to strm->next_out.  The
+  number of unused bits may in general be greater than seven, except when
+  bit 7 of data_type is set, in which case the number of unused bits will be
+  less than eight.
+
+    inflate() should normally be called until it returns Z_STREAM_END or an
+  error. However if all decompression is to be performed in a single step
+  (a single call of inflate), the parameter flush should be set to
+  Z_FINISH. In this case all pending input is processed and all pending
+  output is flushed; avail_out must be large enough to hold all the
+  uncompressed data. (The size of the uncompressed data may have been saved
+  by the compressor for this purpose.) The next operation on this stream must
+  be inflateEnd to deallocate the decompression state. The use of Z_FINISH
+  is never required, but can be used to inform inflate that a faster approach
+  may be used for the single inflate() call.
+
+     In this implementation, inflate() always flushes as much output as
+  possible to the output buffer, and always uses the faster approach on the
+  first call. So the only effect of the flush parameter in this implementation
+  is on the return value of inflate(), as noted below, or when it returns early
+  because Z_BLOCK is used.
+
+     If a preset dictionary is needed after this call (see inflateSetDictionary
+  below), inflate sets strm->adler to the adler32 checksum of the dictionary
+  chosen by the compressor and returns Z_NEED_DICT; otherwise it sets
+  strm->adler to the adler32 checksum of all output produced so far (that is,
+  total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described
+  below. At the end of the stream, inflate() checks that its computed adler32
+  checksum is equal to that saved by the compressor and returns Z_STREAM_END
+  only if the checksum is correct.
+
+    inflate() will decompress and check either zlib-wrapped or gzip-wrapped
+  deflate data.  The header type is detected automatically.  Any information
+  contained in the gzip header is not retained, so applications that need that
+  information should instead use raw inflate, see inflateInit2() below, or
+  inflateBack() and perform their own processing of the gzip header and
+  trailer.
+
+    inflate() returns Z_OK if some progress has been made (more input processed
+  or more output produced), Z_STREAM_END if the end of the compressed data has
+  been reached and all uncompressed output has been produced, Z_NEED_DICT if a
+  preset dictionary is needed at this point, Z_DATA_ERROR if the input data was
+  corrupted (input stream not conforming to the zlib format or incorrect check
+  value), Z_STREAM_ERROR if the stream structure was inconsistent (for example
+  if next_in or next_out was NULL), Z_MEM_ERROR if there was not enough memory,
+  Z_BUF_ERROR if no progress is possible or if there was not enough room in the
+  output buffer when Z_FINISH is used. Note that Z_BUF_ERROR is not fatal, and
+  inflate() can be called again with more input and more output space to
+  continue decompressing. If Z_DATA_ERROR is returned, the application may then
+  call inflateSync() to look for a good compression block if a partial recovery
+  of the data is desired.
+*/
+
+
+ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm));
+/*
+     All dynamically allocated data structures for this stream are freed.
+   This function discards any unprocessed input and does not flush any
+   pending output.
+
+     inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state
+   was inconsistent. In the error case, msg may be set but then points to a
+   static string (which must not be deallocated).
+*/
+
+                        /* Advanced functions */
+
+/*
+    The following functions are needed only in some special applications.
+*/
+
+/*
+ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,
+                                     int  level,
+                                     int  method,
+                                     int  windowBits,
+                                     int  memLevel,
+                                     int  strategy));
+
+     This is another version of deflateInit with more compression options. The
+   fields next_in, zalloc, zfree and opaque must be initialized before by
+   the caller.
+
+     The method parameter is the compression method. It must be Z_DEFLATED in
+   this version of the library.
+
+     The windowBits parameter is the base two logarithm of the window size
+   (the size of the history buffer). It should be in the range 8..15 for this
+   version of the library. Larger values of this parameter result in better
+   compression at the expense of memory usage. The default value is 15 if
+   deflateInit is used instead.
+
+     windowBits can also be -8..-15 for raw deflate. In this case, -windowBits
+   determines the window size. deflate() will then generate raw deflate data
+   with no zlib header or trailer, and will not compute an adler32 check value.
+
+     windowBits can also be greater than 15 for optional gzip encoding. Add
+   16 to windowBits to write a simple gzip header and trailer around the
+   compressed data instead of a zlib wrapper. The gzip header will have no
+   file name, no extra data, no comment, no modification time (set to zero),
+   no header crc, and the operating system will be set to 255 (unknown).  If a
+   gzip stream is being written, strm->adler is a crc32 instead of an adler32.
+
+     The memLevel parameter specifies how much memory should be allocated
+   for the internal compression state. memLevel=1 uses minimum memory but
+   is slow and reduces compression ratio; memLevel=9 uses maximum memory
+   for optimal speed. The default value is 8. See zconf.h for total memory
+   usage as a function of windowBits and memLevel.
+
+     The strategy parameter is used to tune the compression algorithm. Use the
+   value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a
+   filter (or predictor), Z_HUFFMAN_ONLY to force Huffman encoding only (no
+   string match), or Z_RLE to limit match distances to one (run-length
+   encoding). Filtered data consists mostly of small values with a somewhat
+   random distribution. In this case, the compression algorithm is tuned to
+   compress them better. The effect of Z_FILTERED is to force more Huffman
+   coding and less string matching; it is somewhat intermediate between
+   Z_DEFAULT and Z_HUFFMAN_ONLY. Z_RLE is designed to be almost as fast as
+   Z_HUFFMAN_ONLY, but give better compression for PNG image data. The strategy
+   parameter only affects the compression ratio but not the correctness of the
+   compressed output even if it is not set appropriately.  Z_FIXED prevents the
+   use of dynamic Huffman codes, allowing for a simpler decoder for special
+   applications.
+
+      deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
+   memory, Z_STREAM_ERROR if a parameter is invalid (such as an invalid
+   method). msg is set to null if there is no error message.  deflateInit2 does
+   not perform any compression: this will be done by deflate().
+*/
+
+ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm,
+                                             const Bytef *dictionary,
+                                             uInt  dictLength));
+/*
+     Initializes the compression dictionary from the given byte sequence
+   without producing any compressed output. This function must be called
+   immediately after deflateInit, deflateInit2 or deflateReset, before any
+   call of deflate. The compressor and decompressor must use exactly the same
+   dictionary (see inflateSetDictionary).
+
+     The dictionary should consist of strings (byte sequences) that are likely
+   to be encountered later in the data to be compressed, with the most commonly
+   used strings preferably put towards the end of the dictionary. Using a
+   dictionary is most useful when the data to be compressed is short and can be
+   predicted with good accuracy; the data can then be compressed better than
+   with the default empty dictionary.
+
+     Depending on the size of the compression data structures selected by
+   deflateInit or deflateInit2, a part of the dictionary may in effect be
+   discarded, for example if the dictionary is larger than the window size in
+   deflate or deflate2. Thus the strings most likely to be useful should be
+   put at the end of the dictionary, not at the front. In addition, the
+   current implementation of deflate will use at most the window size minus
+   262 bytes of the provided dictionary.
+
+     Upon return of this function, strm->adler is set to the adler32 value
+   of the dictionary; the decompressor may later use this value to determine
+   which dictionary has been used by the compressor. (The adler32 value
+   applies to the whole dictionary even if only a subset of the dictionary is
+   actually used by the compressor.) If a raw deflate was requested, then the
+   adler32 value is not computed and strm->adler is not set.
+
+     deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a
+   parameter is invalid (such as NULL dictionary) or the stream state is
+   inconsistent (for example if deflate has already been called for this stream
+   or if the compression method is bsort). deflateSetDictionary does not
+   perform any compression: this will be done by deflate().
+*/
+
+ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest,
+                                    z_streamp source));
+/*
+     Sets the destination stream as a complete copy of the source stream.
+
+     This function can be useful when several compression strategies will be
+   tried, for example when there are several ways of pre-processing the input
+   data with a filter. The streams that will be discarded should then be freed
+   by calling deflateEnd.  Note that deflateCopy duplicates the internal
+   compression state which can be quite large, so this strategy is slow and
+   can consume lots of memory.
+
+     deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not
+   enough memory, Z_STREAM_ERROR if the source stream state was inconsistent
+   (such as zalloc being NULL). msg is left unchanged in both source and
+   destination.
+*/
+
+ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm));
+/*
+     This function is equivalent to deflateEnd followed by deflateInit,
+   but does not free and reallocate all the internal compression state.
+   The stream will keep the same compression level and any other attributes
+   that may have been set by deflateInit2.
+
+      deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
+   stream state was inconsistent (such as zalloc or state being NULL).
+*/
+
+ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm,
+                                      int level,
+                                      int strategy));
+/*
+     Dynamically update the compression level and compression strategy.  The
+   interpretation of level and strategy is as in deflateInit2.  This can be
+   used to switch between compression and straight copy of the input data, or
+   to switch to a different kind of input data requiring a different
+   strategy. If the compression level is changed, the input available so far
+   is compressed with the old level (and may be flushed); the new level will
+   take effect only at the next call of deflate().
+
+     Before the call of deflateParams, the stream state must be set as for
+   a call of deflate(), since the currently available input may have to
+   be compressed and flushed. In particular, strm->avail_out must be non-zero.
+
+     deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source
+   stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR
+   if strm->avail_out was zero.
+*/
+
+ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm,
+                                    int good_length,
+                                    int max_lazy,
+                                    int nice_length,
+                                    int max_chain));
+/*
+     Fine tune deflate's internal compression parameters.  This should only be
+   used by someone who understands the algorithm used by zlib's deflate for
+   searching for the best matching string, and even then only by the most
+   fanatic optimizer trying to squeeze out the last compressed bit for their
+   specific input data.  Read the deflate.c source code for the meaning of the
+   max_lazy, good_length, nice_length, and max_chain parameters.
+
+     deflateTune() can be called after deflateInit() or deflateInit2(), and
+   returns Z_OK on success, or Z_STREAM_ERROR for an invalid deflate stream.
+ */
+
+ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm,
+                                       uLong sourceLen));
+/*
+     deflateBound() returns an upper bound on the compressed size after
+   deflation of sourceLen bytes.  It must be called after deflateInit()
+   or deflateInit2().  This would be used to allocate an output buffer
+   for deflation in a single pass, and so would be called before deflate().
+*/
+
+ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm,
+                                     int bits,
+                                     int value));
+/*
+     deflatePrime() inserts bits in the deflate output stream.  The intent
+  is that this function is used to start off the deflate output with the
+  bits leftover from a previous deflate stream when appending to it.  As such,
+  this function can only be used for raw deflate, and must be used before the
+  first deflate() call after a deflateInit2() or deflateReset().  bits must be
+  less than or equal to 16, and that many of the least significant bits of
+  value will be inserted in the output.
+
+      deflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source
+   stream state was inconsistent.
+*/
+
+ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm,
+                                         gz_headerp head));
+/*
+      deflateSetHeader() provides gzip header information for when a gzip
+   stream is requested by deflateInit2().  deflateSetHeader() may be called
+   after deflateInit2() or deflateReset() and before the first call of
+   deflate().  The text, time, os, extra field, name, and comment information
+   in the provided gz_header structure are written to the gzip header (xflag is
+   ignored -- the extra flags are set according to the compression level).  The
+   caller must assure that, if not Z_NULL, name and comment are terminated with
+   a zero byte, and that if extra is not Z_NULL, that extra_len bytes are
+   available there.  If hcrc is true, a gzip header crc is included.  Note that
+   the current versions of the command-line version of gzip (up through version
+   1.3.x) do not support header crc's, and will report that it is a "multi-part
+   gzip file" and give up.
+
+      If deflateSetHeader is not used, the default gzip header has text false,
+   the time set to zero, and os set to 255, with no extra, name, or comment
+   fields.  The gzip header is returned to the default state by deflateReset().
+
+      deflateSetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source
+   stream state was inconsistent.
+*/
+
+/*
+ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm,
+                                     int  windowBits));
+
+     This is another version of inflateInit with an extra parameter. The
+   fields next_in, avail_in, zalloc, zfree and opaque must be initialized
+   before by the caller.
+
+     The windowBits parameter is the base two logarithm of the maximum window
+   size (the size of the history buffer).  It should be in the range 8..15 for
+   this version of the library. The default value is 15 if inflateInit is used
+   instead. windowBits must be greater than or equal to the windowBits value
+   provided to deflateInit2() while compressing, or it must be equal to 15 if
+   deflateInit2() was not used. If a compressed stream with a larger window
+   size is given as input, inflate() will return with the error code
+   Z_DATA_ERROR instead of trying to allocate a larger window.
+
+     windowBits can also be -8..-15 for raw inflate. In this case, -windowBits
+   determines the window size. inflate() will then process raw deflate data,
+   not looking for a zlib or gzip header, not generating a check value, and not
+   looking for any check values for comparison at the end of the stream. This
+   is for use with other formats that use the deflate compressed data format
+   such as zip.  Those formats provide their own check values. If a custom
+   format is developed using the raw deflate format for compressed data, it is
+   recommended that a check value such as an adler32 or a crc32 be applied to
+   the uncompressed data as is done in the zlib, gzip, and zip formats.  For
+   most applications, the zlib format should be used as is. Note that comments
+   above on the use in deflateInit2() applies to the magnitude of windowBits.
+
+     windowBits can also be greater than 15 for optional gzip decoding. Add
+   32 to windowBits to enable zlib and gzip decoding with automatic header
+   detection, or add 16 to decode only the gzip format (the zlib format will
+   return a Z_DATA_ERROR).  If a gzip stream is being decoded, strm->adler is
+   a crc32 instead of an adler32.
+
+     inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
+   memory, Z_STREAM_ERROR if a parameter is invalid (such as a null strm). msg
+   is set to null if there is no error message.  inflateInit2 does not perform
+   any decompression apart from reading the zlib header if present: this will
+   be done by inflate(). (So next_in and avail_in may be modified, but next_out
+   and avail_out are unchanged.)
+*/
+
+ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm,
+                                             const Bytef *dictionary,
+                                             uInt  dictLength));
+/*
+     Initializes the decompression dictionary from the given uncompressed byte
+   sequence. This function must be called immediately after a call of inflate,
+   if that call returned Z_NEED_DICT. The dictionary chosen by the compressor
+   can be determined from the adler32 value returned by that call of inflate.
+   The compressor and decompressor must use exactly the same dictionary (see
+   deflateSetDictionary).  For raw inflate, this function can be called
+   immediately after inflateInit2() or inflateReset() and before any call of
+   inflate() to set the dictionary.  The application must insure that the
+   dictionary that was used for compression is provided.
+
+     inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a
+   parameter is invalid (such as NULL dictionary) or the stream state is
+   inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the
+   expected one (incorrect adler32 value). inflateSetDictionary does not
+   perform any decompression: this will be done by subsequent calls of
+   inflate().
+*/
+
+ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm));
+/*
+    Skips invalid compressed data until a full flush point (see above the
+  description of deflate with Z_FULL_FLUSH) can be found, or until all
+  available input is skipped. No output is provided.
+
+    inflateSync returns Z_OK if a full flush point has been found, Z_BUF_ERROR
+  if no more input was provided, Z_DATA_ERROR if no flush point has been found,
+  or Z_STREAM_ERROR if the stream structure was inconsistent. In the success
+  case, the application may save the current current value of total_in which
+  indicates where valid compressed data was found. In the error case, the
+  application may repeatedly call inflateSync, providing more input each time,
+  until success or end of the input data.
+*/
+
+ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest,
+                                    z_streamp source));
+/*
+     Sets the destination stream as a complete copy of the source stream.
+
+     This function can be useful when randomly accessing a large stream.  The
+   first pass through the stream can periodically record the inflate state,
+   allowing restarting inflate at those points when randomly accessing the
+   stream.
+
+     inflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not
+   enough memory, Z_STREAM_ERROR if the source stream state was inconsistent
+   (such as zalloc being NULL). msg is left unchanged in both source and
+   destination.
+*/
+
+ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm));
+/*
+     This function is equivalent to inflateEnd followed by inflateInit,
+   but does not free and reallocate all the internal decompression state.
+   The stream will keep attributes that may have been set by inflateInit2.
+
+      inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
+   stream state was inconsistent (such as zalloc or state being NULL).
+*/
+
+ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm,
+                                     int bits,
+                                     int value));
+/*
+     This function inserts bits in the inflate input stream.  The intent is
+  that this function is used to start inflating at a bit position in the
+  middle of a byte.  The provided bits will be used before any bytes are used
+  from next_in.  This function should only be used with raw inflate, and
+  should be used before the first inflate() call after inflateInit2() or
+  inflateReset().  bits must be less than or equal to 16, and that many of the
+  least significant bits of value will be inserted in the input.
+
+      inflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source
+   stream state was inconsistent.
+*/
+
+ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm,
+                                         gz_headerp head));
+/*
+      inflateGetHeader() requests that gzip header information be stored in the
+   provided gz_header structure.  inflateGetHeader() may be called after
+   inflateInit2() or inflateReset(), and before the first call of inflate().
+   As inflate() processes the gzip stream, head->done is zero until the header
+   is completed, at which time head->done is set to one.  If a zlib stream is
+   being decoded, then head->done is set to -1 to indicate that there will be
+   no gzip header information forthcoming.  Note that Z_BLOCK can be used to
+   force inflate() to return immediately after header processing is complete
+   and before any actual data is decompressed.
+
+      The text, time, xflags, and os fields are filled in with the gzip header
+   contents.  hcrc is set to true if there is a header CRC.  (The header CRC
+   was valid if done is set to one.)  If extra is not Z_NULL, then extra_max
+   contains the maximum number of bytes to write to extra.  Once done is true,
+   extra_len contains the actual extra field length, and extra contains the
+   extra field, or that field truncated if extra_max is less than extra_len.
+   If name is not Z_NULL, then up to name_max characters are written there,
+   terminated with a zero unless the length is greater than name_max.  If
+   comment is not Z_NULL, then up to comm_max characters are written there,
+   terminated with a zero unless the length is greater than comm_max.  When
+   any of extra, name, or comment are not Z_NULL and the respective field is
+   not present in the header, then that field is set to Z_NULL to signal its
+   absence.  This allows the use of deflateSetHeader() with the returned
+   structure to duplicate the header.  However if those fields are set to
+   allocated memory, then the application will need to save those pointers
+   elsewhere so that they can be eventually freed.
+
+      If inflateGetHeader is not used, then the header information is simply
+   discarded.  The header is always checked for validity, including the header
+   CRC if present.  inflateReset() will reset the process to discard the header
+   information.  The application would need to call inflateGetHeader() again to
+   retrieve the header from the next gzip stream.
+
+      inflateGetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source
+   stream state was inconsistent.
+*/
+
+/*
+ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits,
+                                        unsigned char FAR *window));
+
+     Initialize the internal stream state for decompression using inflateBack()
+   calls.  The fields zalloc, zfree and opaque in strm must be initialized
+   before the call.  If zalloc and zfree are Z_NULL, then the default library-
+   derived memory allocation routines are used.  windowBits is the base two
+   logarithm of the window size, in the range 8..15.  window is a caller
+   supplied buffer of that size.  Except for special applications where it is
+   assured that deflate was used with small window sizes, windowBits must be 15
+   and a 32K byte window must be supplied to be able to decompress general
+   deflate streams.
+
+     See inflateBack() for the usage of these routines.
+
+     inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of
+   the paramaters are invalid, Z_MEM_ERROR if the internal state could not
+   be allocated, or Z_VERSION_ERROR if the version of the library does not
+   match the version of the header file.
+*/
+
+typedef unsigned (*in_func) OF((void FAR *, unsigned char FAR * FAR *));
+typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned));
+
+ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm,
+                                    in_func in, void FAR *in_desc,
+                                    out_func out, void FAR *out_desc));
+/*
+     inflateBack() does a raw inflate with a single call using a call-back
+   interface for input and output.  This is more efficient than inflate() for
+   file i/o applications in that it avoids copying between the output and the
+   sliding window by simply making the window itself the output buffer.  This
+   function trusts the application to not change the output buffer passed by
+   the output function, at least until inflateBack() returns.
+
+     inflateBackInit() must be called first to allocate the internal state
+   and to initialize the state with the user-provided window buffer.
+   inflateBack() may then be used multiple times to inflate a complete, raw
+   deflate stream with each call.  inflateBackEnd() is then called to free
+   the allocated state.
+
+     A raw deflate stream is one with no zlib or gzip header or trailer.
+   This routine would normally be used in a utility that reads zip or gzip
+   files and writes out uncompressed files.  The utility would decode the
+   header and process the trailer on its own, hence this routine expects
+   only the raw deflate stream to decompress.  This is different from the
+   normal behavior of inflate(), which expects either a zlib or gzip header and
+   trailer around the deflate stream.
+
+     inflateBack() uses two subroutines supplied by the caller that are then
+   called by inflateBack() for input and output.  inflateBack() calls those
+   routines until it reads a complete deflate stream and writes out all of the
+   uncompressed data, or until it encounters an error.  The function's
+   parameters and return types are defined above in the in_func and out_func
+   typedefs.  inflateBack() will call in(in_desc, &buf) which should return the
+   number of bytes of provided input, and a pointer to that input in buf.  If
+   there is no input available, in() must return zero--buf is ignored in that
+   case--and inflateBack() will return a buffer error.  inflateBack() will call
+   out(out_desc, buf, len) to write the uncompressed data buf[0..len-1].  out()
+   should return zero on success, or non-zero on failure.  If out() returns
+   non-zero, inflateBack() will return with an error.  Neither in() nor out()
+   are permitted to change the contents of the window provided to
+   inflateBackInit(), which is also the buffer that out() uses to write from.
+   The length written by out() will be at most the window size.  Any non-zero
+   amount of input may be provided by in().
+
+     For convenience, inflateBack() can be provided input on the first call by
+   setting strm->next_in and strm->avail_in.  If that input is exhausted, then
+   in() will be called.  Therefore strm->next_in must be initialized before
+   calling inflateBack().  If strm->next_in is Z_NULL, then in() will be called
+   immediately for input.  If strm->next_in is not Z_NULL, then strm->avail_in
+   must also be initialized, and then if strm->avail_in is not zero, input will
+   initially be taken from strm->next_in[0 .. strm->avail_in - 1].
+
+     The in_desc and out_desc parameters of inflateBack() is passed as the
+   first parameter of in() and out() respectively when they are called.  These
+   descriptors can be optionally used to pass any information that the caller-
+   supplied in() and out() functions need to do their job.
+
+     On return, inflateBack() will set strm->next_in and strm->avail_in to
+   pass back any unused input that was provided by the last in() call.  The
+   return values of inflateBack() can be Z_STREAM_END on success, Z_BUF_ERROR
+   if in() or out() returned an error, Z_DATA_ERROR if there was a format
+   error in the deflate stream (in which case strm->msg is set to indicate the
+   nature of the error), or Z_STREAM_ERROR if the stream was not properly
+   initialized.  In the case of Z_BUF_ERROR, an input or output error can be
+   distinguished using strm->next_in which will be Z_NULL only if in() returned
+   an error.  If strm->next is not Z_NULL, then the Z_BUF_ERROR was due to
+   out() returning non-zero.  (in() will always be called before out(), so
+   strm->next_in is assured to be defined if out() returns non-zero.)  Note
+   that inflateBack() cannot return Z_OK.
+*/
+
+ZEXTERN int ZEXPORT inflateBackEnd OF((z_streamp strm));
+/*
+     All memory allocated by inflateBackInit() is freed.
+
+     inflateBackEnd() returns Z_OK on success, or Z_STREAM_ERROR if the stream
+   state was inconsistent.
+*/
+
+ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void));
+/* Return flags indicating compile-time options.
+
+    Type sizes, two bits each, 00 = 16 bits, 01 = 32, 10 = 64, 11 = other:
+     1.0: size of uInt
+     3.2: size of uLong
+     5.4: size of voidpf (pointer)
+     7.6: size of z_off_t
+
+    Compiler, assembler, and debug options:
+     8: DEBUG
+     9: ASMV or ASMINF -- use ASM code
+     10: ZLIB_WINAPI -- exported functions use the WINAPI calling convention
+     11: 0 (reserved)
+
+    One-time table building (smaller code, but not thread-safe if true):
+     12: BUILDFIXED -- build static block decoding tables when needed
+     13: DYNAMIC_CRC_TABLE -- build CRC calculation tables when needed
+     14,15: 0 (reserved)
+
+    Library content (indicates missing functionality):
+     16: NO_GZCOMPRESS -- gz* functions cannot compress (to avoid linking
+                          deflate code when not needed)
+     17: NO_GZIP -- deflate can't write gzip streams, and inflate can't detect
+                    and decode gzip streams (to avoid linking crc code)
+     18-19: 0 (reserved)
+
+    Operation variations (changes in library functionality):
+     20: PKZIP_BUG_WORKAROUND -- slightly more permissive inflate
+     21: FASTEST -- deflate algorithm with only one, lowest compression level
+     22,23: 0 (reserved)
+
+    The sprintf variant used by gzprintf (zero is best):
+     24: 0 = vs*, 1 = s* -- 1 means limited to 20 arguments after the format
+     25: 0 = *nprintf, 1 = *printf -- 1 means gzprintf() not secure!
+     26: 0 = returns value, 1 = void -- 1 means inferred string length returned
+
+    Remainder:
+     27-31: 0 (reserved)
+ */
+
+
+                        /* utility functions */
+
+/*
+     The following utility functions are implemented on top of the
+   basic stream-oriented functions. To simplify the interface, some
+   default options are assumed (compression level and memory usage,
+   standard memory allocation functions). The source code of these
+   utility functions can easily be modified if you need special options.
+*/
+
+ZEXTERN int ZEXPORT compress OF((Bytef *dest,   uLongf *destLen,
+                                 const Bytef *source, uLong sourceLen));
+/*
+     Compresses the source buffer into the destination buffer.  sourceLen is
+   the byte length of the source buffer. Upon entry, destLen is the total
+   size of the destination buffer, which must be at least the value returned
+   by compressBound(sourceLen). Upon exit, destLen is the actual size of the
+   compressed buffer.
+     This function can be used to compress a whole file at once if the
+   input file is mmap'ed.
+     compress returns Z_OK if success, Z_MEM_ERROR if there was not
+   enough memory, Z_BUF_ERROR if there was not enough room in the output
+   buffer.
+*/
+
+ZEXTERN int ZEXPORT compress2 OF((Bytef *dest,   uLongf *destLen,
+                                  const Bytef *source, uLong sourceLen,
+                                  int level));
+/*
+     Compresses the source buffer into the destination buffer. The level
+   parameter has the same meaning as in deflateInit.  sourceLen is the byte
+   length of the source buffer. Upon entry, destLen is the total size of the
+   destination buffer, which must be at least the value returned by
+   compressBound(sourceLen). Upon exit, destLen is the actual size of the
+   compressed buffer.
+
+     compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
+   memory, Z_BUF_ERROR if there was not enough room in the output buffer,
+   Z_STREAM_ERROR if the level parameter is invalid.
+*/
+
+ZEXTERN uLong ZEXPORT compressBound OF((uLong sourceLen));
+/*
+     compressBound() returns an upper bound on the compressed size after
+   compress() or compress2() on sourceLen bytes.  It would be used before
+   a compress() or compress2() call to allocate the destination buffer.
+*/
+
+ZEXTERN int ZEXPORT uncompress OF((Bytef *dest,   uLongf *destLen,
+                                   const Bytef *source, uLong sourceLen));
+/*
+     Decompresses the source buffer into the destination buffer.  sourceLen is
+   the byte length of the source buffer. Upon entry, destLen is the total
+   size of the destination buffer, which must be large enough to hold the
+   entire uncompressed data. (The size of the uncompressed data must have
+   been saved previously by the compressor and transmitted to the decompressor
+   by some mechanism outside the scope of this compression library.)
+   Upon exit, destLen is the actual size of the compressed buffer.
+     This function can be used to decompress a whole file at once if the
+   input file is mmap'ed.
+
+     uncompress returns Z_OK if success, Z_MEM_ERROR if there was not
+   enough memory, Z_BUF_ERROR if there was not enough room in the output
+   buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete.
+*/
+
+
+typedef voidp gzFile;
+
+ZEXTERN gzFile ZEXPORT gzopen  OF((const char *path, const char *mode));
+/*
+     Opens a gzip (.gz) file for reading or writing. The mode parameter
+   is as in fopen ("rb" or "wb") but can also include a compression level
+   ("wb9") or a strategy: 'f' for filtered data as in "wb6f", 'h' for
+   Huffman only compression as in "wb1h", or 'R' for run-length encoding
+   as in "wb1R". (See the description of deflateInit2 for more information
+   about the strategy parameter.)
+
+     gzopen can be used to read a file which is not in gzip format; in this
+   case gzread will directly read from the file without decompression.
+
+     gzopen returns NULL if the file could not be opened or if there was
+   insufficient memory to allocate the (de)compression state; errno
+   can be checked to distinguish the two cases (if errno is zero, the
+   zlib error is Z_MEM_ERROR).  */
+
+ZEXTERN gzFile ZEXPORT gzdopen  OF((int fd, const char *mode));
+/*
+     gzdopen() associates a gzFile with the file descriptor fd.  File
+   descriptors are obtained from calls like open, dup, creat, pipe or
+   fileno (in the file has been previously opened with fopen).
+   The mode parameter is as in gzopen.
+     The next call of gzclose on the returned gzFile will also close the
+   file descriptor fd, just like fclose(fdopen(fd), mode) closes the file
+   descriptor fd. If you want to keep fd open, use gzdopen(dup(fd), mode).
+     gzdopen returns NULL if there was insufficient memory to allocate
+   the (de)compression state.
+*/
+
+ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));
+/*
+     Dynamically update the compression level or strategy. See the description
+   of deflateInit2 for the meaning of these parameters.
+     gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not
+   opened for writing.
+*/
+
+ZEXTERN int ZEXPORT    gzread  OF((gzFile file, voidp buf, unsigned len));
+/*
+     Reads the given number of uncompressed bytes from the compressed file.
+   If the input file was not in gzip format, gzread copies the given number
+   of bytes into the buffer.
+     gzread returns the number of uncompressed bytes actually read (0 for
+   end of file, -1 for error). */
+
+ZEXTERN int ZEXPORT    gzwrite OF((gzFile file,
+                                   voidpc buf, unsigned len));
+/*
+     Writes the given number of uncompressed bytes into the compressed file.
+   gzwrite returns the number of uncompressed bytes actually written
+   (0 in case of error).
+*/
+
+ZEXTERN int ZEXPORTVA   gzprintf OF((gzFile file, const char *format, ...));
+/*
+     Converts, formats, and writes the args to the compressed file under
+   control of the format string, as in fprintf. gzprintf returns the number of
+   uncompressed bytes actually written (0 in case of error).  The number of
+   uncompressed bytes written is limited to 4095. The caller should assure that
+   this limit is not exceeded. If it is exceeded, then gzprintf() will return
+   return an error (0) with nothing written. In this case, there may also be a
+   buffer overflow with unpredictable consequences, which is possible only if
+   zlib was compiled with the insecure functions sprintf() or vsprintf()
+   because the secure snprintf() or vsnprintf() functions were not available.
+*/
+
+ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s));
+/*
+      Writes the given null-terminated string to the compressed file, excluding
+   the terminating null character.
+      gzputs returns the number of characters written, or -1 in case of error.
+*/
+
+ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));
+/*
+      Reads bytes from the compressed file until len-1 characters are read, or
+   a newline character is read and transferred to buf, or an end-of-file
+   condition is encountered.  The string is then terminated with a null
+   character.
+      gzgets returns buf, or Z_NULL in case of error.
+*/
+
+ZEXTERN int ZEXPORT    gzputc OF((gzFile file, int c));
+/*
+      Writes c, converted to an unsigned char, into the compressed file.
+   gzputc returns the value that was written, or -1 in case of error.
+*/
+
+ZEXTERN int ZEXPORT    gzgetc OF((gzFile file));
+/*
+      Reads one byte from the compressed file. gzgetc returns this byte
+   or -1 in case of end of file or error.
+*/
+
+ZEXTERN int ZEXPORT    gzungetc OF((int c, gzFile file));
+/*
+      Push one character back onto the stream to be read again later.
+   Only one character of push-back is allowed.  gzungetc() returns the
+   character pushed, or -1 on failure.  gzungetc() will fail if a
+   character has been pushed but not read yet, or if c is -1. The pushed
+   character will be discarded if the stream is repositioned with gzseek()
+   or gzrewind().
+*/
+
+ZEXTERN int ZEXPORT    gzflush OF((gzFile file, int flush));
+/*
+     Flushes all pending output into the compressed file. The parameter
+   flush is as in the deflate() function. The return value is the zlib
+   error number (see function gzerror below). gzflush returns Z_OK if
+   the flush parameter is Z_FINISH and all output could be flushed.
+     gzflush should be called only when strictly necessary because it can
+   degrade compression.
+*/
+
+ZEXTERN z_off_t ZEXPORT    gzseek OF((gzFile file,
+                                      z_off_t offset, int whence));
+/*
+      Sets the starting position for the next gzread or gzwrite on the
+   given compressed file. The offset represents a number of bytes in the
+   uncompressed data stream. The whence parameter is defined as in lseek(2);
+   the value SEEK_END is not supported.
+     If the file is opened for reading, this function is emulated but can be
+   extremely slow. If the file is opened for writing, only forward seeks are
+   supported; gzseek then compresses a sequence of zeroes up to the new
+   starting position.
+
+      gzseek returns the resulting offset location as measured in bytes from
+   the beginning of the uncompressed stream, or -1 in case of error, in
+   particular if the file is opened for writing and the new starting position
+   would be before the current position.
+*/
+
+ZEXTERN int ZEXPORT    gzrewind OF((gzFile file));
+/*
+     Rewinds the given file. This function is supported only for reading.
+
+   gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET)
+*/
+
+ZEXTERN z_off_t ZEXPORT    gztell OF((gzFile file));
+/*
+     Returns the starting position for the next gzread or gzwrite on the
+   given compressed file. This position represents a number of bytes in the
+   uncompressed data stream.
+
+   gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR)
+*/
+
+ZEXTERN int ZEXPORT gzeof OF((gzFile file));
+/*
+     Returns 1 when EOF has previously been detected reading the given
+   input stream, otherwise zero.
+*/
+
+ZEXTERN int ZEXPORT gzdirect OF((gzFile file));
+/*
+     Returns 1 if file is being read directly without decompression, otherwise
+   zero.
+*/
+
+ZEXTERN int ZEXPORT    gzclose OF((gzFile file));
+/*
+     Flushes all pending output if necessary, closes the compressed file
+   and deallocates all the (de)compression state. The return value is the zlib
+   error number (see function gzerror below).
+*/
+
+ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
+/*
+     Returns the error message for the last error which occurred on the
+   given compressed file. errnum is set to zlib error number. If an
+   error occurred in the file system and not in the compression library,
+   errnum is set to Z_ERRNO and the application may consult errno
+   to get the exact error code.
+*/
+
+ZEXTERN void ZEXPORT gzclearerr OF((gzFile file));
+/*
+     Clears the error and end-of-file flags for file. This is analogous to the
+   clearerr() function in stdio. This is useful for continuing to read a gzip
+   file that is being written concurrently.
+*/
+
+                        /* checksum functions */
+
+/*
+     These functions are not related to compression but are exported
+   anyway because they might be useful in applications using the
+   compression library.
+*/
+
+ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len));
+/*
+     Update a running Adler-32 checksum with the bytes buf[0..len-1] and
+   return the updated checksum. If buf is NULL, this function returns
+   the required initial value for the checksum.
+   An Adler-32 checksum is almost as reliable as a CRC32 but can be computed
+   much faster. Usage example:
+
+     uLong adler = adler32(0L, Z_NULL, 0);
+
+     while (read_buffer(buffer, length) != EOF) {
+       adler = adler32(adler, buffer, length);
+     }
+     if (adler != original_adler) error();
+*/
+
+ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2,
+                                          z_off_t len2));
+/*
+     Combine two Adler-32 checksums into one.  For two sequences of bytes, seq1
+   and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for
+   each, adler1 and adler2.  adler32_combine() returns the Adler-32 checksum of
+   seq1 and seq2 concatenated, requiring only adler1, adler2, and len2.
+*/
+
+ZEXTERN uLong ZEXPORT crc32   OF((uLong crc, const Bytef *buf, uInt len));
+/*
+     Update a running CRC-32 with the bytes buf[0..len-1] and return the
+   updated CRC-32. If buf is NULL, this function returns the required initial
+   value for the for the crc. Pre- and post-conditioning (one's complement) is
+   performed within this function so it shouldn't be done by the application.
+   Usage example:
+
+     uLong crc = crc32(0L, Z_NULL, 0);
+
+     while (read_buffer(buffer, length) != EOF) {
+       crc = crc32(crc, buffer, length);
+     }
+     if (crc != original_crc) error();
+*/
+
+ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2));
+
+/*
+     Combine two CRC-32 check values into one.  For two sequences of bytes,
+   seq1 and seq2 with lengths len1 and len2, CRC-32 check values were
+   calculated for each, crc1 and crc2.  crc32_combine() returns the CRC-32
+   check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and
+   len2.
+*/
+
+
+                        /* various hacks, don't look :) */
+
+/* deflateInit and inflateInit are macros to allow checking the zlib version
+ * and the compiler's view of z_stream:
+ */
+ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level,
+                                     const char *version, int stream_size));
+ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm,
+                                     const char *version, int stream_size));
+ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int  level, int  method,
+                                      int windowBits, int memLevel,
+                                      int strategy, const char *version,
+                                      int stream_size));
+ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int  windowBits,
+                                      const char *version, int stream_size));
+ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits,
+                                         unsigned char FAR *window,
+                                         const char *version,
+                                         int stream_size));
+#define deflateInit(strm, level) \
+        deflateInit_((strm), (level),       ZLIB_VERSION, sizeof(z_stream))
+#define inflateInit(strm) \
+        inflateInit_((strm),                ZLIB_VERSION, sizeof(z_stream))
+#define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \
+        deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\
+                      (strategy),           ZLIB_VERSION, sizeof(z_stream))
+#define inflateInit2(strm, windowBits) \
+        inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream))
+#define inflateBackInit(strm, windowBits, window) \
+        inflateBackInit_((strm), (windowBits), (window), \
+        ZLIB_VERSION, sizeof(z_stream))
+
+
+#if !defined(ZUTIL_H) && !defined(NO_DUMMY_DECL)
+    struct internal_state {int dummy;}; /* hack for buggy compilers */
+#endif
+
+ZEXTERN const char   * ZEXPORT zError           OF((int));
+ZEXTERN int            ZEXPORT inflateSyncPoint OF((z_streamp z));
+ZEXTERN const uLongf * ZEXPORT get_crc_table    OF((void));
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* ZLIB_H */
diff --git a/ndk/platforms/android-4/arch-arm/lib/libGLESv1_CM.so b/ndk/platforms/android-4/arch-arm/lib/libGLESv1_CM.so
new file mode 100644
index 0000000..f61f631
--- /dev/null
+++ b/ndk/platforms/android-4/arch-arm/lib/libGLESv1_CM.so
Binary files differ
diff --git a/ndk/platforms/android-4/include/GLES/gl.h b/ndk/platforms/android-4/include/GLES/gl.h
new file mode 100644
index 0000000..2e8b971
--- /dev/null
+++ b/ndk/platforms/android-4/include/GLES/gl.h
@@ -0,0 +1,769 @@
+#ifndef __gl_h_
+#define __gl_h_
+
+/* $Revision: 7172 $ on $Date:: 2009-01-09 11:17:41 -0800 #$ */
+
+#include <GLES/glplatform.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * This document is licensed under the SGI Free Software B License Version
+ * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
+ */
+
+typedef void             GLvoid;
+typedef unsigned int     GLenum;
+typedef unsigned char    GLboolean;
+typedef unsigned int     GLbitfield;
+typedef khronos_int8_t   GLbyte;
+typedef short            GLshort;
+typedef int              GLint;
+typedef int              GLsizei;
+typedef khronos_uint8_t  GLubyte;
+typedef unsigned short   GLushort;
+typedef unsigned int     GLuint;
+typedef khronos_float_t  GLfloat;
+typedef khronos_float_t  GLclampf;
+typedef khronos_int32_t  GLfixed;
+typedef khronos_int32_t  GLclampx;
+
+typedef khronos_intptr_t GLintptr;
+typedef khronos_ssize_t  GLsizeiptr;
+
+
+/*************************************************************/
+
+/* OpenGL ES core versions */
+#define GL_VERSION_ES_CM_1_0          1
+#define GL_VERSION_ES_CL_1_0          1
+#define GL_VERSION_ES_CM_1_1          1
+#define GL_VERSION_ES_CL_1_1          1
+
+/* ClearBufferMask */
+#define GL_DEPTH_BUFFER_BIT               0x00000100
+#define GL_STENCIL_BUFFER_BIT             0x00000400
+#define GL_COLOR_BUFFER_BIT               0x00004000
+
+/* Boolean */
+#define GL_FALSE                          0
+#define GL_TRUE                           1
+
+/* BeginMode */
+#define GL_POINTS                         0x0000
+#define GL_LINES                          0x0001
+#define GL_LINE_LOOP                      0x0002
+#define GL_LINE_STRIP                     0x0003
+#define GL_TRIANGLES                      0x0004
+#define GL_TRIANGLE_STRIP                 0x0005
+#define GL_TRIANGLE_FAN                   0x0006
+
+/* AlphaFunction */
+#define GL_NEVER                          0x0200
+#define GL_LESS                           0x0201
+#define GL_EQUAL                          0x0202
+#define GL_LEQUAL                         0x0203
+#define GL_GREATER                        0x0204
+#define GL_NOTEQUAL                       0x0205
+#define GL_GEQUAL                         0x0206
+#define GL_ALWAYS                         0x0207
+
+/* BlendingFactorDest */
+#define GL_ZERO                           0
+#define GL_ONE                            1
+#define GL_SRC_COLOR                      0x0300
+#define GL_ONE_MINUS_SRC_COLOR            0x0301
+#define GL_SRC_ALPHA                      0x0302
+#define GL_ONE_MINUS_SRC_ALPHA            0x0303
+#define GL_DST_ALPHA                      0x0304
+#define GL_ONE_MINUS_DST_ALPHA            0x0305
+
+/* BlendingFactorSrc */
+/*      GL_ZERO */
+/*      GL_ONE */
+#define GL_DST_COLOR                      0x0306
+#define GL_ONE_MINUS_DST_COLOR            0x0307
+#define GL_SRC_ALPHA_SATURATE             0x0308
+/*      GL_SRC_ALPHA */
+/*      GL_ONE_MINUS_SRC_ALPHA */
+/*      GL_DST_ALPHA */
+/*      GL_ONE_MINUS_DST_ALPHA */
+
+/* ClipPlaneName */
+#define GL_CLIP_PLANE0                    0x3000
+#define GL_CLIP_PLANE1                    0x3001
+#define GL_CLIP_PLANE2                    0x3002
+#define GL_CLIP_PLANE3                    0x3003
+#define GL_CLIP_PLANE4                    0x3004
+#define GL_CLIP_PLANE5                    0x3005
+
+/* ColorMaterialFace */
+/*      GL_FRONT_AND_BACK */
+
+/* ColorMaterialParameter */
+/*      GL_AMBIENT_AND_DIFFUSE */
+
+/* ColorPointerType */
+/*      GL_UNSIGNED_BYTE */
+/*      GL_FLOAT */
+/*      GL_FIXED */
+
+/* CullFaceMode */
+#define GL_FRONT                          0x0404
+#define GL_BACK                           0x0405
+#define GL_FRONT_AND_BACK                 0x0408
+
+/* DepthFunction */
+/*      GL_NEVER */
+/*      GL_LESS */
+/*      GL_EQUAL */
+/*      GL_LEQUAL */
+/*      GL_GREATER */
+/*      GL_NOTEQUAL */
+/*      GL_GEQUAL */
+/*      GL_ALWAYS */
+
+/* EnableCap */
+#define GL_FOG                            0x0B60
+#define GL_LIGHTING                       0x0B50
+#define GL_TEXTURE_2D                     0x0DE1
+#define GL_CULL_FACE                      0x0B44
+#define GL_ALPHA_TEST                     0x0BC0
+#define GL_BLEND                          0x0BE2
+#define GL_COLOR_LOGIC_OP                 0x0BF2
+#define GL_DITHER                         0x0BD0
+#define GL_STENCIL_TEST                   0x0B90
+#define GL_DEPTH_TEST                     0x0B71
+/*      GL_LIGHT0 */
+/*      GL_LIGHT1 */
+/*      GL_LIGHT2 */
+/*      GL_LIGHT3 */
+/*      GL_LIGHT4 */
+/*      GL_LIGHT5 */
+/*      GL_LIGHT6 */
+/*      GL_LIGHT7 */
+#define GL_POINT_SMOOTH                   0x0B10
+#define GL_LINE_SMOOTH                    0x0B20
+#define GL_SCISSOR_TEST                   0x0C11
+#define GL_COLOR_MATERIAL                 0x0B57
+#define GL_NORMALIZE                      0x0BA1
+#define GL_RESCALE_NORMAL                 0x803A
+#define GL_POLYGON_OFFSET_FILL            0x8037
+#define GL_VERTEX_ARRAY                   0x8074
+#define GL_NORMAL_ARRAY                   0x8075
+#define GL_COLOR_ARRAY                    0x8076
+#define GL_TEXTURE_COORD_ARRAY            0x8078
+#define GL_MULTISAMPLE                    0x809D
+#define GL_SAMPLE_ALPHA_TO_COVERAGE       0x809E
+#define GL_SAMPLE_ALPHA_TO_ONE            0x809F
+#define GL_SAMPLE_COVERAGE                0x80A0
+
+/* ErrorCode */
+#define GL_NO_ERROR                       0
+#define GL_INVALID_ENUM                   0x0500
+#define GL_INVALID_VALUE                  0x0501
+#define GL_INVALID_OPERATION              0x0502
+#define GL_STACK_OVERFLOW                 0x0503
+#define GL_STACK_UNDERFLOW                0x0504
+#define GL_OUT_OF_MEMORY                  0x0505
+
+/* FogMode */
+/*      GL_LINEAR */
+#define GL_EXP                            0x0800
+#define GL_EXP2                           0x0801
+
+/* FogParameter */
+#define GL_FOG_DENSITY                    0x0B62
+#define GL_FOG_START                      0x0B63
+#define GL_FOG_END                        0x0B64
+#define GL_FOG_MODE                       0x0B65
+#define GL_FOG_COLOR                      0x0B66
+
+/* FrontFaceDirection */
+#define GL_CW                             0x0900
+#define GL_CCW                            0x0901
+
+/* GetPName */
+#define GL_CURRENT_COLOR                  0x0B00
+#define GL_CURRENT_NORMAL                 0x0B02
+#define GL_CURRENT_TEXTURE_COORDS         0x0B03
+#define GL_POINT_SIZE                     0x0B11
+#define GL_POINT_SIZE_MIN                 0x8126
+#define GL_POINT_SIZE_MAX                 0x8127
+#define GL_POINT_FADE_THRESHOLD_SIZE      0x8128
+#define GL_POINT_DISTANCE_ATTENUATION     0x8129
+#define GL_SMOOTH_POINT_SIZE_RANGE        0x0B12
+#define GL_LINE_WIDTH                     0x0B21
+#define GL_SMOOTH_LINE_WIDTH_RANGE        0x0B22
+#define GL_ALIASED_POINT_SIZE_RANGE       0x846D
+#define GL_ALIASED_LINE_WIDTH_RANGE       0x846E
+#define GL_CULL_FACE_MODE                 0x0B45
+#define GL_FRONT_FACE                     0x0B46
+#define GL_SHADE_MODEL                    0x0B54
+#define GL_DEPTH_RANGE                    0x0B70
+#define GL_DEPTH_WRITEMASK                0x0B72
+#define GL_DEPTH_CLEAR_VALUE              0x0B73
+#define GL_DEPTH_FUNC                     0x0B74
+#define GL_STENCIL_CLEAR_VALUE            0x0B91
+#define GL_STENCIL_FUNC                   0x0B92
+#define GL_STENCIL_VALUE_MASK             0x0B93
+#define GL_STENCIL_FAIL                   0x0B94
+#define GL_STENCIL_PASS_DEPTH_FAIL        0x0B95
+#define GL_STENCIL_PASS_DEPTH_PASS        0x0B96
+#define GL_STENCIL_REF                    0x0B97
+#define GL_STENCIL_WRITEMASK              0x0B98
+#define GL_MATRIX_MODE                    0x0BA0
+#define GL_VIEWPORT                       0x0BA2
+#define GL_MODELVIEW_STACK_DEPTH          0x0BA3
+#define GL_PROJECTION_STACK_DEPTH         0x0BA4
+#define GL_TEXTURE_STACK_DEPTH            0x0BA5
+#define GL_MODELVIEW_MATRIX               0x0BA6
+#define GL_PROJECTION_MATRIX              0x0BA7
+#define GL_TEXTURE_MATRIX                 0x0BA8
+#define GL_ALPHA_TEST_FUNC                0x0BC1
+#define GL_ALPHA_TEST_REF                 0x0BC2
+#define GL_BLEND_DST                      0x0BE0
+#define GL_BLEND_SRC                      0x0BE1
+#define GL_LOGIC_OP_MODE                  0x0BF0
+#define GL_SCISSOR_BOX                    0x0C10
+#define GL_SCISSOR_TEST                   0x0C11
+#define GL_COLOR_CLEAR_VALUE              0x0C22
+#define GL_COLOR_WRITEMASK                0x0C23
+#define GL_UNPACK_ALIGNMENT               0x0CF5
+#define GL_PACK_ALIGNMENT                 0x0D05
+#define GL_MAX_LIGHTS                     0x0D31
+#define GL_MAX_CLIP_PLANES                0x0D32
+#define GL_MAX_TEXTURE_SIZE               0x0D33
+#define GL_MAX_MODELVIEW_STACK_DEPTH      0x0D36
+#define GL_MAX_PROJECTION_STACK_DEPTH     0x0D38
+#define GL_MAX_TEXTURE_STACK_DEPTH        0x0D39
+#define GL_MAX_VIEWPORT_DIMS              0x0D3A
+#define GL_MAX_TEXTURE_UNITS              0x84E2
+#define GL_SUBPIXEL_BITS                  0x0D50
+#define GL_RED_BITS                       0x0D52
+#define GL_GREEN_BITS                     0x0D53
+#define GL_BLUE_BITS                      0x0D54
+#define GL_ALPHA_BITS                     0x0D55
+#define GL_DEPTH_BITS                     0x0D56
+#define GL_STENCIL_BITS                   0x0D57
+#define GL_POLYGON_OFFSET_UNITS           0x2A00
+#define GL_POLYGON_OFFSET_FILL            0x8037
+#define GL_POLYGON_OFFSET_FACTOR          0x8038
+#define GL_TEXTURE_BINDING_2D             0x8069
+#define GL_VERTEX_ARRAY_SIZE              0x807A
+#define GL_VERTEX_ARRAY_TYPE              0x807B
+#define GL_VERTEX_ARRAY_STRIDE            0x807C
+#define GL_NORMAL_ARRAY_TYPE              0x807E
+#define GL_NORMAL_ARRAY_STRIDE            0x807F
+#define GL_COLOR_ARRAY_SIZE               0x8081
+#define GL_COLOR_ARRAY_TYPE               0x8082
+#define GL_COLOR_ARRAY_STRIDE             0x8083
+#define GL_TEXTURE_COORD_ARRAY_SIZE       0x8088
+#define GL_TEXTURE_COORD_ARRAY_TYPE       0x8089
+#define GL_TEXTURE_COORD_ARRAY_STRIDE     0x808A
+#define GL_VERTEX_ARRAY_POINTER           0x808E
+#define GL_NORMAL_ARRAY_POINTER           0x808F
+#define GL_COLOR_ARRAY_POINTER            0x8090
+#define GL_TEXTURE_COORD_ARRAY_POINTER    0x8092
+#define GL_SAMPLE_BUFFERS                 0x80A8
+#define GL_SAMPLES                        0x80A9
+#define GL_SAMPLE_COVERAGE_VALUE          0x80AA
+#define GL_SAMPLE_COVERAGE_INVERT         0x80AB
+
+/* GetTextureParameter */
+/*      GL_TEXTURE_MAG_FILTER */
+/*      GL_TEXTURE_MIN_FILTER */
+/*      GL_TEXTURE_WRAP_S */
+/*      GL_TEXTURE_WRAP_T */
+
+#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
+#define GL_COMPRESSED_TEXTURE_FORMATS     0x86A3
+
+/* HintMode */
+#define GL_DONT_CARE                      0x1100
+#define GL_FASTEST                        0x1101
+#define GL_NICEST                         0x1102
+
+/* HintTarget */
+#define GL_PERSPECTIVE_CORRECTION_HINT    0x0C50
+#define GL_POINT_SMOOTH_HINT              0x0C51
+#define GL_LINE_SMOOTH_HINT               0x0C52
+#define GL_FOG_HINT                       0x0C54
+#define GL_GENERATE_MIPMAP_HINT           0x8192
+
+/* LightModelParameter */
+#define GL_LIGHT_MODEL_AMBIENT            0x0B53
+#define GL_LIGHT_MODEL_TWO_SIDE           0x0B52
+
+/* LightParameter */
+#define GL_AMBIENT                        0x1200
+#define GL_DIFFUSE                        0x1201
+#define GL_SPECULAR                       0x1202
+#define GL_POSITION                       0x1203
+#define GL_SPOT_DIRECTION                 0x1204
+#define GL_SPOT_EXPONENT                  0x1205
+#define GL_SPOT_CUTOFF                    0x1206
+#define GL_CONSTANT_ATTENUATION           0x1207
+#define GL_LINEAR_ATTENUATION             0x1208
+#define GL_QUADRATIC_ATTENUATION          0x1209
+
+/* DataType */
+#define GL_BYTE                           0x1400
+#define GL_UNSIGNED_BYTE                  0x1401
+#define GL_SHORT                          0x1402
+#define GL_UNSIGNED_SHORT                 0x1403
+#define GL_FLOAT                          0x1406
+#define GL_FIXED                          0x140C
+
+/* LogicOp */
+#define GL_CLEAR                          0x1500
+#define GL_AND                            0x1501
+#define GL_AND_REVERSE                    0x1502
+#define GL_COPY                           0x1503
+#define GL_AND_INVERTED                   0x1504
+#define GL_NOOP                           0x1505
+#define GL_XOR                            0x1506
+#define GL_OR                             0x1507
+#define GL_NOR                            0x1508
+#define GL_EQUIV                          0x1509
+#define GL_INVERT                         0x150A
+#define GL_OR_REVERSE                     0x150B
+#define GL_COPY_INVERTED                  0x150C
+#define GL_OR_INVERTED                    0x150D
+#define GL_NAND                           0x150E
+#define GL_SET                            0x150F
+
+/* MaterialFace */
+/*      GL_FRONT_AND_BACK */
+
+/* MaterialParameter */
+#define GL_EMISSION                       0x1600
+#define GL_SHININESS                      0x1601
+#define GL_AMBIENT_AND_DIFFUSE            0x1602
+/*      GL_AMBIENT */
+/*      GL_DIFFUSE */
+/*      GL_SPECULAR */
+
+/* MatrixMode */
+#define GL_MODELVIEW                      0x1700
+#define GL_PROJECTION                     0x1701
+#define GL_TEXTURE                        0x1702
+
+/* NormalPointerType */
+/*      GL_BYTE */
+/*      GL_SHORT */
+/*      GL_FLOAT */
+/*      GL_FIXED */
+
+/* PixelFormat */
+#define GL_ALPHA                          0x1906
+#define GL_RGB                            0x1907
+#define GL_RGBA                           0x1908
+#define GL_LUMINANCE                      0x1909
+#define GL_LUMINANCE_ALPHA                0x190A
+
+/* PixelStoreParameter */
+#define GL_UNPACK_ALIGNMENT               0x0CF5
+#define GL_PACK_ALIGNMENT                 0x0D05
+
+/* PixelType */
+/*      GL_UNSIGNED_BYTE */
+#define GL_UNSIGNED_SHORT_4_4_4_4         0x8033
+#define GL_UNSIGNED_SHORT_5_5_5_1         0x8034
+#define GL_UNSIGNED_SHORT_5_6_5           0x8363
+
+/* ShadingModel */
+#define GL_FLAT                           0x1D00
+#define GL_SMOOTH                         0x1D01
+
+/* StencilFunction */
+/*      GL_NEVER */
+/*      GL_LESS */
+/*      GL_EQUAL */
+/*      GL_LEQUAL */
+/*      GL_GREATER */
+/*      GL_NOTEQUAL */
+/*      GL_GEQUAL */
+/*      GL_ALWAYS */
+
+/* StencilOp */
+/*      GL_ZERO */
+#define GL_KEEP                           0x1E00
+#define GL_REPLACE                        0x1E01
+#define GL_INCR                           0x1E02
+#define GL_DECR                           0x1E03
+/*      GL_INVERT */
+
+/* StringName */
+#define GL_VENDOR                         0x1F00
+#define GL_RENDERER                       0x1F01
+#define GL_VERSION                        0x1F02
+#define GL_EXTENSIONS                     0x1F03
+
+/* TexCoordPointerType */
+/*      GL_SHORT */
+/*      GL_FLOAT */
+/*      GL_FIXED */
+/*      GL_BYTE */
+
+/* TextureEnvMode */
+#define GL_MODULATE                       0x2100
+#define GL_DECAL                          0x2101
+/*      GL_BLEND */
+#define GL_ADD                            0x0104
+/*      GL_REPLACE */
+
+/* TextureEnvParameter */
+#define GL_TEXTURE_ENV_MODE               0x2200
+#define GL_TEXTURE_ENV_COLOR              0x2201
+
+/* TextureEnvTarget */
+#define GL_TEXTURE_ENV                    0x2300
+
+/* TextureMagFilter */
+#define GL_NEAREST                        0x2600
+#define GL_LINEAR                         0x2601
+
+/* TextureMinFilter */
+/*      GL_NEAREST */
+/*      GL_LINEAR */
+#define GL_NEAREST_MIPMAP_NEAREST         0x2700
+#define GL_LINEAR_MIPMAP_NEAREST          0x2701
+#define GL_NEAREST_MIPMAP_LINEAR          0x2702
+#define GL_LINEAR_MIPMAP_LINEAR           0x2703
+
+/* TextureParameterName */
+#define GL_TEXTURE_MAG_FILTER             0x2800
+#define GL_TEXTURE_MIN_FILTER             0x2801
+#define GL_TEXTURE_WRAP_S                 0x2802
+#define GL_TEXTURE_WRAP_T                 0x2803
+#define GL_GENERATE_MIPMAP                0x8191
+
+/* TextureTarget */
+/*      GL_TEXTURE_2D */
+
+/* TextureUnit */
+#define GL_TEXTURE0                       0x84C0
+#define GL_TEXTURE1                       0x84C1
+#define GL_TEXTURE2                       0x84C2
+#define GL_TEXTURE3                       0x84C3
+#define GL_TEXTURE4                       0x84C4
+#define GL_TEXTURE5                       0x84C5
+#define GL_TEXTURE6                       0x84C6
+#define GL_TEXTURE7                       0x84C7
+#define GL_TEXTURE8                       0x84C8
+#define GL_TEXTURE9                       0x84C9
+#define GL_TEXTURE10                      0x84CA
+#define GL_TEXTURE11                      0x84CB
+#define GL_TEXTURE12                      0x84CC
+#define GL_TEXTURE13                      0x84CD
+#define GL_TEXTURE14                      0x84CE
+#define GL_TEXTURE15                      0x84CF
+#define GL_TEXTURE16                      0x84D0
+#define GL_TEXTURE17                      0x84D1
+#define GL_TEXTURE18                      0x84D2
+#define GL_TEXTURE19                      0x84D3
+#define GL_TEXTURE20                      0x84D4
+#define GL_TEXTURE21                      0x84D5
+#define GL_TEXTURE22                      0x84D6
+#define GL_TEXTURE23                      0x84D7
+#define GL_TEXTURE24                      0x84D8
+#define GL_TEXTURE25                      0x84D9
+#define GL_TEXTURE26                      0x84DA
+#define GL_TEXTURE27                      0x84DB
+#define GL_TEXTURE28                      0x84DC
+#define GL_TEXTURE29                      0x84DD
+#define GL_TEXTURE30                      0x84DE
+#define GL_TEXTURE31                      0x84DF
+#define GL_ACTIVE_TEXTURE                 0x84E0
+#define GL_CLIENT_ACTIVE_TEXTURE          0x84E1
+
+/* TextureWrapMode */
+#define GL_REPEAT                         0x2901
+#define GL_CLAMP_TO_EDGE                  0x812F
+
+/* VertexPointerType */
+/*      GL_SHORT */
+/*      GL_FLOAT */
+/*      GL_FIXED */
+/*      GL_BYTE */
+
+/* LightName */
+#define GL_LIGHT0                         0x4000
+#define GL_LIGHT1                         0x4001
+#define GL_LIGHT2                         0x4002
+#define GL_LIGHT3                         0x4003
+#define GL_LIGHT4                         0x4004
+#define GL_LIGHT5                         0x4005
+#define GL_LIGHT6                         0x4006
+#define GL_LIGHT7                         0x4007
+
+/* Buffer Objects */
+#define GL_ARRAY_BUFFER                   0x8892
+#define GL_ELEMENT_ARRAY_BUFFER           0x8893
+
+#define GL_ARRAY_BUFFER_BINDING               0x8894
+#define GL_ELEMENT_ARRAY_BUFFER_BINDING       0x8895
+#define GL_VERTEX_ARRAY_BUFFER_BINDING        0x8896
+#define GL_NORMAL_ARRAY_BUFFER_BINDING        0x8897
+#define GL_COLOR_ARRAY_BUFFER_BINDING         0x8898
+#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A
+
+#define GL_STATIC_DRAW                    0x88E4
+#define GL_DYNAMIC_DRAW                   0x88E8
+
+#define GL_BUFFER_SIZE                    0x8764
+#define GL_BUFFER_USAGE                   0x8765
+
+/* Texture combine + dot3 */
+#define GL_SUBTRACT                       0x84E7
+#define GL_COMBINE                        0x8570
+#define GL_COMBINE_RGB                    0x8571
+#define GL_COMBINE_ALPHA                  0x8572
+#define GL_RGB_SCALE                      0x8573
+#define GL_ADD_SIGNED                     0x8574
+#define GL_INTERPOLATE                    0x8575
+#define GL_CONSTANT                       0x8576
+#define GL_PRIMARY_COLOR                  0x8577
+#define GL_PREVIOUS                       0x8578
+#define GL_OPERAND0_RGB                   0x8590
+#define GL_OPERAND1_RGB                   0x8591
+#define GL_OPERAND2_RGB                   0x8592
+#define GL_OPERAND0_ALPHA                 0x8598
+#define GL_OPERAND1_ALPHA                 0x8599
+#define GL_OPERAND2_ALPHA                 0x859A
+
+#define GL_ALPHA_SCALE                    0x0D1C
+
+#define GL_SRC0_RGB                       0x8580
+#define GL_SRC1_RGB                       0x8581
+#define GL_SRC2_RGB                       0x8582
+#define GL_SRC0_ALPHA                     0x8588
+#define GL_SRC1_ALPHA                     0x8589
+#define GL_SRC2_ALPHA                     0x858A
+
+#define GL_DOT3_RGB                       0x86AE
+#define GL_DOT3_RGBA                      0x86AF
+
+/*------------------------------------------------------------------------*
+ * required OES extension tokens
+ *------------------------------------------------------------------------*/
+
+/* OES_read_format */
+#ifndef GL_OES_read_format
+#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES                   0x8B9A
+#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES                 0x8B9B
+#endif
+
+/* GL_OES_compressed_paletted_texture */
+#ifndef GL_OES_compressed_paletted_texture
+#define GL_PALETTE4_RGB8_OES                                    0x8B90
+#define GL_PALETTE4_RGBA8_OES                                   0x8B91
+#define GL_PALETTE4_R5_G6_B5_OES                                0x8B92
+#define GL_PALETTE4_RGBA4_OES                                   0x8B93
+#define GL_PALETTE4_RGB5_A1_OES                                 0x8B94
+#define GL_PALETTE8_RGB8_OES                                    0x8B95
+#define GL_PALETTE8_RGBA8_OES                                   0x8B96
+#define GL_PALETTE8_R5_G6_B5_OES                                0x8B97
+#define GL_PALETTE8_RGBA4_OES                                   0x8B98
+#define GL_PALETTE8_RGB5_A1_OES                                 0x8B99
+#endif
+
+/* OES_point_size_array */
+#ifndef GL_OES_point_size_array
+#define GL_POINT_SIZE_ARRAY_OES                                 0x8B9C
+#define GL_POINT_SIZE_ARRAY_TYPE_OES                            0x898A
+#define GL_POINT_SIZE_ARRAY_STRIDE_OES                          0x898B
+#define GL_POINT_SIZE_ARRAY_POINTER_OES                         0x898C
+#define GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES                  0x8B9F
+#endif
+
+/* GL_OES_point_sprite */
+#ifndef GL_OES_point_sprite
+#define GL_POINT_SPRITE_OES                                     0x8861
+#define GL_COORD_REPLACE_OES                                    0x8862
+#endif
+
+/*************************************************************/
+
+/* Available only in Common profile */
+GL_API void GL_APIENTRY glAlphaFunc (GLenum func, GLclampf ref);
+GL_API void GL_APIENTRY glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
+GL_API void GL_APIENTRY glClearDepthf (GLclampf depth);
+GL_API void GL_APIENTRY glClipPlanef (GLenum plane, const GLfloat *equation);
+GL_API void GL_APIENTRY glColor4f (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
+GL_API void GL_APIENTRY glDepthRangef (GLclampf zNear, GLclampf zFar);
+GL_API void GL_APIENTRY glFogf (GLenum pname, GLfloat param);
+GL_API void GL_APIENTRY glFogfv (GLenum pname, const GLfloat *params);
+GL_API void GL_APIENTRY glFrustumf (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
+GL_API void GL_APIENTRY glGetClipPlanef (GLenum pname, GLfloat eqn[4]);
+GL_API void GL_APIENTRY glGetFloatv (GLenum pname, GLfloat *params);
+GL_API void GL_APIENTRY glGetLightfv (GLenum light, GLenum pname, GLfloat *params);
+GL_API void GL_APIENTRY glGetMaterialfv (GLenum face, GLenum pname, GLfloat *params);
+GL_API void GL_APIENTRY glGetTexEnvfv (GLenum env, GLenum pname, GLfloat *params);
+GL_API void GL_APIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat *params);
+GL_API void GL_APIENTRY glLightModelf (GLenum pname, GLfloat param);
+GL_API void GL_APIENTRY glLightModelfv (GLenum pname, const GLfloat *params);
+GL_API void GL_APIENTRY glLightf (GLenum light, GLenum pname, GLfloat param);
+GL_API void GL_APIENTRY glLightfv (GLenum light, GLenum pname, const GLfloat *params);
+GL_API void GL_APIENTRY glLineWidth (GLfloat width);
+GL_API void GL_APIENTRY glLoadMatrixf (const GLfloat *m);
+GL_API void GL_APIENTRY glMaterialf (GLenum face, GLenum pname, GLfloat param);
+GL_API void GL_APIENTRY glMaterialfv (GLenum face, GLenum pname, const GLfloat *params);
+GL_API void GL_APIENTRY glMultMatrixf (const GLfloat *m);
+GL_API void GL_APIENTRY glMultiTexCoord4f (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
+GL_API void GL_APIENTRY glNormal3f (GLfloat nx, GLfloat ny, GLfloat nz);
+GL_API void GL_APIENTRY glOrthof (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
+GL_API void GL_APIENTRY glPointParameterf (GLenum pname, GLfloat param);
+GL_API void GL_APIENTRY glPointParameterfv (GLenum pname, const GLfloat *params);
+GL_API void GL_APIENTRY glPointSize (GLfloat size);
+GL_API void GL_APIENTRY glPolygonOffset (GLfloat factor, GLfloat units);
+GL_API void GL_APIENTRY glRotatef (GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
+GL_API void GL_APIENTRY glScalef (GLfloat x, GLfloat y, GLfloat z);
+GL_API void GL_APIENTRY glTexEnvf (GLenum target, GLenum pname, GLfloat param);
+GL_API void GL_APIENTRY glTexEnvfv (GLenum target, GLenum pname, const GLfloat *params);
+GL_API void GL_APIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param);
+GL_API void GL_APIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat *params);
+GL_API void GL_APIENTRY glTranslatef (GLfloat x, GLfloat y, GLfloat z);
+
+/* Available in both Common and Common-Lite profiles */
+GL_API void GL_APIENTRY glActiveTexture (GLenum texture);
+GL_API void GL_APIENTRY glAlphaFuncx (GLenum func, GLclampx ref);
+GL_API void GL_APIENTRY glBindBuffer (GLenum target, GLuint buffer);
+GL_API void GL_APIENTRY glBindTexture (GLenum target, GLuint texture);
+GL_API void GL_APIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor);
+GL_API void GL_APIENTRY glBufferData (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage);
+GL_API void GL_APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data);
+GL_API void GL_APIENTRY glClear (GLbitfield mask);
+GL_API void GL_APIENTRY glClearColorx (GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha);
+GL_API void GL_APIENTRY glClearDepthx (GLclampx depth);
+GL_API void GL_APIENTRY glClearStencil (GLint s);
+GL_API void GL_APIENTRY glClientActiveTexture (GLenum texture);
+GL_API void GL_APIENTRY glClipPlanex (GLenum plane, const GLfixed *equation);
+GL_API void GL_APIENTRY glColor4ub (GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha);
+GL_API void GL_APIENTRY glColor4x (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha);
+GL_API void GL_APIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
+GL_API void GL_APIENTRY glColorPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+GL_API void GL_APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
+GL_API void GL_APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
+GL_API void GL_APIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
+GL_API void GL_APIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+GL_API void GL_APIENTRY glCullFace (GLenum mode);
+GL_API void GL_APIENTRY glDeleteBuffers (GLsizei n, const GLuint *buffers);
+GL_API void GL_APIENTRY glDeleteTextures (GLsizei n, const GLuint *textures);
+GL_API void GL_APIENTRY glDepthFunc (GLenum func);
+GL_API void GL_APIENTRY glDepthMask (GLboolean flag);
+GL_API void GL_APIENTRY glDepthRangex (GLclampx zNear, GLclampx zFar);
+GL_API void GL_APIENTRY glDisable (GLenum cap);
+GL_API void GL_APIENTRY glDisableClientState (GLenum array);
+GL_API void GL_APIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count);
+GL_API void GL_APIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices);
+GL_API void GL_APIENTRY glEnable (GLenum cap);
+GL_API void GL_APIENTRY glEnableClientState (GLenum array);
+GL_API void GL_APIENTRY glFinish (void);
+GL_API void GL_APIENTRY glFlush (void);
+GL_API void GL_APIENTRY glFogx (GLenum pname, GLfixed param);
+GL_API void GL_APIENTRY glFogxv (GLenum pname, const GLfixed *params);
+GL_API void GL_APIENTRY glFrontFace (GLenum mode);
+GL_API void GL_APIENTRY glFrustumx (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
+GL_API void GL_APIENTRY glGetBooleanv (GLenum pname, GLboolean *params);
+GL_API void GL_APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint *params);
+GL_API void GL_APIENTRY glGetClipPlanex (GLenum pname, GLfixed eqn[4]);
+GL_API void GL_APIENTRY glGenBuffers (GLsizei n, GLuint *buffers);
+GL_API void GL_APIENTRY glGenTextures (GLsizei n, GLuint *textures);
+GL_API GLenum GL_APIENTRY glGetError (void);
+GL_API void GL_APIENTRY glGetFixedv (GLenum pname, GLfixed *params);
+GL_API void GL_APIENTRY glGetIntegerv (GLenum pname, GLint *params);
+GL_API void GL_APIENTRY glGetLightxv (GLenum light, GLenum pname, GLfixed *params);
+GL_API void GL_APIENTRY glGetMaterialxv (GLenum face, GLenum pname, GLfixed *params);
+GL_API void GL_APIENTRY glGetPointerv (GLenum pname, void **params);
+GL_API const GLubyte * GL_APIENTRY glGetString (GLenum name);
+GL_API void GL_APIENTRY glGetTexEnviv (GLenum env, GLenum pname, GLint *params);
+GL_API void GL_APIENTRY glGetTexEnvxv (GLenum env, GLenum pname, GLfixed *params);
+GL_API void GL_APIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint *params);
+GL_API void GL_APIENTRY glGetTexParameterxv (GLenum target, GLenum pname, GLfixed *params);
+GL_API void GL_APIENTRY glHint (GLenum target, GLenum mode);
+GL_API GLboolean GL_APIENTRY glIsBuffer (GLuint buffer);
+GL_API GLboolean GL_APIENTRY glIsEnabled (GLenum cap);
+GL_API GLboolean GL_APIENTRY glIsTexture (GLuint texture);
+GL_API void GL_APIENTRY glLightModelx (GLenum pname, GLfixed param);
+GL_API void GL_APIENTRY glLightModelxv (GLenum pname, const GLfixed *params);
+GL_API void GL_APIENTRY glLightx (GLenum light, GLenum pname, GLfixed param);
+GL_API void GL_APIENTRY glLightxv (GLenum light, GLenum pname, const GLfixed *params);
+GL_API void GL_APIENTRY glLineWidthx (GLfixed width);
+GL_API void GL_APIENTRY glLoadIdentity (void);
+GL_API void GL_APIENTRY glLoadMatrixx (const GLfixed *m);
+GL_API void GL_APIENTRY glLogicOp (GLenum opcode);
+GL_API void GL_APIENTRY glMaterialx (GLenum face, GLenum pname, GLfixed param);
+GL_API void GL_APIENTRY glMaterialxv (GLenum face, GLenum pname, const GLfixed *params);
+GL_API void GL_APIENTRY glMatrixMode (GLenum mode);
+GL_API void GL_APIENTRY glMultMatrixx (const GLfixed *m);
+GL_API void GL_APIENTRY glMultiTexCoord4x (GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q);
+GL_API void GL_APIENTRY glNormal3x (GLfixed nx, GLfixed ny, GLfixed nz);
+GL_API void GL_APIENTRY glNormalPointer (GLenum type, GLsizei stride, const GLvoid *pointer);
+GL_API void GL_APIENTRY glOrthox (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
+GL_API void GL_APIENTRY glPixelStorei (GLenum pname, GLint param);
+GL_API void GL_APIENTRY glPointParameterx (GLenum pname, GLfixed param);
+GL_API void GL_APIENTRY glPointParameterxv (GLenum pname, const GLfixed *params);
+GL_API void GL_APIENTRY glPointSizex (GLfixed size);
+GL_API void GL_APIENTRY glPolygonOffsetx (GLfixed factor, GLfixed units);
+GL_API void GL_APIENTRY glPopMatrix (void);
+GL_API void GL_APIENTRY glPushMatrix (void);
+GL_API void GL_APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels);
+GL_API void GL_APIENTRY glRotatex (GLfixed angle, GLfixed x, GLfixed y, GLfixed z);
+GL_API void GL_APIENTRY glSampleCoverage (GLclampf value, GLboolean invert);
+GL_API void GL_APIENTRY glSampleCoveragex (GLclampx value, GLboolean invert);
+GL_API void GL_APIENTRY glScalex (GLfixed x, GLfixed y, GLfixed z);
+GL_API void GL_APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height);
+GL_API void GL_APIENTRY glShadeModel (GLenum mode);
+GL_API void GL_APIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask);
+GL_API void GL_APIENTRY glStencilMask (GLuint mask);
+GL_API void GL_APIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass);
+GL_API void GL_APIENTRY glTexCoordPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+GL_API void GL_APIENTRY glTexEnvi (GLenum target, GLenum pname, GLint param);
+GL_API void GL_APIENTRY glTexEnvx (GLenum target, GLenum pname, GLfixed param);
+GL_API void GL_APIENTRY glTexEnviv (GLenum target, GLenum pname, const GLint *params);
+GL_API void GL_APIENTRY glTexEnvxv (GLenum target, GLenum pname, const GLfixed *params);
+GL_API void GL_APIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+GL_API void GL_APIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param);
+GL_API void GL_APIENTRY glTexParameterx (GLenum target, GLenum pname, GLfixed param);
+GL_API void GL_APIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint *params);
+GL_API void GL_APIENTRY glTexParameterxv (GLenum target, GLenum pname, const GLfixed *params);
+GL_API void GL_APIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
+GL_API void GL_APIENTRY glTranslatex (GLfixed x, GLfixed y, GLfixed z);
+GL_API void GL_APIENTRY glVertexPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+GL_API void GL_APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height);
+
+/*------------------------------------------------------------------------*
+ * Required OES extension functions
+ *------------------------------------------------------------------------*/
+
+/* GL_OES_read_format */
+#ifndef GL_OES_read_format
+#define GL_OES_read_format 1
+#endif
+
+/* GL_OES_compressed_paletted_texture */
+#ifndef GL_OES_compressed_paletted_texture
+#define GL_OES_compressed_paletted_texture 1
+#endif
+
+/* GL_OES_point_size_array */
+#ifndef GL_OES_point_size_array
+#define GL_OES_point_size_array 1
+GL_API void GL_APIENTRY glPointSizePointerOES (GLenum type, GLsizei stride, const GLvoid *pointer);
+#endif
+
+/* GL_OES_point_sprite */
+#ifndef GL_OES_point_sprite
+#define GL_OES_point_sprite 1
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __gl_h_ */
+
diff --git a/ndk/platforms/android-4/include/GLES/glext.h b/ndk/platforms/android-4/include/GLES/glext.h
new file mode 100644
index 0000000..a8fe2e9
--- /dev/null
+++ b/ndk/platforms/android-4/include/GLES/glext.h
@@ -0,0 +1,607 @@
+#ifndef __glext_h_
+#define __glext_h_
+
+/* $Revision: 7172 $ on $Date:: 2009-01-09 11:17:41 -0800 #$ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * This document is licensed under the SGI Free Software B License Version
+ * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
+ */
+
+#ifndef GL_APIENTRYP
+#   define GL_APIENTRYP GL_APIENTRY*
+#endif
+
+/*------------------------------------------------------------------------*
+ * OES extension tokens
+ *------------------------------------------------------------------------*/
+
+/* GL_OES_blend_equation_separate */
+#ifndef GL_OES_blend_equation_separate
+/* BLEND_EQUATION_RGB_OES same as BLEND_EQUATION_OES */
+#define GL_BLEND_EQUATION_RGB_OES                               0x8009
+#define GL_BLEND_EQUATION_ALPHA_OES                             0x883D
+#endif
+
+/* GL_OES_blend_func_separate */
+#ifndef GL_OES_blend_func_separate
+#define GL_BLEND_DST_RGB_OES                                    0x80C8
+#define GL_BLEND_SRC_RGB_OES                                    0x80C9
+#define GL_BLEND_DST_ALPHA_OES                                  0x80CA
+#define GL_BLEND_SRC_ALPHA_OES                                  0x80CB
+#endif
+
+/* GL_OES_blend_subtract */
+#ifndef GL_OES_blend_subtract
+#define GL_BLEND_EQUATION_OES                                   0x8009
+#define GL_FUNC_ADD_OES                                         0x8006
+#define GL_FUNC_SUBTRACT_OES                                    0x800A
+#define GL_FUNC_REVERSE_SUBTRACT_OES                            0x800B
+#endif
+
+/* GL_OES_compressed_ETC1_RGB8_texture */
+#ifndef GL_OES_compressed_ETC1_RGB8_texture
+#define GL_ETC1_RGB8_OES                                        0x8D64
+#endif
+
+/* GL_OES_depth24 */
+#ifndef GL_OES_depth24
+#define GL_DEPTH_COMPONENT24_OES                                0x81A6
+#endif
+
+/* GL_OES_depth32 */
+#ifndef GL_OES_depth32
+#define GL_DEPTH_COMPONENT32_OES                                0x81A7
+#endif
+
+/* GL_OES_draw_texture */
+#ifndef GL_OES_draw_texture
+#define GL_TEXTURE_CROP_RECT_OES                                0x8B9D
+#endif
+
+/* GL_OES_EGL_image */
+#ifndef GL_OES_EGL_image
+typedef void* GLeglImageOES;
+#endif
+
+/* GL_OES_fixed_point */
+#ifndef GL_OES_fixed_point
+#define GL_FIXED_OES                                            0x140C
+#endif
+
+/* GL_OES_framebuffer_object */
+#ifndef GL_OES_framebuffer_object
+#define GL_NONE_OES                                             0
+#define GL_FRAMEBUFFER_OES                                      0x8D40
+#define GL_RENDERBUFFER_OES                                     0x8D41
+#define GL_RGBA4_OES                                            0x8056
+#define GL_RGB5_A1_OES                                          0x8057
+#define GL_RGB565_OES                                           0x8D62
+#define GL_DEPTH_COMPONENT16_OES                                0x81A5
+#define GL_RENDERBUFFER_WIDTH_OES                               0x8D42
+#define GL_RENDERBUFFER_HEIGHT_OES                              0x8D43
+#define GL_RENDERBUFFER_INTERNAL_FORMAT_OES                     0x8D44
+#define GL_RENDERBUFFER_RED_SIZE_OES                            0x8D50
+#define GL_RENDERBUFFER_GREEN_SIZE_OES                          0x8D51
+#define GL_RENDERBUFFER_BLUE_SIZE_OES                           0x8D52
+#define GL_RENDERBUFFER_ALPHA_SIZE_OES                          0x8D53
+#define GL_RENDERBUFFER_DEPTH_SIZE_OES                          0x8D54
+#define GL_RENDERBUFFER_STENCIL_SIZE_OES                        0x8D55
+#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_OES               0x8CD0
+#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_OES               0x8CD1
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_OES             0x8CD2
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_OES     0x8CD3
+#define GL_COLOR_ATTACHMENT0_OES                                0x8CE0
+#define GL_DEPTH_ATTACHMENT_OES                                 0x8D00
+#define GL_STENCIL_ATTACHMENT_OES                               0x8D20
+#define GL_FRAMEBUFFER_COMPLETE_OES                             0x8CD5
+#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_OES                0x8CD6
+#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_OES        0x8CD7
+#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_OES                0x8CD9
+#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_OES                   0x8CDA
+#define GL_FRAMEBUFFER_UNSUPPORTED_OES                          0x8CDD
+#define GL_FRAMEBUFFER_BINDING_OES                              0x8CA6
+#define GL_RENDERBUFFER_BINDING_OES                             0x8CA7
+#define GL_MAX_RENDERBUFFER_SIZE_OES                            0x84E8
+#define GL_INVALID_FRAMEBUFFER_OPERATION_OES                    0x0506
+#endif
+
+/* GL_OES_mapbuffer */
+#ifndef GL_OES_mapbuffer
+#define GL_WRITE_ONLY_OES                                       0x88B9
+#define GL_BUFFER_ACCESS_OES                                    0x88BB
+#define GL_BUFFER_MAPPED_OES                                    0x88BC
+#define GL_BUFFER_MAP_POINTER_OES                               0x88BD
+#endif
+
+/* GL_OES_matrix_get */
+#ifndef GL_OES_matrix_get
+#define GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES               0x898D
+#define GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES              0x898E
+#define GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES                 0x898F
+#endif
+
+/* GL_OES_matrix_palette */
+#ifndef GL_OES_matrix_palette
+#define GL_MAX_VERTEX_UNITS_OES                                 0x86A4
+#define GL_MAX_PALETTE_MATRICES_OES                             0x8842
+#define GL_MATRIX_PALETTE_OES                                   0x8840
+#define GL_MATRIX_INDEX_ARRAY_OES                               0x8844
+#define GL_WEIGHT_ARRAY_OES                                     0x86AD
+#define GL_CURRENT_PALETTE_MATRIX_OES                           0x8843
+#define GL_MATRIX_INDEX_ARRAY_SIZE_OES                          0x8846
+#define GL_MATRIX_INDEX_ARRAY_TYPE_OES                          0x8847
+#define GL_MATRIX_INDEX_ARRAY_STRIDE_OES                        0x8848
+#define GL_MATRIX_INDEX_ARRAY_POINTER_OES                       0x8849
+#define GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES                0x8B9E
+#define GL_WEIGHT_ARRAY_SIZE_OES                                0x86AB
+#define GL_WEIGHT_ARRAY_TYPE_OES                                0x86A9
+#define GL_WEIGHT_ARRAY_STRIDE_OES                              0x86AA
+#define GL_WEIGHT_ARRAY_POINTER_OES                             0x86AC
+#define GL_WEIGHT_ARRAY_BUFFER_BINDING_OES                      0x889E
+#endif
+
+/* GL_OES_packed_depth_stencil */
+#ifndef GL_OES_packed_depth_stencil
+#define GL_DEPTH_STENCIL_OES                                    0x84F9
+#define GL_UNSIGNED_INT_24_8_OES                                0x84FA
+#define GL_DEPTH24_STENCIL8_OES                                 0x88F0
+#endif
+
+/* GL_OES_rgb8_rgba8 */
+#ifndef GL_OES_rgb8_rgba8
+#define GL_RGB8_OES                                             0x8051
+#define GL_RGBA8_OES                                            0x8058
+#endif
+
+/* GL_OES_stencil1 */
+#ifndef GL_OES_stencil1
+#define GL_STENCIL_INDEX1_OES                                   0x8D46
+#endif
+
+/* GL_OES_stencil4 */
+#ifndef GL_OES_stencil4
+#define GL_STENCIL_INDEX4_OES                                   0x8D47
+#endif
+
+/* GL_OES_stencil8 */
+#ifndef GL_OES_stencil8
+#define GL_STENCIL_INDEX8_OES                                   0x8D48
+#endif
+
+/* GL_OES_stencil_wrap */
+#ifndef GL_OES_stencil_wrap
+#define GL_INCR_WRAP_OES                                        0x8507
+#define GL_DECR_WRAP_OES                                        0x8508
+#endif
+
+/* GL_OES_texture_cube_map */
+#ifndef GL_OES_texture_cube_map
+#define GL_NORMAL_MAP_OES                                       0x8511
+#define GL_REFLECTION_MAP_OES                                   0x8512
+#define GL_TEXTURE_CUBE_MAP_OES                                 0x8513
+#define GL_TEXTURE_BINDING_CUBE_MAP_OES                         0x8514
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_OES                      0x8515
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_OES                      0x8516
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_OES                      0x8517
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_OES                      0x8518
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_OES                      0x8519
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_OES                      0x851A
+#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_OES                        0x851C
+#define GL_TEXTURE_GEN_MODE_OES                                 0x2500
+#define GL_TEXTURE_GEN_STR_OES                                  0x8D60
+#endif
+
+/* GL_OES_texture_mirrored_repeat */
+#ifndef GL_OES_texture_mirrored_repeat
+#define GL_MIRRORED_REPEAT_OES                                  0x8370
+#endif
+
+/*------------------------------------------------------------------------*
+ * AMD extension tokens
+ *------------------------------------------------------------------------*/
+
+/* GL_AMD_compressed_3DC_texture */
+#ifndef GL_AMD_compressed_3DC_texture
+#define GL_3DC_X_AMD                                            0x87F9
+#define GL_3DC_XY_AMD                                           0x87FA
+#endif
+
+/* GL_AMD_compressed_ATC_texture */
+#ifndef GL_AMD_compressed_ATC_texture
+#define GL_ATC_RGB_AMD                                          0x8C92
+#define GL_ATC_RGBA_EXPLICIT_ALPHA_AMD                          0x8C93
+#define GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD                      0x87EE
+#endif
+
+/*------------------------------------------------------------------------*
+ * EXT extension tokens
+ *------------------------------------------------------------------------*/
+
+/* GL_EXT_texture_filter_anisotropic */
+#ifndef GL_EXT_texture_filter_anisotropic
+#define GL_TEXTURE_MAX_ANISOTROPY_EXT                           0x84FE
+#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT                       0x84FF
+#endif
+
+/*------------------------------------------------------------------------*
+ * OES extension functions
+ *------------------------------------------------------------------------*/
+
+/* GL_OES_blend_equation_separate */
+#ifndef GL_OES_blend_equation_separate
+#define GL_OES_blend_equation_separate 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API void GL_APIENTRY glBlendEquationSeparateOES (GLenum modeRGB, GLenum modeAlpha);
+#endif
+typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONSEPARATEOESPROC) (GLenum modeRGB, GLenum modeAlpha);
+#endif
+
+/* GL_OES_blend_func_separate */
+#ifndef GL_OES_blend_func_separate
+#define GL_OES_blend_func_separate 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API void GL_APIENTRY glBlendFuncSeparateOES (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
+#endif
+typedef void (GL_APIENTRYP PFNGLBLENDFUNCSEPARATEOESPROC) (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
+#endif
+
+/* GL_OES_blend_subtract */
+#ifndef GL_OES_blend_subtract
+#define GL_OES_blend_subtract 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API void GL_APIENTRY glBlendEquationOES (GLenum mode);
+#endif
+typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONOESPROC) (GLenum mode);
+#endif
+
+/* GL_OES_byte_coordinates */
+#ifndef GL_OES_byte_coordinates
+#define GL_OES_byte_coordinates 1
+#endif
+
+/* GL_OES_compressed_ETC1_RGB8_texture */
+#ifndef GL_OES_compressed_ETC1_RGB8_texture
+#define GL_OES_compressed_ETC1_RGB8_texture 1
+#endif
+
+/* GL_OES_depth24 */
+#ifndef GL_OES_depth24
+#define GL_OES_depth24 1
+#endif
+
+/* GL_OES_depth32 */
+#ifndef GL_OES_depth32
+#define GL_OES_depth32 1
+#endif
+
+/* GL_OES_draw_texture */
+#ifndef GL_OES_draw_texture
+#define GL_OES_draw_texture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API void GL_APIENTRY glDrawTexsOES (GLshort x, GLshort y, GLshort z, GLshort width, GLshort height);
+GL_API void GL_APIENTRY glDrawTexiOES (GLint x, GLint y, GLint z, GLint width, GLint height);
+GL_API void GL_APIENTRY glDrawTexxOES (GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height);
+GL_API void GL_APIENTRY glDrawTexsvOES (const GLshort *coords);
+GL_API void GL_APIENTRY glDrawTexivOES (const GLint *coords);
+GL_API void GL_APIENTRY glDrawTexxvOES (const GLfixed *coords);
+GL_API void GL_APIENTRY glDrawTexfOES (GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height);
+GL_API void GL_APIENTRY glDrawTexfvOES (const GLfloat *coords);
+#endif
+typedef void (GL_APIENTRYP PFNGLDRAWTEXSOESPROC) (GLshort x, GLshort y, GLshort z, GLshort width, GLshort height);
+typedef void (GL_APIENTRYP PFNGLDRAWTEXIOESPROC) (GLint x, GLint y, GLint z, GLint width, GLint height);
+typedef void (GL_APIENTRYP PFNGLDRAWTEXXOESPROC) (GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height);
+typedef void (GL_APIENTRYP PFNGLDRAWTEXSVOESPROC) (const GLshort *coords);
+typedef void (GL_APIENTRYP PFNGLDRAWTEXIVOESPROC) (const GLint *coords);
+typedef void (GL_APIENTRYP PFNGLDRAWTEXXVOESPROC) (const GLfixed *coords);
+typedef void (GL_APIENTRYP PFNGLDRAWTEXFOESPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height);
+typedef void (GL_APIENTRYP PFNGLDRAWTEXFVOESPROC) (const GLfloat *coords);
+#endif
+
+/* GL_OES_EGL_image */
+#ifndef GL_OES_EGL_image
+#define GL_OES_EGL_image 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API void GL_APIENTRY glEGLImageTargetTexture2DOES (GLenum target, GLeglImageOES image);
+GL_API void GL_APIENTRY glEGLImageTargetRenderbufferStorageOES (GLenum target, GLeglImageOES image);
+#endif
+typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETTEXTURE2DOESPROC) (GLenum target, GLeglImageOES image);
+typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLeglImageOES image);
+#endif
+
+/* GL_OES_element_index_uint */
+#ifndef GL_OES_element_index_uint
+#define GL_OES_element_index_uint 1
+#endif
+
+/* GL_OES_extended_matrix_palette */
+#ifndef GL_OES_extended_matrix_palette
+#define GL_OES_extended_matrix_palette 1
+#endif
+
+/* GL_OES_fbo_render_mipmap */
+#ifndef GL_OES_fbo_render_mipmap
+#define GL_OES_fbo_render_mipmap 1
+#endif
+
+/* GL_OES_fixed_point */
+#ifndef GL_OES_fixed_point
+#define GL_OES_fixed_point 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API void GL_APIENTRY glAlphaFuncxOES (GLenum func, GLclampx ref);
+GL_API void GL_APIENTRY glClearColorxOES (GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha);
+GL_API void GL_APIENTRY glClearDepthxOES (GLclampx depth);
+GL_API void GL_APIENTRY glClipPlanexOES (GLenum plane, const GLfixed *equation);
+GL_API void GL_APIENTRY glColor4xOES (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha);
+GL_API void GL_APIENTRY glDepthRangexOES (GLclampx zNear, GLclampx zFar);
+GL_API void GL_APIENTRY glFogxOES (GLenum pname, GLfixed param);
+GL_API void GL_APIENTRY glFogxvOES (GLenum pname, const GLfixed *params);
+GL_API void GL_APIENTRY glFrustumxOES (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
+GL_API void GL_APIENTRY glGetClipPlanexOES (GLenum pname, GLfixed eqn[4]);
+GL_API void GL_APIENTRY glGetFixedvOES (GLenum pname, GLfixed *params);
+GL_API void GL_APIENTRY glGetLightxvOES (GLenum light, GLenum pname, GLfixed *params);
+GL_API void GL_APIENTRY glGetMaterialxvOES (GLenum face, GLenum pname, GLfixed *params);
+GL_API void GL_APIENTRY glGetTexEnvxvOES (GLenum env, GLenum pname, GLfixed *params);
+GL_API void GL_APIENTRY glGetTexParameterxvOES (GLenum target, GLenum pname, GLfixed *params);
+GL_API void GL_APIENTRY glLightModelxOES (GLenum pname, GLfixed param);
+GL_API void GL_APIENTRY glLightModelxvOES (GLenum pname, const GLfixed *params);
+GL_API void GL_APIENTRY glLightxOES (GLenum light, GLenum pname, GLfixed param);
+GL_API void GL_APIENTRY glLightxvOES (GLenum light, GLenum pname, const GLfixed *params);
+GL_API void GL_APIENTRY glLineWidthxOES (GLfixed width);
+GL_API void GL_APIENTRY glLoadMatrixxOES (const GLfixed *m);
+GL_API void GL_APIENTRY glMaterialxOES (GLenum face, GLenum pname, GLfixed param);
+GL_API void GL_APIENTRY glMaterialxvOES (GLenum face, GLenum pname, const GLfixed *params);
+GL_API void GL_APIENTRY glMultMatrixxOES (const GLfixed *m);
+GL_API void GL_APIENTRY glMultiTexCoord4xOES (GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q);
+GL_API void GL_APIENTRY glNormal3xOES (GLfixed nx, GLfixed ny, GLfixed nz);
+GL_API void GL_APIENTRY glOrthoxOES (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
+GL_API void GL_APIENTRY glPointParameterxOES (GLenum pname, GLfixed param);
+GL_API void GL_APIENTRY glPointParameterxvOES (GLenum pname, const GLfixed *params);
+GL_API void GL_APIENTRY glPointSizexOES (GLfixed size);
+GL_API void GL_APIENTRY glPolygonOffsetxOES (GLfixed factor, GLfixed units);
+GL_API void GL_APIENTRY glRotatexOES (GLfixed angle, GLfixed x, GLfixed y, GLfixed z);
+GL_API void GL_APIENTRY glSampleCoveragexOES (GLclampx value, GLboolean invert);
+GL_API void GL_APIENTRY glScalexOES (GLfixed x, GLfixed y, GLfixed z);
+GL_API void GL_APIENTRY glTexEnvxOES (GLenum target, GLenum pname, GLfixed param);
+GL_API void GL_APIENTRY glTexEnvxvOES (GLenum target, GLenum pname, const GLfixed *params);
+GL_API void GL_APIENTRY glTexParameterxOES (GLenum target, GLenum pname, GLfixed param);
+GL_API void GL_APIENTRY glTexParameterxvOES (GLenum target, GLenum pname, const GLfixed *params);
+GL_API void GL_APIENTRY glTranslatexOES (GLfixed x, GLfixed y, GLfixed z);
+#endif
+typedef void (GL_APIENTRYP PFNGLALPHAFUNCXOESPROC) (GLenum func, GLclampx ref);
+typedef void (GL_APIENTRYP PFNGLCLEARCOLORXOESPROC) (GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha);
+typedef void (GL_APIENTRYP PFNGLCLEARDEPTHXOESPROC) (GLclampx depth);
+typedef void (GL_APIENTRYP PFNGLCLIPPLANEXOESPROC) (GLenum plane, const GLfixed *equation);
+typedef void (GL_APIENTRYP PFNGLCOLOR4XOESPROC) (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha);
+typedef void (GL_APIENTRYP PFNGLDEPTHRANGEXOESPROC) (GLclampx zNear, GLclampx zFar);
+typedef void (GL_APIENTRYP PFNGLFOGXOESPROC) (GLenum pname, GLfixed param);
+typedef void (GL_APIENTRYP PFNGLFOGXVOESPROC) (GLenum pname, const GLfixed *params);
+typedef void (GL_APIENTRYP PFNGLFRUSTUMXOESPROC) (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
+typedef void (GL_APIENTRYP PFNGLGETCLIPPLANEXOESPROC) (GLenum pname, GLfixed eqn[4]);
+typedef void (GL_APIENTRYP PFNGLGETFIXEDVOESPROC) (GLenum pname, GLfixed *params);
+typedef void (GL_APIENTRYP PFNGLGETLIGHTXVOESPROC) (GLenum light, GLenum pname, GLfixed *params);
+typedef void (GL_APIENTRYP PFNGLGETMATERIALXVOESPROC) (GLenum face, GLenum pname, GLfixed *params);
+typedef void (GL_APIENTRYP PFNGLGETTEXENVXVOESPROC) (GLenum env, GLenum pname, GLfixed *params);
+typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERXVOESPROC) (GLenum target, GLenum pname, GLfixed *params);
+typedef void (GL_APIENTRYP PFNGLLIGHTMODELXOESPROC) (GLenum pname, GLfixed param);
+typedef void (GL_APIENTRYP PFNGLLIGHTMODELXVOESPROC) (GLenum pname, const GLfixed *params);
+typedef void (GL_APIENTRYP PFNGLLIGHTXOESPROC) (GLenum light, GLenum pname, GLfixed param);
+typedef void (GL_APIENTRYP PFNGLLIGHTXVOESPROC) (GLenum light, GLenum pname, const GLfixed *params);
+typedef void (GL_APIENTRYP PFNGLLINEWIDTHXOESPROC) (GLfixed width);
+typedef void (GL_APIENTRYP PFNGLLOADMATRIXXOESPROC) (const GLfixed *m);
+typedef void (GL_APIENTRYP PFNGLMATERIALXOESPROC) (GLenum face, GLenum pname, GLfixed param);
+typedef void (GL_APIENTRYP PFNGLMATERIALXVOESPROC) (GLenum face, GLenum pname, const GLfixed *params);
+typedef void (GL_APIENTRYP PFNGLMULTMATRIXXOESPROC) (const GLfixed *m);
+typedef void (GL_APIENTRYP PFNGLMULTITEXCOORD4XOESPROC) (GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q);
+typedef void (GL_APIENTRYP PFNGLNORMAL3XOESPROC) (GLfixed nx, GLfixed ny, GLfixed nz);
+typedef void (GL_APIENTRYP PFNGLORTHOXOESPROC) (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
+typedef void (GL_APIENTRYP PFNGLPOINTPARAMETERXOESPROC) (GLenum pname, GLfixed param);
+typedef void (GL_APIENTRYP PFNGLPOINTPARAMETERXVOESPROC) (GLenum pname, const GLfixed *params);
+typedef void (GL_APIENTRYP PFNGLPOINTSIZEXOESPROC) (GLfixed size);
+typedef void (GL_APIENTRYP PFNGLPOLYGONOFFSETXOESPROC) (GLfixed factor, GLfixed units);
+typedef void (GL_APIENTRYP PFNGLROTATEXOESPROC) (GLfixed angle, GLfixed x, GLfixed y, GLfixed z);
+typedef void (GL_APIENTRYP PFNGLSAMPLECOVERAGEXOESPROC) (GLclampx value, GLboolean invert);
+typedef void (GL_APIENTRYP PFNGLSCALEXOESPROC) (GLfixed x, GLfixed y, GLfixed z);
+typedef void (GL_APIENTRYP PFNGLTEXENVXOESPROC) (GLenum target, GLenum pname, GLfixed param);
+typedef void (GL_APIENTRYP PFNGLTEXENVXVOESPROC) (GLenum target, GLenum pname, const GLfixed *params);
+typedef void (GL_APIENTRYP PFNGLTEXPARAMETERXOESPROC) (GLenum target, GLenum pname, GLfixed param);
+typedef void (GL_APIENTRYP PFNGLTEXPARAMETERXVOESPROC) (GLenum target, GLenum pname, const GLfixed *params);
+typedef void (GL_APIENTRYP PFNGLTRANSLATEXOESPROC) (GLfixed x, GLfixed y, GLfixed z);
+#endif
+
+/* GL_OES_framebuffer_object */
+#ifndef GL_OES_framebuffer_object
+#define GL_OES_framebuffer_object 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API GLboolean GL_APIENTRY glIsRenderbufferOES (GLuint renderbuffer);
+GL_API void GL_APIENTRY glBindRenderbufferOES (GLenum target, GLuint renderbuffer);
+GL_API void GL_APIENTRY glDeleteRenderbuffersOES (GLsizei n, const GLuint* renderbuffers);
+GL_API void GL_APIENTRY glGenRenderbuffersOES (GLsizei n, GLuint* renderbuffers);
+GL_API void GL_APIENTRY glRenderbufferStorageOES (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+GL_API void GL_APIENTRY glGetRenderbufferParameterivOES (GLenum target, GLenum pname, GLint* params);
+GL_API GLboolean GL_APIENTRY glIsFramebufferOES (GLuint framebuffer);
+GL_API void GL_APIENTRY glBindFramebufferOES (GLenum target, GLuint framebuffer);
+GL_API void GL_APIENTRY glDeleteFramebuffersOES (GLsizei n, const GLuint* framebuffers);
+GL_API void GL_APIENTRY glGenFramebuffersOES (GLsizei n, GLuint* framebuffers);
+GL_API GLenum GL_APIENTRY glCheckFramebufferStatusOES (GLenum target);
+GL_API void GL_APIENTRY glFramebufferRenderbufferOES (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+GL_API void GL_APIENTRY glFramebufferTexture2DOES (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+GL_API void GL_APIENTRY glGetFramebufferAttachmentParameterivOES (GLenum target, GLenum attachment, GLenum pname, GLint* params);
+GL_API void GL_APIENTRY glGenerateMipmapOES (GLenum target);
+#endif
+typedef GLboolean (GL_APIENTRYP PFNGLISRENDERBUFFEROESPROC) (GLuint renderbuffer);
+typedef void (GL_APIENTRYP PFNGLBINDRENDERBUFFEROESPROC) (GLenum target, GLuint renderbuffer);
+typedef void (GL_APIENTRYP PFNGLDELETERENDERBUFFERSOESPROC) (GLsizei n, const GLuint* renderbuffers);
+typedef void (GL_APIENTRYP PFNGLGENRENDERBUFFERSOESPROC) (GLsizei n, GLuint* renderbuffers);
+typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (GL_APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVOESPROC) (GLenum target, GLenum pname, GLint* params);
+typedef GLboolean (GL_APIENTRYP PFNGLISFRAMEBUFFEROESPROC) (GLuint framebuffer);
+typedef void (GL_APIENTRYP PFNGLBINDFRAMEBUFFEROESPROC) (GLenum target, GLuint framebuffer);
+typedef void (GL_APIENTRYP PFNGLDELETEFRAMEBUFFERSOESPROC) (GLsizei n, const GLuint* framebuffers);
+typedef void (GL_APIENTRYP PFNGLGENFRAMEBUFFERSOESPROC) (GLsizei n, GLuint* framebuffers);
+typedef GLenum (GL_APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSOESPROC) (GLenum target);
+typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFEROESPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DOESPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+typedef void (GL_APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVOESPROC) (GLenum target, GLenum attachment, GLenum pname, GLint* params);
+typedef void (GL_APIENTRYP PFNGLGENERATEMIPMAPOESPROC) (GLenum target);
+#endif
+
+/* GL_OES_mapbuffer */
+#ifndef GL_OES_mapbuffer
+#define GL_OES_mapbuffer 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API void* GL_APIENTRY glMapBufferOES (GLenum target, GLenum access);
+GL_API GLboolean GL_APIENTRY glUnmapBufferOES (GLenum target);
+GL_API void GL_APIENTRY glGetBufferPointervOES (GLenum target, GLenum pname, void** params);
+#endif
+typedef void* (GL_APIENTRYP PFNGLMAPBUFFEROESPROC) (GLenum target, GLenum access);
+typedef GLboolean (GL_APIENTRYP PFNGLUNMAPBUFFEROESPROC) (GLenum target);
+typedef void (GL_APIENTRYP PFNGLGETBUFFERPOINTERVOESPROC) (GLenum target, GLenum pname, void** params);
+#endif
+
+/* GL_OES_matrix_get */
+#ifndef GL_OES_matrix_get
+#define GL_OES_matrix_get 1
+#endif
+
+/* GL_OES_matrix_palette */
+#ifndef GL_OES_matrix_palette
+#define GL_OES_matrix_palette 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API void GL_APIENTRY glCurrentPaletteMatrixOES (GLuint matrixpaletteindex);
+GL_API void GL_APIENTRY glLoadPaletteFromModelViewMatrixOES (void);
+GL_API void GL_APIENTRY glMatrixIndexPointerOES (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+GL_API void GL_APIENTRY glWeightPointerOES (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+#endif
+typedef void (GL_APIENTRYP PFNGLCURRENTPALETTEMATRIXOESPROC) (GLuint matrixpaletteindex);
+typedef void (GL_APIENTRYP PFNGLLOADPALETTEFROMMODELVIEWMATRIXOESPROC) (void);
+typedef void (GL_APIENTRYP PFNGLMATRIXINDEXPOINTEROESPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+typedef void (GL_APIENTRYP PFNGLWEIGHTPOINTEROESPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+#endif
+
+/* GL_OES_packed_depth_stencil */
+#ifndef GL_OES_packed_depth_stencil
+#define GL_OES_packed_depth_stencil 1
+#endif
+
+/* GL_OES_query_matrix */
+#ifndef GL_OES_query_matrix
+#define GL_OES_query_matrix 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API GLbitfield GL_APIENTRY glQueryMatrixxOES (GLfixed mantissa[16], GLint exponent[16]);
+#endif
+typedef GLbitfield (GL_APIENTRYP PFNGLQUERYMATRIXXOESPROC) (GLfixed mantissa[16], GLint exponent[16]);
+#endif
+
+/* GL_OES_rgb8_rgba8 */
+#ifndef GL_OES_rgb8_rgba8
+#define GL_OES_rgb8_rgba8 1
+#endif
+
+/* GL_OES_single_precision */
+#ifndef GL_OES_single_precision
+#define GL_OES_single_precision 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API void GL_APIENTRY glDepthRangefOES (GLclampf zNear, GLclampf zFar);
+GL_API void GL_APIENTRY glFrustumfOES (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
+GL_API void GL_APIENTRY glOrthofOES (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
+GL_API void GL_APIENTRY glClipPlanefOES (GLenum plane, const GLfloat *equation);
+GL_API void GL_APIENTRY glGetClipPlanefOES (GLenum pname, GLfloat eqn[4]);
+GL_API void GL_APIENTRY glClearDepthfOES (GLclampf depth);
+#endif
+typedef void (GL_APIENTRYP PFNGLDEPTHRANGEFOESPROC) (GLclampf zNear, GLclampf zFar);
+typedef void (GL_APIENTRYP PFNGLFRUSTUMFOESPROC) (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
+typedef void (GL_APIENTRYP PFNGLORTHOFOESPROC) (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
+typedef void (GL_APIENTRYP PFNGLCLIPPLANEFOESPROC) (GLenum plane, const GLfloat *equation);
+typedef void (GL_APIENTRYP PFNGLGETCLIPPLANEFOESPROC) (GLenum pname, GLfloat eqn[4]);
+typedef void (GL_APIENTRYP PFNGLCLEARDEPTHFOESPROC) (GLclampf depth);
+#endif
+
+/* GL_OES_stencil1 */
+#ifndef GL_OES_stencil1
+#define GL_OES_stencil1 1
+#endif
+
+/* GL_OES_stencil4 */
+#ifndef GL_OES_stencil4
+#define GL_OES_stencil4 1
+#endif
+
+/* GL_OES_stencil8 */
+#ifndef GL_OES_stencil8
+#define GL_OES_stencil8 1
+#endif
+
+/* GL_OES_stencil_wrap */
+#ifndef GL_OES_stencil_wrap
+#define GL_OES_stencil_wrap 1
+#endif
+
+/* GL_OES_texture_cube_map */
+#ifndef GL_OES_texture_cube_map
+#define GL_OES_texture_cube_map 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_API void GL_APIENTRY glTexGenfOES (GLenum coord, GLenum pname, GLfloat param);
+GL_API void GL_APIENTRY glTexGenfvOES (GLenum coord, GLenum pname, const GLfloat *params);
+GL_API void GL_APIENTRY glTexGeniOES (GLenum coord, GLenum pname, GLint param);
+GL_API void GL_APIENTRY glTexGenivOES (GLenum coord, GLenum pname, const GLint *params);
+GL_API void GL_APIENTRY glTexGenxOES (GLenum coord, GLenum pname, GLfixed param);
+GL_API void GL_APIENTRY glTexGenxvOES (GLenum coord, GLenum pname, const GLfixed *params);
+GL_API void GL_APIENTRY glGetTexGenfvOES (GLenum coord, GLenum pname, GLfloat *params);
+GL_API void GL_APIENTRY glGetTexGenivOES (GLenum coord, GLenum pname, GLint *params);
+GL_API void GL_APIENTRY glGetTexGenxvOES (GLenum coord, GLenum pname, GLfixed *params);
+#endif
+typedef void (GL_APIENTRYP PFNGLTEXGENFOESPROC) (GLenum coord, GLenum pname, GLfloat param);
+typedef void (GL_APIENTRYP PFNGLTEXGENFVOESPROC) (GLenum coord, GLenum pname, const GLfloat *params);
+typedef void (GL_APIENTRYP PFNGLTEXGENIOESPROC) (GLenum coord, GLenum pname, GLint param);
+typedef void (GL_APIENTRYP PFNGLTEXGENIVOESPROC) (GLenum coord, GLenum pname, const GLint *params);
+typedef void (GL_APIENTRYP PFNGLTEXGENXOESPROC) (GLenum coord, GLenum pname, GLfixed param);
+typedef void (GL_APIENTRYP PFNGLTEXGENXVOESPROC) (GLenum coord, GLenum pname, const GLfixed *params);
+typedef void (GL_APIENTRYP PFNGLGETTEXGENFVOESPROC) (GLenum coord, GLenum pname, GLfloat *params);
+typedef void (GL_APIENTRYP PFNGLGETTEXGENIVOESPROC) (GLenum coord, GLenum pname, GLint *params);
+typedef void (GL_APIENTRYP PFNGLGETTEXGENXVOESPROC) (GLenum coord, GLenum pname, GLfixed *params);
+#endif
+
+/* GL_OES_texture_env_crossbar */
+#ifndef GL_OES_texture_env_crossbar
+#define GL_OES_texture_env_crossbar 1
+#endif
+
+/* GL_OES_texture_mirrored_repeat */
+#ifndef GL_OES_texture_mirrored_repeat
+#define GL_OES_texture_mirrored_repeat 1
+#endif
+
+/*------------------------------------------------------------------------*
+ * AMD extension functions
+ *------------------------------------------------------------------------*/
+
+/* GL_AMD_compressed_3DC_texture */
+#ifndef GL_AMD_compressed_3DC_texture
+#define GL_AMD_compressed_3DC_texture 1
+#endif
+
+/* GL_AMD_compressed_ATC_texture */
+#ifndef GL_AMD_compressed_ATC_texture
+#define GL_AMD_compressed_ATC_texture 1
+#endif
+
+/*------------------------------------------------------------------------*
+ * EXT extension functions
+ *------------------------------------------------------------------------*/
+
+/* GL_EXT_texture_filter_anisotropic */
+#ifndef GL_EXT_texture_filter_anisotropic
+#define GL_EXT_texture_filter_anisotropic 1
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __glext_h_ */
+
diff --git a/ndk/platforms/android-4/include/GLES/glplatform.h b/ndk/platforms/android-4/include/GLES/glplatform.h
new file mode 100644
index 0000000..a38ea4c
--- /dev/null
+++ b/ndk/platforms/android-4/include/GLES/glplatform.h
@@ -0,0 +1,39 @@
+#ifndef __glplatform_h_
+#define __glplatform_h_
+
+/* $Revision: 7172 $ on $Date:: 2009-01-09 11:17:41 -0800 #$ */
+
+/*
+ * This document is licensed under the SGI Free Software B License Version
+ * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
+ */
+
+/* Platform-specific types and definitions for OpenGL ES 1.X  gl.h
+ * Last modified on 2008/12/19
+ *
+ * Adopters may modify khrplatform.h and this file to suit their platform.
+ * You are encouraged to submit all modifications to the Khronos group so that
+ * they can be included in future versions of this file.  Please submit changes
+ * by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla)
+ * by filing a bug against product "OpenGL-ES" component "Registry".
+ */
+
+#include <KHR/khrplatform.h>
+
+#ifndef GL_API
+#define GL_API      KHRONOS_APICALL
+#endif
+
+#if defined(__ANDROID__)
+
+#define GL_APIENTRY KHRONOS_APIENTRY
+
+// XXX: this should probably not be here
+#define GL_DIRECT_TEXTURE_2D_QUALCOMM               0x7E80
+
+// XXX: not sure how this is intended to be used
+#define GL_GLEXT_PROTOTYPES
+
+#endif
+
+#endif /* __glplatform_h_ */
diff --git a/ndk/platforms/android-4/include/KHR/khrplatform.h b/ndk/platforms/android-4/include/KHR/khrplatform.h
new file mode 100644
index 0000000..75bc551
--- /dev/null
+++ b/ndk/platforms/android-4/include/KHR/khrplatform.h
@@ -0,0 +1,243 @@
+#ifndef __khrplatform_h_
+#define __khrplatform_h_
+
+/*
+** Copyright (c) 2008-2009 The Khronos Group Inc.
+**
+** Permission is hereby granted, free of charge, to any person obtaining a
+** copy of this software and/or associated documentation files (the
+** "Materials"), to deal in the Materials without restriction, including
+** without limitation the rights to use, copy, modify, merge, publish,
+** distribute, sublicense, and/or sell copies of the Materials, and to
+** permit persons to whom the Materials are furnished to do so, subject to
+** the following conditions:
+**
+** The above copyright notice and this permission notice shall be included
+** in all copies or substantial portions of the Materials.
+**
+** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+*/
+
+/* Platform-specific types and definitions.
+ * $Revision: 7244 $ on $Date: 2009-01-20 17:06:59 -0800 (Tue, 20 Jan 2009) $
+ *
+ * Adopters may modify this file to suit their platform. Adopters are
+ * encouraged to submit platform specific modifications to the Khronos
+ * group so that they can be included in future versions of this file.
+ * Please submit changes by sending them to the public Khronos Bugzilla
+ * (http://khronos.org/bugzilla) by filing a bug against product
+ * "Khronos (general)" component "Registry".
+ *
+ * A predefined template which fills in some of the bug fields can be
+ * reached using http://tinyurl.com/khrplatform-h-bugreport, but you
+ * must create a Bugzilla login first.
+ *
+ *
+ * See the Implementer's Guidelines for information about where this file
+ * should be located on your system.
+ *    http://www.khronos.org/registry/implementers_guide.pdf
+ *
+ *
+ * This file should be included as
+ *        #include <KHR/khrplatform.h>
+ * by the Khronos API header file that uses its types and defines.
+ *
+ * The types in this file should only be used to define API-specific types.
+ * Types defined in this file:
+ *    khronos_int8_t              signed   8  bit
+ *    khronos_uint8_t             unsigned 8  bit
+ *    khronos_int16_t             signed   16 bit
+ *    khronos_uint16_t            unsigned 16 bit
+ *    khronos_int32_t             signed   32 bit
+ *    khronos_uint32_t            unsigned 32 bit
+ *    khronos_int64_t             signed   64 bit
+ *    khronos_uint64_t            unsigned 64 bit
+ *    khronos_intptr_t            signed   same number of bits as a pointer
+ *    khronos_uintptr_t           unsigned same number of bits as a pointer
+ *    khronos_ssize_t             signed   size
+ *    khronos_usize_t             unsigned size
+ *    khronos_float_t             signed   32 bit floating point
+ *    khronos_time_ns_t           unsigned 64 bit time in nanoseconds
+ *    khronos_utime_nanoseconds_t unsigned time interval or absolute time in
+ *                                         nanoseconds
+ *    khronos_stime_nanoseconds_t signed time interval in nanoseconds
+ *
+ * KHRONOS_SUPPORT_INT64 is 1 if 64 bit integers are supported; otherwise 0.
+ * KHRONOS_SUPPORT_FLOAT is 1 if floats are supported; otherwise 0.
+ *
+ *
+ * Macros defined in this file:
+ *    KHRONOS_APICALL
+ *    KHRONOS_APIENTRY
+ *    KHRONOS_APIATTRIBUTES
+ * These may be used in function prototypes as:
+ *      KHRONOS_APICALL void KHRONOS_APIENTRY funcname(
+ *                                  int arg1,
+ *                                  int arg2) KHRONOS_APIATTRIBUTES;
+ */
+
+/*-------------------------------------------------------------------------
+ * Definition of KHRONOS_APICALL
+ *-------------------------------------------------------------------------
+ * This precedes the return type of the function in the function prototype.
+ */
+#if defined(_WIN32) && !defined(__SCITECH_SNAP__)
+#   define KHRONOS_APICALL __declspec(dllimport)
+#elif defined (__SYMBIAN32__)
+#   define KHRONOS_APICALL IMPORT_C
+#elif defined(__ANDROID__)
+#   define KHRONOS_APICALL __attribute__((visibility("default")))
+#else
+#   define KHRONOS_APICALL
+#endif
+
+/*-------------------------------------------------------------------------
+ * Definition of KHRONOS_APIENTRY
+ *-------------------------------------------------------------------------
+ * This follows the return type of the function  and precedes the function
+ * name in the function prototype.
+ */
+#if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__SCITECH_SNAP__)
+    /* Win32 but not WinCE */
+#   define KHRONOS_APIENTRY __stdcall
+#else
+#   define KHRONOS_APIENTRY
+#endif
+
+/*-------------------------------------------------------------------------
+ * Definition of KHRONOS_APIATTRIBUTES
+ *-------------------------------------------------------------------------
+ * This follows the closing parenthesis of the function prototype arguments.
+ */
+#if defined (__ARMCC_2__)
+#define KHRONOS_APIATTRIBUTES __softfp
+#else
+#define KHRONOS_APIATTRIBUTES
+#endif
+
+/*-------------------------------------------------------------------------
+ * basic type definitions
+ *-----------------------------------------------------------------------*/
+#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__GNUC__) || defined(__SCO__) || defined(__USLC__)
+
+
+/*
+ * Using <stdint.h>
+ */
+#include <stdint.h>
+typedef int32_t                 khronos_int32_t;
+typedef uint32_t                khronos_uint32_t;
+typedef int64_t                 khronos_int64_t;
+typedef uint64_t                khronos_uint64_t;
+#define KHRONOS_SUPPORT_INT64   1
+#define KHRONOS_SUPPORT_FLOAT   1
+
+#elif defined(__VMS ) || defined(__sgi)
+
+/*
+ * Using <inttypes.h>
+ */
+#include <inttypes.h>
+typedef int32_t                 khronos_int32_t;
+typedef uint32_t                khronos_uint32_t;
+typedef int64_t                 khronos_int64_t;
+typedef uint64_t                khronos_uint64_t;
+#define KHRONOS_SUPPORT_INT64   1
+#define KHRONOS_SUPPORT_FLOAT   1
+
+#elif defined(_WIN32) && !defined(__SCITECH_SNAP__)
+
+/*
+ * Win32
+ */
+typedef __int32                 khronos_int32_t;
+typedef unsigned __int32        khronos_uint32_t;
+typedef __int64                 khronos_int64_t;
+typedef unsigned __int64        khronos_uint64_t;
+#define KHRONOS_SUPPORT_INT64   1
+#define KHRONOS_SUPPORT_FLOAT   1
+
+#elif defined(__sun__) || defined(__digital__)
+
+/*
+ * Sun or Digital
+ */
+typedef int                     khronos_int32_t;
+typedef unsigned int            khronos_uint32_t;
+#if defined(__arch64__) || defined(_LP64)
+typedef long int                khronos_int64_t;
+typedef unsigned long int       khronos_uint64_t;
+#else
+typedef long long int           khronos_int64_t;
+typedef unsigned long long int  khronos_uint64_t;
+#endif /* __arch64__ */
+#define KHRONOS_SUPPORT_INT64   1
+#define KHRONOS_SUPPORT_FLOAT   1
+
+#elif 0
+
+/*
+ * Hypothetical platform with no float or int64 support
+ */
+typedef int                     khronos_int32_t;
+typedef unsigned int            khronos_uint32_t;
+#define KHRONOS_SUPPORT_INT64   0
+#define KHRONOS_SUPPORT_FLOAT   0
+
+#else
+
+/*
+ * Generic fallback
+ */
+#include <stdint.h>
+typedef int32_t                 khronos_int32_t;
+typedef uint32_t                khronos_uint32_t;
+typedef int64_t                 khronos_int64_t;
+typedef uint64_t                khronos_uint64_t;
+#define KHRONOS_SUPPORT_INT64   1
+#define KHRONOS_SUPPORT_FLOAT   1
+
+#endif
+
+
+/*
+ * Types that are (so far) the same on all platforms
+ */
+typedef signed   char          khronos_int8_t;
+typedef unsigned char          khronos_uint8_t;
+typedef signed   short int     khronos_int16_t;
+typedef unsigned short int     khronos_uint16_t;
+typedef signed   long  int     khronos_intptr_t;
+typedef unsigned long  int     khronos_uintptr_t;
+typedef signed   long  int     khronos_ssize_t;
+typedef unsigned long  int     khronos_usize_t;
+
+#if KHRONOS_SUPPORT_FLOAT
+/*
+ * Float type
+ */
+typedef          float         khronos_float_t;
+#endif
+
+#if KHRONOS_SUPPORT_INT64
+/* Time types
+ *
+ * These types can be used to represent a time interval in nanoseconds or
+ * an absolute Unadjusted System Time.  Unadjusted System Time is the number
+ * of nanoseconds since some arbitrary system event (e.g. since the last
+ * time the system booted).  The Unadjusted System Time is an unsigned
+ * 64 bit value that wraps back to 0 every 584 years.  Time intervals
+ * may be either signed or unsigned.
+ */
+typedef khronos_uint64_t       khronos_utime_nanoseconds_t;
+typedef khronos_int64_t        khronos_stime_nanoseconds_t;
+#endif
+
+
+#endif /* __khrplatform_h_ */
diff --git a/ndk/platforms/android-4/samples/san-angeles/AndroidManifest.xml b/ndk/platforms/android-4/samples/san-angeles/AndroidManifest.xml
new file mode 100644
index 0000000..5ae6a8e
--- /dev/null
+++ b/ndk/platforms/android-4/samples/san-angeles/AndroidManifest.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+      package="com.example.SanAngeles"
+      android:versionCode="1"
+      android:versionName="1.0">
+    <application android:label="@string/app_name">
+        <activity android:name=".DemoActivity"
+                  android:label="@string/app_name">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.LAUNCHER" />
+            </intent-filter>
+        </activity>
+    </application>
+    <uses-sdk android:minSdkVersion="4" />
+</manifest> 
diff --git a/ndk/platforms/android-4/samples/san-angeles/default.properties b/ndk/platforms/android-4/samples/san-angeles/default.properties
new file mode 100644
index 0000000..9d79b12
--- /dev/null
+++ b/ndk/platforms/android-4/samples/san-angeles/default.properties
@@ -0,0 +1,11 @@
+# This file is automatically generated by Android Tools.
+# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
+# 
+# This file must be checked in Version Control Systems.
+# 
+# To customize properties used by the Ant build system use,
+# "build.properties", and override values to adapt the script to your
+# project structure.
+
+# Project target.
+target=android-4
diff --git a/ndk/platforms/android-4/samples/san-angeles/jni/Android.mk b/ndk/platforms/android-4/samples/san-angeles/jni/Android.mk
new file mode 100644
index 0000000..5663edf
--- /dev/null
+++ b/ndk/platforms/android-4/samples/san-angeles/jni/Android.mk
@@ -0,0 +1,17 @@
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := sanangeles
+
+LOCAL_CFLAGS := -DANDROID_NDK \
+                -DDISABLE_IMPORTGL
+
+LOCAL_SRC_FILES := \
+    importgl.c \
+    demo.c \
+    app-android.c \
+
+LOCAL_LDLIBS := -lGLESv1_CM -ldl -llog
+
+include $(BUILD_SHARED_LIBRARY)
diff --git a/ndk/platforms/android-4/samples/san-angeles/jni/README.txt b/ndk/platforms/android-4/samples/san-angeles/jni/README.txt
new file mode 100644
index 0000000..38b8a4a
--- /dev/null
+++ b/ndk/platforms/android-4/samples/san-angeles/jni/README.txt
@@ -0,0 +1,77 @@
+------------------------------------------------------------------------

+San Angeles Observation OpenGL ES version example

+Copyright 2004-2005 Jetro Lauha

+Web: http://iki.fi/jetro/

+See file license.txt for licensing information.

+------------------------------------------------------------------------

+

+This is an OpenGL ES port of the small self-running demonstration

+called "San Angeles Observation", which was first presented in the

+Assembly'2004 event. It won the first place in the 4 KB intro

+competition category.

+

+The demonstration features a sightseeing of a futuristic city

+having many different kind of buildings and items. Everything is

+flat shaded with three different lights.

+

+The original version was made for desktop with OpenGL. It was

+naturally heavily size optimized in order to fit it in the size

+limit. For this OpenGL ES version example much of the code is

+cleaned up and the sound is removed. Also detail level is lowered,

+although it still contains over 60000 faces.

+

+The Win32 (2000/XP) binary package of original version is

+available from this address: http://jet.ro/files/angeles.zip

+

+First version of this OpenGL ES port was submitted to the Khronos

+OpenGL ES Coding Challenge held in 2004-2005.

+

+As a code example, this source shows the following:

+  * How to create a minimal and portable ad hoc framework

+    for small testing/demonstration programs. This framework

+    compiles for both desktop and PocketPC Win32 environment,

+    and a separate source is included for Linux with X11.

+  * How to dynamically find and use the OpenGL ES DLL or

+    shared object, so that the library is not needed at

+    the compile/link stage.

+  * How to use the basic features of OpenGL ES 1.0/1.1

+    Common Lite, such as vertex arrays, color arrays and

+    lighting.

+  * How to create a self contained small demonstration

+    application with objects generated using procedural

+    algorithms.

+

+As the original version was optimized for size instead of

+performance, that holds true for this OpenGL ES version as

+well. Thus the performance could be significantly increased,

+for example by changing the code to use glDrawElements

+instead of glDrawArrays. The code uses only OpenGL ES 1.0

+Common Lite -level function calls without any extensions.

+

+The reference OpenGL ES implementations used for this application:

+  * Hybrid's OpenGL ES API Implementation (Gerbera) version 2.0.4

+    Prebuilt Win32 PC executable: SanOGLES-Gerbera.exe

+  * PowerVR MBX SDK, OpenGL ES Windows PC Emulation version 1.04.14.0170

+    Prebuilt Win32 PC executable: SanOGLES-PVRSDK.exe

+

+Note that DISABLE_IMPORTGL preprocessor macro can be used

+to specify not to use dynamic runtime binding of the library.

+You also need to define preprocessor macro PVRSDK to compile

+the source with PowerVR OpenGL ES SDK.

+

+The demo application is briefly tested with a few other OpenGL ES

+implementations as well (e.g. Vincent, GLESonGL on Linux, Dell

+Axim X50v). Most of these other implementations rendered the demo

+erroneously in some aspect. This may indicate that the demo source

+could still have some work to do with compatibility and correct

+API usage, although the non-conforming implementations are most

+probably unfinished as well.

+

+Thanks and Acknowledgements:

+

+* Toni Lönnberg (!Cube) created the music for original version, which

+  is not featured in this OpenGL ES port.

+* Sara Kapli (st Rana) for additional camera work.

+* Paul Bourke for information about the supershapes.

+

+------------------------------------------------------------------------

diff --git a/ndk/platforms/android-4/samples/san-angeles/jni/app-android.c b/ndk/platforms/android-4/samples/san-angeles/jni/app-android.c
new file mode 100644
index 0000000..0e552a7
--- /dev/null
+++ b/ndk/platforms/android-4/samples/san-angeles/jni/app-android.c
@@ -0,0 +1,112 @@
+/* San Angeles Observation OpenGL ES version example
+ * Copyright 2009 The Android Open Source Project
+ * All rights reserved.
+ *
+ * This source is free software; you can redistribute it and/or
+ * modify it under the terms of EITHER:
+ *   (1) The GNU Lesser General Public License as published by the Free
+ *       Software Foundation; either version 2.1 of the License, or (at
+ *       your option) any later version. The text of the GNU Lesser
+ *       General Public License is included with this source in the
+ *       file LICENSE-LGPL.txt.
+ *   (2) The BSD-style license that is included with this source in
+ *       the file LICENSE-BSD.txt.
+ *
+ * This source 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 files
+ * LICENSE-LGPL.txt and LICENSE-BSD.txt for more details.
+ */
+#include <jni.h>
+#include <sys/time.h>
+#include <time.h>
+#include <android/log.h>
+#include <stdint.h>
+
+int   gAppAlive   = 1;
+
+static int  sWindowWidth  = 320;
+static int  sWindowHeight = 480;
+static int  sDemoStopped  = 0;
+static long sTimeOffset   = 0;
+static int  sTimeOffsetInit = 0;
+static long sTimeStopped  = 0;
+
+static long
+_getTime(void)
+{
+    struct timeval  now;
+
+    gettimeofday(&now, NULL);
+    return (long)(now.tv_sec*1000 + now.tv_usec/1000);
+}
+
+/* Call to initialize the graphics state */
+void
+Java_com_example_SanAngeles_DemoRenderer_nativeInit( JNIEnv*  env )
+{
+    importGLInit();
+    appInit();
+    gAppAlive    = 1;
+    sDemoStopped = 0;
+    sTimeOffsetInit = 0;
+}
+
+void
+Java_com_example_SanAngeles_DemoRenderer_nativeResize( JNIEnv*  env, jobject  thiz, jint w, jint h )
+{
+    sWindowWidth  = w;
+    sWindowHeight = h;
+    __android_log_print(ANDROID_LOG_INFO, "SanAngeles", "resize w=%d h=%d", w, h);
+}
+
+/* Call to finalize the graphics state */
+void
+Java_com_example_SanAngeles_DemoRenderer_nativeDone( JNIEnv*  env )
+{
+    appDeinit();
+    importGLDeinit();
+}
+
+/* This is called to indicate to the render loop that it should
+ * stop as soon as possible.
+ */
+void
+Java_com_example_SanAngeles_DemoGLSurfaceView_nativePause( JNIEnv*  env )
+{
+    sDemoStopped = !sDemoStopped;
+    if (sDemoStopped) {
+        /* we paused the animation, so store the current
+         * time in sTimeStopped for future nativeRender calls */
+        sTimeStopped = _getTime();
+    } else {
+        /* we resumed the animation, so adjust the time offset
+         * to take care of the pause interval. */
+        sTimeOffset -= _getTime() - sTimeStopped;
+    }
+}
+
+/* Call to render the next GL frame */
+void
+Java_com_example_SanAngeles_DemoRenderer_nativeRender( JNIEnv*  env )
+{
+    long   curTime;
+
+    /* NOTE: if sDemoStopped is TRUE, then we re-render the same frame
+     *       on each iteration.
+     */
+    if (sDemoStopped) {
+        curTime = sTimeStopped + sTimeOffset;
+    } else {
+        curTime = _getTime() + sTimeOffset;
+        if (sTimeOffsetInit == 0) {
+            sTimeOffsetInit = 1;
+            sTimeOffset     = -curTime;
+            curTime         = 0;
+        }
+    }
+
+    //__android_log_print(ANDROID_LOG_INFO, "SanAngeles", "curTime=%ld", curTime);
+
+    appRender(curTime, sWindowWidth, sWindowHeight);
+}
diff --git a/ndk/platforms/android-4/samples/san-angeles/jni/app-linux.c b/ndk/platforms/android-4/samples/san-angeles/jni/app-linux.c
new file mode 100644
index 0000000..6b573f2
--- /dev/null
+++ b/ndk/platforms/android-4/samples/san-angeles/jni/app-linux.c
@@ -0,0 +1,247 @@
+/* San Angeles Observation OpenGL ES version example
+ * Copyright 2004-2005 Jetro Lauha
+ * All rights reserved.
+ * Web: http://iki.fi/jetro/
+ *
+ * This source is free software; you can redistribute it and/or
+ * modify it under the terms of EITHER:
+ *   (1) The GNU Lesser General Public License as published by the Free
+ *       Software Foundation; either version 2.1 of the License, or (at
+ *       your option) any later version. The text of the GNU Lesser
+ *       General Public License is included with this source in the
+ *       file LICENSE-LGPL.txt.
+ *   (2) The BSD-style license that is included with this source in
+ *       the file LICENSE-BSD.txt.
+ *
+ * This source 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 files
+ * LICENSE-LGPL.txt and LICENSE-BSD.txt for more details.
+ *
+ * $Id: app-linux.c,v 1.4 2005/02/08 18:42:48 tonic Exp $
+ * $Revision: 1.4 $
+ *
+ * Parts of this source file is based on test/example code from
+ * GLESonGL implementation by David Blythe. Here is copy of the
+ * license notice from that source:
+ *
+ * Copyright (C) 2003  David Blythe   All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * DAVID BLYTHE BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <sys/time.h>
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#include <X11/keysym.h>
+
+#include "importgl.h"
+
+#include "app.h"
+
+
+int gAppAlive = 1;
+
+static const char sAppName[] =
+    "San Angeles Observation OpenGL ES version example (Linux)";
+static Display *sDisplay;
+static Window sWindow;
+static int sWindowWidth = WINDOW_DEFAULT_WIDTH;
+static int sWindowHeight = WINDOW_DEFAULT_HEIGHT;
+static EGLDisplay sEglDisplay = EGL_NO_DISPLAY;
+static EGLConfig sEglConfig;
+static EGLContext sEglContext = EGL_NO_CONTEXT;
+static EGLSurface sEglSurface = EGL_NO_SURFACE;
+
+
+static void checkGLErrors()
+{
+    GLenum error = glGetError();
+    if (error != GL_NO_ERROR)
+        fprintf(stderr, "GL Error: 0x%04x\n", (int)error);
+}
+
+
+static void checkEGLErrors()
+{
+    EGLint error = eglGetError();
+    // GLESonGL seems to be returning 0 when there is no errors?
+    if (error && error != EGL_SUCCESS)
+        fprintf(stderr, "EGL Error: 0x%04x\n", (int)error);
+}
+
+
+// Initializes and opens both X11 display and OpenGL ES.
+static int initGraphics()
+{
+    static const EGLint configAttribs[] =
+    {
+#if (WINDOW_BPP == 16)
+        EGL_RED_SIZE,       5,
+        EGL_GREEN_SIZE,     5,
+        EGL_BLUE_SIZE,      5,
+#elif (WINDOW_BPP == 32)
+        EGL_RED_SIZE,       8,
+        EGL_GREEN_SIZE,     8,
+        EGL_BLUE_SIZE,      8,
+#else
+#error WINDOW_BPP must be 16 or 32
+#endif
+        EGL_DEPTH_SIZE,     16,
+        EGL_ALPHA_SIZE,     EGL_DONT_CARE,
+        EGL_STENCIL_SIZE,   EGL_DONT_CARE,
+        EGL_SURFACE_TYPE,   EGL_WINDOW_BIT,
+        EGL_NONE
+    };
+    EGLBoolean success;
+    EGLint numConfigs;
+    EGLint majorVersion;
+    EGLint minorVersion;
+
+    int importGLResult;
+    importGLResult = importGLInit();
+    if (!importGLResult)
+        return 0;
+
+    sDisplay = XOpenDisplay(NULL);
+
+    sEglDisplay = eglGetDisplay(sDisplay);
+    success = eglInitialize(sEglDisplay, &majorVersion, &minorVersion);
+    if (success != EGL_FALSE)
+        success = eglGetConfigs(sEglDisplay, NULL, 0, &numConfigs);
+    if (success != EGL_FALSE)
+        success = eglChooseConfig(sEglDisplay, configAttribs,
+                                  &sEglConfig, 1, &numConfigs);
+    if (success != EGL_FALSE)
+    {
+        sEglContext = eglCreateContext(sEglDisplay, sEglConfig, NULL, NULL);
+        if (sEglContext == EGL_NO_CONTEXT)
+            success = EGL_FALSE;
+    }
+    if (success != EGL_FALSE)
+    {
+        XSetWindowAttributes swa;
+        XVisualInfo *vi, tmp;
+        XSizeHints sh;
+        int n;
+        EGLint vid;
+
+        eglGetConfigAttrib(sEglDisplay, sEglConfig,
+                           EGL_NATIVE_VISUAL_ID, &vid);
+        tmp.visualid = vid;
+        vi = XGetVisualInfo(sDisplay, VisualIDMask, &tmp, &n);
+        swa.colormap = XCreateColormap(sDisplay,
+                                       RootWindow(sDisplay, vi->screen),
+                                       vi->visual, AllocNone);
+        sh.flags = PMinSize | PMaxSize;
+        sh.min_width = sh.max_width = sWindowWidth;
+        sh.min_height = sh.max_height = sWindowHeight;
+        swa.border_pixel = 0;
+        swa.event_mask = ExposureMask | StructureNotifyMask |
+                         KeyPressMask | ButtonPressMask | ButtonReleaseMask;
+        sWindow = XCreateWindow(sDisplay, RootWindow(sDisplay, vi->screen),
+                                0, 0, sWindowWidth, sWindowHeight,
+                                0, vi->depth, InputOutput, vi->visual,
+                                CWBorderPixel | CWColormap | CWEventMask,
+                                &swa);
+        XMapWindow(sDisplay, sWindow);
+        XSetStandardProperties(sDisplay, sWindow, sAppName, sAppName,
+                               None, (void *)0, 0, &sh);
+    }
+    if (success != EGL_FALSE)
+    {
+        sEglSurface = eglCreateWindowSurface(sEglDisplay, sEglConfig,
+                                             (NativeWindowType)sWindow, NULL);
+        if (sEglSurface == EGL_NO_SURFACE)
+            success = EGL_FALSE;
+    }
+    if (success != EGL_FALSE)
+        success = eglMakeCurrent(sEglDisplay, sEglSurface,
+                                 sEglSurface, sEglContext);
+
+    if (success == EGL_FALSE)
+        checkEGLErrors();
+
+    return success != EGL_FALSE;
+}
+
+
+static void deinitGraphics()
+{
+    eglMakeCurrent(sEglDisplay, NULL, NULL, NULL);
+    eglDestroyContext(sEglDisplay, sEglContext);
+    eglDestroySurface(sEglDisplay, sEglSurface);
+    eglTerminate(sEglDisplay);
+    importGLDeinit();
+}
+
+
+int main(int argc, char *argv[])
+{
+    // not referenced:
+    argc = argc;
+    argv = argv;
+
+    if (!initGraphics())
+    {
+        fprintf(stderr, "Graphics initialization failed.\n");
+        return EXIT_FAILURE;
+    }
+
+    appInit();
+
+    while (gAppAlive)
+    {
+        struct timeval timeNow;
+
+        while (XPending(sDisplay))
+        {
+            XEvent ev;
+            XNextEvent(sDisplay, &ev);
+            switch (ev.type)
+            {
+            case KeyPress:
+                {
+                    unsigned int keycode, keysym;
+                    keycode = ((XKeyEvent *)&ev)->keycode;
+                    keysym = XKeycodeToKeysym(sDisplay, keycode, 0);
+                    if (keysym == XK_Return || keysym == XK_Escape)
+                        gAppAlive = 0;
+                }
+                break;
+            }
+        }
+
+        if (gAppAlive)
+        {
+            gettimeofday(&timeNow, NULL);
+            appRender(timeNow.tv_sec * 1000 + timeNow.tv_usec / 1000,
+                      sWindowWidth, sWindowHeight);
+            checkGLErrors();
+            eglSwapBuffers(sEglDisplay, sEglSurface);
+            checkEGLErrors();
+        }
+    }
+
+    appDeinit();
+    deinitGraphics();
+
+    return EXIT_SUCCESS;
+}
diff --git a/ndk/platforms/android-4/samples/san-angeles/jni/app-win32.c b/ndk/platforms/android-4/samples/san-angeles/jni/app-win32.c
new file mode 100644
index 0000000..b47577e
--- /dev/null
+++ b/ndk/platforms/android-4/samples/san-angeles/jni/app-win32.c
@@ -0,0 +1,294 @@
+/* San Angeles Observation OpenGL ES version example
+ * Copyright 2004-2005 Jetro Lauha
+ * All rights reserved.
+ * Web: http://iki.fi/jetro/
+ *
+ * This source is free software; you can redistribute it and/or
+ * modify it under the terms of EITHER:
+ *   (1) The GNU Lesser General Public License as published by the Free
+ *       Software Foundation; either version 2.1 of the License, or (at
+ *       your option) any later version. The text of the GNU Lesser
+ *       General Public License is included with this source in the
+ *       file LICENSE-LGPL.txt.
+ *   (2) The BSD-style license that is included with this source in
+ *       the file LICENSE-BSD.txt.
+ *
+ * This source 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 files
+ * LICENSE-LGPL.txt and LICENSE-BSD.txt for more details.
+ *
+ * $Id: app-win32.c,v 1.6 2005/02/24 20:29:00 tonic Exp $
+ * $Revision: 1.6 $
+ */
+
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#include <tchar.h>
+#ifdef UNDER_CE
+#include <aygshell.h>
+#endif
+
+#include <stdio.h>
+
+#include "importgl.h"
+
+#include "app.h"
+
+
+int gAppAlive = 1;
+
+static HINSTANCE sInstance;
+
+static const _TCHAR sAppName[] =
+    _T("San Angeles Observation OpenGL ES version example (Win32)");
+static HWND sWnd;
+static int sWindowWidth = WINDOW_DEFAULT_WIDTH;
+static int sWindowHeight = WINDOW_DEFAULT_HEIGHT;
+static EGLDisplay sEglDisplay = EGL_NO_DISPLAY;
+static EGLConfig sEglConfig;
+static EGLContext sEglContext = EGL_NO_CONTEXT;
+static EGLSurface sEglSurface = EGL_NO_SURFACE;
+
+
+static void checkGLErrors()
+{
+    GLenum error = glGetError();
+    if (error != GL_NO_ERROR)
+    {
+        _TCHAR errorString[32];
+        _stprintf(errorString, _T("0x%04x"), error);
+        MessageBox(NULL, errorString, _T("GL Error"), MB_OK);
+    }
+}
+
+
+static void checkEGLErrors()
+{
+    EGLint error = eglGetError();
+    if (error != EGL_SUCCESS)
+    {
+        _TCHAR errorString[32];
+        _stprintf(errorString, _T("0x%04x"), error);
+        MessageBox(NULL, errorString, _T("EGL Initialization Error"), MB_OK);
+    }
+}
+
+
+static BOOL initEGL(HWND wnd)
+{
+    static const EGLint configAttribs[] =
+    {
+#if (WINDOW_BPP == 16)
+        EGL_RED_SIZE,       5,
+        EGL_GREEN_SIZE,     5,
+        EGL_BLUE_SIZE,      5,
+#elif (WINDOW_BPP == 32)
+        EGL_RED_SIZE,       8,
+        EGL_GREEN_SIZE,     8,
+        EGL_BLUE_SIZE,      8,
+#else
+#error WINDOW_BPP must be 16 or 32
+#endif
+        EGL_DEPTH_SIZE,     16,
+        EGL_ALPHA_SIZE,     EGL_DONT_CARE,
+        EGL_STENCIL_SIZE,   EGL_DONT_CARE,
+        EGL_SURFACE_TYPE,   EGL_WINDOW_BIT,
+        EGL_NONE
+    };
+    EGLBoolean success;
+    EGLint numConfigs;
+    EGLint majorVersion;
+    EGLint minorVersion;
+#ifdef PVRSDK
+    HDC dc;
+#endif // PVRSDK
+
+#ifndef DISABLE_IMPORTGL
+    int importGLResult;
+    importGLResult = importGLInit();
+    if (!importGLResult)
+        return FALSE;
+#endif // !DISABLE_IMPORTGL
+
+#ifdef PVRSDK
+    dc = GetDC(sWnd);
+    sEglDisplay = eglGetDisplay(dc);
+#else
+    sEglDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY);
+#endif // !PVRSDK
+    success = eglInitialize(sEglDisplay, &majorVersion, &minorVersion);
+    if (success != EGL_FALSE)
+        success = eglGetConfigs(sEglDisplay, NULL, 0, &numConfigs);
+    if (success != EGL_FALSE)
+        success = eglChooseConfig(sEglDisplay, configAttribs,
+                                  &sEglConfig, 1, &numConfigs);
+    if (success != EGL_FALSE)
+    {
+        sEglSurface = eglCreateWindowSurface(sEglDisplay, sEglConfig,
+                                             wnd, NULL);
+        if (sEglSurface == EGL_NO_SURFACE)
+            success = EGL_FALSE;
+    }
+    if (success != EGL_FALSE)
+    {
+        sEglContext = eglCreateContext(sEglDisplay, sEglConfig, NULL, NULL);
+        if (sEglContext == EGL_NO_CONTEXT)
+            success = EGL_FALSE;
+    }
+    if (success != EGL_FALSE)
+        success = eglMakeCurrent(sEglDisplay, sEglSurface,
+                                 sEglSurface, sEglContext);
+
+    if (success == EGL_FALSE)
+        checkEGLErrors();
+
+    return success;
+}
+
+
+static void deinitEGL()
+{
+    eglMakeCurrent(sEglDisplay, NULL, NULL, NULL);
+    eglDestroyContext(sEglDisplay, sEglContext);
+    eglDestroySurface(sEglDisplay, sEglSurface);
+    eglTerminate(sEglDisplay);
+#ifndef DISABLE_IMPORTGL
+    importGLDeinit();
+#endif // !DISABLE_IMPORTGL
+}
+
+
+static LRESULT CALLBACK wndProc(HWND wnd, UINT message,
+                                WPARAM wParam, LPARAM lParam)
+{
+    RECT rc;
+    int useDefWindowProc = 0;
+
+    switch (message)
+    {
+    case WM_CLOSE:
+        DestroyWindow(wnd);
+        gAppAlive = 0;
+        break;
+
+    case WM_DESTROY:
+        PostQuitMessage(0);
+        gAppAlive = 0;
+        break;
+
+    case WM_KEYDOWN:
+        if (wParam == VK_ESCAPE || wParam == VK_RETURN)
+            gAppAlive = 0;
+        useDefWindowProc = 1;
+        break;
+
+    case WM_KEYUP:
+        useDefWindowProc = 1;
+        break;
+
+    case WM_SIZE:
+        GetClientRect(sWnd, &rc);
+        sWindowWidth = rc.right;
+        sWindowHeight = rc.bottom;
+        break;
+
+    default:
+        useDefWindowProc = 1;
+    }
+
+    if (useDefWindowProc)
+        return DefWindowProc(wnd, message, wParam, lParam);
+    return 0;
+}
+
+
+int WINAPI WinMain(HINSTANCE instance, HINSTANCE prevInstance,
+                   LPTSTR cmdLine, int cmdShow)
+{
+    MSG msg;
+    WNDCLASS wc;
+    DWORD windowStyle;
+    int windowX, windowY;
+
+    // not referenced:
+    prevInstance = prevInstance;
+    cmdLine = cmdLine;
+
+
+    sInstance = instance;
+
+    // register class
+    wc.style = CS_HREDRAW | CS_VREDRAW;
+    wc.lpfnWndProc = (WNDPROC)wndProc;
+    wc.cbClsExtra = 0;
+    wc.cbWndExtra = 0;
+    wc.hInstance = sInstance;
+    wc.hIcon = NULL;
+    wc.hCursor = 0;
+    wc.hbrBackground = GetStockObject(BLACK_BRUSH);
+    wc.lpszMenuName = NULL;
+    wc.lpszClassName = sAppName;
+    if (!RegisterClass(&wc))
+        return FALSE;
+
+    // init instance
+    windowStyle = WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_VISIBLE;
+#ifdef UNDER_CE
+    sWindowWidth = GetSystemMetrics(SM_CXSCREEN);
+    sWindowHeight = GetSystemMetrics(SM_CYSCREEN);
+    windowX = windowY = 0;
+#else
+    windowStyle |= WS_OVERLAPPEDWINDOW;
+    windowX = CW_USEDEFAULT;
+    windowY = 0;
+#endif
+    sWnd = CreateWindow(sAppName, sAppName, windowStyle,
+                        windowX, windowY,
+                        sWindowWidth, sWindowHeight,
+                        NULL, NULL, instance, NULL);
+    if (!sWnd)
+        return FALSE;
+
+    ShowWindow(sWnd, cmdShow);
+
+#ifdef UNDER_CE
+    SHFullScreen(sWnd,
+                 SHFS_HIDETASKBAR | SHFS_HIDESIPBUTTON | SHFS_HIDESTARTICON);
+    MoveWindow(sWnd, 0, 0, sWindowWidth, sWindowHeight, TRUE);
+#endif
+
+    UpdateWindow(sWnd);
+
+    if (!initEGL(sWnd))
+        return FALSE;
+
+    appInit(sWindowWidth, sWindowHeight);
+
+    while (gAppAlive)
+    {
+        while (PeekMessage(&msg, sWnd, 0, 0, PM_NOREMOVE))
+        {
+            if (GetMessage(&msg, sWnd, 0, 0))
+            {
+                TranslateMessage(&msg);
+                DispatchMessage(&msg);
+            }
+            else
+                gAppAlive = 0;
+        }
+
+        if (gAppAlive)
+        {
+            appRender(GetTickCount(), sWindowWidth, sWindowHeight);
+            checkGLErrors();
+            eglSwapBuffers(sEglDisplay, sEglSurface);
+            checkEGLErrors();
+        }
+    }
+
+    appDeinit();
+    deinitEGL();
+
+    return 0;
+}
diff --git a/ndk/platforms/android-4/samples/san-angeles/jni/app.h b/ndk/platforms/android-4/samples/san-angeles/jni/app.h
new file mode 100644
index 0000000..70ebd35
--- /dev/null
+++ b/ndk/platforms/android-4/samples/san-angeles/jni/app.h
@@ -0,0 +1,56 @@
+/* San Angeles Observation OpenGL ES version example
+ * Copyright 2004-2005 Jetro Lauha
+ * All rights reserved.
+ * Web: http://iki.fi/jetro/
+ *
+ * This source is free software; you can redistribute it and/or
+ * modify it under the terms of EITHER:
+ *   (1) The GNU Lesser General Public License as published by the Free
+ *       Software Foundation; either version 2.1 of the License, or (at
+ *       your option) any later version. The text of the GNU Lesser
+ *       General Public License is included with this source in the
+ *       file LICENSE-LGPL.txt.
+ *   (2) The BSD-style license that is included with this source in
+ *       the file LICENSE-BSD.txt.
+ *
+ * This source 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 files
+ * LICENSE-LGPL.txt and LICENSE-BSD.txt for more details.
+ *
+ * $Id: app.h,v 1.14 2005/02/06 21:13:54 tonic Exp $
+ * $Revision: 1.14 $
+ */
+
+#ifndef APP_H_INCLUDED
+#define APP_H_INCLUDED
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#define WINDOW_DEFAULT_WIDTH    640
+#define WINDOW_DEFAULT_HEIGHT   480
+
+#define WINDOW_BPP              16
+
+
+// The simple framework expects the application code to define these functions.
+extern void appInit();
+extern void appDeinit();
+extern void appRender(long tick, int width, int height);
+
+/* Value is non-zero when application is alive, and 0 when it is closing.
+ * Defined by the application framework.
+ */
+extern int gAppAlive;
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif // !APP_H_INCLUDED
diff --git a/ndk/platforms/android-4/samples/san-angeles/jni/cams.h b/ndk/platforms/android-4/samples/san-angeles/jni/cams.h
new file mode 100644
index 0000000..2b1acb3
--- /dev/null
+++ b/ndk/platforms/android-4/samples/san-angeles/jni/cams.h
@@ -0,0 +1,65 @@
+/* San Angeles Observation OpenGL ES version example
+ * Copyright 2004-2005 Jetro Lauha
+ * All rights reserved.
+ * Web: http://iki.fi/jetro/
+ *
+ * This source is free software; you can redistribute it and/or
+ * modify it under the terms of EITHER:
+ *   (1) The GNU Lesser General Public License as published by the Free
+ *       Software Foundation; either version 2.1 of the License, or (at
+ *       your option) any later version. The text of the GNU Lesser
+ *       General Public License is included with this source in the
+ *       file LICENSE-LGPL.txt.
+ *   (2) The BSD-style license that is included with this source in
+ *       the file LICENSE-BSD.txt.
+ *
+ * This source 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 files
+ * LICENSE-LGPL.txt and LICENSE-BSD.txt for more details.
+ *
+ * $Id: cams.h,v 1.7 2005/01/31 22:15:15 tonic Exp $
+ * $Revision: 1.7 $
+ */
+
+#ifndef CAMS_H_INCLUDED
+#define CAMS_H_INCLUDED
+
+
+/* Length in milliseconds of one camera track base unit.
+ * The value originates from the music synchronization.
+ */
+#define CAMTRACK_LEN    5442
+
+
+// Camera track definition for one camera trucking shot.
+typedef struct
+{
+    /* Five parameters of src[5] and dest[5]:
+     * eyeX, eyeY, eyeZ, viewAngle, viewHeightOffs
+     */
+    short src[5], dest[5];
+    unsigned char dist;     // if >0, cam rotates around eye xy on dist * 0.1
+    unsigned char len;      // length multiplier
+} CAMTRACK;
+
+static CAMTRACK sCamTracks[] =
+{
+    { { 4500, 2700, 100, 70, -30 }, { 50, 50, -90, -100, 0 }, 20, 1 },
+    { { -1448, 4294, 25, 363, 0 }, { -136, 202, 125, -98, 100 }, 0, 1 },
+    { { 1437, 4930, 200, -275, -20 }, { 1684, 0, 0, 9, 0 }, 0, 1 },
+    { { 1800, 3609, 200, 0, 675 }, { 0, 0, 0, 300, 0 }, 0, 1 },
+    { { 923, 996, 50, 2336, -80 }, { 0, -20, -50, 0, 170 }, 0, 1 },
+    { { -1663, -43, 600, 2170, 0 }, { 20, 0, -600, 0, 100 }, 0, 1 },
+    { { 1049, -1420, 175, 2111, -17 }, { 0, 0, 0, -334, 0 }, 0, 2 },
+    { { 0, 0, 50, 300, 25 }, { 0, 0, 0, 300, 0 }, 70, 2 },
+    { { -473, -953, 3500, -353, -350 }, { 0, 0, -2800, 0, 0 }, 0, 2 },
+    { { 191, 1938, 35, 1139, -17 }, { 1205, -2909, 0, 0, 0 }, 0, 2 },
+    { { -1449, -2700, 150, 0, 0 }, { 0, 2000, 0, 0, 0 }, 0, 2 },
+    { { 5273, 4992, 650, 373, -50 }, { -4598, -3072, 0, 0, 0 }, 0, 2 },
+    { { 3223, -3282, 1075, -393, -25 }, { 1649, -1649, 0, 0, 0 }, 0, 2 }
+};
+#define CAMTRACK_COUNT (sizeof(camTracks) / sizeof(camTracks[0]))
+
+
+#endif // !CAMS_H_INCLUDED
diff --git a/ndk/platforms/android-4/samples/san-angeles/jni/demo.c b/ndk/platforms/android-4/samples/san-angeles/jni/demo.c
new file mode 100644
index 0000000..9cb73d1
--- /dev/null
+++ b/ndk/platforms/android-4/samples/san-angeles/jni/demo.c
@@ -0,0 +1,792 @@
+/* San Angeles Observation OpenGL ES version example
+ * Copyright 2004-2005 Jetro Lauha
+ * All rights reserved.
+ * Web: http://iki.fi/jetro/
+ *
+ * This source is free software; you can redistribute it and/or
+ * modify it under the terms of EITHER:
+ *   (1) The GNU Lesser General Public License as published by the Free
+ *       Software Foundation; either version 2.1 of the License, or (at
+ *       your option) any later version. The text of the GNU Lesser
+ *       General Public License is included with this source in the
+ *       file LICENSE-LGPL.txt.
+ *   (2) The BSD-style license that is included with this source in
+ *       the file LICENSE-BSD.txt.
+ *
+ * This source 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 files
+ * LICENSE-LGPL.txt and LICENSE-BSD.txt for more details.
+ *
+ * $Id: demo.c,v 1.10 2005/02/08 20:54:39 tonic Exp $
+ * $Revision: 1.10 $
+ */
+
+#include <stdlib.h>
+#include <math.h>
+#include <float.h>
+#include <assert.h>
+
+#include "importgl.h"
+
+#include "app.h"
+#include "shapes.h"
+#include "cams.h"
+
+
+// Total run length is 20 * camera track base unit length (see cams.h).
+#define RUN_LENGTH  (20 * CAMTRACK_LEN)
+#undef PI
+#define PI 3.1415926535897932f
+#define RANDOM_UINT_MAX 65535
+
+
+static unsigned long sRandomSeed = 0;
+
+static void seedRandom(unsigned long seed)
+{
+    sRandomSeed = seed;
+}
+
+static unsigned long randomUInt()
+{
+    sRandomSeed = sRandomSeed * 0x343fd + 0x269ec3;
+    return sRandomSeed >> 16;
+}
+
+
+// Capped conversion from float to fixed.
+static long floatToFixed(float value)
+{
+    if (value < -32768) value = -32768;
+    if (value > 32767) value = 32767;
+    return (long)(value * 65536);
+}
+
+#define FIXED(value) floatToFixed(value)
+
+
+// Definition of one GL object in this demo.
+typedef struct {
+    /* Vertex array and color array are enabled for all objects, so their
+     * pointers must always be valid and non-NULL. Normal array is not
+     * used by the ground plane, so when its pointer is NULL then normal
+     * array usage is disabled.
+     *
+     * Vertex array is supposed to use GL_FIXED datatype and stride 0
+     * (i.e. tightly packed array). Color array is supposed to have 4
+     * components per color with GL_UNSIGNED_BYTE datatype and stride 0.
+     * Normal array is supposed to use GL_FIXED datatype and stride 0.
+     */
+    GLfixed *vertexArray;
+    GLubyte *colorArray;
+    GLfixed *normalArray;
+    GLint vertexComponents;
+    GLsizei count;
+} GLOBJECT;
+
+
+static long sStartTick = 0;
+static long sTick = 0;
+
+static int sCurrentCamTrack = 0;
+static long sCurrentCamTrackStartTick = 0;
+static long sNextCamTrackStartTick = 0x7fffffff;
+
+static GLOBJECT *sSuperShapeObjects[SUPERSHAPE_COUNT] = { NULL };
+static GLOBJECT *sGroundPlane = NULL;
+
+
+typedef struct {
+    float x, y, z;
+} VECTOR3;
+
+
+static void freeGLObject(GLOBJECT *object)
+{
+    if (object == NULL)
+        return;
+    free(object->normalArray);
+    free(object->colorArray);
+    free(object->vertexArray);
+    free(object);
+}
+
+
+static GLOBJECT * newGLObject(long vertices, int vertexComponents,
+                              int useNormalArray)
+{
+    GLOBJECT *result;
+    result = (GLOBJECT *)malloc(sizeof(GLOBJECT));
+    if (result == NULL)
+        return NULL;
+    result->count = vertices;
+    result->vertexComponents = vertexComponents;
+    result->vertexArray = (GLfixed *)malloc(vertices * vertexComponents *
+                                            sizeof(GLfixed));
+    result->colorArray = (GLubyte *)malloc(vertices * 4 * sizeof(GLubyte));
+    if (useNormalArray)
+    {
+        result->normalArray = (GLfixed *)malloc(vertices * 3 *
+                                                sizeof(GLfixed));
+    }
+    else
+        result->normalArray = NULL;
+    if (result->vertexArray == NULL ||
+        result->colorArray == NULL ||
+        (useNormalArray && result->normalArray == NULL))
+    {
+        freeGLObject(result);
+        return NULL;
+    }
+    return result;
+}
+
+
+static void drawGLObject(GLOBJECT *object)
+{
+    assert(object != NULL);
+
+    glVertexPointer(object->vertexComponents, GL_FIXED,
+                    0, object->vertexArray);
+    glColorPointer(4, GL_UNSIGNED_BYTE, 0, object->colorArray);
+
+    // Already done in initialization:
+    //glEnableClientState(GL_VERTEX_ARRAY);
+    //glEnableClientState(GL_COLOR_ARRAY);
+
+    if (object->normalArray)
+    {
+        glNormalPointer(GL_FIXED, 0, object->normalArray);
+        glEnableClientState(GL_NORMAL_ARRAY);
+    }
+    else
+        glDisableClientState(GL_NORMAL_ARRAY);
+    glDrawArrays(GL_TRIANGLES, 0, object->count);
+}
+
+
+static void vector3Sub(VECTOR3 *dest, VECTOR3 *v1, VECTOR3 *v2)
+{
+    dest->x = v1->x - v2->x;
+    dest->y = v1->y - v2->y;
+    dest->z = v1->z - v2->z;
+}
+
+
+static void superShapeMap(VECTOR3 *point, float r1, float r2, float t, float p)
+{
+    // sphere-mapping of supershape parameters
+    point->x = (float)(cos(t) * cos(p) / r1 / r2);
+    point->y = (float)(sin(t) * cos(p) / r1 / r2);
+    point->z = (float)(sin(p) / r2);
+}
+
+
+static float ssFunc(const float t, const float *p)
+{
+    return (float)(pow(pow(fabs(cos(p[0] * t / 4)) / p[1], p[4]) +
+                       pow(fabs(sin(p[0] * t / 4)) / p[2], p[5]), 1 / p[3]));
+}
+
+
+// Creates and returns a supershape object.
+// Based on Paul Bourke's POV-Ray implementation.
+// http://astronomy.swin.edu.au/~pbourke/povray/supershape/
+static GLOBJECT * createSuperShape(const float *params)
+{
+    const int resol1 = (int)params[SUPERSHAPE_PARAMS - 3];
+    const int resol2 = (int)params[SUPERSHAPE_PARAMS - 2];
+    // latitude 0 to pi/2 for no mirrored bottom
+    // (latitudeBegin==0 for -pi/2 to pi/2 originally)
+    const int latitudeBegin = resol2 / 4;
+    const int latitudeEnd = resol2 / 2;    // non-inclusive
+    const int longitudeCount = resol1;
+    const int latitudeCount = latitudeEnd - latitudeBegin;
+    const long triangleCount = longitudeCount * latitudeCount * 2;
+    const long vertices = triangleCount * 3;
+    GLOBJECT *result;
+    float baseColor[3];
+    int a, longitude, latitude;
+    long currentVertex, currentQuad;
+
+    result = newGLObject(vertices, 3, 1);
+    if (result == NULL)
+        return NULL;
+
+    for (a = 0; a < 3; ++a)
+        baseColor[a] = ((randomUInt() % 155) + 100) / 255.f;
+
+    currentQuad = 0;
+    currentVertex = 0;
+
+    // longitude -pi to pi
+    for (longitude = 0; longitude < longitudeCount; ++longitude)
+    {
+
+        // latitude 0 to pi/2
+        for (latitude = latitudeBegin; latitude < latitudeEnd; ++latitude)
+        {
+            float t1 = -PI + longitude * 2 * PI / resol1;
+            float t2 = -PI + (longitude + 1) * 2 * PI / resol1;
+            float p1 = -PI / 2 + latitude * 2 * PI / resol2;
+            float p2 = -PI / 2 + (latitude + 1) * 2 * PI / resol2;
+            float r0, r1, r2, r3;
+
+            r0 = ssFunc(t1, params);
+            r1 = ssFunc(p1, &params[6]);
+            r2 = ssFunc(t2, params);
+            r3 = ssFunc(p2, &params[6]);
+
+            if (r0 != 0 && r1 != 0 && r2 != 0 && r3 != 0)
+            {
+                VECTOR3 pa, pb, pc, pd;
+                VECTOR3 v1, v2, n;
+                float ca;
+                int i;
+                //float lenSq, invLenSq;
+
+                superShapeMap(&pa, r0, r1, t1, p1);
+                superShapeMap(&pb, r2, r1, t2, p1);
+                superShapeMap(&pc, r2, r3, t2, p2);
+                superShapeMap(&pd, r0, r3, t1, p2);
+
+                // kludge to set lower edge of the object to fixed level
+                if (latitude == latitudeBegin + 1)
+                    pa.z = pb.z = 0;
+
+                vector3Sub(&v1, &pb, &pa);
+                vector3Sub(&v2, &pd, &pa);
+
+                // Calculate normal with cross product.
+                /*   i    j    k      i    j
+                 * v1.x v1.y v1.z | v1.x v1.y
+                 * v2.x v2.y v2.z | v2.x v2.y
+                 */
+
+                n.x = v1.y * v2.z - v1.z * v2.y;
+                n.y = v1.z * v2.x - v1.x * v2.z;
+                n.z = v1.x * v2.y - v1.y * v2.x;
+
+                /* Pre-normalization of the normals is disabled here because
+                 * they will be normalized anyway later due to automatic
+                 * normalization (GL_NORMALIZE). It is enabled because the
+                 * objects are scaled with glScale.
+                 */
+                /*
+                lenSq = n.x * n.x + n.y * n.y + n.z * n.z;
+                invLenSq = (float)(1 / sqrt(lenSq));
+                n.x *= invLenSq;
+                n.y *= invLenSq;
+                n.z *= invLenSq;
+                */
+
+                ca = pa.z + 0.5f;
+
+                for (i = currentVertex * 3;
+                     i < (currentVertex + 6) * 3;
+                     i += 3)
+                {
+                    result->normalArray[i] = FIXED(n.x);
+                    result->normalArray[i + 1] = FIXED(n.y);
+                    result->normalArray[i + 2] = FIXED(n.z);
+                }
+                for (i = currentVertex * 4;
+                     i < (currentVertex + 6) * 4;
+                     i += 4)
+                {
+                    int a, color[3];
+                    for (a = 0; a < 3; ++a)
+                    {
+                        color[a] = (int)(ca * baseColor[a] * 255);
+                        if (color[a] > 255) color[a] = 255;
+                    }
+                    result->colorArray[i] = (GLubyte)color[0];
+                    result->colorArray[i + 1] = (GLubyte)color[1];
+                    result->colorArray[i + 2] = (GLubyte)color[2];
+                    result->colorArray[i + 3] = 0;
+                }
+                result->vertexArray[currentVertex * 3] = FIXED(pa.x);
+                result->vertexArray[currentVertex * 3 + 1] = FIXED(pa.y);
+                result->vertexArray[currentVertex * 3 + 2] = FIXED(pa.z);
+                ++currentVertex;
+                result->vertexArray[currentVertex * 3] = FIXED(pb.x);
+                result->vertexArray[currentVertex * 3 + 1] = FIXED(pb.y);
+                result->vertexArray[currentVertex * 3 + 2] = FIXED(pb.z);
+                ++currentVertex;
+                result->vertexArray[currentVertex * 3] = FIXED(pd.x);
+                result->vertexArray[currentVertex * 3 + 1] = FIXED(pd.y);
+                result->vertexArray[currentVertex * 3 + 2] = FIXED(pd.z);
+                ++currentVertex;
+                result->vertexArray[currentVertex * 3] = FIXED(pb.x);
+                result->vertexArray[currentVertex * 3 + 1] = FIXED(pb.y);
+                result->vertexArray[currentVertex * 3 + 2] = FIXED(pb.z);
+                ++currentVertex;
+                result->vertexArray[currentVertex * 3] = FIXED(pc.x);
+                result->vertexArray[currentVertex * 3 + 1] = FIXED(pc.y);
+                result->vertexArray[currentVertex * 3 + 2] = FIXED(pc.z);
+                ++currentVertex;
+                result->vertexArray[currentVertex * 3] = FIXED(pd.x);
+                result->vertexArray[currentVertex * 3 + 1] = FIXED(pd.y);
+                result->vertexArray[currentVertex * 3 + 2] = FIXED(pd.z);
+                ++currentVertex;
+            } // r0 && r1 && r2 && r3
+            ++currentQuad;
+        } // latitude
+    } // longitude
+
+    // Set number of vertices in object to the actual amount created.
+    result->count = currentVertex;
+
+    return result;
+}
+
+
+static GLOBJECT * createGroundPlane()
+{
+    const int scale = 4;
+    const int yBegin = -15, yEnd = 15;    // ends are non-inclusive
+    const int xBegin = -15, xEnd = 15;
+    const long triangleCount = (yEnd - yBegin) * (xEnd - xBegin) * 2;
+    const long vertices = triangleCount * 3;
+    GLOBJECT *result;
+    int x, y;
+    long currentVertex, currentQuad;
+
+    result = newGLObject(vertices, 2, 0);
+    if (result == NULL)
+        return NULL;
+
+    currentQuad = 0;
+    currentVertex = 0;
+
+    for (y = yBegin; y < yEnd; ++y)
+    {
+        for (x = xBegin; x < xEnd; ++x)
+        {
+            GLubyte color;
+            int i, a;
+            color = (GLubyte)((randomUInt() & 0x5f) + 81);  // 101 1111
+            for (i = currentVertex * 4; i < (currentVertex + 6) * 4; i += 4)
+            {
+                result->colorArray[i] = color;
+                result->colorArray[i + 1] = color;
+                result->colorArray[i + 2] = color;
+                result->colorArray[i + 3] = 0;
+            }
+
+            // Axis bits for quad triangles:
+            // x: 011100 (0x1c), y: 110001 (0x31)  (clockwise)
+            // x: 001110 (0x0e), y: 100011 (0x23)  (counter-clockwise)
+            for (a = 0; a < 6; ++a)
+            {
+                const int xm = x + ((0x1c >> a) & 1);
+                const int ym = y + ((0x31 >> a) & 1);
+                const float m = (float)(cos(xm * 2) * sin(ym * 4) * 0.75f);
+                result->vertexArray[currentVertex * 2] =
+                    FIXED(xm * scale + m);
+                result->vertexArray[currentVertex * 2 + 1] =
+                    FIXED(ym * scale + m);
+                ++currentVertex;
+            }
+            ++currentQuad;
+        }
+    }
+    return result;
+}
+
+
+static void drawGroundPlane()
+{
+    glDisable(GL_CULL_FACE);
+    glDisable(GL_DEPTH_TEST);
+    glEnable(GL_BLEND);
+    glBlendFunc(GL_ZERO, GL_SRC_COLOR);
+    glDisable(GL_LIGHTING);
+
+    drawGLObject(sGroundPlane);
+
+    glEnable(GL_LIGHTING);
+    glDisable(GL_BLEND);
+    glEnable(GL_DEPTH_TEST);
+}
+
+
+static void drawFadeQuad()
+{
+    static const GLfixed quadVertices[] = {
+        -0x10000, -0x10000,
+         0x10000, -0x10000,
+        -0x10000,  0x10000,
+         0x10000, -0x10000,
+         0x10000,  0x10000,
+        -0x10000,  0x10000
+    };
+
+    const int beginFade = sTick - sCurrentCamTrackStartTick;
+    const int endFade = sNextCamTrackStartTick - sTick;
+    const int minFade = beginFade < endFade ? beginFade : endFade;
+
+    if (minFade < 1024)
+    {
+        const GLfixed fadeColor = minFade << 6;
+        glColor4x(fadeColor, fadeColor, fadeColor, 0);
+
+        glDisable(GL_DEPTH_TEST);
+        glEnable(GL_BLEND);
+        glBlendFunc(GL_ZERO, GL_SRC_COLOR);
+        glDisable(GL_LIGHTING);
+
+        glMatrixMode(GL_MODELVIEW);
+        glLoadIdentity();
+
+        glMatrixMode(GL_PROJECTION);
+        glLoadIdentity();
+
+        glDisableClientState(GL_COLOR_ARRAY);
+        glDisableClientState(GL_NORMAL_ARRAY);
+        glVertexPointer(2, GL_FIXED, 0, quadVertices);
+        glDrawArrays(GL_TRIANGLES, 0, 6);
+
+        glEnableClientState(GL_COLOR_ARRAY);
+
+        glMatrixMode(GL_MODELVIEW);
+
+        glEnable(GL_LIGHTING);
+        glDisable(GL_BLEND);
+        glEnable(GL_DEPTH_TEST);
+    }
+}
+
+
+// Called from the app framework.
+void appInit()
+{
+    int a;
+
+    glEnable(GL_NORMALIZE);
+    glEnable(GL_DEPTH_TEST);
+    glDisable(GL_CULL_FACE);
+    glShadeModel(GL_FLAT);
+
+    glEnable(GL_LIGHTING);
+    glEnable(GL_LIGHT0);
+    glEnable(GL_LIGHT1);
+    glEnable(GL_LIGHT2);
+
+    glEnableClientState(GL_VERTEX_ARRAY);
+    glEnableClientState(GL_COLOR_ARRAY);
+
+    seedRandom(15);
+
+    for (a = 0; a < SUPERSHAPE_COUNT; ++a)
+    {
+        sSuperShapeObjects[a] = createSuperShape(sSuperShapeParams[a]);
+        assert(sSuperShapeObjects[a] != NULL);
+    }
+    sGroundPlane = createGroundPlane();
+    assert(sGroundPlane != NULL);
+}
+
+
+// Called from the app framework.
+void appDeinit()
+{
+    int a;
+    for (a = 0; a < SUPERSHAPE_COUNT; ++a)
+        freeGLObject(sSuperShapeObjects[a]);
+    freeGLObject(sGroundPlane);
+}
+
+
+static void gluPerspective(GLfloat fovy, GLfloat aspect,
+                           GLfloat zNear, GLfloat zFar)
+{
+    GLfloat xmin, xmax, ymin, ymax;
+
+    ymax = zNear * (GLfloat)tan(fovy * PI / 360);
+    ymin = -ymax;
+    xmin = ymin * aspect;
+    xmax = ymax * aspect;
+
+    glFrustumx((GLfixed)(xmin * 65536), (GLfixed)(xmax * 65536),
+               (GLfixed)(ymin * 65536), (GLfixed)(ymax * 65536),
+               (GLfixed)(zNear * 65536), (GLfixed)(zFar * 65536));
+}
+
+
+static void prepareFrame(int width, int height)
+{
+    glViewport(0, 0, width, height);
+
+    glClearColorx((GLfixed)(0.1f * 65536),
+                  (GLfixed)(0.2f * 65536),
+                  (GLfixed)(0.3f * 65536), 0x10000);
+    glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
+
+    glMatrixMode(GL_PROJECTION);
+    glLoadIdentity();
+    gluPerspective(45, (float)width / height, 0.5f, 150);
+
+    glMatrixMode(GL_MODELVIEW);
+
+    glLoadIdentity();
+}
+
+
+static void configureLightAndMaterial()
+{
+    static GLfixed light0Position[] = { -0x40000, 0x10000, 0x10000, 0 };
+    static GLfixed light0Diffuse[] = { 0x10000, 0x6666, 0, 0x10000 };
+    static GLfixed light1Position[] = { 0x10000, -0x20000, -0x10000, 0 };
+    static GLfixed light1Diffuse[] = { 0x11eb, 0x23d7, 0x5999, 0x10000 };
+    static GLfixed light2Position[] = { -0x10000, 0, -0x40000, 0 };
+    static GLfixed light2Diffuse[] = { 0x11eb, 0x2b85, 0x23d7, 0x10000 };
+    static GLfixed materialSpecular[] = { 0x10000, 0x10000, 0x10000, 0x10000 };
+
+    glLightxv(GL_LIGHT0, GL_POSITION, light0Position);
+    glLightxv(GL_LIGHT0, GL_DIFFUSE, light0Diffuse);
+    glLightxv(GL_LIGHT1, GL_POSITION, light1Position);
+    glLightxv(GL_LIGHT1, GL_DIFFUSE, light1Diffuse);
+    glLightxv(GL_LIGHT2, GL_POSITION, light2Position);
+    glLightxv(GL_LIGHT2, GL_DIFFUSE, light2Diffuse);
+    glMaterialxv(GL_FRONT_AND_BACK, GL_SPECULAR, materialSpecular);
+
+    glMaterialx(GL_FRONT_AND_BACK, GL_SHININESS, 60 << 16);
+    glEnable(GL_COLOR_MATERIAL);
+}
+
+
+static void drawModels(float zScale)
+{
+    const int translationScale = 9;
+    int x, y;
+
+    seedRandom(9);
+
+    glScalex(1 << 16, 1 << 16, (GLfixed)(zScale * 65536));
+
+    for (y = -5; y <= 5; ++y)
+    {
+        for (x = -5; x <= 5; ++x)
+        {
+            float buildingScale;
+            GLfixed fixedScale;
+
+            int curShape = randomUInt() % SUPERSHAPE_COUNT;
+            buildingScale = sSuperShapeParams[curShape][SUPERSHAPE_PARAMS - 1];
+            fixedScale = (GLfixed)(buildingScale * 65536);
+
+            glPushMatrix();
+            glTranslatex((x * translationScale) * 65536,
+                         (y * translationScale) * 65536,
+                         0);
+            glRotatex((GLfixed)((randomUInt() % 360) << 16), 0, 0, 1 << 16);
+            glScalex(fixedScale, fixedScale, fixedScale);
+
+            drawGLObject(sSuperShapeObjects[curShape]);
+            glPopMatrix();
+        }
+    }
+
+    for (x = -2; x <= 2; ++x)
+    {
+        const int shipScale100 = translationScale * 500;
+        const int offs100 = x * shipScale100 + (sTick % shipScale100);
+        float offs = offs100 * 0.01f;
+        GLfixed fixedOffs = (GLfixed)(offs * 65536);
+        glPushMatrix();
+        glTranslatex(fixedOffs, -4 * 65536, 2 << 16);
+        drawGLObject(sSuperShapeObjects[SUPERSHAPE_COUNT - 1]);
+        glPopMatrix();
+        glPushMatrix();
+        glTranslatex(-4 * 65536, fixedOffs, 4 << 16);
+        glRotatex(90 << 16, 0, 0, 1 << 16);
+        drawGLObject(sSuperShapeObjects[SUPERSHAPE_COUNT - 1]);
+        glPopMatrix();
+    }
+}
+
+
+/* Following gluLookAt implementation is adapted from the
+ * Mesa 3D Graphics library. http://www.mesa3d.org
+ */
+static void gluLookAt(GLfloat eyex, GLfloat eyey, GLfloat eyez,
+	              GLfloat centerx, GLfloat centery, GLfloat centerz,
+	              GLfloat upx, GLfloat upy, GLfloat upz)
+{
+    GLfloat m[16];
+    GLfloat x[3], y[3], z[3];
+    GLfloat mag;
+
+    /* Make rotation matrix */
+
+    /* Z vector */
+    z[0] = eyex - centerx;
+    z[1] = eyey - centery;
+    z[2] = eyez - centerz;
+    mag = (float)sqrt(z[0] * z[0] + z[1] * z[1] + z[2] * z[2]);
+    if (mag) {			/* mpichler, 19950515 */
+        z[0] /= mag;
+        z[1] /= mag;
+        z[2] /= mag;
+    }
+
+    /* Y vector */
+    y[0] = upx;
+    y[1] = upy;
+    y[2] = upz;
+
+    /* X vector = Y cross Z */
+    x[0] = y[1] * z[2] - y[2] * z[1];
+    x[1] = -y[0] * z[2] + y[2] * z[0];
+    x[2] = y[0] * z[1] - y[1] * z[0];
+
+    /* Recompute Y = Z cross X */
+    y[0] = z[1] * x[2] - z[2] * x[1];
+    y[1] = -z[0] * x[2] + z[2] * x[0];
+    y[2] = z[0] * x[1] - z[1] * x[0];
+
+    /* mpichler, 19950515 */
+    /* cross product gives area of parallelogram, which is < 1.0 for
+     * non-perpendicular unit-length vectors; so normalize x, y here
+     */
+
+    mag = (float)sqrt(x[0] * x[0] + x[1] * x[1] + x[2] * x[2]);
+    if (mag) {
+        x[0] /= mag;
+        x[1] /= mag;
+        x[2] /= mag;
+    }
+
+    mag = (float)sqrt(y[0] * y[0] + y[1] * y[1] + y[2] * y[2]);
+    if (mag) {
+        y[0] /= mag;
+        y[1] /= mag;
+        y[2] /= mag;
+    }
+
+#define M(row,col)  m[col*4+row]
+    M(0, 0) = x[0];
+    M(0, 1) = x[1];
+    M(0, 2) = x[2];
+    M(0, 3) = 0.0;
+    M(1, 0) = y[0];
+    M(1, 1) = y[1];
+    M(1, 2) = y[2];
+    M(1, 3) = 0.0;
+    M(2, 0) = z[0];
+    M(2, 1) = z[1];
+    M(2, 2) = z[2];
+    M(2, 3) = 0.0;
+    M(3, 0) = 0.0;
+    M(3, 1) = 0.0;
+    M(3, 2) = 0.0;
+    M(3, 3) = 1.0;
+#undef M
+    {
+        int a;
+        GLfixed fixedM[16];
+        for (a = 0; a < 16; ++a)
+            fixedM[a] = (GLfixed)(m[a] * 65536);
+        glMultMatrixx(fixedM);
+    }
+
+    /* Translate Eye to Origin */
+    glTranslatex((GLfixed)(-eyex * 65536),
+                 (GLfixed)(-eyey * 65536),
+                 (GLfixed)(-eyez * 65536));
+}
+
+
+static void camTrack()
+{
+    float lerp[5];
+    float eX, eY, eZ, cX, cY, cZ;
+    float trackPos;
+    CAMTRACK *cam;
+    long currentCamTick;
+    int a;
+
+    if (sNextCamTrackStartTick <= sTick)
+    {
+        ++sCurrentCamTrack;
+        sCurrentCamTrackStartTick = sNextCamTrackStartTick;
+    }
+    sNextCamTrackStartTick = sCurrentCamTrackStartTick +
+                             sCamTracks[sCurrentCamTrack].len * CAMTRACK_LEN;
+
+    cam = &sCamTracks[sCurrentCamTrack];
+    currentCamTick = sTick - sCurrentCamTrackStartTick;
+    trackPos = (float)currentCamTick / (CAMTRACK_LEN * cam->len);
+
+    for (a = 0; a < 5; ++a)
+        lerp[a] = (cam->src[a] + cam->dest[a] * trackPos) * 0.01f;
+
+    if (cam->dist)
+    {
+        float dist = cam->dist * 0.1f;
+        cX = lerp[0];
+        cY = lerp[1];
+        cZ = lerp[2];
+        eX = cX - (float)cos(lerp[3]) * dist;
+        eY = cY - (float)sin(lerp[3]) * dist;
+        eZ = cZ - lerp[4];
+    }
+    else
+    {
+        eX = lerp[0];
+        eY = lerp[1];
+        eZ = lerp[2];
+        cX = eX + (float)cos(lerp[3]);
+        cY = eY + (float)sin(lerp[3]);
+        cZ = eZ + lerp[4];
+    }
+    gluLookAt(eX, eY, eZ, cX, cY, cZ, 0, 0, 1);
+}
+
+
+// Called from the app framework.
+/* The tick is current time in milliseconds, width and height
+ * are the image dimensions to be rendered.
+ */
+void appRender(long tick, int width, int height)
+{
+    if (sStartTick == 0)
+        sStartTick = tick;
+    if (!gAppAlive)
+        return;
+
+    // Actual tick value is "blurred" a little bit.
+    sTick = (sTick + tick - sStartTick) >> 1;
+
+    // Terminate application after running through the demonstration once.
+    if (sTick >= RUN_LENGTH)
+    {
+        gAppAlive = 0;
+        return;
+    }
+
+    // Prepare OpenGL ES for rendering of the frame.
+    prepareFrame(width, height);
+
+    // Update the camera position and set the lookat.
+    camTrack();
+
+    // Configure environment.
+    configureLightAndMaterial();
+
+    // Draw the reflection by drawing models with negated Z-axis.
+    glPushMatrix();
+    drawModels(-1);
+    glPopMatrix();
+
+    // Blend the ground plane to the window.
+    drawGroundPlane();
+
+    // Draw all the models normally.
+    drawModels(1);
+
+    // Draw fade quad over whole window (when changing cameras).
+    drawFadeQuad();
+}
diff --git a/ndk/platforms/android-4/samples/san-angeles/jni/importgl.c b/ndk/platforms/android-4/samples/san-angeles/jni/importgl.c
new file mode 100644
index 0000000..f501636
--- /dev/null
+++ b/ndk/platforms/android-4/samples/san-angeles/jni/importgl.c
@@ -0,0 +1,168 @@
+/* San Angeles Observation OpenGL ES version example
+ * Copyright 2004-2005 Jetro Lauha
+ * All rights reserved.
+ * Web: http://iki.fi/jetro/
+ *
+ * This source is free software; you can redistribute it and/or
+ * modify it under the terms of EITHER:
+ *   (1) The GNU Lesser General Public License as published by the Free
+ *       Software Foundation; either version 2.1 of the License, or (at
+ *       your option) any later version. The text of the GNU Lesser
+ *       General Public License is included with this source in the
+ *       file LICENSE-LGPL.txt.
+ *   (2) The BSD-style license that is included with this source in
+ *       the file LICENSE-BSD.txt.
+ *
+ * This source 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 files
+ * LICENSE-LGPL.txt and LICENSE-BSD.txt for more details.
+ *
+ * $Id: importgl.c,v 1.4 2005/02/08 18:42:55 tonic Exp $
+ * $Revision: 1.4 $
+ */
+
+#undef WIN32
+#undef LINUX
+#ifdef _MSC_VER
+// Desktop or mobile Win32 environment:
+#define WIN32
+#else
+// Linux environment:
+#define LINUX
+#endif
+
+#ifndef DISABLE_IMPORTGL
+
+#if defined(WIN32)
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#include <tchar.h>
+static HMODULE sGLESDLL = NULL;
+#endif // WIN32
+
+#ifdef LINUX
+#include <stdlib.h>
+#include <dlfcn.h>
+static void *sGLESSO = NULL;
+#endif // LINUX
+
+#endif /* DISABLE_IMPORTGL */
+
+#define IMPORTGL_NO_FNPTR_DEFS
+#define IMPORTGL_API
+#define IMPORTGL_FNPTRINIT = NULL
+#include "importgl.h"
+
+
+/* Imports function pointers to selected function calls in OpenGL ES Common
+ * or Common Lite profile DLL or shared object. The function pointers are
+ * stored as global symbols with equivalent function name but prefixed with
+ * "funcPtr_". Standard gl/egl calls are redirected to the function pointers
+ * with preprocessor macros (see importgl.h).
+ */
+int importGLInit()
+{
+    int result = 1;
+
+#ifndef DISABLE_IMPORTGL
+
+#undef IMPORT_FUNC
+
+#ifdef WIN32
+    sGLESDLL = LoadLibrary(_T("libGLES_CM.dll"));
+    if (sGLESDLL == NULL)
+        sGLESDLL = LoadLibrary(_T("libGLES_CL.dll"));
+    if (sGLESDLL == NULL)
+        return 0;   // Cannot find OpenGL ES Common or Common Lite DLL.
+
+    /* The following fetches address to each egl & gl function call
+     * and stores it to the related function pointer. Casting through
+     * void * results in warnings with VC warning level 4, which
+     * could be fixed by casting to the true type for each fetch.
+     */
+#define IMPORT_FUNC(funcName) do { \
+        void *procAddress = (void *)GetProcAddress(sGLESDLL, _T(#funcName)); \
+        if (procAddress == NULL) result = 0; \
+        *((void **)&FNPTR(funcName)) = procAddress; } while (0)
+#endif // WIN32
+
+#ifdef LINUX
+#ifdef ANDROID_NDK
+    sGLESSO = dlopen("libGLESv1_CM.so", RTLD_NOW);
+#else /* !ANDROID_NDK */
+    sGLESSO = dlopen("libGLES_CM.so", RTLD_NOW);
+    if (sGLESSO == NULL)
+        sGLESSO = dlopen("libGLES_CL.so", RTLD_NOW);
+#endif /* !ANDROID_NDK */
+    if (sGLESSO == NULL)
+        return 0;   // Cannot find OpenGL ES Common or Common Lite SO.
+
+#define IMPORT_FUNC(funcName) do { \
+        void *procAddress = (void *)dlsym(sGLESSO, #funcName); \
+        if (procAddress == NULL) result = 0; \
+        *((void **)&FNPTR(funcName)) = procAddress; } while (0)
+#endif // LINUX
+
+#ifndef ANDROID_NDK
+    IMPORT_FUNC(eglChooseConfig);
+    IMPORT_FUNC(eglCreateContext);
+    IMPORT_FUNC(eglCreateWindowSurface);
+    IMPORT_FUNC(eglDestroyContext);
+    IMPORT_FUNC(eglDestroySurface);
+    IMPORT_FUNC(eglGetConfigAttrib);
+    IMPORT_FUNC(eglGetConfigs);
+    IMPORT_FUNC(eglGetDisplay);
+    IMPORT_FUNC(eglGetError);
+    IMPORT_FUNC(eglInitialize);
+    IMPORT_FUNC(eglMakeCurrent);
+    IMPORT_FUNC(eglSwapBuffers);
+    IMPORT_FUNC(eglTerminate);
+#endif /* !ANDROID_NDK */
+
+    IMPORT_FUNC(glBlendFunc);
+    IMPORT_FUNC(glClear);
+    IMPORT_FUNC(glClearColorx);
+    IMPORT_FUNC(glColor4x);
+    IMPORT_FUNC(glColorPointer);
+    IMPORT_FUNC(glDisable);
+    IMPORT_FUNC(glDisableClientState);
+    IMPORT_FUNC(glDrawArrays);
+    IMPORT_FUNC(glEnable);
+    IMPORT_FUNC(glEnableClientState);
+    IMPORT_FUNC(glFrustumx);
+    IMPORT_FUNC(glGetError);
+    IMPORT_FUNC(glLightxv);
+    IMPORT_FUNC(glLoadIdentity);
+    IMPORT_FUNC(glMaterialx);
+    IMPORT_FUNC(glMaterialxv);
+    IMPORT_FUNC(glMatrixMode);
+    IMPORT_FUNC(glMultMatrixx);
+    IMPORT_FUNC(glNormalPointer);
+    IMPORT_FUNC(glPopMatrix);
+    IMPORT_FUNC(glPushMatrix);
+    IMPORT_FUNC(glRotatex);
+    IMPORT_FUNC(glScalex);
+    IMPORT_FUNC(glShadeModel);
+    IMPORT_FUNC(glTranslatex);
+    IMPORT_FUNC(glVertexPointer);
+    IMPORT_FUNC(glViewport);
+
+#endif /* DISABLE_IMPORTGL */
+
+    return result;
+}
+
+
+void importGLDeinit()
+{
+#ifndef DISABLE_IMPORTGL
+#ifdef WIN32
+    FreeLibrary(sGLESDLL);
+#endif
+
+#ifdef LINUX
+    dlclose(sGLESSO);
+#endif
+#endif /* DISABLE_IMPORTGL */
+}
diff --git a/ndk/platforms/android-4/samples/san-angeles/jni/importgl.h b/ndk/platforms/android-4/samples/san-angeles/jni/importgl.h
new file mode 100644
index 0000000..b05e0c8
--- /dev/null
+++ b/ndk/platforms/android-4/samples/san-angeles/jni/importgl.h
@@ -0,0 +1,172 @@
+/* San Angeles Observation OpenGL ES version example
+ * Copyright 2004-2005 Jetro Lauha
+ * All rights reserved.
+ * Web: http://iki.fi/jetro/
+ *
+ * This source is free software; you can redistribute it and/or
+ * modify it under the terms of EITHER:
+ *   (1) The GNU Lesser General Public License as published by the Free
+ *       Software Foundation; either version 2.1 of the License, or (at
+ *       your option) any later version. The text of the GNU Lesser
+ *       General Public License is included with this source in the
+ *       file LICENSE-LGPL.txt.
+ *   (2) The BSD-style license that is included with this source in
+ *       the file LICENSE-BSD.txt.
+ *
+ * This source 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 files
+ * LICENSE-LGPL.txt and LICENSE-BSD.txt for more details.
+ *
+ * $Id: importgl.h,v 1.4 2005/02/24 20:29:33 tonic Exp $
+ * $Revision: 1.4 $
+ */
+
+#ifndef IMPORTGL_H_INCLUDED
+#define IMPORTGL_H_INCLUDED
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include <GLES/gl.h>
+#ifndef ANDROID_NDK
+#include <GLES/egl.h>
+#endif /* !ANDROID_NDK */
+
+/* Use DISABLE_IMPORTGL if you want to link the OpenGL ES at
+ * compile/link time and not import it dynamically runtime.
+ */
+#ifndef DISABLE_IMPORTGL
+
+
+/* Dynamically fetches pointers to the egl & gl functions.
+ * Should be called once on application initialization.
+ * Returns non-zero on success and 0 on failure.
+ */
+extern int importGLInit();
+
+/* Frees the handle to egl & gl functions library.
+ */
+extern void importGLDeinit();
+
+
+#ifndef IMPORTGL_API
+#define IMPORTGL_API extern
+#endif
+#ifndef IMPORTGL_FNPTRINIT
+#define IMPORTGL_FNPTRINIT
+#endif
+
+#define FNDEF(retType, funcName, args) IMPORTGL_API retType (*funcPtr_##funcName) args IMPORTGL_FNPTRINIT
+
+#ifndef ANDROID_NDK
+FNDEF(EGLBoolean, eglChooseConfig, (EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config));
+FNDEF(EGLContext, eglCreateContext, (EGLDisplay dpy, EGLConfig config, EGLContext share_list, const EGLint *attrib_list));
+FNDEF(EGLSurface, eglCreateWindowSurface, (EGLDisplay dpy, EGLConfig config, NativeWindowType window, const EGLint *attrib_list));
+FNDEF(EGLBoolean, eglDestroyContext, (EGLDisplay dpy, EGLContext ctx));
+FNDEF(EGLBoolean, eglDestroySurface, (EGLDisplay dpy, EGLSurface surface));
+FNDEF(EGLBoolean, eglGetConfigAttrib, (EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value));
+FNDEF(EGLBoolean, eglGetConfigs, (EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config));
+FNDEF(EGLDisplay, eglGetDisplay, (NativeDisplayType display));
+FNDEF(EGLint, eglGetError, (void));
+FNDEF(EGLBoolean, eglInitialize, (EGLDisplay dpy, EGLint *major, EGLint *minor));
+FNDEF(EGLBoolean, eglMakeCurrent, (EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx));
+FNDEF(EGLBoolean, eglSwapBuffers, (EGLDisplay dpy, EGLSurface draw));
+FNDEF(EGLBoolean, eglTerminate, (EGLDisplay dpy));
+#endif /* !ANDROID_NDK */
+
+FNDEF(void, glBlendFunc, (GLenum sfactor, GLenum dfactor));
+FNDEF(void, glClear, (GLbitfield mask));
+FNDEF(void, glClearColorx, (GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha));
+FNDEF(void, glColor4x, (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha));
+FNDEF(void, glColorPointer, (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer));
+FNDEF(void, glDisable, (GLenum cap));
+FNDEF(void, glDisableClientState, (GLenum array));
+FNDEF(void, glDrawArrays, (GLenum mode, GLint first, GLsizei count));
+FNDEF(void, glEnable, (GLenum cap));
+FNDEF(void, glEnableClientState, (GLenum array));
+FNDEF(void, glFrustumx, (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar));
+FNDEF(GLenum, glGetError, (void));
+FNDEF(void, glLightxv, (GLenum light, GLenum pname, const GLfixed *params));
+FNDEF(void, glLoadIdentity, (void));
+FNDEF(void, glMaterialx, (GLenum face, GLenum pname, GLfixed param));
+FNDEF(void, glMaterialxv, (GLenum face, GLenum pname, const GLfixed *params));
+FNDEF(void, glMatrixMode, (GLenum mode));
+FNDEF(void, glMultMatrixx, (const GLfixed *m));
+FNDEF(void, glNormalPointer, (GLenum type, GLsizei stride, const GLvoid *pointer));
+FNDEF(void, glPopMatrix, (void));
+FNDEF(void, glPushMatrix, (void));
+FNDEF(void, glRotatex, (GLfixed angle, GLfixed x, GLfixed y, GLfixed z));
+FNDEF(void, glScalex, (GLfixed x, GLfixed y, GLfixed z));
+FNDEF(void, glShadeModel, (GLenum mode));
+FNDEF(void, glTranslatex, (GLfixed x, GLfixed y, GLfixed z));
+FNDEF(void, glVertexPointer, (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer));
+FNDEF(void, glViewport, (GLint x, GLint y, GLsizei width, GLsizei height));
+
+
+#undef FN
+#define FNPTR(name) funcPtr_##name
+
+#ifndef IMPORTGL_NO_FNPTR_DEFS
+
+// Redirect egl* and gl* function calls to funcPtr_egl* and funcPtr_gl*.
+
+#ifndef ANDROID_NDK
+#define eglChooseConfig         FNPTR(eglChooseConfig)
+#define eglCreateContext        FNPTR(eglCreateContext)
+#define eglCreateWindowSurface  FNPTR(eglCreateWindowSurface)
+#define eglDestroyContext       FNPTR(eglDestroyContext)
+#define eglDestroySurface       FNPTR(eglDestroySurface)
+#define eglGetConfigAttrib      FNPTR(eglGetConfigAttrib)
+#define eglGetConfigs           FNPTR(eglGetConfigs)
+#define eglGetDisplay           FNPTR(eglGetDisplay)
+#define eglGetError             FNPTR(eglGetError)
+#define eglInitialize           FNPTR(eglInitialize)
+#define eglMakeCurrent          FNPTR(eglMakeCurrent)
+#define eglSwapBuffers          FNPTR(eglSwapBuffers)
+#define eglTerminate            FNPTR(eglTerminate)
+#endif /* !ANDROID_NDK */
+
+#define glBlendFunc             FNPTR(glBlendFunc)
+#define glClear                 FNPTR(glClear)
+#define glClearColorx           FNPTR(glClearColorx)
+#define glColor4x               FNPTR(glColor4x)
+#define glColorPointer          FNPTR(glColorPointer)
+#define glDisable               FNPTR(glDisable)
+#define glDisableClientState    FNPTR(glDisableClientState)
+#define glDrawArrays            FNPTR(glDrawArrays)
+#define glEnable                FNPTR(glEnable)
+#define glEnableClientState     FNPTR(glEnableClientState)
+#define glFrustumx              FNPTR(glFrustumx)
+#define glGetError              FNPTR(glGetError)
+#define glLightxv               FNPTR(glLightxv)
+#define glLoadIdentity          FNPTR(glLoadIdentity)
+#define glMaterialx             FNPTR(glMaterialx)
+#define glMaterialxv            FNPTR(glMaterialxv)
+#define glMatrixMode            FNPTR(glMatrixMode)
+#define glMultMatrixx           FNPTR(glMultMatrixx)
+#define glNormalPointer         FNPTR(glNormalPointer)
+#define glPopMatrix             FNPTR(glPopMatrix)
+#define glPushMatrix            FNPTR(glPushMatrix)
+#define glRotatex               FNPTR(glRotatex)
+#define glScalex                FNPTR(glScalex)
+#define glShadeModel            FNPTR(glShadeModel)
+#define glTranslatex            FNPTR(glTranslatex)
+#define glVertexPointer         FNPTR(glVertexPointer)
+#define glViewport              FNPTR(glViewport)
+
+#endif // !IMPORTGL_NO_FNPTR_DEFS
+
+
+#endif // !DISABLE_IMPORTGL
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif // !IMPORTGL_H_INCLUDED
diff --git a/ndk/platforms/android-4/samples/san-angeles/jni/license-BSD.txt b/ndk/platforms/android-4/samples/san-angeles/jni/license-BSD.txt
new file mode 100644
index 0000000..8924e3c
--- /dev/null
+++ b/ndk/platforms/android-4/samples/san-angeles/jni/license-BSD.txt
@@ -0,0 +1,34 @@
+This is the BSD-style license for the "San Angeles Observation"

+OpenGL ES version example source code

+---------------------------------------------------------------

+

+San Angeles Observation OpenGL ES version example

+Copyright (c) 2004-2005, Jetro Lauha

+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.

+    * Neither the name of the software product's copyright owner nor

+      the names of its contributors may be used to endorse or promote

+      products derived from this software without specific prior written

+      permission.

+

+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS

+"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 COPYRIGHT

+OWNER OR CONTRIBUTORS 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.

diff --git a/ndk/platforms/android-4/samples/san-angeles/jni/license-LGPL.txt b/ndk/platforms/android-4/samples/san-angeles/jni/license-LGPL.txt
new file mode 100644
index 0000000..b1e3f5a
--- /dev/null
+++ b/ndk/platforms/android-4/samples/san-angeles/jni/license-LGPL.txt
@@ -0,0 +1,504 @@
+		  GNU LESSER GENERAL PUBLIC LICENSE
+		       Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+     59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL.  It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+  This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it.  You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+  When we speak of free software, we are referring to freedom of use,
+not price.  Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+  To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights.  These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+  For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you.  You must make sure that they, too, receive or can get the source
+code.  If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it.  And you must show them these terms so they know their rights.
+
+  We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+  To protect each distributor, we want to make it very clear that
+there is no warranty for the free library.  Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+  Finally, software patents pose a constant threat to the existence of
+any free program.  We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder.  Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+  Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License.  This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License.  We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+  When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library.  The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom.  The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+  We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License.  It also provides other free software developers Less
+of an advantage over competing non-free programs.  These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries.  However, the Lesser license provides advantages in certain
+special circumstances.
+
+  For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard.  To achieve this, non-free programs must be
+allowed to use the library.  A more frequent case is that a free
+library does the same job as widely used non-free libraries.  In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+  In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software.  For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+  Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.  Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library".  The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+		  GNU LESSER GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+  A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+  The "Library", below, refers to any such software library or work
+which has been distributed under these terms.  A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language.  (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+  "Source code" for a work means the preferred form of the work for
+making modifications to it.  For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+  Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it).  Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+  
+  1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+  You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+  2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) The modified work must itself be a software library.
+
+    b) You must cause the files modified to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    c) You must cause the whole of the work to be licensed at no
+    charge to all third parties under the terms of this License.
+
+    d) If a facility in the modified Library refers to a function or a
+    table of data to be supplied by an application program that uses
+    the facility, other than as an argument passed when the facility
+    is invoked, then you must make a good faith effort to ensure that,
+    in the event an application does not supply such function or
+    table, the facility still operates, and performs whatever part of
+    its purpose remains meaningful.
+
+    (For example, a function in a library to compute square roots has
+    a purpose that is entirely well-defined independent of the
+    application.  Therefore, Subsection 2d requires that any
+    application-supplied function or table used by this function must
+    be optional: if the application does not supply it, the square
+    root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library.  To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License.  (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.)  Do not make any other change in
+these notices.
+
+  Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+  This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+  4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+  If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library".  Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+  However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library".  The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+  When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library.  The
+threshold for this to be true is not precisely defined by law.
+
+  If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work.  (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+  Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+  6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+  You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License.  You must supply a copy of this License.  If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License.  Also, you must do one
+of these things:
+
+    a) Accompany the work with the complete corresponding
+    machine-readable source code for the Library including whatever
+    changes were used in the work (which must be distributed under
+    Sections 1 and 2 above); and, if the work is an executable linked
+    with the Library, with the complete machine-readable "work that
+    uses the Library", as object code and/or source code, so that the
+    user can modify the Library and then relink to produce a modified
+    executable containing the modified Library.  (It is understood
+    that the user who changes the contents of definitions files in the
+    Library will not necessarily be able to recompile the application
+    to use the modified definitions.)
+
+    b) Use a suitable shared library mechanism for linking with the
+    Library.  A suitable mechanism is one that (1) uses at run time a
+    copy of the library already present on the user's computer system,
+    rather than copying library functions into the executable, and (2)
+    will operate properly with a modified version of the library, if
+    the user installs one, as long as the modified version is
+    interface-compatible with the version that the work was made with.
+
+    c) Accompany the work with a written offer, valid for at
+    least three years, to give the same user the materials
+    specified in Subsection 6a, above, for a charge no more
+    than the cost of performing this distribution.
+
+    d) If distribution of the work is made by offering access to copy
+    from a designated place, offer equivalent access to copy the above
+    specified materials from the same place.
+
+    e) Verify that the user has already received a copy of these
+    materials or that you have already sent this user a copy.
+
+  For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it.  However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+  It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system.  Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+  7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+    a) Accompany the combined library with a copy of the same work
+    based on the Library, uncombined with any other library
+    facilities.  This must be distributed under the terms of the
+    Sections above.
+
+    b) Give prominent notice with the combined library of the fact
+    that part of it is a work based on the Library, and explaining
+    where to find the accompanying uncombined form of the same work.
+
+  8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License.  Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License.  However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+  9. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Library or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+  10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+  11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded.  In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+  13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation.  If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+  14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission.  For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this.  Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+			    NO WARRANTY
+
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+
+           How to Apply These Terms to Your New Libraries
+
+  If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change.  You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+  To apply these terms, attach the following notices to the library.  It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the library's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library 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
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the
+  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+  <signature of Ty Coon>, 1 April 1990
+  Ty Coon, President of Vice
+
+That's all there is to it!
+
+
diff --git a/ndk/platforms/android-4/samples/san-angeles/jni/license.txt b/ndk/platforms/android-4/samples/san-angeles/jni/license.txt
new file mode 100644
index 0000000..620841e
--- /dev/null
+++ b/ndk/platforms/android-4/samples/san-angeles/jni/license.txt
@@ -0,0 +1,19 @@
+San Angeles Observation OpenGL ES version example

+Copyright 2004-2005 Jetro Lauha

+All rights reserved.

+Web: http://iki.fi/jetro/

+

+This source is free software; you can redistribute it and/or

+modify it under the terms of EITHER:

+  (1) The GNU Lesser General Public License as published by the Free

+      Software Foundation; either version 2.1 of the License, or (at

+      your option) any later version. The text of the GNU Lesser

+      General Public License is included with this source in the

+      file LICENSE-LGPL.txt.

+  (2) The BSD-style license that is included with this source in

+      the file LICENSE-BSD.txt.

+

+This source 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 files

+LICENSE-LGPL.txt and LICENSE-BSD.txt for more details.

diff --git a/ndk/platforms/android-4/samples/san-angeles/jni/shapes.h b/ndk/platforms/android-4/samples/san-angeles/jni/shapes.h
new file mode 100644
index 0000000..25ffae8
--- /dev/null
+++ b/ndk/platforms/android-4/samples/san-angeles/jni/shapes.h
@@ -0,0 +1,59 @@
+/* San Angeles Observation OpenGL ES version example
+ * Copyright 2004-2005 Jetro Lauha
+ * All rights reserved.
+ * Web: http://iki.fi/jetro/
+ *
+ * This source is free software; you can redistribute it and/or
+ * modify it under the terms of EITHER:
+ *   (1) The GNU Lesser General Public License as published by the Free
+ *       Software Foundation; either version 2.1 of the License, or (at
+ *       your option) any later version. The text of the GNU Lesser
+ *       General Public License is included with this source in the
+ *       file LICENSE-LGPL.txt.
+ *   (2) The BSD-style license that is included with this source in
+ *       the file LICENSE-BSD.txt.
+ *
+ * This source 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 files
+ * LICENSE-LGPL.txt and LICENSE-BSD.txt for more details.
+ *
+ * $Id: shapes.h,v 1.6 2005/01/31 22:15:30 tonic Exp $
+ * $Revision: 1.6 $
+ */
+
+#ifndef SHAPES_H_INCLUDED
+#define SHAPES_H_INCLUDED
+
+
+#define SUPERSHAPE_PARAMS 15
+
+static const float sSuperShapeParams[][SUPERSHAPE_PARAMS] =
+{
+    // m  a     b     n1      n2     n3     m     a     b     n1     n2      n3   res1 res2 scale  (org.res1,res2)
+    { 10, 1,    2,    90,      1,   -45,    8,    1,    1,    -1,     1,  -0.4f,   20,  30, 2 }, // 40, 60
+    { 10, 1,    2,    90,      1,   -45,    4,    1,    1,    10,     1,  -0.4f,   20,  20, 4 }, // 40, 40
+    { 10, 1,    2,    60,      1,   -10,    4,    1,    1,    -1,    -2,  -0.4f,   41,  41, 1 }, // 82, 82
+    {  6, 1,    1,    60,      1,   -70,    8,    1,    1,  0.4f,     3,  0.25f,   20,  20, 1 }, // 40, 40
+    {  4, 1,    1,    30,      1,    20,   12,    1,    1,  0.4f,     3,  0.25f,   10,  30, 1 }, // 20, 60
+    {  8, 1,    1,    30,      1,    -4,    8,    2,    1,    -1,     5,   0.5f,   25,  26, 1 }, // 60, 60
+    { 13, 1,    1,    30,      1,    -4,   13,    1,    1,     1,     5,      1,   30,  30, 6 }, // 60, 60
+    { 10, 1, 1.1f, -0.5f,   0.1f,    70,   60,    1,    1,   -90,     0, -0.25f,   20,  60, 8 }, // 60, 180
+    {  7, 1,    1,    20,  -0.3f, -3.5f,    6,    1,    1,    -1,  4.5f,   0.5f,   10,  20, 4 }, // 60, 80
+    {  4, 1,    1,    10,     10,    10,    4,    1,    1,    10,    10,     10,   10,  20, 1 }, // 20, 40
+    {  4, 1,    1,     1,      1,     1,    4,    1,    1,     1,     1,      1,   10,  10, 2 }, // 10, 10
+    {  1, 1,    1,    38, -0.25f,    19,    4,    1,    1,    10,    10,     10,   10,  15, 2 }, // 20, 40
+    {  2, 1,    1,  0.7f,   0.3f,  0.2f,    3,    1,    1,   100,   100,    100,   10,  25, 2 }, // 20, 50
+    {  6, 1,    1,     1,      1,     1,    3,    1,    1,     1,     1,      1,   30,  30, 2 }, // 60, 60
+    {  3, 1,    1,     1,      1,     1,    6,    1,    1,     2,     1,      1,   10,  20, 2 }, // 20, 40
+    {  6, 1,    1,     6,   5.5f,   100,    6,    1,    1,    25,    10,     10,   30,  20, 2 }, // 60, 40
+    {  3, 1,    1,  0.5f,   1.7f,  1.7f,    2,    1,    1,    10,    10,     10,   20,  20, 2 }, // 40, 40
+    {  5, 1,    1,  0.1f,   1.7f,  1.7f,    1,    1,    1,  0.3f,  0.5f,   0.5f,   20,  20, 4 }, // 40, 40
+    {  2, 1,    1,     6,   5.5f,   100,    6,    1,    1,     4,    10,     10,   10,  22, 1 }, // 40, 40
+    {  6, 1,    1,    -1,     70,  0.1f,    9,    1, 0.5f,   -98, 0.05f,    -45,   20,  30, 4 }, // 60, 91
+    {  6, 1,    1,    -1,     90, -0.1f,    7,    1,    1,    90,  1.3f,     34,   13,  16, 1 }, // 32, 60
+};
+#define SUPERSHAPE_COUNT (sizeof(sSuperShapeParams) / sizeof(sSuperShapeParams[0]))
+
+
+#endif // !SHAPES_H_INCLUDED
diff --git a/ndk/platforms/android-4/samples/san-angeles/res/layout/main.xml b/ndk/platforms/android-4/samples/san-angeles/res/layout/main.xml
new file mode 100644
index 0000000..ca19a18
--- /dev/null
+++ b/ndk/platforms/android-4/samples/san-angeles/res/layout/main.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:orientation="vertical"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    >
+<TextView  
+    android:layout_width="match_parent" 
+    android:layout_height="wrap_content" 
+    android:text="Hello World, DemoActivity"
+    />
+</LinearLayout>
+
diff --git a/ndk/platforms/android-4/samples/san-angeles/res/values/strings.xml b/ndk/platforms/android-4/samples/san-angeles/res/values/strings.xml
new file mode 100644
index 0000000..b01f0ee
--- /dev/null
+++ b/ndk/platforms/android-4/samples/san-angeles/res/values/strings.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <string name="app_name">DemoActivity</string>
+</resources>
diff --git a/ndk/platforms/android-4/samples/san-angeles/src/com/example/SanAngeles/DemoActivity.java b/ndk/platforms/android-4/samples/san-angeles/src/com/example/SanAngeles/DemoActivity.java
new file mode 100644
index 0000000..696be78
--- /dev/null
+++ b/ndk/platforms/android-4/samples/san-angeles/src/com/example/SanAngeles/DemoActivity.java
@@ -0,0 +1,117 @@
+/*
+ * Copyright (C) 2009 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * This is a small port of the "San Angeles Observation" demo
+ * program for OpenGL ES 1.x. For more details, see:
+ *
+ *    http://jet.ro/visuals/san-angeles-observation/
+ *
+ * This program demonstrates how to use a GLSurfaceView from Java
+ * along with native OpenGL calls to perform frame rendering.
+ *
+ * Touching the screen will start/stop the animation.
+ *
+ * Note that the demo runs much faster on the emulator than on
+ * real devices, this is mainly due to the following facts:
+ *
+ * - the demo sends bazillions of polygons to OpenGL without
+ *   even trying to do culling. Most of them are clearly out
+ *   of view.
+ *
+ * - on a real device, the GPU bus is the real bottleneck
+ *   that prevent the demo from getting acceptable performance.
+ *
+ * - the software OpenGL engine used in the emulator uses
+ *   the system bus instead, and its code rocks :-)
+ *
+ * Fixing the program to send less polygons to the GPU is left
+ * as an exercise to the reader. As always, patches welcomed :-)
+ */
+package com.example.SanAngeles;
+
+import javax.microedition.khronos.egl.EGLConfig;
+import javax.microedition.khronos.opengles.GL10;
+
+import android.app.Activity;
+import android.content.Context;
+import android.opengl.GLSurfaceView;
+import android.os.Bundle;
+import android.view.MotionEvent;
+
+public class DemoActivity extends Activity {
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        mGLView = new DemoGLSurfaceView(this);
+        setContentView(mGLView);
+    }
+
+    @Override
+    protected void onPause() {
+        super.onPause();
+        mGLView.onPause();
+    }
+
+    @Override
+    protected void onResume() {
+        super.onResume();
+        mGLView.onResume();
+    }
+
+    private GLSurfaceView mGLView;
+
+    static {
+        System.loadLibrary("sanangeles");
+    }
+}
+
+class DemoGLSurfaceView extends GLSurfaceView {
+    public DemoGLSurfaceView(Context context) {
+        super(context);
+        mRenderer = new DemoRenderer();
+        setRenderer(mRenderer);
+    }
+
+    public boolean onTouchEvent(final MotionEvent event) {
+        if (event.getAction() == MotionEvent.ACTION_DOWN) {
+            nativePause();
+        }
+        return true;
+    }
+
+    DemoRenderer mRenderer;
+
+    private static native void nativePause();
+}
+
+class DemoRenderer implements GLSurfaceView.Renderer {
+    public void onSurfaceCreated(GL10 gl, EGLConfig config) {
+        nativeInit();
+    }
+
+    public void onSurfaceChanged(GL10 gl, int w, int h) {
+        //gl.glViewport(0, 0, w, h);
+        nativeResize(w, h);
+    }
+
+    public void onDrawFrame(GL10 gl) {
+        nativeRender();
+    }
+
+    private static native void nativeInit();
+    private static native void nativeResize(int w, int h);
+    private static native void nativeRender();
+    private static native void nativeDone();
+}
diff --git a/ndk/platforms/android-5/arch-arm/lib/libGLESv2.so b/ndk/platforms/android-5/arch-arm/lib/libGLESv2.so
new file mode 100644
index 0000000..fa6557b
--- /dev/null
+++ b/ndk/platforms/android-5/arch-arm/lib/libGLESv2.so
Binary files differ
diff --git a/ndk/platforms/android-5/arch-arm/lib/libc.so b/ndk/platforms/android-5/arch-arm/lib/libc.so
new file mode 100644
index 0000000..2483bf7
--- /dev/null
+++ b/ndk/platforms/android-5/arch-arm/lib/libc.so
Binary files differ
diff --git a/ndk/platforms/android-5/arch-arm/symbols/libc.so.txt b/ndk/platforms/android-5/arch-arm/symbols/libc.so.txt
new file mode 100644
index 0000000..47e9383
--- /dev/null
+++ b/ndk/platforms/android-5/arch-arm/symbols/libc.so.txt
@@ -0,0 +1,1085 @@
+
+.data.rel.ro
+.text
+MD5_Final
+MD5_Init
+MD5_Update
+SHA1Final
+SHA1Init
+SHA1Transform
+SHA1Update
+_C_ctype_
+_C_tolower_
+_C_toupper_
+_Unwind_Backtrace
+_Unwind_Complete
+_Unwind_DeleteException
+_Unwind_ForcedUnwind
+_Unwind_GetCFA
+_Unwind_GetDataRelBase
+_Unwind_GetLanguageSpecificData
+_Unwind_GetRegionStart
+_Unwind_GetTextRelBase
+_Unwind_RaiseException
+_Unwind_Resume
+_Unwind_Resume_or_Rethrow
+_Unwind_VRS_Get
+_Unwind_VRS_Pop
+_Unwind_VRS_Set
+___Unwind_Backtrace
+___Unwind_ForcedUnwind
+___Unwind_RaiseException
+___Unwind_Resume
+___Unwind_Resume_or_Rethrow
+__adddf3
+__addsf3
+__aeabi_atexit
+__aeabi_cdcmpeq
+__aeabi_cdcmple
+__aeabi_cdrcmple
+__aeabi_d2f
+__aeabi_d2iz
+__aeabi_dadd
+__aeabi_dcmpeq
+__aeabi_dcmpge
+__aeabi_dcmpgt
+__aeabi_dcmple
+__aeabi_dcmplt
+__aeabi_dcmpun
+__aeabi_ddiv
+__aeabi_dmul
+__aeabi_drsub
+__aeabi_dsub
+__aeabi_f2d
+__aeabi_f2iz
+__aeabi_fadd
+__aeabi_fcmpun
+__aeabi_fdiv
+__aeabi_fmul
+__aeabi_frsub
+__aeabi_fsub
+__aeabi_i2d
+__aeabi_i2f
+__aeabi_idiv
+__aeabi_idiv0
+__aeabi_idivmod
+__aeabi_l2d
+__aeabi_l2f
+__aeabi_ldiv0
+__aeabi_ldivmod
+__aeabi_lmul
+__aeabi_memclr
+__aeabi_memclr4
+__aeabi_memclr8
+__aeabi_memcpy
+__aeabi_memcpy4
+__aeabi_memcpy8
+__aeabi_memmove
+__aeabi_memmove4
+__aeabi_memmove8
+__aeabi_memset
+__aeabi_memset4
+__aeabi_memset8
+__aeabi_ui2d
+__aeabi_ui2f
+__aeabi_uidiv
+__aeabi_uidivmod
+__aeabi_ul2d
+__aeabi_ul2f
+__aeabi_uldivmod
+__aeabi_unwind_cpp_pr0
+__aeabi_unwind_cpp_pr1
+__aeabi_unwind_cpp_pr2
+__arc4_getbyte
+__assert
+__assert2
+__atexit
+__atexit_invalid
+__atexit_register_cleanup
+__atomic_cmpxchg
+__atomic_dec
+__atomic_inc
+__atomic_swap
+__b64_ntop
+__b64_pton
+__bionic_brk
+__bionic_libgcc_compat_hooks
+__brk
+__bss_end__
+__bss_start
+__bss_start__
+__clone
+__cmpdf2
+__cxa_atexit
+__cxa_begin_cleanup
+__cxa_call_unexpected
+__cxa_finalize
+__cxa_type_match
+__data_start
+__div0
+__divdf3
+__divdi3
+__divsf3
+__divsi3
+__dn_comp
+__dn_count_labels
+__dn_skipname
+__dorand48
+__dso_handle
+__dtoa
+__end__
+__eqdf2
+__errno
+__evAddTime
+__evCmpTime
+__evConsIovec
+__evConsTime
+__evNowTime
+__evOptMonoTime
+__evSubTime
+__evTimeSpec
+__evTimeVal
+__evUTCTime
+__exidx_end
+__exidx_start
+__extendsfdf2
+__fcntl
+__fcntl64
+__findenv
+__fixdfsi
+__fixsfsi
+__floatdidf
+__floatdisf
+__floatsidf
+__floatsisf
+__floatundidf
+__floatundisf
+__floatunsidf
+__floatunsisf
+__fork
+__fp_nquery
+__fp_query
+__fremovelock
+__futex_wait
+__futex_wake
+__gedf2
+__get_h_errno
+__get_pc
+__get_res_cache
+__get_sp
+__get_stack_base
+__get_thread
+__getcwd
+__getpriority
+__gnu_Unwind_Backtrace
+__gnu_Unwind_Find_exidx
+__gnu_Unwind_ForcedUnwind
+__gnu_Unwind_RaiseException
+__gnu_Unwind_Restore_VFP
+__gnu_Unwind_Restore_VFP_D
+__gnu_Unwind_Restore_VFP_D_16_to_31
+__gnu_Unwind_Restore_WMMXC
+__gnu_Unwind_Restore_WMMXD
+__gnu_Unwind_Resume
+__gnu_Unwind_Resume_or_Rethrow
+__gnu_Unwind_Save_VFP
+__gnu_Unwind_Save_VFP_D
+__gnu_Unwind_Save_VFP_D_16_to_31
+__gnu_Unwind_Save_WMMXC
+__gnu_Unwind_Save_WMMXD
+__gnu_ldivmod_helper
+__gnu_uldivmod_helper
+__gnu_unwind_execute
+__gnu_unwind_frame
+__gtdf2
+__hostalias
+__init_tls
+__ioctl
+__isthreaded
+__ledf2
+__libc_android_abort
+__libc_android_log_assert
+__libc_android_log_print
+__libc_android_log_vprint
+__libc_init
+__libc_init_common
+__libc_prenit
+__llseek
+__loc_aton
+__loc_ntoa
+__ltdf2
+__memcmp16
+__mmap2
+__muldf3
+__muldi3
+__mulsf3
+__nedf2
+__ns_format_ttl
+__ns_get16
+__ns_get32
+__ns_initparse
+__ns_makecanon
+__ns_msg_getflag
+__ns_name_compress
+__ns_name_ntol
+__ns_name_ntop
+__ns_name_pack
+__ns_name_pton
+__ns_name_rollback
+__ns_name_skip
+__ns_name_uncompress
+__ns_name_unpack
+__ns_parserr
+__ns_put16
+__ns_put32
+__ns_samename
+__ns_skiprr
+__ns_sprintrr
+__ns_sprintrrf
+__open
+__openat
+__p_cdname
+__p_cdnname
+__p_cert_syms
+__p_class
+__p_class_syms
+__p_default_section_syms
+__p_fqname
+__p_fqnname
+__p_key_syms
+__p_option
+__p_query
+__p_rcode
+__p_rcode_syms
+__p_secstodate
+__p_section
+__p_sockun
+__p_time
+__p_type
+__p_type_syms
+__p_update_section_syms
+__page_shift
+__page_size
+__pread64
+__progname
+__pthread_cleanup_pop
+__pthread_cleanup_push
+__pthread_clone
+__pthread_cond_timedwait
+__pthread_cond_timedwait_relative
+__ptrace
+__putlong
+__putshort
+__pwrite64
+__rand48_add
+__rand48_mult
+__rand48_seed
+__reboot
+__res_close
+__res_dnok
+__res_get_nibblesuffix
+__res_get_nibblesuffix2
+__res_get_state
+__res_get_static
+__res_getservers
+__res_hnok
+__res_hostalias
+__res_isourserver
+__res_mailok
+__res_nameinquery
+__res_nametoclass
+__res_nametotype
+__res_nclose
+__res_ndestroy
+__res_ninit
+__res_nmkquery
+__res_nopt
+__res_nquery
+__res_nquerydomain
+__res_nsearch
+__res_nsend
+__res_opt
+__res_ourserver_p
+__res_ownok
+__res_pquery
+__res_put_state
+__res_queriesmatch
+__res_querydomain
+__res_randomid
+__res_send
+__res_send_setqhook
+__res_send_setrhook
+__res_setservers
+__res_vinit
+__restore_core_regs
+__rt_sigaction
+__rt_sigprocmask
+__rt_sigtimedwait
+__sF
+__sFext
+__sclose
+__sdidinit
+__set_errno
+__set_syscall_errno
+__set_tls
+__sflags
+__sflush
+__sfp
+__sfvwrite
+__sglue
+__sigsuspend
+__sinit
+__slbexpand
+__smakebuf
+__sread
+__srefill
+__srget
+__sseek
+__stack_chk_fail
+__stack_chk_guard
+__statfs64
+__subdf3
+__subsf3
+__swbuf
+__swhatbuf
+__swrite
+__swsetup
+__sym_ntop
+__sym_ntos
+__sym_ston
+__syslog
+__system_properties_init
+__system_property_area__
+__system_property_find
+__system_property_find_nth
+__system_property_get
+__system_property_read
+__system_property_wait
+__thread_entry
+__timer_create
+__timer_delete
+__timer_getoverrun
+__timer_gettime
+__timer_settime
+__timer_table_start_stop
+__truncdfsf2
+__udivdi3
+__udivsi3
+__unorddf2
+__unordsf2
+__wait4
+_bss_end__
+_cleanup
+_ctype_
+_dns_gethtbyaddr
+_dns_gethtbyname
+_dorand48
+_edata
+_end
+_endhtent
+_exit
+_exit_thread
+_exit_with_stack_teardown
+_fwalk
+_gethtbyaddr
+_gethtbyname
+_gethtbyname2
+_gethtent
+_getlong
+_getshort
+_init_thread
+_longjmp
+_mktemp
+_nres
+_ns_flagdata
+_rand48_add
+_rand48_mult
+_rand48_seed
+_res_opcodes
+_resolv_cache_add
+_resolv_cache_create
+_resolv_cache_lookup
+_resolv_cache_reset
+_sethtent
+_setjmp
+_stack
+_thread_atexit_lock
+_thread_atexit_unlock
+_thread_created_hook
+_tolower_tab_
+_toupper_tab_
+abort
+accept
+access
+acct
+alarm
+alphasort
+arc4random
+arc4random_addrandom
+arc4random_buf
+arc4random_stir
+arc4random_uniform
+asctime
+asctime64
+asctime64_r
+asctime_r
+asprintf
+atexit
+atoi
+atol
+atoll
+basename
+basename_r
+bcopy
+bind
+bindresvport
+brk
+bsd_signal
+bsearch
+btowc
+bzero
+cacheflush
+calloc
+capget
+capset
+chdir
+chmod
+chown
+chroot
+clearerr
+clock
+clock_getres
+clock_gettime
+clock_nanosleep
+clock_settime
+close
+closedir
+closelog
+closelog_r
+connect
+copy_TM_to_tm
+copy_tm_to_TM
+creat
+ctime
+ctime64
+ctime64_r
+ctime_r
+daemon
+delete_module
+difftime
+dirfd
+dirname
+dirname_r
+div
+dlindependent_calloc
+dlindependent_comalloc
+dlmallinfo
+dlmalloc_footprint
+dlmalloc_max_footprint
+dlmalloc_stats
+dlmalloc_trim
+dlmalloc_usable_size
+dlmalloc_walk_free_pages
+dlmalloc_walk_heap
+dlmallopt
+dlpvalloc
+dlvalloc
+dn_expand
+dns_change_prop
+dns_last_change_counter
+drand48
+dup
+dup2
+endpwent
+endservent
+endutent
+environ
+epoll_create
+epoll_ctl
+epoll_wait
+erand48
+execl
+execle
+execlp
+execv
+execve
+execvp
+exit
+fake_gmtime_r
+fake_localtime_r
+fchdir
+fchmod
+fchmodat
+fchown
+fchownat
+fclose
+fcntl
+fdopen
+fdopendir
+feof
+ferror
+fflush
+ffs
+fgetc
+fgetln
+fgetpos
+fgets
+fgetwc
+fgetws
+fileno
+flock
+flockfile
+fnmatch
+fopen
+fork
+fpathconf
+fprintf
+fpurge
+fputc
+fputs
+fputwc
+fputws
+fread
+free
+free_malloc_leak_info
+freeaddrinfo
+freedtoa
+freopen
+fscanf
+fseek
+fseeko
+fsetpos
+fstat
+fstatat
+fstatfs
+fsync
+ftell
+ftello
+ftime
+ftok
+ftruncate
+ftrylockfile
+funlockfile
+funopen
+futex
+fwide
+fwprintf
+fwrite
+fwscanf
+gMallocLeakZygoteChild
+gai_strerror
+get_malloc_leak_info
+getaddrinfo
+getc
+getc_unlocked
+getchar
+getchar_unlocked
+getcwd
+getdents
+getdtablesize
+getegid
+getenv
+geteuid
+getgid
+getgrgid
+getgrnam
+getgrouplist
+getgroups
+gethostbyaddr
+gethostbyname
+gethostbyname2
+gethostbyname_r
+gethostent
+gethostname
+getitimer
+getlogin
+getmntent
+getnameinfo
+getnetbyaddr
+getnetbyname
+getopt
+getopt_long
+getopt_long_only
+getpeername
+getpgid
+getpgrp
+getpid
+getppid
+getpriority
+getprotobyname
+getprotobynumber
+getpt
+getpwnam
+getpwuid
+getresgid
+getresuid
+getrlimit
+getrusage
+gets
+getservbyname
+getservbyport
+getservent
+getservent_r
+getsockname
+getsockopt
+gettid
+gettimeofday
+getuid
+getutent
+getwc
+getwchar
+gmtime
+gmtime64
+gmtime64_r
+gmtime_r
+h_errlist
+h_nerr
+herror
+hstrerror
+if_indextoname
+if_nametoindex
+index
+inet_addr
+inet_aton
+inet_nsap_addr
+inet_nsap_ntoa
+inet_ntoa
+inet_ntop
+inet_pton
+init_module
+initgroups
+inotify_add_watch
+inotify_init
+inotify_rm_watch
+ioctl
+isalnum
+isalpha
+isascii
+isatty
+isblank
+iscntrl
+isdigit
+isgraph
+islower
+isprint
+ispunct
+issetugid
+isspace
+isupper
+iswalnum
+iswalpha
+iswcntrl
+iswctype
+iswdigit
+iswgraph
+iswlower
+iswprint
+iswpunct
+iswspace
+iswupper
+iswxdigit
+isxdigit
+jrand48
+kill
+klogctl
+lchown
+ldexp
+ldiv
+link
+listen
+lldiv
+load_domain_search_list
+localtime
+localtime64
+localtime64_r
+localtime_r
+longjmp
+longjmperror
+lrand48
+lseek
+lseek64
+lstat
+madvise
+mallinfo
+malloc
+malloc_debug_init
+mbrlen
+mbrtowc
+mbsinit
+mbsrtowcs
+memalign
+memccpy
+memchr
+memcmp
+memcpy
+memmem
+memmove
+memrchr
+memset
+memswap
+mincore
+mkdir
+mkdirat
+mkdtemp
+mknod
+mkstemp
+mkstemps
+mktemp
+mktime
+mktime64
+mlock
+mmap
+mount
+mprotect
+mrand48
+mremap
+msync
+munlock
+munmap
+nanosleep
+nice
+nrand48
+nsdispatch
+open
+openat
+opendir
+openlog
+openlog_r
+optarg
+opterr
+optind
+optopt
+optreset
+pathconf
+pause
+pclose
+perror
+pipe
+poll
+popen
+prctl
+pread
+printf
+pselect
+pthread_attr_destroy
+pthread_attr_getdetachstate
+pthread_attr_getguardsize
+pthread_attr_getschedparam
+pthread_attr_getschedpolicy
+pthread_attr_getscope
+pthread_attr_getstack
+pthread_attr_getstackaddr
+pthread_attr_getstacksize
+pthread_attr_init
+pthread_attr_setdetachstate
+pthread_attr_setguardsize
+pthread_attr_setschedparam
+pthread_attr_setschedpolicy
+pthread_attr_setscope
+pthread_attr_setstack
+pthread_attr_setstackaddr
+pthread_attr_setstacksize
+pthread_cond_broadcast
+pthread_cond_destroy
+pthread_cond_init
+pthread_cond_signal
+pthread_cond_timedwait
+pthread_cond_timedwait_monotonic
+pthread_cond_timedwait_monotonic_np
+pthread_cond_timedwait_relative_np
+pthread_cond_timeout_np
+pthread_cond_wait
+pthread_create
+pthread_detach
+pthread_equal
+pthread_exit
+pthread_getattr_np
+pthread_getcpuclockid
+pthread_getschedparam
+pthread_getspecific
+pthread_join
+pthread_key_create
+pthread_key_delete
+pthread_kill
+pthread_mutex_destroy
+pthread_mutex_init
+pthread_mutex_lock
+pthread_mutex_lock_timeout_np
+pthread_mutex_trylock
+pthread_mutex_unlock
+pthread_mutexattr_destroy
+pthread_mutexattr_getpshared
+pthread_mutexattr_gettype
+pthread_mutexattr_init
+pthread_mutexattr_setpshared
+pthread_mutexattr_settype
+pthread_once
+pthread_self
+pthread_setschedparam
+pthread_setspecific
+pthread_sigmask
+ptrace
+ptsname
+ptsname_r
+putc
+putc_unlocked
+putchar
+putchar_unlocked
+putenv
+puts
+pututline
+putw
+putwc
+putwchar
+pwrite
+qsort
+raise
+read
+readdir
+readdir_r
+readlink
+readv
+realloc
+realpath
+reboot
+recv
+recvfrom
+recvmsg
+remove
+rename
+renameat
+res_get_dns_changed
+res_init
+res_mkquery
+res_need_init
+res_query
+res_search
+restore_core_regs
+rewind
+rewinddir
+rmdir
+sbrk
+scandir
+scanf
+sched_get_priority_max
+sched_get_priority_min
+sched_getparam
+sched_getscheduler
+sched_rr_get_interval
+sched_setparam
+sched_setscheduler
+sched_yield
+seed48
+select
+sem_close
+sem_destroy
+sem_getvalue
+sem_init
+sem_open
+sem_post
+sem_timedwait
+sem_trywait
+sem_unlink
+sem_wait
+send
+sendfile
+sendmsg
+sendto
+setbuf
+setbuffer
+setegid
+setenv
+seteuid
+setgid
+setgroups
+setitimer
+setjmp
+setlinebuf
+setlocale
+setlogmask
+setlogmask_r
+setpgid
+setpgrp
+setpriority
+setregid
+setresgid
+setresuid
+setreuid
+setrlimit
+setservent
+setsid
+setsockopt
+settimeofday
+setuid
+setutent
+setvbuf
+shutdown
+sigaction
+sigblock
+siginterrupt
+siglongjmp
+sigpending
+sigprocmask
+sigsetjmp
+sigsetmask
+sigsuspend
+sigwait
+sleep
+snprintf
+socket
+socketpair
+sprintf
+srand48
+sscanf
+stat
+statfs
+strcasecmp
+strcasestr
+strcat
+strchr
+strcmp
+strcoll
+strcpy
+strcspn
+strdup
+strerror
+strerror_r
+strftime
+strftime_tz
+strlcat
+strlcpy
+strlen
+strncasecmp
+strncat
+strncmp
+strncpy
+strndup
+strnlen
+strntoimax
+strntoumax
+strpbrk
+strptime
+strrchr
+strsep
+strsignal
+strspn
+strstr
+strtod
+strtoimax
+strtok
+strtok_r
+strtol
+strtoll
+strtotimeval
+strtoul
+strtoull
+strtoumax
+strxfrm
+swprintf
+swscanf
+symlink
+sync
+sys_siglist
+syscall
+sysconf
+syslog
+syslog_r
+system
+sysv_signal
+tcgetpgrp
+tcsetpgrp
+tempnam
+the_key
+the_once
+time
+timegm64
+timelocal64
+timer_create
+timer_delete
+timer_getoverrun
+timer_gettime
+timer_settime
+times
+tkill
+tmpfile
+tmpnam
+toascii
+tolower
+toupper
+towlower
+towupper
+truncate
+ttyname
+tzname
+tzset
+umask
+umount
+umount2
+uname
+ungetc
+ungetwc
+unlink
+unlinkat
+unlockpt
+unsetenv
+usleep
+utime
+utimes
+utmpname
+valid_tm_mon
+valid_tm_wday
+valloc
+vasprintf
+vfork
+vfprintf
+vfscanf
+vfwprintf
+vprintf
+vscanf
+vsnprintf
+vsprintf
+vsscanf
+vswprintf
+vsyslog
+vsyslog_r
+vwprintf
+wait
+wait3
+waitid
+waitpid
+wcrtomb
+wcscat
+wcschr
+wcscmp
+wcscoll
+wcscpy
+wcscspn
+wcsftime
+wcslen
+wcsncat
+wcsncmp
+wcsncpy
+wcspbrk
+wcsrchr
+wcsrtombs
+wcsspn
+wcsstr
+wcstod
+wcstok
+wcstol
+wcstoul
+wcswcs
+wcswidth
+wcsxfrm
+wctob
+wctype
+wcwidth
+wmemchr
+wmemcmp
+wmemcpy
+wmemmove
+wmemset
+wprintf
+write
+writev
+wscanf
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/a.out.h b/ndk/platforms/android-5/arch-x86/include/asm/a.out.h
new file mode 100644
index 0000000..6aecff7
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/a.out.h
@@ -0,0 +1,31 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_X86_A_OUT_H
+#define _ASM_X86_A_OUT_H
+
+struct exec
+{
+ unsigned int a_info;
+ unsigned a_text;
+ unsigned a_data;
+ unsigned a_bss;
+ unsigned a_syms;
+ unsigned a_entry;
+ unsigned a_trsize;
+ unsigned a_drsize;
+};
+
+#define N_TRSIZE(a) ((a).a_trsize)
+#define N_DRSIZE(a) ((a).a_drsize)
+#define N_SYMSIZE(a) ((a).a_syms)
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/acpi.h b/ndk/platforms/android-5/arch-x86/include/asm/acpi.h
new file mode 100644
index 0000000..0115ce9
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/acpi.h
@@ -0,0 +1,19 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_X86_ACPI_H
+#define _ASM_X86_ACPI_H
+
+#include "acpi_64.h"
+
+#include <asm/processor.h>
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/acpi_32.h b/ndk/platforms/android-5/arch-x86/include/asm/acpi_32.h
new file mode 100644
index 0000000..fe0043c
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/acpi_32.h
@@ -0,0 +1,15 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_ACPI_H
+#define _ASM_ACPI_H
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/alternative.h b/ndk/platforms/android-5/arch-x86/include/asm/alternative.h
new file mode 100644
index 0000000..17c1dc5
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/alternative.h
@@ -0,0 +1,12 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#include "alternative_64.h"
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/alternative_32.h b/ndk/platforms/android-5/arch-x86/include/asm/alternative_32.h
new file mode 100644
index 0000000..ef13111
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/alternative_32.h
@@ -0,0 +1,38 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _I386_ALTERNATIVE_H
+#define _I386_ALTERNATIVE_H
+
+#include <asm/types.h>
+#include <linux/stddef.h>
+#include <linux/types.h>
+
+struct alt_instr {
+ u8 *instr;
+ u8 *replacement;
+ u8 cpuid;
+ u8 instrlen;
+ u8 replacementlen;
+ u8 pad;
+};
+
+struct module;
+#define alternative(oldinstr, newinstr, feature)   asm volatile ("661:\n\t" oldinstr "\n662:\n"   ".section .altinstructions,\"a\"\n"   "  .align 4\n"   "  .long 661b\n"     "  .long 663f\n"     "  .byte %c0\n"     "  .byte 662b-661b\n"     "  .byte 664f-663f\n"     ".previous\n"   ".section .altinstr_replacement,\"ax\"\n"   "663:\n\t" newinstr "\n664:\n"    ".previous" :: "i" (feature) : "memory")
+#define alternative_input(oldinstr, newinstr, feature, input...)   asm volatile ("661:\n\t" oldinstr "\n662:\n"   ".section .altinstructions,\"a\"\n"   "  .align 4\n"   "  .long 661b\n"     "  .long 663f\n"     "  .byte %c0\n"     "  .byte 662b-661b\n"     "  .byte 664f-663f\n"     ".previous\n"   ".section .altinstr_replacement,\"ax\"\n"   "663:\n\t" newinstr "\n664:\n"    ".previous" :: "i" (feature), ##input)
+#define alternative_io(oldinstr, newinstr, feature, output, input...)   asm volatile ("661:\n\t" oldinstr "\n662:\n"   ".section .altinstructions,\"a\"\n"   "  .align 4\n"   "  .long 661b\n"     "  .long 663f\n"     "  .byte %c[feat]\n"     "  .byte 662b-661b\n"     "  .byte 664f-663f\n"     ".previous\n"   ".section .altinstr_replacement,\"ax\"\n"   "663:\n\t" newinstr "\n664:\n"     ".previous" : output : [feat] "i" (feature), ##input)
+#define ASM_OUTPUT2(a, b) a, b
+#define LOCK_PREFIX ""
+
+#define __parainstructions NULL
+#define __parainstructions_end NULL
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/apic.h b/ndk/platforms/android-5/arch-x86/include/asm/apic.h
new file mode 100644
index 0000000..5cb7181
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/apic.h
@@ -0,0 +1,12 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#include "apic_64.h"
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/apic_32.h b/ndk/platforms/android-5/arch-x86/include/asm/apic_32.h
new file mode 100644
index 0000000..02c9d9b
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/apic_32.h
@@ -0,0 +1,31 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASM_APIC_H
+#define __ASM_APIC_H
+
+#include <linux/pm.h>
+#include <linux/delay.h>
+#include <asm/fixmap.h>
+#include <asm/apicdef.h>
+#include <asm/processor.h>
+#include <asm/system.h>
+
+#define Dprintk(x...)
+
+#define APIC_QUIET 0
+#define APIC_VERBOSE 1
+#define APIC_DEBUG 2
+
+#define apic_printk(v, s, a...) do {   if ((v) <= apic_verbosity)   printk(s, ##a);   } while (0)
+
+#define local_apic_timer_c2_ok 1
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/apicdef.h b/ndk/platforms/android-5/arch-x86/include/asm/apicdef.h
new file mode 100644
index 0000000..bd19f5a
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/apicdef.h
@@ -0,0 +1,12 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#include "apicdef_64.h"
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/apicdef_32.h b/ndk/platforms/android-5/arch-x86/include/asm/apicdef_32.h
new file mode 100644
index 0000000..a4a5edb
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/apicdef_32.h
@@ -0,0 +1,372 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASM_APICDEF_H
+#define __ASM_APICDEF_H
+
+#define APIC_DEFAULT_PHYS_BASE 0xfee00000
+
+#define APIC_ID 0x20
+#define APIC_LVR 0x30
+#define APIC_LVR_MASK 0xFF00FF
+#define GET_APIC_VERSION(x) ((x)&0xFF)
+#define GET_APIC_MAXLVT(x) (((x)>>16)&0xFF)
+#define APIC_INTEGRATED(x) ((x)&0xF0)
+#define APIC_XAPIC(x) ((x) >= 0x14)
+#define APIC_TASKPRI 0x80
+#define APIC_TPRI_MASK 0xFF
+#define APIC_ARBPRI 0x90
+#define APIC_ARBPRI_MASK 0xFF
+#define APIC_PROCPRI 0xA0
+#define APIC_EOI 0xB0
+#define APIC_EIO_ACK 0x0  
+#define APIC_RRR 0xC0
+#define APIC_LDR 0xD0
+#define APIC_LDR_MASK (0xFF<<24)
+#define GET_APIC_LOGICAL_ID(x) (((x)>>24)&0xFF)
+#define SET_APIC_LOGICAL_ID(x) (((x)<<24))
+#define APIC_ALL_CPUS 0xFF
+#define APIC_DFR 0xE0
+#define APIC_DFR_CLUSTER 0x0FFFFFFFul
+#define APIC_DFR_FLAT 0xFFFFFFFFul
+#define APIC_SPIV 0xF0
+#define APIC_SPIV_FOCUS_DISABLED (1<<9)
+#define APIC_SPIV_APIC_ENABLED (1<<8)
+#define APIC_ISR 0x100
+#define APIC_ISR_NR 0x8  
+#define APIC_TMR 0x180
+#define APIC_IRR 0x200
+#define APIC_ESR 0x280
+#define APIC_ESR_SEND_CS 0x00001
+#define APIC_ESR_RECV_CS 0x00002
+#define APIC_ESR_SEND_ACC 0x00004
+#define APIC_ESR_RECV_ACC 0x00008
+#define APIC_ESR_SENDILL 0x00020
+#define APIC_ESR_RECVILL 0x00040
+#define APIC_ESR_ILLREGA 0x00080
+#define APIC_ICR 0x300
+#define APIC_DEST_SELF 0x40000
+#define APIC_DEST_ALLINC 0x80000
+#define APIC_DEST_ALLBUT 0xC0000
+#define APIC_ICR_RR_MASK 0x30000
+#define APIC_ICR_RR_INVALID 0x00000
+#define APIC_ICR_RR_INPROG 0x10000
+#define APIC_ICR_RR_VALID 0x20000
+#define APIC_INT_LEVELTRIG 0x08000
+#define APIC_INT_ASSERT 0x04000
+#define APIC_ICR_BUSY 0x01000
+#define APIC_DEST_LOGICAL 0x00800
+#define APIC_DM_FIXED 0x00000
+#define APIC_DM_LOWEST 0x00100
+#define APIC_DM_SMI 0x00200
+#define APIC_DM_REMRD 0x00300
+#define APIC_DM_NMI 0x00400
+#define APIC_DM_INIT 0x00500
+#define APIC_DM_STARTUP 0x00600
+#define APIC_DM_EXTINT 0x00700
+#define APIC_VECTOR_MASK 0x000FF
+#define APIC_ICR2 0x310
+#define GET_APIC_DEST_FIELD(x) (((x)>>24)&0xFF)
+#define SET_APIC_DEST_FIELD(x) ((x)<<24)
+#define APIC_LVTT 0x320
+#define APIC_LVTTHMR 0x330
+#define APIC_LVTPC 0x340
+#define APIC_LVT0 0x350
+#define APIC_LVT_TIMER_BASE_MASK (0x3<<18)
+#define GET_APIC_TIMER_BASE(x) (((x)>>18)&0x3)
+#define SET_APIC_TIMER_BASE(x) (((x)<<18))
+#define APIC_TIMER_BASE_CLKIN 0x0
+#define APIC_TIMER_BASE_TMBASE 0x1
+#define APIC_TIMER_BASE_DIV 0x2
+#define APIC_LVT_TIMER_PERIODIC (1<<17)
+#define APIC_LVT_MASKED (1<<16)
+#define APIC_LVT_LEVEL_TRIGGER (1<<15)
+#define APIC_LVT_REMOTE_IRR (1<<14)
+#define APIC_INPUT_POLARITY (1<<13)
+#define APIC_SEND_PENDING (1<<12)
+#define APIC_MODE_MASK 0x700
+#define GET_APIC_DELIVERY_MODE(x) (((x)>>8)&0x7)
+#define SET_APIC_DELIVERY_MODE(x,y) (((x)&~0x700)|((y)<<8))
+#define APIC_MODE_FIXED 0x0
+#define APIC_MODE_NMI 0x4
+#define APIC_MODE_EXTINT 0x7
+#define APIC_LVT1 0x360
+#define APIC_LVTERR 0x370
+#define APIC_TMICT 0x380
+#define APIC_TMCCT 0x390
+#define APIC_TDCR 0x3E0
+#define APIC_TDR_DIV_TMBASE (1<<2)
+#define APIC_TDR_DIV_1 0xB
+#define APIC_TDR_DIV_2 0x0
+#define APIC_TDR_DIV_4 0x1
+#define APIC_TDR_DIV_8 0x2
+#define APIC_TDR_DIV_16 0x3
+#define APIC_TDR_DIV_32 0x8
+#define APIC_TDR_DIV_64 0x9
+#define APIC_TDR_DIV_128 0xA
+
+#define APIC_BASE (fix_to_virt(FIX_APIC_BASE))
+
+#define MAX_IO_APICS 64
+
+#define u32 unsigned int
+
+struct local_apic {
+
+  struct { u32 __reserved[4]; } __reserved_01;
+
+  struct { u32 __reserved[4]; } __reserved_02;
+
+  struct {
+ u32 __reserved_1 : 24,
+ phys_apic_id : 4,
+ __reserved_2 : 4;
+ u32 __reserved[3];
+ } id;
+
+  const
+ struct {
+ u32 version : 8,
+ __reserved_1 : 8,
+ max_lvt : 8,
+ __reserved_2 : 8;
+ u32 __reserved[3];
+ } version;
+
+  struct { u32 __reserved[4]; } __reserved_03;
+
+  struct { u32 __reserved[4]; } __reserved_04;
+
+  struct { u32 __reserved[4]; } __reserved_05;
+
+  struct { u32 __reserved[4]; } __reserved_06;
+
+  struct {
+ u32 priority : 8,
+ __reserved_1 : 24;
+ u32 __reserved_2[3];
+ } tpr;
+
+  const
+ struct {
+ u32 priority : 8,
+ __reserved_1 : 24;
+ u32 __reserved_2[3];
+ } apr;
+
+  const
+ struct {
+ u32 priority : 8,
+ __reserved_1 : 24;
+ u32 __reserved_2[3];
+ } ppr;
+
+  struct {
+ u32 eoi;
+ u32 __reserved[3];
+ } eoi;
+
+  struct { u32 __reserved[4]; } __reserved_07;
+
+  struct {
+ u32 __reserved_1 : 24,
+ logical_dest : 8;
+ u32 __reserved_2[3];
+ } ldr;
+
+  struct {
+ u32 __reserved_1 : 28,
+ model : 4;
+ u32 __reserved_2[3];
+ } dfr;
+
+  struct {
+ u32 spurious_vector : 8,
+ apic_enabled : 1,
+ focus_cpu : 1,
+ __reserved_2 : 22;
+ u32 __reserved_3[3];
+ } svr;
+
+  struct {
+  u32 bitfield;
+ u32 __reserved[3];
+ } isr [8];
+
+  struct {
+  u32 bitfield;
+ u32 __reserved[3];
+ } tmr [8];
+
+  struct {
+  u32 bitfield;
+ u32 __reserved[3];
+ } irr [8];
+
+  union {
+ struct {
+ u32 send_cs_error : 1,
+ receive_cs_error : 1,
+ send_accept_error : 1,
+ receive_accept_error : 1,
+ __reserved_1 : 1,
+ send_illegal_vector : 1,
+ receive_illegal_vector : 1,
+ illegal_register_address : 1,
+ __reserved_2 : 24;
+ u32 __reserved_3[3];
+ } error_bits;
+ struct {
+ u32 errors;
+ u32 __reserved_3[3];
+ } all_errors;
+ } esr;
+
+  struct { u32 __reserved[4]; } __reserved_08;
+
+  struct { u32 __reserved[4]; } __reserved_09;
+
+  struct { u32 __reserved[4]; } __reserved_10;
+
+  struct { u32 __reserved[4]; } __reserved_11;
+
+  struct { u32 __reserved[4]; } __reserved_12;
+
+  struct { u32 __reserved[4]; } __reserved_13;
+
+  struct { u32 __reserved[4]; } __reserved_14;
+
+  struct {
+ u32 vector : 8,
+ delivery_mode : 3,
+ destination_mode : 1,
+ delivery_status : 1,
+ __reserved_1 : 1,
+ level : 1,
+ trigger : 1,
+ __reserved_2 : 2,
+ shorthand : 2,
+ __reserved_3 : 12;
+ u32 __reserved_4[3];
+ } icr1;
+
+  struct {
+ union {
+ u32 __reserved_1 : 24,
+ phys_dest : 4,
+ __reserved_2 : 4;
+ u32 __reserved_3 : 24,
+ logical_dest : 8;
+ } dest;
+ u32 __reserved_4[3];
+ } icr2;
+
+  struct {
+ u32 vector : 8,
+ __reserved_1 : 4,
+ delivery_status : 1,
+ __reserved_2 : 3,
+ mask : 1,
+ timer_mode : 1,
+ __reserved_3 : 14;
+ u32 __reserved_4[3];
+ } lvt_timer;
+
+  struct {
+ u32 vector : 8,
+ delivery_mode : 3,
+ __reserved_1 : 1,
+ delivery_status : 1,
+ __reserved_2 : 3,
+ mask : 1,
+ __reserved_3 : 15;
+ u32 __reserved_4[3];
+ } lvt_thermal;
+
+  struct {
+ u32 vector : 8,
+ delivery_mode : 3,
+ __reserved_1 : 1,
+ delivery_status : 1,
+ __reserved_2 : 3,
+ mask : 1,
+ __reserved_3 : 15;
+ u32 __reserved_4[3];
+ } lvt_pc;
+
+  struct {
+ u32 vector : 8,
+ delivery_mode : 3,
+ __reserved_1 : 1,
+ delivery_status : 1,
+ polarity : 1,
+ remote_irr : 1,
+ trigger : 1,
+ mask : 1,
+ __reserved_2 : 15;
+ u32 __reserved_3[3];
+ } lvt_lint0;
+
+  struct {
+ u32 vector : 8,
+ delivery_mode : 3,
+ __reserved_1 : 1,
+ delivery_status : 1,
+ polarity : 1,
+ remote_irr : 1,
+ trigger : 1,
+ mask : 1,
+ __reserved_2 : 15;
+ u32 __reserved_3[3];
+ } lvt_lint1;
+
+  struct {
+ u32 vector : 8,
+ __reserved_1 : 4,
+ delivery_status : 1,
+ __reserved_2 : 3,
+ mask : 1,
+ __reserved_3 : 15;
+ u32 __reserved_4[3];
+ } lvt_error;
+
+  struct {
+ u32 initial_count;
+ u32 __reserved_2[3];
+ } timer_icr;
+
+  const
+ struct {
+ u32 curr_count;
+ u32 __reserved_2[3];
+ } timer_ccr;
+
+  struct { u32 __reserved[4]; } __reserved_16;
+
+  struct { u32 __reserved[4]; } __reserved_17;
+
+  struct { u32 __reserved[4]; } __reserved_18;
+
+  struct { u32 __reserved[4]; } __reserved_19;
+
+  struct {
+ u32 divisor : 4,
+ __reserved_1 : 28;
+ u32 __reserved_2[3];
+ } timer_dcr;
+
+  struct { u32 __reserved[4]; } __reserved_20;
+
+} __attribute__ ((packed));
+
+#undef u32
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/atomic.h b/ndk/platforms/android-5/arch-x86/include/asm/atomic.h
new file mode 100644
index 0000000..00289cf
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/atomic.h
@@ -0,0 +1,12 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#include "atomic_64.h"
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/atomic_32.h b/ndk/platforms/android-5/arch-x86/include/asm/atomic_32.h
new file mode 100644
index 0000000..677aac8
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/atomic_32.h
@@ -0,0 +1,39 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ARCH_I386_ATOMIC__
+#define __ARCH_I386_ATOMIC__
+
+#include <linux/compiler.h>
+#include <asm/processor.h>
+#include <asm/cmpxchg.h>
+
+typedef struct { int counter; } atomic_t;
+
+#define ATOMIC_INIT(i) { (i) }
+
+#define atomic_read(v) ((v)->counter)
+
+#define atomic_set(v,i) (((v)->counter) = (i))
+
+#define atomic_cmpxchg(v, old, new) (cmpxchg(&((v)->counter), (old), (new)))
+#define atomic_xchg(v, new) (xchg(&((v)->counter), (new)))
+#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
+#define atomic_inc_return(v) (atomic_add_return(1,v))
+#define atomic_dec_return(v) (atomic_sub_return(1,v))
+#define atomic_clear_mask(mask, addr)  __asm__ __volatile__(LOCK_PREFIX "andl %0,%1"  : : "r" (~(mask)),"m" (*addr) : "memory")
+#define atomic_set_mask(mask, addr)  __asm__ __volatile__(LOCK_PREFIX "orl %0,%1"  : : "r" (mask),"m" (*(addr)) : "memory")
+#define smp_mb__before_atomic_dec() barrier()
+#define smp_mb__after_atomic_dec() barrier()
+#define smp_mb__before_atomic_inc() barrier()
+#define smp_mb__after_atomic_inc() barrier()
+#include <asm-generic/atomic.h>
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/auxvec.h b/ndk/platforms/android-5/arch-x86/include/asm/auxvec.h
new file mode 100644
index 0000000..f065eb1
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/auxvec.h
@@ -0,0 +1,20 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_X86_AUXVEC_H
+#define _ASM_X86_AUXVEC_H
+
+#ifdef __i386__
+#define AT_SYSINFO 32
+#endif
+#define AT_SYSINFO_EHDR 33
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/bitops.h b/ndk/platforms/android-5/arch-x86/include/asm/bitops.h
new file mode 100644
index 0000000..3b58565
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/bitops.h
@@ -0,0 +1,12 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#include "bitops_64.h"
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/bitops_32.h b/ndk/platforms/android-5/arch-x86/include/asm/bitops_32.h
new file mode 100644
index 0000000..fa77fe2
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/bitops_32.h
@@ -0,0 +1,30 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _I386_BITOPS_H
+#define _I386_BITOPS_H
+
+#ifndef _LINUX_BITOPS_H
+#error only <linux/bitops.h> can be included directly
+#endif
+
+#include <linux/compiler.h>
+#include <asm/alternative.h>
+
+#define ADDR (*(volatile long *) addr)
+
+#define smp_mb__before_clear_bit() barrier()
+#define smp_mb__after_clear_bit() barrier()
+#define test_bit(nr,addr)  (__builtin_constant_p(nr) ?   constant_test_bit((nr),(addr)) :   variable_test_bit((nr),(addr)))
+#undef ADDR
+
+#include <asm-generic/bitops/fls64.h>
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/bug.h b/ndk/platforms/android-5/arch-x86/include/asm/bug.h
new file mode 100644
index 0000000..9247022
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/bug.h
@@ -0,0 +1,16 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_X86_BUG_H
+#define _ASM_X86_BUG_H
+
+#include <asm-generic/bug.h>
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/byteorder.h b/ndk/platforms/android-5/arch-x86/include/asm/byteorder.h
new file mode 100644
index 0000000..a839798
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/byteorder.h
@@ -0,0 +1,70 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_X86_BYTEORDER_H
+#define _ASM_X86_BYTEORDER_H
+
+#include <asm/types.h>
+#include <linux/compiler.h>
+
+#ifdef __GNUC__
+
+#ifdef __i386__
+
+static __inline__ __attribute_const__ __u32 ___arch__swab32(__u32 x)
+{
+ __asm__("xchgb %b0,%h0\n\t"
+ "rorl $16,%0\n\t"
+ "xchgb %b0,%h0"
+ :"=q" (x)
+ : "0" (x));
+ return x;
+}
+
+static __inline__ __attribute_const__ __u64 ___arch__swab64(__u64 val)
+{
+ union {
+ struct { __u32 a,b; } s;
+ __u64 u;
+ } v;
+ v.u = val;
+ v.s.a = ___arch__swab32(v.s.a);
+ v.s.b = ___arch__swab32(v.s.b);
+ __asm__("xchgl %0,%1" : "=r" (v.s.a), "=r" (v.s.b) : "0" (v.s.a), "1" (v.s.b));
+ return v.u;
+}
+
+#else
+
+static __inline__ __attribute_const__ __u64 ___arch__swab64(__u64 x)
+{
+ __asm__("bswapq %0" : "=r" (x) : "0" (x));
+ return x;
+}
+
+static __inline__ __attribute_const__ __u32 ___arch__swab32(__u32 x)
+{
+ __asm__("bswapl %0" : "=r" (x) : "0" (x));
+ return x;
+}
+
+#endif
+
+#define __arch__swab64(x) ___arch__swab64(x)
+#define __arch__swab32(x) ___arch__swab32(x)
+
+#define __BYTEORDER_HAS_U64__
+
+#endif
+
+#include <linux/byteorder/little_endian.h>
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/cache.h b/ndk/platforms/android-5/arch-x86/include/asm/cache.h
new file mode 100644
index 0000000..2766a71
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/cache.h
@@ -0,0 +1,20 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ARCH_X86_CACHE_H
+#define _ARCH_X86_CACHE_H
+
+#define L1_CACHE_SHIFT (CONFIG_X86_L1_CACHE_SHIFT)
+#define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT)
+
+#define __read_mostly __attribute__((__section__(".data.read_mostly")))
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/cacheflush.h b/ndk/platforms/android-5/arch-x86/include/asm/cacheflush.h
new file mode 100644
index 0000000..028277b
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/cacheflush.h
@@ -0,0 +1,34 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_X86_CACHEFLUSH_H
+#define _ASM_X86_CACHEFLUSH_H
+
+#include <linux/mm.h>
+
+#define flush_cache_all() do { } while (0)
+#define flush_cache_mm(mm) do { } while (0)
+#define flush_cache_dup_mm(mm) do { } while (0)
+#define flush_cache_range(vma, start, end) do { } while (0)
+#define flush_cache_page(vma, vmaddr, pfn) do { } while (0)
+#define flush_dcache_page(page) do { } while (0)
+#define flush_dcache_mmap_lock(mapping) do { } while (0)
+#define flush_dcache_mmap_unlock(mapping) do { } while (0)
+#define flush_icache_range(start, end) do { } while (0)
+#define flush_icache_page(vma,pg) do { } while (0)
+#define flush_icache_user_range(vma,pg,adr,len) do { } while (0)
+#define flush_cache_vmap(start, end) do { } while (0)
+#define flush_cache_vunmap(start, end) do { } while (0)
+
+#define copy_to_user_page(vma, page, vaddr, dst, src, len)   memcpy(dst, src, len)
+#define copy_from_user_page(vma, page, vaddr, dst, src, len)   memcpy(dst, src, len)
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/cmpxchg.h b/ndk/platforms/android-5/arch-x86/include/asm/cmpxchg.h
new file mode 100644
index 0000000..de059a2
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/cmpxchg.h
@@ -0,0 +1,12 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#include "cmpxchg_64.h"
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/cmpxchg_32.h b/ndk/platforms/android-5/arch-x86/include/asm/cmpxchg_32.h
new file mode 100644
index 0000000..3632f4c
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/cmpxchg_32.h
@@ -0,0 +1,31 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASM_CMPXCHG_H
+#define __ASM_CMPXCHG_H
+
+#include <linux/bitops.h>  
+
+#define xchg(ptr,v) ((__typeof__(*(ptr)))__xchg((unsigned long)(v),(ptr),sizeof(*(ptr))))
+
+struct __xchg_dummy { unsigned long a[100]; };
+#define __xg(x) ((struct __xchg_dummy *)(x))
+
+#define ll_low(x) *(((unsigned int*)&(x))+0)
+#define ll_high(x) *(((unsigned int*)&(x))+1)
+#define set_64bit(ptr,value)  (__builtin_constant_p(value) ?   __set_64bit_constant(ptr, value) :   __set_64bit_var(ptr, value) )
+#define _set_64bit(ptr,value)  (__builtin_constant_p(value) ?   __set_64bit(ptr, (unsigned int)(value), (unsigned int)((value)>>32ULL) ) :   __set_64bit(ptr, ll_low(value), ll_high(value)) )
+
+#define cmpxchg(ptr,o,n)  ({   __typeof__(*(ptr)) __ret;   if (likely(boot_cpu_data.x86 > 3))   __ret = __cmpxchg((ptr), (unsigned long)(o),   (unsigned long)(n), sizeof(*(ptr)));   else   __ret = cmpxchg_386((ptr), (unsigned long)(o),   (unsigned long)(n), sizeof(*(ptr)));   __ret;  })
+#define cmpxchg_local(ptr,o,n)  ({   __typeof__(*(ptr)) __ret;   if (likely(boot_cpu_data.x86 > 3))   __ret = __cmpxchg_local((ptr), (unsigned long)(o),   (unsigned long)(n), sizeof(*(ptr)));   else   __ret = cmpxchg_386((ptr), (unsigned long)(o),   (unsigned long)(n), sizeof(*(ptr)));   __ret;  })
+#define cmpxchg64(ptr,o,n)  ((__typeof__(*(ptr)))__cmpxchg64((ptr),(unsigned long long)(o),  (unsigned long long)(n)))
+#define cmpxchg64_local(ptr,o,n)  ((__typeof__(*(ptr)))__cmpxchg64_local((ptr),(unsigned long long)(o),  (unsigned long long)(n)))
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/cpufeature.h b/ndk/platforms/android-5/arch-x86/include/asm/cpufeature.h
new file mode 100644
index 0000000..47af457
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/cpufeature.h
@@ -0,0 +1,12 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#include "cpufeature_64.h"
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/cpufeature_32.h b/ndk/platforms/android-5/arch-x86/include/asm/cpufeature_32.h
new file mode 100644
index 0000000..a8ebc40
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/cpufeature_32.h
@@ -0,0 +1,151 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASM_I386_CPUFEATURE_H
+#define __ASM_I386_CPUFEATURE_H
+
+#ifndef __ASSEMBLY__
+#include <linux/bitops.h>
+#endif
+#include <asm/required-features.h>
+
+#define NCAPINTS 8  
+
+#define X86_FEATURE_FPU (0*32+ 0)  
+#define X86_FEATURE_VME (0*32+ 1)  
+#define X86_FEATURE_DE (0*32+ 2)  
+#define X86_FEATURE_PSE (0*32+ 3)  
+#define X86_FEATURE_TSC (0*32+ 4)  
+#define X86_FEATURE_MSR (0*32+ 5)  
+#define X86_FEATURE_PAE (0*32+ 6)  
+#define X86_FEATURE_MCE (0*32+ 7)  
+#define X86_FEATURE_CX8 (0*32+ 8)  
+#define X86_FEATURE_APIC (0*32+ 9)  
+#define X86_FEATURE_SEP (0*32+11)  
+#define X86_FEATURE_MTRR (0*32+12)  
+#define X86_FEATURE_PGE (0*32+13)  
+#define X86_FEATURE_MCA (0*32+14)  
+#define X86_FEATURE_CMOV (0*32+15)  
+#define X86_FEATURE_PAT (0*32+16)  
+#define X86_FEATURE_PSE36 (0*32+17)  
+#define X86_FEATURE_PN (0*32+18)  
+#define X86_FEATURE_CLFLSH (0*32+19)  
+#define X86_FEATURE_DS (0*32+21)  
+#define X86_FEATURE_ACPI (0*32+22)  
+#define X86_FEATURE_MMX (0*32+23)  
+#define X86_FEATURE_FXSR (0*32+24)  
+
+#define X86_FEATURE_XMM (0*32+25)  
+#define X86_FEATURE_XMM2 (0*32+26)  
+#define X86_FEATURE_SELFSNOOP (0*32+27)  
+#define X86_FEATURE_HT (0*32+28)  
+#define X86_FEATURE_ACC (0*32+29)  
+#define X86_FEATURE_IA64 (0*32+30)  
+
+#define X86_FEATURE_SYSCALL (1*32+11)  
+#define X86_FEATURE_MP (1*32+19)  
+#define X86_FEATURE_NX (1*32+20)  
+#define X86_FEATURE_MMXEXT (1*32+22)  
+#define X86_FEATURE_RDTSCP (1*32+27)  
+#define X86_FEATURE_LM (1*32+29)  
+#define X86_FEATURE_3DNOWEXT (1*32+30)  
+#define X86_FEATURE_3DNOW (1*32+31)  
+
+#define X86_FEATURE_RECOVERY (2*32+ 0)  
+#define X86_FEATURE_LONGRUN (2*32+ 1)  
+#define X86_FEATURE_LRTI (2*32+ 3)  
+
+#define X86_FEATURE_CXMMX (3*32+ 0)  
+#define X86_FEATURE_K6_MTRR (3*32+ 1)  
+#define X86_FEATURE_CYRIX_ARR (3*32+ 2)  
+#define X86_FEATURE_CENTAUR_MCR (3*32+ 3)  
+
+#define X86_FEATURE_K8 (3*32+ 4)  
+#define X86_FEATURE_K7 (3*32+ 5)  
+#define X86_FEATURE_P3 (3*32+ 6)  
+#define X86_FEATURE_P4 (3*32+ 7)  
+#define X86_FEATURE_CONSTANT_TSC (3*32+ 8)  
+#define X86_FEATURE_UP (3*32+ 9)  
+#define X86_FEATURE_FXSAVE_LEAK (3*32+10)  
+#define X86_FEATURE_ARCH_PERFMON (3*32+11)  
+#define X86_FEATURE_PEBS (3*32+12)  
+#define X86_FEATURE_BTS (3*32+13)  
+
+#define X86_FEATURE_SYNC_RDTSC (3*32+15)  
+#define X86_FEATURE_REP_GOOD (3*32+16)  
+
+#define X86_FEATURE_XMM3 (4*32+ 0)  
+#define X86_FEATURE_MWAIT (4*32+ 3)  
+#define X86_FEATURE_DSCPL (4*32+ 4)  
+#define X86_FEATURE_EST (4*32+ 7)  
+#define X86_FEATURE_TM2 (4*32+ 8)  
+#define X86_FEATURE_CID (4*32+10)  
+#define X86_FEATURE_CX16 (4*32+13)  
+#define X86_FEATURE_XTPR (4*32+14)  
+#define X86_FEATURE_DCA (4*32+18)  
+
+#define X86_FEATURE_XSTORE (5*32+ 2)  
+#define X86_FEATURE_XSTORE_EN (5*32+ 3)  
+#define X86_FEATURE_XCRYPT (5*32+ 6)  
+#define X86_FEATURE_XCRYPT_EN (5*32+ 7)  
+#define X86_FEATURE_ACE2 (5*32+ 8)  
+#define X86_FEATURE_ACE2_EN (5*32+ 9)  
+#define X86_FEATURE_PHE (5*32+ 10)  
+#define X86_FEATURE_PHE_EN (5*32+ 11)  
+#define X86_FEATURE_PMM (5*32+ 12)  
+#define X86_FEATURE_PMM_EN (5*32+ 13)  
+
+#define X86_FEATURE_LAHF_LM (6*32+ 0)  
+#define X86_FEATURE_CMP_LEGACY (6*32+ 1)  
+
+#define X86_FEATURE_IDA (7*32+ 0)  
+
+#define cpu_has(c, bit)   (__builtin_constant_p(bit) &&   ( (((bit)>>5)==0 && (1UL<<((bit)&31) & REQUIRED_MASK0)) ||   (((bit)>>5)==1 && (1UL<<((bit)&31) & REQUIRED_MASK1)) ||   (((bit)>>5)==2 && (1UL<<((bit)&31) & REQUIRED_MASK2)) ||   (((bit)>>5)==3 && (1UL<<((bit)&31) & REQUIRED_MASK3)) ||   (((bit)>>5)==4 && (1UL<<((bit)&31) & REQUIRED_MASK4)) ||   (((bit)>>5)==5 && (1UL<<((bit)&31) & REQUIRED_MASK5)) ||   (((bit)>>5)==6 && (1UL<<((bit)&31) & REQUIRED_MASK6)) ||   (((bit)>>5)==7 && (1UL<<((bit)&31) & REQUIRED_MASK7)) )   ? 1 :   test_bit(bit, (c)->x86_capability))
+#define boot_cpu_has(bit) cpu_has(&boot_cpu_data, bit)
+
+#define cpu_has_fpu boot_cpu_has(X86_FEATURE_FPU)
+#define cpu_has_vme boot_cpu_has(X86_FEATURE_VME)
+#define cpu_has_de boot_cpu_has(X86_FEATURE_DE)
+#define cpu_has_pse boot_cpu_has(X86_FEATURE_PSE)
+#define cpu_has_tsc boot_cpu_has(X86_FEATURE_TSC)
+#define cpu_has_pae boot_cpu_has(X86_FEATURE_PAE)
+#define cpu_has_pge boot_cpu_has(X86_FEATURE_PGE)
+#define cpu_has_apic boot_cpu_has(X86_FEATURE_APIC)
+#define cpu_has_sep boot_cpu_has(X86_FEATURE_SEP)
+#define cpu_has_mtrr boot_cpu_has(X86_FEATURE_MTRR)
+#define cpu_has_mmx boot_cpu_has(X86_FEATURE_MMX)
+#define cpu_has_fxsr boot_cpu_has(X86_FEATURE_FXSR)
+#define cpu_has_xmm boot_cpu_has(X86_FEATURE_XMM)
+#define cpu_has_xmm2 boot_cpu_has(X86_FEATURE_XMM2)
+#define cpu_has_xmm3 boot_cpu_has(X86_FEATURE_XMM3)
+#define cpu_has_ht boot_cpu_has(X86_FEATURE_HT)
+#define cpu_has_mp boot_cpu_has(X86_FEATURE_MP)
+#define cpu_has_nx boot_cpu_has(X86_FEATURE_NX)
+#define cpu_has_k6_mtrr boot_cpu_has(X86_FEATURE_K6_MTRR)
+#define cpu_has_cyrix_arr boot_cpu_has(X86_FEATURE_CYRIX_ARR)
+#define cpu_has_centaur_mcr boot_cpu_has(X86_FEATURE_CENTAUR_MCR)
+#define cpu_has_xstore boot_cpu_has(X86_FEATURE_XSTORE)
+#define cpu_has_xstore_enabled boot_cpu_has(X86_FEATURE_XSTORE_EN)
+#define cpu_has_xcrypt boot_cpu_has(X86_FEATURE_XCRYPT)
+#define cpu_has_xcrypt_enabled boot_cpu_has(X86_FEATURE_XCRYPT_EN)
+#define cpu_has_ace2 boot_cpu_has(X86_FEATURE_ACE2)
+#define cpu_has_ace2_enabled boot_cpu_has(X86_FEATURE_ACE2_EN)
+#define cpu_has_phe boot_cpu_has(X86_FEATURE_PHE)
+#define cpu_has_phe_enabled boot_cpu_has(X86_FEATURE_PHE_EN)
+#define cpu_has_pmm boot_cpu_has(X86_FEATURE_PMM)
+#define cpu_has_pmm_enabled boot_cpu_has(X86_FEATURE_PMM_EN)
+#define cpu_has_ds boot_cpu_has(X86_FEATURE_DS)
+#define cpu_has_pebs boot_cpu_has(X86_FEATURE_PEBS)
+#define cpu_has_clflush boot_cpu_has(X86_FEATURE_CLFLSH)
+#define cpu_has_bts boot_cpu_has(X86_FEATURE_BTS)
+
+#endif
+
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/cputime.h b/ndk/platforms/android-5/arch-x86/include/asm/cputime.h
new file mode 100644
index 0000000..0e79e0b
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/cputime.h
@@ -0,0 +1,12 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#include <asm-generic/cputime.h>
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/current.h b/ndk/platforms/android-5/arch-x86/include/asm/current.h
new file mode 100644
index 0000000..b53c6fe
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/current.h
@@ -0,0 +1,12 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#include "current_64.h"
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/current_32.h b/ndk/platforms/android-5/arch-x86/include/asm/current_32.h
new file mode 100644
index 0000000..f74b371
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/current_32.h
@@ -0,0 +1,21 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _I386_CURRENT_H
+#define _I386_CURRENT_H
+
+#include <linux/compiler.h>
+#include <asm/percpu.h>
+
+struct task_struct;
+
+#define current get_current()
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/delay.h b/ndk/platforms/android-5/arch-x86/include/asm/delay.h
new file mode 100644
index 0000000..7cb5f74
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/delay.h
@@ -0,0 +1,19 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_X86_DELAY_H
+#define _ASM_X86_DELAY_H
+
+#define udelay(n) (__builtin_constant_p(n) ?   ((n) > 20000 ? __bad_udelay() : __const_udelay((n) * 0x10c7ul)) :   __udelay(n))
+
+#define ndelay(n) (__builtin_constant_p(n) ?   ((n) > 20000 ? __bad_ndelay() : __const_udelay((n) * 5ul)) :   __ndelay(n))
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/desc.h b/ndk/platforms/android-5/arch-x86/include/asm/desc.h
new file mode 100644
index 0000000..e9d448b
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/desc.h
@@ -0,0 +1,12 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#include "desc_64.h"
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/desc_32.h b/ndk/platforms/android-5/arch-x86/include/asm/desc_32.h
new file mode 100644
index 0000000..f53191c
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/desc_32.h
@@ -0,0 +1,65 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ARCH_DESC_H
+#define __ARCH_DESC_H
+
+#include <asm/ldt.h>
+#include <asm/segment.h>
+
+#ifndef __ASSEMBLY__
+
+#include <linux/preempt.h>
+#include <linux/smp.h>
+#include <linux/percpu.h>
+
+#include <asm/mmu.h>
+
+struct Xgt_desc_struct {
+ unsigned short size;
+ unsigned long address __attribute__((packed));
+ unsigned short pad;
+} __attribute__ ((packed));
+
+struct gdt_page
+{
+ struct desc_struct gdt[GDT_ENTRIES];
+} __attribute__((aligned(PAGE_SIZE)));
+
+#define DESCTYPE_LDT 0x82  
+#define DESCTYPE_TSS 0x89  
+#define DESCTYPE_TASK 0x85  
+#define DESCTYPE_INT 0x8e  
+#define DESCTYPE_TRAP 0x8f  
+#define DESCTYPE_DPL3 0x60  
+#define DESCTYPE_S 0x10  
+#define load_TR_desc() native_load_tr_desc()
+#define load_gdt(dtr) native_load_gdt(dtr)
+#define load_idt(dtr) native_load_idt(dtr)
+#define load_tr(tr) __asm__ __volatile("ltr %0"::"m" (tr))
+#define load_ldt(ldt) __asm__ __volatile("lldt %0"::"m" (ldt))
+#define store_gdt(dtr) native_store_gdt(dtr)
+#define store_idt(dtr) native_store_idt(dtr)
+#define store_tr(tr) (tr = native_store_tr())
+#define store_ldt(ldt) __asm__ ("sldt %0":"=m" (ldt))
+#define load_TLS(t, cpu) native_load_tls(t, cpu)
+#define set_ldt native_set_ldt
+#define write_ldt_entry(dt, entry, a, b) write_dt_entry(dt, entry, a, b)
+#define write_gdt_entry(dt, entry, a, b) write_dt_entry(dt, entry, a, b)
+#define write_idt_entry(dt, entry, a, b) write_dt_entry(dt, entry, a, b)
+#define set_tss_desc(cpu,addr) __set_tss_desc(cpu, GDT_ENTRY_TSS, addr)
+#define LDT_entry_a(info)   ((((info)->base_addr & 0x0000ffff) << 16) | ((info)->limit & 0x0ffff))
+#define LDT_entry_b(info)   (((info)->base_addr & 0xff000000) |   (((info)->base_addr & 0x00ff0000) >> 16) |   ((info)->limit & 0xf0000) |   (((info)->read_exec_only ^ 1) << 9) |   ((info)->contents << 10) |   (((info)->seg_not_present ^ 1) << 15) |   ((info)->seg_32bit << 22) |   ((info)->limit_in_pages << 23) |   ((info)->useable << 20) |   0x7000)
+#define LDT_empty(info) (  (info)->base_addr == 0 &&   (info)->limit == 0 &&   (info)->contents == 0 &&   (info)->read_exec_only == 1 &&   (info)->seg_32bit == 0 &&   (info)->limit_in_pages == 0 &&   (info)->seg_not_present == 1 &&   (info)->useable == 0 )
+#else
+#define GET_DESC_BASE(idx, gdt, base, lo_w, lo_b, hi_b)   movb idx*8+4(gdt), lo_b;   movb idx*8+7(gdt), hi_b;   shll $16, base;   movw idx*8+2(gdt), lo_w;
+#endif
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/desc_defs.h b/ndk/platforms/android-5/arch-x86/include/asm/desc_defs.h
new file mode 100644
index 0000000..bf6de4a
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/desc_defs.h
@@ -0,0 +1,70 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ARCH_DESC_DEFS_H
+#define __ARCH_DESC_DEFS_H
+
+#ifndef __ASSEMBLY__
+
+#include <linux/types.h>
+
+struct desc_struct {
+ u16 limit0;
+ u16 base0;
+ unsigned base1 : 8, type : 4, s : 1, dpl : 2, p : 1;
+ unsigned limit : 4, avl : 1, l : 1, d : 1, g : 1, base2 : 8;
+} __attribute__((packed));
+
+struct n_desc_struct {
+ unsigned int a,b;
+};
+
+enum {
+ GATE_INTERRUPT = 0xE,
+ GATE_TRAP = 0xF,
+ GATE_CALL = 0xC,
+};
+
+struct gate_struct {
+ u16 offset_low;
+ u16 segment;
+ unsigned ist : 3, zero0 : 5, type : 5, dpl : 2, p : 1;
+ u16 offset_middle;
+ u32 offset_high;
+ u32 zero1;
+} __attribute__((packed));
+
+#define PTR_LOW(x) ((unsigned long)(x) & 0xFFFF)
+#define PTR_MIDDLE(x) (((unsigned long)(x) >> 16) & 0xFFFF)
+#define PTR_HIGH(x) ((unsigned long)(x) >> 32)
+
+enum {
+ DESC_TSS = 0x9,
+ DESC_LDT = 0x2,
+};
+
+struct ldttss_desc {
+ u16 limit0;
+ u16 base0;
+ unsigned base1 : 8, type : 5, dpl : 2, p : 1;
+ unsigned limit1 : 4, zero0 : 3, g : 1, base2 : 8;
+ u32 base3;
+ u32 zero1;
+} __attribute__((packed));
+
+struct desc_ptr {
+ unsigned short size;
+ unsigned long address;
+} __attribute__((packed)) ;
+
+#endif
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/div64.h b/ndk/platforms/android-5/arch-x86/include/asm/div64.h
new file mode 100644
index 0000000..3fef43e
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/div64.h
@@ -0,0 +1,17 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_X86_DIV64_H
+#define _ASM_X86_DIV64_H
+
+#include <asm-generic/div64.h>
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/dma-mapping.h b/ndk/platforms/android-5/arch-x86/include/asm/dma-mapping.h
new file mode 100644
index 0000000..3da1da6
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/dma-mapping.h
@@ -0,0 +1,12 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#include "dma-mapping_64.h"
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/dma-mapping_32.h b/ndk/platforms/android-5/arch-x86/include/asm/dma-mapping_32.h
new file mode 100644
index 0000000..974a60b
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/dma-mapping_32.h
@@ -0,0 +1,28 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_I386_DMA_MAPPING_H
+#define _ASM_I386_DMA_MAPPING_H
+
+#include <linux/mm.h>
+#include <linux/scatterlist.h>
+
+#include <asm/cache.h>
+#include <asm/io.h>
+#include <asm/bug.h>
+
+#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
+#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
+
+#define dma_is_consistent(d, h) (1)
+#define ARCH_HAS_DMA_DECLARE_COHERENT_MEMORY
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/dma.h b/ndk/platforms/android-5/arch-x86/include/asm/dma.h
new file mode 100644
index 0000000..ae51e02
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/dma.h
@@ -0,0 +1,12 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#include "dma_64.h"
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/dma_32.h b/ndk/platforms/android-5/arch-x86/include/asm/dma_32.h
new file mode 100644
index 0000000..9c24f5e
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/dma_32.h
@@ -0,0 +1,90 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_DMA_H
+#define _ASM_DMA_H
+
+#include <linux/spinlock.h>  
+#include <asm/io.h>  
+#include <linux/delay.h>
+
+#ifdef HAVE_REALLY_SLOW_DMA_CONTROLLER
+#define dma_outb outb_p
+#else
+#define dma_outb outb
+#endif
+
+#define dma_inb inb
+
+#define MAX_DMA_CHANNELS 8
+
+#define MAX_DMA_ADDRESS (PAGE_OFFSET+0x1000000)
+
+#define IO_DMA1_BASE 0x00  
+#define IO_DMA2_BASE 0xC0  
+
+#define DMA1_CMD_REG 0x08  
+#define DMA1_STAT_REG 0x08  
+#define DMA1_REQ_REG 0x09  
+#define DMA1_MASK_REG 0x0A  
+#define DMA1_MODE_REG 0x0B  
+#define DMA1_CLEAR_FF_REG 0x0C  
+#define DMA1_TEMP_REG 0x0D  
+#define DMA1_RESET_REG 0x0D  
+#define DMA1_CLR_MASK_REG 0x0E  
+#define DMA1_MASK_ALL_REG 0x0F  
+
+#define DMA2_CMD_REG 0xD0  
+#define DMA2_STAT_REG 0xD0  
+#define DMA2_REQ_REG 0xD2  
+#define DMA2_MASK_REG 0xD4  
+#define DMA2_MODE_REG 0xD6  
+#define DMA2_CLEAR_FF_REG 0xD8  
+#define DMA2_TEMP_REG 0xDA  
+#define DMA2_RESET_REG 0xDA  
+#define DMA2_CLR_MASK_REG 0xDC  
+#define DMA2_MASK_ALL_REG 0xDE  
+
+#define DMA_ADDR_0 0x00  
+#define DMA_ADDR_1 0x02
+#define DMA_ADDR_2 0x04
+#define DMA_ADDR_3 0x06
+#define DMA_ADDR_4 0xC0
+#define DMA_ADDR_5 0xC4
+#define DMA_ADDR_6 0xC8
+#define DMA_ADDR_7 0xCC
+
+#define DMA_CNT_0 0x01  
+#define DMA_CNT_1 0x03
+#define DMA_CNT_2 0x05
+#define DMA_CNT_3 0x07
+#define DMA_CNT_4 0xC2
+#define DMA_CNT_5 0xC6
+#define DMA_CNT_6 0xCA
+#define DMA_CNT_7 0xCE
+
+#define DMA_PAGE_0 0x87  
+#define DMA_PAGE_1 0x83
+#define DMA_PAGE_2 0x81
+#define DMA_PAGE_3 0x82
+#define DMA_PAGE_5 0x8B
+#define DMA_PAGE_6 0x89
+#define DMA_PAGE_7 0x8A
+
+#define DMA_MODE_READ 0x44  
+#define DMA_MODE_WRITE 0x48  
+#define DMA_MODE_CASCADE 0xC0  
+
+#define DMA_AUTOINIT 0x10
+
+#define isa_dma_bridge_buggy (0)
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/dwarf2.h b/ndk/platforms/android-5/arch-x86/include/asm/dwarf2.h
new file mode 100644
index 0000000..c937591
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/dwarf2.h
@@ -0,0 +1,12 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#include "dwarf2_64.h"
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/dwarf2_32.h b/ndk/platforms/android-5/arch-x86/include/asm/dwarf2_32.h
new file mode 100644
index 0000000..a2dc3f1
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/dwarf2_32.h
@@ -0,0 +1,33 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _DWARF2_H
+#define _DWARF2_H
+
+#ifndef __ASSEMBLY__
+#warning "asm/dwarf2.h should be only included in pure assembly files"
+#endif
+
+#define CFI_STARTPROC ignore
+#define CFI_ENDPROC ignore
+#define CFI_DEF_CFA ignore
+#define CFI_DEF_CFA_REGISTER ignore
+#define CFI_DEF_CFA_OFFSET ignore
+#define CFI_ADJUST_CFA_OFFSET ignore
+#define CFI_OFFSET ignore
+#define CFI_REL_OFFSET ignore
+#define CFI_REGISTER ignore
+#define CFI_RESTORE ignore
+#define CFI_REMEMBER_STATE ignore
+#define CFI_RESTORE_STATE ignore
+#define CFI_UNDEFINED ignore
+#define CFI_SIGNAL_FRAME ignore
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/e820.h b/ndk/platforms/android-5/arch-x86/include/asm/e820.h
new file mode 100644
index 0000000..8a88ff0
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/e820.h
@@ -0,0 +1,36 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASM_E820_H
+#define __ASM_E820_H
+#define E820MAP 0x2d0  
+#define E820MAX 128  
+#define E820NR 0x1e8  
+
+#define E820_RAM 1
+#define E820_RESERVED 2
+#define E820_ACPI 3
+#define E820_NVS 4
+
+#ifndef __ASSEMBLY__
+struct e820entry {
+ __u64 addr;
+ __u64 size;
+ __u32 type;
+} __attribute__((packed));
+
+struct e820map {
+ __u32 nr_map;
+ struct e820entry map[E820MAX];
+};
+#endif
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/elf.h b/ndk/platforms/android-5/arch-x86/include/asm/elf.h
new file mode 100644
index 0000000..6c6fbbf
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/elf.h
@@ -0,0 +1,74 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_X86_ELF_H
+#define _ASM_X86_ELF_H
+
+#include <asm/ptrace.h>
+#include <asm/user.h>
+#include <asm/auxvec.h>
+
+typedef unsigned long elf_greg_t;
+
+#define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof(elf_greg_t))
+typedef elf_greg_t elf_gregset_t[ELF_NGREG];
+
+typedef struct user_i387_struct elf_fpregset_t;
+
+#ifdef __i386__
+
+typedef struct user_fxsr_struct elf_fpxregset_t;
+
+#define R_386_NONE 0
+#define R_386_32 1
+#define R_386_PC32 2
+#define R_386_GOT32 3
+#define R_386_PLT32 4
+#define R_386_COPY 5
+#define R_386_GLOB_DAT 6
+#define R_386_JMP_SLOT 7
+#define R_386_RELATIVE 8
+#define R_386_GOTOFF 9
+#define R_386_GOTPC 10
+#define R_386_NUM 11
+
+#define ELF_CLASS ELFCLASS32
+#define ELF_DATA ELFDATA2LSB
+#define ELF_ARCH EM_386
+
+#else
+
+#define R_X86_64_NONE 0  
+#define R_X86_64_64 1  
+#define R_X86_64_PC32 2  
+#define R_X86_64_GOT32 3  
+#define R_X86_64_PLT32 4  
+#define R_X86_64_COPY 5  
+#define R_X86_64_GLOB_DAT 6  
+#define R_X86_64_JUMP_SLOT 7  
+#define R_X86_64_RELATIVE 8  
+#define R_X86_64_GOTPCREL 9  
+#define R_X86_64_32 10  
+#define R_X86_64_32S 11  
+#define R_X86_64_16 12  
+#define R_X86_64_PC16 13  
+#define R_X86_64_8 14  
+#define R_X86_64_PC8 15  
+
+#define R_X86_64_NUM 16
+
+#define ELF_CLASS ELFCLASS64
+#define ELF_DATA ELFDATA2LSB
+#define ELF_ARCH EM_X86_64
+
+#endif
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/errno.h b/ndk/platforms/android-5/arch-x86/include/asm/errno.h
new file mode 100644
index 0000000..e8f7425
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/errno.h
@@ -0,0 +1,12 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#include <asm-generic/errno.h>
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/fcntl.h b/ndk/platforms/android-5/arch-x86/include/asm/fcntl.h
new file mode 100644
index 0000000..00630ad
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/fcntl.h
@@ -0,0 +1,12 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#include <asm-generic/fcntl.h>
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/fixmap.h b/ndk/platforms/android-5/arch-x86/include/asm/fixmap.h
new file mode 100644
index 0000000..19b9cc8
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/fixmap.h
@@ -0,0 +1,12 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#include "fixmap_64.h"
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/fixmap_32.h b/ndk/platforms/android-5/arch-x86/include/asm/fixmap_32.h
new file mode 100644
index 0000000..95de8a0
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/fixmap_32.h
@@ -0,0 +1,55 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_FIXMAP_H
+#define _ASM_FIXMAP_H
+
+#define FIXADDR_USER_START __fix_to_virt(FIX_VDSO)
+#define FIXADDR_USER_END __fix_to_virt(FIX_VDSO - 1)
+
+#ifndef __ASSEMBLY__
+#include <linux/kernel.h>
+#include <asm/acpi.h>
+#include <asm/apicdef.h>
+#include <asm/page.h>
+
+enum fixed_addresses {
+ FIX_HOLE,
+ FIX_VDSO,
+ FIX_DBGP_BASE,
+ FIX_EARLYCON_MEM_BASE,
+ __end_of_permanent_fixed_addresses,
+
+#define NR_FIX_BTMAPS 16
+ FIX_BTMAP_END = __end_of_permanent_fixed_addresses,
+ FIX_BTMAP_BEGIN = FIX_BTMAP_END + NR_FIX_BTMAPS - 1,
+ FIX_WP_TEST,
+ __end_of_fixed_addresses
+};
+
+#define set_fixmap(idx, phys)   __set_fixmap(idx, phys, PAGE_KERNEL)
+
+#define set_fixmap_nocache(idx, phys)   __set_fixmap(idx, phys, PAGE_KERNEL_NOCACHE)
+
+#define clear_fixmap(idx)   __set_fixmap(idx, 0, __pgprot(0))
+
+#define FIXADDR_TOP ((unsigned long)__FIXADDR_TOP)
+
+#define __FIXADDR_SIZE (__end_of_permanent_fixed_addresses << PAGE_SHIFT)
+#define __FIXADDR_BOOT_SIZE (__end_of_fixed_addresses << PAGE_SHIFT)
+#define FIXADDR_START (FIXADDR_TOP - __FIXADDR_SIZE)
+#define FIXADDR_BOOT_START (FIXADDR_TOP - __FIXADDR_BOOT_SIZE)
+
+#define __fix_to_virt(x) (FIXADDR_TOP - ((x) << PAGE_SHIFT))
+#define __virt_to_fix(x) ((FIXADDR_TOP - ((x)&PAGE_MASK)) >> PAGE_SHIFT)
+
+#endif
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/genapic.h b/ndk/platforms/android-5/arch-x86/include/asm/genapic.h
new file mode 100644
index 0000000..84e687e
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/genapic.h
@@ -0,0 +1,12 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#include "genapic_64.h"
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/genapic_32.h b/ndk/platforms/android-5/arch-x86/include/asm/genapic_32.h
new file mode 100644
index 0000000..07801ea
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/genapic_32.h
@@ -0,0 +1,73 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_GENAPIC_H
+#define _ASM_GENAPIC_H 1
+
+#include <asm/mpspec.h>
+
+struct mpc_config_translation;
+struct mpc_config_bus;
+struct mp_config_table;
+struct mpc_config_processor;
+
+struct genapic {
+ char *name;
+ int (*probe)(void);
+
+ int (*apic_id_registered)(void);
+ cpumask_t (*target_cpus)(void);
+ int int_delivery_mode;
+ int int_dest_mode;
+ int ESR_DISABLE;
+ int apic_destination_logical;
+ unsigned long (*check_apicid_used)(physid_mask_t bitmap, int apicid);
+ unsigned long (*check_apicid_present)(int apicid);
+ int no_balance_irq;
+ int no_ioapic_check;
+ void (*init_apic_ldr)(void);
+ physid_mask_t (*ioapic_phys_id_map)(physid_mask_t map);
+
+ void (*setup_apic_routing)(void);
+ int (*multi_timer_check)(int apic, int irq);
+ int (*apicid_to_node)(int logical_apicid);
+ int (*cpu_to_logical_apicid)(int cpu);
+ int (*cpu_present_to_apicid)(int mps_cpu);
+ physid_mask_t (*apicid_to_cpu_present)(int phys_apicid);
+ int (*mpc_apic_id)(struct mpc_config_processor *m,
+ struct mpc_config_translation *t);
+ void (*setup_portio_remap)(void);
+ int (*check_phys_apicid_present)(int boot_cpu_physical_apicid);
+ void (*enable_apic_mode)(void);
+ u32 (*phys_pkg_id)(u32 cpuid_apic, int index_msb);
+
+ void (*mpc_oem_bus_info)(struct mpc_config_bus *, char *,
+ struct mpc_config_translation *);
+ void (*mpc_oem_pci_bus)(struct mpc_config_bus *,
+ struct mpc_config_translation *);
+
+ int (*mps_oem_check)(struct mp_config_table *mpc, char *oem,
+ char *productid);
+ int (*acpi_madt_oem_check)(char *oem_id, char *oem_table_id);
+
+ unsigned (*get_apic_id)(unsigned long x);
+ unsigned long apic_id_mask;
+ unsigned int (*cpu_mask_to_apicid)(cpumask_t cpumask);
+
+};
+
+#define APICFUNC(x) .x = x,
+
+#define IPIFUNC(x)
+
+#define APIC_INIT(aname, aprobe) {   .name = aname,   .probe = aprobe,   .int_delivery_mode = INT_DELIVERY_MODE,   .int_dest_mode = INT_DEST_MODE,   .no_balance_irq = NO_BALANCE_IRQ,   .ESR_DISABLE = esr_disable,   .apic_destination_logical = APIC_DEST_LOGICAL,   APICFUNC(apic_id_registered)   APICFUNC(target_cpus)   APICFUNC(check_apicid_used)   APICFUNC(check_apicid_present)   APICFUNC(init_apic_ldr)   APICFUNC(ioapic_phys_id_map)   APICFUNC(setup_apic_routing)   APICFUNC(multi_timer_check)   APICFUNC(apicid_to_node)   APICFUNC(cpu_to_logical_apicid)   APICFUNC(cpu_present_to_apicid)   APICFUNC(apicid_to_cpu_present)   APICFUNC(mpc_apic_id)   APICFUNC(setup_portio_remap)   APICFUNC(check_phys_apicid_present)   APICFUNC(mpc_oem_bus_info)   APICFUNC(mpc_oem_pci_bus)   APICFUNC(mps_oem_check)   APICFUNC(get_apic_id)   .apic_id_mask = APIC_ID_MASK,   APICFUNC(cpu_mask_to_apicid)   APICFUNC(acpi_madt_oem_check)   IPIFUNC(send_IPI_mask)   IPIFUNC(send_IPI_allbutself)   IPIFUNC(send_IPI_all)   APICFUNC(enable_apic_mode)   APICFUNC(phys_pkg_id)   }
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/hardirq.h b/ndk/platforms/android-5/arch-x86/include/asm/hardirq.h
new file mode 100644
index 0000000..ee224f1
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/hardirq.h
@@ -0,0 +1,12 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#include "hardirq_64.h"
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/hardirq_32.h b/ndk/platforms/android-5/arch-x86/include/asm/hardirq_32.h
new file mode 100644
index 0000000..b682f66
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/hardirq_32.h
@@ -0,0 +1,36 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASM_HARDIRQ_H
+#define __ASM_HARDIRQ_H
+
+#include <linux/threads.h>
+#include <linux/irq.h>
+
+typedef struct {
+ unsigned int __softirq_pending;
+ unsigned long idle_timestamp;
+ unsigned int __nmi_count;
+ unsigned int apic_timer_irqs;
+ unsigned int irq0_irqs;
+ unsigned int irq_resched_count;
+ unsigned int irq_call_count;
+ unsigned int irq_tlb_count;
+ unsigned int irq_thermal_count;
+ unsigned int irq_spurious_count;
+} ____cacheline_aligned irq_cpustat_t;
+
+#define __ARCH_IRQ_STAT
+#define __IRQ_STAT(cpu, member) (per_cpu(irq_stat, cpu).member)
+
+#include <linux/irq_cpustat.h>
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/highmem.h b/ndk/platforms/android-5/arch-x86/include/asm/highmem.h
new file mode 100644
index 0000000..f738851
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/highmem.h
@@ -0,0 +1,15 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_HIGHMEM_H
+#define _ASM_HIGHMEM_H
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/hw_irq.h b/ndk/platforms/android-5/arch-x86/include/asm/hw_irq.h
new file mode 100644
index 0000000..ed937c7
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/hw_irq.h
@@ -0,0 +1,12 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#include "hw_irq_64.h"
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/hw_irq_32.h b/ndk/platforms/android-5/arch-x86/include/asm/hw_irq_32.h
new file mode 100644
index 0000000..6f584fc
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/hw_irq_32.h
@@ -0,0 +1,24 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_HW_IRQ_H
+#define _ASM_HW_IRQ_H
+
+#include <linux/profile.h>
+#include <asm/atomic.h>
+#include <asm/irq.h>
+#include <asm/sections.h>
+
+#define NMI_VECTOR 0x02
+
+#define IO_APIC_IRQ(x) (((x) >= 16) || ((1<<(x)) & io_apic_irqs))
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/i387.h b/ndk/platforms/android-5/arch-x86/include/asm/i387.h
new file mode 100644
index 0000000..2692557
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/i387.h
@@ -0,0 +1,12 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#include "i387_64.h"
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/i387_32.h b/ndk/platforms/android-5/arch-x86/include/asm/i387_32.h
new file mode 100644
index 0000000..8563fb9
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/i387_32.h
@@ -0,0 +1,33 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASM_I386_I387_H
+#define __ASM_I386_I387_H
+
+#include <linux/sched.h>
+#include <linux/init.h>
+#include <linux/kernel_stat.h>
+#include <asm/processor.h>
+#include <asm/sigcontext.h>
+#include <asm/user.h>
+
+#define restore_fpu(tsk)   alternative_input(   "nop ; frstor %1",   "fxrstor %1",   X86_FEATURE_FXSR,   "m" ((tsk)->thread.i387.fxsave))
+
+#define kernel_fpu_end() do { stts(); preempt_enable(); } while(0)
+
+#define safe_address (kstat_cpu(0).cpustat.user)
+
+#define __unlazy_fpu( tsk ) do {   if (task_thread_info(tsk)->status & TS_USEDFPU) {   __save_init_fpu(tsk);   stts();   } else   tsk->fpu_counter = 0;  } while (0)
+#define __clear_fpu( tsk )  do {   if (task_thread_info(tsk)->status & TS_USEDFPU) {   asm volatile("fnclex ; fwait");   task_thread_info(tsk)->status &= ~TS_USEDFPU;   stts();   }  } while (0)
+#define unlazy_fpu( tsk ) do {   preempt_disable();   __unlazy_fpu(tsk);   preempt_enable();  } while (0)
+#define clear_fpu( tsk ) do {   preempt_disable();   __clear_fpu( tsk );   preempt_enable();  } while (0)
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/i8253.h b/ndk/platforms/android-5/arch-x86/include/asm/i8253.h
new file mode 100644
index 0000000..93b1d1a
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/i8253.h
@@ -0,0 +1,19 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASM_I8253_H__
+#define __ASM_I8253_H__
+
+#define PIT_MODE 0x43
+#define PIT_CH0 0x40
+#define PIT_CH2 0x42
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/i8259.h b/ndk/platforms/android-5/arch-x86/include/asm/i8259.h
new file mode 100644
index 0000000..c2366ea
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/i8259.h
@@ -0,0 +1,19 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASM_I8259_H__
+#define __ASM_I8259_H__
+
+#define __byte(x,y) (((unsigned char *) &(y))[x])
+#define cached_master_mask (__byte(0, cached_irq_mask))
+#define cached_slave_mask (__byte(1, cached_irq_mask))
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/ia32_unistd.h b/ndk/platforms/android-5/arch-x86/include/asm/ia32_unistd.h
new file mode 100644
index 0000000..848d228
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/ia32_unistd.h
@@ -0,0 +1,22 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_X86_64_IA32_UNISTD_H_
+#define _ASM_X86_64_IA32_UNISTD_H_
+
+#define __NR_ia32_restart_syscall 0
+#define __NR_ia32_exit 1
+#define __NR_ia32_read 3
+#define __NR_ia32_write 4
+#define __NR_ia32_sigreturn 119
+#define __NR_ia32_rt_sigreturn 173
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/io.h b/ndk/platforms/android-5/arch-x86/include/asm/io.h
new file mode 100644
index 0000000..ea52e66
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/io.h
@@ -0,0 +1,12 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#include "io_64.h"
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/io_32.h b/ndk/platforms/android-5/arch-x86/include/asm/io_32.h
new file mode 100644
index 0000000..f7e0025
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/io_32.h
@@ -0,0 +1,27 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_IO_H
+#define _ASM_IO_H
+
+#include <linux/string.h>
+#include <linux/compiler.h>
+
+#define IO_SPACE_LIMIT 0xffff
+
+#define XQUAD_PORTIO_BASE 0xfe400000
+#define XQUAD_PORTIO_QUAD 0x40000  
+
+#ifdef REALLY_SLOW_IO
+#endif
+#define __BUILDIO(bwl,bw,type)  static inline void out##bwl(unsigned type value, int port) {   out##bwl##_local(value, port);  }  static inline unsigned type in##bwl(int port) {   return in##bwl##_local(port);  }
+#define BUILDIO(bwl,bw,type)  static inline void out##bwl##_local(unsigned type value, int port) {   __asm__ __volatile__("out" #bwl " %" #bw "0, %w1" : : "a"(value), "Nd"(port));  }  static inline unsigned type in##bwl##_local(int port) {   unsigned type value;   __asm__ __volatile__("in" #bwl " %w1, %" #bw "0" : "=a"(value) : "Nd"(port));   return value;  }  static inline void out##bwl##_local_p(unsigned type value, int port) {   out##bwl##_local(value, port);   slow_down_io();  }  static inline unsigned type in##bwl##_local_p(int port) {   unsigned type value = in##bwl##_local(port);   slow_down_io();   return value;  }  __BUILDIO(bwl,bw,type)  static inline void out##bwl##_p(unsigned type value, int port) {   out##bwl(value, port);   slow_down_io();  }  static inline unsigned type in##bwl##_p(int port) {   unsigned type value = in##bwl(port);   slow_down_io();   return value;  }  static inline void outs##bwl(int port, const void *addr, unsigned long count) {   __asm__ __volatile__("rep; outs" #bwl : "+S"(addr), "+c"(count) : "d"(port));  }  static inline void ins##bwl(int port, void *addr, unsigned long count) {   __asm__ __volatile__("rep; ins" #bwl : "+D"(addr), "+c"(count) : "d"(port));  }
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/io_apic.h b/ndk/platforms/android-5/arch-x86/include/asm/io_apic.h
new file mode 100644
index 0000000..ed608d3
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/io_apic.h
@@ -0,0 +1,12 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#include "io_apic_64.h"
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/io_apic_32.h b/ndk/platforms/android-5/arch-x86/include/asm/io_apic_32.h
new file mode 100644
index 0000000..cc858a3
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/io_apic_32.h
@@ -0,0 +1,96 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASM_IO_APIC_H
+#define __ASM_IO_APIC_H
+
+#include <asm/types.h>
+#include <asm/mpspec.h>
+#include <asm/apicdef.h>
+
+union IO_APIC_reg_00 {
+ u32 raw;
+ struct {
+ u32 __reserved_2 : 14,
+ LTS : 1,
+ delivery_type : 1,
+ __reserved_1 : 8,
+ ID : 8;
+ } __attribute__ ((packed)) bits;
+};
+
+union IO_APIC_reg_01 {
+ u32 raw;
+ struct {
+ u32 version : 8,
+ __reserved_2 : 7,
+ PRQ : 1,
+ entries : 8,
+ __reserved_1 : 8;
+ } __attribute__ ((packed)) bits;
+};
+
+union IO_APIC_reg_02 {
+ u32 raw;
+ struct {
+ u32 __reserved_2 : 24,
+ arbitration : 4,
+ __reserved_1 : 4;
+ } __attribute__ ((packed)) bits;
+};
+
+union IO_APIC_reg_03 {
+ u32 raw;
+ struct {
+ u32 boot_DT : 1,
+ __reserved_1 : 31;
+ } __attribute__ ((packed)) bits;
+};
+
+enum ioapic_irq_destination_types {
+ dest_Fixed = 0,
+ dest_LowestPrio = 1,
+ dest_SMI = 2,
+ dest__reserved_1 = 3,
+ dest_NMI = 4,
+ dest_INIT = 5,
+ dest__reserved_2 = 6,
+ dest_ExtINT = 7
+};
+
+struct IO_APIC_route_entry {
+ __u32 vector : 8,
+ delivery_mode : 3,
+ dest_mode : 1,
+ delivery_status : 1,
+ polarity : 1,
+ irr : 1,
+ trigger : 1,
+ mask : 1,
+ __reserved_2 : 15;
+
+ union { struct { __u32
+ __reserved_1 : 24,
+ physical_dest : 4,
+ __reserved_2 : 4;
+ } physical;
+
+ struct { __u32
+ __reserved_1 : 24,
+ logical_dest : 8;
+ } logical;
+ } dest;
+
+} __attribute__ ((packed));
+
+#define io_apic_assign_pci_irqs 0
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/ioctl.h b/ndk/platforms/android-5/arch-x86/include/asm/ioctl.h
new file mode 100644
index 0000000..6e446b6
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/ioctl.h
@@ -0,0 +1,12 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#include <asm-generic/ioctl.h>
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/ioctls.h b/ndk/platforms/android-5/arch-x86/include/asm/ioctls.h
new file mode 100644
index 0000000..3aedc04
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/ioctls.h
@@ -0,0 +1,95 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_X86_IOCTLS_H
+#define _ASM_X86_IOCTLS_H
+
+#include <asm/ioctl.h>
+
+#define TCGETS 0x5401
+#define TCSETS 0x5402  
+#define TCSETSW 0x5403
+#define TCSETSF 0x5404
+#define TCGETA 0x5405
+#define TCSETA 0x5406
+#define TCSETAW 0x5407
+#define TCSETAF 0x5408
+#define TCSBRK 0x5409
+#define TCXONC 0x540A
+#define TCFLSH 0x540B
+#define TIOCEXCL 0x540C
+#define TIOCNXCL 0x540D
+#define TIOCSCTTY 0x540E
+#define TIOCGPGRP 0x540F
+#define TIOCSPGRP 0x5410
+#define TIOCOUTQ 0x5411
+#define TIOCSTI 0x5412
+#define TIOCGWINSZ 0x5413
+#define TIOCSWINSZ 0x5414
+#define TIOCMGET 0x5415
+#define TIOCMBIS 0x5416
+#define TIOCMBIC 0x5417
+#define TIOCMSET 0x5418
+#define TIOCGSOFTCAR 0x5419
+#define TIOCSSOFTCAR 0x541A
+#define FIONREAD 0x541B
+#define TIOCINQ FIONREAD
+#define TIOCLINUX 0x541C
+#define TIOCCONS 0x541D
+#define TIOCGSERIAL 0x541E
+#define TIOCSSERIAL 0x541F
+#define TIOCPKT 0x5420
+#define FIONBIO 0x5421
+#define TIOCNOTTY 0x5422
+#define TIOCSETD 0x5423
+#define TIOCGETD 0x5424
+#define TCSBRKP 0x5425  
+
+#define TIOCSBRK 0x5427  
+#define TIOCCBRK 0x5428  
+#define TIOCGSID 0x5429  
+#define TCGETS2 _IOR('T',0x2A, struct termios2)
+#define TCSETS2 _IOW('T',0x2B, struct termios2)
+#define TCSETSW2 _IOW('T',0x2C, struct termios2)
+#define TCSETSF2 _IOW('T',0x2D, struct termios2)
+#define TIOCGPTN _IOR('T',0x30, unsigned int)  
+#define TIOCSPTLCK _IOW('T',0x31, int)  
+
+#define FIONCLEX 0x5450
+#define FIOCLEX 0x5451
+#define FIOASYNC 0x5452
+#define TIOCSERCONFIG 0x5453
+#define TIOCSERGWILD 0x5454
+#define TIOCSERSWILD 0x5455
+#define TIOCGLCKTRMIOS 0x5456
+#define TIOCSLCKTRMIOS 0x5457
+#define TIOCSERGSTRUCT 0x5458  
+#define TIOCSERGETLSR 0x5459  
+#define TIOCSERGETMULTI 0x545A  
+#define TIOCSERSETMULTI 0x545B  
+
+#define TIOCMIWAIT 0x545C  
+#define TIOCGICOUNT 0x545D  
+#define TIOCGHAYESESP 0x545E  
+#define TIOCSHAYESESP 0x545F  
+#define FIOQSIZE 0x5460
+
+#define TIOCPKT_DATA 0
+#define TIOCPKT_FLUSHREAD 1
+#define TIOCPKT_FLUSHWRITE 2
+#define TIOCPKT_STOP 4
+#define TIOCPKT_START 8
+#define TIOCPKT_NOSTOP 16
+#define TIOCPKT_DOSTOP 32
+
+#define TIOCSER_TEMT 0x01  
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/ipcbuf.h b/ndk/platforms/android-5/arch-x86/include/asm/ipcbuf.h
new file mode 100644
index 0000000..32342c1
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/ipcbuf.h
@@ -0,0 +1,30 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_X86_IPCBUF_H
+#define _ASM_X86_IPCBUF_H
+
+struct ipc64_perm
+{
+ __kernel_key_t key;
+ __kernel_uid32_t uid;
+ __kernel_gid32_t gid;
+ __kernel_uid32_t cuid;
+ __kernel_gid32_t cgid;
+ __kernel_mode_t mode;
+ unsigned short __pad1;
+ unsigned short seq;
+ unsigned short __pad2;
+ unsigned long __unused1;
+ unsigned long __unused2;
+};
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/irq.h b/ndk/platforms/android-5/arch-x86/include/asm/irq.h
new file mode 100644
index 0000000..07a331d
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/irq.h
@@ -0,0 +1,12 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#include "irq_64.h"
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/irq_32.h b/ndk/platforms/android-5/arch-x86/include/asm/irq_32.h
new file mode 100644
index 0000000..3141071
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/irq_32.h
@@ -0,0 +1,23 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_IRQ_H
+#define _ASM_IRQ_H
+
+#include <linux/sched.h>
+
+#include "irq_vectors.h"
+#include <asm/thread_info.h>
+
+#define irq_ctx_init(cpu) do { } while (0)
+#define irq_ctx_exit(cpu) do { } while (0)
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/irqflags.h b/ndk/platforms/android-5/arch-x86/include/asm/irqflags.h
new file mode 100644
index 0000000..4f84662
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/irqflags.h
@@ -0,0 +1,12 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#include "irqflags_64.h"
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/irqflags_32.h b/ndk/platforms/android-5/arch-x86/include/asm/irqflags_32.h
new file mode 100644
index 0000000..9002e44
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/irqflags_32.h
@@ -0,0 +1,33 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_IRQFLAGS_H
+#define _ASM_IRQFLAGS_H
+#include <asm/processor-flags.h>
+
+#ifndef __ASSEMBLY__
+#endif
+#ifndef __ASSEMBLY__
+#else
+#define DISABLE_INTERRUPTS(clobbers) cli
+#define ENABLE_INTERRUPTS(clobbers) sti
+#define ENABLE_INTERRUPTS_SYSEXIT sti; sysexit
+#define INTERRUPT_RETURN iret
+#define GET_CR0_INTO_EAX movl %cr0, %eax
+#endif
+#ifndef __ASSEMBLY__
+#define raw_local_save_flags(flags)   do { (flags) = __raw_local_save_flags(); } while (0)
+#define raw_local_irq_save(flags)   do { (flags) = __raw_local_irq_save(); } while (0)
+#endif
+#define TRACE_IRQS_ON
+#define TRACE_IRQS_OFF
+#define LOCKDEP_SYS_EXIT
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/ist.h b/ndk/platforms/android-5/arch-x86/include/asm/ist.h
new file mode 100644
index 0000000..0abab19
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/ist.h
@@ -0,0 +1,24 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_IST_H
+#define _ASM_IST_H
+
+#include <linux/types.h>
+
+struct ist_info {
+ __u32 signature;
+ __u32 command;
+ __u32 event;
+ __u32 perf_level;
+};
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/kmap_types.h b/ndk/platforms/android-5/arch-x86/include/asm/kmap_types.h
new file mode 100644
index 0000000..c2313ee
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/kmap_types.h
@@ -0,0 +1,36 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_X86_KMAP_TYPES_H
+#define _ASM_X86_KMAP_TYPES_H
+
+#define D(n)
+
+enum km_type {
+D(0) KM_BOUNCE_READ,
+D(1) KM_SKB_SUNRPC_DATA,
+D(2) KM_SKB_DATA_SOFTIRQ,
+D(3) KM_USER0,
+D(4) KM_USER1,
+D(5) KM_BIO_SRC_IRQ,
+D(6) KM_BIO_DST_IRQ,
+D(7) KM_PTE0,
+D(8) KM_PTE1,
+D(9) KM_IRQ0,
+D(10) KM_IRQ1,
+D(11) KM_SOFTIRQ0,
+D(12) KM_SOFTIRQ1,
+D(13) KM_TYPE_NR
+};
+
+#undef D
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/ldt.h b/ndk/platforms/android-5/arch-x86/include/asm/ldt.h
new file mode 100644
index 0000000..19b91ab
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/ldt.h
@@ -0,0 +1,41 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_X86_LDT_H
+#define _ASM_X86_LDT_H
+
+#define LDT_ENTRIES 8192
+
+#define LDT_ENTRY_SIZE 8
+
+#ifndef __ASSEMBLY__
+
+struct user_desc {
+ unsigned int entry_number;
+ unsigned int base_addr;
+ unsigned int limit;
+ unsigned int seg_32bit:1;
+ unsigned int contents:2;
+ unsigned int read_exec_only:1;
+ unsigned int limit_in_pages:1;
+ unsigned int seg_not_present:1;
+ unsigned int useable:1;
+#ifdef __x86_64__
+ unsigned int lm:1;
+#endif
+};
+
+#define MODIFY_LDT_CONTENTS_DATA 0
+#define MODIFY_LDT_CONTENTS_STACK 1
+#define MODIFY_LDT_CONTENTS_CODE 2
+
+#endif
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/linkage.h b/ndk/platforms/android-5/arch-x86/include/asm/linkage.h
new file mode 100644
index 0000000..f149e4d
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/linkage.h
@@ -0,0 +1,12 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#include "linkage_64.h"
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/linkage_32.h b/ndk/platforms/android-5/arch-x86/include/asm/linkage_32.h
new file mode 100644
index 0000000..6db10ee
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/linkage_32.h
@@ -0,0 +1,21 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASM_LINKAGE_H
+#define __ASM_LINKAGE_H
+
+#define asmlinkage CPP_ASMLINKAGE __attribute__((regparm(0)))
+#define FASTCALL(x) x __attribute__((regparm(3)))
+#define fastcall __attribute__((regparm(3)))
+
+#define prevent_tail_call(ret) __asm__ ("" : "=r" (ret) : "0" (ret))
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/local.h b/ndk/platforms/android-5/arch-x86/include/asm/local.h
new file mode 100644
index 0000000..85080b8
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/local.h
@@ -0,0 +1,12 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#include "local_64.h"
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/local_32.h b/ndk/platforms/android-5/arch-x86/include/asm/local_32.h
new file mode 100644
index 0000000..fcad753
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/local_32.h
@@ -0,0 +1,51 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ARCH_I386_LOCAL_H
+#define _ARCH_I386_LOCAL_H
+
+#include <linux/percpu.h>
+#include <asm/system.h>
+#include <asm/atomic.h>
+
+typedef struct
+{
+ atomic_long_t a;
+} local_t;
+
+#define LOCAL_INIT(i) { ATOMIC_LONG_INIT(i) }
+
+#define local_read(l) atomic_long_read(&(l)->a)
+#define local_set(l,i) atomic_long_set(&(l)->a, (i))
+
+#define local_inc_return(l) (local_add_return(1,l))
+#define local_dec_return(l) (local_sub_return(1,l))
+#define local_cmpxchg(l, o, n)   (cmpxchg_local(&((l)->a.counter), (o), (n)))
+#define local_xchg(l, n) (xchg(&((l)->a.counter), (n)))
+#define local_add_unless(l, a, u)  ({   long c, old;   c = local_read(l);   for (;;) {   if (unlikely(c == (u)))   break;   old = local_cmpxchg((l), c, c + (a));   if (likely(old == c))   break;   c = old;   }   c != (u);  })
+#define local_inc_not_zero(l) local_add_unless((l), 1, 0)
+#define __local_inc(l) local_inc(l)
+#define __local_dec(l) local_dec(l)
+#define __local_add(i,l) local_add((i),(l))
+#define __local_sub(i,l) local_sub((i),(l))
+#define cpu_local_wrap_v(l)   ({ local_t res__;   preempt_disable();   res__ = (l);   preempt_enable();   res__; })
+#define cpu_local_wrap(l)   ({ preempt_disable();   l;   preempt_enable(); })  
+#define cpu_local_read(l) cpu_local_wrap_v(local_read(&__get_cpu_var(l)))
+#define cpu_local_set(l, i) cpu_local_wrap(local_set(&__get_cpu_var(l), (i)))
+#define cpu_local_inc(l) cpu_local_wrap(local_inc(&__get_cpu_var(l)))
+#define cpu_local_dec(l) cpu_local_wrap(local_dec(&__get_cpu_var(l)))
+#define cpu_local_add(i, l) cpu_local_wrap(local_add((i), &__get_cpu_var(l)))
+#define cpu_local_sub(i, l) cpu_local_wrap(local_sub((i), &__get_cpu_var(l)))
+#define __cpu_local_inc(l) cpu_local_inc(l)
+#define __cpu_local_dec(l) cpu_local_dec(l)
+#define __cpu_local_add(i, l) cpu_local_add((i), (l))
+#define __cpu_local_sub(i, l) cpu_local_sub((i), (l))
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/math_emu.h b/ndk/platforms/android-5/arch-x86/include/asm/math_emu.h
new file mode 100644
index 0000000..9380d19
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/math_emu.h
@@ -0,0 +1,40 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _I386_MATH_EMU_H
+#define _I386_MATH_EMU_H
+
+#include <asm/sigcontext.h>
+
+struct info {
+ long ___orig_eip;
+ long ___ebx;
+ long ___ecx;
+ long ___edx;
+ long ___esi;
+ long ___edi;
+ long ___ebp;
+ long ___eax;
+ long ___ds;
+ long ___es;
+ long ___fs;
+ long ___orig_eax;
+ long ___eip;
+ long ___cs;
+ long ___eflags;
+ long ___esp;
+ long ___ss;
+ long ___vm86_es;
+ long ___vm86_ds;
+ long ___vm86_fs;
+ long ___vm86_gs;
+};
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/mc146818rtc.h b/ndk/platforms/android-5/arch-x86/include/asm/mc146818rtc.h
new file mode 100644
index 0000000..8497877
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/mc146818rtc.h
@@ -0,0 +1,12 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#include "mc146818rtc_64.h"
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/mc146818rtc_32.h b/ndk/platforms/android-5/arch-x86/include/asm/mc146818rtc_32.h
new file mode 100644
index 0000000..899d608
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/mc146818rtc_32.h
@@ -0,0 +1,44 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_MC146818RTC_H
+#define _ASM_MC146818RTC_H
+
+#include <asm/io.h>
+#include <asm/system.h>
+#include <asm/processor.h>
+#include <linux/mc146818rtc.h>
+
+#ifndef RTC_PORT
+#define RTC_PORT(x) (0x70 + (x))
+#define RTC_ALWAYS_BCD 1  
+#endif
+
+#ifdef __HAVE_ARCH_CMPXCHG
+
+#include <linux/smp.h>
+
+#define lock_cmos_prefix(reg)   do {   unsigned long cmos_flags;   local_irq_save(cmos_flags);   lock_cmos(reg)
+#define lock_cmos_suffix(reg)   unlock_cmos();   local_irq_restore(cmos_flags);   } while (0)
+#else
+#define lock_cmos_prefix(reg) do {} while (0)
+#define lock_cmos_suffix(reg) do {} while (0)
+#define lock_cmos(reg)
+#define unlock_cmos()
+#define do_i_have_lock_cmos() 0
+#define current_lock_cmos_reg() 0
+#endif
+#define CMOS_READ(addr) rtc_cmos_read(addr)
+#define CMOS_WRITE(val, addr) rtc_cmos_write(val, addr)
+
+#define RTC_IRQ 8
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/mman.h b/ndk/platforms/android-5/arch-x86/include/asm/mman.h
new file mode 100644
index 0000000..7eda319
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/mman.h
@@ -0,0 +1,30 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_X86_MMAN_H
+#define _ASM_X86_MMAN_H
+
+#include <asm-generic/mman.h>
+
+#define MAP_32BIT 0x40  
+
+#define MAP_GROWSDOWN 0x0100  
+#define MAP_DENYWRITE 0x0800  
+#define MAP_EXECUTABLE 0x1000  
+#define MAP_LOCKED 0x2000  
+#define MAP_NORESERVE 0x4000  
+#define MAP_POPULATE 0x8000  
+#define MAP_NONBLOCK 0x10000  
+
+#define MCL_CURRENT 1  
+#define MCL_FUTURE 2  
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/mmsegment.h b/ndk/platforms/android-5/arch-x86/include/asm/mmsegment.h
new file mode 100644
index 0000000..76045c7
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/mmsegment.h
@@ -0,0 +1,19 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_MMSEGMENT_H
+#define _ASM_MMSEGMENT_H 1
+
+typedef struct {
+ unsigned long seg;
+} mm_segment_t;
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/mmu.h b/ndk/platforms/android-5/arch-x86/include/asm/mmu.h
new file mode 100644
index 0000000..30db10a
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/mmu.h
@@ -0,0 +1,25 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_X86_MMU_H
+#define _ASM_X86_MMU_H
+
+#include <linux/spinlock.h>
+#include <linux/mutex.h>
+
+typedef struct {
+ void *ldt;
+ int size;
+ struct mutex lock;
+ void *vdso;
+} mm_context_t;
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/module.h b/ndk/platforms/android-5/arch-x86/include/asm/module.h
new file mode 100644
index 0000000..ff292d4
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/module.h
@@ -0,0 +1,12 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#include "module_64.h"
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/module_32.h b/ndk/platforms/android-5/arch-x86/include/asm/module_32.h
new file mode 100644
index 0000000..2e26729
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/module_32.h
@@ -0,0 +1,29 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_I386_MODULE_H
+#define _ASM_I386_MODULE_H
+
+struct mod_arch_specific
+{
+};
+
+#define Elf_Shdr Elf32_Shdr
+#define Elf_Sym Elf32_Sym
+#define Elf_Ehdr Elf32_Ehdr
+
+#error unknown processor family
+
+#define MODULE_STACKSIZE ""
+
+#define MODULE_ARCH_VERMAGIC MODULE_PROC_FAMILY MODULE_STACKSIZE
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/mpspec.h b/ndk/platforms/android-5/arch-x86/include/asm/mpspec.h
new file mode 100644
index 0000000..2336504
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/mpspec.h
@@ -0,0 +1,12 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#include "mpspec_64.h"
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/mpspec_32.h b/ndk/platforms/android-5/arch-x86/include/asm/mpspec_32.h
new file mode 100644
index 0000000..7acbe8a
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/mpspec_32.h
@@ -0,0 +1,52 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASM_MPSPEC_H
+#define __ASM_MPSPEC_H
+
+#include <linux/cpumask.h>
+#include <asm/mpspec_def.h>
+#include <mach_mpspec.h>
+
+#define PHYSID_ARRAY_SIZE BITS_TO_LONGS(MAX_APICS)
+
+struct physid_mask
+{
+ unsigned long mask[PHYSID_ARRAY_SIZE];
+};
+
+typedef struct physid_mask physid_mask_t;
+
+#define physid_set(physid, map) set_bit(physid, (map).mask)
+#define physid_clear(physid, map) clear_bit(physid, (map).mask)
+#define physid_isset(physid, map) test_bit(physid, (map).mask)
+#define physid_test_and_set(physid, map) test_and_set_bit(physid, (map).mask)
+
+#define physids_and(dst, src1, src2) bitmap_and((dst).mask, (src1).mask, (src2).mask, MAX_APICS)
+#define physids_or(dst, src1, src2) bitmap_or((dst).mask, (src1).mask, (src2).mask, MAX_APICS)
+#define physids_clear(map) bitmap_zero((map).mask, MAX_APICS)
+#define physids_complement(dst, src) bitmap_complement((dst).mask,(src).mask, MAX_APICS)
+#define physids_empty(map) bitmap_empty((map).mask, MAX_APICS)
+#define physids_equal(map1, map2) bitmap_equal((map1).mask, (map2).mask, MAX_APICS)
+#define physids_weight(map) bitmap_weight((map).mask, MAX_APICS)
+#define physids_shift_right(d, s, n) bitmap_shift_right((d).mask, (s).mask, n, MAX_APICS)
+#define physids_shift_left(d, s, n) bitmap_shift_left((d).mask, (s).mask, n, MAX_APICS)
+#define physids_coerce(map) ((map).mask[0])
+
+#define physids_promote(physids)   ({   physid_mask_t __physid_mask = PHYSID_MASK_NONE;   __physid_mask.mask[0] = physids;   __physid_mask;   })
+
+#define physid_mask_of_physid(physid)   ({   physid_mask_t __physid_mask = PHYSID_MASK_NONE;   physid_set(physid, __physid_mask);   __physid_mask;   })
+
+#define PHYSID_MASK_ALL { {[0 ... PHYSID_ARRAY_SIZE-1] = ~0UL} }
+#define PHYSID_MASK_NONE { {[0 ... PHYSID_ARRAY_SIZE-1] = 0UL} }
+
+#endif
+
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/mpspec_def.h b/ndk/platforms/android-5/arch-x86/include/asm/mpspec_def.h
new file mode 100644
index 0000000..1f15363
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/mpspec_def.h
@@ -0,0 +1,171 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASM_MPSPEC_DEF_H
+#define __ASM_MPSPEC_DEF_H
+
+#define SMP_MAGIC_IDENT (('_'<<24)|('P'<<16)|('M'<<8)|'_')
+
+#define MAX_MPC_ENTRY 1024
+#define MAX_APICS 256
+
+struct intel_mp_floating
+{
+ char mpf_signature[4];
+ unsigned long mpf_physptr;
+ unsigned char mpf_length;
+ unsigned char mpf_specification;
+ unsigned char mpf_checksum;
+ unsigned char mpf_feature1;
+ unsigned char mpf_feature2;
+ unsigned char mpf_feature3;
+ unsigned char mpf_feature4;
+ unsigned char mpf_feature5;
+};
+
+struct mp_config_table
+{
+ char mpc_signature[4];
+#define MPC_SIGNATURE "PCMP"
+ unsigned short mpc_length;
+ char mpc_spec;
+ char mpc_checksum;
+ char mpc_oem[8];
+ char mpc_productid[12];
+ unsigned long mpc_oemptr;
+ unsigned short mpc_oemsize;
+ unsigned short mpc_oemcount;
+ unsigned long mpc_lapic;
+ unsigned long reserved;
+};
+
+#define MP_PROCESSOR 0
+#define MP_BUS 1
+#define MP_IOAPIC 2
+#define MP_INTSRC 3
+#define MP_LINTSRC 4
+#define MP_TRANSLATION 192  
+
+struct mpc_config_processor
+{
+ unsigned char mpc_type;
+ unsigned char mpc_apicid;
+ unsigned char mpc_apicver;
+ unsigned char mpc_cpuflag;
+#define CPU_ENABLED 1  
+#define CPU_BOOTPROCESSOR 2  
+ unsigned long mpc_cpufeature;
+#define CPU_STEPPING_MASK 0x0F
+#define CPU_MODEL_MASK 0xF0
+#define CPU_FAMILY_MASK 0xF00
+ unsigned long mpc_featureflag;
+ unsigned long mpc_reserved[2];
+};
+
+struct mpc_config_bus
+{
+ unsigned char mpc_type;
+ unsigned char mpc_busid;
+ unsigned char mpc_bustype[6];
+};
+
+#define BUSTYPE_EISA "EISA"
+#define BUSTYPE_ISA "ISA"
+#define BUSTYPE_INTERN "INTERN"  
+#define BUSTYPE_MCA "MCA"
+#define BUSTYPE_VL "VL"  
+#define BUSTYPE_PCI "PCI"
+#define BUSTYPE_PCMCIA "PCMCIA"
+#define BUSTYPE_CBUS "CBUS"
+#define BUSTYPE_CBUSII "CBUSII"
+#define BUSTYPE_FUTURE "FUTURE"
+#define BUSTYPE_MBI "MBI"
+#define BUSTYPE_MBII "MBII"
+#define BUSTYPE_MPI "MPI"
+#define BUSTYPE_MPSA "MPSA"
+#define BUSTYPE_NUBUS "NUBUS"
+#define BUSTYPE_TC "TC"
+#define BUSTYPE_VME "VME"
+#define BUSTYPE_XPRESS "XPRESS"
+
+struct mpc_config_ioapic
+{
+ unsigned char mpc_type;
+ unsigned char mpc_apicid;
+ unsigned char mpc_apicver;
+ unsigned char mpc_flags;
+#define MPC_APIC_USABLE 0x01
+ unsigned long mpc_apicaddr;
+};
+
+struct mpc_config_intsrc
+{
+ unsigned char mpc_type;
+ unsigned char mpc_irqtype;
+ unsigned short mpc_irqflag;
+ unsigned char mpc_srcbus;
+ unsigned char mpc_srcbusirq;
+ unsigned char mpc_dstapic;
+ unsigned char mpc_dstirq;
+};
+
+enum mp_irq_source_types {
+ mp_INT = 0,
+ mp_NMI = 1,
+ mp_SMI = 2,
+ mp_ExtINT = 3
+};
+
+#define MP_IRQDIR_DEFAULT 0
+#define MP_IRQDIR_HIGH 1
+#define MP_IRQDIR_LOW 3
+
+struct mpc_config_lintsrc
+{
+ unsigned char mpc_type;
+ unsigned char mpc_irqtype;
+ unsigned short mpc_irqflag;
+ unsigned char mpc_srcbusid;
+ unsigned char mpc_srcbusirq;
+ unsigned char mpc_destapic;
+#define MP_APIC_ALL 0xFF
+ unsigned char mpc_destapiclint;
+};
+
+struct mp_config_oemtable
+{
+ char oem_signature[4];
+#define MPC_OEM_SIGNATURE "_OEM"
+ unsigned short oem_length;
+ char oem_rev;
+ char oem_checksum;
+ char mpc_oem[8];
+};
+
+struct mpc_config_translation
+{
+ unsigned char mpc_type;
+ unsigned char trans_len;
+ unsigned char trans_type;
+ unsigned char trans_quad;
+ unsigned char trans_global;
+ unsigned char trans_local;
+ unsigned short trans_reserved;
+};
+
+enum mp_bustype {
+ MP_BUS_ISA = 1,
+ MP_BUS_EISA,
+ MP_BUS_PCI,
+ MP_BUS_MCA,
+};
+#endif
+
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/msgbuf.h b/ndk/platforms/android-5/arch-x86/include/asm/msgbuf.h
new file mode 100644
index 0000000..8843e78
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/msgbuf.h
@@ -0,0 +1,38 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_X86_MSGBUF_H
+#define _ASM_X86_MSGBUF_H
+
+struct msqid64_ds {
+ struct ipc64_perm msg_perm;
+ __kernel_time_t msg_stime;
+#ifdef __i386__
+ unsigned long __unused1;
+#endif
+ __kernel_time_t msg_rtime;
+#ifdef __i386__
+ unsigned long __unused2;
+#endif
+ __kernel_time_t msg_ctime;
+#ifdef __i386__
+ unsigned long __unused3;
+#endif
+ unsigned long msg_cbytes;
+ unsigned long msg_qnum;
+ unsigned long msg_qbytes;
+ __kernel_pid_t msg_lspid;
+ __kernel_pid_t msg_lrpid;
+ unsigned long __unused4;
+ unsigned long __unused5;
+};
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/msr-index.h b/ndk/platforms/android-5/arch-x86/include/asm/msr-index.h
new file mode 100644
index 0000000..8ea204e
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/msr-index.h
@@ -0,0 +1,283 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASM_MSR_INDEX_H
+#define __ASM_MSR_INDEX_H
+
+#define MSR_EFER 0xc0000080  
+#define MSR_STAR 0xc0000081  
+#define MSR_LSTAR 0xc0000082  
+#define MSR_CSTAR 0xc0000083  
+#define MSR_SYSCALL_MASK 0xc0000084  
+#define MSR_FS_BASE 0xc0000100  
+#define MSR_GS_BASE 0xc0000101  
+#define MSR_KERNEL_GS_BASE 0xc0000102  
+
+#define _EFER_SCE 0  
+#define _EFER_LME 8  
+#define _EFER_LMA 10  
+#define _EFER_NX 11  
+
+#define EFER_SCE (1<<_EFER_SCE)
+#define EFER_LME (1<<_EFER_LME)
+#define EFER_LMA (1<<_EFER_LMA)
+#define EFER_NX (1<<_EFER_NX)
+
+#define MSR_IA32_PERFCTR0 0x000000c1
+#define MSR_IA32_PERFCTR1 0x000000c2
+#define MSR_FSB_FREQ 0x000000cd
+
+#define MSR_MTRRcap 0x000000fe
+#define MSR_IA32_BBL_CR_CTL 0x00000119
+
+#define MSR_IA32_SYSENTER_CS 0x00000174
+#define MSR_IA32_SYSENTER_ESP 0x00000175
+#define MSR_IA32_SYSENTER_EIP 0x00000176
+
+#define MSR_IA32_MCG_CAP 0x00000179
+#define MSR_IA32_MCG_STATUS 0x0000017a
+#define MSR_IA32_MCG_CTL 0x0000017b
+
+#define MSR_IA32_PEBS_ENABLE 0x000003f1
+#define MSR_IA32_DS_AREA 0x00000600
+#define MSR_IA32_PERF_CAPABILITIES 0x00000345
+
+#define MSR_MTRRfix64K_00000 0x00000250
+#define MSR_MTRRfix16K_80000 0x00000258
+#define MSR_MTRRfix16K_A0000 0x00000259
+#define MSR_MTRRfix4K_C0000 0x00000268
+#define MSR_MTRRfix4K_C8000 0x00000269
+#define MSR_MTRRfix4K_D0000 0x0000026a
+#define MSR_MTRRfix4K_D8000 0x0000026b
+#define MSR_MTRRfix4K_E0000 0x0000026c
+#define MSR_MTRRfix4K_E8000 0x0000026d
+#define MSR_MTRRfix4K_F0000 0x0000026e
+#define MSR_MTRRfix4K_F8000 0x0000026f
+#define MSR_MTRRdefType 0x000002ff
+
+#define MSR_IA32_DEBUGCTLMSR 0x000001d9
+#define MSR_IA32_LASTBRANCHFROMIP 0x000001db
+#define MSR_IA32_LASTBRANCHTOIP 0x000001dc
+#define MSR_IA32_LASTINTFROMIP 0x000001dd
+#define MSR_IA32_LASTINTTOIP 0x000001de
+
+#define MSR_IA32_MC0_CTL 0x00000400
+#define MSR_IA32_MC0_STATUS 0x00000401
+#define MSR_IA32_MC0_ADDR 0x00000402
+#define MSR_IA32_MC0_MISC 0x00000403
+
+#define MSR_P6_PERFCTR0 0x000000c1
+#define MSR_P6_PERFCTR1 0x000000c2
+#define MSR_P6_EVNTSEL0 0x00000186
+#define MSR_P6_EVNTSEL1 0x00000187
+
+#define MSR_AMD64_IBSFETCHCTL 0xc0011030
+#define MSR_AMD64_IBSFETCHLINAD 0xc0011031
+#define MSR_AMD64_IBSFETCHPHYSAD 0xc0011032
+#define MSR_AMD64_IBSOPCTL 0xc0011033
+#define MSR_AMD64_IBSOPRIP 0xc0011034
+#define MSR_AMD64_IBSOPDATA 0xc0011035
+#define MSR_AMD64_IBSOPDATA2 0xc0011036
+#define MSR_AMD64_IBSOPDATA3 0xc0011037
+#define MSR_AMD64_IBSDCLINAD 0xc0011038
+#define MSR_AMD64_IBSDCPHYSAD 0xc0011039
+#define MSR_AMD64_IBSCTL 0xc001103a
+
+#define MSR_K8_TOP_MEM1 0xc001001a
+#define MSR_K8_TOP_MEM2 0xc001001d
+#define MSR_K8_SYSCFG 0xc0010010
+#define MSR_K8_HWCR 0xc0010015
+#define MSR_K8_ENABLE_C1E 0xc0010055
+#define K8_MTRRFIXRANGE_DRAM_ENABLE 0x00040000  
+#define K8_MTRRFIXRANGE_DRAM_MODIFY 0x00080000  
+#define K8_MTRR_RDMEM_WRMEM_MASK 0x18181818  
+
+#define MSR_K7_EVNTSEL0 0xc0010000
+#define MSR_K7_PERFCTR0 0xc0010004
+#define MSR_K7_EVNTSEL1 0xc0010001
+#define MSR_K7_PERFCTR1 0xc0010005
+#define MSR_K7_EVNTSEL2 0xc0010002
+#define MSR_K7_PERFCTR2 0xc0010006
+#define MSR_K7_EVNTSEL3 0xc0010003
+#define MSR_K7_PERFCTR3 0xc0010007
+#define MSR_K7_CLK_CTL 0xc001001b
+#define MSR_K7_HWCR 0xc0010015
+#define MSR_K7_FID_VID_CTL 0xc0010041
+#define MSR_K7_FID_VID_STATUS 0xc0010042
+
+#define MSR_K6_EFER 0xc0000080
+#define MSR_K6_STAR 0xc0000081
+#define MSR_K6_WHCR 0xc0000082
+#define MSR_K6_UWCCR 0xc0000085
+#define MSR_K6_EPMR 0xc0000086
+#define MSR_K6_PSOR 0xc0000087
+#define MSR_K6_PFIR 0xc0000088
+
+#define MSR_IDT_FCR1 0x00000107
+#define MSR_IDT_FCR2 0x00000108
+#define MSR_IDT_FCR3 0x00000109
+#define MSR_IDT_FCR4 0x0000010a
+
+#define MSR_IDT_MCR0 0x00000110
+#define MSR_IDT_MCR1 0x00000111
+#define MSR_IDT_MCR2 0x00000112
+#define MSR_IDT_MCR3 0x00000113
+#define MSR_IDT_MCR4 0x00000114
+#define MSR_IDT_MCR5 0x00000115
+#define MSR_IDT_MCR6 0x00000116
+#define MSR_IDT_MCR7 0x00000117
+#define MSR_IDT_MCR_CTRL 0x00000120
+
+#define MSR_VIA_FCR 0x00001107
+#define MSR_VIA_LONGHAUL 0x0000110a
+#define MSR_VIA_RNG 0x0000110b
+#define MSR_VIA_BCR2 0x00001147
+
+#define MSR_TMTA_LONGRUN_CTRL 0x80868010
+#define MSR_TMTA_LONGRUN_FLAGS 0x80868011
+#define MSR_TMTA_LRTI_READOUT 0x80868018
+#define MSR_TMTA_LRTI_VOLT_MHZ 0x8086801a
+
+#define MSR_IA32_P5_MC_ADDR 0x00000000
+#define MSR_IA32_P5_MC_TYPE 0x00000001
+#define MSR_IA32_TSC 0x00000010
+#define MSR_IA32_PLATFORM_ID 0x00000017
+#define MSR_IA32_EBL_CR_POWERON 0x0000002a
+
+#define MSR_IA32_APICBASE 0x0000001b
+#define MSR_IA32_APICBASE_BSP (1<<8)
+#define MSR_IA32_APICBASE_ENABLE (1<<11)
+#define MSR_IA32_APICBASE_BASE (0xfffff<<12)
+
+#define MSR_IA32_UCODE_WRITE 0x00000079
+#define MSR_IA32_UCODE_REV 0x0000008b
+
+#define MSR_IA32_PERF_STATUS 0x00000198
+#define MSR_IA32_PERF_CTL 0x00000199
+
+#define MSR_IA32_MPERF 0x000000e7
+#define MSR_IA32_APERF 0x000000e8
+
+#define MSR_IA32_THERM_CONTROL 0x0000019a
+#define MSR_IA32_THERM_INTERRUPT 0x0000019b
+#define MSR_IA32_THERM_STATUS 0x0000019c
+#define MSR_IA32_MISC_ENABLE 0x000001a0
+
+#define MSR_P6_EVNTSEL0 0x00000186
+#define MSR_P6_EVNTSEL1 0x00000187
+
+#define MSR_IA32_MCG_EAX 0x00000180
+#define MSR_IA32_MCG_EBX 0x00000181
+#define MSR_IA32_MCG_ECX 0x00000182
+#define MSR_IA32_MCG_EDX 0x00000183
+#define MSR_IA32_MCG_ESI 0x00000184
+#define MSR_IA32_MCG_EDI 0x00000185
+#define MSR_IA32_MCG_EBP 0x00000186
+#define MSR_IA32_MCG_ESP 0x00000187
+#define MSR_IA32_MCG_EFLAGS 0x00000188
+#define MSR_IA32_MCG_EIP 0x00000189
+#define MSR_IA32_MCG_RESERVED 0x0000018a
+
+#define MSR_P4_BPU_PERFCTR0 0x00000300
+#define MSR_P4_BPU_PERFCTR1 0x00000301
+#define MSR_P4_BPU_PERFCTR2 0x00000302
+#define MSR_P4_BPU_PERFCTR3 0x00000303
+#define MSR_P4_MS_PERFCTR0 0x00000304
+#define MSR_P4_MS_PERFCTR1 0x00000305
+#define MSR_P4_MS_PERFCTR2 0x00000306
+#define MSR_P4_MS_PERFCTR3 0x00000307
+#define MSR_P4_FLAME_PERFCTR0 0x00000308
+#define MSR_P4_FLAME_PERFCTR1 0x00000309
+#define MSR_P4_FLAME_PERFCTR2 0x0000030a
+#define MSR_P4_FLAME_PERFCTR3 0x0000030b
+#define MSR_P4_IQ_PERFCTR0 0x0000030c
+#define MSR_P4_IQ_PERFCTR1 0x0000030d
+#define MSR_P4_IQ_PERFCTR2 0x0000030e
+#define MSR_P4_IQ_PERFCTR3 0x0000030f
+#define MSR_P4_IQ_PERFCTR4 0x00000310
+#define MSR_P4_IQ_PERFCTR5 0x00000311
+#define MSR_P4_BPU_CCCR0 0x00000360
+#define MSR_P4_BPU_CCCR1 0x00000361
+#define MSR_P4_BPU_CCCR2 0x00000362
+#define MSR_P4_BPU_CCCR3 0x00000363
+#define MSR_P4_MS_CCCR0 0x00000364
+#define MSR_P4_MS_CCCR1 0x00000365
+#define MSR_P4_MS_CCCR2 0x00000366
+#define MSR_P4_MS_CCCR3 0x00000367
+#define MSR_P4_FLAME_CCCR0 0x00000368
+#define MSR_P4_FLAME_CCCR1 0x00000369
+#define MSR_P4_FLAME_CCCR2 0x0000036a
+#define MSR_P4_FLAME_CCCR3 0x0000036b
+#define MSR_P4_IQ_CCCR0 0x0000036c
+#define MSR_P4_IQ_CCCR1 0x0000036d
+#define MSR_P4_IQ_CCCR2 0x0000036e
+#define MSR_P4_IQ_CCCR3 0x0000036f
+#define MSR_P4_IQ_CCCR4 0x00000370
+#define MSR_P4_IQ_CCCR5 0x00000371
+#define MSR_P4_ALF_ESCR0 0x000003ca
+#define MSR_P4_ALF_ESCR1 0x000003cb
+#define MSR_P4_BPU_ESCR0 0x000003b2
+#define MSR_P4_BPU_ESCR1 0x000003b3
+#define MSR_P4_BSU_ESCR0 0x000003a0
+#define MSR_P4_BSU_ESCR1 0x000003a1
+#define MSR_P4_CRU_ESCR0 0x000003b8
+#define MSR_P4_CRU_ESCR1 0x000003b9
+#define MSR_P4_CRU_ESCR2 0x000003cc
+#define MSR_P4_CRU_ESCR3 0x000003cd
+#define MSR_P4_CRU_ESCR4 0x000003e0
+#define MSR_P4_CRU_ESCR5 0x000003e1
+#define MSR_P4_DAC_ESCR0 0x000003a8
+#define MSR_P4_DAC_ESCR1 0x000003a9
+#define MSR_P4_FIRM_ESCR0 0x000003a4
+#define MSR_P4_FIRM_ESCR1 0x000003a5
+#define MSR_P4_FLAME_ESCR0 0x000003a6
+#define MSR_P4_FLAME_ESCR1 0x000003a7
+#define MSR_P4_FSB_ESCR0 0x000003a2
+#define MSR_P4_FSB_ESCR1 0x000003a3
+#define MSR_P4_IQ_ESCR0 0x000003ba
+#define MSR_P4_IQ_ESCR1 0x000003bb
+#define MSR_P4_IS_ESCR0 0x000003b4
+#define MSR_P4_IS_ESCR1 0x000003b5
+#define MSR_P4_ITLB_ESCR0 0x000003b6
+#define MSR_P4_ITLB_ESCR1 0x000003b7
+#define MSR_P4_IX_ESCR0 0x000003c8
+#define MSR_P4_IX_ESCR1 0x000003c9
+#define MSR_P4_MOB_ESCR0 0x000003aa
+#define MSR_P4_MOB_ESCR1 0x000003ab
+#define MSR_P4_MS_ESCR0 0x000003c0
+#define MSR_P4_MS_ESCR1 0x000003c1
+#define MSR_P4_PMH_ESCR0 0x000003ac
+#define MSR_P4_PMH_ESCR1 0x000003ad
+#define MSR_P4_RAT_ESCR0 0x000003bc
+#define MSR_P4_RAT_ESCR1 0x000003bd
+#define MSR_P4_SAAT_ESCR0 0x000003ae
+#define MSR_P4_SAAT_ESCR1 0x000003af
+#define MSR_P4_SSU_ESCR0 0x000003be
+#define MSR_P4_SSU_ESCR1 0x000003bf  
+
+#define MSR_P4_TBPU_ESCR0 0x000003c2
+#define MSR_P4_TBPU_ESCR1 0x000003c3
+#define MSR_P4_TC_ESCR0 0x000003c4
+#define MSR_P4_TC_ESCR1 0x000003c5
+#define MSR_P4_U2L_ESCR0 0x000003b0
+#define MSR_P4_U2L_ESCR1 0x000003b1
+
+#define MSR_CORE_PERF_FIXED_CTR0 0x00000309
+#define MSR_CORE_PERF_FIXED_CTR1 0x0000030a
+#define MSR_CORE_PERF_FIXED_CTR2 0x0000030b
+#define MSR_CORE_PERF_FIXED_CTR_CTRL 0x0000038d
+#define MSR_CORE_PERF_GLOBAL_STATUS 0x0000038e
+#define MSR_CORE_PERF_GLOBAL_CTRL 0x0000038f
+#define MSR_CORE_PERF_GLOBAL_OVF_CTRL 0x00000390
+
+#define MSR_GEODE_BUSCONT_CONF0 0x00001900
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/msr.h b/ndk/platforms/android-5/arch-x86/include/asm/msr.h
new file mode 100644
index 0000000..f1da917
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/msr.h
@@ -0,0 +1,54 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASM_X86_MSR_H_
+#define __ASM_X86_MSR_H_
+
+#include <asm/msr-index.h>
+
+#ifndef __ASSEMBLY__
+#include <linux/types.h>
+#endif
+
+#ifdef __i386__
+
+#else
+
+#ifndef __ASSEMBLY__
+#include <linux/errno.h>
+
+#define rdmsr(msr,val1,val2)   __asm__ __volatile__("rdmsr"   : "=a" (val1), "=d" (val2)   : "c" (msr))
+
+#define rdmsrl(msr,val) do { unsigned long a__,b__;   __asm__ __volatile__("rdmsr"   : "=a" (a__), "=d" (b__)   : "c" (msr));   val = a__ | (b__<<32);  } while(0)
+
+#define wrmsr(msr,val1,val2)   __asm__ __volatile__("wrmsr"   :     : "c" (msr), "a" (val1), "d" (val2))
+
+#define wrmsrl(msr,val) wrmsr(msr,(__u32)((__u64)(val)),((__u64)(val))>>32)
+
+#define rdtsc(low,high)   __asm__ __volatile__("rdtsc" : "=a" (low), "=d" (high))
+
+#define rdtscl(low)   __asm__ __volatile__ ("rdtsc" : "=a" (low) : : "edx")
+
+#define rdtscp(low,high,aux)   __asm__ __volatile__ (".byte 0x0f,0x01,0xf9" : "=a" (low), "=d" (high), "=c" (aux))
+
+#define rdtscll(val) do {   unsigned int __a,__d;   __asm__ __volatile__("rdtsc" : "=a" (__a), "=d" (__d));   (val) = ((unsigned long)__a) | (((unsigned long)__d)<<32);  } while(0)
+
+#define rdtscpll(val, aux) do {   unsigned long __a, __d;   __asm__ __volatile__ (".byte 0x0f,0x01,0xf9" : "=a" (__a), "=d" (__d), "=c" (aux));   (val) = (__d << 32) | __a;  } while (0)
+
+#define write_tsc(val1,val2) wrmsr(0x10, val1, val2)
+
+#define write_rdtscp_aux(val) wrmsr(0xc0000103, val, 0)
+
+#define rdpmc(counter,low,high)   __asm__ __volatile__("rdpmc"   : "=a" (low), "=d" (high)   : "c" (counter))
+
+#endif
+#endif
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/page.h b/ndk/platforms/android-5/arch-x86/include/asm/page.h
new file mode 100644
index 0000000..e6dcf27
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/page.h
@@ -0,0 +1,16 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifdef __i386__
+#include "page_32.h"
+#else
+#include "page_64.h"
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/page_32.h b/ndk/platforms/android-5/arch-x86/include/asm/page_32.h
new file mode 100644
index 0000000..718cf95
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/page_32.h
@@ -0,0 +1,22 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _I386_PAGE_H
+#define _I386_PAGE_H
+
+#define PAGE_SHIFT 12
+#define PAGE_SIZE (1UL << PAGE_SHIFT)
+#define PAGE_MASK (~(PAGE_SIZE-1))
+
+#define LARGE_PAGE_MASK (~(LARGE_PAGE_SIZE-1))
+#define LARGE_PAGE_SIZE (1UL << PMD_SHIFT)
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/param.h b/ndk/platforms/android-5/arch-x86/include/asm/param.h
new file mode 100644
index 0000000..3fafd55
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/param.h
@@ -0,0 +1,26 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_X86_PARAM_H
+#define _ASM_X86_PARAM_H
+
+#ifndef HZ
+#define HZ 100
+#endif
+
+#define EXEC_PAGESIZE 4096
+
+#ifndef NOGROUP
+#define NOGROUP (-1)
+#endif
+
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/paravirt.h b/ndk/platforms/android-5/arch-x86/include/asm/paravirt.h
new file mode 100644
index 0000000..ab0d08e
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/paravirt.h
@@ -0,0 +1,15 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASM_PARAVIRT_H
+#define __ASM_PARAVIRT_H
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/pda.h b/ndk/platforms/android-5/arch-x86/include/asm/pda.h
new file mode 100644
index 0000000..6711224
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/pda.h
@@ -0,0 +1,65 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef X86_64_PDA_H
+#define X86_64_PDA_H
+
+#ifndef __ASSEMBLY__
+#include <linux/stddef.h>
+#include <linux/types.h>
+#include <linux/cache.h>
+#include <asm/page.h>
+
+struct x8664_pda {
+ struct task_struct *pcurrent;
+ unsigned long data_offset;
+ unsigned long kernelstack;
+ unsigned long oldrsp;
+ int irqcount;
+ int cpunumber;
+ char *irqstackptr;
+ int nodenumber;
+ unsigned int __softirq_pending;
+ unsigned int __nmi_count;
+ short mmu_state;
+ short isidle;
+ struct mm_struct *active_mm;
+ unsigned apic_timer_irqs;
+ unsigned irq0_irqs;
+ unsigned irq_resched_count;
+ unsigned irq_call_count;
+ unsigned irq_tlb_count;
+ unsigned irq_thermal_count;
+ unsigned irq_threshold_count;
+ unsigned irq_spurious_count;
+} ____cacheline_aligned_in_smp;
+
+#define cpu_pda(i) (_cpu_pda[i])
+
+#define pda_offset(field) offsetof(struct x8664_pda, field)
+
+#define pda_to_op(op,field,val) do {   typedef typeof(_proxy_pda.field) T__;   if (0) { T__ tmp__; tmp__ = (val); }     switch (sizeof(_proxy_pda.field)) {   case 2:   asm(op "w %1,%%gs:%c2" :   "+m" (_proxy_pda.field) :   "ri" ((T__)val),   "i"(pda_offset(field)));   break;   case 4:   asm(op "l %1,%%gs:%c2" :   "+m" (_proxy_pda.field) :   "ri" ((T__)val),   "i" (pda_offset(field)));   break;   case 8:   asm(op "q %1,%%gs:%c2":   "+m" (_proxy_pda.field) :   "ri" ((T__)val),   "i"(pda_offset(field)));   break;   default:   __bad_pda_field();   }   } while (0)
+
+#define pda_from_op(op,field) ({   typeof(_proxy_pda.field) ret__;   switch (sizeof(_proxy_pda.field)) {   case 2:   asm(op "w %%gs:%c1,%0" :   "=r" (ret__) :   "i" (pda_offset(field)),   "m" (_proxy_pda.field));   break;   case 4:   asm(op "l %%gs:%c1,%0":   "=r" (ret__):   "i" (pda_offset(field)),   "m" (_proxy_pda.field));   break;   case 8:   asm(op "q %%gs:%c1,%0":   "=r" (ret__) :   "i" (pda_offset(field)),   "m" (_proxy_pda.field));   break;   default:   __bad_pda_field();   }   ret__; })
+
+#define read_pda(field) pda_from_op("mov",field)
+#define write_pda(field,val) pda_to_op("mov",field,val)
+#define add_pda(field,val) pda_to_op("add",field,val)
+#define sub_pda(field,val) pda_to_op("sub",field,val)
+#define or_pda(field,val) pda_to_op("or",field,val)
+
+#define test_and_clear_bit_pda(bit,field) ({   int old__;   asm volatile("btr %2,%%gs:%c3\n\tsbbl %0,%0"   : "=r" (old__), "+m" (_proxy_pda.field)   : "dIr" (bit), "i" (pda_offset(field)) : "memory");   old__;  })
+
+#endif
+
+#define PDA_STACKOFFSET (5*8)
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/percpu.h b/ndk/platforms/android-5/arch-x86/include/asm/percpu.h
new file mode 100644
index 0000000..7740e67
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/percpu.h
@@ -0,0 +1,12 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#include "percpu_64.h"
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/percpu_32.h b/ndk/platforms/android-5/arch-x86/include/asm/percpu_32.h
new file mode 100644
index 0000000..21135d6
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/percpu_32.h
@@ -0,0 +1,36 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ARCH_I386_PERCPU__
+#define __ARCH_I386_PERCPU__
+
+#ifdef __ASSEMBLY__
+
+#define PER_CPU(var, reg)   movl $per_cpu__##var, reg
+#define PER_CPU_VAR(var) per_cpu__##var
+
+#else
+
+#include <asm-generic/percpu.h>
+#define __percpu_seg ""
+
+#define percpu_to_op(op,var,val)   do {   typedef typeof(var) T__;   if (0) { T__ tmp__; tmp__ = (val); }   switch (sizeof(var)) {   case 1:   asm(op "b %1,"__percpu_seg"%0"   : "+m" (var)   :"ri" ((T__)val));   break;   case 2:   asm(op "w %1,"__percpu_seg"%0"   : "+m" (var)   :"ri" ((T__)val));   break;   case 4:   asm(op "l %1,"__percpu_seg"%0"   : "+m" (var)   :"ri" ((T__)val));   break;   default: __bad_percpu_size();   }   } while (0)
+
+#define percpu_from_op(op,var)   ({   typeof(var) ret__;   switch (sizeof(var)) {   case 1:   asm(op "b "__percpu_seg"%1,%0"   : "=r" (ret__)   : "m" (var));   break;   case 2:   asm(op "w "__percpu_seg"%1,%0"   : "=r" (ret__)   : "m" (var));   break;   case 4:   asm(op "l "__percpu_seg"%1,%0"   : "=r" (ret__)   : "m" (var));   break;   default: __bad_percpu_size();   }   ret__; })
+
+#define x86_read_percpu(var) percpu_from_op("mov", per_cpu__##var)
+#define x86_write_percpu(var,val) percpu_to_op("mov", per_cpu__##var, val)
+#define x86_add_percpu(var,val) percpu_to_op("add", per_cpu__##var, val)
+#define x86_sub_percpu(var,val) percpu_to_op("sub", per_cpu__##var, val)
+#define x86_or_percpu(var,val) percpu_to_op("or", per_cpu__##var, val)
+#endif
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/pgalloc.h b/ndk/platforms/android-5/arch-x86/include/asm/pgalloc.h
new file mode 100644
index 0000000..d5a032b
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/pgalloc.h
@@ -0,0 +1,12 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#include "pgalloc_64.h"
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/pgalloc_32.h b/ndk/platforms/android-5/arch-x86/include/asm/pgalloc_32.h
new file mode 100644
index 0000000..bc0f884
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/pgalloc_32.h
@@ -0,0 +1,30 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _I386_PGALLOC_H
+#define _I386_PGALLOC_H
+
+#include <linux/threads.h>
+#include <linux/mm.h>  
+
+#define paravirt_alloc_pt(mm, pfn) do { } while (0)
+#define paravirt_alloc_pd(pfn) do { } while (0)
+#define paravirt_alloc_pd(pfn) do { } while (0)
+#define paravirt_alloc_pd_clone(pfn, clonepfn, start, count) do { } while (0)
+#define paravirt_release_pt(pfn) do { } while (0)
+#define paravirt_release_pd(pfn) do { } while (0)
+
+#define pmd_populate_kernel(mm, pmd, pte)  do {   paravirt_alloc_pt(mm, __pa(pte) >> PAGE_SHIFT);   set_pmd(pmd, __pmd(_PAGE_TABLE + __pa(pte)));  } while (0)
+
+#define pmd_populate(mm, pmd, pte)  do {   paravirt_alloc_pt(mm, page_to_pfn(pte));   set_pmd(pmd, __pmd(_PAGE_TABLE +   ((unsigned long long)page_to_pfn(pte) <<   (unsigned long long) PAGE_SHIFT)));  } while (0)
+
+#define __pte_free_tlb(tlb,pte)  do {   paravirt_release_pt(page_to_pfn(pte));   tlb_remove_page((tlb),(pte));  } while (0)
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/pgtable-2level-defs.h b/ndk/platforms/android-5/arch-x86/include/asm/pgtable-2level-defs.h
new file mode 100644
index 0000000..9edc6c5
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/pgtable-2level-defs.h
@@ -0,0 +1,22 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _I386_PGTABLE_2LEVEL_DEFS_H
+#define _I386_PGTABLE_2LEVEL_DEFS_H
+
+#define SHARED_KERNEL_PMD 0
+
+#define PGDIR_SHIFT 22
+#define PTRS_PER_PGD 1024
+
+#define PTRS_PER_PTE 1024
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/pgtable-2level.h b/ndk/platforms/android-5/arch-x86/include/asm/pgtable-2level.h
new file mode 100644
index 0000000..7ade4ed
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/pgtable-2level.h
@@ -0,0 +1,39 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _I386_PGTABLE_2LEVEL_H
+#define _I386_PGTABLE_2LEVEL_H
+
+#define pte_ERROR(e)   printk("%s:%d: bad pte %08lx.\n", __FILE__, __LINE__, (e).pte_low)
+#define pgd_ERROR(e)   printk("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, pgd_val(e))
+
+#define set_pte(pteptr, pteval) native_set_pte(pteptr, pteval)
+#define set_pte_at(mm,addr,ptep,pteval) native_set_pte_at(mm, addr, ptep, pteval)
+#define set_pmd(pmdptr, pmdval) native_set_pmd(pmdptr, pmdval)
+#define set_pte_atomic(pteptr, pteval) set_pte(pteptr,pteval)
+#define set_pte_present(mm,addr,ptep,pteval) set_pte_at(mm,addr,ptep,pteval)
+#define pte_clear(mm,addr,xp) do { set_pte_at(mm, addr, xp, __pte(0)); } while (0)
+#define pmd_clear(xp) do { set_pmd(xp, __pmd(0)); } while (0)
+#define native_ptep_get_and_clear(xp) native_local_ptep_get_and_clear(xp)
+#define pte_page(x) pfn_to_page(pte_pfn(x))
+#define pte_none(x) (!(x).pte_low)
+#define pte_pfn(x) (pte_val(x) >> PAGE_SHIFT)
+#define pfn_pte(pfn, prot) __pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot))
+#define pfn_pmd(pfn, prot) __pmd(((pfn) << PAGE_SHIFT) | pgprot_val(prot))
+#define PTE_FILE_MAX_BITS 29
+#define pte_to_pgoff(pte)   ((((pte).pte_low >> 1) & 0x1f ) + (((pte).pte_low >> 8) << 5 ))
+#define pgoff_to_pte(off)   ((pte_t) { (((off) & 0x1f) << 1) + (((off) >> 5) << 8) + _PAGE_FILE })
+#define __swp_type(x) (((x).val >> 1) & 0x1f)
+#define __swp_offset(x) ((x).val >> 8)
+#define __swp_entry(type, offset) ((swp_entry_t) { ((type) << 1) | ((offset) << 8) })
+#define __pte_to_swp_entry(pte) ((swp_entry_t) { (pte).pte_low })
+#define __swp_entry_to_pte(x) ((pte_t) { (x).val })
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/pgtable.h b/ndk/platforms/android-5/arch-x86/include/asm/pgtable.h
new file mode 100644
index 0000000..797e473
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/pgtable.h
@@ -0,0 +1,12 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#include "pgtable_64.h"
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/pgtable_32.h b/ndk/platforms/android-5/arch-x86/include/asm/pgtable_32.h
new file mode 100644
index 0000000..c63ba93
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/pgtable_32.h
@@ -0,0 +1,175 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _I386_PGTABLE_H
+#define _I386_PGTABLE_H
+
+#ifndef __ASSEMBLY__
+#include <asm/processor.h>
+#include <asm/fixmap.h>
+#include <linux/threads.h>
+#include <asm/paravirt.h>
+
+#include <linux/bitops.h>
+#include <linux/slab.h>
+#include <linux/list.h>
+#include <linux/spinlock.h>
+
+struct mm_struct;
+struct vm_area_struct;
+
+#define ZERO_PAGE(vaddr) (virt_to_page(empty_zero_page))
+
+#include <asm/pgtable-2level-defs.h>
+
+#define PGDIR_SIZE (1UL << PGDIR_SHIFT)
+#define PGDIR_MASK (~(PGDIR_SIZE-1))
+
+#define USER_PTRS_PER_PGD (TASK_SIZE/PGDIR_SIZE)
+#define FIRST_USER_ADDRESS 0
+
+#define USER_PGD_PTRS (PAGE_OFFSET >> PGDIR_SHIFT)
+#define KERNEL_PGD_PTRS (PTRS_PER_PGD-USER_PGD_PTRS)
+
+#define TWOLEVEL_PGDIR_SHIFT 22
+#define BOOT_USER_PGD_PTRS (__PAGE_OFFSET >> TWOLEVEL_PGDIR_SHIFT)
+#define BOOT_KERNEL_PGD_PTRS (1024-BOOT_USER_PGD_PTRS)
+
+#define VMALLOC_OFFSET (8*1024*1024)
+#define VMALLOC_START (((unsigned long) high_memory +   2*VMALLOC_OFFSET-1) & ~(VMALLOC_OFFSET-1))
+#define VMALLOC_END (FIXADDR_START-2*PAGE_SIZE)
+
+#define _PAGE_BIT_PRESENT 0
+#define _PAGE_BIT_RW 1
+#define _PAGE_BIT_USER 2
+#define _PAGE_BIT_PWT 3
+#define _PAGE_BIT_PCD 4
+#define _PAGE_BIT_ACCESSED 5
+#define _PAGE_BIT_DIRTY 6
+#define _PAGE_BIT_PSE 7  
+#define _PAGE_BIT_GLOBAL 8  
+#define _PAGE_BIT_UNUSED1 9  
+#define _PAGE_BIT_UNUSED2 10
+#define _PAGE_BIT_UNUSED3 11
+#define _PAGE_BIT_NX 63
+
+#define _PAGE_PRESENT 0x001
+#define _PAGE_RW 0x002
+#define _PAGE_USER 0x004
+#define _PAGE_PWT 0x008
+#define _PAGE_PCD 0x010
+#define _PAGE_ACCESSED 0x020
+#define _PAGE_DIRTY 0x040
+#define _PAGE_PSE 0x080  
+#define _PAGE_GLOBAL 0x100  
+#define _PAGE_UNUSED1 0x200  
+#define _PAGE_UNUSED2 0x400
+#define _PAGE_UNUSED3 0x800
+
+#define _PAGE_FILE 0x040  
+#define _PAGE_PROTNONE 0x080  
+#define _PAGE_NX 0
+
+#define _PAGE_TABLE (_PAGE_PRESENT | _PAGE_RW | _PAGE_USER | _PAGE_ACCESSED | _PAGE_DIRTY)
+#define _KERNPG_TABLE (_PAGE_PRESENT | _PAGE_RW | _PAGE_ACCESSED | _PAGE_DIRTY)
+#define _PAGE_CHG_MASK (PTE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY)
+
+#define PAGE_NONE   __pgprot(_PAGE_PROTNONE | _PAGE_ACCESSED)
+#define PAGE_SHARED   __pgprot(_PAGE_PRESENT | _PAGE_RW | _PAGE_USER | _PAGE_ACCESSED)
+
+#define PAGE_SHARED_EXEC   __pgprot(_PAGE_PRESENT | _PAGE_RW | _PAGE_USER | _PAGE_ACCESSED)
+#define PAGE_COPY_NOEXEC   __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_ACCESSED | _PAGE_NX)
+#define PAGE_COPY_EXEC   __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_ACCESSED)
+#define PAGE_COPY   PAGE_COPY_NOEXEC
+#define PAGE_READONLY   __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_ACCESSED | _PAGE_NX)
+#define PAGE_READONLY_EXEC   __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_ACCESSED)
+
+#define _PAGE_KERNEL   (_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_NX)
+#define _PAGE_KERNEL_EXEC   (_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | _PAGE_ACCESSED)
+
+#define __PAGE_KERNEL_RO (__PAGE_KERNEL & ~_PAGE_RW)
+#define __PAGE_KERNEL_RX (__PAGE_KERNEL_EXEC & ~_PAGE_RW)
+#define __PAGE_KERNEL_NOCACHE (__PAGE_KERNEL | _PAGE_PCD)
+#define __PAGE_KERNEL_LARGE (__PAGE_KERNEL | _PAGE_PSE)
+#define __PAGE_KERNEL_LARGE_EXEC (__PAGE_KERNEL_EXEC | _PAGE_PSE)
+
+#define PAGE_KERNEL __pgprot(__PAGE_KERNEL)
+#define PAGE_KERNEL_RO __pgprot(__PAGE_KERNEL_RO)
+#define PAGE_KERNEL_EXEC __pgprot(__PAGE_KERNEL_EXEC)
+#define PAGE_KERNEL_RX __pgprot(__PAGE_KERNEL_RX)
+#define PAGE_KERNEL_NOCACHE __pgprot(__PAGE_KERNEL_NOCACHE)
+#define PAGE_KERNEL_LARGE __pgprot(__PAGE_KERNEL_LARGE)
+#define PAGE_KERNEL_LARGE_EXEC __pgprot(__PAGE_KERNEL_LARGE_EXEC)
+
+#define __P000 PAGE_NONE
+#define __P001 PAGE_READONLY
+#define __P010 PAGE_COPY
+#define __P011 PAGE_COPY
+#define __P100 PAGE_READONLY_EXEC
+#define __P101 PAGE_READONLY_EXEC
+#define __P110 PAGE_COPY_EXEC
+#define __P111 PAGE_COPY_EXEC
+
+#define __S000 PAGE_NONE
+#define __S001 PAGE_READONLY
+#define __S010 PAGE_SHARED
+#define __S011 PAGE_SHARED
+#define __S100 PAGE_READONLY_EXEC
+#define __S101 PAGE_READONLY_EXEC
+#define __S110 PAGE_SHARED_EXEC
+#define __S111 PAGE_SHARED_EXEC
+
+#undef TEST_ACCESS_OK
+
+#define pte_present(x) ((x).pte_low & (_PAGE_PRESENT | _PAGE_PROTNONE))
+
+#define pmd_none(x) (!(unsigned long)pmd_val(x))
+#define pmd_present(x) (pmd_val(x) & _PAGE_PRESENT)
+#define pmd_bad(x) ((pmd_val(x) & (~PAGE_MASK & ~_PAGE_USER)) != _KERNPG_TABLE)
+
+#define pages_to_mb(x) ((x) >> (20-PAGE_SHIFT))
+
+#include <asm/pgtable-2level.h>
+#define pte_update(mm, addr, ptep) do { } while (0)
+#define pte_update_defer(mm, addr, ptep) do { } while (0)
+#define __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS
+#define ptep_set_access_flags(vma, address, ptep, entry, dirty)  ({   int __changed = !pte_same(*(ptep), entry);   if (__changed && dirty) {   (ptep)->pte_low = (entry).pte_low;   pte_update_defer((vma)->vm_mm, (address), (ptep));   flush_tlb_page(vma, address);   }   __changed;  })
+#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
+#define ptep_test_and_clear_young(vma, addr, ptep) ({   int __ret = 0;   if (pte_young(*(ptep)))   __ret = test_and_clear_bit(_PAGE_BIT_ACCESSED,   &(ptep)->pte_low);   if (__ret)   pte_update((vma)->vm_mm, addr, ptep);   __ret;  })
+#define __HAVE_ARCH_PTEP_CLEAR_YOUNG_FLUSH
+#define ptep_clear_flush_young(vma, address, ptep)  ({   int __young;   __young = ptep_test_and_clear_young((vma), (address), (ptep));   if (__young)   flush_tlb_page(vma, address);   __young;  })
+#define __HAVE_ARCH_PTEP_GET_AND_CLEAR
+#define __HAVE_ARCH_PTEP_GET_AND_CLEAR_FULL
+#define __HAVE_ARCH_PTEP_SET_WRPROTECT
+#define pgprot_noncached(prot) ((boot_cpu_data.x86 > 3)   ? (__pgprot(pgprot_val(prot) | _PAGE_PCD | _PAGE_PWT)) : (prot))
+#define mk_pte(page, pgprot) pfn_pte(page_to_pfn(page), (pgprot))
+#define pmd_large(pmd)  ((pmd_val(pmd) & (_PAGE_PSE|_PAGE_PRESENT)) == (_PAGE_PSE|_PAGE_PRESENT))
+#define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1))
+#define pgd_index_k(addr) pgd_index(addr)
+#define pgd_offset(mm, address) ((mm)->pgd+pgd_index(address))
+#define pgd_offset_k(address) pgd_offset(&init_mm, address)
+#define pmd_index(address)   (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1))
+#define pte_index(address)   (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
+#define pte_offset_kernel(dir, address)   ((pte_t *) pmd_page_vaddr(*(dir)) + pte_index(address))
+#define pmd_page(pmd) (pfn_to_page(pmd_val(pmd) >> PAGE_SHIFT))
+#define pmd_page_vaddr(pmd)   ((unsigned long) __va(pmd_val(pmd) & PAGE_MASK))
+
+ #define pte_offset_map(dir, address)   ((pte_t *)page_address(pmd_page(*(dir))) + pte_index(address))
+#define pte_offset_map_nested(dir, address) pte_offset_map(dir, address)
+#define pte_unmap(pte) do { } while (0)
+#define pte_unmap_nested(pte) do { } while (0)
+#define kpte_clear_flush(ptep, vaddr)  do {   pte_clear(&init_mm, vaddr, ptep);   __flush_tlb_one(vaddr);  } while (0)
+#define update_mmu_cache(vma,address,pte) do { } while (0)
+
+#endif
+#define io_remap_pfn_range(vma, vaddr, pfn, size, prot)   remap_pfn_range(vma, vaddr, pfn, size, prot)
+#include <asm-generic/pgtable.h>
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/poll.h b/ndk/platforms/android-5/arch-x86/include/asm/poll.h
new file mode 100644
index 0000000..5b16673
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/poll.h
@@ -0,0 +1,12 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#include <asm-generic/poll.h>
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/posix_types.h b/ndk/platforms/android-5/arch-x86/include/asm/posix_types.h
new file mode 100644
index 0000000..79bb490
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/posix_types.h
@@ -0,0 +1,16 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifdef __i386__
+#include "posix_types_32.h"
+#else
+#include "posix_types_64.h"
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/posix_types_32.h b/ndk/platforms/android-5/arch-x86/include/asm/posix_types_32.h
new file mode 100644
index 0000000..97a8b69
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/posix_types_32.h
@@ -0,0 +1,70 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ARCH_I386_POSIX_TYPES_H
+#define __ARCH_I386_POSIX_TYPES_H
+
+typedef unsigned long __kernel_ino_t;
+typedef unsigned short __kernel_mode_t;
+typedef unsigned short __kernel_nlink_t;
+typedef long __kernel_off_t;
+typedef int __kernel_pid_t;
+typedef unsigned short __kernel_ipc_pid_t;
+typedef unsigned short __kernel_uid_t;
+typedef unsigned short __kernel_gid_t;
+typedef unsigned int __kernel_size_t;
+typedef int __kernel_ssize_t;
+typedef int __kernel_ptrdiff_t;
+typedef long __kernel_time_t;
+typedef long __kernel_suseconds_t;
+typedef long __kernel_clock_t;
+typedef int __kernel_timer_t;
+typedef int __kernel_clockid_t;
+typedef int __kernel_daddr_t;
+typedef char * __kernel_caddr_t;
+typedef unsigned short __kernel_uid16_t;
+typedef unsigned short __kernel_gid16_t;
+typedef unsigned int __kernel_uid32_t;
+typedef unsigned int __kernel_gid32_t;
+
+typedef unsigned short __kernel_old_uid_t;
+typedef unsigned short __kernel_old_gid_t;
+typedef unsigned short __kernel_old_dev_t;
+
+#ifdef __GNUC__
+typedef long long __kernel_loff_t;
+#endif
+
+typedef struct {
+#ifdef __USE_ALL
+ int val[2];
+#else
+ int __val[2];
+#endif
+} __kernel_fsid_t;
+
+#if !defined(__GLIBC__) || __GLIBC__ < 2
+
+#undef __FD_SET
+#define __FD_SET(fd,fdsetp)   __asm__ __volatile__("btsl %1,%0":   "+m" (*(__kernel_fd_set *) (fdsetp)):"r" ((int) (fd)))
+
+#undef __FD_CLR
+#define __FD_CLR(fd,fdsetp)   __asm__ __volatile__("btrl %1,%0":   "+m" (*(__kernel_fd_set *) (fdsetp)):"r" ((int) (fd)))
+
+#undef __FD_ISSET
+#define __FD_ISSET(fd,fdsetp) (__extension__ ({   unsigned char __result;   __asm__ __volatile__("btl %1,%2 ; setb %0"   :"=q" (__result) :"r" ((int) (fd)),   "m" (*(__kernel_fd_set *) (fdsetp)));   __result; }))
+
+#undef __FD_ZERO
+#define __FD_ZERO(fdsetp)  do {   int __d0, __d1;   __asm__ __volatile__("cld ; rep ; stosl"   :"=m" (*(__kernel_fd_set *) (fdsetp)),   "=&c" (__d0), "=&D" (__d1)   :"a" (0), "1" (__FDSET_LONGS),   "2" ((__kernel_fd_set *) (fdsetp)) : "memory");  } while (0)
+
+#endif
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/prctl.h b/ndk/platforms/android-5/arch-x86/include/asm/prctl.h
new file mode 100644
index 0000000..8852ca7
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/prctl.h
@@ -0,0 +1,20 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef X86_64_PRCTL_H
+#define X86_64_PRCTL_H 1
+
+#define ARCH_SET_GS 0x1001
+#define ARCH_SET_FS 0x1002
+#define ARCH_GET_FS 0x1003
+#define ARCH_GET_GS 0x1004
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/processor-flags.h b/ndk/platforms/android-5/arch-x86/include/asm/processor-flags.h
new file mode 100644
index 0000000..79e8f7d
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/processor-flags.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASM_I386_PROCESSOR_FLAGS_H
+#define __ASM_I386_PROCESSOR_FLAGS_H
+
+#define X86_EFLAGS_CF 0x00000001  
+#define X86_EFLAGS_PF 0x00000004  
+#define X86_EFLAGS_AF 0x00000010  
+#define X86_EFLAGS_ZF 0x00000040  
+#define X86_EFLAGS_SF 0x00000080  
+#define X86_EFLAGS_TF 0x00000100  
+#define X86_EFLAGS_IF 0x00000200  
+#define X86_EFLAGS_DF 0x00000400  
+#define X86_EFLAGS_OF 0x00000800  
+#define X86_EFLAGS_IOPL 0x00003000  
+#define X86_EFLAGS_NT 0x00004000  
+#define X86_EFLAGS_RF 0x00010000  
+#define X86_EFLAGS_VM 0x00020000  
+#define X86_EFLAGS_AC 0x00040000  
+#define X86_EFLAGS_VIF 0x00080000  
+#define X86_EFLAGS_VIP 0x00100000  
+#define X86_EFLAGS_ID 0x00200000  
+
+#define X86_CR0_PE 0x00000001  
+#define X86_CR0_MP 0x00000002  
+#define X86_CR0_EM 0x00000004  
+#define X86_CR0_TS 0x00000008  
+#define X86_CR0_ET 0x00000010  
+#define X86_CR0_NE 0x00000020  
+#define X86_CR0_WP 0x00010000  
+#define X86_CR0_AM 0x00040000  
+#define X86_CR0_NW 0x20000000  
+#define X86_CR0_CD 0x40000000  
+#define X86_CR0_PG 0x80000000  
+
+#define X86_CR3_PWT 0x00000008  
+#define X86_CR3_PCD 0x00000010  
+
+#define X86_CR4_VME 0x00000001  
+#define X86_CR4_PVI 0x00000002  
+#define X86_CR4_TSD 0x00000004  
+#define X86_CR4_DE 0x00000008  
+#define X86_CR4_PSE 0x00000010  
+#define X86_CR4_PAE 0x00000020  
+#define X86_CR4_MCE 0x00000040  
+#define X86_CR4_PGE 0x00000080  
+#define X86_CR4_PCE 0x00000100  
+#define X86_CR4_OSFXSR 0x00000200  
+#define X86_CR4_OSXMMEXCPT 0x00000400  
+#define X86_CR4_VMXE 0x00002000  
+
+#define X86_CR8_TPR 0x0000000F  
+
+#define CX86_PCR0 0x20
+#define CX86_GCR 0xb8
+#define CX86_CCR0 0xc0
+#define CX86_CCR1 0xc1
+#define CX86_CCR2 0xc2
+#define CX86_CCR3 0xc3
+#define CX86_CCR4 0xe8
+#define CX86_CCR5 0xe9
+#define CX86_CCR6 0xea
+#define CX86_CCR7 0xeb
+#define CX86_PCR1 0xf0
+#define CX86_DIR0 0xfe
+#define CX86_DIR1 0xff
+#define CX86_ARR_BASE 0xc4
+#define CX86_RCR_BASE 0xdc
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/processor.h b/ndk/platforms/android-5/arch-x86/include/asm/processor.h
new file mode 100644
index 0000000..7d47749
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/processor.h
@@ -0,0 +1,12 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#include "processor_64.h"
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/processor_32.h b/ndk/platforms/android-5/arch-x86/include/asm/processor_32.h
new file mode 100644
index 0000000..539edd1
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/processor_32.h
@@ -0,0 +1,324 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASM_I386_PROCESSOR_H
+#define __ASM_I386_PROCESSOR_H
+
+#include <asm/vm86.h>
+#include <asm/math_emu.h>
+#include <asm/segment.h>
+#include <asm/page.h>
+#include <asm/types.h>
+#include <asm/sigcontext.h>
+#include <asm/cpufeature.h>
+#include <asm/msr.h>
+#include <asm/system.h>
+#include <linux/cache.h>
+#include <linux/threads.h>
+#include <asm/percpu.h>
+#include <linux/cpumask.h>
+#include <linux/init.h>
+#include <asm/processor-flags.h>
+
+struct desc_struct {
+ unsigned long a,b;
+};
+
+#define desc_empty(desc)   (!((desc)->a | (desc)->b))
+
+#define desc_equal(desc1, desc2)   (((desc1)->a == (desc2)->a) && ((desc1)->b == (desc2)->b))
+
+#define current_text_addr() ({ void *pc; __asm__("movl $1f,%0\n1:":"=g" (pc)); pc; })
+
+struct cpuinfo_x86 {
+ __u8 x86;
+ __u8 x86_vendor;
+ __u8 x86_model;
+ __u8 x86_mask;
+ char wp_works_ok;
+ char hlt_works_ok;
+ char hard_math;
+ char rfu;
+ int cpuid_level;
+ unsigned long x86_capability[NCAPINTS];
+ char x86_vendor_id[16];
+ char x86_model_id[64];
+ int x86_cache_size;
+ int x86_cache_alignment;
+ char fdiv_bug;
+ char f00f_bug;
+ char coma_bug;
+ char pad0;
+ int x86_power;
+ unsigned long loops_per_jiffy;
+ unsigned char x86_max_cores;
+ unsigned char apicid;
+ unsigned short x86_clflush_size;
+} __attribute__((__aligned__(SMP_CACHE_BYTES)));
+
+#define X86_VENDOR_INTEL 0
+#define X86_VENDOR_CYRIX 1
+#define X86_VENDOR_AMD 2
+#define X86_VENDOR_UMC 3
+#define X86_VENDOR_NEXGEN 4
+#define X86_VENDOR_CENTAUR 5
+#define X86_VENDOR_TRANSMETA 7
+#define X86_VENDOR_NSC 8
+#define X86_VENDOR_NUM 9
+#define X86_VENDOR_UNKNOWN 0xff
+
+#define cpu_data(cpu) boot_cpu_data
+#define current_cpu_data boot_cpu_data
+
+#define load_cr3(pgdir) write_cr3(__pa(pgdir))
+
+#define TASK_SIZE (PAGE_OFFSET)
+
+#define TASK_UNMAPPED_BASE (PAGE_ALIGN(TASK_SIZE / 3))
+
+#define HAVE_ARCH_PICK_MMAP_LAYOUT
+
+#define IO_BITMAP_BITS 65536
+#define IO_BITMAP_BYTES (IO_BITMAP_BITS/8)
+#define IO_BITMAP_LONGS (IO_BITMAP_BYTES/sizeof(long))
+#define IO_BITMAP_OFFSET offsetof(struct tss_struct,io_bitmap)
+#define INVALID_IO_BITMAP_OFFSET 0x8000
+#define INVALID_IO_BITMAP_OFFSET_LAZY 0x9000
+
+struct i387_fsave_struct {
+ long cwd;
+ long swd;
+ long twd;
+ long fip;
+ long fcs;
+ long foo;
+ long fos;
+ long st_space[20];
+ long status;
+};
+
+struct i387_fxsave_struct {
+ unsigned short cwd;
+ unsigned short swd;
+ unsigned short twd;
+ unsigned short fop;
+ long fip;
+ long fcs;
+ long foo;
+ long fos;
+ long mxcsr;
+ long mxcsr_mask;
+ long st_space[32];
+ long xmm_space[32];
+ long padding[56];
+} __attribute__ ((aligned (16)));
+
+struct i387_soft_struct {
+ long cwd;
+ long swd;
+ long twd;
+ long fip;
+ long fcs;
+ long foo;
+ long fos;
+ long st_space[20];
+ unsigned char ftop, changed, lookahead, no_update, rm, alimit;
+ struct info *info;
+ unsigned long entry_eip;
+};
+
+union i387_union {
+ struct i387_fsave_struct fsave;
+ struct i387_fxsave_struct fxsave;
+ struct i387_soft_struct soft;
+};
+
+typedef struct {
+ unsigned long seg;
+} mm_segment_t;
+
+struct thread_struct;
+
+struct i386_hw_tss {
+ unsigned short back_link,__blh;
+ unsigned long esp0;
+ unsigned short ss0,__ss0h;
+ unsigned long esp1;
+ unsigned short ss1,__ss1h;
+ unsigned long esp2;
+ unsigned short ss2,__ss2h;
+ unsigned long __cr3;
+ unsigned long eip;
+ unsigned long eflags;
+ unsigned long eax,ecx,edx,ebx;
+ unsigned long esp;
+ unsigned long ebp;
+ unsigned long esi;
+ unsigned long edi;
+ unsigned short es, __esh;
+ unsigned short cs, __csh;
+ unsigned short ss, __ssh;
+ unsigned short ds, __dsh;
+ unsigned short fs, __fsh;
+ unsigned short gs, __gsh;
+ unsigned short ldt, __ldth;
+ unsigned short trace, io_bitmap_base;
+} __attribute__((packed));
+
+struct tss_struct {
+ struct i386_hw_tss x86_tss;
+
+ unsigned long io_bitmap[IO_BITMAP_LONGS + 1];
+
+ unsigned long io_bitmap_max;
+ struct thread_struct *io_bitmap_owner;
+
+ unsigned long __cacheline_filler[35];
+
+ unsigned long stack[64];
+} __attribute__((packed));
+
+#define ARCH_MIN_TASKALIGN 16
+
+struct thread_struct {
+
+ struct desc_struct tls_array[GDT_ENTRY_TLS_ENTRIES];
+ unsigned long esp0;
+ unsigned long sysenter_cs;
+ unsigned long eip;
+ unsigned long esp;
+ unsigned long fs;
+ unsigned long gs;
+
+ unsigned long debugreg[8];
+
+ unsigned long cr2, trap_no, error_code;
+
+ union i387_union i387;
+
+ struct vm86_struct __user * vm86_info;
+ unsigned long screen_bitmap;
+ unsigned long v86flags, v86mask, saved_esp0;
+ unsigned int saved_fs, saved_gs;
+
+ unsigned long *io_bitmap_ptr;
+ unsigned long iopl;
+
+ unsigned long io_bitmap_max;
+};
+
+#define INIT_THREAD {   .esp0 = sizeof(init_stack) + (long)&init_stack,   .vm86_info = NULL,   .sysenter_cs = __KERNEL_CS,   .io_bitmap_ptr = NULL,   .fs = __KERNEL_PERCPU,  }
+
+#define INIT_TSS {   .x86_tss = {   .esp0 = sizeof(init_stack) + (long)&init_stack,   .ss0 = __KERNEL_DS,   .ss1 = __KERNEL_CS,   .io_bitmap_base = INVALID_IO_BITMAP_OFFSET,   },   .io_bitmap = { [ 0 ... IO_BITMAP_LONGS] = ~0 },  }
+
+#define start_thread(regs, new_eip, new_esp) do {   __asm__("movl %0,%%gs": :"r" (0));   regs->xfs = 0;   set_fs(USER_DS);   regs->xds = __USER_DS;   regs->xes = __USER_DS;   regs->xss = __USER_DS;   regs->xcs = __USER_CS;   regs->eip = new_eip;   regs->esp = new_esp;  } while (0)
+
+struct task_struct;
+struct mm_struct;
+
+#define THREAD_SIZE_LONGS (THREAD_SIZE/sizeof(unsigned long))
+#define KSTK_TOP(info)  ({   unsigned long *__ptr = (unsigned long *)(info);   (unsigned long)(&__ptr[THREAD_SIZE_LONGS]);  })
+
+#define task_pt_regs(task)  ({   struct pt_regs *__regs__;   __regs__ = (struct pt_regs *)(KSTK_TOP(task_stack_page(task))-8);   __regs__ - 1;  })
+
+#define KSTK_EIP(task) (task_pt_regs(task)->eip)
+#define KSTK_ESP(task) (task_pt_regs(task)->esp)
+
+struct microcode_header {
+ unsigned int hdrver;
+ unsigned int rev;
+ unsigned int date;
+ unsigned int sig;
+ unsigned int cksum;
+ unsigned int ldrver;
+ unsigned int pf;
+ unsigned int datasize;
+ unsigned int totalsize;
+ unsigned int reserved[3];
+};
+
+struct microcode {
+ struct microcode_header hdr;
+ unsigned int bits[0];
+};
+
+typedef struct microcode microcode_t;
+typedef struct microcode_header microcode_header_t;
+
+struct extended_signature {
+ unsigned int sig;
+ unsigned int pf;
+ unsigned int cksum;
+};
+
+struct extended_sigtable {
+ unsigned int count;
+ unsigned int cksum;
+ unsigned int reserved[3];
+ struct extended_signature sigs[0];
+};
+
+#define cpu_relax() rep_nop()
+#define paravirt_enabled() 0
+#define __cpuid native_cpuid
+#define get_debugreg(var, register)   (var) = native_get_debugreg(register)
+#define set_debugreg(value, register)   native_set_debugreg(register, value)
+#define set_iopl_mask native_set_iopl_mask
+#define GENERIC_NOP1 ".byte 0x90\n"
+#define GENERIC_NOP2 ".byte 0x89,0xf6\n"
+#define GENERIC_NOP3 ".byte 0x8d,0x76,0x00\n"
+#define GENERIC_NOP4 ".byte 0x8d,0x74,0x26,0x00\n"
+#define GENERIC_NOP5 GENERIC_NOP1 GENERIC_NOP4
+#define GENERIC_NOP6 ".byte 0x8d,0xb6,0x00,0x00,0x00,0x00\n"
+#define GENERIC_NOP7 ".byte 0x8d,0xb4,0x26,0x00,0x00,0x00,0x00\n"
+#define GENERIC_NOP8 GENERIC_NOP1 GENERIC_NOP7
+#define K8_NOP1 GENERIC_NOP1
+#define K8_NOP2 ".byte 0x66,0x90\n" 
+#define K8_NOP3 ".byte 0x66,0x66,0x90\n" 
+#define K8_NOP4 ".byte 0x66,0x66,0x66,0x90\n" 
+#define K8_NOP5 K8_NOP3 K8_NOP2 
+#define K8_NOP6 K8_NOP3 K8_NOP3
+#define K8_NOP7 K8_NOP4 K8_NOP3
+#define K8_NOP8 K8_NOP4 K8_NOP4
+#define K7_NOP1 GENERIC_NOP1
+#define K7_NOP2 ".byte 0x8b,0xc0\n" 
+#define K7_NOP3 ".byte 0x8d,0x04,0x20\n"
+#define K7_NOP4 ".byte 0x8d,0x44,0x20,0x00\n"
+#define K7_NOP5 K7_NOP4 ASM_NOP1
+#define K7_NOP6 ".byte 0x8d,0x80,0,0,0,0\n"
+#define K7_NOP7 ".byte 0x8D,0x04,0x05,0,0,0,0\n"
+#define K7_NOP8 K7_NOP7 ASM_NOP1
+#define P6_NOP1 GENERIC_NOP1
+#define P6_NOP2 ".byte 0x66,0x90\n"
+#define P6_NOP3 ".byte 0x0f,0x1f,0x00\n"
+#define P6_NOP4 ".byte 0x0f,0x1f,0x40,0\n"
+#define P6_NOP5 ".byte 0x0f,0x1f,0x44,0x00,0\n"
+#define P6_NOP6 ".byte 0x66,0x0f,0x1f,0x44,0x00,0\n"
+#define P6_NOP7 ".byte 0x0f,0x1f,0x80,0,0,0,0\n"
+#define P6_NOP8 ".byte 0x0f,0x1f,0x84,0x00,0,0,0,0\n"
+#define ASM_NOP1 GENERIC_NOP1
+#define ASM_NOP2 GENERIC_NOP2
+#define ASM_NOP3 GENERIC_NOP3
+#define ASM_NOP4 GENERIC_NOP4
+#define ASM_NOP5 GENERIC_NOP5
+#define ASM_NOP6 GENERIC_NOP6
+#define ASM_NOP7 GENERIC_NOP7
+#define ASM_NOP8 GENERIC_NOP8
+#define ASM_NOP_MAX 8
+#define ARCH_HAS_PREFETCH
+#define ARCH_HAS_PREFETCH
+#define ARCH_HAS_PREFETCHW
+#define ARCH_HAS_SPINLOCK_PREFETCH
+#define spin_lock_prefetch(x) prefetchw(x)
+
+#define cache_line_size() (boot_cpu_data.x86_cache_alignment)
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/ptrace-abi.h b/ndk/platforms/android-5/arch-x86/include/asm/ptrace-abi.h
new file mode 100644
index 0000000..3e6ea08
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/ptrace-abi.h
@@ -0,0 +1,88 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_X86_PTRACE_ABI_H
+#define _ASM_X86_PTRACE_ABI_H
+
+#ifdef __i386__
+
+#define EBX 0
+#define ECX 1
+#define EDX 2
+#define ESI 3
+#define EDI 4
+#define EBP 5
+#define EAX 6
+#define DS 7
+#define ES 8
+#define FS 9
+#define GS 10
+#define ORIG_EAX 11
+#define EIP 12
+#define CS 13
+#define EFL 14
+#define UESP 15
+#define SS 16
+#define FRAME_SIZE 17
+
+#else
+
+#if defined(__ASSEMBLY__) || defined(__FRAME_OFFSETS)
+#define R15 0
+#define R14 8
+#define R13 16
+#define R12 24
+#define RBP 32
+#define RBX 40
+
+#define R11 48
+#define R10 56
+#define R9 64
+#define R8 72
+#define RAX 80
+#define RCX 88
+#define RDX 96
+#define RSI 104
+#define RDI 112
+#define ORIG_RAX 120  
+
+#define RIP 128
+#define CS 136
+#define EFLAGS 144
+#define RSP 152
+#define SS 160
+#define ARGOFFSET R11
+#endif
+
+#define FRAME_SIZE 168
+
+#endif
+
+#define PTRACE_GETREGS 12
+#define PTRACE_SETREGS 13
+#define PTRACE_GETFPREGS 14
+#define PTRACE_SETFPREGS 15
+#define PTRACE_GETFPXREGS 18
+#define PTRACE_SETFPXREGS 19
+
+#define PTRACE_OLDSETOPTIONS 21
+
+#define PTRACE_GET_THREAD_AREA 25
+#define PTRACE_SET_THREAD_AREA 26
+
+#ifdef __x86_64__
+#define PTRACE_ARCH_PRCTL 30
+#else
+#define PTRACE_SYSEMU 31
+#define PTRACE_SYSEMU_SINGLESTEP 32
+#endif
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/ptrace.h b/ndk/platforms/android-5/arch-x86/include/asm/ptrace.h
new file mode 100644
index 0000000..4743e0f
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/ptrace.h
@@ -0,0 +1,74 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_X86_PTRACE_H
+#define _ASM_X86_PTRACE_H
+
+#include <linux/compiler.h>  
+#include <asm/ptrace-abi.h>
+
+#ifndef __ASSEMBLY__
+
+#ifdef __i386__
+
+struct pt_regs {
+ long ebx;
+ long ecx;
+ long edx;
+ long esi;
+ long edi;
+ long ebp;
+ long eax;
+ int xds;
+ int xes;
+ int xfs;
+
+ long orig_eax;
+ long eip;
+ int xcs;
+ long eflags;
+ long esp;
+ int xss;
+};
+
+#else
+
+struct pt_regs {
+ unsigned long r15;
+ unsigned long r14;
+ unsigned long r13;
+ unsigned long r12;
+ unsigned long rbp;
+ unsigned long rbx;
+
+ unsigned long r11;
+ unsigned long r10;
+ unsigned long r9;
+ unsigned long r8;
+ unsigned long rax;
+ unsigned long rcx;
+ unsigned long rdx;
+ unsigned long rsi;
+ unsigned long rdi;
+ unsigned long orig_rax;
+
+ unsigned long rip;
+ unsigned long cs;
+ unsigned long eflags;
+ unsigned long rsp;
+ unsigned long ss;
+
+};
+
+#endif
+#endif
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/required-features.h b/ndk/platforms/android-5/arch-x86/include/asm/required-features.h
new file mode 100644
index 0000000..a96517a
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/required-features.h
@@ -0,0 +1,44 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_REQUIRED_FEATURES_H
+#define _ASM_REQUIRED_FEATURES_H 1
+
+#define NEED_FPU (1<<(X86_FEATURE_FPU & 31))
+
+#define NEED_PAE 0
+#define NEED_CX8 0
+
+#define NEED_CMOV 0
+
+#define NEED_3DNOW 0
+
+#define NEED_PSE 0
+#define NEED_MSR 0
+#define NEED_PGE 0
+#define NEED_FXSR 0
+#define NEED_XMM 0
+#define NEED_XMM2 0
+#define NEED_LM 0
+
+#define REQUIRED_MASK0 (NEED_FPU|NEED_PSE|NEED_MSR|NEED_PAE|  NEED_CX8|NEED_PGE|NEED_FXSR|NEED_CMOV|  NEED_XMM|NEED_XMM2)
+#define SSE_MASK (NEED_XMM|NEED_XMM2)
+
+#define REQUIRED_MASK1 (NEED_LM|NEED_3DNOW)
+
+#define REQUIRED_MASK2 0
+#define REQUIRED_MASK3 0
+#define REQUIRED_MASK4 0
+#define REQUIRED_MASK5 0
+#define REQUIRED_MASK6 0
+#define REQUIRED_MASK7 0
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/resource.h b/ndk/platforms/android-5/arch-x86/include/asm/resource.h
new file mode 100644
index 0000000..29d9e12
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/resource.h
@@ -0,0 +1,12 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#include <asm-generic/resource.h>
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/rwlock.h b/ndk/platforms/android-5/arch-x86/include/asm/rwlock.h
new file mode 100644
index 0000000..3693542
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/rwlock.h
@@ -0,0 +1,18 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_X86_RWLOCK_H
+#define _ASM_X86_RWLOCK_H
+
+#define RW_LOCK_BIAS 0x01000000
+#define RW_LOCK_BIAS_STR "0x01000000"
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/scatterlist.h b/ndk/platforms/android-5/arch-x86/include/asm/scatterlist.h
new file mode 100644
index 0000000..fa4d0cc
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/scatterlist.h
@@ -0,0 +1,12 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#include "scatterlist_64.h"
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/scatterlist_32.h b/ndk/platforms/android-5/arch-x86/include/asm/scatterlist_32.h
new file mode 100644
index 0000000..29044c3
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/scatterlist_32.h
@@ -0,0 +1,31 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _I386_SCATTERLIST_H
+#define _I386_SCATTERLIST_H
+
+#include <asm/types.h>
+
+struct scatterlist {
+ unsigned long page_link;
+ unsigned int offset;
+ dma_addr_t dma_address;
+ unsigned int length;
+};
+
+#define ARCH_HAS_SG_CHAIN
+
+#define sg_dma_address(sg) ((sg)->dma_address)
+#define sg_dma_len(sg) ((sg)->length)
+
+#define ISA_DMA_THRESHOLD (0x00ffffff)
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/sections.h b/ndk/platforms/android-5/arch-x86/include/asm/sections.h
new file mode 100644
index 0000000..a21da3e
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/sections.h
@@ -0,0 +1,12 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#include <asm-generic/sections.h>
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/segment.h b/ndk/platforms/android-5/arch-x86/include/asm/segment.h
new file mode 100644
index 0000000..6877a80
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/segment.h
@@ -0,0 +1,12 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#include "segment_64.h"
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/segment_32.h b/ndk/platforms/android-5/arch-x86/include/asm/segment_32.h
new file mode 100644
index 0000000..54b312b
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/segment_32.h
@@ -0,0 +1,89 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_SEGMENT_H
+#define _ASM_SEGMENT_H
+
+#define GDT_ENTRY_TLS_ENTRIES 3
+#define GDT_ENTRY_TLS_MIN 6
+#define GDT_ENTRY_TLS_MAX (GDT_ENTRY_TLS_MIN + GDT_ENTRY_TLS_ENTRIES - 1)
+
+#define TLS_SIZE (GDT_ENTRY_TLS_ENTRIES * 8)
+
+#define GDT_ENTRY_DEFAULT_USER_CS 14
+#define __USER_CS (GDT_ENTRY_DEFAULT_USER_CS * 8 + 3)
+
+#define GDT_ENTRY_DEFAULT_USER_DS 15
+#define __USER_DS (GDT_ENTRY_DEFAULT_USER_DS * 8 + 3)
+
+#define GDT_ENTRY_KERNEL_BASE 12
+
+#define GDT_ENTRY_KERNEL_CS (GDT_ENTRY_KERNEL_BASE + 0)
+#define __KERNEL_CS (GDT_ENTRY_KERNEL_CS * 8)
+
+#define GDT_ENTRY_KERNEL_DS (GDT_ENTRY_KERNEL_BASE + 1)
+#define __KERNEL_DS (GDT_ENTRY_KERNEL_DS * 8)
+
+#define GDT_ENTRY_TSS (GDT_ENTRY_KERNEL_BASE + 4)
+#define GDT_ENTRY_LDT (GDT_ENTRY_KERNEL_BASE + 5)
+
+#define GDT_ENTRY_PNPBIOS_BASE (GDT_ENTRY_KERNEL_BASE + 6)
+#define GDT_ENTRY_APMBIOS_BASE (GDT_ENTRY_KERNEL_BASE + 11)
+
+#define GDT_ENTRY_ESPFIX_SS (GDT_ENTRY_KERNEL_BASE + 14)
+#define __ESPFIX_SS (GDT_ENTRY_ESPFIX_SS * 8)
+
+#define GDT_ENTRY_PERCPU (GDT_ENTRY_KERNEL_BASE + 15)
+#define __KERNEL_PERCPU 0
+
+#define GDT_ENTRY_DOUBLEFAULT_TSS 31
+
+#define GDT_ENTRIES 32
+#define GDT_SIZE (GDT_ENTRIES * 8)
+
+#define GDT_ENTRY_BOOT_CS 2
+#define __BOOT_CS (GDT_ENTRY_BOOT_CS * 8)
+
+#define GDT_ENTRY_BOOT_DS (GDT_ENTRY_BOOT_CS + 1)
+#define __BOOT_DS (GDT_ENTRY_BOOT_DS * 8)
+
+#define GDT_ENTRY_PNPBIOS_CS32 (GDT_ENTRY_PNPBIOS_BASE + 0)
+#define GDT_ENTRY_PNPBIOS_CS16 (GDT_ENTRY_PNPBIOS_BASE + 1)
+#define GDT_ENTRY_PNPBIOS_DS (GDT_ENTRY_PNPBIOS_BASE + 2)
+#define GDT_ENTRY_PNPBIOS_TS1 (GDT_ENTRY_PNPBIOS_BASE + 3)
+#define GDT_ENTRY_PNPBIOS_TS2 (GDT_ENTRY_PNPBIOS_BASE + 4)
+
+#define PNP_CS32 (GDT_ENTRY_PNPBIOS_CS32 * 8)  
+#define PNP_CS16 (GDT_ENTRY_PNPBIOS_CS16 * 8)  
+#define PNP_DS (GDT_ENTRY_PNPBIOS_DS * 8)  
+#define PNP_TS1 (GDT_ENTRY_PNPBIOS_TS1 * 8)  
+#define PNP_TS2 (GDT_ENTRY_PNPBIOS_TS2 * 8)  
+
+#define IDT_ENTRIES 256
+
+#define SEGMENT_RPL_MASK 0x3
+
+#define SEGMENT_TI_MASK 0x4
+
+#define USER_RPL 0x3
+
+#define SEGMENT_LDT 0x4
+#define SEGMENT_GDT 0x0
+
+#define get_kernel_rpl() 0
+
+#define SEGMENT_IS_KERNEL_CODE(x) (((x) & 0xfc) == GDT_ENTRY_KERNEL_CS * 8)
+
+#define SEGMENT_IS_FLAT_CODE(x) (((x) & 0xec) == GDT_ENTRY_KERNEL_CS * 8)
+
+#define SEGMENT_IS_PNP_CODE(x) (((x) & 0xf4) == GDT_ENTRY_PNPBIOS_BASE * 8)
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/semaphore.h b/ndk/platforms/android-5/arch-x86/include/asm/semaphore.h
new file mode 100644
index 0000000..8b4c595
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/semaphore.h
@@ -0,0 +1,12 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#include "semaphore_64.h"
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/semaphore_32.h b/ndk/platforms/android-5/arch-x86/include/asm/semaphore_32.h
new file mode 100644
index 0000000..babe779
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/semaphore_32.h
@@ -0,0 +1,17 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _I386_SEMAPHORE_H
+#define _I386_SEMAPHORE_H
+
+#include <linux/linkage.h>
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/sembuf.h b/ndk/platforms/android-5/arch-x86/include/asm/sembuf.h
new file mode 100644
index 0000000..1695208
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/sembuf.h
@@ -0,0 +1,26 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_X86_SEMBUF_H
+#define _ASM_X86_SEMBUF_H
+
+struct semid64_ds {
+ struct ipc64_perm sem_perm;
+ __kernel_time_t sem_otime;
+ unsigned long __unused1;
+ __kernel_time_t sem_ctime;
+ unsigned long __unused2;
+ unsigned long sem_nsems;
+ unsigned long __unused3;
+ unsigned long __unused4;
+};
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/setup.h b/ndk/platforms/android-5/arch-x86/include/asm/setup.h
new file mode 100644
index 0000000..696ed97
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/setup.h
@@ -0,0 +1,17 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_X86_SETUP_H
+#define _ASM_X86_SETUP_H
+
+#define COMMAND_LINE_SIZE 2048
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/shmbuf.h b/ndk/platforms/android-5/arch-x86/include/asm/shmbuf.h
new file mode 100644
index 0000000..314ccb7
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/shmbuf.h
@@ -0,0 +1,49 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_X86_SHMBUF_H
+#define _ASM_X86_SHMBUF_H
+
+struct shmid64_ds {
+ struct ipc64_perm shm_perm;
+ size_t shm_segsz;
+ __kernel_time_t shm_atime;
+#ifdef __i386__
+ unsigned long __unused1;
+#endif
+ __kernel_time_t shm_dtime;
+#ifdef __i386__
+ unsigned long __unused2;
+#endif
+ __kernel_time_t shm_ctime;
+#ifdef __i386__
+ unsigned long __unused3;
+#endif
+ __kernel_pid_t shm_cpid;
+ __kernel_pid_t shm_lpid;
+ unsigned long shm_nattch;
+ unsigned long __unused4;
+ unsigned long __unused5;
+};
+
+struct shminfo64 {
+ unsigned long shmmax;
+ unsigned long shmmin;
+ unsigned long shmmni;
+ unsigned long shmseg;
+ unsigned long shmall;
+ unsigned long __unused1;
+ unsigned long __unused2;
+ unsigned long __unused3;
+ unsigned long __unused4;
+};
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/shmparam.h b/ndk/platforms/android-5/arch-x86/include/asm/shmparam.h
new file mode 100644
index 0000000..e667ba1
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/shmparam.h
@@ -0,0 +1,17 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_X86_SHMPARAM_H
+#define _ASM_X86_SHMPARAM_H
+
+#define SHMLBA PAGE_SIZE  
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/sigcontext.h b/ndk/platforms/android-5/arch-x86/include/asm/sigcontext.h
new file mode 100644
index 0000000..a8f76f0
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/sigcontext.h
@@ -0,0 +1,132 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_X86_SIGCONTEXT_H
+#define _ASM_X86_SIGCONTEXT_H
+
+#include <linux/compiler.h>
+#include <asm/types.h>
+
+#ifdef __i386__
+
+struct _fpreg {
+ unsigned short significand[4];
+ unsigned short exponent;
+};
+
+struct _fpxreg {
+ unsigned short significand[4];
+ unsigned short exponent;
+ unsigned short padding[3];
+};
+
+struct _xmmreg {
+ unsigned long element[4];
+};
+
+struct _fpstate {
+
+ unsigned long cw;
+ unsigned long sw;
+ unsigned long tag;
+ unsigned long ipoff;
+ unsigned long cssel;
+ unsigned long dataoff;
+ unsigned long datasel;
+ struct _fpreg _st[8];
+ unsigned short status;
+ unsigned short magic;
+
+ unsigned long _fxsr_env[6];
+ unsigned long mxcsr;
+ unsigned long reserved;
+ struct _fpxreg _fxsr_st[8];
+ struct _xmmreg _xmm[8];
+ unsigned long padding[56];
+};
+
+#define X86_FXSR_MAGIC 0x0000
+
+struct sigcontext {
+ unsigned short gs, __gsh;
+ unsigned short fs, __fsh;
+ unsigned short es, __esh;
+ unsigned short ds, __dsh;
+ unsigned long edi;
+ unsigned long esi;
+ unsigned long ebp;
+ unsigned long esp;
+ unsigned long ebx;
+ unsigned long edx;
+ unsigned long ecx;
+ unsigned long eax;
+ unsigned long trapno;
+ unsigned long err;
+ unsigned long eip;
+ unsigned short cs, __csh;
+ unsigned long eflags;
+ unsigned long esp_at_signal;
+ unsigned short ss, __ssh;
+ struct _fpstate __user * fpstate;
+ unsigned long oldmask;
+ unsigned long cr2;
+};
+
+#else
+
+struct _fpstate {
+ __u16 cwd;
+ __u16 swd;
+ __u16 twd;
+ __u16 fop;
+ __u64 rip;
+ __u64 rdp;
+ __u32 mxcsr;
+ __u32 mxcsr_mask;
+ __u32 st_space[32];
+ __u32 xmm_space[64];
+ __u32 reserved2[24];
+};
+
+struct sigcontext {
+ unsigned long r8;
+ unsigned long r9;
+ unsigned long r10;
+ unsigned long r11;
+ unsigned long r12;
+ unsigned long r13;
+ unsigned long r14;
+ unsigned long r15;
+ unsigned long rdi;
+ unsigned long rsi;
+ unsigned long rbp;
+ unsigned long rbx;
+ unsigned long rdx;
+ unsigned long rax;
+ unsigned long rcx;
+ unsigned long rsp;
+ unsigned long rip;
+ unsigned long eflags;
+ unsigned short cs;
+ unsigned short gs;
+ unsigned short fs;
+ unsigned short __pad0;
+ unsigned long err;
+ unsigned long trapno;
+ unsigned long oldmask;
+ unsigned long cr2;
+ struct _fpstate __user *fpstate;
+ unsigned long reserved1[8];
+};
+
+#endif
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/siginfo.h b/ndk/platforms/android-5/arch-x86/include/asm/siginfo.h
new file mode 100644
index 0000000..0d21d22
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/siginfo.h
@@ -0,0 +1,21 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_X86_SIGINFO_H
+#define _ASM_X86_SIGINFO_H
+
+#ifdef __x86_64__
+#define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int))
+#endif
+
+#include <asm-generic/siginfo.h>
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/signal.h b/ndk/platforms/android-5/arch-x86/include/asm/signal.h
new file mode 100644
index 0000000..6d84eab
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/signal.h
@@ -0,0 +1,127 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_X86_SIGNAL_H
+#define _ASM_X86_SIGNAL_H
+
+#ifndef __ASSEMBLY__
+#include <linux/types.h>
+#include <linux/time.h>
+#include <linux/compiler.h>
+
+struct siginfo;
+
+#define NSIG 32
+typedef unsigned long sigset_t;
+
+#endif
+
+#define SIGHUP 1
+#define SIGINT 2
+#define SIGQUIT 3
+#define SIGILL 4
+#define SIGTRAP 5
+#define SIGABRT 6
+#define SIGIOT 6
+#define SIGBUS 7
+#define SIGFPE 8
+#define SIGKILL 9
+#define SIGUSR1 10
+#define SIGSEGV 11
+#define SIGUSR2 12
+#define SIGPIPE 13
+#define SIGALRM 14
+#define SIGTERM 15
+#define SIGSTKFLT 16
+#define SIGCHLD 17
+#define SIGCONT 18
+#define SIGSTOP 19
+#define SIGTSTP 20
+#define SIGTTIN 21
+#define SIGTTOU 22
+#define SIGURG 23
+#define SIGXCPU 24
+#define SIGXFSZ 25
+#define SIGVTALRM 26
+#define SIGPROF 27
+#define SIGWINCH 28
+#define SIGIO 29
+#define SIGPOLL SIGIO
+
+#define SIGPWR 30
+#define SIGSYS 31
+#define SIGUNUSED 31
+
+#define SIGRTMIN 32
+#define SIGRTMAX _NSIG
+
+#define SA_NOCLDSTOP 0x00000001u
+#define SA_NOCLDWAIT 0x00000002u
+#define SA_SIGINFO 0x00000004u
+#define SA_ONSTACK 0x08000000u
+#define SA_RESTART 0x10000000u
+#define SA_NODEFER 0x40000000u
+#define SA_RESETHAND 0x80000000u
+
+#define SA_NOMASK SA_NODEFER
+#define SA_ONESHOT SA_RESETHAND
+
+#define SA_RESTORER 0x04000000
+
+#define SS_ONSTACK 1
+#define SS_DISABLE 2
+
+#define MINSIGSTKSZ 2048
+#define SIGSTKSZ 8192
+
+#include <asm-generic/signal.h>
+
+#ifndef __ASSEMBLY__
+
+#ifdef __i386__
+
+struct sigaction {
+ union {
+ __sighandler_t _sa_handler;
+ void (*_sa_sigaction)(int, struct siginfo *, void *);
+ } _u;
+ sigset_t sa_mask;
+ unsigned long sa_flags;
+ void (*sa_restorer)(void);
+};
+
+#define sa_handler _u._sa_handler
+#define sa_sigaction _u._sa_sigaction
+
+#else
+
+struct sigaction {
+ __sighandler_t sa_handler;
+ unsigned long sa_flags;
+ __sigrestore_t sa_restorer;
+ sigset_t sa_mask;
+};
+
+struct k_sigaction {
+ struct sigaction sa;
+};
+
+#endif
+
+typedef struct sigaltstack {
+ void __user *ss_sp;
+ int ss_flags;
+ size_t ss_size;
+} stack_t;
+
+#endif
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/smp.h b/ndk/platforms/android-5/arch-x86/include/asm/smp.h
new file mode 100644
index 0000000..40d4601
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/smp.h
@@ -0,0 +1,12 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#include "smp_64.h"
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/smp_32.h b/ndk/platforms/android-5/arch-x86/include/asm/smp_32.h
new file mode 100644
index 0000000..f093a24
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/smp_32.h
@@ -0,0 +1,34 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASM_SMP_H
+#define __ASM_SMP_H
+
+#ifndef __ASSEMBLY__
+#include <linux/kernel.h>
+#include <linux/threads.h>
+#include <linux/cpumask.h>
+#endif
+
+#define BAD_APICID 0xFFu
+
+#define safe_smp_processor_id() 0
+#define cpu_physical_id(cpu) boot_cpu_physical_apicid
+
+#define NO_PROC_ID 0xFF  
+
+#ifndef __ASSEMBLY__
+
+#define hard_smp_processor_id() 0
+
+#endif
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/socket.h b/ndk/platforms/android-5/arch-x86/include/asm/socket.h
new file mode 100644
index 0000000..27d243f
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/socket.h
@@ -0,0 +1,63 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_SOCKET_H
+#define _ASM_SOCKET_H
+
+#include <asm/sockios.h>
+
+#define SOL_SOCKET 1
+
+#define SO_DEBUG 1
+#define SO_REUSEADDR 2
+#define SO_TYPE 3
+#define SO_ERROR 4
+#define SO_DONTROUTE 5
+#define SO_BROADCAST 6
+#define SO_SNDBUF 7
+#define SO_RCVBUF 8
+#define SO_SNDBUFFORCE 32
+#define SO_RCVBUFFORCE 33
+#define SO_KEEPALIVE 9
+#define SO_OOBINLINE 10
+#define SO_NO_CHECK 11
+#define SO_PRIORITY 12
+#define SO_LINGER 13
+#define SO_BSDCOMPAT 14
+
+#define SO_PASSCRED 16
+#define SO_PEERCRED 17
+#define SO_RCVLOWAT 18
+#define SO_SNDLOWAT 19
+#define SO_RCVTIMEO 20
+#define SO_SNDTIMEO 21
+
+#define SO_SECURITY_AUTHENTICATION 22
+#define SO_SECURITY_ENCRYPTION_TRANSPORT 23
+#define SO_SECURITY_ENCRYPTION_NETWORK 24
+
+#define SO_BINDTODEVICE 25
+
+#define SO_ATTACH_FILTER 26
+#define SO_DETACH_FILTER 27
+
+#define SO_PEERNAME 28
+#define SO_TIMESTAMP 29
+#define SCM_TIMESTAMP SO_TIMESTAMP
+
+#define SO_ACCEPTCONN 30
+
+#define SO_PEERSEC 31
+#define SO_PASSSEC 34
+#define SO_TIMESTAMPNS 35
+#define SCM_TIMESTAMPNS SO_TIMESTAMPNS
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/sockios.h b/ndk/platforms/android-5/arch-x86/include/asm/sockios.h
new file mode 100644
index 0000000..ebdfa98
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/sockios.h
@@ -0,0 +1,23 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_X86_SOCKIOS_H
+#define _ASM_X86_SOCKIOS_H
+
+#define FIOSETOWN 0x8901
+#define SIOCSPGRP 0x8902
+#define FIOGETOWN 0x8903
+#define SIOCGPGRP 0x8904
+#define SIOCATMARK 0x8905
+#define SIOCGSTAMP 0x8906  
+#define SIOCGSTAMPNS 0x8907  
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/spinlock.h b/ndk/platforms/android-5/arch-x86/include/asm/spinlock.h
new file mode 100644
index 0000000..10d123a
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/spinlock.h
@@ -0,0 +1,12 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#include "spinlock_64.h"
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/spinlock_32.h b/ndk/platforms/android-5/arch-x86/include/asm/spinlock_32.h
new file mode 100644
index 0000000..171783e
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/spinlock_32.h
@@ -0,0 +1,29 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASM_SPINLOCK_H
+#define __ASM_SPINLOCK_H
+
+#include <asm/atomic.h>
+#include <asm/rwlock.h>
+#include <asm/page.h>
+#include <asm/processor.h>
+#include <linux/compiler.h>
+
+#define CLI_STRING "cli"
+#define STI_STRING "sti"
+#define CLI_STI_CLOBBERS
+#define CLI_STI_INPUT_ARGS
+
+#define _raw_spin_relax(lock) cpu_relax()
+#define _raw_read_relax(lock) cpu_relax()
+#define _raw_write_relax(lock) cpu_relax()
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/spinlock_types.h b/ndk/platforms/android-5/arch-x86/include/asm/spinlock_types.h
new file mode 100644
index 0000000..ab914c4
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/spinlock_types.h
@@ -0,0 +1,31 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASM_SPINLOCK_TYPES_H
+#define __ASM_SPINLOCK_TYPES_H
+
+#ifndef __LINUX_SPINLOCK_TYPES_H
+#error "please don't include this file directly"
+#endif
+
+typedef struct {
+ unsigned int slock;
+} raw_spinlock_t;
+
+#define __RAW_SPIN_LOCK_UNLOCKED { 1 }
+
+typedef struct {
+ unsigned int lock;
+} raw_rwlock_t;
+
+#define __RAW_RW_LOCK_UNLOCKED { RW_LOCK_BIAS }
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/stat.h b/ndk/platforms/android-5/arch-x86/include/asm/stat.h
new file mode 100644
index 0000000..837d716
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/stat.h
@@ -0,0 +1,120 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_X86_STAT_H
+#define _ASM_X86_STAT_H
+
+#define STAT_HAVE_NSEC 1
+
+#ifdef __i386__
+struct stat {
+ unsigned long st_dev;
+ unsigned long st_ino;
+ unsigned short st_mode;
+ unsigned short st_nlink;
+ unsigned short st_uid;
+ unsigned short st_gid;
+ unsigned long st_rdev;
+ unsigned long st_size;
+ unsigned long st_blksize;
+ unsigned long st_blocks;
+ unsigned long st_atime;
+ unsigned long st_atime_nsec;
+ unsigned long st_mtime;
+ unsigned long st_mtime_nsec;
+ unsigned long st_ctime;
+ unsigned long st_ctime_nsec;
+ unsigned long __unused4;
+ unsigned long __unused5;
+};
+
+#define STAT64_HAS_BROKEN_ST_INO 1
+
+struct stat64 {
+ unsigned long long st_dev;
+ unsigned char __pad0[4];
+
+ unsigned long __st_ino;
+
+ unsigned int st_mode;
+ unsigned int st_nlink;
+
+ unsigned long st_uid;
+ unsigned long st_gid;
+
+ unsigned long long st_rdev;
+ unsigned char __pad3[4];
+
+ long long st_size;
+ unsigned long st_blksize;
+
+ unsigned long long st_blocks;
+
+ unsigned long st_atime;
+ unsigned long st_atime_nsec;
+
+ unsigned long st_mtime;
+ unsigned int st_mtime_nsec;
+
+ unsigned long st_ctime;
+ unsigned long st_ctime_nsec;
+
+ unsigned long long st_ino;
+};
+
+#else
+
+struct stat {
+ unsigned long st_dev;
+ unsigned long st_ino;
+ unsigned long st_nlink;
+
+ unsigned int st_mode;
+ unsigned int st_uid;
+ unsigned int st_gid;
+ unsigned int __pad0;
+ unsigned long st_rdev;
+ long st_size;
+ long st_blksize;
+ long st_blocks;
+
+ unsigned long st_atime;
+ unsigned long st_atime_nsec;
+ unsigned long st_mtime;
+ unsigned long st_mtime_nsec;
+ unsigned long st_ctime;
+ unsigned long st_ctime_nsec;
+ long __unused[3];
+};
+#endif
+
+struct __old_kernel_stat {
+ unsigned short st_dev;
+ unsigned short st_ino;
+ unsigned short st_mode;
+ unsigned short st_nlink;
+ unsigned short st_uid;
+ unsigned short st_gid;
+ unsigned short st_rdev;
+#ifdef __i386__
+ unsigned long st_size;
+ unsigned long st_atime;
+ unsigned long st_mtime;
+ unsigned long st_ctime;
+#else
+ unsigned int st_size;
+ unsigned int st_atime;
+ unsigned int st_mtime;
+ unsigned int st_ctime;
+#endif
+};
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/statfs.h b/ndk/platforms/android-5/arch-x86/include/asm/statfs.h
new file mode 100644
index 0000000..592d864
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/statfs.h
@@ -0,0 +1,62 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_X86_STATFS_H
+#define _ASM_X86_STATFS_H
+
+#ifdef __i386__
+#include <asm-generic/statfs.h>
+#else
+
+struct statfs {
+ long f_type;
+ long f_bsize;
+ long f_blocks;
+ long f_bfree;
+ long f_bavail;
+ long f_files;
+ long f_ffree;
+ __kernel_fsid_t f_fsid;
+ long f_namelen;
+ long f_frsize;
+ long f_spare[5];
+};
+
+struct statfs64 {
+ long f_type;
+ long f_bsize;
+ long f_blocks;
+ long f_bfree;
+ long f_bavail;
+ long f_files;
+ long f_ffree;
+ __kernel_fsid_t f_fsid;
+ long f_namelen;
+ long f_frsize;
+ long f_spare[5];
+};
+
+struct compat_statfs64 {
+ __u32 f_type;
+ __u32 f_bsize;
+ __u64 f_blocks;
+ __u64 f_bfree;
+ __u64 f_bavail;
+ __u64 f_files;
+ __u64 f_ffree;
+ __kernel_fsid_t f_fsid;
+ __u32 f_namelen;
+ __u32 f_frsize;
+ __u32 f_spare[5];
+} __attribute__((packed));
+
+#endif
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/string.h b/ndk/platforms/android-5/arch-x86/include/asm/string.h
new file mode 100644
index 0000000..92fa291
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/string.h
@@ -0,0 +1,12 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#include "string_64.h"
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/string_32.h b/ndk/platforms/android-5/arch-x86/include/asm/string_32.h
new file mode 100644
index 0000000..58a72d7
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/string_32.h
@@ -0,0 +1,15 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _I386_STRING_H_
+#define _I386_STRING_H_
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/swiotlb.h b/ndk/platforms/android-5/arch-x86/include/asm/swiotlb.h
new file mode 100644
index 0000000..5ee37b3
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/swiotlb.h
@@ -0,0 +1,19 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_SWIOTLB_H
+#define _ASM_SWIOTLB_H 1
+
+#include <asm/dma-mapping.h>
+
+#define swiotlb 0
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/system.h b/ndk/platforms/android-5/arch-x86/include/asm/system.h
new file mode 100644
index 0000000..834193b
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/system.h
@@ -0,0 +1,12 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#include "system_64.h"
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/system_32.h b/ndk/platforms/android-5/arch-x86/include/asm/system_32.h
new file mode 100644
index 0000000..d799ae6
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/system_32.h
@@ -0,0 +1,33 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __ASM_SYSTEM_H
+#define __ASM_SYSTEM_H
+
+#include <linux/kernel.h>
+#include <asm/segment.h>
+#include <asm/cpufeature.h>
+#include <asm/cmpxchg.h>
+
+#define nop() __asm__ __volatile__ ("nop")
+#define mb() alternative("lock; addl $0,0(%%esp)", "mfence", X86_FEATURE_XMM2)
+#define rmb() alternative("lock; addl $0,0(%%esp)", "lfence", X86_FEATURE_XMM2)
+#define wmb() alternative("lock; addl $0,0(%%esp)", "sfence", X86_FEATURE_XMM)
+#define read_barrier_depends() do { } while(0)
+#define smp_mb() barrier()
+#define smp_rmb() barrier()
+#define smp_wmb() barrier()
+#define smp_read_barrier_depends() do { } while(0)
+#define set_mb(var, value) do { var = value; barrier(); } while (0)
+#include <linux/irqflags.h>
+#define HAVE_DISABLE_HLT
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/termbits.h b/ndk/platforms/android-5/arch-x86/include/asm/termbits.h
new file mode 100644
index 0000000..6d7c5e8
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/termbits.h
@@ -0,0 +1,201 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_X86_TERMBITS_H
+#define _ASM_X86_TERMBITS_H
+
+#include <linux/posix_types.h>
+
+typedef unsigned char cc_t;
+typedef unsigned int speed_t;
+typedef unsigned int tcflag_t;
+
+#define NCCS 19
+struct termios {
+ tcflag_t c_iflag;
+ tcflag_t c_oflag;
+ tcflag_t c_cflag;
+ tcflag_t c_lflag;
+ cc_t c_line;
+ cc_t c_cc[NCCS];
+};
+
+struct termios2 {
+ tcflag_t c_iflag;
+ tcflag_t c_oflag;
+ tcflag_t c_cflag;
+ tcflag_t c_lflag;
+ cc_t c_line;
+ cc_t c_cc[NCCS];
+ speed_t c_ispeed;
+ speed_t c_ospeed;
+};
+
+struct ktermios {
+ tcflag_t c_iflag;
+ tcflag_t c_oflag;
+ tcflag_t c_cflag;
+ tcflag_t c_lflag;
+ cc_t c_line;
+ cc_t c_cc[NCCS];
+ speed_t c_ispeed;
+ speed_t c_ospeed;
+};
+
+#define VINTR 0
+#define VQUIT 1
+#define VERASE 2
+#define VKILL 3
+#define VEOF 4
+#define VTIME 5
+#define VMIN 6
+#define VSWTC 7
+#define VSTART 8
+#define VSTOP 9
+#define VSUSP 10
+#define VEOL 11
+#define VREPRINT 12
+#define VDISCARD 13
+#define VWERASE 14
+#define VLNEXT 15
+#define VEOL2 16
+
+#define IGNBRK 0000001
+#define BRKINT 0000002
+#define IGNPAR 0000004
+#define PARMRK 0000010
+#define INPCK 0000020
+#define ISTRIP 0000040
+#define INLCR 0000100
+#define IGNCR 0000200
+#define ICRNL 0000400
+#define IUCLC 0001000
+#define IXON 0002000
+#define IXANY 0004000
+#define IXOFF 0010000
+#define IMAXBEL 0020000
+#define IUTF8 0040000
+
+#define OPOST 0000001
+#define OLCUC 0000002
+#define ONLCR 0000004
+#define OCRNL 0000010
+#define ONOCR 0000020
+#define ONLRET 0000040
+#define OFILL 0000100
+#define OFDEL 0000200
+#define NLDLY 0000400
+#define NL0 0000000
+#define NL1 0000400
+#define CRDLY 0003000
+#define CR0 0000000
+#define CR1 0001000
+#define CR2 0002000
+#define CR3 0003000
+#define TABDLY 0014000
+#define TAB0 0000000
+#define TAB1 0004000
+#define TAB2 0010000
+#define TAB3 0014000
+#define XTABS 0014000
+#define BSDLY 0020000
+#define BS0 0000000
+#define BS1 0020000
+#define VTDLY 0040000
+#define VT0 0000000
+#define VT1 0040000
+#define FFDLY 0100000
+#define FF0 0000000
+#define FF1 0100000
+
+#define CBAUD 0010017
+#define B0 0000000  
+#define B50 0000001
+#define B75 0000002
+#define B110 0000003
+#define B134 0000004
+#define B150 0000005
+#define B200 0000006
+#define B300 0000007
+#define B600 0000010
+#define B1200 0000011
+#define B1800 0000012
+#define B2400 0000013
+#define B4800 0000014
+#define B9600 0000015
+#define B19200 0000016
+#define B38400 0000017
+#define EXTA B19200
+#define EXTB B38400
+#define CSIZE 0000060
+#define CS5 0000000
+#define CS6 0000020
+#define CS7 0000040
+#define CS8 0000060
+#define CSTOPB 0000100
+#define CREAD 0000200
+#define PARENB 0000400
+#define PARODD 0001000
+#define HUPCL 0002000
+#define CLOCAL 0004000
+#define CBAUDEX 0010000
+#define BOTHER 0010000  
+#define B57600 0010001
+#define B115200 0010002
+#define B230400 0010003
+#define B460800 0010004
+#define B500000 0010005
+#define B576000 0010006
+#define B921600 0010007
+#define B1000000 0010010
+#define B1152000 0010011
+#define B1500000 0010012
+#define B2000000 0010013
+#define B2500000 0010014
+#define B3000000 0010015
+#define B3500000 0010016
+#define B4000000 0010017
+#define CIBAUD 002003600000  
+#define CMSPAR 010000000000  
+#define CRTSCTS 020000000000  
+
+#define IBSHIFT 16  
+
+#define ISIG 0000001
+#define ICANON 0000002
+#define XCASE 0000004
+#define ECHO 0000010
+#define ECHOE 0000020
+#define ECHOK 0000040
+#define ECHONL 0000100
+#define NOFLSH 0000200
+#define TOSTOP 0000400
+#define ECHOCTL 0001000
+#define ECHOPRT 0002000
+#define ECHOKE 0004000
+#define FLUSHO 0010000
+#define PENDIN 0040000
+#define IEXTEN 0100000
+
+#define TCOOFF 0
+#define TCOON 1
+#define TCIOFF 2
+#define TCION 3
+
+#define TCIFLUSH 0
+#define TCOFLUSH 1
+#define TCIOFLUSH 2
+
+#define TCSANOW 0
+#define TCSADRAIN 1
+#define TCSAFLUSH 2
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/termios.h b/ndk/platforms/android-5/arch-x86/include/asm/termios.h
new file mode 100644
index 0000000..01bdca4
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/termios.h
@@ -0,0 +1,67 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_X86_TERMIOS_H
+#define _ASM_X86_TERMIOS_H
+
+#include <asm/termbits.h>
+#include <asm/ioctls.h>
+
+struct winsize {
+ unsigned short ws_row;
+ unsigned short ws_col;
+ unsigned short ws_xpixel;
+ unsigned short ws_ypixel;
+};
+
+#define NCC 8
+struct termio {
+ unsigned short c_iflag;
+ unsigned short c_oflag;
+ unsigned short c_cflag;
+ unsigned short c_lflag;
+ unsigned char c_line;
+ unsigned char c_cc[NCC];
+};
+
+#define TIOCM_LE 0x001
+#define TIOCM_DTR 0x002
+#define TIOCM_RTS 0x004
+#define TIOCM_ST 0x008
+#define TIOCM_SR 0x010
+#define TIOCM_CTS 0x020
+#define TIOCM_CAR 0x040
+#define TIOCM_RNG 0x080
+#define TIOCM_DSR 0x100
+#define TIOCM_CD TIOCM_CAR
+#define TIOCM_RI TIOCM_RNG
+#define TIOCM_OUT1 0x2000
+#define TIOCM_OUT2 0x4000
+#define TIOCM_LOOP 0x8000
+
+#define N_TTY 0
+#define N_SLIP 1
+#define N_MOUSE 2
+#define N_PPP 3
+#define N_STRIP 4
+#define N_AX25 5
+#define N_X25 6
+#define N_6PACK 7
+#define N_MASC 8
+#define N_R3964 9
+#define N_PROFIBUS_FDL 10
+#define N_IRDA 11
+#define N_SMSBLOCK 12
+#define N_HDLC 13
+#define N_SYNC_PPP 14
+#define N_HCI 15
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/thread_info.h b/ndk/platforms/android-5/arch-x86/include/asm/thread_info.h
new file mode 100644
index 0000000..ff46b08
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/thread_info.h
@@ -0,0 +1,12 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#include "thread_info_64.h"
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/thread_info_32.h b/ndk/platforms/android-5/arch-x86/include/asm/thread_info_32.h
new file mode 100644
index 0000000..5664ef8
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/thread_info_32.h
@@ -0,0 +1,15 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_THREAD_INFO_H
+#define _ASM_THREAD_INFO_H
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/tlbflush.h b/ndk/platforms/android-5/arch-x86/include/asm/tlbflush.h
new file mode 100644
index 0000000..fd6b226
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/tlbflush.h
@@ -0,0 +1,12 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#include "tlbflush_64.h"
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/tlbflush_32.h b/ndk/platforms/android-5/arch-x86/include/asm/tlbflush_32.h
new file mode 100644
index 0000000..8ebff80
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/tlbflush_32.h
@@ -0,0 +1,43 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _I386_TLBFLUSH_H
+#define _I386_TLBFLUSH_H
+
+#include <linux/mm.h>
+#include <asm/processor.h>
+
+#define __flush_tlb() __native_flush_tlb()
+#define __flush_tlb_global() __native_flush_tlb_global()
+#define __flush_tlb_single(addr) __native_flush_tlb_single(addr)
+
+#define __native_flush_tlb()   do {   unsigned int tmpreg;     __asm__ __volatile__(   "movl %%cr3, %0;              \n"   "movl %0, %%cr3;  # flush TLB \n"   : "=r" (tmpreg)   :: "memory");   } while (0)
+
+#define __native_flush_tlb_global()   do {   unsigned int tmpreg, cr4, cr4_orig;     __asm__ __volatile__(   "movl %%cr4, %2;  # turn off PGE     \n"   "movl %2, %1;                        \n"   "andl %3, %1;                        \n"   "movl %1, %%cr4;                     \n"   "movl %%cr3, %0;                     \n"   "movl %0, %%cr3;  # flush TLB        \n"   "movl %2, %%cr4;  # turn PGE back on \n"   : "=&r" (tmpreg), "=&r" (cr4), "=&r" (cr4_orig)   : "i" (~X86_CR4_PGE)   : "memory");   } while (0)
+
+#define __native_flush_tlb_single(addr)   __asm__ __volatile__("invlpg (%0)" ::"r" (addr) : "memory")
+
+#define __flush_tlb_all()   do {   if (cpu_has_pge)   __flush_tlb_global();   else   __flush_tlb();   } while (0)
+
+#define cpu_has_invlpg (boot_cpu_data.x86 > 3)
+
+#define __flush_tlb_one(addr)   do {   if (cpu_has_invlpg)   __flush_tlb_single(addr);   else   __flush_tlb();   } while (0)
+
+#define TLB_FLUSH_ALL 0xffffffff
+
+#include <linux/sched.h>
+
+#define flush_tlb() __flush_tlb()
+#define flush_tlb_all() __flush_tlb_all()
+#define local_flush_tlb() __flush_tlb()
+
+#define flush_tlb_others(mask, mm, va)   native_flush_tlb_others(&mask, mm, va)
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/tsc.h b/ndk/platforms/android-5/arch-x86/include/asm/tsc.h
new file mode 100644
index 0000000..2528cd1
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/tsc.h
@@ -0,0 +1,22 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_X86_TSC_H
+#define _ASM_X86_TSC_H
+
+#include <asm/processor.h>
+
+#define NS_SCALE 10  
+#define US_SCALE 32  
+
+typedef unsigned long long cycles_t;
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/types.h b/ndk/platforms/android-5/arch-x86/include/asm/types.h
new file mode 100644
index 0000000..4af92b0
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/types.h
@@ -0,0 +1,40 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_X86_TYPES_H
+#define _ASM_X86_TYPES_H
+
+#ifndef __ASSEMBLY__
+
+typedef unsigned short umode_t;
+
+typedef __signed__ char __s8;
+typedef unsigned char __u8;
+
+typedef __signed__ short __s16;
+typedef unsigned short __u16;
+
+typedef __signed__ int __s32;
+typedef unsigned int __u32;
+
+#ifdef __i386__
+#ifdef __GNUC__
+__extension__ typedef __signed__ long long __s64;
+__extension__ typedef unsigned long long __u64;
+#endif
+#else
+typedef __signed__ long long __s64;
+typedef unsigned long long __u64;
+#endif
+
+#endif
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/uaccess.h b/ndk/platforms/android-5/arch-x86/include/asm/uaccess.h
new file mode 100644
index 0000000..b2bec69
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/uaccess.h
@@ -0,0 +1,12 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#include "uaccess_64.h"
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/uaccess_32.h b/ndk/platforms/android-5/arch-x86/include/asm/uaccess_32.h
new file mode 100644
index 0000000..9827fc4
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/uaccess_32.h
@@ -0,0 +1,83 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __i386_UACCESS_H
+#define __i386_UACCESS_H
+
+#include <linux/errno.h>
+#include <linux/thread_info.h>
+#include <linux/prefetch.h>
+#include <linux/string.h>
+#include <asm/page.h>
+
+#define VERIFY_READ 0
+#define VERIFY_WRITE 1
+
+#define MAKE_MM_SEG(s) ((mm_segment_t) { (s) })
+
+#define KERNEL_DS MAKE_MM_SEG(0xFFFFFFFFUL)
+#define USER_DS MAKE_MM_SEG(PAGE_OFFSET)
+
+#define get_ds() (KERNEL_DS)
+#define get_fs() (current_thread_info()->addr_limit)
+#define set_fs(x) (current_thread_info()->addr_limit = (x))
+
+#define segment_eq(a,b) ((a).seg == (b).seg)
+
+#define __addr_ok(addr) ((unsigned long __force)(addr) < (current_thread_info()->addr_limit.seg))
+
+#define __range_ok(addr,size) ({   unsigned long flag,roksum;   __chk_user_ptr(addr);   asm("addl %3,%1 ; sbbl %0,%0; cmpl %1,%4; sbbl $0,%0"   :"=&r" (flag), "=r" (roksum)   :"1" (addr),"g" ((int)(size)),"rm" (current_thread_info()->addr_limit.seg));   flag; })
+
+#define access_ok(type,addr,size) (likely(__range_ok(addr,size) == 0))
+
+struct exception_table_entry
+{
+ unsigned long insn, fixup;
+};
+
+#define __get_user_x(size,ret,x,ptr)   __asm__ __volatile__("call __get_user_" #size   :"=a" (ret),"=d" (x)   :"0" (ptr))
+
+#define get_user(x,ptr)  ({ int __ret_gu;   unsigned long __val_gu;   __chk_user_ptr(ptr);   switch(sizeof (*(ptr))) {   case 1: __get_user_x(1,__ret_gu,__val_gu,ptr); break;   case 2: __get_user_x(2,__ret_gu,__val_gu,ptr); break;   case 4: __get_user_x(4,__ret_gu,__val_gu,ptr); break;   default: __get_user_x(X,__ret_gu,__val_gu,ptr); break;   }   (x) = (__typeof__(*(ptr)))__val_gu;   __ret_gu;  })
+
+#define __put_user_1(x, ptr) __asm__ __volatile__("call __put_user_1":"=a" (__ret_pu):"0" ((typeof(*(ptr)))(x)), "c" (ptr))
+#define __put_user_2(x, ptr) __asm__ __volatile__("call __put_user_2":"=a" (__ret_pu):"0" ((typeof(*(ptr)))(x)), "c" (ptr))
+#define __put_user_4(x, ptr) __asm__ __volatile__("call __put_user_4":"=a" (__ret_pu):"0" ((typeof(*(ptr)))(x)), "c" (ptr))
+#define __put_user_8(x, ptr) __asm__ __volatile__("call __put_user_8":"=a" (__ret_pu):"A" ((typeof(*(ptr)))(x)), "c" (ptr))
+#define __put_user_X(x, ptr) __asm__ __volatile__("call __put_user_X":"=a" (__ret_pu):"c" (ptr))
+
+#define put_user(x,ptr)  ({   int __ret_pu;   __typeof__(*(ptr)) __pus_tmp = x;   __ret_pu=0;   if(unlikely(__copy_to_user_ll(ptr, &__pus_tmp,   sizeof(*(ptr))) != 0))   __ret_pu=-EFAULT;   __ret_pu;   })
+
+#define __get_user(x,ptr)   __get_user_nocheck((x),(ptr),sizeof(*(ptr)))
+
+#define __put_user(x,ptr)   __put_user_nocheck((__typeof__(*(ptr)))(x),(ptr),sizeof(*(ptr)))
+
+#define __put_user_nocheck(x,ptr,size)  ({   long __pu_err;   __put_user_size((x),(ptr),(size),__pu_err,-EFAULT);   __pu_err;  })
+
+#define __put_user_u64(x, addr, err)   __asm__ __volatile__(   "1:	movl %%eax,0(%2)\n"   "2:	movl %%edx,4(%2)\n"   "3:\n"   ".section .fixup,\"ax\"\n"   "4:	movl %3,%0\n"   "	jmp 3b\n"   ".previous\n"   ".section __ex_table,\"a\"\n"   "	.align 4\n"   "	.long 1b,4b\n"   "	.long 2b,4b\n"   ".previous"   : "=r"(err)   : "A" (x), "r" (addr), "i"(-EFAULT), "0"(err))
+
+#define __put_user_size(x,ptr,size,retval,errret)  do {   __typeof__(*(ptr)) __pus_tmp = x;   retval = 0;     if(unlikely(__copy_to_user_ll(ptr, &__pus_tmp, size) != 0))   retval = errret;  } while (0)
+
+struct __large_struct { unsigned long buf[100]; };
+#define __m(x) (*(struct __large_struct __user *)(x))
+
+#define __put_user_asm(x, addr, err, itype, rtype, ltype, errret)   __asm__ __volatile__(   "1:	mov"itype" %"rtype"1,%2\n"   "2:\n"   ".section .fixup,\"ax\"\n"   "3:	movl %3,%0\n"   "	jmp 2b\n"   ".previous\n"   ".section __ex_table,\"a\"\n"   "	.align 4\n"   "	.long 1b,3b\n"   ".previous"   : "=r"(err)   : ltype (x), "m"(__m(addr)), "i"(errret), "0"(err))
+
+#define __get_user_nocheck(x,ptr,size)  ({   long __gu_err;   unsigned long __gu_val;   __get_user_size(__gu_val,(ptr),(size),__gu_err,-EFAULT);  (x) = (__typeof__(*(ptr)))__gu_val;   __gu_err;  })
+
+#define __get_user_size(x,ptr,size,retval,errret)  do {   retval = 0;   __chk_user_ptr(ptr);   switch (size) {   case 1: __get_user_asm(x,ptr,retval,"b","b","=q",errret);break;   case 2: __get_user_asm(x,ptr,retval,"w","w","=r",errret);break;   case 4: __get_user_asm(x,ptr,retval,"l","","=r",errret);break;   default: (x) = __get_user_bad();   }  } while (0)
+
+#define __get_user_asm(x, addr, err, itype, rtype, ltype, errret)   __asm__ __volatile__(   "1:	mov"itype" %2,%"rtype"1\n"   "2:\n"   ".section .fixup,\"ax\"\n"   "3:	movl %3,%0\n"   "	xor"itype" %"rtype"1,%"rtype"1\n"   "	jmp 2b\n"   ".previous\n"   ".section __ex_table,\"a\"\n"   "	.align 4\n"   "	.long 1b,3b\n"   ".previous"   : "=r"(err), ltype (x)   : "m"(__m(addr)), "i"(errret), "0"(err))
+
+#define ARCH_HAS_NOCACHE_UACCESS
+
+#define strlen_user(str) strnlen_user(str, LONG_MAX)
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/unaligned.h b/ndk/platforms/android-5/arch-x86/include/asm/unaligned.h
new file mode 100644
index 0000000..ce7a8a7
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/unaligned.h
@@ -0,0 +1,19 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_X86_UNALIGNED_H
+#define _ASM_X86_UNALIGNED_H
+
+#define get_unaligned(ptr) (*(ptr))
+
+#define put_unaligned(val, ptr) ((void)( *(ptr) = (val) ))
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/unistd.h b/ndk/platforms/android-5/arch-x86/include/asm/unistd.h
new file mode 100644
index 0000000..769f836
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/unistd.h
@@ -0,0 +1,16 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifdef __i386__
+#include "unistd_32.h"
+#else
+#include "unistd_64.h"
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/unistd_32.h b/ndk/platforms/android-5/arch-x86/include/asm/unistd_32.h
new file mode 100644
index 0000000..b3d8b19
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/unistd_32.h
@@ -0,0 +1,341 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_I386_UNISTD_H_
+#define _ASM_I386_UNISTD_H_
+
+#define __NR_restart_syscall 0
+#define __NR_exit 1
+#define __NR_fork 2
+#define __NR_read 3
+#define __NR_write 4
+#define __NR_open 5
+#define __NR_close 6
+#define __NR_waitpid 7
+#define __NR_creat 8
+#define __NR_link 9
+#define __NR_unlink 10
+#define __NR_execve 11
+#define __NR_chdir 12
+#define __NR_time 13
+#define __NR_mknod 14
+#define __NR_chmod 15
+#define __NR_lchown 16
+#define __NR_break 17
+#define __NR_oldstat 18
+#define __NR_lseek 19
+#define __NR_getpid 20
+#define __NR_mount 21
+#define __NR_umount 22
+#define __NR_setuid 23
+#define __NR_getuid 24
+#define __NR_stime 25
+#define __NR_ptrace 26
+#define __NR_alarm 27
+#define __NR_oldfstat 28
+#define __NR_pause 29
+#define __NR_utime 30
+#define __NR_stty 31
+#define __NR_gtty 32
+#define __NR_access 33
+#define __NR_nice 34
+#define __NR_ftime 35
+#define __NR_sync 36
+#define __NR_kill 37
+#define __NR_rename 38
+#define __NR_mkdir 39
+#define __NR_rmdir 40
+#define __NR_dup 41
+#define __NR_pipe 42
+#define __NR_times 43
+#define __NR_prof 44
+#define __NR_brk 45
+#define __NR_setgid 46
+#define __NR_getgid 47
+#define __NR_signal 48
+#define __NR_geteuid 49
+#define __NR_getegid 50
+#define __NR_acct 51
+#define __NR_umount2 52
+#define __NR_lock 53
+#define __NR_ioctl 54
+#define __NR_fcntl 55
+#define __NR_mpx 56
+#define __NR_setpgid 57
+#define __NR_ulimit 58
+#define __NR_oldolduname 59
+#define __NR_umask 60
+#define __NR_chroot 61
+#define __NR_ustat 62
+#define __NR_dup2 63
+#define __NR_getppid 64
+#define __NR_getpgrp 65
+#define __NR_setsid 66
+#define __NR_sigaction 67
+#define __NR_sgetmask 68
+#define __NR_ssetmask 69
+#define __NR_setreuid 70
+#define __NR_setregid 71
+#define __NR_sigsuspend 72
+#define __NR_sigpending 73
+#define __NR_sethostname 74
+#define __NR_setrlimit 75
+#define __NR_getrlimit 76  
+#define __NR_getrusage 77
+#define __NR_gettimeofday 78
+#define __NR_settimeofday 79
+#define __NR_getgroups 80
+#define __NR_setgroups 81
+#define __NR_select 82
+#define __NR_symlink 83
+#define __NR_oldlstat 84
+#define __NR_readlink 85
+#define __NR_uselib 86
+#define __NR_swapon 87
+#define __NR_reboot 88
+#define __NR_readdir 89
+#define __NR_mmap 90
+#define __NR_munmap 91
+#define __NR_truncate 92
+#define __NR_ftruncate 93
+#define __NR_fchmod 94
+#define __NR_fchown 95
+#define __NR_getpriority 96
+#define __NR_setpriority 97
+#define __NR_profil 98
+#define __NR_statfs 99
+#define __NR_fstatfs 100
+#define __NR_ioperm 101
+#define __NR_socketcall 102
+#define __NR_syslog 103
+#define __NR_setitimer 104
+#define __NR_getitimer 105
+#define __NR_stat 106
+#define __NR_lstat 107
+#define __NR_fstat 108
+#define __NR_olduname 109
+#define __NR_iopl 110
+#define __NR_vhangup 111
+#define __NR_idle 112
+#define __NR_vm86old 113
+#define __NR_wait4 114
+#define __NR_swapoff 115
+#define __NR_sysinfo 116
+#define __NR_ipc 117
+#define __NR_fsync 118
+#define __NR_sigreturn 119
+#define __NR_clone 120
+#define __NR_setdomainname 121
+#define __NR_uname 122
+#define __NR_modify_ldt 123
+#define __NR_adjtimex 124
+#define __NR_mprotect 125
+#define __NR_sigprocmask 126
+#define __NR_create_module 127
+#define __NR_init_module 128
+#define __NR_delete_module 129
+#define __NR_get_kernel_syms 130
+#define __NR_quotactl 131
+#define __NR_getpgid 132
+#define __NR_fchdir 133
+#define __NR_bdflush 134
+#define __NR_sysfs 135
+#define __NR_personality 136
+#define __NR_afs_syscall 137  
+#define __NR_setfsuid 138
+#define __NR_setfsgid 139
+#define __NR__llseek 140
+#define __NR_getdents 141
+#define __NR__newselect 142
+#define __NR_flock 143
+#define __NR_msync 144
+#define __NR_readv 145
+#define __NR_writev 146
+#define __NR_getsid 147
+#define __NR_fdatasync 148
+#define __NR__sysctl 149
+#define __NR_mlock 150
+#define __NR_munlock 151
+#define __NR_mlockall 152
+#define __NR_munlockall 153
+#define __NR_sched_setparam 154
+#define __NR_sched_getparam 155
+#define __NR_sched_setscheduler 156
+#define __NR_sched_getscheduler 157
+#define __NR_sched_yield 158
+#define __NR_sched_get_priority_max 159
+#define __NR_sched_get_priority_min 160
+#define __NR_sched_rr_get_interval 161
+#define __NR_nanosleep 162
+#define __NR_mremap 163
+#define __NR_setresuid 164
+#define __NR_getresuid 165
+#define __NR_vm86 166
+#define __NR_query_module 167
+#define __NR_poll 168
+#define __NR_nfsservctl 169
+#define __NR_setresgid 170
+#define __NR_getresgid 171
+#define __NR_prctl 172
+#define __NR_rt_sigreturn 173
+#define __NR_rt_sigaction 174
+#define __NR_rt_sigprocmask 175
+#define __NR_rt_sigpending 176
+#define __NR_rt_sigtimedwait 177
+#define __NR_rt_sigqueueinfo 178
+#define __NR_rt_sigsuspend 179
+#define __NR_pread64 180
+#define __NR_pwrite64 181
+#define __NR_chown 182
+#define __NR_getcwd 183
+#define __NR_capget 184
+#define __NR_capset 185
+#define __NR_sigaltstack 186
+#define __NR_sendfile 187
+#define __NR_getpmsg 188  
+#define __NR_putpmsg 189  
+#define __NR_vfork 190
+#define __NR_ugetrlimit 191  
+#define __NR_mmap2 192
+#define __NR_truncate64 193
+#define __NR_ftruncate64 194
+#define __NR_stat64 195
+#define __NR_lstat64 196
+#define __NR_fstat64 197
+#define __NR_lchown32 198
+#define __NR_getuid32 199
+#define __NR_getgid32 200
+#define __NR_geteuid32 201
+#define __NR_getegid32 202
+#define __NR_setreuid32 203
+#define __NR_setregid32 204
+#define __NR_getgroups32 205
+#define __NR_setgroups32 206
+#define __NR_fchown32 207
+#define __NR_setresuid32 208
+#define __NR_getresuid32 209
+#define __NR_setresgid32 210
+#define __NR_getresgid32 211
+#define __NR_chown32 212
+#define __NR_setuid32 213
+#define __NR_setgid32 214
+#define __NR_setfsuid32 215
+#define __NR_setfsgid32 216
+#define __NR_pivot_root 217
+#define __NR_mincore 218
+#define __NR_madvise 219
+#define __NR_madvise1 219  
+#define __NR_getdents64 220
+#define __NR_fcntl64 221
+
+#define __NR_gettid 224
+#define __NR_readahead 225
+#define __NR_setxattr 226
+#define __NR_lsetxattr 227
+#define __NR_fsetxattr 228
+#define __NR_getxattr 229
+#define __NR_lgetxattr 230
+#define __NR_fgetxattr 231
+#define __NR_listxattr 232
+#define __NR_llistxattr 233
+#define __NR_flistxattr 234
+#define __NR_removexattr 235
+#define __NR_lremovexattr 236
+#define __NR_fremovexattr 237
+#define __NR_tkill 238
+#define __NR_sendfile64 239
+#define __NR_futex 240
+#define __NR_sched_setaffinity 241
+#define __NR_sched_getaffinity 242
+#define __NR_set_thread_area 243
+#define __NR_get_thread_area 244
+#define __NR_io_setup 245
+#define __NR_io_destroy 246
+#define __NR_io_getevents 247
+#define __NR_io_submit 248
+#define __NR_io_cancel 249
+#define __NR_fadvise64 250
+
+#define __NR_exit_group 252
+#define __NR_lookup_dcookie 253
+#define __NR_epoll_create 254
+#define __NR_epoll_ctl 255
+#define __NR_epoll_wait 256
+#define __NR_remap_file_pages 257
+#define __NR_set_tid_address 258
+#define __NR_timer_create 259
+#define __NR_timer_settime (__NR_timer_create+1)
+#define __NR_timer_gettime (__NR_timer_create+2)
+#define __NR_timer_getoverrun (__NR_timer_create+3)
+#define __NR_timer_delete (__NR_timer_create+4)
+#define __NR_clock_settime (__NR_timer_create+5)
+#define __NR_clock_gettime (__NR_timer_create+6)
+#define __NR_clock_getres (__NR_timer_create+7)
+#define __NR_clock_nanosleep (__NR_timer_create+8)
+#define __NR_statfs64 268
+#define __NR_fstatfs64 269
+#define __NR_tgkill 270
+#define __NR_utimes 271
+#define __NR_fadvise64_64 272
+#define __NR_vserver 273
+#define __NR_mbind 274
+#define __NR_get_mempolicy 275
+#define __NR_set_mempolicy 276
+#define __NR_mq_open 277
+#define __NR_mq_unlink (__NR_mq_open+1)
+#define __NR_mq_timedsend (__NR_mq_open+2)
+#define __NR_mq_timedreceive (__NR_mq_open+3)
+#define __NR_mq_notify (__NR_mq_open+4)
+#define __NR_mq_getsetattr (__NR_mq_open+5)
+#define __NR_kexec_load 283
+#define __NR_waitid 284
+
+#define __NR_add_key 286
+#define __NR_request_key 287
+#define __NR_keyctl 288
+#define __NR_ioprio_set 289
+#define __NR_ioprio_get 290
+#define __NR_inotify_init 291
+#define __NR_inotify_add_watch 292
+#define __NR_inotify_rm_watch 293
+#define __NR_migrate_pages 294
+#define __NR_openat 295
+#define __NR_mkdirat 296
+#define __NR_mknodat 297
+#define __NR_fchownat 298
+#define __NR_futimesat 299
+#define __NR_fstatat64 300
+#define __NR_unlinkat 301
+#define __NR_renameat 302
+#define __NR_linkat 303
+#define __NR_symlinkat 304
+#define __NR_readlinkat 305
+#define __NR_fchmodat 306
+#define __NR_faccessat 307
+#define __NR_pselect6 308
+#define __NR_ppoll 309
+#define __NR_unshare 310
+#define __NR_set_robust_list 311
+#define __NR_get_robust_list 312
+#define __NR_splice 313
+#define __NR_sync_file_range 314
+#define __NR_tee 315
+#define __NR_vmsplice 316
+#define __NR_move_pages 317
+#define __NR_getcpu 318
+#define __NR_epoll_pwait 319
+#define __NR_utimensat 320
+#define __NR_signalfd 321
+#define __NR_timerfd 322
+#define __NR_eventfd 323
+#define __NR_fallocate 324
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/user.h b/ndk/platforms/android-5/arch-x86/include/asm/user.h
new file mode 100644
index 0000000..980b0aa
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/user.h
@@ -0,0 +1,16 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifdef __i386__
+#include "user_32.h"
+#else
+#include "user_64.h"
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/user32.h b/ndk/platforms/android-5/arch-x86/include/asm/user32.h
new file mode 100644
index 0000000..89eabb1
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/user32.h
@@ -0,0 +1,73 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef USER32_H
+#define USER32_H 1
+
+struct user_i387_ia32_struct {
+ u32 cwd;
+ u32 swd;
+ u32 twd;
+ u32 fip;
+ u32 fcs;
+ u32 foo;
+ u32 fos;
+ u32 st_space[20];
+};
+
+struct user32_fxsr_struct {
+ unsigned short cwd;
+ unsigned short swd;
+ unsigned short twd;
+ unsigned short fop;
+ int fip;
+ int fcs;
+ int foo;
+ int fos;
+ int mxcsr;
+ int reserved;
+ int st_space[32];
+ int xmm_space[32];
+ int padding[56];
+};
+
+struct user_regs_struct32 {
+ __u32 ebx, ecx, edx, esi, edi, ebp, eax;
+ unsigned short ds, __ds, es, __es;
+ unsigned short fs, __fs, gs, __gs;
+ __u32 orig_eax, eip;
+ unsigned short cs, __cs;
+ __u32 eflags, esp;
+ unsigned short ss, __ss;
+};
+
+struct user32 {
+ struct user_regs_struct32 regs;
+ int u_fpvalid;
+
+ struct user_i387_ia32_struct i387;
+
+ __u32 u_tsize;
+ __u32 u_dsize;
+ __u32 u_ssize;
+ __u32 start_code;
+ __u32 start_stack;
+ __u32 signal;
+ int reserved;
+ __u32 u_ar0;
+
+ __u32 u_fpstate;
+ __u32 magic;
+ char u_comm[32];
+ int u_debugreg[8];
+};
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/user_32.h b/ndk/platforms/android-5/arch-x86/include/asm/user_32.h
new file mode 100644
index 0000000..8e0296c
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/user_32.h
@@ -0,0 +1,81 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _I386_USER_H
+#define _I386_USER_H
+
+#include <asm/page.h>
+
+struct user_i387_struct {
+ long cwd;
+ long swd;
+ long twd;
+ long fip;
+ long fcs;
+ long foo;
+ long fos;
+ long st_space[20];
+};
+
+struct user_fxsr_struct {
+ unsigned short cwd;
+ unsigned short swd;
+ unsigned short twd;
+ unsigned short fop;
+ long fip;
+ long fcs;
+ long foo;
+ long fos;
+ long mxcsr;
+ long reserved;
+ long st_space[32];
+ long xmm_space[32];
+ long padding[56];
+};
+
+struct user_regs_struct {
+ long ebx, ecx, edx, esi, edi, ebp, eax;
+ unsigned short ds, __ds, es, __es;
+ unsigned short fs, __fs, gs, __gs;
+ long orig_eax, eip;
+ unsigned short cs, __cs;
+ long eflags, esp;
+ unsigned short ss, __ss;
+};
+
+struct user{
+
+ struct user_regs_struct regs;
+
+ int u_fpvalid;
+
+ struct user_i387_struct i387;
+
+ unsigned long int u_tsize;
+ unsigned long int u_dsize;
+ unsigned long int u_ssize;
+ unsigned long start_code;
+ unsigned long start_stack;
+ long int signal;
+ int reserved;
+ struct user_pt_regs * u_ar0;
+
+ struct user_i387_struct* u_fpstate;
+ unsigned long magic;
+ char u_comm[32];
+ int u_debugreg[8];
+};
+#define NBPG PAGE_SIZE
+#define UPAGES 1
+#define HOST_TEXT_START_ADDR (u.start_code)
+#define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG)
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/vm86.h b/ndk/platforms/android-5/arch-x86/include/asm/vm86.h
new file mode 100644
index 0000000..d0e71f1
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/vm86.h
@@ -0,0 +1,113 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _LINUX_VM86_H
+#define _LINUX_VM86_H
+
+#define TF_MASK 0x00000100
+#define IF_MASK 0x00000200
+#define IOPL_MASK 0x00003000
+#define NT_MASK 0x00004000
+#define VM_MASK 0  
+#define AC_MASK 0x00040000
+#define VIF_MASK 0x00080000  
+#define VIP_MASK 0x00100000  
+#define ID_MASK 0x00200000
+
+#define BIOSSEG 0x0f000
+
+#define CPU_086 0
+#define CPU_186 1
+#define CPU_286 2
+#define CPU_386 3
+#define CPU_486 4
+#define CPU_586 5
+
+#define VM86_TYPE(retval) ((retval) & 0xff)
+#define VM86_ARG(retval) ((retval) >> 8)
+
+#define VM86_SIGNAL 0  
+#define VM86_UNKNOWN 1  
+#define VM86_INTx 2  
+#define VM86_STI 3  
+
+#define VM86_PICRETURN 4  
+#define VM86_TRAP 6  
+
+#define VM86_PLUS_INSTALL_CHECK 0
+#define VM86_ENTER 1
+#define VM86_ENTER_NO_BYPASS 2
+#define VM86_REQUEST_IRQ 3
+#define VM86_FREE_IRQ 4
+#define VM86_GET_IRQ_BITS 5
+#define VM86_GET_AND_RESET_IRQ 6
+
+struct vm86_regs {
+
+ long ebx;
+ long ecx;
+ long edx;
+ long esi;
+ long edi;
+ long ebp;
+ long eax;
+ long __null_ds;
+ long __null_es;
+ long __null_fs;
+ long __null_gs;
+ long orig_eax;
+ long eip;
+ unsigned short cs, __csh;
+ long eflags;
+ long esp;
+ unsigned short ss, __ssh;
+
+ unsigned short es, __esh;
+ unsigned short ds, __dsh;
+ unsigned short fs, __fsh;
+ unsigned short gs, __gsh;
+};
+
+struct revectored_struct {
+ unsigned long __map[8];
+};
+
+struct vm86_struct {
+ struct vm86_regs regs;
+ unsigned long flags;
+ unsigned long screen_bitmap;
+ unsigned long cpu_type;
+ struct revectored_struct int_revectored;
+ struct revectored_struct int21_revectored;
+};
+
+#define VM86_SCREEN_BITMAP 0x0001
+
+struct vm86plus_info_struct {
+ unsigned long force_return_for_pic:1;
+ unsigned long vm86dbg_active:1;
+ unsigned long vm86dbg_TFpendig:1;
+ unsigned long unused:28;
+ unsigned long is_vm86pus:1;
+ unsigned char vm86dbg_intxxtab[32];
+};
+
+struct vm86plus_struct {
+ struct vm86_regs regs;
+ unsigned long flags;
+ unsigned long screen_bitmap;
+ unsigned long cpu_type;
+ struct revectored_struct int_revectored;
+ struct revectored_struct int21_revectored;
+ struct vm86plus_info_struct vm86plus;
+};
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/voyager.h b/ndk/platforms/android-5/arch-x86/include/asm/voyager.h
new file mode 100644
index 0000000..c6f50a9
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/voyager.h
@@ -0,0 +1,437 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#undef VOYAGER_DEBUG
+#undef VOYAGER_CAT_DEBUG
+
+#ifdef VOYAGER_DEBUG
+#define VDEBUG(x) printk x
+#else
+#define VDEBUG(x)
+#endif
+
+#define VOYAGER_LEVEL5_AND_ABOVE 0x3435
+#define VOYAGER_LEVEL4 0x3360
+
+#define VOYAGER_DINO 0x43
+
+#define VOYAGER_MC_SETUP 0x96
+
+#define VOYAGER_CAT_CONFIG_PORT 0x97
+#define VOYAGER_CAT_DESELECT 0xff
+#define VOYAGER_SSPB_RELOCATION_PORT 0x98
+
+#define VOYAGER_CAT_IRCYC 0x01
+
+#define VOYAGER_CAT_DRCYC 0x02
+
+#define VOYAGER_CAT_RUN 0x0F
+
+#define VOYAGER_CAT_END 0x80
+
+#define VOYAGER_CAT_HOLD 0x90
+
+#define VOYAGER_CAT_STEP 0xE0
+
+#define VOYAGER_CAT_CLEMSON 0xFF
+
+#define VOYAGER_CAT_HEADER 0x7F
+
+#define VOYAGER_MIN_MODULE 0x10
+#define VOYAGER_MAX_MODULE 0x1f
+
+#define VOYAGER_ASIC_ID_REG 0x00
+#define VOYAGER_ASIC_TYPE_REG 0x01
+
+#define VOYAGER_AUTO_INC_REG 0x02
+#define VOYAGER_AUTO_INC 0x04
+#define VOYAGER_NO_AUTO_INC 0xfb
+#define VOYAGER_SUBADDRDATA 0x03
+#define VOYAGER_SCANPATH 0x05
+#define VOYAGER_CONNECT_ASIC 0x01
+#define VOYAGER_DISCONNECT_ASIC 0xfe
+#define VOYAGER_SUBADDRLO 0x06
+#define VOYAGER_SUBADDRHI 0x07
+#define VOYAGER_SUBMODSELECT 0x08
+#define VOYAGER_SUBMODPRESENT 0x09
+
+#define VOYAGER_SUBADDR_LO 0xff
+#define VOYAGER_SUBADDR_HI 0xffff
+
+#define VOYAGER_MAX_SCAN_PATH 0x100
+
+#define VOYAGER_MAX_REG_SIZE 4
+
+#define VOYAGER_MAX_MODULES 16
+
+#define VOYAGER_MAX_ASICS_PER_MODULE 7
+
+#define VOYAGER_CAT_ID 0
+#define VOYAGER_PSI 0x1a
+
+#define VOYAGER_READ_CONFIG 0x1
+#define VOYAGER_WRITE_CONFIG 0x2
+#define VOYAGER_BYPASS 0xff
+
+typedef struct voyager_asic
+{
+ __u8 asic_addr;
+ __u8 asic_type;
+ __u8 asic_id;
+ __u8 jtag_id[4];
+ __u8 asic_location;
+ __u8 bit_location;
+ __u8 ireg_length;
+ __u16 subaddr;
+ struct voyager_asic *next;
+} voyager_asic_t;
+
+typedef struct voyager_module {
+ __u8 module_addr;
+ __u8 scan_path_connected;
+ __u16 ee_size;
+ __u16 num_asics;
+ __u16 inst_bits;
+ __u16 largest_reg;
+ __u16 smallest_reg;
+ voyager_asic_t *asic;
+ struct voyager_module *submodule;
+ struct voyager_module *next;
+} voyager_module_t;
+
+typedef struct voyager_eeprom_hdr {
+ __u8 module_id[4];
+ __u8 version_id;
+ __u8 config_id;
+ __u16 boundry_id;
+ __u16 ee_size;
+ __u8 assembly[11];
+ __u8 assembly_rev;
+ __u8 tracer[4];
+ __u16 assembly_cksum;
+ __u16 power_consump;
+ __u16 num_asics;
+ __u16 bist_time;
+ __u16 err_log_offset;
+ __u16 scan_path_offset;
+ __u16 cct_offset;
+ __u16 log_length;
+ __u16 xsum_end;
+ __u8 reserved[4];
+ __u8 sflag;
+ __u8 part_number[13];
+ __u8 version[10];
+ __u8 signature[8];
+ __u16 eeprom_chksum;
+ __u32 data_stamp_offset;
+ __u8 eflag ;
+} __attribute__((packed)) voyager_eprom_hdr_t;
+
+#define VOYAGER_EPROM_SIZE_OFFSET ((__u16)(&(((voyager_eprom_hdr_t *)0)->ee_size)))
+#define VOYAGER_XSUM_END_OFFSET 0x2a
+
+typedef struct voyager_sp_table {
+ __u8 asic_id;
+ __u8 bypass_flag;
+ __u16 asic_data_offset;
+ __u16 config_data_offset;
+} __attribute__((packed)) voyager_sp_table_t;
+
+typedef struct voyager_jtag_table {
+ __u8 icode[4];
+ __u8 runbist[4];
+ __u8 intest[4];
+ __u8 samp_preld[4];
+ __u8 ireg_len;
+} __attribute__((packed)) voyager_jtt_t;
+
+typedef struct voyager_asic_data_table {
+ __u8 jtag_id[4];
+ __u16 length_bsr;
+ __u16 length_bist_reg;
+ __u32 bist_clk;
+ __u16 subaddr_bits;
+ __u16 seed_bits;
+ __u16 sig_bits;
+ __u16 jtag_offset;
+} __attribute__((packed)) voyager_at_t;
+
+#define VOYAGER_WCBIC0 0x41  
+#define VOYAGER_WCBIC1 0x49  
+#define VOYAGER_WCBIC2 0x51  
+#define VOYAGER_WCBIC3 0x59  
+#define VOYAGER_WCBIC4 0x61  
+#define VOYAGER_WCBIC5 0x69  
+#define VOYAGER_WCBIC6 0x71  
+#define VOYAGER_WCBIC7 0x79  
+
+#define VOYAGER_WCBIC_TOM_L 0x4
+#define VOYAGER_WCBIC_TOM_H 0x5
+
+#define VOYAGER_VMC1 0x81
+#define VOYAGER_VMC2 0x91
+#define VOYAGER_VMC3 0xa1
+#define VOYAGER_VMC4 0xb1
+
+#define VOYAGER_VMC_MEMORY_SETUP 0x9
+#define VMC_Interleaving 0x01
+#define VMC_4Way 0x02
+#define VMC_EvenCacheLines 0x04
+#define VMC_HighLine 0x08
+#define VMC_Start0_Enable 0x20
+#define VMC_Start1_Enable 0x40
+#define VMC_Vremap 0x80
+#define VOYAGER_VMC_BANK_DENSITY 0xa
+#define VMC_BANK_EMPTY 0
+#define VMC_BANK_4MB 1
+#define VMC_BANK_16MB 2
+#define VMC_BANK_64MB 3
+#define VMC_BANK0_MASK 0x03
+#define VMC_BANK1_MASK 0x0C
+#define VMC_BANK2_MASK 0x30
+#define VMC_BANK3_MASK 0xC0
+
+#define VOYAGER_MMC_ASIC_ID 1
+
+#define VOYAGER_MMC_MEMORY0_MODULE 0x14
+#define VOYAGER_MMC_MEMORY1_MODULE 0x15
+
+#define VOYAGER_MMA_ASIC_ID 2
+
+#define VOYAGER_QUAD_BASEBOARD 1
+
+#define VOYAGER_QUAD_QDATA0 1
+#define VOYAGER_QUAD_QDATA1 2
+#define VOYAGER_QUAD_QABC 3
+
+#define VOYAGER_PROCESSOR_PRESENT_MASK 0x88a
+#define VOYAGER_MEMORY_CLICKMAP 0xa23
+#define VOYAGER_DUMP_LOCATION 0xb1a
+
+#define VOYAGER_SUS_IN_CONTROL_PORT 0x3ff
+#define VOYAGER_IN_CONTROL_FLAG 0x80
+
+#define VOYAGER_PSI_STATUS_REG 0x08
+#define PSI_DC_FAIL 0x01
+#define PSI_MON 0x02
+#define PSI_FAULT 0x04
+#define PSI_ALARM 0x08
+#define PSI_CURRENT 0x10
+#define PSI_DVM 0x20
+#define PSI_PSCFAULT 0x40
+#define PSI_STAT_CHG 0x80
+
+#define VOYAGER_PSI_SUPPLY_REG 0x8000
+
+#define PSI_FAIL_DC 0x01
+#define PSI_FAIL_AC 0x02
+#define PSI_MON_INT 0x04
+#define PSI_SWITCH_OFF 0x08
+#define PSI_HX_OFF 0x10
+#define PSI_SECURITY 0x20
+#define PSI_CMOS_BATT_LOW 0x40
+#define PSI_CMOS_BATT_FAIL 0x80
+
+#define PSI_CLR_SWITCH_OFF 0x13
+#define PSI_CLR_HX_OFF 0x14
+#define PSI_CLR_CMOS_BATT_FAIL 0x17
+
+#define VOYAGER_PSI_MASK 0x8001
+#define PSI_MASK_MASK 0x10
+
+#define VOYAGER_PSI_AC_FAIL_REG 0x8004
+#define AC_FAIL_STAT_CHANGE 0x80
+
+#define VOYAGER_PSI_GENERAL_REG 0x8007
+
+#define PSI_SWITCH_ON 0x01
+#define PSI_SWITCH_ENABLED 0x02
+#define PSI_ALARM_ENABLED 0x08
+#define PSI_SECURE_ENABLED 0x10
+#define PSI_COLD_RESET 0x20
+#define PSI_COLD_START 0x80
+
+#define PSI_POWER_DOWN 0x10
+#define PSI_SWITCH_DISABLE 0x01
+#define PSI_SWITCH_ENABLE 0x11
+#define PSI_CLEAR 0x12
+#define PSI_ALARM_DISABLE 0x03
+#define PSI_ALARM_ENABLE 0x13
+#define PSI_CLEAR_COLD_RESET 0x05
+#define PSI_SET_COLD_RESET 0x15
+#define PSI_CLEAR_COLD_START 0x07
+#define PSI_SET_COLD_START 0x17
+
+struct voyager_bios_info {
+ __u8 len;
+ __u8 major;
+ __u8 minor;
+ __u8 debug;
+ __u8 num_classes;
+ __u8 class_1;
+ __u8 class_2;
+};
+
+#define NUMBER_OF_MC_BUSSES 2
+#define SLOTS_PER_MC_BUS 8
+#define MAX_CPUS 16  
+#define MAX_PROCESSOR_BOARDS 4  
+#define MAX_CACHE_LEVELS 4  
+#define MAX_SHARED_CPUS 4  
+#define NUMBER_OF_POS_REGS 8
+
+typedef struct {
+ __u8 MC_Slot;
+ __u8 POS_Values[NUMBER_OF_POS_REGS];
+} __attribute__((packed)) MC_SlotInformation_t;
+
+struct QuadDescription {
+ __u8 Type;
+ __u8 StructureVersion;
+ __u32 CPI_BaseAddress;
+ __u32 LARC_BankSize;
+ __u32 LocalMemoryStateBits;
+ __u8 Slot;
+} __attribute__((packed));
+
+struct ProcBoardInfo {
+ __u8 Type;
+ __u8 StructureVersion;
+ __u8 NumberOfBoards;
+ struct QuadDescription QuadData[MAX_PROCESSOR_BOARDS];
+} __attribute__((packed));
+
+struct CacheDescription {
+ __u8 Level;
+ __u32 TotalSize;
+ __u16 LineSize;
+ __u8 Associativity;
+ __u8 CacheType;
+ __u8 WriteType;
+ __u8 Number_CPUs_SharedBy;
+ __u8 Shared_CPUs_Hardware_IDs[MAX_SHARED_CPUS];
+
+} __attribute__((packed));
+
+struct CPU_Description {
+ __u8 CPU_HardwareId;
+ char *FRU_String;
+ __u8 NumberOfCacheLevels;
+ struct CacheDescription CacheLevelData[MAX_CACHE_LEVELS];
+} __attribute__((packed));
+
+struct CPU_Info {
+ __u8 Type;
+ __u8 StructureVersion;
+ __u8 NumberOf_CPUs;
+ struct CPU_Description CPU_Data[MAX_CPUS];
+} __attribute__((packed));
+
+typedef struct {
+ __u8 Mailbox_SUS;
+ __u8 Mailbox_OS;
+ __u8 SUS_MailboxVersion;
+ __u8 OS_MailboxVersion;
+ __u32 OS_Flags;
+ __u32 SUS_Flags;
+ __u32 WatchDogPeriod;
+ __u32 WatchDogCount;
+ __u32 MemoryFor_SUS_ErrorLog;
+ MC_SlotInformation_t MC_SlotInfo[NUMBER_OF_MC_BUSSES*SLOTS_PER_MC_BUS];
+
+ struct ProcBoardInfo *BoardData;
+ struct CPU_Info *CPU_Data;
+
+} Voyager_KernelSUS_Mbox_t;
+
+struct voyager_qic_cpi {
+
+ struct {
+ __u32 pad1[3];
+ __u32 cpi;
+ __u32 pad2[4];
+ } qic_cpi[8];
+};
+
+struct voyager_status {
+ __u32 power_fail:1;
+ __u32 switch_off:1;
+ __u32 request_from_kernel:1;
+};
+
+struct voyager_psi_regs {
+ __u8 cat_id;
+ __u8 cat_dev;
+ __u8 cat_control;
+ __u8 subaddr;
+ __u8 dummy4;
+ __u8 checkbit;
+ __u8 subaddr_low;
+ __u8 subaddr_high;
+ __u8 intstatus;
+ __u8 stat1;
+ __u8 stat3;
+ __u8 fault;
+ __u8 tms;
+ __u8 gen;
+ __u8 sysconf;
+ __u8 dummy15;
+};
+
+struct voyager_psi_subregs {
+ __u8 supply;
+ __u8 mask;
+ __u8 present;
+ __u8 DCfail;
+ __u8 ACfail;
+ __u8 fail;
+ __u8 UPSfail;
+ __u8 genstatus;
+};
+
+struct voyager_psi {
+ struct voyager_psi_regs regs;
+ struct voyager_psi_subregs subregs;
+};
+
+struct voyager_SUS {
+#define VOYAGER_DUMP_BUTTON_NMI 0x1
+#define VOYAGER_SUS_VALID 0x2
+#define VOYAGER_SYSINT_COMPLETE 0x3
+ __u8 SUS_mbox;
+#define VOYAGER_NO_COMMAND 0x0
+#define VOYAGER_IGNORE_DUMP 0x1
+#define VOYAGER_DO_DUMP 0x2
+#define VOYAGER_SYSINT_HANDSHAKE 0x3
+#define VOYAGER_DO_MEM_DUMP 0x4
+#define VOYAGER_SYSINT_WAS_RECOVERED 0x5
+ __u8 kernel_mbox;
+#define VOYAGER_MAILBOX_VERSION 0x10
+ __u8 SUS_version;
+ __u8 kernel_version;
+#define VOYAGER_OS_HAS_SYSINT 0x1
+#define VOYAGER_OS_IN_PROGRESS 0x2
+#define VOYAGER_UPDATING_WDPERIOD 0x4
+ __u32 kernel_flags;
+#define VOYAGER_SUS_BOOTING 0x1
+#define VOYAGER_SUS_IN_PROGRESS 0x2
+ __u32 SUS_flags;
+ __u32 watchdog_period;
+ __u32 watchdog_count;
+ __u32 SUS_errorlog;
+
+};
+
+#define VOYAGER_PSI_READ 0
+#define VOYAGER_PSI_WRITE 1
+#define VOYAGER_PSI_SUBREAD 2
+#define VOYAGER_PSI_SUBWRITE 3
+
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/vsyscall.h b/ndk/platforms/android-5/arch-x86/include/asm/vsyscall.h
new file mode 100644
index 0000000..a7bee3b
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/vsyscall.h
@@ -0,0 +1,27 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef _ASM_X86_64_VSYSCALL_H_
+#define _ASM_X86_64_VSYSCALL_H_
+
+enum vsyscall_num {
+ __NR_vgettimeofday,
+ __NR_vtime,
+ __NR_vgetcpu,
+};
+
+#define VSYSCALL_START (-10UL << 20)
+#define VSYSCALL_SIZE 1024
+#define VSYSCALL_END (-2UL << 20)
+#define VSYSCALL_MAPPED_PAGES 1
+#define VSYSCALL_ADDR(vsyscall_nr) (VSYSCALL_START+VSYSCALL_SIZE*(vsyscall_nr))
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/asm/xen/hypercall.h b/ndk/platforms/android-5/arch-x86/include/asm/xen/hypercall.h
new file mode 100644
index 0000000..3c523a8
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/asm/xen/hypercall.h
@@ -0,0 +1,34 @@
+/****************************************************************************
+ ****************************************************************************
+ ***
+ ***   This header was automatically generated from a Linux kernel header
+ ***   of the same name, to make information necessary for userspace to
+ ***   call into the kernel available to libc.  It contains only constants,
+ ***   structures, and macros generated from the original header, and thus,
+ ***   contains no copyrightable information.
+ ***
+ ****************************************************************************
+ ****************************************************************************/
+#ifndef __HYPERCALL_H__
+#define __HYPERCALL_H__
+
+#include <linux/errno.h>
+#include <linux/string.h>
+
+#include <xen/interface/xen.h>
+#include <xen/interface/sched.h>
+#include <xen/interface/physdev.h>
+
+#define _hypercall0(type, name)  ({   long __res;   asm volatile (   "call %[call]"   : "=a" (__res)   : [call] "m" (hypercall_page[__HYPERVISOR_##name])   : "memory" );   (type)__res;  })
+
+#define _hypercall1(type, name, a1)  ({   long __res, __ign1;   asm volatile (   "call %[call]"   : "=a" (__res), "=b" (__ign1)   : "1" ((long)(a1)),   [call] "m" (hypercall_page[__HYPERVISOR_##name])   : "memory" );   (type)__res;  })
+
+#define _hypercall2(type, name, a1, a2)  ({   long __res, __ign1, __ign2;   asm volatile (   "call %[call]"   : "=a" (__res), "=b" (__ign1), "=c" (__ign2)   : "1" ((long)(a1)), "2" ((long)(a2)),   [call] "m" (hypercall_page[__HYPERVISOR_##name])   : "memory" );   (type)__res;  })
+
+#define _hypercall3(type, name, a1, a2, a3)  ({   long __res, __ign1, __ign2, __ign3;   asm volatile (   "call %[call]"   : "=a" (__res), "=b" (__ign1), "=c" (__ign2),   "=d" (__ign3)   : "1" ((long)(a1)), "2" ((long)(a2)),   "3" ((long)(a3)),   [call] "m" (hypercall_page[__HYPERVISOR_##name])   : "memory" );   (type)__res;  })
+
+#define _hypercall4(type, name, a1, a2, a3, a4)  ({   long __res, __ign1, __ign2, __ign3, __ign4;   asm volatile (   "call %[call]"   : "=a" (__res), "=b" (__ign1), "=c" (__ign2),   "=d" (__ign3), "=S" (__ign4)   : "1" ((long)(a1)), "2" ((long)(a2)),   "3" ((long)(a3)), "4" ((long)(a4)),   [call] "m" (hypercall_page[__HYPERVISOR_##name])   : "memory" );   (type)__res;  })
+
+#define _hypercall5(type, name, a1, a2, a3, a4, a5)  ({   long __res, __ign1, __ign2, __ign3, __ign4, __ign5;   asm volatile (   "call %[call]"   : "=a" (__res), "=b" (__ign1), "=c" (__ign2),   "=d" (__ign3), "=S" (__ign4), "=D" (__ign5)   : "1" ((long)(a1)), "2" ((long)(a2)),   "3" ((long)(a3)), "4" ((long)(a4)),   "5" ((long)(a5)),   [call] "m" (hypercall_page[__HYPERVISOR_##name])   : "memory" );   (type)__res;  })
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/endian.h b/ndk/platforms/android-5/arch-x86/include/endian.h
new file mode 100644
index 0000000..ad37919
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/endian.h
@@ -0,0 +1,70 @@
+/*	$OpenBSD: endian.h,v 1.14 2005/12/13 00:35:23 millert Exp $	*/
+
+/*-
+ * Copyright (c) 1997 Niklas Hallqvist.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * 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 _I386_ENDIAN_H_
+#define _I386_ENDIAN_H_
+
+#ifdef __GNUC__
+
+#if defined(_KERNEL) && !defined(I386_CPU)
+#define	__swap32md(x) ({						\
+	u_int32_t __swap32md_x = (x);					\
+									\
+	__asm ("bswap %1" : "+r" (__swap32md_x));			\
+	__swap32md_x;							\
+})
+#else
+#define	__swap32md(x) ({						\
+	u_int32_t __swap32md_x = (x);					\
+									\
+	__asm ("rorw $8, %w1; rorl $16, %1; rorw $8, %w1" :		\
+	    "+r" (__swap32md_x));					\
+	__swap32md_x;							\
+})
+#endif	/* _KERNEL && !I386_CPU */
+
+#define	__swap64md(x) ({						\
+	u_int64_t __swap64md_x = (x);					\
+									\
+	(u_int64_t)__swap32md(__swap64md_x >> 32) |			\
+	    (u_int64_t)__swap32md(__swap64md_x & 0xffffffff) << 32;	\
+})
+#define	__swap16md(x) ({						\
+	u_int16_t __swap16md_x = (x);					\
+									\
+	__asm ("rorw $8, %w1" : "+r" (__swap16md_x));			\
+	__swap16md_x;							\
+})
+
+/* Tell sys/endian.h we have MD variants of the swap macros.  */
+#define MD_SWAP
+
+#endif	/* __GNUC__ */
+
+#define _BYTE_ORDER _LITTLE_ENDIAN
+#include <sys/endian.h>
+
+#endif /* _I386_ENDIAN_H_ */
diff --git a/ndk/platforms/android-5/arch-x86/include/fenv.h b/ndk/platforms/android-5/arch-x86/include/fenv.h
new file mode 100644
index 0000000..b124366
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/fenv.h
@@ -0,0 +1,240 @@
+/*-
+ * Copyright (c) 2004-2005 David Schultz <das@FreeBSD.ORG>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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.
+ *
+ * $FreeBSD: src/lib/msun/i387/fenv.h,v 1.4 2005/03/17 22:21:46 das Exp $
+ */
+
+#ifndef	_FENV_H_
+#define	_FENV_H_
+
+#include <sys/cdefs.h>
+#include <sys/_types.h>
+
+/*                   
+ * To preserve binary compatibility with FreeBSD 5.3, we pack the
+ * mxcsr into some reserved fields, rather than changing sizeof(fenv_t).
+ */
+typedef struct {
+	__uint16_t	__control;
+	__uint16_t      __mxcsr_hi;
+	__uint16_t	__status;
+	__uint16_t      __mxcsr_lo;
+	__uint32_t	__tag;
+	char		__other[16];
+} fenv_t;
+
+#define	__get_mxcsr(env)	(((env).__mxcsr_hi << 16) |	\
+				 ((env).__mxcsr_lo))
+#define	__set_mxcsr(env, x)	do {				\
+	(env).__mxcsr_hi = (__uint32_t)(x) >> 16;		\
+	(env).__mxcsr_lo = (__uint16_t)(x);			\
+} while (0)
+
+typedef	__uint16_t	fexcept_t;
+
+/* Exception flags */
+#define	FE_INVALID	0x01
+#define	FE_DENORMAL	0x02
+#define	FE_DIVBYZERO	0x04
+#define	FE_OVERFLOW	0x08
+#define	FE_UNDERFLOW	0x10
+#define	FE_INEXACT	0x20
+#define	FE_ALL_EXCEPT	(FE_DIVBYZERO | FE_DENORMAL | FE_INEXACT | \
+			 FE_INVALID | FE_OVERFLOW | FE_UNDERFLOW)
+
+/* Rounding modes */
+#define	FE_TONEAREST	0x0000
+#define	FE_DOWNWARD	0x0400
+#define	FE_UPWARD	0x0800
+#define	FE_TOWARDZERO	0x0c00
+#define	_ROUND_MASK	(FE_TONEAREST | FE_DOWNWARD | \
+			 FE_UPWARD | FE_TOWARDZERO)
+
+/*
+ * As compared to the x87 control word, the SSE unit's control word
+ * has the rounding control bits offset by 3 and the exception mask
+ * bits offset by 7.
+ */
+#define	_SSE_ROUND_SHIFT	3
+#define	_SSE_EMASK_SHIFT	7
+
+/* After testing for SSE support once, we cache the result in __has_sse. */
+enum __sse_support { __SSE_YES, __SSE_NO, __SSE_UNK };
+extern enum __sse_support __has_sse;
+int __test_sse(void);
+#ifdef __SSE__
+#define	__HAS_SSE()	1
+#else
+#define	__HAS_SSE()	(__has_sse == __SSE_YES ||			\
+			 (__has_sse == __SSE_UNK && __test_sse()))
+#endif
+
+__BEGIN_DECLS
+
+/* Default floating-point environment */
+extern const fenv_t	__fe_dfl_env;
+#define	FE_DFL_ENV	(&__fe_dfl_env)
+
+#define	__fldcw(__cw)		__asm __volatile("fldcw %0" : : "m" (__cw))
+#define	__fldenv(__env)		__asm __volatile("fldenv %0" : : "m" (__env))
+#define	__fnclex()		__asm __volatile("fnclex")
+#define	__fnstenv(__env)	__asm __volatile("fnstenv %0" : "=m" (*(__env)))
+#define	__fnstcw(__cw)		__asm __volatile("fnstcw %0" : "=m" (*(__cw)))
+#define	__fnstsw(__sw)		__asm __volatile("fnstsw %0" : "=am" (*(__sw)))
+#define	__fwait()		__asm __volatile("fwait")
+#define	__ldmxcsr(__csr)	__asm __volatile("ldmxcsr %0" : : "m" (__csr))
+#define	__stmxcsr(__csr)	__asm __volatile("stmxcsr %0" : "=m" (*(__csr)))
+
+static __inline int
+feclearexcept(int __excepts)
+{
+	fenv_t __env;
+	int __mxcsr;
+
+	if (__excepts == FE_ALL_EXCEPT) {
+		__fnclex();
+	} else {
+		__fnstenv(&__env);
+		__env.__status &= ~__excepts;
+		__fldenv(__env);
+	}
+	if (__HAS_SSE()) {
+		__stmxcsr(&__mxcsr);
+		__mxcsr &= ~__excepts;
+		__ldmxcsr(__mxcsr);
+	}
+	return (0);
+}
+
+static __inline int
+fegetexceptflag(fexcept_t *__flagp, int __excepts)
+{
+	int __mxcsr, __status;
+
+	__fnstsw(&__status);
+	if (__HAS_SSE())
+		__stmxcsr(&__mxcsr);
+	else
+		__mxcsr = 0;
+	*__flagp = (__mxcsr | __status) & __excepts;
+	return (0);
+}
+
+int fesetexceptflag(const fexcept_t *__flagp, int __excepts);
+int feraiseexcept(int __excepts);
+
+static __inline int
+fetestexcept(int __excepts)
+{
+	int __mxcsr, __status;
+
+	__fnstsw(&__status);
+	if (__HAS_SSE())
+		__stmxcsr(&__mxcsr);
+	else
+		__mxcsr = 0;
+	return ((__status | __mxcsr) & __excepts);
+}
+
+static __inline int
+fegetround(void)
+{
+	int __control;
+
+	/*
+	 * We assume that the x87 and the SSE unit agree on the
+	 * rounding mode.  Reading the control word on the x87 turns
+	 * out to be about 5 times faster than reading it on the SSE
+	 * unit on an Opteron 244.
+	 */
+	__fnstcw(&__control);
+	return (__control & _ROUND_MASK);
+}
+
+static __inline int
+fesetround(int __round)
+{
+	int __mxcsr, __control;
+
+	if (__round & ~_ROUND_MASK)
+		return (-1);
+
+	__fnstcw(&__control);
+	__control &= ~_ROUND_MASK;
+	__control |= __round;
+	__fldcw(__control);
+
+	if (__HAS_SSE()) {
+		__stmxcsr(&__mxcsr);
+		__mxcsr &= ~(_ROUND_MASK << _SSE_ROUND_SHIFT);
+		__mxcsr |= __round << _SSE_ROUND_SHIFT;
+		__ldmxcsr(__mxcsr);
+	}
+
+	return (0);
+}
+
+int fegetenv(fenv_t *__envp);
+int feholdexcept(fenv_t *__envp);
+
+static __inline int
+fesetenv(const fenv_t *__envp)
+{
+	fenv_t __env = *__envp;
+	int __mxcsr;
+
+	__mxcsr = __get_mxcsr(__env);
+	__set_mxcsr(__env, 0xffffffff);
+	__fldenv(__env);
+	if (__HAS_SSE())
+		__ldmxcsr(__mxcsr);
+	return (0);
+}
+
+int feupdateenv(const fenv_t *__envp);
+
+#if __BSD_VISIBLE
+
+int feenableexcept(int __mask);
+int fedisableexcept(int __mask);
+
+static __inline int
+fegetexcept(void)
+{
+	int __control;
+
+	/*
+	 * We assume that the masks for the x87 and the SSE unit are
+	 * the same.
+	 */
+	__fnstcw(&__control);
+	return (~__control & FE_ALL_EXCEPT);
+}
+
+#endif /* __BSD_VISIBLE */
+
+__END_DECLS
+
+#endif	/* !_FENV_H_ */
diff --git a/ndk/platforms/android-5/arch-x86/include/machine/_types.h b/ndk/platforms/android-5/arch-x86/include/machine/_types.h
new file mode 100644
index 0000000..be4f6e4
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/machine/_types.h
@@ -0,0 +1,136 @@
+/*	$OpenBSD: _types.h,v 1.2 2006/01/13 17:50:06 millert Exp $	*/
+
+/*-
+ * Copyright (c) 1990, 1993
+ *	The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ * 3. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
+ *
+ *	@(#)types.h	8.3 (Berkeley) 1/5/94
+ *	@(#)ansi.h	8.2 (Berkeley) 1/4/94
+ */
+
+#ifndef _I386__TYPES_H_
+#define _I386__TYPES_H_
+
+/* the kernel defines size_t as unsigned int, but g++ wants it to be unsigned long */
+#ifndef _SIZE_T
+#  define _SIZE_T
+#  ifdef ANDROID
+     typedef unsigned int  size_t;
+#  else
+     typedef unsigned long  size_t;
+#  endif
+#endif
+#if !defined(_SSIZE_T) && !defined(_SSIZE_T_DEFINED_)
+#define _SSIZE_T
+#define _SSIZE_T_DEFINED_
+typedef long int       ssize_t;
+#endif
+#ifndef _PTRDIFF_T
+#define _PTRDIFF_T
+typedef long           ptrdiff_t;
+#endif
+
+#define _OFF_T_DEFINED_
+#define _SIZE_T_DEFINED_
+
+#include <linux/types.h>
+
+/* 7.18.1.1 Exact-width integer types */
+typedef	__signed char		__int8_t;
+typedef	unsigned char		__uint8_t;
+typedef	short			__int16_t;
+typedef	unsigned short		__uint16_t;
+typedef	int			__int32_t;
+typedef	unsigned int		__uint32_t;
+/* LONGLONG */
+typedef	long long		__int64_t;
+/* LONGLONG */
+typedef	unsigned long long	__uint64_t;
+
+/* 7.18.1.2 Minimum-width integer types */
+typedef	__int8_t		__int_least8_t;
+typedef	__uint8_t		__uint_least8_t;
+typedef	__int16_t		__int_least16_t;
+typedef	__uint16_t		__uint_least16_t;
+typedef	__int32_t		__int_least32_t;
+typedef	__uint32_t		__uint_least32_t;
+typedef	__int64_t		__int_least64_t;
+typedef	__uint64_t		__uint_least64_t;
+
+/* 7.18.1.3 Fastest minimum-width integer types */
+typedef	__int32_t		__int_fast8_t;
+typedef	__uint32_t		__uint_fast8_t;
+typedef	__int32_t		__int_fast16_t;
+typedef	__uint32_t		__uint_fast16_t;
+typedef	__int32_t		__int_fast32_t;
+typedef	__uint32_t		__uint_fast32_t;
+typedef	__int64_t		__int_fast64_t;
+typedef	__uint64_t		__uint_fast64_t;
+
+/* 7.18.1.4 Integer types capable of holding object pointers */
+typedef	int 			__intptr_t;
+typedef	unsigned int 	__uintptr_t;
+
+/* 7.18.1.5 Greatest-width integer types */
+typedef	__int64_t		__intmax_t;
+typedef	__uint64_t		__uintmax_t;
+
+/* Register size */
+typedef __int32_t		__register_t;
+
+/* VM system types */
+typedef unsigned long		__vaddr_t;
+typedef unsigned long		__paddr_t;
+typedef unsigned long		__vsize_t;
+typedef unsigned long		__psize_t;
+
+/* Standard system types */
+typedef int			__clock_t;
+typedef int			__clockid_t;
+typedef long			__ptrdiff_t;
+typedef	int			__time_t;
+typedef int			__timer_t;
+#if defined(__GNUC__) && __GNUC__ >= 3
+typedef	__builtin_va_list	__va_list;
+#else
+typedef	char *			__va_list;
+#endif
+
+/* Wide character support types */
+#ifndef __cplusplus
+typedef	int			__wchar_t;
+#endif
+typedef int			__wint_t;
+typedef	int			__rune_t;
+typedef	void *			__wctrans_t;
+typedef	void *			__wctype_t;
+
+/* Feature test macros */
+#define __HAVE_CPUINFO
+#define __HAVE_MUTEX
+
+#endif	/* _I386__TYPES_H_ */
diff --git a/ndk/platforms/android-5/arch-x86/include/machine/asm.h b/ndk/platforms/android-5/arch-x86/include/machine/asm.h
new file mode 100644
index 0000000..7a23060
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/machine/asm.h
@@ -0,0 +1,124 @@
+/*	$OpenBSD: asm.h,v 1.8 2004/06/13 21:49:16 niklas Exp $	*/
+/*	$NetBSD: asm.h,v 1.7 1994/10/27 04:15:56 cgd Exp $	*/
+
+/*-
+ * Copyright (c) 1990 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * William Jolitz.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ * 3. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
+ *
+ *	@(#)asm.h	5.5 (Berkeley) 5/7/91
+ */
+
+#ifndef _I386_ASM_H_
+#define _I386_ASM_H_
+
+/* This is borrowed from FreeBSD /src/sys/i386/include/asmacros.h v1.27 */
+/*
+ * CNAME and HIDENAME manage the relationship between symbol names in C
+ * and the equivalent assembly language names.  CNAME is given a name as
+ * it would be used in a C program.  It expands to the equivalent assembly
+ * language name.  HIDENAME is given an assembly-language name, and expands
+ * to a possibly-modified form that will be invisible to C programs.
+ */
+#define CNAME(csym)             csym
+#define HIDENAME(asmsym)        .asmsym
+
+#ifdef PIC
+#define PIC_PROLOGUE	\
+	pushl	%ebx;	\
+	call	666f;	\
+666:			\
+	popl	%ebx;	\
+	addl	$_C_LABEL(_GLOBAL_OFFSET_TABLE_)+[.-666b], %ebx
+#define PIC_EPILOGUE	\
+	popl	%ebx
+#define PIC_PLT(x)	x@PLT
+#define PIC_GOT(x)	x@GOT(%ebx)
+#define PIC_GOTOFF(x)	x@GOTOFF(%ebx)
+#else
+#define PIC_PROLOGUE
+#define PIC_EPILOGUE
+#define PIC_PLT(x)	x
+#define PIC_GOT(x)	x
+#define PIC_GOTOFF(x)	x
+#endif
+
+#define _C_LABEL(name)	name
+#define	_ASM_LABEL(x)	x
+
+#define CVAROFF(x, y)	_C_LABEL(x) + y
+
+#ifdef __STDC__
+# define __CONCAT(x,y)	x ## y
+# define __STRING(x)	#x
+#else
+# define __CONCAT(x,y)	x/**/y
+# define __STRING(x)	"x"
+#endif
+
+/*
+ * WEAK ALIAS: create a weak alias
+ */
+#define WEAK_ALIAS(alias,sym) \
+	.weak alias; \
+	alias = sym
+
+/*
+ * WARN_REFERENCES: create a warning if the specified symbol is referenced
+ */
+#define WARN_REFERENCES(_sym,_msg)	\
+	.section .gnu.warning. ## _sym ; .ascii _msg ; .text
+
+/* let kernels and others override entrypoint alignment */
+#ifndef _ALIGN_TEXT
+# define _ALIGN_TEXT .align 2, 0x90
+#endif
+
+#define _ENTRY(x) \
+	.text; _ALIGN_TEXT; .globl x; .type x,@function; x:
+
+#ifdef GPROF
+# define _PROF_PROLOGUE	\
+	pushl %ebp; movl %esp,%ebp; call PIC_PLT(mcount); popl %ebp
+#else
+# define _PROF_PROLOGUE
+#endif
+
+#define	ENTRY(y)	_ENTRY(_C_LABEL(y)); _PROF_PROLOGUE
+#define	NENTRY(y)	_ENTRY(_C_LABEL(y))
+#define	ASENTRY(y)	_ENTRY(_ASM_LABEL(y)); _PROF_PROLOGUE
+
+#define	ALTENTRY(name)	.globl _C_LABEL(name); _C_LABEL(name):
+
+#define	ASMSTR		.asciz
+
+#define RCSID(x)	.text; .asciz x
+#define __FBSDID(x)     RCSID(x)
+
+#endif /* !_I386_ASM_H_ */
diff --git a/ndk/platforms/android-5/arch-x86/include/machine/cdefs.h b/ndk/platforms/android-5/arch-x86/include/machine/cdefs.h
new file mode 100644
index 0000000..6efee6a
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/machine/cdefs.h
@@ -0,0 +1,24 @@
+/*	$OpenBSD: cdefs.h,v 1.9 2005/11/24 20:46:45 deraadt Exp $	*/
+
+/*
+ * Written by J.T. Conklin <jtc@wimsey.com> 01/17/95.
+ * Public domain.
+ */
+
+#ifndef	_MACHINE_CDEFS_H_
+#define	_MACHINE_CDEFS_H_
+
+#if defined(lint)
+#define __indr_reference(sym,alias)	__lint_equal__(sym,alias)
+#define __warn_references(sym,msg)
+#define __weak_alias(alias,sym)		__lint_equal__(sym,alias)
+#elif defined(__GNUC__) && defined(__STDC__)
+#define __weak_alias(alias,sym)				\
+	__asm__(".weak " __STRING(alias) " ; "		\
+	    __STRING(alias) " = " __STRING(sym));
+#define __warn_references(sym,msg)			\
+	__asm__(".section .gnu.warning." __STRING(sym)	\
+	    " ; .ascii \"" msg "\" ; .text");
+#endif
+
+#endif /* !_MACHINE_CDEFS_H_ */
diff --git a/ndk/platforms/android-5/arch-x86/include/machine/exec.h b/ndk/platforms/android-5/arch-x86/include/machine/exec.h
new file mode 100644
index 0000000..d091741
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/machine/exec.h
@@ -0,0 +1,51 @@
+/*	$OpenBSD: exec.h,v 1.9 2003/04/17 03:42:14 drahn Exp $	*/
+/*	$NetBSD: exec.h,v 1.6 1994/10/27 04:16:05 cgd Exp $	*/
+
+/*
+ * Copyright (c) 1993 Christopher G. Demetriou
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ * 3. 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 _I386_EXEC_H_
+#define _I386_EXEC_H_
+
+#define __LDPGSZ	4096
+
+#define NATIVE_EXEC_ELF
+
+#define ARCH_ELFSIZE		32
+
+#define ELF_TARG_CLASS		ELFCLASS32
+#define ELF_TARG_DATA		ELFDATA2LSB
+#define ELF_TARG_MACH		EM_386 /* XXX - EM_486 is currently unused
+                                          by all OSs/compilers/linkers */
+
+#define _NLIST_DO_AOUT
+#define _NLIST_DO_ELF
+
+#define _KERN_DO_AOUT
+#define _KERN_DO_ELF
+
+#endif  /* _I386_EXEC_H_ */
diff --git a/ndk/platforms/android-5/arch-x86/include/machine/ieee.h b/ndk/platforms/android-5/arch-x86/include/machine/ieee.h
new file mode 100644
index 0000000..55b3703
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/machine/ieee.h
@@ -0,0 +1,133 @@
+/*	$OpenBSD: ieee.h,v 1.2 2003/06/02 23:27:47 millert Exp $ */
+/*	$NetBSD: ieee.h,v 1.1 1996/09/30 16:34:25 ws Exp $ */
+
+/*
+ * Copyright (c) 1992, 1993
+ *	The Regents of the University of California.  All rights reserved.
+ *
+ * This software was developed by the Computer Systems Engineering group
+ * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
+ * contributed to Berkeley.
+ *
+ * All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ *	This product includes software developed by the University of
+ *	California, Lawrence Berkeley Laboratory.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ * 3. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
+ *
+ *	@(#)ieee.h	8.1 (Berkeley) 6/11/93
+ */
+
+/*
+ * ieee.h defines the machine-dependent layout of the machine's IEEE
+ * floating point.  It does *not* define (yet?) any of the rounding
+ * mode bits, exceptions, and so forth.
+ */
+
+/*
+ * Define the number of bits in each fraction and exponent.
+ *
+ *		     k	         k+1
+ * Note that  1.0 x 2  == 0.1 x 2      and that denorms are represented
+ *
+ *					  (-exp_bias+1)
+ * as fractions that look like 0.fffff x 2             .  This means that
+ *
+ *			 -126
+ * the number 0.10000 x 2    , for instance, is the same as the normalized
+ *
+ *		-127			   -128
+ * float 1.0 x 2    .  Thus, to represent 2    , we need one leading zero
+ *
+ *				  -129
+ * in the fraction; to represent 2    , we need two, and so on.  This
+ *
+ *						     (-exp_bias-fracbits+1)
+ * implies that the smallest denormalized number is 2
+ *
+ * for whichever format we are talking about: for single precision, for
+ *
+ *						-126		-149
+ * instance, we get .00000000000000000000001 x 2    , or 1.0 x 2    , and
+ *
+ * -149 == -127 - 23 + 1.
+ */
+#define	SNG_EXPBITS	8
+#define	SNG_FRACBITS	23
+
+#define	DBL_EXPBITS	11
+#define	DBL_FRACBITS	52
+
+#define	EXT_EXPBITS	15
+#define	EXT_FRACBITS	112
+
+struct ieee_single {
+	u_int	sng_frac:23;
+	u_int	sng_exp:8;
+	u_int	sng_sign:1;
+};
+
+struct ieee_double {
+	u_int	dbl_fracl;
+	u_int	dbl_frach:20;
+	u_int	dbl_exp:11;
+	u_int	dbl_sign:1;
+};
+
+struct ieee_ext {
+	u_int	ext_fracl;
+	u_int	ext_fraclm;
+	u_int	ext_frachm;
+	u_int	ext_frach:16;
+	u_int	ext_exp:15;
+	u_int	ext_sign:1;
+};
+
+/*
+ * Floats whose exponent is in [1..INFNAN) (of whatever type) are
+ * `normal'.  Floats whose exponent is INFNAN are either Inf or NaN.
+ * Floats whose exponent is zero are either zero (iff all fraction
+ * bits are zero) or subnormal values.
+ *
+ * A NaN is a `signalling NaN' if its QUIETNAN bit is clear in its
+ * high fraction; if the bit is set, it is a `quiet NaN'.
+ */
+#define	SNG_EXP_INFNAN	255
+#define	DBL_EXP_INFNAN	2047
+#define	EXT_EXP_INFNAN	32767
+
+#if 0
+#define	SNG_QUIETNAN	(1 << 22)
+#define	DBL_QUIETNAN	(1 << 19)
+#define	EXT_QUIETNAN	(1 << 15)
+#endif
+
+/*
+ * Exponent biases.
+ */
+#define	SNG_EXP_BIAS	127
+#define	DBL_EXP_BIAS	1023
+#define	EXT_EXP_BIAS	16383
diff --git a/ndk/platforms/android-5/arch-x86/include/machine/internal_types.h b/ndk/platforms/android-5/arch-x86/include/machine/internal_types.h
new file mode 100644
index 0000000..4d1833c
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/machine/internal_types.h
@@ -0,0 +1,6 @@
+/* $OpenBSD: internal_types.h,v 1.1 2002/04/24 21:53:11 espie Exp $ */
+/* Public domain */
+#ifndef _MACHINE_INTERNAL_TYPES_H_
+#define _MACHINE_INTERNAL_TYPES_H_
+
+#endif
diff --git a/ndk/platforms/android-5/arch-x86/include/machine/kernel.h b/ndk/platforms/android-5/arch-x86/include/machine/kernel.h
new file mode 100644
index 0000000..19d1577
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/machine/kernel.h
@@ -0,0 +1,41 @@
+/* bionic/arch-arm/include/machine/kernel.h
+**
+** Copyright 2006-2008, The Android Open Source Project
+**
+** 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.
+**     * Neither the name of Google Inc. nor the names of its contributors may
+**       be used to endorse or promote products derived from this software
+**       without specific prior written permission.
+**
+** THIS SOFTWARE IS PROVIDED BY Google Inc. ``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 Google Inc. 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 _ARCH_X86_KERNEL_H
+#define _ARCH_X86_KERNEL_H
+
+/* this file contains kernel-specific definitions that were optimized out of
+   our processed kernel headers, but still useful nonetheless... */
+
+typedef unsigned long   __kernel_blkcnt_t;
+typedef unsigned long   __kernel_blksize_t;
+
+/* these aren't really defined by the kernel headers though... */
+typedef unsigned long   __kernel_fsblkcnt_t;
+typedef unsigned long   __kernel_fsfilcnt_t;
+typedef unsigned int    __kernel_id_t;
+
+#endif /* _ARCH_X86_KERNEL_H */
diff --git a/ndk/platforms/android-5/arch-x86/include/machine/limits.h b/ndk/platforms/android-5/arch-x86/include/machine/limits.h
new file mode 100644
index 0000000..86fd854
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/machine/limits.h
@@ -0,0 +1,63 @@
+/*	$OpenBSD: limits.h,v 1.11 2006/01/06 22:48:47 millert Exp $	*/
+/*	$NetBSD: limits.h,v 1.11 1995/12/21 01:08:59 mycroft Exp $	*/
+
+/*
+ * Copyright (c) 1988 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ * 3. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
+ *
+ *	@(#)limits.h	7.2 (Berkeley) 6/28/90
+ */
+
+#ifndef _MACHINE_LIMITS_H_
+#define _MACHINE_LIMITS_H_
+
+#include <sys/cdefs.h>
+
+#define	MB_LEN_MAX	1		/* no multibyte characters */
+
+#ifndef	SIZE_MAX
+#define	SIZE_MAX	UINT_MAX	/* max value for a size_t */
+#endif
+#ifndef SSIZE_MAX
+#define	SSIZE_MAX	INT_MAX		/* max value for a ssize_t */
+#endif
+
+#if __BSD_VISIBLE
+#define	SIZE_T_MAX	UINT_MAX	/* max value for a size_t (historic) */
+
+#define	UQUAD_MAX	0xffffffffffffffffULL		/* max unsigned quad */
+#define	QUAD_MAX	0x7fffffffffffffffLL		/* max signed quad */
+#define	QUAD_MIN	(-0x7fffffffffffffffLL-1)	/* min signed quad */
+
+#endif /* __BSD_VISIBLE */
+
+#define LONGLONG_BIT    64
+#define LONGLONG_MIN    (-9223372036854775807LL-1)
+#define LONGLONG_MAX    9223372036854775807LL
+#define ULONGLONG_MAX   18446744073709551615ULL
+
+#endif /* _MACHINE_LIMITS_H_ */
diff --git a/ndk/platforms/android-5/arch-x86/include/machine/setjmp.h b/ndk/platforms/android-5/arch-x86/include/machine/setjmp.h
new file mode 100644
index 0000000..ded095d
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/include/machine/setjmp.h
@@ -0,0 +1,8 @@
+/*	$OpenBSD: setjmp.h,v 1.2 2000/08/05 22:07:32 niklas Exp $	*/
+/*	$NetBSD: setjmp.h,v 1.1 1994/12/20 10:36:43 cgd Exp $	*/
+
+/*
+ * machine/setjmp.h: machine dependent setjmp-related information.
+ */
+
+#define	_JBLEN	10		/* size, in longs, of a jmp_buf */
diff --git a/ndk/platforms/android-5/arch-x86/lib/crtbegin_dynamic.o b/ndk/platforms/android-5/arch-x86/lib/crtbegin_dynamic.o
new file mode 100644
index 0000000..c620c30
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/lib/crtbegin_dynamic.o
Binary files differ
diff --git a/ndk/platforms/android-5/arch-x86/lib/crtbegin_static.o b/ndk/platforms/android-5/arch-x86/lib/crtbegin_static.o
new file mode 100644
index 0000000..c7505ee
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/lib/crtbegin_static.o
Binary files differ
diff --git a/ndk/platforms/android-5/arch-x86/lib/crtend_android.o b/ndk/platforms/android-5/arch-x86/lib/crtend_android.o
new file mode 100644
index 0000000..2a835b7
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/lib/crtend_android.o
Binary files differ
diff --git a/ndk/platforms/android-5/arch-x86/lib/libc.a b/ndk/platforms/android-5/arch-x86/lib/libc.a
new file mode 100644
index 0000000..15403b1
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/lib/libc.a
Binary files differ
diff --git a/ndk/platforms/android-5/arch-x86/lib/libc.so b/ndk/platforms/android-5/arch-x86/lib/libc.so
new file mode 100755
index 0000000..fb6851c
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/lib/libc.so
Binary files differ
diff --git a/ndk/platforms/android-5/arch-x86/lib/libc_common.a b/ndk/platforms/android-5/arch-x86/lib/libc_common.a
new file mode 100644
index 0000000..aed18c7
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/lib/libc_common.a
Binary files differ
diff --git a/ndk/platforms/android-5/arch-x86/lib/libdl.so b/ndk/platforms/android-5/arch-x86/lib/libdl.so
new file mode 100755
index 0000000..3f2cbeb
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/lib/libdl.so
Binary files differ
diff --git a/ndk/platforms/android-5/arch-x86/lib/libm.a b/ndk/platforms/android-5/arch-x86/lib/libm.a
new file mode 100644
index 0000000..4e7c1f9
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/lib/libm.a
Binary files differ
diff --git a/ndk/platforms/android-5/arch-x86/lib/libm.so b/ndk/platforms/android-5/arch-x86/lib/libm.so
new file mode 100755
index 0000000..1f46494
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/lib/libm.so
Binary files differ
diff --git a/ndk/platforms/android-5/arch-x86/lib/libstdc++.a b/ndk/platforms/android-5/arch-x86/lib/libstdc++.a
new file mode 100644
index 0000000..ff5c78e
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/lib/libstdc++.a
Binary files differ
diff --git a/ndk/platforms/android-5/arch-x86/lib/libstdc++.so b/ndk/platforms/android-5/arch-x86/lib/libstdc++.so
new file mode 100755
index 0000000..79124d1
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/lib/libstdc++.so
Binary files differ
diff --git a/ndk/platforms/android-5/arch-x86/lib/libthread_db.a b/ndk/platforms/android-5/arch-x86/lib/libthread_db.a
new file mode 100644
index 0000000..abe0957
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/lib/libthread_db.a
Binary files differ
diff --git a/ndk/platforms/android-5/arch-x86/lib/libthread_db.so b/ndk/platforms/android-5/arch-x86/lib/libthread_db.so
new file mode 100755
index 0000000..8614274
--- /dev/null
+++ b/ndk/platforms/android-5/arch-x86/lib/libthread_db.so
Binary files differ
diff --git a/ndk/platforms/android-5/include/GLES2/gl2.h b/ndk/platforms/android-5/include/GLES2/gl2.h
new file mode 100644
index 0000000..0182a67
--- /dev/null
+++ b/ndk/platforms/android-5/include/GLES2/gl2.h
@@ -0,0 +1,620 @@
+#ifndef __gl2_h_
+#define __gl2_h_
+
+/* $Revision: 7173 $ on $Date:: 2009-01-09 11:18:21 -0800 #$ */
+
+#include <GLES2/gl2platform.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * This document is licensed under the SGI Free Software B License Version
+ * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
+ */
+
+/*-------------------------------------------------------------------------
+ * Data type definitions
+ *-----------------------------------------------------------------------*/
+
+typedef void             GLvoid;
+typedef unsigned int     GLenum;
+typedef unsigned char    GLboolean;
+typedef unsigned int     GLbitfield;
+typedef khronos_int8_t   GLbyte;
+typedef short            GLshort;
+typedef int              GLint;
+typedef int              GLsizei;
+typedef khronos_uint8_t  GLubyte;
+typedef unsigned short   GLushort;
+typedef unsigned int     GLuint;
+typedef khronos_float_t  GLfloat;
+typedef khronos_float_t  GLclampf;
+typedef khronos_int32_t  GLfixed;
+
+/* GL types for handling large vertex buffer objects */
+typedef khronos_intptr_t GLintptr;
+typedef khronos_ssize_t  GLsizeiptr;
+
+/* OpenGL ES core versions */
+#define GL_ES_VERSION_2_0                 1
+
+/* ClearBufferMask */
+#define GL_DEPTH_BUFFER_BIT               0x00000100
+#define GL_STENCIL_BUFFER_BIT             0x00000400
+#define GL_COLOR_BUFFER_BIT               0x00004000
+
+/* Boolean */
+#define GL_FALSE                          0
+#define GL_TRUE                           1
+
+/* BeginMode */
+#define GL_POINTS                         0x0000
+#define GL_LINES                          0x0001
+#define GL_LINE_LOOP                      0x0002
+#define GL_LINE_STRIP                     0x0003
+#define GL_TRIANGLES                      0x0004
+#define GL_TRIANGLE_STRIP                 0x0005
+#define GL_TRIANGLE_FAN                   0x0006
+
+/* AlphaFunction (not supported in ES20) */
+/*      GL_NEVER */
+/*      GL_LESS */
+/*      GL_EQUAL */
+/*      GL_LEQUAL */
+/*      GL_GREATER */
+/*      GL_NOTEQUAL */
+/*      GL_GEQUAL */
+/*      GL_ALWAYS */
+
+/* BlendingFactorDest */
+#define GL_ZERO                           0
+#define GL_ONE                            1
+#define GL_SRC_COLOR                      0x0300
+#define GL_ONE_MINUS_SRC_COLOR            0x0301
+#define GL_SRC_ALPHA                      0x0302
+#define GL_ONE_MINUS_SRC_ALPHA            0x0303
+#define GL_DST_ALPHA                      0x0304
+#define GL_ONE_MINUS_DST_ALPHA            0x0305
+
+/* BlendingFactorSrc */
+/*      GL_ZERO */
+/*      GL_ONE */
+#define GL_DST_COLOR                      0x0306
+#define GL_ONE_MINUS_DST_COLOR            0x0307
+#define GL_SRC_ALPHA_SATURATE             0x0308
+/*      GL_SRC_ALPHA */
+/*      GL_ONE_MINUS_SRC_ALPHA */
+/*      GL_DST_ALPHA */
+/*      GL_ONE_MINUS_DST_ALPHA */
+
+/* BlendEquationSeparate */
+#define GL_FUNC_ADD                       0x8006
+#define GL_BLEND_EQUATION                 0x8009
+#define GL_BLEND_EQUATION_RGB             0x8009    /* same as BLEND_EQUATION */
+#define GL_BLEND_EQUATION_ALPHA           0x883D
+
+/* BlendSubtract */
+#define GL_FUNC_SUBTRACT                  0x800A
+#define GL_FUNC_REVERSE_SUBTRACT          0x800B
+
+/* Separate Blend Functions */
+#define GL_BLEND_DST_RGB                  0x80C8
+#define GL_BLEND_SRC_RGB                  0x80C9
+#define GL_BLEND_DST_ALPHA                0x80CA
+#define GL_BLEND_SRC_ALPHA                0x80CB
+#define GL_CONSTANT_COLOR                 0x8001
+#define GL_ONE_MINUS_CONSTANT_COLOR       0x8002
+#define GL_CONSTANT_ALPHA                 0x8003
+#define GL_ONE_MINUS_CONSTANT_ALPHA       0x8004
+#define GL_BLEND_COLOR                    0x8005
+
+/* Buffer Objects */
+#define GL_ARRAY_BUFFER                   0x8892
+#define GL_ELEMENT_ARRAY_BUFFER           0x8893
+#define GL_ARRAY_BUFFER_BINDING           0x8894
+#define GL_ELEMENT_ARRAY_BUFFER_BINDING   0x8895
+
+#define GL_STREAM_DRAW                    0x88E0
+#define GL_STATIC_DRAW                    0x88E4
+#define GL_DYNAMIC_DRAW                   0x88E8
+
+#define GL_BUFFER_SIZE                    0x8764
+#define GL_BUFFER_USAGE                   0x8765
+
+#define GL_CURRENT_VERTEX_ATTRIB          0x8626
+
+/* CullFaceMode */
+#define GL_FRONT                          0x0404
+#define GL_BACK                           0x0405
+#define GL_FRONT_AND_BACK                 0x0408
+
+/* DepthFunction */
+/*      GL_NEVER */
+/*      GL_LESS */
+/*      GL_EQUAL */
+/*      GL_LEQUAL */
+/*      GL_GREATER */
+/*      GL_NOTEQUAL */
+/*      GL_GEQUAL */
+/*      GL_ALWAYS */
+
+/* EnableCap */
+#define GL_TEXTURE_2D                     0x0DE1
+#define GL_CULL_FACE                      0x0B44
+#define GL_BLEND                          0x0BE2
+#define GL_DITHER                         0x0BD0
+#define GL_STENCIL_TEST                   0x0B90
+#define GL_DEPTH_TEST                     0x0B71
+#define GL_SCISSOR_TEST                   0x0C11
+#define GL_POLYGON_OFFSET_FILL            0x8037
+#define GL_SAMPLE_ALPHA_TO_COVERAGE       0x809E
+#define GL_SAMPLE_COVERAGE                0x80A0
+
+/* ErrorCode */
+#define GL_NO_ERROR                       0
+#define GL_INVALID_ENUM                   0x0500
+#define GL_INVALID_VALUE                  0x0501
+#define GL_INVALID_OPERATION              0x0502
+#define GL_OUT_OF_MEMORY                  0x0505
+
+/* FrontFaceDirection */
+#define GL_CW                             0x0900
+#define GL_CCW                            0x0901
+
+/* GetPName */
+#define GL_LINE_WIDTH                     0x0B21
+#define GL_ALIASED_POINT_SIZE_RANGE       0x846D
+#define GL_ALIASED_LINE_WIDTH_RANGE       0x846E
+#define GL_CULL_FACE_MODE                 0x0B45
+#define GL_FRONT_FACE                     0x0B46
+#define GL_DEPTH_RANGE                    0x0B70
+#define GL_DEPTH_WRITEMASK                0x0B72
+#define GL_DEPTH_CLEAR_VALUE              0x0B73
+#define GL_DEPTH_FUNC                     0x0B74
+#define GL_STENCIL_CLEAR_VALUE            0x0B91
+#define GL_STENCIL_FUNC                   0x0B92
+#define GL_STENCIL_FAIL                   0x0B94
+#define GL_STENCIL_PASS_DEPTH_FAIL        0x0B95
+#define GL_STENCIL_PASS_DEPTH_PASS        0x0B96
+#define GL_STENCIL_REF                    0x0B97
+#define GL_STENCIL_VALUE_MASK             0x0B93
+#define GL_STENCIL_WRITEMASK              0x0B98
+#define GL_STENCIL_BACK_FUNC              0x8800
+#define GL_STENCIL_BACK_FAIL              0x8801
+#define GL_STENCIL_BACK_PASS_DEPTH_FAIL   0x8802
+#define GL_STENCIL_BACK_PASS_DEPTH_PASS   0x8803
+#define GL_STENCIL_BACK_REF               0x8CA3
+#define GL_STENCIL_BACK_VALUE_MASK        0x8CA4
+#define GL_STENCIL_BACK_WRITEMASK         0x8CA5
+#define GL_VIEWPORT                       0x0BA2
+#define GL_SCISSOR_BOX                    0x0C10
+/*      GL_SCISSOR_TEST */
+#define GL_COLOR_CLEAR_VALUE              0x0C22
+#define GL_COLOR_WRITEMASK                0x0C23
+#define GL_UNPACK_ALIGNMENT               0x0CF5
+#define GL_PACK_ALIGNMENT                 0x0D05
+#define GL_MAX_TEXTURE_SIZE               0x0D33
+#define GL_MAX_VIEWPORT_DIMS              0x0D3A
+#define GL_SUBPIXEL_BITS                  0x0D50
+#define GL_RED_BITS                       0x0D52
+#define GL_GREEN_BITS                     0x0D53
+#define GL_BLUE_BITS                      0x0D54
+#define GL_ALPHA_BITS                     0x0D55
+#define GL_DEPTH_BITS                     0x0D56
+#define GL_STENCIL_BITS                   0x0D57
+#define GL_POLYGON_OFFSET_UNITS           0x2A00
+/*      GL_POLYGON_OFFSET_FILL */
+#define GL_POLYGON_OFFSET_FACTOR          0x8038
+#define GL_TEXTURE_BINDING_2D             0x8069
+#define GL_SAMPLE_BUFFERS                 0x80A8
+#define GL_SAMPLES                        0x80A9
+#define GL_SAMPLE_COVERAGE_VALUE          0x80AA
+#define GL_SAMPLE_COVERAGE_INVERT         0x80AB
+
+/* GetTextureParameter */
+/*      GL_TEXTURE_MAG_FILTER */
+/*      GL_TEXTURE_MIN_FILTER */
+/*      GL_TEXTURE_WRAP_S */
+/*      GL_TEXTURE_WRAP_T */
+
+#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
+#define GL_COMPRESSED_TEXTURE_FORMATS     0x86A3
+
+/* HintMode */
+#define GL_DONT_CARE                      0x1100
+#define GL_FASTEST                        0x1101
+#define GL_NICEST                         0x1102
+
+/* HintTarget */
+#define GL_GENERATE_MIPMAP_HINT            0x8192
+
+/* DataType */
+#define GL_BYTE                           0x1400
+#define GL_UNSIGNED_BYTE                  0x1401
+#define GL_SHORT                          0x1402
+#define GL_UNSIGNED_SHORT                 0x1403
+#define GL_INT                            0x1404
+#define GL_UNSIGNED_INT                   0x1405
+#define GL_FLOAT                          0x1406
+#define GL_FIXED                          0x140C
+
+/* PixelFormat */
+#define GL_DEPTH_COMPONENT                0x1902
+#define GL_ALPHA                          0x1906
+#define GL_RGB                            0x1907
+#define GL_RGBA                           0x1908
+#define GL_LUMINANCE                      0x1909
+#define GL_LUMINANCE_ALPHA                0x190A
+
+/* PixelType */
+/*      GL_UNSIGNED_BYTE */
+#define GL_UNSIGNED_SHORT_4_4_4_4         0x8033
+#define GL_UNSIGNED_SHORT_5_5_5_1         0x8034
+#define GL_UNSIGNED_SHORT_5_6_5           0x8363
+
+/* Shaders */
+#define GL_FRAGMENT_SHADER                  0x8B30
+#define GL_VERTEX_SHADER                    0x8B31
+#define GL_MAX_VERTEX_ATTRIBS               0x8869
+#define GL_MAX_VERTEX_UNIFORM_VECTORS       0x8DFB
+#define GL_MAX_VARYING_VECTORS              0x8DFC
+#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D
+#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS   0x8B4C
+#define GL_MAX_TEXTURE_IMAGE_UNITS          0x8872
+#define GL_MAX_FRAGMENT_UNIFORM_VECTORS     0x8DFD
+#define GL_SHADER_TYPE                      0x8B4F
+#define GL_DELETE_STATUS                    0x8B80
+#define GL_LINK_STATUS                      0x8B82
+#define GL_VALIDATE_STATUS                  0x8B83
+#define GL_ATTACHED_SHADERS                 0x8B85
+#define GL_ACTIVE_UNIFORMS                  0x8B86
+#define GL_ACTIVE_UNIFORM_MAX_LENGTH        0x8B87
+#define GL_ACTIVE_ATTRIBUTES                0x8B89
+#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH      0x8B8A
+#define GL_SHADING_LANGUAGE_VERSION         0x8B8C
+#define GL_CURRENT_PROGRAM                  0x8B8D
+
+/* StencilFunction */
+#define GL_NEVER                          0x0200
+#define GL_LESS                           0x0201
+#define GL_EQUAL                          0x0202
+#define GL_LEQUAL                         0x0203
+#define GL_GREATER                        0x0204
+#define GL_NOTEQUAL                       0x0205
+#define GL_GEQUAL                         0x0206
+#define GL_ALWAYS                         0x0207
+
+/* StencilOp */
+/*      GL_ZERO */
+#define GL_KEEP                           0x1E00
+#define GL_REPLACE                        0x1E01
+#define GL_INCR                           0x1E02
+#define GL_DECR                           0x1E03
+#define GL_INVERT                         0x150A
+#define GL_INCR_WRAP                      0x8507
+#define GL_DECR_WRAP                      0x8508
+
+/* StringName */
+#define GL_VENDOR                         0x1F00
+#define GL_RENDERER                       0x1F01
+#define GL_VERSION                        0x1F02
+#define GL_EXTENSIONS                     0x1F03
+
+/* TextureMagFilter */
+#define GL_NEAREST                        0x2600
+#define GL_LINEAR                         0x2601
+
+/* TextureMinFilter */
+/*      GL_NEAREST */
+/*      GL_LINEAR */
+#define GL_NEAREST_MIPMAP_NEAREST         0x2700
+#define GL_LINEAR_MIPMAP_NEAREST          0x2701
+#define GL_NEAREST_MIPMAP_LINEAR          0x2702
+#define GL_LINEAR_MIPMAP_LINEAR           0x2703
+
+/* TextureParameterName */
+#define GL_TEXTURE_MAG_FILTER             0x2800
+#define GL_TEXTURE_MIN_FILTER             0x2801
+#define GL_TEXTURE_WRAP_S                 0x2802
+#define GL_TEXTURE_WRAP_T                 0x2803
+
+/* TextureTarget */
+/*      GL_TEXTURE_2D */
+#define GL_TEXTURE                        0x1702
+
+#define GL_TEXTURE_CUBE_MAP               0x8513
+#define GL_TEXTURE_BINDING_CUBE_MAP       0x8514
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_X    0x8515
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X    0x8516
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y    0x8517
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y    0x8518
+#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z    0x8519
+#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z    0x851A
+#define GL_MAX_CUBE_MAP_TEXTURE_SIZE      0x851C
+
+/* TextureUnit */
+#define GL_TEXTURE0                       0x84C0
+#define GL_TEXTURE1                       0x84C1
+#define GL_TEXTURE2                       0x84C2
+#define GL_TEXTURE3                       0x84C3
+#define GL_TEXTURE4                       0x84C4
+#define GL_TEXTURE5                       0x84C5
+#define GL_TEXTURE6                       0x84C6
+#define GL_TEXTURE7                       0x84C7
+#define GL_TEXTURE8                       0x84C8
+#define GL_TEXTURE9                       0x84C9
+#define GL_TEXTURE10                      0x84CA
+#define GL_TEXTURE11                      0x84CB
+#define GL_TEXTURE12                      0x84CC
+#define GL_TEXTURE13                      0x84CD
+#define GL_TEXTURE14                      0x84CE
+#define GL_TEXTURE15                      0x84CF
+#define GL_TEXTURE16                      0x84D0
+#define GL_TEXTURE17                      0x84D1
+#define GL_TEXTURE18                      0x84D2
+#define GL_TEXTURE19                      0x84D3
+#define GL_TEXTURE20                      0x84D4
+#define GL_TEXTURE21                      0x84D5
+#define GL_TEXTURE22                      0x84D6
+#define GL_TEXTURE23                      0x84D7
+#define GL_TEXTURE24                      0x84D8
+#define GL_TEXTURE25                      0x84D9
+#define GL_TEXTURE26                      0x84DA
+#define GL_TEXTURE27                      0x84DB
+#define GL_TEXTURE28                      0x84DC
+#define GL_TEXTURE29                      0x84DD
+#define GL_TEXTURE30                      0x84DE
+#define GL_TEXTURE31                      0x84DF
+#define GL_ACTIVE_TEXTURE                 0x84E0
+
+/* TextureWrapMode */
+#define GL_REPEAT                         0x2901
+#define GL_CLAMP_TO_EDGE                  0x812F
+#define GL_MIRRORED_REPEAT                0x8370
+
+/* Uniform Types */
+#define GL_FLOAT_VEC2                     0x8B50
+#define GL_FLOAT_VEC3                     0x8B51
+#define GL_FLOAT_VEC4                     0x8B52
+#define GL_INT_VEC2                       0x8B53
+#define GL_INT_VEC3                       0x8B54
+#define GL_INT_VEC4                       0x8B55
+#define GL_BOOL                           0x8B56
+#define GL_BOOL_VEC2                      0x8B57
+#define GL_BOOL_VEC3                      0x8B58
+#define GL_BOOL_VEC4                      0x8B59
+#define GL_FLOAT_MAT2                     0x8B5A
+#define GL_FLOAT_MAT3                     0x8B5B
+#define GL_FLOAT_MAT4                     0x8B5C
+#define GL_SAMPLER_2D                     0x8B5E
+#define GL_SAMPLER_CUBE                   0x8B60
+
+/* Vertex Arrays */
+#define GL_VERTEX_ATTRIB_ARRAY_ENABLED        0x8622
+#define GL_VERTEX_ATTRIB_ARRAY_SIZE           0x8623
+#define GL_VERTEX_ATTRIB_ARRAY_STRIDE         0x8624
+#define GL_VERTEX_ATTRIB_ARRAY_TYPE           0x8625
+#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED     0x886A
+#define GL_VERTEX_ATTRIB_ARRAY_POINTER        0x8645
+#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F
+
+/* Read Format */
+#define GL_IMPLEMENTATION_COLOR_READ_TYPE   0x8B9A
+#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B
+
+/* Shader Source */
+#define GL_COMPILE_STATUS                 0x8B81
+#define GL_INFO_LOG_LENGTH                0x8B84
+#define GL_SHADER_SOURCE_LENGTH           0x8B88
+#define GL_SHADER_COMPILER                0x8DFA
+
+/* Shader Binary */
+#define GL_SHADER_BINARY_FORMATS          0x8DF8
+#define GL_NUM_SHADER_BINARY_FORMATS      0x8DF9
+
+/* Shader Precision-Specified Types */
+#define GL_LOW_FLOAT                      0x8DF0
+#define GL_MEDIUM_FLOAT                   0x8DF1
+#define GL_HIGH_FLOAT                     0x8DF2
+#define GL_LOW_INT                        0x8DF3
+#define GL_MEDIUM_INT                     0x8DF4
+#define GL_HIGH_INT                       0x8DF5
+
+/* Framebuffer Object. */
+#define GL_FRAMEBUFFER                    0x8D40
+#define GL_RENDERBUFFER                   0x8D41
+
+#define GL_RGBA4                          0x8056
+#define GL_RGB5_A1                        0x8057
+#define GL_RGB565                         0x8D62
+#define GL_DEPTH_COMPONENT16              0x81A5
+#define GL_STENCIL_INDEX                  0x1901
+#define GL_STENCIL_INDEX8                 0x8D48
+
+#define GL_RENDERBUFFER_WIDTH             0x8D42
+#define GL_RENDERBUFFER_HEIGHT            0x8D43
+#define GL_RENDERBUFFER_INTERNAL_FORMAT   0x8D44
+#define GL_RENDERBUFFER_RED_SIZE          0x8D50
+#define GL_RENDERBUFFER_GREEN_SIZE        0x8D51
+#define GL_RENDERBUFFER_BLUE_SIZE         0x8D52
+#define GL_RENDERBUFFER_ALPHA_SIZE        0x8D53
+#define GL_RENDERBUFFER_DEPTH_SIZE        0x8D54
+#define GL_RENDERBUFFER_STENCIL_SIZE      0x8D55
+
+#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE           0x8CD0
+#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME           0x8CD1
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL         0x8CD2
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3
+
+#define GL_COLOR_ATTACHMENT0              0x8CE0
+#define GL_DEPTH_ATTACHMENT               0x8D00
+#define GL_STENCIL_ATTACHMENT             0x8D20
+
+#define GL_NONE                           0
+
+#define GL_FRAMEBUFFER_COMPLETE                      0x8CD5
+#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT         0x8CD6
+#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7
+#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS         0x8CD9
+#define GL_FRAMEBUFFER_UNSUPPORTED                   0x8CDD
+
+#define GL_FRAMEBUFFER_BINDING            0x8CA6
+#define GL_RENDERBUFFER_BINDING           0x8CA7
+#define GL_MAX_RENDERBUFFER_SIZE          0x84E8
+
+#define GL_INVALID_FRAMEBUFFER_OPERATION  0x0506
+
+/*-------------------------------------------------------------------------
+ * GL core functions.
+ *-----------------------------------------------------------------------*/
+
+GL_APICALL void         GL_APIENTRY glActiveTexture (GLenum texture);
+GL_APICALL void         GL_APIENTRY glAttachShader (GLuint program, GLuint shader);
+GL_APICALL void         GL_APIENTRY glBindAttribLocation (GLuint program, GLuint index, const char* name);
+GL_APICALL void         GL_APIENTRY glBindBuffer (GLenum target, GLuint buffer);
+GL_APICALL void         GL_APIENTRY glBindFramebuffer (GLenum target, GLuint framebuffer);
+GL_APICALL void         GL_APIENTRY glBindRenderbuffer (GLenum target, GLuint renderbuffer);
+GL_APICALL void         GL_APIENTRY glBindTexture (GLenum target, GLuint texture);
+GL_APICALL void         GL_APIENTRY glBlendColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
+GL_APICALL void         GL_APIENTRY glBlendEquation ( GLenum mode );
+GL_APICALL void         GL_APIENTRY glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha);
+GL_APICALL void         GL_APIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor);
+GL_APICALL void         GL_APIENTRY glBlendFuncSeparate (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
+GL_APICALL void         GL_APIENTRY glBufferData (GLenum target, GLsizeiptr size, const void* data, GLenum usage);
+GL_APICALL void         GL_APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const void* data);
+GL_APICALL GLenum       GL_APIENTRY glCheckFramebufferStatus (GLenum target);
+GL_APICALL void         GL_APIENTRY glClear (GLbitfield mask);
+GL_APICALL void         GL_APIENTRY glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
+GL_APICALL void         GL_APIENTRY glClearDepthf (GLclampf depth);
+GL_APICALL void         GL_APIENTRY glClearStencil (GLint s);
+GL_APICALL void         GL_APIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
+GL_APICALL void         GL_APIENTRY glCompileShader (GLuint shader);
+GL_APICALL void         GL_APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data);
+GL_APICALL void         GL_APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data);
+GL_APICALL void         GL_APIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
+GL_APICALL void         GL_APIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+GL_APICALL GLuint       GL_APIENTRY glCreateProgram (void);
+GL_APICALL GLuint       GL_APIENTRY glCreateShader (GLenum type);
+GL_APICALL void         GL_APIENTRY glCullFace (GLenum mode);
+GL_APICALL void         GL_APIENTRY glDeleteBuffers (GLsizei n, const GLuint* buffers);
+GL_APICALL void         GL_APIENTRY glDeleteFramebuffers (GLsizei n, const GLuint* framebuffers);
+GL_APICALL void         GL_APIENTRY glDeleteProgram (GLuint program);
+GL_APICALL void         GL_APIENTRY glDeleteRenderbuffers (GLsizei n, const GLuint* renderbuffers);
+GL_APICALL void         GL_APIENTRY glDeleteShader (GLuint shader);
+GL_APICALL void         GL_APIENTRY glDeleteTextures (GLsizei n, const GLuint* textures);
+GL_APICALL void         GL_APIENTRY glDepthFunc (GLenum func);
+GL_APICALL void         GL_APIENTRY glDepthMask (GLboolean flag);
+GL_APICALL void         GL_APIENTRY glDepthRangef (GLclampf zNear, GLclampf zFar);
+GL_APICALL void         GL_APIENTRY glDetachShader (GLuint program, GLuint shader);
+GL_APICALL void         GL_APIENTRY glDisable (GLenum cap);
+GL_APICALL void         GL_APIENTRY glDisableVertexAttribArray (GLuint index);
+GL_APICALL void         GL_APIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count);
+GL_APICALL void         GL_APIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const void* indices);
+GL_APICALL void         GL_APIENTRY glEnable (GLenum cap);
+GL_APICALL void         GL_APIENTRY glEnableVertexAttribArray (GLuint index);
+GL_APICALL void         GL_APIENTRY glFinish (void);
+GL_APICALL void         GL_APIENTRY glFlush (void);
+GL_APICALL void         GL_APIENTRY glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
+GL_APICALL void         GL_APIENTRY glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
+GL_APICALL void         GL_APIENTRY glFrontFace (GLenum mode);
+GL_APICALL void         GL_APIENTRY glGenBuffers (GLsizei n, GLuint* buffers);
+GL_APICALL void         GL_APIENTRY glGenerateMipmap (GLenum target);
+GL_APICALL void         GL_APIENTRY glGenFramebuffers (GLsizei n, GLuint* framebuffers);
+GL_APICALL void         GL_APIENTRY glGenRenderbuffers (GLsizei n, GLuint* renderbuffers);
+GL_APICALL void         GL_APIENTRY glGenTextures (GLsizei n, GLuint* textures);
+GL_APICALL void         GL_APIENTRY glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name);
+GL_APICALL void         GL_APIENTRY glGetActiveUniform (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name);
+GL_APICALL void         GL_APIENTRY glGetAttachedShaders (GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders);
+GL_APICALL int          GL_APIENTRY glGetAttribLocation (GLuint program, const char* name);
+GL_APICALL void         GL_APIENTRY glGetBooleanv (GLenum pname, GLboolean* params);
+GL_APICALL void         GL_APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint* params);
+GL_APICALL GLenum       GL_APIENTRY glGetError (void);
+GL_APICALL void         GL_APIENTRY glGetFloatv (GLenum pname, GLfloat* params);
+GL_APICALL void         GL_APIENTRY glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint* params);
+GL_APICALL void         GL_APIENTRY glGetIntegerv (GLenum pname, GLint* params);
+GL_APICALL void         GL_APIENTRY glGetProgramiv (GLuint program, GLenum pname, GLint* params);
+GL_APICALL void         GL_APIENTRY glGetProgramInfoLog (GLuint program, GLsizei bufsize, GLsizei* length, char* infolog);
+GL_APICALL void         GL_APIENTRY glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint* params);
+GL_APICALL void         GL_APIENTRY glGetShaderiv (GLuint shader, GLenum pname, GLint* params);
+GL_APICALL void         GL_APIENTRY glGetShaderInfoLog (GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog);
+GL_APICALL void         GL_APIENTRY glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision);
+GL_APICALL void         GL_APIENTRY glGetShaderSource (GLuint shader, GLsizei bufsize, GLsizei* length, char* source);
+GL_APICALL const GLubyte* GL_APIENTRY glGetString (GLenum name);
+GL_APICALL void         GL_APIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat* params);
+GL_APICALL void         GL_APIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint* params);
+GL_APICALL void         GL_APIENTRY glGetUniformfv (GLuint program, GLint location, GLfloat* params);
+GL_APICALL void         GL_APIENTRY glGetUniformiv (GLuint program, GLint location, GLint* params);
+GL_APICALL int          GL_APIENTRY glGetUniformLocation (GLuint program, const char* name);
+GL_APICALL void         GL_APIENTRY glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat* params);
+GL_APICALL void         GL_APIENTRY glGetVertexAttribiv (GLuint index, GLenum pname, GLint* params);
+GL_APICALL void         GL_APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, void** pointer);
+GL_APICALL void         GL_APIENTRY glHint (GLenum target, GLenum mode);
+GL_APICALL GLboolean    GL_APIENTRY glIsBuffer (GLuint buffer);
+GL_APICALL GLboolean    GL_APIENTRY glIsEnabled (GLenum cap);
+GL_APICALL GLboolean    GL_APIENTRY glIsFramebuffer (GLuint framebuffer);
+GL_APICALL GLboolean    GL_APIENTRY glIsProgram (GLuint program);
+GL_APICALL GLboolean    GL_APIENTRY glIsRenderbuffer (GLuint renderbuffer);
+GL_APICALL GLboolean    GL_APIENTRY glIsShader (GLuint shader);
+GL_APICALL GLboolean    GL_APIENTRY glIsTexture (GLuint texture);
+GL_APICALL void         GL_APIENTRY glLineWidth (GLfloat width);
+GL_APICALL void         GL_APIENTRY glLinkProgram (GLuint program);
+GL_APICALL void         GL_APIENTRY glPixelStorei (GLenum pname, GLint param);
+GL_APICALL void         GL_APIENTRY glPolygonOffset (GLfloat factor, GLfloat units);
+GL_APICALL void         GL_APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void* pixels);
+GL_APICALL void         GL_APIENTRY glReleaseShaderCompiler (void);
+GL_APICALL void         GL_APIENTRY glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
+GL_APICALL void         GL_APIENTRY glSampleCoverage (GLclampf value, GLboolean invert);
+GL_APICALL void         GL_APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height);
+GL_APICALL void         GL_APIENTRY glShaderBinary (GLsizei n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLsizei length);
+GL_APICALL void         GL_APIENTRY glShaderSource (GLuint shader, GLsizei count, const char** string, const GLint* length);
+GL_APICALL void         GL_APIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask);
+GL_APICALL void         GL_APIENTRY glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask);
+GL_APICALL void         GL_APIENTRY glStencilMask (GLuint mask);
+GL_APICALL void         GL_APIENTRY glStencilMaskSeparate (GLenum face, GLuint mask);
+GL_APICALL void         GL_APIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass);
+GL_APICALL void         GL_APIENTRY glStencilOpSeparate (GLenum face, GLenum fail, GLenum zfail, GLenum zpass);
+GL_APICALL void         GL_APIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat,  GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels);
+GL_APICALL void         GL_APIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param);
+GL_APICALL void         GL_APIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat* params);
+GL_APICALL void         GL_APIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param);
+GL_APICALL void         GL_APIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint* params);
+GL_APICALL void         GL_APIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels);
+GL_APICALL void         GL_APIENTRY glUniform1f (GLint location, GLfloat x);
+GL_APICALL void         GL_APIENTRY glUniform1fv (GLint location, GLsizei count, const GLfloat* v);
+GL_APICALL void         GL_APIENTRY glUniform1i (GLint location, GLint x);
+GL_APICALL void         GL_APIENTRY glUniform1iv (GLint location, GLsizei count, const GLint* v);
+GL_APICALL void         GL_APIENTRY glUniform2f (GLint location, GLfloat x, GLfloat y);
+GL_APICALL void         GL_APIENTRY glUniform2fv (GLint location, GLsizei count, const GLfloat* v);
+GL_APICALL void         GL_APIENTRY glUniform2i (GLint location, GLint x, GLint y);
+GL_APICALL void         GL_APIENTRY glUniform2iv (GLint location, GLsizei count, const GLint* v);
+GL_APICALL void         GL_APIENTRY glUniform3f (GLint location, GLfloat x, GLfloat y, GLfloat z);
+GL_APICALL void         GL_APIENTRY glUniform3fv (GLint location, GLsizei count, const GLfloat* v);
+GL_APICALL void         GL_APIENTRY glUniform3i (GLint location, GLint x, GLint y, GLint z);
+GL_APICALL void         GL_APIENTRY glUniform3iv (GLint location, GLsizei count, const GLint* v);
+GL_APICALL void         GL_APIENTRY glUniform4f (GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GL_APICALL void         GL_APIENTRY glUniform4fv (GLint location, GLsizei count, const GLfloat* v);
+GL_APICALL void         GL_APIENTRY glUniform4i (GLint location, GLint x, GLint y, GLint z, GLint w);
+GL_APICALL void         GL_APIENTRY glUniform4iv (GLint location, GLsizei count, const GLint* v);
+GL_APICALL void         GL_APIENTRY glUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
+GL_APICALL void         GL_APIENTRY glUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
+GL_APICALL void         GL_APIENTRY glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
+GL_APICALL void         GL_APIENTRY glUseProgram (GLuint program);
+GL_APICALL void         GL_APIENTRY glValidateProgram (GLuint program);
+GL_APICALL void         GL_APIENTRY glVertexAttrib1f (GLuint indx, GLfloat x);
+GL_APICALL void         GL_APIENTRY glVertexAttrib1fv (GLuint indx, const GLfloat* values);
+GL_APICALL void         GL_APIENTRY glVertexAttrib2f (GLuint indx, GLfloat x, GLfloat y);
+GL_APICALL void         GL_APIENTRY glVertexAttrib2fv (GLuint indx, const GLfloat* values);
+GL_APICALL void         GL_APIENTRY glVertexAttrib3f (GLuint indx, GLfloat x, GLfloat y, GLfloat z);
+GL_APICALL void         GL_APIENTRY glVertexAttrib3fv (GLuint indx, const GLfloat* values);
+GL_APICALL void         GL_APIENTRY glVertexAttrib4f (GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+GL_APICALL void         GL_APIENTRY glVertexAttrib4fv (GLuint indx, const GLfloat* values);
+GL_APICALL void         GL_APIENTRY glVertexAttribPointer (GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* ptr);
+GL_APICALL void         GL_APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __gl2_h_ */
diff --git a/ndk/platforms/android-5/include/GLES2/gl2ext.h b/ndk/platforms/android-5/include/GLES2/gl2ext.h
new file mode 100644
index 0000000..72f1ae7
--- /dev/null
+++ b/ndk/platforms/android-5/include/GLES2/gl2ext.h
@@ -0,0 +1,518 @@
+#ifndef __gl2ext_h_
+#define __gl2ext_h_
+
+/* $Revision: 8271 $ on $Date:: 2009-05-21 09:33:40 -0700 #$ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * This document is licensed under the SGI Free Software B License Version
+ * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
+ */
+
+#ifndef GL_APIENTRYP
+#   define GL_APIENTRYP GL_APIENTRY*
+#endif
+
+/*------------------------------------------------------------------------*
+ * OES extension tokens
+ *------------------------------------------------------------------------*/
+
+/* GL_OES_compressed_ETC1_RGB8_texture */
+#ifndef GL_OES_compressed_ETC1_RGB8_texture
+#define GL_ETC1_RGB8_OES                                        0x8D64
+#endif
+
+/* GL_OES_compressed_paletted_texture */
+#ifndef GL_OES_compressed_paletted_texture
+#define GL_PALETTE4_RGB8_OES                                    0x8B90
+#define GL_PALETTE4_RGBA8_OES                                   0x8B91
+#define GL_PALETTE4_R5_G6_B5_OES                                0x8B92
+#define GL_PALETTE4_RGBA4_OES                                   0x8B93
+#define GL_PALETTE4_RGB5_A1_OES                                 0x8B94
+#define GL_PALETTE8_RGB8_OES                                    0x8B95
+#define GL_PALETTE8_RGBA8_OES                                   0x8B96
+#define GL_PALETTE8_R5_G6_B5_OES                                0x8B97
+#define GL_PALETTE8_RGBA4_OES                                   0x8B98
+#define GL_PALETTE8_RGB5_A1_OES                                 0x8B99
+#endif
+
+/* GL_OES_depth24 */
+#ifndef GL_OES_depth24
+#define GL_DEPTH_COMPONENT24_OES                                0x81A6
+#endif
+
+/* GL_OES_depth32 */
+#ifndef GL_OES_depth32
+#define GL_DEPTH_COMPONENT32_OES                                0x81A7
+#endif
+
+/* GL_OES_depth_texture */
+/* No new tokens introduced by this extension. */
+
+/* GL_OES_EGL_image */
+#ifndef GL_OES_EGL_image
+typedef void* GLeglImageOES;
+#endif
+
+/* GL_OES_get_program_binary */
+#ifndef GL_OES_get_program_binary
+#define GL_PROGRAM_BINARY_LENGTH_OES                            0x8741
+#define GL_NUM_PROGRAM_BINARY_FORMATS_OES                       0x87FE
+#define GL_PROGRAM_BINARY_FORMATS_OES                           0x87FF
+#endif
+
+/* GL_OES_mapbuffer */
+#ifndef GL_OES_mapbuffer
+#define GL_WRITE_ONLY_OES                                       0x88B9
+#define GL_BUFFER_ACCESS_OES                                    0x88BB
+#define GL_BUFFER_MAPPED_OES                                    0x88BC
+#define GL_BUFFER_MAP_POINTER_OES                               0x88BD
+#endif
+
+/* GL_OES_packed_depth_stencil */
+#ifndef GL_OES_packed_depth_stencil
+#define GL_DEPTH_STENCIL_OES                                    0x84F9
+#define GL_UNSIGNED_INT_24_8_OES                                0x84FA
+#define GL_DEPTH24_STENCIL8_OES                                 0x88F0
+#endif
+
+/* GL_OES_rgb8_rgba8 */
+#ifndef GL_OES_rgb8_rgba8
+#define GL_RGB8_OES                                             0x8051
+#define GL_RGBA8_OES                                            0x8058
+#endif
+
+/* GL_OES_standard_derivatives */
+#ifndef GL_OES_standard_derivatives
+#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES                  0x8B8B
+#endif
+
+/* GL_OES_stencil1 */
+#ifndef GL_OES_stencil1
+#define GL_STENCIL_INDEX1_OES                                   0x8D46
+#endif
+
+/* GL_OES_stencil4 */
+#ifndef GL_OES_stencil4
+#define GL_STENCIL_INDEX4_OES                                   0x8D47
+#endif
+
+/* GL_OES_texture3D */
+#ifndef GL_OES_texture3D
+#define GL_TEXTURE_WRAP_R_OES                                   0x8072
+#define GL_TEXTURE_3D_OES                                       0x806F
+#define GL_TEXTURE_BINDING_3D_OES                               0x806A
+#define GL_MAX_3D_TEXTURE_SIZE_OES                              0x8073
+#define GL_SAMPLER_3D_OES                                       0x8B5F
+#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_OES        0x8CD4
+#endif
+
+/* GL_OES_texture_half_float */
+#ifndef GL_OES_texture_half_float
+#define GL_HALF_FLOAT_OES                                       0x8D61
+#endif
+
+/* GL_OES_vertex_half_float */
+/* GL_HALF_FLOAT_OES defined in GL_OES_texture_half_float already. */
+
+/* GL_OES_vertex_type_10_10_10_2 */
+#ifndef GL_OES_vertex_type_10_10_10_2
+#define GL_UNSIGNED_INT_10_10_10_2_OES                          0x8DF6
+#define GL_INT_10_10_10_2_OES                                   0x8DF7
+#endif
+
+/*------------------------------------------------------------------------*
+ * AMD extension tokens
+ *------------------------------------------------------------------------*/
+
+/* GL_AMD_compressed_3DC_texture */
+#ifndef GL_AMD_compressed_3DC_texture
+#define GL_3DC_X_AMD                                            0x87F9
+#define GL_3DC_XY_AMD                                           0x87FA
+#endif
+
+/* GL_AMD_compressed_ATC_texture */
+#ifndef GL_AMD_compressed_ATC_texture
+#define GL_ATC_RGB_AMD                                          0x8C92
+#define GL_ATC_RGBA_EXPLICIT_ALPHA_AMD                          0x8C93
+#define GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD                      0x87EE
+#endif
+
+/* GL_AMD_program_binary_Z400 */
+#ifndef GL_AMD_program_binary_Z400
+#define GL_Z400_BINARY_AMD                                      0x8740
+#endif
+
+/* GL_AMD_performance_monitor */
+#ifndef GL_AMD_performance_monitor
+#define GL_COUNTER_TYPE_AMD                                     0x8BC0
+#define GL_COUNTER_RANGE_AMD                                    0x8BC1
+#define GL_UNSIGNED_INT64_AMD                                   0x8BC2
+#define GL_PERCENTAGE_AMD                                       0x8BC3
+#define GL_PERFMON_RESULT_AVAILABLE_AMD                         0x8BC4
+#define GL_PERFMON_RESULT_SIZE_AMD                              0x8BC5
+#define GL_PERFMON_RESULT_AMD                                   0x8BC6
+#endif
+
+/*------------------------------------------------------------------------*
+ * EXT extension tokens
+ *------------------------------------------------------------------------*/
+
+/* GL_EXT_texture_filter_anisotropic */
+#ifndef GL_EXT_texture_filter_anisotropic
+#define GL_TEXTURE_MAX_ANISOTROPY_EXT                           0x84FE
+#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT                       0x84FF
+#endif
+
+/* GL_EXT_texture_type_2_10_10_10_REV */
+#ifndef GL_EXT_texture_type_2_10_10_10_REV
+#define GL_UNSIGNED_INT_2_10_10_10_REV_EXT                      0x8368
+#endif
+
+/* GL_EXT_texture_format_BGRA8888 */
+#ifndef GL_EXT_texture_format_BGRA8888
+#define GL_BGRA                                                 0x80E1
+#endif
+
+/*------------------------------------------------------------------------*
+ * IMG extension tokens
+ *------------------------------------------------------------------------*/
+
+/* GL_IMG_read_format */
+#ifndef GL_IMG_read_format
+#define GL_BGRA                                                 0x80E1
+#define GL_UNSIGNED_SHORT_4_4_4_4_REV                           0x8365
+#define GL_UNSIGNED_SHORT_1_5_5_5_REV                           0x8366
+#endif
+
+/* GL_IMG_texture_compression_pvrtc */
+#ifndef GL_IMG_texture_compression_pvrtc
+#define GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG                      0x8C00
+#define GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG                      0x8C01
+#define GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG                     0x8C02
+#define GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG                     0x8C03
+#endif
+
+/*------------------------------------------------------------------------*
+ * NV extension tokens
+ *------------------------------------------------------------------------*/
+
+/* GL_NV_fence */
+#ifndef GL_NV_fence
+#define GL_ALL_COMPLETED_NV                                     0x84F2
+#define GL_FENCE_STATUS_NV                                      0x84F3
+#define GL_FENCE_CONDITION_NV                                   0x84F4
+#endif
+
+/*------------------------------------------------------------------------*
+ * QCOM extension tokens
+ *------------------------------------------------------------------------*/
+
+/* GL_QCOM_driver_control */
+/* No new tokens introduced by this extension. */
+
+/* GL_QCOM_perfmon_global_mode */
+#ifndef GL_QCOM_perfmon_global_mode
+#define GL_PERFMON_GLOBAL_MODE_QCOM                             0x8FA0
+#endif
+
+/*------------------------------------------------------------------------*
+ * End of extension tokens, start of corresponding extension functions
+ *------------------------------------------------------------------------*/
+
+/*------------------------------------------------------------------------*
+ * OES extension functions
+ *------------------------------------------------------------------------*/
+
+/* GL_OES_compressed_ETC1_RGB8_texture */
+#ifndef GL_OES_compressed_ETC1_RGB8_texture
+#define GL_OES_compressed_ETC1_RGB8_texture 1
+#endif
+
+/* GL_OES_compressed_paletted_texture */
+#ifndef GL_OES_compressed_paletted_texture
+#define GL_OES_compressed_paletted_texture 1
+#endif
+
+/* GL_OES_EGL_image */
+#ifndef GL_OES_EGL_image
+#define GL_OES_EGL_image 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glEGLImageTargetTexture2DOES (GLenum target, GLeglImageOES image);
+GL_APICALL void GL_APIENTRY glEGLImageTargetRenderbufferStorageOES (GLenum target, GLeglImageOES image);
+#endif
+typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETTEXTURE2DOESPROC) (GLenum target, GLeglImageOES image);
+typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLeglImageOES image);
+#endif
+
+/* GL_OES_depth24 */
+#ifndef GL_OES_depth24
+#define GL_OES_depth24 1
+#endif
+
+/* GL_OES_depth32 */
+#ifndef GL_OES_depth32
+#define GL_OES_depth32 1
+#endif
+
+/* GL_OES_depth_texture */
+#ifndef GL_OES_depth_texture
+#define GL_OES_depth_texture 1
+#endif
+
+/* GL_OES_element_index_uint */
+#ifndef GL_OES_element_index_uint
+#define GL_OES_element_index_uint 1
+#endif
+
+/* GL_OES_fbo_render_mipmap */
+#ifndef GL_OES_fbo_render_mipmap
+#define GL_OES_fbo_render_mipmap 1
+#endif
+
+/* GL_OES_fragment_precision_high */
+#ifndef GL_OES_fragment_precision_high
+#define GL_OES_fragment_precision_high 1
+#endif
+
+/* GL_OES_get_program_binary */
+#ifndef GL_OES_get_program_binary
+#define GL_OES_get_program_binary 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glGetProgramBinaryOES (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary);
+GL_APICALL void GL_APIENTRY glProgramBinaryOES (GLuint program, GLenum binaryFormat, const void *binary, GLint length);
+#endif
+typedef void (GL_APIENTRYP PFNGLGETPROGRAMBINARYOESPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary);
+typedef void (GL_APIENTRYP PFNGLPROGRAMBINARYOESPROC) (GLuint program, GLenum binaryFormat, const void *binary, GLint length);
+#endif
+
+/* GL_OES_mapbuffer */
+#ifndef GL_OES_mapbuffer
+#define GL_OES_mapbuffer 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void* GL_APIENTRY glMapBufferOES (GLenum target, GLenum access);
+GL_APICALL GLboolean GL_APIENTRY glUnmapBufferOES (GLenum target);
+GL_APICALL void GL_APIENTRY glGetBufferPointervOES (GLenum target, GLenum pname, void** params);
+#endif
+typedef void* (GL_APIENTRYP PFNGLMAPBUFFEROESPROC) (GLenum target, GLenum access);
+typedef GLboolean (GL_APIENTRYP PFNGLUNMAPBUFFEROESPROC) (GLenum target);
+typedef void (GL_APIENTRYP PFNGLGETBUFFERPOINTERVOESPROC) (GLenum target, GLenum pname, void** params);
+#endif
+
+/* GL_OES_packed_depth_stencil */
+#ifndef GL_OES_packed_depth_stencil
+#define GL_OES_packed_depth_stencil 1
+#endif
+
+/* GL_OES_rgb8_rgba8 */
+#ifndef GL_OES_rgb8_rgba8
+#define GL_OES_rgb8_rgba8 1
+#endif
+
+/* GL_OES_standard_derivatives */
+#ifndef GL_OES_standard_derivatives
+#define GL_OES_standard_derivatives 1
+#endif
+
+/* GL_OES_stencil1 */
+#ifndef GL_OES_stencil1
+#define GL_OES_stencil1 1
+#endif
+
+/* GL_OES_stencil4 */
+#ifndef GL_OES_stencil4
+#define GL_OES_stencil4 1
+#endif
+
+/* GL_OES_texture_3D */
+#ifndef GL_OES_texture_3D
+#define GL_OES_texture_3D 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glTexImage3DOES (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void* pixels);
+GL_APICALL void GL_APIENTRY glTexSubImage3DOES (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void* pixels);
+GL_APICALL void GL_APIENTRY glCopyTexSubImage3DOES (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+GL_APICALL void GL_APIENTRY glCompressedTexImage3DOES (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void* data);
+GL_APICALL void GL_APIENTRY glCompressedTexSubImage3DOES (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void* data);
+GL_APICALL void GL_APIENTRY glFramebufferTexture3DOES (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
+#endif
+typedef void (GL_APIENTRYP PFNGLTEXIMAGE3DOESPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels);
+typedef void (GL_APIENTRYP PFNGLTEXSUBIMAGE3DOESPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void* pixels);
+typedef void (GL_APIENTRYP PFNGLCOPYTEXSUBIMAGE3DOESPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DOESPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void* data);
+typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DOESPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void* data);
+typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DOES) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
+#endif
+
+/* GL_OES_texture_float_linear */
+#ifndef GL_OES_texture_float_linear
+#define GL_OES_texture_float_linear 1
+#endif
+
+/* GL_OES_texture_half_float_linear */
+#ifndef GL_OES_texture_half_float_linear
+#define GL_OES_texture_half_float_linear 1
+#endif
+
+/* GL_OES_texture_float */
+#ifndef GL_OES_texture_float
+#define GL_OES_texture_float 1
+#endif
+
+/* GL_OES_texture_half_float */
+#ifndef GL_OES_texture_half_float
+#define GL_OES_texture_half_float 1
+#endif
+
+/* GL_OES_texture_npot */
+#ifndef GL_OES_texture_npot
+#define GL_OES_texture_npot 1
+#endif
+
+/* GL_OES_vertex_half_float */
+#ifndef GL_OES_vertex_half_float
+#define GL_OES_vertex_half_float 1
+#endif
+
+/* GL_OES_vertex_type_10_10_10_2 */
+#ifndef GL_OES_vertex_type_10_10_10_2
+#define GL_OES_vertex_type_10_10_10_2 1
+#endif
+
+/*------------------------------------------------------------------------*
+ * AMD extension functions
+ *------------------------------------------------------------------------*/
+
+/* GL_AMD_compressed_3DC_texture */
+#ifndef GL_AMD_compressed_3DC_texture
+#define GL_AMD_compressed_3DC_texture 1
+#endif
+
+/* GL_AMD_compressed_ATC_texture */
+#ifndef GL_AMD_compressed_ATC_texture
+#define GL_AMD_compressed_ATC_texture 1
+#endif
+
+/* GL_AMD_program_binary_Z400 */
+#ifndef GL_AMD_program_binary_Z400
+#define GL_AMD_program_binary_Z400 1
+#endif
+
+/* AMD_performance_monitor */
+#ifndef GL_AMD_performance_monitor
+#define GL_AMD_performance_monitor 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glGetPerfMonitorGroupsAMD (GLint *numGroups, GLsizei groupsSize, GLuint *groups);
+GL_APICALL void GL_APIENTRY glGetPerfMonitorCountersAMD (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters);
+GL_APICALL void GL_APIENTRY glGetPerfMonitorGroupStringAMD (GLuint group, GLsizei bufSize, GLsizei *length, char *groupString);
+GL_APICALL void GL_APIENTRY glGetPerfMonitorCounterStringAMD (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, char *counterString);
+GL_APICALL void GL_APIENTRY glGetPerfMonitorCounterInfoAMD (GLuint group, GLuint counter, GLenum pname, void *data);
+GL_APICALL void GL_APIENTRY glGenPerfMonitorsAMD (GLsizei n, GLuint *monitors);
+GL_APICALL void GL_APIENTRY glDeletePerfMonitorsAMD (GLsizei n, GLuint *monitors);
+GL_APICALL void GL_APIENTRY glSelectPerfMonitorCountersAMD (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *countersList);
+GL_APICALL void GL_APIENTRY glBeginPerfMonitorAMD (GLuint monitor);
+GL_APICALL void GL_APIENTRY glEndPerfMonitorAMD (GLuint monitor);
+GL_APICALL void GL_APIENTRY glGetPerfMonitorCounterDataAMD (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten);
+#endif
+typedef void (GL_APIENTRYP PFNGLGETPERFMONITORGROUPSAMDPROC) (GLint *numGroups, GLsizei groupsSize, GLuint *groups);
+typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERSAMDPROC) (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters);
+typedef void (GL_APIENTRYP PFNGLGETPERFMONITORGROUPSTRINGAMDPROC) (GLuint group, GLsizei bufSize, GLsizei *length, char *groupString);
+typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC) (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, char *counterString);
+typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERINFOAMDPROC) (GLuint group, GLuint counter, GLenum pname, void *data);
+typedef void (GL_APIENTRYP PFNGLGENPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors);
+typedef void (GL_APIENTRYP PFNGLDELETEPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors);
+typedef void (GL_APIENTRYP PFNGLSELECTPERFMONITORCOUNTERSAMDPROC) (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *countersList);
+typedef void (GL_APIENTRYP PFNGLBEGINPERFMONITORAMDPROC) (GLuint monitor);
+typedef void (GL_APIENTRYP PFNGLENDPERFMONITORAMDPROC) (GLuint monitor);
+typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERDATAAMDPROC) (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten);
+#endif
+
+/*------------------------------------------------------------------------*
+ * EXT extension functions
+ *------------------------------------------------------------------------*/
+
+/* GL_EXT_texture_filter_anisotropic */
+#ifndef GL_EXT_texture_filter_anisotropic
+#define GL_EXT_texture_filter_anisotropic 1
+#endif
+
+/* GL_EXT_texture_type_2_10_10_10_REV */
+#ifndef GL_EXT_texture_type_2_10_10_10_REV
+#define GL_EXT_texture_type_2_10_10_10_REV 1
+#endif
+
+/* GL_EXT_texture_format_BGRA8888 */
+#ifndef GL_EXT_texture_format_BGRA8888
+#define GL_EXT_texture_format_BGRA8888 1
+#endif
+
+/*------------------------------------------------------------------------*
+ * IMG extension functions
+ *------------------------------------------------------------------------*/
+
+/* GL_IMG_read_format */
+#ifndef GL_IMG_read_format
+#define GL_IMG_read_format 1
+#endif
+
+/* GL_IMG_texture_compression_pvrtc */
+#ifndef GL_IMG_texture_compression_pvrtc
+#define GL_IMG_texture_compression_pvrtc 1
+#endif
+
+/*------------------------------------------------------------------------*
+ * NV extension functions
+ *------------------------------------------------------------------------*/
+
+/* GL_NV_fence */
+#ifndef GL_NV_fence
+#define GL_NV_fence 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glDeleteFencesNV (GLsizei n, const GLuint *fences);
+GL_APICALL void GL_APIENTRY glGenFencesNV (GLsizei n, GLuint *fences);
+GL_APICALL GLboolean GL_APIENTRY glIsFenceNV (GLuint fence);
+GL_APICALL GLboolean GL_APIENTRY glTestFenceNV (GLuint fence);
+GL_APICALL void GL_APIENTRY glGetFenceivNV (GLuint fence, GLenum pname, GLint *params);
+GL_APICALL void GL_APIENTRY glFinishFenceNV (GLuint fence);
+GL_APICALL void GL_APIENTRY glSetFenceNV (GLuint fence, GLenum condition);
+#endif
+typedef void (GL_APIENTRYP PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences);
+typedef void (GL_APIENTRYP PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences);
+typedef GLboolean (GL_APIENTRYP PFNGLISFENCENVPROC) (GLuint fence);
+typedef GLboolean (GL_APIENTRYP PFNGLTESTFENCENVPROC) (GLuint fence);
+typedef void (GL_APIENTRYP PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint *params);
+typedef void (GL_APIENTRYP PFNGLFINISHFENCENVPROC) (GLuint fence);
+typedef void (GL_APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition);
+#endif
+
+/*------------------------------------------------------------------------*
+ * QCOM extension functions
+ *------------------------------------------------------------------------*/
+
+/* GL_QCOM_driver_control */
+#ifndef GL_QCOM_driver_control
+#define GL_QCOM_driver_control 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glGetDriverControlsQCOM (GLint *num, GLsizei size, GLuint *driverControls);
+GL_APICALL void GL_APIENTRY glGetDriverControlStringQCOM (GLuint driverControl, GLsizei bufSize, GLsizei *length, char *driverControlString);
+GL_APICALL void GL_APIENTRY glEnableDriverControlQCOM (GLuint driverControl);
+GL_APICALL void GL_APIENTRY glDisableDriverControlQCOM (GLuint driverControl);
+#endif
+typedef void (GL_APIENTRYP PFNGLGETDRIVERCONTROLSQCOMPROC) (GLint *num, GLsizei size, GLuint *driverControls);
+typedef void (GL_APIENTRYP PFNGLGETDRIVERCONTROLSTRINGQCOMPROC) (GLuint driverControl, GLsizei bufSize, GLsizei *length, char *driverControlString);
+typedef void (GL_APIENTRYP PFNGLENABLEDRIVERCONTROLQCOMPROC) (GLuint driverControl);
+typedef void (GL_APIENTRYP PFNGLDISABLEDRIVERCONTROLQCOMPROC) (GLuint driverControl);
+#endif
+
+/* GL_QCOM_perfmon_global_mode */
+#ifndef GL_QCOM_perfmon_global_mode
+#define GL_QCOM_perfmon_global_mode 1
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __gl2ext_h_ */
diff --git a/ndk/platforms/android-5/include/GLES2/gl2platform.h b/ndk/platforms/android-5/include/GLES2/gl2platform.h
new file mode 100644
index 0000000..3e9036c
--- /dev/null
+++ b/ndk/platforms/android-5/include/GLES2/gl2platform.h
@@ -0,0 +1,29 @@
+#ifndef __gl2platform_h_
+#define __gl2platform_h_
+
+/* $Revision: 7173 $ on $Date:: 2009-01-09 11:18:21 -0800 #$ */
+
+/*
+ * This document is licensed under the SGI Free Software B License Version
+ * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
+ */
+
+/* Platform-specific types and definitions for OpenGL ES 2.X  gl2.h
+ * Last modified on 2008/12/19
+ *
+ * Adopters may modify khrplatform.h and this file to suit their platform.
+ * You are encouraged to submit all modifications to the Khronos group so that
+ * they can be included in future versions of this file.  Please submit changes
+ * by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla)
+ * by filing a bug against product "OpenGL-ES" component "Registry".
+ */
+
+#include <KHR/khrplatform.h>
+
+#ifndef GL_APICALL
+#define GL_APICALL  KHRONOS_APICALL
+#endif
+
+#define GL_APIENTRY KHRONOS_APIENTRY
+
+#endif /* __gl2platform_h_ */
diff --git a/ndk/platforms/android-5/include/pthread.h b/ndk/platforms/android-5/include/pthread.h
new file mode 100644
index 0000000..6603b3f
--- /dev/null
+++ b/ndk/platforms/android-5/include/pthread.h
@@ -0,0 +1,270 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _PTHREAD_H_
+#define _PTHREAD_H_
+
+#include <time.h>
+#include <signal.h>
+#include <sched.h>
+#include <limits.h>
+#include <sys/types.h>
+
+/*
+ * Types
+ */
+typedef struct
+{
+    int volatile value;
+} pthread_mutex_t;
+
+#define  PTHREAD_MUTEX_INITIALIZER             {0}
+#define  PTHREAD_RECURSIVE_MUTEX_INITIALIZER   {0x4000}
+#define  PTHREAD_ERRORCHECK_MUTEX_INITIALIZER  {0x8000}
+
+enum {
+    PTHREAD_MUTEX_NORMAL = 0,
+    PTHREAD_MUTEX_RECURSIVE = 1,
+    PTHREAD_MUTEX_ERRORCHECK = 2,
+
+    PTHREAD_MUTEX_ERRORCHECK_NP = PTHREAD_MUTEX_ERRORCHECK,
+    PTHREAD_MUTEX_RECURSIVE_NP  = PTHREAD_MUTEX_RECURSIVE,
+
+    PTHREAD_MUTEX_DEFAULT = PTHREAD_MUTEX_NORMAL
+};
+
+
+
+typedef struct
+{
+    int volatile value;
+} pthread_cond_t;
+
+typedef struct
+{
+    uint32_t flags;
+    void * stack_base;
+    size_t stack_size;
+    size_t guard_size;
+    int32_t sched_policy;
+    int32_t sched_priority;
+} pthread_attr_t;
+
+typedef long pthread_mutexattr_t;
+typedef long pthread_condattr_t;
+
+typedef int pthread_key_t;
+typedef long pthread_t;
+
+typedef volatile int  pthread_once_t;
+
+/*
+ * Defines
+ */
+#define PTHREAD_COND_INITIALIZER  {0}
+
+#define PTHREAD_STACK_MIN (2 * PAGE_SIZE)
+
+#define PTHREAD_CREATE_DETACHED  0x00000001
+#define PTHREAD_CREATE_JOINABLE  0x00000000
+
+#define PTHREAD_ONCE_INIT    0
+
+#define PTHREAD_PROCESS_PRIVATE  0
+#define PTHREAD_PROCESS_SHARED   1
+
+#define PTHREAD_SCOPE_SYSTEM     0
+#define PTHREAD_SCOPE_PROCESS    1
+
+/*
+ * Prototypes
+ */
+#if __cplusplus
+extern "C" {
+#endif
+
+int pthread_attr_init(pthread_attr_t * attr);
+int pthread_attr_destroy(pthread_attr_t * attr);
+
+int pthread_attr_setdetachstate(pthread_attr_t * attr, int state);
+int pthread_attr_getdetachstate(pthread_attr_t const * attr, int * state);
+
+int pthread_attr_setschedpolicy(pthread_attr_t * attr, int policy);
+int pthread_attr_getschedpolicy(pthread_attr_t const * attr, int * policy);
+
+int pthread_attr_setschedparam(pthread_attr_t * attr, struct sched_param const * param);
+int pthread_attr_getschedparam(pthread_attr_t const * attr, struct sched_param * param);
+
+int pthread_attr_setstacksize(pthread_attr_t * attr, size_t stack_size);
+int pthread_attr_getstacksize(pthread_attr_t const * attr, size_t * stack_size);
+
+int pthread_attr_setstackaddr(pthread_attr_t * attr, void * stackaddr);
+int pthread_attr_getstackaddr(pthread_attr_t const * attr, void ** stackaddr);
+
+int pthread_attr_setstack(pthread_attr_t * attr, void * stackaddr, size_t stack_size);
+int pthread_attr_getstack(pthread_attr_t const * attr, void ** stackaddr, size_t * stack_size);
+
+int pthread_attr_setguardsize(pthread_attr_t * attr, size_t guard_size);
+int pthread_attr_getguardsize(pthread_attr_t const * attr, size_t * guard_size);
+
+int pthread_attr_setscope(pthread_attr_t *attr, int  scope);
+int pthread_attr_getscope(pthread_attr_t const *attr);
+
+int pthread_getattr_np(pthread_t thid, pthread_attr_t * attr);
+
+int pthread_create(pthread_t *thread, pthread_attr_t const * attr,
+                   void *(*start_routine)(void *), void * arg);
+void pthread_exit(void * retval);
+int pthread_join(pthread_t thid, void ** ret_val);
+int pthread_detach(pthread_t  thid);
+
+pthread_t pthread_self(void);
+int pthread_equal(pthread_t one, pthread_t two);
+
+int pthread_getschedparam(pthread_t thid, int * policy,
+                          struct sched_param * param);
+int pthread_setschedparam(pthread_t thid, int poilcy,
+                          struct sched_param const * param);
+
+int pthread_mutexattr_init(pthread_mutexattr_t *attr);
+int pthread_mutexattr_destroy(pthread_mutexattr_t *attr);
+int pthread_mutexattr_gettype(const pthread_mutexattr_t *attr, int *type);
+int pthread_mutexattr_settype(pthread_mutexattr_t *attr, int type);
+int pthread_mutexattr_setpshared(pthread_mutexattr_t *attr, int  pshared);
+int pthread_mutexattr_getpshared(pthread_mutexattr_t *attr, int *pshared);
+
+int pthread_mutex_init(pthread_mutex_t *mutex,
+                       const pthread_mutexattr_t *attr);
+int pthread_mutex_destroy(pthread_mutex_t *mutex);
+int pthread_mutex_lock(pthread_mutex_t *mutex);
+int pthread_mutex_unlock(pthread_mutex_t *mutex);
+int pthread_mutex_trylock(pthread_mutex_t *mutex);
+int pthread_mutex_timedlock(pthread_mutex_t *mutex, struct timespec*  ts);
+
+int pthread_cond_init(pthread_cond_t *cond,
+                      const pthread_condattr_t *attr);
+int pthread_cond_destroy(pthread_cond_t *cond);
+int pthread_cond_broadcast(pthread_cond_t *cond);
+int pthread_cond_signal(pthread_cond_t *cond);
+int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex);
+int pthread_cond_timedwait(pthread_cond_t *cond,
+                           pthread_mutex_t * mutex,
+                           const struct timespec *abstime);
+
+/* BIONIC: same as pthread_cond_timedwait, except the 'abstime' given refers
+ *         to the CLOCK_MONOTONIC clock instead, to avoid any problems when
+ *         the wall-clock time is changed brutally
+ */
+int pthread_cond_timedwait_monotonic_np(pthread_cond_t         *cond,
+                                        pthread_mutex_t        *mutex,
+                                        const struct timespec  *abstime);
+
+/* BIONIC: DEPRECATED. same as pthread_cond_timedwait_monotonic_np()
+ * unfortunately pthread_cond_timedwait_monotonic has shipped already
+ */
+int pthread_cond_timedwait_monotonic(pthread_cond_t         *cond,
+                                     pthread_mutex_t        *mutex,
+                                     const struct timespec  *abstime);
+
+#define HAVE_PTHREAD_COND_TIMEDWAIT_MONOTONIC 1
+
+/* BIONIC: same as pthread_cond_timedwait, except the 'reltime' given refers
+ *         is relative to the current time.
+ */
+int pthread_cond_timedwait_relative_np(pthread_cond_t         *cond,
+                                     pthread_mutex_t        *mutex,
+                                     const struct timespec  *reltime);
+
+#define HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE 1
+
+
+
+int pthread_cond_timeout_np(pthread_cond_t *cond,
+                            pthread_mutex_t * mutex,
+                            unsigned msecs);
+
+/* same as pthread_mutex_lock(), but will wait up to 'msecs' milli-seconds
+ * before returning. same return values than pthread_mutex_trylock though, i.e.
+ * returns EBUSY if the lock could not be acquired after the timeout
+ * expired.
+ */
+int pthread_mutex_lock_timeout_np(pthread_mutex_t *mutex, unsigned msecs);
+
+int pthread_key_create(pthread_key_t *key, void (*destructor_function)(void *));
+int pthread_key_delete (pthread_key_t);
+int pthread_setspecific(pthread_key_t key, const void *value);
+void *pthread_getspecific(pthread_key_t key);
+
+int pthread_kill(pthread_t tid, int sig);
+int pthread_sigmask(int how, const sigset_t *set, sigset_t *oset);
+
+int pthread_getcpuclockid(pthread_t  tid, clockid_t  *clockid);
+
+int pthread_once(pthread_once_t  *once_control, void (*init_routine)(void));
+
+typedef void  (*__pthread_cleanup_func_t)(void*);
+
+typedef struct __pthread_cleanup_t {
+    struct __pthread_cleanup_t*   __cleanup_prev;
+    __pthread_cleanup_func_t      __cleanup_routine;
+    void*                         __cleanup_arg;
+} __pthread_cleanup_t;
+
+extern void  __pthread_cleanup_push(__pthread_cleanup_t*      c,
+                                    __pthread_cleanup_func_t  routine,
+                                    void*                     arg);
+
+extern void  __pthread_cleanup_pop(__pthread_cleanup_t*  c,
+                                   int                   execute);
+
+/* Believe or not, the definitions of pthread_cleanup_push and
+ * pthread_cleanup_pop below are correct. Posix states that these
+ * can be implemented as macros that might introduce opening and
+ * closing braces, and that using setjmp/longjmp/return/break/continue
+ * between them results in undefined behaviour.
+ *
+ * And indeed, GLibc and other C libraries use a similar definition
+ */
+#define  pthread_cleanup_push(routine, arg)                      \
+    do {                                                         \
+        __pthread_cleanup_t  __cleanup;                          \
+        __pthread_cleanup_push( &__cleanup, (routine), (arg) );  \
+
+#define  pthread_cleanup_pop(execute)                  \
+        __pthread_cleanup_pop( &__cleanup, (execute)); \
+    } while (0);
+
+#if __cplusplus
+} /* extern "C" */
+#endif
+
+/************ TO FIX ************/
+
+#define LONG_LONG_MAX __LONG_LONG_MAX__
+#define LONG_LONG_MIN (-__LONG_LONG_MAX__ - 1)
+
+#endif // _PTHREAD_H_
diff --git a/ndk/platforms/android-5/samples/hello-gl2/Android.mk b/ndk/platforms/android-5/samples/hello-gl2/Android.mk
new file mode 100644
index 0000000..2e36165
--- /dev/null
+++ b/ndk/platforms/android-5/samples/hello-gl2/Android.mk
@@ -0,0 +1,10 @@
+LOCAL_PATH:= $(LOCAL_PATH)/jni
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE    := libgl2jni
+LOCAL_CFLAGS    := -Werror
+LOCAL_SRC_FILES := gl_code.cpp
+LOCAL_LDLIBS    := -llog -lGLESv2
+
+include $(BUILD_SHARED_LIBRARY)
diff --git a/ndk/platforms/android-5/samples/hello-gl2/AndroidManifest.xml b/ndk/platforms/android-5/samples/hello-gl2/AndroidManifest.xml
new file mode 100644
index 0000000..5a4d5f2
--- /dev/null
+++ b/ndk/platforms/android-5/samples/hello-gl2/AndroidManifest.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2009, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License"); 
+** you may not use this file except in compliance with the License. 
+** You may obtain a copy of the License at 
+**
+**     http://www.apache.org/licenses/LICENSE-2.0 
+**
+** Unless required by applicable law or agreed to in writing, software 
+** distributed under the License is distributed on an "AS IS" BASIS, 
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+** See the License for the specific language governing permissions and 
+** limitations under the License.
+*/
+-->
+
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+    package="com.android.gl2jni">
+    <application
+            android:label="@string/gl2jni_activity">
+        <activity android:name="GL2JNIActivity"
+                android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
+            	android:launchMode="singleTask"
+            	android:configChanges="orientation|keyboardHidden">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.LAUNCHER" />
+            </intent-filter>
+        </activity>
+    </application>
+    <uses-feature android:glEsVersion="0x00020000"/>
+    <uses-sdk android:minSdkVersion="5"/>
+</manifest>
diff --git a/ndk/platforms/android-5/samples/hello-gl2/default.properties b/ndk/platforms/android-5/samples/hello-gl2/default.properties
new file mode 100644
index 0000000..dbf05f2
--- /dev/null
+++ b/ndk/platforms/android-5/samples/hello-gl2/default.properties
@@ -0,0 +1,11 @@
+# This file is automatically generated by Android Tools.
+# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
+# 
+# This file must be checked in Version Control Systems.
+# 
+# To customize properties used by the Ant build system use,
+# "build.properties", and override values to adapt the script to your
+# project structure.
+
+# Project target.
+target=android-5
diff --git a/ndk/platforms/android-5/samples/hello-gl2/jni/Android.mk b/ndk/platforms/android-5/samples/hello-gl2/jni/Android.mk
new file mode 100644
index 0000000..a995c86
--- /dev/null
+++ b/ndk/platforms/android-5/samples/hello-gl2/jni/Android.mk
@@ -0,0 +1,24 @@
+# Copyright (C) 2009 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+LOCAL_PATH:= $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE    := libgl2jni
+LOCAL_CFLAGS    := -Werror
+LOCAL_SRC_FILES := gl_code.cpp
+LOCAL_LDLIBS    := -llog -lGLESv2
+
+include $(BUILD_SHARED_LIBRARY)
diff --git a/ndk/platforms/android-5/samples/hello-gl2/jni/gl_code.cpp b/ndk/platforms/android-5/samples/hello-gl2/jni/gl_code.cpp
new file mode 100644
index 0000000..42d99d3
--- /dev/null
+++ b/ndk/platforms/android-5/samples/hello-gl2/jni/gl_code.cpp
@@ -0,0 +1,184 @@
+/*
+ * Copyright (C) 2009 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// OpenGL ES 2.0 code
+
+#include <jni.h>
+#include <android/log.h>
+
+#include <GLES2/gl2.h>
+#include <GLES2/gl2ext.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+
+#define  LOG_TAG    "libgl2jni"
+#define  LOGI(...)  __android_log_print(ANDROID_LOG_INFO,LOG_TAG,__VA_ARGS__)
+#define  LOGE(...)  __android_log_print(ANDROID_LOG_ERROR,LOG_TAG,__VA_ARGS__)
+
+static void printGLString(const char *name, GLenum s) {
+    const char *v = (const char *) glGetString(s);
+    LOGI("GL %s = %s\n", name, v);
+}
+
+static void checkGlError(const char* op) {
+    for (GLint error = glGetError(); error; error
+            = glGetError()) {
+        LOGI("after %s() glError (0x%x)\n", op, error);
+    }
+}
+
+static const char gVertexShader[] = 
+    "attribute vec4 vPosition;\n"
+    "void main() {\n"
+    "  gl_Position = vPosition;\n"
+    "}\n";
+
+static const char gFragmentShader[] = 
+    "precision mediump float;\n"
+    "void main() {\n"
+    "  gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);\n"
+    "}\n";
+
+GLuint loadShader(GLenum shaderType, const char* pSource) {
+    GLuint shader = glCreateShader(shaderType);
+    if (shader) {
+        glShaderSource(shader, 1, &pSource, NULL);
+        glCompileShader(shader);
+        GLint compiled = 0;
+        glGetShaderiv(shader, GL_COMPILE_STATUS, &compiled);
+        if (!compiled) {
+            GLint infoLen = 0;
+            glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &infoLen);
+            if (infoLen) {
+                char* buf = (char*) malloc(infoLen);
+                if (buf) {
+                    glGetShaderInfoLog(shader, infoLen, NULL, buf);
+                    LOGE("Could not compile shader %d:\n%s\n",
+                            shaderType, buf);
+                    free(buf);
+                }
+                glDeleteShader(shader);
+                shader = 0;
+            }
+        }
+    }
+    return shader;
+}
+
+GLuint createProgram(const char* pVertexSource, const char* pFragmentSource) {
+    GLuint vertexShader = loadShader(GL_VERTEX_SHADER, pVertexSource);
+    if (!vertexShader) {
+        return 0;
+    }
+
+    GLuint pixelShader = loadShader(GL_FRAGMENT_SHADER, pFragmentSource);
+    if (!pixelShader) {
+        return 0;
+    }
+
+    GLuint program = glCreateProgram();
+    if (program) {
+        glAttachShader(program, vertexShader);
+        checkGlError("glAttachShader");
+        glAttachShader(program, pixelShader);
+        checkGlError("glAttachShader");
+        glLinkProgram(program);
+        GLint linkStatus = GL_FALSE;
+        glGetProgramiv(program, GL_LINK_STATUS, &linkStatus);
+        if (linkStatus != GL_TRUE) {
+            GLint bufLength = 0;
+            glGetProgramiv(program, GL_INFO_LOG_LENGTH, &bufLength);
+            if (bufLength) {
+                char* buf = (char*) malloc(bufLength);
+                if (buf) {
+                    glGetProgramInfoLog(program, bufLength, NULL, buf);
+                    LOGE("Could not link program:\n%s\n", buf);
+                    free(buf);
+                }
+            }
+            glDeleteProgram(program);
+            program = 0;
+        }
+    }
+    return program;
+}
+
+GLuint gProgram;
+GLuint gvPositionHandle;
+
+bool setupGraphics(int w, int h) {
+    printGLString("Version", GL_VERSION);
+    printGLString("Vendor", GL_VENDOR);
+    printGLString("Renderer", GL_RENDERER);
+    printGLString("Extensions", GL_EXTENSIONS);
+
+    LOGI("setupGraphics(%d, %d)", w, h);
+    gProgram = createProgram(gVertexShader, gFragmentShader);
+    if (!gProgram) {
+        LOGE("Could not create program.");
+        return false;
+    }
+    gvPositionHandle = glGetAttribLocation(gProgram, "vPosition");
+    checkGlError("glGetAttribLocation");
+    LOGI("glGetAttribLocation(\"vPosition\") = %d\n",
+            gvPositionHandle);
+
+    glViewport(0, 0, w, h);
+    checkGlError("glViewport");
+    return true;
+}
+
+const GLfloat gTriangleVertices[] = { 0.0f, 0.5f, -0.5f, -0.5f,
+        0.5f, -0.5f };
+
+void renderFrame() {
+    static float grey;
+    grey += 0.01f;
+    if (grey > 1.0f) {
+        grey = 0.0f;
+    }
+    glClearColor(grey, grey, grey, 1.0f);
+    checkGlError("glClearColor");
+    glClear( GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
+    checkGlError("glClear");
+
+    glUseProgram(gProgram);
+    checkGlError("glUseProgram");
+
+    glVertexAttribPointer(gvPositionHandle, 2, GL_FLOAT, GL_FALSE, 0, gTriangleVertices);
+    checkGlError("glVertexAttribPointer");
+    glEnableVertexAttribArray(gvPositionHandle);
+    checkGlError("glEnableVertexAttribArray");
+    glDrawArrays(GL_TRIANGLES, 0, 3);
+    checkGlError("glDrawArrays");
+}
+
+extern "C" {
+    JNIEXPORT void JNICALL Java_com_android_gl2jni_GL2JNILib_init(JNIEnv * env, jobject obj,  jint width, jint height);
+    JNIEXPORT void JNICALL Java_com_android_gl2jni_GL2JNILib_step(JNIEnv * env, jobject obj);
+};
+
+JNIEXPORT void JNICALL Java_com_android_gl2jni_GL2JNILib_init(JNIEnv * env, jobject obj,  jint width, jint height)
+{
+    setupGraphics(width, height);
+}
+
+JNIEXPORT void JNICALL Java_com_android_gl2jni_GL2JNILib_step(JNIEnv * env, jobject obj)
+{
+    renderFrame();
+}
diff --git a/ndk/platforms/android-5/samples/hello-gl2/res/values/strings.xml b/ndk/platforms/android-5/samples/hello-gl2/res/values/strings.xml
new file mode 100644
index 0000000..e3f7331
--- /dev/null
+++ b/ndk/platforms/android-5/samples/hello-gl2/res/values/strings.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2006, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License"); 
+** you may not use this file except in compliance with the License. 
+** You may obtain a copy of the License at 
+**
+**     http://www.apache.org/licenses/LICENSE-2.0 
+**
+** Unless required by applicable law or agreed to in writing, software 
+** distributed under the License is distributed on an "AS IS" BASIS, 
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+** See the License for the specific language governing permissions and 
+** limitations under the License.
+*/
+-->
+
+<!-- This file contains resource definitions for displayed strings, allowing
+     them to be changed based on the locale and options. -->
+
+<resources>
+    <!-- Simple strings. -->
+    <string name="gl2jni_activity">GL2JNI</string>
+
+</resources>
+
diff --git a/ndk/platforms/android-5/samples/hello-gl2/src/com/android/gl2jni/GL2JNIActivity.java b/ndk/platforms/android-5/samples/hello-gl2/src/com/android/gl2jni/GL2JNIActivity.java
new file mode 100644
index 0000000..c366a2c
--- /dev/null
+++ b/ndk/platforms/android-5/samples/hello-gl2/src/com/android/gl2jni/GL2JNIActivity.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2007 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.gl2jni;
+
+import android.app.Activity;
+import android.os.Bundle;
+import android.util.Log;
+import android.view.WindowManager;
+
+import java.io.File;
+
+
+public class GL2JNIActivity extends Activity {
+
+    GL2JNIView mView;
+
+    @Override protected void onCreate(Bundle icicle) {
+        super.onCreate(icicle);
+        mView = new GL2JNIView(getApplication());
+	setContentView(mView);
+    }
+
+    @Override protected void onPause() {
+        super.onPause();
+        mView.onPause();
+    }
+
+    @Override protected void onResume() {
+        super.onResume();
+        mView.onResume();
+    }
+}
diff --git a/ndk/platforms/android-5/samples/hello-gl2/src/com/android/gl2jni/GL2JNILib.java b/ndk/platforms/android-5/samples/hello-gl2/src/com/android/gl2jni/GL2JNILib.java
new file mode 100644
index 0000000..040a984
--- /dev/null
+++ b/ndk/platforms/android-5/samples/hello-gl2/src/com/android/gl2jni/GL2JNILib.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2007 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.gl2jni;
+
+// Wrapper for native library
+
+public class GL2JNILib {
+
+     static {
+         System.loadLibrary("gl2jni");
+     }
+
+    /**
+     * @param width the current view width
+     * @param height the current view height
+     */
+     public static native void init(int width, int height);
+     public static native void step();
+}
diff --git a/ndk/platforms/android-5/samples/hello-gl2/src/com/android/gl2jni/GL2JNIView.java b/ndk/platforms/android-5/samples/hello-gl2/src/com/android/gl2jni/GL2JNIView.java
new file mode 100644
index 0000000..060290a
--- /dev/null
+++ b/ndk/platforms/android-5/samples/hello-gl2/src/com/android/gl2jni/GL2JNIView.java
@@ -0,0 +1,339 @@
+/*
+ * Copyright (C) 2009 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.gl2jni;
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+import android.content.Context;
+import android.graphics.PixelFormat;
+import android.opengl.GLSurfaceView;
+import android.util.AttributeSet;
+import android.util.Log;
+import android.view.KeyEvent;
+import android.view.MotionEvent;
+
+import javax.microedition.khronos.egl.EGL10;
+import javax.microedition.khronos.egl.EGLConfig;
+import javax.microedition.khronos.egl.EGLContext;
+import javax.microedition.khronos.egl.EGLDisplay;
+import javax.microedition.khronos.opengles.GL10;
+
+/**
+ * A simple GLSurfaceView sub-class that demonstrate how to perform
+ * OpenGL ES 2.0 rendering into a GL Surface. Note the following important
+ * details:
+ *
+ * - The class must use a custom context factory to enable 2.0 rendering.
+ *   See ContextFactory class definition below.
+ *
+ * - The class must use a custom EGLConfigChooser to be able to select
+ *   an EGLConfig that supports 2.0. This is done by providing a config
+ *   specification to eglChooseConfig() that has the attribute
+ *   EGL10.ELG_RENDERABLE_TYPE containing the EGL_OPENGL_ES2_BIT flag
+ *   set. See ConfigChooser class definition below.
+ *
+ * - The class must select the surface's format, then choose an EGLConfig
+ *   that matches it exactly (with regards to red/green/blue/alpha channels
+ *   bit depths). Failure to do so would result in an EGL_BAD_MATCH error.
+ */
+class GL2JNIView extends GLSurfaceView {
+    private static String TAG = "GL2JNIView";
+    private static final boolean DEBUG = false;
+
+    public GL2JNIView(Context context) {
+        super(context);
+        init(false, 0, 0);
+    }
+
+    public GL2JNIView(Context context, boolean translucent, int depth, int stencil) {
+        super(context);
+        init(translucent, depth, stencil);
+    }
+
+    private void init(boolean translucent, int depth, int stencil) {
+
+        /* By default, GLSurfaceView() creates a RGB_565 opaque surface.
+         * If we want a translucent one, we should change the surface's
+         * format here, using PixelFormat.TRANSLUCENT for GL Surfaces
+         * is interpreted as any 32-bit surface with alpha by SurfaceFlinger.
+         */
+        if (translucent) {
+            this.getHolder().setFormat(PixelFormat.TRANSLUCENT);
+        }
+
+        /* Setup the context factory for 2.0 rendering.
+         * See ContextFactory class definition below
+         */
+        setEGLContextFactory(new ContextFactory());
+
+        /* We need to choose an EGLConfig that matches the format of
+         * our surface exactly. This is going to be done in our
+         * custom config chooser. See ConfigChooser class definition
+         * below.
+         */
+        setEGLConfigChooser( translucent ?
+                             new ConfigChooser(8, 8, 8, 8, depth, stencil) :
+                             new ConfigChooser(5, 6, 5, 0, depth, stencil) );
+
+        /* Set the renderer responsible for frame rendering */
+        setRenderer(new Renderer());
+    }
+
+    private static class ContextFactory implements GLSurfaceView.EGLContextFactory {
+        private static int EGL_CONTEXT_CLIENT_VERSION = 0x3098;
+        public EGLContext createContext(EGL10 egl, EGLDisplay display, EGLConfig eglConfig) {
+            Log.w(TAG, "creating OpenGL ES 2.0 context");
+            checkEglError("Before eglCreateContext", egl);
+            int[] attrib_list = {EGL_CONTEXT_CLIENT_VERSION, 2, EGL10.EGL_NONE };
+            EGLContext context = egl.eglCreateContext(display, eglConfig, EGL10.EGL_NO_CONTEXT, attrib_list);
+            checkEglError("After eglCreateContext", egl);
+            return context;
+        }
+
+        public void destroyContext(EGL10 egl, EGLDisplay display, EGLContext context) {
+            egl.eglDestroyContext(display, context);
+        }
+    }
+
+    private static void checkEglError(String prompt, EGL10 egl) {
+        int error;
+        while ((error = egl.eglGetError()) != EGL10.EGL_SUCCESS) {
+            Log.e(TAG, String.format("%s: EGL error: 0x%x", prompt, error));
+        }
+    }
+
+    private static class ConfigChooser implements GLSurfaceView.EGLConfigChooser {
+
+        public ConfigChooser(int r, int g, int b, int a, int depth, int stencil) {
+            mRedSize = r;
+            mGreenSize = g;
+            mBlueSize = b;
+            mAlphaSize = a;
+            mDepthSize = depth;
+            mStencilSize = stencil;
+        }
+
+        /* This EGL config specification is used to specify 2.0 rendering.
+         * We use a minimum size of 4 bits for red/green/blue, but will
+         * perform actual matching in chooseConfig() below.
+         */
+        private static int EGL_OPENGL_ES2_BIT = 4;
+        private static int[] s_configAttribs2 =
+        {
+            EGL10.EGL_RED_SIZE, 4,
+            EGL10.EGL_GREEN_SIZE, 4,
+            EGL10.EGL_BLUE_SIZE, 4,
+            EGL10.EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
+            EGL10.EGL_NONE
+        };
+
+        public EGLConfig chooseConfig(EGL10 egl, EGLDisplay display) {
+
+            /* Get the number of minimally matching EGL configurations
+             */
+            int[] num_config = new int[1];
+            egl.eglChooseConfig(display, s_configAttribs2, null, 0, num_config);
+
+            int numConfigs = num_config[0];
+
+            if (numConfigs <= 0) {
+                throw new IllegalArgumentException("No configs match configSpec");
+            }
+
+            /* Allocate then read the array of minimally matching EGL configs
+             */
+            EGLConfig[] configs = new EGLConfig[numConfigs];
+            egl.eglChooseConfig(display, s_configAttribs2, configs, numConfigs, num_config);
+
+            if (DEBUG) {
+                 printConfigs(egl, display, configs);
+            }
+            /* Now return the "best" one
+             */
+            return chooseConfig(egl, display, configs);
+        }
+
+        public EGLConfig chooseConfig(EGL10 egl, EGLDisplay display,
+                EGLConfig[] configs) {
+            for(EGLConfig config : configs) {
+                int d = findConfigAttrib(egl, display, config,
+                        EGL10.EGL_DEPTH_SIZE, 0);
+                int s = findConfigAttrib(egl, display, config,
+                        EGL10.EGL_STENCIL_SIZE, 0);
+
+                // We need at least mDepthSize and mStencilSize bits
+                if (d < mDepthSize || s < mStencilSize)
+                    continue;
+
+                // We want an *exact* match for red/green/blue/alpha
+                int r = findConfigAttrib(egl, display, config,
+                        EGL10.EGL_RED_SIZE, 0);
+                int g = findConfigAttrib(egl, display, config,
+                            EGL10.EGL_GREEN_SIZE, 0);
+                int b = findConfigAttrib(egl, display, config,
+                            EGL10.EGL_BLUE_SIZE, 0);
+                int a = findConfigAttrib(egl, display, config,
+                        EGL10.EGL_ALPHA_SIZE, 0);
+
+                if (r == mRedSize && g == mGreenSize && b == mBlueSize && a == mAlphaSize)
+                    return config;
+            }
+            return null;
+        }
+
+        private int findConfigAttrib(EGL10 egl, EGLDisplay display,
+                EGLConfig config, int attribute, int defaultValue) {
+
+            if (egl.eglGetConfigAttrib(display, config, attribute, mValue)) {
+                return mValue[0];
+            }
+            return defaultValue;
+        }
+
+        private void printConfigs(EGL10 egl, EGLDisplay display,
+            EGLConfig[] configs) {
+            int numConfigs = configs.length;
+            Log.w(TAG, String.format("%d configurations", numConfigs));
+            for (int i = 0; i < numConfigs; i++) {
+                Log.w(TAG, String.format("Configuration %d:\n", i));
+                printConfig(egl, display, configs[i]);
+            }
+        }
+
+        private void printConfig(EGL10 egl, EGLDisplay display,
+                EGLConfig config) {
+            int[] attributes = {
+                    EGL10.EGL_BUFFER_SIZE,
+                    EGL10.EGL_ALPHA_SIZE,
+                    EGL10.EGL_BLUE_SIZE,
+                    EGL10.EGL_GREEN_SIZE,
+                    EGL10.EGL_RED_SIZE,
+                    EGL10.EGL_DEPTH_SIZE,
+                    EGL10.EGL_STENCIL_SIZE,
+                    EGL10.EGL_CONFIG_CAVEAT,
+                    EGL10.EGL_CONFIG_ID,
+                    EGL10.EGL_LEVEL,
+                    EGL10.EGL_MAX_PBUFFER_HEIGHT,
+                    EGL10.EGL_MAX_PBUFFER_PIXELS,
+                    EGL10.EGL_MAX_PBUFFER_WIDTH,
+                    EGL10.EGL_NATIVE_RENDERABLE,
+                    EGL10.EGL_NATIVE_VISUAL_ID,
+                    EGL10.EGL_NATIVE_VISUAL_TYPE,
+                    0x3030, // EGL10.EGL_PRESERVED_RESOURCES,
+                    EGL10.EGL_SAMPLES,
+                    EGL10.EGL_SAMPLE_BUFFERS,
+                    EGL10.EGL_SURFACE_TYPE,
+                    EGL10.EGL_TRANSPARENT_TYPE,
+                    EGL10.EGL_TRANSPARENT_RED_VALUE,
+                    EGL10.EGL_TRANSPARENT_GREEN_VALUE,
+                    EGL10.EGL_TRANSPARENT_BLUE_VALUE,
+                    0x3039, // EGL10.EGL_BIND_TO_TEXTURE_RGB,
+                    0x303A, // EGL10.EGL_BIND_TO_TEXTURE_RGBA,
+                    0x303B, // EGL10.EGL_MIN_SWAP_INTERVAL,
+                    0x303C, // EGL10.EGL_MAX_SWAP_INTERVAL,
+                    EGL10.EGL_LUMINANCE_SIZE,
+                    EGL10.EGL_ALPHA_MASK_SIZE,
+                    EGL10.EGL_COLOR_BUFFER_TYPE,
+                    EGL10.EGL_RENDERABLE_TYPE,
+                    0x3042 // EGL10.EGL_CONFORMANT
+            };
+            String[] names = {
+                    "EGL_BUFFER_SIZE",
+                    "EGL_ALPHA_SIZE",
+                    "EGL_BLUE_SIZE",
+                    "EGL_GREEN_SIZE",
+                    "EGL_RED_SIZE",
+                    "EGL_DEPTH_SIZE",
+                    "EGL_STENCIL_SIZE",
+                    "EGL_CONFIG_CAVEAT",
+                    "EGL_CONFIG_ID",
+                    "EGL_LEVEL",
+                    "EGL_MAX_PBUFFER_HEIGHT",
+                    "EGL_MAX_PBUFFER_PIXELS",
+                    "EGL_MAX_PBUFFER_WIDTH",
+                    "EGL_NATIVE_RENDERABLE",
+                    "EGL_NATIVE_VISUAL_ID",
+                    "EGL_NATIVE_VISUAL_TYPE",
+                    "EGL_PRESERVED_RESOURCES",
+                    "EGL_SAMPLES",
+                    "EGL_SAMPLE_BUFFERS",
+                    "EGL_SURFACE_TYPE",
+                    "EGL_TRANSPARENT_TYPE",
+                    "EGL_TRANSPARENT_RED_VALUE",
+                    "EGL_TRANSPARENT_GREEN_VALUE",
+                    "EGL_TRANSPARENT_BLUE_VALUE",
+                    "EGL_BIND_TO_TEXTURE_RGB",
+                    "EGL_BIND_TO_TEXTURE_RGBA",
+                    "EGL_MIN_SWAP_INTERVAL",
+                    "EGL_MAX_SWAP_INTERVAL",
+                    "EGL_LUMINANCE_SIZE",
+                    "EGL_ALPHA_MASK_SIZE",
+                    "EGL_COLOR_BUFFER_TYPE",
+                    "EGL_RENDERABLE_TYPE",
+                    "EGL_CONFORMANT"
+            };
+            int[] value = new int[1];
+            for (int i = 0; i < attributes.length; i++) {
+                int attribute = attributes[i];
+                String name = names[i];
+                if ( egl.eglGetConfigAttrib(display, config, attribute, value)) {
+                    Log.w(TAG, String.format("  %s: %d\n", name, value[0]));
+                } else {
+                    // Log.w(TAG, String.format("  %s: failed\n", name));
+                    while (egl.eglGetError() != EGL10.EGL_SUCCESS);
+                }
+            }
+        }
+
+        // Subclasses can adjust these values:
+        protected int mRedSize;
+        protected int mGreenSize;
+        protected int mBlueSize;
+        protected int mAlphaSize;
+        protected int mDepthSize;
+        protected int mStencilSize;
+        private int[] mValue = new int[1];
+    }
+
+    private static class Renderer implements GLSurfaceView.Renderer {
+        public void onDrawFrame(GL10 gl) {
+            GL2JNILib.step();
+        }
+
+        public void onSurfaceChanged(GL10 gl, int width, int height) {
+            GL2JNILib.init(width, height);
+        }
+
+        public void onSurfaceCreated(GL10 gl, EGLConfig config) {
+            // Do nothing.
+        }
+    }
+}
diff --git a/ndk/platforms/android-8/arch-arm/lib/libc.so b/ndk/platforms/android-8/arch-arm/lib/libc.so
new file mode 100644
index 0000000..b965d04
--- /dev/null
+++ b/ndk/platforms/android-8/arch-arm/lib/libc.so
Binary files differ
diff --git a/ndk/platforms/android-8/arch-arm/lib/libdl.so b/ndk/platforms/android-8/arch-arm/lib/libdl.so
new file mode 100644
index 0000000..3319c4c
--- /dev/null
+++ b/ndk/platforms/android-8/arch-arm/lib/libdl.so
Binary files differ
diff --git a/ndk/platforms/android-8/arch-arm/lib/libjnigraphics.so b/ndk/platforms/android-8/arch-arm/lib/libjnigraphics.so
new file mode 100755
index 0000000..4c21f4c
--- /dev/null
+++ b/ndk/platforms/android-8/arch-arm/lib/libjnigraphics.so
Binary files differ
diff --git a/ndk/platforms/android-8/arch-arm/symbols/libc.so.txt b/ndk/platforms/android-8/arch-arm/symbols/libc.so.txt
new file mode 100644
index 0000000..b268233
--- /dev/null
+++ b/ndk/platforms/android-8/arch-arm/symbols/libc.so.txt
@@ -0,0 +1,1140 @@
+
+.data.rel.ro
+.text
+MD5_Final
+MD5_Init
+MD5_Update
+SHA1Final
+SHA1Init
+SHA1Transform
+SHA1Update
+_C_ctype_
+_C_tolower_
+_C_toupper_
+_Unwind_Backtrace
+_Unwind_Complete
+_Unwind_DeleteException
+_Unwind_ForcedUnwind
+_Unwind_GetCFA
+_Unwind_GetDataRelBase
+_Unwind_GetLanguageSpecificData
+_Unwind_GetRegionStart
+_Unwind_GetTextRelBase
+_Unwind_RaiseException
+_Unwind_Resume
+_Unwind_Resume_or_Rethrow
+_Unwind_VRS_Get
+_Unwind_VRS_Pop
+_Unwind_VRS_Set
+___Unwind_Backtrace
+___Unwind_ForcedUnwind
+___Unwind_RaiseException
+___Unwind_Resume
+___Unwind_Resume_or_Rethrow
+__adddf3
+__addsf3
+__aeabi_atexit
+__aeabi_cdcmpeq
+__aeabi_cdcmple
+__aeabi_cdrcmple
+__aeabi_d2f
+__aeabi_d2iz
+__aeabi_dadd
+__aeabi_dcmpeq
+__aeabi_dcmpge
+__aeabi_dcmpgt
+__aeabi_dcmple
+__aeabi_dcmplt
+__aeabi_dcmpun
+__aeabi_ddiv
+__aeabi_dmul
+__aeabi_drsub
+__aeabi_dsub
+__aeabi_f2d
+__aeabi_f2iz
+__aeabi_fadd
+__aeabi_fcmpun
+__aeabi_fdiv
+__aeabi_fmul
+__aeabi_frsub
+__aeabi_fsub
+__aeabi_i2d
+__aeabi_i2f
+__aeabi_idiv
+__aeabi_idiv0
+__aeabi_idivmod
+__aeabi_l2d
+__aeabi_l2f
+__aeabi_ldiv0
+__aeabi_ldivmod
+__aeabi_lmul
+__aeabi_memclr
+__aeabi_memclr4
+__aeabi_memclr8
+__aeabi_memcpy
+__aeabi_memcpy4
+__aeabi_memcpy8
+__aeabi_memmove
+__aeabi_memmove4
+__aeabi_memmove8
+__aeabi_memset
+__aeabi_memset4
+__aeabi_memset8
+__aeabi_ui2d
+__aeabi_ui2f
+__aeabi_uidiv
+__aeabi_uidivmod
+__aeabi_ul2d
+__aeabi_ul2f
+__aeabi_uldivmod
+__aeabi_unwind_cpp_pr0
+__aeabi_unwind_cpp_pr1
+__aeabi_unwind_cpp_pr2
+__arc4_getbyte
+__assert
+__assert2
+__atexit
+__atexit_invalid
+__atexit_register_cleanup
+__atomic_cmpxchg
+__atomic_dec
+__atomic_inc
+__atomic_swap
+__b64_ntop
+__b64_pton
+__bionic_brk
+__bionic_clone
+__bionic_clone_entry
+__bionic_libgcc_compat_hooks
+__brk
+__bss_end__
+__bss_start
+__bss_start__
+__cmpdf2
+__cxa_atexit
+__cxa_begin_cleanup
+__cxa_call_unexpected
+__cxa_finalize
+__cxa_type_match
+__data_start
+__div0
+__divdf3
+__divdi3
+__divsf3
+__divsi3
+__dn_comp
+__dn_count_labels
+__dn_skipname
+__dorand48
+__dso_handle
+__dtoa
+__end__
+__eqdf2
+__errno
+__evAddTime
+__evCmpTime
+__evConsIovec
+__evConsTime
+__evNowTime
+__evOptMonoTime
+__evSubTime
+__evTimeSpec
+__evTimeVal
+__evUTCTime
+__exidx_end
+__exidx_start
+__extendsfdf2
+__fcntl
+__fcntl64
+__findenv
+__fixdfsi
+__fixsfsi
+__floatdidf
+__floatdisf
+__floatsidf
+__floatsisf
+__floatundidf
+__floatundisf
+__floatunsidf
+__floatunsisf
+__fork
+__fp_nquery
+__fp_query
+__fremovelock
+__futex_syscall3
+__futex_syscall4
+__futex_wait
+__futex_wake
+__gedf2
+__get_h_errno
+__get_pc
+__get_res_cache
+__get_sp
+__get_stack_base
+__get_thread
+__getcwd
+__getpriority
+__gnu_Unwind_Backtrace
+__gnu_Unwind_Find_exidx
+__gnu_Unwind_ForcedUnwind
+__gnu_Unwind_RaiseException
+__gnu_Unwind_Restore_VFP
+__gnu_Unwind_Restore_VFP_D
+__gnu_Unwind_Restore_VFP_D_16_to_31
+__gnu_Unwind_Restore_WMMXC
+__gnu_Unwind_Restore_WMMXD
+__gnu_Unwind_Resume
+__gnu_Unwind_Resume_or_Rethrow
+__gnu_Unwind_Save_VFP
+__gnu_Unwind_Save_VFP_D
+__gnu_Unwind_Save_VFP_D_16_to_31
+__gnu_Unwind_Save_WMMXC
+__gnu_Unwind_Save_WMMXD
+__gnu_ldivmod_helper
+__gnu_uldivmod_helper
+__gnu_unwind_execute
+__gnu_unwind_frame
+__gtdf2
+__hostalias
+__init_tls
+__ioctl
+__isthreaded
+__ledf2
+__libc_android_abort
+__libc_android_log_assert
+__libc_android_log_print
+__libc_android_log_vprint
+__libc_init
+__libc_init_common
+__libc_malloc_default_dispatch
+__libc_malloc_dispatch
+__libc_prenit
+__llseek
+__loc_aton
+__loc_ntoa
+__ltdf2
+__memcmp16
+__mmap2
+__muldf3
+__muldi3
+__mulsf3
+__nedf2
+__ns_format_ttl
+__ns_get16
+__ns_get32
+__ns_initparse
+__ns_makecanon
+__ns_msg_getflag
+__ns_name_compress
+__ns_name_ntol
+__ns_name_ntop
+__ns_name_pack
+__ns_name_pton
+__ns_name_rollback
+__ns_name_skip
+__ns_name_uncompress
+__ns_name_unpack
+__ns_parserr
+__ns_put16
+__ns_put32
+__ns_samename
+__ns_skiprr
+__ns_sprintrr
+__ns_sprintrrf
+__open
+__openat
+__p_cdname
+__p_cdnname
+__p_cert_syms
+__p_class
+__p_class_syms
+__p_default_section_syms
+__p_fqname
+__p_fqnname
+__p_key_syms
+__p_option
+__p_query
+__p_rcode
+__p_rcode_syms
+__p_secstodate
+__p_section
+__p_sockun
+__p_time
+__p_type
+__p_type_syms
+__p_update_section_syms
+__page_shift
+__page_size
+__pread64
+__progname
+__pthread_cleanup_pop
+__pthread_cleanup_push
+__pthread_clone
+__pthread_cond_timedwait
+__pthread_cond_timedwait_relative
+__ptrace
+__putlong
+__putshort
+__pwrite64
+__rand48_add
+__rand48_mult
+__rand48_seed
+__reboot
+__res_close
+__res_dnok
+__res_get_nibblesuffix
+__res_get_nibblesuffix2
+__res_get_state
+__res_get_static
+__res_getservers
+__res_hnok
+__res_hostalias
+__res_isourserver
+__res_mailok
+__res_nameinquery
+__res_nametoclass
+__res_nametotype
+__res_nclose
+__res_ndestroy
+__res_ninit
+__res_nmkquery
+__res_nopt
+__res_nquery
+__res_nquerydomain
+__res_nsearch
+__res_nsend
+__res_opt
+__res_ourserver_p
+__res_ownok
+__res_pquery
+__res_put_state
+__res_queriesmatch
+__res_querydomain
+__res_randomid
+__res_send
+__res_send_setqhook
+__res_send_setrhook
+__res_setservers
+__res_vinit
+__restore_core_regs
+__rt_sigaction
+__rt_sigprocmask
+__rt_sigtimedwait
+__sF
+__sFext
+__sclose
+__sdidinit
+__set_errno
+__set_syscall_errno
+__set_tls
+__setresuid
+__setreuid
+__setuid
+__sflags
+__sflush
+__sfp
+__sfvwrite
+__sglue
+__sigsuspend
+__sinit
+__slbexpand
+__smakebuf
+__sread
+__srefill
+__srget
+__sseek
+__stack_chk_fail
+__stack_chk_guard
+__statfs64
+__subdf3
+__subsf3
+__swbuf
+__swhatbuf
+__swrite
+__swsetup
+__sym_ntop
+__sym_ntos
+__sym_ston
+__sys_clone
+__syslog
+__system_properties_init
+__system_property_area__
+__system_property_find
+__system_property_find_nth
+__system_property_get
+__system_property_read
+__system_property_wait
+__thread_entry
+__timer_create
+__timer_delete
+__timer_getoverrun
+__timer_gettime
+__timer_settime
+__timer_table_start_stop
+__truncdfsf2
+__udivdi3
+__udivsi3
+__unorddf2
+__unordsf2
+__wait4
+_bss_end__
+_cleanup
+_ctype_
+_dns_gethtbyaddr
+_dns_gethtbyname
+_dorand48
+_edata
+_end
+_endhtent
+_exit
+_exit_thread
+_exit_with_stack_teardown
+_fwalk
+_gethtbyaddr
+_gethtbyname
+_gethtbyname2
+_gethtent
+_getlong
+_getshort
+_init_thread
+_longjmp
+_mktemp
+_nres
+_ns_flagdata
+_rand48_add
+_rand48_mult
+_rand48_seed
+_res_opcodes
+_resolv_cache_add
+_resolv_cache_create
+_resolv_cache_lookup
+_resolv_cache_reset
+_sethtent
+_setjmp
+_stack
+_thread_atexit_lock
+_thread_atexit_unlock
+_thread_created_hook
+_tolower_tab_
+_toupper_tab_
+abort
+accept
+access
+acct
+alarm
+alphasort
+arc4random
+arc4random_addrandom
+arc4random_buf
+arc4random_stir
+arc4random_uniform
+asctime
+asctime64
+asctime64_r
+asctime_r
+asprintf
+atexit
+atoi
+atol
+atoll
+basename
+basename_r
+bcopy
+bind
+bindresvport
+brk
+bsd_signal
+bsearch
+btowc
+bzero
+cacheflush
+calloc
+capget
+capset
+chdir
+chmod
+chown
+chroot
+clearenv
+clearerr
+clock
+clock_getres
+clock_gettime
+clock_nanosleep
+clock_settime
+clone
+close
+closedir
+closelog
+closelog_r
+connect
+copy_TM_to_tm
+copy_tm_to_TM
+cpuacct_add
+creat
+ctime
+ctime64
+ctime64_r
+ctime_r
+daemon
+daylight
+delete_module
+difftime
+dirfd
+dirname
+dirname_r
+div
+dlcalloc
+dlfree
+dlindependent_calloc
+dlindependent_comalloc
+dlmallinfo
+dlmalloc
+dlmalloc_footprint
+dlmalloc_max_footprint
+dlmalloc_stats
+dlmalloc_trim
+dlmalloc_usable_size
+dlmalloc_walk_free_pages
+dlmalloc_walk_heap
+dlmallopt
+dlmemalign
+dlpvalloc
+dlrealloc
+dlvalloc
+dn_expand
+dns_change_prop
+dns_last_change_counter
+drand48
+dup
+dup2
+endpwent
+endservent
+endusershell
+endutent
+environ
+epoll_create
+epoll_ctl
+epoll_wait
+erand48
+err
+errx
+execl
+execle
+execlp
+execv
+execve
+execvp
+exit
+fake_gmtime_r
+fake_localtime_r
+fchdir
+fchmod
+fchmodat
+fchown
+fchownat
+fclose
+fcntl
+fdopen
+fdopendir
+fdprintf
+feof
+ferror
+fflush
+ffs
+fgetc
+fgetln
+fgetpos
+fgets
+fgetwc
+fgetws
+fileno
+flock
+flockfile
+fnmatch
+fopen
+fork
+fpathconf
+fprintf
+fpurge
+fputc
+fputs
+fputwc
+fputws
+fread
+free
+free_malloc_leak_info
+freeaddrinfo
+freedtoa
+freopen
+fscanf
+fseek
+fseeko
+fsetpos
+fstat
+fstatat
+fstatfs
+fsync
+ftell
+ftello
+ftime
+ftok
+ftruncate
+ftrylockfile
+fts_children
+fts_close
+fts_open
+fts_read
+fts_set
+funlockfile
+funopen
+futex
+fwide
+fwprintf
+fwrite
+fwscanf
+gAllocationsMutex
+gHashTable
+gMallocLeakZygoteChild
+gai_strerror
+get_malloc_leak_info
+getaddrinfo
+getc
+getc_unlocked
+getchar
+getchar_unlocked
+getcwd
+getdents
+getdtablesize
+getegid
+getenv
+geteuid
+getgid
+getgrgid
+getgrnam
+getgrouplist
+getgroups
+gethostbyaddr
+gethostbyname
+gethostbyname2
+gethostbyname_r
+gethostent
+gethostname
+getitimer
+getlogin
+getmntent
+getnameinfo
+getnetbyaddr
+getnetbyname
+getopt
+getopt_long
+getopt_long_only
+getpeername
+getpgid
+getpgrp
+getpid
+getppid
+getpriority
+getprotobyname
+getprotobynumber
+getpt
+getpwnam
+getpwuid
+getresgid
+getresuid
+getrlimit
+getrusage
+gets
+getservbyname
+getservbyport
+getservent
+getservent_r
+getsockname
+getsockopt
+gettid
+gettimeofday
+getuid
+getusershell
+getutent
+getwc
+getwchar
+gmtime
+gmtime64
+gmtime64_r
+gmtime_r
+h_errlist
+h_nerr
+herror
+hstrerror
+if_indextoname
+if_nametoindex
+index
+inet_addr
+inet_aton
+inet_nsap_addr
+inet_nsap_ntoa
+inet_ntoa
+inet_ntop
+inet_pton
+init_module
+initgroups
+inotify_add_watch
+inotify_init
+inotify_rm_watch
+ioctl
+ioprio_get
+ioprio_set
+isalnum
+isalpha
+isascii
+isatty
+isblank
+iscntrl
+isdigit
+isgraph
+islower
+isprint
+ispunct
+issetugid
+isspace
+isupper
+iswalnum
+iswalpha
+iswcntrl
+iswctype
+iswdigit
+iswgraph
+iswlower
+iswprint
+iswpunct
+iswspace
+iswupper
+iswxdigit
+isxdigit
+jrand48
+kill
+killpg
+klogctl
+lchown
+ldexp
+ldiv
+link
+listen
+lldiv
+load_domain_search_list
+localtime
+localtime64
+localtime64_r
+localtime_r
+longjmp
+longjmperror
+lrand48
+lseek
+lseek64
+lstat
+madvise
+mallinfo
+malloc
+malloc_debug_init
+mbrlen
+mbrtowc
+mbsinit
+mbsrtowcs
+mbstowcs
+memalign
+memccpy
+memchr
+memcmp
+memcpy
+memmem
+memmove
+memrchr
+memset
+memswap
+mincore
+mkdir
+mkdirat
+mkdtemp
+mknod
+mkstemp
+mkstemps
+mktemp
+mktime
+mktime64
+mlock
+mmap
+mount
+mprotect
+mrand48
+mremap
+msync
+munlock
+munmap
+nanosleep
+nice
+nrand48
+nsdispatch
+open
+openat
+opendir
+openlog
+openlog_r
+optarg
+opterr
+optind
+optopt
+optreset
+pathconf
+pause
+pclose
+perror
+pipe
+poll
+popen
+prctl
+pread
+printf
+pselect
+pthread_attr_destroy
+pthread_attr_getdetachstate
+pthread_attr_getguardsize
+pthread_attr_getschedparam
+pthread_attr_getschedpolicy
+pthread_attr_getscope
+pthread_attr_getstack
+pthread_attr_getstackaddr
+pthread_attr_getstacksize
+pthread_attr_init
+pthread_attr_setdetachstate
+pthread_attr_setguardsize
+pthread_attr_setschedparam
+pthread_attr_setschedpolicy
+pthread_attr_setscope
+pthread_attr_setstack
+pthread_attr_setstackaddr
+pthread_attr_setstacksize
+pthread_cond_broadcast
+pthread_cond_destroy
+pthread_cond_init
+pthread_cond_signal
+pthread_cond_timedwait
+pthread_cond_timedwait_monotonic
+pthread_cond_timedwait_monotonic_np
+pthread_cond_timedwait_relative_np
+pthread_cond_timeout_np
+pthread_cond_wait
+pthread_condattr_destroy
+pthread_condattr_getpshared
+pthread_condattr_init
+pthread_condattr_setpshared
+pthread_create
+pthread_detach
+pthread_equal
+pthread_exit
+pthread_getattr_np
+pthread_getcpuclockid
+pthread_getschedparam
+pthread_getspecific
+pthread_join
+pthread_key_create
+pthread_key_delete
+pthread_kill
+pthread_mutex_destroy
+pthread_mutex_init
+pthread_mutex_lock
+pthread_mutex_lock_timeout_np
+pthread_mutex_trylock
+pthread_mutex_unlock
+pthread_mutexattr_destroy
+pthread_mutexattr_getpshared
+pthread_mutexattr_gettype
+pthread_mutexattr_init
+pthread_mutexattr_setpshared
+pthread_mutexattr_settype
+pthread_once
+pthread_self
+pthread_setschedparam
+pthread_setspecific
+pthread_sigmask
+ptrace
+ptsname
+ptsname_r
+putc
+putc_unlocked
+putchar
+putchar_unlocked
+putenv
+puts
+pututline
+putw
+putwc
+putwchar
+pwrite
+qsort
+raise
+read
+readdir
+readdir_r
+readlink
+readv
+realloc
+realpath
+reboot
+recv
+recvfrom
+recvmsg
+regcomp
+regerror
+regexec
+regfree
+remove
+rename
+renameat
+res_get_dns_changed
+res_init
+res_mkquery
+res_need_init
+res_query
+res_search
+restore_core_regs
+rewind
+rewinddir
+rmdir
+sbrk
+scandir
+scanf
+sched_get_priority_max
+sched_get_priority_min
+sched_getparam
+sched_getscheduler
+sched_rr_get_interval
+sched_setparam
+sched_setscheduler
+sched_yield
+seed48
+select
+sem_close
+sem_destroy
+sem_getvalue
+sem_init
+sem_open
+sem_post
+sem_timedwait
+sem_trywait
+sem_unlink
+sem_wait
+send
+sendfile
+sendmsg
+sendto
+setbuf
+setbuffer
+setegid
+setenv
+seteuid
+setgid
+setgroups
+setitimer
+setjmp
+setlinebuf
+setlocale
+setlogmask
+setlogmask_r
+setpgid
+setpgrp
+setpriority
+setregid
+setresgid
+setresuid
+setreuid
+setrlimit
+setservent
+setsid
+setsockopt
+settimeofday
+setuid
+setusershell
+setutent
+setvbuf
+shutdown
+sigaction
+sigaltstack
+sigblock
+siginterrupt
+siglongjmp
+sigpending
+sigprocmask
+sigsetjmp
+sigsetmask
+sigsuspend
+sigwait
+sleep
+snprintf
+socket
+socketpair
+sprintf
+srand48
+sscanf
+stat
+statfs
+strcasecmp
+strcasestr
+strcat
+strchr
+strcmp
+strcoll
+strcpy
+strcspn
+strdup
+strerror
+strerror_r
+strftime
+strftime_tz
+strlcat
+strlcpy
+strlen
+strncasecmp
+strncat
+strncmp
+strncpy
+strndup
+strnlen
+strntoimax
+strntoumax
+strpbrk
+strptime
+strrchr
+strsep
+strsignal
+strspn
+strstr
+strtod
+strtoimax
+strtok
+strtok_r
+strtol
+strtoll
+strtotimeval
+strtoul
+strtoull
+strtoumax
+strxfrm
+swprintf
+swscanf
+symlink
+sync
+sys_siglist
+sys_signame
+syscall
+sysconf
+syslog
+syslog_r
+system
+sysv_signal
+tcgetpgrp
+tcsetpgrp
+tempnam
+the_key
+the_once
+time
+timegm64
+timelocal64
+timer_create
+timer_delete
+timer_getoverrun
+timer_gettime
+timer_settime
+times
+timezone
+tkill
+tmpfile
+tmpnam
+toascii
+tolower
+toupper
+towlower
+towupper
+truncate
+ttyname
+ttyname_r
+tzname
+tzset
+umask
+umount
+umount2
+uname
+ungetc
+ungetwc
+unlink
+unlinkat
+unlockpt
+unsetenv
+usleep
+utime
+utimes
+utmpname
+valid_tm_mon
+valid_tm_wday
+valloc
+vasprintf
+verr
+verrx
+vfdprintf
+vfork
+vfprintf
+vfscanf
+vfwprintf
+vprintf
+vscanf
+vsnprintf
+vsprintf
+vsscanf
+vswprintf
+vsyslog
+vsyslog_r
+vwarn
+vwarnx
+vwprintf
+wait
+wait3
+waitid
+waitpid
+warn
+warnx
+wcrtomb
+wcscat
+wcschr
+wcscmp
+wcscoll
+wcscpy
+wcscspn
+wcsftime
+wcslen
+wcsncat
+wcsncmp
+wcsncpy
+wcspbrk
+wcsrchr
+wcsrtombs
+wcsspn
+wcsstr
+wcstod
+wcstok
+wcstol
+wcstombs
+wcstoul
+wcswcs
+wcswidth
+wcsxfrm
+wctob
+wctype
+wcwidth
+wmemchr
+wmemcmp
+wmemcpy
+wmemmove
+wmemset
+wprintf
+write
+writev
+wscanf
diff --git a/ndk/platforms/android-8/include/android/bitmap.h b/ndk/platforms/android-8/include/android/bitmap.h
new file mode 100644
index 0000000..5078277
--- /dev/null
+++ b/ndk/platforms/android-8/include/android/bitmap.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (C) 2009 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ANDROID_BITMAP_H
+#define ANDROID_BITMAP_H
+
+#include <stdint.h>
+#include <jni.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define ANDROID_BITMAP_RESUT_SUCCESS            0
+#define ANDROID_BITMAP_RESULT_BAD_PARAMETER     -1
+#define ANDROID_BITMAP_RESULT_JNI_EXCEPTION     -2
+#define ANDROID_BITMAP_RESULT_ALLOCATION_FAILED -3
+
+enum AndroidBitmapFormat {
+    ANDROID_BITMAP_FORMAT_NONE      = 0,
+    ANDROID_BITMAP_FORMAT_RGBA_8888 = 1,
+    ANDROID_BITMAP_FORMAT_RGB_565   = 4,
+    ANDROID_BITMAP_FORMAT_RGBA_4444 = 7,
+    ANDROID_BITMAP_FORMAT_A_8       = 8,
+};
+
+typedef struct {
+    uint32_t    width;
+    uint32_t    height;
+    uint32_t    stride;
+    int32_t     format;
+    uint32_t    flags;      // 0 for now
+} AndroidBitmapInfo;
+
+/**
+ * Given a java bitmap object, fill out the AndroidBitmap struct for it.
+ * If the call fails, the info parameter will be ignored
+ */
+int AndroidBitmap_getInfo(JNIEnv* env, jobject jbitmap,
+                          AndroidBitmapInfo* info);
+
+/**
+ * Given a java bitmap object, attempt to lock the pixel address.
+ * Locking will ensure that the memory for the pixels will not move
+ * until the unlockPixels call, and ensure that, if the pixels had been
+ * previously purged, they will have been restored.
+ *
+ * If this call succeeds, it must be balanced by a call to
+ * AndroidBitmap_unlockPixels, after which time the address of the pixels should
+ * no longer be used.
+ *
+ * If this succeeds, *addrPtr will be set to the pixel address. If the call
+ * fails, addrPtr will be ignored.
+ */
+int AndroidBitmap_lockPixels(JNIEnv* env, jobject jbitmap, void** addrPtr);
+
+/**
+ * Call this to balanace a successful call to AndroidBitmap_lockPixels
+ */
+int AndroidBitmap_unlockPixels(JNIEnv* env, jobject jbitmap);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/ndk/platforms/android-8/include/dlfcn.h b/ndk/platforms/android-8/include/dlfcn.h
new file mode 100644
index 0000000..f84d1d1
--- /dev/null
+++ b/ndk/platforms/android-8/include/dlfcn.h
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 __DLFCN_H__
+#define __DLFCN_H__
+
+#include <sys/cdefs.h>
+
+__BEGIN_DECLS
+
+typedef struct {
+    const char *dli_fname;  /* Pathname of shared object that
+                               contains address */
+    void       *dli_fbase;  /* Address at which shared object
+                               is loaded */
+    const char *dli_sname;  /* Name of nearest symbol with address
+                               lower than addr */
+    void       *dli_saddr;  /* Exact address of symbol named
+                               in dli_sname */
+} Dl_info;
+
+extern void*        dlopen(const char*  filename, int flag);
+extern int          dlclose(void*  handle);
+extern const char*  dlerror(void);
+extern void*        dlsym(void*  handle, const char*  symbol);
+extern int          dladdr(void* addr, Dl_info *info);
+
+enum {
+  RTLD_NOW  = 0,
+  RTLD_LAZY = 1,
+
+  RTLD_LOCAL  = 0,
+  RTLD_GLOBAL = 2,
+};
+
+#define RTLD_DEFAULT  ((void*) 0xffffffff)
+#define RTLD_NEXT     ((void*) 0xfffffffe)
+
+__END_DECLS
+
+#endif /* __DLFCN_H */
+
+
diff --git a/ndk/platforms/android-8/include/err.h b/ndk/platforms/android-8/include/err.h
new file mode 100644
index 0000000..1636efe
--- /dev/null
+++ b/ndk/platforms/android-8/include/err.h
@@ -0,0 +1,90 @@
+/*	$OpenBSD: err.h,v 1.10 2006/01/06 18:53:04 millert Exp $	*/
+/*	$NetBSD: err.h,v 1.11 1994/10/26 00:55:52 cgd Exp $	*/
+
+/*-
+ * Copyright (c) 1993
+ *	The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ * 3. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
+ *
+ *	@(#)err.h	8.1 (Berkeley) 6/2/93
+ */
+
+#ifndef _ERR_H_
+#define	_ERR_H_
+
+/*
+ * Don't use va_list in the err/warn prototypes.   Va_list is typedef'd in two
+ * places (<machine/varargs.h> and <machine/stdarg.h>), so if we include one
+ * of them here we may collide with the utility's includes.  It's unreasonable
+ * for utilities to have to include one of them to include err.h, so we get
+ * __va_list from <machine/_types.h> and use it.
+ */
+#include <sys/cdefs.h>
+#include <machine/_types.h>
+
+__BEGIN_DECLS
+
+__noreturn void	err(int, const char *, ...)
+			__attribute__((__format__ (printf, 2, 3)));
+__noreturn void	verr(int, const char *, __va_list)
+			__attribute__((__format__ (printf, 2, 0)));
+__noreturn void	errx(int, const char *, ...)
+			__attribute__((__format__ (printf, 2, 3)));
+__noreturn void	verrx(int, const char *, __va_list)
+			__attribute__((__format__ (printf, 2, 0)));
+void		warn(const char *, ...)
+			__attribute__((__format__ (printf, 1, 2)));
+void		vwarn(const char *, __va_list)
+			__attribute__((__format__ (printf, 1, 0)));
+void		warnx(const char *, ...)
+			__attribute__((__format__ (printf, 1, 2)));
+void		vwarnx(const char *, __va_list)
+			__attribute__((__format__ (printf, 1, 0)));
+
+/*
+ * The _* versions are for use in library functions so user-defined
+ * versions of err*,warn* do not get used.
+ */
+__noreturn void	_err(int, const char *, ...)
+			__attribute__((__format__ (printf, 2, 3)));
+__noreturn void	_verr(int, const char *, __va_list)
+			__attribute__((__format__ (printf, 2, 0)));
+__noreturn void	_errx(int, const char *, ...)
+			__attribute__((__format__ (printf, 2, 3)));
+__noreturn void	_verrx(int, const char *, __va_list)
+			__attribute__((__format__ (printf, 2, 0)));
+void		_warn(const char *, ...)
+			__attribute__((__format__ (printf, 1, 2)));
+void		_vwarn(const char *, __va_list)
+			__attribute__((__format__ (printf, 1, 0)));
+void		_warnx(const char *, ...)
+			__attribute__((__format__ (printf, 1, 2)));
+void		_vwarnx(const char *, __va_list)
+			__attribute__((__format__ (printf, 1, 0)));
+
+__END_DECLS
+
+#endif /* !_ERR_H_ */
diff --git a/ndk/platforms/android-8/include/fts.h b/ndk/platforms/android-8/include/fts.h
new file mode 100644
index 0000000..da26a88
--- /dev/null
+++ b/ndk/platforms/android-8/include/fts.h
@@ -0,0 +1,125 @@
+/*	$OpenBSD: fts.h,v 1.12 2009/08/27 16:19:27 millert Exp $	*/
+/*	$NetBSD: fts.h,v 1.5 1994/12/28 01:41:50 mycroft Exp $	*/
+
+/*
+ * Copyright (c) 1989, 1993
+ *	The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ * 3. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
+ *
+ *	@(#)fts.h	8.3 (Berkeley) 8/14/94
+ */
+
+#ifndef	_FTS_H_
+#define	_FTS_H_
+
+typedef struct {
+	struct _ftsent *fts_cur;	/* current node */
+	struct _ftsent *fts_child;	/* linked list of children */
+	struct _ftsent **fts_array;	/* sort array */
+	dev_t fts_dev;			/* starting device # */
+	char *fts_path;			/* path for this descent */
+	int fts_rfd;			/* fd for root */
+	size_t fts_pathlen;		/* sizeof(path) */
+	int fts_nitems;			/* elements in the sort array */
+	int (*fts_compar)();		/* compare function */
+
+#define	FTS_COMFOLLOW	0x0001		/* follow command line symlinks */
+#define	FTS_LOGICAL	0x0002		/* logical walk */
+#define	FTS_NOCHDIR	0x0004		/* don't change directories */
+#define	FTS_NOSTAT	0x0008		/* don't get stat info */
+#define	FTS_PHYSICAL	0x0010		/* physical walk */
+#define	FTS_SEEDOT	0x0020		/* return dot and dot-dot */
+#define	FTS_XDEV	0x0040		/* don't cross devices */
+#define	FTS_OPTIONMASK	0x00ff		/* valid user option mask */
+
+#define	FTS_NAMEONLY	0x1000		/* (private) child names only */
+#define	FTS_STOP	0x2000		/* (private) unrecoverable error */
+	int fts_options;		/* fts_open options, global flags */
+} FTS;
+
+typedef struct _ftsent {
+	struct _ftsent *fts_cycle;	/* cycle node */
+	struct _ftsent *fts_parent;	/* parent directory */
+	struct _ftsent *fts_link;	/* next file in directory */
+	long fts_number;	        /* local numeric value */
+	void *fts_pointer;	        /* local address value */
+	char *fts_accpath;		/* access path */
+	char *fts_path;			/* root path */
+	int fts_errno;			/* errno for this node */
+	int fts_symfd;			/* fd for symlink */
+	size_t fts_pathlen;		/* strlen(fts_path) */
+	size_t fts_namelen;		/* strlen(fts_name) */
+
+	ino_t fts_ino;			/* inode */
+	dev_t fts_dev;			/* device */
+	nlink_t fts_nlink;		/* link count */
+
+#define	FTS_ROOTPARENTLEVEL	-1
+#define	FTS_ROOTLEVEL		 0
+#define	FTS_MAXLEVEL		 0x7fff
+	short fts_level;		/* depth (-1 to N) */
+
+#define	FTS_D		 1		/* preorder directory */
+#define	FTS_DC		 2		/* directory that causes cycles */
+#define	FTS_DEFAULT	 3		/* none of the above */
+#define	FTS_DNR		 4		/* unreadable directory */
+#define	FTS_DOT		 5		/* dot or dot-dot */
+#define	FTS_DP		 6		/* postorder directory */
+#define	FTS_ERR		 7		/* error; errno is set */
+#define	FTS_F		 8		/* regular file */
+#define	FTS_INIT	 9		/* initialized only */
+#define	FTS_NS		10		/* stat(2) failed */
+#define	FTS_NSOK	11		/* no stat(2) requested */
+#define	FTS_SL		12		/* symbolic link */
+#define	FTS_SLNONE	13		/* symbolic link without target */
+	unsigned short fts_info;	/* user flags for FTSENT structure */
+
+#define	FTS_DONTCHDIR	 0x01		/* don't chdir .. to the parent */
+#define	FTS_SYMFOLLOW	 0x02		/* followed a symlink to get here */
+	unsigned short fts_flags;	/* private flags for FTSENT structure */
+
+#define	FTS_AGAIN	 1		/* read node again */
+#define	FTS_FOLLOW	 2		/* follow symbolic link */
+#define	FTS_NOINSTR	 3		/* no instructions */
+#define	FTS_SKIP	 4		/* discard node */
+	unsigned short fts_instr;	/* fts_set() instructions */
+
+	struct stat *fts_statp;		/* stat(2) information */
+	char fts_name[1];		/* file name */
+} FTSENT;
+
+#include <sys/cdefs.h>
+
+__BEGIN_DECLS
+FTSENT	*fts_children(FTS *, int);
+int	 fts_close(FTS *);
+FTS	*fts_open(char * const *, int,
+	    int (*)(const FTSENT **, const FTSENT **));
+FTSENT	*fts_read(FTS *);
+int	 fts_set(FTS *, FTSENT *, int);
+__END_DECLS
+
+#endif /* !_FTS_H_ */
diff --git a/ndk/platforms/android-8/include/pthread.h b/ndk/platforms/android-8/include/pthread.h
new file mode 100644
index 0000000..eb2d169
--- /dev/null
+++ b/ndk/platforms/android-8/include/pthread.h
@@ -0,0 +1,275 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _PTHREAD_H_
+#define _PTHREAD_H_
+
+#include <time.h>
+#include <signal.h>
+#include <sched.h>
+#include <limits.h>
+#include <sys/types.h>
+
+/*
+ * Types
+ */
+typedef struct
+{
+    int volatile value;
+} pthread_mutex_t;
+
+#define  PTHREAD_MUTEX_INITIALIZER             {0}
+#define  PTHREAD_RECURSIVE_MUTEX_INITIALIZER   {0x4000}
+#define  PTHREAD_ERRORCHECK_MUTEX_INITIALIZER  {0x8000}
+
+enum {
+    PTHREAD_MUTEX_NORMAL = 0,
+    PTHREAD_MUTEX_RECURSIVE = 1,
+    PTHREAD_MUTEX_ERRORCHECK = 2,
+
+    PTHREAD_MUTEX_ERRORCHECK_NP = PTHREAD_MUTEX_ERRORCHECK,
+    PTHREAD_MUTEX_RECURSIVE_NP  = PTHREAD_MUTEX_RECURSIVE,
+
+    PTHREAD_MUTEX_DEFAULT = PTHREAD_MUTEX_NORMAL
+};
+
+
+
+typedef struct
+{
+    int volatile value;
+} pthread_cond_t;
+
+typedef struct
+{
+    uint32_t flags;
+    void * stack_base;
+    size_t stack_size;
+    size_t guard_size;
+    int32_t sched_policy;
+    int32_t sched_priority;
+} pthread_attr_t;
+
+typedef long pthread_mutexattr_t;
+typedef long pthread_condattr_t;
+
+typedef int pthread_key_t;
+typedef long pthread_t;
+
+typedef volatile int  pthread_once_t;
+
+/*
+ * Defines
+ */
+#define PTHREAD_COND_INITIALIZER  {0}
+
+#define PTHREAD_STACK_MIN (2 * PAGE_SIZE)
+
+#define PTHREAD_CREATE_DETACHED  0x00000001
+#define PTHREAD_CREATE_JOINABLE  0x00000000
+
+#define PTHREAD_ONCE_INIT    0
+
+#define PTHREAD_PROCESS_PRIVATE  0
+#define PTHREAD_PROCESS_SHARED   1
+
+#define PTHREAD_SCOPE_SYSTEM     0
+#define PTHREAD_SCOPE_PROCESS    1
+
+/*
+ * Prototypes
+ */
+#if __cplusplus
+extern "C" {
+#endif
+
+int pthread_attr_init(pthread_attr_t * attr);
+int pthread_attr_destroy(pthread_attr_t * attr);
+
+int pthread_attr_setdetachstate(pthread_attr_t * attr, int state);
+int pthread_attr_getdetachstate(pthread_attr_t const * attr, int * state);
+
+int pthread_attr_setschedpolicy(pthread_attr_t * attr, int policy);
+int pthread_attr_getschedpolicy(pthread_attr_t const * attr, int * policy);
+
+int pthread_attr_setschedparam(pthread_attr_t * attr, struct sched_param const * param);
+int pthread_attr_getschedparam(pthread_attr_t const * attr, struct sched_param * param);
+
+int pthread_attr_setstacksize(pthread_attr_t * attr, size_t stack_size);
+int pthread_attr_getstacksize(pthread_attr_t const * attr, size_t * stack_size);
+
+int pthread_attr_setstackaddr(pthread_attr_t * attr, void * stackaddr);
+int pthread_attr_getstackaddr(pthread_attr_t const * attr, void ** stackaddr);
+
+int pthread_attr_setstack(pthread_attr_t * attr, void * stackaddr, size_t stack_size);
+int pthread_attr_getstack(pthread_attr_t const * attr, void ** stackaddr, size_t * stack_size);
+
+int pthread_attr_setguardsize(pthread_attr_t * attr, size_t guard_size);
+int pthread_attr_getguardsize(pthread_attr_t const * attr, size_t * guard_size);
+
+int pthread_attr_setscope(pthread_attr_t *attr, int  scope);
+int pthread_attr_getscope(pthread_attr_t const *attr);
+
+int pthread_getattr_np(pthread_t thid, pthread_attr_t * attr);
+
+int pthread_create(pthread_t *thread, pthread_attr_t const * attr,
+                   void *(*start_routine)(void *), void * arg);
+void pthread_exit(void * retval);
+int pthread_join(pthread_t thid, void ** ret_val);
+int pthread_detach(pthread_t  thid);
+
+pthread_t pthread_self(void);
+int pthread_equal(pthread_t one, pthread_t two);
+
+int pthread_getschedparam(pthread_t thid, int * policy,
+                          struct sched_param * param);
+int pthread_setschedparam(pthread_t thid, int poilcy,
+                          struct sched_param const * param);
+
+int pthread_mutexattr_init(pthread_mutexattr_t *attr);
+int pthread_mutexattr_destroy(pthread_mutexattr_t *attr);
+int pthread_mutexattr_gettype(const pthread_mutexattr_t *attr, int *type);
+int pthread_mutexattr_settype(pthread_mutexattr_t *attr, int type);
+int pthread_mutexattr_setpshared(pthread_mutexattr_t *attr, int  pshared);
+int pthread_mutexattr_getpshared(pthread_mutexattr_t *attr, int *pshared);
+
+int pthread_mutex_init(pthread_mutex_t *mutex,
+                       const pthread_mutexattr_t *attr);
+int pthread_mutex_destroy(pthread_mutex_t *mutex);
+int pthread_mutex_lock(pthread_mutex_t *mutex);
+int pthread_mutex_unlock(pthread_mutex_t *mutex);
+int pthread_mutex_trylock(pthread_mutex_t *mutex);
+int pthread_mutex_timedlock(pthread_mutex_t *mutex, struct timespec*  ts);
+
+int pthread_condattr_init(pthread_condattr_t *attr);
+int pthread_condattr_getpshared(pthread_condattr_t *attr, int *pshared);
+int pthread_condattr_setpshared(pthread_condattr_t* attr, int pshared);
+int pthread_condattr_destroy(pthread_condattr_t *attr);
+
+int pthread_cond_init(pthread_cond_t *cond,
+                      const pthread_condattr_t *attr);
+int pthread_cond_destroy(pthread_cond_t *cond);
+int pthread_cond_broadcast(pthread_cond_t *cond);
+int pthread_cond_signal(pthread_cond_t *cond);
+int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex);
+int pthread_cond_timedwait(pthread_cond_t *cond,
+                           pthread_mutex_t * mutex,
+                           const struct timespec *abstime);
+
+/* BIONIC: same as pthread_cond_timedwait, except the 'abstime' given refers
+ *         to the CLOCK_MONOTONIC clock instead, to avoid any problems when
+ *         the wall-clock time is changed brutally
+ */
+int pthread_cond_timedwait_monotonic_np(pthread_cond_t         *cond,
+                                        pthread_mutex_t        *mutex,
+                                        const struct timespec  *abstime);
+
+/* BIONIC: DEPRECATED. same as pthread_cond_timedwait_monotonic_np()
+ * unfortunately pthread_cond_timedwait_monotonic has shipped already
+ */
+int pthread_cond_timedwait_monotonic(pthread_cond_t         *cond,
+                                     pthread_mutex_t        *mutex,
+                                     const struct timespec  *abstime);
+
+#define HAVE_PTHREAD_COND_TIMEDWAIT_MONOTONIC 1
+
+/* BIONIC: same as pthread_cond_timedwait, except the 'reltime' given refers
+ *         is relative to the current time.
+ */
+int pthread_cond_timedwait_relative_np(pthread_cond_t         *cond,
+                                     pthread_mutex_t        *mutex,
+                                     const struct timespec  *reltime);
+
+#define HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE 1
+
+
+
+int pthread_cond_timeout_np(pthread_cond_t *cond,
+                            pthread_mutex_t * mutex,
+                            unsigned msecs);
+
+/* same as pthread_mutex_lock(), but will wait up to 'msecs' milli-seconds
+ * before returning. same return values than pthread_mutex_trylock though, i.e.
+ * returns EBUSY if the lock could not be acquired after the timeout
+ * expired.
+ */
+int pthread_mutex_lock_timeout_np(pthread_mutex_t *mutex, unsigned msecs);
+
+int pthread_key_create(pthread_key_t *key, void (*destructor_function)(void *));
+int pthread_key_delete (pthread_key_t);
+int pthread_setspecific(pthread_key_t key, const void *value);
+void *pthread_getspecific(pthread_key_t key);
+
+int pthread_kill(pthread_t tid, int sig);
+int pthread_sigmask(int how, const sigset_t *set, sigset_t *oset);
+
+int pthread_getcpuclockid(pthread_t  tid, clockid_t  *clockid);
+
+int pthread_once(pthread_once_t  *once_control, void (*init_routine)(void));
+
+typedef void  (*__pthread_cleanup_func_t)(void*);
+
+typedef struct __pthread_cleanup_t {
+    struct __pthread_cleanup_t*   __cleanup_prev;
+    __pthread_cleanup_func_t      __cleanup_routine;
+    void*                         __cleanup_arg;
+} __pthread_cleanup_t;
+
+extern void  __pthread_cleanup_push(__pthread_cleanup_t*      c,
+                                    __pthread_cleanup_func_t  routine,
+                                    void*                     arg);
+
+extern void  __pthread_cleanup_pop(__pthread_cleanup_t*  c,
+                                   int                   execute);
+
+/* Believe or not, the definitions of pthread_cleanup_push and
+ * pthread_cleanup_pop below are correct. Posix states that these
+ * can be implemented as macros that might introduce opening and
+ * closing braces, and that using setjmp/longjmp/return/break/continue
+ * between them results in undefined behaviour.
+ *
+ * And indeed, GLibc and other C libraries use a similar definition
+ */
+#define  pthread_cleanup_push(routine, arg)                      \
+    do {                                                         \
+        __pthread_cleanup_t  __cleanup;                          \
+        __pthread_cleanup_push( &__cleanup, (routine), (arg) );  \
+
+#define  pthread_cleanup_pop(execute)                  \
+        __pthread_cleanup_pop( &__cleanup, (execute)); \
+    } while (0);
+
+#if __cplusplus
+} /* extern "C" */
+#endif
+
+/************ TO FIX ************/
+
+#define LONG_LONG_MAX __LONG_LONG_MAX__
+#define LONG_LONG_MIN (-__LONG_LONG_MAX__ - 1)
+
+#endif // _PTHREAD_H_
diff --git a/ndk/platforms/android-8/include/regex.h b/ndk/platforms/android-8/include/regex.h
new file mode 100644
index 0000000..aec38e3
--- /dev/null
+++ b/ndk/platforms/android-8/include/regex.h
@@ -0,0 +1,105 @@
+/*	$OpenBSD: regex.h,v 1.6 2003/06/02 19:34:12 millert Exp $	*/
+/*	$NetBSD: regex.h,v 1.4.6.1 1996/06/10 18:57:07 explorer Exp $	*/
+
+/*-
+ * Copyright (c) 1992 Henry Spencer.
+ * Copyright (c) 1992, 1993
+ *	The Regents of the University of California.  All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Henry Spencer of the University of Toronto.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ * 3. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
+ *
+ *	@(#)regex.h	8.1 (Berkeley) 6/2/93
+ */
+
+#ifndef _REGEX_H_
+#define	_REGEX_H_
+
+#include <sys/cdefs.h>
+#include <sys/types.h>
+
+/* types */
+typedef off_t regoff_t;
+
+typedef struct {
+	int re_magic;
+	size_t re_nsub;		/* number of parenthesized subexpressions */
+	const char *re_endp;	/* end pointer for REG_PEND */
+	struct re_guts *re_g;	/* none of your business :-) */
+} regex_t;
+
+typedef struct {
+	regoff_t rm_so;		/* start of match */
+	regoff_t rm_eo;		/* end of match */
+} regmatch_t;
+
+/* regcomp() flags */
+#define	REG_BASIC	0000
+#define	REG_EXTENDED	0001
+#define	REG_ICASE	0002
+#define	REG_NOSUB	0004
+#define	REG_NEWLINE	0010
+#define	REG_NOSPEC	0020
+#define	REG_PEND	0040
+#define	REG_DUMP	0200
+
+/* regerror() flags */
+#define	REG_NOMATCH	 1
+#define	REG_BADPAT	 2
+#define	REG_ECOLLATE	 3
+#define	REG_ECTYPE	 4
+#define	REG_EESCAPE	 5
+#define	REG_ESUBREG	 6
+#define	REG_EBRACK	 7
+#define	REG_EPAREN	 8
+#define	REG_EBRACE	 9
+#define	REG_BADBR	10
+#define	REG_ERANGE	11
+#define	REG_ESPACE	12
+#define	REG_BADRPT	13
+#define	REG_EMPTY	14
+#define	REG_ASSERT	15
+#define	REG_INVARG	16
+#define	REG_ATOI	255	/* convert name to number (!) */
+#define	REG_ITOA	0400	/* convert number to name (!) */
+
+/* regexec() flags */
+#define	REG_NOTBOL	00001
+#define	REG_NOTEOL	00002
+#define	REG_STARTEND	00004
+#define	REG_TRACE	00400	/* tracing of execution */
+#define	REG_LARGE	01000	/* force large representation */
+#define	REG_BACKR	02000	/* force use of backref code */
+
+__BEGIN_DECLS
+int	regcomp(regex_t *, const char *, int);
+size_t	regerror(int, const regex_t *, char *, size_t);
+int	regexec(const regex_t *, const char *, size_t, regmatch_t [], int);
+void	regfree(regex_t *);
+__END_DECLS
+
+#endif /* !_REGEX_H_ */
diff --git a/ndk/platforms/android-8/include/sched.h b/ndk/platforms/android-8/include/sched.h
new file mode 100644
index 0000000..2dba5b1
--- /dev/null
+++ b/ndk/platforms/android-8/include/sched.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _SCHED_H_
+#define _SCHED_H_
+
+#include <sys/cdefs.h>
+#include <sys/time.h>
+
+__BEGIN_DECLS
+
+#define SCHED_NORMAL            0
+#define SCHED_OTHER             0
+#define SCHED_FIFO              1
+#define SCHED_RR                2
+
+struct sched_param {
+    int sched_priority;
+};
+
+extern int sched_setscheduler(pid_t, int, const struct sched_param *);
+extern int sched_getscheduler(pid_t);
+extern int sched_yield(void);
+extern int sched_get_priority_max(int policy);
+extern int sched_get_priority_min(int policy);
+extern int sched_setparam(pid_t, const struct sched_param *);
+extern int sched_getparam(pid_t, struct sched_param *);
+extern int sched_rr_get_interval(pid_t pid, struct timespec *tp);
+
+#define CLONE_VM             0x00000100
+#define CLONE_FS             0x00000200
+#define CLONE_FILES          0x00000400
+#define CLONE_SIGHAND        0x00000800
+#define CLONE_PTRACE         0x00002000
+#define CLONE_VFORK          0x00004000
+#define CLONE_PARENT         0x00008000
+#define CLONE_THREAD         0x00010000
+#define CLONE_NEWNS          0x00020000
+#define CLONE_SYSVSEM        0x00040000
+#define CLONE_SETTLS         0x00080000
+#define CLONE_PARENT_SETTID  0x00100000
+#define CLONE_CHILD_CLEARTID 0x00200000
+#define CLONE_DETACHED       0x00400000
+#define CLONE_UNTRACED       0x00800000
+#define CLONE_CHILD_SETTID   0x01000000
+#define CLONE_STOPPED        0x02000000
+
+#ifdef _GNU_SOURCE
+extern int    clone(int (*fn)(void*), void *child_stack, int flags, void *arg);
+#endif
+
+__END_DECLS
+
+#endif /* _SCHED_H_ */
diff --git a/ndk/platforms/android-8/include/signal.h b/ndk/platforms/android-8/include/signal.h
new file mode 100644
index 0000000..4401164
--- /dev/null
+++ b/ndk/platforms/android-8/include/signal.h
@@ -0,0 +1,128 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _SIGNAL_H_
+#define _SIGNAL_H_
+
+#include <sys/cdefs.h>
+#include <limits.h>		/* For LONG_BIT */
+#include <string.h>		/* For memset() */
+#include <sys/types.h>
+#include <asm/signal.h>
+
+#define __ARCH_SI_UID_T __kernel_uid32_t
+#include <asm/siginfo.h>
+#undef __ARCH_SI_UID_T
+
+__BEGIN_DECLS
+
+typedef int sig_atomic_t;
+
+/* crepy NIG / _NSIG handling, just to be safe */
+#ifndef NSIG
+#  define NSIG  _NSIG
+#endif
+#ifndef _NSIG
+#  define _NSIG  NSIG
+#endif
+
+extern const char * const sys_siglist[];
+extern const char * const sys_signame[];
+
+static __inline__ int sigismember(sigset_t *set, int signum)
+{
+    unsigned long *local_set = (unsigned long *)set;
+    signum--;
+    return (int)((local_set[signum/LONG_BIT] >> (signum%LONG_BIT)) & 1);
+}
+
+
+static __inline__ int sigaddset(sigset_t *set, int signum)
+{
+    unsigned long *local_set = (unsigned long *)set;
+    signum--;
+    local_set[signum/LONG_BIT] |= 1UL << (signum%LONG_BIT);
+    return 0;
+}
+
+
+static __inline__ int sigdelset(sigset_t *set, int signum)
+{
+    unsigned long *local_set = (unsigned long *)set;
+    signum--;
+    local_set[signum/LONG_BIT] &= ~(1UL << (signum%LONG_BIT));
+    return 0;
+}
+
+
+static __inline__ int sigemptyset(sigset_t *set)
+{
+    memset(set, 0, sizeof *set);
+    return 0;
+}
+
+static __inline__ int sigfillset(sigset_t *set)
+{
+    memset(set, ~0, sizeof *set);
+    return 0;
+}
+
+
+/* compatibility types */
+typedef void  (*sig_t)(int);
+typedef sig_t sighandler_t;
+
+/* differentiater between sysv and bsd behaviour 8*/
+extern __sighandler_t sysv_signal(int, __sighandler_t);
+extern __sighandler_t bsd_signal(int, __sighandler_t);
+
+/* the default is bsd */
+static __inline__ __sighandler_t signal(int s, __sighandler_t f)
+{
+    return bsd_signal(s,f);
+}
+
+/* the syscall itself */
+extern __sighandler_t __signal(int, __sighandler_t, int);
+
+extern int sigprocmask(int, const sigset_t *, sigset_t *);
+extern int sigaction(int, const struct sigaction *, struct sigaction *);
+
+extern int sigpending(sigset_t *);
+extern int sigsuspend(const sigset_t *);
+extern int sigwait(const sigset_t *set, int *sig);
+extern int siginterrupt(int  sig, int  flag);
+
+extern int raise(int);
+extern int kill(pid_t, int);
+extern int killpg(int pgrp, int sig);
+extern int sigaltstack(const stack_t *ss, stack_t *oss);
+
+
+__END_DECLS
+
+#endif /* _SIGNAL_H_ */
diff --git a/ndk/platforms/android-8/include/stdio.h b/ndk/platforms/android-8/include/stdio.h
new file mode 100644
index 0000000..c38ed5a
--- /dev/null
+++ b/ndk/platforms/android-8/include/stdio.h
@@ -0,0 +1,453 @@
+/*	$OpenBSD: stdio.h,v 1.35 2006/01/13 18:10:09 miod Exp $	*/
+/*	$NetBSD: stdio.h,v 1.18 1996/04/25 18:29:21 jtc Exp $	*/
+
+/*-
+ * Copyright (c) 1990 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Chris Torek.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ * 3. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
+ *
+ *	@(#)stdio.h	5.17 (Berkeley) 6/3/91
+ */
+
+#ifndef	_STDIO_H_
+#define	_STDIO_H_
+
+#include <sys/cdefs.h>
+#include <sys/_types.h>
+
+/* va_list and size_t must be defined by stdio.h according to Posix */
+#define __need___va_list
+#include <stdarg.h>
+
+/* note that this forces stddef.h to *only* define size_t */
+#define __need_size_t
+#include <stddef.h>
+
+#include <stddef.h>
+
+#if __BSD_VISIBLE || __POSIX_VISIBLE || __XPG_VISIBLE
+#include <sys/types.h>	/* XXX should be removed */
+#endif
+
+#ifndef	_SIZE_T_DEFINED_
+#define	_SIZE_T_DEFINED_
+typedef	unsigned long    size_t;
+#endif
+
+#ifndef	_OFF_T_DEFINED_
+#define	_OFF_T_DEFINED_
+typedef	long    off_t;
+#endif
+
+#ifndef NULL
+#ifdef 	__GNUG__
+#define	NULL	__null
+#else
+#define	NULL	0L
+#endif
+#endif
+
+#define	_FSTDIO			/* Define for new stdio with functions. */
+
+typedef off_t fpos_t;		/* stdio file position type */
+
+/*
+ * NB: to fit things in six character monocase externals, the stdio
+ * code uses the prefix `__s' for stdio objects, typically followed
+ * by a three-character attempt at a mnemonic.
+ */
+
+/* stdio buffers */
+struct __sbuf {
+	unsigned char *_base;
+	int	_size;
+};
+
+/*
+ * stdio state variables.
+ *
+ * The following always hold:
+ *
+ *	if (_flags&(__SLBF|__SWR)) == (__SLBF|__SWR),
+ *		_lbfsize is -_bf._size, else _lbfsize is 0
+ *	if _flags&__SRD, _w is 0
+ *	if _flags&__SWR, _r is 0
+ *
+ * This ensures that the getc and putc macros (or inline functions) never
+ * try to write or read from a file that is in `read' or `write' mode.
+ * (Moreover, they can, and do, automatically switch from read mode to
+ * write mode, and back, on "r+" and "w+" files.)
+ *
+ * _lbfsize is used only to make the inline line-buffered output stream
+ * code as compact as possible.
+ *
+ * _ub, _up, and _ur are used when ungetc() pushes back more characters
+ * than fit in the current _bf, or when ungetc() pushes back a character
+ * that does not match the previous one in _bf.  When this happens,
+ * _ub._base becomes non-nil (i.e., a stream has ungetc() data iff
+ * _ub._base!=NULL) and _up and _ur save the current values of _p and _r.
+ *
+ * NOTE: if you change this structure, you also need to update the
+ * std() initializer in findfp.c.
+ */
+typedef	struct __sFILE {
+	unsigned char *_p;	/* current position in (some) buffer */
+	int	_r;		/* read space left for getc() */
+	int	_w;		/* write space left for putc() */
+	short	_flags;		/* flags, below; this FILE is free if 0 */
+	short	_file;		/* fileno, if Unix descriptor, else -1 */
+	struct	__sbuf _bf;	/* the buffer (at least 1 byte, if !NULL) */
+	int	_lbfsize;	/* 0 or -_bf._size, for inline putc */
+
+	/* operations */
+	void	*_cookie;	/* cookie passed to io functions */
+	int	(*_close)(void *);
+	int	(*_read)(void *, char *, int);
+	fpos_t	(*_seek)(void *, fpos_t, int);
+	int	(*_write)(void *, const char *, int);
+
+	/* extension data, to avoid further ABI breakage */
+	struct	__sbuf _ext;
+	/* data for long sequences of ungetc() */
+	unsigned char *_up;	/* saved _p when _p is doing ungetc data */
+	int	_ur;		/* saved _r when _r is counting ungetc data */
+
+	/* tricks to meet minimum requirements even when malloc() fails */
+	unsigned char _ubuf[3];	/* guarantee an ungetc() buffer */
+	unsigned char _nbuf[1];	/* guarantee a getc() buffer */
+
+	/* separate buffer for fgetln() when line crosses buffer boundary */
+	struct	__sbuf _lb;	/* buffer for fgetln() */
+
+	/* Unix stdio files get aligned to block boundaries on fseek() */
+	int	_blksize;	/* stat.st_blksize (may be != _bf._size) */
+	fpos_t	_offset;	/* current lseek offset */
+} FILE;
+
+__BEGIN_DECLS
+extern FILE __sF[];
+__END_DECLS
+
+#define	__SLBF	0x0001		/* line buffered */
+#define	__SNBF	0x0002		/* unbuffered */
+#define	__SRD	0x0004		/* OK to read */
+#define	__SWR	0x0008		/* OK to write */
+	/* RD and WR are never simultaneously asserted */
+#define	__SRW	0x0010		/* open for reading & writing */
+#define	__SEOF	0x0020		/* found EOF */
+#define	__SERR	0x0040		/* found error */
+#define	__SMBF	0x0080		/* _buf is from malloc */
+#define	__SAPP	0x0100		/* fdopen()ed in append mode */
+#define	__SSTR	0x0200		/* this is an sprintf/snprintf string */
+#define	__SOPT	0x0400		/* do fseek() optimisation */
+#define	__SNPT	0x0800		/* do not do fseek() optimisation */
+#define	__SOFF	0x1000		/* set iff _offset is in fact correct */
+#define	__SMOD	0x2000		/* true => fgetln modified _p text */
+#define	__SALC	0x4000		/* allocate string space dynamically */
+
+/*
+ * The following three definitions are for ANSI C, which took them
+ * from System V, which brilliantly took internal interface macros and
+ * made them official arguments to setvbuf(), without renaming them.
+ * Hence, these ugly _IOxxx names are *supposed* to appear in user code.
+ *
+ * Although numbered as their counterparts above, the implementation
+ * does not rely on this.
+ */
+#define	_IOFBF	0		/* setvbuf should set fully buffered */
+#define	_IOLBF	1		/* setvbuf should set line buffered */
+#define	_IONBF	2		/* setvbuf should set unbuffered */
+
+#define	BUFSIZ	1024		/* size of buffer used by setbuf */
+
+#define	EOF	(-1)
+
+/*
+ * FOPEN_MAX is a minimum maximum, and should be the number of descriptors
+ * that the kernel can provide without allocation of a resource that can
+ * fail without the process sleeping.  Do not use this for anything.
+ */
+#define	FOPEN_MAX	20	/* must be <= OPEN_MAX <sys/syslimits.h> */
+#define	FILENAME_MAX	1024	/* must be <= PATH_MAX <sys/syslimits.h> */
+
+/* System V/ANSI C; this is the wrong way to do this, do *not* use these. */
+#if __BSD_VISIBLE || __XPG_VISIBLE
+#define	P_tmpdir	"/tmp/"
+#endif
+#define	L_tmpnam	1024	/* XXX must be == PATH_MAX */
+#define	TMP_MAX		308915776
+
+#ifndef SEEK_SET
+#define	SEEK_SET	0	/* set file offset to offset */
+#endif
+#ifndef SEEK_CUR
+#define	SEEK_CUR	1	/* set file offset to current plus offset */
+#endif
+#ifndef SEEK_END
+#define	SEEK_END	2	/* set file offset to EOF plus offset */
+#endif
+
+#define	stdin	(&__sF[0])
+#define	stdout	(&__sF[1])
+#define	stderr	(&__sF[2])
+
+/*
+ * Functions defined in ANSI C standard.
+ */
+__BEGIN_DECLS
+void	 clearerr(FILE *);
+int	 fclose(FILE *);
+int	 feof(FILE *);
+int	 ferror(FILE *);
+int	 fflush(FILE *);
+int	 fgetc(FILE *);
+int	 fgetpos(FILE *, fpos_t *);
+char	*fgets(char *, int, FILE *);
+FILE	*fopen(const char *, const char *);
+int	 fprintf(FILE *, const char *, ...);
+int	 fputc(int, FILE *);
+int	 fputs(const char *, FILE *);
+size_t	 fread(void *, size_t, size_t, FILE *);
+FILE	*freopen(const char *, const char *, FILE *);
+int	 fscanf(FILE *, const char *, ...);
+int	 fseek(FILE *, long, int);
+int	 fseeko(FILE *, off_t, int);
+int	 fsetpos(FILE *, const fpos_t *);
+long	 ftell(FILE *);
+off_t	 ftello(FILE *);
+size_t	 fwrite(const void *, size_t, size_t, FILE *);
+int	 getc(FILE *);
+int	 getchar(void);
+char	*gets(char *);
+#if __BSD_VISIBLE && !defined(__SYS_ERRLIST)
+#define __SYS_ERRLIST
+
+extern int sys_nerr;			/* perror(3) external variables */
+extern char *sys_errlist[];
+#endif
+void	 perror(const char *);
+int	 printf(const char *, ...);
+int	 putc(int, FILE *);
+int	 putchar(int);
+int	 puts(const char *);
+int	 remove(const char *);
+int	 rename(const char *, const char *);
+void	 rewind(FILE *);
+int	 scanf(const char *, ...);
+void	 setbuf(FILE *, char *);
+int	 setvbuf(FILE *, char *, int, size_t);
+int	 sprintf(char *, const char *, ...);
+int	 sscanf(const char *, const char *, ...);
+FILE	*tmpfile(void);
+char	*tmpnam(char *);
+int	 ungetc(int, FILE *);
+int	 vfprintf(FILE *, const char *, __va_list);
+int	 vprintf(const char *, __va_list);
+int	 vsprintf(char *, const char *, __va_list);
+
+#if __ISO_C_VISIBLE >= 1999 || __BSD_VISIBLE
+int	 snprintf(char *, size_t, const char *, ...)
+		__attribute__((__format__ (printf, 3, 4)))
+		__attribute__((__nonnull__ (3)));
+int	 vfscanf(FILE *, const char *, __va_list)
+		__attribute__((__format__ (scanf, 2, 0)))
+		__attribute__((__nonnull__ (2)));
+int	 vscanf(const char *, __va_list)
+		__attribute__((__format__ (scanf, 1, 0)))
+		__attribute__((__nonnull__ (1)));
+int	 vsnprintf(char *, size_t, const char *, __va_list)
+		__attribute__((__format__ (printf, 3, 0)))
+		__attribute__((__nonnull__ (3)));
+int	 vsscanf(const char *, const char *, __va_list)
+		__attribute__((__format__ (scanf, 2, 0)))
+		__attribute__((__nonnull__ (2)));
+#endif /* __ISO_C_VISIBLE >= 1999 || __BSD_VISIBLE */
+
+__END_DECLS
+
+
+/*
+ * Functions defined in POSIX 1003.1.
+ */
+#if __BSD_VISIBLE || __POSIX_VISIBLE || __XPG_VISIBLE
+#define	L_ctermid	1024	/* size for ctermid(); PATH_MAX */
+#define L_cuserid	9	/* size for cuserid(); UT_NAMESIZE + 1 */
+
+__BEGIN_DECLS
+#if 0 /* MISSING FROM BIONIC */
+char	*ctermid(char *);
+char	*cuserid(char *);
+#endif /* MISSING */
+FILE	*fdopen(int, const char *);
+int	 fileno(FILE *);
+
+#if (__POSIX_VISIBLE >= 199209)
+int	 pclose(FILE *);
+FILE	*popen(const char *, const char *);
+#endif
+
+#if __POSIX_VISIBLE >= 199506
+void	 flockfile(FILE *);
+int	 ftrylockfile(FILE *);
+void	 funlockfile(FILE *);
+
+/*
+ * These are normally used through macros as defined below, but POSIX
+ * requires functions as well.
+ */
+int	 getc_unlocked(FILE *);
+int	 getchar_unlocked(void);
+int	 putc_unlocked(int, FILE *);
+int	 putchar_unlocked(int);
+#endif /* __POSIX_VISIBLE >= 199506 */
+
+#if __XPG_VISIBLE
+char	*tempnam(const char *, const char *);
+#endif
+__END_DECLS
+
+#endif /* __BSD_VISIBLE || __POSIX_VISIBLE || __XPG_VISIBLE */
+
+/*
+ * Routines that are purely local.
+ */
+#if __BSD_VISIBLE
+__BEGIN_DECLS
+int	 asprintf(char **, const char *, ...)
+		__attribute__((__format__ (printf, 2, 3)))
+		__attribute__((__nonnull__ (2)));
+char	*fgetln(FILE *, size_t *);
+int	 fpurge(FILE *);
+int	 getw(FILE *);
+int	 putw(int, FILE *);
+void	 setbuffer(FILE *, char *, int);
+int	 setlinebuf(FILE *);
+int	 vasprintf(char **, const char *, __va_list)
+		__attribute__((__format__ (printf, 2, 0)))
+		__attribute__((__nonnull__ (2)));
+__END_DECLS
+
+/*
+ * Stdio function-access interface.
+ */
+__BEGIN_DECLS
+FILE	*funopen(const void *,
+		int (*)(void *, char *, int),
+		int (*)(void *, const char *, int),
+		fpos_t (*)(void *, fpos_t, int),
+		int (*)(void *));
+__END_DECLS
+#define	fropen(cookie, fn) funopen(cookie, fn, 0, 0, 0)
+#define	fwopen(cookie, fn) funopen(cookie, 0, fn, 0, 0)
+#endif /* __BSD_VISIBLE */
+
+/*
+ * Functions internal to the implementation.
+ */
+__BEGIN_DECLS
+int	__srget(FILE *);
+int	__swbuf(int, FILE *);
+__END_DECLS
+
+/*
+ * The __sfoo macros are here so that we can
+ * define function versions in the C library.
+ */
+#define	__sgetc(p) (--(p)->_r < 0 ? __srget(p) : (int)(*(p)->_p++))
+#if defined(__GNUC__)
+static __inline int __sputc(int _c, FILE *_p) {
+	if (--_p->_w >= 0 || (_p->_w >= _p->_lbfsize && (char)_c != '\n'))
+		return (*_p->_p++ = _c);
+	else
+		return (__swbuf(_c, _p));
+}
+#else
+/*
+ * This has been tuned to generate reasonable code on the vax using pcc.
+ */
+#define	__sputc(c, p) \
+	(--(p)->_w < 0 ? \
+		(p)->_w >= (p)->_lbfsize ? \
+			(*(p)->_p = (c)), *(p)->_p != '\n' ? \
+				(int)*(p)->_p++ : \
+				__swbuf('\n', p) : \
+			__swbuf((int)(c), p) : \
+		(*(p)->_p = (c), (int)*(p)->_p++))
+#endif
+
+#define	__sfeof(p)	(((p)->_flags & __SEOF) != 0)
+#define	__sferror(p)	(((p)->_flags & __SERR) != 0)
+#define	__sclearerr(p)	((void)((p)->_flags &= ~(__SERR|__SEOF)))
+#define	__sfileno(p)	((p)->_file)
+
+#define	feof(p)		__sfeof(p)
+#define	ferror(p)	__sferror(p)
+
+#ifndef _POSIX_THREADS
+#define	clearerr(p)	__sclearerr(p)
+#endif
+
+#if __POSIX_VISIBLE
+#define	fileno(p)	__sfileno(p)
+#endif
+
+#ifndef lint
+#ifndef _POSIX_THREADS
+#define	getc(fp)	__sgetc(fp)
+#endif /* _POSIX_THREADS */
+#define	getc_unlocked(fp)	__sgetc(fp)
+/*
+ * The macro implementations of putc and putc_unlocked are not
+ * fully POSIX compliant; they do not set errno on failure
+ */
+#if __BSD_VISIBLE
+#ifndef _POSIX_THREADS
+#define putc(x, fp)	__sputc(x, fp)
+#endif /* _POSIX_THREADS */
+#define putc_unlocked(x, fp)	__sputc(x, fp)
+#endif /* __BSD_VISIBLE */
+#endif /* lint */
+
+#define	getchar()	getc(stdin)
+#define	putchar(x)	putc(x, stdout)
+#define getchar_unlocked()	getc_unlocked(stdin)
+#define putchar_unlocked(c)	putc_unlocked(c, stdout)
+
+#ifdef _GNU_SOURCE
+/*
+ * glibc defines dprintf(int, const char*, ...), which is poorly named
+ * and likely to conflict with locally defined debugging printfs
+ * fdprintf is a better name, and some programs that use fdprintf use a
+ * #define fdprintf dprintf for compatibility
+ */
+int fdprintf(int, const char*, ...);
+int vfdprintf(int, const char*, __va_list);
+#endif /* _GNU_SOURCE */
+
+#endif /* _STDIO_H_ */
diff --git a/ndk/platforms/android-8/include/stdlib.h b/ndk/platforms/android-8/include/stdlib.h
new file mode 100644
index 0000000..ddaf32c
--- /dev/null
+++ b/ndk/platforms/android-8/include/stdlib.h
@@ -0,0 +1,185 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _STDLIB_H_
+#define _STDLIB_H_
+
+#include <sys/cdefs.h>
+
+/* wchar_t is required in stdlib.h according to POSIX.
+ * note that defining __need_wchar_t prevents stddef.h
+ * to define all other symbols it does normally */
+#define __need_wchar_t
+#include <stddef.h>
+
+#include <stddef.h>
+#include <string.h>
+#include <alloca.h>
+#include <strings.h>
+#include <memory.h>
+
+__BEGIN_DECLS
+
+#define EXIT_FAILURE 1
+#define EXIT_SUCCESS 0
+
+extern __noreturn void exit(int);
+extern __noreturn void abort(void);
+extern int atexit(void (*)(void));
+
+extern char *getenv(const char *);
+extern int putenv(const char *);
+extern int setenv(const char *, const char *, int);
+extern int unsetenv(const char *);
+extern int clearenv(void);
+
+extern char *mktemp (char *);
+extern int mkstemp (char *);
+
+extern long strtol(const char *, char **, int);
+extern long long strtoll(const char *, char **, int);
+extern unsigned long strtoul(const char *, char **, int);
+extern unsigned long long strtoull(const char *, char **, int);
+extern double strtod(const char *nptr, char **endptr);
+
+static __inline__ float strtof(const char *nptr, char **endptr)
+{
+    return (float)strtod(nptr, endptr);
+}
+
+extern int atoi(const char *);
+extern long atol(const char *);
+extern long long atoll(const char *);
+
+static __inline__ double atof(const char *nptr)
+{
+    return (strtod(nptr, NULL));
+}
+
+static __inline__ int abs(int __n) {
+    return (__n < 0) ? -__n : __n;
+}
+
+static __inline__ long labs(long __n) {
+    return (__n < 0L) ? -__n : __n;
+}
+
+static __inline__ long long llabs(long long __n) {
+    return (__n < 0LL) ? -__n : __n;
+}
+
+extern char * realpath(const char *path, char *resolved);
+extern int system(const char * string);
+
+extern void * bsearch(const void *key, const void *base0,
+	size_t nmemb, size_t size,
+	int (*compar)(const void *, const void *));
+
+extern void qsort(void *, size_t, size_t, int (*)(const void *, const void *));
+
+extern long jrand48(unsigned short *);
+extern long mrand48(void);
+extern long nrand48(unsigned short *);
+extern long lrand48(void);
+extern unsigned short *seed48(unsigned short*);
+extern double erand48(unsigned short xsubi[3]);
+extern double drand48(void);
+extern void srand48(long);
+extern unsigned int arc4random(void);
+extern void arc4random_stir(void);
+extern void arc4random_addrandom(unsigned char *, int);
+
+#define RAND_MAX 0x7fffffff
+static __inline__ int rand(void) {
+    return (int)lrand48();
+}
+static __inline__ void srand(unsigned int __s) {
+    srand48(__s);
+}
+static __inline__ long random(void)
+{
+    return lrand48();
+}
+static __inline__ void srandom(unsigned int __s)
+{
+    srand48(__s);
+}
+
+/* Basic PTY functions.  These only work if devpts is mounted! */
+
+extern int    unlockpt(int);
+extern char*  ptsname(int);
+extern char*  ptsname_r(int, char*, size_t);
+extern int    getpt(void);
+
+static __inline__ int grantpt(int __fd)
+{
+  (void)__fd;
+  return 0;     /* devpts does this all for us! */
+}
+
+typedef struct {
+    int  quot;
+    int  rem;
+} div_t;
+
+extern div_t   div(int, int);
+
+typedef struct {
+    long int  quot;
+    long int  rem;
+} ldiv_t;
+
+extern ldiv_t   ldiv(long, long);
+
+typedef struct {
+    long long int  quot;
+    long long int  rem;
+} lldiv_t;
+
+extern lldiv_t   lldiv(long long, long long);
+
+#if 1 /* MISSING FROM BIONIC - ENABLED FOR STLPort and libstdc++-v3 */
+/* make STLPort happy */
+extern int      mblen(const char *, size_t);
+extern size_t   mbstowcs(wchar_t *, const char *, size_t);
+extern int      mbtowc(wchar_t *, const char *, size_t);
+
+/* Likewise, make libstdc++-v3 happy.  */
+extern int	wctomb(char *, wchar_t);
+extern size_t	wcstombs(char *, const wchar_t *, size_t);
+#endif /* MISSING */
+
+#define MB_CUR_MAX 1
+
+#if 0 /* MISSING FROM BIONIC */
+extern int on_exit(void (*)(int, void *), void *);
+#endif /* MISSING */
+
+__END_DECLS
+
+#endif /* _STDLIB_H_ */
diff --git a/ndk/platforms/android-8/include/time.h b/ndk/platforms/android-8/include/time.h
new file mode 100644
index 0000000..6163c6d
--- /dev/null
+++ b/ndk/platforms/android-8/include/time.h
@@ -0,0 +1,115 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _TIME_H_
+#define _TIME_H_
+
+#include <sys/cdefs.h>
+#include <sys/time.h>
+
+#define __ARCH_SI_UID_T __kernel_uid32_t
+#include <asm/siginfo.h>
+#undef __ARCH_SI_UID_T
+
+__BEGIN_DECLS
+
+extern time_t   time(time_t *);
+extern int      nanosleep(const struct timespec *, struct timespec *);
+
+extern char *strtotimeval(const char *str, struct timeval *tv);
+
+struct tm {
+   int     tm_sec;         /* seconds */
+   int     tm_min;         /* minutes */
+   int     tm_hour;        /* hours */
+   int     tm_mday;        /* day of the month */
+   int     tm_mon;         /* month */
+   int     tm_year;        /* year */
+   int     tm_wday;        /* day of the week */
+   int     tm_yday;        /* day in the year */
+   int     tm_isdst;       /* daylight saving time */
+
+   long int tm_gmtoff;     /* Seconds east of UTC.  */
+   const char *tm_zone;    /* Timezone abbreviation.  */
+
+};
+
+/* defining TM_ZONE indicates that we have a "timezone abbreviation" field in
+ * struct tm, the value should be the field name
+ */
+#define   TM_ZONE   tm_zone
+
+extern char* asctime(const struct tm* a);
+extern char* asctime_r(const struct tm* a, char* buf);
+
+/* Return the difference between TIME1 and TIME0.  */
+extern double difftime (time_t __time1, time_t __time0);
+extern time_t mktime (struct tm *a);
+
+extern struct tm*  localtime(const time_t *t);
+extern struct tm*  localtime_r(const time_t *timep, struct tm *result);
+
+extern struct tm*  gmtime(const time_t *timep);
+extern struct tm*  gmtime_r(const time_t *timep, struct tm *result);
+
+extern char*       strptime(const char *buf, const char *fmt, struct tm *tm);
+extern size_t      strftime(char *s, size_t max, const char *format, const struct tm *tm);
+
+extern char *ctime(const time_t *timep);
+extern char *ctime_r(const time_t *timep, char *buf);
+
+extern void  tzset(void);
+
+/* global includes */
+extern char*     tzname[];
+extern int       daylight;
+extern long int  timezone;
+
+#define CLOCKS_PER_SEC     1000000
+
+extern clock_t   clock(void);
+
+/* BIONIC: extra linux clock goodies */
+extern int clock_getres(int, struct timespec *);
+extern int clock_gettime(int, struct timespec *);
+
+#define CLOCK_REALTIME             0
+#define CLOCK_MONOTONIC            1
+#define CLOCK_PROCESS_CPUTIME_ID   2
+#define CLOCK_THREAD_CPUTIME_ID    3
+#define CLOCK_REALTIME_HR          4
+#define CLOCK_MONOTONIC_HR         5
+
+extern int  timer_create(int, struct sigevent*, timer_t*);
+extern int  timer_delete(timer_t);
+extern int  timer_settime(timer_t timerid, int flags, const struct itimerspec *value, struct itimerspec *ovalue);
+extern int  timer_gettime(timer_t timerid, struct itimerspec *value);
+extern int  timer_getoverrun(timer_t  timerid);
+
+__END_DECLS
+
+#endif /* _TIME_H_ */
diff --git a/ndk/platforms/android-8/include/unistd.h b/ndk/platforms/android-8/include/unistd.h
new file mode 100644
index 0000000..d64c971
--- /dev/null
+++ b/ndk/platforms/android-8/include/unistd.h
@@ -0,0 +1,208 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _UNISTD_H_
+#define _UNISTD_H_
+
+#include <stddef.h>
+#include <sys/cdefs.h>
+#include <sys/types.h>
+#include <sys/select.h>
+#include <sys/sysconf.h>
+#include <linux/capability.h>
+#include <pathconf.h>
+
+__BEGIN_DECLS
+
+/* Standard file descriptor numbers. */
+#define STDIN_FILENO	0
+#define STDOUT_FILENO	1
+#define STDERR_FILENO	2
+
+/* Values for whence in fseek and lseek */
+#define SEEK_SET 0
+#define SEEK_CUR 1
+#define SEEK_END 2
+
+extern char **environ;
+extern __noreturn void _exit(int);
+
+extern pid_t  fork(void);
+extern pid_t  vfork(void);
+extern pid_t  getpid(void);
+extern pid_t  gettid(void);
+extern pid_t  getpgid(pid_t);
+extern int    setpgid(pid_t, pid_t);
+extern pid_t  getppid(void);
+extern pid_t  getpgrp(void);
+extern int    setpgrp(void);
+extern pid_t  setsid(void);
+
+extern int execv(const char *, char * const *);
+extern int execvp(const char *, char * const *);
+extern int execve(const char *, char * const *, char * const *);
+extern int execl(const char *, const char *, ...);
+extern int execlp(const char *, const char *, ...);
+extern int execle(const char *, const char *, ...);
+extern int capget(cap_user_header_t hdrp, cap_user_data_t datap);
+extern int capset(cap_user_header_t hdrp, const cap_user_data_t datap);
+extern int prctl(int  option,  unsigned long arg2, unsigned long arg3,
+                 unsigned long arg4, unsigned long arg5);
+
+extern int nice(int);
+
+extern int setuid(uid_t);
+extern uid_t getuid(void);
+extern int seteuid(uid_t);
+extern uid_t geteuid(void);
+extern int setgid(gid_t);
+extern gid_t getgid(void);
+extern int setegid(gid_t);
+extern gid_t getegid(void);
+extern int getgroups(int, gid_t *);
+extern int setgroups(size_t, const gid_t *);
+extern int setreuid(uid_t, uid_t);
+extern int setregid(gid_t, gid_t);
+extern int setresuid(uid_t, uid_t, uid_t);
+extern int setresgid(gid_t, gid_t, gid_t);
+extern int getresuid(uid_t *ruid, uid_t *euid, uid_t *suid);
+extern int getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid);
+extern int issetugid(void);
+extern char* getlogin(void);
+extern char* getusershell(void);
+extern void setusershell(void);
+extern void endusershell(void);
+
+
+
+/* Macros for access() */
+#define R_OK  4  /* Read */
+#define W_OK  2  /* Write */
+#define X_OK  1  /* Execute */
+#define F_OK  0  /* Existence */
+
+extern int access(const char *, int);
+extern int link(const char *, const char *);
+extern int unlink(const char *);
+extern int chdir(const char *);
+extern int fchdir(int);
+extern int rmdir(const char *);
+extern int pipe(int *);
+extern int chroot(const char *);
+extern int symlink(const char *, const char *);
+extern int readlink(const char *, char *, size_t);
+extern int chown(const char *, uid_t, gid_t);
+extern int fchown(int, uid_t, gid_t);
+extern int lchown(const char *, uid_t, gid_t);
+extern int truncate(const char *, off_t);
+extern char *getcwd(char *, size_t);
+
+extern int sync(void);
+
+extern int close(int);
+extern off_t lseek(int, off_t, int);
+extern loff_t lseek64(int, loff_t, int);
+
+extern ssize_t read(int, void *, size_t);
+extern ssize_t write(int, const void *, size_t);
+extern ssize_t pread(int, void *, size_t, off_t);
+extern ssize_t pwrite(int, void *, size_t, off_t);
+
+extern int dup(int);
+extern int dup2(int, int);
+extern int fcntl(int, int, ...);
+extern int ioctl(int, int, ...);
+extern int flock(int, int);
+extern int fsync(int);
+extern int ftruncate(int, off_t);
+
+extern int pause(void);
+extern unsigned int alarm(unsigned int);
+extern unsigned int sleep(unsigned int);
+extern int usleep(unsigned long);
+
+extern int gethostname(char *, size_t);
+
+extern int getdtablesize(void);
+
+extern void *__brk(void *);
+extern int brk(void *);
+extern void *sbrk(ptrdiff_t);
+
+extern int getopt(int, char * const *, const char *);
+extern char *optarg;
+extern int optind, opterr, optopt;
+
+extern int isatty(int);
+extern char* ttyname(int);
+extern int ttyname_r(int, char*, size_t);
+
+extern int  acct(const char*  filepath);
+
+static __inline__ int getpagesize(void) {
+  extern unsigned int __page_size;
+  return __page_size;
+}
+static __inline__ int __getpageshift(void) {
+  extern unsigned int __page_shift;
+  return __page_shift;
+}
+
+extern int sysconf(int  name);
+
+extern int daemon(int, int);
+
+/* A special syscall that is only available on the ARM, not x86 function. */
+extern int cacheflush(long start, long end, long flags);
+
+extern pid_t tcgetpgrp(int fd);
+extern int   tcsetpgrp(int fd, pid_t _pid);
+
+#if 0 /* MISSING FROM BIONIC */
+extern pid_t  getsid(pid_t);
+extern int execvpe(const char *, char * const *, char * const *);
+extern int execlpe(const char *, const char *, ...);
+extern int getfsuid(uid_t);
+extern int setfsuid(uid_t);
+extern int fdatasync(int);
+extern int getlogin_r(char* name, size_t namesize);
+extern int sethostname(const char *, size_t);
+extern int getdomainname(char *, size_t);
+extern int setdomainname(const char *, size_t);
+#endif /* MISSING */
+
+/* Used to retry syscalls that can return EINTR. */
+#define TEMP_FAILURE_RETRY(exp) ({         \
+    typeof (exp) _rc;                      \
+    do {                                   \
+        _rc = (exp);                       \
+    } while (_rc == -1 && errno == EINTR); \
+    _rc; })
+
+__END_DECLS
+
+#endif /* _UNISTD_H_ */
diff --git a/ndk/platforms/android-8/include/wchar.h b/ndk/platforms/android-8/include/wchar.h
new file mode 100644
index 0000000..97e1b5c
--- /dev/null
+++ b/ndk/platforms/android-8/include/wchar.h
@@ -0,0 +1,157 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _WCHAR_H_
+#define _WCHAR_H_
+
+#include <sys/cdefs.h>
+#include <stdio.h>
+
+/* wchar_t is required in stdlib.h according to POSIX */
+#define __need___wchar_t
+#include <stddef.h>
+
+#include <stdarg.h>
+#include <time.h>
+#include <malloc.h>
+
+#include <stddef.h>
+
+/* IMPORTANT: Any code that relies on wide character support is essentially
+ *            non-portable and/or broken. the only reason this header exist
+ *            is because I'm really a nice guy. However, I'm not nice enough
+ *            to provide you with a real implementation. instead wchar_t == char
+ *            and all wc functions are stubs to their "normal" equivalent...
+ */
+
+__BEGIN_DECLS
+
+typedef int                     wint_t;
+typedef struct { int  dummy; }  mbstate_t;
+
+typedef enum {
+    WC_TYPE_INVALID = 0,
+    WC_TYPE_ALNUM,
+    WC_TYPE_ALPHA,
+    WC_TYPE_BLANK,
+    WC_TYPE_CNTRL,
+    WC_TYPE_DIGIT,
+    WC_TYPE_GRAPH,
+    WC_TYPE_LOWER,
+    WC_TYPE_PRINT,
+    WC_TYPE_PUNCT,
+    WC_TYPE_SPACE,
+    WC_TYPE_UPPER,
+    WC_TYPE_XDIGIT,
+    WC_TYPE_MAX
+} wctype_t;
+
+#define  WCHAR_MAX   255
+#define  WCHAR_MIN   0
+#define  WEOF        (-1)
+
+extern wint_t            btowc(int);
+extern int               fwprintf(FILE *, const wchar_t *, ...);
+extern int               fwscanf(FILE *, const wchar_t *, ...);
+extern int               iswalnum(wint_t);
+extern int               iswalpha(wint_t);
+extern int               iswcntrl(wint_t);
+extern int               iswdigit(wint_t);
+extern int               iswgraph(wint_t);
+extern int               iswlower(wint_t);
+extern int               iswprint(wint_t);
+extern int               iswpunct(wint_t);
+extern int               iswspace(wint_t);
+extern int               iswupper(wint_t);
+extern int               iswxdigit(wint_t);
+extern int               iswctype(wint_t, wctype_t);
+extern wint_t            fgetwc(FILE *);
+extern wchar_t          *fgetws(wchar_t *, int, FILE *);
+extern wint_t            fputwc(wchar_t, FILE *);
+extern int               fputws(const wchar_t *, FILE *);
+extern int               fwide(FILE *, int);
+extern wint_t            getwc(FILE *);
+extern wint_t            getwchar(void);
+extern int               mbsinit(const mbstate_t *);
+extern size_t            mbrlen(const char *, size_t, mbstate_t *);
+extern size_t            mbrtowc(wchar_t *, const char *, size_t, mbstate_t *);
+extern size_t            mbsrtowcs(wchar_t *, const char **, size_t, mbstate_t *);
+extern size_t            mbstowcs(wchar_t *, const char *, size_t);
+extern wint_t            putwc(wchar_t, FILE *);
+extern wint_t            putwchar(wchar_t);
+extern int               swprintf(wchar_t *, size_t, const wchar_t *, ...);
+extern int               swscanf(const wchar_t *, const wchar_t *, ...);
+extern wint_t            towlower(wint_t);
+extern wint_t            towupper(wint_t);
+extern wint_t            ungetwc(wint_t, FILE *);
+extern int               vfwprintf(FILE *, const wchar_t *, va_list);
+extern int               vwprintf(const wchar_t *, va_list);
+extern int               vswprintf(wchar_t *, size_t, const wchar_t *, va_list);
+extern size_t            wcrtomb(char *, wchar_t, mbstate_t *);
+extern wchar_t          *wcscat(wchar_t *, const wchar_t *);
+extern wchar_t          *wcschr(const wchar_t *, wchar_t);
+extern int               wcscmp(const wchar_t *, const wchar_t *);
+extern int               wcscoll(const wchar_t *, const wchar_t *);
+extern wchar_t          *wcscpy(wchar_t *, const wchar_t *);
+extern size_t            wcscspn(const wchar_t *, const wchar_t *);
+extern size_t            wcsftime(wchar_t *, size_t, const wchar_t *, const struct tm *);
+extern size_t            wcslen(const wchar_t *);
+extern wchar_t          *wcsncat(wchar_t *, const wchar_t *, size_t);
+extern int               wcsncmp(const wchar_t *, const wchar_t *, size_t);
+extern wchar_t          *wcsncpy(wchar_t *, const wchar_t *, size_t);
+extern wchar_t          *wcspbrk(const wchar_t *, const wchar_t *);
+extern wchar_t          *wcsrchr(const wchar_t *, wchar_t);
+extern size_t            wcsrtombs(char *, const wchar_t **, size_t, mbstate_t *);
+extern size_t            wcsspn(const wchar_t *, const wchar_t *);
+extern wchar_t          *wcsstr(const wchar_t *, const wchar_t *);
+extern double            wcstod(const wchar_t *, wchar_t **);
+extern wchar_t          *wcstok(wchar_t *, const wchar_t *, wchar_t **);
+extern long int          wcstol(const wchar_t *, wchar_t **, int);
+extern size_t            wcstombs(char *, const wchar_t *, size_t);
+extern unsigned long int wcstoul(const wchar_t *, wchar_t **, int);
+extern wchar_t          *wcswcs(const wchar_t *, const wchar_t *);
+extern int               wcswidth(const wchar_t *, size_t);
+extern size_t            wcsxfrm(wchar_t *, const wchar_t *, size_t);
+extern int               wctob(wint_t);
+extern wctype_t          wctype(const char *);
+extern int               wcwidth(wchar_t);
+extern wchar_t          *wmemchr(const wchar_t *, wchar_t, size_t);
+extern int               wmemcmp(const wchar_t *, const wchar_t *, size_t);
+extern wchar_t          *wmemcpy(wchar_t *, const wchar_t *, size_t);
+extern wchar_t          *wmemmove(wchar_t *, const wchar_t *, size_t);
+extern wchar_t          *wmemset(wchar_t *, wchar_t, size_t);
+extern int               wprintf(const wchar_t *, ...);
+extern int               wscanf(const wchar_t *, ...);
+
+/* No really supported.  These are just for making libstdc++-v3 happy.  */
+typedef void *wctrans_t;
+extern wint_t		 towctrans(wint_t, wctrans_t);
+extern wctrans_t	 wctrans (const char *);
+
+__END_DECLS
+
+#endif /* _WCHAR_H_ */
diff --git a/ndk/platforms/android-8/samples/bitmap-plasma/AndroidManifest.xml b/ndk/platforms/android-8/samples/bitmap-plasma/AndroidManifest.xml
new file mode 100644
index 0000000..28f0252
--- /dev/null
+++ b/ndk/platforms/android-8/samples/bitmap-plasma/AndroidManifest.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+      package="com.example.plasma"
+      android:versionCode="1"
+      android:versionName="1.0">
+    <application android:label="@string/app_name" android:debuggable="true">
+        <activity android:name=".Plasma"
+                  android:label="@string/app_name">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.LAUNCHER" />
+            </intent-filter>
+        </activity>
+    </application>
+    <uses-sdk android:minSdkVersion="8"/>
+</manifest> 
diff --git a/ndk/platforms/android-8/samples/bitmap-plasma/default.properties b/ndk/platforms/android-8/samples/bitmap-plasma/default.properties
new file mode 100644
index 0000000..9a2c9f6
--- /dev/null
+++ b/ndk/platforms/android-8/samples/bitmap-plasma/default.properties
@@ -0,0 +1,11 @@
+# This file is automatically generated by Android Tools.
+# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
+# 
+# This file must be checked in Version Control Systems.
+# 
+# To customize properties used by the Ant build system use,
+# "build.properties", and override values to adapt the script to your
+# project structure.
+
+# Project target.
+target=android-9
diff --git a/ndk/platforms/android-8/samples/bitmap-plasma/jni/Android.mk b/ndk/platforms/android-8/samples/bitmap-plasma/jni/Android.mk
new file mode 100644
index 0000000..3fcb491
--- /dev/null
+++ b/ndk/platforms/android-8/samples/bitmap-plasma/jni/Android.mk
@@ -0,0 +1,9 @@
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE    := plasma
+LOCAL_SRC_FILES := plasma.c
+LOCAL_LDLIBS    := -lm -llog -ljnigraphics
+
+include $(BUILD_SHARED_LIBRARY)
diff --git a/ndk/platforms/android-8/samples/bitmap-plasma/jni/Application.mk b/ndk/platforms/android-8/samples/bitmap-plasma/jni/Application.mk
new file mode 100644
index 0000000..8c85307
--- /dev/null
+++ b/ndk/platforms/android-8/samples/bitmap-plasma/jni/Application.mk
@@ -0,0 +1,3 @@
+# The ARMv7 is significanly faster due to the use of the hardware FPU
+APP_ABI := armeabi armeabi-v7a
+APP_PLATFORM := android-8
diff --git a/ndk/platforms/android-8/samples/bitmap-plasma/jni/plasma.c b/ndk/platforms/android-8/samples/bitmap-plasma/jni/plasma.c
new file mode 100644
index 0000000..79cd66d
--- /dev/null
+++ b/ndk/platforms/android-8/samples/bitmap-plasma/jni/plasma.c
@@ -0,0 +1,400 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <jni.h>
+#include <time.h>
+#include <android/log.h>
+#include <android/bitmap.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+
+#define  LOG_TAG    "libplasma"
+#define  LOGI(...)  __android_log_print(ANDROID_LOG_INFO,LOG_TAG,__VA_ARGS__)
+#define  LOGE(...)  __android_log_print(ANDROID_LOG_ERROR,LOG_TAG,__VA_ARGS__)
+
+/* Set to 1 to enable debug log traces. */
+#define DEBUG 0
+
+/* Set to 1 to optimize memory stores when generating plasma. */
+#define OPTIMIZE_WRITES  1
+
+/* Return current time in milliseconds */
+static double now_ms(void)
+{
+    struct timeval tv;
+    gettimeofday(&tv, NULL);
+    return tv.tv_sec*1000. + tv.tv_usec/1000.;
+}
+
+/* We're going to perform computations for every pixel of the target
+ * bitmap. floating-point operations are very slow on ARMv5, and not
+ * too bad on ARMv7 with the exception of trigonometric functions.
+ *
+ * For better performance on all platforms, we're going to use fixed-point
+ * arithmetic and all kinds of tricks
+ */
+
+typedef int32_t  Fixed;
+
+#define  FIXED_BITS           16
+#define  FIXED_ONE            (1 << FIXED_BITS)
+#define  FIXED_AVERAGE(x,y)   (((x) + (y)) >> 1)
+
+#define  FIXED_FROM_INT(x)    ((x) << FIXED_BITS)
+#define  FIXED_TO_INT(x)      ((x) >> FIXED_BITS)
+
+#define  FIXED_FROM_FLOAT(x)  ((Fixed)((x)*FIXED_ONE))
+#define  FIXED_TO_FLOAT(x)    ((x)/(1.*FIXED_ONE))
+
+#define  FIXED_MUL(x,y)       (((int64_t)(x) * (y)) >> FIXED_BITS)
+#define  FIXED_DIV(x,y)       (((int64_t)(x) * FIXED_ONE) / (y))
+
+#define  FIXED_DIV2(x)        ((x) >> 1)
+#define  FIXED_AVERAGE(x,y)   (((x) + (y)) >> 1)
+
+#define  FIXED_FRAC(x)        ((x) & ((1 << FIXED_BITS)-1))
+#define  FIXED_TRUNC(x)       ((x) & ~((1 << FIXED_BITS)-1))
+
+#define  FIXED_FROM_INT_FLOAT(x,f)   (Fixed)((x)*(FIXED_ONE*(f)))
+
+typedef int32_t  Angle;
+
+#define  ANGLE_BITS              9
+
+#if ANGLE_BITS < 8
+#  error ANGLE_BITS must be at least 8
+#endif
+
+#define  ANGLE_2PI               (1 << ANGLE_BITS)
+#define  ANGLE_PI                (1 << (ANGLE_BITS-1))
+#define  ANGLE_PI2               (1 << (ANGLE_BITS-2))
+#define  ANGLE_PI4               (1 << (ANGLE_BITS-3))
+
+#define  ANGLE_FROM_FLOAT(x)   (Angle)((x)*ANGLE_PI/M_PI)
+#define  ANGLE_TO_FLOAT(x)     ((x)*M_PI/ANGLE_PI)
+
+#if ANGLE_BITS <= FIXED_BITS
+#  define  ANGLE_FROM_FIXED(x)     (Angle)((x) >> (FIXED_BITS - ANGLE_BITS))
+#  define  ANGLE_TO_FIXED(x)       (Fixed)((x) << (FIXED_BITS - ANGLE_BITS))
+#else
+#  define  ANGLE_FROM_FIXED(x)     (Angle)((x) << (ANGLE_BITS - FIXED_BITS))
+#  define  ANGLE_TO_FIXED(x)       (Fixed)((x) >> (ANGLE_BITS - FIXED_BITS))
+#endif
+
+static Fixed  angle_sin_tab[ANGLE_2PI+1];
+
+static void init_angles(void)
+{
+    int  nn;
+    for (nn = 0; nn < ANGLE_2PI+1; nn++) {
+        double  radians = nn*M_PI/ANGLE_PI;
+        angle_sin_tab[nn] = FIXED_FROM_FLOAT(sin(radians));
+    }
+}
+
+static __inline__ Fixed angle_sin( Angle  a )
+{
+    return angle_sin_tab[(uint32_t)a & (ANGLE_2PI-1)];
+}
+
+static __inline__ Fixed angle_cos( Angle  a )
+{
+    return angle_sin(a + ANGLE_PI2);
+}
+
+static __inline__ Fixed fixed_sin( Fixed  f )
+{
+    return angle_sin(ANGLE_FROM_FIXED(f));
+}
+
+static __inline__ Fixed  fixed_cos( Fixed  f )
+{
+    return angle_cos(ANGLE_FROM_FIXED(f));
+}
+
+/* Color palette used for rendering the plasma */
+#define  PALETTE_BITS   8
+#define  PALETTE_SIZE   (1 << PALETTE_BITS)
+
+#if PALETTE_BITS > FIXED_BITS
+#  error PALETTE_BITS must be smaller than FIXED_BITS 
+#endif
+
+static uint16_t  palette[PALETTE_SIZE];
+
+static uint16_t  make565(int red, int green, int blue)
+{
+    return (uint16_t)( ((red   << 8) & 0xf800) |
+                       ((green << 2) & 0x03e0) |
+                       ((blue  >> 3) & 0x001f) );
+}
+
+static void init_palette(void)
+{
+    int  nn, mm = 0;
+    /* fun with colors */
+    for (nn = 0; nn < PALETTE_SIZE/4; nn++) {
+        int  jj = (nn-mm)*4*255/PALETTE_SIZE;
+        palette[nn] = make565(255, jj, 255-jj);
+    }
+
+    for ( mm = nn; nn < PALETTE_SIZE/2; nn++ ) {
+        int  jj = (nn-mm)*4*255/PALETTE_SIZE;
+        palette[nn] = make565(255-jj, 255, jj);
+    }
+
+    for ( mm = nn; nn < PALETTE_SIZE*3/4; nn++ ) {
+        int  jj = (nn-mm)*4*255/PALETTE_SIZE;
+        palette[nn] = make565(0, 255-jj, 255);
+    }
+
+    for ( mm = nn; nn < PALETTE_SIZE; nn++ ) {
+        int  jj = (nn-mm)*4*255/PALETTE_SIZE;
+        palette[nn] = make565(jj, 0, 255);
+    }
+}
+
+static __inline__ uint16_t  palette_from_fixed( Fixed  x )
+{
+    if (x < 0) x = -x;
+    if (x >= FIXED_ONE) x = FIXED_ONE-1;
+    int  idx = FIXED_FRAC(x) >> (FIXED_BITS - PALETTE_BITS);
+    return palette[idx & (PALETTE_SIZE-1)];
+}
+
+/* Angles expressed as fixed point radians */
+
+static void init_tables(void)
+{
+    init_palette();
+    init_angles();
+}
+
+static void fill_plasma( AndroidBitmapInfo*  info, void*  pixels, double  t )
+{
+    Fixed ft  = FIXED_FROM_FLOAT(t/1000.);
+    Fixed yt1 = FIXED_FROM_FLOAT(t/1230.);
+    Fixed yt2 = yt1;
+    Fixed xt10 = FIXED_FROM_FLOAT(t/3000.);
+    Fixed xt20 = xt10;
+
+#define  YT1_INCR   FIXED_FROM_FLOAT(1/100.)
+#define  YT2_INCR   FIXED_FROM_FLOAT(1/163.)
+
+    int  yy;
+    for (yy = 0; yy < info->height; yy++) {
+        uint16_t*  line = (uint16_t*)pixels;
+        Fixed      base = fixed_sin(yt1) + fixed_sin(yt2);
+        Fixed      xt1 = xt10;
+        Fixed      xt2 = xt20;
+
+        yt1 += YT1_INCR;
+        yt2 += YT2_INCR;
+
+#define  XT1_INCR  FIXED_FROM_FLOAT(1/173.)
+#define  XT2_INCR  FIXED_FROM_FLOAT(1/242.)
+
+#if OPTIMIZE_WRITES
+        /* optimize memory writes by generating one aligned 32-bit store
+         * for every pair of pixels.
+         */
+        uint16_t*  line_end = line + info->width;
+
+        if (line < line_end) {
+            if (((uint32_t)line & 3) != 0) {
+                Fixed ii = base + fixed_sin(xt1) + fixed_sin(xt2);
+
+                xt1 += XT1_INCR;
+                xt2 += XT2_INCR;
+
+                line[0] = palette_from_fixed(ii >> 2);
+                line++;
+            }
+
+            while (line + 2 <= line_end) {
+                Fixed i1 = base + fixed_sin(xt1) + fixed_sin(xt2);
+                xt1 += XT1_INCR;
+                xt2 += XT2_INCR;
+
+                Fixed i2 = base + fixed_sin(xt1) + fixed_sin(xt2);
+                xt1 += XT1_INCR;
+                xt2 += XT2_INCR;
+
+                uint32_t  pixel = ((uint32_t)palette_from_fixed(i1 >> 2) << 16) |
+                                   (uint32_t)palette_from_fixed(i2 >> 2);
+
+                ((uint32_t*)line)[0] = pixel;
+                line += 2;
+            }
+
+            if (line < line_end) {
+                Fixed ii = base + fixed_sin(xt1) + fixed_sin(xt2);
+                line[0] = palette_from_fixed(ii >> 2);
+                line++;
+            }
+        }
+#else /* !OPTIMIZE_WRITES */
+        int xx;
+        for (xx = 0; xx < info->width; xx++) {
+
+            Fixed ii = base + fixed_sin(xt1) + fixed_sin(xt2);
+
+            xt1 += XT1_INCR;
+            xt2 += XT2_INCR;
+
+            line[xx] = palette_from_fixed(ii / 4);
+        }
+#endif /* !OPTIMIZE_WRITES */
+
+        // go to next line
+        pixels = (char*)pixels + info->stride;
+    }
+}
+
+/* simple stats management */
+typedef struct {
+    double  renderTime;
+    double  frameTime;
+} FrameStats;
+
+#define  MAX_FRAME_STATS  200
+#define  MAX_PERIOD_MS    1500
+
+typedef struct {
+    double  firstTime;
+    double  lastTime;
+    double  frameTime;
+
+    int         firstFrame;
+    int         numFrames;
+    FrameStats  frames[ MAX_FRAME_STATS ];
+} Stats;
+
+static void
+stats_init( Stats*  s )
+{
+    s->lastTime = now_ms();
+    s->firstTime = 0.;
+    s->firstFrame = 0;
+    s->numFrames  = 0;
+}
+
+static void
+stats_startFrame( Stats*  s )
+{
+    s->frameTime = now_ms();
+}
+
+static void
+stats_endFrame( Stats*  s )
+{
+    double now = now_ms();
+    double renderTime = now - s->frameTime;
+    double frameTime  = now - s->lastTime;
+    int nn;
+
+    if (now - s->firstTime >= MAX_PERIOD_MS) {
+        if (s->numFrames > 0) {
+            double minRender, maxRender, avgRender;
+            double minFrame, maxFrame, avgFrame;
+            int count;
+
+            nn = s->firstFrame;
+            minRender = maxRender = avgRender = s->frames[nn].renderTime;
+            minFrame  = maxFrame  = avgFrame  = s->frames[nn].frameTime;
+            for (count = s->numFrames; count > 0; count-- ) {
+                nn += 1;
+                if (nn >= MAX_FRAME_STATS)
+                    nn -= MAX_FRAME_STATS;
+                double render = s->frames[nn].renderTime;
+                if (render < minRender) minRender = render;
+                if (render > maxRender) maxRender = render;
+                double frame = s->frames[nn].frameTime;
+                if (frame < minFrame) minFrame = frame;
+                if (frame > maxFrame) maxFrame = frame;
+                avgRender += render;
+                avgFrame  += frame;
+            }
+            avgRender /= s->numFrames;
+            avgFrame  /= s->numFrames;
+
+            LOGI("frame/s (avg,min,max) = (%.1f,%.1f,%.1f) "
+                 "render time ms (avg,min,max) = (%.1f,%.1f,%.1f)\n",
+                 1000./avgFrame, 1000./maxFrame, 1000./minFrame,
+                 avgRender, minRender, maxRender);
+        }
+        s->numFrames  = 0;
+        s->firstFrame = 0;
+        s->firstTime  = now;
+    }
+
+    nn = s->firstFrame + s->numFrames;
+    if (nn >= MAX_FRAME_STATS)
+        nn -= MAX_FRAME_STATS;
+
+    s->frames[nn].renderTime = renderTime;
+    s->frames[nn].frameTime  = frameTime;
+
+    if (s->numFrames < MAX_FRAME_STATS) {
+        s->numFrames += 1;
+    } else {
+        s->firstFrame += 1;
+        if (s->firstFrame >= MAX_FRAME_STATS)
+            s->firstFrame -= MAX_FRAME_STATS;
+    }
+
+    s->lastTime = now;
+}
+
+JNIEXPORT void JNICALL Java_com_example_plasma_PlasmaView_renderPlasma(JNIEnv * env, jobject  obj, jobject bitmap,  jlong  time_ms)
+{
+    AndroidBitmapInfo  info;
+    void*              pixels;
+    int                ret;
+    static Stats       stats;
+    static int         init;
+
+    if (!init) {
+        init_tables();
+        stats_init(&stats);
+        init = 1;
+    }
+
+    if ((ret = AndroidBitmap_getInfo(env, bitmap, &info)) < 0) {
+        LOGE("AndroidBitmap_getInfo() failed ! error=%d", ret);
+        return;
+    }
+
+    if (info.format != ANDROID_BITMAP_FORMAT_RGB_565) {
+        LOGE("Bitmap format is not RGB_565 !");
+        return;
+    }
+
+    if ((ret = AndroidBitmap_lockPixels(env, bitmap, &pixels)) < 0) {
+        LOGE("AndroidBitmap_lockPixels() failed ! error=%d", ret);
+    }
+
+    stats_startFrame(&stats);
+
+    /* Now fill the values with a nice little plasma */
+    fill_plasma(&info, pixels, time_ms );
+
+    AndroidBitmap_unlockPixels(env, bitmap);
+
+    stats_endFrame(&stats);
+}
diff --git a/ndk/platforms/android-8/samples/bitmap-plasma/res/values/strings.xml b/ndk/platforms/android-8/samples/bitmap-plasma/res/values/strings.xml
new file mode 100644
index 0000000..f98e87b
--- /dev/null
+++ b/ndk/platforms/android-8/samples/bitmap-plasma/res/values/strings.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <string name="app_name">Plasma</string>
+</resources>
diff --git a/ndk/platforms/android-8/samples/bitmap-plasma/src/com/example/plasma/Plasma.java b/ndk/platforms/android-8/samples/bitmap-plasma/src/com/example/plasma/Plasma.java
new file mode 100644
index 0000000..f0938d1
--- /dev/null
+++ b/ndk/platforms/android-8/samples/bitmap-plasma/src/com/example/plasma/Plasma.java
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.example.plasma;
+
+import android.app.Activity;
+import android.os.Bundle;
+import android.content.Context;
+import android.view.View;
+import android.graphics.Bitmap;
+import android.graphics.Canvas;
+
+public class Plasma extends Activity
+{
+    /** Called when the activity is first created. */
+    @Override
+    public void onCreate(Bundle savedInstanceState)
+    {
+        super.onCreate(savedInstanceState);
+        setContentView(new PlasmaView(this));
+    }
+
+    /* load our native library */
+    static {
+        System.loadLibrary("plasma");
+    }
+}
+
+class PlasmaView extends View {
+    private Bitmap mBitmap;
+    private long mStartTime;
+
+    /* implementend by libplasma.so */
+    private static native void renderPlasma(Bitmap  bitmap, long time_ms);
+
+    public PlasmaView(Context context) {
+        super(context);
+
+        final int W = 200;
+        final int H = 200;
+
+        mBitmap = Bitmap.createBitmap(W, H, Bitmap.Config.RGB_565);
+        mStartTime = System.currentTimeMillis();
+    }
+
+    @Override protected void onDraw(Canvas canvas) {
+        //canvas.drawColor(0xFFCCCCCC);
+        renderPlasma(mBitmap, System.currentTimeMillis() - mStartTime);
+        canvas.drawBitmap(mBitmap, 0, 0, null);
+        // force a redraw, with a different time-based pattern.
+        invalidate();
+    }
+}
diff --git a/ndk/platforms/android-9/arch-arm/lib/crtbegin_so.o b/ndk/platforms/android-9/arch-arm/lib/crtbegin_so.o
new file mode 100644
index 0000000..5230178
--- /dev/null
+++ b/ndk/platforms/android-9/arch-arm/lib/crtbegin_so.o
Binary files differ
diff --git a/ndk/platforms/android-9/arch-arm/lib/crtend_so.o b/ndk/platforms/android-9/arch-arm/lib/crtend_so.o
new file mode 100644
index 0000000..c54db97
--- /dev/null
+++ b/ndk/platforms/android-9/arch-arm/lib/crtend_so.o
Binary files differ
diff --git a/ndk/platforms/android-9/arch-arm/lib/libEGL.so b/ndk/platforms/android-9/arch-arm/lib/libEGL.so
new file mode 100644
index 0000000..f63b64c
--- /dev/null
+++ b/ndk/platforms/android-9/arch-arm/lib/libEGL.so
Binary files differ
diff --git a/ndk/platforms/android-9/arch-arm/lib/libOpenSLES.so b/ndk/platforms/android-9/arch-arm/lib/libOpenSLES.so
new file mode 100755
index 0000000..1e7c180
--- /dev/null
+++ b/ndk/platforms/android-9/arch-arm/lib/libOpenSLES.so
Binary files differ
diff --git a/ndk/platforms/android-9/arch-arm/lib/libandroid.so b/ndk/platforms/android-9/arch-arm/lib/libandroid.so
new file mode 100644
index 0000000..1ac0a9c
--- /dev/null
+++ b/ndk/platforms/android-9/arch-arm/lib/libandroid.so
Binary files differ
diff --git a/ndk/platforms/android-9/arch-arm/symbols/libOpenSLES.so.txt b/ndk/platforms/android-9/arch-arm/symbols/libOpenSLES.so.txt
new file mode 100644
index 0000000..e7ccafb
--- /dev/null
+++ b/ndk/platforms/android-9/arch-arm/symbols/libOpenSLES.so.txt
@@ -0,0 +1,52 @@
+SL_IID_3DCOMMIT
+SL_IID_3DDOPPLER
+SL_IID_3DGROUPING
+SL_IID_3DLOCATION
+SL_IID_3DMACROSCOPIC
+SL_IID_3DSOURCE
+SL_IID_ANDROIDCONFIGURATION
+SL_IID_ANDROIDEFFECT
+SL_IID_ANDROIDEFFECTCAPABILITIES
+SL_IID_ANDROIDEFFECTSEND
+SL_IID_ANDROIDSIMPLEBUFFERQUEUE
+SL_IID_AUDIODECODERCAPABILITIES
+SL_IID_AUDIOENCODER
+SL_IID_AUDIOENCODERCAPABILITIES
+SL_IID_AUDIOIODEVICECAPABILITIES
+SL_IID_BASSBOOST
+SL_IID_BUFFERQUEUE
+SL_IID_DEVICEVOLUME
+SL_IID_DYNAMICINTERFACEMANAGEMENT
+SL_IID_DYNAMICSOURCE
+SL_IID_EFFECTSEND
+SL_IID_ENGINE
+SL_IID_ENGINECAPABILITIES
+SL_IID_ENVIRONMENTALREVERB
+SL_IID_EQUALIZER
+SL_IID_LED
+SL_IID_METADATAEXTRACTION
+SL_IID_METADATATRAVERSAL
+SL_IID_MIDIMESSAGE
+SL_IID_MIDIMUTESOLO
+SL_IID_MIDITEMPO
+SL_IID_MIDITIME
+SL_IID_MUTESOLO
+SL_IID_NULL
+SL_IID_OBJECT
+SL_IID_OUTPUTMIX
+SL_IID_PITCH
+SL_IID_PLAY
+SL_IID_PLAYBACKRATE
+SL_IID_PREFETCHSTATUS
+SL_IID_PRESETREVERB
+SL_IID_RATEPITCH
+SL_IID_RECORD
+SL_IID_SEEK
+SL_IID_THREADSYNC
+SL_IID_VIBRA
+SL_IID_VIRTUALIZER
+SL_IID_VISUALIZATION
+SL_IID_VOLUME
+slCreateEngine
+slQueryNumSupportedEngineInterfaces
+slQuerySupportedEngineInterfaces
diff --git a/ndk/platforms/android-9/include/EGL/egl.h b/ndk/platforms/android-9/include/EGL/egl.h
new file mode 100644
index 0000000..99ea342
--- /dev/null
+++ b/ndk/platforms/android-9/include/EGL/egl.h
@@ -0,0 +1,329 @@
+/* -*- mode: c; tab-width: 8; -*- */
+/* vi: set sw=4 ts=8: */
+/* Reference version of egl.h for EGL 1.4.
+ * $Revision: 9356 $ on $Date: 2009-10-21 02:52:25 -0700 (Wed, 21 Oct 2009) $
+ */
+
+/*
+** Copyright (c) 2007-2009 The Khronos Group Inc.
+**
+** Permission is hereby granted, free of charge, to any person obtaining a
+** copy of this software and/or associated documentation files (the
+** "Materials"), to deal in the Materials without restriction, including
+** without limitation the rights to use, copy, modify, merge, publish,
+** distribute, sublicense, and/or sell copies of the Materials, and to
+** permit persons to whom the Materials are furnished to do so, subject to
+** the following conditions:
+**
+** The above copyright notice and this permission notice shall be included
+** in all copies or substantial portions of the Materials.
+**
+** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+*/
+
+#ifndef __egl_h_
+#define __egl_h_
+
+/* All platform-dependent types and macro boilerplate (such as EGLAPI
+ * and EGLAPIENTRY) should go in eglplatform.h.
+ */
+#include <EGL/eglplatform.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* EGL Types */
+/* EGLint is defined in eglplatform.h */
+typedef unsigned int EGLBoolean;
+typedef unsigned int EGLenum;
+typedef void *EGLConfig;
+typedef void *EGLContext;
+typedef void *EGLDisplay;
+typedef void *EGLSurface;
+typedef void *EGLClientBuffer;
+
+/* EGL Versioning */
+#define EGL_VERSION_1_0			1
+#define EGL_VERSION_1_1			1
+#define EGL_VERSION_1_2			1
+#define EGL_VERSION_1_3			1
+#define EGL_VERSION_1_4			1
+
+/* EGL Enumerants. Bitmasks and other exceptional cases aside, most
+ * enums are assigned unique values starting at 0x3000.
+ */
+
+/* EGL aliases */
+#define EGL_FALSE			0
+#define EGL_TRUE			1
+
+/* Out-of-band handle values */
+#define EGL_DEFAULT_DISPLAY		((EGLNativeDisplayType)0)
+#define EGL_NO_CONTEXT			((EGLContext)0)
+#define EGL_NO_DISPLAY			((EGLDisplay)0)
+#define EGL_NO_SURFACE			((EGLSurface)0)
+
+/* Out-of-band attribute value */
+#define EGL_DONT_CARE			((EGLint)-1)
+
+/* Errors / GetError return values */
+#define EGL_SUCCESS			0x3000
+#define EGL_NOT_INITIALIZED		0x3001
+#define EGL_BAD_ACCESS			0x3002
+#define EGL_BAD_ALLOC			0x3003
+#define EGL_BAD_ATTRIBUTE		0x3004
+#define EGL_BAD_CONFIG			0x3005
+#define EGL_BAD_CONTEXT			0x3006
+#define EGL_BAD_CURRENT_SURFACE		0x3007
+#define EGL_BAD_DISPLAY			0x3008
+#define EGL_BAD_MATCH			0x3009
+#define EGL_BAD_NATIVE_PIXMAP		0x300A
+#define EGL_BAD_NATIVE_WINDOW		0x300B
+#define EGL_BAD_PARAMETER		0x300C
+#define EGL_BAD_SURFACE			0x300D
+#define EGL_CONTEXT_LOST		0x300E	/* EGL 1.1 - IMG_power_management */
+
+/* Reserved 0x300F-0x301F for additional errors */
+
+/* Config attributes */
+#define EGL_BUFFER_SIZE			0x3020
+#define EGL_ALPHA_SIZE			0x3021
+#define EGL_BLUE_SIZE			0x3022
+#define EGL_GREEN_SIZE			0x3023
+#define EGL_RED_SIZE			0x3024
+#define EGL_DEPTH_SIZE			0x3025
+#define EGL_STENCIL_SIZE		0x3026
+#define EGL_CONFIG_CAVEAT		0x3027
+#define EGL_CONFIG_ID			0x3028
+#define EGL_LEVEL			0x3029
+#define EGL_MAX_PBUFFER_HEIGHT		0x302A
+#define EGL_MAX_PBUFFER_PIXELS		0x302B
+#define EGL_MAX_PBUFFER_WIDTH		0x302C
+#define EGL_NATIVE_RENDERABLE		0x302D
+#define EGL_NATIVE_VISUAL_ID		0x302E
+#define EGL_NATIVE_VISUAL_TYPE		0x302F
+#define EGL_SAMPLES			0x3031
+#define EGL_SAMPLE_BUFFERS		0x3032
+#define EGL_SURFACE_TYPE		0x3033
+#define EGL_TRANSPARENT_TYPE		0x3034
+#define EGL_TRANSPARENT_BLUE_VALUE	0x3035
+#define EGL_TRANSPARENT_GREEN_VALUE	0x3036
+#define EGL_TRANSPARENT_RED_VALUE	0x3037
+#define EGL_NONE			0x3038	/* Attrib list terminator */
+#define EGL_BIND_TO_TEXTURE_RGB		0x3039
+#define EGL_BIND_TO_TEXTURE_RGBA	0x303A
+#define EGL_MIN_SWAP_INTERVAL		0x303B
+#define EGL_MAX_SWAP_INTERVAL		0x303C
+#define EGL_LUMINANCE_SIZE		0x303D
+#define EGL_ALPHA_MASK_SIZE		0x303E
+#define EGL_COLOR_BUFFER_TYPE		0x303F
+#define EGL_RENDERABLE_TYPE		0x3040
+#define EGL_MATCH_NATIVE_PIXMAP		0x3041	/* Pseudo-attribute (not queryable) */
+#define EGL_CONFORMANT			0x3042
+
+/* Reserved 0x3041-0x304F for additional config attributes */
+
+/* Config attribute values */
+#define EGL_SLOW_CONFIG			0x3050	/* EGL_CONFIG_CAVEAT value */
+#define EGL_NON_CONFORMANT_CONFIG	0x3051	/* EGL_CONFIG_CAVEAT value */
+#define EGL_TRANSPARENT_RGB		0x3052	/* EGL_TRANSPARENT_TYPE value */
+#define EGL_RGB_BUFFER			0x308E	/* EGL_COLOR_BUFFER_TYPE value */
+#define EGL_LUMINANCE_BUFFER		0x308F	/* EGL_COLOR_BUFFER_TYPE value */
+
+/* More config attribute values, for EGL_TEXTURE_FORMAT */
+#define EGL_NO_TEXTURE			0x305C
+#define EGL_TEXTURE_RGB			0x305D
+#define EGL_TEXTURE_RGBA		0x305E
+#define EGL_TEXTURE_2D			0x305F
+
+/* Config attribute mask bits */
+#define EGL_PBUFFER_BIT			0x0001	/* EGL_SURFACE_TYPE mask bits */
+#define EGL_PIXMAP_BIT			0x0002	/* EGL_SURFACE_TYPE mask bits */
+#define EGL_WINDOW_BIT			0x0004	/* EGL_SURFACE_TYPE mask bits */
+#define EGL_VG_COLORSPACE_LINEAR_BIT	0x0020	/* EGL_SURFACE_TYPE mask bits */
+#define EGL_VG_ALPHA_FORMAT_PRE_BIT	0x0040	/* EGL_SURFACE_TYPE mask bits */
+#define EGL_MULTISAMPLE_RESOLVE_BOX_BIT 0x0200	/* EGL_SURFACE_TYPE mask bits */
+#define EGL_SWAP_BEHAVIOR_PRESERVED_BIT 0x0400	/* EGL_SURFACE_TYPE mask bits */
+
+#define EGL_OPENGL_ES_BIT		0x0001	/* EGL_RENDERABLE_TYPE mask bits */
+#define EGL_OPENVG_BIT			0x0002	/* EGL_RENDERABLE_TYPE mask bits */
+#define EGL_OPENGL_ES2_BIT		0x0004	/* EGL_RENDERABLE_TYPE mask bits */
+#define EGL_OPENGL_BIT			0x0008	/* EGL_RENDERABLE_TYPE mask bits */
+
+/* QueryString targets */
+#define EGL_VENDOR			0x3053
+#define EGL_VERSION			0x3054
+#define EGL_EXTENSIONS			0x3055
+#define EGL_CLIENT_APIS			0x308D
+
+/* QuerySurface / SurfaceAttrib / CreatePbufferSurface targets */
+#define EGL_HEIGHT			0x3056
+#define EGL_WIDTH			0x3057
+#define EGL_LARGEST_PBUFFER		0x3058
+#define EGL_TEXTURE_FORMAT		0x3080
+#define EGL_TEXTURE_TARGET		0x3081
+#define EGL_MIPMAP_TEXTURE		0x3082
+#define EGL_MIPMAP_LEVEL		0x3083
+#define EGL_RENDER_BUFFER		0x3086
+#define EGL_VG_COLORSPACE		0x3087
+#define EGL_VG_ALPHA_FORMAT		0x3088
+#define EGL_HORIZONTAL_RESOLUTION	0x3090
+#define EGL_VERTICAL_RESOLUTION		0x3091
+#define EGL_PIXEL_ASPECT_RATIO		0x3092
+#define EGL_SWAP_BEHAVIOR		0x3093
+#define EGL_MULTISAMPLE_RESOLVE		0x3099
+
+/* EGL_RENDER_BUFFER values / BindTexImage / ReleaseTexImage buffer targets */
+#define EGL_BACK_BUFFER			0x3084
+#define EGL_SINGLE_BUFFER		0x3085
+
+/* OpenVG color spaces */
+#define EGL_VG_COLORSPACE_sRGB		0x3089	/* EGL_VG_COLORSPACE value */
+#define EGL_VG_COLORSPACE_LINEAR	0x308A	/* EGL_VG_COLORSPACE value */
+
+/* OpenVG alpha formats */
+#define EGL_VG_ALPHA_FORMAT_NONPRE	0x308B	/* EGL_ALPHA_FORMAT value */
+#define EGL_VG_ALPHA_FORMAT_PRE		0x308C	/* EGL_ALPHA_FORMAT value */
+
+/* Constant scale factor by which fractional display resolutions &
+ * aspect ratio are scaled when queried as integer values.
+ */
+#define EGL_DISPLAY_SCALING		10000
+
+/* Unknown display resolution/aspect ratio */
+#define EGL_UNKNOWN			((EGLint)-1)
+
+/* Back buffer swap behaviors */
+#define EGL_BUFFER_PRESERVED		0x3094	/* EGL_SWAP_BEHAVIOR value */
+#define EGL_BUFFER_DESTROYED		0x3095	/* EGL_SWAP_BEHAVIOR value */
+
+/* CreatePbufferFromClientBuffer buffer types */
+#define EGL_OPENVG_IMAGE		0x3096
+
+/* QueryContext targets */
+#define EGL_CONTEXT_CLIENT_TYPE		0x3097
+
+/* CreateContext attributes */
+#define EGL_CONTEXT_CLIENT_VERSION	0x3098
+
+/* Multisample resolution behaviors */
+#define EGL_MULTISAMPLE_RESOLVE_DEFAULT 0x309A	/* EGL_MULTISAMPLE_RESOLVE value */
+#define EGL_MULTISAMPLE_RESOLVE_BOX	0x309B	/* EGL_MULTISAMPLE_RESOLVE value */
+
+/* BindAPI/QueryAPI targets */
+#define EGL_OPENGL_ES_API		0x30A0
+#define EGL_OPENVG_API			0x30A1
+#define EGL_OPENGL_API			0x30A2
+
+/* GetCurrentSurface targets */
+#define EGL_DRAW			0x3059
+#define EGL_READ			0x305A
+
+/* WaitNative engines */
+#define EGL_CORE_NATIVE_ENGINE		0x305B
+
+/* EGL 1.2 tokens renamed for consistency in EGL 1.3 */
+#define EGL_COLORSPACE			EGL_VG_COLORSPACE
+#define EGL_ALPHA_FORMAT		EGL_VG_ALPHA_FORMAT
+#define EGL_COLORSPACE_sRGB		EGL_VG_COLORSPACE_sRGB
+#define EGL_COLORSPACE_LINEAR		EGL_VG_COLORSPACE_LINEAR
+#define EGL_ALPHA_FORMAT_NONPRE		EGL_VG_ALPHA_FORMAT_NONPRE
+#define EGL_ALPHA_FORMAT_PRE		EGL_VG_ALPHA_FORMAT_PRE
+
+/* EGL extensions must request enum blocks from the Khronos
+ * API Registrar, who maintains the enumerant registry. Submit
+ * a bug in Khronos Bugzilla against task "Registry".
+ */
+
+
+
+/* EGL Functions */
+
+EGLAPI EGLint EGLAPIENTRY eglGetError(void);
+
+EGLAPI EGLDisplay EGLAPIENTRY eglGetDisplay(EGLNativeDisplayType display_id);
+EGLAPI EGLBoolean EGLAPIENTRY eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor);
+EGLAPI EGLBoolean EGLAPIENTRY eglTerminate(EGLDisplay dpy);
+
+EGLAPI const char * EGLAPIENTRY eglQueryString(EGLDisplay dpy, EGLint name);
+
+EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigs(EGLDisplay dpy, EGLConfig *configs,
+			 EGLint config_size, EGLint *num_config);
+EGLAPI EGLBoolean EGLAPIENTRY eglChooseConfig(EGLDisplay dpy, const EGLint *attrib_list,
+			   EGLConfig *configs, EGLint config_size,
+			   EGLint *num_config);
+EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigAttrib(EGLDisplay dpy, EGLConfig config,
+			      EGLint attribute, EGLint *value);
+
+EGLAPI EGLSurface EGLAPIENTRY eglCreateWindowSurface(EGLDisplay dpy, EGLConfig config,
+				  EGLNativeWindowType win,
+				  const EGLint *attrib_list);
+EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferSurface(EGLDisplay dpy, EGLConfig config,
+				   const EGLint *attrib_list);
+EGLAPI EGLSurface EGLAPIENTRY eglCreatePixmapSurface(EGLDisplay dpy, EGLConfig config,
+				  EGLNativePixmapType pixmap,
+				  const EGLint *attrib_list);
+EGLAPI EGLBoolean EGLAPIENTRY eglDestroySurface(EGLDisplay dpy, EGLSurface surface);
+EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurface(EGLDisplay dpy, EGLSurface surface,
+			   EGLint attribute, EGLint *value);
+
+EGLAPI EGLBoolean EGLAPIENTRY eglBindAPI(EGLenum api);
+EGLAPI EGLenum EGLAPIENTRY eglQueryAPI(void);
+
+EGLAPI EGLBoolean EGLAPIENTRY eglWaitClient(void);
+
+EGLAPI EGLBoolean EGLAPIENTRY eglReleaseThread(void);
+
+EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferFromClientBuffer(
+	      EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer,
+	      EGLConfig config, const EGLint *attrib_list);
+
+EGLAPI EGLBoolean EGLAPIENTRY eglSurfaceAttrib(EGLDisplay dpy, EGLSurface surface,
+			    EGLint attribute, EGLint value);
+EGLAPI EGLBoolean EGLAPIENTRY eglBindTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer);
+EGLAPI EGLBoolean EGLAPIENTRY eglReleaseTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer);
+
+
+EGLAPI EGLBoolean EGLAPIENTRY eglSwapInterval(EGLDisplay dpy, EGLint interval);
+
+
+EGLAPI EGLContext EGLAPIENTRY eglCreateContext(EGLDisplay dpy, EGLConfig config,
+			    EGLContext share_context,
+			    const EGLint *attrib_list);
+EGLAPI EGLBoolean EGLAPIENTRY eglDestroyContext(EGLDisplay dpy, EGLContext ctx);
+EGLAPI EGLBoolean EGLAPIENTRY eglMakeCurrent(EGLDisplay dpy, EGLSurface draw,
+			  EGLSurface read, EGLContext ctx);
+
+EGLAPI EGLContext EGLAPIENTRY eglGetCurrentContext(void);
+EGLAPI EGLSurface EGLAPIENTRY eglGetCurrentSurface(EGLint readdraw);
+EGLAPI EGLDisplay EGLAPIENTRY eglGetCurrentDisplay(void);
+EGLAPI EGLBoolean EGLAPIENTRY eglQueryContext(EGLDisplay dpy, EGLContext ctx,
+			   EGLint attribute, EGLint *value);
+
+EGLAPI EGLBoolean EGLAPIENTRY eglWaitGL(void);
+EGLAPI EGLBoolean EGLAPIENTRY eglWaitNative(EGLint engine);
+EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers(EGLDisplay dpy, EGLSurface surface);
+EGLAPI EGLBoolean EGLAPIENTRY eglCopyBuffers(EGLDisplay dpy, EGLSurface surface,
+			  EGLNativePixmapType target);
+
+/* This is a generic function pointer type, whose name indicates it must
+ * be cast to the proper type *and calling convention* before use.
+ */
+typedef void (*__eglMustCastToProperFunctionPointerType)(void);
+
+/* Now, define eglGetProcAddress using the generic function ptr. type */
+EGLAPI __eglMustCastToProperFunctionPointerType EGLAPIENTRY
+       eglGetProcAddress(const char *procname);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __egl_h_ */
diff --git a/ndk/platforms/android-9/include/EGL/eglext.h b/ndk/platforms/android-9/include/EGL/eglext.h
new file mode 100644
index 0000000..b121158
--- /dev/null
+++ b/ndk/platforms/android-9/include/EGL/eglext.h
@@ -0,0 +1,252 @@
+#ifndef __eglext_h_
+#define __eglext_h_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+** Copyright (c) 2007-2010 The Khronos Group Inc.
+**
+** Permission is hereby granted, free of charge, to any person obtaining a
+** copy of this software and/or associated documentation files (the
+** "Materials"), to deal in the Materials without restriction, including
+** without limitation the rights to use, copy, modify, merge, publish,
+** distribute, sublicense, and/or sell copies of the Materials, and to
+** permit persons to whom the Materials are furnished to do so, subject to
+** the following conditions:
+**
+** The above copyright notice and this permission notice shall be included
+** in all copies or substantial portions of the Materials.
+**
+** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+*/
+
+#include <EGL/eglplatform.h>
+
+/*************************************************************/
+
+/* Header file version number */
+/* Current version at http://www.khronos.org/registry/egl/ */
+/* $Revision: 11249 $ on $Date: 2010-05-05 09:54:28 -0700 (Wed, 05 May 2010) $ */
+#define EGL_EGLEXT_VERSION 5
+
+#ifndef EGL_KHR_config_attribs
+#define EGL_KHR_config_attribs 1
+#define EGL_CONFORMANT_KHR			0x3042	/* EGLConfig attribute */
+#define EGL_VG_COLORSPACE_LINEAR_BIT_KHR	0x0020	/* EGL_SURFACE_TYPE bitfield */
+#define EGL_VG_ALPHA_FORMAT_PRE_BIT_KHR		0x0040	/* EGL_SURFACE_TYPE bitfield */
+#endif
+
+#ifndef EGL_KHR_lock_surface
+#define EGL_KHR_lock_surface 1
+#define EGL_READ_SURFACE_BIT_KHR		0x0001	/* EGL_LOCK_USAGE_HINT_KHR bitfield */
+#define EGL_WRITE_SURFACE_BIT_KHR		0x0002	/* EGL_LOCK_USAGE_HINT_KHR bitfield */
+#define EGL_LOCK_SURFACE_BIT_KHR		0x0080	/* EGL_SURFACE_TYPE bitfield */
+#define EGL_OPTIMAL_FORMAT_BIT_KHR		0x0100	/* EGL_SURFACE_TYPE bitfield */
+#define EGL_MATCH_FORMAT_KHR			0x3043	/* EGLConfig attribute */
+#define EGL_FORMAT_RGB_565_EXACT_KHR		0x30C0	/* EGL_MATCH_FORMAT_KHR value */
+#define EGL_FORMAT_RGB_565_KHR			0x30C1	/* EGL_MATCH_FORMAT_KHR value */
+#define EGL_FORMAT_RGBA_8888_EXACT_KHR		0x30C2	/* EGL_MATCH_FORMAT_KHR value */
+#define EGL_FORMAT_RGBA_8888_KHR		0x30C3	/* EGL_MATCH_FORMAT_KHR value */
+#define EGL_MAP_PRESERVE_PIXELS_KHR		0x30C4	/* eglLockSurfaceKHR attribute */
+#define EGL_LOCK_USAGE_HINT_KHR			0x30C5	/* eglLockSurfaceKHR attribute */
+#define EGL_BITMAP_POINTER_KHR			0x30C6	/* eglQuerySurface attribute */
+#define EGL_BITMAP_PITCH_KHR			0x30C7	/* eglQuerySurface attribute */
+#define EGL_BITMAP_ORIGIN_KHR			0x30C8	/* eglQuerySurface attribute */
+#define EGL_BITMAP_PIXEL_RED_OFFSET_KHR		0x30C9	/* eglQuerySurface attribute */
+#define EGL_BITMAP_PIXEL_GREEN_OFFSET_KHR	0x30CA	/* eglQuerySurface attribute */
+#define EGL_BITMAP_PIXEL_BLUE_OFFSET_KHR	0x30CB	/* eglQuerySurface attribute */
+#define EGL_BITMAP_PIXEL_ALPHA_OFFSET_KHR	0x30CC	/* eglQuerySurface attribute */
+#define EGL_BITMAP_PIXEL_LUMINANCE_OFFSET_KHR	0x30CD	/* eglQuerySurface attribute */
+#define EGL_LOWER_LEFT_KHR			0x30CE	/* EGL_BITMAP_ORIGIN_KHR value */
+#define EGL_UPPER_LEFT_KHR			0x30CF	/* EGL_BITMAP_ORIGIN_KHR value */
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLBoolean EGLAPIENTRY eglLockSurfaceKHR (EGLDisplay display, EGLSurface surface, const EGLint *attrib_list);
+EGLAPI EGLBoolean EGLAPIENTRY eglUnlockSurfaceKHR (EGLDisplay display, EGLSurface surface);
+#endif /* EGL_EGLEXT_PROTOTYPES */
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLLOCKSURFACEKHRPROC) (EGLDisplay display, EGLSurface surface, const EGLint *attrib_list);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLUNLOCKSURFACEKHRPROC) (EGLDisplay display, EGLSurface surface);
+#endif
+
+#ifndef EGL_KHR_image
+#define EGL_KHR_image 1
+#define EGL_NATIVE_PIXMAP_KHR			0x30B0	/* eglCreateImageKHR target */
+typedef void *EGLImageKHR;
+#define EGL_NO_IMAGE_KHR			((EGLImageKHR)0)
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLImageKHR EGLAPIENTRY eglCreateImageKHR (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list);
+EGLAPI EGLBoolean EGLAPIENTRY eglDestroyImageKHR (EGLDisplay dpy, EGLImageKHR image);
+#endif /* EGL_EGLEXT_PROTOTYPES */
+typedef EGLImageKHR (EGLAPIENTRYP PFNEGLCREATEIMAGEKHRPROC) (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYIMAGEKHRPROC) (EGLDisplay dpy, EGLImageKHR image);
+#endif
+
+#ifndef EGL_KHR_vg_parent_image
+#define EGL_KHR_vg_parent_image 1
+#define EGL_VG_PARENT_IMAGE_KHR			0x30BA	/* eglCreateImageKHR target */
+#endif
+
+#ifndef EGL_KHR_gl_texture_2D_image
+#define EGL_KHR_gl_texture_2D_image 1
+#define EGL_GL_TEXTURE_2D_KHR			0x30B1	/* eglCreateImageKHR target */
+#define EGL_GL_TEXTURE_LEVEL_KHR		0x30BC	/* eglCreateImageKHR attribute */
+#endif
+
+#ifndef EGL_KHR_gl_texture_cubemap_image
+#define EGL_KHR_gl_texture_cubemap_image 1
+#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_X_KHR	0x30B3	/* eglCreateImageKHR target */
+#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X_KHR	0x30B4	/* eglCreateImageKHR target */
+#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y_KHR	0x30B5	/* eglCreateImageKHR target */
+#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_KHR	0x30B6	/* eglCreateImageKHR target */
+#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z_KHR	0x30B7	/* eglCreateImageKHR target */
+#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_KHR	0x30B8	/* eglCreateImageKHR target */
+#endif
+
+#ifndef EGL_KHR_gl_texture_3D_image
+#define EGL_KHR_gl_texture_3D_image 1
+#define EGL_GL_TEXTURE_3D_KHR			0x30B2	/* eglCreateImageKHR target */
+#define EGL_GL_TEXTURE_ZOFFSET_KHR		0x30BD	/* eglCreateImageKHR attribute */
+#endif
+
+#ifndef EGL_KHR_gl_renderbuffer_image
+#define EGL_KHR_gl_renderbuffer_image 1
+#define EGL_GL_RENDERBUFFER_KHR			0x30B9	/* eglCreateImageKHR target */
+#endif
+
+#ifndef EGL_KHR_reusable_sync
+#define EGL_KHR_reusable_sync 1
+
+typedef void* EGLSyncKHR;
+typedef khronos_utime_nanoseconds_t EGLTimeKHR;
+
+#define EGL_SYNC_STATUS_KHR			0x30F1
+#define EGL_SIGNALED_KHR			0x30F2
+#define EGL_UNSIGNALED_KHR			0x30F3
+#define EGL_TIMEOUT_EXPIRED_KHR			0x30F5
+#define EGL_CONDITION_SATISFIED_KHR		0x30F6
+#define EGL_SYNC_TYPE_KHR			0x30F7
+#define EGL_SYNC_REUSABLE_KHR			0x30FA
+#define EGL_SYNC_FLUSH_COMMANDS_BIT_KHR		0x0001	/* eglClientWaitSyncKHR <flags> bitfield */
+#define EGL_FOREVER_KHR				0xFFFFFFFFFFFFFFFFull
+#define EGL_NO_SYNC_KHR				((EGLSyncKHR)0)
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLSyncKHR EGLAPIENTRY eglCreateSyncKHR(EGLDisplay dpy, EGLenum type, const EGLint *attrib_list);
+EGLAPI EGLBoolean EGLAPIENTRY eglDestroySyncKHR(EGLDisplay dpy, EGLSyncKHR sync);
+EGLAPI EGLint EGLAPIENTRY eglClientWaitSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout);
+EGLAPI EGLBoolean EGLAPIENTRY eglSignalSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode);
+EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncAttribKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value);
+#endif /* EGL_EGLEXT_PROTOTYPES */
+typedef EGLSyncKHR (EGLAPIENTRYP PFNEGLCREATESYNCKHRPROC) (EGLDisplay dpy, EGLenum type, const EGLint *attrib_list);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync);
+typedef EGLint (EGLAPIENTRYP PFNEGLCLIENTWAITSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLSIGNALSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value);
+#endif
+
+#ifndef EGL_KHR_image_base
+#define EGL_KHR_image_base 1
+/* Most interfaces defined by EGL_KHR_image_pixmap above */
+#define EGL_IMAGE_PRESERVED_KHR			0x30D2	/* eglCreateImageKHR attribute */
+#endif
+
+#ifndef EGL_KHR_image_pixmap
+#define EGL_KHR_image_pixmap 1
+/* Interfaces defined by EGL_KHR_image above */
+#endif
+
+#ifndef EGL_IMG_context_priority
+#define EGL_IMG_context_priority 1
+#define EGL_CONTEXT_PRIORITY_LEVEL_IMG		0x3100
+#define EGL_CONTEXT_PRIORITY_HIGH_IMG		0x3101
+#define EGL_CONTEXT_PRIORITY_MEDIUM_IMG		0x3102
+#define EGL_CONTEXT_PRIORITY_LOW_IMG		0x3103
+#endif
+
+#ifndef EGL_NV_coverage_sample
+#define EGL_NV_coverage_sample 1
+#define EGL_COVERAGE_BUFFERS_NV 0x30E0
+#define EGL_COVERAGE_SAMPLES_NV 0x30E1
+#endif
+
+#ifndef EGL_NV_depth_nonlinear
+#define EGL_NV_depth_nonlinear 1
+#define EGL_DEPTH_ENCODING_NV 0x30E2
+#define EGL_DEPTH_ENCODING_NONE_NV 0
+#define EGL_DEPTH_ENCODING_NONLINEAR_NV 0x30E3
+#endif
+
+#ifndef EGL_NV_sync
+#define EGL_NV_sync 1
+#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_NV	0x30E6
+#define EGL_SYNC_STATUS_NV			0x30E7
+#define EGL_SIGNALED_NV				0x30E8
+#define EGL_UNSIGNALED_NV			0x30E9
+#define EGL_SYNC_FLUSH_COMMANDS_BIT_NV		0x0001
+#define EGL_FOREVER_NV				0xFFFFFFFFFFFFFFFFull
+#define EGL_ALREADY_SIGNALED_NV			0x30EA
+#define EGL_TIMEOUT_EXPIRED_NV			0x30EB
+#define EGL_CONDITION_SATISFIED_NV		0x30EC
+#define EGL_SYNC_TYPE_NV			0x30ED
+#define EGL_SYNC_CONDITION_NV			0x30EE
+#define EGL_SYNC_FENCE_NV			0x30EF
+#define EGL_NO_SYNC_NV				((EGLSyncNV)0)
+typedef void* EGLSyncNV;
+typedef unsigned long long EGLTimeNV;
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLSyncNV eglCreateFenceSyncNV (EGLDisplay dpy, EGLenum condition, const EGLint *attrib_list);
+EGLBoolean eglDestroySyncNV (EGLSyncNV sync);
+EGLBoolean eglFenceNV (EGLSyncNV sync);
+EGLint eglClientWaitSyncNV (EGLSyncNV sync, EGLint flags, EGLTimeNV timeout);
+EGLBoolean eglSignalSyncNV (EGLSyncNV sync, EGLenum mode);
+EGLBoolean eglGetSyncAttribNV (EGLSyncNV sync, EGLint attribute, EGLint *value);
+#endif /* EGL_EGLEXT_PROTOTYPES */
+typedef EGLSyncNV (EGLAPIENTRYP PFNEGLCREATEFENCESYNCNVPROC) (EGLDisplay dpy, EGLenum condition, const EGLint *attrib_list);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSYNCNVPROC) (EGLSyncNV sync);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLFENCENVPROC) (EGLSyncNV sync);
+typedef EGLint (EGLAPIENTRYP PFNEGLCLIENTWAITSYNCNVPROC) (EGLSyncNV sync, EGLint flags, EGLTimeNV timeout);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLSIGNALSYNCNVPROC) (EGLSyncNV sync, EGLenum mode);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBNVPROC) (EGLSyncNV sync, EGLint attribute, EGLint *value);
+#endif
+
+#ifndef EGL_KHR_fence_sync
+#define EGL_KHR_fence_sync 1
+/* Reuses most tokens and entry points from EGL_KHR_reusable_sync */
+#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_KHR	0x30F0
+#define EGL_SYNC_CONDITION_KHR			0x30F8
+#define EGL_SYNC_FENCE_KHR			0x30F9
+#endif
+
+#ifndef EGL_ANDROID_image_native_buffer
+#define EGL_ANDROID_image_native_buffer 1
+struct android_native_buffer_t;
+#define EGL_NATIVE_BUFFER_ANDROID       0x3140  /* eglCreateImageKHR target */
+#endif
+
+#ifndef EGL_ANDROID_get_render_buffer
+#define EGL_ANDROID_get_render_buffer 1
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLClientBuffer EGLAPIENTRY eglGetRenderBufferANDROID(EGLDisplay dpy, EGLSurface draw);
+#endif
+typedef EGLClientBuffer (EGLAPIENTRYP PFNEGLGETRENDERBUFFERANDROIDPROC) (EGLDisplay dpy, EGLSurface draw);
+#endif
+
+#ifndef EGL_ANDROID_swap_rectangle
+#define EGL_ANDROID_swap_rectangle 1
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLBoolean EGLAPIENTRY eglSetSwapRectangleANDROID (EGLDisplay dpy, EGLSurface draw, EGLint left, EGLint top, EGLint width, EGLint height);
+#endif /* EGL_EGLEXT_PROTOTYPES */
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLSETSWAPRECTANGLEANDROIDPROC) (EGLDisplay dpy, EGLSurface draw, EGLint left, EGLint top, EGLint width, EGLint height);
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/ndk/platforms/android-9/include/EGL/eglplatform.h b/ndk/platforms/android-9/include/EGL/eglplatform.h
new file mode 100644
index 0000000..e6c250d
--- /dev/null
+++ b/ndk/platforms/android-9/include/EGL/eglplatform.h
@@ -0,0 +1,121 @@
+#ifndef __eglplatform_h_
+#define __eglplatform_h_
+
+/*
+** Copyright (c) 2007-2009 The Khronos Group Inc.
+**
+** Permission is hereby granted, free of charge, to any person obtaining a
+** copy of this software and/or associated documentation files (the
+** "Materials"), to deal in the Materials without restriction, including
+** without limitation the rights to use, copy, modify, merge, publish,
+** distribute, sublicense, and/or sell copies of the Materials, and to
+** permit persons to whom the Materials are furnished to do so, subject to
+** the following conditions:
+**
+** The above copyright notice and this permission notice shall be included
+** in all copies or substantial portions of the Materials.
+**
+** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+*/
+
+/* Platform-specific types and definitions for egl.h
+ * $Revision: 9724 $ on $Date: 2009-12-02 02:05:33 -0800 (Wed, 02 Dec 2009) $
+ *
+ * Adopters may modify khrplatform.h and this file to suit their platform.
+ * You are encouraged to submit all modifications to the Khronos group so that
+ * they can be included in future versions of this file.  Please submit changes
+ * by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla)
+ * by filing a bug against product "EGL" component "Registry".
+ */
+
+#include <KHR/khrplatform.h>
+
+/* Macros used in EGL function prototype declarations.
+ *
+ * EGL functions should be prototyped as:
+ *
+ * EGLAPI return-type EGLAPIENTRY eglFunction(arguments);
+ * typedef return-type (EXPAPIENTRYP PFNEGLFUNCTIONPROC) (arguments);
+ *
+ * KHRONOS_APICALL and KHRONOS_APIENTRY are defined in KHR/khrplatform.h
+ */
+
+#ifndef EGLAPI
+#define EGLAPI KHRONOS_APICALL
+#endif
+
+#ifndef EGLAPIENTRY
+#define EGLAPIENTRY  KHRONOS_APIENTRY
+#endif
+#define EGLAPIENTRYP EGLAPIENTRY*
+
+/* The types NativeDisplayType, NativeWindowType, and NativePixmapType
+ * are aliases of window-system-dependent types, such as X Display * or
+ * Windows Device Context. They must be defined in platform-specific
+ * code below. The EGL-prefixed versions of Native*Type are the same
+ * types, renamed in EGL 1.3 so all types in the API start with "EGL".
+ */
+
+#if defined(_WIN32) || defined(__VC32__) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) /* Win32 and WinCE */
+#ifndef WIN32_LEAN_AND_MEAN
+#define WIN32_LEAN_AND_MEAN 1
+#endif
+#include <windows.h>
+
+typedef HDC     EGLNativeDisplayType;
+typedef HBITMAP EGLNativePixmapType;
+typedef HWND    EGLNativeWindowType;
+
+#elif defined(__WINSCW__) || defined(__SYMBIAN32__)  /* Symbian */
+
+typedef int   EGLNativeDisplayType;
+typedef void *EGLNativeWindowType;
+typedef void *EGLNativePixmapType;
+
+#elif defined(__unix__) && !defined(__ANDROID__)
+
+/* X11 (tentative)  */
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+
+typedef Display *EGLNativeDisplayType;
+typedef Pixmap   EGLNativePixmapType;
+typedef Window   EGLNativeWindowType;
+
+
+#elif defined(__ANDROID__)
+
+#include <android/native_window.h>
+
+struct egl_native_pixmap_t;
+
+typedef struct ANativeWindow*           EGLNativeWindowType;
+typedef struct egl_native_pixmap_t*     EGLNativePixmapType;
+typedef void*                           EGLNativeDisplayType;
+
+#else
+#error "Platform not recognized"
+#endif
+
+/* EGL 1.2 types, renamed for consistency in EGL 1.3 */
+typedef EGLNativeDisplayType NativeDisplayType;
+typedef EGLNativePixmapType  NativePixmapType;
+typedef EGLNativeWindowType  NativeWindowType;
+
+
+/* Define EGLint. This must be a signed integral type large enough to contain
+ * all legal attribute names and values passed into and out of EGL, whether
+ * their type is boolean, bitmask, enumerant (symbolic constant), integer,
+ * handle, or other.  While in general a 32-bit integer will suffice, if
+ * handles are 64 bit types, then EGLint should be defined as a signed 64-bit
+ * integer type.
+ */
+typedef khronos_int32_t EGLint;
+
+#endif /* __eglplatform_h */
diff --git a/ndk/platforms/android-9/include/SLES/OpenSLES.h b/ndk/platforms/android-9/include/SLES/OpenSLES.h
new file mode 100644
index 0000000..16496f9
--- /dev/null
+++ b/ndk/platforms/android-9/include/SLES/OpenSLES.h
@@ -0,0 +1,2774 @@
+/*
+ * Copyright (c) 2007-2009 The Khronos Group Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and /or associated documentation files (the "Materials "), to
+ * deal in the Materials without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Materials, and to permit persons to whom the Materials are
+ * furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Materials.
+ *
+ * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS IN THE
+ * MATERIALS.
+ *
+ * OpenSLES.h - OpenSL ES version 1.0.1
+ *
+ */
+
+/****************************************************************************/
+/* NOTE: This file is a standard OpenSL ES header file and should not be    */
+/* modified in any way.                                                     */
+/****************************************************************************/
+
+#ifndef OPENSL_ES_H_
+#define OPENSL_ES_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "OpenSLES_Platform.h"
+
+
+/*****************************************************************************/
+/* Common types, structures, and defines                                */
+/*****************************************************************************/
+
+#ifndef _KHRONOS_KEYS_
+#define _KHRONOS_KEYS_
+
+#define KHRONOS_TITLE "KhronosTitle"
+#define KHRONOS_ALBUM "KhronosAlbum"
+#define KHRONOS_TRACK_NUMBER "KhronosTrackNumber"
+#define KHRONOS_ARTIST "KhronosArtist"
+#define KHRONOS_GENRE "KhronosGenre"
+#define KHRONOS_YEAR "KhronosYear"
+#define KHRONOS_COMMENT "KhronosComment"
+#define KHRONOS_ARTIST_URL "KhronosArtistURL"
+#define KHRONOS_CONTENT_URL "KhronosContentURL"
+#define KHRONOS_RATING "KhronosRating"
+#define KHRONOS_ALBUM_ART "KhronosAlbumArt"
+#define KHRONOS_COPYRIGHT "KhronosCopyright"
+
+#endif
+
+
+/* remap common types to SL types for clarity */
+typedef sl_int8_t              SLint8;          /* 8 bit signed integer  */
+typedef sl_uint8_t             SLuint8;         /* 8 bit unsigned integer */
+typedef sl_int16_t             SLint16;         /* 16 bit signed integer */
+typedef sl_uint16_t            SLuint16;        /* 16 bit unsigned integer */
+typedef sl_int32_t             SLint32;           /* 32 bit signed integer */
+typedef sl_uint32_t            SLuint32;          /* 32 bit unsigned integer */
+
+typedef SLuint32                    SLboolean;
+#define SL_BOOLEAN_FALSE            ((SLboolean) 0x00000000)
+#define SL_BOOLEAN_TRUE             ((SLboolean) 0x00000001)
+
+typedef SLuint8						SLchar;			/* UTF-8 is to be used */
+typedef SLint16						SLmillibel;
+typedef SLuint32					SLmillisecond;
+typedef SLuint32					SLmilliHertz;
+typedef SLint32						SLmillimeter;
+typedef SLint32						SLmillidegree;
+typedef SLint16						SLpermille;
+typedef SLuint32					SLmicrosecond;
+typedef SLuint32					SLresult;
+
+#define SL_MILLIBEL_MAX 	((SLmillibel) 0x7FFF)
+#define SL_MILLIBEL_MIN 	((SLmillibel) (-SL_MILLIBEL_MAX-1))
+
+#define SL_MILLIHERTZ_MAX	((SLmilliHertz) 0xFFFFFFFF)
+#define SL_MILLIMETER_MAX	((SLmillimeter) 0x7FFFFFFF)
+
+/** Interface ID defined as a UUID */
+typedef const struct SLInterfaceID_ {
+    SLuint32 time_low;
+    SLuint16 time_mid;
+    SLuint16 time_hi_and_version;
+    SLuint16 clock_seq;
+    SLuint8  node[6];
+} * SLInterfaceID;
+
+/* Forward declaration for the object interface */
+struct SLObjectItf_;
+
+typedef const struct SLObjectItf_ * const * SLObjectItf;
+
+/* Objects ID's */
+
+#define SL_OBJECTID_ENGINE			((SLuint32) 0x00001001)
+#define SL_OBJECTID_LEDDEVICE		((SLuint32) 0x00001002)
+#define SL_OBJECTID_VIBRADEVICE		((SLuint32) 0x00001003)
+#define SL_OBJECTID_AUDIOPLAYER		((SLuint32) 0x00001004)
+#define SL_OBJECTID_AUDIORECORDER	((SLuint32) 0x00001005)
+#define SL_OBJECTID_MIDIPLAYER		((SLuint32) 0x00001006)
+#define SL_OBJECTID_LISTENER		((SLuint32) 0x00001007)
+#define SL_OBJECTID_3DGROUP			((SLuint32) 0x00001008)
+#define SL_OBJECTID_OUTPUTMIX		((SLuint32) 0x00001009)
+#define SL_OBJECTID_METADATAEXTRACTOR	((SLuint32) 0x0000100A)
+
+
+/* SL Profiles */
+
+#define SL_PROFILES_PHONE	((SLuint16) 0x0001)
+#define SL_PROFILES_MUSIC	((SLuint16) 0x0002)
+#define SL_PROFILES_GAME	((SLuint16) 0x0004)
+
+/* Types of voices supported by the system */
+
+#define SL_VOICETYPE_2D_AUDIO		((SLuint16) 0x0001)
+#define SL_VOICETYPE_MIDI			((SLuint16) 0x0002)
+#define SL_VOICETYPE_3D_AUDIO 		((SLuint16) 0x0004)
+#define SL_VOICETYPE_3D_MIDIOUTPUT 	((SLuint16) 0x0008)
+
+/* Convenient macros representing various different priority levels, for use with the SetPriority method */
+
+#define SL_PRIORITY_LOWEST		((SLint32) (-0x7FFFFFFF-1))
+#define SL_PRIORITY_VERYLOW		((SLint32) -0x60000000)
+#define SL_PRIORITY_LOW			((SLint32) -0x40000000)
+#define SL_PRIORITY_BELOWNORMAL	((SLint32) -0x20000000)
+#define SL_PRIORITY_NORMAL		((SLint32) 0x00000000)
+#define SL_PRIORITY_ABOVENORMAL	((SLint32) 0x20000000)
+#define SL_PRIORITY_HIGH		((SLint32) 0x40000000)
+#define SL_PRIORITY_VERYHIGH	((SLint32) 0x60000000)
+#define SL_PRIORITY_HIGHEST	((SLint32) 0x7FFFFFFF)
+
+
+/** These macros list the various sample formats that are possible on audio input and output devices. */
+
+#define SL_PCMSAMPLEFORMAT_FIXED_8	((SLuint16) 0x0008)
+#define SL_PCMSAMPLEFORMAT_FIXED_16	((SLuint16) 0x0010)
+#define SL_PCMSAMPLEFORMAT_FIXED_20 	((SLuint16) 0x0014)
+#define SL_PCMSAMPLEFORMAT_FIXED_24	((SLuint16) 0x0018)
+#define SL_PCMSAMPLEFORMAT_FIXED_28 	((SLuint16) 0x001C)
+#define SL_PCMSAMPLEFORMAT_FIXED_32	((SLuint16) 0x0020)
+
+
+/** These macros specify the commonly used sampling rates (in milliHertz) supported by most audio I/O devices. */
+
+#define SL_SAMPLINGRATE_8		((SLuint32) 8000000)
+#define SL_SAMPLINGRATE_11_025	((SLuint32) 11025000)
+#define SL_SAMPLINGRATE_12		((SLuint32) 12000000)
+#define SL_SAMPLINGRATE_16		((SLuint32) 16000000)
+#define SL_SAMPLINGRATE_22_05	((SLuint32) 22050000)
+#define SL_SAMPLINGRATE_24		((SLuint32) 24000000)
+#define SL_SAMPLINGRATE_32		((SLuint32) 32000000)
+#define SL_SAMPLINGRATE_44_1	((SLuint32) 44100000)
+#define SL_SAMPLINGRATE_48		((SLuint32) 48000000)
+#define SL_SAMPLINGRATE_64		((SLuint32) 64000000)
+#define SL_SAMPLINGRATE_88_2	((SLuint32) 88200000)
+#define SL_SAMPLINGRATE_96		((SLuint32) 96000000)
+#define SL_SAMPLINGRATE_192	((SLuint32) 192000000)
+
+#define SL_SPEAKER_FRONT_LEFT			((SLuint32) 0x00000001)
+#define SL_SPEAKER_FRONT_RIGHT			((SLuint32) 0x00000002)
+#define SL_SPEAKER_FRONT_CENTER			((SLuint32) 0x00000004)
+#define SL_SPEAKER_LOW_FREQUENCY			((SLuint32) 0x00000008)
+#define SL_SPEAKER_BACK_LEFT			((SLuint32) 0x00000010)
+#define SL_SPEAKER_BACK_RIGHT			((SLuint32) 0x00000020)
+#define SL_SPEAKER_FRONT_LEFT_OF_CENTER	((SLuint32) 0x00000040)
+#define SL_SPEAKER_FRONT_RIGHT_OF_CENTER	((SLuint32) 0x00000080)
+#define SL_SPEAKER_BACK_CENTER			((SLuint32) 0x00000100)
+#define SL_SPEAKER_SIDE_LEFT			((SLuint32) 0x00000200)
+#define SL_SPEAKER_SIDE_RIGHT			((SLuint32) 0x00000400)
+#define SL_SPEAKER_TOP_CENTER			((SLuint32) 0x00000800)
+#define SL_SPEAKER_TOP_FRONT_LEFT		((SLuint32) 0x00001000)
+#define SL_SPEAKER_TOP_FRONT_CENTER		((SLuint32) 0x00002000)
+#define SL_SPEAKER_TOP_FRONT_RIGHT		((SLuint32) 0x00004000)
+#define SL_SPEAKER_TOP_BACK_LEFT			((SLuint32) 0x00008000)
+#define SL_SPEAKER_TOP_BACK_CENTER		((SLuint32) 0x00010000)
+#define SL_SPEAKER_TOP_BACK_RIGHT		((SLuint32) 0x00020000)
+
+
+/*****************************************************************************/
+/* Errors                                                                    */
+/*                                                                           */
+/*****************************************************************************/
+
+#define SL_RESULT_SUCCESS				((SLuint32) 0x00000000)
+#define SL_RESULT_PRECONDITIONS_VIOLATED	((SLuint32) 0x00000001)
+#define SL_RESULT_PARAMETER_INVALID		((SLuint32) 0x00000002)
+#define SL_RESULT_MEMORY_FAILURE			((SLuint32) 0x00000003)
+#define SL_RESULT_RESOURCE_ERROR			((SLuint32) 0x00000004)
+#define SL_RESULT_RESOURCE_LOST			((SLuint32) 0x00000005)
+#define SL_RESULT_IO_ERROR				((SLuint32) 0x00000006)
+#define SL_RESULT_BUFFER_INSUFFICIENT		((SLuint32) 0x00000007)
+#define SL_RESULT_CONTENT_CORRUPTED		((SLuint32) 0x00000008)
+#define SL_RESULT_CONTENT_UNSUPPORTED		((SLuint32) 0x00000009)
+#define SL_RESULT_CONTENT_NOT_FOUND		((SLuint32) 0x0000000A)
+#define SL_RESULT_PERMISSION_DENIED		((SLuint32) 0x0000000B)
+#define SL_RESULT_FEATURE_UNSUPPORTED		((SLuint32) 0x0000000C)
+#define SL_RESULT_INTERNAL_ERROR			((SLuint32) 0x0000000D)
+#define SL_RESULT_UNKNOWN_ERROR			((SLuint32) 0x0000000E)
+#define SL_RESULT_OPERATION_ABORTED		((SLuint32) 0x0000000F)
+#define SL_RESULT_CONTROL_LOST			((SLuint32) 0x00000010)
+
+
+/* Object state definitions */
+
+#define SL_OBJECT_STATE_UNREALIZED	((SLuint32) 0x00000001)
+#define SL_OBJECT_STATE_REALIZED		((SLuint32) 0x00000002)
+#define SL_OBJECT_STATE_SUSPENDED	((SLuint32) 0x00000003)
+
+/* Object event definitions */
+
+#define SL_OBJECT_EVENT_RUNTIME_ERROR			((SLuint32) 0x00000001)
+#define SL_OBJECT_EVENT_ASYNC_TERMINATION		((SLuint32) 0x00000002)
+#define SL_OBJECT_EVENT_RESOURCES_LOST			((SLuint32) 0x00000003)
+#define SL_OBJECT_EVENT_RESOURCES_AVAILABLE		((SLuint32) 0x00000004)
+#define SL_OBJECT_EVENT_ITF_CONTROL_TAKEN		((SLuint32) 0x00000005)
+#define SL_OBJECT_EVENT_ITF_CONTROL_RETURNED		((SLuint32) 0x00000006)
+#define SL_OBJECT_EVENT_ITF_PARAMETERS_CHANGED	((SLuint32) 0x00000007)
+
+
+/*****************************************************************************/
+/* Interface definitions                                                     */
+/*****************************************************************************/
+
+/** NULL Interface */
+
+extern SLAPIENTRY const SLInterfaceID SL_IID_NULL;
+
+/*---------------------------------------------------------------------------*/
+/* Data Source and Data Sink Structures                                      */
+/*---------------------------------------------------------------------------*/
+
+/** Data locator macros  */
+#define SL_DATALOCATOR_URI			((SLuint32) 0x00000001)
+#define SL_DATALOCATOR_ADDRESS		((SLuint32) 0x00000002)
+#define SL_DATALOCATOR_IODEVICE		((SLuint32) 0x00000003)
+#define SL_DATALOCATOR_OUTPUTMIX		((SLuint32) 0x00000004)
+#define SL_DATALOCATOR_RESERVED5		((SLuint32) 0x00000005)
+#define SL_DATALOCATOR_BUFFERQUEUE	((SLuint32) 0x00000006)
+#define SL_DATALOCATOR_MIDIBUFFERQUEUE	((SLuint32) 0x00000007)
+#define SL_DATALOCATOR_RESERVED8		((SLuint32) 0x00000008)
+
+
+
+/** URI-based data locator definition where locatorType must be SL_DATALOCATOR_URI*/
+typedef struct SLDataLocator_URI_ {
+	SLuint32 		locatorType;
+	SLchar *		URI;
+} SLDataLocator_URI;
+
+/** Address-based data locator definition where locatorType must be SL_DATALOCATOR_ADDRESS*/
+typedef struct SLDataLocator_Address_ {
+	SLuint32 	locatorType;
+	void 		*pAddress;
+	SLuint32	length;
+} SLDataLocator_Address;
+
+/** IODevice-types */
+#define SL_IODEVICE_AUDIOINPUT	((SLuint32) 0x00000001)
+#define SL_IODEVICE_LEDARRAY	((SLuint32) 0x00000002)
+#define SL_IODEVICE_VIBRA		((SLuint32) 0x00000003)
+#define SL_IODEVICE_RESERVED4	((SLuint32) 0x00000004)
+#define SL_IODEVICE_RESERVED5	((SLuint32) 0x00000005)
+
+/** IODevice-based data locator definition where locatorType must be SL_DATALOCATOR_IODEVICE*/
+typedef struct SLDataLocator_IODevice_ {
+	SLuint32	locatorType;
+	SLuint32	deviceType;
+	SLuint32	deviceID;
+	SLObjectItf	device;
+} SLDataLocator_IODevice;
+
+/** OutputMix-based data locator definition where locatorType must be SL_DATALOCATOR_OUTPUTMIX*/
+typedef struct SLDataLocator_OutputMix {
+	SLuint32 		locatorType;
+	SLObjectItf		outputMix;
+} SLDataLocator_OutputMix;
+
+
+/** BufferQueue-based data locator definition where locatorType must be SL_DATALOCATOR_BUFFERQUEUE*/
+typedef struct SLDataLocator_BufferQueue {
+	SLuint32	locatorType;
+	SLuint32	numBuffers;
+} SLDataLocator_BufferQueue;
+
+/** MidiBufferQueue-based data locator definition where locatorType must be SL_DATALOCATOR_MIDIBUFFERQUEUE*/
+typedef struct SLDataLocator_MIDIBufferQueue {
+	SLuint32	locatorType;
+	SLuint32	tpqn;
+	SLuint32	numBuffers;
+} SLDataLocator_MIDIBufferQueue;
+
+/** Data format defines */
+#define SL_DATAFORMAT_MIME		((SLuint32) 0x00000001)
+#define SL_DATAFORMAT_PCM		((SLuint32) 0x00000002)
+#define SL_DATAFORMAT_RESERVED3	((SLuint32) 0x00000003)
+
+
+/** MIME-type-based data format definition where formatType must be SL_DATAFORMAT_MIME*/
+typedef struct SLDataFormat_MIME_ {
+	SLuint32 		formatType;
+	SLchar * 		mimeType;
+	SLuint32		containerType;
+} SLDataFormat_MIME;
+
+/* Byte order of a block of 16- or 32-bit data */
+#define SL_BYTEORDER_BIGENDIAN				((SLuint32) 0x00000001)
+#define SL_BYTEORDER_LITTLEENDIAN			((SLuint32) 0x00000002)
+
+/* Container type */
+#define SL_CONTAINERTYPE_UNSPECIFIED	((SLuint32) 0x00000001)
+#define SL_CONTAINERTYPE_RAW		((SLuint32) 0x00000002)
+#define SL_CONTAINERTYPE_ASF		((SLuint32) 0x00000003)
+#define SL_CONTAINERTYPE_AVI		((SLuint32) 0x00000004)
+#define SL_CONTAINERTYPE_BMP		((SLuint32) 0x00000005)
+#define SL_CONTAINERTYPE_JPG		((SLuint32) 0x00000006)
+#define SL_CONTAINERTYPE_JPG2000		((SLuint32) 0x00000007)
+#define SL_CONTAINERTYPE_M4A		((SLuint32) 0x00000008)
+#define SL_CONTAINERTYPE_MP3		((SLuint32) 0x00000009)
+#define SL_CONTAINERTYPE_MP4		((SLuint32) 0x0000000A)
+#define SL_CONTAINERTYPE_MPEG_ES		((SLuint32) 0x0000000B)
+#define SL_CONTAINERTYPE_MPEG_PS		((SLuint32) 0x0000000C)
+#define SL_CONTAINERTYPE_MPEG_TS		((SLuint32) 0x0000000D)
+#define SL_CONTAINERTYPE_QT		((SLuint32) 0x0000000E)
+#define SL_CONTAINERTYPE_WAV		((SLuint32) 0x0000000F)
+#define SL_CONTAINERTYPE_XMF_0		((SLuint32) 0x00000010)
+#define SL_CONTAINERTYPE_XMF_1		((SLuint32) 0x00000011)
+#define SL_CONTAINERTYPE_XMF_2		((SLuint32) 0x00000012)
+#define SL_CONTAINERTYPE_XMF_3		((SLuint32) 0x00000013)
+#define SL_CONTAINERTYPE_XMF_GENERIC	((SLuint32) 0x00000014)
+#define SL_CONTAINERTYPE_AMR  		((SLuint32) 0x00000015)
+#define SL_CONTAINERTYPE_AAC		((SLuint32) 0x00000016)
+#define SL_CONTAINERTYPE_3GPP		((SLuint32) 0x00000017)
+#define SL_CONTAINERTYPE_3GA		((SLuint32) 0x00000018)
+#define SL_CONTAINERTYPE_RM		((SLuint32) 0x00000019)
+#define SL_CONTAINERTYPE_DMF		((SLuint32) 0x0000001A)
+#define SL_CONTAINERTYPE_SMF		((SLuint32) 0x0000001B)
+#define SL_CONTAINERTYPE_MOBILE_DLS	((SLuint32) 0x0000001C)
+#define SL_CONTAINERTYPE_OGG	((SLuint32) 0x0000001D)
+
+
+/** PCM-type-based data format definition where formatType must be SL_DATAFORMAT_PCM*/
+typedef struct SLDataFormat_PCM_ {
+	SLuint32 		formatType;
+	SLuint32 		numChannels;
+	SLuint32 		samplesPerSec;
+	SLuint32 		bitsPerSample;
+	SLuint32 		containerSize;
+	SLuint32 		channelMask;
+	SLuint32		endianness;
+} SLDataFormat_PCM;
+
+typedef struct SLDataSource_ {
+	void *pLocator;
+	void *pFormat;
+} SLDataSource;
+
+
+typedef struct SLDataSink_ {
+	void *pLocator;
+	void *pFormat;
+} SLDataSink;
+
+
+
+
+
+
+/*---------------------------------------------------------------------------*/
+/* Standard Object Interface                                                 */
+/*---------------------------------------------------------------------------*/
+
+extern SLAPIENTRY const SLInterfaceID SL_IID_OBJECT;
+
+/** Object callback */
+
+
+typedef void (/*SLAPIENTRY*/ *slObjectCallback) (
+	SLObjectItf caller,
+	const void * pContext,
+	SLuint32 event,
+	SLresult result,
+    SLuint32 param,
+    void *pInterface
+);
+
+
+struct SLObjectItf_ {
+	SLresult (*Realize) (
+		SLObjectItf self,
+		SLboolean async
+	);
+	SLresult (*Resume) (
+		SLObjectItf self,
+		SLboolean async
+	);
+	SLresult (*GetState) (
+		SLObjectItf self,
+		SLuint32 * pState
+	);
+	SLresult (*GetInterface) (
+		SLObjectItf self,
+		const SLInterfaceID iid,
+		void * pInterface
+	);
+	SLresult (*RegisterCallback) (
+		SLObjectItf self,
+		slObjectCallback callback,
+		void * pContext
+	);
+	void (*AbortAsyncOperation) (
+		SLObjectItf self
+	);
+	void (*Destroy) (
+		SLObjectItf self
+	);
+	SLresult (*SetPriority) (
+		SLObjectItf self,
+		SLint32 priority,
+		SLboolean preemptable
+	);
+	SLresult (*GetPriority) (
+		SLObjectItf self,
+		SLint32 *pPriority,
+		SLboolean *pPreemptable
+	);
+	SLresult (*SetLossOfControlInterfaces) (
+		SLObjectItf self,
+		SLint16 numInterfaces,
+		SLInterfaceID * pInterfaceIDs,
+		SLboolean enabled
+	);
+};
+
+
+/*---------------------------------------------------------------------------*/
+/* Audio IO Device capabilities interface                                    */
+/*---------------------------------------------------------------------------*/
+
+#define SL_DEFAULTDEVICEID_AUDIOINPUT 	((SLuint32) 0xFFFFFFFF)
+#define SL_DEFAULTDEVICEID_AUDIOOUTPUT 	((SLuint32) 0xFFFFFFFE)
+#define SL_DEFAULTDEVICEID_LED          ((SLuint32) 0xFFFFFFFD)
+#define SL_DEFAULTDEVICEID_VIBRA        ((SLuint32) 0xFFFFFFFC)
+#define SL_DEFAULTDEVICEID_RESERVED1    ((SLuint32) 0xFFFFFFFB)
+
+
+#define SL_DEVCONNECTION_INTEGRATED         ((SLint16) 0x0001)
+#define SL_DEVCONNECTION_ATTACHED_WIRED     ((SLint16) 0x0100)
+#define SL_DEVCONNECTION_ATTACHED_WIRELESS  ((SLint16) 0x0200)
+#define SL_DEVCONNECTION_NETWORK 		    ((SLint16) 0x0400)
+
+
+#define SL_DEVLOCATION_HANDSET 	((SLuint16) 0x0001)
+#define SL_DEVLOCATION_HEADSET 	((SLuint16) 0x0002)
+#define SL_DEVLOCATION_CARKIT 	((SLuint16) 0x0003)
+#define SL_DEVLOCATION_DOCK 	((SLuint16) 0x0004)
+#define SL_DEVLOCATION_REMOTE 	((SLuint16) 0x0005)
+/* Note: SL_DEVLOCATION_RESLTE is deprecated, use SL_DEVLOCATION_REMOTE instead. */
+#define SL_DEVLOCATION_RESLTE 	((SLuint16) 0x0005)
+
+
+#define SL_DEVSCOPE_UNKNOWN     ((SLuint16) 0x0001)
+#define SL_DEVSCOPE_ENVIRONMENT ((SLuint16) 0x0002)
+#define SL_DEVSCOPE_USER        ((SLuint16) 0x0003)
+
+
+typedef struct SLAudioInputDescriptor_ {
+	SLchar *deviceName;
+	SLint16 deviceConnection;
+	SLint16 deviceScope;
+	SLint16 deviceLocation;
+	SLboolean isForTelephony;
+	SLmilliHertz minSampleRate;
+	SLmilliHertz maxSampleRate;
+	SLboolean isFreqRangeContinuous;
+	SLmilliHertz *samplingRatesSupported;
+	SLint16 numOfSamplingRatesSupported;
+	SLint16 maxChannels;
+} SLAudioInputDescriptor;
+
+
+typedef struct SLAudioOutputDescriptor_ {
+	SLchar *pDeviceName;
+	SLint16 deviceConnection;
+	SLint16 deviceScope;
+	SLint16 deviceLocation;
+	SLboolean isForTelephony;
+	SLmilliHertz minSampleRate;
+	SLmilliHertz maxSampleRate;
+	SLboolean isFreqRangeContinuous;
+	SLmilliHertz *samplingRatesSupported;
+	SLint16 numOfSamplingRatesSupported;
+	SLint16 maxChannels;
+} SLAudioOutputDescriptor;
+
+
+
+extern SLAPIENTRY const SLInterfaceID SL_IID_AUDIOIODEVICECAPABILITIES;
+
+struct SLAudioIODeviceCapabilitiesItf_;
+typedef const struct SLAudioIODeviceCapabilitiesItf_ * const * SLAudioIODeviceCapabilitiesItf;
+
+
+typedef void (/*SLAPIENTRY*/ *slAvailableAudioInputsChangedCallback) (
+	SLAudioIODeviceCapabilitiesItf caller,
+	void *pContext,
+	SLuint32 deviceID,
+	SLint32 numInputs,
+	SLboolean isNew
+);
+
+
+typedef void (/*SLAPIENTRY*/ *slAvailableAudioOutputsChangedCallback) (
+	SLAudioIODeviceCapabilitiesItf caller,
+	void *pContext,
+	SLuint32 deviceID,
+	SLint32 numOutputs,
+	SLboolean isNew
+);
+
+typedef void (/*SLAPIENTRY*/ *slDefaultDeviceIDMapChangedCallback) (
+	SLAudioIODeviceCapabilitiesItf caller,
+	void *pContext,
+	SLboolean isOutput,
+	SLint32 numDevices
+);
+
+
+struct SLAudioIODeviceCapabilitiesItf_ {
+	SLresult (*GetAvailableAudioInputs)(
+		SLAudioIODeviceCapabilitiesItf self,
+		SLint32  *pNumInputs,
+		SLuint32 *pInputDeviceIDs
+	);
+	SLresult (*QueryAudioInputCapabilities)(
+		SLAudioIODeviceCapabilitiesItf self,
+		SLuint32 deviceId,
+		SLAudioInputDescriptor *pDescriptor
+	);
+	SLresult (*RegisterAvailableAudioInputsChangedCallback) (
+		SLAudioIODeviceCapabilitiesItf self,
+		slAvailableAudioInputsChangedCallback callback,
+		void *pContext
+	);
+	SLresult (*GetAvailableAudioOutputs)(
+		SLAudioIODeviceCapabilitiesItf self,
+		SLint32 *pNumOutputs,
+		SLuint32 *pOutputDeviceIDs
+	);
+	SLresult (*QueryAudioOutputCapabilities)(
+		SLAudioIODeviceCapabilitiesItf self,
+		SLuint32 deviceId,
+		SLAudioOutputDescriptor *pDescriptor
+	);
+	SLresult (*RegisterAvailableAudioOutputsChangedCallback) (
+		SLAudioIODeviceCapabilitiesItf self,
+		slAvailableAudioOutputsChangedCallback callback,
+		void *pContext
+	);
+	SLresult (*RegisterDefaultDeviceIDMapChangedCallback) (
+		SLAudioIODeviceCapabilitiesItf self,
+		slDefaultDeviceIDMapChangedCallback callback,
+		void *pContext
+	);
+	SLresult (*GetAssociatedAudioInputs) (
+		SLAudioIODeviceCapabilitiesItf self,
+		SLuint32 deviceId,
+		SLint32 *pNumAudioInputs,
+		SLuint32 *pAudioInputDeviceIDs
+	);
+	SLresult (*GetAssociatedAudioOutputs) (
+		SLAudioIODeviceCapabilitiesItf self,
+		SLuint32 deviceId,
+		SLint32 *pNumAudioOutputs,
+		SLuint32 *pAudioOutputDeviceIDs
+	);
+	SLresult (*GetDefaultAudioDevices) (
+		SLAudioIODeviceCapabilitiesItf self,
+		SLuint32 defaultDeviceID,
+		SLint32 *pNumAudioDevices,
+		SLuint32 *pAudioDeviceIDs
+	);
+	SLresult (*QuerySampleFormatsSupported)(
+		SLAudioIODeviceCapabilitiesItf self,
+		SLuint32 deviceId,
+		SLmilliHertz samplingRate,
+		SLint32 *pSampleFormats,
+		SLint32 *pNumOfSampleFormats
+	);
+};
+
+
+
+/*---------------------------------------------------------------------------*/
+/* Capabilities of the LED array IODevice                                    */
+/*---------------------------------------------------------------------------*/
+
+typedef struct SLLEDDescriptor_ {
+	SLuint8   ledCount;
+	SLuint8   primaryLED;
+	SLuint32  colorMask;
+} SLLEDDescriptor;
+
+
+/*---------------------------------------------------------------------------*/
+/* LED Array interface                                                       */
+/*---------------------------------------------------------------------------*/
+
+typedef struct SLHSL_ {
+    SLmillidegree  hue;
+    SLpermille     saturation;
+    SLpermille     lightness;
+} SLHSL;
+
+
+extern SLAPIENTRY const SLInterfaceID SL_IID_LED;
+
+struct SLLEDArrayItf_;
+typedef const struct SLLEDArrayItf_ * const * SLLEDArrayItf;
+
+struct SLLEDArrayItf_ {
+	SLresult (*ActivateLEDArray) (
+		SLLEDArrayItf self,
+		SLuint32 lightMask
+	);
+	SLresult (*IsLEDArrayActivated) (
+		SLLEDArrayItf self,
+		SLuint32 *lightMask
+	);
+	SLresult (*SetColor) (
+		SLLEDArrayItf self,
+		SLuint8 index,
+		const SLHSL *color
+	);
+	SLresult (*GetColor) (
+		SLLEDArrayItf self,
+		SLuint8 index,
+		SLHSL *color
+	);
+};
+
+/*---------------------------------------------------------------------------*/
+/* Capabilities of the Vibra IODevice                                        */
+/*---------------------------------------------------------------------------*/
+
+typedef struct SLVibraDescriptor_ {
+	SLboolean supportsFrequency;
+	SLboolean supportsIntensity;
+	SLmilliHertz  minFrequency;
+	SLmilliHertz  maxFrequency;
+} SLVibraDescriptor;
+
+
+
+/*---------------------------------------------------------------------------*/
+/* Vibra interface                                                           */
+/*---------------------------------------------------------------------------*/
+
+
+extern SLAPIENTRY const SLInterfaceID SL_IID_VIBRA;
+
+
+struct SLVibraItf_;
+typedef const struct SLVibraItf_ * const * SLVibraItf;
+
+struct SLVibraItf_ {
+	SLresult (*Vibrate) (
+		SLVibraItf self,
+		SLboolean vibrate
+	);
+	SLresult (*IsVibrating) (
+		SLVibraItf self,
+		SLboolean *pVibrating
+	);
+	SLresult (*SetFrequency) (
+		SLVibraItf self,
+		SLmilliHertz frequency
+	);
+	SLresult (*GetFrequency) (
+		SLVibraItf self,
+		SLmilliHertz *pFrequency
+	);
+	SLresult (*SetIntensity) (
+		SLVibraItf self,
+		SLpermille intensity
+	);
+	SLresult (*GetIntensity) (
+		SLVibraItf self,
+		SLpermille *pIntensity
+	);
+};
+
+
+/*---------------------------------------------------------------------------*/
+/* Meta data extraction related types and interface                          */
+/*---------------------------------------------------------------------------*/
+
+#define SL_CHARACTERENCODING_UNKNOWN			((SLuint32) 0x00000000)
+#define SL_CHARACTERENCODING_BINARY       ((SLuint32) 0x00000001)
+#define SL_CHARACTERENCODING_ASCII        ((SLuint32) 0x00000002)
+#define SL_CHARACTERENCODING_BIG5         ((SLuint32) 0x00000003)
+#define SL_CHARACTERENCODING_CODEPAGE1252		((SLuint32) 0x00000004)
+#define SL_CHARACTERENCODING_GB2312			((SLuint32) 0x00000005)
+#define SL_CHARACTERENCODING_HZGB2312			((SLuint32) 0x00000006)
+#define SL_CHARACTERENCODING_GB12345			((SLuint32) 0x00000007)
+#define SL_CHARACTERENCODING_GB18030			((SLuint32) 0x00000008)
+#define SL_CHARACTERENCODING_GBK				((SLuint32) 0x00000009)
+#define SL_CHARACTERENCODING_IMAPUTF7			((SLuint32) 0x0000000A)
+#define SL_CHARACTERENCODING_ISO2022JP			((SLuint32) 0x0000000B)
+#define SL_CHARACTERENCODING_ISO2022JP1		((SLuint32) 0x0000000B)
+#define SL_CHARACTERENCODING_ISO88591			((SLuint32) 0x0000000C)
+#define SL_CHARACTERENCODING_ISO885910			((SLuint32) 0x0000000D)
+#define SL_CHARACTERENCODING_ISO885913			((SLuint32) 0x0000000E)
+#define SL_CHARACTERENCODING_ISO885914			((SLuint32) 0x0000000F)
+#define SL_CHARACTERENCODING_ISO885915			((SLuint32) 0x00000010)
+#define SL_CHARACTERENCODING_ISO88592			((SLuint32) 0x00000011)
+#define SL_CHARACTERENCODING_ISO88593			((SLuint32) 0x00000012)
+#define SL_CHARACTERENCODING_ISO88594			((SLuint32) 0x00000013)
+#define SL_CHARACTERENCODING_ISO88595			((SLuint32) 0x00000014)
+#define SL_CHARACTERENCODING_ISO88596			((SLuint32) 0x00000015)
+#define SL_CHARACTERENCODING_ISO88597			((SLuint32) 0x00000016)
+#define SL_CHARACTERENCODING_ISO88598			((SLuint32) 0x00000017)
+#define SL_CHARACTERENCODING_ISO88599			((SLuint32) 0x00000018)
+#define SL_CHARACTERENCODING_ISOEUCJP			((SLuint32) 0x00000019)
+#define SL_CHARACTERENCODING_SHIFTJIS			((SLuint32) 0x0000001A)
+#define SL_CHARACTERENCODING_SMS7BIT			((SLuint32) 0x0000001B)
+#define SL_CHARACTERENCODING_UTF7			((SLuint32) 0x0000001C)
+#define SL_CHARACTERENCODING_UTF8			((SLuint32) 0x0000001D)
+#define SL_CHARACTERENCODING_JAVACONFORMANTUTF8	((SLuint32) 0x0000001E)
+#define SL_CHARACTERENCODING_UTF16BE			((SLuint32) 0x0000001F)
+#define SL_CHARACTERENCODING_UTF16LE			((SLuint32) 0x00000020)
+
+
+#define SL_METADATA_FILTER_KEY		((SLuint8) 0x01)
+#define SL_METADATA_FILTER_LANG		((SLuint8) 0x02)
+#define SL_METADATA_FILTER_ENCODING	((SLuint8) 0x04)
+
+
+typedef struct SLMetadataInfo_ {
+    SLuint32     size;
+    SLuint32     encoding;
+    SLchar       langCountry[16];
+    SLuint8      data[1];
+} SLMetadataInfo;
+
+extern SLAPIENTRY const SLInterfaceID SL_IID_METADATAEXTRACTION;
+
+struct SLMetadataExtractionItf_;
+typedef const struct SLMetadataExtractionItf_ * const * SLMetadataExtractionItf;
+
+
+struct SLMetadataExtractionItf_ {
+	SLresult (*GetItemCount) (
+		SLMetadataExtractionItf self,
+		SLuint32 *pItemCount
+	);
+	SLresult (*GetKeySize) (
+		SLMetadataExtractionItf self,
+		SLuint32 index,
+		SLuint32 *pKeySize
+	);
+	SLresult (*GetKey) (
+		SLMetadataExtractionItf self,
+		SLuint32 index,
+		SLuint32 keySize,
+		SLMetadataInfo *pKey
+	);
+	SLresult (*GetValueSize) (
+		SLMetadataExtractionItf self,
+		SLuint32 index,
+		SLuint32 *pValueSize
+	);
+	SLresult (*GetValue) (
+		SLMetadataExtractionItf self,
+		SLuint32 index,
+		SLuint32 valueSize,
+		SLMetadataInfo *pValue
+	);
+	SLresult (*AddKeyFilter) (
+		SLMetadataExtractionItf self,
+		SLuint32 keySize,
+		const void *pKey,
+		SLuint32 keyEncoding,
+		const SLchar *pValueLangCountry,
+		SLuint32 valueEncoding,
+		SLuint8 filterMask
+	);
+	SLresult (*ClearKeyFilter) (
+		SLMetadataExtractionItf self
+	);
+};
+
+
+/*---------------------------------------------------------------------------*/
+/* Meta data traversal related types and interface                          */
+/*---------------------------------------------------------------------------*/
+
+#define SL_METADATATRAVERSALMODE_ALL	((SLuint32) 0x00000001)
+#define SL_METADATATRAVERSALMODE_NODE	((SLuint32) 0x00000002)
+
+
+#define SL_NODETYPE_UNSPECIFIED	((SLuint32) 0x00000001)
+#define SL_NODETYPE_AUDIO		((SLuint32) 0x00000002)
+#define SL_NODETYPE_VIDEO		((SLuint32) 0x00000003)
+#define SL_NODETYPE_IMAGE		((SLuint32) 0x00000004)
+
+#define SL_NODE_PARENT 0xFFFFFFFF
+
+extern SLAPIENTRY const SLInterfaceID SL_IID_METADATATRAVERSAL;
+
+struct SLMetadataTraversalItf_;
+typedef const struct SLMetadataTraversalItf_ * const * SLMetadataTraversalItf;
+
+struct SLMetadataTraversalItf_ {
+	SLresult (*SetMode) (
+		SLMetadataTraversalItf self,
+		SLuint32 mode
+	);
+	SLresult (*GetChildCount) (
+		SLMetadataTraversalItf self,
+		SLuint32 *pCount
+	);
+	SLresult (*GetChildMIMETypeSize) (
+		SLMetadataTraversalItf self,
+		SLuint32 index,
+		SLuint32 *pSize
+	);
+	SLresult (*GetChildInfo) (
+		SLMetadataTraversalItf self,
+		SLuint32 index,
+		SLint32 *pNodeID,
+		SLuint32 *pType,
+		SLuint32 size,
+		SLchar *pMimeType
+	);
+	SLresult (*SetActiveNode) (
+		SLMetadataTraversalItf self,
+		SLuint32 index
+	);
+};
+
+/*---------------------------------------------------------------------------*/
+/* Dynamic Source types and interface                                        */
+/*---------------------------------------------------------------------------*/
+
+extern SLAPIENTRY const SLInterfaceID SL_IID_DYNAMICSOURCE;
+
+struct SLDynamicSourceItf_;
+typedef const struct SLDynamicSourceItf_ * const * SLDynamicSourceItf;
+
+struct SLDynamicSourceItf_ {
+	SLresult (*SetSource) (
+		SLDynamicSourceItf self,
+		SLDataSource *pDataSource
+	);
+};
+
+/*---------------------------------------------------------------------------*/
+/* Output Mix interface                                                      */
+/*---------------------------------------------------------------------------*/
+
+extern SLAPIENTRY const SLInterfaceID SL_IID_OUTPUTMIX;
+
+struct SLOutputMixItf_;
+typedef const struct SLOutputMixItf_ * const * SLOutputMixItf;
+
+typedef void (/*SLAPIENTRY*/ *slMixDeviceChangeCallback) (
+	SLOutputMixItf caller,
+    void *pContext
+);
+
+
+struct SLOutputMixItf_ {
+	SLresult (*GetDestinationOutputDeviceIDs) (
+		SLOutputMixItf self,
+		SLint32 *pNumDevices,
+		SLuint32 *pDeviceIDs
+	);
+	SLresult (*RegisterDeviceChangeCallback) (
+		SLOutputMixItf self,
+		slMixDeviceChangeCallback callback,
+		void *pContext
+    );
+    SLresult (*ReRoute)(
+        SLOutputMixItf self,
+        SLint32 numOutputDevices,
+        SLuint32 *pOutputDeviceIDs
+    );
+};
+
+
+/*---------------------------------------------------------------------------*/
+/* Playback interface                                                        */
+/*---------------------------------------------------------------------------*/
+
+/** Playback states */
+#define SL_PLAYSTATE_STOPPED	((SLuint32) 0x00000001)
+#define SL_PLAYSTATE_PAUSED	((SLuint32) 0x00000002)
+#define SL_PLAYSTATE_PLAYING	((SLuint32) 0x00000003)
+
+/** Play events **/
+#define SL_PLAYEVENT_HEADATEND		((SLuint32) 0x00000001)
+#define SL_PLAYEVENT_HEADATMARKER	((SLuint32) 0x00000002)
+#define SL_PLAYEVENT_HEADATNEWPOS	((SLuint32) 0x00000004)
+#define SL_PLAYEVENT_HEADMOVING		((SLuint32) 0x00000008)
+#define SL_PLAYEVENT_HEADSTALLED	((SLuint32) 0x00000010)
+
+#define SL_TIME_UNKNOWN	((SLuint32) 0xFFFFFFFF)
+
+
+extern SLAPIENTRY const SLInterfaceID SL_IID_PLAY;
+
+/** Playback interface methods */
+
+struct SLPlayItf_;
+typedef const struct SLPlayItf_ * const * SLPlayItf;
+
+typedef void (/*SLAPIENTRY*/ *slPlayCallback) (
+	SLPlayItf caller,
+	void *pContext,
+	SLuint32 event
+);
+
+struct SLPlayItf_ {
+	SLresult (*SetPlayState) (
+		SLPlayItf self,
+		SLuint32 state
+	);
+	SLresult (*GetPlayState) (
+		SLPlayItf self,
+		SLuint32 *pState
+	);
+	SLresult (*GetDuration) (
+		SLPlayItf self,
+		SLmillisecond *pMsec
+	);
+	SLresult (*GetPosition) (
+		SLPlayItf self,
+		SLmillisecond *pMsec
+	);
+	SLresult (*RegisterCallback) (
+		SLPlayItf self,
+		slPlayCallback callback,
+		void *pContext
+	);
+	SLresult (*SetCallbackEventsMask) (
+		SLPlayItf self,
+		SLuint32 eventFlags
+	);
+	SLresult (*GetCallbackEventsMask) (
+		SLPlayItf self,
+		SLuint32 *pEventFlags
+	);
+	SLresult (*SetMarkerPosition) (
+		SLPlayItf self,
+		SLmillisecond mSec
+	);
+	SLresult (*ClearMarkerPosition) (
+		SLPlayItf self
+	);
+	SLresult (*GetMarkerPosition) (
+		SLPlayItf self,
+		SLmillisecond *pMsec
+	);
+	SLresult (*SetPositionUpdatePeriod) (
+		SLPlayItf self,
+		SLmillisecond mSec
+	);
+	SLresult (*GetPositionUpdatePeriod) (
+		SLPlayItf self,
+		SLmillisecond *pMsec
+	);
+};
+
+/*---------------------------------------------------------------------------*/
+/* Prefetch status interface                                                 */
+/*---------------------------------------------------------------------------*/
+
+#define SL_PREFETCHEVENT_STATUSCHANGE		((SLuint32) 0x00000001)
+#define SL_PREFETCHEVENT_FILLLEVELCHANGE	((SLuint32) 0x00000002)
+
+#define SL_PREFETCHSTATUS_UNDERFLOW		((SLuint32) 0x00000001)
+#define SL_PREFETCHSTATUS_SUFFICIENTDATA	((SLuint32) 0x00000002)
+#define SL_PREFETCHSTATUS_OVERFLOW		((SLuint32) 0x00000003)
+
+
+extern SLAPIENTRY const SLInterfaceID SL_IID_PREFETCHSTATUS;
+
+
+/** Prefetch status interface methods */
+
+struct SLPrefetchStatusItf_;
+typedef const struct SLPrefetchStatusItf_ * const * SLPrefetchStatusItf;
+
+typedef void (/*SLAPIENTRY*/ *slPrefetchCallback) (
+	SLPrefetchStatusItf caller,
+	void *pContext,
+	SLuint32 event
+);
+
+struct SLPrefetchStatusItf_ {
+	SLresult (*GetPrefetchStatus) (
+		SLPrefetchStatusItf self,
+		SLuint32 *pStatus
+	);
+	SLresult (*GetFillLevel) (
+		SLPrefetchStatusItf self,
+		SLpermille *pLevel
+	);
+	SLresult (*RegisterCallback) (
+		SLPrefetchStatusItf self,
+		slPrefetchCallback callback,
+		void *pContext
+	);
+	SLresult (*SetCallbackEventsMask) (
+		SLPrefetchStatusItf self,
+		SLuint32 eventFlags
+	);
+	SLresult (*GetCallbackEventsMask) (
+		SLPrefetchStatusItf self,
+		SLuint32 *pEventFlags
+	);
+	SLresult (*SetFillUpdatePeriod) (
+		SLPrefetchStatusItf self,
+		SLpermille period
+	);
+	SLresult (*GetFillUpdatePeriod) (
+		SLPrefetchStatusItf self,
+		SLpermille *pPeriod
+	);
+};
+
+/*---------------------------------------------------------------------------*/
+/* Playback Rate interface                                                   */
+/*---------------------------------------------------------------------------*/
+
+#define SL_RATEPROP_RESERVED1		  		((SLuint32) 0x00000001)
+#define SL_RATEPROP_RESERVED2		  		((SLuint32) 0x00000002)
+#define SL_RATEPROP_SILENTAUDIO				((SLuint32) 0x00000100)
+#define SL_RATEPROP_STAGGEREDAUDIO	((SLuint32) 0x00000200)
+#define SL_RATEPROP_NOPITCHCORAUDIO	((SLuint32) 0x00000400)
+#define SL_RATEPROP_PITCHCORAUDIO	((SLuint32) 0x00000800)
+
+
+extern SLAPIENTRY const SLInterfaceID SL_IID_PLAYBACKRATE;
+
+struct SLPlaybackRateItf_;
+typedef const struct SLPlaybackRateItf_ * const * SLPlaybackRateItf;
+
+struct SLPlaybackRateItf_ {
+	SLresult (*SetRate)(
+		SLPlaybackRateItf self,
+		SLpermille rate
+	);
+	SLresult (*GetRate)(
+		SLPlaybackRateItf self,
+		SLpermille *pRate
+	);
+	SLresult (*SetPropertyConstraints)(
+		SLPlaybackRateItf self,
+		SLuint32 constraints
+	);
+	SLresult (*GetProperties)(
+		SLPlaybackRateItf self,
+		SLuint32 *pProperties
+	);
+	SLresult (*GetCapabilitiesOfRate)(
+		SLPlaybackRateItf self,
+		SLpermille rate,
+		SLuint32 *pCapabilities
+	);
+	SLresult (*GetRateRange) (
+		SLPlaybackRateItf self,
+		SLuint8 index,
+		SLpermille *pMinRate,
+		SLpermille *pMaxRate,
+		SLpermille *pStepSize,
+		SLuint32 *pCapabilities
+	);
+};
+
+/*---------------------------------------------------------------------------*/
+/* Seek Interface                                                            */
+/*---------------------------------------------------------------------------*/
+
+#define SL_SEEKMODE_FAST		((SLuint32) 0x0001)
+#define SL_SEEKMODE_ACCURATE	((SLuint32) 0x0002)
+
+extern SLAPIENTRY const SLInterfaceID SL_IID_SEEK;
+
+struct SLSeekItf_;
+typedef const struct SLSeekItf_ * const * SLSeekItf;
+
+struct SLSeekItf_ {
+	SLresult (*SetPosition)(
+		SLSeekItf self,
+		SLmillisecond pos,
+		SLuint32 seekMode
+	);
+	SLresult (*SetLoop)(
+		SLSeekItf self,
+		SLboolean loopEnable,
+		SLmillisecond startPos,
+		SLmillisecond endPos
+	);
+	SLresult (*GetLoop)(
+		SLSeekItf self,
+		SLboolean *pLoopEnabled,
+		SLmillisecond *pStartPos,
+		SLmillisecond *pEndPos
+	);
+};
+
+/*---------------------------------------------------------------------------*/
+/* Standard Recording Interface                                              */
+/*---------------------------------------------------------------------------*/
+
+/** Recording states */
+#define SL_RECORDSTATE_STOPPED 	((SLuint32) 0x00000001)
+#define SL_RECORDSTATE_PAUSED	((SLuint32) 0x00000002)
+#define SL_RECORDSTATE_RECORDING	((SLuint32) 0x00000003)
+
+
+/** Record event **/
+#define SL_RECORDEVENT_HEADATLIMIT	((SLuint32) 0x00000001)
+#define SL_RECORDEVENT_HEADATMARKER	((SLuint32) 0x00000002)
+#define SL_RECORDEVENT_HEADATNEWPOS	((SLuint32) 0x00000004)
+#define SL_RECORDEVENT_HEADMOVING	((SLuint32) 0x00000008)
+#define SL_RECORDEVENT_HEADSTALLED 	((SLuint32) 0x00000010)
+/* Note: SL_RECORDEVENT_BUFFER_INSUFFICIENT is deprecated, use SL_RECORDEVENT_BUFFER_FULL instead. */
+#define SL_RECORDEVENT_BUFFER_INSUFFICIENT      ((SLuint32) 0x00000020)
+#define SL_RECORDEVENT_BUFFER_FULL	((SLuint32) 0x00000020)
+
+
+extern SLAPIENTRY const SLInterfaceID SL_IID_RECORD;
+
+struct SLRecordItf_;
+typedef const struct SLRecordItf_ * const * SLRecordItf;
+
+typedef void (/*SLAPIENTRY*/ *slRecordCallback) (
+	SLRecordItf caller,
+	void *pContext,
+	SLuint32 event
+);
+
+/** Recording interface methods */
+struct SLRecordItf_ {
+	SLresult (*SetRecordState) (
+		SLRecordItf self,
+		SLuint32 state
+	);
+	SLresult (*GetRecordState) (
+		SLRecordItf self,
+		SLuint32 *pState
+	);
+	SLresult (*SetDurationLimit) (
+		SLRecordItf self,
+		SLmillisecond msec
+	);
+	SLresult (*GetPosition) (
+		SLRecordItf self,
+		SLmillisecond *pMsec
+	);
+	SLresult (*RegisterCallback) (
+		SLRecordItf self,
+		slRecordCallback callback,
+		void *pContext
+	);
+	SLresult (*SetCallbackEventsMask) (
+		SLRecordItf self,
+		SLuint32 eventFlags
+	);
+	SLresult (*GetCallbackEventsMask) (
+		SLRecordItf self,
+		SLuint32 *pEventFlags
+	);
+	SLresult (*SetMarkerPosition) (
+		SLRecordItf self,
+		SLmillisecond mSec
+	);
+	SLresult (*ClearMarkerPosition) (
+		SLRecordItf self
+	);
+	SLresult (*GetMarkerPosition) (
+		SLRecordItf self,
+		SLmillisecond *pMsec
+	);
+	SLresult (*SetPositionUpdatePeriod) (
+		SLRecordItf self,
+		SLmillisecond mSec
+	);
+	SLresult (*GetPositionUpdatePeriod) (
+		SLRecordItf self,
+		SLmillisecond *pMsec
+	);
+};
+
+/*---------------------------------------------------------------------------*/
+/* Equalizer interface                                                       */
+/*---------------------------------------------------------------------------*/
+
+#define SL_EQUALIZER_UNDEFINED				((SLuint16) 0xFFFF)
+
+extern SLAPIENTRY const SLInterfaceID SL_IID_EQUALIZER;
+
+struct SLEqualizerItf_;
+typedef const struct SLEqualizerItf_ * const * SLEqualizerItf;
+
+struct SLEqualizerItf_ {
+	SLresult (*SetEnabled)(
+		SLEqualizerItf self,
+		SLboolean enabled
+	);
+	SLresult (*IsEnabled)(
+		SLEqualizerItf self,
+		SLboolean *pEnabled
+	);
+	SLresult (*GetNumberOfBands)(
+		SLEqualizerItf self,
+		SLuint16 *pAmount
+	);
+	SLresult (*GetBandLevelRange)(
+		SLEqualizerItf self,
+		SLmillibel *pMin,
+		SLmillibel *pMax
+	);
+	SLresult (*SetBandLevel)(
+		SLEqualizerItf self,
+		SLuint16 band,
+		SLmillibel level
+	);
+	SLresult (*GetBandLevel)(
+		SLEqualizerItf self,
+		SLuint16 band,
+		SLmillibel *pLevel
+	);
+	SLresult (*GetCenterFreq)(
+		SLEqualizerItf self,
+		SLuint16 band,
+		SLmilliHertz *pCenter
+	);
+	SLresult (*GetBandFreqRange)(
+		SLEqualizerItf self,
+		SLuint16 band,
+		SLmilliHertz *pMin,
+		SLmilliHertz *pMax
+	);
+	SLresult (*GetBand)(
+		SLEqualizerItf self,
+		SLmilliHertz frequency,
+		SLuint16 *pBand
+	);
+	SLresult (*GetCurrentPreset)(
+		SLEqualizerItf self,
+		SLuint16 *pPreset
+	);
+	SLresult (*UsePreset)(
+		SLEqualizerItf self,
+		SLuint16 index
+	);
+	SLresult (*GetNumberOfPresets)(
+		SLEqualizerItf self,
+		SLuint16 *pNumPresets
+	);
+	SLresult (*GetPresetName)(
+		SLEqualizerItf self,
+		SLuint16 index,
+		const SLchar ** ppName
+	);
+};
+
+/*---------------------------------------------------------------------------*/
+/* Volume Interface                                                           */
+/* --------------------------------------------------------------------------*/
+
+extern SLAPIENTRY const SLInterfaceID SL_IID_VOLUME;
+
+struct SLVolumeItf_;
+typedef const struct SLVolumeItf_ * const * SLVolumeItf;
+
+struct SLVolumeItf_ {
+	SLresult (*SetVolumeLevel) (
+		SLVolumeItf self,
+		SLmillibel level
+	);
+	SLresult (*GetVolumeLevel) (
+		SLVolumeItf self,
+		SLmillibel *pLevel
+	);
+	SLresult (*GetMaxVolumeLevel) (
+		SLVolumeItf  self,
+		SLmillibel *pMaxLevel
+	);
+	SLresult (*SetMute) (
+		SLVolumeItf self,
+		SLboolean mute
+	);
+	SLresult (*GetMute) (
+		SLVolumeItf self,
+		SLboolean *pMute
+	);
+	SLresult (*EnableStereoPosition) (
+		SLVolumeItf self,
+		SLboolean enable
+	);
+	SLresult (*IsEnabledStereoPosition) (
+		SLVolumeItf self,
+		SLboolean *pEnable
+	);
+	SLresult (*SetStereoPosition) (
+		SLVolumeItf self,
+		SLpermille stereoPosition
+	);
+	SLresult (*GetStereoPosition) (
+		SLVolumeItf self,
+		SLpermille *pStereoPosition
+	);
+};
+
+
+/*---------------------------------------------------------------------------*/
+/* Device Volume Interface                                                   */
+/* --------------------------------------------------------------------------*/
+
+extern SLAPIENTRY const SLInterfaceID SL_IID_DEVICEVOLUME;
+
+struct SLDeviceVolumeItf_;
+typedef const struct SLDeviceVolumeItf_ * const * SLDeviceVolumeItf;
+
+struct SLDeviceVolumeItf_ {
+	SLresult (*GetVolumeScale) (
+		SLDeviceVolumeItf self,
+		SLuint32 deviceID,
+		SLint32 *pMinValue,
+		SLint32 *pMaxValue,
+		SLboolean *pIsMillibelScale
+	);
+	SLresult (*SetVolume) (
+		SLDeviceVolumeItf self,
+		SLuint32 deviceID,
+		SLint32 volume
+	);
+	SLresult (*GetVolume) (
+		SLDeviceVolumeItf self,
+		SLuint32 deviceID,
+		SLint32 *pVolume
+	);
+};
+
+
+/*---------------------------------------------------------------------------*/
+/* Buffer Queue Interface                                                    */
+/*---------------------------------------------------------------------------*/
+
+extern SLAPIENTRY const SLInterfaceID SL_IID_BUFFERQUEUE;
+
+struct SLBufferQueueItf_;
+typedef const struct SLBufferQueueItf_ * const * SLBufferQueueItf;
+
+typedef void (/*SLAPIENTRY*/ *slBufferQueueCallback)(
+	SLBufferQueueItf caller,
+	void *pContext
+);
+
+/** Buffer queue state **/
+
+typedef struct SLBufferQueueState_ {
+	SLuint32	count;
+	SLuint32	playIndex;
+} SLBufferQueueState;
+
+
+struct SLBufferQueueItf_ {
+	SLresult (*Enqueue) (
+		SLBufferQueueItf self,
+		const void *pBuffer,
+		SLuint32 size
+	);
+	SLresult (*Clear) (
+		SLBufferQueueItf self
+	);
+	SLresult (*GetState) (
+		SLBufferQueueItf self,
+		SLBufferQueueState *pState
+	);
+	SLresult (*RegisterCallback) (
+		SLBufferQueueItf self,
+		slBufferQueueCallback callback,
+		void* pContext
+	);
+};
+
+
+/*---------------------------------------------------------------------------*/
+/* PresetReverb                                                              */
+/*---------------------------------------------------------------------------*/
+
+#define SL_REVERBPRESET_NONE		((SLuint16) 0x0000)
+#define SL_REVERBPRESET_SMALLROOM	((SLuint16) 0x0001)
+#define SL_REVERBPRESET_MEDIUMROOM	((SLuint16) 0x0002)
+#define SL_REVERBPRESET_LARGEROOM	((SLuint16) 0x0003)
+#define SL_REVERBPRESET_MEDIUMHALL	((SLuint16) 0x0004)
+#define SL_REVERBPRESET_LARGEHALL	((SLuint16) 0x0005)
+#define SL_REVERBPRESET_PLATE 		((SLuint16) 0x0006)
+
+
+extern SLAPIENTRY const SLInterfaceID SL_IID_PRESETREVERB;
+
+struct SLPresetReverbItf_;
+typedef const struct SLPresetReverbItf_ * const * SLPresetReverbItf;
+
+struct SLPresetReverbItf_ {
+	SLresult (*SetPreset) (
+		SLPresetReverbItf self,
+		SLuint16 preset
+	);
+	SLresult (*GetPreset) (
+		SLPresetReverbItf self,
+		SLuint16 *pPreset
+	);
+};
+
+
+/*---------------------------------------------------------------------------*/
+/* EnvironmentalReverb                                                       */
+/*---------------------------------------------------------------------------*/
+
+#define SL_I3DL2_ENVIRONMENT_PRESET_DEFAULT \
+	{ SL_MILLIBEL_MIN,    0,  1000,   500, SL_MILLIBEL_MIN,  20, SL_MILLIBEL_MIN,  40, 1000,1000 }
+#define SL_I3DL2_ENVIRONMENT_PRESET_GENERIC \
+	{ -1000, -100, 1490,  830, -2602,   7,   200,  11, 1000,1000 }
+#define SL_I3DL2_ENVIRONMENT_PRESET_PADDEDCELL \
+	{ -1000,-6000,  170,  100, -1204,   1,   207,   2, 1000,1000 }
+#define SL_I3DL2_ENVIRONMENT_PRESET_ROOM \
+	{ -1000, -454,  400,  830, -1646,   2,    53,   3, 1000,1000 }
+#define SL_I3DL2_ENVIRONMENT_PRESET_BATHROOM \
+	{ -1000,-1200, 1490,  540,  -370,   7,  1030,  11, 1000, 600 }
+#define SL_I3DL2_ENVIRONMENT_PRESET_LIVINGROOM \
+	{ -1000,-6000,  500,  100, -1376,   3, -1104,   4, 1000,1000 }
+#define SL_I3DL2_ENVIRONMENT_PRESET_STONEROOM \
+	{ -1000, -300, 2310,  640,  -711,  12,    83,  17, 1000,1000 }
+#define SL_I3DL2_ENVIRONMENT_PRESET_AUDITORIUM \
+	{ -1000, -476, 4320,  590,  -789,  20,  -289,  30, 1000,1000 }
+#define SL_I3DL2_ENVIRONMENT_PRESET_CONCERTHALL \
+	{ -1000, -500, 3920,  700, -1230,  20,    -2,  29, 1000,1000 }
+#define SL_I3DL2_ENVIRONMENT_PRESET_CAVE \
+	{ -1000,    0, 2910, 1300,  -602,  15,  -302,  22, 1000,1000 }
+#define SL_I3DL2_ENVIRONMENT_PRESET_ARENA \
+	{ -1000, -698, 7240,  330, -1166,  20,    16,  30, 1000,1000 }
+#define SL_I3DL2_ENVIRONMENT_PRESET_HANGAR \
+	{ -1000,-1000, 10050,  230,  -602,  20,   198,  30, 1000,1000 }
+#define SL_I3DL2_ENVIRONMENT_PRESET_CARPETEDHALLWAY \
+	{ -1000,-4000,  300,  100, -1831,   2, -1630,  30, 1000,1000 }
+#define SL_I3DL2_ENVIRONMENT_PRESET_HALLWAY \
+	{ -1000, -300, 1490,  590, -1219,   7,   441,  11, 1000,1000 }
+#define SL_I3DL2_ENVIRONMENT_PRESET_STONECORRIDOR \
+	{ -1000, -237, 2700,  790, -1214,  13,   395,  20, 1000,1000 }
+#define SL_I3DL2_ENVIRONMENT_PRESET_ALLEY \
+	{ -1000, -270, 1490,  860, -1204,   7,    -4,  11, 1000,1000 }
+#define SL_I3DL2_ENVIRONMENT_PRESET_FOREST \
+	{ -1000,-3300, 1490,  540, -2560, 162,  -613,  88,  790,1000 }
+#define SL_I3DL2_ENVIRONMENT_PRESET_CITY \
+	{ -1000, -800, 1490,  670, -2273,   7, -2217,  11,  500,1000 }
+#define SL_I3DL2_ENVIRONMENT_PRESET_MOUNTAINS \
+	{ -1000,-2500, 1490,  210, -2780, 300, -2014, 100,  270,1000 }
+#define SL_I3DL2_ENVIRONMENT_PRESET_QUARRY \
+	{ -1000,-1000, 1490,  830, SL_MILLIBEL_MIN,  61,   500,  25, 1000,1000 }
+#define SL_I3DL2_ENVIRONMENT_PRESET_PLAIN \
+	{ -1000,-2000, 1490,  500, -2466, 179, -2514, 100,  210,1000 }
+#define SL_I3DL2_ENVIRONMENT_PRESET_PARKINGLOT \
+	{ -1000,    0, 1650, 1500, -1363,   8, -1153,  12, 1000,1000 }
+#define SL_I3DL2_ENVIRONMENT_PRESET_SEWERPIPE \
+	{ -1000,-1000, 2810,  140,   429,  14,   648,  21,  800, 600 }
+#define SL_I3DL2_ENVIRONMENT_PRESET_UNDERWATER \
+	{ -1000,-4000, 1490,  100,  -449,   7,  1700,  11, 1000,1000 }
+#define SL_I3DL2_ENVIRONMENT_PRESET_SMALLROOM \
+	{ -1000,-600, 1100, 830, -400, 5, 500, 10, 1000, 1000 }
+#define SL_I3DL2_ENVIRONMENT_PRESET_MEDIUMROOM \
+	{ -1000,-600, 1300, 830, -1000, 20, -200, 20, 1000, 1000 }
+#define SL_I3DL2_ENVIRONMENT_PRESET_LARGEROOM \
+	{ -1000,-600, 1500, 830, -1600, 5, -1000, 40, 1000, 1000 }
+#define SL_I3DL2_ENVIRONMENT_PRESET_MEDIUMHALL \
+	{ -1000,-600, 1800, 700, -1300, 15, -800, 30, 1000, 1000 }
+#define SL_I3DL2_ENVIRONMENT_PRESET_LARGEHALL \
+	{ -1000,-600, 1800, 700, -2000, 30, -1400, 60, 1000, 1000 }
+#define SL_I3DL2_ENVIRONMENT_PRESET_PLATE \
+	{ -1000,-200, 1300, 900, 0, 2, 0, 10, 1000, 750 }
+
+
+typedef struct SLEnvironmentalReverbSettings_ {
+	SLmillibel    roomLevel;
+	SLmillibel    roomHFLevel;
+	SLmillisecond decayTime;
+	SLpermille    decayHFRatio;
+	SLmillibel    reflectionsLevel;
+	SLmillisecond reflectionsDelay;
+	SLmillibel    reverbLevel;
+	SLmillisecond reverbDelay;
+	SLpermille    diffusion;
+	SLpermille    density;
+} SLEnvironmentalReverbSettings;
+
+
+
+
+extern SLAPIENTRY const SLInterfaceID SL_IID_ENVIRONMENTALREVERB;
+
+
+struct SLEnvironmentalReverbItf_;
+typedef const struct SLEnvironmentalReverbItf_ * const * SLEnvironmentalReverbItf;
+
+struct SLEnvironmentalReverbItf_ {
+	SLresult (*SetRoomLevel) (
+		SLEnvironmentalReverbItf self,
+		SLmillibel room
+	);
+	SLresult (*GetRoomLevel) (
+		SLEnvironmentalReverbItf self,
+		SLmillibel *pRoom
+	);
+	SLresult (*SetRoomHFLevel) (
+		SLEnvironmentalReverbItf self,
+		SLmillibel roomHF
+	);
+	SLresult (*GetRoomHFLevel) (
+		SLEnvironmentalReverbItf self,
+		SLmillibel *pRoomHF
+	);
+	SLresult (*SetDecayTime) (
+		SLEnvironmentalReverbItf self,
+		SLmillisecond decayTime
+	);
+	SLresult (*GetDecayTime) (
+		SLEnvironmentalReverbItf self,
+		SLmillisecond *pDecayTime
+	);
+	SLresult (*SetDecayHFRatio) (
+		SLEnvironmentalReverbItf self,
+		SLpermille decayHFRatio
+	);
+	SLresult (*GetDecayHFRatio) (
+		SLEnvironmentalReverbItf self,
+		SLpermille *pDecayHFRatio
+	);
+	SLresult (*SetReflectionsLevel) (
+		SLEnvironmentalReverbItf self,
+		SLmillibel reflectionsLevel
+	);
+	SLresult (*GetReflectionsLevel) (
+		SLEnvironmentalReverbItf self,
+		SLmillibel *pReflectionsLevel
+	);
+	SLresult (*SetReflectionsDelay) (
+		SLEnvironmentalReverbItf self,
+		SLmillisecond reflectionsDelay
+	);
+	SLresult (*GetReflectionsDelay) (
+		SLEnvironmentalReverbItf self,
+		SLmillisecond *pReflectionsDelay
+	);
+	SLresult (*SetReverbLevel) (
+		SLEnvironmentalReverbItf self,
+		SLmillibel reverbLevel
+	);
+	SLresult (*GetReverbLevel) (
+		SLEnvironmentalReverbItf self,
+		SLmillibel *pReverbLevel
+	);
+	SLresult (*SetReverbDelay) (
+		SLEnvironmentalReverbItf self,
+		SLmillisecond reverbDelay
+	);
+	SLresult (*GetReverbDelay) (
+		SLEnvironmentalReverbItf self,
+		SLmillisecond *pReverbDelay
+	);
+	SLresult (*SetDiffusion) (
+		SLEnvironmentalReverbItf self,
+		SLpermille diffusion
+	);
+	SLresult (*GetDiffusion) (
+		SLEnvironmentalReverbItf self,
+		SLpermille *pDiffusion
+	);
+	SLresult (*SetDensity) (
+		SLEnvironmentalReverbItf self,
+		SLpermille density
+	);
+	SLresult (*GetDensity) (
+		SLEnvironmentalReverbItf self,
+		SLpermille *pDensity
+	);
+	SLresult (*SetEnvironmentalReverbProperties) (
+		SLEnvironmentalReverbItf self,
+		const SLEnvironmentalReverbSettings *pProperties
+	);
+	SLresult (*GetEnvironmentalReverbProperties) (
+		SLEnvironmentalReverbItf self,
+		SLEnvironmentalReverbSettings *pProperties
+	);
+};
+
+/*---------------------------------------------------------------------------*/
+/* Effects Send Interface                                                    */
+/*---------------------------------------------------------------------------*/
+
+
+extern SLAPIENTRY const SLInterfaceID SL_IID_EFFECTSEND;
+
+struct SLEffectSendItf_;
+typedef const struct SLEffectSendItf_ * const * SLEffectSendItf;
+
+struct SLEffectSendItf_ {
+	SLresult (*EnableEffectSend) (
+		SLEffectSendItf self,
+		const void *pAuxEffect,
+		SLboolean enable,
+		SLmillibel initialLevel
+	);
+	SLresult (*IsEnabled) (
+		SLEffectSendItf self,
+		const void * pAuxEffect,
+		SLboolean *pEnable
+	);
+	SLresult (*SetDirectLevel) (
+		SLEffectSendItf self,
+		SLmillibel directLevel
+	);
+	SLresult (*GetDirectLevel) (
+		SLEffectSendItf self,
+		SLmillibel *pDirectLevel
+	);
+	SLresult (*SetSendLevel) (
+		SLEffectSendItf self,
+		const void *pAuxEffect,
+		SLmillibel sendLevel
+	);
+	SLresult (*GetSendLevel)(
+		SLEffectSendItf self,
+		const void *pAuxEffect,
+		SLmillibel *pSendLevel
+	);
+};
+
+
+/*---------------------------------------------------------------------------*/
+/* 3D Grouping Interface                                                     */
+/*---------------------------------------------------------------------------*/
+
+
+extern SLAPIENTRY const SLInterfaceID SL_IID_3DGROUPING;
+
+
+struct SL3DGroupingItf_ ;
+typedef const struct SL3DGroupingItf_ * const * SL3DGroupingItf;
+
+struct SL3DGroupingItf_ {
+	SLresult (*Set3DGroup) (
+		SL3DGroupingItf self,
+		SLObjectItf group
+	);
+	SLresult (*Get3DGroup) (
+		SL3DGroupingItf self,
+		SLObjectItf *pGroup
+	);
+};
+
+
+/*---------------------------------------------------------------------------*/
+/* 3D Commit Interface                                                       */
+/*---------------------------------------------------------------------------*/
+
+
+extern SLAPIENTRY const SLInterfaceID SL_IID_3DCOMMIT;
+
+struct SL3DCommitItf_;
+typedef const struct SL3DCommitItf_* const * SL3DCommitItf;
+
+struct SL3DCommitItf_ {
+	SLresult (*Commit) (
+		SL3DCommitItf self
+	);
+	SLresult (*SetDeferred) (
+		SL3DCommitItf self,
+		SLboolean deferred
+	);
+};
+
+
+/*---------------------------------------------------------------------------*/
+/* 3D Location Interface                                                     */
+/*---------------------------------------------------------------------------*/
+
+typedef struct SLVec3D_ {
+	SLint32	x;
+	SLint32	y;
+	SLint32	z;
+} SLVec3D;
+
+extern SLAPIENTRY const SLInterfaceID SL_IID_3DLOCATION;
+
+struct SL3DLocationItf_;
+typedef const struct SL3DLocationItf_ * const * SL3DLocationItf;
+
+struct SL3DLocationItf_ {
+	SLresult (*SetLocationCartesian) (
+		SL3DLocationItf self,
+		const SLVec3D *pLocation
+	);
+	SLresult (*SetLocationSpherical) (
+		SL3DLocationItf self,
+		SLmillidegree azimuth,
+		SLmillidegree elevation,
+		SLmillimeter distance
+	);
+	SLresult (*Move) (
+		SL3DLocationItf self,
+		const SLVec3D *pMovement
+	);
+	SLresult (*GetLocationCartesian) (
+		SL3DLocationItf self,
+		SLVec3D *pLocation
+	);
+	SLresult (*SetOrientationVectors) (
+		SL3DLocationItf self,
+		const SLVec3D *pFront,
+		const SLVec3D *pAbove
+	);
+	SLresult (*SetOrientationAngles) (
+		SL3DLocationItf self,
+		SLmillidegree heading,
+		SLmillidegree pitch,
+		SLmillidegree roll
+	);
+	SLresult (*Rotate) (
+		SL3DLocationItf self,
+		SLmillidegree theta,
+		const SLVec3D *pAxis
+	);
+	SLresult (*GetOrientationVectors) (
+		SL3DLocationItf self,
+		SLVec3D *pFront,
+		SLVec3D *pUp
+	);
+};
+
+
+/*---------------------------------------------------------------------------*/
+/* 3D Doppler Interface                                                      */
+/*---------------------------------------------------------------------------*/
+
+
+extern SLAPIENTRY const SLInterfaceID SL_IID_3DDOPPLER;
+
+struct SL3DDopplerItf_;
+typedef const struct SL3DDopplerItf_ * const * SL3DDopplerItf;
+
+struct SL3DDopplerItf_ {
+	SLresult (*SetVelocityCartesian) (
+		SL3DDopplerItf self,
+		const SLVec3D *pVelocity
+	);
+	SLresult (*SetVelocitySpherical) (
+		SL3DDopplerItf self,
+		SLmillidegree azimuth,
+		SLmillidegree elevation,
+		SLmillimeter speed
+	);
+	SLresult (*GetVelocityCartesian) (
+		SL3DDopplerItf self,
+		SLVec3D *pVelocity
+	);
+	SLresult (*SetDopplerFactor) (
+		SL3DDopplerItf self,
+		SLpermille dopplerFactor
+	);
+	SLresult (*GetDopplerFactor) (
+		SL3DDopplerItf self,
+		SLpermille *pDopplerFactor
+	);
+};
+
+/*---------------------------------------------------------------------------*/
+/* 3D Source Interface and associated defines                                */
+/* --------------------------------------------------------------------------*/
+
+#define SL_ROLLOFFMODEL_EXPONENTIAL	((SLuint32) 0x00000000)
+#define SL_ROLLOFFMODEL_LINEAR		((SLuint32) 0x00000001)
+
+
+extern SLAPIENTRY const SLInterfaceID SL_IID_3DSOURCE;
+
+struct SL3DSourceItf_;
+typedef const struct SL3DSourceItf_ * const * SL3DSourceItf;
+
+struct SL3DSourceItf_ {
+	SLresult (*SetHeadRelative) (
+		SL3DSourceItf self,
+		SLboolean headRelative
+	);
+	SLresult (*GetHeadRelative) (
+		SL3DSourceItf self,
+		SLboolean *pHeadRelative
+	);
+	SLresult (*SetRolloffDistances) (
+		SL3DSourceItf self,
+		SLmillimeter minDistance,
+		SLmillimeter maxDistance
+	);
+	SLresult (*GetRolloffDistances) (
+		SL3DSourceItf self,
+		SLmillimeter *pMinDistance,
+		SLmillimeter *pMaxDistance
+	);
+	SLresult (*SetRolloffMaxDistanceMute) (
+		SL3DSourceItf self,
+		SLboolean mute
+	);
+	SLresult (*GetRolloffMaxDistanceMute) (
+		SL3DSourceItf self,
+		SLboolean *pMute
+	);
+	SLresult (*SetRolloffFactor) (
+		SL3DSourceItf self,
+		SLpermille rolloffFactor
+	);
+	SLresult (*GetRolloffFactor) (
+		SL3DSourceItf self,
+		SLpermille *pRolloffFactor
+	);
+	SLresult (*SetRoomRolloffFactor) (
+		SL3DSourceItf self,
+		SLpermille roomRolloffFactor
+	);
+	SLresult (*GetRoomRolloffFactor) (
+		SL3DSourceItf self,
+		SLpermille *pRoomRolloffFactor
+	);
+	SLresult (*SetRolloffModel) (
+		SL3DSourceItf self,
+		SLuint8 model
+	);
+	SLresult (*GetRolloffModel) (
+		SL3DSourceItf self,
+		SLuint8 *pModel
+	);
+	SLresult (*SetCone) (
+		SL3DSourceItf self,
+		SLmillidegree innerAngle,
+		SLmillidegree outerAngle,
+		SLmillibel outerLevel
+	);
+	SLresult (*GetCone) (
+		SL3DSourceItf self,
+		SLmillidegree *pInnerAngle,
+		SLmillidegree *pOuterAngle,
+		SLmillibel *pOuterLevel
+	);
+};
+
+/*---------------------------------------------------------------------------*/
+/* 3D Macroscopic Interface                                                  */
+/* --------------------------------------------------------------------------*/
+
+extern SLAPIENTRY const SLInterfaceID SL_IID_3DMACROSCOPIC;
+
+struct SL3DMacroscopicItf_;
+typedef const struct SL3DMacroscopicItf_ * const * SL3DMacroscopicItf;
+
+struct SL3DMacroscopicItf_ {
+	SLresult (*SetSize) (
+		SL3DMacroscopicItf self,
+		SLmillimeter width,
+		SLmillimeter height,
+		SLmillimeter depth
+	);
+	SLresult (*GetSize) (
+		SL3DMacroscopicItf self,
+		SLmillimeter *pWidth,
+		SLmillimeter *pHeight,
+		SLmillimeter *pDepth
+	);
+	SLresult (*SetOrientationAngles) (
+		SL3DMacroscopicItf self,
+		SLmillidegree heading,
+		SLmillidegree pitch,
+		SLmillidegree roll
+	);
+	SLresult (*SetOrientationVectors) (
+		SL3DMacroscopicItf self,
+		const SLVec3D *pFront,
+		const SLVec3D *pAbove
+	);
+	SLresult (*Rotate) (
+		SL3DMacroscopicItf self,
+		SLmillidegree theta,
+		const SLVec3D *pAxis
+	);
+	SLresult (*GetOrientationVectors) (
+		SL3DMacroscopicItf self,
+		SLVec3D *pFront,
+		SLVec3D *pUp
+	);
+};
+
+/*---------------------------------------------------------------------------*/
+/* Mute Solo Interface                                                       */
+/* --------------------------------------------------------------------------*/
+
+
+extern SLAPIENTRY const SLInterfaceID SL_IID_MUTESOLO;
+
+struct SLMuteSoloItf_;
+typedef const struct SLMuteSoloItf_ * const * SLMuteSoloItf;
+
+struct SLMuteSoloItf_ {
+	SLresult (*SetChannelMute) (
+		SLMuteSoloItf self,
+		SLuint8 chan,
+		SLboolean mute
+	);
+	SLresult (*GetChannelMute) (
+		SLMuteSoloItf self,
+		SLuint8 chan,
+		SLboolean *pMute
+	);
+	SLresult (*SetChannelSolo) (
+		SLMuteSoloItf self,
+		SLuint8 chan,
+		SLboolean solo
+	);
+	SLresult (*GetChannelSolo) (
+		SLMuteSoloItf self,
+		SLuint8 chan,
+		SLboolean *pSolo
+	);
+	SLresult (*GetNumChannels) (
+		SLMuteSoloItf self,
+		SLuint8 *pNumChannels
+	);
+};
+
+
+/*---------------------------------------------------------------------------*/
+/* Dynamic Interface Management Interface and associated types and macros    */
+/* --------------------------------------------------------------------------*/
+
+#define SL_DYNAMIC_ITF_EVENT_RUNTIME_ERROR			((SLuint32) 0x00000001)
+#define SL_DYNAMIC_ITF_EVENT_ASYNC_TERMINATION		((SLuint32) 0x00000002)
+#define SL_DYNAMIC_ITF_EVENT_RESOURCES_LOST			((SLuint32) 0x00000003)
+#define SL_DYNAMIC_ITF_EVENT_RESOURCES_LOST_PERMANENTLY	((SLuint32) 0x00000004)
+#define SL_DYNAMIC_ITF_EVENT_RESOURCES_AVAILABLE		((SLuint32) 0x00000005)
+
+
+
+
+extern SLAPIENTRY const SLInterfaceID SL_IID_DYNAMICINTERFACEMANAGEMENT;
+
+struct SLDynamicInterfaceManagementItf_;
+typedef const struct SLDynamicInterfaceManagementItf_ * const * SLDynamicInterfaceManagementItf;
+
+typedef void (/*SLAPIENTRY*/ *slDynamicInterfaceManagementCallback) (
+	SLDynamicInterfaceManagementItf caller,
+	void * pContext,
+	SLuint32 event,
+	SLresult result,
+    const SLInterfaceID iid
+);
+
+
+struct SLDynamicInterfaceManagementItf_ {
+	SLresult (*AddInterface) (
+		SLDynamicInterfaceManagementItf self,
+		const SLInterfaceID iid,
+		SLboolean async
+	);
+	SLresult (*RemoveInterface) (
+		SLDynamicInterfaceManagementItf self,
+		const SLInterfaceID iid
+	);
+	SLresult (*ResumeInterface) (
+		SLDynamicInterfaceManagementItf self,
+		const SLInterfaceID iid,
+		SLboolean async
+	);
+	SLresult (*RegisterCallback) (
+		SLDynamicInterfaceManagementItf self,
+		slDynamicInterfaceManagementCallback callback,
+		void * pContext
+	);
+};
+
+/*---------------------------------------------------------------------------*/
+/* Midi Message Interface and associated types                               */
+/* --------------------------------------------------------------------------*/
+
+#define SL_MIDIMESSAGETYPE_NOTE_ON_OFF		((SLuint32) 0x00000001)
+#define SL_MIDIMESSAGETYPE_POLY_PRESSURE	((SLuint32) 0x00000002)
+#define SL_MIDIMESSAGETYPE_CONTROL_CHANGE	((SLuint32) 0x00000003)
+#define SL_MIDIMESSAGETYPE_PROGRAM_CHANGE	((SLuint32) 0x00000004)
+#define SL_MIDIMESSAGETYPE_CHANNEL_PRESSURE	((SLuint32) 0x00000005)
+#define SL_MIDIMESSAGETYPE_PITCH_BEND		((SLuint32) 0x00000006)
+#define SL_MIDIMESSAGETYPE_SYSTEM_MESSAGE	((SLuint32) 0x00000007)
+
+
+extern SLAPIENTRY const SLInterfaceID SL_IID_MIDIMESSAGE;
+
+struct SLMIDIMessageItf_;
+typedef const struct SLMIDIMessageItf_ * const * SLMIDIMessageItf;
+
+typedef void (/*SLAPIENTRY*/ *slMetaEventCallback) (
+	SLMIDIMessageItf caller,
+	void *pContext,
+	SLuint8 type,
+    SLuint32 length,
+	const SLuint8 *pData,
+	SLuint32 tick,
+	SLuint16 track
+);
+
+typedef void (/*SLAPIENTRY*/ *slMIDIMessageCallback) (
+	SLMIDIMessageItf caller,
+	void *pContext,
+	SLuint8 statusByte,
+	SLuint32 length,
+	const SLuint8 *pData,
+	SLuint32 tick,
+	SLuint16 track
+);
+
+struct SLMIDIMessageItf_ {
+	SLresult (*SendMessage) (
+		SLMIDIMessageItf self,
+		const SLuint8 *data,
+		SLuint32 length
+	);
+	SLresult (*RegisterMetaEventCallback) (
+		SLMIDIMessageItf self,
+		slMetaEventCallback callback,
+		void *pContext
+	);
+	SLresult (*RegisterMIDIMessageCallback) (
+		SLMIDIMessageItf self,
+		slMIDIMessageCallback callback,
+		void *pContext
+	);
+	SLresult (*AddMIDIMessageCallbackFilter) (
+		SLMIDIMessageItf self,
+		SLuint32 messageType
+	);
+	SLresult (*ClearMIDIMessageCallbackFilter) (
+		SLMIDIMessageItf self
+	);
+};
+
+
+/*---------------------------------------------------------------------------*/
+/* Midi Mute Solo interface                                                  */
+/* --------------------------------------------------------------------------*/
+
+
+extern SLAPIENTRY const SLInterfaceID SL_IID_MIDIMUTESOLO;
+
+struct SLMIDIMuteSoloItf_;
+typedef const struct SLMIDIMuteSoloItf_ * const * SLMIDIMuteSoloItf;
+
+struct SLMIDIMuteSoloItf_ {
+	SLresult (*SetChannelMute) (
+		SLMIDIMuteSoloItf self,
+		SLuint8 channel,
+		SLboolean mute
+	);
+	SLresult (*GetChannelMute) (
+		SLMIDIMuteSoloItf self,
+		SLuint8 channel,
+		SLboolean *pMute
+	);
+	SLresult (*SetChannelSolo) (
+		SLMIDIMuteSoloItf self,
+		SLuint8 channel,
+		SLboolean solo
+	);
+	SLresult (*GetChannelSolo) (
+		SLMIDIMuteSoloItf self,
+		SLuint8 channel,
+		SLboolean *pSolo
+	);
+	SLresult (*GetTrackCount) (
+		SLMIDIMuteSoloItf self,
+		SLuint16 *pCount
+	);
+	SLresult (*SetTrackMute) (
+		SLMIDIMuteSoloItf self,
+		SLuint16 track,
+		SLboolean mute
+	);
+	SLresult (*GetTrackMute) (
+		SLMIDIMuteSoloItf self,
+		SLuint16 track,
+		SLboolean *pMute
+	);
+	SLresult (*SetTrackSolo) (
+		SLMIDIMuteSoloItf self,
+		SLuint16 track,
+		SLboolean solo
+	);
+	SLresult (*GetTrackSolo) (
+		SLMIDIMuteSoloItf self,
+		SLuint16 track,
+		SLboolean *pSolo
+	);
+};
+
+
+/*---------------------------------------------------------------------------*/
+/* Midi Tempo interface                                                      */
+/* --------------------------------------------------------------------------*/
+
+
+extern SLAPIENTRY const SLInterfaceID SL_IID_MIDITEMPO;
+
+struct SLMIDITempoItf_;
+typedef const struct SLMIDITempoItf_ * const * SLMIDITempoItf;
+
+struct SLMIDITempoItf_ {
+	SLresult (*SetTicksPerQuarterNote) (
+		SLMIDITempoItf self,
+		SLuint32 tpqn
+	);
+	SLresult (*GetTicksPerQuarterNote) (
+		SLMIDITempoItf self,
+		SLuint32 *pTpqn
+	);
+	SLresult (*SetMicrosecondsPerQuarterNote) (
+		SLMIDITempoItf self,
+		SLmicrosecond uspqn
+	);
+	SLresult (*GetMicrosecondsPerQuarterNote) (
+		SLMIDITempoItf self,
+		SLmicrosecond *uspqn
+	);
+};
+
+
+/*---------------------------------------------------------------------------*/
+/* Midi Time interface                                                       */
+/* --------------------------------------------------------------------------*/
+
+
+extern SLAPIENTRY const SLInterfaceID SL_IID_MIDITIME;
+
+struct SLMIDITimeItf_;
+typedef const struct SLMIDITimeItf_ * const * SLMIDITimeItf;
+
+struct SLMIDITimeItf_ {
+	SLresult (*GetDuration) (
+		SLMIDITimeItf self,
+		SLuint32 *pDuration
+	);
+	SLresult (*SetPosition) (
+		SLMIDITimeItf self,
+		SLuint32 position
+	);
+	SLresult (*GetPosition) (
+		SLMIDITimeItf self,
+		SLuint32 *pPosition
+	);
+	SLresult (*SetLoopPoints) (
+		SLMIDITimeItf self,
+		SLuint32 startTick,
+		SLuint32 numTicks
+	);
+	SLresult (*GetLoopPoints) (
+		SLMIDITimeItf self,
+		SLuint32 *pStartTick,
+		SLuint32 *pNumTicks
+	);
+};
+
+
+/*---------------------------------------------------------------------------*/
+/* Audio Decoder Capabilities Interface                                      */
+/* --------------------------------------------------------------------------*/
+
+/*Audio Codec related defines*/
+
+#define SL_RATECONTROLMODE_CONSTANTBITRATE	((SLuint32) 0x00000001)
+#define SL_RATECONTROLMODE_VARIABLEBITRATE	((SLuint32) 0x00000002)
+
+#define SL_AUDIOCODEC_PCM         ((SLuint32) 0x00000001)
+#define SL_AUDIOCODEC_MP3         ((SLuint32) 0x00000002)
+#define SL_AUDIOCODEC_AMR         ((SLuint32) 0x00000003)
+#define SL_AUDIOCODEC_AMRWB       ((SLuint32) 0x00000004)
+#define SL_AUDIOCODEC_AMRWBPLUS   ((SLuint32) 0x00000005)
+#define SL_AUDIOCODEC_AAC         ((SLuint32) 0x00000006)
+#define SL_AUDIOCODEC_WMA         ((SLuint32) 0x00000007)
+#define SL_AUDIOCODEC_REAL        ((SLuint32) 0x00000008)
+
+#define SL_AUDIOPROFILE_PCM                   ((SLuint32) 0x00000001)
+
+#define SL_AUDIOPROFILE_MPEG1_L3              ((SLuint32) 0x00000001)
+#define SL_AUDIOPROFILE_MPEG2_L3              ((SLuint32) 0x00000002)
+#define SL_AUDIOPROFILE_MPEG25_L3             ((SLuint32) 0x00000003)
+
+#define SL_AUDIOCHANMODE_MP3_MONO             ((SLuint32) 0x00000001)
+#define SL_AUDIOCHANMODE_MP3_STEREO           ((SLuint32) 0x00000002)
+#define SL_AUDIOCHANMODE_MP3_JOINTSTEREO      ((SLuint32) 0x00000003)
+#define SL_AUDIOCHANMODE_MP3_DUAL             ((SLuint32) 0x00000004)
+
+#define SL_AUDIOPROFILE_AMR			((SLuint32) 0x00000001)
+
+#define SL_AUDIOSTREAMFORMAT_CONFORMANCE	((SLuint32) 0x00000001)
+#define SL_AUDIOSTREAMFORMAT_IF1			((SLuint32) 0x00000002)
+#define SL_AUDIOSTREAMFORMAT_IF2			((SLuint32) 0x00000003)
+#define SL_AUDIOSTREAMFORMAT_FSF			((SLuint32) 0x00000004)
+#define SL_AUDIOSTREAMFORMAT_RTPPAYLOAD	((SLuint32) 0x00000005)
+#define SL_AUDIOSTREAMFORMAT_ITU			((SLuint32) 0x00000006)
+
+#define SL_AUDIOPROFILE_AMRWB			((SLuint32) 0x00000001)
+
+#define SL_AUDIOPROFILE_AMRWBPLUS		((SLuint32) 0x00000001)
+
+#define SL_AUDIOPROFILE_AAC_AAC			((SLuint32) 0x00000001)
+
+#define SL_AUDIOMODE_AAC_MAIN			((SLuint32) 0x00000001)
+#define SL_AUDIOMODE_AAC_LC			((SLuint32) 0x00000002)
+#define SL_AUDIOMODE_AAC_SSR			((SLuint32) 0x00000003)
+#define SL_AUDIOMODE_AAC_LTP			((SLuint32) 0x00000004)
+#define SL_AUDIOMODE_AAC_HE			((SLuint32) 0x00000005)
+#define SL_AUDIOMODE_AAC_SCALABLE		((SLuint32) 0x00000006)
+#define SL_AUDIOMODE_AAC_ERLC			((SLuint32) 0x00000007)
+#define SL_AUDIOMODE_AAC_LD			((SLuint32) 0x00000008)
+#define SL_AUDIOMODE_AAC_HE_PS			((SLuint32) 0x00000009)
+#define SL_AUDIOMODE_AAC_HE_MPS			((SLuint32) 0x0000000A)
+
+#define SL_AUDIOSTREAMFORMAT_MP2ADTS		((SLuint32) 0x00000001)
+#define SL_AUDIOSTREAMFORMAT_MP4ADTS		((SLuint32) 0x00000002)
+#define SL_AUDIOSTREAMFORMAT_MP4LOAS		((SLuint32) 0x00000003)
+#define SL_AUDIOSTREAMFORMAT_MP4LATM		((SLuint32) 0x00000004)
+#define SL_AUDIOSTREAMFORMAT_ADIF		((SLuint32) 0x00000005)
+#define SL_AUDIOSTREAMFORMAT_MP4FF		((SLuint32) 0x00000006)
+#define SL_AUDIOSTREAMFORMAT_RAW			((SLuint32) 0x00000007)
+
+#define SL_AUDIOPROFILE_WMA7		((SLuint32) 0x00000001)
+#define SL_AUDIOPROFILE_WMA8		((SLuint32) 0x00000002)
+#define SL_AUDIOPROFILE_WMA9		((SLuint32) 0x00000003)
+#define SL_AUDIOPROFILE_WMA10		((SLuint32) 0x00000004)
+
+#define SL_AUDIOMODE_WMA_LEVEL1		((SLuint32) 0x00000001)
+#define SL_AUDIOMODE_WMA_LEVEL2		((SLuint32) 0x00000002)
+#define SL_AUDIOMODE_WMA_LEVEL3		((SLuint32) 0x00000003)
+#define SL_AUDIOMODE_WMA_LEVEL4		((SLuint32) 0x00000004)
+#define SL_AUDIOMODE_WMAPRO_LEVELM0	((SLuint32) 0x00000005)
+#define SL_AUDIOMODE_WMAPRO_LEVELM1	((SLuint32) 0x00000006)
+#define SL_AUDIOMODE_WMAPRO_LEVELM2	((SLuint32) 0x00000007)
+#define SL_AUDIOMODE_WMAPRO_LEVELM3	((SLuint32) 0x00000008)
+
+#define SL_AUDIOPROFILE_REALAUDIO		((SLuint32) 0x00000001)
+
+#define SL_AUDIOMODE_REALAUDIO_G2		((SLuint32) 0x00000001)
+#define SL_AUDIOMODE_REALAUDIO_8			((SLuint32) 0x00000002)
+#define SL_AUDIOMODE_REALAUDIO_10		((SLuint32) 0x00000003)
+#define SL_AUDIOMODE_REALAUDIO_SURROUND	((SLuint32) 0x00000004)
+
+typedef struct SLAudioCodecDescriptor_ {
+    SLuint32      maxChannels;
+    SLuint32      minBitsPerSample;
+    SLuint32      maxBitsPerSample;
+    SLmilliHertz  minSampleRate;
+    SLmilliHertz  maxSampleRate;
+    SLboolean     isFreqRangeContinuous;
+    SLmilliHertz *pSampleRatesSupported;
+    SLuint32      numSampleRatesSupported;
+    SLuint32      minBitRate;
+    SLuint32      maxBitRate;
+    SLboolean     isBitrateRangeContinuous;
+    SLuint32     *pBitratesSupported;
+    SLuint32      numBitratesSupported;
+    SLuint32	  profileSetting;
+    SLuint32      modeSetting;
+} SLAudioCodecDescriptor;
+
+/*Structure used to retrieve the profile and level settings supported by an audio encoder */
+
+typedef struct SLAudioCodecProfileMode_ {
+    SLuint32 profileSetting;
+    SLuint32 modeSetting;
+} SLAudioCodecProfileMode;
+
+extern SLAPIENTRY const SLInterfaceID SL_IID_AUDIODECODERCAPABILITIES;
+
+struct SLAudioDecoderCapabilitiesItf_;
+typedef const struct SLAudioDecoderCapabilitiesItf_ * const * SLAudioDecoderCapabilitiesItf;
+
+struct SLAudioDecoderCapabilitiesItf_ {
+    SLresult (*GetAudioDecoders) (
+        SLAudioDecoderCapabilitiesItf self,
+        SLuint32 * pNumDecoders ,
+        SLuint32 *pDecoderIds
+    );
+    SLresult (*GetAudioDecoderCapabilities) (
+        SLAudioDecoderCapabilitiesItf self,
+        SLuint32 decoderId,
+        SLuint32 *pIndex,
+        SLAudioCodecDescriptor *pDescriptor
+    );
+};
+
+
+
+
+/*---------------------------------------------------------------------------*/
+/* Audio Encoder Capabilities Interface                                      */
+/* --------------------------------------------------------------------------*/
+
+/* Structure used when setting audio encoding parameters */
+
+typedef struct SLAudioEncoderSettings_ {
+    SLuint32 encoderId;
+    SLuint32 channelsIn;
+    SLuint32 channelsOut;
+    SLmilliHertz sampleRate;
+    SLuint32 bitRate;
+    SLuint32 bitsPerSample;
+    SLuint32 rateControl;
+    SLuint32 profileSetting;
+    SLuint32 levelSetting;
+    SLuint32 channelMode;
+    SLuint32 streamFormat;
+    SLuint32 encodeOptions;
+    SLuint32 blockAlignment;
+} SLAudioEncoderSettings;
+
+extern SLAPIENTRY const SLInterfaceID SL_IID_AUDIOENCODERCAPABILITIES;
+
+struct SLAudioEncoderCapabilitiesItf_;
+typedef const struct SLAudioEncoderCapabilitiesItf_ * const * SLAudioEncoderCapabilitiesItf;
+
+struct SLAudioEncoderCapabilitiesItf_ {
+    SLresult (*GetAudioEncoders) (
+        SLAudioEncoderCapabilitiesItf self,
+        SLuint32 *pNumEncoders ,
+        SLuint32 *pEncoderIds
+    );
+    SLresult (*GetAudioEncoderCapabilities) (
+        SLAudioEncoderCapabilitiesItf self,
+        SLuint32 encoderId,
+        SLuint32 *pIndex,
+        SLAudioCodecDescriptor * pDescriptor
+    );
+};
+
+
+/*---------------------------------------------------------------------------*/
+/* Audio Encoder Interface                                                   */
+/* --------------------------------------------------------------------------*/
+
+
+extern SLAPIENTRY const SLInterfaceID SL_IID_AUDIOENCODER;
+
+struct SLAudioEncoderItf_;
+typedef const struct SLAudioEncoderItf_ * const * SLAudioEncoderItf;
+
+struct SLAudioEncoderItf_ {
+    SLresult (*SetEncoderSettings) (
+        SLAudioEncoderItf		self,
+        SLAudioEncoderSettings 	*pSettings
+    );
+    SLresult (*GetEncoderSettings) (
+        SLAudioEncoderItf		self,
+        SLAudioEncoderSettings	*pSettings
+    );
+};
+
+
+/*---------------------------------------------------------------------------*/
+/* Bass Boost Interface                                                      */
+/* --------------------------------------------------------------------------*/
+
+
+extern SLAPIENTRY const SLInterfaceID SL_IID_BASSBOOST;
+
+struct SLBassBoostItf_;
+typedef const struct SLBassBoostItf_ * const * SLBassBoostItf;
+
+struct SLBassBoostItf_ {
+	SLresult (*SetEnabled)(
+		SLBassBoostItf self,
+		SLboolean enabled
+	);
+	SLresult (*IsEnabled)(
+		SLBassBoostItf self,
+		SLboolean *pEnabled
+	);
+	SLresult (*SetStrength)(
+		SLBassBoostItf self,
+		SLpermille strength
+	);
+	SLresult (*GetRoundedStrength)(
+		SLBassBoostItf self,
+		SLpermille *pStrength
+	);
+	SLresult (*IsStrengthSupported)(
+		SLBassBoostItf self,
+		SLboolean *pSupported
+	);
+};
+
+/*---------------------------------------------------------------------------*/
+/* Pitch Interface                                                           */
+/* --------------------------------------------------------------------------*/
+
+
+extern SLAPIENTRY const SLInterfaceID SL_IID_PITCH;
+
+struct SLPitchItf_;
+typedef const struct SLPitchItf_ * const * SLPitchItf;
+
+struct SLPitchItf_ {
+	SLresult (*SetPitch) (
+		SLPitchItf self,
+		SLpermille pitch
+	);
+	SLresult (*GetPitch) (
+		SLPitchItf self,
+		SLpermille *pPitch
+	);
+	SLresult (*GetPitchCapabilities) (
+		SLPitchItf self,
+		SLpermille *pMinPitch,
+		SLpermille *pMaxPitch
+	);
+};
+
+
+/*---------------------------------------------------------------------------*/
+/* Rate Pitch Interface                                                      */
+/* RatePitchItf is an interface for controlling the rate a sound is played   */
+/* back. A change in rate will cause a change in pitch.                      */
+/* --------------------------------------------------------------------------*/
+
+
+extern SLAPIENTRY const SLInterfaceID SL_IID_RATEPITCH;
+
+struct SLRatePitchItf_;
+typedef const struct SLRatePitchItf_ * const * SLRatePitchItf;
+
+struct SLRatePitchItf_ {
+	SLresult (*SetRate) (
+		SLRatePitchItf self,
+		SLpermille rate
+	);
+	SLresult (*GetRate) (
+		SLRatePitchItf self,
+		SLpermille *pRate
+	);
+	SLresult (*GetRatePitchCapabilities) (
+		SLRatePitchItf self,
+		SLpermille *pMinRate,
+		SLpermille *pMaxRate
+	);
+};
+
+
+/*---------------------------------------------------------------------------*/
+/* Virtualizer Interface                                                      */
+/* --------------------------------------------------------------------------*/
+
+
+extern SLAPIENTRY const SLInterfaceID SL_IID_VIRTUALIZER;
+
+struct SLVirtualizerItf_;
+typedef const struct SLVirtualizerItf_ * const * SLVirtualizerItf;
+
+struct SLVirtualizerItf_ {
+	SLresult (*SetEnabled)(
+		SLVirtualizerItf self,
+		SLboolean enabled
+	);
+	SLresult (*IsEnabled)(
+		SLVirtualizerItf self,
+		SLboolean *pEnabled
+	);
+	SLresult (*SetStrength)(
+		SLVirtualizerItf self,
+		SLpermille strength
+	);
+	SLresult (*GetRoundedStrength)(
+		SLVirtualizerItf self,
+		SLpermille *pStrength
+	);
+	SLresult (*IsStrengthSupported)(
+		SLVirtualizerItf self,
+		SLboolean *pSupported
+	);
+};
+
+/*---------------------------------------------------------------------------*/
+/* Visualization Interface                                                   */
+/* --------------------------------------------------------------------------*/
+
+
+extern SLAPIENTRY const SLInterfaceID SL_IID_VISUALIZATION;
+
+struct SLVisualizationItf_;
+typedef const struct SLVisualizationItf_ * const * SLVisualizationItf;
+
+typedef void (/*SLAPIENTRY*/ *slVisualizationCallback) (
+	void *pContext,
+	const SLuint8 waveform[],
+	const SLuint8 fft[],
+	SLmilliHertz samplerate
+);
+
+struct SLVisualizationItf_{
+	SLresult (*RegisterVisualizationCallback)(
+		SLVisualizationItf self,
+		slVisualizationCallback callback,
+		void *pContext,
+		SLmilliHertz rate
+	);
+	SLresult (*GetMaxRate)(
+		SLVisualizationItf self,
+		SLmilliHertz* pRate
+	);
+};
+
+
+/*---------------------------------------------------------------------------*/
+/* Engine Interface                                                          */
+/* --------------------------------------------------------------------------*/
+
+
+extern SLAPIENTRY const SLInterfaceID SL_IID_ENGINE;
+
+struct SLEngineItf_;
+typedef const struct SLEngineItf_ * const * SLEngineItf;
+
+
+struct SLEngineItf_ {
+
+	SLresult (*CreateLEDDevice) (
+		SLEngineItf self,
+		SLObjectItf * pDevice,
+		SLuint32 deviceID,
+		SLuint32 numInterfaces,
+		const SLInterfaceID * pInterfaceIds,
+		const SLboolean * pInterfaceRequired
+	);
+	SLresult (*CreateVibraDevice) (
+		SLEngineItf self,
+		SLObjectItf * pDevice,
+		SLuint32 deviceID,
+		SLuint32 numInterfaces,
+		const SLInterfaceID * pInterfaceIds,
+		const SLboolean * pInterfaceRequired
+	);
+	SLresult (*CreateAudioPlayer) (
+		SLEngineItf self,
+		SLObjectItf * pPlayer,
+		SLDataSource *pAudioSrc,
+		SLDataSink *pAudioSnk,
+		SLuint32 numInterfaces,
+		const SLInterfaceID * pInterfaceIds,
+		const SLboolean * pInterfaceRequired
+	);
+	SLresult (*CreateAudioRecorder) (
+		SLEngineItf self,
+		SLObjectItf * pRecorder,
+		SLDataSource *pAudioSrc,
+		SLDataSink *pAudioSnk,
+		SLuint32 numInterfaces,
+		const SLInterfaceID * pInterfaceIds,
+		const SLboolean * pInterfaceRequired
+	);
+	SLresult (*CreateMidiPlayer) (
+		SLEngineItf self,
+		SLObjectItf * pPlayer,
+		SLDataSource *pMIDISrc,
+		SLDataSource *pBankSrc,
+		SLDataSink *pAudioOutput,
+		SLDataSink *pVibra,
+		SLDataSink *pLEDArray,
+		SLuint32 numInterfaces,
+		const SLInterfaceID * pInterfaceIds,
+		const SLboolean * pInterfaceRequired
+	);
+	SLresult (*CreateListener) (
+		SLEngineItf self,
+		SLObjectItf * pListener,
+		SLuint32 numInterfaces,
+		const SLInterfaceID * pInterfaceIds,
+		const SLboolean * pInterfaceRequired
+	);
+	SLresult (*Create3DGroup) (
+		SLEngineItf self,
+		SLObjectItf * pGroup,
+		SLuint32 numInterfaces,
+		const SLInterfaceID * pInterfaceIds,
+		const SLboolean * pInterfaceRequired
+	);
+	SLresult (*CreateOutputMix) (
+		SLEngineItf self,
+		SLObjectItf * pMix,
+		SLuint32 numInterfaces,
+		const SLInterfaceID * pInterfaceIds,
+		const SLboolean * pInterfaceRequired
+	);
+	SLresult (*CreateMetadataExtractor) (
+		SLEngineItf self,
+		SLObjectItf * pMetadataExtractor,
+		SLDataSource * pDataSource,
+		SLuint32 numInterfaces,
+		const SLInterfaceID * pInterfaceIds,
+		const SLboolean * pInterfaceRequired
+	);
+    SLresult (*CreateExtensionObject) (
+        SLEngineItf self,
+        SLObjectItf * pObject,
+        void * pParameters,
+        SLuint32 objectID,
+        SLuint32 numInterfaces,
+        const SLInterfaceID * pInterfaceIds,
+        const SLboolean * pInterfaceRequired
+    );
+	SLresult (*QueryNumSupportedInterfaces) (
+		SLEngineItf self,
+		SLuint32 objectID,
+		SLuint32 * pNumSupportedInterfaces
+	);
+	SLresult (*QuerySupportedInterfaces) (
+		SLEngineItf self,
+		SLuint32 objectID,
+		SLuint32 index,
+		SLInterfaceID * pInterfaceId
+	);
+    SLresult (*QueryNumSupportedExtensions) (
+        SLEngineItf self,
+        SLuint32 * pNumExtensions
+    );
+    SLresult (*QuerySupportedExtension) (
+        SLEngineItf self,
+        SLuint32 index,
+        SLchar * pExtensionName,
+        SLint16 * pNameLength
+    );
+    SLresult (*IsExtensionSupported) (
+        SLEngineItf self,
+        const SLchar * pExtensionName,
+        SLboolean * pSupported
+    );
+};
+
+
+/*---------------------------------------------------------------------------*/
+/* Engine Capabilities Interface                                             */
+/* --------------------------------------------------------------------------*/
+
+
+extern SLAPIENTRY const SLInterfaceID SL_IID_ENGINECAPABILITIES;
+
+struct SLEngineCapabilitiesItf_;
+typedef const struct SLEngineCapabilitiesItf_ * const * SLEngineCapabilitiesItf;
+
+struct SLEngineCapabilitiesItf_ {
+	SLresult (*QuerySupportedProfiles) (
+		SLEngineCapabilitiesItf self,
+		SLuint16 *pProfilesSupported
+	);
+	SLresult (*QueryAvailableVoices) (
+		SLEngineCapabilitiesItf self,
+		SLuint16 voiceType,
+		SLint16 *pNumMaxVoices,
+		SLboolean *pIsAbsoluteMax,
+		SLint16 *pNumFreeVoices
+	);
+	SLresult (*QueryNumberOfMIDISynthesizers) (
+		SLEngineCapabilitiesItf self,
+		SLint16 *pNumMIDIsynthesizers
+	);
+	SLresult (*QueryAPIVersion) (
+		SLEngineCapabilitiesItf self,
+		SLint16 *pMajor,
+		SLint16 *pMinor,
+		SLint16 *pStep
+	);
+	SLresult (*QueryLEDCapabilities) (
+		SLEngineCapabilitiesItf self,
+        SLuint32 *pIndex,
+		SLuint32 *pLEDDeviceID,
+		SLLEDDescriptor *pDescriptor
+	);
+	SLresult (*QueryVibraCapabilities) (
+		SLEngineCapabilitiesItf self,
+        SLuint32 *pIndex,
+		SLuint32 *pVibraDeviceID,
+		SLVibraDescriptor *pDescriptor
+	);
+	SLresult (*IsThreadSafe) (
+		SLEngineCapabilitiesItf self,
+		SLboolean *pIsThreadSafe
+	);
+};
+
+/*---------------------------------------------------------------------------*/
+/* Thread Sync Interface                                                     */
+/* --------------------------------------------------------------------------*/
+
+
+extern SLAPIENTRY const SLInterfaceID SL_IID_THREADSYNC;
+
+struct SLThreadSyncItf_;
+typedef const struct SLThreadSyncItf_ * const * SLThreadSyncItf;
+
+
+struct SLThreadSyncItf_ {
+	SLresult (*EnterCriticalSection) (
+		SLThreadSyncItf self
+	);
+	SLresult (*ExitCriticalSection) (
+		SLThreadSyncItf self
+	);
+};
+
+
+/*****************************************************************************/
+/* SL engine constructor                                                     */
+/*****************************************************************************/
+
+#define SL_ENGINEOPTION_THREADSAFE	((SLuint32) 0x00000001)
+#define SL_ENGINEOPTION_LOSSOFCONTROL	((SLuint32) 0x00000002)
+
+typedef struct SLEngineOption_ {
+	SLuint32 feature;
+	SLuint32 data;
+} SLEngineOption;
+
+
+SLresult SLAPIENTRY slCreateEngine(
+	SLObjectItf             *pEngine,
+	SLuint32                numOptions,
+	const SLEngineOption    *pEngineOptions,
+	SLuint32                numInterfaces,
+	const SLInterfaceID     *pInterfaceIds,
+	const SLboolean         * pInterfaceRequired
+);
+
+SLresult SLAPIENTRY slQueryNumSupportedEngineInterfaces(
+	SLuint32 * pNumSupportedInterfaces
+);
+
+SLresult SLAPIENTRY slQuerySupportedEngineInterfaces(
+	SLuint32 index,
+	SLInterfaceID * pInterfaceId
+);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* OPENSL_ES_H_ */
diff --git a/ndk/platforms/android-9/include/SLES/OpenSLES_Android.h b/ndk/platforms/android-9/include/SLES/OpenSLES_Android.h
new file mode 100644
index 0000000..829df68
--- /dev/null
+++ b/ndk/platforms/android-9/include/SLES/OpenSLES_Android.h
@@ -0,0 +1,242 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef OPENSL_ES_ANDROID_H_
+#define OPENSL_ES_ANDROID_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*---------------------------------------------------------------------------*/
+/* Android common types                                                      */
+/*---------------------------------------------------------------------------*/
+
+typedef sl_int64_t             SLAint64;           /* 64 bit signed integer */
+
+
+/*---------------------------------------------------------------------------*/
+/* Android Effect interface                                                  */
+/*---------------------------------------------------------------------------*/
+
+extern SLAPIENTRY const SLInterfaceID SL_IID_ANDROIDEFFECT;
+
+/** Android Effect interface methods */
+
+struct SLAndroidEffectItf_;
+typedef const struct SLAndroidEffectItf_ * const * SLAndroidEffectItf;
+
+struct SLAndroidEffectItf_ {
+
+    SLresult (*CreateEffect) (SLAndroidEffectItf self,
+            SLInterfaceID effectImplementationId);
+
+    SLresult (*ReleaseEffect) (SLAndroidEffectItf self,
+            SLInterfaceID effectImplementationId);
+
+    SLresult (*SetEnabled) (SLAndroidEffectItf self,
+            SLInterfaceID effectImplementationId,
+            SLboolean enabled);
+
+    SLresult (*IsEnabled) (SLAndroidEffectItf self,
+            SLInterfaceID effectImplementationId,
+            SLboolean *pEnabled);
+
+    SLresult (*SendCommand) (SLAndroidEffectItf self,
+            SLInterfaceID effectImplementationId,
+            SLuint32 command,
+            SLuint32 commandSize,
+            void *pCommandData,
+            SLuint32 *replySize,
+            void *pReplyData);
+};
+
+
+/*---------------------------------------------------------------------------*/
+/* Android Effect Send interface                                             */
+/*---------------------------------------------------------------------------*/
+
+extern SLAPIENTRY const SLInterfaceID SL_IID_ANDROIDEFFECTSEND;
+
+/** Android Effect Send interface methods */
+
+struct SLAndroidEffectSendItf_;
+typedef const struct SLAndroidEffectSendItf_ * const * SLAndroidEffectSendItf;
+
+struct SLAndroidEffectSendItf_ {
+    SLresult (*EnableEffectSend) (
+        SLAndroidEffectSendItf self,
+        SLInterfaceID effectImplementationId,
+        SLboolean enable,
+        SLmillibel initialLevel
+    );
+    SLresult (*IsEnabled) (
+        SLAndroidEffectSendItf self,
+        SLInterfaceID effectImplementationId,
+        SLboolean *pEnable
+    );
+    SLresult (*SetDirectLevel) (
+        SLAndroidEffectSendItf self,
+        SLmillibel directLevel
+    );
+    SLresult (*GetDirectLevel) (
+        SLAndroidEffectSendItf self,
+        SLmillibel *pDirectLevel
+    );
+    SLresult (*SetSendLevel) (
+        SLAndroidEffectSendItf self,
+        SLInterfaceID effectImplementationId,
+        SLmillibel sendLevel
+    );
+    SLresult (*GetSendLevel)(
+        SLAndroidEffectSendItf self,
+        SLInterfaceID effectImplementationId,
+        SLmillibel *pSendLevel
+    );
+};
+
+
+/*---------------------------------------------------------------------------*/
+/* Android Effect Capabilities interface                                     */
+/*---------------------------------------------------------------------------*/
+
+extern SLAPIENTRY const SLInterfaceID SL_IID_ANDROIDEFFECTCAPABILITIES;
+
+/** Android Effect Capabilities interface methods */
+
+struct SLAndroidEffectCapabilitiesItf_;
+typedef const struct SLAndroidEffectCapabilitiesItf_ * const * SLAndroidEffectCapabilitiesItf;
+
+struct SLAndroidEffectCapabilitiesItf_ {
+
+    SLresult (*QueryNumEffects) (SLAndroidEffectCapabilitiesItf self,
+            SLuint32 *pNumSupportedEffects);
+
+
+    SLresult (*QueryEffect) (SLAndroidEffectCapabilitiesItf self,
+            SLuint32 index,
+            SLInterfaceID *pEffectType,
+            SLInterfaceID *pEffectImplementation,
+            SLchar *pName,
+            SLuint16 *pNameSize);
+};
+
+
+/*---------------------------------------------------------------------------*/
+/* Android Configuration interface                                           */
+/*---------------------------------------------------------------------------*/
+extern SLAPIENTRY const SLInterfaceID SL_IID_ANDROIDCONFIGURATION;
+
+/** Android Configuration interface methods */
+
+struct SLAndroidConfigurationItf_;
+typedef const struct SLAndroidConfigurationItf_ * const * SLAndroidConfigurationItf;
+
+struct SLAndroidConfigurationItf_ {
+
+    SLresult (*SetConfiguration) (SLAndroidConfigurationItf self,
+            const SLchar *configKey,
+            const void *pConfigValue,
+            SLuint32 valueSize);
+
+    SLresult (*GetConfiguration) (SLAndroidConfigurationItf self,
+           const SLchar *configKey,
+           SLuint32 *pValueSize,
+           void *pConfigValue
+       );
+};
+
+
+/*---------------------------------------------------------------------------*/
+/* Android Simple Buffer Queue Interface                                     */
+/*---------------------------------------------------------------------------*/
+
+extern SLAPIENTRY const SLInterfaceID SL_IID_ANDROIDSIMPLEBUFFERQUEUE;
+
+struct SLAndroidSimpleBufferQueueItf_;
+typedef const struct SLAndroidSimpleBufferQueueItf_ * const * SLAndroidSimpleBufferQueueItf;
+
+typedef void (/*SLAPIENTRY*/ *slAndroidSimpleBufferQueueCallback)(
+	SLAndroidSimpleBufferQueueItf caller,
+	void *pContext
+);
+
+/** Android simple buffer queue state **/
+
+typedef struct SLAndroidSimpleBufferQueueState_ {
+	SLuint32	count;
+	SLuint32	index;
+} SLAndroidSimpleBufferQueueState;
+
+
+struct SLAndroidSimpleBufferQueueItf_ {
+	SLresult (*Enqueue) (
+		SLAndroidSimpleBufferQueueItf self,
+		const void *pBuffer,
+		SLuint32 size
+	);
+	SLresult (*Clear) (
+		SLAndroidSimpleBufferQueueItf self
+	);
+	SLresult (*GetState) (
+		SLAndroidSimpleBufferQueueItf self,
+		SLAndroidSimpleBufferQueueState *pState
+	);
+	SLresult (*RegisterCallback) (
+		SLAndroidSimpleBufferQueueItf self,
+		slAndroidSimpleBufferQueueCallback callback,
+		void* pContext
+	);
+};
+
+
+/*---------------------------------------------------------------------------*/
+/* Android File Descriptor Data Locator                                      */
+/*---------------------------------------------------------------------------*/
+
+/** Addendum to Data locator macros  */
+#define SL_DATALOCATOR_ANDROIDFD                ((SLuint32) 0x800007BC)
+
+#define SL_DATALOCATOR_ANDROIDFD_USE_FILE_SIZE ((SLAint64) 0xFFFFFFFFFFFFFFFFll)
+
+/** File Descriptor-based data locator definition, locatorType must be SL_DATALOCATOR_ANDROIDFD */
+typedef struct SLDataLocator_AndroidFD_ {
+    SLuint32        locatorType;
+    SLint32         fd;
+    SLAint64        offset;
+    SLAint64        length;
+} SLDataLocator_AndroidFD;
+
+
+/*---------------------------------------------------------------------------*/
+/* Android Android Simple Buffer Queue Data Locator                          */
+/*---------------------------------------------------------------------------*/
+
+/** Addendum to Data locator macros  */
+#define SL_DATALOCATOR_ANDROIDSIMPLEBUFFERQUEUE ((SLuint32) 0x800007BD)
+
+/** BufferQueue-based data locator definition where locatorType must be SL_DATALOCATOR_ANDROIDSIMPLEBUFFERQUEUE*/
+typedef struct SLDataLocator_AndroidSimpleBufferQueue {
+	SLuint32	locatorType;
+	SLuint32	numBuffers;
+} SLDataLocator_AndroidSimpleBufferQueue;
+
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* OPENSL_ES_ANDROID_H_ */
diff --git a/ndk/platforms/android-9/include/SLES/OpenSLES_AndroidConfiguration.h b/ndk/platforms/android-9/include/SLES/OpenSLES_AndroidConfiguration.h
new file mode 100644
index 0000000..bff6410
--- /dev/null
+++ b/ndk/platforms/android-9/include/SLES/OpenSLES_AndroidConfiguration.h
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef OPENSL_ES_ANDROIDCONFIGURATION_H_
+#define OPENSL_ES_ANDROIDCONFIGURATION_H_
+
+#ifdef __cplusplus
+extern "C" {
+
+/*---------------------------------------------------------------------------*/
+/* Android AudioRecorder configuration                                       */
+/*---------------------------------------------------------------------------*/
+
+/** Audio recording preset */
+/** Audio recording preset key */
+#define SL_ANDROID_KEY_RECORDING_PRESET ((const SLchar*) "androidRecordingPreset")
+/** Audio recording preset values */
+/**   preset "none" cannot be set, it is used to indicate the current settings
+ *     do not match any of the presets. */
+#define SL_ANDROID_RECORDING_PRESET_NONE              ((SLuint32) 0x00000000)
+/**   generic recording configuration on the platform */
+#define SL_ANDROID_RECORDING_PRESET_GENERIC           ((SLuint32) 0x00000001)
+/**   uses the microphone audio source with the same orientation as the camera
+ *     if available, the main device microphone otherwise */
+#define SL_ANDROID_RECORDING_PRESET_CAMCORDER         ((SLuint32) 0x00000002)
+/**   uses the main microphone tuned for voice recognition */
+#define SL_ANDROID_RECORDING_PRESET_VOICE_RECOGNITION ((SLuint32) 0x00000003)
+
+/*---------------------------------------------------------------------------*/
+/* Android AudioPlayer configuration                                         */
+/*---------------------------------------------------------------------------*/
+
+/** Audio playback stream type */
+/** Audio playback stream type key */
+#define SL_ANDROID_KEY_STREAM_TYPE ((const SLchar*) "androidPlaybackStreamType")
+
+/** Audio playback stream type  values */
+/*      same as android.media.AudioManager.STREAM_VOICE_CALL */
+#define SL_ANDROID_STREAM_VOICE        ((SLint32) 0x00000000)
+/*      same as android.media.AudioManager.STREAM_SYSTEM */
+#define SL_ANDROID_STREAM_SYSTEM       ((SLint32) 0x00000001)
+/*      same as android.media.AudioManager.STREAM_RING */
+#define SL_ANDROID_STREAM_RING         ((SLint32) 0x00000002)
+/*      same as android.media.AudioManager.STREAM_MUSIC */
+#define SL_ANDROID_STREAM_MEDIA        ((SLint32) 0x00000003)
+/*      same as android.media.AudioManager.STREAM_ALARM */
+#define SL_ANDROID_STREAM_ALARM        ((SLint32) 0x00000004)
+/*      same as android.media.AudioManager.STREAM_NOTIFICATION */
+#define SL_ANDROID_STREAM_NOTIFICATION ((SLint32) 0x00000005)
+
+
+
+}
+#endif /* __cplusplus */
+
+#endif /* OPENSL_ES_ANDROIDCONFIGURATION_H_ */
diff --git a/ndk/platforms/android-9/include/SLES/OpenSLES_Platform.h b/ndk/platforms/android-9/include/SLES/OpenSLES_Platform.h
new file mode 100644
index 0000000..ea401a7
--- /dev/null
+++ b/ndk/platforms/android-9/include/SLES/OpenSLES_Platform.h
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2007-2009 The Khronos Group Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and /or associated documentation files (the "Materials "), to
+ * deal in the Materials without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Materials, and to permit persons to whom the Materials are
+ * furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Materials.
+ *
+ * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS IN THE
+ * MATERIALS.
+ *
+ * OpenSLES_Platform.h - OpenSL ES version 1.0
+ *
+ */
+
+/****************************************************************************/
+/* NOTE: This file contains definitions for the base types and the          */
+/* SLAPIENTRY macro. This file **WILL NEED TO BE EDITED** to provide        */
+/* the correct definitions specific to the platform being used.             */
+/****************************************************************************/
+
+#ifndef _OPENSLES_PLATFORM_H_
+#define _OPENSLES_PLATFORM_H_
+
+typedef unsigned char               sl_uint8_t;
+typedef signed char                 sl_int8_t;
+typedef unsigned short              sl_uint16_t;
+typedef signed short                sl_int16_t;
+typedef unsigned long               sl_uint32_t;
+typedef signed long                 sl_int32_t;
+typedef long long                   sl_int64_t;
+
+#ifndef SLAPIENTRY
+#ifdef __GNUC__
+#define SLAPIENTRY                 /* override per-platform */
+#else
+#define SLAPIENTRY __declspec(dllimport)
+#endif
+#endif
+
+#endif /* _OPENSLES_PLATFORM_H_ */
diff --git a/ndk/platforms/android-9/include/android/asset_manager.h b/ndk/platforms/android-9/include/android/asset_manager.h
new file mode 100644
index 0000000..3ad0f99
--- /dev/null
+++ b/ndk/platforms/android-9/include/android/asset_manager.h
@@ -0,0 +1,135 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#ifndef ANDROID_ASSET_MANAGER_H
+#define ANDROID_ASSET_MANAGER_H
+
+#include <sys/cdefs.h>
+
+__BEGIN_DECLS
+
+struct AAssetManager;
+typedef struct AAssetManager AAssetManager;
+
+struct AAssetDir;
+typedef struct AAssetDir AAssetDir;
+
+struct AAsset;
+typedef struct AAsset AAsset;
+
+/* Available modes for opening assets */
+enum {
+    AASSET_MODE_UNKNOWN      = 0,
+    AASSET_MODE_RANDOM       = 1,
+    AASSET_MODE_STREAMING    = 2,
+    AASSET_MODE_BUFFER       = 3
+};
+
+
+/**
+ * Open the named directory within the asset hierarchy.  The directory can then
+ * be inspected with the AAssetDir functions.  To open the top-level directory,
+ * pass in "" as the dirName.
+ *
+ * The object returned here should be freed by calling AAssetDir_close().
+ */
+AAssetDir* AAssetManager_openDir(AAssetManager* mgr, const char* dirName);
+
+/**
+ * Open an asset.
+ *
+ * The object returned here should be freed by calling AAsset_close().
+ */
+AAsset* AAssetManager_open(AAssetManager* mgr, const char* filename, int mode);
+
+/**
+ * Iterate over the files in an asset directory.  A NULL string is returned
+ * when all the file names have been returned.
+ *
+ * The returned file name is suitable for passing to AAssetManager_open().
+ *
+ * The string returned here is owned by the AssetDir implementation and is not
+ * guaranteed to remain valid if any other calls are made on this AAssetDir
+ * instance.
+ */
+const char* AAssetDir_getNextFileName(AAssetDir* assetDir);
+
+/**
+ * Reset the iteration state of AAssetDir_getNextFileName() to the beginning.
+ */
+void AAssetDir_rewind(AAssetDir* assetDir);
+
+/**
+ * Close an opened AAssetDir, freeing any related resources.
+ */
+void AAssetDir_close(AAssetDir* assetDir);
+
+/**
+ * Attempt to read 'count' bytes of data from the current offset.
+ *
+ * Returns the number of bytes read, zero on EOF, or < 0 on error.
+ */
+int AAsset_read(AAsset* asset, void* buf, size_t count);
+
+/**
+ * Seek to the specified offset within the asset data.  'whence' uses the
+ * same constants as lseek()/fseek().
+ *
+ * Returns the new position on success, or (off_t) -1 on error.
+ */
+off_t AAsset_seek(AAsset* asset, off_t offset, int whence);
+
+/**
+ * Close the asset, freeing all associated resources.
+ */
+void AAsset_close(AAsset* asset);
+
+/**
+ * Get a pointer to a buffer holding the entire contents of the assset.
+ *
+ * Returns NULL on failure.
+ */
+const void* AAsset_getBuffer(AAsset* asset);
+
+/**
+ * Report the total size of the asset data.
+ */
+off_t AAsset_getLength(AAsset* asset);
+
+/**
+ * Report the total amount of asset data that can be read from the current position.
+ */
+off_t AAsset_getRemainingLength(AAsset* asset);
+
+/**
+ * Open a new file descriptor that can be used to read the asset data.
+ *
+ * Returns < 0 if direct fd access is not possible (for example, if the asset is
+ * compressed).
+ */
+int AAsset_openFileDescriptor(AAsset* asset, off_t* outStart, off_t* outLength);
+
+/**
+ * Returns whether this asset's internal buffer is allocated in ordinary RAM (i.e. not
+ * mmapped).
+ */
+int AAsset_isAllocated(AAsset* asset);
+
+
+__END_DECLS
+
+#endif      /* ANDROID_ASSET_MANAGER_H */
diff --git a/ndk/platforms/android-9/include/android/asset_manager_jni.h b/ndk/platforms/android-9/include/android/asset_manager_jni.h
new file mode 100644
index 0000000..073434b
--- /dev/null
+++ b/ndk/platforms/android-9/include/android/asset_manager_jni.h
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#ifndef ANDROID_ASSET_MANAGER_JNI_H
+#define ANDROID_ASSET_MANAGER_JNI_H
+
+#include <android/asset_manager.h>
+#include <jni.h>
+
+__BEGIN_DECLS
+
+/**
+ * Given a Dalvik AssetManager object, obtain the corresponding native AAssetManager
+ * object.  Note that the caller is responsible for obtaining and holding a VM reference
+ * to the jobject to prevent its being garbage collected while the native object is
+ * in use.
+ */
+AAssetManager* AAssetManager_fromJava(JNIEnv* env, jobject assetManager);
+
+__END_DECLS
+
+#endif      /* ANDROID_ASSET_MANAGER_JNI_H */
diff --git a/ndk/platforms/android-9/include/android/bitmap.h b/ndk/platforms/android-9/include/android/bitmap.h
new file mode 100644
index 0000000..160e34a
--- /dev/null
+++ b/ndk/platforms/android-9/include/android/bitmap.h
@@ -0,0 +1,76 @@
+/*
+ * Copyright (C) 2009 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ANDROID_BITMAP_H
+#define ANDROID_BITMAP_H
+
+#include <sys/cdefs.h>
+#include <stdint.h>
+#include <jni.h>
+
+__BEGIN_DECLS
+
+#define ANDROID_BITMAP_RESUT_SUCCESS            0
+#define ANDROID_BITMAP_RESULT_BAD_PARAMETER     -1
+#define ANDROID_BITMAP_RESULT_JNI_EXCEPTION     -2
+#define ANDROID_BITMAP_RESULT_ALLOCATION_FAILED -3
+
+enum AndroidBitmapFormat {
+    ANDROID_BITMAP_FORMAT_NONE      = 0,
+    ANDROID_BITMAP_FORMAT_RGBA_8888 = 1,
+    ANDROID_BITMAP_FORMAT_RGB_565   = 4,
+    ANDROID_BITMAP_FORMAT_RGBA_4444 = 7,
+    ANDROID_BITMAP_FORMAT_A_8       = 8,
+};
+
+typedef struct {
+    uint32_t    width;
+    uint32_t    height;
+    uint32_t    stride;
+    int32_t     format;
+    uint32_t    flags;      // 0 for now
+} AndroidBitmapInfo;
+
+/**
+ * Given a java bitmap object, fill out the AndroidBitmap struct for it.
+ * If the call fails, the info parameter will be ignored
+ */
+int AndroidBitmap_getInfo(JNIEnv* env, jobject jbitmap,
+                          AndroidBitmapInfo* info);
+
+/**
+ * Given a java bitmap object, attempt to lock the pixel address.
+ * Locking will ensure that the memory for the pixels will not move
+ * until the unlockPixels call, and ensure that, if the pixels had been
+ * previously purged, they will have been restored.
+ *
+ * If this call succeeds, it must be balanced by a call to
+ * AndroidBitmap_unlockPixels, after which time the address of the pixels should
+ * no longer be used.
+ *
+ * If this succeeds, *addrPtr will be set to the pixel address. If the call
+ * fails, addrPtr will be ignored.
+ */
+int AndroidBitmap_lockPixels(JNIEnv* env, jobject jbitmap, void** addrPtr);
+
+/**
+ * Call this to balanace a successful call to AndroidBitmap_lockPixels
+ */
+int AndroidBitmap_unlockPixels(JNIEnv* env, jobject jbitmap);
+
+__END_DECLS
+
+#endif /* ANDROID_BITMAP_H */
diff --git a/ndk/platforms/android-9/include/android/configuration.h b/ndk/platforms/android-9/include/android/configuration.h
new file mode 100644
index 0000000..4c85b12
--- /dev/null
+++ b/ndk/platforms/android-9/include/android/configuration.h
@@ -0,0 +1,315 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ANDROID_CONFIGURATION_H
+#define ANDROID_CONFIGURATION_H
+
+#include <android/asset_manager.h>
+
+__BEGIN_DECLS
+
+struct AConfiguration;
+typedef struct AConfiguration AConfiguration;
+
+enum {
+    ACONFIGURATION_ORIENTATION_ANY  = 0x0000,
+    ACONFIGURATION_ORIENTATION_PORT = 0x0001,
+    ACONFIGURATION_ORIENTATION_LAND = 0x0002,
+    ACONFIGURATION_ORIENTATION_SQUARE = 0x0003,
+
+    ACONFIGURATION_TOUCHSCREEN_ANY  = 0x0000,
+    ACONFIGURATION_TOUCHSCREEN_NOTOUCH  = 0x0001,
+    ACONFIGURATION_TOUCHSCREEN_STYLUS  = 0x0002,
+    ACONFIGURATION_TOUCHSCREEN_FINGER  = 0x0003,
+
+    ACONFIGURATION_DENSITY_DEFAULT = 0,
+    ACONFIGURATION_DENSITY_LOW = 120,
+    ACONFIGURATION_DENSITY_MEDIUM = 160,
+    ACONFIGURATION_DENSITY_HIGH = 240,
+    ACONFIGURATION_DENSITY_NONE = 0xffff,
+
+    ACONFIGURATION_KEYBOARD_ANY  = 0x0000,
+    ACONFIGURATION_KEYBOARD_NOKEYS  = 0x0001,
+    ACONFIGURATION_KEYBOARD_QWERTY  = 0x0002,
+    ACONFIGURATION_KEYBOARD_12KEY  = 0x0003,
+
+    ACONFIGURATION_NAVIGATION_ANY  = 0x0000,
+    ACONFIGURATION_NAVIGATION_NONAV  = 0x0001,
+    ACONFIGURATION_NAVIGATION_DPAD  = 0x0002,
+    ACONFIGURATION_NAVIGATION_TRACKBALL  = 0x0003,
+    ACONFIGURATION_NAVIGATION_WHEEL  = 0x0004,
+
+    ACONFIGURATION_KEYSHIDDEN_ANY = 0x0000,
+    ACONFIGURATION_KEYSHIDDEN_NO = 0x0001,
+    ACONFIGURATION_KEYSHIDDEN_YES = 0x0002,
+    ACONFIGURATION_KEYSHIDDEN_SOFT = 0x0003,
+
+    ACONFIGURATION_NAVHIDDEN_ANY = 0x0000,
+    ACONFIGURATION_NAVHIDDEN_NO = 0x0001,
+    ACONFIGURATION_NAVHIDDEN_YES = 0x0002,
+
+    ACONFIGURATION_SCREENSIZE_ANY  = 0x00,
+    ACONFIGURATION_SCREENSIZE_SMALL = 0x01,
+    ACONFIGURATION_SCREENSIZE_NORMAL = 0x02,
+    ACONFIGURATION_SCREENSIZE_LARGE = 0x03,
+    ACONFIGURATION_SCREENSIZE_XLARGE = 0x04,
+
+    ACONFIGURATION_SCREENLONG_ANY = 0x00,
+    ACONFIGURATION_SCREENLONG_NO = 0x1,
+    ACONFIGURATION_SCREENLONG_YES = 0x2,
+
+    ACONFIGURATION_UI_MODE_TYPE_ANY = 0x00,
+    ACONFIGURATION_UI_MODE_TYPE_NORMAL = 0x01,
+    ACONFIGURATION_UI_MODE_TYPE_DESK = 0x02,
+    ACONFIGURATION_UI_MODE_TYPE_CAR = 0x03,
+
+    ACONFIGURATION_UI_MODE_NIGHT_ANY = 0x00,
+    ACONFIGURATION_UI_MODE_NIGHT_NO = 0x1,
+    ACONFIGURATION_UI_MODE_NIGHT_YES = 0x2,
+
+    ACONFIGURATION_MCC = 0x0001,
+    ACONFIGURATION_MNC = 0x0002,
+    ACONFIGURATION_LOCALE = 0x0004,
+    ACONFIGURATION_TOUCHSCREEN = 0x0008,
+    ACONFIGURATION_KEYBOARD = 0x0010,
+    ACONFIGURATION_KEYBOARD_HIDDEN = 0x0020,
+    ACONFIGURATION_NAVIGATION = 0x0040,
+    ACONFIGURATION_ORIENTATION = 0x0080,
+    ACONFIGURATION_DENSITY = 0x0100,
+    ACONFIGURATION_SCREEN_SIZE = 0x0200,
+    ACONFIGURATION_VERSION = 0x0400,
+    ACONFIGURATION_SCREEN_LAYOUT = 0x0800,
+    ACONFIGURATION_UI_MODE = 0x1000,
+};
+
+/**
+ * Create a new AConfiguration, initialized with no values set.
+ */
+AConfiguration* AConfiguration_new();
+
+/**
+ * Free an AConfiguration that was previously created with
+ * AConfiguration_new().
+ */
+void AConfiguration_delete(AConfiguration* config);
+
+/**
+ * Create and return a new AConfiguration based on the current configuration in
+ * use in the given AssetManager.
+ */
+void AConfiguration_fromAssetManager(AConfiguration* out, AAssetManager* am);
+
+/**
+ * Copy the contents of 'src' to 'dest'.
+ */
+void AConfiguration_copy(AConfiguration* dest, AConfiguration* src);
+
+/**
+ * Return the current MCC set in the configuration.  0 if not set.
+ */
+int32_t AConfiguration_getMcc(AConfiguration* config);
+
+/**
+ * Set the current MCC in the configuration.  0 to clear.
+ */
+void AConfiguration_setMcc(AConfiguration* config, int32_t mcc);
+
+/**
+ * Return the current MNC set in the configuration.  0 if not set.
+ */
+int32_t AConfiguration_getMnc(AConfiguration* config);
+
+/**
+ * Set the current MNC in the configuration.  0 to clear.
+ */
+void AConfiguration_setMnc(AConfiguration* config, int32_t mnc);
+
+/**
+ * Return the current language code set in the configuration.  The output will
+ * be filled with an array of two characters.  They are not 0-terminated.  If
+ * a language is not set, they will be 0.
+ */
+void AConfiguration_getLanguage(AConfiguration* config, char* outLanguage);
+
+/**
+ * Set the current language code in the configuration, from the first two
+ * characters in the string.
+ */
+void AConfiguration_setLanguage(AConfiguration* config, const char* language);
+
+/**
+ * Return the current country code set in the configuration.  The output will
+ * be filled with an array of two characters.  They are not 0-terminated.  If
+ * a country is not set, they will be 0.
+ */
+void AConfiguration_getCountry(AConfiguration* config, char* outCountry);
+
+/**
+ * Set the current country code in the configuration, from the first two
+ * characters in the string.
+ */
+void AConfiguration_setCountry(AConfiguration* config, const char* country);
+
+/**
+ * Return the current ACONFIGURATION_ORIENTATION_* set in the configuration.
+ */
+int32_t AConfiguration_getOrientation(AConfiguration* config);
+
+/**
+ * Set the current orientation in the configuration.
+ */
+void AConfiguration_setOrientation(AConfiguration* config, int32_t orientation);
+
+/**
+ * Return the current ACONFIGURATION_TOUCHSCREEN_* set in the configuration.
+ */
+int32_t AConfiguration_getTouchscreen(AConfiguration* config);
+
+/**
+ * Set the current touchscreen in the configuration.
+ */
+void AConfiguration_setTouchscreen(AConfiguration* config, int32_t touchscreen);
+
+/**
+ * Return the current ACONFIGURATION_DENSITY_* set in the configuration.
+ */
+int32_t AConfiguration_getDensity(AConfiguration* config);
+
+/**
+ * Set the current density in the configuration.
+ */
+void AConfiguration_setDensity(AConfiguration* config, int32_t density);
+
+/**
+ * Return the current ACONFIGURATION_KEYBOARD_* set in the configuration.
+ */
+int32_t AConfiguration_getKeyboard(AConfiguration* config);
+
+/**
+ * Set the current keyboard in the configuration.
+ */
+void AConfiguration_setKeyboard(AConfiguration* config, int32_t keyboard);
+
+/**
+ * Return the current ACONFIGURATION_NAVIGATION_* set in the configuration.
+ */
+int32_t AConfiguration_getNavigation(AConfiguration* config);
+
+/**
+ * Set the current navigation in the configuration.
+ */
+void AConfiguration_setNavigation(AConfiguration* config, int32_t navigation);
+
+/**
+ * Return the current ACONFIGURATION_KEYSHIDDEN_* set in the configuration.
+ */
+int32_t AConfiguration_getKeysHidden(AConfiguration* config);
+
+/**
+ * Set the current keys hidden in the configuration.
+ */
+void AConfiguration_setKeysHidden(AConfiguration* config, int32_t keysHidden);
+
+/**
+ * Return the current ACONFIGURATION_NAVHIDDEN_* set in the configuration.
+ */
+int32_t AConfiguration_getNavHidden(AConfiguration* config);
+
+/**
+ * Set the current nav hidden in the configuration.
+ */
+void AConfiguration_setNavHidden(AConfiguration* config, int32_t navHidden);
+
+/**
+ * Return the current SDK (API) version set in the configuration.
+ */
+int32_t AConfiguration_getSdkVersion(AConfiguration* config);
+
+/**
+ * Set the current SDK version in the configuration.
+ */
+void AConfiguration_setSdkVersion(AConfiguration* config, int32_t sdkVersion);
+
+/**
+ * Return the current ACONFIGURATION_SCREENSIZE_* set in the configuration.
+ */
+int32_t AConfiguration_getScreenSize(AConfiguration* config);
+
+/**
+ * Set the current screen size in the configuration.
+ */
+void AConfiguration_setScreenSize(AConfiguration* config, int32_t screenSize);
+
+/**
+ * Return the current ACONFIGURATION_SCREENLONG_* set in the configuration.
+ */
+int32_t AConfiguration_getScreenLong(AConfiguration* config);
+
+/**
+ * Set the current screen long in the configuration.
+ */
+void AConfiguration_setScreenLong(AConfiguration* config, int32_t screenLong);
+
+/**
+ * Return the current ACONFIGURATION_UI_MODE_TYPE_* set in the configuration.
+ */
+int32_t AConfiguration_getUiModeType(AConfiguration* config);
+
+/**
+ * Set the current UI mode type in the configuration.
+ */
+void AConfiguration_setUiModeType(AConfiguration* config, int32_t uiModeType);
+
+/**
+ * Return the current ACONFIGURATION_UI_MODE_NIGHT_* set in the configuration.
+ */
+int32_t AConfiguration_getUiModeNight(AConfiguration* config);
+
+/**
+ * Set the current UI mode night in the configuration.
+ */
+void AConfiguration_setUiModeNight(AConfiguration* config, int32_t uiModeNight);
+
+/**
+ * Perform a diff between two configurations.  Returns a bit mask of
+ * ACONFIGURATION_* constants, each bit set meaning that configuration element
+ * is different between them.
+ */
+int32_t AConfiguration_diff(AConfiguration* config1, AConfiguration* config2);
+
+/**
+ * Determine whether 'base' is a valid configuration for use within the
+ * environment 'requested'.  Returns 0 if there are any values in 'base'
+ * that conflict with 'requested'.  Returns 1 if it does not conflict.
+ */
+int32_t AConfiguration_match(AConfiguration* base, AConfiguration* requested);
+
+/**
+ * Determine whether the configuration in 'test' is better than the existing
+ * configuration in 'base'.  If 'requested' is non-NULL, this decision is based
+ * on the overall configuration given there.  If it is NULL, this decision is
+ * simply based on which configuration is more specific.  Returns non-0 if
+ * 'test' is better than 'base'.
+ *
+ * This assumes you have already filtered the configurations with
+ * AConfiguration_match().
+ */
+int32_t AConfiguration_isBetterThan(AConfiguration* base, AConfiguration* test,
+        AConfiguration* requested);
+
+__END_DECLS
+
+#endif /* ANDROID_CONFIGURATION_H */
diff --git a/ndk/platforms/android-9/include/android/input.h b/ndk/platforms/android-9/include/android/input.h
new file mode 100644
index 0000000..ae96c50
--- /dev/null
+++ b/ndk/platforms/android-9/include/android/input.h
@@ -0,0 +1,680 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _ANDROID_INPUT_H
+#define _ANDROID_INPUT_H
+
+/******************************************************************
+ *
+ * IMPORTANT NOTICE:
+ *
+ *   This file is part of Android's set of stable system headers
+ *   exposed by the Android NDK (Native Development Kit).
+ *
+ *   Third-party source AND binary code relies on the definitions
+ *   here to be FROZEN ON ALL UPCOMING PLATFORM RELEASES.
+ *
+ *   - DO NOT MODIFY ENUMS (EXCEPT IF YOU ADD NEW 32-BIT VALUES)
+ *   - DO NOT MODIFY CONSTANTS OR FUNCTIONAL MACROS
+ *   - DO NOT CHANGE THE SIGNATURE OF FUNCTIONS IN ANY WAY
+ *   - DO NOT CHANGE THE LAYOUT OR SIZE OF STRUCTURES
+ */
+
+/*
+ * Structures and functions to receive and process input events in
+ * native code.
+ *
+ * NOTE: These functions MUST be implemented by /system/lib/libui.so
+ */
+
+#include <stdint.h>
+#include <sys/types.h>
+#include <android/keycodes.h>
+#include <android/looper.h>
+
+__BEGIN_DECLS
+
+/*
+ * Key states (may be returned by queries about the current state of a
+ * particular key code, scan code or switch).
+ */
+enum {
+    /* The key state is unknown or the requested key itself is not supported. */
+    AKEY_STATE_UNKNOWN = -1,
+
+    /* The key is up. */
+    AKEY_STATE_UP = 0,
+
+    /* The key is down. */
+    AKEY_STATE_DOWN = 1,
+
+    /* The key is down but is a virtual key press that is being emulated by the system. */
+    AKEY_STATE_VIRTUAL = 2
+};
+
+/*
+ * Meta key / modifer state.
+ */
+enum {
+    /* No meta keys are pressed. */
+    AMETA_NONE = 0,
+
+    /* This mask is used to check whether one of the ALT meta keys is pressed. */
+    AMETA_ALT_ON = 0x02,
+
+    /* This mask is used to check whether the left ALT meta key is pressed. */
+    AMETA_ALT_LEFT_ON = 0x10,
+
+    /* This mask is used to check whether the right ALT meta key is pressed. */
+    AMETA_ALT_RIGHT_ON = 0x20,
+
+    /* This mask is used to check whether one of the SHIFT meta keys is pressed. */
+    AMETA_SHIFT_ON = 0x01,
+
+    /* This mask is used to check whether the left SHIFT meta key is pressed. */
+    AMETA_SHIFT_LEFT_ON = 0x40,
+
+    /* This mask is used to check whether the right SHIFT meta key is pressed. */
+    AMETA_SHIFT_RIGHT_ON = 0x80,
+
+    /* This mask is used to check whether the SYM meta key is pressed. */
+    AMETA_SYM_ON = 0x04
+};
+
+/*
+ * Input events.
+ *
+ * Input events are opaque structures.  Use the provided accessors functions to
+ * read their properties.
+ */
+struct AInputEvent;
+typedef struct AInputEvent AInputEvent;
+
+/*
+ * Input event types.
+ */
+enum {
+    /* Indicates that the input event is a key event. */
+    AINPUT_EVENT_TYPE_KEY = 1,
+
+    /* Indicates that the input event is a motion event. */
+    AINPUT_EVENT_TYPE_MOTION = 2
+};
+
+/*
+ * Key event actions.
+ */
+enum {
+    /* The key has been pressed down. */
+    AKEY_EVENT_ACTION_DOWN = 0,
+
+    /* The key has been released. */
+    AKEY_EVENT_ACTION_UP = 1,
+
+    /* Multiple duplicate key events have occurred in a row, or a complex string is
+     * being delivered.  The repeat_count property of the key event contains the number
+     * of times the given key code should be executed.
+     */
+    AKEY_EVENT_ACTION_MULTIPLE = 2
+};
+
+/*
+ * Key event flags.
+ */
+enum {
+    /* This mask is set if the device woke because of this key event. */
+    AKEY_EVENT_FLAG_WOKE_HERE = 0x1,
+
+    /* This mask is set if the key event was generated by a software keyboard. */
+    AKEY_EVENT_FLAG_SOFT_KEYBOARD = 0x2,
+
+    /* This mask is set if we don't want the key event to cause us to leave touch mode. */
+    AKEY_EVENT_FLAG_KEEP_TOUCH_MODE = 0x4,
+
+    /* This mask is set if an event was known to come from a trusted part
+     * of the system.  That is, the event is known to come from the user,
+     * and could not have been spoofed by a third party component. */
+    AKEY_EVENT_FLAG_FROM_SYSTEM = 0x8,
+
+    /* This mask is used for compatibility, to identify enter keys that are
+     * coming from an IME whose enter key has been auto-labelled "next" or
+     * "done".  This allows TextView to dispatch these as normal enter keys
+     * for old applications, but still do the appropriate action when
+     * receiving them. */
+    AKEY_EVENT_FLAG_EDITOR_ACTION = 0x10,
+
+    /* When associated with up key events, this indicates that the key press
+     * has been canceled.  Typically this is used with virtual touch screen
+     * keys, where the user can slide from the virtual key area on to the
+     * display: in that case, the application will receive a canceled up
+     * event and should not perform the action normally associated with the
+     * key.  Note that for this to work, the application can not perform an
+     * action for a key until it receives an up or the long press timeout has
+     * expired. */
+    AKEY_EVENT_FLAG_CANCELED = 0x20,
+
+    /* This key event was generated by a virtual (on-screen) hard key area.
+     * Typically this is an area of the touchscreen, outside of the regular
+     * display, dedicated to "hardware" buttons. */
+    AKEY_EVENT_FLAG_VIRTUAL_HARD_KEY = 0x40,
+
+    /* This flag is set for the first key repeat that occurs after the
+     * long press timeout. */
+    AKEY_EVENT_FLAG_LONG_PRESS = 0x80,
+
+    /* Set when a key event has AKEY_EVENT_FLAG_CANCELED set because a long
+     * press action was executed while it was down. */
+    AKEY_EVENT_FLAG_CANCELED_LONG_PRESS = 0x100,
+
+    /* Set for AKEY_EVENT_ACTION_UP when this event's key code is still being
+     * tracked from its initial down.  That is, somebody requested that tracking
+     * started on the key down and a long press has not caused
+     * the tracking to be canceled. */
+    AKEY_EVENT_FLAG_TRACKING = 0x200
+};
+
+/*
+ * Motion event actions.
+ */
+
+/* Bit shift for the action bits holding the pointer index as
+ * defined by AMOTION_EVENT_ACTION_POINTER_INDEX_MASK.
+ */
+#define AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT 8
+
+enum {
+    /* Bit mask of the parts of the action code that are the action itself.
+     */
+    AMOTION_EVENT_ACTION_MASK = 0xff,
+
+    /* Bits in the action code that represent a pointer index, used with
+     * AMOTION_EVENT_ACTION_POINTER_DOWN and AMOTION_EVENT_ACTION_POINTER_UP.  Shifting
+     * down by AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT provides the actual pointer
+     * index where the data for the pointer going up or down can be found.
+     */
+    AMOTION_EVENT_ACTION_POINTER_INDEX_MASK  = 0xff00,
+
+    /* A pressed gesture has started, the motion contains the initial starting location.
+     */
+    AMOTION_EVENT_ACTION_DOWN = 0,
+
+    /* A pressed gesture has finished, the motion contains the final release location
+     * as well as any intermediate points since the last down or move event.
+     */
+    AMOTION_EVENT_ACTION_UP = 1,
+
+    /* A change has happened during a press gesture (between AMOTION_EVENT_ACTION_DOWN and
+     * AMOTION_EVENT_ACTION_UP).  The motion contains the most recent point, as well as
+     * any intermediate points since the last down or move event.
+     */
+    AMOTION_EVENT_ACTION_MOVE = 2,
+
+    /* The current gesture has been aborted.
+     * You will not receive any more points in it.  You should treat this as
+     * an up event, but not perform any action that you normally would.
+     */
+    AMOTION_EVENT_ACTION_CANCEL = 3,
+
+    /* A movement has happened outside of the normal bounds of the UI element.
+     * This does not provide a full gesture, but only the initial location of the movement/touch.
+     */
+    AMOTION_EVENT_ACTION_OUTSIDE = 4,
+
+    /* A non-primary pointer has gone down.
+     * The bits in AMOTION_EVENT_ACTION_POINTER_INDEX_MASK indicate which pointer changed.
+     */
+    AMOTION_EVENT_ACTION_POINTER_DOWN = 5,
+
+    /* A non-primary pointer has gone up.
+     * The bits in AMOTION_EVENT_ACTION_POINTER_INDEX_MASK indicate which pointer changed.
+     */
+    AMOTION_EVENT_ACTION_POINTER_UP = 6
+};
+
+/*
+ * Motion event flags.
+ */
+enum {
+    /* This flag indicates that the window that received this motion event is partly
+     * or wholly obscured by another visible window above it.  This flag is set to true
+     * even if the event did not directly pass through the obscured area.
+     * A security sensitive application can check this flag to identify situations in which
+     * a malicious application may have covered up part of its content for the purpose
+     * of misleading the user or hijacking touches.  An appropriate response might be
+     * to drop the suspect touches or to take additional precautions to confirm the user's
+     * actual intent.
+     */
+    AMOTION_EVENT_FLAG_WINDOW_IS_OBSCURED = 0x1,
+};
+
+/*
+ * Motion event edge touch flags.
+ */
+enum {
+    /* No edges intersected */
+    AMOTION_EVENT_EDGE_FLAG_NONE = 0,
+
+    /* Flag indicating the motion event intersected the top edge of the screen. */
+    AMOTION_EVENT_EDGE_FLAG_TOP = 0x01,
+
+    /* Flag indicating the motion event intersected the bottom edge of the screen. */
+    AMOTION_EVENT_EDGE_FLAG_BOTTOM = 0x02,
+
+    /* Flag indicating the motion event intersected the left edge of the screen. */
+    AMOTION_EVENT_EDGE_FLAG_LEFT = 0x04,
+
+    /* Flag indicating the motion event intersected the right edge of the screen. */
+    AMOTION_EVENT_EDGE_FLAG_RIGHT = 0x08
+};
+
+/*
+ * Input sources.
+ *
+ * Refer to the documentation on android.view.InputDevice for more details about input sources
+ * and their correct interpretation.
+ */
+enum {
+    AINPUT_SOURCE_CLASS_MASK = 0x000000ff,
+
+    AINPUT_SOURCE_CLASS_BUTTON = 0x00000001,
+    AINPUT_SOURCE_CLASS_POINTER = 0x00000002,
+    AINPUT_SOURCE_CLASS_NAVIGATION = 0x00000004,
+    AINPUT_SOURCE_CLASS_POSITION = 0x00000008,
+};
+
+enum {
+    AINPUT_SOURCE_UNKNOWN = 0x00000000,
+
+    AINPUT_SOURCE_KEYBOARD = 0x00000100 | AINPUT_SOURCE_CLASS_BUTTON,
+    AINPUT_SOURCE_DPAD = 0x00000200 | AINPUT_SOURCE_CLASS_BUTTON,
+    AINPUT_SOURCE_TOUCHSCREEN = 0x00001000 | AINPUT_SOURCE_CLASS_POINTER,
+    AINPUT_SOURCE_MOUSE = 0x00002000 | AINPUT_SOURCE_CLASS_POINTER,
+    AINPUT_SOURCE_TRACKBALL = 0x00010000 | AINPUT_SOURCE_CLASS_NAVIGATION,
+    AINPUT_SOURCE_TOUCHPAD = 0x00100000 | AINPUT_SOURCE_CLASS_POSITION,
+};
+
+/*
+ * Keyboard types.
+ *
+ * Refer to the documentation on android.view.InputDevice for more details.
+ */
+enum {
+    AINPUT_KEYBOARD_TYPE_NONE = 0,
+    AINPUT_KEYBOARD_TYPE_NON_ALPHABETIC = 1,
+    AINPUT_KEYBOARD_TYPE_ALPHABETIC = 2,
+};
+
+/*
+ * Constants used to retrieve information about the range of motion for a particular
+ * coordinate of a motion event.
+ *
+ * Refer to the documentation on android.view.InputDevice for more details about input sources
+ * and their correct interpretation.
+ */
+enum {
+    AINPUT_MOTION_RANGE_X = 0,
+    AINPUT_MOTION_RANGE_Y = 1,
+    AINPUT_MOTION_RANGE_PRESSURE = 2,
+    AINPUT_MOTION_RANGE_SIZE = 3,
+    AINPUT_MOTION_RANGE_TOUCH_MAJOR = 4,
+    AINPUT_MOTION_RANGE_TOUCH_MINOR = 5,
+    AINPUT_MOTION_RANGE_TOOL_MAJOR = 6,
+    AINPUT_MOTION_RANGE_TOOL_MINOR = 7,
+    AINPUT_MOTION_RANGE_ORIENTATION = 8,
+};
+
+
+/*
+ * Input event accessors.
+ *
+ * Note that most functions can only be used on input events that are of a given type.
+ * Calling these functions on input events of other types will yield undefined behavior.
+ */
+
+/*** Accessors for all input events. ***/
+
+/* Get the input event type. */
+int32_t AInputEvent_getType(const AInputEvent* event);
+
+/* Get the id for the device that an input event came from.
+ *
+ * Input events can be generated by multiple different input devices.
+ * Use the input device id to obtain information about the input
+ * device that was responsible for generating a particular event.
+ *
+ * An input device id of 0 indicates that the event didn't come from a physical device;
+ * other numbers are arbitrary and you shouldn't depend on the values.
+ * Use the provided input device query API to obtain information about input devices.
+ */
+int32_t AInputEvent_getDeviceId(const AInputEvent* event);
+
+/* Get the input event source. */
+int32_t AInputEvent_getSource(const AInputEvent* event);
+
+/*** Accessors for key events only. ***/
+
+/* Get the key event action. */
+int32_t AKeyEvent_getAction(const AInputEvent* key_event);
+
+/* Get the key event flags. */
+int32_t AKeyEvent_getFlags(const AInputEvent* key_event);
+
+/* Get the key code of the key event.
+ * This is the physical key that was pressed, not the Unicode character. */
+int32_t AKeyEvent_getKeyCode(const AInputEvent* key_event);
+
+/* Get the hardware key id of this key event.
+ * These values are not reliable and vary from device to device. */
+int32_t AKeyEvent_getScanCode(const AInputEvent* key_event);
+
+/* Get the meta key state. */
+int32_t AKeyEvent_getMetaState(const AInputEvent* key_event);
+
+/* Get the repeat count of the event.
+ * For both key up an key down events, this is the number of times the key has
+ * repeated with the first down starting at 0 and counting up from there.  For
+ * multiple key events, this is the number of down/up pairs that have occurred. */
+int32_t AKeyEvent_getRepeatCount(const AInputEvent* key_event);
+
+/* Get the time of the most recent key down event, in the
+ * java.lang.System.nanoTime() time base.  If this is a down event,
+ * this will be the same as eventTime.
+ * Note that when chording keys, this value is the down time of the most recently
+ * pressed key, which may not be the same physical key of this event. */
+int64_t AKeyEvent_getDownTime(const AInputEvent* key_event);
+
+/* Get the time this event occurred, in the
+ * java.lang.System.nanoTime() time base. */
+int64_t AKeyEvent_getEventTime(const AInputEvent* key_event);
+
+/*** Accessors for motion events only. ***/
+
+/* Get the combined motion event action code and pointer index. */
+int32_t AMotionEvent_getAction(const AInputEvent* motion_event);
+
+/* Get the motion event flags. */
+int32_t AMotionEvent_getFlags(const AInputEvent* motion_event);
+
+/* Get the state of any meta / modifier keys that were in effect when the
+ * event was generated. */
+int32_t AMotionEvent_getMetaState(const AInputEvent* motion_event);
+
+/* Get a bitfield indicating which edges, if any, were touched by this motion event.
+ * For touch events, clients can use this to determine if the user's finger was
+ * touching the edge of the display. */
+int32_t AMotionEvent_getEdgeFlags(const AInputEvent* motion_event);
+
+/* Get the time when the user originally pressed down to start a stream of
+ * position events, in the java.lang.System.nanoTime() time base. */
+int64_t AMotionEvent_getDownTime(const AInputEvent* motion_event);
+
+/* Get the time when this specific event was generated,
+ * in the java.lang.System.nanoTime() time base. */
+int64_t AMotionEvent_getEventTime(const AInputEvent* motion_event);
+
+/* Get the X coordinate offset.
+ * For touch events on the screen, this is the delta that was added to the raw
+ * screen coordinates to adjust for the absolute position of the containing windows
+ * and views. */
+float AMotionEvent_getXOffset(const AInputEvent* motion_event);
+
+/* Get the precision of the Y coordinates being reported.
+ * For touch events on the screen, this is the delta that was added to the raw
+ * screen coordinates to adjust for the absolute position of the containing windows
+ * and views. */
+float AMotionEvent_getYOffset(const AInputEvent* motion_event);
+
+/* Get the precision of the X coordinates being reported.
+ * You can multiply this number with an X coordinate sample to find the
+ * actual hardware value of the X coordinate. */
+float AMotionEvent_getXPrecision(const AInputEvent* motion_event);
+
+/* Get the precision of the Y coordinates being reported.
+ * You can multiply this number with a Y coordinate sample to find the
+ * actual hardware value of the Y coordinate. */
+float AMotionEvent_getYPrecision(const AInputEvent* motion_event);
+
+/* Get the number of pointers of data contained in this event.
+ * Always >= 1. */
+size_t AMotionEvent_getPointerCount(const AInputEvent* motion_event);
+
+/* Get the pointer identifier associated with a particular pointer
+ * data index is this event.  The identifier tells you the actual pointer
+ * number associated with the data, accounting for individual pointers
+ * going up and down since the start of the current gesture. */
+int32_t AMotionEvent_getPointerId(const AInputEvent* motion_event, size_t pointer_index);
+
+/* Get the original raw X coordinate of this event.
+ * For touch events on the screen, this is the original location of the event
+ * on the screen, before it had been adjusted for the containing window
+ * and views. */
+float AMotionEvent_getRawX(const AInputEvent* motion_event, size_t pointer_index);
+
+/* Get the original raw X coordinate of this event.
+ * For touch events on the screen, this is the original location of the event
+ * on the screen, before it had been adjusted for the containing window
+ * and views. */
+float AMotionEvent_getRawY(const AInputEvent* motion_event, size_t pointer_index);
+
+/* Get the current X coordinate of this event for the given pointer index.
+ * Whole numbers are pixels; the value may have a fraction for input devices
+ * that are sub-pixel precise. */
+float AMotionEvent_getX(const AInputEvent* motion_event, size_t pointer_index);
+
+/* Get the current Y coordinate of this event for the given pointer index.
+ * Whole numbers are pixels; the value may have a fraction for input devices
+ * that are sub-pixel precise. */
+float AMotionEvent_getY(const AInputEvent* motion_event, size_t pointer_index);
+
+/* Get the current pressure of this event for the given pointer index.
+ * The pressure generally ranges from 0 (no pressure at all) to 1 (normal pressure),
+ * however values higher than 1 may be generated depending on the calibration of
+ * the input device. */
+float AMotionEvent_getPressure(const AInputEvent* motion_event, size_t pointer_index);
+
+/* Get the current scaled value of the approximate size for the given pointer index.
+ * This represents some approximation of the area of the screen being
+ * pressed; the actual value in pixels corresponding to the
+ * touch is normalized with the device specific range of values
+ * and scaled to a value between 0 and 1.  The value of size can be used to
+ * determine fat touch events. */
+float AMotionEvent_getSize(const AInputEvent* motion_event, size_t pointer_index);
+
+/* Get the current length of the major axis of an ellipse that describes the touch area
+ * at the point of contact for the given pointer index. */
+float AMotionEvent_getTouchMajor(const AInputEvent* motion_event, size_t pointer_index);
+
+/* Get the current length of the minor axis of an ellipse that describes the touch area
+ * at the point of contact for the given pointer index. */
+float AMotionEvent_getTouchMinor(const AInputEvent* motion_event, size_t pointer_index);
+
+/* Get the current length of the major axis of an ellipse that describes the size
+ * of the approaching tool for the given pointer index.
+ * The tool area represents the estimated size of the finger or pen that is
+ * touching the device independent of its actual touch area at the point of contact. */
+float AMotionEvent_getToolMajor(const AInputEvent* motion_event, size_t pointer_index);
+
+/* Get the current length of the minor axis of an ellipse that describes the size
+ * of the approaching tool for the given pointer index.
+ * The tool area represents the estimated size of the finger or pen that is
+ * touching the device independent of its actual touch area at the point of contact. */
+float AMotionEvent_getToolMinor(const AInputEvent* motion_event, size_t pointer_index);
+
+/* Get the current orientation of the touch area and tool area in radians clockwise from
+ * vertical for the given pointer index.
+ * An angle of 0 degrees indicates that the major axis of contact is oriented
+ * upwards, is perfectly circular or is of unknown orientation.  A positive angle
+ * indicates that the major axis of contact is oriented to the right.  A negative angle
+ * indicates that the major axis of contact is oriented to the left.
+ * The full range is from -PI/2 radians (finger pointing fully left) to PI/2 radians
+ * (finger pointing fully right). */
+float AMotionEvent_getOrientation(const AInputEvent* motion_event, size_t pointer_index);
+
+/* Get the number of historical points in this event.  These are movements that
+ * have occurred between this event and the previous event.  This only applies
+ * to AMOTION_EVENT_ACTION_MOVE events -- all other actions will have a size of 0.
+ * Historical samples are indexed from oldest to newest. */
+size_t AMotionEvent_getHistorySize(const AInputEvent* motion_event);
+
+/* Get the time that a historical movement occurred between this event and
+ * the previous event, in the java.lang.System.nanoTime() time base. */
+int64_t AMotionEvent_getHistoricalEventTime(AInputEvent* motion_event,
+        size_t history_index);
+
+/* Get the historical raw X coordinate of this event for the given pointer index that
+ * occurred between this event and the previous motion event.
+ * For touch events on the screen, this is the original location of the event
+ * on the screen, before it had been adjusted for the containing window
+ * and views.
+ * Whole numbers are pixels; the value may have a fraction for input devices
+ * that are sub-pixel precise. */
+float AMotionEvent_getHistoricalRawX(const AInputEvent* motion_event, size_t pointer_index);
+
+/* Get the historical raw Y coordinate of this event for the given pointer index that
+ * occurred between this event and the previous motion event.
+ * For touch events on the screen, this is the original location of the event
+ * on the screen, before it had been adjusted for the containing window
+ * and views.
+ * Whole numbers are pixels; the value may have a fraction for input devices
+ * that are sub-pixel precise. */
+float AMotionEvent_getHistoricalRawY(const AInputEvent* motion_event, size_t pointer_index);
+
+/* Get the historical X coordinate of this event for the given pointer index that
+ * occurred between this event and the previous motion event.
+ * Whole numbers are pixels; the value may have a fraction for input devices
+ * that are sub-pixel precise. */
+float AMotionEvent_getHistoricalX(AInputEvent* motion_event, size_t pointer_index,
+        size_t history_index);
+
+/* Get the historical Y coordinate of this event for the given pointer index that
+ * occurred between this event and the previous motion event.
+ * Whole numbers are pixels; the value may have a fraction for input devices
+ * that are sub-pixel precise. */
+float AMotionEvent_getHistoricalY(AInputEvent* motion_event, size_t pointer_index,
+        size_t history_index);
+
+/* Get the historical pressure of this event for the given pointer index that
+ * occurred between this event and the previous motion event.
+ * The pressure generally ranges from 0 (no pressure at all) to 1 (normal pressure),
+ * however values higher than 1 may be generated depending on the calibration of
+ * the input device. */
+float AMotionEvent_getHistoricalPressure(AInputEvent* motion_event, size_t pointer_index,
+        size_t history_index);
+
+/* Get the current scaled value of the approximate size for the given pointer index that
+ * occurred between this event and the previous motion event.
+ * This represents some approximation of the area of the screen being
+ * pressed; the actual value in pixels corresponding to the
+ * touch is normalized with the device specific range of values
+ * and scaled to a value between 0 and 1.  The value of size can be used to
+ * determine fat touch events. */
+float AMotionEvent_getHistoricalSize(AInputEvent* motion_event, size_t pointer_index,
+        size_t history_index);
+
+/* Get the historical length of the major axis of an ellipse that describes the touch area
+ * at the point of contact for the given pointer index that
+ * occurred between this event and the previous motion event. */
+float AMotionEvent_getHistoricalTouchMajor(const AInputEvent* motion_event, size_t pointer_index,
+        size_t history_index);
+
+/* Get the historical length of the minor axis of an ellipse that describes the touch area
+ * at the point of contact for the given pointer index that
+ * occurred between this event and the previous motion event. */
+float AMotionEvent_getHistoricalTouchMinor(const AInputEvent* motion_event, size_t pointer_index,
+        size_t history_index);
+
+/* Get the historical length of the major axis of an ellipse that describes the size
+ * of the approaching tool for the given pointer index that
+ * occurred between this event and the previous motion event.
+ * The tool area represents the estimated size of the finger or pen that is
+ * touching the device independent of its actual touch area at the point of contact. */
+float AMotionEvent_getHistoricalToolMajor(const AInputEvent* motion_event, size_t pointer_index,
+        size_t history_index);
+
+/* Get the historical length of the minor axis of an ellipse that describes the size
+ * of the approaching tool for the given pointer index that
+ * occurred between this event and the previous motion event.
+ * The tool area represents the estimated size of the finger or pen that is
+ * touching the device independent of its actual touch area at the point of contact. */
+float AMotionEvent_getHistoricalToolMinor(const AInputEvent* motion_event, size_t pointer_index,
+        size_t history_index);
+
+/* Get the historical orientation of the touch area and tool area in radians clockwise from
+ * vertical for the given pointer index that
+ * occurred between this event and the previous motion event.
+ * An angle of 0 degrees indicates that the major axis of contact is oriented
+ * upwards, is perfectly circular or is of unknown orientation.  A positive angle
+ * indicates that the major axis of contact is oriented to the right.  A negative angle
+ * indicates that the major axis of contact is oriented to the left.
+ * The full range is from -PI/2 radians (finger pointing fully left) to PI/2 radians
+ * (finger pointing fully right). */
+float AMotionEvent_getHistoricalOrientation(const AInputEvent* motion_event, size_t pointer_index,
+        size_t history_index);
+
+
+/*
+ * Input queue
+ *
+ * An input queue is the facility through which you retrieve input
+ * events.
+ */
+struct AInputQueue;
+typedef struct AInputQueue AInputQueue;
+
+/*
+ * Add this input queue to a looper for processing.  See
+ * ALooper_addFd() for information on the ident, callback, and data params.
+ */
+void AInputQueue_attachLooper(AInputQueue* queue, ALooper* looper,
+        int ident, ALooper_callbackFunc callback, void* data);
+
+/*
+ * Remove the input queue from the looper it is currently attached to.
+ */
+void AInputQueue_detachLooper(AInputQueue* queue);
+
+/*
+ * Returns true if there are one or more events available in the
+ * input queue.  Returns 1 if the queue has events; 0 if
+ * it does not have events; and a negative value if there is an error.
+ */
+int32_t AInputQueue_hasEvents(AInputQueue* queue);
+
+/*
+ * Returns the next available event from the queue.  Returns a negative
+ * value if no events are available or an error has occurred.
+ */
+int32_t AInputQueue_getEvent(AInputQueue* queue, AInputEvent** outEvent);
+
+/*
+ * Sends the key for standard pre-dispatching -- that is, possibly deliver
+ * it to the current IME to be consumed before the app.  Returns 0 if it
+ * was not pre-dispatched, meaning you can process it right now.  If non-zero
+ * is returned, you must abandon the current event processing and allow the
+ * event to appear again in the event queue (if it does not get consumed during
+ * pre-dispatching).
+ */
+int32_t AInputQueue_preDispatchEvent(AInputQueue* queue, AInputEvent* event);
+
+/*
+ * Report that dispatching has finished with the given event.
+ * This must be called after receiving an event with AInputQueue_get_event().
+ */
+void AInputQueue_finishEvent(AInputQueue* queue, AInputEvent* event, int handled);
+
+__END_DECLS
+
+#endif /* _ANDROID_INPUT_H */
diff --git a/ndk/platforms/android-9/include/android/keycodes.h b/ndk/platforms/android-9/include/android/keycodes.h
new file mode 100644
index 0000000..be0550a
--- /dev/null
+++ b/ndk/platforms/android-9/include/android/keycodes.h
@@ -0,0 +1,163 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _ANDROID_KEYCODES_H
+#define _ANDROID_KEYCODES_H
+
+/******************************************************************
+ *
+ * IMPORTANT NOTICE:
+ *
+ *   This file is part of Android's set of stable system headers
+ *   exposed by the Android NDK (Native Development Kit).
+ *
+ *   Third-party source AND binary code relies on the definitions
+ *   here to be FROZEN ON ALL UPCOMING PLATFORM RELEASES.
+ *
+ *   - DO NOT MODIFY ENUMS (EXCEPT IF YOU ADD NEW 32-BIT VALUES)
+ *   - DO NOT MODIFY CONSTANTS OR FUNCTIONAL MACROS
+ *   - DO NOT CHANGE THE SIGNATURE OF FUNCTIONS IN ANY WAY
+ *   - DO NOT CHANGE THE LAYOUT OR SIZE OF STRUCTURES
+ */
+
+#include <sys/cdefs.h>
+#include <sys/types.h>
+
+__BEGIN_DECLS
+
+/*
+ * Key codes.
+ */
+enum {
+    AKEYCODE_UNKNOWN         = 0,
+    AKEYCODE_SOFT_LEFT       = 1,
+    AKEYCODE_SOFT_RIGHT      = 2,
+    AKEYCODE_HOME            = 3,
+    AKEYCODE_BACK            = 4,
+    AKEYCODE_CALL            = 5,
+    AKEYCODE_ENDCALL         = 6,
+    AKEYCODE_0               = 7,
+    AKEYCODE_1               = 8,
+    AKEYCODE_2               = 9,
+    AKEYCODE_3               = 10,
+    AKEYCODE_4               = 11,
+    AKEYCODE_5               = 12,
+    AKEYCODE_6               = 13,
+    AKEYCODE_7               = 14,
+    AKEYCODE_8               = 15,
+    AKEYCODE_9               = 16,
+    AKEYCODE_STAR            = 17,
+    AKEYCODE_POUND           = 18,
+    AKEYCODE_DPAD_UP         = 19,
+    AKEYCODE_DPAD_DOWN       = 20,
+    AKEYCODE_DPAD_LEFT       = 21,
+    AKEYCODE_DPAD_RIGHT      = 22,
+    AKEYCODE_DPAD_CENTER     = 23,
+    AKEYCODE_VOLUME_UP       = 24,
+    AKEYCODE_VOLUME_DOWN     = 25,
+    AKEYCODE_POWER           = 26,
+    AKEYCODE_CAMERA          = 27,
+    AKEYCODE_CLEAR           = 28,
+    AKEYCODE_A               = 29,
+    AKEYCODE_B               = 30,
+    AKEYCODE_C               = 31,
+    AKEYCODE_D               = 32,
+    AKEYCODE_E               = 33,
+    AKEYCODE_F               = 34,
+    AKEYCODE_G               = 35,
+    AKEYCODE_H               = 36,
+    AKEYCODE_I               = 37,
+    AKEYCODE_J               = 38,
+    AKEYCODE_K               = 39,
+    AKEYCODE_L               = 40,
+    AKEYCODE_M               = 41,
+    AKEYCODE_N               = 42,
+    AKEYCODE_O               = 43,
+    AKEYCODE_P               = 44,
+    AKEYCODE_Q               = 45,
+    AKEYCODE_R               = 46,
+    AKEYCODE_S               = 47,
+    AKEYCODE_T               = 48,
+    AKEYCODE_U               = 49,
+    AKEYCODE_V               = 50,
+    AKEYCODE_W               = 51,
+    AKEYCODE_X               = 52,
+    AKEYCODE_Y               = 53,
+    AKEYCODE_Z               = 54,
+    AKEYCODE_COMMA           = 55,
+    AKEYCODE_PERIOD          = 56,
+    AKEYCODE_ALT_LEFT        = 57,
+    AKEYCODE_ALT_RIGHT       = 58,
+    AKEYCODE_SHIFT_LEFT      = 59,
+    AKEYCODE_SHIFT_RIGHT     = 60,
+    AKEYCODE_TAB             = 61,
+    AKEYCODE_SPACE           = 62,
+    AKEYCODE_SYM             = 63,
+    AKEYCODE_EXPLORER        = 64,
+    AKEYCODE_ENVELOPE        = 65,
+    AKEYCODE_ENTER           = 66,
+    AKEYCODE_DEL             = 67,
+    AKEYCODE_GRAVE           = 68,
+    AKEYCODE_MINUS           = 69,
+    AKEYCODE_EQUALS          = 70,
+    AKEYCODE_LEFT_BRACKET    = 71,
+    AKEYCODE_RIGHT_BRACKET   = 72,
+    AKEYCODE_BACKSLASH       = 73,
+    AKEYCODE_SEMICOLON       = 74,
+    AKEYCODE_APOSTROPHE      = 75,
+    AKEYCODE_SLASH           = 76,
+    AKEYCODE_AT              = 77,
+    AKEYCODE_NUM             = 78,
+    AKEYCODE_HEADSETHOOK     = 79,
+    AKEYCODE_FOCUS           = 80,   // *Camera* focus
+    AKEYCODE_PLUS            = 81,
+    AKEYCODE_MENU            = 82,
+    AKEYCODE_NOTIFICATION    = 83,
+    AKEYCODE_SEARCH          = 84,
+    AKEYCODE_MEDIA_PLAY_PAUSE= 85,
+    AKEYCODE_MEDIA_STOP      = 86,
+    AKEYCODE_MEDIA_NEXT      = 87,
+    AKEYCODE_MEDIA_PREVIOUS  = 88,
+    AKEYCODE_MEDIA_REWIND    = 89,
+    AKEYCODE_MEDIA_FAST_FORWARD = 90,
+    AKEYCODE_MUTE            = 91,
+    AKEYCODE_PAGE_UP         = 92,
+    AKEYCODE_PAGE_DOWN       = 93,
+    AKEYCODE_PICTSYMBOLS     = 94,
+    AKEYCODE_SWITCH_CHARSET  = 95,
+    AKEYCODE_BUTTON_A        = 96,
+    AKEYCODE_BUTTON_B        = 97,
+    AKEYCODE_BUTTON_C        = 98,
+    AKEYCODE_BUTTON_X        = 99,
+    AKEYCODE_BUTTON_Y        = 100,
+    AKEYCODE_BUTTON_Z        = 101,
+    AKEYCODE_BUTTON_L1       = 102,
+    AKEYCODE_BUTTON_R1       = 103,
+    AKEYCODE_BUTTON_L2       = 104,
+    AKEYCODE_BUTTON_R2       = 105,
+    AKEYCODE_BUTTON_THUMBL   = 106,
+    AKEYCODE_BUTTON_THUMBR   = 107,
+    AKEYCODE_BUTTON_START    = 108,
+    AKEYCODE_BUTTON_SELECT   = 109,
+    AKEYCODE_BUTTON_MODE     = 110,
+
+    // NOTE: If you add a new keycode here you must also add it to several other files.
+    //       Refer to frameworks/base/core/java/android/view/KeyEvent.java for the full list.
+};
+
+__END_DECLS
+
+#endif /* _ANDROID_KEYCODES_H */
diff --git a/ndk/platforms/android-9/include/android/looper.h b/ndk/platforms/android-9/include/android/looper.h
new file mode 100644
index 0000000..9b7438b
--- /dev/null
+++ b/ndk/platforms/android-9/include/android/looper.h
@@ -0,0 +1,253 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#ifndef ANDROID_LOOPER_H
+#define ANDROID_LOOPER_H
+
+#include <sys/cdefs.h>
+
+__BEGIN_DECLS
+
+/**
+ * ALooper
+ *
+ * A looper is the state tracking an event loop for a thread.
+ * Loopers do not define event structures or other such things; rather
+ * they are a lower-level facility to attach one or more discrete objects
+ * listening for an event.  An "event" here is simply data available on
+ * a file descriptor: each attached object has an associated file descriptor,
+ * and waiting for "events" means (internally) polling on all of these file
+ * descriptors until one or more of them have data available.
+ *
+ * A thread can have only one ALooper associated with it.
+ */
+struct ALooper;
+typedef struct ALooper ALooper;
+
+/**
+ * Returns the looper associated with the calling thread, or NULL if
+ * there is not one.
+ */
+ALooper* ALooper_forThread();
+
+enum {
+    /**
+     * Option for ALooper_prepare: this looper will accept calls to
+     * ALooper_addFd() that do not have a callback (that is provide NULL
+     * for the callback).  In this case the caller of ALooper_pollOnce()
+     * or ALooper_pollAll() MUST check the return from these functions to
+     * discover when data is available on such fds and process it.
+     */
+    ALOOPER_PREPARE_ALLOW_NON_CALLBACKS = 1<<0
+};
+
+/**
+ * Prepares a looper associated with the calling thread, and returns it.
+ * If the thread already has a looper, it is returned.  Otherwise, a new
+ * one is created, associated with the thread, and returned.
+ *
+ * The opts may be ALOOPER_PREPARE_ALLOW_NON_CALLBACKS or 0.
+ */
+ALooper* ALooper_prepare(int opts);
+
+enum {
+    /**
+     * Result from ALooper_pollOnce() and ALooper_pollAll():
+     * The poll was awoken using wake() before the timeout expired
+     * and no callbacks were executed and no other file descriptors were ready.
+     */
+    ALOOPER_POLL_WAKE = -1,
+
+    /**
+     * Result from ALooper_pollOnce() and ALooper_pollAll():
+     * One or more callbacks were executed.
+     */
+    ALOOPER_POLL_CALLBACK = -2,
+
+    /**
+     * Result from ALooper_pollOnce() and ALooper_pollAll():
+     * The timeout expired.
+     */
+    ALOOPER_POLL_TIMEOUT = -3,
+
+    /**
+     * Result from ALooper_pollOnce() and ALooper_pollAll():
+     * An error occurred.
+     */
+    ALOOPER_POLL_ERROR = -4,
+};
+
+/**
+ * Acquire a reference on the given ALooper object.  This prevents the object
+ * from being deleted until the reference is removed.  This is only needed
+ * to safely hand an ALooper from one thread to another.
+ */
+void ALooper_acquire(ALooper* looper);
+
+/**
+ * Remove a reference that was previously acquired with ALooper_acquire().
+ */
+void ALooper_release(ALooper* looper);
+
+/**
+ * Flags for file descriptor events that a looper can monitor.
+ *
+ * These flag bits can be combined to monitor multiple events at once.
+ */
+enum {
+    /**
+     * The file descriptor is available for read operations.
+     */
+    ALOOPER_EVENT_INPUT = 1 << 0,
+
+    /**
+     * The file descriptor is available for write operations.
+     */
+    ALOOPER_EVENT_OUTPUT = 1 << 1,
+
+    /**
+     * The file descriptor has encountered an error condition.
+     *
+     * The looper always sends notifications about errors; it is not necessary
+     * to specify this event flag in the requested event set.
+     */
+    ALOOPER_EVENT_ERROR = 1 << 2,
+
+    /**
+     * The file descriptor was hung up.
+     * For example, indicates that the remote end of a pipe or socket was closed.
+     *
+     * The looper always sends notifications about hangups; it is not necessary
+     * to specify this event flag in the requested event set.
+     */
+    ALOOPER_EVENT_HANGUP = 1 << 3,
+
+    /**
+     * The file descriptor is invalid.
+     * For example, the file descriptor was closed prematurely.
+     *
+     * The looper always sends notifications about invalid file descriptors; it is not necessary
+     * to specify this event flag in the requested event set.
+     */
+    ALOOPER_EVENT_INVALID = 1 << 4,
+};
+
+/**
+ * For callback-based event loops, this is the prototype of the function
+ * that is called.  It is given the file descriptor it is associated with,
+ * a bitmask of the poll events that were triggered (typically ALOOPER_EVENT_INPUT),
+ * and the data pointer that was originally supplied.
+ *
+ * Implementations should return 1 to continue receiving callbacks, or 0
+ * to have this file descriptor and callback unregistered from the looper.
+ */
+typedef int (*ALooper_callbackFunc)(int fd, int events, void* data);
+
+/**
+ * Waits for events to be available, with optional timeout in milliseconds.
+ * Invokes callbacks for all file descriptors on which an event occurred.
+ *
+ * If the timeout is zero, returns immediately without blocking.
+ * If the timeout is negative, waits indefinitely until an event appears.
+ *
+ * Returns ALOOPER_POLL_WAKE if the poll was awoken using wake() before
+ * the timeout expired and no callbacks were invoked and no other file
+ * descriptors were ready.
+ *
+ * Returns ALOOPER_POLL_CALLBACK if one or more callbacks were invoked.
+ *
+ * Returns ALOOPER_POLL_TIMEOUT if there was no data before the given
+ * timeout expired.
+ *
+ * Returns ALOOPER_POLL_ERROR if an error occurred.
+ *
+ * Returns a value >= 0 containing an identifier if its file descriptor has data
+ * and it has no callback function (requiring the caller here to handle it).
+ * In this (and only this) case outFd, outEvents and outData will contain the poll
+ * events and data associated with the fd, otherwise they will be set to NULL.
+ *
+ * This method does not return until it has finished invoking the appropriate callbacks
+ * for all file descriptors that were signalled.
+ */
+int ALooper_pollOnce(int timeoutMillis, int* outFd, int* outEvents, void** outData);
+
+/**
+ * Like ALooper_pollOnce(), but performs all pending callbacks until all
+ * data has been consumed or a file descriptor is available with no callback.
+ * This function will never return ALOOPER_POLL_CALLBACK.
+ */
+int ALooper_pollAll(int timeoutMillis, int* outFd, int* outEvents, void** outData);
+
+/**
+ * Wakes the poll asynchronously.
+ *
+ * This method can be called on any thread.
+ * This method returns immediately.
+ */
+void ALooper_wake(ALooper* looper);
+
+/**
+ * Adds a new file descriptor to be polled by the looper.
+ * If the same file descriptor was previously added, it is replaced.
+ *
+ * "fd" is the file descriptor to be added.
+ * "ident" is an identifier for this event, which is returned from ALooper_pollOnce().
+ * The identifier must be >= 0, or ALOOPER_POLL_CALLBACK if providing a non-NULL callback.
+ * "events" are the poll events to wake up on.  Typically this is ALOOPER_EVENT_INPUT.
+ * "callback" is the function to call when there is an event on the file descriptor.
+ * "data" is a private data pointer to supply to the callback.
+ *
+ * There are two main uses of this function:
+ *
+ * (1) If "callback" is non-NULL, then this function will be called when there is
+ * data on the file descriptor.  It should execute any events it has pending,
+ * appropriately reading from the file descriptor.  The 'ident' is ignored in this case.
+ *
+ * (2) If "callback" is NULL, the 'ident' will be returned by ALooper_pollOnce
+ * when its file descriptor has data available, requiring the caller to take
+ * care of processing it.
+ *
+ * Returns 1 if the file descriptor was added or -1 if an error occurred.
+ *
+ * This method can be called on any thread.
+ * This method may block briefly if it needs to wake the poll.
+ */
+int ALooper_addFd(ALooper* looper, int fd, int ident, int events,
+        ALooper_callbackFunc callback, void* data);
+
+/**
+ * Removes a previously added file descriptor from the looper.
+ *
+ * When this method returns, it is safe to close the file descriptor since the looper
+ * will no longer have a reference to it.  However, it is possible for the callback to
+ * already be running or for it to run one last time if the file descriptor was already
+ * signalled.  Calling code is responsible for ensuring that this case is safely handled.
+ * For example, if the callback takes care of removing itself during its own execution either
+ * by returning 0 or by calling this method, then it can be guaranteed to not be invoked
+ * again at any later time unless registered anew.
+ *
+ * Returns 1 if the file descriptor was removed, 0 if none was previously registered
+ * or -1 if an error occurred.
+ *
+ * This method can be called on any thread.
+ * This method may block briefly if it needs to wake the poll.
+ */
+int ALooper_removeFd(ALooper* looper, int fd);
+
+__END_DECLS
+
+#endif /* ANDROID_NATIVE_WINDOW_H */
diff --git a/ndk/platforms/android-9/include/android/native_activity.h b/ndk/platforms/android-9/include/android/native_activity.h
new file mode 100644
index 0000000..0bff86d
--- /dev/null
+++ b/ndk/platforms/android-9/include/android/native_activity.h
@@ -0,0 +1,292 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#ifndef ANDROID_NATIVE_ACTIVITY_H
+#define ANDROID_NATIVE_ACTIVITY_H
+
+#include <stdint.h>
+#include <sys/cdefs.h>
+#include <sys/types.h>
+
+#include <jni.h>
+
+#include <android/asset_manager.h>
+#include <android/input.h>
+#include <android/native_window.h>
+
+__BEGIN_DECLS
+
+struct ANativeActivityCallbacks;
+
+/**
+ * This structure defines the native side of an android.app.NativeActivity.
+ * It is created by the framework, and handed to the application's native
+ * code as it is being launched.
+ */
+typedef struct ANativeActivity {
+    /**
+     * Pointer to the callback function table of the native application.
+     * You can set the functions here to your own callbacks.  The callbacks
+     * pointer itself here should not be changed; it is allocated and managed
+     * for you by the framework.
+     */
+    struct ANativeActivityCallbacks* callbacks;
+
+    /**
+     * The global handle on the process's Java VM.
+     */
+    JavaVM* vm;
+
+    /**
+     * JNI context for the main thread of the app.  Note that this field
+     * can ONLY be used from the main thread of the process; that is, the
+     * thread that calls into the ANativeActivityCallbacks.
+     */
+    JNIEnv* env;
+
+    /**
+     * The NativeActivity Java class.
+     */
+    jobject clazz;
+
+    /**
+     * Path to this application's internal data directory.
+     */
+    const char* internalDataPath;
+
+    /**
+     * Path to this application's external (removable/mountable) data directory.
+     */
+    const char* externalDataPath;
+
+    /**
+     * The platform's SDK version code.
+     */
+    int32_t sdkVersion;
+
+    /**
+     * This is the native instance of the application.  It is not used by
+     * the framework, but can be set by the application to its own instance
+     * state.
+     */
+    void* instance;
+
+    /**
+     * Pointer to the Asset Manager instance for the application.  The application
+     * uses this to access binary assets bundled inside its own .apk file.
+     */
+    AAssetManager* assetManager;
+} ANativeActivity;
+
+/**
+ * These are the callbacks the framework makes into a native application.
+ * All of these callbacks happen on the main thread of the application.
+ * By default, all callbacks are NULL; set to a pointer to your own function
+ * to have it called.
+ */
+typedef struct ANativeActivityCallbacks {
+    /**
+     * NativeActivity has started.  See Java documentation for Activity.onStart()
+     * for more information.
+     */
+    void (*onStart)(ANativeActivity* activity);
+
+    /**
+     * NativeActivity has resumed.  See Java documentation for Activity.onResume()
+     * for more information.
+     */
+    void (*onResume)(ANativeActivity* activity);
+
+    /**
+     * Framework is asking NativeActivity to save its current instance state.
+     * See Java documentation for Activity.onSaveInstanceState() for more
+     * information.  The returned pointer needs to be created with malloc();
+     * the framework will call free() on it for you.  You also must fill in
+     * outSize with the number of bytes in the allocation.  Note that the
+     * saved state will be persisted, so it can not contain any active
+     * entities (pointers to memory, file descriptors, etc).
+     */
+    void* (*onSaveInstanceState)(ANativeActivity* activity, size_t* outSize);
+
+    /**
+     * NativeActivity has paused.  See Java documentation for Activity.onPause()
+     * for more information.
+     */
+    void (*onPause)(ANativeActivity* activity);
+
+    /**
+     * NativeActivity has stopped.  See Java documentation for Activity.onStop()
+     * for more information.
+     */
+    void (*onStop)(ANativeActivity* activity);
+
+    /**
+     * NativeActivity is being destroyed.  See Java documentation for Activity.onDestroy()
+     * for more information.
+     */
+    void (*onDestroy)(ANativeActivity* activity);
+
+    /**
+     * Focus has changed in this NativeActivity's window.  This is often used,
+     * for example, to pause a game when it loses input focus.
+     */
+    void (*onWindowFocusChanged)(ANativeActivity* activity, int hasFocus);
+
+    /**
+     * The drawing window for this native activity has been created.  You
+     * can use the given native window object to start drawing.
+     */
+    void (*onNativeWindowCreated)(ANativeActivity* activity, ANativeWindow* window);
+
+    /**
+     * The drawing window for this native activity has been resized.  You should
+     * retrieve the new size from the window and ensure that your rendering in
+     * it now matches.
+     */
+    void (*onNativeWindowResized)(ANativeActivity* activity, ANativeWindow* window);
+
+    /**
+     * The drawing window for this native activity needs to be redrawn.  To avoid
+     * transient artifacts during screen changes (such resizing after rotation),
+     * applications should not return from this function until they have finished
+     * drawing their window in its current state.
+     */
+    void (*onNativeWindowRedrawNeeded)(ANativeActivity* activity, ANativeWindow* window);
+
+    /**
+     * The drawing window for this native activity is going to be destroyed.
+     * You MUST ensure that you do not touch the window object after returning
+     * from this function: in the common case of drawing to the window from
+     * another thread, that means the implementation of this callback must
+     * properly synchronize with the other thread to stop its drawing before
+     * returning from here.
+     */
+    void (*onNativeWindowDestroyed)(ANativeActivity* activity, ANativeWindow* window);
+
+    /**
+     * The input queue for this native activity's window has been created.
+     * You can use the given input queue to start retrieving input events.
+     */
+    void (*onInputQueueCreated)(ANativeActivity* activity, AInputQueue* queue);
+
+    /**
+     * The input queue for this native activity's window is being destroyed.
+     * You should no longer try to reference this object upon returning from this
+     * function.
+     */
+    void (*onInputQueueDestroyed)(ANativeActivity* activity, AInputQueue* queue);
+
+    /**
+     * The rectangle in the window in which content should be placed has changed.
+     */
+    void (*onContentRectChanged)(ANativeActivity* activity, const ARect* rect);
+
+    /**
+     * The current device AConfiguration has changed.  The new configuration can
+     * be retrieved from assetManager.
+     */
+    void (*onConfigurationChanged)(ANativeActivity* activity);
+
+    /**
+     * The system is running low on memory.  Use this callback to release
+     * resources you do not need, to help the system avoid killing more
+     * important processes.
+     */
+    void (*onLowMemory)(ANativeActivity* activity);
+} ANativeActivityCallbacks;
+
+/**
+ * This is the function that must be in the native code to instantiate the
+ * application's native activity.  It is called with the activity instance (see
+ * above); if the code is being instantiated from a previously saved instance,
+ * the savedState will be non-NULL and point to the saved data.  You must make
+ * any copy of this data you need -- it will be released after you return from
+ * this function.
+ */
+typedef void ANativeActivity_createFunc(ANativeActivity* activity,
+        void* savedState, size_t savedStateSize);
+
+/**
+ * The name of the function that NativeInstance looks for when launching its
+ * native code.  This is the default function that is used, you can specify
+ * "android.app.func_name" string meta-data in your manifest to use a different
+ * function.
+ */
+extern ANativeActivity_createFunc ANativeActivity_onCreate;
+
+/**
+ * Finish the given activity.  Its finish() method will be called, causing it
+ * to be stopped and destroyed.  Note that this method can be called from
+ * *any* thread; it will send a message to the main thread of the process
+ * where the Java finish call will take place.
+ */
+void ANativeActivity_finish(ANativeActivity* activity);
+
+/**
+ * Change the window format of the given activity.  Calls getWindow().setFormat()
+ * of the given activity.  Note that this method can be called from
+ * *any* thread; it will send a message to the main thread of the process
+ * where the Java finish call will take place.
+ */
+void ANativeActivity_setWindowFormat(ANativeActivity* activity, int32_t format);
+
+/**
+ * Change the window flags of the given activity.  Calls getWindow().setFlags()
+ * of the given activity.  Note that this method can be called from
+ * *any* thread; it will send a message to the main thread of the process
+ * where the Java finish call will take place.  See window.h for flag constants.
+ */
+void ANativeActivity_setWindowFlags(ANativeActivity* activity,
+        uint32_t addFlags, uint32_t removeFlags);
+
+/**
+ * Flags for ANativeActivity_showSoftInput; see the Java InputMethodManager
+ * API for documentation.
+ */
+enum {
+    ANATIVEACTIVITY_SHOW_SOFT_INPUT_IMPLICIT = 0x0001,
+    ANATIVEACTIVITY_SHOW_SOFT_INPUT_FORCED = 0x0002,
+};
+
+/**
+ * Show the IME while in the given activity.  Calls InputMethodManager.showSoftInput()
+ * for the given activity.  Note that this method can be called from
+ * *any* thread; it will send a message to the main thread of the process
+ * where the Java finish call will take place.
+ */
+void ANativeActivity_showSoftInput(ANativeActivity* activity, uint32_t flags);
+
+/**
+ * Flags for ANativeActivity_hideSoftInput; see the Java InputMethodManager
+ * API for documentation.
+ */
+enum {
+    ANATIVEACTIVITY_HIDE_SOFT_INPUT_IMPLICIT_ONLY = 0x0001,
+    ANATIVEACTIVITY_HIDE_SOFT_INPUT_NOT_ALWAYS = 0x0002,
+};
+
+/**
+ * Hide the IME while in the given activity.  Calls InputMethodManager.hideSoftInput()
+ * for the given activity.  Note that this method can be called from
+ * *any* thread; it will send a message to the main thread of the process
+ * where the Java finish call will take place.
+ */
+void ANativeActivity_hideSoftInput(ANativeActivity* activity, uint32_t flags);
+
+__END_DECLS
+
+#endif /* ANDROID_NATIVE_ACTIVITY_H */
diff --git a/ndk/platforms/android-9/include/android/native_window.h b/ndk/platforms/android-9/include/android/native_window.h
new file mode 100644
index 0000000..75e68c1
--- /dev/null
+++ b/ndk/platforms/android-9/include/android/native_window.h
@@ -0,0 +1,114 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ANDROID_NATIVE_WINDOW_H
+#define ANDROID_NATIVE_WINDOW_H
+
+#include <sys/cdefs.h>
+#include <android/rect.h>
+
+__BEGIN_DECLS
+
+/*
+ * Pixel formats that a window can use.
+ */
+enum {
+    WINDOW_FORMAT_RGBA_8888          = 1,
+    WINDOW_FORMAT_RGBX_8888          = 2,
+    WINDOW_FORMAT_RGB_565            = 4,
+};
+
+struct ANativeWindow;
+typedef struct ANativeWindow ANativeWindow;
+
+typedef struct ANativeWindow_Buffer {
+    // The number of pixels that are show horizontally.
+    int32_t width;
+
+    // The number of pixels that are shown vertically.
+    int32_t height;
+
+    // The number of *pixels* that a line in the buffer takes in
+    // memory.  This may be >= width.
+    int32_t stride;
+
+    // The format of the buffer.  One of WINDOW_FORMAT_*
+    int32_t format;
+
+    // The actual bits.
+    void* bits;
+
+    // Do not touch.
+    uint32_t reserved[6];
+} ANativeWindow_Buffer;
+
+/**
+ * Acquire a reference on the given ANativeWindow object.  This prevents the object
+ * from being deleted until the reference is removed.
+ */
+void ANativeWindow_acquire(ANativeWindow* window);
+
+/**
+ * Remove a reference that was previously acquired with ANativeWindow_acquire().
+ */
+void ANativeWindow_release(ANativeWindow* window);
+
+/*
+ * Return the current width in pixels of the window surface.  Returns a
+ * negative value on error.
+ */
+int32_t ANativeWindow_getWidth(ANativeWindow* window);
+
+/*
+ * Return the current height in pixels of the window surface.  Returns a
+ * negative value on error.
+ */
+int32_t ANativeWindow_getHeight(ANativeWindow* window);
+
+/*
+ * Return the current pixel format of the window surface.  Returns a
+ * negative value on error.
+ */
+int32_t ANativeWindow_getFormat(ANativeWindow* window);
+
+/*
+ * Change the format and size of the window buffers.
+ *
+ * The width and height control the number of pixels in the buffers, not the
+ * dimensions of the window on screen.  If these are different than the
+ * window's physical size, then it buffer will be scaled to match that size
+ * when compositing it to the screen.
+ *
+ * For all of these parameters, if 0 is supplied then the window's base
+ * value will come back in force.
+ */
+int32_t ANativeWindow_setBuffersGeometry(ANativeWindow* window, int32_t width, int32_t height, int32_t format);
+
+/**
+ * Lock the window's next drawing surface for writing.
+ */
+int32_t ANativeWindow_lock(ANativeWindow* window, ANativeWindow_Buffer* outBuffer,
+        ARect* inOutDirtyBounds);
+
+/**
+ * Unlock the window's drawing surface after previously locking it,
+ * posting the new buffer to the display.
+ */
+int32_t ANativeWindow_unlockAndPost(ANativeWindow* window);
+
+__END_DECLS
+
+#endif /* ANDROID_NATIVE_WINDOW_H */
diff --git a/ndk/platforms/android-9/include/android/native_window_jni.h b/ndk/platforms/android-9/include/android/native_window_jni.h
new file mode 100644
index 0000000..a44a5b1
--- /dev/null
+++ b/ndk/platforms/android-9/include/android/native_window_jni.h
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ANDROID_NATIVE_WINDOW_JNI_H
+#define ANDROID_NATIVE_WINDOW_JNI_H
+
+#include <android/native_window.h>
+
+#include <jni.h>
+
+__BEGIN_DECLS
+
+/**
+ * Return the ANativeWindow associated with a Java Surface object,
+ * for interacting with it through native code.  This acquires a reference
+ * on the ANativeWindow that is returned; be sure to use ANativeWindow_release()
+ * when done with it so that it doesn't leak.
+ */
+ANativeWindow* ANativeWindow_fromSurface(JNIEnv* env, jobject surface);
+
+__END_DECLS
+
+#endif /* ANDROID_NATIVE_WINDOW_H */
diff --git a/ndk/platforms/android-9/include/android/obb.h b/ndk/platforms/android-9/include/android/obb.h
new file mode 100644
index 0000000..5670b1c
--- /dev/null
+++ b/ndk/platforms/android-9/include/android/obb.h
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#ifndef ANDROID_OBB_H
+#define ANDROID_OBB_H
+
+#include <sys/cdefs.h>
+#include <sys/types.h>
+
+__BEGIN_DECLS
+
+struct AObbInfo;
+typedef struct AObbInfo AObbInfo;
+
+enum {
+    AOBBINFO_OVERLAY = 0x0001,
+};
+
+/**
+ * Scan an OBB and get information about it.
+ */
+AObbInfo* AObbScanner_getObbInfo(const char* filename);
+
+/**
+ * Destroy the AObbInfo object. You must call this when finished with the object.
+ */
+void AObbInfo_delete(AObbInfo* obbInfo);
+
+/**
+ * Get the package name for the OBB.
+ */
+const char* AObbInfo_getPackageName(AObbInfo* obbInfo);
+
+/**
+ * Get the version of an OBB file.
+ */
+int32_t AObbInfo_getVersion(AObbInfo* obbInfo);
+
+/**
+ * Get the flags of an OBB file.
+ */
+int32_t AObbInfo_getFlags(AObbInfo* obbInfo);
+
+__END_DECLS
+
+#endif      /* ANDROID_OBB_H */
diff --git a/ndk/platforms/android-9/include/android/rect.h b/ndk/platforms/android-9/include/android/rect.h
new file mode 100644
index 0000000..161c2a7
--- /dev/null
+++ b/ndk/platforms/android-9/include/android/rect.h
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#ifndef ANDROID_RECT_H
+#define ANDROID_RECT_H
+
+#include <sys/cdefs.h>
+
+__BEGIN_DECLS
+
+typedef struct ARect {
+    int32_t left;
+    int32_t top;
+    int32_t right;
+    int32_t bottom;
+} ARect;
+
+__END_DECLS
+
+#endif /* ANDROID_RECT_H */
diff --git a/ndk/platforms/android-9/include/android/sensor.h b/ndk/platforms/android-9/include/android/sensor.h
new file mode 100644
index 0000000..eb46ef0
--- /dev/null
+++ b/ndk/platforms/android-9/include/android/sensor.h
@@ -0,0 +1,252 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#ifndef ANDROID_SENSOR_H
+#define ANDROID_SENSOR_H
+
+/******************************************************************
+ *
+ * IMPORTANT NOTICE:
+ *
+ *   This file is part of Android's set of stable system headers
+ *   exposed by the Android NDK (Native Development Kit).
+ *
+ *   Third-party source AND binary code relies on the definitions
+ *   here to be FROZEN ON ALL UPCOMING PLATFORM RELEASES.
+ *
+ *   - DO NOT MODIFY ENUMS (EXCEPT IF YOU ADD NEW 32-BIT VALUES)
+ *   - DO NOT MODIFY CONSTANTS OR FUNCTIONAL MACROS
+ *   - DO NOT CHANGE THE SIGNATURE OF FUNCTIONS IN ANY WAY
+ *   - DO NOT CHANGE THE LAYOUT OR SIZE OF STRUCTURES
+ */
+
+/*
+ * Structures and functions to receive and process sensor events in
+ * native code.
+ *
+ */
+#include <sys/cdefs.h>
+#include <sys/types.h>
+
+#include <android/looper.h>
+
+__BEGIN_DECLS
+
+
+/*
+ * Sensor types
+ * (keep in sync with hardware/sensor.h)
+ */
+
+enum {
+    ASENSOR_TYPE_ACCELEROMETER      = 1,
+    ASENSOR_TYPE_MAGNETIC_FIELD     = 2,
+    ASENSOR_TYPE_GYROSCOPE          = 4,
+    ASENSOR_TYPE_LIGHT              = 5,
+    ASENSOR_TYPE_PROXIMITY          = 8
+};
+
+/*
+ * Sensor accuracy measure
+ */
+enum {
+    ASENSOR_STATUS_UNRELIABLE       = 0,
+    ASENSOR_STATUS_ACCURACY_LOW     = 1,
+    ASENSOR_STATUS_ACCURACY_MEDIUM  = 2,
+    ASENSOR_STATUS_ACCURACY_HIGH    = 3
+};
+
+/*
+ * A few useful constants
+ */
+
+/* Earth's gravity in m/s^2 */
+#define ASENSOR_STANDARD_GRAVITY            (9.80665f)
+/* Maximum magnetic field on Earth's surface in uT */
+#define ASENSOR_MAGNETIC_FIELD_EARTH_MAX    (60.0f)
+/* Minimum magnetic field on Earth's surface in uT*/
+#define ASENSOR_MAGNETIC_FIELD_EARTH_MIN    (30.0f)
+
+/*
+ * A sensor event.
+ */
+
+/* NOTE: Must match hardware/sensors.h */
+typedef struct ASensorVector {
+    union {
+        float v[3];
+        struct {
+            float x;
+            float y;
+            float z;
+        };
+        struct {
+            float azimuth;
+            float pitch;
+            float roll;
+        };
+    };
+    int8_t status;
+    uint8_t reserved[3];
+} ASensorVector;
+
+/* NOTE: Must match hardware/sensors.h */
+typedef struct ASensorEvent {
+    int32_t version; /* sizeof(struct ASensorEvent) */
+    int32_t sensor;
+    int32_t type;
+    int32_t reserved0;
+    int64_t timestamp;
+    union {
+        float           data[16];
+        ASensorVector   vector;
+        ASensorVector   acceleration;
+        ASensorVector   magnetic;
+        float           temperature;
+        float           distance;
+        float           light;
+        float           pressure;
+    };
+    int32_t reserved1[4];
+} ASensorEvent;
+
+
+struct ASensorManager;
+typedef struct ASensorManager ASensorManager;
+
+struct ASensorEventQueue;
+typedef struct ASensorEventQueue ASensorEventQueue;
+
+struct ASensor;
+typedef struct ASensor ASensor;
+typedef ASensor const* ASensorRef;
+typedef ASensorRef const* ASensorList;
+
+/*****************************************************************************/
+
+/*
+ * Get a reference to the sensor manager. ASensorManager is a singleton.
+ *
+ * Example:
+ *
+ *     ASensorManager* sensorManager = ASensorManager_getInstance();
+ *
+ */
+ASensorManager* ASensorManager_getInstance();
+
+
+/*
+ * Returns the list of available sensors.
+ */
+int ASensorManager_getSensorList(ASensorManager* manager, ASensorList* list);
+
+/*
+ * Returns the default sensor for the given type, or NULL if no sensor
+ * of that type exist.
+ */
+ASensor const* ASensorManager_getDefaultSensor(ASensorManager* manager, int type);
+
+/*
+ * Creates a new sensor event queue and associate it with a looper.
+ */
+ASensorEventQueue* ASensorManager_createEventQueue(ASensorManager* manager,
+        ALooper* looper, int ident, ALooper_callbackFunc callback, void* data);
+
+/*
+ * Destroys the event queue and free all resources associated to it.
+ */
+int ASensorManager_destroyEventQueue(ASensorManager* manager, ASensorEventQueue* queue);
+
+
+/*****************************************************************************/
+
+/*
+ * Enable the selected sensor. Returns a negative error code on failure.
+ */
+int ASensorEventQueue_enableSensor(ASensorEventQueue* queue, ASensor const* sensor);
+
+/*
+ * Disable the selected sensor. Returns a negative error code on failure.
+ */
+int ASensorEventQueue_disableSensor(ASensorEventQueue* queue, ASensor const* sensor);
+
+/*
+ * Sets the delivery rate of events in microseconds for the given sensor.
+ * Note that this is a hint only, generally event will arrive at a higher
+ * rate. It is an error to set a rate inferior to the value returned by
+ * ASensor_getMinDelay().
+ * Returns a negative error code on failure.
+ */
+int ASensorEventQueue_setEventRate(ASensorEventQueue* queue, ASensor const* sensor, int32_t usec);
+
+/*
+ * Returns true if there are one or more events available in the
+ * sensor queue.  Returns 1 if the queue has events; 0 if
+ * it does not have events; and a negative value if there is an error.
+ */
+int ASensorEventQueue_hasEvents(ASensorEventQueue* queue);
+
+/*
+ * Returns the next available events from the queue.  Returns a negative
+ * value if no events are available or an error has occurred, otherwise
+ * the number of events returned.
+ *
+ * Examples:
+ *   ASensorEvent event;
+ *   ssize_t numEvent = ASensorEventQueue_getEvents(queue, &event, 1);
+ *
+ *   ASensorEvent eventBuffer[8];
+ *   ssize_t numEvent = ASensorEventQueue_getEvents(queue, eventBuffer, 8);
+ *
+ */
+ssize_t ASensorEventQueue_getEvents(ASensorEventQueue* queue,
+                ASensorEvent* events, size_t count);
+
+
+/*****************************************************************************/
+
+/*
+ * Returns this sensor's name (non localized)
+ */
+const char* ASensor_getName(ASensor const* sensor);
+
+/*
+ * Returns this sensor's vendor's name (non localized)
+ */
+const char* ASensor_getVendor(ASensor const* sensor);
+
+/*
+ * Return this sensor's type
+ */
+int ASensor_getType(ASensor const* sensor);
+
+/*
+ * Returns this sensors's resolution
+ */
+float ASensor_getResolution(ASensor const* sensor);
+
+/*
+ * Returns the minimum delay allowed between events in microseconds.
+ * A value of zero means that this sensor doesn't report events at a
+ * constant rate, but rather only when a new data is available.
+ */
+int ASensor_getMinDelay(ASensor const* sensor);
+
+
+__END_DECLS
+
+#endif /* ANDROID_SENSOR_H */
diff --git a/ndk/platforms/android-9/include/android/storage_manager.h b/ndk/platforms/android-9/include/android/storage_manager.h
new file mode 100644
index 0000000..f3b08dc
--- /dev/null
+++ b/ndk/platforms/android-9/include/android/storage_manager.h
@@ -0,0 +1,124 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#ifndef ANDROID_STORAGE_MANAGER_H
+#define ANDROID_STORAGE_MANAGER_H
+
+#include <sys/cdefs.h>
+#include <stdint.h>
+
+__BEGIN_DECLS
+
+struct AStorageManager;
+typedef struct AStorageManager AStorageManager;
+
+enum {
+    /*
+     * The OBB container is now mounted and ready for use. Can be returned
+     * as the status for callbacks made during asynchronous OBB actions.
+     */
+    AOBB_STATE_MOUNTED = 1,
+
+    /*
+     * The OBB container is now unmounted and not usable. Can be returned
+     * as the status for callbacks made during asynchronous OBB actions.
+     */
+    AOBB_STATE_UNMOUNTED = 2,
+
+    /*
+     * There was an internal system error encountered while trying to
+     * mount the OBB. Can be returned as the status for callbacks made
+     * during asynchronous OBB actions.
+     */
+    AOBB_STATE_ERROR_INTERNAL = 20,
+
+    /*
+     * The OBB could not be mounted by the system. Can be returned as the
+     * status for callbacks made during asynchronous OBB actions.
+     */
+    AOBB_STATE_ERROR_COULD_NOT_MOUNT = 21,
+
+    /*
+     * The OBB could not be unmounted. This most likely indicates that a
+     * file is in use on the OBB. Can be returned as the status for
+     * callbacks made during asynchronous OBB actions.
+     */
+    AOBB_STATE_ERROR_COULD_NOT_UNMOUNT = 22,
+
+    /*
+     * A call was made to unmount the OBB when it was not mounted. Can be
+     * returned as the status for callbacks made during asynchronous OBB
+     * actions.
+     */
+    AOBB_STATE_ERROR_NOT_MOUNTED = 23,
+
+    /*
+     * The OBB has already been mounted. Can be returned as the status for
+     * callbacks made during asynchronous OBB actions.
+     */
+    AOBB_STATE_ERROR_ALREADY_MOUNTED = 24,
+
+    /*
+     * The current application does not have permission to use this OBB.
+     * This could be because the OBB indicates it's owned by a different
+     * package. Can be returned as the status for callbacks made during
+     * asynchronous OBB actions.
+     */
+    AOBB_STATE_ERROR_PERMISSION_DENIED = 25,
+};
+
+/**
+ * Obtains a new instance of AStorageManager.
+ */
+AStorageManager* AStorageManager_new();
+
+/**
+ * Release AStorageManager instance.
+ */
+void AStorageManager_delete(AStorageManager* mgr);
+
+/**
+ * Callback function for asynchronous calls made on OBB files.
+ */
+typedef void (*AStorageManager_obbCallbackFunc)(const char* filename, const int32_t state, void* data);
+
+/**
+ * Attempts to mount an OBB file. This is an asynchronous operation.
+ */
+void AStorageManager_mountObb(AStorageManager* mgr, const char* filename, const char* key,
+        AStorageManager_obbCallbackFunc cb, void* data);
+
+/**
+ * Attempts to unmount an OBB file. This is an asynchronous operation.
+ */
+void AStorageManager_unmountObb(AStorageManager* mgr, const char* filename, const int force,
+        AStorageManager_obbCallbackFunc cb, void* data);
+
+/**
+ * Check whether an OBB is mounted.
+ */
+int AStorageManager_isObbMounted(AStorageManager* mgr, const char* filename);
+
+/**
+ * Get the mounted path for an OBB.
+ */
+const char* AStorageManager_getMountedObbPath(AStorageManager* mgr, const char* filename);
+
+
+__END_DECLS
+
+#endif      /* ANDROID_STORAGE_MANAGER_H */
diff --git a/ndk/platforms/android-9/include/android/window.h b/ndk/platforms/android-9/include/android/window.h
new file mode 100644
index 0000000..0633f89
--- /dev/null
+++ b/ndk/platforms/android-9/include/android/window.h
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#ifndef ANDROID_WINDOW_H
+#define ANDROID_WINDOW_H
+
+#include <sys/cdefs.h>
+
+__BEGIN_DECLS
+
+/**
+ * Window flags, as per the Java API at android.view.WindowManager.LayoutParams.
+ */
+enum {
+    AWINDOW_FLAG_ALLOW_LOCK_WHILE_SCREEN_ON = 0x00000001,
+    AWINDOW_FLAG_DIM_BEHIND                 = 0x00000002,
+    AWINDOW_FLAG_BLUR_BEHIND                = 0x00000004,
+    AWINDOW_FLAG_NOT_FOCUSABLE              = 0x00000008,
+    AWINDOW_FLAG_NOT_TOUCHABLE              = 0x00000010,
+    AWINDOW_FLAG_NOT_TOUCH_MODAL            = 0x00000020,
+    AWINDOW_FLAG_TOUCHABLE_WHEN_WAKING      = 0x00000040,
+    AWINDOW_FLAG_KEEP_SCREEN_ON             = 0x00000080,
+    AWINDOW_FLAG_LAYOUT_IN_SCREEN           = 0x00000100,
+    AWINDOW_FLAG_LAYOUT_NO_LIMITS           = 0x00000200,
+    AWINDOW_FLAG_FULLSCREEN                 = 0x00000400,
+    AWINDOW_FLAG_FORCE_NOT_FULLSCREEN       = 0x00000800,
+    AWINDOW_FLAG_DITHER                     = 0x00001000,
+    AWINDOW_FLAG_SECURE                     = 0x00002000,
+    AWINDOW_FLAG_SCALED                     = 0x00004000,
+    AWINDOW_FLAG_IGNORE_CHEEK_PRESSES       = 0x00008000,
+    AWINDOW_FLAG_LAYOUT_INSET_DECOR         = 0x00010000,
+    AWINDOW_FLAG_ALT_FOCUSABLE_IM           = 0x00020000,
+    AWINDOW_FLAG_WATCH_OUTSIDE_TOUCH        = 0x00040000,
+    AWINDOW_FLAG_SHOW_WHEN_LOCKED           = 0x00080000,
+    AWINDOW_FLAG_SHOW_WALLPAPER             = 0x00100000,
+    AWINDOW_FLAG_TURN_SCREEN_ON             = 0x00200000,
+    AWINDOW_FLAG_DISMISS_KEYGUARD           = 0x00400000,
+};
+
+__END_DECLS
+
+#endif /* ANDROID_WINDOW_H */
diff --git a/ndk/platforms/android-9/include/arpa/telnet.h b/ndk/platforms/android-9/include/arpa/telnet.h
new file mode 100644
index 0000000..d318e08
--- /dev/null
+++ b/ndk/platforms/android-9/include/arpa/telnet.h
@@ -0,0 +1,316 @@
+/*
+ * Copyright (c) 1983, 1993
+ *	The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
+ *
+ *	@(#)telnet.h	8.2 (Berkeley) 12/15/93
+ */
+
+#ifndef _ARPA_TELNET_H
+#define	_ARPA_TELNET_H 1
+
+/*
+ * Definitions for the TELNET protocol.
+ */
+#define	IAC	255		/* interpret as command: */
+#define	DONT	254		/* you are not to use option */
+#define	DO	253		/* please, you use option */
+#define	WONT	252		/* I won't use option */
+#define	WILL	251		/* I will use option */
+#define	SB	250		/* interpret as subnegotiation */
+#define	GA	249		/* you may reverse the line */
+#define	EL	248		/* erase the current line */
+#define	EC	247		/* erase the current character */
+#define	AYT	246		/* are you there */
+#define	AO	245		/* abort output--but let prog finish */
+#define	IP	244		/* interrupt process--permanently */
+#define	BREAK	243		/* break */
+#define	DM	242		/* data mark--for connect. cleaning */
+#define	NOP	241		/* nop */
+#define	SE	240		/* end sub negotiation */
+#define EOR     239             /* end of record (transparent mode) */
+#define	ABORT	238		/* Abort process */
+#define	SUSP	237		/* Suspend process */
+#define	xEOF	236		/* End of file: EOF is already used... */
+
+#define SYNCH	242		/* for telfunc calls */
+
+#ifdef TELCMDS
+char *telcmds[] = {
+	"EOF", "SUSP", "ABORT", "EOR",
+	"SE", "NOP", "DMARK", "BRK", "IP", "AO", "AYT", "EC",
+	"EL", "GA", "SB", "WILL", "WONT", "DO", "DONT", "IAC", 0,
+};
+#else
+extern char *telcmds[];
+#endif
+
+#define	TELCMD_FIRST	xEOF
+#define	TELCMD_LAST	IAC
+#define	TELCMD_OK(x)	((unsigned int)(x) <= TELCMD_LAST && \
+			 (unsigned int)(x) >= TELCMD_FIRST)
+#define	TELCMD(x)	telcmds[(x)-TELCMD_FIRST]
+
+/* telnet options */
+#define TELOPT_BINARY	0	/* 8-bit data path */
+#define TELOPT_ECHO	1	/* echo */
+#define	TELOPT_RCP	2	/* prepare to reconnect */
+#define	TELOPT_SGA	3	/* suppress go ahead */
+#define	TELOPT_NAMS	4	/* approximate message size */
+#define	TELOPT_STATUS	5	/* give status */
+#define	TELOPT_TM	6	/* timing mark */
+#define	TELOPT_RCTE	7	/* remote controlled transmission and echo */
+#define TELOPT_NAOL 	8	/* negotiate about output line width */
+#define TELOPT_NAOP 	9	/* negotiate about output page size */
+#define TELOPT_NAOCRD	10	/* negotiate about CR disposition */
+#define TELOPT_NAOHTS	11	/* negotiate about horizontal tabstops */
+#define TELOPT_NAOHTD	12	/* negotiate about horizontal tab disposition */
+#define TELOPT_NAOFFD	13	/* negotiate about formfeed disposition */
+#define TELOPT_NAOVTS	14	/* negotiate about vertical tab stops */
+#define TELOPT_NAOVTD	15	/* negotiate about vertical tab disposition */
+#define TELOPT_NAOLFD	16	/* negotiate about output LF disposition */
+#define TELOPT_XASCII	17	/* extended ascii character set */
+#define	TELOPT_LOGOUT	18	/* force logout */
+#define	TELOPT_BM	19	/* byte macro */
+#define	TELOPT_DET	20	/* data entry terminal */
+#define	TELOPT_SUPDUP	21	/* supdup protocol */
+#define	TELOPT_SUPDUPOUTPUT 22	/* supdup output */
+#define	TELOPT_SNDLOC	23	/* send location */
+#define	TELOPT_TTYPE	24	/* terminal type */
+#define	TELOPT_EOR	25	/* end or record */
+#define	TELOPT_TUID	26	/* TACACS user identification */
+#define	TELOPT_OUTMRK	27	/* output marking */
+#define	TELOPT_TTYLOC	28	/* terminal location number */
+#define	TELOPT_3270REGIME 29	/* 3270 regime */
+#define	TELOPT_X3PAD	30	/* X.3 PAD */
+#define	TELOPT_NAWS	31	/* window size */
+#define	TELOPT_TSPEED	32	/* terminal speed */
+#define	TELOPT_LFLOW	33	/* remote flow control */
+#define TELOPT_LINEMODE	34	/* Linemode option */
+#define TELOPT_XDISPLOC	35	/* X Display Location */
+#define TELOPT_OLD_ENVIRON 36	/* Old - Environment variables */
+#define	TELOPT_AUTHENTICATION 37/* Authenticate */
+#define	TELOPT_ENCRYPT	38	/* Encryption option */
+#define TELOPT_NEW_ENVIRON 39	/* New - Environment variables */
+#define	TELOPT_EXOPL	255	/* extended-options-list */
+
+
+#define	NTELOPTS	(1+TELOPT_NEW_ENVIRON)
+#ifdef TELOPTS
+const char *telopts[NTELOPTS+1] = {
+	"BINARY", "ECHO", "RCP", "SUPPRESS GO AHEAD", "NAME",
+	"STATUS", "TIMING MARK", "RCTE", "NAOL", "NAOP",
+	"NAOCRD", "NAOHTS", "NAOHTD", "NAOFFD", "NAOVTS",
+	"NAOVTD", "NAOLFD", "EXTEND ASCII", "LOGOUT", "BYTE MACRO",
+	"DATA ENTRY TERMINAL", "SUPDUP", "SUPDUP OUTPUT",
+	"SEND LOCATION", "TERMINAL TYPE", "END OF RECORD",
+	"TACACS UID", "OUTPUT MARKING", "TTYLOC",
+	"3270 REGIME", "X.3 PAD", "NAWS", "TSPEED", "LFLOW",
+	"LINEMODE", "XDISPLOC", "OLD-ENVIRON", "AUTHENTICATION",
+	"ENCRYPT", "NEW-ENVIRON",
+	0,
+};
+#define	TELOPT_FIRST	TELOPT_BINARY
+#define	TELOPT_LAST	TELOPT_NEW_ENVIRON
+#define	TELOPT_OK(x)	((unsigned int)(x) <= TELOPT_LAST)
+#define	TELOPT(x)	telopts[(x)-TELOPT_FIRST]
+#endif
+
+/* sub-option qualifiers */
+#define	TELQUAL_IS	0	/* option is... */
+#define	TELQUAL_SEND	1	/* send option */
+#define	TELQUAL_INFO	2	/* ENVIRON: informational version of IS */
+#define	TELQUAL_REPLY	2	/* AUTHENTICATION: client version of IS */
+#define	TELQUAL_NAME	3	/* AUTHENTICATION: client version of IS */
+
+#define	LFLOW_OFF		0	/* Disable remote flow control */
+#define	LFLOW_ON		1	/* Enable remote flow control */
+#define	LFLOW_RESTART_ANY	2	/* Restart output on any char */
+#define	LFLOW_RESTART_XON	3	/* Restart output only on XON */
+
+/*
+ * LINEMODE suboptions
+ */
+
+#define	LM_MODE		1
+#define	LM_FORWARDMASK	2
+#define	LM_SLC		3
+
+#define	MODE_EDIT	0x01
+#define	MODE_TRAPSIG	0x02
+#define	MODE_ACK	0x04
+#define MODE_SOFT_TAB	0x08
+#define MODE_LIT_ECHO	0x10
+
+#define	MODE_MASK	0x1f
+
+/* Not part of protocol, but needed to simplify things... */
+#define MODE_FLOW		0x0100
+#define MODE_ECHO		0x0200
+#define MODE_INBIN		0x0400
+#define MODE_OUTBIN		0x0800
+#define MODE_FORCE		0x1000
+
+#define	SLC_SYNCH	1
+#define	SLC_BRK		2
+#define	SLC_IP		3
+#define	SLC_AO		4
+#define	SLC_AYT		5
+#define	SLC_EOR		6
+#define	SLC_ABORT	7
+#define	SLC_EOF		8
+#define	SLC_SUSP	9
+#define	SLC_EC		10
+#define	SLC_EL		11
+#define	SLC_EW		12
+#define	SLC_RP		13
+#define	SLC_LNEXT	14
+#define	SLC_XON		15
+#define	SLC_XOFF	16
+#define	SLC_FORW1	17
+#define	SLC_FORW2	18
+
+#define	NSLC		18
+
+/*
+ * For backwards compatibility, we define SLC_NAMES to be the
+ * list of names if SLC_NAMES is not defined.
+ */
+#define	SLC_NAMELIST	"0", "SYNCH", "BRK", "IP", "AO", "AYT", "EOR", \
+			"ABORT", "EOF", "SUSP", "EC", "EL", "EW", "RP", \
+			"LNEXT", "XON", "XOFF", "FORW1", "FORW2", 0,
+#ifdef	SLC_NAMES
+const char *slc_names[] = {
+	SLC_NAMELIST
+};
+#else
+extern char *slc_names[];
+#define	SLC_NAMES SLC_NAMELIST
+#endif
+
+#define	SLC_NAME_OK(x)	((unsigned int)(x) <= NSLC)
+#define SLC_NAME(x)	slc_names[x]
+
+#define	SLC_NOSUPPORT	0
+#define	SLC_CANTCHANGE	1
+#define	SLC_VARIABLE	2
+#define	SLC_DEFAULT	3
+#define	SLC_LEVELBITS	0x03
+
+#define	SLC_FUNC	0
+#define	SLC_FLAGS	1
+#define	SLC_VALUE	2
+
+#define	SLC_ACK		0x80
+#define	SLC_FLUSHIN	0x40
+#define	SLC_FLUSHOUT	0x20
+
+#define	OLD_ENV_VAR	1
+#define	OLD_ENV_VALUE	0
+#define	NEW_ENV_VAR	0
+#define	NEW_ENV_VALUE	1
+#define	ENV_ESC		2
+#define ENV_USERVAR	3
+
+/*
+ * AUTHENTICATION suboptions
+ */
+
+/*
+ * Who is authenticating who ...
+ */
+#define	AUTH_WHO_CLIENT		0	/* Client authenticating server */
+#define	AUTH_WHO_SERVER		1	/* Server authenticating client */
+#define	AUTH_WHO_MASK		1
+
+/*
+ * amount of authentication done
+ */
+#define	AUTH_HOW_ONE_WAY	0
+#define	AUTH_HOW_MUTUAL		2
+#define	AUTH_HOW_MASK		2
+
+#define	AUTHTYPE_NULL		0
+#define	AUTHTYPE_KERBEROS_V4	1
+#define	AUTHTYPE_KERBEROS_V5	2
+#define	AUTHTYPE_SPX		3
+#define	AUTHTYPE_MINK		4
+#define	AUTHTYPE_CNT		5
+
+#define	AUTHTYPE_TEST		99
+
+#ifdef	AUTH_NAMES
+const char *authtype_names[] = {
+	"NULL", "KERBEROS_V4", "KERBEROS_V5", "SPX", "MINK", 0,
+};
+#else
+extern char *authtype_names[];
+#endif
+
+#define	AUTHTYPE_NAME_OK(x)	((unsigned int)(x) < AUTHTYPE_CNT)
+#define	AUTHTYPE_NAME(x)	authtype_names[x]
+
+/*
+ * ENCRYPTion suboptions
+ */
+#define	ENCRYPT_IS		0	/* I pick encryption type ... */
+#define	ENCRYPT_SUPPORT		1	/* I support encryption types ... */
+#define	ENCRYPT_REPLY		2	/* Initial setup response */
+#define	ENCRYPT_START		3	/* Am starting to send encrypted */
+#define	ENCRYPT_END		4	/* Am ending encrypted */
+#define	ENCRYPT_REQSTART	5	/* Request you start encrypting */
+#define	ENCRYPT_REQEND		6	/* Request you send encrypting */
+#define	ENCRYPT_ENC_KEYID	7
+#define	ENCRYPT_DEC_KEYID	8
+#define	ENCRYPT_CNT		9
+
+#define	ENCTYPE_ANY		0
+#define	ENCTYPE_DES_CFB64	1
+#define	ENCTYPE_DES_OFB64	2
+#define	ENCTYPE_CNT		3
+
+#ifdef	ENCRYPT_NAMES
+const char *encrypt_names[] = {
+	"IS", "SUPPORT", "REPLY", "START", "END",
+	"REQUEST-START", "REQUEST-END", "ENC-KEYID", "DEC-KEYID",
+	0,
+};
+const char *enctype_names[] = {
+	"ANY", "DES_CFB64",  "DES_OFB64",  0,
+};
+#else
+extern const char *encrypt_names[];
+extern const char *enctype_names[];
+#endif
+
+
+#define	ENCRYPT_NAME_OK(x)	((unsigned int)(x) < ENCRYPT_CNT)
+#define	ENCRYPT_NAME(x)		encrypt_names[x]
+
+#define	ENCTYPE_NAME_OK(x)	((unsigned int)(x) < ENCTYPE_CNT)
+#define	ENCTYPE_NAME(x)		enctype_names[x]
+
+#endif /* arpa/telnet.h */
diff --git a/ndk/platforms/android-9/include/math.h b/ndk/platforms/android-9/include/math.h
new file mode 100644
index 0000000..3b5660f
--- /dev/null
+++ b/ndk/platforms/android-9/include/math.h
@@ -0,0 +1,493 @@
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ */
+
+/*
+ * from: @(#)fdlibm.h 5.1 93/09/24
+ * $FreeBSD: src/lib/msun/src/math.h,v 1.61 2005/04/16 21:12:47 das Exp $
+ */
+
+#ifndef _MATH_H_
+#define	_MATH_H_
+
+#include <sys/cdefs.h>
+#include <sys/types.h>
+#include <limits.h>
+
+#define __pure2
+
+/*
+ * ANSI/POSIX
+ */
+extern const union __infinity_un {
+	unsigned char	__uc[8];
+	double		__ud;
+} __infinity;
+
+extern const union __nan_un {
+	unsigned char	__uc[sizeof(float)];
+	float		__uf;
+} __nan;
+
+/* #if __GNUC_PREREQ__(3, 3) || (defined(__INTEL_COMPILER) && __INTEL_COMPILER >= 800) */
+#if 1
+#define	__MATH_BUILTIN_CONSTANTS
+#endif
+
+/* #if __GNUC_PREREQ__(3, 0) && !defined(__INTEL_COMPILER) */
+#if 1
+#define	__MATH_BUILTIN_RELOPS
+#endif
+
+/* #ifdef __MATH_BUILTIN_CONSTANTS */
+#if 1
+#define	HUGE_VAL	__builtin_huge_val()
+#else
+#define	HUGE_VAL	(__infinity.__ud)
+#endif
+
+/* #if __ISO_C_VISIBLE >= 1999 */
+#if 0
+#define	FP_ILOGB0	(-__INT_MAX)
+#define	FP_ILOGBNAN	__INT_MAX
+#else
+#define	FP_ILOGB0	(-INT_MAX)
+#define	FP_ILOGBNAN	INT_MAX
+#endif
+
+#ifdef __MATH_BUILTIN_CONSTANTS
+#define	HUGE_VALF	__builtin_huge_valf()
+#define	HUGE_VALL	__builtin_huge_vall()
+#define	INFINITY	__builtin_inf()
+#define	NAN		__builtin_nan("")
+#else
+#define	HUGE_VALF	(float)HUGE_VAL
+#define	HUGE_VALL	(long double)HUGE_VAL
+#define	INFINITY	HUGE_VALF
+#define	NAN		(__nan.__uf)
+#endif /* __MATH_BUILTIN_CONSTANTS */
+
+#define	MATH_ERRNO	1
+#define	MATH_ERREXCEPT	2
+#define	math_errhandling	MATH_ERREXCEPT
+
+/* XXX We need a <machine/math.h>. */
+#if defined(__ia64__) || defined(__sparc64__)
+#define	FP_FAST_FMA
+#endif
+#ifdef __ia64__
+#define	FP_FAST_FMAL
+#endif
+#define	FP_FAST_FMAF
+
+/* Symbolic constants to classify floating point numbers. */
+#define	FP_INFINITE	0x01
+#define	FP_NAN		0x02
+#define	FP_NORMAL	0x04
+#define	FP_SUBNORMAL	0x08
+#define	FP_ZERO		0x10
+#define	fpclassify(x) \
+    ((sizeof (x) == sizeof (float)) ? __fpclassifyf(x) \
+    : (sizeof (x) == sizeof (double)) ? __fpclassifyd(x) \
+    : __fpclassifyl(x))
+
+#define	isfinite(x)					\
+    ((sizeof (x) == sizeof (float)) ? __isfinitef(x)	\
+    : (sizeof (x) == sizeof (double)) ? __isfinite(x)	\
+    : __isfinitel(x))
+#define	isinf(x)					\
+    ((sizeof (x) == sizeof (float)) ? __isinff(x)	\
+    : (sizeof (x) == sizeof (double)) ? __isinf(x)	\
+    : __isinfl(x))
+#define	isnan(x)					\
+    ((sizeof (x) == sizeof (float)) ? isnanf(x)		\
+    : (sizeof (x) == sizeof (double)) ? isnan(x)	\
+    : __isnanl(x))
+#define	isnormal(x)					\
+    ((sizeof (x) == sizeof (float)) ? __isnormalf(x)	\
+    : (sizeof (x) == sizeof (double)) ? __isnormal(x)	\
+    : __isnormall(x))
+
+#ifdef __MATH_BUILTIN_RELOPS
+#define	isgreater(x, y)		__builtin_isgreater((x), (y))
+#define	isgreaterequal(x, y)	__builtin_isgreaterequal((x), (y))
+#define	isless(x, y)		__builtin_isless((x), (y))
+#define	islessequal(x, y)	__builtin_islessequal((x), (y))
+#define	islessgreater(x, y)	__builtin_islessgreater((x), (y))
+#define	isunordered(x, y)	__builtin_isunordered((x), (y))
+#else
+#define	isgreater(x, y)		(!isunordered((x), (y)) && (x) > (y))
+#define	isgreaterequal(x, y)	(!isunordered((x), (y)) && (x) >= (y))
+#define	isless(x, y)		(!isunordered((x), (y)) && (x) < (y))
+#define	islessequal(x, y)	(!isunordered((x), (y)) && (x) <= (y))
+#define	islessgreater(x, y)	(!isunordered((x), (y)) && \
+					((x) > (y) || (y) > (x)))
+#define	isunordered(x, y)	(isnan(x) || isnan(y))
+#endif /* __MATH_BUILTIN_RELOPS */
+
+#define	signbit(x)					\
+    ((sizeof (x) == sizeof (float)) ? __signbitf(x)	\
+    : (sizeof (x) == sizeof (double)) ? __signbit(x)	\
+    : __signbitl(x))
+
+#if 0
+typedef	__double_t	double_t;
+typedef	__float_t	float_t;
+#endif 
+/* #endif */ /* __ISO_C_VISIBLE >= 1999 */
+
+/*
+ * XOPEN/SVID
+ */
+/* #if __BSD_VISIBLE || __XSI_VISIBLE */
+#define	M_E		2.7182818284590452354	/* e */
+#define	M_LOG2E		1.4426950408889634074	/* log 2e */
+#define	M_LOG10E	0.43429448190325182765	/* log 10e */
+#define	M_LN2		0.69314718055994530942	/* log e2 */
+#define	M_LN10		2.30258509299404568402	/* log e10 */
+#define	M_PI		3.14159265358979323846	/* pi */
+#define	M_PI_2		1.57079632679489661923	/* pi/2 */
+#define	M_PI_4		0.78539816339744830962	/* pi/4 */
+#define	M_1_PI		0.31830988618379067154	/* 1/pi */
+#define	M_2_PI		0.63661977236758134308	/* 2/pi */
+#define	M_2_SQRTPI	1.12837916709551257390	/* 2/sqrt(pi) */
+#define	M_SQRT2		1.41421356237309504880	/* sqrt(2) */
+#define	M_SQRT1_2	0.70710678118654752440	/* 1/sqrt(2) */
+
+#define	MAXFLOAT	((float)3.40282346638528860e+38)
+extern int signgam;
+/* #endif */ /* __BSD_VISIBLE || __XSI_VISIBLE */
+
+#if __BSD_VISIBLE
+#if 0
+/* Old value from 4.4BSD-Lite math.h; this is probably better. */
+#define	HUGE		HUGE_VAL
+#else
+#define	HUGE		MAXFLOAT
+#endif
+#endif /* __BSD_VISIBLE */
+
+/*
+ * Most of these functions depend on the rounding mode and have the side
+ * effect of raising floating-point exceptions, so they are not declared
+ * as __pure2.  In C99, FENV_ACCESS affects the purity of these functions.
+ */
+__BEGIN_DECLS
+/*
+ * ANSI/POSIX
+ */
+int	__fpclassifyd(double) __pure2;
+int	__fpclassifyf(float) __pure2;
+int	__fpclassifyl(long double) __pure2;
+int	__isfinitef(float) __pure2;
+int	__isfinite(double) __pure2;
+int	__isfinitel(long double) __pure2;
+int	__isinff(float) __pure2;
+int     __isinf(double) __pure2;
+int	__isinfl(long double) __pure2;
+int	__isnanl(long double) __pure2;
+int	__isnormalf(float) __pure2;
+int	__isnormal(double) __pure2;
+int	__isnormall(long double) __pure2;
+int	__signbit(double) __pure2;
+int	__signbitf(float) __pure2;
+int	__signbitl(long double) __pure2;
+
+double	acos(double);
+double	asin(double);
+double	atan(double);
+double	atan2(double, double);
+double	cos(double);
+double	sin(double);
+double	tan(double);
+
+double	cosh(double);
+double	sinh(double);
+double	tanh(double);
+
+double	exp(double);
+double	frexp(double, int *);	/* fundamentally !__pure2 */
+double	ldexp(double, int);
+double	log(double);
+double	log10(double);
+double	modf(double, double *);	/* fundamentally !__pure2 */
+
+double	pow(double, double);
+double	sqrt(double);
+
+double	ceil(double);
+double	fabs(double) __pure2;
+double	floor(double);
+double	fmod(double, double);
+
+/*
+ * These functions are not in C90.
+ */
+/* #if __BSD_VISIBLE || __ISO_C_VISIBLE >= 1999 || __XSI_VISIBLE */
+double	acosh(double);
+double	asinh(double);
+double	atanh(double);
+double	cbrt(double);
+double	erf(double);
+double	erfc(double);
+double	exp2(double);
+double	expm1(double);
+double	fma(double, double, double);
+double	hypot(double, double);
+int	ilogb(double) __pure2;
+/* int	(isinf)(double) __pure2; */
+int	(isnan)(double) __pure2;
+double	lgamma(double);
+long long llrint(double);
+long long llround(double);
+double	log1p(double);
+double	logb(double);
+long	lrint(double);
+long	lround(double);
+double	nextafter(double, double);
+double	remainder(double, double);
+double	remquo(double, double, int *);
+double	rint(double);
+/* #endif */ /* __BSD_VISIBLE || __ISO_C_VISIBLE >= 1999 || __XSI_VISIBLE */
+
+/* #if __BSD_VISIBLE || __XSI_VISIBLE */
+double	j0(double);
+double	j1(double);
+double	jn(int, double);
+double	scalb(double, double);
+double	y0(double);
+double	y1(double);
+double	yn(int, double);
+
+/* #if __XSI_VISIBLE <= 500 || __BSD_VISIBLE */
+double	gamma(double);
+/* #endif */
+/* #endif */ /* __BSD_VISIBLE || __XSI_VISIBLE */
+
+/* #if __BSD_VISIBLE || __ISO_C_VISIBLE >= 1999 */
+double	copysign(double, double) __pure2;
+double	fdim(double, double);
+double	fmax(double, double) __pure2;
+double	fmin(double, double) __pure2;
+double	nearbyint(double);
+double	round(double);
+double	scalbln(double, long);
+double	scalbn(double, int);
+double	tgamma(double);
+double	trunc(double);
+/* #endif */
+
+/*
+ * BSD math library entry points
+ */
+/* #if __BSD_VISIBLE */
+double	drem(double, double);
+int	finite(double) __pure2;
+int	isnanf(float) __pure2;
+
+/*
+ * Reentrant version of gamma & lgamma; passes signgam back by reference
+ * as the second argument; user must allocate space for signgam.
+ */
+double	gamma_r(double, int *);
+double	lgamma_r(double, int *);
+
+/*
+ * IEEE Test Vector
+ */
+double	significand(double);
+/* #endif */ /* __BSD_VISIBLE */
+
+/* float versions of ANSI/POSIX functions */
+/*#if __ISO_C_VISIBLE >= 1999 */
+float	acosf(float);
+float	asinf(float);
+float	atanf(float);
+float	atan2f(float, float);
+float	cosf(float);
+float	sinf(float);
+float	tanf(float);
+
+float	coshf(float);
+float	sinhf(float);
+float	tanhf(float);
+
+float	exp2f(float);
+float	expf(float);
+float	expm1f(float);
+float	frexpf(float, int *);	/* fundamentally !__pure2 */
+int	ilogbf(float) __pure2;
+float	ldexpf(float, int);
+float	log10f(float);
+float	log1pf(float);
+float	logf(float);
+float	modff(float, float *);	/* fundamentally !__pure2 */
+
+float	powf(float, float);
+float	sqrtf(float);
+
+float	ceilf(float);
+float	fabsf(float) __pure2;
+float	floorf(float);
+float	fmodf(float, float);
+float	roundf(float);
+
+float	erff(float);
+float	erfcf(float);
+float	hypotf(float, float);
+float	lgammaf(float);
+
+float	acoshf(float);
+float	asinhf(float);
+float	atanhf(float);
+float	cbrtf(float);
+float	logbf(float);
+float	copysignf(float, float) __pure2;
+long long llrintf(float);
+long long llroundf(float);
+long	lrintf(float);
+long	lroundf(float);
+float	nearbyintf(float);
+float	nextafterf(float, float);
+float	remainderf(float, float);
+float	remquof(float, float, int *);
+float	rintf(float);
+float	scalblnf(float, long);
+float	scalbnf(float, int);
+float	truncf(float);
+
+float	fdimf(float, float);
+float	fmaf(float, float, float);
+float	fmaxf(float, float) __pure2;
+float	fminf(float, float) __pure2;
+/* #endif */
+
+/*
+ * float versions of BSD math library entry points
+ */
+/* #if __BSD_VISIBLE */
+float	dremf(float, float);
+int	finitef(float) __pure2;
+float	gammaf(float);
+float	j0f(float);
+float	j1f(float);
+float	jnf(int, float);
+float	scalbf(float, float);
+float	y0f(float);
+float	y1f(float);
+float	ynf(int, float);
+
+/*
+ * Float versions of reentrant version of gamma & lgamma; passes
+ * signgam back by reference as the second argument; user must
+ * allocate space for signgam.
+ */
+float	gammaf_r(float, int *);
+float	lgammaf_r(float, int *);
+
+/*
+ * float version of IEEE Test Vector
+ */
+float	significandf(float);
+/* #endif */	/* __BSD_VISIBLE */ 
+
+/*
+ * long double versions of ISO/POSIX math functions
+ */
+/* #if __ISO_C_VISIBLE >= 1999 */
+#if 0
+long double	acoshl(long double);
+long double	acosl(long double);
+long double	asinhl(long double);
+long double	asinl(long double);
+long double	atan2l(long double, long double);
+long double	atanhl(long double);
+long double	atanl(long double);
+long double	cbrtl(long double);
+#endif
+long double	ceill(long double);
+long double	copysignl(long double, long double) __pure2;
+#if 0
+long double	coshl(long double);
+long double	cosl(long double);
+long double	erfcl(long double);
+long double	erfl(long double);
+long double	exp2l(long double);
+long double	expl(long double);
+long double	expm1l(long double);
+#endif
+long double	fabsl(long double) __pure2;
+long double	fdiml(long double, long double);
+long double	floorl(long double);
+long double	fmal(long double, long double, long double);
+long double	fmaxl(long double, long double) __pure2;
+long double	fminl(long double, long double) __pure2;
+#if 0
+long double	fmodl(long double, long double);
+#endif
+long double	frexpl(long double value, int *); /* fundamentally !__pure2 */
+#if 0
+long double	hypotl(long double, long double);
+#endif
+int		ilogbl(long double) __pure2;
+long double	ldexpl(long double, int);
+#if 0
+long double	lgammal(long double);
+long long	llrintl(long double);
+#endif
+long long	llroundl(long double);
+#if 0
+long double	log10l(long double);
+long double	log1pl(long double);
+long double	log2l(long double);
+long double	logbl(long double);
+long double	logl(long double);
+long		lrintl(long double);
+#endif
+long		lroundl(long double);
+#if 0
+long double	modfl(long double, long double *); /* fundamentally !__pure2 */
+long double	nanl(const char *) __pure2;
+long double	nearbyintl(long double);
+#endif
+long double	nextafterl(long double, long double);
+double		nexttoward(double, long double);
+float		nexttowardf(float, long double);
+long double	nexttowardl(long double, long double);
+#if 0
+long double	powl(long double, long double);
+long double	remainderl(long double, long double);
+long double	remquol(long double, long double, int *);
+long double	rintl(long double);
+#endif
+long double	roundl(long double);
+long double	scalblnl(long double, long);
+long double	scalbnl(long double, int);
+#if 0
+long double	sinhl(long double);
+long double	sinl(long double);
+long double	sqrtl(long double);
+long double	tanhl(long double);
+long double	tanl(long double);
+long double	tgammal(long double);
+#endif
+long double	truncl(long double);
+
+/* BIONIC: GLibc compatibility - required by the ARM toolchain */
+#ifdef _GNU_SOURCE
+void  sincos(double x, double *sin, double *cos);
+void  sincosf(float x, float *sin, float *cos);
+void  sincosl(long double x, long double *sin, long double *cos);
+#endif
+
+/* #endif */ /* __ISO_C_VISIBLE >= 1999 */
+__END_DECLS
+
+#endif /* !_MATH_H_ */
diff --git a/ndk/platforms/android-9/include/pthread.h b/ndk/platforms/android-9/include/pthread.h
new file mode 100644
index 0000000..1e80b12
--- /dev/null
+++ b/ndk/platforms/android-9/include/pthread.h
@@ -0,0 +1,314 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _PTHREAD_H_
+#define _PTHREAD_H_
+
+#include <time.h>
+#include <signal.h>
+#include <sched.h>
+#include <limits.h>
+#include <sys/types.h>
+
+/*
+ * Types
+ */
+typedef struct
+{
+    int volatile value;
+} pthread_mutex_t;
+
+#define  PTHREAD_MUTEX_INITIALIZER             {0}
+#define  PTHREAD_RECURSIVE_MUTEX_INITIALIZER   {0x4000}
+#define  PTHREAD_ERRORCHECK_MUTEX_INITIALIZER  {0x8000}
+
+enum {
+    PTHREAD_MUTEX_NORMAL = 0,
+    PTHREAD_MUTEX_RECURSIVE = 1,
+    PTHREAD_MUTEX_ERRORCHECK = 2,
+
+    PTHREAD_MUTEX_ERRORCHECK_NP = PTHREAD_MUTEX_ERRORCHECK,
+    PTHREAD_MUTEX_RECURSIVE_NP  = PTHREAD_MUTEX_RECURSIVE,
+
+    PTHREAD_MUTEX_DEFAULT = PTHREAD_MUTEX_NORMAL
+};
+
+
+
+typedef struct
+{
+    int volatile value;
+} pthread_cond_t;
+
+typedef struct
+{
+    uint32_t flags;
+    void * stack_base;
+    size_t stack_size;
+    size_t guard_size;
+    int32_t sched_policy;
+    int32_t sched_priority;
+} pthread_attr_t;
+
+typedef long pthread_mutexattr_t;
+typedef long pthread_condattr_t;
+
+typedef int pthread_key_t;
+typedef long pthread_t;
+
+typedef volatile int  pthread_once_t;
+
+/*
+ * Defines
+ */
+#define PTHREAD_COND_INITIALIZER  {0}
+
+#define PTHREAD_STACK_MIN (2 * PAGE_SIZE)
+
+#define PTHREAD_CREATE_DETACHED  0x00000001
+#define PTHREAD_CREATE_JOINABLE  0x00000000
+
+#define PTHREAD_ONCE_INIT    0
+
+#define PTHREAD_PROCESS_PRIVATE  0
+#define PTHREAD_PROCESS_SHARED   1
+
+#define PTHREAD_SCOPE_SYSTEM     0
+#define PTHREAD_SCOPE_PROCESS    1
+
+/*
+ * Prototypes
+ */
+#if __cplusplus
+extern "C" {
+#endif
+
+int pthread_attr_init(pthread_attr_t * attr);
+int pthread_attr_destroy(pthread_attr_t * attr);
+
+int pthread_attr_setdetachstate(pthread_attr_t * attr, int state);
+int pthread_attr_getdetachstate(pthread_attr_t const * attr, int * state);
+
+int pthread_attr_setschedpolicy(pthread_attr_t * attr, int policy);
+int pthread_attr_getschedpolicy(pthread_attr_t const * attr, int * policy);
+
+int pthread_attr_setschedparam(pthread_attr_t * attr, struct sched_param const * param);
+int pthread_attr_getschedparam(pthread_attr_t const * attr, struct sched_param * param);
+
+int pthread_attr_setstacksize(pthread_attr_t * attr, size_t stack_size);
+int pthread_attr_getstacksize(pthread_attr_t const * attr, size_t * stack_size);
+
+int pthread_attr_setstackaddr(pthread_attr_t * attr, void * stackaddr);
+int pthread_attr_getstackaddr(pthread_attr_t const * attr, void ** stackaddr);
+
+int pthread_attr_setstack(pthread_attr_t * attr, void * stackaddr, size_t stack_size);
+int pthread_attr_getstack(pthread_attr_t const * attr, void ** stackaddr, size_t * stack_size);
+
+int pthread_attr_setguardsize(pthread_attr_t * attr, size_t guard_size);
+int pthread_attr_getguardsize(pthread_attr_t const * attr, size_t * guard_size);
+
+int pthread_attr_setscope(pthread_attr_t *attr, int  scope);
+int pthread_attr_getscope(pthread_attr_t const *attr);
+
+int pthread_getattr_np(pthread_t thid, pthread_attr_t * attr);
+
+int pthread_create(pthread_t *thread, pthread_attr_t const * attr,
+                   void *(*start_routine)(void *), void * arg);
+void pthread_exit(void * retval);
+int pthread_join(pthread_t thid, void ** ret_val);
+int pthread_detach(pthread_t  thid);
+
+pthread_t pthread_self(void);
+int pthread_equal(pthread_t one, pthread_t two);
+
+int pthread_getschedparam(pthread_t thid, int * policy,
+                          struct sched_param * param);
+int pthread_setschedparam(pthread_t thid, int poilcy,
+                          struct sched_param const * param);
+
+int pthread_mutexattr_init(pthread_mutexattr_t *attr);
+int pthread_mutexattr_destroy(pthread_mutexattr_t *attr);
+int pthread_mutexattr_gettype(const pthread_mutexattr_t *attr, int *type);
+int pthread_mutexattr_settype(pthread_mutexattr_t *attr, int type);
+int pthread_mutexattr_setpshared(pthread_mutexattr_t *attr, int  pshared);
+int pthread_mutexattr_getpshared(pthread_mutexattr_t *attr, int *pshared);
+
+int pthread_mutex_init(pthread_mutex_t *mutex,
+                       const pthread_mutexattr_t *attr);
+int pthread_mutex_destroy(pthread_mutex_t *mutex);
+int pthread_mutex_lock(pthread_mutex_t *mutex);
+int pthread_mutex_unlock(pthread_mutex_t *mutex);
+int pthread_mutex_trylock(pthread_mutex_t *mutex);
+#if 0 /* MISSING FROM BIONIC */
+int pthread_mutex_timedlock(pthread_mutex_t *mutex, struct timespec*  ts);
+#endif /* MISSING */
+
+int pthread_condattr_init(pthread_condattr_t *attr);
+int pthread_condattr_getpshared(pthread_condattr_t *attr, int *pshared);
+int pthread_condattr_setpshared(pthread_condattr_t* attr, int pshared);
+int pthread_condattr_destroy(pthread_condattr_t *attr);
+
+int pthread_cond_init(pthread_cond_t *cond,
+                      const pthread_condattr_t *attr);
+int pthread_cond_destroy(pthread_cond_t *cond);
+int pthread_cond_broadcast(pthread_cond_t *cond);
+int pthread_cond_signal(pthread_cond_t *cond);
+int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex);
+int pthread_cond_timedwait(pthread_cond_t *cond,
+                           pthread_mutex_t * mutex,
+                           const struct timespec *abstime);
+
+/* BIONIC: same as pthread_cond_timedwait, except the 'abstime' given refers
+ *         to the CLOCK_MONOTONIC clock instead, to avoid any problems when
+ *         the wall-clock time is changed brutally
+ */
+int pthread_cond_timedwait_monotonic_np(pthread_cond_t         *cond,
+                                        pthread_mutex_t        *mutex,
+                                        const struct timespec  *abstime);
+
+/* BIONIC: DEPRECATED. same as pthread_cond_timedwait_monotonic_np()
+ * unfortunately pthread_cond_timedwait_monotonic has shipped already
+ */
+int pthread_cond_timedwait_monotonic(pthread_cond_t         *cond,
+                                     pthread_mutex_t        *mutex,
+                                     const struct timespec  *abstime);
+
+#define HAVE_PTHREAD_COND_TIMEDWAIT_MONOTONIC 1
+
+/* BIONIC: same as pthread_cond_timedwait, except the 'reltime' given refers
+ *         is relative to the current time.
+ */
+int pthread_cond_timedwait_relative_np(pthread_cond_t         *cond,
+                                     pthread_mutex_t        *mutex,
+                                     const struct timespec  *reltime);
+
+#define HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE 1
+
+
+
+int pthread_cond_timeout_np(pthread_cond_t *cond,
+                            pthread_mutex_t * mutex,
+                            unsigned msecs);
+
+/* same as pthread_mutex_lock(), but will wait up to 'msecs' milli-seconds
+ * before returning. same return values than pthread_mutex_trylock though, i.e.
+ * returns EBUSY if the lock could not be acquired after the timeout
+ * expired.
+ */
+int pthread_mutex_lock_timeout_np(pthread_mutex_t *mutex, unsigned msecs);
+
+/* read-write lock support */
+
+typedef int pthread_rwlockattr_t;
+
+typedef struct {
+    pthread_mutex_t  lock;
+    pthread_cond_t   cond;
+    int              numLocks;
+    int              writerThreadId;
+    int              pendingReaders;
+    int              pendingWriters;
+    void*            reserved[4];  /* for future extensibility */
+} pthread_rwlock_t;
+
+#define PTHREAD_RWLOCK_INITIALIZER  { PTHREAD_MUTEX_INITIALIZER, 0, NULL, 0, 0 }
+
+int pthread_rwlockattr_init(pthread_rwlockattr_t *attr);
+int pthread_rwlockattr_destroy(pthread_rwlockattr_t *attr);
+int pthread_rwlockattr_setpshared(pthread_rwlockattr_t *attr, int  pshared);
+int pthread_rwlockattr_getpshared(pthread_rwlockattr_t *attr, int *pshared);
+
+int pthread_rwlock_init(pthread_rwlock_t *rwlock, const pthread_rwlockattr_t *attr);
+int pthread_rwlock_destroy(pthread_rwlock_t *rwlock);
+
+int pthread_rwlock_rdlock(pthread_rwlock_t *rwlock);
+int pthread_rwlock_tryrdlock(pthread_rwlock_t *rwlock);
+int pthread_rwlock_timedrdlock(pthread_rwlock_t *rwlock, const struct timespec *abs_timeout);
+
+int pthread_rwlock_wrlock(pthread_rwlock_t *rwlock);
+int pthread_rwlock_trywrlock(pthread_rwlock_t *rwlock);
+int pthread_rwlock_timedwrlock(pthread_rwlock_t *rwlock, const struct timespec *abs_timeout);
+
+int pthread_rwlock_unlock(pthread_rwlock_t *rwlock);
+
+
+int pthread_key_create(pthread_key_t *key, void (*destructor_function)(void *));
+int pthread_key_delete (pthread_key_t);
+int pthread_setspecific(pthread_key_t key, const void *value);
+void *pthread_getspecific(pthread_key_t key);
+
+int pthread_kill(pthread_t tid, int sig);
+int pthread_sigmask(int how, const sigset_t *set, sigset_t *oset);
+
+int pthread_getcpuclockid(pthread_t  tid, clockid_t  *clockid);
+
+int pthread_once(pthread_once_t  *once_control, void (*init_routine)(void));
+
+int pthread_setname_np(pthread_t thid, const char *thname);
+
+typedef void  (*__pthread_cleanup_func_t)(void*);
+
+typedef struct __pthread_cleanup_t {
+    struct __pthread_cleanup_t*   __cleanup_prev;
+    __pthread_cleanup_func_t      __cleanup_routine;
+    void*                         __cleanup_arg;
+} __pthread_cleanup_t;
+
+extern void  __pthread_cleanup_push(__pthread_cleanup_t*      c,
+                                    __pthread_cleanup_func_t  routine,
+                                    void*                     arg);
+
+extern void  __pthread_cleanup_pop(__pthread_cleanup_t*  c,
+                                   int                   execute);
+
+/* Believe or not, the definitions of pthread_cleanup_push and
+ * pthread_cleanup_pop below are correct. Posix states that these
+ * can be implemented as macros that might introduce opening and
+ * closing braces, and that using setjmp/longjmp/return/break/continue
+ * between them results in undefined behaviour.
+ *
+ * And indeed, GLibc and other C libraries use a similar definition
+ */
+#define  pthread_cleanup_push(routine, arg)                      \
+    do {                                                         \
+        __pthread_cleanup_t  __cleanup;                          \
+        __pthread_cleanup_push( &__cleanup, (routine), (arg) );  \
+
+#define  pthread_cleanup_pop(execute)                  \
+        __pthread_cleanup_pop( &__cleanup, (execute)); \
+    } while (0);
+
+#if __cplusplus
+} /* extern "C" */
+#endif
+
+/************ TO FIX ************/
+
+#define LONG_LONG_MAX __LONG_LONG_MAX__
+#define LONG_LONG_MIN (-__LONG_LONG_MAX__ - 1)
+
+#endif // _PTHREAD_H_
diff --git a/ndk/platforms/android-9/include/sched.h b/ndk/platforms/android-9/include/sched.h
new file mode 100644
index 0000000..e702470
--- /dev/null
+++ b/ndk/platforms/android-9/include/sched.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _SCHED_H_
+#define _SCHED_H_
+
+#include <sys/cdefs.h>
+#include <sys/time.h>
+
+__BEGIN_DECLS
+
+#define SCHED_NORMAL            0
+#define SCHED_OTHER             0
+#define SCHED_FIFO              1
+#define SCHED_RR                2
+
+struct sched_param {
+    int sched_priority;
+};
+
+extern int sched_setscheduler(pid_t, int, const struct sched_param *);
+extern int sched_getscheduler(pid_t);
+extern int sched_yield(void);
+extern int sched_get_priority_max(int policy);
+extern int sched_get_priority_min(int policy);
+extern int sched_setparam(pid_t, const struct sched_param *);
+extern int sched_getparam(pid_t, struct sched_param *);
+extern int sched_rr_get_interval(pid_t pid, struct timespec *tp);
+
+#define CLONE_VM             0x00000100
+#define CLONE_FS             0x00000200
+#define CLONE_FILES          0x00000400
+#define CLONE_SIGHAND        0x00000800
+#define CLONE_PTRACE         0x00002000
+#define CLONE_VFORK          0x00004000
+#define CLONE_PARENT         0x00008000
+#define CLONE_THREAD         0x00010000
+#define CLONE_NEWNS          0x00020000
+#define CLONE_SYSVSEM        0x00040000
+#define CLONE_SETTLS         0x00080000
+#define CLONE_PARENT_SETTID  0x00100000
+#define CLONE_CHILD_CLEARTID 0x00200000
+#define CLONE_DETACHED       0x00400000
+#define CLONE_UNTRACED       0x00800000
+#define CLONE_CHILD_SETTID   0x01000000
+#define CLONE_STOPPED        0x02000000
+
+#ifdef _GNU_SOURCE
+extern int clone(int (*fn)(void *), void *child_stack, int flags, void*  arg, ...);
+#endif
+
+__END_DECLS
+
+#endif /* _SCHED_H_ */
diff --git a/ndk/platforms/android-9/include/stdlib.h b/ndk/platforms/android-9/include/stdlib.h
new file mode 100644
index 0000000..97d8e46
--- /dev/null
+++ b/ndk/platforms/android-9/include/stdlib.h
@@ -0,0 +1,185 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _STDLIB_H_
+#define _STDLIB_H_
+
+#include <sys/cdefs.h>
+
+/* wchar_t is required in stdlib.h according to POSIX.
+ * note that defining __need_wchar_t prevents stddef.h
+ * to define all other symbols it does normally */
+#define __need_wchar_t
+#include <stddef.h>
+
+#include <stddef.h>
+#include <string.h>
+#include <alloca.h>
+#include <strings.h>
+#include <memory.h>
+
+__BEGIN_DECLS
+
+#define EXIT_FAILURE 1
+#define EXIT_SUCCESS 0
+
+extern __noreturn void exit(int);
+extern __noreturn void abort(void);
+extern int atexit(void (*)(void));
+
+extern char *getenv(const char *);
+extern int putenv(const char *);
+extern int setenv(const char *, const char *, int);
+extern int unsetenv(const char *);
+extern int clearenv(void);
+
+extern char *mktemp (char *);
+extern int mkstemp (char *);
+
+extern long strtol(const char *, char **, int);
+extern long long strtoll(const char *, char **, int);
+extern unsigned long strtoul(const char *, char **, int);
+extern unsigned long long strtoull(const char *, char **, int);
+extern double strtod(const char *nptr, char **endptr);
+
+static __inline__ float strtof(const char *nptr, char **endptr)
+{
+    return (float)strtod(nptr, endptr);
+}
+
+extern int atoi(const char *);
+extern long atol(const char *);
+extern long long atoll(const char *);
+
+static __inline__ double atof(const char *nptr)
+{
+    return (strtod(nptr, NULL));
+}
+
+static __inline__ int abs(int __n) {
+    return (__n < 0) ? -__n : __n;
+}
+
+static __inline__ long labs(long __n) {
+    return (__n < 0L) ? -__n : __n;
+}
+
+static __inline__ long long llabs(long long __n) {
+    return (__n < 0LL) ? -__n : __n;
+}
+
+extern char * realpath(const char *path, char *resolved);
+extern int system(const char * string);
+
+extern void * bsearch(const void *key, const void *base0,
+	size_t nmemb, size_t size,
+	int (*compar)(const void *, const void *));
+
+extern void qsort(void *, size_t, size_t, int (*)(const void *, const void *));
+
+extern long jrand48(unsigned short *);
+extern long mrand48(void);
+extern long nrand48(unsigned short *);
+extern long lrand48(void);
+extern unsigned short *seed48(unsigned short*);
+extern double erand48(unsigned short xsubi[3]);
+extern double drand48(void);
+extern void srand48(long);
+extern unsigned int arc4random(void);
+extern void arc4random_stir(void);
+extern void arc4random_addrandom(unsigned char *, int);
+
+#define RAND_MAX 0x7fffffff
+static __inline__ int rand(void) {
+    return (int)lrand48();
+}
+static __inline__ void srand(unsigned int __s) {
+    srand48(__s);
+}
+static __inline__ long random(void)
+{
+    return lrand48();
+}
+static __inline__ void srandom(unsigned int __s)
+{
+    srand48(__s);
+}
+
+/* Basic PTY functions.  These only work if devpts is mounted! */
+
+extern int    unlockpt(int);
+extern char*  ptsname(int);
+extern int    ptsname_r(int, char*, size_t);
+extern int    getpt(void);
+
+static __inline__ int grantpt(int __fd __attribute((unused)))
+{
+  (void)__fd;
+  return 0;     /* devpts does this all for us! */
+}
+
+typedef struct {
+    int  quot;
+    int  rem;
+} div_t;
+
+extern div_t   div(int, int);
+
+typedef struct {
+    long int  quot;
+    long int  rem;
+} ldiv_t;
+
+extern ldiv_t   ldiv(long, long);
+
+typedef struct {
+    long long int  quot;
+    long long int  rem;
+} lldiv_t;
+
+extern lldiv_t   lldiv(long long, long long);
+
+#if 1 /* MISSING FROM BIONIC - ENABLED FOR STLPort and libstdc++-v3 */
+/* make STLPort happy */
+extern int      mblen(const char *, size_t);
+extern size_t   mbstowcs(wchar_t *, const char *, size_t);
+extern int      mbtowc(wchar_t *, const char *, size_t);
+
+/* Likewise, make libstdc++-v3 happy.  */
+extern int	wctomb(char *, wchar_t);
+extern size_t	wcstombs(char *, const wchar_t *, size_t);
+#endif /* MISSING */
+
+#define MB_CUR_MAX 1
+
+#if 0 /* MISSING FROM BIONIC */
+extern int on_exit(void (*)(int, void *), void *);
+#endif /* MISSING */
+
+__END_DECLS
+
+#endif /* _STDLIB_H_ */
diff --git a/ndk/platforms/android-9/include/strings.h b/ndk/platforms/android-9/include/strings.h
new file mode 100644
index 0000000..fee7dc4
--- /dev/null
+++ b/ndk/platforms/android-9/include/strings.h
@@ -0,0 +1,56 @@
+/*	$NetBSD: strings.h,v 1.10 2005/02/03 04:39:32 perry Exp $	*/
+
+/*-
+ * Copyright (c) 1998 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Klaus Klein.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *        This product includes software developed by the NetBSD
+ *        Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``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 FOUNDATION OR CONTRIBUTORS
+ * 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 _STRINGS_H_
+#define _STRINGS_H_
+
+#include <sys/types.h>
+#include <sys/cdefs.h>
+
+__BEGIN_DECLS
+int	 bcmp(const void *, const void *, size_t);
+void	 bcopy(const void *, void *, size_t);
+void	 bzero(void *, size_t);
+int	 ffs(int);
+char	*index(const char *, int);
+char	*rindex(const char *, int);
+int	 strcasecmp(const char *, const char *);
+int	 strncasecmp(const char *, const char *, size_t);
+__END_DECLS
+
+#endif /* !defined(_STRINGS_H_) */
diff --git a/ndk/platforms/android-9/include/sys/_sigdefs.h b/ndk/platforms/android-9/include/sys/_sigdefs.h
new file mode 100644
index 0000000..6822c25
--- /dev/null
+++ b/ndk/platforms/android-9/include/sys/_sigdefs.h
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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.
+ */
+
+/*
+ * this header is used to define signal constants and names;
+ * it might be included several times
+ */
+
+#ifndef __BIONIC_SIGDEF
+#error __BIONIC_SIGDEF not defined
+#endif
+
+__BIONIC_SIGDEF(HUP,1,"Hangup")
+__BIONIC_SIGDEF(INT,2,"Interrupt")
+__BIONIC_SIGDEF(QUIT,3,"Quit")
+__BIONIC_SIGDEF(ILL,4,"Illegal instruction")
+__BIONIC_SIGDEF(TRAP,5,"Trap")
+__BIONIC_SIGDEF(ABRT,6,"Aborted")
+__BIONIC_SIGDEF(BUS,7,"Bus error")
+__BIONIC_SIGDEF(FPE,8,"Floating point exception")
+__BIONIC_SIGDEF(KILL,9,"Killed")
+__BIONIC_SIGDEF(USR1,10,"User signal 1")
+__BIONIC_SIGDEF(SEGV,11,"Segmentation fault")
+__BIONIC_SIGDEF(USR2,12,"User signal 2")
+__BIONIC_SIGDEF(PIPE,13,"Broken pipe")
+__BIONIC_SIGDEF(ALRM,14,"Alarm clock")
+__BIONIC_SIGDEF(TERM,15,"Terminated")
+__BIONIC_SIGDEF(STKFLT,16,"Stack fault")
+__BIONIC_SIGDEF(CHLD,17,"Child exited")
+__BIONIC_SIGDEF(CONT,18,"Continue")
+__BIONIC_SIGDEF(STOP,19,"Stopped (signal)")
+__BIONIC_SIGDEF(TSTP,20,"Stopped")
+__BIONIC_SIGDEF(TTIN,21,"Stopped (tty input)")
+__BIONIC_SIGDEF(TTOU,22,"Stopper (tty output)")
+__BIONIC_SIGDEF(URG,23,"Urgent I/O condition")
+__BIONIC_SIGDEF(XCPU,24,"CPU time limit exceeded")
+__BIONIC_SIGDEF(XFSZ,25,"File size limit exceeded")
+__BIONIC_SIGDEF(VTALRM,26,"Virtual timer expired")
+__BIONIC_SIGDEF(PROF,27,"Profiling timer expired")
+__BIONIC_SIGDEF(WINCH,28,"Window size changed")
+__BIONIC_SIGDEF(IO,29,"I/O possible")
+__BIONIC_SIGDEF(PWR,30,"Power failure")
+__BIONIC_SIGDEF(SYS,31,"Bad system call")
+
+#undef __BIONIC_SIGDEF
diff --git a/ndk/platforms/android-9/include/sys/cdefs.h b/ndk/platforms/android-9/include/sys/cdefs.h
new file mode 100644
index 0000000..849e2b8
--- /dev/null
+++ b/ndk/platforms/android-9/include/sys/cdefs.h
@@ -0,0 +1,501 @@
+/*	$NetBSD: cdefs.h,v 1.58 2004/12/11 05:59:00 christos Exp $	*/
+
+/*
+ * Copyright (c) 1991, 1993
+ *	The Regents of the University of California.  All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Berkeley Software Design, Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. 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.
+ * 3. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
+ *
+ *	@(#)cdefs.h	8.8 (Berkeley) 1/9/95
+ */
+
+#ifndef	_SYS_CDEFS_H_
+#define	_SYS_CDEFS_H_
+
+/*
+ * Macro to test if we're using a GNU C compiler of a specific vintage
+ * or later, for e.g. features that appeared in a particular version
+ * of GNU C.  Usage:
+ *
+ *	#if __GNUC_PREREQ__(major, minor)
+ *	...cool feature...
+ *	#else
+ *	...delete feature...
+ *	#endif
+ */
+#ifdef __GNUC__
+#define	__GNUC_PREREQ__(x, y)						\
+	((__GNUC__ == (x) && __GNUC_MINOR__ >= (y)) ||			\
+	 (__GNUC__ > (x)))
+#else
+#define	__GNUC_PREREQ__(x, y)	0
+#endif
+
+#include <sys/cdefs_elf.h>
+
+#if defined(__cplusplus)
+#define	__BEGIN_DECLS		extern "C" {
+#define	__END_DECLS		}
+#define	__static_cast(x,y)	static_cast<x>(y)
+#else
+#define	__BEGIN_DECLS
+#define	__END_DECLS
+#define	__static_cast(x,y)	(x)y
+#endif
+
+/*
+ * The __CONCAT macro is used to concatenate parts of symbol names, e.g.
+ * with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfoo.
+ * The __CONCAT macro is a bit tricky -- make sure you don't put spaces
+ * in between its arguments.  __CONCAT can also concatenate double-quoted
+ * strings produced by the __STRING macro, but this only works with ANSI C.
+ */
+
+#define	___STRING(x)	__STRING(x)
+#define	___CONCAT(x,y)	__CONCAT(x,y)
+
+#if __STDC__ || defined(__cplusplus)
+#define	__P(protos)	protos		/* full-blown ANSI C */
+#define	__CONCAT(x,y)	x ## y
+#define	__STRING(x)	#x
+
+#define	__const		const		/* define reserved names to standard */
+#define	__signed	signed
+#define	__volatile	volatile
+#if defined(__cplusplus)
+#define	__inline	inline		/* convert to C++ keyword */
+#else
+#if !defined(__GNUC__) && !defined(__lint__)
+#define	__inline			/* delete GCC keyword */
+#endif /* !__GNUC__  && !__lint__ */
+#endif /* !__cplusplus */
+
+#else	/* !(__STDC__ || __cplusplus) */
+#define	__P(protos)	()		/* traditional C preprocessor */
+#define	__CONCAT(x,y)	x/**/y
+#define	__STRING(x)	"x"
+
+#ifndef __GNUC__
+#define	__const				/* delete pseudo-ANSI C keywords */
+#define	__inline
+#define	__signed
+#define	__volatile
+#endif	/* !__GNUC__ */
+
+/*
+ * In non-ANSI C environments, new programs will want ANSI-only C keywords
+ * deleted from the program and old programs will want them left alone.
+ * Programs using the ANSI C keywords const, inline etc. as normal
+ * identifiers should define -DNO_ANSI_KEYWORDS.
+ */
+#ifndef	NO_ANSI_KEYWORDS
+#define	const		__const		/* convert ANSI C keywords */
+#define	inline		__inline
+#define	signed		__signed
+#define	volatile	__volatile
+#endif /* !NO_ANSI_KEYWORDS */
+#endif	/* !(__STDC__ || __cplusplus) */
+
+/*
+ * Used for internal auditing of the NetBSD source tree.
+ */
+#ifdef __AUDIT__
+#define	__aconst	__const
+#else
+#define	__aconst
+#endif
+
+/*
+ * The following macro is used to remove const cast-away warnings
+ * from gcc -Wcast-qual; it should be used with caution because it
+ * can hide valid errors; in particular most valid uses are in
+ * situations where the API requires it, not to cast away string
+ * constants. We don't use *intptr_t on purpose here and we are
+ * explicit about unsigned long so that we don't have additional
+ * dependencies.
+ */
+#define __UNCONST(a)	((void *)(unsigned long)(const void *)(a))
+
+/*
+ * GCC2 provides __extension__ to suppress warnings for various GNU C
+ * language extensions under "-ansi -pedantic".
+ */
+#if !__GNUC_PREREQ__(2, 0)
+#define	__extension__		/* delete __extension__ if non-gcc or gcc1 */
+#endif
+
+/*
+ * GCC1 and some versions of GCC2 declare dead (non-returning) and
+ * pure (no side effects) functions using "volatile" and "const";
+ * unfortunately, these then cause warnings under "-ansi -pedantic".
+ * GCC2 uses a new, peculiar __attribute__((attrs)) style.  All of
+ * these work for GNU C++ (modulo a slight glitch in the C++ grammar
+ * in the distribution version of 2.5.5).
+ */
+#if !__GNUC_PREREQ__(2, 5)
+#define	__attribute__(x)	/* delete __attribute__ if non-gcc or gcc1 */
+#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
+#define	__dead		__volatile
+#define	__pure		__const
+#endif
+#endif
+
+/* Delete pseudo-keywords wherever they are not available or needed. */
+#ifndef __dead
+#define	__dead
+#define	__pure
+#endif
+
+#if __GNUC_PREREQ__(2, 7)
+#define	__unused	__attribute__((__unused__))
+#else
+#define	__unused	/* delete */
+#endif
+
+#if __GNUC_PREREQ__(3, 1)
+#define	__used		__attribute__((__used__))
+#else
+#define	__used		/* delete */
+#endif
+
+#if __GNUC_PREREQ__(2, 7)
+#define	__packed	__attribute__((__packed__))
+#define	__aligned(x)	__attribute__((__aligned__(x)))
+#define	__section(x)	__attribute__((__section__(x)))
+#elif defined(__lint__)
+#define	__packed	/* delete */
+#define	__aligned(x)	/* delete */
+#define	__section(x)	/* delete */
+#else
+#define	__packed	error: no __packed for this compiler
+#define	__aligned(x)	error: no __aligned for this compiler
+#define	__section(x)	error: no __section for this compiler
+#endif
+
+#if !__GNUC_PREREQ__(2, 8)
+#define	__extension__
+#endif
+
+#if __GNUC_PREREQ__(2, 8)
+#define __statement(x)	__extension__(x)
+#elif defined(lint)
+#define __statement(x)	(0)
+#else
+#define __statement(x)	(x)
+#endif
+
+/*
+ * C99 defines the restrict type qualifier keyword, which was made available
+ * in GCC 2.92.
+ */
+#if __STDC_VERSION__ >= 199901L
+#define	__restrict	restrict
+#else
+#if !__GNUC_PREREQ__(2, 92)
+#define	__restrict	/* delete __restrict when not supported */
+#endif
+#endif
+
+/*
+ * C99 defines __func__ predefined identifier, which was made available
+ * in GCC 2.95.
+ */
+#if !(__STDC_VERSION__ >= 199901L)
+#if __GNUC_PREREQ__(2, 6)
+#define	__func__	__PRETTY_FUNCTION__
+#elif __GNUC_PREREQ__(2, 4)
+#define	__func__	__FUNCTION__
+#else
+#define	__func__	""
+#endif
+#endif /* !(__STDC_VERSION__ >= 199901L) */
+
+#if defined(_KERNEL)
+#if defined(NO_KERNEL_RCSIDS)
+#undef __KERNEL_RCSID
+#define	__KERNEL_RCSID(_n, _s)		/* nothing */
+#endif /* NO_KERNEL_RCSIDS */
+#endif /* _KERNEL */
+
+#if !defined(_STANDALONE) && !defined(_KERNEL)
+#ifdef __GNUC__
+#define	__RENAME(x)	___RENAME(x)
+#else
+#ifdef __lint__
+#define	__RENAME(x)	__symbolrename(x)
+#else
+#error "No function renaming possible"
+#endif /* __lint__ */
+#endif /* __GNUC__ */
+#else /* _STANDALONE || _KERNEL */
+#define	__RENAME(x)	no renaming in kernel or standalone environment
+#endif
+
+/*
+ * A barrier to stop the optimizer from moving code or assume live
+ * register values. This is gcc specific, the version is more or less
+ * arbitrary, might work with older compilers.
+ */
+#if __GNUC_PREREQ__(2, 95)
+#define	__insn_barrier()	__asm __volatile("":::"memory")
+#else
+#define	__insn_barrier()	/* */
+#endif
+
+/*
+ * GNU C version 2.96 adds explicit branch prediction so that
+ * the CPU back-end can hint the processor and also so that
+ * code blocks can be reordered such that the predicted path
+ * sees a more linear flow, thus improving cache behavior, etc.
+ *
+ * The following two macros provide us with a way to use this
+ * compiler feature.  Use __predict_true() if you expect the expression
+ * to evaluate to true, and __predict_false() if you expect the
+ * expression to evaluate to false.
+ *
+ * A few notes about usage:
+ *
+ *	* Generally, __predict_false() error condition checks (unless
+ *	  you have some _strong_ reason to do otherwise, in which case
+ *	  document it), and/or __predict_true() `no-error' condition
+ *	  checks, assuming you want to optimize for the no-error case.
+ *
+ *	* Other than that, if you don't know the likelihood of a test
+ *	  succeeding from empirical or other `hard' evidence, don't
+ *	  make predictions.
+ *
+ *	* These are meant to be used in places that are run `a lot'.
+ *	  It is wasteful to make predictions in code that is run
+ *	  seldomly (e.g. at subsystem initialization time) as the
+ *	  basic block reordering that this affects can often generate
+ *	  larger code.
+ */
+#if __GNUC_PREREQ__(2, 96)
+#define	__predict_true(exp)	__builtin_expect((exp) != 0, 1)
+#define	__predict_false(exp)	__builtin_expect((exp) != 0, 0)
+#else
+#define	__predict_true(exp)	(exp)
+#define	__predict_false(exp)	(exp)
+#endif
+
+#if __GNUC_PREREQ__(2, 96)
+#define __noreturn    __attribute__((__noreturn__))
+#define __mallocfunc  __attribute__((malloc))
+#else
+#define __noreturn
+#define __mallocfunc
+#endif
+
+/*
+ * Macros for manipulating "link sets".  Link sets are arrays of pointers
+ * to objects, which are gathered up by the linker.
+ *
+ * Object format-specific code has provided us with the following macros:
+ *
+ *	__link_set_add_text(set, sym)
+ *		Add a reference to the .text symbol `sym' to `set'.
+ *
+ *	__link_set_add_rodata(set, sym)
+ *		Add a reference to the .rodata symbol `sym' to `set'.
+ *
+ *	__link_set_add_data(set, sym)
+ *		Add a reference to the .data symbol `sym' to `set'.
+ *
+ *	__link_set_add_bss(set, sym)
+ *		Add a reference to the .bss symbol `sym' to `set'.
+ *
+ *	__link_set_decl(set, ptype)
+ *		Provide an extern declaration of the set `set', which
+ *		contains an array of the pointer type `ptype'.  This
+ *		macro must be used by any code which wishes to reference
+ *		the elements of a link set.
+ *
+ *	__link_set_start(set)
+ *		This points to the first slot in the link set.
+ *
+ *	__link_set_end(set)
+ *		This points to the (non-existent) slot after the last
+ *		entry in the link set.
+ *
+ *	__link_set_count(set)
+ *		Count the number of entries in link set `set'.
+ *
+ * In addition, we provide the following macros for accessing link sets:
+ *
+ *	__link_set_foreach(pvar, set)
+ *		Iterate over the link set `set'.  Because a link set is
+ *		an array of pointers, pvar must be declared as "type **pvar",
+ *		and the actual entry accessed as "*pvar".
+ *
+ *	__link_set_entry(set, idx)
+ *		Access the link set entry at index `idx' from set `set'.
+ */
+#define	__link_set_foreach(pvar, set)					\
+	for (pvar = __link_set_start(set); pvar < __link_set_end(set); pvar++)
+
+#define	__link_set_entry(set, idx)	(__link_set_begin(set)[idx])
+
+/*
+ * Some of the recend FreeBSD sources used in Bionic need this.
+ * Originally, this is used to embed the rcs versions of each source file
+ * in the generated binary. We certainly don't want this in Bionic.
+ */
+#define	__FBSDID(s)	struct __hack
+
+/*-
+ * The following definitions are an extension of the behavior originally
+ * implemented in <sys/_posix.h>, but with a different level of granularity.
+ * POSIX.1 requires that the macros we test be defined before any standard
+ * header file is included.
+ *
+ * Here's a quick run-down of the versions:
+ *  defined(_POSIX_SOURCE)		1003.1-1988
+ *  _POSIX_C_SOURCE == 1		1003.1-1990
+ *  _POSIX_C_SOURCE == 2		1003.2-1992 C Language Binding Option
+ *  _POSIX_C_SOURCE == 199309		1003.1b-1993
+ *  _POSIX_C_SOURCE == 199506		1003.1c-1995, 1003.1i-1995,
+ *					and the omnibus ISO/IEC 9945-1: 1996
+ *  _POSIX_C_SOURCE == 200112		1003.1-2001
+ *  _POSIX_C_SOURCE == 200809		1003.1-2008
+ *
+ * In addition, the X/Open Portability Guide, which is now the Single UNIX
+ * Specification, defines a feature-test macro which indicates the version of
+ * that specification, and which subsumes _POSIX_C_SOURCE.
+ *
+ * Our macros begin with two underscores to avoid namespace screwage.
+ */
+
+/* Deal with IEEE Std. 1003.1-1990, in which _POSIX_C_SOURCE == 1. */
+#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE == 1
+#undef _POSIX_C_SOURCE		/* Probably illegal, but beyond caring now. */
+#define	_POSIX_C_SOURCE		199009
+#endif
+
+/* Deal with IEEE Std. 1003.2-1992, in which _POSIX_C_SOURCE == 2. */
+#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE == 2
+#undef _POSIX_C_SOURCE
+#define	_POSIX_C_SOURCE		199209
+#endif
+
+/* Deal with various X/Open Portability Guides and Single UNIX Spec. */
+#ifdef _XOPEN_SOURCE
+#if _XOPEN_SOURCE - 0 >= 700
+#define	__XSI_VISIBLE		700
+#undef _POSIX_C_SOURCE
+#define	_POSIX_C_SOURCE		200809
+#elif _XOPEN_SOURCE - 0 >= 600
+#define	__XSI_VISIBLE		600
+#undef _POSIX_C_SOURCE
+#define	_POSIX_C_SOURCE		200112
+#elif _XOPEN_SOURCE - 0 >= 500
+#define	__XSI_VISIBLE		500
+#undef _POSIX_C_SOURCE
+#define	_POSIX_C_SOURCE		199506
+#endif
+#endif
+
+/*
+ * Deal with all versions of POSIX.  The ordering relative to the tests above is
+ * important.
+ */
+#if defined(_POSIX_SOURCE) && !defined(_POSIX_C_SOURCE)
+#define	_POSIX_C_SOURCE		198808
+#endif
+#ifdef _POSIX_C_SOURCE
+#if _POSIX_C_SOURCE >= 200809
+#define	__POSIX_VISIBLE		200809
+#define	__ISO_C_VISIBLE		1999
+#elif _POSIX_C_SOURCE >= 200112
+#define	__POSIX_VISIBLE		200112
+#define	__ISO_C_VISIBLE		1999
+#elif _POSIX_C_SOURCE >= 199506
+#define	__POSIX_VISIBLE		199506
+#define	__ISO_C_VISIBLE		1990
+#elif _POSIX_C_SOURCE >= 199309
+#define	__POSIX_VISIBLE		199309
+#define	__ISO_C_VISIBLE		1990
+#elif _POSIX_C_SOURCE >= 199209
+#define	__POSIX_VISIBLE		199209
+#define	__ISO_C_VISIBLE		1990
+#elif _POSIX_C_SOURCE >= 199009
+#define	__POSIX_VISIBLE		199009
+#define	__ISO_C_VISIBLE		1990
+#else
+#define	__POSIX_VISIBLE		198808
+#define	__ISO_C_VISIBLE		0
+#endif /* _POSIX_C_SOURCE */
+#else
+/*-
+ * Deal with _ANSI_SOURCE:
+ * If it is defined, and no other compilation environment is explicitly
+ * requested, then define our internal feature-test macros to zero.  This
+ * makes no difference to the preprocessor (undefined symbols in preprocessing
+ * expressions are defined to have value zero), but makes it more convenient for
+ * a test program to print out the values.
+ *
+ * If a program mistakenly defines _ANSI_SOURCE and some other macro such as
+ * _POSIX_C_SOURCE, we will assume that it wants the broader compilation
+ * environment (and in fact we will never get here).
+ */
+#if defined(_ANSI_SOURCE)	/* Hide almost everything. */
+#define	__POSIX_VISIBLE		0
+#define	__XSI_VISIBLE		0
+#define	__BSD_VISIBLE		0
+#define	__ISO_C_VISIBLE		1990
+#elif defined(_C99_SOURCE)	/* Localism to specify strict C99 env. */
+#define	__POSIX_VISIBLE		0
+#define	__XSI_VISIBLE		0
+#define	__BSD_VISIBLE		0
+#define	__ISO_C_VISIBLE		1999
+#else				/* Default environment: show everything. */
+#define	__POSIX_VISIBLE		200809
+#define	__XSI_VISIBLE		700
+#define	__BSD_VISIBLE		1
+#define	__ISO_C_VISIBLE		1999
+#endif
+#endif
+
+/*
+ * Default values.
+ */
+#ifndef __XPG_VISIBLE
+# define __XPG_VISIBLE          700
+#endif
+#ifndef __POSIX_VISIBLE
+# define __POSIX_VISIBLE        200809
+#endif
+#ifndef __ISO_C_VISIBLE
+# define __ISO_C_VISIBLE        1999
+#endif
+#ifndef __BSD_VISIBLE
+# define __BSD_VISIBLE          1
+#endif
+
+#define  __BIONIC__   1
+
+#endif /* !_SYS_CDEFS_H_ */
diff --git a/ndk/platforms/android-9/include/sys/linux-syscalls.h b/ndk/platforms/android-9/include/sys/linux-syscalls.h
new file mode 100644
index 0000000..9702a7a
--- /dev/null
+++ b/ndk/platforms/android-9/include/sys/linux-syscalls.h
@@ -0,0 +1,292 @@
+/* auto-generated by gensyscalls.py, do not touch */
+#ifndef _BIONIC_LINUX_SYSCALLS_H_
+
+#if !defined __ASM_ARM_UNISTD_H && !defined __ASM_I386_UNISTD_H
+#if defined __arm__ && !defined __ARM_EABI__ && !defined __thumb__
+  #  define __NR_SYSCALL_BASE  0x900000
+  #else
+  #  define  __NR_SYSCALL_BASE  0
+  #endif
+
+#define __NR_exit                         (__NR_SYSCALL_BASE + 1)
+#define __NR_fork                         (__NR_SYSCALL_BASE + 2)
+#define __NR_clone                        (__NR_SYSCALL_BASE + 120)
+#define __NR_execve                       (__NR_SYSCALL_BASE + 11)
+#define __NR_setuid32                     (__NR_SYSCALL_BASE + 213)
+#define __NR_getuid32                     (__NR_SYSCALL_BASE + 199)
+#define __NR_getgid32                     (__NR_SYSCALL_BASE + 200)
+#define __NR_geteuid32                    (__NR_SYSCALL_BASE + 201)
+#define __NR_getegid32                    (__NR_SYSCALL_BASE + 202)
+#define __NR_getresuid32                  (__NR_SYSCALL_BASE + 209)
+#define __NR_getresgid32                  (__NR_SYSCALL_BASE + 211)
+#define __NR_gettid                       (__NR_SYSCALL_BASE + 224)
+#define __NR_getgroups32                  (__NR_SYSCALL_BASE + 205)
+#define __NR_getpgid                      (__NR_SYSCALL_BASE + 132)
+#define __NR_getppid                      (__NR_SYSCALL_BASE + 64)
+#define __NR_setsid                       (__NR_SYSCALL_BASE + 66)
+#define __NR_setgid32                     (__NR_SYSCALL_BASE + 214)
+#define __NR_setreuid32                   (__NR_SYSCALL_BASE + 203)
+#define __NR_setresuid32                  (__NR_SYSCALL_BASE + 208)
+#define __NR_setresgid32                  (__NR_SYSCALL_BASE + 210)
+#define __NR_brk                          (__NR_SYSCALL_BASE + 45)
+#define __NR_ptrace                       (__NR_SYSCALL_BASE + 26)
+#define __NR_getpriority                  (__NR_SYSCALL_BASE + 96)
+#define __NR_setpriority                  (__NR_SYSCALL_BASE + 97)
+#define __NR_setrlimit                    (__NR_SYSCALL_BASE + 75)
+#define __NR_ugetrlimit                   (__NR_SYSCALL_BASE + 191)
+#define __NR_getrusage                    (__NR_SYSCALL_BASE + 77)
+#define __NR_setgroups32                  (__NR_SYSCALL_BASE + 206)
+#define __NR_setpgid                      (__NR_SYSCALL_BASE + 57)
+#define __NR_setregid32                   (__NR_SYSCALL_BASE + 204)
+#define __NR_chroot                       (__NR_SYSCALL_BASE + 61)
+#define __NR_prctl                        (__NR_SYSCALL_BASE + 172)
+#define __NR_capget                       (__NR_SYSCALL_BASE + 184)
+#define __NR_capset                       (__NR_SYSCALL_BASE + 185)
+#define __NR_sigaltstack                  (__NR_SYSCALL_BASE + 186)
+#define __NR_acct                         (__NR_SYSCALL_BASE + 51)
+#define __NR_read                         (__NR_SYSCALL_BASE + 3)
+#define __NR_write                        (__NR_SYSCALL_BASE + 4)
+#define __NR_pread64                      (__NR_SYSCALL_BASE + 180)
+#define __NR_pwrite64                     (__NR_SYSCALL_BASE + 181)
+#define __NR_open                         (__NR_SYSCALL_BASE + 5)
+#define __NR_close                        (__NR_SYSCALL_BASE + 6)
+#define __NR_lseek                        (__NR_SYSCALL_BASE + 19)
+#define __NR__llseek                      (__NR_SYSCALL_BASE + 140)
+#define __NR_getpid                       (__NR_SYSCALL_BASE + 20)
+#define __NR_mmap2                        (__NR_SYSCALL_BASE + 192)
+#define __NR_munmap                       (__NR_SYSCALL_BASE + 91)
+#define __NR_mremap                       (__NR_SYSCALL_BASE + 163)
+#define __NR_msync                        (__NR_SYSCALL_BASE + 144)
+#define __NR_mprotect                     (__NR_SYSCALL_BASE + 125)
+#define __NR_mlock                        (__NR_SYSCALL_BASE + 150)
+#define __NR_munlock                      (__NR_SYSCALL_BASE + 151)
+#define __NR_ioctl                        (__NR_SYSCALL_BASE + 54)
+#define __NR_readv                        (__NR_SYSCALL_BASE + 145)
+#define __NR_writev                       (__NR_SYSCALL_BASE + 146)
+#define __NR_fcntl                        (__NR_SYSCALL_BASE + 55)
+#define __NR_flock                        (__NR_SYSCALL_BASE + 143)
+#define __NR_fchmod                       (__NR_SYSCALL_BASE + 94)
+#define __NR_dup                          (__NR_SYSCALL_BASE + 41)
+#define __NR_pipe                         (__NR_SYSCALL_BASE + 42)
+#define __NR_dup2                         (__NR_SYSCALL_BASE + 63)
+#define __NR__newselect                   (__NR_SYSCALL_BASE + 142)
+#define __NR_ftruncate                    (__NR_SYSCALL_BASE + 93)
+#define __NR_fsync                        (__NR_SYSCALL_BASE + 118)
+#define __NR_fdatasync                    (__NR_SYSCALL_BASE + 148)
+#define __NR_fchown32                     (__NR_SYSCALL_BASE + 207)
+#define __NR_sync                         (__NR_SYSCALL_BASE + 36)
+#define __NR_fcntl64                      (__NR_SYSCALL_BASE + 221)
+#define __NR_sendfile                     (__NR_SYSCALL_BASE + 187)
+#define __NR_link                         (__NR_SYSCALL_BASE + 9)
+#define __NR_unlink                       (__NR_SYSCALL_BASE + 10)
+#define __NR_chdir                        (__NR_SYSCALL_BASE + 12)
+#define __NR_mknod                        (__NR_SYSCALL_BASE + 14)
+#define __NR_chmod                        (__NR_SYSCALL_BASE + 15)
+#define __NR_chown32                      (__NR_SYSCALL_BASE + 212)
+#define __NR_lchown32                     (__NR_SYSCALL_BASE + 198)
+#define __NR_mount                        (__NR_SYSCALL_BASE + 21)
+#define __NR_umount2                      (__NR_SYSCALL_BASE + 52)
+#define __NR_fstat64                      (__NR_SYSCALL_BASE + 197)
+#define __NR_stat64                       (__NR_SYSCALL_BASE + 195)
+#define __NR_lstat64                      (__NR_SYSCALL_BASE + 196)
+#define __NR_mkdir                        (__NR_SYSCALL_BASE + 39)
+#define __NR_readlink                     (__NR_SYSCALL_BASE + 85)
+#define __NR_rmdir                        (__NR_SYSCALL_BASE + 40)
+#define __NR_rename                       (__NR_SYSCALL_BASE + 38)
+#define __NR_getcwd                       (__NR_SYSCALL_BASE + 183)
+#define __NR_access                       (__NR_SYSCALL_BASE + 33)
+#define __NR_symlink                      (__NR_SYSCALL_BASE + 83)
+#define __NR_fchdir                       (__NR_SYSCALL_BASE + 133)
+#define __NR_truncate                     (__NR_SYSCALL_BASE + 92)
+#define __NR_pause                        (__NR_SYSCALL_BASE + 29)
+#define __NR_gettimeofday                 (__NR_SYSCALL_BASE + 78)
+#define __NR_settimeofday                 (__NR_SYSCALL_BASE + 79)
+#define __NR_times                        (__NR_SYSCALL_BASE + 43)
+#define __NR_nanosleep                    (__NR_SYSCALL_BASE + 162)
+#define __NR_getitimer                    (__NR_SYSCALL_BASE + 105)
+#define __NR_setitimer                    (__NR_SYSCALL_BASE + 104)
+#define __NR_sigaction                    (__NR_SYSCALL_BASE + 67)
+#define __NR_sigprocmask                  (__NR_SYSCALL_BASE + 126)
+#define __NR_sigsuspend                   (__NR_SYSCALL_BASE + 72)
+#define __NR_rt_sigaction                 (__NR_SYSCALL_BASE + 174)
+#define __NR_rt_sigprocmask               (__NR_SYSCALL_BASE + 175)
+#define __NR_rt_sigtimedwait              (__NR_SYSCALL_BASE + 177)
+#define __NR_sigpending                   (__NR_SYSCALL_BASE + 73)
+#define __NR_sched_setscheduler           (__NR_SYSCALL_BASE + 156)
+#define __NR_sched_getscheduler           (__NR_SYSCALL_BASE + 157)
+#define __NR_sched_yield                  (__NR_SYSCALL_BASE + 158)
+#define __NR_sched_setparam               (__NR_SYSCALL_BASE + 154)
+#define __NR_sched_getparam               (__NR_SYSCALL_BASE + 155)
+#define __NR_sched_get_priority_max       (__NR_SYSCALL_BASE + 159)
+#define __NR_sched_get_priority_min       (__NR_SYSCALL_BASE + 160)
+#define __NR_sched_rr_get_interval        (__NR_SYSCALL_BASE + 161)
+#define __NR_uname                        (__NR_SYSCALL_BASE + 122)
+#define __NR_wait4                        (__NR_SYSCALL_BASE + 114)
+#define __NR_umask                        (__NR_SYSCALL_BASE + 60)
+#define __NR_reboot                       (__NR_SYSCALL_BASE + 88)
+#define __NR_syslog                       (__NR_SYSCALL_BASE + 103)
+#define __NR_init_module                  (__NR_SYSCALL_BASE + 128)
+#define __NR_delete_module                (__NR_SYSCALL_BASE + 129)
+#define __NR_syslog                       (__NR_SYSCALL_BASE + 103)
+#define __NR_sysinfo                      (__NR_SYSCALL_BASE + 116)
+#define __NR_futex                        (__NR_SYSCALL_BASE + 240)
+#define __NR_poll                         (__NR_SYSCALL_BASE + 168)
+
+#ifdef __arm__
+#define __NR_exit_group                   (__NR_SYSCALL_BASE + 248)
+#define __NR_waitid                       (__NR_SYSCALL_BASE + 280)
+#define __NR_vfork                        (__NR_SYSCALL_BASE + 190)
+#define __NR_openat                       (__NR_SYSCALL_BASE + 322)
+#define __NR_madvise                      (__NR_SYSCALL_BASE + 220)
+#define __NR_mincore                      (__NR_SYSCALL_BASE + 219)
+#define __NR_pipe2                        (__NR_SYSCALL_BASE + 359)
+#define __NR_getdents64                   (__NR_SYSCALL_BASE + 217)
+#define __NR_fstatfs64                    (__NR_SYSCALL_BASE + 267)
+#define __NR_fstatat64                    (__NR_SYSCALL_BASE + 327)
+#define __NR_mkdirat                      (__NR_SYSCALL_BASE + 323)
+#define __NR_fchownat                     (__NR_SYSCALL_BASE + 325)
+#define __NR_fchmodat                     (__NR_SYSCALL_BASE + 333)
+#define __NR_renameat                     (__NR_SYSCALL_BASE + 329)
+#define __NR_unlinkat                     (__NR_SYSCALL_BASE + 328)
+#define __NR_statfs64                     (__NR_SYSCALL_BASE + 266)
+#define __NR_clock_gettime                (__NR_SYSCALL_BASE + 263)
+#define __NR_clock_settime                (__NR_SYSCALL_BASE + 262)
+#define __NR_clock_getres                 (__NR_SYSCALL_BASE + 264)
+#define __NR_clock_nanosleep              (__NR_SYSCALL_BASE + 265)
+#define __NR_timer_create                 (__NR_SYSCALL_BASE + 257)
+#define __NR_timer_settime                (__NR_SYSCALL_BASE + 258)
+#define __NR_timer_gettime                (__NR_SYSCALL_BASE + 259)
+#define __NR_timer_getoverrun             (__NR_SYSCALL_BASE + 260)
+#define __NR_timer_delete                 (__NR_SYSCALL_BASE + 261)
+#define __NR_utimes                       (__NR_SYSCALL_BASE + 269)
+#define __NR_socket                       (__NR_SYSCALL_BASE + 281)
+#define __NR_socketpair                   (__NR_SYSCALL_BASE + 288)
+#define __NR_bind                         (__NR_SYSCALL_BASE + 282)
+#define __NR_connect                      (__NR_SYSCALL_BASE + 283)
+#define __NR_listen                       (__NR_SYSCALL_BASE + 284)
+#define __NR_accept                       (__NR_SYSCALL_BASE + 285)
+#define __NR_getsockname                  (__NR_SYSCALL_BASE + 286)
+#define __NR_getpeername                  (__NR_SYSCALL_BASE + 287)
+#define __NR_sendto                       (__NR_SYSCALL_BASE + 290)
+#define __NR_recvfrom                     (__NR_SYSCALL_BASE + 292)
+#define __NR_shutdown                     (__NR_SYSCALL_BASE + 293)
+#define __NR_setsockopt                   (__NR_SYSCALL_BASE + 294)
+#define __NR_getsockopt                   (__NR_SYSCALL_BASE + 295)
+#define __NR_sendmsg                      (__NR_SYSCALL_BASE + 296)
+#define __NR_recvmsg                      (__NR_SYSCALL_BASE + 297)
+#define __NR_ioprio_set                   (__NR_SYSCALL_BASE + 314)
+#define __NR_ioprio_get                   (__NR_SYSCALL_BASE + 315)
+#define __NR_epoll_create                 (__NR_SYSCALL_BASE + 250)
+#define __NR_epoll_ctl                    (__NR_SYSCALL_BASE + 251)
+#define __NR_epoll_wait                   (__NR_SYSCALL_BASE + 252)
+#define __NR_inotify_init                 (__NR_SYSCALL_BASE + 316)
+#define __NR_inotify_add_watch            (__NR_SYSCALL_BASE + 317)
+#define __NR_inotify_rm_watch             (__NR_SYSCALL_BASE + 318)
+#define __NR_eventfd2                     (__NR_SYSCALL_BASE + 356)
+#define __NR_ARM_set_tls                  (__NR_SYSCALL_BASE + 983045)
+#define __NR_ARM_cacheflush               (__NR_SYSCALL_BASE + 983042)
+#endif
+
+#ifdef __i386__
+#define __NR_exit_group                   (__NR_SYSCALL_BASE + 252)
+#define __NR_waitpid                      (__NR_SYSCALL_BASE + 7)
+#define __NR_waitid                       (__NR_SYSCALL_BASE + 284)
+#define __NR_kill                         (__NR_SYSCALL_BASE + 37)
+#define __NR_tkill                        (__NR_SYSCALL_BASE + 238)
+#define __NR_set_thread_area              (__NR_SYSCALL_BASE + 243)
+#define __NR_openat                       (__NR_SYSCALL_BASE + 295)
+#define __NR_madvise                      (__NR_SYSCALL_BASE + 219)
+#define __NR_mincore                      (__NR_SYSCALL_BASE + 218)
+#define __NR_pipe2                        (__NR_SYSCALL_BASE + 331)
+#define __NR_getdents64                   (__NR_SYSCALL_BASE + 220)
+#define __NR_fstatfs64                    (__NR_SYSCALL_BASE + 269)
+#define __NR_fstatat64                    (__NR_SYSCALL_BASE + 300)
+#define __NR_mkdirat                      (__NR_SYSCALL_BASE + 296)
+#define __NR_fchownat                     (__NR_SYSCALL_BASE + 298)
+#define __NR_fchmodat                     (__NR_SYSCALL_BASE + 306)
+#define __NR_renameat                     (__NR_SYSCALL_BASE + 302)
+#define __NR_unlinkat                     (__NR_SYSCALL_BASE + 301)
+#define __NR_statfs64                     (__NR_SYSCALL_BASE + 268)
+#define __NR_clock_gettime                (__NR_SYSCALL_BASE + 265)
+#define __NR_clock_settime                (__NR_SYSCALL_BASE + 264)
+#define __NR_clock_getres                 (__NR_SYSCALL_BASE + 266)
+#define __NR_clock_nanosleep              (__NR_SYSCALL_BASE + 267)
+#define __NR_timer_create                 (__NR_SYSCALL_BASE + 259)
+#define __NR_timer_settime                (__NR_SYSCALL_BASE + 260)
+#define __NR_timer_gettime                (__NR_SYSCALL_BASE + 261)
+#define __NR_timer_getoverrun             (__NR_SYSCALL_BASE + 262)
+#define __NR_timer_delete                 (__NR_SYSCALL_BASE + 263)
+#define __NR_utimes                       (__NR_SYSCALL_BASE + 271)
+#define __NR_socketcall                   (__NR_SYSCALL_BASE + 102)
+#define __NR_ioprio_set                   (__NR_SYSCALL_BASE + 289)
+#define __NR_ioprio_get                   (__NR_SYSCALL_BASE + 290)
+#define __NR_epoll_create                 (__NR_SYSCALL_BASE + 254)
+#define __NR_epoll_ctl                    (__NR_SYSCALL_BASE + 255)
+#define __NR_epoll_wait                   (__NR_SYSCALL_BASE + 256)
+#define __NR_inotify_init                 (__NR_SYSCALL_BASE + 291)
+#define __NR_inotify_add_watch            (__NR_SYSCALL_BASE + 292)
+#define __NR_inotify_rm_watch             (__NR_SYSCALL_BASE + 293)
+#define __NR_eventfd2                     (__NR_SYSCALL_BASE + 328)
+#endif
+
+#if defined(__SH3__) || defined(__SH4__) 
+#define __NR_exit_group                   (__NR_SYSCALL_BASE + 252)
+#define __NR_waitpid                      (__NR_SYSCALL_BASE + 7)
+#define __NR_waitid                       (__NR_SYSCALL_BASE + 284)
+#define __NR_kill                         (__NR_SYSCALL_BASE + 37)
+#define __NR_tkill                        (__NR_SYSCALL_BASE + 238)
+#define __NR_set_thread_area              (__NR_SYSCALL_BASE + 243)
+#define __NR_vfork                        (__NR_SYSCALL_BASE + 190)
+#define __NR_openat                       (__NR_SYSCALL_BASE + 295)
+#define __NR_madvise                      (__NR_SYSCALL_BASE + 219)
+#define __NR_mincore                      (__NR_SYSCALL_BASE + 218)
+#define __NR_pipe2                        (__NR_SYSCALL_BASE + 331)
+#define __NR_getdents64                   (__NR_SYSCALL_BASE + 220)
+#define __NR_fstatfs64                    (__NR_SYSCALL_BASE + 269)
+#define __NR_fstatat64                    (__NR_SYSCALL_BASE + 300)
+#define __NR_mkdirat                      (__NR_SYSCALL_BASE + 296)
+#define __NR_fchownat                     (__NR_SYSCALL_BASE + 298)
+#define __NR_fchmodat                     (__NR_SYSCALL_BASE + 306)
+#define __NR_renameat                     (__NR_SYSCALL_BASE + 302)
+#define __NR_unlinkat                     (__NR_SYSCALL_BASE + 301)
+#define __NR_statfs64                     (__NR_SYSCALL_BASE + 268)
+#define __NR_clock_gettime                (__NR_SYSCALL_BASE + 265)
+#define __NR_clock_settime                (__NR_SYSCALL_BASE + 264)
+#define __NR_clock_getres                 (__NR_SYSCALL_BASE + 266)
+#define __NR_clock_nanosleep              (__NR_SYSCALL_BASE + 267)
+#define __NR_timer_create                 (__NR_SYSCALL_BASE + 259)
+#define __NR_timer_settime                (__NR_SYSCALL_BASE + 260)
+#define __NR_timer_gettime                (__NR_SYSCALL_BASE + 261)
+#define __NR_timer_getoverrun             (__NR_SYSCALL_BASE + 262)
+#define __NR_timer_delete                 (__NR_SYSCALL_BASE + 263)
+#define __NR_utimes                       (__NR_SYSCALL_BASE + 271)
+#define __NR_socketcall                   (__NR_SYSCALL_BASE + 102)
+#define __NR_socketcall                   (__NR_SYSCALL_BASE + 102)
+#define __NR_socketcall                   (__NR_SYSCALL_BASE + 102)
+#define __NR_socketcall                   (__NR_SYSCALL_BASE + 102)
+#define __NR_socketcall                   (__NR_SYSCALL_BASE + 102)
+#define __NR_socketcall                   (__NR_SYSCALL_BASE + 102)
+#define __NR_socketcall                   (__NR_SYSCALL_BASE + 102)
+#define __NR_socketcall                   (__NR_SYSCALL_BASE + 102)
+#define __NR_socketcall                   (__NR_SYSCALL_BASE + 102)
+#define __NR_socketcall                   (__NR_SYSCALL_BASE + 102)
+#define __NR_socketcall                   (__NR_SYSCALL_BASE + 102)
+#define __NR_socketcall                   (__NR_SYSCALL_BASE + 102)
+#define __NR_socketcall                   (__NR_SYSCALL_BASE + 102)
+#define __NR_socketcall                   (__NR_SYSCALL_BASE + 102)
+#define __NR_socketcall                   (__NR_SYSCALL_BASE + 102)
+#define __NR___socketcall                 (__NR_SYSCALL_BASE + 102)
+#define __NR_ioprio_set                   (__NR_SYSCALL_BASE + 288)
+#define __NR_ioprio_get                   (__NR_SYSCALL_BASE + 289)
+#define __NR_epoll_create                 (__NR_SYSCALL_BASE + 254)
+#define __NR_epoll_ctl                    (__NR_SYSCALL_BASE + 255)
+#define __NR_epoll_wait                   (__NR_SYSCALL_BASE + 256)
+#define __NR_inotify_init                 (__NR_SYSCALL_BASE + 290)
+#define __NR_inotify_add_watch            (__NR_SYSCALL_BASE + 291)
+#define __NR_inotify_rm_watch             (__NR_SYSCALL_BASE + 292)
+#define __NR_eventfd2                     (__NR_SYSCALL_BASE + 328)
+#endif
+
+#endif
+
+#endif /* _BIONIC_LINUX_SYSCALLS_H_ */
diff --git a/ndk/platforms/android-9/include/sys/linux-unistd.h b/ndk/platforms/android-9/include/sys/linux-unistd.h
new file mode 100644
index 0000000..23853da
--- /dev/null
+++ b/ndk/platforms/android-9/include/sys/linux-unistd.h
@@ -0,0 +1,212 @@
+/* auto-generated by gensyscalls.py, do not touch */
+#ifndef _BIONIC_LINUX_UNISTD_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void             _exit (int);
+void             _exit_thread (int);
+pid_t            __fork (void);
+pid_t            _waitpid (pid_t, int*, int, struct rusage*);
+int              __waitid (int, pid_t, struct siginfo_t*, int,void*);
+pid_t            __sys_clone (int, void*, int*, void*, int*);
+int              execve (const char*, char* const*, char* const*);
+int              __setuid (uid_t);
+uid_t            getuid (void);
+gid_t            getgid (void);
+uid_t            geteuid (void);
+gid_t            getegid (void);
+uid_t            getresuid (void);
+gid_t            getresgid (void);
+pid_t            gettid (void);
+int              getgroups (int, gid_t *);
+pid_t            getpgid (pid_t);
+pid_t            getppid (void);
+pid_t            setsid (void);
+int              setgid (gid_t);
+int              seteuid (uid_t);
+int              __setreuid (uid_t, uid_t);
+int              __setresuid (uid_t, uid_t, uid_t);
+int              setresgid (gid_t, gid_t, gid_t);
+void*            __brk (void*);
+int              kill (pid_t, int);
+int              tkill (pid_t tid, int sig);
+int              __ptrace (int request, int pid, void* addr, void* data);
+int              __set_thread_area (void*  user_desc);
+int              __getpriority (int, int);
+int              setpriority (int, int, int);
+int              setrlimit (int resource, const struct rlimit *rlp);
+int              getrlimit (int resource, struct rlimit *rlp);
+int              getrusage (int who, struct rusage*  r_usage);
+int              setgroups (int, const gid_t *);
+pid_t            getpgrp (void);
+int              setpgid (pid_t, pid_t);
+pid_t            vfork (void);
+int              setregid (gid_t, gid_t);
+int              chroot (const char *);
+int              prctl (int option, unsigned int arg2, unsigned int arg3, unsigned int arg4, unsigned int arg5);
+int              capget (cap_user_header_t header, cap_user_data_t data);
+int              capset (cap_user_header_t header, const cap_user_data_t data);
+int              sigaltstack (const stack_t*, stack_t*);
+int              acct (const char*  filepath);
+ssize_t          read (int, void*, size_t);
+ssize_t          write (int, const void*, size_t);
+ssize_t          __pread64 (int, void *, size_t, off_t, off_t);
+ssize_t          __pwrite64 (int, void *, size_t, off_t, off_t);
+int              __open (const char*, int, mode_t);
+int              __openat (int, const char*, int, mode_t);
+int              close (int);
+int              creat (const char*, mode_t);
+off_t            lseek (int, off_t, int);
+int              __llseek (int, unsigned long, unsigned long, loff_t*, int);
+pid_t            getpid (void);
+void *           mmap (void *, size_t, int, int, int, long);
+void *           __mmap2 (void*, size_t, int, int, int, long);
+int              munmap (void *, size_t);
+void *           mremap (void *, size_t, size_t, unsigned long);
+int              msync (const void *, size_t, int);
+int              mprotect (const void *, size_t, int);
+int              madvise (const void *, size_t, int);
+int              mlock (const void *addr, size_t len);
+int              munlock (const void *addr, size_t len);
+int              mincore (void*  start, size_t  length, unsigned char*  vec);
+int              __ioctl (int, int, void *);
+int              readv (int, const struct iovec *, int);
+int              writev (int, const struct iovec *, int);
+int              __fcntl (int, int, void*);
+int              flock (int, int);
+int              fchmod (int, mode_t);
+int              dup (int);
+int              pipe (int *);
+int              pipe2 (int *, int);
+int              dup2 (int, int);
+int              select (int, struct fd_set *, struct fd_set *, struct fd_set *, struct timeval *);
+int              ftruncate (int, off_t);
+int              getdents (unsigned int, struct dirent *, unsigned int);
+int              fsync (int);
+int              fdatasync (int);
+int              fchown (int, uid_t, gid_t);
+void             sync (void);
+int              __fcntl64 (int, int, void *);
+int              __fstatfs64 (int, size_t, struct statfs *);
+ssize_t          sendfile (int out_fd, int in_fd, off_t *offset, size_t count);
+int              fstatat (int dirfd, const char *path, struct stat *buf, int flags);
+int              mkdirat (int dirfd, const char *pathname, mode_t mode);
+int              fchownat (int dirfd, const char *path, uid_t owner, gid_t group, int flags);
+int              fchmodat (int dirfd, const char *path, mode_t mode, int flags);
+int              renameat (int olddirfd, const char *oldpath, int newdirfd, const char *newpath);
+int              link (const char*, const char*);
+int              unlink (const char*);
+int              unlinkat (int, const char *, int);
+int              chdir (const char*);
+int              mknod (const char*, mode_t, dev_t);
+int              chmod (const char*,mode_t);
+int              chown (const char *, uid_t, gid_t);
+int              lchown (const char*, uid_t, gid_t);
+int              mount (const char*, const char*, const char*, unsigned long, const void*);
+int              umount (const char*);
+int              umount2 (const char*, int);
+int              fstat (int, struct stat*);
+int              stat (const char *, struct stat *);
+int              lstat (const char *, struct stat *);
+int              mkdir (const char *, mode_t);
+int              readlink (const char *, char *, size_t);
+int              rmdir (const char *);
+int              rename (const char *, const char *);
+int              __getcwd (char * buf, size_t size);
+int              access (const char *, int);
+int              symlink (const char *, const char *);
+int              fchdir (int);
+int              truncate (const char*, off_t);
+int              __statfs64 (const char *, size_t, struct statfs *);
+int              pause (void);
+int              gettimeofday (struct timeval*, struct timezone*);
+int              settimeofday (const struct timeval*, const struct timezone*);
+clock_t          times (struct tms *);
+int              nanosleep (const struct timespec *, struct timespec *);
+int              clock_gettime (clockid_t clk_id, struct timespec *tp);
+int              clock_settime (clockid_t clk_id, const struct timespec *tp);
+int              clock_getres (clockid_t clk_id, struct timespec *res);
+int              clock_nanosleep (const struct timespec *req, struct timespec *rem);
+int              getitimer (int, const struct itimerval *);
+int              setitimer (int, const struct itimerval *, struct itimerval *);
+int              __timer_create (clockid_t clockid, struct sigevent *evp, timer_t *timerid);
+int              __timer_settime (timer_t, int, const struct itimerspec*, struct itimerspec*);
+int              __timer_gettime (timer_t, struct itimerspec*);
+int              __timer_getoverrun (timer_t);
+int              __timer_delete (timer_t);
+int              utimes (const char*, const struct timeval tvp[2]);
+int              sigaction (int, const struct sigaction *, struct sigaction *);
+int              sigprocmask (int, const sigset_t *, sigset_t *);
+int              __sigsuspend (int unused1, int unused2, unsigned mask);
+int              __rt_sigaction (int sig, const struct sigaction *act, struct sigaction *oact, size_t sigsetsize);
+int              __rt_sigprocmask (int  how, const sigset_t *set, sigset_t *oset, size_t sigsetsize);
+int              __rt_sigtimedwait (const sigset_t *set, struct siginfo_t  *info, struct timespec_t  *timeout, size_t  sigset_size);
+int              sigpending (sigset_t *);
+int              socket (int, int, int);
+int              socketpair (int, int, int, int*);
+int              bind (int, struct sockaddr *, int);
+int              connect (int, struct sockaddr *, socklen_t);
+int              listen (int, int);
+int              accept (int, struct sockaddr *, socklen_t *);
+int              getsockname (int, struct sockaddr *, socklen_t *);
+int              getpeername (int, struct sockaddr *, socklen_t *);
+int              sendto (int, const void *, size_t, int, const struct sockaddr *, socklen_t);
+int              recvfrom (int, void *, size_t, unsigned int, struct sockaddr *, socklen_t *);
+int              shutdown (int, int);
+int              setsockopt (int, int, int, const void *, socklen_t);
+int              getsockopt (int, int, int, void *, socklen_t *);
+int              sendmsg (int, const struct msghdr *, unsigned int);
+int              recvmsg (int, struct msghdr *, unsigned int);
+int              socket (int, int, int);
+int              bind (int, struct sockaddr *, int);
+int              connect (int, struct sockaddr *, socklen_t);
+int              listen (int, int);
+int              accept (int, struct sockaddr *, socklen_t *);
+int              getsockname (int, struct sockaddr *, socklen_t *);
+int              getpeername (int, struct sockaddr *, socklen_t *);
+int              socketpair (int, int, int, int*);
+int              sendto (int, const void *, size_t, int, const struct sockaddr *, socklen_t);
+int              recvfrom (int, void *, size_t, unsigned int, struct sockaddr *, socklen_t *);
+int              shutdown (int, int);
+int              setsockopt (int, int, int, const void *, socklen_t);
+int              getsockopt (int, int, int, void *, socklen_t *);
+int              sendmsg (int, const struct msghdr *, unsigned int);
+int              recvmsg (int, struct msghdr *, unsigned int);
+int              __socketcall (int, unsigned long*);
+int              sched_setscheduler (pid_t pid, int policy, const struct sched_param *param);
+int              sched_getscheduler (pid_t pid);
+int              sched_yield (void);
+int              sched_setparam (pid_t pid, const struct sched_param *param);
+int              sched_getparam (pid_t pid, struct sched_param *param);
+int              sched_get_priority_max (int policy);
+int              sched_get_priority_min (int policy);
+int              sched_rr_get_interval (pid_t pid, struct timespec *interval);
+int              ioprio_set (int which, int who, int ioprio);
+int              ioprio_get (int which, int who);
+int              uname (struct utsname *);
+pid_t            __wait4 (pid_t pid, int *status, int options, struct rusage *rusage);
+mode_t           umask (mode_t);
+int              __reboot (int, int, int, void *);
+int              __syslog (int, char *, int);
+int              init_module (void *, unsigned long, const char *);
+int              delete_module (const char*, unsigned int);
+int              klogctl (int, char *, int);
+int              sysinfo (struct sysinfo *);
+int              futex (void *, int, int, void *, void *, int);
+int              epoll_create (int size);
+int              epoll_ctl (int epfd, int op, int fd, struct epoll_event *event);
+int              epoll_wait (int epfd, struct epoll_event *events, int max, int timeout);
+int              inotify_init (void);
+int              inotify_add_watch (int, const char *, unsigned int);
+int              inotify_rm_watch (int, unsigned int);
+int              poll (struct pollfd *, unsigned int, long);
+int              eventfd (unsigned int, int);
+int              __set_tls (void*);
+int              cacheflush (long start, long end, long flags);
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _BIONIC_LINUX_UNISTD_H_ */
diff --git a/ndk/platforms/android-9/include/sys/sysinfo.h b/ndk/platforms/android-9/include/sys/sysinfo.h
new file mode 100644
index 0000000..c7e46e6
--- /dev/null
+++ b/ndk/platforms/android-9/include/sys/sysinfo.h
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _SYS_SYSINFO_H_
+#define _SYS_SYSINFO_H_
+
+#include <sys/cdefs.h>
+#include <linux/kernel.h>
+
+__BEGIN_DECLS
+
+extern int sysinfo (struct sysinfo *info);
+
+__END_DECLS
+
+#endif /* _SYS_SYSINFO_H_ */
diff --git a/ndk/platforms/android-9/include/sys/wait.h b/ndk/platforms/android-9/include/sys/wait.h
new file mode 100644
index 0000000..b30b7ec
--- /dev/null
+++ b/ndk/platforms/android-9/include/sys/wait.h
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _SYS_WAIT_H_
+#define _SYS_WAIT_H_
+
+#include <sys/cdefs.h>
+#include <sys/types.h>
+#include <sys/resource.h>
+#include <linux/wait.h>
+#include <signal.h>
+
+__BEGIN_DECLS
+
+#define WEXITSTATUS(s)  (((s) & 0xff00) >> 8)
+#define WCOREDUMP(s)    ((s) & 0x80)
+#define WTERMSIG(s)     ((s) & 0x7f)
+#define WSTOPSIG(s)     WEXITSTATUS(s)
+
+#define WIFEXITED(s)    (WTERMSIG(s) == 0)
+#define WIFSTOPPED(s)   (WTERMSIG(s) == 0x7f)
+#define WIFSIGNALED(s)  (WTERMSIG((s)+1) >= 2)
+
+extern pid_t  wait(int *);
+extern pid_t  waitpid(pid_t, int *, int);
+extern pid_t  wait3(int *, int, struct rusage *);
+extern pid_t  wait4(pid_t, int *, int, struct rusage *);
+
+/* Posix states that idtype_t should be an enumeration type, but
+ * the kernel headers define P_ALL, P_PID and P_PGID as constant macros
+ * instead.
+ */
+typedef int idtype_t;
+
+extern int  waitid(idtype_t which, id_t id, siginfo_t *info, int options);
+
+__END_DECLS
+
+#endif /* _SYS_WAIT_H_ */
diff --git a/ndk/platforms/android-9/include/thread_db.h b/ndk/platforms/android-9/include/thread_db.h
new file mode 100644
index 0000000..1b36cb2
--- /dev/null
+++ b/ndk/platforms/android-9/include/thread_db.h
@@ -0,0 +1,164 @@
+/*
+ * Copyright 2006 The Android Open Source Project
+ */
+
+#ifndef _LIBTHREAD_DB__THREAD_DB_H
+#define _LIBTHREAD_DB__THREAD_DB_H
+
+#include <pthread.h>
+#include <signal.h>
+#include <stdint.h>
+#include <sys/types.h>
+
+typedef void *psaddr_t;
+typedef pid_t lwpid_t;
+
+#define TD_THR_ANY_USER_FLAGS       0xffffffff
+#define TD_THR_LOWEST_PRIORITY      -20
+#define TD_SIGNO_MASK               NULL
+
+/* td_err_e values */
+enum {
+    TD_OK,
+    TD_ERR,
+    TD_NOTHR,
+    TD_NOSV,
+    TD_NOLWP,
+    TD_BADPH,
+    TD_BADTH,
+    TD_BADSH,
+    TD_BADTA,
+    TD_BADKEY,
+    TD_NOMSG,
+    TD_NOFPREGS,
+    TD_NOLIBTHREAD,
+    TD_NOEVENT,
+    TD_NOCAPAB,
+    TD_DBERR,
+    TD_NOAPLIC,
+    TD_NOTSD,
+    TD_MALLOC,
+    TD_PARTIALREG,
+    TD_NOXREGS,
+    TD_VERSION
+};
+
+/*
+ * td_event_e values 
+ * NOTE: There is a max of 32 events
+ */
+enum {
+    TD_CREATE,
+    TD_DEATH
+};
+
+/* td_thr_state_e values */
+enum {
+    TD_THR_ANY_STATE,
+    TD_THR_UNKNOWN,
+    TD_THR_SLEEP,
+    TD_THR_ZOMBIE
+};
+
+typedef int32_t td_err_e;
+typedef uint32_t td_event_e;
+typedef uint32_t td_notify_e;
+typedef uint32_t td_thr_state_e;
+typedef pthread_t thread_t;
+
+typedef struct
+{
+    pid_t pid;
+    struct ps_prochandle *ph;
+} td_thragent_t;
+
+typedef struct
+{
+    pid_t pid;
+    pid_t tid;
+} td_thrhandle_t;
+
+typedef struct
+{
+    td_event_e event;
+    td_thrhandle_t const * th_p;
+    union {
+        void * data;
+    } msg;
+} td_event_msg_t;
+
+typedef struct
+{
+    uint32_t events;
+} td_thr_events_t;
+
+typedef struct
+{
+    union {
+        void * bptaddr;
+    } u;
+} td_notify_t;
+
+typedef struct
+{
+    td_thr_state_e ti_state;
+    thread_t ti_tid; // pthread's id for the thread
+    int32_t ti_lid; // the kernel's id for the thread
+} td_thrinfo_t;
+
+
+#define td_event_emptyset(set) \
+    (set)->events = 0
+
+#define td_event_fillset(set) \
+    (set)->events = 0xffffffff
+
+#define td_event_addset(set, n) \
+    (set)->events |= (1 << n)
+
+
+typedef int td_thr_iter_f(td_thrhandle_t const *, void *);
+
+
+struct ps_prochandle;
+
+#ifdef __cplusplus
+extern "C"{
+#endif
+
+extern td_err_e td_ta_new(struct ps_prochandle * proc_handle, td_thragent_t ** thread_agent);
+
+extern td_err_e td_ta_delete(td_thragent_t * ta);
+
+extern td_err_e td_ta_set_event(td_thragent_t const * agent, td_thr_events_t * event);
+
+extern td_err_e td_ta_event_addr(td_thragent_t const * agent, td_event_e event, td_notify_t * notify);
+
+extern td_err_e td_ta_clear_event(const td_thragent_t * ta_arg,
+				  td_thr_events_t * event);
+
+extern td_err_e td_ta_event_getmsg(td_thragent_t const * agent, td_event_msg_t * event);
+
+extern td_err_e td_ta_map_lwp2thr(td_thragent_t const * agent, lwpid_t lwpid,
+				  td_thrhandle_t *th);
+
+extern td_err_e td_thr_get_info(td_thrhandle_t const * handle,
+				td_thrinfo_t * info);
+
+extern td_err_e td_thr_event_enable(td_thrhandle_t const * handle,
+				    td_event_e event);
+
+extern td_err_e td_ta_thr_iter(td_thragent_t const * agent, td_thr_iter_f * func, void * cookie,
+                               td_thr_state_e state, int32_t prio, sigset_t * sigmask, uint32_t user_flags);
+
+extern char const ** td_symbol_list(void);
+
+extern td_err_e td_thr_tls_get_addr(const td_thrhandle_t * th,
+				    psaddr_t map_address, size_t offset,
+				    psaddr_t * address);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/ndk/platforms/android-9/include/unistd.h b/ndk/platforms/android-9/include/unistd.h
new file mode 100644
index 0000000..29154a2
--- /dev/null
+++ b/ndk/platforms/android-9/include/unistd.h
@@ -0,0 +1,211 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _UNISTD_H_
+#define _UNISTD_H_
+
+#include <stddef.h>
+#include <sys/cdefs.h>
+#include <sys/types.h>
+#include <sys/select.h>
+#include <sys/sysconf.h>
+#include <linux/capability.h>
+#include <pathconf.h>
+
+__BEGIN_DECLS
+
+/* Standard file descriptor numbers. */
+#define STDIN_FILENO	0
+#define STDOUT_FILENO	1
+#define STDERR_FILENO	2
+
+/* Values for whence in fseek and lseek */
+#define SEEK_SET 0
+#define SEEK_CUR 1
+#define SEEK_END 2
+
+extern char **environ;
+extern __noreturn void _exit(int);
+
+extern pid_t  fork(void);
+extern pid_t  vfork(void);
+extern pid_t  getpid(void);
+extern pid_t  gettid(void);
+extern pid_t  getpgid(pid_t);
+extern int    setpgid(pid_t, pid_t);
+extern pid_t  getppid(void);
+extern pid_t  getpgrp(void);
+extern int    setpgrp(void);
+extern pid_t  setsid(void);
+
+extern int execv(const char *, char * const *);
+extern int execvp(const char *, char * const *);
+extern int execve(const char *, char * const *, char * const *);
+extern int execl(const char *, const char *, ...);
+extern int execlp(const char *, const char *, ...);
+extern int execle(const char *, const char *, ...);
+extern int capget(cap_user_header_t hdrp, cap_user_data_t datap);
+extern int capset(cap_user_header_t hdrp, const cap_user_data_t datap);
+extern int prctl(int  option,  unsigned long arg2, unsigned long arg3,
+                 unsigned long arg4, unsigned long arg5);
+
+extern int nice(int);
+
+extern int setuid(uid_t);
+extern uid_t getuid(void);
+extern int seteuid(uid_t);
+extern uid_t geteuid(void);
+extern int setgid(gid_t);
+extern gid_t getgid(void);
+extern int setegid(gid_t);
+extern gid_t getegid(void);
+extern int getgroups(int, gid_t *);
+extern int setgroups(size_t, const gid_t *);
+extern int setreuid(uid_t, uid_t);
+extern int setregid(gid_t, gid_t);
+extern int setresuid(uid_t, uid_t, uid_t);
+extern int setresgid(gid_t, gid_t, gid_t);
+extern int getresuid(uid_t *ruid, uid_t *euid, uid_t *suid);
+extern int getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid);
+extern int issetugid(void);
+extern char* getlogin(void);
+extern char* getusershell(void);
+extern void setusershell(void);
+extern void endusershell(void);
+
+
+
+/* Macros for access() */
+#define R_OK  4  /* Read */
+#define W_OK  2  /* Write */
+#define X_OK  1  /* Execute */
+#define F_OK  0  /* Existence */
+
+extern int access(const char *, int);
+extern int link(const char *, const char *);
+extern int unlink(const char *);
+extern int chdir(const char *);
+extern int fchdir(int);
+extern int rmdir(const char *);
+extern int pipe(int *);
+#ifdef _GNU_SOURCE  /* GLibc compatibility */
+extern int pipe2(int *, int);
+#endif
+extern int chroot(const char *);
+extern int symlink(const char *, const char *);
+extern int readlink(const char *, char *, size_t);
+extern int chown(const char *, uid_t, gid_t);
+extern int fchown(int, uid_t, gid_t);
+extern int lchown(const char *, uid_t, gid_t);
+extern int truncate(const char *, off_t);
+extern char *getcwd(char *, size_t);
+
+extern int sync(void);
+
+extern int close(int);
+extern off_t lseek(int, off_t, int);
+extern loff_t lseek64(int, loff_t, int);
+
+extern ssize_t read(int, void *, size_t);
+extern ssize_t write(int, const void *, size_t);
+extern ssize_t pread(int, void *, size_t, off_t);
+extern ssize_t pwrite(int, void *, size_t, off_t);
+
+extern int dup(int);
+extern int dup2(int, int);
+extern int fcntl(int, int, ...);
+extern int ioctl(int, int, ...);
+extern int flock(int, int);
+extern int fsync(int);
+extern int fdatasync(int);
+extern int ftruncate(int, off_t);
+
+extern int pause(void);
+extern unsigned int alarm(unsigned int);
+extern unsigned int sleep(unsigned int);
+extern int usleep(unsigned long);
+
+extern int gethostname(char *, size_t);
+
+extern int getdtablesize(void);
+
+extern void *__brk(void *);
+extern int brk(void *);
+extern void *sbrk(ptrdiff_t);
+
+extern int getopt(int, char * const *, const char *);
+extern char *optarg;
+extern int optind, opterr, optopt;
+
+extern int isatty(int);
+extern char* ttyname(int);
+extern int ttyname_r(int, char*, size_t);
+
+extern int  acct(const char*  filepath);
+
+static __inline__ int getpagesize(void) {
+  extern unsigned int __page_size;
+  return __page_size;
+}
+static __inline__ int __getpageshift(void) {
+  extern unsigned int __page_shift;
+  return __page_shift;
+}
+
+extern int sysconf(int  name);
+
+extern int daemon(int, int);
+
+/* A special syscall that is only available on the ARM, not x86 function. */
+extern int cacheflush(long start, long end, long flags);
+
+extern pid_t tcgetpgrp(int fd);
+extern int   tcsetpgrp(int fd, pid_t _pid);
+
+#if 0 /* MISSING FROM BIONIC */
+extern pid_t  getsid(pid_t);
+extern int execvpe(const char *, char * const *, char * const *);
+extern int execlpe(const char *, const char *, ...);
+extern int getfsuid(uid_t);
+extern int setfsuid(uid_t);
+extern int getlogin_r(char* name, size_t namesize);
+extern int sethostname(const char *, size_t);
+extern int getdomainname(char *, size_t);
+extern int setdomainname(const char *, size_t);
+#endif /* MISSING */
+
+/* Used to retry syscalls that can return EINTR. */
+#define TEMP_FAILURE_RETRY(exp) ({         \
+    typeof (exp) _rc;                      \
+    do {                                   \
+        _rc = (exp);                       \
+    } while (_rc == -1 && errno == EINTR); \
+    _rc; })
+
+__END_DECLS
+
+#endif /* _UNISTD_H_ */
diff --git a/ndk/platforms/android-9/include/wchar.h b/ndk/platforms/android-9/include/wchar.h
new file mode 100644
index 0000000..9b744a5
--- /dev/null
+++ b/ndk/platforms/android-9/include/wchar.h
@@ -0,0 +1,157 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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
+ * COPYRIGHT OWNER OR CONTRIBUTORS 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 _WCHAR_H_
+#define _WCHAR_H_
+
+#include <sys/cdefs.h>
+#include <stdio.h>
+
+/* wchar_t is required in stdlib.h according to POSIX */
+#define __need___wchar_t
+#include <stddef.h>
+
+#include <stdarg.h>
+#include <time.h>
+#include <malloc.h>
+
+#include <stddef.h>
+
+/* IMPORTANT: Any code that relies on wide character support is essentially
+ *            non-portable and/or broken. the only reason this header exist
+ *            is because I'm really a nice guy. However, I'm not nice enough
+ *            to provide you with a real implementation. instead wchar_t == char
+ *            and all wc functions are stubs to their "normal" equivalent...
+ */
+
+__BEGIN_DECLS
+
+typedef int                     wint_t;
+typedef struct { int  dummy; }  mbstate_t;
+
+typedef enum {
+    WC_TYPE_INVALID = 0,
+    WC_TYPE_ALNUM,
+    WC_TYPE_ALPHA,
+    WC_TYPE_BLANK,
+    WC_TYPE_CNTRL,
+    WC_TYPE_DIGIT,
+    WC_TYPE_GRAPH,
+    WC_TYPE_LOWER,
+    WC_TYPE_PRINT,
+    WC_TYPE_PUNCT,
+    WC_TYPE_SPACE,
+    WC_TYPE_UPPER,
+    WC_TYPE_XDIGIT,
+    WC_TYPE_MAX
+} wctype_t;
+
+#define  WCHAR_MAX   INT_MAX
+#define  WCHAR_MIN   INT_MIN
+#define  WEOF        ((wint_t)(-1))
+
+extern wint_t            btowc(int);
+extern int               fwprintf(FILE *, const wchar_t *, ...);
+extern int               fwscanf(FILE *, const wchar_t *, ...);
+extern int               iswalnum(wint_t);
+extern int               iswalpha(wint_t);
+extern int               iswcntrl(wint_t);
+extern int               iswdigit(wint_t);
+extern int               iswgraph(wint_t);
+extern int               iswlower(wint_t);
+extern int               iswprint(wint_t);
+extern int               iswpunct(wint_t);
+extern int               iswspace(wint_t);
+extern int               iswupper(wint_t);
+extern int               iswxdigit(wint_t);
+extern int               iswctype(wint_t, wctype_t);
+extern wint_t            fgetwc(FILE *);
+extern wchar_t          *fgetws(wchar_t *, int, FILE *);
+extern wint_t            fputwc(wchar_t, FILE *);
+extern int               fputws(const wchar_t *, FILE *);
+extern int               fwide(FILE *, int);
+extern wint_t            getwc(FILE *);
+extern wint_t            getwchar(void);
+extern int               mbsinit(const mbstate_t *);
+extern size_t            mbrlen(const char *, size_t, mbstate_t *);
+extern size_t            mbrtowc(wchar_t *, const char *, size_t, mbstate_t *);
+extern size_t            mbsrtowcs(wchar_t *, const char **, size_t, mbstate_t *);
+extern size_t            mbstowcs(wchar_t *, const char *, size_t);
+extern wint_t            putwc(wchar_t, FILE *);
+extern wint_t            putwchar(wchar_t);
+extern int               swprintf(wchar_t *, size_t, const wchar_t *, ...);
+extern int               swscanf(const wchar_t *, const wchar_t *, ...);
+extern wint_t            towlower(wint_t);
+extern wint_t            towupper(wint_t);
+extern wint_t            ungetwc(wint_t, FILE *);
+extern int               vfwprintf(FILE *, const wchar_t *, va_list);
+extern int               vwprintf(const wchar_t *, va_list);
+extern int               vswprintf(wchar_t *, size_t, const wchar_t *, va_list);
+extern size_t            wcrtomb(char *, wchar_t, mbstate_t *);
+extern wchar_t          *wcscat(wchar_t *, const wchar_t *);
+extern wchar_t          *wcschr(const wchar_t *, wchar_t);
+extern int               wcscmp(const wchar_t *, const wchar_t *);
+extern int               wcscoll(const wchar_t *, const wchar_t *);
+extern wchar_t          *wcscpy(wchar_t *, const wchar_t *);
+extern size_t            wcscspn(const wchar_t *, const wchar_t *);
+extern size_t            wcsftime(wchar_t *, size_t, const wchar_t *, const struct tm *);
+extern size_t            wcslen(const wchar_t *);
+extern wchar_t          *wcsncat(wchar_t *, const wchar_t *, size_t);
+extern int               wcsncmp(const wchar_t *, const wchar_t *, size_t);
+extern wchar_t          *wcsncpy(wchar_t *, const wchar_t *, size_t);
+extern wchar_t          *wcspbrk(const wchar_t *, const wchar_t *);
+extern wchar_t          *wcsrchr(const wchar_t *, wchar_t);
+extern size_t            wcsrtombs(char *, const wchar_t **, size_t, mbstate_t *);
+extern size_t            wcsspn(const wchar_t *, const wchar_t *);
+extern wchar_t          *wcsstr(const wchar_t *, const wchar_t *);
+extern double            wcstod(const wchar_t *, wchar_t **);
+extern wchar_t          *wcstok(wchar_t *, const wchar_t *, wchar_t **);
+extern long int          wcstol(const wchar_t *, wchar_t **, int);
+extern size_t            wcstombs(char *, const wchar_t *, size_t);
+extern unsigned long int wcstoul(const wchar_t *, wchar_t **, int);
+extern wchar_t          *wcswcs(const wchar_t *, const wchar_t *);
+extern int               wcswidth(const wchar_t *, size_t);
+extern size_t            wcsxfrm(wchar_t *, const wchar_t *, size_t);
+extern int               wctob(wint_t);
+extern wctype_t          wctype(const char *);
+extern int               wcwidth(wchar_t);
+extern wchar_t          *wmemchr(const wchar_t *, wchar_t, size_t);
+extern int               wmemcmp(const wchar_t *, const wchar_t *, size_t);
+extern wchar_t          *wmemcpy(wchar_t *, const wchar_t *, size_t);
+extern wchar_t          *wmemmove(wchar_t *, const wchar_t *, size_t);
+extern wchar_t          *wmemset(wchar_t *, wchar_t, size_t);
+extern int               wprintf(const wchar_t *, ...);
+extern int               wscanf(const wchar_t *, ...);
+
+/* No really supported.  These are just for making libstdc++-v3 happy.  */
+typedef void *wctrans_t;
+extern wint_t		 towctrans(wint_t, wctrans_t);
+extern wctrans_t	 wctrans (const char *);
+
+__END_DECLS
+
+#endif /* _WCHAR_H_ */
diff --git a/ndk/platforms/android-9/samples/native-activity/Android.mk b/ndk/platforms/android-9/samples/native-activity/Android.mk
new file mode 100644
index 0000000..ea961ca
--- /dev/null
+++ b/ndk/platforms/android-9/samples/native-activity/Android.mk
@@ -0,0 +1,70 @@
+# Copyright (C) 2010 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+LOCAL_PATH:= $(call my-dir)
+
+##################################################################
+#
+# NOTE: This is a helper to build this sample code using the
+# Android platform build system, inside of its source tree.  This
+# is NOT part of the NDK and is not for use with the NDK build
+# system.
+#
+##################################################################
+
+# ----------------------------------------------------------------
+# Native code.
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_TAGS := samples
+
+LOCAL_C_INCLUDES += \
+		$(TOPDIR)frameworks/base/native/include \
+		$(TOPDIR)frameworks/base/opengl/include \
+		$(TOPDIR)development/ndk/sources/android/native_app_glue
+
+LOCAL_SRC_FILES := \
+	jni/main.c \
+	../../../../sources/android/native_app_glue/android_native_app_glue.c
+
+LOCAL_NDK_VERSION := 4
+LOCAL_SDK_VERSION := 8
+
+LOCAL_SHARED_LIBRARIES := liblog libandroid libEGL libGLESv1_CM
+
+LOCAL_PRELINK_MODULE := false
+
+LOCAL_MODULE := libnative-activity
+
+include $(BUILD_SHARED_LIBRARY)
+
+# ----------------------------------------------------------------
+# Packaging .ap (and Java code if there was some)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_TAGS := samples
+
+LOCAL_SRC_FILES := $(call all-java-files-under, src)
+
+LOCAL_PACKAGE_NAME := NativeActivity
+
+LOCAL_CERTIFICATE := shared
+
+LOCAL_JNI_SHARED_LIBRARIES := libnative-activity
+
+LOCAL_SDK_VERSION := current
+
+include $(BUILD_PACKAGE)
diff --git a/ndk/platforms/android-9/samples/native-activity/AndroidManifest.xml b/ndk/platforms/android-9/samples/native-activity/AndroidManifest.xml
new file mode 100644
index 0000000..1fd3620
--- /dev/null
+++ b/ndk/platforms/android-9/samples/native-activity/AndroidManifest.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- BEGIN_INCLUDE(manifest) -->
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+        package="com.example.native_activity"
+        android:versionCode="1"
+        android:versionName="1.0">
+
+    <!-- This is the platform API where NativeActivity was introduced. -->
+    <uses-sdk android:minSdkVersion="8" />
+
+    <!-- This .apk has no Java code itself, so set hasCode to false. -->
+    <application android:label="@string/app_name" android:hasCode="false">
+
+        <!-- Our activity is the built-in NativeActivity framework class.
+             This will take care of integrating with our NDK code. -->
+        <activity android:name="android.app.NativeActivity"
+                android:label="@string/app_name"
+                android:configChanges="orientation|keyboardHidden">
+            <!-- Tell NativeActivity the name of or .so -->
+            <meta-data android:name="android.app.lib_name"
+                    android:value="native-activity" />
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.LAUNCHER" />
+            </intent-filter>
+        </activity>
+    </application>
+
+</manifest> 
+<!-- END_INCLUDE(manifest) -->
diff --git a/ndk/platforms/android-9/samples/native-activity/default.properties b/ndk/platforms/android-9/samples/native-activity/default.properties
new file mode 100644
index 0000000..9d135cb
--- /dev/null
+++ b/ndk/platforms/android-9/samples/native-activity/default.properties
@@ -0,0 +1,11 @@
+# This file is automatically generated by Android Tools.
+# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
+# 
+# This file must be checked in Version Control Systems.
+# 
+# To customize properties used by the Ant build system use,
+# "build.properties", and override values to adapt the script to your
+# project structure.
+
+# Project target.
+target=android-7
diff --git a/ndk/platforms/android-9/samples/native-activity/jni/Android.mk b/ndk/platforms/android-9/samples/native-activity/jni/Android.mk
new file mode 100644
index 0000000..9e64d80
--- /dev/null
+++ b/ndk/platforms/android-9/samples/native-activity/jni/Android.mk
@@ -0,0 +1,26 @@
+# Copyright (C) 2010 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE    := native-activity
+LOCAL_SRC_FILES := main.c
+LOCAL_LDLIBS    := -llog -landroid -lEGL -lGLESv1_CM
+LOCAL_STATIC_LIBRARIES := android_native_app_glue
+
+include $(BUILD_SHARED_LIBRARY)
+
+$(call import-module,android/native_app_glue)
diff --git a/ndk/platforms/android-9/samples/native-activity/jni/Application.mk b/ndk/platforms/android-9/samples/native-activity/jni/Application.mk
new file mode 100644
index 0000000..22d188e
--- /dev/null
+++ b/ndk/platforms/android-9/samples/native-activity/jni/Application.mk
@@ -0,0 +1 @@
+APP_PLATFORM := android-9
diff --git a/ndk/platforms/android-9/samples/native-activity/jni/main.c b/ndk/platforms/android-9/samples/native-activity/jni/main.c
new file mode 100644
index 0000000..2e19635
--- /dev/null
+++ b/ndk/platforms/android-9/samples/native-activity/jni/main.c
@@ -0,0 +1,307 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+//BEGIN_INCLUDE(all)
+#include <jni.h>
+#include <errno.h>
+
+#include <EGL/egl.h>
+#include <GLES/gl.h>
+
+#include <android/sensor.h>
+#include <android/log.h>
+#include <android_native_app_glue.h>
+
+#define LOGI(...) ((void)__android_log_print(ANDROID_LOG_INFO, "native-activity", __VA_ARGS__))
+#define LOGW(...) ((void)__android_log_print(ANDROID_LOG_WARN, "native-activity", __VA_ARGS__))
+
+/**
+ * Our saved state data.
+ */
+struct saved_state {
+    float angle;
+    int32_t x;
+    int32_t y;
+};
+
+/**
+ * Shared state for our app.
+ */
+struct engine {
+    struct android_app* app;
+
+    ASensorManager* sensorManager;
+    const ASensor* accelerometerSensor;
+    ASensorEventQueue* sensorEventQueue;
+
+    int animating;
+    EGLDisplay display;
+    EGLSurface surface;
+    EGLContext context;
+    int32_t width;
+    int32_t height;
+    struct saved_state state;
+};
+
+/**
+ * Initialize an EGL context for the current display.
+ */
+static int engine_init_display(struct engine* engine) {
+    // initialize OpenGL ES and EGL
+
+    /*
+     * Here specify the attributes of the desired configuration.
+     * Below, we select an EGLConfig with at least 8 bits per color
+     * component compatible with on-screen windows
+     */
+    const EGLint attribs[] = {
+            EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
+            EGL_BLUE_SIZE, 8,
+            EGL_GREEN_SIZE, 8,
+            EGL_RED_SIZE, 8,
+            EGL_NONE
+    };
+    EGLint w, h, dummy, format;
+    EGLint numConfigs;
+    EGLConfig config;
+    EGLSurface surface;
+    EGLContext context;
+
+    EGLDisplay display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
+
+    eglInitialize(display, 0, 0);
+
+    /* Here, the application chooses the configuration it desires. In this
+     * sample, we have a very simplified selection process, where we pick
+     * the first EGLConfig that matches our criteria */
+    eglChooseConfig(display, attribs, &config, 1, &numConfigs);
+
+    /* EGL_NATIVE_VISUAL_ID is an attribute of the EGLConfig that is
+     * guaranteed to be accepted by ANativeWindow_setBuffersGeometry().
+     * As soon as we picked a EGLConfig, we can safely reconfigure the
+     * ANativeWindow buffers to match, using EGL_NATIVE_VISUAL_ID. */
+    eglGetConfigAttrib(display, config, EGL_NATIVE_VISUAL_ID, &format);
+
+    ANativeWindow_setBuffersGeometry(engine->app->window, 0, 0, format);
+
+    surface = eglCreateWindowSurface(display, config, engine->app->window, NULL);
+    context = eglCreateContext(display, config, NULL, NULL);
+
+    if (eglMakeCurrent(display, surface, surface, context) == EGL_FALSE) {
+        LOGW("Unable to eglMakeCurrent");
+        return -1;
+    }
+
+    eglQuerySurface(display, surface, EGL_WIDTH, &w);
+    eglQuerySurface(display, surface, EGL_HEIGHT, &h);
+
+    engine->display = display;
+    engine->context = context;
+    engine->surface = surface;
+    engine->width = w;
+    engine->height = h;
+    engine->state.angle = 0;
+
+    // Initialize GL state.
+    glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST);
+    glEnable(GL_CULL_FACE);
+    glShadeModel(GL_SMOOTH);
+    glDisable(GL_DEPTH_TEST);
+
+    return 0;
+}
+
+/**
+ * Just the current frame in the display.
+ */
+static void engine_draw_frame(struct engine* engine) {
+    if (engine->display == NULL) {
+        // No display.
+        return;
+    }
+
+    // Just fill the screen with a color.
+    glClearColor(((float)engine->state.x)/engine->width, engine->state.angle,
+            ((float)engine->state.y)/engine->height, 1);
+    glClear(GL_COLOR_BUFFER_BIT);
+
+    eglSwapBuffers(engine->display, engine->surface);
+}
+
+/**
+ * Tear down the EGL context currently associated with the display.
+ */
+static void engine_term_display(struct engine* engine) {
+    if (engine->display != EGL_NO_DISPLAY) {
+        eglMakeCurrent(engine->display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
+        if (engine->context != EGL_NO_CONTEXT) {
+            eglDestroyContext(engine->display, engine->context);
+        }
+        if (engine->surface != EGL_NO_SURFACE) {
+            eglDestroySurface(engine->display, engine->surface);
+        }
+        eglTerminate(engine->display);
+    }
+    engine->animating = 0;
+    engine->display = EGL_NO_DISPLAY;
+    engine->context = EGL_NO_CONTEXT;
+    engine->surface = EGL_NO_SURFACE;
+}
+
+/**
+ * Process the next input event.
+ */
+static int32_t engine_handle_input(struct android_app* app, AInputEvent* event) {
+    struct engine* engine = (struct engine*)app->userData;
+    if (AInputEvent_getType(event) == AINPUT_EVENT_TYPE_MOTION) {
+        engine->animating = 1;
+        engine->state.x = AMotionEvent_getX(event, 0);
+        engine->state.y = AMotionEvent_getY(event, 0);
+        return 1;
+    }
+    return 0;
+}
+
+/**
+ * Process the next main command.
+ */
+static void engine_handle_cmd(struct android_app* app, int32_t cmd) {
+    struct engine* engine = (struct engine*)app->userData;
+    switch (cmd) {
+        case APP_CMD_SAVE_STATE:
+            // The system has asked us to save our current state.  Do so.
+            engine->app->savedState = malloc(sizeof(struct saved_state));
+            *((struct saved_state*)engine->app->savedState) = engine->state;
+            engine->app->savedStateSize = sizeof(struct saved_state);
+            break;
+        case APP_CMD_INIT_WINDOW:
+            // The window is being shown, get it ready.
+            if (engine->app->window != NULL) {
+                engine_init_display(engine);
+                engine_draw_frame(engine);
+            }
+            break;
+        case APP_CMD_TERM_WINDOW:
+            // The window is being hidden or closed, clean it up.
+            engine_term_display(engine);
+            break;
+        case APP_CMD_GAINED_FOCUS:
+            // When our app gains focus, we start monitoring the accelerometer.
+            if (engine->accelerometerSensor != NULL) {
+                ASensorEventQueue_enableSensor(engine->sensorEventQueue,
+                        engine->accelerometerSensor);
+                // We'd like to get 60 events per second (in us).
+                ASensorEventQueue_setEventRate(engine->sensorEventQueue,
+                        engine->accelerometerSensor, (1000L/60)*1000);
+            }
+            break;
+        case APP_CMD_LOST_FOCUS:
+            // When our app loses focus, we stop monitoring the accelerometer.
+            // This is to avoid consuming battery while not being used.
+            if (engine->accelerometerSensor != NULL) {
+                ASensorEventQueue_disableSensor(engine->sensorEventQueue,
+                        engine->accelerometerSensor);
+            }
+            // Also stop animating.
+            engine->animating = 0;
+            engine_draw_frame(engine);
+            break;
+    }
+}
+
+/**
+ * This is the main entry point of a native application that is using
+ * android_native_app_glue.  It runs in its own thread, with its own
+ * event loop for receiving input events and doing other things.
+ */
+void android_main(struct android_app* state) {
+    struct engine engine;
+
+    // Make sure glue isn't stripped.
+    app_dummy();
+
+    memset(&engine, 0, sizeof(engine));
+    state->userData = &engine;
+    state->onAppCmd = engine_handle_cmd;
+    state->onInputEvent = engine_handle_input;
+    engine.app = state;
+
+    // Prepare to monitor accelerometer
+    engine.sensorManager = ASensorManager_getInstance();
+    engine.accelerometerSensor = ASensorManager_getDefaultSensor(engine.sensorManager,
+            ASENSOR_TYPE_ACCELEROMETER);
+    engine.sensorEventQueue = ASensorManager_createEventQueue(engine.sensorManager,
+            state->looper, LOOPER_ID_USER, NULL, NULL);
+
+    if (state->savedState != NULL) {
+        // We are starting with a previous saved state; restore from it.
+        engine.state = *(struct saved_state*)state->savedState;
+    }
+
+    // loop waiting for stuff to do.
+
+    while (1) {
+        // Read all pending events.
+        int ident;
+        int events;
+        struct android_poll_source* source;
+
+        // If not animating, we will block forever waiting for events.
+        // If animating, we loop until all events are read, then continue
+        // to draw the next frame of animation.
+        while ((ident=ALooper_pollAll(engine.animating ? 0 : -1, NULL, &events,
+                (void**)&source)) >= 0) {
+
+            // Process this event.
+            if (source != NULL) {
+                source->process(state, source);
+            }
+
+            // If a sensor has data, process it now.
+            if (ident == LOOPER_ID_USER) {
+                if (engine.accelerometerSensor != NULL) {
+                    ASensorEvent event;
+                    while (ASensorEventQueue_getEvents(engine.sensorEventQueue,
+                            &event, 1) > 0) {
+                        LOGI("accelerometer: x=%f y=%f z=%f",
+                                event.acceleration.x, event.acceleration.y,
+                                event.acceleration.z);
+                    }
+                }
+            }
+
+            // Check if we are exiting.
+            if (state->destroyRequested != 0) {
+                engine_term_display(&engine);
+                return;
+            }
+        }
+
+        if (engine.animating) {
+            // Done with events; draw next animation frame.
+            engine.state.angle += .01f;
+            if (engine.state.angle > 1) {
+                engine.state.angle = 0;
+            }
+
+            // Drawing is throttled to the screen update rate, so there
+            // is no need to do timing here.
+            engine_draw_frame(&engine);
+        }
+    }
+}
+//END_INCLUDE(all)
diff --git a/ndk/platforms/android-9/samples/native-activity/res/values/strings.xml b/ndk/platforms/android-9/samples/native-activity/res/values/strings.xml
new file mode 100644
index 0000000..d8f5513
--- /dev/null
+++ b/ndk/platforms/android-9/samples/native-activity/res/values/strings.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <string name="app_name">NativeActivity</string>
+</resources>
diff --git a/ndk/platforms/android-9/samples/native-plasma/AndroidManifest.xml b/ndk/platforms/android-9/samples/native-plasma/AndroidManifest.xml
new file mode 100644
index 0000000..28408b9
--- /dev/null
+++ b/ndk/platforms/android-9/samples/native-plasma/AndroidManifest.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+      package="com.example.native_plasma"
+      android:versionCode="1"
+      android:versionName="1.0">
+    <uses-sdk android:minSdkVersion="8" />
+    <application android:label="@string/app_name"
+                 android:hasCode="false" android:debuggable="true">
+        <activity android:name="android.app.NativeActivity"
+                  android:label="@string/app_name">
+            <meta-data android:name="android.app.lib_name"
+                    android:value="native-plasma" />
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.LAUNCHER" />
+            </intent-filter>
+        </activity>
+    </application>
+</manifest> 
diff --git a/ndk/platforms/android-9/samples/native-plasma/default.properties b/ndk/platforms/android-9/samples/native-plasma/default.properties
new file mode 100644
index 0000000..9d135cb
--- /dev/null
+++ b/ndk/platforms/android-9/samples/native-plasma/default.properties
@@ -0,0 +1,11 @@
+# This file is automatically generated by Android Tools.
+# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
+# 
+# This file must be checked in Version Control Systems.
+# 
+# To customize properties used by the Ant build system use,
+# "build.properties", and override values to adapt the script to your
+# project structure.
+
+# Project target.
+target=android-7
diff --git a/ndk/platforms/android-9/samples/native-plasma/jni/Android.mk b/ndk/platforms/android-9/samples/native-plasma/jni/Android.mk
new file mode 100644
index 0000000..f78df90
--- /dev/null
+++ b/ndk/platforms/android-9/samples/native-plasma/jni/Android.mk
@@ -0,0 +1,26 @@
+# Copyright (C) 2010 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE    := native-plasma
+LOCAL_SRC_FILES := plasma.c
+LOCAL_LDLIBS    := -lm -llog -landroid
+LOCAL_STATIC_LIBRARIES := android_native_app_glue
+
+include $(BUILD_SHARED_LIBRARY)
+
+$(call import-module,android/native_app_glue)
diff --git a/ndk/platforms/android-9/samples/native-plasma/jni/Application.mk b/ndk/platforms/android-9/samples/native-plasma/jni/Application.mk
new file mode 100644
index 0000000..23fa139
--- /dev/null
+++ b/ndk/platforms/android-9/samples/native-plasma/jni/Application.mk
@@ -0,0 +1,3 @@
+# The ARMv7 is significanly faster due to the use of the hardware FPU
+APP_ABI := armeabi armeabi-v7a
+APP_PLATFORM := android-9
diff --git a/ndk/platforms/android-9/samples/native-plasma/jni/plasma.c b/ndk/platforms/android-9/samples/native-plasma/jni/plasma.c
new file mode 100644
index 0000000..01ec644
--- /dev/null
+++ b/ndk/platforms/android-9/samples/native-plasma/jni/plasma.c
@@ -0,0 +1,499 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <android_native_app_glue.h>
+
+#include <errno.h>
+#include <jni.h>
+#include <sys/time.h>
+#include <time.h>
+#include <android/log.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+
+#define  LOG_TAG    "libplasma"
+#define  LOGI(...)  __android_log_print(ANDROID_LOG_INFO,LOG_TAG,__VA_ARGS__)
+#define  LOGW(...)  __android_log_print(ANDROID_LOG_WARN,LOG_TAG,__VA_ARGS__)
+#define  LOGE(...)  __android_log_print(ANDROID_LOG_ERROR,LOG_TAG,__VA_ARGS__)
+
+/* Set to 1 to enable debug log traces. */
+#define DEBUG 0
+
+/* Set to 1 to optimize memory stores when generating plasma. */
+#define OPTIMIZE_WRITES  1
+
+/* Return current time in milliseconds */
+static double now_ms(void)
+{
+    struct timeval tv;
+    gettimeofday(&tv, NULL);
+    return tv.tv_sec*1000. + tv.tv_usec/1000.;
+}
+
+/* We're going to perform computations for every pixel of the target
+ * bitmap. floating-point operations are very slow on ARMv5, and not
+ * too bad on ARMv7 with the exception of trigonometric functions.
+ *
+ * For better performance on all platforms, we're going to use fixed-point
+ * arithmetic and all kinds of tricks
+ */
+
+typedef int32_t  Fixed;
+
+#define  FIXED_BITS           16
+#define  FIXED_ONE            (1 << FIXED_BITS)
+#define  FIXED_AVERAGE(x,y)   (((x) + (y)) >> 1)
+
+#define  FIXED_FROM_INT(x)    ((x) << FIXED_BITS)
+#define  FIXED_TO_INT(x)      ((x) >> FIXED_BITS)
+
+#define  FIXED_FROM_FLOAT(x)  ((Fixed)((x)*FIXED_ONE))
+#define  FIXED_TO_FLOAT(x)    ((x)/(1.*FIXED_ONE))
+
+#define  FIXED_MUL(x,y)       (((int64_t)(x) * (y)) >> FIXED_BITS)
+#define  FIXED_DIV(x,y)       (((int64_t)(x) * FIXED_ONE) / (y))
+
+#define  FIXED_DIV2(x)        ((x) >> 1)
+#define  FIXED_AVERAGE(x,y)   (((x) + (y)) >> 1)
+
+#define  FIXED_FRAC(x)        ((x) & ((1 << FIXED_BITS)-1))
+#define  FIXED_TRUNC(x)       ((x) & ~((1 << FIXED_BITS)-1))
+
+#define  FIXED_FROM_INT_FLOAT(x,f)   (Fixed)((x)*(FIXED_ONE*(f)))
+
+typedef int32_t  Angle;
+
+#define  ANGLE_BITS              9
+
+#if ANGLE_BITS < 8
+#  error ANGLE_BITS must be at least 8
+#endif
+
+#define  ANGLE_2PI               (1 << ANGLE_BITS)
+#define  ANGLE_PI                (1 << (ANGLE_BITS-1))
+#define  ANGLE_PI2               (1 << (ANGLE_BITS-2))
+#define  ANGLE_PI4               (1 << (ANGLE_BITS-3))
+
+#define  ANGLE_FROM_FLOAT(x)   (Angle)((x)*ANGLE_PI/M_PI)
+#define  ANGLE_TO_FLOAT(x)     ((x)*M_PI/ANGLE_PI)
+
+#if ANGLE_BITS <= FIXED_BITS
+#  define  ANGLE_FROM_FIXED(x)     (Angle)((x) >> (FIXED_BITS - ANGLE_BITS))
+#  define  ANGLE_TO_FIXED(x)       (Fixed)((x) << (FIXED_BITS - ANGLE_BITS))
+#else
+#  define  ANGLE_FROM_FIXED(x)     (Angle)((x) << (ANGLE_BITS - FIXED_BITS))
+#  define  ANGLE_TO_FIXED(x)       (Fixed)((x) >> (ANGLE_BITS - FIXED_BITS))
+#endif
+
+static Fixed  angle_sin_tab[ANGLE_2PI+1];
+
+static void init_angles(void)
+{
+    int  nn;
+    for (nn = 0; nn < ANGLE_2PI+1; nn++) {
+        double  radians = nn*M_PI/ANGLE_PI;
+        angle_sin_tab[nn] = FIXED_FROM_FLOAT(sin(radians));
+    }
+}
+
+static __inline__ Fixed angle_sin( Angle  a )
+{
+    return angle_sin_tab[(uint32_t)a & (ANGLE_2PI-1)];
+}
+
+static __inline__ Fixed angle_cos( Angle  a )
+{
+    return angle_sin(a + ANGLE_PI2);
+}
+
+static __inline__ Fixed fixed_sin( Fixed  f )
+{
+    return angle_sin(ANGLE_FROM_FIXED(f));
+}
+
+static __inline__ Fixed  fixed_cos( Fixed  f )
+{
+    return angle_cos(ANGLE_FROM_FIXED(f));
+}
+
+/* Color palette used for rendering the plasma */
+#define  PALETTE_BITS   8
+#define  PALETTE_SIZE   (1 << PALETTE_BITS)
+
+#if PALETTE_BITS > FIXED_BITS
+#  error PALETTE_BITS must be smaller than FIXED_BITS 
+#endif
+
+static uint16_t  palette[PALETTE_SIZE];
+
+static uint16_t  make565(int red, int green, int blue)
+{
+    return (uint16_t)( ((red   << 8) & 0xf800) |
+                       ((green << 2) & 0x03e0) |
+                       ((blue  >> 3) & 0x001f) );
+}
+
+static void init_palette(void)
+{
+    int  nn, mm = 0;
+    /* fun with colors */
+    for (nn = 0; nn < PALETTE_SIZE/4; nn++) {
+        int  jj = (nn-mm)*4*255/PALETTE_SIZE;
+        palette[nn] = make565(255, jj, 255-jj);
+    }
+
+    for ( mm = nn; nn < PALETTE_SIZE/2; nn++ ) {
+        int  jj = (nn-mm)*4*255/PALETTE_SIZE;
+        palette[nn] = make565(255-jj, 255, jj);
+    }
+
+    for ( mm = nn; nn < PALETTE_SIZE*3/4; nn++ ) {
+        int  jj = (nn-mm)*4*255/PALETTE_SIZE;
+        palette[nn] = make565(0, 255-jj, 255);
+    }
+
+    for ( mm = nn; nn < PALETTE_SIZE; nn++ ) {
+        int  jj = (nn-mm)*4*255/PALETTE_SIZE;
+        palette[nn] = make565(jj, 0, 255);
+    }
+}
+
+static __inline__ uint16_t  palette_from_fixed( Fixed  x )
+{
+    if (x < 0) x = -x;
+    if (x >= FIXED_ONE) x = FIXED_ONE-1;
+    int  idx = FIXED_FRAC(x) >> (FIXED_BITS - PALETTE_BITS);
+    return palette[idx & (PALETTE_SIZE-1)];
+}
+
+/* Angles expressed as fixed point radians */
+
+static void init_tables(void)
+{
+    init_palette();
+    init_angles();
+}
+
+static void fill_plasma(ANativeWindow_Buffer* buffer, double  t)
+{
+    Fixed ft  = FIXED_FROM_FLOAT(t/1000.);
+    Fixed yt1 = FIXED_FROM_FLOAT(t/1230.);
+    Fixed yt2 = yt1;
+    Fixed xt10 = FIXED_FROM_FLOAT(t/3000.);
+    Fixed xt20 = xt10;
+
+#define  YT1_INCR   FIXED_FROM_FLOAT(1/100.)
+#define  YT2_INCR   FIXED_FROM_FLOAT(1/163.)
+
+    void* pixels = buffer->bits;
+    //LOGI("width=%d height=%d stride=%d format=%d", buffer->width, buffer->height,
+    //        buffer->stride, buffer->format);
+
+    int  yy;
+    for (yy = 0; yy < buffer->height; yy++) {
+        uint16_t*  line = (uint16_t*)pixels;
+        Fixed      base = fixed_sin(yt1) + fixed_sin(yt2);
+        Fixed      xt1 = xt10;
+        Fixed      xt2 = xt20;
+
+        yt1 += YT1_INCR;
+        yt2 += YT2_INCR;
+
+#define  XT1_INCR  FIXED_FROM_FLOAT(1/173.)
+#define  XT2_INCR  FIXED_FROM_FLOAT(1/242.)
+
+#if OPTIMIZE_WRITES
+        /* optimize memory writes by generating one aligned 32-bit store
+         * for every pair of pixels.
+         */
+        uint16_t*  line_end = line + buffer->width;
+
+        if (line < line_end) {
+            if (((uint32_t)line & 3) != 0) {
+                Fixed ii = base + fixed_sin(xt1) + fixed_sin(xt2);
+
+                xt1 += XT1_INCR;
+                xt2 += XT2_INCR;
+
+                line[0] = palette_from_fixed(ii >> 2);
+                line++;
+            }
+
+            while (line + 2 <= line_end) {
+                Fixed i1 = base + fixed_sin(xt1) + fixed_sin(xt2);
+                xt1 += XT1_INCR;
+                xt2 += XT2_INCR;
+
+                Fixed i2 = base + fixed_sin(xt1) + fixed_sin(xt2);
+                xt1 += XT1_INCR;
+                xt2 += XT2_INCR;
+
+                uint32_t  pixel = ((uint32_t)palette_from_fixed(i1 >> 2) << 16) |
+                                   (uint32_t)palette_from_fixed(i2 >> 2);
+
+                ((uint32_t*)line)[0] = pixel;
+                line += 2;
+            }
+
+            if (line < line_end) {
+                Fixed ii = base + fixed_sin(xt1) + fixed_sin(xt2);
+                line[0] = palette_from_fixed(ii >> 2);
+                line++;
+            }
+        }
+#else /* !OPTIMIZE_WRITES */
+        int xx;
+        for (xx = 0; xx < buffer->width; xx++) {
+
+            Fixed ii = base + fixed_sin(xt1) + fixed_sin(xt2);
+
+            xt1 += XT1_INCR;
+            xt2 += XT2_INCR;
+
+            line[xx] = palette_from_fixed(ii / 4);
+        }
+#endif /* !OPTIMIZE_WRITES */
+
+        // go to next line
+        pixels = (uint16_t*)pixels + buffer->stride;
+    }
+}
+
+/* simple stats management */
+typedef struct {
+    double  renderTime;
+    double  frameTime;
+} FrameStats;
+
+#define  MAX_FRAME_STATS  200
+#define  MAX_PERIOD_MS    1500
+
+typedef struct {
+    double  firstTime;
+    double  lastTime;
+    double  frameTime;
+
+    int         firstFrame;
+    int         numFrames;
+    FrameStats  frames[ MAX_FRAME_STATS ];
+} Stats;
+
+static void
+stats_init( Stats*  s )
+{
+    s->lastTime = now_ms();
+    s->firstTime = 0.;
+    s->firstFrame = 0;
+    s->numFrames  = 0;
+}
+
+static void
+stats_startFrame( Stats*  s )
+{
+    s->frameTime = now_ms();
+}
+
+static void
+stats_endFrame( Stats*  s )
+{
+    double now = now_ms();
+    double renderTime = now - s->frameTime;
+    double frameTime  = now - s->lastTime;
+    int nn;
+
+    if (now - s->firstTime >= MAX_PERIOD_MS) {
+        if (s->numFrames > 0) {
+            double minRender, maxRender, avgRender;
+            double minFrame, maxFrame, avgFrame;
+            int count;
+
+            nn = s->firstFrame;
+            minRender = maxRender = avgRender = s->frames[nn].renderTime;
+            minFrame  = maxFrame  = avgFrame  = s->frames[nn].frameTime;
+            for (count = s->numFrames; count > 0; count-- ) {
+                nn += 1;
+                if (nn >= MAX_FRAME_STATS)
+                    nn -= MAX_FRAME_STATS;
+                double render = s->frames[nn].renderTime;
+                if (render < minRender) minRender = render;
+                if (render > maxRender) maxRender = render;
+                double frame = s->frames[nn].frameTime;
+                if (frame < minFrame) minFrame = frame;
+                if (frame > maxFrame) maxFrame = frame;
+                avgRender += render;
+                avgFrame  += frame;
+            }
+            avgRender /= s->numFrames;
+            avgFrame  /= s->numFrames;
+
+            LOGI("frame/s (avg,min,max) = (%.1f,%.1f,%.1f) "
+                 "render time ms (avg,min,max) = (%.1f,%.1f,%.1f)\n",
+                 1000./avgFrame, 1000./maxFrame, 1000./minFrame,
+                 avgRender, minRender, maxRender);
+        }
+        s->numFrames  = 0;
+        s->firstFrame = 0;
+        s->firstTime  = now;
+    }
+
+    nn = s->firstFrame + s->numFrames;
+    if (nn >= MAX_FRAME_STATS)
+        nn -= MAX_FRAME_STATS;
+
+    s->frames[nn].renderTime = renderTime;
+    s->frames[nn].frameTime  = frameTime;
+
+    if (s->numFrames < MAX_FRAME_STATS) {
+        s->numFrames += 1;
+    } else {
+        s->firstFrame += 1;
+        if (s->firstFrame >= MAX_FRAME_STATS)
+            s->firstFrame -= MAX_FRAME_STATS;
+    }
+
+    s->lastTime = now;
+}
+
+// ----------------------------------------------------------------------
+
+struct engine {
+    struct android_app* app;
+
+    Stats stats;
+
+    int animating;
+};
+
+static void engine_draw_frame(struct engine* engine) {
+    if (engine->app->window == NULL) {
+        // No window.
+        return;
+    }
+
+    ANativeWindow_Buffer buffer;
+    if (ANativeWindow_lock(engine->app->window, &buffer, NULL) < 0) {
+        LOGW("Unable to lock window buffer");
+        return;
+    }
+
+    stats_startFrame(&engine->stats);
+
+    struct timespec t;
+    t.tv_sec = t.tv_nsec = 0;
+    clock_gettime(CLOCK_MONOTONIC, &t);
+    int64_t time_ms = (((int64_t)t.tv_sec)*1000000000LL + t.tv_nsec)/1000000;
+
+    /* Now fill the values with a nice little plasma */
+    fill_plasma(&buffer, time_ms);
+
+    ANativeWindow_unlockAndPost(engine->app->window);
+
+    stats_endFrame(&engine->stats);
+}
+
+static int engine_term_display(struct engine* engine) {
+    engine->animating = 0;
+}
+
+static int32_t engine_handle_input(struct android_app* app, AInputEvent* event) {
+    struct engine* engine = (struct engine*)app->userData;
+    if (AInputEvent_getType(event) == AINPUT_EVENT_TYPE_MOTION) {
+        engine->animating = 1;
+        return 1;
+    } else if (AInputEvent_getType(event) == AINPUT_EVENT_TYPE_KEY) {
+        LOGI("Key event: action=%d keyCode=%d metaState=0x%x",
+                AKeyEvent_getAction(event),
+                AKeyEvent_getKeyCode(event),
+                AKeyEvent_getMetaState(event));
+    }
+
+    return 0;
+}
+
+static void engine_handle_cmd(struct android_app* app, int32_t cmd) {
+    struct engine* engine = (struct engine*)app->userData;
+    switch (cmd) {
+        case APP_CMD_INIT_WINDOW:
+            if (engine->app->window != NULL) {
+                engine_draw_frame(engine);
+            }
+            break;
+        case APP_CMD_TERM_WINDOW:
+            engine_term_display(engine);
+            break;
+        case APP_CMD_LOST_FOCUS:
+            engine->animating = 0;
+            engine_draw_frame(engine);
+            break;
+    }
+}
+
+void android_main(struct android_app* state) {
+    static int init;
+
+    struct engine engine;
+
+    // Make sure glue isn't stripped.
+    app_dummy();
+
+    memset(&engine, 0, sizeof(engine));
+    state->userData = &engine;
+    state->onAppCmd = engine_handle_cmd;
+    state->onInputEvent = engine_handle_input;
+    engine.app = state;
+
+    if (!init) {
+        init_tables();
+        init = 1;
+    }
+
+    stats_init(&engine.stats);
+
+    // loop waiting for stuff to do.
+
+    while (1) {
+        // Read all pending events.
+        int ident;
+        int events;
+        struct android_poll_source* source;
+
+        // If not animating, we will block forever waiting for events.
+        // If animating, we loop until all events are read, then continue
+        // to draw the next frame of animation.
+        while ((ident=ALooper_pollAll(engine.animating ? 0 : -1, NULL, &events,
+                (void**)&source)) >= 0) {
+
+            // Process this event.
+            if (source != NULL) {
+                source->process(state, source);
+            }
+
+            // Check if we are exiting.
+            if (state->destroyRequested != 0) {
+                LOGI("Engine thread destroy requested!");
+                engine_term_display(&engine);
+                return;
+            }
+        }
+
+        if (engine.animating) {
+            engine_draw_frame(&engine);
+        }
+    }
+}
diff --git a/ndk/platforms/android-9/samples/native-plasma/res/values/strings.xml b/ndk/platforms/android-9/samples/native-plasma/res/values/strings.xml
new file mode 100644
index 0000000..269ec3d
--- /dev/null
+++ b/ndk/platforms/android-9/samples/native-plasma/res/values/strings.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <string name="app_name">Native Plasma</string>
+</resources>
diff --git a/ndk/platforms/android-9/samples/native-plasma/src/Dummy.java b/ndk/platforms/android-9/samples/native-plasma/src/Dummy.java
new file mode 100644
index 0000000..596215a
--- /dev/null
+++ b/ndk/platforms/android-9/samples/native-plasma/src/Dummy.java
@@ -0,0 +1,4 @@
+// Temporary until the NDK build system can deal with there being no Java source.
+class Dummy {
+
+}
diff --git a/ndk/samples/hello-jni/AndroidManifest.xml b/ndk/samples/hello-jni/AndroidManifest.xml
new file mode 100644
index 0000000..ef53ac4
--- /dev/null
+++ b/ndk/samples/hello-jni/AndroidManifest.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+      package="com.example.hellojni"
+      android:versionCode="1"
+      android:versionName="1.0">
+    <uses-sdk android:minSdkVersion="3" />
+    <application android:label="@string/app_name"
+                 android:debuggable="true">
+        <activity android:name=".HelloJni"
+                  android:label="@string/app_name">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.LAUNCHER" />
+            </intent-filter>
+        </activity>
+    </application>
+</manifest> 
diff --git a/ndk/samples/hello-jni/default.properties b/ndk/samples/hello-jni/default.properties
new file mode 100644
index 0000000..0b9250e
--- /dev/null
+++ b/ndk/samples/hello-jni/default.properties
@@ -0,0 +1,11 @@
+# This file is automatically generated by Android Tools.
+# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
+# 
+# This file must be checked in Version Control Systems.
+# 
+# To customize properties used by the Ant build system use,
+# "build.properties", and override values to adapt the script to your
+# project structure.
+
+# Project target.
+target=android-8
diff --git a/ndk/samples/hello-jni/jni/Android.mk b/ndk/samples/hello-jni/jni/Android.mk
new file mode 100644
index 0000000..6ccf381
--- /dev/null
+++ b/ndk/samples/hello-jni/jni/Android.mk
@@ -0,0 +1,22 @@
+# Copyright (C) 2009 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE    := hello-jni
+LOCAL_SRC_FILES := hello-jni.c
+
+include $(BUILD_SHARED_LIBRARY)
diff --git a/ndk/samples/hello-jni/jni/hello-jni.c b/ndk/samples/hello-jni/jni/hello-jni.c
new file mode 100644
index 0000000..632ac17
--- /dev/null
+++ b/ndk/samples/hello-jni/jni/hello-jni.c
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2009 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+#include <string.h>
+#include <jni.h>
+
+/* This is a trivial JNI example where we use a native method
+ * to return a new VM String. See the corresponding Java source
+ * file located at:
+ *
+ *   apps/samples/hello-jni/project/src/com/example/HelloJni/HelloJni.java
+ */
+jstring
+Java_com_example_hellojni_HelloJni_stringFromJNI( JNIEnv* env,
+                                                  jobject thiz )
+{
+    return (*env)->NewStringUTF(env, "Hello from JNI !");
+}
diff --git a/ndk/samples/hello-jni/res/values/strings.xml b/ndk/samples/hello-jni/res/values/strings.xml
new file mode 100644
index 0000000..c526073
--- /dev/null
+++ b/ndk/samples/hello-jni/res/values/strings.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <string name="app_name">HelloJni</string>
+</resources>
diff --git a/ndk/samples/hello-jni/src/com/example/hellojni/HelloJni.java b/ndk/samples/hello-jni/src/com/example/hellojni/HelloJni.java
new file mode 100644
index 0000000..97ab6d9
--- /dev/null
+++ b/ndk/samples/hello-jni/src/com/example/hellojni/HelloJni.java
@@ -0,0 +1,66 @@
+/*
+ * Copyright (C) 2009 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.example.hellojni;
+
+import android.app.Activity;
+import android.widget.TextView;
+import android.os.Bundle;
+
+
+public class HelloJni extends Activity
+{
+    /** Called when the activity is first created. */
+    @Override
+    public void onCreate(Bundle savedInstanceState)
+    {
+        super.onCreate(savedInstanceState);
+
+        /* Create a TextView and set its content.
+         * the text is retrieved by calling a native
+         * function.
+         */
+        TextView  tv = new TextView(this);
+        tv.setText( stringFromJNI() );
+        setContentView(tv);
+    }
+
+    /* A native method that is implemented by the
+     * 'hello-jni' native library, which is packaged
+     * with this application.
+     */
+    public native String  stringFromJNI();
+
+    /* This is another native method declaration that is *not*
+     * implemented by 'hello-jni'. This is simply to show that
+     * you can declare as many native methods in your Java code
+     * as you want, their implementation is searched in the
+     * currently loaded native libraries only the first time
+     * you call them.
+     *
+     * Trying to call this function will result in a
+     * java.lang.UnsatisfiedLinkError exception !
+     */
+    public native String  unimplementedStringFromJNI();
+
+    /* this is used to load the 'hello-jni' library on application
+     * startup. The library has already been unpacked into
+     * /data/data/com.example.HelloJni/lib/libhello-jni.so at
+     * installation time by the package manager.
+     */
+    static {
+        System.loadLibrary("hello-jni");
+    }
+}
diff --git a/ndk/samples/hello-jni/tests/AndroidManifest.xml b/ndk/samples/hello-jni/tests/AndroidManifest.xml
new file mode 100644
index 0000000..d6be01e
--- /dev/null
+++ b/ndk/samples/hello-jni/tests/AndroidManifest.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- package name must be unique so suffix with "tests" so package loader doesn't ignore us -->
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+          package="com.example.HelloJni.tests"
+          android:versionCode="1"
+          android:versionName="1.0">
+    <!-- We add an application tag here just so that we can indicate that
+         this package needs to link against the android.test library,
+         which is needed when building test cases. -->
+    <application>
+        <uses-library android:name="android.test.runner" />
+    </application>
+    <!--
+    This declares that this application uses the instrumentation test runner targeting
+    the package of com.example.HelloJni.  To run the tests use the command:
+    "adb shell am instrument -w com.example.HelloJni.tests/android.test.InstrumentationTestRunner"
+    -->
+    <instrumentation android:name="android.test.InstrumentationTestRunner"
+                     android:targetPackage="com.example.HelloJni"
+                     android:label="Tests for HelloJni"/>
+</manifest>
diff --git a/ndk/samples/hello-jni/tests/default.properties b/ndk/samples/hello-jni/tests/default.properties
new file mode 100644
index 0000000..4513a1e
--- /dev/null
+++ b/ndk/samples/hello-jni/tests/default.properties
@@ -0,0 +1,11 @@
+# This file is automatically generated by Android Tools.
+# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
+# 
+# This file must be checked in Version Control Systems.
+# 
+# To customize properties used by the Ant build system use,
+# "build.properties", and override values to adapt the script to your
+# project structure.
+
+# Project target.
+target=android-3
diff --git a/ndk/samples/hello-jni/tests/src/com/example/HelloJni/HelloJniTest.java b/ndk/samples/hello-jni/tests/src/com/example/HelloJni/HelloJniTest.java
new file mode 100644
index 0000000..519d857
--- /dev/null
+++ b/ndk/samples/hello-jni/tests/src/com/example/HelloJni/HelloJniTest.java
@@ -0,0 +1,21 @@
+package com.example.HelloJni;
+
+import android.test.ActivityInstrumentationTestCase;
+
+/**
+ * This is a simple framework for a test of an Application.  See
+ * {@link android.test.ApplicationTestCase ApplicationTestCase} for more information on
+ * how to write and extend Application tests.
+ * <p/>
+ * To run this test, you can type:
+ * adb shell am instrument -w \
+ * -e class com.example.HelloJni.HelloJniTest \
+ * com.example.HelloJni.tests/android.test.InstrumentationTestRunner
+ */
+public class HelloJniTest extends ActivityInstrumentationTestCase<HelloJni> {
+
+    public HelloJniTest() {
+        super("com.example.HelloJni", HelloJni.class);
+    }
+
+}
diff --git a/ndk/samples/hello-neon/AndroidManifest.xml b/ndk/samples/hello-neon/AndroidManifest.xml
new file mode 100644
index 0000000..2d362d6
--- /dev/null
+++ b/ndk/samples/hello-neon/AndroidManifest.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+      package="com.example.neon"
+      android:versionCode="1"
+      android:versionName="1.0">
+    <application android:label="@string/app_name">
+        <activity android:name=".HelloNeon"
+                  android:label="@string/app_name">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.LAUNCHER" />
+            </intent-filter>
+        </activity>
+    </application>
+</manifest> 
diff --git a/ndk/samples/hello-neon/build.properties b/ndk/samples/hello-neon/build.properties
new file mode 100644
index 0000000..8167464
--- /dev/null
+++ b/ndk/samples/hello-neon/build.properties
@@ -0,0 +1,20 @@
+# This file is used to override default values used by the Ant build system.
+# 
+# This file must be checked in Version Control Systems, as it is
+# integral to the build system of your project.
+
+# This file is only used by the Ant script.
+
+# You can use this to override default values such as
+#  'source.dir' for the location of your java source folder and
+#  'out.dir' for the location of your output folder.
+
+# You can also use it define how the release builds are signed by declaring
+# the following properties:
+#  'key.store' for the location of your keystore and
+#  'key.alias' for the name of the key to use.
+# The password will be asked during the build when you use the 'release' target.
+
+# The name of your application package as defined in the manifest.
+# Used by the 'uninstall' rule.
+application.package=com.example.neon
diff --git a/ndk/samples/hello-neon/default.properties b/ndk/samples/hello-neon/default.properties
new file mode 100644
index 0000000..4513a1e
--- /dev/null
+++ b/ndk/samples/hello-neon/default.properties
@@ -0,0 +1,11 @@
+# This file is automatically generated by Android Tools.
+# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
+# 
+# This file must be checked in Version Control Systems.
+# 
+# To customize properties used by the Ant build system use,
+# "build.properties", and override values to adapt the script to your
+# project structure.
+
+# Project target.
+target=android-3
diff --git a/ndk/samples/hello-neon/jni/Android.mk b/ndk/samples/hello-neon/jni/Android.mk
new file mode 100644
index 0000000..685b01b
--- /dev/null
+++ b/ndk/samples/hello-neon/jni/Android.mk
@@ -0,0 +1,20 @@
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := helloneon
+
+LOCAL_SRC_FILES := helloneon.c
+
+ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
+    LOCAL_CFLAGS := -DHAVE_NEON=1
+    LOCAL_SRC_FILES += helloneon-intrinsics.c.neon
+endif
+
+LOCAL_STATIC_LIBRARIES := cpufeatures
+
+LOCAL_LDLIBS := -llog
+
+include $(BUILD_SHARED_LIBRARY)
+
+$(call import-module,cpufeatures)
diff --git a/ndk/samples/hello-neon/jni/Application.mk b/ndk/samples/hello-neon/jni/Application.mk
new file mode 100644
index 0000000..db8f866
--- /dev/null
+++ b/ndk/samples/hello-neon/jni/Application.mk
@@ -0,0 +1,2 @@
+# Build both ARMv5TE and ARMv7-A machine code.
+APP_ABI := armeabi armeabi-v7a
diff --git a/ndk/samples/hello-neon/jni/helloneon-intrinsics.c b/ndk/samples/hello-neon/jni/helloneon-intrinsics.c
new file mode 100644
index 0000000..35367c1
--- /dev/null
+++ b/ndk/samples/hello-neon/jni/helloneon-intrinsics.c
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+#include "helloneon-intrinsics.h"
+#include <arm_neon.h>
+
+/* this source file should only be compiled by Android.mk when targeting
+ * the armeabi-v7a ABI, and should be built in NEON mode
+ */
+void
+fir_filter_neon_intrinsics(short *output, const short* input, const short* kernel, int width, int kernelSize)
+{
+#if 1
+   int nn, offset = -kernelSize/2;
+
+   for (nn = 0; nn < width; nn++)
+   {
+        int mm, sum = 0;
+        int32x4_t sum_vec = vdupq_n_s32(0);
+        for(mm = 0; mm < kernelSize/4; mm++)
+        {
+            int16x4_t  kernel_vec = vld1_s16(kernel + mm*4);
+            int16x4_t  input_vec = vld1_s16(input + (nn+offset+mm*4));
+            sum_vec = vmlal_s16(sum_vec, kernel_vec, input_vec);
+        }
+
+        sum += vgetq_lane_s32(sum_vec, 0);
+        sum += vgetq_lane_s32(sum_vec, 1);
+        sum += vgetq_lane_s32(sum_vec, 2);
+        sum += vgetq_lane_s32(sum_vec, 3);
+
+        if(kernelSize & 3)
+        {
+            for(mm = kernelSize - (kernelSize & 3); mm < kernelSize; mm++)
+                sum += kernel[mm] * input[nn+offset+mm];
+        }
+
+        output[nn] = (short)((sum + 0x8000) >> 16);
+    }
+#else /* for comparison purposes only */
+    int nn, offset = -kernelSize/2;
+    for (nn = 0; nn < width; nn++) {
+        int sum = 0;
+        int mm;
+        for (mm = 0; mm < kernelSize; mm++) {
+            sum += kernel[mm]*input[nn+offset+mm];
+        }
+        output[n] = (short)((sum + 0x8000) >> 16);
+    }
+#endif
+}
diff --git a/ndk/samples/hello-neon/jni/helloneon-intrinsics.h b/ndk/samples/hello-neon/jni/helloneon-intrinsics.h
new file mode 100644
index 0000000..ad4c8db
--- /dev/null
+++ b/ndk/samples/hello-neon/jni/helloneon-intrinsics.h
@@ -0,0 +1,22 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+#ifndef HELLONEON_INTRINSICS_H
+#define HELLONEON_INTRINSICS_H
+
+void fir_filter_neon_intrinsics(short *output, const short* input, const short* kernel, int width, int kernelSize);
+
+#endif /* HELLONEON_INTRINSICS_H */
diff --git a/ndk/samples/hello-neon/jni/helloneon.c b/ndk/samples/hello-neon/jni/helloneon.c
new file mode 100644
index 0000000..ee19e08
--- /dev/null
+++ b/ndk/samples/hello-neon/jni/helloneon.c
@@ -0,0 +1,163 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+#include <jni.h>
+#include <time.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <cpu-features.h>
+#include "helloneon-intrinsics.h"
+
+#define DEBUG 0
+
+#if DEBUG
+#include <android/log.h>
+#  define  D(x...)  __android_log_print(ANDROID_LOG_INFO,"helloneon",x)
+#else
+#  define  D(...)  do {} while (0)
+#endif
+
+/* return current time in milliseconds */
+static double
+now_ms(void)
+{
+    struct timespec res;
+    clock_gettime(CLOCK_REALTIME, &res);
+    return 1000.0*res.tv_sec + (double)res.tv_nsec/1e6;
+}
+
+
+/* this is a FIR filter implemented in C */
+static void
+fir_filter_c(short *output, const short* input, const short* kernel, int width, int kernelSize)
+{
+    int  offset = -kernelSize/2;
+    int  nn;
+    for (nn = 0; nn < width; nn++) {
+        int sum = 0;
+        int mm;
+        for (mm = 0; mm < kernelSize; mm++) {
+            sum += kernel[mm]*input[nn+offset+mm];
+        }
+        output[nn] = (short)((sum + 0x8000) >> 16);
+    }
+}
+
+#define  FIR_KERNEL_SIZE   32
+#define  FIR_OUTPUT_SIZE   2560
+#define  FIR_INPUT_SIZE    (FIR_OUTPUT_SIZE + FIR_KERNEL_SIZE)
+#define  FIR_ITERATIONS    600
+
+static const short  fir_kernel[FIR_KERNEL_SIZE] = { 
+    0x10, 0x20, 0x40, 0x70, 0x8c, 0xa2, 0xce, 0xf0, 0xe9, 0xce, 0xa2, 0x8c, 070, 0x40, 0x20, 0x10,
+    0x10, 0x20, 0x40, 0x70, 0x8c, 0xa2, 0xce, 0xf0, 0xe9, 0xce, 0xa2, 0x8c, 070, 0x40, 0x20, 0x10 };
+
+static short        fir_output[FIR_OUTPUT_SIZE];
+static short        fir_input_0[FIR_INPUT_SIZE];
+static const short* fir_input = fir_input_0 + (FIR_KERNEL_SIZE/2);
+static short        fir_output_expected[FIR_OUTPUT_SIZE];
+
+/* This is a trivial JNI example where we use a native method
+ * to return a new VM String. See the corresponding Java source
+ * file located at:
+ *
+ *   apps/samples/hello-neon/project/src/com/example/neon/HelloNeon.java
+ */
+jstring
+Java_com_example_neon_HelloNeon_stringFromJNI( JNIEnv* env,
+                                               jobject thiz )
+{
+    char*  str;
+    uint64_t features;
+    char buffer[512];
+    char tryNeon = 0;
+    double  t0, t1, time_c, time_neon;
+
+    /* setup FIR input - whatever */
+    {
+        int  nn;
+        for (nn = 0; nn < FIR_INPUT_SIZE; nn++) {
+            fir_input_0[nn] = (5*nn) & 255;
+        }
+        fir_filter_c(fir_output_expected, fir_input, fir_kernel, FIR_OUTPUT_SIZE, FIR_KERNEL_SIZE);
+    }
+
+    /* Benchmark small FIR filter loop - C version */
+    t0 = now_ms();
+    {
+        int  count = FIR_ITERATIONS;
+        for (; count > 0; count--) {
+            fir_filter_c(fir_output, fir_input, fir_kernel, FIR_OUTPUT_SIZE, FIR_KERNEL_SIZE);
+        }
+    }
+    t1 = now_ms();
+    time_c = t1 - t0;
+
+    asprintf(&str, "FIR Filter benchmark:\nC version          : %g ms\n", time_c);
+    strlcpy(buffer, str, sizeof buffer);
+    free(str);
+
+    strlcat(buffer, "Neon version   : ", sizeof buffer);
+
+    if (android_getCpuFamily() != ANDROID_CPU_FAMILY_ARM) {
+        strlcat(buffer, "Not an ARM CPU !\n", sizeof buffer);
+        goto EXIT;
+    }
+
+    features = android_getCpuFeatures();
+    if ((features & ANDROID_CPU_ARM_FEATURE_ARMv7) == 0) {
+        strlcat(buffer, "Not an ARMv7 CPU !\n", sizeof buffer);
+        goto EXIT;
+    }
+
+    /* HAVE_NEON is defined in Android.mk ! */
+#ifdef HAVE_NEON
+    if ((features & ANDROID_CPU_ARM_FEATURE_NEON) == 0) {
+        strlcat(buffer, "CPU doesn't support NEON !\n", sizeof buffer);
+        goto EXIT;
+    }
+
+    /* Benchmark small FIR filter loop - Neon version */
+    t0 = now_ms();
+    {
+        int  count = FIR_ITERATIONS;
+        for (; count > 0; count--) {
+            fir_filter_neon_intrinsics(fir_output, fir_input, fir_kernel, FIR_OUTPUT_SIZE, FIR_KERNEL_SIZE);
+        }
+    }
+    t1 = now_ms();
+    time_neon = t1 - t0;
+    asprintf(&str, "%g ms (x%g faster)\n", time_neon, time_c / (time_neon < 1e-6 ? 1. : time_neon));
+    strlcat(buffer, str, sizeof buffer);
+    free(str);
+
+    /* check the result, just in case */
+    {
+        int  nn, fails = 0;
+        for (nn = 0; nn < FIR_OUTPUT_SIZE; nn++) {
+            if (fir_output[nn] != fir_output_expected[nn]) {
+                if (++fails < 16)
+                    D("neon[%d] = %d expected %d", nn, fir_output[nn], fir_output_expected[nn]);
+            }
+        }
+        D("%d fails\n", fails);
+    }
+#else /* !HAVE_NEON */
+    strlcat(buffer, "Program not compiled with ARMv7 support !\n", sizeof buffer);
+#endif /* !HAVE_NEON */
+EXIT:
+    return (*env)->NewStringUTF(env, buffer);
+}
diff --git a/ndk/samples/hello-neon/res/values/strings.xml b/ndk/samples/hello-neon/res/values/strings.xml
new file mode 100644
index 0000000..8d8f980
--- /dev/null
+++ b/ndk/samples/hello-neon/res/values/strings.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <string name="app_name">HelloNeon</string>
+</resources>
diff --git a/ndk/samples/hello-neon/src/com/example/neon/HelloNeon.java b/ndk/samples/hello-neon/src/com/example/neon/HelloNeon.java
new file mode 100644
index 0000000..b2f5e88
--- /dev/null
+++ b/ndk/samples/hello-neon/src/com/example/neon/HelloNeon.java
@@ -0,0 +1,37 @@
+package com.example.neon;
+
+import android.app.Activity;
+import android.os.Bundle;
+import android.widget.TextView;
+
+public class HelloNeon extends Activity
+{
+    /** Called when the activity is first created. */
+    @Override
+    public void onCreate(Bundle savedInstanceState)
+    {
+        super.onCreate(savedInstanceState);
+        /* Create a TextView and set its content.
+         * the text is retrieved by calling a native
+         * function.
+         */
+        TextView  tv = new TextView(this);
+        tv.setText( stringFromJNI() );
+        setContentView(tv);
+    }
+
+    /* A native method that is implemented by the
+     * 'helloneon' native library, which is packaged
+     * with this application.
+     */
+    public native String  stringFromJNI();
+
+    /* this is used to load the 'helloneon' library on application
+     * startup. The library has already been unpacked into
+     * /data/data/com.example.neon/lib/libhelloneon.so at
+     * installation time by the package manager.
+     */
+    static {
+        System.loadLibrary("helloneon");
+    }
+}
diff --git a/ndk/samples/module-exports/README.TXT b/ndk/samples/module-exports/README.TXT
new file mode 100644
index 0000000..abd6c98
--- /dev/null
+++ b/ndk/samples/module-exports/README.TXT
@@ -0,0 +1,9 @@
+This sample is used to demonstrate the usage of module exports
+(i.e. LOCAL_EXPORT_CFLAGS and similar other variables).
+
+Here, three modules are defined: foo, bar, zoo
+
+'foo' exports its include directory and a linker flag
+bar simply uses 'foo', as a static library
+zoo uses bar, is a shared library.
+
diff --git a/ndk/samples/module-exports/jni/Android.mk b/ndk/samples/module-exports/jni/Android.mk
new file mode 100644
index 0000000..a4b594d
--- /dev/null
+++ b/ndk/samples/module-exports/jni/Android.mk
@@ -0,0 +1,23 @@
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := foo
+LOCAL_SRC_FILES := foo/foo.c
+LOCAL_CFLAGS := -DFOO=2
+LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/foo
+LOCAL_EXPORT_CFLAGS := -DFOO=1
+LOCAL_EXPORT_LDLIBS := -llog
+include $(BUILD_STATIC_LIBRARY)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := bar
+LOCAL_SRC_FILES := bar/bar.c
+LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/bar
+LOCAL_STATIC_LIBRARIES := foo
+include $(BUILD_SHARED_LIBRARY)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := zoo
+LOCAL_SRC_FILES := zoo/zoo.c
+LOCAL_SHARED_LIBRARIES := bar
+include $(BUILD_SHARED_LIBRARY)
diff --git a/ndk/samples/module-exports/jni/bar/bar.c b/ndk/samples/module-exports/jni/bar/bar.c
new file mode 100644
index 0000000..71b21d2
--- /dev/null
+++ b/ndk/samples/module-exports/jni/bar/bar.c
@@ -0,0 +1,6 @@
+#include "bar.h"
+
+int  bar(int  x)
+{
+    return foo(x)-1;
+}
diff --git a/ndk/samples/module-exports/jni/bar/bar.h b/ndk/samples/module-exports/jni/bar/bar.h
new file mode 100644
index 0000000..a01f5f7
--- /dev/null
+++ b/ndk/samples/module-exports/jni/bar/bar.h
@@ -0,0 +1,15 @@
+#ifndef BAR_H
+#define BAR_H
+
+/* FOO should be defined to '1' here with the magic of LOCAL_EXPORT_CFLAGS */
+#ifndef FOO
+#error FOO should be defined here !
+#endif
+
+#if FOO != 1
+#error FOO is not correctly defined here !
+#endif
+
+extern int  bar(int  x);
+
+#endif /* BAR_H */
diff --git a/ndk/samples/module-exports/jni/foo/foo.c b/ndk/samples/module-exports/jni/foo/foo.c
new file mode 100644
index 0000000..71e8595
--- /dev/null
+++ b/ndk/samples/module-exports/jni/foo/foo.c
@@ -0,0 +1,20 @@
+#include "foo.h"
+#include <android/log.h>
+
+/* FOO should be defined to '2' when building foo.c */
+#ifndef FOO
+#error FOO is not defined here !
+#endif
+
+#if FOO != 2
+#error FOO is incorrectly defined here !
+#endif
+
+#define  LOG_TAG    "libfoo"
+#define  LOGI(...)  __android_log_print(ANDROID_LOG_INFO,LOG_TAG,__VA_ARGS__)
+
+int  foo(int  x)
+{
+    LOGI("foo(%d) called !", x);
+    return x+1;
+}
diff --git a/ndk/samples/module-exports/jni/foo/foo.h b/ndk/samples/module-exports/jni/foo/foo.h
new file mode 100644
index 0000000..e061d10
--- /dev/null
+++ b/ndk/samples/module-exports/jni/foo/foo.h
@@ -0,0 +1,6 @@
+#ifndef FOO_H
+#define FOO_H
+
+extern int  foo(int x);
+
+#endif /* FOO_H */
diff --git a/ndk/samples/module-exports/jni/zoo/zoo.c b/ndk/samples/module-exports/jni/zoo/zoo.c
new file mode 100644
index 0000000..24e7209
--- /dev/null
+++ b/ndk/samples/module-exports/jni/zoo/zoo.c
@@ -0,0 +1,6 @@
+#include "bar.h"
+
+int something(void)
+{
+    return bar(42);
+}
diff --git a/ndk/samples/test-libstdc++/jni/Android.mk b/ndk/samples/test-libstdc++/jni/Android.mk
new file mode 100644
index 0000000..ba83acf
--- /dev/null
+++ b/ndk/samples/test-libstdc++/jni/Android.mk
@@ -0,0 +1,9 @@
+# A simple test for the minimal standard C++ library
+#
+
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := test-libstl
+LOCAL_SRC_FILES := test-libstl.cpp
+include $(BUILD_EXECUTABLE)
diff --git a/ndk/samples/test-libstdc++/jni/test-libstl.cpp b/ndk/samples/test-libstdc++/jni/test-libstl.cpp
new file mode 100644
index 0000000..f9cedb0
--- /dev/null
+++ b/ndk/samples/test-libstdc++/jni/test-libstl.cpp
@@ -0,0 +1,8 @@
+#include <cerrno>
+#include <cstddef>
+
+int main(void)
+{
+    return 0;
+}
+
diff --git a/ndk/samples/two-libs/AndroidManifest.xml b/ndk/samples/two-libs/AndroidManifest.xml
new file mode 100644
index 0000000..8ed9917
--- /dev/null
+++ b/ndk/samples/two-libs/AndroidManifest.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+      package="com.example.twolibs"
+      android:versionCode="1"
+      android:versionName="1.0">
+    <uses-sdk android:minSdkVersion="3" />
+    <application android:label="@string/app_name">
+        <activity android:name=".TwoLibs"
+                  android:label="@string/app_name">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.LAUNCHER" />
+            </intent-filter>
+        </activity>
+    </application>
+</manifest> 
diff --git a/ndk/samples/two-libs/default.properties b/ndk/samples/two-libs/default.properties
new file mode 100644
index 0000000..4513a1e
--- /dev/null
+++ b/ndk/samples/two-libs/default.properties
@@ -0,0 +1,11 @@
+# This file is automatically generated by Android Tools.
+# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
+# 
+# This file must be checked in Version Control Systems.
+# 
+# To customize properties used by the Ant build system use,
+# "build.properties", and override values to adapt the script to your
+# project structure.
+
+# Project target.
+target=android-3
diff --git a/ndk/samples/two-libs/jni/Android.mk b/ndk/samples/two-libs/jni/Android.mk
new file mode 100644
index 0000000..eb3f018
--- /dev/null
+++ b/ndk/samples/two-libs/jni/Android.mk
@@ -0,0 +1,41 @@
+# Copyright (C) 2009 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+# the purpose of this sample is to demonstrate how one can
+# generate two distinct shared libraries and have them both
+# uploaded in
+#
+
+LOCAL_PATH:= $(call my-dir)
+
+# first lib, which will be built statically
+#
+include $(CLEAR_VARS)
+
+LOCAL_MODULE    := libtwolib-first
+LOCAL_SRC_FILES := first.c
+
+include $(BUILD_STATIC_LIBRARY)
+
+# second lib, which will depend on and include the first one
+#
+include $(CLEAR_VARS)
+
+LOCAL_MODULE    := libtwolib-second
+LOCAL_SRC_FILES := second.c
+
+LOCAL_STATIC_LIBRARIES := libtwolib-first
+
+include $(BUILD_SHARED_LIBRARY)
diff --git a/ndk/samples/two-libs/jni/first.c b/ndk/samples/two-libs/jni/first.c
new file mode 100644
index 0000000..f09e376
--- /dev/null
+++ b/ndk/samples/two-libs/jni/first.c
@@ -0,0 +1,22 @@
+/*
+ * Copyright (C) 2009 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+#include "first.h"
+
+int  first(int  x, int  y)
+{
+    return x + y;
+}
diff --git a/ndk/samples/two-libs/jni/first.h b/ndk/samples/two-libs/jni/first.h
new file mode 100644
index 0000000..d893480
--- /dev/null
+++ b/ndk/samples/two-libs/jni/first.h
@@ -0,0 +1,22 @@
+/*
+ * Copyright (C) 2009 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+#ifndef FIRST_H
+#define FIRST_H
+
+extern int first(int  x, int  y);
+
+#endif /* FIRST_H */
diff --git a/ndk/samples/two-libs/jni/second.c b/ndk/samples/two-libs/jni/second.c
new file mode 100644
index 0000000..4631848
--- /dev/null
+++ b/ndk/samples/two-libs/jni/second.c
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) 2009 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+#include "first.h"
+#include <jni.h>
+
+jint
+Java_com_example_twolibs_TwoLibs_add( JNIEnv*  env,
+                                      jobject  this,
+                                      jint     x,
+                                      jint     y )
+{
+    return first(x, y);
+}
diff --git a/ndk/samples/two-libs/res/values/strings.xml b/ndk/samples/two-libs/res/values/strings.xml
new file mode 100644
index 0000000..ae57f1f
--- /dev/null
+++ b/ndk/samples/two-libs/res/values/strings.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <string name="app_name">TwoLib</string>
+</resources>
diff --git a/ndk/samples/two-libs/src/com/example/twolibs/TwoLibs.java b/ndk/samples/two-libs/src/com/example/twolibs/TwoLibs.java
new file mode 100644
index 0000000..ef9da01
--- /dev/null
+++ b/ndk/samples/two-libs/src/com/example/twolibs/TwoLibs.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2009 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.example.twolibs;
+
+import android.app.Activity;
+import android.widget.TextView;
+import android.os.Bundle;
+
+public class TwoLibs extends Activity
+{
+    /** Called when the activity is first created. */
+    @Override
+    public void onCreate(Bundle savedInstanceState)
+    {
+        super.onCreate(savedInstanceState);
+
+        TextView  tv = new TextView(this);
+        int       x  = 1000;
+        int       y  = 42;
+
+        // here, we dynamically load the library at runtime
+        // before calling the native method.
+        //
+        System.loadLibrary("twolib-second");
+
+        int  z = add(x, y);
+
+        tv.setText( "The sum of " + x + " and " + y + " is " + z );
+        setContentView(tv);
+    }
+
+    public native int add(int  x, int  y);
+}
diff --git a/ndk/samples/two-libs/tests/AndroidManifest.xml b/ndk/samples/two-libs/tests/AndroidManifest.xml
new file mode 100644
index 0000000..a7dd602
--- /dev/null
+++ b/ndk/samples/two-libs/tests/AndroidManifest.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- package name must be unique so suffix with "tests" so package loader doesn't ignore us -->
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+          package="com.example.TwoLib.tests"
+          android:versionCode="1"
+          android:versionName="1.0">
+    <!-- We add an application tag here just so that we can indicate that
+         this package needs to link against the android.test library,
+         which is needed when building test cases. -->
+    <application>
+        <uses-library android:name="android.test.runner" />
+    </application>
+    <!--
+    This declares that this application uses the instrumentation test runner targeting
+    the package of com.example.TwoLib.  To run the tests use the command:
+    "adb shell am instrument -w com.example.TwoLib.tests/android.test.InstrumentationTestRunner"
+    -->
+    <instrumentation android:name="android.test.InstrumentationTestRunner"
+                     android:targetPackage="com.example.TwoLib"
+                     android:label="Tests for TwoLib"/>
+</manifest>
diff --git a/ndk/samples/two-libs/tests/default.properties b/ndk/samples/two-libs/tests/default.properties
new file mode 100644
index 0000000..4513a1e
--- /dev/null
+++ b/ndk/samples/two-libs/tests/default.properties
@@ -0,0 +1,11 @@
+# This file is automatically generated by Android Tools.
+# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
+# 
+# This file must be checked in Version Control Systems.
+# 
+# To customize properties used by the Ant build system use,
+# "build.properties", and override values to adapt the script to your
+# project structure.
+
+# Project target.
+target=android-3
diff --git a/ndk/samples/two-libs/tests/src/com/example/TwoLib/TwoLibTest.java b/ndk/samples/two-libs/tests/src/com/example/TwoLib/TwoLibTest.java
new file mode 100644
index 0000000..2924502
--- /dev/null
+++ b/ndk/samples/two-libs/tests/src/com/example/TwoLib/TwoLibTest.java
@@ -0,0 +1,21 @@
+package com.example.TwoLib;
+
+import android.test.ActivityInstrumentationTestCase;
+
+/**
+ * This is a simple framework for a test of an Application.  See
+ * {@link android.test.ApplicationTestCase ApplicationTestCase} for more information on
+ * how to write and extend Application tests.
+ * <p/>
+ * To run this test, you can type:
+ * adb shell am instrument -w \
+ * -e class com.example.TwoLib.TwoLibTest \
+ * com.example.TwoLib.tests/android.test.InstrumentationTestRunner
+ */
+public class TwoLibTest extends ActivityInstrumentationTestCase<TwoLib> {
+
+    public TwoLibTest() {
+        super("com.example.TwoLib", TwoLib.class);
+    }
+
+}
diff --git a/ndk/sources/android/native_app_glue/Android.mk b/ndk/sources/android/native_app_glue/Android.mk
new file mode 100644
index 0000000..00252fc
--- /dev/null
+++ b/ndk/sources/android/native_app_glue/Android.mk
@@ -0,0 +1,10 @@
+LOCAL_PATH:= $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE:= android_native_app_glue
+LOCAL_SRC_FILES:= android_native_app_glue.c
+LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)
+LOCAL_EXPORT_LDLIBS := -llog
+
+include $(BUILD_STATIC_LIBRARY)
diff --git a/ndk/sources/android/native_app_glue/android_native_app_glue.c b/ndk/sources/android/native_app_glue/android_native_app_glue.c
new file mode 100644
index 0000000..fbd42b4
--- /dev/null
+++ b/ndk/sources/android/native_app_glue/android_native_app_glue.c
@@ -0,0 +1,436 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <jni.h>
+
+#include <errno.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/resource.h>
+
+#include "android_native_app_glue.h"
+#include <android/log.h>
+
+#define LOGI(...) ((void)__android_log_print(ANDROID_LOG_INFO, "threaded_app", __VA_ARGS__))
+
+static void free_saved_state(struct android_app* android_app) {
+    pthread_mutex_lock(&android_app->mutex);
+    if (android_app->savedState != NULL) {
+        free(android_app->savedState);
+        android_app->savedState = NULL;
+        android_app->savedStateSize = 0;
+    }
+    pthread_mutex_unlock(&android_app->mutex);
+}
+
+int8_t android_app_read_cmd(struct android_app* android_app) {
+    int8_t cmd;
+    if (read(android_app->msgread, &cmd, sizeof(cmd)) == sizeof(cmd)) {
+        switch (cmd) {
+            case APP_CMD_SAVE_STATE:
+                free_saved_state(android_app);
+                break;
+        }
+        return cmd;
+    } else {
+        LOGI("No data on command pipe!");
+    }
+    return -1;
+}
+
+static void print_cur_config(struct android_app* android_app) {
+    char lang[2], country[2];
+    AConfiguration_getLanguage(android_app->config, lang);
+    AConfiguration_getCountry(android_app->config, country);
+
+    LOGI("Config: mcc=%d mnc=%d lang=%c%c cnt=%c%c orien=%d touch=%d dens=%d "
+            "keys=%d nav=%d keysHid=%d navHid=%d sdk=%d size=%d long=%d "
+            "modetype=%d modenight=%d",
+            AConfiguration_getMcc(android_app->config),
+            AConfiguration_getMnc(android_app->config),
+            lang[0], lang[1], country[0], country[1],
+            AConfiguration_getOrientation(android_app->config),
+            AConfiguration_getTouchscreen(android_app->config),
+            AConfiguration_getDensity(android_app->config),
+            AConfiguration_getKeyboard(android_app->config),
+            AConfiguration_getNavigation(android_app->config),
+            AConfiguration_getKeysHidden(android_app->config),
+            AConfiguration_getNavHidden(android_app->config),
+            AConfiguration_getSdkVersion(android_app->config),
+            AConfiguration_getScreenSize(android_app->config),
+            AConfiguration_getScreenLong(android_app->config),
+            AConfiguration_getUiModeType(android_app->config),
+            AConfiguration_getUiModeNight(android_app->config));
+}
+
+void android_app_pre_exec_cmd(struct android_app* android_app, int8_t cmd) {
+    switch (cmd) {
+        case APP_CMD_INPUT_CHANGED:
+            LOGI("APP_CMD_INPUT_CHANGED\n");
+            pthread_mutex_lock(&android_app->mutex);
+            if (android_app->inputQueue != NULL) {
+                AInputQueue_detachLooper(android_app->inputQueue);
+            }
+            android_app->inputQueue = android_app->pendingInputQueue;
+            if (android_app->inputQueue != NULL) {
+                LOGI("Attaching input queue to looper");
+                AInputQueue_attachLooper(android_app->inputQueue,
+                        android_app->looper, LOOPER_ID_INPUT, NULL,
+                        &android_app->inputPollSource);
+            }
+            pthread_cond_broadcast(&android_app->cond);
+            pthread_mutex_unlock(&android_app->mutex);
+            break;
+
+        case APP_CMD_INIT_WINDOW:
+            LOGI("APP_CMD_INIT_WINDOW\n");
+            pthread_mutex_lock(&android_app->mutex);
+            android_app->window = android_app->pendingWindow;
+            pthread_cond_broadcast(&android_app->cond);
+            pthread_mutex_unlock(&android_app->mutex);
+            break;
+
+        case APP_CMD_TERM_WINDOW:
+            LOGI("APP_CMD_TERM_WINDOW\n");
+            pthread_mutex_lock(&android_app->mutex);
+            android_app->window = NULL;
+            pthread_cond_broadcast(&android_app->cond);
+            pthread_mutex_unlock(&android_app->mutex);
+            break;
+
+        case APP_CMD_RESUME:
+        case APP_CMD_START:
+        case APP_CMD_PAUSE:
+        case APP_CMD_STOP:
+            LOGI("activityState=%d\n", cmd);
+            pthread_mutex_lock(&android_app->mutex);
+            android_app->activityState = cmd;
+            pthread_cond_broadcast(&android_app->cond);
+            pthread_mutex_unlock(&android_app->mutex);
+            break;
+
+        case APP_CMD_CONFIG_CHANGED:
+            LOGI("APP_CMD_CONFIG_CHANGED\n");
+            AConfiguration_fromAssetManager(android_app->config,
+                    android_app->activity->assetManager);
+            print_cur_config(android_app);
+            break;
+
+        case APP_CMD_DESTROY:
+            LOGI("APP_CMD_DESTROY\n");
+            android_app->destroyRequested = 1;
+            break;
+    }
+}
+
+void android_app_post_exec_cmd(struct android_app* android_app, int8_t cmd) {
+    switch (cmd) {
+        case APP_CMD_TERM_WINDOW:
+            LOGI("APP_CMD_TERM_WINDOW\n");
+            pthread_mutex_lock(&android_app->mutex);
+            android_app->window = NULL;
+            pthread_cond_broadcast(&android_app->cond);
+            pthread_mutex_unlock(&android_app->mutex);
+            break;
+
+        case APP_CMD_SAVE_STATE:
+            LOGI("APP_CMD_SAVE_STATE\n");
+            pthread_mutex_lock(&android_app->mutex);
+            android_app->stateSaved = 1;
+            pthread_cond_broadcast(&android_app->cond);
+            pthread_mutex_unlock(&android_app->mutex);
+            break;
+
+        case APP_CMD_RESUME:
+            free_saved_state(android_app);
+            break;
+    }
+}
+
+void app_dummy() {
+
+}
+
+static void android_app_destroy(struct android_app* android_app) {
+    LOGI("android_app_destroy!");
+    free_saved_state(android_app);
+    pthread_mutex_lock(&android_app->mutex);
+    if (android_app->inputQueue != NULL) {
+        AInputQueue_detachLooper(android_app->inputQueue);
+    }
+    AConfiguration_delete(android_app->config);
+    android_app->destroyed = 1;
+    pthread_cond_broadcast(&android_app->cond);
+    pthread_mutex_unlock(&android_app->mutex);
+    // Can't touch android_app object after this.
+}
+
+static void process_input(struct android_app* app, struct android_poll_source* source) {
+    AInputEvent* event = NULL;
+    if (AInputQueue_getEvent(app->inputQueue, &event) >= 0) {
+        LOGI("New input event: type=%d\n", AInputEvent_getType(event));
+        if (AInputQueue_preDispatchEvent(app->inputQueue, event)) {
+            return;
+        }
+        int32_t handled = 0;
+        if (app->onInputEvent != NULL) handled = app->onInputEvent(app, event);
+        AInputQueue_finishEvent(app->inputQueue, event, handled);
+    } else {
+        LOGI("Failure reading next input event: %s\n", strerror(errno));
+    }
+}
+
+static void process_cmd(struct android_app* app, struct android_poll_source* source) {
+    int8_t cmd = android_app_read_cmd(app);
+    android_app_pre_exec_cmd(app, cmd);
+    if (app->onAppCmd != NULL) app->onAppCmd(app, cmd);
+    android_app_post_exec_cmd(app, cmd);
+}
+
+static void* android_app_entry(void* param) {
+    struct android_app* android_app = (struct android_app*)param;
+
+    android_app->config = AConfiguration_new();
+    AConfiguration_fromAssetManager(android_app->config, android_app->activity->assetManager);
+
+    print_cur_config(android_app);
+
+    android_app->cmdPollSource.id = LOOPER_ID_MAIN;
+    android_app->cmdPollSource.app = android_app;
+    android_app->cmdPollSource.process = process_cmd;
+    android_app->inputPollSource.id = LOOPER_ID_INPUT;
+    android_app->inputPollSource.app = android_app;
+    android_app->inputPollSource.process = process_input;
+
+    ALooper* looper = ALooper_prepare(ALOOPER_PREPARE_ALLOW_NON_CALLBACKS);
+    ALooper_addFd(looper, android_app->msgread, LOOPER_ID_MAIN, ALOOPER_EVENT_INPUT, NULL,
+            &android_app->cmdPollSource);
+    android_app->looper = looper;
+
+    pthread_mutex_lock(&android_app->mutex);
+    android_app->running = 1;
+    pthread_cond_broadcast(&android_app->cond);
+    pthread_mutex_unlock(&android_app->mutex);
+
+    android_main(android_app);
+
+    android_app_destroy(android_app);
+    return NULL;
+}
+
+// --------------------------------------------------------------------
+// Native activity interaction (called from main thread)
+// --------------------------------------------------------------------
+
+static struct android_app* android_app_create(ANativeActivity* activity,
+        void* savedState, size_t savedStateSize) {
+    struct android_app* android_app = (struct android_app*)malloc(sizeof(struct android_app));
+    memset(android_app, 0, sizeof(struct android_app));
+    android_app->activity = activity;
+
+    pthread_mutex_init(&android_app->mutex, NULL);
+    pthread_cond_init(&android_app->cond, NULL);
+
+    if (savedState != NULL) {
+        android_app->savedState = malloc(savedStateSize);
+        android_app->savedStateSize = savedStateSize;
+        memcpy(android_app->savedState, savedState, savedStateSize);
+    }
+
+    int msgpipe[2];
+    if (pipe(msgpipe)) {
+        LOGI("could not create pipe: %s", strerror(errno));
+    }
+    android_app->msgread = msgpipe[0];
+    android_app->msgwrite = msgpipe[1];
+
+    pthread_attr_t attr; 
+    pthread_attr_init(&attr);
+    pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+    pthread_create(&android_app->thread, &attr, android_app_entry, android_app);
+
+    // Wait for thread to start.
+    pthread_mutex_lock(&android_app->mutex);
+    while (!android_app->running) {
+        pthread_cond_wait(&android_app->cond, &android_app->mutex);
+    }
+    pthread_mutex_unlock(&android_app->mutex);
+
+    return android_app;
+}
+
+static void android_app_write_cmd(struct android_app* android_app, int8_t cmd) {
+    if (write(android_app->msgwrite, &cmd, sizeof(cmd)) != sizeof(cmd)) {
+        LOGI("Failure writing android_app cmd: %s\n", strerror(errno));
+    }
+}
+
+static void android_app_set_input(struct android_app* android_app, AInputQueue* inputQueue) {
+    pthread_mutex_lock(&android_app->mutex);
+    android_app->pendingInputQueue = inputQueue;
+    android_app_write_cmd(android_app, APP_CMD_INPUT_CHANGED);
+    while (android_app->inputQueue != android_app->pendingInputQueue) {
+        pthread_cond_wait(&android_app->cond, &android_app->mutex);
+    }
+    pthread_mutex_unlock(&android_app->mutex);
+}
+
+static void android_app_set_window(struct android_app* android_app, ANativeWindow* window) {
+    pthread_mutex_lock(&android_app->mutex);
+    if (android_app->pendingWindow != NULL) {
+        android_app_write_cmd(android_app, APP_CMD_TERM_WINDOW);
+    }
+    android_app->pendingWindow = window;
+    if (window != NULL) {
+        android_app_write_cmd(android_app, APP_CMD_INIT_WINDOW);
+    }
+    while (android_app->window != android_app->pendingWindow) {
+        pthread_cond_wait(&android_app->cond, &android_app->mutex);
+    }
+    pthread_mutex_unlock(&android_app->mutex);
+}
+
+static void android_app_set_activity_state(struct android_app* android_app, int8_t cmd) {
+    pthread_mutex_lock(&android_app->mutex);
+    android_app_write_cmd(android_app, cmd);
+    while (android_app->activityState != cmd) {
+        pthread_cond_wait(&android_app->cond, &android_app->mutex);
+    }
+    pthread_mutex_unlock(&android_app->mutex);
+}
+
+static void android_app_free(struct android_app* android_app) {
+    pthread_mutex_lock(&android_app->mutex);
+    android_app_write_cmd(android_app, APP_CMD_DESTROY);
+    while (!android_app->destroyed) {
+        pthread_cond_wait(&android_app->cond, &android_app->mutex);
+    }
+    pthread_mutex_unlock(&android_app->mutex);
+
+    close(android_app->msgread);
+    close(android_app->msgwrite);
+    pthread_cond_destroy(&android_app->cond);
+    pthread_mutex_destroy(&android_app->mutex);
+    free(android_app);
+}
+
+static void onDestroy(ANativeActivity* activity) {
+    LOGI("Destroy: %p\n", activity);
+    android_app_free((struct android_app*)activity->instance);
+}
+
+static void onStart(ANativeActivity* activity) {
+    LOGI("Start: %p\n", activity);
+    android_app_set_activity_state((struct android_app*)activity->instance, APP_CMD_START);
+}
+
+static void onResume(ANativeActivity* activity) {
+    LOGI("Resume: %p\n", activity);
+    android_app_set_activity_state((struct android_app*)activity->instance, APP_CMD_RESUME);
+}
+
+static void* onSaveInstanceState(ANativeActivity* activity, size_t* outLen) {
+    struct android_app* android_app = (struct android_app*)activity->instance;
+    void* savedState = NULL;
+
+    LOGI("SaveInstanceState: %p\n", activity);
+    pthread_mutex_lock(&android_app->mutex);
+    android_app->stateSaved = 0;
+    android_app_write_cmd(android_app, APP_CMD_SAVE_STATE);
+    while (!android_app->stateSaved) {
+        pthread_cond_wait(&android_app->cond, &android_app->mutex);
+    }
+
+    if (android_app->savedState != NULL) {
+        savedState = android_app->savedState;
+        *outLen = android_app->savedStateSize;
+        android_app->savedState = NULL;
+        android_app->savedStateSize = 0;
+    }
+
+    pthread_mutex_unlock(&android_app->mutex);
+
+    return savedState;
+}
+
+static void onPause(ANativeActivity* activity) {
+    LOGI("Pause: %p\n", activity);
+    android_app_set_activity_state((struct android_app*)activity->instance, APP_CMD_PAUSE);
+}
+
+static void onStop(ANativeActivity* activity) {
+    LOGI("Stop: %p\n", activity);
+    android_app_set_activity_state((struct android_app*)activity->instance, APP_CMD_STOP);
+}
+
+static void onConfigurationChanged(ANativeActivity* activity) {
+    struct android_app* android_app = (struct android_app*)activity->instance;
+    LOGI("ConfigurationChanged: %p\n", activity);
+    android_app_write_cmd(android_app, APP_CMD_CONFIG_CHANGED);
+}
+
+static void onLowMemory(ANativeActivity* activity) {
+    struct android_app* android_app = (struct android_app*)activity->instance;
+    LOGI("LowMemory: %p\n", activity);
+    android_app_write_cmd(android_app, APP_CMD_LOW_MEMORY);
+}
+
+static void onWindowFocusChanged(ANativeActivity* activity, int focused) {
+    LOGI("WindowFocusChanged: %p -- %d\n", activity, focused);
+    android_app_write_cmd((struct android_app*)activity->instance,
+            focused ? APP_CMD_GAINED_FOCUS : APP_CMD_LOST_FOCUS);
+}
+
+static void onNativeWindowCreated(ANativeActivity* activity, ANativeWindow* window) {
+    LOGI("NativeWindowCreated: %p -- %p\n", activity, window);
+    android_app_set_window((struct android_app*)activity->instance, window);
+}
+
+static void onNativeWindowDestroyed(ANativeActivity* activity, ANativeWindow* window) {
+    LOGI("NativeWindowDestroyed: %p -- %p\n", activity, window);
+    android_app_set_window((struct android_app*)activity->instance, NULL);
+}
+
+static void onInputQueueCreated(ANativeActivity* activity, AInputQueue* queue) {
+    LOGI("InputQueueCreated: %p -- %p\n", activity, queue);
+    android_app_set_input((struct android_app*)activity->instance, queue);
+}
+
+static void onInputQueueDestroyed(ANativeActivity* activity, AInputQueue* queue) {
+    LOGI("InputQueueDestroyed: %p -- %p\n", activity, queue);
+    android_app_set_input((struct android_app*)activity->instance, NULL);
+}
+
+void ANativeActivity_onCreate(ANativeActivity* activity,
+        void* savedState, size_t savedStateSize) {
+    LOGI("Creating: %p\n", activity);
+    activity->callbacks->onDestroy = onDestroy;
+    activity->callbacks->onStart = onStart;
+    activity->callbacks->onResume = onResume;
+    activity->callbacks->onSaveInstanceState = onSaveInstanceState;
+    activity->callbacks->onPause = onPause;
+    activity->callbacks->onStop = onStop;
+    activity->callbacks->onConfigurationChanged = onConfigurationChanged;
+    activity->callbacks->onLowMemory = onLowMemory;
+    activity->callbacks->onWindowFocusChanged = onWindowFocusChanged;
+    activity->callbacks->onNativeWindowCreated = onNativeWindowCreated;
+    activity->callbacks->onNativeWindowDestroyed = onNativeWindowDestroyed;
+    activity->callbacks->onInputQueueCreated = onInputQueueCreated;
+    activity->callbacks->onInputQueueDestroyed = onInputQueueDestroyed;
+
+    activity->instance = android_app_create(activity, savedState, savedStateSize);
+}
diff --git a/ndk/sources/android/native_app_glue/android_native_app_glue.h b/ndk/sources/android/native_app_glue/android_native_app_glue.h
new file mode 100644
index 0000000..1b8c1f1
--- /dev/null
+++ b/ndk/sources/android/native_app_glue/android_native_app_glue.h
@@ -0,0 +1,349 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef _ANDROID_NATIVE_APP_GLUE_H
+#define _ANDROID_NATIVE_APP_GLUE_H
+
+#include <poll.h>
+#include <pthread.h>
+#include <sched.h>
+
+#include <android/configuration.h>
+#include <android/looper.h>
+#include <android/native_activity.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * The native activity interface provided by <android/native_activity.h>
+ * is based on a set of application-provided callbacks that will be called
+ * by the Activity's main thread when certain events occur.
+ *
+ * This means that each one of this callbacks _should_ _not_ block, or they
+ * risk having the system force-close the application. This programming
+ * model is direct, lightweight, but constraining.
+ *
+ * The 'threaded_native_app' static library is used to provide a different
+ * execution model where the application can implement its own main event
+ * loop in a different thread instead. Here's how it works:
+ *
+ * 1/ The application must provide a function named "android_main()" that
+ *    will be called when the activity is created, in a new thread that is
+ *    distinct from the activity's main thread.
+ *
+ * 2/ android_main() receives a pointer to a valid "android_app" structure
+ *    that contains references to other important objects, e.g. the
+ *    ANativeActivity obejct instance the application is running in.
+ *
+ * 3/ the "android_app" object holds an ALooper instance that already
+ *    listens to two important things:
+ *
+ *      - activity lifecycle events (e.g. "pause", "resume"). See APP_CMD_XXX
+ *        declarations below.
+ *
+ *      - input events coming from the AInputQueue attached to the activity.
+ *
+ *    Each of these correspond to an ALooper identifier returned by
+ *    ALooper_pollOnce with values of LOOPER_ID_MAIN and LOOPER_ID_INPUT,
+ *    respectively.
+ *
+ *    Your application can use the same ALooper to listen to additional
+ *    file-descriptors.  They can either be callback based, or with return
+ *    identifiers starting with LOOPER_ID_USER.
+ *
+ * 4/ Whenever you receive a LOOPER_ID_MAIN or LOOPER_ID_INPUT event,
+ *    the returned data will point to an android_poll_source structure.  You
+ *    can call the process() function on it, and fill in android_app->onAppCmd
+ *    and android_app->onInputEvent to be called for your own processing
+ *    of the event.
+ *
+ *    Alternatively, you can call the low-level functions to read and process
+ *    the data directly...  look at the process_cmd() and process_input()
+ *    implementations in the glue to see how to do this.
+ *
+ * See the sample named "native-activity" that comes with the NDK with a
+ * full usage example.  Also look at the JavaDoc of NativeActivity.
+ */
+
+struct android_app;
+
+/**
+ * Data associated with an ALooper fd that will be returned as the "outData"
+ * when that source has data ready.
+ */
+struct android_poll_source {
+    // The identifier of this source.  May be LOOPER_ID_MAIN or
+    // LOOPER_ID_INPUT.
+    int32_t id;
+
+    // The android_app this ident is associated with.
+    struct android_app* app;
+
+    // Function to call to perform the standard processing of data from
+    // this source.
+    void (*process)(struct android_app* app, struct android_poll_source* source);
+};
+
+/**
+ * This is the interface for the standard glue code of a threaded
+ * application.  In this model, the application's code is running
+ * in its own thread separate from the main thread of the process.
+ * It is not required that this thread be associated with the Java
+ * VM, although it will need to be in order to make JNI calls any
+ * Java objects.
+ */
+struct android_app {
+    // The application can place a pointer to its own state object
+    // here if it likes.
+    void* userData;
+
+    // Fill this in with the function to process main app commands (APP_CMD_*)
+    void (*onAppCmd)(struct android_app* app, int32_t cmd);
+
+    // Fill this in with the function to process input events.  At this point
+    // the event has already been pre-dispatched, and it will be finished upon
+    // return.  Return 1 if you have handled the event, 0 for any default
+    // dispatching.
+    int32_t (*onInputEvent)(struct android_app* app, AInputEvent* event);
+
+    // The ANativeActivity object instance that this app is running in.
+    ANativeActivity* activity;
+
+    // The current configuration the app is running in.
+    AConfiguration* config;
+
+    // This is the last instance's saved state, as provided at creation time.
+    // It is NULL if there was no state.  You can use this as you need; the
+    // memory will remain around until you call android_app_exec_cmd() for
+    // APP_CMD_RESUME, at which point it will be freed and savedState set to NULL.
+    // These variables should only be changed when processing a APP_CMD_SAVE_STATE,
+    // at which point they will be initialized to NULL and you can malloc your
+    // state and place the information here.  In that case the memory will be
+    // freed for you later.
+    void* savedState;
+    size_t savedStateSize;
+
+    // The ALooper associated with the app's thread.
+    ALooper* looper;
+
+    // When non-NULL, this is the input queue from which the app will
+    // receive user input events.
+    AInputQueue* inputQueue;
+
+    // When non-NULL, this is the window surface that the app can draw in.
+    ANativeWindow* window;
+
+    // Current content rectangle of the window; this is the area where the
+    // window's content should be placed to be seen by the user.
+    ARect contentRect;
+
+    // Current state of the app's activity.  May be either APP_CMD_START,
+    // APP_CMD_RESUME, APP_CMD_PAUSE, or APP_CMD_STOP; see below.
+    int activityState;
+
+    // This is non-zero when the application's NativeActivity is being
+    // destroyed and waiting for the app thread to complete.
+    int destroyRequested;
+
+    // -------------------------------------------------
+    // Below are "private" implementation of the glue code.
+
+    pthread_mutex_t mutex;
+    pthread_cond_t cond;
+
+    int msgread;
+    int msgwrite;
+
+    pthread_t thread;
+
+    struct android_poll_source cmdPollSource;
+    struct android_poll_source inputPollSource;
+
+    int running;
+    int stateSaved;
+    int destroyed;
+    int redrawNeeded;
+    AInputQueue* pendingInputQueue;
+    ANativeWindow* pendingWindow;
+    ARect pendingContentRect;
+};
+
+enum {
+    /**
+     * Looper data ID of commands coming from the app's main thread, which
+     * is returned as an identifier from ALooper_pollOnce().  The data for this
+     * identifier is a pointer to an android_poll_source structure.
+     * These can be retrieved and processed with android_app_read_cmd()
+     * and android_app_exec_cmd().
+     */
+    LOOPER_ID_MAIN = 1,
+
+    /**
+     * Looper data ID of events coming from the AInputQueue of the
+     * application's window, which is returned as an identifier from
+     * ALooper_pollOnce().  The data for this identifier is a pointer to an
+     * android_poll_source structure.  These can be read via the inputQueue
+     * object of android_app.
+     */
+    LOOPER_ID_INPUT = 2,
+
+    /**
+     * Start of user-defined ALooper identifiers.
+     */
+    LOOPER_ID_USER = 3,
+};
+
+enum {
+    /**
+     * Command from main thread: the AInputQueue has changed.  Upon processing
+     * this command, android_app->inputQueue will be updated to the new queue
+     * (or NULL).
+     */
+    APP_CMD_INPUT_CHANGED,
+
+    /**
+     * Command from main thread: a new ANativeWindow is ready for use.  Upon
+     * receiving this command, android_app->window will contain the new window
+     * surface.
+     */
+    APP_CMD_INIT_WINDOW,
+
+    /**
+     * Command from main thread: the existing ANativeWindow needs to be
+     * terminated.  Upon receiving this command, android_app->window still
+     * contains the existing window; after calling android_app_exec_cmd
+     * it will be set to NULL.
+     */
+    APP_CMD_TERM_WINDOW,
+
+    /**
+     * Command from main thread: the current ANativeWindow has been resized.
+     * Please redraw with its new size.
+     */
+    APP_CMD_WINDOW_RESIZED,
+
+    /**
+     * Command from main thread: the system needs that the current ANativeWindow
+     * be redrawn.  You should redraw the window before handing this to
+     * android_app_exec_cmd() in order to avoid transient drawing glitches.
+     */
+    APP_CMD_WINDOW_REDRAW_NEEDED,
+
+    /**
+     * Command from main thread: the content area of the window has changed,
+     * such as from the soft input window being shown or hidden.  You can
+     * find the new content rect in android_app::contentRect.
+     */
+    APP_CMD_CONTENT_RECT_CHANGED,
+
+    /**
+     * Command from main thread: the app's activity window has gained
+     * input focus.
+     */
+    APP_CMD_GAINED_FOCUS,
+
+    /**
+     * Command from main thread: the app's activity window has lost
+     * input focus.
+     */
+    APP_CMD_LOST_FOCUS,
+
+    /**
+     * Command from main thread: the current device configuration has changed.
+     */
+    APP_CMD_CONFIG_CHANGED,
+
+    /**
+     * Command from main thread: the system is running low on memory.
+     * Try to reduce your memory use.
+     */
+    APP_CMD_LOW_MEMORY,
+
+    /**
+     * Command from main thread: the app's activity has been started.
+     */
+    APP_CMD_START,
+
+    /**
+     * Command from main thread: the app's activity has been resumed.
+     */
+    APP_CMD_RESUME,
+
+    /**
+     * Command from main thread: the app should generate a new saved state
+     * for itself, to restore from later if needed.  If you have saved state,
+     * allocate it with malloc and place it in android_app.savedState with
+     * the size in android_app.savedStateSize.  The will be freed for you
+     * later.
+     */
+    APP_CMD_SAVE_STATE,
+
+    /**
+     * Command from main thread: the app's activity has been paused.
+     */
+    APP_CMD_PAUSE,
+
+    /**
+     * Command from main thread: the app's activity has been stopped.
+     */
+    APP_CMD_STOP,
+
+    /**
+     * Command from main thread: the app's activity is being destroyed,
+     * and waiting for the app thread to clean up and exit before proceeding.
+     */
+    APP_CMD_DESTROY,
+};
+
+/**
+ * Call when ALooper_pollAll() returns LOOPER_ID_MAIN, reading the next
+ * app command message.
+ */
+int8_t android_app_read_cmd(struct android_app* android_app);
+
+/**
+ * Call with the command returned by android_app_read_cmd() to do the
+ * initial pre-processing of the given command.  You can perform your own
+ * actions for the command after calling this function.
+ */
+void android_app_pre_exec_cmd(struct android_app* android_app, int8_t cmd);
+
+/**
+ * Call with the command returned by android_app_read_cmd() to do the
+ * final post-processing of the given command.  You must have done your own
+ * actions for the command before calling this function.
+ */
+void android_app_post_exec_cmd(struct android_app* android_app, int8_t cmd);
+
+/**
+ * Dummy function you can call to ensure glue code isn't stripped.
+ */
+void app_dummy();
+
+/**
+ * This is the function that application code must implement, representing
+ * the main entry to the app.
+ */
+extern void android_main(struct android_app* app);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _ANDROID_NATIVE_APP_GLUE_H */
diff --git a/ndk/tests/dlclose-destruction/jni/Android.mk b/ndk/tests/dlclose-destruction/jni/Android.mk
new file mode 100644
index 0000000..09226c7
--- /dev/null
+++ b/ndk/tests/dlclose-destruction/jni/Android.mk
@@ -0,0 +1,12 @@
+# A small sample used to demonstrate static C++ destructors
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := libtest1
+LOCAL_SRC_FILES := libtest1.cpp
+include $(BUILD_SHARED_LIBRARY)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := test_dlclose_destruction
+LOCAL_SRC_FILES := main.c
+include $(BUILD_EXECUTABLE)
diff --git a/ndk/tests/dlclose-destruction/jni/Application.mk b/ndk/tests/dlclose-destruction/jni/Application.mk
new file mode 100644
index 0000000..22d188e
--- /dev/null
+++ b/ndk/tests/dlclose-destruction/jni/Application.mk
@@ -0,0 +1 @@
+APP_PLATFORM := android-9
diff --git a/ndk/tests/dlclose-destruction/jni/libtest1.cpp b/ndk/tests/dlclose-destruction/jni/libtest1.cpp
new file mode 100644
index 0000000..0544b2b
--- /dev/null
+++ b/ndk/tests/dlclose-destruction/jni/libtest1.cpp
@@ -0,0 +1,31 @@
+#include <stddef.h>
+#include "libtest1.h"
+
+class Foo
+{
+public:
+    Foo() { mAddress = NULL; }
+    void setAddress(int *px);
+    ~Foo();
+private:
+    int *mAddress;
+};
+
+void Foo::setAddress(int *px)
+{
+    mAddress = px;
+    *mAddress = 1;
+}
+
+Foo::~Foo()
+{
+    if (mAddress)
+        *mAddress = 2;
+}
+
+static Foo foo;
+
+extern "C" void test1_set(int *px)
+{
+    foo.setAddress(px);
+}
diff --git a/ndk/tests/dlclose-destruction/jni/libtest1.h b/ndk/tests/dlclose-destruction/jni/libtest1.h
new file mode 100644
index 0000000..6471332
--- /dev/null
+++ b/ndk/tests/dlclose-destruction/jni/libtest1.h
@@ -0,0 +1,21 @@
+#ifndef LIBTEST1_H
+#define LIBTEST1_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* define in libtest1, will be called dynamically through dlsym()
+ * by main.c. This function receives the address of an integer
+ * and sets its value to 1.
+ *
+ * when the library is unloaded, the value is set to 2 automatically
+ * by the destructor there.
+ */
+extern void test1_set(int *px);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* LIBTEST1_H */
diff --git a/ndk/tests/dlclose-destruction/jni/main.c b/ndk/tests/dlclose-destruction/jni/main.c
new file mode 100644
index 0000000..63c0a65
--- /dev/null
+++ b/ndk/tests/dlclose-destruction/jni/main.c
@@ -0,0 +1,48 @@
+#include <stdio.h>
+#include <dlfcn.h>
+
+typedef void (*test_func_t)(int *px);
+int  x;
+
+int main(void)
+{
+    void*  lib = dlopen("libtest1.so", RTLD_NOW);
+    test_func_t test_func;
+
+    if (lib == NULL) {
+        fprintf(stderr, "Can't load library: %s\n", dlerror());
+        return 1;
+    }
+
+    printf("Loaded !\n");
+
+    test_func = dlsym(lib, "test1_set");
+    if (test_func == NULL) {
+        fprintf(stderr, "Can't find test function\n");
+        return 2;
+    }
+
+    x = 0;
+    test_func(&x);
+
+    if (x == 1) {
+        printf("Test function called !\n");
+    } else {
+        fprintf(stderr, "Test function failed to set variable !\n");
+        return 3;
+    }
+
+    dlclose(lib);
+    printf("Unloaded !\n");
+
+    if (x == 2) {
+        printf("Test destructor called !\n");
+    } else if (x == 1) {
+        fprintf(stderr, "Test destructor was *not* called !\n");
+        return 4;
+    } else {
+        fprintf(stderr, "Test destructor called but returned invalid value (%d)\n", x);
+        return 5;
+    }
+    return 0;
+}
diff --git a/ndk/tests/prebuilt-library/jni/Android.mk b/ndk/tests/prebuilt-library/jni/Android.mk
new file mode 100644
index 0000000..e3d9cb5
--- /dev/null
+++ b/ndk/tests/prebuilt-library/jni/Android.mk
@@ -0,0 +1,31 @@
+LOCAL_PATH := $(call my-dir)
+
+# Define BUILD_FOO=1 to rebuild libfoo.so from scratch, then
+# copy obj/local/armeabi/libfoo.so to jni/libfoo.so
+#
+ifneq ($(BUILD_FOO),)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := foo
+LOCAL_SRC_FILES := foo/foo.c
+LOCAL_C_INCLUDES := $(LOCAL_PATH)/foo
+LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/foo
+include $(BUILD_SHARED_LIBRARY)
+
+else # not build libfoo.so, trying to use PREBUILT_SHARED_LIBRARY instead.
+
+# Note: the module is named foo-prebuilt, but the library is libfool.so !
+#
+include $(CLEAR_VARS)
+LOCAL_MODULE := foo-prebuilt
+LOCAL_SRC_FILES := libfoo.so
+LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/foo
+include $(PREBUILT_SHARED_LIBRARY)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := foo-user
+LOCAL_SRC_FILES := foo-user.c
+LOCAL_SHARED_LIBRARIES := foo-prebuilt
+include $(BUILD_SHARED_LIBRARY)
+
+endif
diff --git a/ndk/tests/prebuilt-library/jni/foo-user.c b/ndk/tests/prebuilt-library/jni/foo-user.c
new file mode 100644
index 0000000..acc453e
--- /dev/null
+++ b/ndk/tests/prebuilt-library/jni/foo-user.c
@@ -0,0 +1,6 @@
+#include "foo.h"
+
+int main(void)
+{
+    return foo();
+}
diff --git a/ndk/tests/prebuilt-library/jni/foo/foo.c b/ndk/tests/prebuilt-library/jni/foo/foo.c
new file mode 100644
index 0000000..a4758ad
--- /dev/null
+++ b/ndk/tests/prebuilt-library/jni/foo/foo.c
@@ -0,0 +1,6 @@
+#include "foo.h"
+
+int foo(void)
+{
+    return 42;
+}
diff --git a/ndk/tests/prebuilt-library/jni/foo/foo.h b/ndk/tests/prebuilt-library/jni/foo/foo.h
new file mode 100644
index 0000000..5b5c8f2
--- /dev/null
+++ b/ndk/tests/prebuilt-library/jni/foo/foo.h
@@ -0,0 +1,6 @@
+#ifndef FOO_FOO_H
+#define FOO_FOO_H
+
+extern int  foo(void);
+
+#endif /* FOO_FOO_H */
diff --git a/ndk/tests/prebuilt-library/jni/libfoo.so b/ndk/tests/prebuilt-library/jni/libfoo.so
new file mode 100755
index 0000000..d5c7c37
--- /dev/null
+++ b/ndk/tests/prebuilt-library/jni/libfoo.so
Binary files differ
diff --git a/ndk/tests/run-all.sh b/ndk/tests/run-all.sh
new file mode 100755
index 0000000..e413778
--- /dev/null
+++ b/ndk/tests/run-all.sh
@@ -0,0 +1,126 @@
+# Run all tests
+
+PROGDIR=`dirname $0`
+PROGDIR=`cd $PROGDIR && pwd`
+
+# Assume that we are under tests/
+# and that the samples will be under samples/ and platforms/android-N/samples/
+#
+ROOTDIR=`dirname $PROGDIR`
+#
+# Sanity checks:
+#
+if [ -z "$NDK" ] ; then
+    echo "ERROR: Please define NDK in your environment to point to the root of your NDK install."
+    exit 1
+fi
+
+if [ ! -d "$NDK" ] ; then
+    echo "ERROR: Your NDK variable does not point to a directory: $NDK"
+    exit 2
+fi
+
+if [ ! -f "$NDK/ndk-build" -o ! -f "$NDK/build/core/ndk-common.sh" ] ; then
+    echo "ERROR: Your NDK variable does not point to a valid NDK directory: $NDK"
+    exit 3
+fi
+
+if [ ! -d "$NDK/platforms" -o ! -d "$NDK/samples" ] ; then
+    echo "ERROR: Your NDK directory does not have 'platforms' or 'samples' directories."
+    echo "Please run $NDK/build/tools/build-platforms.sh first !"
+    exit 3
+fi
+
+#
+# Parse options
+#
+JOBS=
+while [ -n "$1" ]; do
+    opt="$1"
+    optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'`
+    case "$opt" in
+        --help|-h|-\?)
+            OPTION_HELP=yes
+            ;;
+        --verbose)
+            VERBOSE=yes
+            ;;
+        -j*)
+            JOBS="$opt"
+            shift
+            ;;
+        --jobs=*)
+            JOBS="-j$optarg"
+            ;;
+        -*) # unknown options
+            echo "ERROR: Unknown option '$opt', use --help for list of valid ones."
+            exit 1
+        ;;
+        *)  # Simply record parameter
+            if [ -z "$PARAMETERS" ] ; then
+                PARAMETERS="$opt"
+            else
+                PARAMETERS="$PARAMETERS $opt"
+            fi
+            ;;
+    esac
+    shift
+done
+
+if [ "$OPTION_HELP" = "yes" ] ; then
+    echo "Usage: $PROGNAME [options]"
+    echo ""
+    echo "Run all NDK automated tests at once."
+    echo ""
+    echo "Valid options:"
+    echo ""
+    echo "    --help|-h|-?      Print this help"
+    echo "    --verbose         Enable verbose mode"
+    echo "    -j<N> --jobs=<N>  Launch parallel builds"
+    echo ""
+    exit 0
+fi
+
+#
+# Create log file
+#
+MYLOG=/tmp/ndk-tests.log
+mkdir -p `dirname $MYLOG`
+rm -f $MYLOG
+echo "NDK automated tests log file" > $MYLOG
+
+if [ "$VERBOSE" = "yes" ] ; then
+run ()
+{
+    $NDK/ndk-build -B $JOBS 2>&1
+}
+else
+run ()
+{
+    $NDK/ndk-build -B $JOBS >> $MYLOG 2>&1
+}
+fi
+
+# Find sample directories
+SAMPLE_DIRS=`cd $ROOTDIR && ls -d samples/*`
+SAMPLE_DIRS="$SAMPLE_DIRS "`cd $ROOTDIR && ls -d platforms/android-*/samples/*`
+
+#
+# Rebuild all samples first
+# $1: sample name
+#
+build_sample ()
+{
+    echo "Building NDK sample: `basename $1`"
+    SAMPLEDIR=$ROOTDIR/$1
+    cd $SAMPLEDIR
+    run $NDK/ndk-build -B $JOBS
+    if [ $? != 0 ] ; then
+        echo "!!! BUILD FAILURE [$1]!!! See $MYLOG for details or use --verbose option!"
+        exit 1
+    fi
+}
+
+for DIR in $SAMPLE_DIRS; do
+    build_sample $DIR
+done
diff --git a/pdk/docs/porting/porting_toc.cs b/pdk/docs/porting/porting_toc.cs
index 02b18e3..ffa5675 100644
--- a/pdk/docs/porting/porting_toc.cs
+++ b/pdk/docs/porting/porting_toc.cs
@@ -22,6 +22,7 @@
 <li> <h2>Customization</h2>
   <ul>
     <li><a href="<?cs var:toroot ?>porting/customization.html">Customization</a></li>
+    <li><a href="<?cs var:toroot ?>porting/usersguide.html">Android User's Guide</a></li>
   </ul>
 </li>
 
diff --git a/pdk/docs/porting/usersguide.jd b/pdk/docs/porting/usersguide.jd
new file mode 100755
index 0000000..3a1ecfb
--- /dev/null
+++ b/pdk/docs/porting/usersguide.jd
@@ -0,0 +1,66 @@
+page.title=Android User's Guide Sources
+doc.type=porting
+@jd:body
+
+<div id="qv-wrapper">
+<div id="qv">
+<h2>Android User's Guide Sources</h2>
+<ul>
+<li><a href="http://dl.google.com/android/porting/userdocs/android-users-guide-220cc-100.zip">Android 2.2 <em>User's Guide</em></a></li>
+</ul>
+</div>
+</div>
+
+<p><a href="http://dl.google.com/android/porting/userdocs/android-users-guide-220cc-100.zip">This archive</a> contains Framemaker 9 source files, a PDF
+example, and some related files for the "Android User's Guide," version
+AUG-CC-220-100, which Google is releasing under the Creative Commons Attribution
+3.0 License:</p>
+
+<p>"Except as otherwise noted at <a
+href="http://code.google.com/policies.html#restrictions">http://code.google.com/
+policies.html#restrictions</a>, the contents of this manual is licensed under
+the Creative Commons Attribution 3.0 License, which is available at <a
+href="http://creativecommons.org/licenses/by/3.0/">http://creativecommons.org/
+licenses/by/3.0/</a>. When using this work in whole or in part, please attribute
+the work to Google Inc. No Google or third-party trademarks or brand features
+are included in this license."</p>
+
+<p>This book documents Android 2.2 as implemented for the Google Nexus
+One phone. By releasing the sources to this book under the Creative
+Commons Attibution 3.0 License, we hope that a wide variety of OEMs
+and developers will find some or all of these chapters helpful when
+documenting their own implementations of Android 2.2. You should be
+able to remove irrelevant chapters, add your own chapters, and rewrite
+some or all of the chapters you keep, as a quicker way to document
+your Android implementation than by starting from scratch.</p>
+
+<p>Keep these points in mind when working with these files:</p>
+
+<ul>
+<li>These source files were created in Adobe Framemaker 9: you will need
+Frame and know how to use it to make use of these files. If Frame is
+not convenient for you, you can copy text from the PDF document or
+explore a utility for converting these files into other formats.</li>
+
+<li>This book uses three fonts: GeneralGG, Droid Sans, and Expert Dingbats.</li>
+
+<li>GeneralGG is available for purchase from Hoefler &amp; Frere-Jones
+(<a
+href="http://www.typography.com/home/index.php">http://www.typography.com/home/index.php</a>).
+Helveticta is a good substitute if you don't want to buy or use 
+GeneralGG, which is Google's standard sans-serif font.</li>
+
+<li>Droid Sans and Expert Dingbats are included in the fonts directory:
+they are open source fonts. Droid Sans is used for screen text. Expert
+Dingbats is used for bullets.</li>
+
+<li>All variables for the book are set in the frontmatter.fm file.</li>
+
+<li>The hidden, conditional text "HTML" is used as part of Google's
+process for converting this book into Google Help Center doc format --
+you can safely ignore it.</li>
+
+<li>For more information, please contact <a
+href="mailto:userdocs@android.com">userdocs@android.com</a></li>
+
+</ul>
diff --git a/pdk/docs/source/git-repo.jd b/pdk/docs/source/git-repo.jd
index 245d7d9..8905780 100644
--- a/pdk/docs/source/git-repo.jd
+++ b/pdk/docs/source/git-repo.jd
@@ -31,7 +31,7 @@
 .
 <h3>
 Installing Repo <br></h3>
-$ curl http://android.git.kernel.org/repo ~/bin/repo <div>$ chmod a+x ~/bin/repo</div>
+$ curl http://android.git.kernel.org/repo &gt; ~/bin/repo <div>$ chmod a+x ~/bin/repo</div>
 $ mkdir <i>working-directory-name</i>
 <br>$ cd <i>working-directory-name <br></i>
 $ repo init-u git://android.git.kernel.org/platform/manifest.git <br><br><h3>
diff --git a/samples/AccelerometerPlay/Android.mk b/samples/AccelerometerPlay/Android.mk
new file mode 100644
index 0000000..e4b0ab9
--- /dev/null
+++ b/samples/AccelerometerPlay/Android.mk
@@ -0,0 +1,33 @@
+# Copyright (C) 2010 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+LOCAL_PATH:= $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_TAGS := samples
+
+# Only compile source java files in this apk.
+LOCAL_SRC_FILES := $(call all-java-files-under, src)
+
+LOCAL_PACKAGE_NAME := AccelerometerPlay
+
+LOCAL_SDK_VERSION := current
+
+LOCAL_AAPT_FLAGS = -c 120dpi -c 240dpi -c 160dpi
+
+include $(BUILD_PACKAGE)
+
+# Use the following include to make our test apk.
+include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/samples/AccelerometerPlay/AndroidManifest.xml b/samples/AccelerometerPlay/AndroidManifest.xml
new file mode 100644
index 0000000..5def875
--- /dev/null
+++ b/samples/AccelerometerPlay/AndroidManifest.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2010 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+      android:versionCode="1"
+      android:versionName="1.0" package="com.example.android.accelerometerplay">
+    <application android:icon="@drawable/icon" android:label="@string/app_name">
+        <activity android:name=".AccelerometerPlayActivity"
+                  android:label="@string/app_name"
+                  android:screenOrientation="portrait" android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.LAUNCHER" />
+            </intent-filter>
+        </activity>
+
+    </application>
+
+
+<uses-sdk android:minSdkVersion="5"></uses-sdk>
+<uses-permission android:name="android.permission.VIBRATE"></uses-permission>
+
+<uses-permission android:name="android.permission.WAKE_LOCK"></uses-permission>
+
+</manifest> 
\ No newline at end of file
diff --git a/tools/zoneinfo/tzdata2009s/MODULE_LICENSE_PUBLIC_DOMAIN b/samples/AccelerometerPlay/MODULE_LICENSE_APACHE2
similarity index 100%
copy from tools/zoneinfo/tzdata2009s/MODULE_LICENSE_PUBLIC_DOMAIN
copy to samples/AccelerometerPlay/MODULE_LICENSE_APACHE2
diff --git a/samples/AccelerometerPlay/NOTICE b/samples/AccelerometerPlay/NOTICE
new file mode 100644
index 0000000..c5b1efa
--- /dev/null
+++ b/samples/AccelerometerPlay/NOTICE
@@ -0,0 +1,190 @@
+
+   Copyright (c) 2005-2008, The Android Open Source Project
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
diff --git a/samples/AccelerometerPlay/res/drawable-hdpi/ball.png b/samples/AccelerometerPlay/res/drawable-hdpi/ball.png
new file mode 100644
index 0000000..e79e4d6
--- /dev/null
+++ b/samples/AccelerometerPlay/res/drawable-hdpi/ball.png
Binary files differ
diff --git a/samples/AccelerometerPlay/res/drawable-hdpi/icon.png b/samples/AccelerometerPlay/res/drawable-hdpi/icon.png
new file mode 100644
index 0000000..8074c4c
--- /dev/null
+++ b/samples/AccelerometerPlay/res/drawable-hdpi/icon.png
Binary files differ
diff --git a/samples/AccelerometerPlay/res/drawable-hdpi/wood.jpg b/samples/AccelerometerPlay/res/drawable-hdpi/wood.jpg
new file mode 100644
index 0000000..883f491
--- /dev/null
+++ b/samples/AccelerometerPlay/res/drawable-hdpi/wood.jpg
Binary files differ
diff --git a/samples/AccelerometerPlay/res/drawable-ldpi/icon.png b/samples/AccelerometerPlay/res/drawable-ldpi/icon.png
new file mode 100644
index 0000000..1095584
--- /dev/null
+++ b/samples/AccelerometerPlay/res/drawable-ldpi/icon.png
Binary files differ
diff --git a/samples/AccelerometerPlay/res/drawable-mdpi/icon.png b/samples/AccelerometerPlay/res/drawable-mdpi/icon.png
new file mode 100644
index 0000000..a07c69f
--- /dev/null
+++ b/samples/AccelerometerPlay/res/drawable-mdpi/icon.png
Binary files differ
diff --git a/samples/AccelerometerPlay/res/layout/main.xml b/samples/AccelerometerPlay/res/layout/main.xml
new file mode 100644
index 0000000..8166ca6
--- /dev/null
+++ b/samples/AccelerometerPlay/res/layout/main.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2010 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:orientation="vertical"
+    android:layout_width="fill_parent"
+    android:layout_height="fill_parent"
+    >
+</LinearLayout>
diff --git a/samples/AccelerometerPlay/res/values/strings.xml b/samples/AccelerometerPlay/res/values/strings.xml
new file mode 100644
index 0000000..6e3785e
--- /dev/null
+++ b/samples/AccelerometerPlay/res/values/strings.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2010 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<resources>
+    <string name="app_name">AccelerometerPlay</string>
+</resources>
diff --git a/samples/AccelerometerPlay/src/com/example/android/accelerometerplay/AccelerometerPlayActivity.java b/samples/AccelerometerPlay/src/com/example/android/accelerometerplay/AccelerometerPlayActivity.java
new file mode 100644
index 0000000..c9e840f
--- /dev/null
+++ b/samples/AccelerometerPlay/src/com/example/android/accelerometerplay/AccelerometerPlayActivity.java
@@ -0,0 +1,460 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.android.accelerometerplay;
+
+import android.app.Activity;
+import android.content.Context;
+import android.graphics.Bitmap;
+import android.graphics.BitmapFactory;
+import android.graphics.Canvas;
+import android.graphics.BitmapFactory.Options;
+import android.hardware.Sensor;
+import android.hardware.SensorEvent;
+import android.hardware.SensorEventListener;
+import android.hardware.SensorManager;
+import android.os.Bundle;
+import android.os.PowerManager;
+import android.os.PowerManager.WakeLock;
+import android.util.DisplayMetrics;
+import android.view.Display;
+import android.view.Surface;
+import android.view.View;
+import android.view.WindowManager;
+
+/**
+ * This is an example of using the accelerometer to integrate the device's
+ * acceleration to a position using the Verlet method. This is illustrated with
+ * a very simple particle system comprised of a few iron balls freely moving on
+ * an inclined wooden table. The inclination of the virtual table is controlled
+ * by the device's accelerometer.
+ * 
+ * @see SensorManager
+ * @see SensorEvent
+ * @see Sensor
+ */
+
+public class AccelerometerPlayActivity extends Activity {
+
+    private SimulationView mSimulationView;
+    private SensorManager mSensorManager;
+    private PowerManager mPowerManager;
+    private WindowManager mWindowManager;
+    private Display mDisplay;
+    private WakeLock mWakeLock;
+
+    /** Called when the activity is first created. */
+    @Override
+    public void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        // Get an instance of the SensorManager
+        mSensorManager = (SensorManager) getSystemService(SENSOR_SERVICE);
+
+        // Get an instance of the PowerManager
+        mPowerManager = (PowerManager) getSystemService(POWER_SERVICE);
+
+        // Get an instance of the WindowManager
+        mWindowManager = (WindowManager) getSystemService(WINDOW_SERVICE);
+        mDisplay = mWindowManager.getDefaultDisplay();
+
+        // Create a bright wake lock
+        mWakeLock = mPowerManager.newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK, getClass()
+                .getName());
+
+        // instantiate our simulation view and set it as the activity's content
+        mSimulationView = new SimulationView(this);
+        setContentView(mSimulationView);
+    }
+
+    @Override
+    protected void onResume() {
+        super.onResume();
+        /*
+         * when the activity is resumed, we acquire a wake-lock so that the
+         * screen stays on, since the user will likely not be fiddling with the
+         * screen or buttons.
+         */
+        mWakeLock.acquire();
+
+        // Start the simulation
+        mSimulationView.startSimulation();
+    }
+
+    @Override
+    protected void onPause() {
+        super.onPause();
+        /*
+         * When the activity is paused, we make sure to stop the simulation,
+         * release our sensor resources and wake locks
+         */
+
+        // Stop the simulation
+        mSimulationView.stopSimulation();
+
+        // and release our wake-lock
+        mWakeLock.release();
+    }
+
+    class SimulationView extends View implements SensorEventListener {
+        // diameter of the balls in meters
+        private static final float sBallDiameter = 0.004f;
+        private static final float sBallDiameter2 = sBallDiameter * sBallDiameter;
+
+        // friction of the virtual table and air
+        private static final float sFriction = 0.1f;
+
+        private Sensor mAccelerometer;
+        private long mLastT;
+        private float mLastDeltaT;
+
+        private float mXDpi;
+        private float mYDpi;
+        private float mMetersToPixelsX;
+        private float mMetersToPixelsY;
+        private Bitmap mBitmap;
+        private Bitmap mWood;
+        private float mXOrigin;
+        private float mYOrigin;
+        private float mSensorX;
+        private float mSensorY;
+        private long mSensorTimeStamp;
+        private long mCpuTimeStamp;
+        private float mHorizontalBound;
+        private float mVerticalBound;
+        private final ParticleSystem mParticleSystem = new ParticleSystem();
+
+        /*
+         * Each of our particle holds its previous and current position, its
+         * acceleration. for added realism each particle has its own friction
+         * coefficient.
+         */
+        class Particle {
+            private float mPosX;
+            private float mPosY;
+            private float mAccelX;
+            private float mAccelY;
+            private float mLastPosX;
+            private float mLastPosY;
+            private float mOneMinusFriction;
+
+            Particle() {
+                // make each particle a bit different by randomizing its
+                // coefficient of friction
+                final float r = ((float) Math.random() - 0.5f) * 0.2f;
+                mOneMinusFriction = 1.0f - sFriction + r;
+            }
+
+            public void computePhysics(float sx, float sy, float dT, float dTC) {
+                // Force of gravity applied to our virtual object
+                final float m = 1000.0f; // mass of our virtual object
+                final float gx = -sx * m;
+                final float gy = -sy * m;
+
+                /*
+                 * ·F = mA <=> A = ·F / m We could simplify the code by
+                 * completely eliminating "m" (the mass) from all the equations,
+                 * but it would hide the concepts from this sample code.
+                 */
+                final float invm = 1.0f / m;
+                final float ax = gx * invm;
+                final float ay = gy * invm;
+
+                /*
+                 * Time-corrected Verlet integration The position Verlet
+                 * integrator is defined as x(t+Æt) = x(t) + x(t) - x(t-Æt) +
+                 * a(t)Ætö2 However, the above equation doesn't handle variable
+                 * Æt very well, a time-corrected version is needed: x(t+Æt) =
+                 * x(t) + (x(t) - x(t-Æt)) * (Æt/Æt_prev) + a(t)Ætö2 We also add
+                 * a simple friction term (f) to the equation: x(t+Æt) = x(t) +
+                 * (1-f) * (x(t) - x(t-Æt)) * (Æt/Æt_prev) + a(t)Ætö2
+                 */
+                final float dTdT = dT * dT;
+                final float x = mPosX + mOneMinusFriction * dTC * (mPosX - mLastPosX) + mAccelX
+                        * dTdT;
+                final float y = mPosY + mOneMinusFriction * dTC * (mPosY - mLastPosY) + mAccelY
+                        * dTdT;
+                mLastPosX = mPosX;
+                mLastPosY = mPosY;
+                mPosX = x;
+                mPosY = y;
+                mAccelX = ax;
+                mAccelY = ay;
+            }
+
+            /*
+             * Resolving constraints and collisions with the Verlet integrator
+             * can be very simple, we simply need to move a colliding or
+             * constrained particle in such way that the constraint is
+             * satisfied.
+             */
+            public void resolveCollisionWithBounds() {
+                final float xmax = mHorizontalBound;
+                final float ymax = mVerticalBound;
+                final float x = mPosX;
+                final float y = mPosY;
+                if (x > xmax) {
+                    mPosX = xmax;
+                } else if (x < -xmax) {
+                    mPosX = -xmax;
+                }
+                if (y > ymax) {
+                    mPosY = ymax;
+                } else if (y < -ymax) {
+                    mPosY = -ymax;
+                }
+            }
+        }
+
+        /*
+         * A particle system is just a collection of particles
+         */
+        class ParticleSystem {
+            static final int NUM_PARTICLES = 15;
+            private Particle mBalls[] = new Particle[NUM_PARTICLES];
+
+            ParticleSystem() {
+                /*
+                 * Initially our particles have no speed or acceleration
+                 */
+                for (int i = 0; i < mBalls.length; i++) {
+                    mBalls[i] = new Particle();
+                }
+            }
+
+            /*
+             * Update the position of each particle in the system using the
+             * Verlet integrator.
+             */
+            private void updatePositions(float sx, float sy, long timestamp) {
+                final long t = timestamp;
+                if (mLastT != 0) {
+                    final float dT = (float) (t - mLastT) * (1.0f / 1000000000.0f);
+                    if (mLastDeltaT != 0) {
+                        final float dTC = dT / mLastDeltaT;
+                        final int count = mBalls.length;
+                        for (int i = 0; i < count; i++) {
+                            Particle ball = mBalls[i];
+                            ball.computePhysics(sx, sy, dT, dTC);
+                        }
+                    }
+                    mLastDeltaT = dT;
+                }
+                mLastT = t;
+            }
+
+            /*
+             * Performs one iteration of the simulation. First updating the
+             * position of all the particles and resolving the constraints and
+             * collisions.
+             */
+            public void update(float sx, float sy, long now) {
+                // update the system's positions
+                updatePositions(sx, sy, now);
+
+                // We do no more than a limited number of iterations
+                final int NUM_MAX_ITERATIONS = 10;
+
+                /*
+                 * Resolve collisions, each particle is tested against every
+                 * other particle for collision. If a collision is detected the
+                 * particle is moved away using a virtual spring of infinite
+                 * stiffness.
+                 */
+                boolean more = true;
+                final int count = mBalls.length;
+                for (int k = 0; k < NUM_MAX_ITERATIONS && more; k++) {
+                    more = false;
+                    for (int i = 0; i < count; i++) {
+                        Particle curr = mBalls[i];
+                        for (int j = i + 1; j < count; j++) {
+                            Particle ball = mBalls[j];
+                            float dx = ball.mPosX - curr.mPosX;
+                            float dy = ball.mPosY - curr.mPosY;
+                            float dd = dx * dx + dy * dy;
+                            // Check for collisions
+                            if (dd <= sBallDiameter2) {
+                                /*
+                                 * add a little bit of entropy, after nothing is
+                                 * perfect in the universe.
+                                 */
+                                dx += ((float) Math.random() - 0.5f) * 0.0001f;
+                                dy += ((float) Math.random() - 0.5f) * 0.0001f;
+                                dd = dx * dx + dy * dy;
+                                // simulate the spring
+                                final float d = (float) Math.sqrt(dd);
+                                final float c = (0.5f * (sBallDiameter - d)) / d;
+                                curr.mPosX -= dx * c;
+                                curr.mPosY -= dy * c;
+                                ball.mPosX += dx * c;
+                                ball.mPosY += dy * c;
+                                more = true;
+                            }
+                        }
+                        /*
+                         * Finally make sure the particle doesn't intersects
+                         * with the walls.
+                         */
+                        curr.resolveCollisionWithBounds();
+                    }
+                }
+            }
+
+            public int getParticleCount() {
+                return mBalls.length;
+            }
+
+            public float getPosX(int i) {
+                return mBalls[i].mPosX;
+            }
+
+            public float getPosY(int i) {
+                return mBalls[i].mPosY;
+            }
+        }
+
+        public void startSimulation() {
+            /*
+             * It is not necessary to get accelerometer events at a very high
+             * rate, by using a slower rate (SENSOR_DELAY_UI), we get an
+             * automatic low-pass filter, which "extracts" the gravity component
+             * of the acceleration. As an added benefit, we use less power and
+             * CPU resources.
+             */
+            mSensorManager.registerListener(this, mAccelerometer, SensorManager.SENSOR_DELAY_UI);
+        }
+
+        public void stopSimulation() {
+            mSensorManager.unregisterListener(this);
+        }
+
+        public SimulationView(Context context) {
+            super(context);
+            mAccelerometer = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);
+
+            DisplayMetrics metrics = new DisplayMetrics();
+            getWindowManager().getDefaultDisplay().getMetrics(metrics);
+            mXDpi = metrics.xdpi;
+            mYDpi = metrics.ydpi;
+            mMetersToPixelsX = mXDpi / 0.0254f;
+            mMetersToPixelsY = mYDpi / 0.0254f;
+
+            // rescale the ball so it's about 0.5 cm on screen
+            Bitmap ball = BitmapFactory.decodeResource(getResources(), R.drawable.ball);
+            final int dstWidth = (int) (sBallDiameter * mMetersToPixelsX + 0.5f);
+            final int dstHeight = (int) (sBallDiameter * mMetersToPixelsY + 0.5f);
+            mBitmap = Bitmap.createScaledBitmap(ball, dstWidth, dstHeight, true);
+
+            Options opts = new Options();
+            opts.inDither = true;
+            opts.inPreferredConfig = Bitmap.Config.RGB_565;
+            mWood = BitmapFactory.decodeResource(getResources(), R.drawable.wood, opts);
+        }
+
+        @Override
+        protected void onSizeChanged(int w, int h, int oldw, int oldh) {
+            // compute the origin of the screen relative to the origin of
+            // the bitmap
+            mXOrigin = (w - mBitmap.getWidth()) * 0.5f;
+            mYOrigin = (h - mBitmap.getHeight()) * 0.5f;
+            mHorizontalBound = ((w / mMetersToPixelsX - sBallDiameter) * 0.5f);
+            mVerticalBound = ((h / mMetersToPixelsY - sBallDiameter) * 0.5f);
+        }
+
+        @Override
+        public void onSensorChanged(SensorEvent event) {
+            if (event.sensor.getType() != Sensor.TYPE_ACCELEROMETER)
+                return;
+            /*
+             * record the accelerometer data, the event's timestamp as well as
+             * the current time. The latter is needed so we can calculate the
+             * "present" time during rendering. In this application, we need to
+             * take into account how the screen is rotated with respect to the
+             * sensors (which always return data in a coordinate space aligned
+             * to with the screen in its native orientation).
+             */
+
+            switch (mDisplay.getRotation()) {
+                case Surface.ROTATION_0:
+                    mSensorX = event.values[0];
+                    mSensorY = event.values[1];
+                    break;
+                case Surface.ROTATION_90:
+                    mSensorX = -event.values[1];
+                    mSensorY = event.values[0];
+                    break;
+                case Surface.ROTATION_180:
+                    mSensorX = -event.values[0];
+                    mSensorY = -event.values[1];
+                    break;
+                case Surface.ROTATION_270:
+                    mSensorX = event.values[1];
+                    mSensorY = -event.values[0];
+                    break;
+            }
+
+            mSensorTimeStamp = event.timestamp;
+            mCpuTimeStamp = System.nanoTime();
+        }
+
+        @Override
+        protected void onDraw(Canvas canvas) {
+
+            /*
+             * draw the background
+             */
+
+            canvas.drawBitmap(mWood, 0, 0, null);
+
+            /*
+             * compute the new position of our object, based on accelerometer
+             * data and present time.
+             */
+
+            final ParticleSystem particleSystem = mParticleSystem;
+            final long now = mSensorTimeStamp + (System.nanoTime() - mCpuTimeStamp);
+            final float sx = mSensorX;
+            final float sy = mSensorY;
+
+            particleSystem.update(sx, sy, now);
+
+            final float xc = mXOrigin;
+            final float yc = mYOrigin;
+            final float xs = mMetersToPixelsX;
+            final float ys = mMetersToPixelsY;
+            final Bitmap bitmap = mBitmap;
+            final int count = particleSystem.getParticleCount();
+            for (int i = 0; i < count; i++) {
+                /*
+                 * We transform the canvas so that the coordinate system matches
+                 * the sensors coordinate system with the origin in the center
+                 * of the screen and the unit is the meter.
+                 */
+
+                final float x = xc + particleSystem.getPosX(i) * xs;
+                final float y = yc - particleSystem.getPosY(i) * ys;
+                canvas.drawBitmap(bitmap, x, y, null);
+            }
+
+            // and make sure to redraw asap
+            invalidate();
+        }
+
+        @Override
+        public void onAccuracyChanged(Sensor sensor, int accuracy) {
+        }
+    }
+}
diff --git a/samples/AccessibilityService/Android.mk b/samples/AccessibilityService/Android.mk
new file mode 100644
index 0000000..e47b6f6
--- /dev/null
+++ b/samples/AccessibilityService/Android.mk
@@ -0,0 +1,12 @@
+LOCAL_PATH:= $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_TAGS := samples
+
+LOCAL_SRC_FILES := $(call all-subdir-java-files)
+
+LOCAL_PACKAGE_NAME := AccessibilityService
+
+LOCAL_SDK_VERSION := current
+
+include $(BUILD_PACKAGE)
diff --git a/samples/AccessibilityService/AndroidManifest.xml b/samples/AccessibilityService/AndroidManifest.xml
new file mode 100644
index 0000000..1b5f794
--- /dev/null
+++ b/samples/AccessibilityService/AndroidManifest.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!-- Copyright (C) 2010 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+      package="com.example.android.clockback"
+      android:versionCode="1"
+      android:versionName="1.0">
+
+    <uses-permission android:name="android.permission.VIBRATE" />
+
+    <application android:label="@string/clockback_setup_title">
+
+        <!-- We declare our service here -->
+        <service android:name=".ClockBackService">
+            <!-- This intent filter is a clue for the system that this is an accessibility service -->
+            <intent-filter>
+                <action android:name="android.accessibilityservice.AccessibilityService" />
+            </intent-filter>
+        </service>
+
+    </application>
+
+    <!-- Accessibility API appeared in SDK version 4 (Android 1.6) -->
+    <uses-sdk android:minSdkVersion="4" />
+
+</manifest>
diff --git a/samples/AccessibilityService/_index.html b/samples/AccessibilityService/_index.html
new file mode 100644
index 0000000..d6adbf2
--- /dev/null
+++ b/samples/AccessibilityService/_index.html
@@ -0,0 +1,120 @@
+<p>
+  This is an example of an accessibility service that provides custom feedback for the Clock application which comes by default with Android devices. It demonstrates the following key features of the Android accessibility APIs:
+</p>
+<ol>
+  <li>
+    Simple demonstration of how to use the accessibility APIs.
+  </li>
+  <li>
+    Hands-on example of various ways to utilize the accessibility API for providing alternative and complementary feedback.
+  </li>
+  <li>
+    Providing application specific feedback &mdash; the service handles only accessibility events from the Clock application.
+  </li>
+  <li>
+    Providing dynamic, context-dependent feedback &mdash; feedback type changes depending on the ringer mode.
+  </li>
+  <li>
+    Application specific UI enhancement &mdash; application domain knowledge is utilized to enhance the provided feedback.
+  </li>
+</ol>
+<p>
+  <strong>
+    Note: This code sample will work only on devices shipped with the default Clock application. If you are
+    running Android 1.6 of Android 2.0 you should enable first ClockBack and then TalkBack since in these
+    releases accessibility services are notified in the order of registration.
+  </strong>
+</p>
+<p>
+  Steps to exercise the ClockBack example:
+</p>
+<ol>
+  <li>
+    <ul>
+      <li>
+        <strong>Action:</strong> Enable accessibility and all default accessibility services:<br/>
+        Settings &rarr; Accessibility &rarr; select the Accessibility, TalkBack, KickBack, and SoundBack checkboxes
+      </li>
+      <li>
+        <strong>Result:</strong> The system provides spoken, audible, and haptic feedback.
+      </li>
+    </ul>
+  </li>
+  <li>
+    <ul>
+      <li>
+        <strong>Action:</strong> Explore the feedback provided by the system:<br/>
+        Poke around with the trackball.
+      </li>
+      <li>
+        <strong>Result:</strong> You are somehow familiar with the type of the provided feedback.
+      </li>
+    </ul>
+  </li>
+  <li>
+    <ul>
+      <li>
+        <strong>Action:</strong> Go to the Clock application and try to change the time of an alarm:<br/>
+        All applications &rarr; Clock &rarr; Alarms (left corner) &rarr; Select an alarm &rarr; Time &mdash; explore the plus, minus buttons, hour and minute edit boxes.
+      </li>
+      <li>
+        <strong>Result:</strong> The hour and minute edit boxes are announced without any clue which is the hour and which is the minute one (you can guess from the arrangement).
+      </li>
+    </ul>
+  </li>
+  <li>
+    <ul>
+      <li>
+        <strong>Action:</strong> Enable ClockBack:<br>
+        Settings &rarr; Accessibility &rarr; ClockBack &mdash; select the checkbox (assuming you have installed the APK).
+      </li>
+      <li>
+        <strong>Result:</strong> We have active accessibility service for providing application specific feedback for the Clock application.
+      </li>
+    </ul>
+  </li>
+  <li>
+    <ul>
+      <li>
+        <strong>Action:</strong> Go to the Clock application and try to change the time of an alarm:<br/>
+        All applications &rarr; Clock &rarr; Alarms (left corner) &rarr; Select an alarm &rarr; Time &mdash; explore the hour and minute edit boxes.
+      </li>
+      <li>
+        <strong>Result:</strong> The hour and minute edit boxes are now spoken. This is an example of application specific feedback that utilizes domain information to enhance the user experience.
+      </li>
+    </ul>
+  </li>
+  <li>
+    <ul>
+      <li>
+        <strong>Action:</strong> Set the ringer to vibration mode and explore the provided feedback:<br/>
+        Use the device button for reducing the ringer volume until it is in vibration mode. Move around the Clock application and outside of that application.
+      </li>
+      <li>
+        <strong>Result:</strong> The Clock application provides custom audible and default haptic feedback. The rest of the system provides the default feedback.
+      </li>
+    </ul>
+  </li>
+  <li>
+    <ul>
+      <li>
+        <strong>Action:</strong> Set the ringer to muted mode and explore the provided feedback:<br/>
+        Use the device button for reducing the ringer volume until it is in muted mode. Move around the Clock application and outside of that application.
+      </li>
+      <li>
+        <strong>Result:</strong> The Clock application provides only custom haptic feedback. The rest of the system provides the default feedback. Now we are providing custom context dependent feedback based on the device state (ringer mode).
+      </li>
+    </ul>
+  </li>
+  <li>
+    <ul>
+      <li>
+        <strong>Action:</strong> Write an accessibility service:<br/>
+        The <a href="http://code.google.com/p/eyes-free/">Eyes-Free open source project</a> has more accessibility-related resources. To contribute, visit the project page or post to the <a href="http://groups.google.com/group/eyes-free">mailing list</a>.
+      </li>
+      <li>
+        <strong>Result:</strong> One more cool application has been written.
+      </li>
+    </ul>
+  </li>
+</ol>
diff --git a/samples/AccessibilityService/res/raw/sound_ringer_normal.ogg b/samples/AccessibilityService/res/raw/sound_ringer_normal.ogg
new file mode 100644
index 0000000..959e398
--- /dev/null
+++ b/samples/AccessibilityService/res/raw/sound_ringer_normal.ogg
Binary files differ
diff --git a/samples/AccessibilityService/res/raw/sound_ringer_silent.ogg b/samples/AccessibilityService/res/raw/sound_ringer_silent.ogg
new file mode 100644
index 0000000..d3bb25e
--- /dev/null
+++ b/samples/AccessibilityService/res/raw/sound_ringer_silent.ogg
Binary files differ
diff --git a/samples/AccessibilityService/res/raw/sound_ringer_vibrate.ogg b/samples/AccessibilityService/res/raw/sound_ringer_vibrate.ogg
new file mode 100644
index 0000000..761e10f
--- /dev/null
+++ b/samples/AccessibilityService/res/raw/sound_ringer_vibrate.ogg
Binary files differ
diff --git a/samples/AccessibilityService/res/raw/sound_screen_off.ogg b/samples/AccessibilityService/res/raw/sound_screen_off.ogg
new file mode 100644
index 0000000..342733a
--- /dev/null
+++ b/samples/AccessibilityService/res/raw/sound_screen_off.ogg
Binary files differ
diff --git a/samples/AccessibilityService/res/raw/sound_screen_on.ogg b/samples/AccessibilityService/res/raw/sound_screen_on.ogg
new file mode 100644
index 0000000..bf3632e
--- /dev/null
+++ b/samples/AccessibilityService/res/raw/sound_screen_on.ogg
Binary files differ
diff --git a/samples/AccessibilityService/res/raw/sound_view_clicked.ogg b/samples/AccessibilityService/res/raw/sound_view_clicked.ogg
new file mode 100644
index 0000000..3fe25cf
--- /dev/null
+++ b/samples/AccessibilityService/res/raw/sound_view_clicked.ogg
Binary files differ
diff --git a/samples/AccessibilityService/res/raw/sound_view_focused_or_selected.ogg b/samples/AccessibilityService/res/raw/sound_view_focused_or_selected.ogg
new file mode 100644
index 0000000..0100d27
--- /dev/null
+++ b/samples/AccessibilityService/res/raw/sound_view_focused_or_selected.ogg
Binary files differ
diff --git a/samples/AccessibilityService/res/raw/sound_window_state_changed.ogg b/samples/AccessibilityService/res/raw/sound_window_state_changed.ogg
new file mode 100644
index 0000000..0fec9de
--- /dev/null
+++ b/samples/AccessibilityService/res/raw/sound_window_state_changed.ogg
Binary files differ
diff --git a/samples/AccessibilityService/res/values/strings.xml b/samples/AccessibilityService/res/values/strings.xml
new file mode 100644
index 0000000..a9913c2
--- /dev/null
+++ b/samples/AccessibilityService/res/values/strings.xml
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+
+    <!-- VALUES -->
+
+    <!-- Setting up the user interface vibration feedback service -->
+    <string name="clockback_setup_title">ClockBack</string>
+
+    <!-- String value for announcing the increase hours buttons -->
+    <string name="value_increase_hours">Increase hours</string>
+
+    <!-- String value for announcing the increase minutes buttons -->
+    <string name="value_increase_minutes">Increase minutes</string>
+
+    <!-- String value for announcing the decrease hours buttons -->
+    <string name="value_decrease_hours">Decrease hours</string>
+
+    <!-- String value for announcing the decrease minutes buttons -->
+    <string name="value_decrease_minutes">Decrease minutes</string>
+
+    <!-- String value for announcing one hour input -->
+    <string name="value_hour">hour</string>
+
+    <!-- String value for announcing the hours input -->
+    <string name="value_hours">hours</string>
+
+    <!-- String value for announcing one minute input -->
+    <string name="value_minute">minute</string>
+
+    <!-- String value for announcing the minutes input -->
+    <string name="value_minutes">minutes</string>
+
+    <!-- String value for announcing audible ringer mode -->
+    <string name="value_ringer_audible">Ringer audible</string>
+
+    <!-- String value for announcing vibrating ringer mode -->
+    <string name="value_ringer_vibrate">Ringer vibrate</string>
+
+    <!-- String value for announcing silent ringer mode-->
+    <string name="value_ringer_silent">Ringer silent</string>
+
+    <!-- TEMPLATES -->
+
+    <!-- String template for announcing the screen on -->
+    <string name="template_screen_on">Screen on. Volume %1$s percent.</string>
+
+    <!-- String template for announcing the screen off -->
+    <string name="template_screen_off">Screen off. Volume %1$s percent.</string>
+
+</resources>
diff --git a/samples/AccessibilityService/src/com/example/android/clockback/ClockBackService.java b/samples/AccessibilityService/src/com/example/android/clockback/ClockBackService.java
new file mode 100644
index 0000000..5746716
--- /dev/null
+++ b/samples/AccessibilityService/src/com/example/android/clockback/ClockBackService.java
@@ -0,0 +1,701 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.android.clockback;
+
+import android.accessibilityservice.AccessibilityService;
+import android.accessibilityservice.AccessibilityServiceInfo;
+import android.app.Service;
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+import android.content.IntentFilter;
+import android.media.AudioManager;
+import android.os.Handler;
+import android.os.Message;
+import android.os.Vibrator;
+import android.speech.tts.TextToSpeech;
+import android.util.Log;
+import android.util.SparseArray;
+import android.view.accessibility.AccessibilityEvent;
+
+import java.util.List;
+
+/**
+ * This class is an {@link AccessibilityService} that provides custom feedback
+ * for the Clock application that comes by default with Android devices. It
+ * demonstrates the following key features of the Android accessibility APIs:
+ * <ol>
+ *   <li>
+ *     Simple demonstration of how to use the accessibility APIs.
+ *   </li>
+ *   <li>
+ *     Hands-on example of various ways to utilize the accessibility API for
+ *     providing alternative and complementary feedback.
+ *   </li>
+ *   <li>
+ *     Providing application specific feedback &mdash; the service handles only
+ *     accessibility events from the clock application.
+ *   </li>
+ *   <li>
+ *     Providing dynamic, context-dependent feedback &mdash; feedback type changes
+ *     depending on the ringer state.
+ *   </li>
+ *   <li>
+ *     Application specific UI enhancement - application domain knowledge is
+ *     utilized to enhance the provided feedback.
+ *   </li>
+ * </ol>
+ * <p>
+ *   <strong>
+ *     Note: This code sample will work only on devices shipped with the default Clock
+ *     application. If you are running Android 1.6 of Android 2.0 you should enable first
+ *     ClockBack and then TalkBack since in these releases accessibility services are
+ *     notified in the order of registration.
+ *   </strong>
+ * </p>
+ */
+public class ClockBackService extends AccessibilityService {
+
+    /** Tag for logging from this service. */
+    private static final String LOG_TAG = "ClockBackService";
+
+    // Fields for configuring how the system handles this accessibility service.
+
+    /** Minimal timeout between accessibility events we want to receive. */
+    private static final int EVENT_NOTIFICATION_TIMEOUT_MILLIS = 80;
+
+    /** Packages we are interested in.
+     * <p>
+     *   <strong>
+     *   Note: This code sample will work only on devices shipped with the
+     *   default Clock application.
+     *   </strong>
+     * </p>
+     */
+    // This works with AlarmClock and Clock whose package name changes in different releases
+    private static final String[] PACKAGE_NAMES = new String[] {
+            "com.android.alarmclock", "com.google.android.deskclock", "com.android.deskclock"
+    };
+
+    // Message types we are passing around.
+
+    /** Speak. */
+    private static final int MESSAGE_SPEAK = 1;
+
+    /** Stop speaking. */
+    private static final int MESSAGE_STOP_SPEAK = 2;
+
+    /** Start the TTS service. */
+    private static final int MESSAGE_START_TTS = 3;
+
+    /** Stop the TTS service. */
+    private static final int MESSAGE_SHUTDOWN_TTS = 4;
+
+    /** Play an earcon. */
+    private static final int MESSAGE_PLAY_EARCON = 5;
+
+    /** Stop playing an earcon. */
+    private static final int MESSAGE_STOP_PLAY_EARCON = 6;
+
+    /** Vibrate a pattern. */
+    private static final int MESSAGE_VIBRATE = 7;
+
+    /** Stop vibrating. */
+    private static final int MESSAGE_STOP_VIBRATE = 8;
+
+    // Screen state broadcast related constants.
+
+    /** Feedback mapping index used as a key for the screen-on broadcast. */
+    private static final int INDEX_SCREEN_ON = 0x00000100;
+
+    /** Feedback mapping index used as a key for the screen-off broadcast. */
+    private static final int INDEX_SCREEN_OFF = 0x00000200;
+
+    // Ringer mode change related constants.
+
+    /** Feedback mapping index used as a key for normal ringer mode. */
+    private static final int INDEX_RINGER_NORMAL = 0x00000400;
+
+    /** Feedback mapping index used as a key for vibration ringer mode. */
+    private static final int INDEX_RINGER_VIBRATE = 0x00000800;
+
+    /** Feedback mapping index used as a key for silent ringer mode. */
+    private static final int INDEX_RINGER_SILENT = 0x00001000;
+
+    // Speech related constants.
+
+    /**
+     * The queuing mode we are using - interrupt a spoken utterance before
+     * speaking another one.
+     */
+    private static final int QUEUING_MODE_INTERRUPT = 2;
+
+    /** The space string constant. */
+    private static final String SPACE = " ";
+
+    /**
+     * The class name of the number picker buttons with no text we want to
+     * announce in the Clock application.
+     */
+    private static final String CLASS_NAME_NUMBER_PICKER_BUTTON_CLOCK = "android.widget.NumberPickerButton";
+
+    /**
+     * The class name of the number picker buttons with no text we want to
+     * announce in the AlarmClock application.
+     */
+    private static final String CLASS_NAME_NUMBER_PICKER_BUTTON_ALARM_CLOCK = "com.android.internal.widget.NumberPickerButton";
+
+    /**
+     * The class name of the edit text box for hours and minutes we want to
+     * better announce.
+     */
+    private static final String CLASS_NAME_EDIT_TEXT = "android.widget.EditText";
+
+    /**
+     * Mapping from integer to string resource id where the keys are generated
+     * from the {@link AccessibilityEvent#getText()},
+     * {@link AccessibilityEvent#getItemCount()} and
+     * {@link AccessibilityEvent#getCurrentItemIndex()} properties.
+     * <p>
+     * Note: In general, computing these mappings includes the widget position on
+     * the screen. This is fragile and should be used as a last resort since
+     * changing the layout could potentially change the widget position. This is
+     * a workaround since the widgets of interest are image buttons that do not
+     * have contentDescription attribute set (plus/minus buttons) or no other
+     * information in the accessibility event is available to distinguish them
+     * aside of their positions on the screen (hour/minute inputs).<br/>
+     * If you are owner of the target application (Clock in this case) you
+     * should add contentDescription attribute to all image buttons such that a
+     * screen reader knows how to speak them. For input fields (while not
+     * applicable for the hour and minute inputs since they are not empty) a
+     * hint text should be set to enable better announcement.
+     * </p>
+     */
+    private static final SparseArray<Integer> sEventDataMappedStringResourceIds = new SparseArray<Integer>();
+    static {
+        sEventDataMappedStringResourceIds.put(110, R.string.value_increase_hours);
+        sEventDataMappedStringResourceIds.put(1140, R.string.value_increase_minutes);
+        sEventDataMappedStringResourceIds.put(1120, R.string.value_decrease_hours);
+        sEventDataMappedStringResourceIds.put(1160, R.string.value_decrease_minutes);
+        sEventDataMappedStringResourceIds.put(1111, R.string.value_hour);
+        sEventDataMappedStringResourceIds.put(1110, R.string.value_hours);
+        sEventDataMappedStringResourceIds.put(1151, R.string.value_minute);
+        sEventDataMappedStringResourceIds.put(1150, R.string.value_minutes);
+    }
+
+    /** Mapping from integers to vibration patterns for haptic feedback. */
+    private static final SparseArray<long[]> sVibrationPatterns = new SparseArray<long[]>();
+    static {
+        sVibrationPatterns.put(AccessibilityEvent.TYPE_VIEW_CLICKED, new long[] {
+                0L, 100L
+        });
+        sVibrationPatterns.put(AccessibilityEvent.TYPE_VIEW_LONG_CLICKED, new long[] {
+                0L, 100L
+        });
+        sVibrationPatterns.put(AccessibilityEvent.TYPE_VIEW_SELECTED, new long[] {
+                0L, 15L, 10L, 15L
+        });
+        sVibrationPatterns.put(AccessibilityEvent.TYPE_VIEW_FOCUSED, new long[] {
+                0L, 15L, 10L, 15L
+        });
+        sVibrationPatterns.put(AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED, new long[] {
+                0L, 25L, 50L, 25L, 50L, 25L
+        });
+        sVibrationPatterns.put(INDEX_SCREEN_ON, new long[] {
+                0L, 10L, 10L, 20L, 20L, 30L
+        });
+        sVibrationPatterns.put(INDEX_SCREEN_OFF, new long[] {
+                0L, 30L, 20L, 20L, 10L, 10L
+        });
+    }
+
+    /** Mapping from integers to raw sound resource ids. */
+    private static SparseArray<Integer> sSoundsResourceIds = new SparseArray<Integer>();
+    static {
+        sSoundsResourceIds.put(AccessibilityEvent.TYPE_VIEW_CLICKED, R.raw.sound_view_clicked);
+        sSoundsResourceIds.put(AccessibilityEvent.TYPE_VIEW_LONG_CLICKED, R.raw.sound_view_clicked);
+        sSoundsResourceIds.put(AccessibilityEvent.TYPE_VIEW_SELECTED, R.raw.sound_view_focused_or_selected);
+        sSoundsResourceIds.put(AccessibilityEvent.TYPE_VIEW_FOCUSED, R.raw.sound_view_focused_or_selected);
+        sSoundsResourceIds.put(AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED, R.raw.sound_window_state_changed);
+        sSoundsResourceIds.put(INDEX_SCREEN_ON, R.raw.sound_screen_on);
+        sSoundsResourceIds.put(INDEX_SCREEN_OFF, R.raw.sound_screen_off);
+        sSoundsResourceIds.put(INDEX_RINGER_SILENT, R.raw.sound_ringer_silent);
+        sSoundsResourceIds.put(INDEX_RINGER_VIBRATE, R.raw.sound_ringer_vibrate);
+        sSoundsResourceIds.put(INDEX_RINGER_NORMAL, R.raw.sound_ringer_normal);
+    }
+
+    // Sound pool related member fields.
+
+    /** Mapping from integers to earcon names - dynamically populated. */
+    private final SparseArray<String> mEarconNames = new SparseArray<String>();
+
+    // Auxiliary fields.
+
+    /**
+     * Handle to this service to enable inner classes to access the {@link Context}.
+     */
+    Context mContext;
+
+    /** The feedback this service is currently providing. */
+    int mProvidedFeedbackType;
+
+    /** Reusable instance for building utterances. */
+    private final StringBuilder mUtterance = new StringBuilder();
+
+    // Feedback providing services.
+
+    /** The {@link TextToSpeech} used for speaking. */
+    private TextToSpeech mTts;
+
+    /** The {@link AudioManager} for detecting ringer state. */
+    private AudioManager mAudioManager;
+
+    /** Vibrator for providing haptic feedback. */
+    private Vibrator mVibrator;
+
+    /** Flag if the infrastructure is initialized. */
+    private boolean isInfrastructureInitialized;
+
+    /** {@link Handler} for executing messages on the service main thread. */
+    Handler mHandler = new Handler() {
+        @Override
+        public void handleMessage(Message message) {
+            switch (message.what) {
+                case MESSAGE_SPEAK:
+                    String utterance = (String) message.obj;
+                    mTts.speak(utterance, QUEUING_MODE_INTERRUPT, null);
+                    return;
+                case MESSAGE_STOP_SPEAK:
+                    mTts.stop();
+                    return;
+                case MESSAGE_START_TTS:
+                    mTts = new TextToSpeech(mContext, new TextToSpeech.OnInitListener() {
+                        public void onInit(int status) {
+                            // Register here since to add earcons the TTS must be initialized and
+                            // the receiver is called immediately with the current ringer mode.
+                            registerBroadCastReceiver();
+                        }
+                    });
+                    return;
+                case MESSAGE_SHUTDOWN_TTS:
+                    mTts.shutdown();
+                    return;
+                case MESSAGE_PLAY_EARCON:
+                    int resourceId = message.arg1;
+                    playEarcon(resourceId);
+                    return;
+                case MESSAGE_STOP_PLAY_EARCON:
+                    mTts.stop();
+                    return;
+                case MESSAGE_VIBRATE:
+                    int key = message.arg1;
+                    long[] pattern = sVibrationPatterns.get(key);
+                    mVibrator.vibrate(pattern, -1);
+                    return;
+                case MESSAGE_STOP_VIBRATE:
+                    mVibrator.cancel();
+                    return;
+            }
+        }
+    };
+
+    /**
+     * {@link BroadcastReceiver} for receiving updates for our context - device
+     * state.
+     */
+    private BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver() {
+        @Override
+        public void onReceive(Context context, Intent intent) {
+            String action = intent.getAction();
+
+            if (AudioManager.RINGER_MODE_CHANGED_ACTION.equals(action)) {
+                int ringerMode = intent.getIntExtra(AudioManager.EXTRA_RINGER_MODE,
+                        AudioManager.RINGER_MODE_NORMAL);
+                configureForRingerMode(ringerMode);
+            } else if (Intent.ACTION_SCREEN_ON.equals(action)) {
+                provideScreenStateChangeFeedback(INDEX_SCREEN_ON);
+            } else if (Intent.ACTION_SCREEN_OFF.equals(action)) {
+                provideScreenStateChangeFeedback(INDEX_SCREEN_OFF);
+            } else {
+                Log.w(LOG_TAG, "Registered for but not handling action " + action);
+            }
+        }
+
+        /**
+         * Provides feedback to announce the screen state change. Such a change
+         * is turning the screen on or off.
+         *
+         * @param feedbackIndex The index of the feedback in the statically
+         *            mapped feedback resources.
+         */
+        private void provideScreenStateChangeFeedback(int feedbackIndex) {
+            // We take a specific action depending on the feedback we currently provide.
+            switch (mProvidedFeedbackType) {
+                case AccessibilityServiceInfo.FEEDBACK_SPOKEN:
+                    String utterance = generateScreenOnOrOffUtternace(feedbackIndex);
+                    mHandler.obtainMessage(MESSAGE_SPEAK, utterance).sendToTarget();
+                    return;
+                case AccessibilityServiceInfo.FEEDBACK_AUDIBLE:
+                    mHandler.obtainMessage(MESSAGE_PLAY_EARCON, feedbackIndex, 0).sendToTarget();
+                    return;
+                case AccessibilityServiceInfo.FEEDBACK_HAPTIC:
+                    mHandler.obtainMessage(MESSAGE_VIBRATE, feedbackIndex, 0).sendToTarget();
+                    return;
+                default:
+                    throw new IllegalStateException("Unexpected feedback type "
+                            + mProvidedFeedbackType);
+            }
+        }
+    };
+
+    @Override
+    public void onServiceConnected() {
+        if (isInfrastructureInitialized) {
+            return;
+        }
+
+        mContext = this;
+
+        // Send a message to start the TTS.
+        mHandler.sendEmptyMessage(MESSAGE_START_TTS);
+
+        // Get the vibrator service.
+        mVibrator = (Vibrator) getSystemService(Service.VIBRATOR_SERVICE);
+
+        // Get the AudioManager and configure according the current ring mode.
+        mAudioManager = (AudioManager) getSystemService(Service.AUDIO_SERVICE);
+        // In Froyo the broadcast receiver for the ringer mode is called back with the
+        // current state upon registering but in Eclair this is not done so we poll here.
+        int ringerMode = mAudioManager.getRingerMode();
+        configureForRingerMode(ringerMode);
+
+        // We are in an initialized state now.
+        isInfrastructureInitialized = true;
+    }
+
+    @Override
+    public boolean onUnbind(Intent intent) {
+        if (isInfrastructureInitialized) {
+            // Stop the TTS service.
+            mHandler.sendEmptyMessage(MESSAGE_SHUTDOWN_TTS);
+
+            // Unregister the intent broadcast receiver.
+            if (mBroadcastReceiver != null) {
+                unregisterReceiver(mBroadcastReceiver);
+            }
+
+            // We are not in an initialized state anymore.
+            isInfrastructureInitialized = false;
+        }
+        return false;
+    }
+
+    /**
+     * Registers the phone state observing broadcast receiver.
+     */
+    private void registerBroadCastReceiver() {
+        // Create a filter with the broadcast intents we are interested in.
+        IntentFilter filter = new IntentFilter();
+        filter.addAction(AudioManager.RINGER_MODE_CHANGED_ACTION);
+        filter.addAction(Intent.ACTION_SCREEN_ON);
+        filter.addAction(Intent.ACTION_SCREEN_OFF);
+        // Register for broadcasts of interest.
+        registerReceiver(mBroadcastReceiver, filter, null, null);
+    }
+
+    /**
+     * Generates an utterance for announcing screen on and screen off.
+     *
+     * @param feedbackIndex The feedback index for looking up feedback value.
+     * @return The utterance.
+     */
+    private String generateScreenOnOrOffUtternace(int feedbackIndex) {
+        // Get the announce template.
+        int resourceId = (feedbackIndex == INDEX_SCREEN_ON) ? R.string.template_screen_on
+                : R.string.template_screen_off;
+        String template = mContext.getString(resourceId);
+
+        // Format the template with the ringer percentage.
+        int currentRingerVolume = mAudioManager.getStreamVolume(AudioManager.STREAM_RING);
+        int maxRingerVolume = mAudioManager.getStreamMaxVolume(AudioManager.STREAM_RING);
+        int volumePercent = (100 / maxRingerVolume) * currentRingerVolume;
+
+        // Let us round to five so it sounds better.
+        int adjustment = volumePercent % 10;
+        if (adjustment < 5) {
+            volumePercent -= adjustment;
+        } else if (adjustment > 5) {
+            volumePercent += (10 - adjustment);
+        }
+
+        return String.format(template, volumePercent);
+    }
+
+    /**
+     * Configures the service according to a ringer mode. Possible
+     * configurations:
+     * <p>
+     *   1. {@link AudioManager#RINGER_MODE_SILENT}<br/>
+     *   Goal:     Provide only custom haptic feedback.<br/>
+     *   Approach: Take over the haptic feedback by configuring this service to provide
+     *             such and do so. This way the system will not call the default haptic
+     *             feedback service KickBack.<br/>
+     *             Take over the audible and spoken feedback by configuring this
+     *             service to provide such feedback but not doing so. This way the system
+     *             will not call the default spoken feedback service TalkBack and the
+     *             default audible feedback service SoundBack.
+     * </p>
+     * <p>
+     *   2. {@link AudioManager#RINGER_MODE_VIBRATE}<br/>
+     *   Goal:     Provide custom audible and default haptic feedback.<br/>
+     *   Approach: Take over the audible feedback and provide custom one.<br/>
+     *             Take over the spoken feedback but do not provide such.<br/>
+     *             Let some other service provide haptic feedback (KickBack).
+     * </p>
+     * <p>
+     *   3. {@link AudioManager#RINGER_MODE_NORMAL}
+     *   Goal:     Provide custom spoken, default audible and default haptic feedback.<br/>
+     *   Approach: Take over the spoken feedback and provide custom one.<br/>
+     *             Let some other services provide audible feedback (SounBack) and haptic
+     *             feedback (KickBack).
+     * </p>
+     * Note: In the above description an assumption is made that all default feedback
+     *       services are enabled. Such services are TalkBack, SoundBack, and KickBack.
+     *       Also the feature of defining a service as the default for a given feedback
+     *       type will be available in Android 2.2 and above. For previous releases the package
+     *       specific accessibility service must be registered first i.e. checked in the
+     *       settings.
+     *
+     * @param ringerMode The device ringer mode.
+     */
+    private void configureForRingerMode(int ringerMode) {
+        if (ringerMode == AudioManager.RINGER_MODE_SILENT) {
+            // When the ringer is silent we want to provide only haptic feedback.
+            mProvidedFeedbackType = AccessibilityServiceInfo.FEEDBACK_HAPTIC;
+
+            // Take over the spoken and sound feedback so no such feedback is provided.
+            setServiceInfo(AccessibilityServiceInfo.FEEDBACK_HAPTIC
+                    | AccessibilityServiceInfo.FEEDBACK_SPOKEN
+                    | AccessibilityServiceInfo.FEEDBACK_AUDIBLE);
+
+            // Use only an earcon to announce ringer state change.
+            mHandler.obtainMessage(MESSAGE_PLAY_EARCON, INDEX_RINGER_SILENT, 0).sendToTarget();
+        } else if (ringerMode == AudioManager.RINGER_MODE_VIBRATE) {
+            // When the ringer is vibrating we want to provide only audible feedback.
+            mProvidedFeedbackType = AccessibilityServiceInfo.FEEDBACK_AUDIBLE;
+
+            // Take over the spoken feedback so no spoken feedback is provided.
+            setServiceInfo(AccessibilityServiceInfo.FEEDBACK_AUDIBLE
+                    | AccessibilityServiceInfo.FEEDBACK_SPOKEN);
+
+            // Use only an earcon to announce ringer state change.
+            mHandler.obtainMessage(MESSAGE_PLAY_EARCON, INDEX_RINGER_VIBRATE, 0).sendToTarget();
+        } else if (ringerMode == AudioManager.RINGER_MODE_NORMAL) {
+            // When the ringer is ringing we want to provide spoken feedback
+            // overriding the default spoken feedback.
+            mProvidedFeedbackType = AccessibilityServiceInfo.FEEDBACK_SPOKEN;
+            setServiceInfo(AccessibilityServiceInfo.FEEDBACK_SPOKEN);
+
+            // Use only an earcon to announce ringer state change.
+            mHandler.obtainMessage(MESSAGE_PLAY_EARCON, INDEX_RINGER_NORMAL, 0).sendToTarget();
+        }
+    }
+
+    /**
+     * Sets the {@link AccessibilityServiceInfo} which informs the system how to
+     * handle this {@link AccessibilityService}.
+     *
+     * @param feedbackType The type of feedback this service will provide.
+     * <p>
+     *   Note: The feedbackType parameter is an bitwise or of all
+     *   feedback types this service would like to provide.
+     * </p>
+     */
+    private void setServiceInfo(int feedbackType) {
+        AccessibilityServiceInfo info = new AccessibilityServiceInfo();
+        // We are interested in all types of accessibility events.
+        info.eventTypes = AccessibilityEvent.TYPES_ALL_MASK;
+        // We want to provide specific type of feedback.
+        info.feedbackType = feedbackType;
+        // We want to receive events in a certain interval.
+        info.notificationTimeout = EVENT_NOTIFICATION_TIMEOUT_MILLIS;
+        // We want to receive accessibility events only from certain packages.
+        info.packageNames = PACKAGE_NAMES;
+        setServiceInfo(info);
+    }
+
+    @Override
+    public void onAccessibilityEvent(AccessibilityEvent event) {
+        Log.i(LOG_TAG, mProvidedFeedbackType + " " + event.toString());
+
+        // Here we act according to the feedback type we are currently providing.
+        if (mProvidedFeedbackType == AccessibilityServiceInfo.FEEDBACK_SPOKEN) {
+            mHandler.obtainMessage(MESSAGE_SPEAK, formatUtterance(event)).sendToTarget();
+        } else if (mProvidedFeedbackType == AccessibilityServiceInfo.FEEDBACK_AUDIBLE) {
+            mHandler.obtainMessage(MESSAGE_PLAY_EARCON, event.getEventType(), 0).sendToTarget();
+        } else if (mProvidedFeedbackType == AccessibilityServiceInfo.FEEDBACK_HAPTIC) {
+            mHandler.obtainMessage(MESSAGE_VIBRATE, event.getEventType(), 0).sendToTarget();
+        } else {
+            throw new IllegalStateException("Unexpected feedback type " + mProvidedFeedbackType);
+        }
+    }
+
+    @Override
+    public void onInterrupt() {
+        // Here we act according to the feedback type we are currently providing.
+        if (mProvidedFeedbackType == AccessibilityServiceInfo.FEEDBACK_SPOKEN) {
+            mHandler.obtainMessage(MESSAGE_STOP_SPEAK).sendToTarget();
+        } else if (mProvidedFeedbackType == AccessibilityServiceInfo.FEEDBACK_AUDIBLE) {
+            mHandler.obtainMessage(MESSAGE_STOP_PLAY_EARCON).sendToTarget();
+        } else if (mProvidedFeedbackType == AccessibilityServiceInfo.FEEDBACK_HAPTIC) {
+            mHandler.obtainMessage(MESSAGE_STOP_VIBRATE).sendToTarget();
+        } else {
+            throw new IllegalStateException("Unexpected feedback type " + mProvidedFeedbackType);
+        }
+    }
+
+    /**
+     * Formats an utterance from an {@link AccessibilityEvent}.
+     *
+     * @param event The event from which to format an utterance.
+     * @return The formatted utterance.
+     */
+    private String formatUtterance(AccessibilityEvent event) {
+        StringBuilder utterance = mUtterance;
+
+        // Clear the utterance before appending the formatted text.
+        utterance.setLength(0);
+
+        List<CharSequence> eventText = event.getText();
+
+        // We try to get the event text if such.
+        if (!eventText.isEmpty()) {
+            for (CharSequence subText : eventText) {
+                // Make 01 pronounced as 1
+                if (subText.charAt(0) =='0') {
+                    subText = subText.subSequence(1, subText.length());
+                }
+                utterance.append(subText);
+                utterance.append(SPACE);
+            }
+
+            // Here we do a bit of enhancement of the UI presentation by using the semantic
+            // of the event source in the context of the Clock application.
+            if (event.getEventType() == AccessibilityEvent.TYPE_VIEW_FOCUSED
+                    && CLASS_NAME_EDIT_TEXT.equals(event.getClassName())) {
+                // If the source is an edit text box and we have a mapping based on
+                // its position in the items of the container parent of the event source
+                // we append that value as well. We say "XX hours" and "XX minutes".
+                String resourceValue = getEventDataMappedStringResource(event);
+                if (resourceValue != null) {
+                    utterance.append(resourceValue);
+                }
+            }
+
+            return utterance.toString();
+        }
+
+        // There is no event text but we try to get the content description which is
+        // an optional attribute for describing a view (typically used with ImageView).
+        CharSequence contentDescription = event.getContentDescription();
+        if (contentDescription != null) {
+            utterance.append(contentDescription);
+            return utterance.toString();
+        }
+
+        // No text and content description for the plus and minus buttons, so we lookup
+        // custom values based on the event's itemCount and currentItemIndex properties.
+        CharSequence className = event.getClassName();
+
+        if (event.getEventType() == AccessibilityEvent.TYPE_VIEW_FOCUSED
+                && (CLASS_NAME_NUMBER_PICKER_BUTTON_ALARM_CLOCK.equals(className)
+                || CLASS_NAME_NUMBER_PICKER_BUTTON_CLOCK.equals(className))) {
+            String resourceValue = getEventDataMappedStringResource(event);
+            utterance.append(resourceValue);
+        }
+
+        return utterance.toString();
+    }
+
+    /**
+     * Returns a string resource mapped based on the accessibility event
+     * data, specifically the
+     * {@link AccessibilityEvent#getText()},
+     * {@link AccessibilityEvent#getItemCount()}, and
+     * {@link AccessibilityEvent#getCurrentItemIndex()} properties.
+     *
+     * @param event The {@link AccessibilityEvent} to process.
+     * @return The mapped string if such exists, null otherwise.
+     */
+    private String getEventDataMappedStringResource(AccessibilityEvent event) {
+        int lookupIndex = computeLookupIndex(event);
+        int resourceId = sEventDataMappedStringResourceIds.get(lookupIndex);
+        return getString(resourceId);
+    }
+
+    /**
+     * Computes an index for looking up the custom text for views which either
+     * do not have text/content description or the position information
+     * is the only oracle for deciding from which widget was an accessibility
+     * event generated. The index is computed based on
+     * {@link AccessibilityEvent#getText()},
+     * {@link AccessibilityEvent#getItemCount()}, and
+     * {@link AccessibilityEvent#getCurrentItemIndex()} properties.
+     *
+     * @param event The event from which to compute the index.
+     * @return The lookup index.
+     */
+    private int computeLookupIndex(AccessibilityEvent event) {
+        int lookupIndex = event.getItemCount();
+        int divided = event.getCurrentItemIndex();
+
+        while (divided > 0) {
+            lookupIndex *= 10;
+            divided /= 10;
+        }
+
+        lookupIndex += event.getCurrentItemIndex();
+        lookupIndex *= 10;
+
+        // This is primarily for handling the zero hour/zero minutes cases
+        if (!event.getText().isEmpty()
+                && ("1".equals(event.getText().get(0).toString()) || "01".equals(event.getText()
+                        .get(0).toString()))) {
+            lookupIndex++;
+        }
+
+        return lookupIndex;
+    }
+
+    /**
+     * Plays an earcon given its id.
+     *
+     * @param earconId The id of the earcon to be played.
+     */
+    private void playEarcon(int earconId) {
+        String earconName = mEarconNames.get(earconId);
+        if (earconName == null) {
+            // We do not know the sound id, hence we need to load the sound.
+            int resourceId = sSoundsResourceIds.get(earconId);
+            earconName = "[" + earconId + "]";
+            mTts.addEarcon(earconName, getPackageName(), resourceId);
+            mEarconNames.put(earconId, earconName);
+        }
+
+        mTts.playEarcon(earconName, QUEUING_MODE_INTERRUPT, null);
+    }
+}
diff --git a/samples/Alarm/AndroidManifest.xml b/samples/Alarm/AndroidManifest.xml
new file mode 100644
index 0000000..6a7a831
--- /dev/null
+++ b/samples/Alarm/AndroidManifest.xml
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2010 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<!--
+    Declares the contents of this Android application. The xmlns:android
+    attribute brings in the Android platform namespace, and the
+    "package" attribute provides a unique name for the application.
+    If you use this file as a template in your own application, you must change
+    the package name from "com.example.android" to one that you own or have
+    control over.
+ -->
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+    package="com.example.android.newalarm"
+    android:versionCode="2"
+    android:versionName="2.0">
+    <!--
+        Declares the application, its icon, and its visible label
+     -->
+    <application
+        android:icon="@drawable/icon"
+        android:label="@string/app_name">
+        <!--
+            Declares the activity's class name and visible label. The leading "." indicates
+            that the name should be preceded by the application's Android package name.
+         -->
+        <activity
+            android:name=".AlarmActivity"
+            android:label="@string/app_name">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.LAUNCHER" />
+            </intent-filter>
+        </activity>
+        <service
+            android:name=".AlarmService"
+            android:label="@string/alarm_service"
+            android:process="com.example.android.newalarm">
+        </service>
+    </application>
+    <uses-sdk android:targetSdkVersion="4" android:minSdkVersion="3"/>
+</manifest>
diff --git a/samples/Alarm/_index.html b/samples/Alarm/_index.html
new file mode 100644
index 0000000..dff51ce
--- /dev/null
+++ b/samples/Alarm/_index.html
@@ -0,0 +1,29 @@
+<p>
+    This sample is a revised version of the AlarmService functionality included in the
+    ApiDemos sample application. It is used as the application under test
+    for the <a href="../AlarmServiceTest/index.html">Alarm Service Test</a>
+    sample test application.
+</p>
+<p>
+    This application demonstrates a simple Android service that is started when needed by
+    <code>Context.startService(Intent)</code> and stops itself when its work is done. You can
+    use this type of service to move long-running or periodic tasks into the background. For
+    example, you could use this type of service to perform data synchronization.
+</p>
+<p>
+    In the sample, the service simply runs for 15 seconds and then stops itself. The wait is
+    implemented in a separate thread that uses a thread-safe object. This illustrates how to
+    set up a service that runs multiple threads that depend on one or more objects that must be
+    made thread-safe.
+</p>
+<p>
+    The application also contains the <code>AlarmActivity</code> activity that is a client of the
+    service. You use the activity to control when the service starts and stops. By default, the
+    activity fires off the service every thirty seconds. In effect, the service starts after
+    thirty seconds, runs for 15 seconds, stops, and then runs again automatically in another
+    15 seconds. You also use the client to stop this cycle.
+</p>
+<p>
+    The test application <a href="tests/index.html">AlarmServiceTest</a>
+    shows you how to set up a test of this service.
+</p>
diff --git a/samples/Alarm/res/drawable/icon.png b/samples/Alarm/res/drawable/icon.png
new file mode 100644
index 0000000..5ae7701
--- /dev/null
+++ b/samples/Alarm/res/drawable/icon.png
Binary files differ
diff --git a/samples/Alarm/res/drawable/stat_sample.png b/samples/Alarm/res/drawable/stat_sample.png
new file mode 100755
index 0000000..6c9ba0a
--- /dev/null
+++ b/samples/Alarm/res/drawable/stat_sample.png
Binary files differ
diff --git a/samples/Alarm/res/layout/main.xml b/samples/Alarm/res/layout/main.xml
new file mode 100644
index 0000000..3d79e2b
--- /dev/null
+++ b/samples/Alarm/res/layout/main.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2010 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<!-- Demonstrates starting and stopping a local service.
+     See corresponding Java code com.android.sdk.app.LocalSerice.java. -->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:orientation="vertical"
+    android:padding="4dip"
+    android:gravity="center_horizontal"
+    android:layout_width="fill_parent"
+    android:layout_height="fill_parent">
+    <TextView
+        android:layout_width="fill_parent"
+        android:layout_height="wrap_content"
+        android:layout_weight="0"
+        android:paddingBottom="4dip"
+        android:text="@string/alarm_service"/>
+    <Button android:id="@+id/start_alarm"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:text="@string/start_alarm_service">
+        <requestFocus />
+    </Button>
+
+    <Button android:id="@+id/stop_alarm"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:text="@string/stop_alarm_service" />
+</LinearLayout>
+
diff --git a/samples/Alarm/res/values/strings.xml b/samples/Alarm/res/values/strings.xml
new file mode 100644
index 0000000..18a34cc
--- /dev/null
+++ b/samples/Alarm/res/values/strings.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2010 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+<resources>
+    <string name="app_name">Alarm</string>
+    <string name="alarm_service">
+        This shows how to schedule a repeating alarm that starts a service.</string>
+    <string name="start_alarm_service">Start Alarm Service</string>
+    <string name="stop_alarm_service">Stop Alarm Service</string>
+    <string name="repeating_started">
+        Repeating timer started. Starts AlarmService every 30 seconds.</string>
+    <string name="alarm_service_started">The sample service is running.</string>
+    <string name="alarm_service_label">Sample Alarm Service</string>
+    <string name="alarm_service_finished">The sample service is no longer running.</string>
+    <string name="repeating_stopped">
+        Repeating timer stopped. AlarmService will no longer be started.</string>
+</resources>
diff --git a/samples/Alarm/src/com/example/android/newalarm/AlarmActivity.java b/samples/Alarm/src/com/example/android/newalarm/AlarmActivity.java
new file mode 100644
index 0000000..d26507d
--- /dev/null
+++ b/samples/Alarm/src/com/example/android/newalarm/AlarmActivity.java
@@ -0,0 +1,133 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.android.newalarm;
+
+import android.app.Activity;
+import android.app.AlarmManager;
+import android.app.PendingIntent;
+import android.content.Intent;
+import android.os.SystemClock;
+import android.os.Bundle;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.widget.Button;
+import android.widget.Toast;
+
+/**
+ * This is the activity that controls AlarmService.
+ * <p>
+ * When the user clicks the "Start Alarm Service" button, it triggers a repeating countdown
+ * timer. Every thirty seconds, the timer starts AlarmService, which then runs for 15 seconds
+ * and shuts itself down.
+ * </p>
+ * <p>
+ * When the user clicks the "Stop Alarm Service" button, it stops the countdown timer.
+ * </p>
+ */
+
+public class AlarmActivity extends Activity {
+    // 30 seconds in milliseconds
+    private static final long THIRTY_SECONDS_MILLIS = 30 * 1000;
+
+    // An intent for AlarmService, to trigger it as if the Activity called startService().
+    private PendingIntent mAlarmSender;
+
+    // Contains a handle to the system alarm service
+    private AlarmManager mAlarmManager;
+
+    /**
+     * This method is called when Android starts the activity. It initializes the UI.
+     * <p>
+     * This method is automatically called when Android starts the Activity
+     * </p>
+     */
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        // Create a PendingIntent to trigger a startService() for AlarmService
+        mAlarmSender = PendingIntent.getService(  // set up an intent for a call to a service
+            AlarmActivity.this,  // the current context
+            0,  // request code (not used)
+            new Intent(AlarmActivity.this, AlarmService.class),  // A new Service intent
+            0   // flags (none are required for a service)
+        );
+
+        // Creates the main view
+        setContentView(R.layout.main);
+
+        // Finds the button that starts the repeating countdown timer
+        Button button = (Button)findViewById(R.id.start_alarm);
+
+        // Sets the listener for the start button
+        button.setOnClickListener(mStartAlarmListener);
+
+        // Finds the button that stops countdown timer
+        button = (Button)findViewById(R.id.stop_alarm);
+
+        // Sets the listener for the stop button
+        button.setOnClickListener(mStopAlarmListener);
+
+        // Gets the handle to the system alarm service
+        mAlarmManager = (AlarmManager)getSystemService(ALARM_SERVICE);
+    }
+
+    // Creates a new anonymous click listener for the start button. It starts the repeating
+    //  countdown timer.
+    private OnClickListener mStartAlarmListener = new OnClickListener() {
+        // Sets the callback for when the button is clicked
+        public void onClick(View v) {
+
+            // Sets the time when the alarm will first go off
+            // The Android AlarmManager uses this form of the current time.
+            long firstAlarmTime = SystemClock.elapsedRealtime();
+
+            // Sets a repeating countdown timer that triggers AlarmService
+            mAlarmManager.setRepeating(
+                AlarmManager.ELAPSED_REALTIME_WAKEUP, // based on time since last wake up
+                firstAlarmTime,  // sends the first alarm immediately
+                THIRTY_SECONDS_MILLIS,  // repeats every thirty seconds
+                mAlarmSender  // when the alarm goes off, sends this Intent
+            );
+
+            // Notifies the user that the repeating countdown timer has been started
+            Toast.makeText(
+                AlarmActivity.this,  //  the current context
+                R.string.repeating_started,  // the message to display
+                Toast.LENGTH_LONG  // how long to display the message
+            ).show();  // show the message on the screen
+        }
+    };
+
+    // Creates a new anonymous click listener for the stop button. It shuts off the repeating
+    // countdown timer.
+    private OnClickListener mStopAlarmListener = new OnClickListener() {
+        // Sets the callback for when the button is clicked
+        public void onClick(View v) {
+
+            // Cancels the repeating countdown timer
+            mAlarmManager.cancel(mAlarmSender);
+
+            // Notifies the user that the repeating countdown timer has been stopped
+            Toast.makeText(
+                AlarmActivity.this,  //  the current context
+                R.string.repeating_stopped,  // the message to display
+                Toast.LENGTH_LONG  // how long to display the message
+            ).show(); // display the message
+        }
+    };
+}
diff --git a/samples/Alarm/src/com/example/android/newalarm/AlarmService.java b/samples/Alarm/src/com/example/android/newalarm/AlarmService.java
new file mode 100644
index 0000000..1f88206
--- /dev/null
+++ b/samples/Alarm/src/com/example/android/newalarm/AlarmService.java
@@ -0,0 +1,216 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.android.newalarm;
+
+import android.app.Notification;
+import android.app.NotificationManager;
+import android.app.PendingIntent;
+import android.app.Service;
+import android.content.Intent;
+import android.os.Binder;
+import android.os.IBinder;
+import android.os.Parcel;
+import android.os.RemoteException;
+import android.widget.Toast;
+
+/**
+ * <p>
+ * This class implements a service. The service is started by AlarmActivity, which contains a
+ * repeating countdown timer that sends a PendingIntent. The user starts and stops the timer with
+ * buttons in the UI.
+ * </p>
+ * <p>
+ * When this service is started, it creates a Runnable and starts it in a new Thread. The
+ * Runnable does a synchronized lock on the service's Binder object for 15 seconds, then issues
+ * a stopSelf(). The net effect is a new worker thread that takes 15 seconds to run and then
+ * shuts down the entire service. The activity restarts the service after 15 more seconds, when the
+ * countdown timer triggers again.
+ * </p>
+ * <p>
+ * This service is provided as the service under test for the sample test application
+ * AlarmServiceTest.
+ * </p>
+ * <p>
+ * Note: Since this sample is based on the Android 1.5 platform, it does not implement
+ * onStartCommand. See the Javadoc for android.app.Service for more details.
+ * </p>
+ */
+public class AlarmService extends Service {
+    // Defines a label for the thread that this service starts
+    private static final String ALARM_SERVICE_THREAD = "AlarmService";
+
+    // Defines 15 seconds
+    public static final long WAIT_TIME_SECONDS = 15;
+
+    // Define the number of milliseconds in one second
+    public static final long MILLISECS_PER_SEC = 1000;
+
+    /*
+     * For testing purposes, the following variables are defined as fields and set to
+     * package visibility.
+     */
+
+    // The NotificationManager used to send notifications to the status bar.
+    NotificationManager mNotificationManager;
+
+    // An Intent that displays the client if the user clicks the notification.
+    PendingIntent mContentIntent;
+
+    // A Notification to send to the Notification Manager when the service is started.
+    Notification mNotification;
+
+    // A Binder, used as the lock object for the worker thread.
+    IBinder mBinder = new AlarmBinder();
+
+    // A Thread object that will run the background task
+    Thread mWorkThread;
+
+    // The Runnable that is the service's "task". This illustrates how a service is used to
+    // offload work from a client.
+    Runnable mWorkTask = new Runnable() {
+        public void run() {
+            // Sets the wait time to 15 seconds, simulating a 15-second background task.
+            long waitTime = System.currentTimeMillis() + WAIT_TIME_SECONDS * MILLISECS_PER_SEC;
+
+            // Puts the wait in a while loop to ensure that it actually waited 15 seconds.
+            // This covers the situation where an interrupt might have overridden the wait.
+            while (System.currentTimeMillis() < waitTime) {
+                // Waits for 15 seconds or interruption
+                synchronized (mBinder) {
+                    try {
+                        // Waits for 15 seconds or until an interrupt triggers an exception.
+                        // If an interrupt occurs, the wait is recalculated to ensure a net
+                        // wait of 15 seconds.
+                        mBinder.wait(waitTime - System.currentTimeMillis());
+                    } catch (InterruptedException e) {
+                    }
+                }
+            }
+            // Stops the current service. In response, Android calls onDestroy().
+            stopSelf();
+        }
+    };
+
+    /**
+     *  Makes a full concrete subclass of Binder, rather than doing it in line, for readability.
+     */
+    public class AlarmBinder extends Binder {
+        // Constructor. Calls the super constructor to set up the instance.
+        public AlarmBinder() {
+            super();
+        }
+
+        @Override
+        protected boolean onTransact(int code, Parcel data, Parcel reply, int flags)
+            throws RemoteException {
+
+            // Call the parent method with the arguments passed in
+            return super.onTransact(code, data, reply, flags);
+        }
+    }
+
+    /**
+     * Initializes the service when it is first started by a call to startService() or
+     * bindService().
+     */
+    @Override
+    public void onCreate() {
+        // Gets a handle to the system mNotification service.
+        mNotificationManager = (NotificationManager)getSystemService(NOTIFICATION_SERVICE);
+
+        // Updates the status bar to indicate that this service is running.
+        showNotification();
+
+        // Creates a new thread. A new thread is used so that the service's work doesn't block
+        // anything on the calling client's thread. By default, a service runs in the same
+        // process and thread as the client that starts it.
+        mWorkThread = new Thread(
+            null,  // threadgroup (in this case, null)
+            mWorkTask, // the Runnable that will run in this thread
+            ALARM_SERVICE_THREAD
+        );
+        // Starts the thread
+        mWorkThread.start();
+    }
+
+    /**
+     * Stops the service in response to the stopSelf() issued when the wait is over. Other
+     * clients that use this service could stop it by issuing a stopService() or a stopSelf() on
+     * the service object.
+     */
+    @Override
+    public void onDestroy() {
+        // Cancels the status bar mNotification based on its ID, which is set in showNotification().
+        mNotificationManager.cancel(R.string.alarm_service_started);
+
+        // Sends a notification to the screen.
+        Toast.makeText(
+            this,  // the current context
+            R.string.alarm_service_finished,  // the message to show
+            Toast.LENGTH_LONG   // how long to keep the message on the screen
+        ).show();  // show the text
+    }
+
+    // Returns the service's binder object to clients that issue onBind().
+    @Override
+    public IBinder onBind(Intent intent) {
+        return mBinder;
+    }
+
+    /**
+     * Displays a notification in the status bar that this service is running. This method
+     * also creates an Intent for the AlarmActivity client and attaches it to the notification
+     * line. If the user clicks the line in the expanded status window, the Intent triggers
+     * AlarmActivity.
+     */
+    private void showNotification() {
+        // Sets the text to use for the status bar and status list views.
+        CharSequence notificationText = getText(R.string.alarm_service_started);
+
+        // Sets the icon, status bar text, and display time for the mNotification.
+        mNotification = new Notification(
+            R.drawable.stat_sample,  // the status icon
+            notificationText, // the status text
+            System.currentTimeMillis()  // the time stamp
+        );
+
+        // Sets up the Intent that starts AlarmActivity
+        mContentIntent = PendingIntent.getActivity(
+            this,  // Start the Activity in the current context
+            0,   // not used
+            new Intent(this, AlarmActivity.class),  // A new Intent for AlarmActivity
+            0  // Use an existing activity instance if available
+        );
+
+        // Creates a new content view for the mNotification. The view appears when the user
+        // shows the expanded status window.
+        mNotification.setLatestEventInfo(
+            this,  //  Put the content view in the current context
+            getText(R.string.alarm_service_label),  // The text to use as the label of the entry
+            notificationText,  // The text to use as the contents of the entry
+            mContentIntent  // The intent to send when the entry is clicked
+        );
+
+        // Sets a unique ID for the notification and sends it to NotificationManager to be
+        // displayed. The ID is the integer marker for the notification string, which is
+        // guaranteed to be unique within the entire application.
+        mNotificationManager.notify(
+            R.string.alarm_service_started,  // unique id for the mNotification
+            mNotification   // the mNotification object
+        );
+    }
+}
diff --git a/samples/Alarm/tests/AndroidManifest.xml b/samples/Alarm/tests/AndroidManifest.xml
new file mode 100644
index 0000000..8688920
--- /dev/null
+++ b/samples/Alarm/tests/AndroidManifest.xml
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2010 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<!--
+    Declare the contents of this Android test package. The xmlns:android
+    attribute brings in the Android platform namespace, and the
+    "package" attribute provides a unique name for the package.
+    If you use this file as a template in your own test package, you must change
+    the package name from "com.example.android" to one that you own or have
+    control over.
+ -->
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+    package="com.example.android.newalarm.test"
+    android:versionCode="1"
+    android:versionName="1.0">
+    <!--
+        Must use the application element to include the uses-library element.
+     -->
+    <application>
+        <!--
+            Tells Android to include this library in the test package's class loader.
+            The test runner is not included by default in a manifest file.
+        -->
+        <uses-library android:name="android.test.runner" />
+    </application>
+    <!--
+        Specifies that the test package requires API platform level 3 (Android 1.5) or above.
+        The installer will not install this package onto a device or emulator that is running an
+        older platform version.
+     -->
+    <uses-sdk android:minSdkVersion="3" />
+    <!--
+        Declares the instrumentation for this application. The instrumentation class is
+        specified by the "name" attribute, and must name a subclass of
+        android.app.Instrumentation. The application that is run by the instrumentation object is
+        specified by the "targetPackage" attribute.
+     -->
+    <instrumentation
+        android:targetPackage="com.example.android.newalarm"
+        android:name="android.test.InstrumentationTestRunner" />
+</manifest>
diff --git a/samples/Alarm/tests/_index.html b/samples/Alarm/tests/_index.html
new file mode 100644
index 0000000..614125d
--- /dev/null
+++ b/samples/Alarm/tests/_index.html
@@ -0,0 +1,50 @@
+<p>
+    This sample is the test application for the <a href="../Alarm/index.html">Alarm</a>
+    sample application. It tests the application's <code>AlarmService</code> service.
+</p>
+<p>
+    The test application uses the
+    <a href="../../../reference/android/test/ServiceTestCase.html">
+    <code>ServiceTestCase</code></a>  test case class,
+    which extends the JUnit <a href="../../../reference/junit/framework/TestCase.html">
+    <code>TestCase</code></a> class. The test runner is
+    <a href="../../../reference/android/test/InstrumentationTestRunner.html">
+    <code>InstrumentationTestRunner</code></a>.
+</p>
+<p>
+    The application shows how to set up a test application project,
+    how to create the <a href="AndroidManifest.html"><code>AndroidManifest.xml</code></a>
+    file for a test application, and how to set up a test case class for a service. The
+    test case class, <a href="src/com/android/example/newalarm/ServiceAlarmTest.html">
+    <code>AlarmServiceTest</code></a>, contains tests that demonstrate the following
+    Android test patterns:
+</p>
+    <ul>
+        <li>
+            Test setup: The <code>setUp()</code> method re-initializes the state of the
+            service under test before each test is run.
+        </li>
+        <li>
+            Service start: The <code>Service.testServiceCreate()</code> test confirms that the
+            service starts correctly and initializes the variables it needs to provide its
+            services.
+        </li>
+    </ul>
+<p>
+    The <a href="AndroidManifest.html">manifest</a> declares an <code>&lt;instrumentation&gt;</code>
+    element that links the test application with the application under test. Specifically, the
+    element's <code>android:name</code> attribute specifies <code>InstrumentationTestRunner</code>
+    as the instrumentation to use. The <code>android:targetPackage</code> attribute specifies
+    <code>com.android.example.newalarm</code> as the name of the Android package that contains the
+    service under test.
+</p>
+<p class="note">
+    <strong>Note:</strong> <code>AlarmServiceTest.java</code> uses the Java package name
+    <code>com.example.android.newalarm</code>, which is the same package used by service under
+    test, <code>AlarmService.java</code>. This allows the test class to access members in the
+    service under test that are defined with package visibility. To prevent conflicts, though,
+    the generated java file <code>R.java</code> for <code>AlarmServiceTest</code> uses the
+    Java package name <code>com.example.android.newalarm.test</code>. For the same reason, the
+    Android package name for the test application (specified in the manifest file), is
+    <code>com.example.android.newalarm.test</code>.
+</p>
diff --git a/samples/Alarm/tests/src/com/example/android/newalarm/AlarmServiceTest.java b/samples/Alarm/tests/src/com/example/android/newalarm/AlarmServiceTest.java
new file mode 100644
index 0000000..4d6c7ad
--- /dev/null
+++ b/samples/Alarm/tests/src/com/example/android/newalarm/AlarmServiceTest.java
@@ -0,0 +1,86 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.android.newalarm;
+
+import android.content.Intent;
+import android.test.ServiceTestCase;
+import com.example.android.newalarm.AlarmService;
+
+/**
+ * Test class for the Alarm sample test package. This test class tests the AlarmService
+ * service component.
+ */
+public class AlarmServiceTest extends ServiceTestCase<AlarmService> {
+    // Contains an Intent used to start the service
+    Intent mStartServiceIntent;
+
+    // Contains a handle to the system alarm service
+    AlarmService mService;
+
+    /**
+     * Constructor for the test class. Test classes that are run by InstrumentationTestRunner
+     * must provide a constructor with no arguments that calls the base class constructor as its
+     * first statement.
+     */
+    public AlarmServiceTest() {
+        super(AlarmService.class);
+    }
+
+    /*
+     * Sets up the test fixture. This method is called before each test
+     */
+    @Override
+    protected void setUp() throws Exception {
+
+        super.setUp();
+
+        // Sets up an intent to start the service under test
+        mStartServiceIntent = new Intent(this.getSystemContext(),AlarmService.class);
+    }
+
+    /**
+     * Cleans up the test fixture
+     * Called after each test method. If you override the method, call super.tearDown() as the
+     * last statement in your override.
+     */
+    @Override
+    protected void tearDown() throws Exception {
+        // Always call the super constructor when overriding tearDown()
+        super.tearDown();
+    }
+
+    /**
+     * Tests the service's onCreate() method. Starts the service using startService(Intent)
+     */
+    public void testServiceCreate() {
+        // Starts the service under test
+        this.startService(mStartServiceIntent);
+
+        // Gets a handle to the service under test.
+        mService = this.getService();
+
+        // Asserts that the Notification Manager was created in the service under test.
+        assertNotNull(mService.mNotificationManager);
+
+        // Asserts that the PendingIntent for the expanded status window was created
+        assertNotNull(mService.mContentIntent);
+
+        // Asserts that the notification was created
+        assertNotNull(mService.mNotification);
+    }
+
+}
diff --git a/samples/AliasActivity/AndroidManifest.xml b/samples/AliasActivity/AndroidManifest.xml
index 33ad326..66ff9f2 100644
--- a/samples/AliasActivity/AndroidManifest.xml
+++ b/samples/AliasActivity/AndroidManifest.xml
@@ -21,8 +21,8 @@
      to come from a domain that you own or have control over. -->
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
     package="com.example.android.aliasactivity">
-    <application android:hasCode="false">
-        <activity android:name="android.app.AliasActivity" android:label="@string/app_label">
+    <application android:hasCode="false" android:label="@string/app_label">
+        <activity android:name="android.app.AliasActivity">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN"/>
                 <category android:name="android.intent.category.LAUNCHER"/>
diff --git a/samples/ApiDemos/AndroidManifest.xml b/samples/ApiDemos/AndroidManifest.xml
index 1e3f66b..6e39538 100644
--- a/samples/ApiDemos/AndroidManifest.xml
+++ b/samples/ApiDemos/AndroidManifest.xml
@@ -32,6 +32,9 @@
     <uses-permission android:name="android.permission.SEND_SMS" />
     <uses-permission android:name="android.permission.RECEIVE_SMS" />
 
+    <!-- For android.media.audiofx.Visualizer -->
+    <uses-permission android:name="android.permission.RECORD_AUDIO" />
+
     <!-- We will request access to the camera, saying we require a camera
          of some sort but not one with autofocus capability. -->
     <uses-permission android:name="android.permission.CAMERA" />
@@ -207,6 +210,14 @@
             </intent-filter>
         </activity>
 
+        <activity android:name=".app.ScreenOrientation"
+                  android:label="@string/activity_screen_orientation">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.SAMPLE_CODE" />
+            </intent-filter>
+        </activity>
+
         <!-- Intent Samples -->
 
         <activity android:name=".app.Intents" android:label="@string/activity_intents">
@@ -635,6 +646,13 @@
             </intent-filter>
         </activity>
 
+        <activity android:name=".content.PickContact" android:label="@string/activity_pick_contact">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.SAMPLE_CODE" />
+            </intent-filter>
+        </activity>
+
         <!-- ************************************* -->
         <!--     OS PACKAGE SAMPLES                -->
         <!-- ************************************* -->
@@ -1443,6 +1461,13 @@
             </intent-filter>
         </activity>
 
+        <activity android:name=".view.SecureView" android:label="Views/Secure View">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.SAMPLE_CODE" />
+            </intent-filter>
+        </activity>
+
         <!-- ************************************* -->
         <!--           GRAPHICS SAMPLES            -->
         <!-- ************************************* -->
@@ -1605,6 +1630,14 @@
             </intent-filter>
         </activity>
 
+        <activity android:name=".graphics.WindowSurface"
+                android:label="Graphics/Surface Window">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.SAMPLE_CODE" />
+            </intent-filter>
+        </activity>
+
         <activity android:name=".graphics.TextAlign" android:label="Graphics/Text Align">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
@@ -1854,6 +1887,13 @@
             </intent-filter>
         </activity>
 
+        <activity android:name=".media.AudioFxDemo" android:label="Media/AudioFx">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.SAMPLE_CODE" />
+            </intent-filter>
+        </activity>
+
         <!-- ************************************* -->
         <!--      APPWIDGET PACKAGE SAMPLES           -->
         <!-- ************************************* -->
diff --git a/samples/ApiDemos/_index.html b/samples/ApiDemos/_index.html
old mode 100755
new mode 100644
diff --git a/samples/ApiDemos/res/layout/device_admin_sample.xml b/samples/ApiDemos/res/layout/device_admin_sample.xml
index 2827c01..16b08ce 100644
--- a/samples/ApiDemos/res/layout/device_admin_sample.xml
+++ b/samples/ApiDemos/res/layout/device_admin_sample.xml
@@ -99,21 +99,27 @@
 
     </LinearLayout>
 
+    <Button android:id="@+id/force_lock"
+        android:layout_width="wrap_content" android:layout_height="wrap_content"
+        android:layout_weight="0"
+        android:text="@string/force_lock">
+    </Button>
+
     <LinearLayout android:orientation="horizontal" android:gravity="center"
         android:layout_width="match_parent" android:layout_height="wrap_content">
 
-        <Button android:id="@+id/force_lock"
-            android:layout_width="wrap_content" android:layout_height="wrap_content"
-            android:layout_weight="0"
-            android:text="@string/force_lock">
-        </Button>
-
         <Button android:id="@+id/wipe_data"
             android:layout_width="wrap_content" android:layout_height="wrap_content"
             android:layout_weight="0"
             android:text="@string/wipe_data">
         </Button>
 
+        <Button android:id="@+id/wipe_all_data"
+            android:layout_width="wrap_content" android:layout_height="wrap_content"
+            android:layout_weight="0"
+            android:text="@string/wipe_all_data">
+        </Button>
+
     </LinearLayout>
 
     <LinearLayout android:orientation="horizontal" android:gravity="center"
diff --git a/samples/ApiDemos/res/layout/pick_contact.xml b/samples/ApiDemos/res/layout/pick_contact.xml
new file mode 100644
index 0000000..c83c89e
--- /dev/null
+++ b/samples/ApiDemos/res/layout/pick_contact.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2010 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+  
+          http://www.apache.org/licenses/LICENSE-2.0
+  
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<!-- Demonstrates selecting various types of contact data. -->
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:padding="4dip"
+    android:gravity="center_horizontal"
+    android:layout_width="match_parent" android:layout_height="match_parent">
+
+    <TextView
+        android:layout_width="match_parent" android:layout_height="wrap_content"
+        android:layout_weight="0"
+        android:paddingBottom="4dip"
+        android:text="@string/pick_contact_msg"/>
+        
+    <Button android:id="@+id/pick_contact"
+        android:layout_width="wrap_content" android:layout_height="wrap_content" 
+        android:text="@string/pick_contact">
+        <requestFocus />
+    </Button>
+
+    <Button android:id="@+id/pick_person"
+        android:layout_width="wrap_content" android:layout_height="wrap_content" 
+        android:text="@string/pick_person">
+    </Button>
+
+    <Button android:id="@+id/pick_phone"
+        android:layout_width="wrap_content" android:layout_height="wrap_content" 
+        android:text="@string/pick_phone">
+    </Button>
+
+    <Button android:id="@+id/pick_address"
+        android:layout_width="wrap_content" android:layout_height="wrap_content" 
+        android:text="@string/pick_address">
+    </Button>
+</LinearLayout>
diff --git a/samples/ApiDemos/res/layout/screen_orientation.xml b/samples/ApiDemos/res/layout/screen_orientation.xml
new file mode 100644
index 0000000..b5943e2
--- /dev/null
+++ b/samples/ApiDemos/res/layout/screen_orientation.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2010 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<!-- Demonstrates implementation of a DeviceAdmin. -->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:orientation="vertical" android:padding="4dip"
+    android:gravity="center_horizontal"
+    android:layout_width="match_parent" android:layout_height="match_parent">
+
+    <TextView
+        android:layout_width="match_parent" android:layout_height="wrap_content"
+        android:layout_weight="0"
+        android:paddingBottom="4dip"
+        android:text="@string/screen_orientation_summary"/>
+
+    <Spinner android:id="@+id/orientation"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:drawSelectorOnTop="true"
+        android:prompt="@string/screen_orientation">
+    </Spinner>
+</LinearLayout>
+
diff --git a/samples/ApiDemos/res/layout/secure_view.xml b/samples/ApiDemos/res/layout/secure_view.xml
new file mode 100644
index 0000000..82a1f79
--- /dev/null
+++ b/samples/ApiDemos/res/layout/secure_view.xml
@@ -0,0 +1,112 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2010 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<!-- Demonstrates secure views. -->
+<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent">
+    <LinearLayout
+        android:orientation="vertical"
+        android:padding="10dip"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent">
+        <TextView
+            android:id="@+id/secure_view_description"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:text="@string/secure_view_description"/>
+
+        <TextView
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="10dip"
+            android:textStyle="bold"
+            android:text="@string/secure_view_step1_heading"/>
+
+        <TextView
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:text="@string/secure_view_step1_detail"/>
+
+        <Button
+            android:id="@+id/secure_view_toast_button"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_gravity="center_horizontal"
+            android:text="@string/secure_view_pop_toast"/>
+
+        <TextView
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="10dip"
+            android:textStyle="bold"
+            android:text="@string/secure_view_step2_heading"/>
+
+        <TextView
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:text="@string/secure_view_step2_detail"/>
+
+        <Button
+            android:id="@+id/secure_view_unsecure_button"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_gravity="center_horizontal"
+            android:textColor="#833"
+            android:text="@string/secure_view_button"/>
+
+        <TextView
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="10dip"
+            android:textStyle="bold"
+            android:text="@string/secure_view_step3_heading"/>
+
+        <TextView
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:text="@string/secure_view_step3_detail"/>
+
+        <Button
+            android:id="@+id/secure_view_builtin_secure_button"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_gravity="center_horizontal"
+            android:filterTouchesWhenObscured="true"
+            android:textColor="#833"
+            android:text="@string/secure_view_button"/>
+
+        <TextView
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="10dip"
+            android:textStyle="bold"
+            android:text="@string/secure_view_step4_heading"/>
+
+        <TextView
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:text="@string/secure_view_step4_detail"/>
+
+        <Button
+            android:id="@+id/secure_view_custom_secure_button"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_gravity="center_horizontal"
+            android:textColor="#833"
+            android:text="@string/secure_view_button"/>
+    </LinearLayout>
+</ScrollView>
diff --git a/samples/ApiDemos/res/layout/secure_view_overlay.xml b/samples/ApiDemos/res/layout/secure_view_overlay.xml
new file mode 100644
index 0000000..aaa043a
--- /dev/null
+++ b/samples/ApiDemos/res/layout/secure_view_overlay.xml
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2010 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<!-- An overlay that will appear on top of the secure view in an attempt to obscure
+     its true purpose and encourage the user to click on the secure button. -->
+<com.example.android.apis.view.SecureViewOverlay
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent">
+
+    <TextView
+        android:id="@+id/secure_view_overlay_description"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:text="@string/secure_view_overlay_description"/>
+
+    <Button
+        android:id="@+id/secure_view_overlay_button1"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:textColor="#383"
+        android:text="@string/secure_view_overlay_button1"/>
+
+    <Button
+        android:id="@+id/secure_view_overlay_button2"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:textColor="#383"
+        android:text="@string/secure_view_overlay_button2"/>
+
+    <Button
+        android:id="@+id/secure_view_overlay_button3"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:textColor="#383"
+        android:text="@string/secure_view_overlay_button3"/>
+</com.example.android.apis.view.SecureViewOverlay>
diff --git a/samples/ApiDemos/res/values/arrays.xml b/samples/ApiDemos/res/values/arrays.xml
index df918cd..29c9d2e 100644
--- a/samples/ApiDemos/res/values/arrays.xml
+++ b/samples/ApiDemos/res/values/arrays.xml
@@ -94,4 +94,28 @@
         <item>Alphanumeric</item>
     </string-array>
 
+    <!-- Used in app/Screen Orientation -->
+    <string-array name="screen_orientations">
+        <item>UNSPECIFIED</item>
+        <item>LANDSCAPE</item>
+        <item>PORTRAIT</item>
+        <item>USER</item>
+        <item>BEHIND</item>
+        <item>SENSOR</item>
+        <item>NOSENSOR</item>
+        <item>SENSOR_LANDSCAPE</item>
+        <item>SENSOR_PORTRAIT</item>
+        <item>REVERSE_LANDSCAPE</item>
+        <item>REVERSE_PORTRAIT</item>
+        <item>FULL_SENSOR</item>
+    </string-array>
+
+    <!-- Used in view/Secure View examples -->
+    <string-array name="secure_view_clicked">
+        <item>*bzzt*\nTransferred $1,000,000 to J. Phisher.  Thank you!</item>
+        <item>*bzzt*\nSending all life savings to the International Cabal of Evil Penguins.</item>
+        <item>*bzzt*\nOpening portal to R\'lyeh.  Long live Cthulhu!</item>
+        <item>*bzzt*\nYou\'re not very good at this, are you?</item>
+        <item>*bzzt*\nGo away...</item>
+    </string-array>
 </resources>
diff --git a/samples/ApiDemos/res/values/strings.xml b/samples/ApiDemos/res/values/strings.xml
index db6f56f..db432c1 100644
--- a/samples/ApiDemos/res/values/strings.xml
+++ b/samples/ApiDemos/res/values/strings.xml
@@ -44,6 +44,12 @@
     <string name="set_wallpaper">Set Wallpaper</string>
     <string name="randomize">Randomize</string>
 
+    <string name="activity_screen_orientation">App/Activity/Screen Orientation</string>
+    <string name="screen_orientation_summary">Demonstrates the available screen
+        orientation modes.  Often you want to set the desired mode in your manifest
+        instead of programmatically.</string>
+    <string name="screen_orientation">Screen Orientation</string>
+    
     <string name="activity_translucent">App/Activity/Translucent</string>
     <string name="translucent_background">Example of how you can make an
             activity have a translucent background, compositing over
@@ -246,6 +252,15 @@
     <string name="activity_themes">Content/Resources/Themes</string>
     <string name="activity_resources">Content/Resources/Resources</string>
 
+    <string name="activity_pick_contact">Content/Provider/Pick Contact</string>
+    <string name="pick_contact_msg">Invoke Contacts to pick varius kinds of
+        contact data.  None of these require that the caller hold the
+        READ_CONTACTS permission.</string>
+    <string name="pick_contact">Pick a Contact</string>
+    <string name="pick_person">Pick a Person</string>
+    <string name="pick_phone">Pick a Phone</string>
+    <string name="pick_address">Pick an Address</string>
+    
     <!-- ============================== -->
     <!--  app/intents examples strings     -->
     <!-- ============================== -->
@@ -464,6 +479,7 @@
     <string name="max_failed_pw_hint">Password Attempts Wipe Data</string>
     <string name="force_lock">Force Lock</string>
     <string name="wipe_data">Wipe Data</string>
+    <string name="wipe_all_data">Wipe All Data</string>
     <string name="timeout_hint">Max screen timeout</string>
     <string name="set_timeout_label">Set Timeout</string>
 
@@ -520,6 +536,49 @@
 
     <string name="ratingbar_rating">Rating:</string>
 
+    <string name="secure_view_description">
+        This activity demonstrates a view that detects when it is potentially obscured
+        by other windows.
+    </string>
+    <string name="secure_view_step1_heading">Click me first:</string>
+    <string name="secure_view_step1_detail">
+        Pop up a toast that will overlay and obscure this window in a poor attempt to fool
+        you into clicking the big red buttons.  Don\'t do it!
+    </string>
+    <string name="secure_view_step2_heading">Unfiltered demo:</string>
+    <string name="secure_view_step2_detail">
+        This button does no filtering.  This button will still work as usual while the
+        toast is visible and is spoofing the view.  Careful!
+    </string>
+    <string name="secure_view_step3_heading">Built-in filtering demo:</string>
+    <string name="secure_view_step3_detail">
+        This button uses the built-in secure touch filtering provided by the framework
+        using the android:filterTouchesWhenObscured attribute.  This button will be inoperable
+        while the toast is visible.
+    </string>
+    <string name="secure_view_step4_heading">Custom filtering demo:</string>
+    <string name="secure_view_step4_detail">
+        This button filters touches using a touch listener to examine the MotionEvent flags
+        and warns the user.  This button will display a message if touched while the
+        toast is visible.
+    </string>
+
+    <string name="secure_view_pop_toast">Pop toast</string>
+    <string name="secure_view_button">Don\'t click!  It\'ll cost you!</string>
+    <string name="secure_view_action_dialog_title">Oh no!</string>
+    <string name="secure_view_action_dialog_dismiss">Oops...</string>
+    <string name="secure_view_caught_dialog_title">Saved!</string>
+    <string name="secure_view_caught_dialog_message">
+        Careful!  There appears to be another window partly obscuring this window...
+        Something unutterably HORRIBLE might have happened.
+    </string>
+    <string name="secure_view_caught_dialog_dismiss">Phew!</string>
+
+    <string name="secure_view_overlay_description">A toast!  A toast!</string>
+    <string name="secure_view_overlay_button1">Totally safe, trust me...</string>
+    <string name="secure_view_overlay_button2">Clicky?</string>
+    <string name="secure_view_overlay_button3">Think of the penguins!</string>
+
     <!-- ============================== -->
     <!--  GoogleLogin examples strings  -->
     <!-- ============================== -->
diff --git a/samples/ApiDemos/src/com/example/android/apis/app/DeviceAdminSample.java b/samples/ApiDemos/src/com/example/android/apis/app/DeviceAdminSample.java
index f7ee2d7..b3fc2f9 100644
--- a/samples/ApiDemos/src/com/example/android/apis/app/DeviceAdminSample.java
+++ b/samples/ApiDemos/src/com/example/android/apis/app/DeviceAdminSample.java
@@ -128,6 +128,7 @@
 
         Button mForceLockButton;
         Button mWipeDataButton;
+        Button mWipeAllDataButton;
 
         private Button mTimeoutButton;
 
@@ -208,6 +209,8 @@
             mForceLockButton.setOnClickListener(mForceLockListener);
             mWipeDataButton = (Button)findViewById(R.id.wipe_data);
             mWipeDataButton.setOnClickListener(mWipeDataListener);
+            mWipeAllDataButton = (Button)findViewById(R.id.wipe_all_data);
+            mWipeAllDataButton.setOnClickListener(mWipeDataListener);
 
             mTimeout = (EditText) findViewById(R.id.timeout);
             mTimeoutButton = (Button) findViewById(R.id.set_timeout);
@@ -226,6 +229,7 @@
                 mResetPasswordButton.setEnabled(true);
                 mForceLockButton.setEnabled(true);
                 mWipeDataButton.setEnabled(true);
+                mWipeAllDataButton.setEnabled(true);
             } else {
                 mEnableButton.setEnabled(true);
                 mDisableButton.setEnabled(false);
@@ -236,6 +240,7 @@
                 mResetPasswordButton.setEnabled(false);
                 mForceLockButton.setEnabled(false);
                 mWipeDataButton.setEnabled(false);
+                mWipeAllDataButton.setEnabled(false);
             }
         }
 
@@ -372,7 +377,7 @@
         };
 
         private OnClickListener mWipeDataListener = new OnClickListener() {
-            public void onClick(View v) {
+            public void onClick(final View v) {
                 if (mAM.isUserAMonkey()) {
                     // Don't trust monkeys to do the right thing!
                     AlertDialog.Builder builder = new AlertDialog.Builder(Controller.this);
@@ -386,14 +391,22 @@
                 builder.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
                     public void onClick(DialogInterface dialog, int which) {
                         AlertDialog.Builder builder = new AlertDialog.Builder(Controller.this);
-                        builder.setMessage("This is not a test.  "
-                                + "This WILL erase all of your data!  "
-                                + "Are you really absolutely sure?");
+                        if (v == mWipeAllDataButton) {
+                            builder.setMessage("This is not a test.  "
+                                    + "This WILL erase all of your data, "
+                                    + "including external storage!  "
+                                    + "Are you really absolutely sure?");
+                        } else {
+                            builder.setMessage("This is not a test.  "
+                                    + "This WILL erase all of your data!  "
+                                    + "Are you really absolutely sure?");
+                        }
                         builder.setPositiveButton("BOOM!", new DialogInterface.OnClickListener() {
                             public void onClick(DialogInterface dialog, int which) {
                                 boolean active = mDPM.isAdminActive(mDeviceAdminSample);
                                 if (active) {
-                                    mDPM.wipeData(0);
+                                    mDPM.wipeData(v == mWipeAllDataButton
+                                            ? DevicePolicyManager.WIPE_EXTERNAL_STORAGE : 0);
                                 }
                             }
                         });
diff --git a/samples/ApiDemos/src/com/example/android/apis/app/ScreenOrientation.java b/samples/ApiDemos/src/com/example/android/apis/app/ScreenOrientation.java
new file mode 100644
index 0000000..3946b2a
--- /dev/null
+++ b/samples/ApiDemos/src/com/example/android/apis/app/ScreenOrientation.java
@@ -0,0 +1,73 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.android.apis.app;
+
+import com.example.android.apis.R;
+
+import android.app.Activity;
+import android.app.admin.DevicePolicyManager;
+import android.content.pm.ActivityInfo;
+import android.os.Bundle;
+import android.view.View;
+import android.widget.AdapterView;
+import android.widget.ArrayAdapter;
+import android.widget.Spinner;
+import android.widget.AdapterView.OnItemSelectedListener;
+
+public class ScreenOrientation extends Activity {
+    Spinner mOrientation;
+
+    // Orientation spinner choices
+    // This list must match the list found in samples/ApiDemos/res/values/arrays.xml
+    final static int mOrientationValues[] = new int[] {
+        ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED,
+        ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE,
+        ActivityInfo.SCREEN_ORIENTATION_PORTRAIT,
+        ActivityInfo.SCREEN_ORIENTATION_USER,
+        ActivityInfo.SCREEN_ORIENTATION_BEHIND,
+        ActivityInfo.SCREEN_ORIENTATION_SENSOR,
+        ActivityInfo.SCREEN_ORIENTATION_NOSENSOR,
+        ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE,
+        ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT,
+        ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE,
+        ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT,
+        ActivityInfo.SCREEN_ORIENTATION_FULL_SENSOR,
+    };
+    
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.screen_orientation);
+        
+        mOrientation = (Spinner)findViewById(R.id.orientation);
+        ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(
+                this, R.array.screen_orientations, android.R.layout.simple_spinner_item);
+        adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
+        mOrientation.setAdapter(adapter);
+        mOrientation.setOnItemSelectedListener(
+                new OnItemSelectedListener() {
+                    public void onItemSelected(
+                            AdapterView<?> parent, View view, int position, long id) {
+                        setRequestedOrientation(mOrientationValues[position]);
+                    }
+
+                    public void onNothingSelected(AdapterView<?> parent) {
+                        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);
+                    }
+                });
+    }
+}
diff --git a/samples/ApiDemos/src/com/example/android/apis/content/PickContact.java b/samples/ApiDemos/src/com/example/android/apis/content/PickContact.java
new file mode 100644
index 0000000..8ee85cc
--- /dev/null
+++ b/samples/ApiDemos/src/com/example/android/apis/content/PickContact.java
@@ -0,0 +1,114 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.android.apis.content;
+
+// Need the following import to get access to the app resources, since this
+// class is in a sub-package.
+import com.example.android.apis.R;
+
+import android.app.Activity;
+import android.app.AlarmManager;
+import android.app.PendingIntent;
+import android.content.Intent;
+import android.database.Cursor;
+import android.net.Uri;
+import android.os.SystemClock;
+import android.os.Bundle;
+import android.provider.BaseColumns;
+import android.provider.ContactsContract;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.widget.Button;
+import android.widget.Toast;
+
+import java.util.Calendar;
+
+/**
+ * Demonstrates launching the contacts app to pick a contact.  Does not
+ * require permission to read contacts, as that permission will be granted
+ * when the selected contact is returned.
+ */
+public class PickContact extends Activity {
+    Toast mToast;
+    ResultDisplayer mPendingResult;
+
+    class ResultDisplayer implements OnClickListener {
+        String mMsg;
+        String mMimeType;
+        
+        ResultDisplayer(String msg, String mimeType) {
+            mMsg = msg;
+            mMimeType = mimeType;
+        }
+        
+        public void onClick(View v) {
+            Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
+            intent.setType(mMimeType);
+            mPendingResult = this;
+            startActivityForResult(intent, 1);
+        }
+    }
+    
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        setContentView(R.layout.pick_contact);
+
+        // Watch for button clicks.
+        ((Button)findViewById(R.id.pick_contact)).setOnClickListener(
+                new ResultDisplayer("Selected contact",
+                        ContactsContract.Contacts.CONTENT_ITEM_TYPE));
+        ((Button)findViewById(R.id.pick_person)).setOnClickListener(
+                new ResultDisplayer("Selected person",
+                        "vnd.android.cursor.item/person"));
+        ((Button)findViewById(R.id.pick_phone)).setOnClickListener(
+                new ResultDisplayer("Selected phone",
+                        ContactsContract.CommonDataKinds.Phone.CONTENT_ITEM_TYPE));
+        ((Button)findViewById(R.id.pick_address)).setOnClickListener(
+                new ResultDisplayer("Selected address",
+                        ContactsContract.CommonDataKinds.StructuredPostal.CONTENT_ITEM_TYPE));
+    }
+
+    @Override
+    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
+        if (data != null) {
+            Uri uri = data.getData();
+            if (uri != null) {
+                Cursor c = null;
+                try {
+                    c = getContentResolver().query(uri, new String[] { BaseColumns._ID },
+                            null, null, null);
+                    if (c != null && c.moveToFirst()) {
+                        int id = c.getInt(0);
+                        if (mToast != null) {
+                            mToast.cancel();
+                        }
+                        String txt = mPendingResult.mMsg + ":\n" + uri + "\nid: " + id;
+                        mToast = Toast.makeText(this, txt, Toast.LENGTH_LONG);
+                        mToast.show();
+                    }
+                } finally {
+                    if (c != null) {
+                        c.close();
+                    }
+                }
+            }
+        }
+    }
+}
+
diff --git a/samples/ApiDemos/src/com/example/android/apis/graphics/CameraPreview.java b/samples/ApiDemos/src/com/example/android/apis/graphics/CameraPreview.java
index 171c885..22dc297 100644
--- a/samples/ApiDemos/src/com/example/android/apis/graphics/CameraPreview.java
+++ b/samples/ApiDemos/src/com/example/android/apis/graphics/CameraPreview.java
@@ -21,9 +21,13 @@
 import android.hardware.Camera;
 import android.hardware.Camera.Size;
 import android.os.Bundle;
+import android.util.Log;
 import android.view.SurfaceHolder;
 import android.view.SurfaceView;
+import android.view.View;
+import android.view.ViewGroup;
 import android.view.Window;
+import android.view.WindowManager;
 
 import java.io.IOException;
 import java.util.List;
@@ -32,62 +36,145 @@
 
 public class CameraPreview extends Activity {
     private Preview mPreview;
+    Camera mCamera;
 
     @Override
-	protected void onCreate(Bundle savedInstanceState) {
+    protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
 
         // Hide the window title.
         requestWindowFeature(Window.FEATURE_NO_TITLE);
+        getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
 
-        // Create our Preview view and set it as the content of our activity.
+        // Create a RelativeLayout container that will hold a SurfaceView,
+        // and set it as the content of our activity.
         mPreview = new Preview(this);
         setContentView(mPreview);
     }
 
+    @Override
+    protected void onResume() {
+        super.onResume();
+
+        mCamera = Camera.open();
+        mPreview.setCamera(mCamera);
+    }
+
+    @Override
+    protected void onPause() {
+        super.onPause();
+
+        // Because the Camera object is a shared resource, it's very
+        // important to release it when the activity is paused.
+        if (mCamera != null) {
+            mPreview.setCamera(null);
+            mCamera.release();
+            mCamera = null;
+        }
+    }
 }
 
 // ----------------------------------------------------------------------
 
-class Preview extends SurfaceView implements SurfaceHolder.Callback {
+/**
+ * A simple wrapper around a Camera and a SurfaceView that renders a centered preview of the Camera
+ * to the surface. We need to center the SurfaceView because not all devices have cameras that
+ * support preview sizes at the same aspect ratio as the device's display.
+ */
+class Preview extends ViewGroup implements SurfaceHolder.Callback {
+    private final String TAG = "Preview";
+
+    SurfaceView mSurfaceView;
     SurfaceHolder mHolder;
+    Size mPreviewSize;
+    List<Size> mSupportedPreviewSizes;
     Camera mCamera;
 
     Preview(Context context) {
         super(context);
 
+        mSurfaceView = new SurfaceView(context);
+        addView(mSurfaceView);
+
         // Install a SurfaceHolder.Callback so we get notified when the
         // underlying surface is created and destroyed.
-        mHolder = getHolder();
+        mHolder = mSurfaceView.getHolder();
         mHolder.addCallback(this);
         mHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
     }
 
+    public void setCamera(Camera camera) {
+        mCamera = camera;
+        if (mCamera != null) {
+            mSupportedPreviewSizes = mCamera.getParameters().getSupportedPreviewSizes();
+            requestLayout();
+        }
+    }
+
+    @Override
+    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
+        // We purposely disregard child measurements because act as a
+        // wrapper to a SurfaceView that centers the camera preview instead
+        // of stretching it.
+        final int width = resolveSize(getSuggestedMinimumWidth(), widthMeasureSpec);
+        final int height = resolveSize(getSuggestedMinimumHeight(), heightMeasureSpec);
+        setMeasuredDimension(width, height);
+
+        if (mSupportedPreviewSizes != null) {
+            mPreviewSize = getOptimalPreviewSize(mSupportedPreviewSizes, width, height);
+        }
+    }
+
+    @Override
+    protected void onLayout(boolean changed, int l, int t, int r, int b) {
+        if (changed && getChildCount() > 0) {
+            final View child = getChildAt(0);
+
+            final int width = r - l;
+            final int height = b - t;
+
+            int previewWidth = width;
+            int previewHeight = height;
+            if (mPreviewSize != null) {
+                previewWidth = mPreviewSize.width;
+                previewHeight = mPreviewSize.height;
+            }
+
+            // Center the child SurfaceView within the parent.
+            if (width * previewHeight > height * previewWidth) {
+                final int scaledChildWidth = previewWidth * height / previewHeight;
+                child.layout((width - scaledChildWidth) / 2, 0,
+                        (width + scaledChildWidth) / 2, height);
+            } else {
+                final int scaledChildHeight = previewHeight * width / previewWidth;
+                child.layout(0, (height - scaledChildHeight) / 2,
+                        width, (height + scaledChildHeight) / 2);
+            }
+        }
+    }
+
     public void surfaceCreated(SurfaceHolder holder) {
         // The Surface has been created, acquire the camera and tell it where
         // to draw.
-        mCamera = Camera.open();
         try {
-           mCamera.setPreviewDisplay(holder);
+            if (mCamera != null) {
+                mCamera.setPreviewDisplay(holder);
+            }
         } catch (IOException exception) {
-            mCamera.release();
-            mCamera = null;
-            // TODO: add more exception handling logic here
+            Log.e(TAG, "IOException caused by setPreviewDisplay()", exception);
         }
     }
 
     public void surfaceDestroyed(SurfaceHolder holder) {
         // Surface will be destroyed when we return, so stop the preview.
-        // Because the CameraDevice object is not a shared resource, it's very
-        // important to release it when the activity is paused.
-        mCamera.stopPreview();
-        mCamera.release();
-        mCamera = null;
+        if (mCamera != null) {
+            mCamera.stopPreview();
+        }
     }
 
 
     private Size getOptimalPreviewSize(List<Size> sizes, int w, int h) {
-        final double ASPECT_TOLERANCE = 0.05;
+        final double ASPECT_TOLERANCE = 0.1;
         double targetRatio = (double) w / h;
         if (sizes == null) return null;
 
@@ -123,10 +210,8 @@
         // Now that the size is known, set up the camera parameters and begin
         // the preview.
         Camera.Parameters parameters = mCamera.getParameters();
-
-        List<Size> sizes = parameters.getSupportedPreviewSizes();
-        Size optimalSize = getOptimalPreviewSize(sizes, w, h);
-        parameters.setPreviewSize(optimalSize.width, optimalSize.height);
+        parameters.setPreviewSize(mPreviewSize.width, mPreviewSize.height);
+        requestLayout();
 
         mCamera.setParameters(parameters);
         mCamera.startPreview();
diff --git a/samples/ApiDemos/src/com/example/android/apis/graphics/TouchPaint.java b/samples/ApiDemos/src/com/example/android/apis/graphics/TouchPaint.java
index ba48da0..9a3eb65 100644
--- a/samples/ApiDemos/src/com/example/android/apis/graphics/TouchPaint.java
+++ b/samples/ApiDemos/src/com/example/android/apis/graphics/TouchPaint.java
@@ -158,21 +158,20 @@
     public class MyView extends View {
         private static final int FADE_ALPHA = 0x06;
         private static final int MAX_FADE_STEPS = 256/FADE_ALPHA + 4;
+        private static final int TRACKBALL_SCALE = 10;
+
         private Bitmap mBitmap;
         private Canvas mCanvas;
         private final Rect mRect = new Rect();
         private final Paint mPaint;
         private final Paint mFadePaint;
-        private boolean mCurDown;
-        private int mCurX;
-        private int mCurY;
-        private float mCurPressure;
-        private float mCurSize;
-        private int mCurWidth;
+        private float mCurX;
+        private float mCurY;
         private int mFadeSteps = MAX_FADE_STEPS;
 
         public MyView(Context c) {
             super(c);
+            setFocusable(true);
             mPaint = new Paint();
             mPaint.setAntiAlias(true);
             mPaint.setARGB(255, 255, 255, 255);
@@ -228,61 +227,59 @@
         }
 
         @Override public boolean onTrackballEvent(MotionEvent event) {
-            boolean oldDown = mCurDown;
-            mCurDown = true;
             int N = event.getHistorySize();
-            int baseX = mCurX;
-            int baseY = mCurY;
-            final float scaleX = event.getXPrecision();
-            final float scaleY = event.getYPrecision();
+            final float scaleX = event.getXPrecision() * TRACKBALL_SCALE;
+            final float scaleY = event.getYPrecision() * TRACKBALL_SCALE;
             for (int i=0; i<N; i++) {
                 //Log.i("TouchPaint", "Intermediate trackball #" + i
                 //        + ": x=" + event.getHistoricalX(i)
                 //        + ", y=" + event.getHistoricalY(i));
-                drawPoint(baseX+event.getHistoricalX(i)*scaleX,
-                        baseY+event.getHistoricalY(i)*scaleY,
-                        event.getHistoricalPressure(i),
-                        event.getHistoricalSize(i));
+                mCurX += event.getHistoricalX(i) * scaleX;
+                mCurY += event.getHistoricalY(i) * scaleY;
+                drawPoint(mCurX, mCurY, 1.0f, 16.0f);
             }
             //Log.i("TouchPaint", "Trackball: x=" + event.getX()
             //        + ", y=" + event.getY());
-            drawPoint(baseX+event.getX()*scaleX, baseY+event.getY()*scaleY,
-                    event.getPressure(), event.getSize());
-            mCurDown = oldDown;
+            mCurX += event.getX() * scaleX;
+            mCurY += event.getY() * scaleY;
+            drawPoint(mCurX, mCurY, 1.0f, 16.0f);
             return true;
         }
 
         @Override public boolean onTouchEvent(MotionEvent event) {
-            int action = event.getAction();
-            mCurDown = action == MotionEvent.ACTION_DOWN
-                    || action == MotionEvent.ACTION_MOVE;
-            int N = event.getHistorySize();
-            for (int i=0; i<N; i++) {
-                //Log.i("TouchPaint", "Intermediate pointer #" + i);
-                drawPoint(event.getHistoricalX(i), event.getHistoricalY(i),
-                        event.getHistoricalPressure(i),
-                        event.getHistoricalSize(i));
+            int action = event.getActionMasked();
+            if (action != MotionEvent.ACTION_UP && action != MotionEvent.ACTION_CANCEL) {
+                int N = event.getHistorySize();
+                int P = event.getPointerCount();
+                for (int i = 0; i < N; i++) {
+                    for (int j = 0; j < P; j++) {
+                        mCurX = event.getHistoricalX(j, i);
+                        mCurY = event.getHistoricalY(j, i);
+                        drawPoint(mCurX, mCurY,
+                                event.getHistoricalPressure(j, i),
+                                event.getHistoricalTouchMajor(j, i));
+                    }
+                }
+                for (int j = 0; j < P; j++) {
+                    mCurX = event.getX(j);
+                    mCurY = event.getY(j);
+                    drawPoint(mCurX, mCurY, event.getPressure(j), event.getTouchMajor(j));
+                }
             }
-            drawPoint(event.getX(), event.getY(), event.getPressure(),
-                    event.getSize());
             return true;
         }
 
-        private void drawPoint(float x, float y, float pressure, float size) {
+        private void drawPoint(float x, float y, float pressure, float width) {
             //Log.i("TouchPaint", "Drawing: " + x + "x" + y + " p="
-            //        + pressure + " s=" + size);
-            mCurX = (int)x;
-            mCurY = (int)y;
-            mCurPressure = pressure;
-            mCurSize = size;
-            mCurWidth = (int)(mCurSize*(getWidth()/3));
-            if (mCurWidth < 1) mCurWidth = 1;
-            if (mCurDown && mBitmap != null) {
-                int pressureLevel = (int)(mCurPressure*255);
+            //        + pressure + " width=" + width);
+            if (width < 1) width = 1;
+            if (mBitmap != null) {
+                float radius = width / 2;
+                int pressureLevel = (int)(pressure * 255);
                 mPaint.setARGB(pressureLevel, 255, 255, 255);
-                mCanvas.drawCircle(mCurX, mCurY, mCurWidth, mPaint);
-                mRect.set(mCurX-mCurWidth-2, mCurY-mCurWidth-2,
-                        mCurX+mCurWidth+2, mCurY+mCurWidth+2);
+                mCanvas.drawCircle(x, y, radius, mPaint);
+                mRect.set((int) (x - radius - 2), (int) (y - radius - 2),
+                        (int) (x + radius + 2), (int) (y + radius + 2));
                 invalidate(mRect);
             }
             mFadeSteps = 0;
diff --git a/samples/ApiDemos/src/com/example/android/apis/graphics/WindowSurface.java b/samples/ApiDemos/src/com/example/android/apis/graphics/WindowSurface.java
new file mode 100644
index 0000000..305147c
--- /dev/null
+++ b/samples/ApiDemos/src/com/example/android/apis/graphics/WindowSurface.java
@@ -0,0 +1,271 @@
+package com.example.android.apis.graphics;
+
+import android.app.Activity;
+import android.graphics.Canvas;
+import android.graphics.Paint;
+import android.os.Bundle;
+import android.util.Log;
+import android.view.KeyEvent;
+import android.view.MotionEvent;
+import android.view.SurfaceHolder;
+
+/**
+ * Demonstrates how to take over the Surface from a window to do direct
+ * drawing to it (without going through the view hierarchy).
+ */
+public class WindowSurface extends Activity implements SurfaceHolder.Callback2 {
+    DrawingThread mDrawingThread;
+    
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        
+        // Tell the activity's window that we want to do our own drawing
+        // to its surface.  This prevents the view hierarchy from drawing to
+        // it, though we can still add views to capture input if desired.
+        getWindow().takeSurface(this);
+        
+        // This is the thread that will be drawing to our surface.
+        mDrawingThread = new DrawingThread();
+        mDrawingThread.start();
+    }
+
+    @Override
+    protected void onPause() {
+        super.onPause();
+        
+        // Make sure the drawing thread is not running while we are paused.
+        synchronized (mDrawingThread) {
+            mDrawingThread.mRunning = false;
+            mDrawingThread.notify();
+        }
+    }
+
+    @Override
+    protected void onResume() {
+        super.onResume();
+        
+        // Let the drawing thread resume running.
+        synchronized (mDrawingThread) {
+            mDrawingThread.mRunning = true;
+            mDrawingThread.notify();
+        }
+    }
+
+    @Override
+    protected void onDestroy() {
+        super.onDestroy();
+        
+        // Make sure the drawing thread goes away.
+        synchronized (mDrawingThread) {
+            mDrawingThread.mQuit = true;
+            mDrawingThread.notify();
+        }
+    }
+
+    public void surfaceCreated(SurfaceHolder holder) {
+        // Tell the drawing thread that a surface is available.
+        synchronized (mDrawingThread) {
+            mDrawingThread.mSurface = holder;
+            mDrawingThread.notify();
+        }
+    }
+
+    public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
+        // Don't need to do anything here; the drawing thread will pick up
+        // new sizes from the canvas.
+    }
+
+    public void surfaceRedrawNeeded(SurfaceHolder holder) {
+    }
+
+    public void surfaceDestroyed(SurfaceHolder holder) {
+        // We need to tell the drawing thread to stop, and block until
+        // it has done so.
+        synchronized (mDrawingThread) {
+            mDrawingThread.mSurface = holder;
+            mDrawingThread.notify();
+            while (mDrawingThread.mActive) {
+                try {
+                    mDrawingThread.wait();
+                } catch (InterruptedException e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+    }
+
+    // Tracking of a single point that is moving on the screen.
+    static final class MovingPoint {
+        float x, y, dx, dy;
+        
+        void init(int width, int height, float minStep) {
+            x = (float)((width-1)*Math.random());
+            y = (float)((height-1)*Math.random());
+            dx = (float)(Math.random()*minStep*2) + 1;
+            dy = (float)(Math.random()*minStep*2) + 1;
+        }
+        
+        float adjDelta(float cur, float minStep, float maxStep) {
+            cur += (Math.random()*minStep) - (minStep/2);
+            if (cur < 0 && cur > -minStep) cur = -minStep;
+            if (cur >= 0 && cur < minStep) cur = minStep;
+            if (cur > maxStep) cur = maxStep;
+            if (cur < -maxStep) cur = -maxStep;
+            return cur;
+        }
+        
+        void step(int width, int height, float minStep, float maxStep) {
+            x += dx;
+            if (x <= 0 || x >= (width-1)) {
+                if (x <= 0) x = 0;
+                else if (x >= (width-1)) x = width-1;
+                dx = adjDelta(-dx, minStep, maxStep);
+            }
+            y += dy;
+            if (y <= 0 || y >= (height-1)) {
+                if (y <= 0) y = 0;
+                else if (y >= (height-1)) y = height-1;
+                dy = adjDelta(-dy, minStep, maxStep);
+            }
+        }
+    }
+    
+    /**
+     * This is a thread that will be running a loop, drawing into the
+     * window's surface.
+     */
+    class DrawingThread extends Thread {
+        // These are protected by the Thread's lock.
+        SurfaceHolder mSurface;
+        boolean mRunning;
+        boolean mActive;
+        boolean mQuit;
+        
+        // Internal state.
+        int mLineWidth;
+        float mMinStep;
+        float mMaxStep;
+        
+        boolean mInitialized;
+        final MovingPoint mPoint1 = new MovingPoint();
+        final MovingPoint mPoint2 = new MovingPoint();
+        
+        static final int NUM_OLD = 100;
+        int mNumOld = 0;
+        final float[] mOld = new float[NUM_OLD*4];
+        final int[] mOldColor = new int[NUM_OLD];
+        int mBrightLine = 0;
+        
+        // X is red, Y is blue.
+        final MovingPoint mColor = new MovingPoint();
+        
+        final Paint mBackground = new Paint();
+        final Paint mForeground = new Paint();
+        
+        int makeGreen(int index) {
+            int dist = Math.abs(mBrightLine-index);
+            if (dist > 10) return 0;
+            return (255-(dist*(255/10))) << 8;
+        }
+        
+        @Override
+        public void run() {
+            mLineWidth = (int)(getResources().getDisplayMetrics().density * 1.5);
+            if (mLineWidth < 1) mLineWidth = 1;
+            mMinStep = mLineWidth * 2;
+            mMaxStep = mMinStep * 3;
+            
+            mBackground.setColor(0xff000000);
+            mForeground.setColor(0xff00ffff);
+            mForeground.setAntiAlias(false);
+            mForeground.setStrokeWidth(mLineWidth);
+            
+            while (true) {
+                // Synchronize with activity: block until the activity is ready
+                // and we have a surface; report whether we are active or inactive
+                // at this point; exit thread when asked to quit.
+                synchronized (this) {
+                    while (mSurface == null || !mRunning) {
+                        if (mActive) {
+                            mActive = false;
+                            notify();
+                        }
+                        if (mQuit) {
+                            return;
+                        }
+                        try {
+                            wait();
+                        } catch (InterruptedException e) {
+                        }
+                    }
+                    
+                    if (!mActive) {
+                        mActive = true;
+                        notify();
+                    }
+                    
+                    // Lock the canvas for drawing.
+                    Canvas canvas = mSurface.lockCanvas();
+                    if (canvas == null) {
+                        Log.i("WindowSurface", "Failure locking canvas");
+                        continue;
+                    }
+                    
+                    // Update graphics.
+                    if (!mInitialized) {
+                        mInitialized = true;
+                        mPoint1.init(canvas.getWidth(), canvas.getHeight(), mMinStep);
+                        mPoint2.init(canvas.getWidth(), canvas.getHeight(), mMinStep);
+                        mColor.init(127, 127, 1);
+                    } else {
+                        mPoint1.step(canvas.getWidth(), canvas.getHeight(),
+                                mMinStep, mMaxStep);
+                        mPoint2.step(canvas.getWidth(), canvas.getHeight(),
+                                mMinStep, mMaxStep);
+                        mColor.step(127, 127, 1, 3);
+                    }
+                    mBrightLine+=2;
+                    if (mBrightLine > (NUM_OLD*2)) {
+                        mBrightLine = -2;
+                    }
+                    
+                    // Clear background.
+                    canvas.drawColor(mBackground.getColor());
+                    
+                    // Draw old lines.
+                    for (int i=mNumOld-1; i>=0; i--) {
+                        mForeground.setColor(mOldColor[i] | makeGreen(i));
+                        mForeground.setAlpha(((NUM_OLD-i) * 255) / NUM_OLD);
+                        int p = i*4;
+                        canvas.drawLine(mOld[p], mOld[p+1], mOld[p+2], mOld[p+3], mForeground);
+                    }
+                    
+                    // Draw new line.
+                    int red = (int)mColor.x + 128;
+                    if (red > 255) red = 255;
+                    int blue = (int)mColor.y + 128;
+                    if (blue > 255) blue = 255;
+                    int color = 0xff000000 | (red<<16) | blue;
+                    mForeground.setColor(color | makeGreen(-2));
+                    canvas.drawLine(mPoint1.x, mPoint1.y, mPoint2.x, mPoint2.y, mForeground);
+                    
+                    // Add in the new line.
+                    if (mNumOld > 1) {
+                        System.arraycopy(mOld, 0, mOld, 4, (mNumOld-1)*4);
+                        System.arraycopy(mOldColor, 0, mOldColor, 1, mNumOld-1);
+                    }
+                    if (mNumOld < NUM_OLD) mNumOld++;
+                    mOld[0] = mPoint1.x;
+                    mOld[1] = mPoint1.y;
+                    mOld[2] = mPoint2.x;
+                    mOld[3] = mPoint2.y;
+                    mOldColor[0] = color;
+                    
+                    // All done!
+                    mSurface.unlockCanvasAndPost(canvas);
+                }
+            }
+        }
+    }
+}
diff --git a/samples/ApiDemos/src/com/example/android/apis/graphics/spritetext/LabelMaker.java b/samples/ApiDemos/src/com/example/android/apis/graphics/spritetext/LabelMaker.java
index 6481397..0c48e4a 100644
--- a/samples/ApiDemos/src/com/example/android/apis/graphics/spritetext/LabelMaker.java
+++ b/samples/ApiDemos/src/com/example/android/apis/graphics/spritetext/LabelMaker.java
@@ -35,8 +35,8 @@
  *
  *
  * OpenGL labels are implemented by creating a Bitmap, drawing all the labels
- * into the Bitmap, converting the Bitmap into an Alpha texture, and creating a
- * mesh for each label
+ * into the Bitmap, converting the Bitmap into an Alpha texture, and drawing
+ * portions of the texture using glDrawTexiOES.
  *
  * The benefits of this approach are that the labels are drawn using the high
  * quality anti-aliased font rasterizer, full character set support, and all the
@@ -246,24 +246,11 @@
                     textPaint);
         }
 
-        Grid grid = new Grid(2, 2);
-        // Grid.set arguments: i, j, x, y, z, u, v
-
-        float texU = u * mTexelWidth;
-        float texU2 = u2 * mTexelWidth;
-        float texV = 1.0f - v * mTexelHeight;
-        float texV2 = 1.0f - v2 * mTexelHeight;
-
-        grid.set(0, 0,   0.0f,   0.0f, 0.0f, texU , texV2);
-        grid.set(1, 0,  width,   0.0f, 0.0f, texU2, texV2);
-        grid.set(0, 1,   0.0f, height, 0.0f, texU , texV );
-        grid.set(1, 1,  width, height, 0.0f, texU2, texV );
-
         // We know there's enough space, so update the member variables
         mU = u + width;
         mV = v;
         mLineHeight = lineHeight;
-        mLabels.add(new Label(grid, width, height, ascent,
+        mLabels.add(new Label(width, height, ascent,
                 u, v + height, width, -height));
         return mLabels.size() - 1;
     }
@@ -381,9 +368,8 @@
     }
 
     private static class Label {
-        public Label(Grid grid, float width, float height, float baseLine,
+        public Label(float width, float height, float baseLine,
                 int cropU, int cropV, int cropW, int cropH) {
-            this.grid = grid;
             this.width = width;
             this.height = height;
             this.baseline = baseLine;
@@ -395,7 +381,6 @@
             mCrop = crop;
         }
 
-        public Grid grid;
         public float width;
         public float height;
         public float baseline;
diff --git a/samples/ApiDemos/src/com/example/android/apis/media/AudioFxDemo.java b/samples/ApiDemos/src/com/example/android/apis/media/AudioFxDemo.java
new file mode 100644
index 0000000..7b4db1f
--- /dev/null
+++ b/samples/ApiDemos/src/com/example/android/apis/media/AudioFxDemo.java
@@ -0,0 +1,252 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.android.apis.media;
+
+import com.example.android.apis.R;
+
+import android.app.Activity;
+import android.content.Context;
+import android.content.res.AssetFileDescriptor;
+import android.graphics.Canvas;
+import android.graphics.Color;
+import android.graphics.Paint;
+import android.graphics.Rect;
+import android.media.AudioManager;
+import android.media.MediaPlayer;
+import android.media.audiofx.Equalizer;
+import android.media.audiofx.Visualizer;
+import android.net.Uri;
+import android.os.Bundle;
+import android.util.Log;
+import android.view.Gravity;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.LinearLayout;
+import android.widget.SeekBar;
+import android.widget.TextView;
+
+import java.io.IOException;
+
+public class AudioFxDemo extends Activity {
+    private static final String TAG = "AudioFxDemo";
+
+    private static final float VISUALIZER_HEIGHT_DIP = 50f;
+
+    private MediaPlayer mMediaPlayer;
+    private Visualizer mVisualizer;
+    private Equalizer mEqualizer;
+
+    private LinearLayout mLinearLayout;
+    private VisualizerView mVisualizerView;
+    private TextView mStatusTextView;
+
+    @Override
+    public void onCreate(Bundle icicle) {
+        super.onCreate(icicle);
+
+        setVolumeControlStream(AudioManager.STREAM_MUSIC);
+
+        mStatusTextView = new TextView(this);
+
+        mLinearLayout = new LinearLayout(this);
+        mLinearLayout.setOrientation(LinearLayout.VERTICAL);
+        mLinearLayout.addView(mStatusTextView);
+
+        setContentView(mLinearLayout);
+
+        // Create the MediaPlayer
+        mMediaPlayer = MediaPlayer.create(this, R.raw.test_cbr);
+        Log.d(TAG, "MediaPlayer audio session ID: " + mMediaPlayer.getAudioSessionId());
+
+        setupVisualizerFxAndUI();
+        setupEqualizerFxAndUI();
+
+        // Make sure the visualizer is enabled only when you actually want to receive data, and
+        // when it makes sense to receive data.
+        mVisualizer.setEnabled(true);
+
+        // When the stream ends, we don't need to collect any more data. We don't do this in
+        // setupVisualizerFxAndUI because we likely want to have more, non-Visualizer related code
+        // in this callback.
+        mMediaPlayer.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
+            public void onCompletion(MediaPlayer mediaPlayer) {
+                mVisualizer.setEnabled(false);
+            }
+        });
+
+        mMediaPlayer.start();
+        mStatusTextView.setText("Playing audio...");
+    }
+
+    private void setupEqualizerFxAndUI() {
+        // Create the Equalizer object (an AudioEffect subclass) and attach it to our media player,
+        // with a default priority (0).
+        mEqualizer = new Equalizer(0, mMediaPlayer.getAudioSessionId());
+        mEqualizer.setEnabled(true);
+
+        TextView eqTextView = new TextView(this);
+        eqTextView.setText("Equalizer:");
+        mLinearLayout.addView(eqTextView);
+
+        short bands = mEqualizer.getNumberOfBands();
+
+        final short minEQLevel = mEqualizer.getBandLevelRange()[0];
+        final short maxEQLevel = mEqualizer.getBandLevelRange()[1];
+
+        for (short i = 0; i < bands; i++) {
+            final short band = i;
+
+            TextView freqTextView = new TextView(this);
+            freqTextView.setLayoutParams(new ViewGroup.LayoutParams(
+                    ViewGroup.LayoutParams.FILL_PARENT,
+                    ViewGroup.LayoutParams.WRAP_CONTENT));
+            freqTextView.setGravity(Gravity.CENTER_HORIZONTAL);
+            freqTextView.setText((mEqualizer.getCenterFreq(band) / 1000) + " Hz");
+            mLinearLayout.addView(freqTextView);
+
+            LinearLayout row = new LinearLayout(this);
+            row.setOrientation(LinearLayout.HORIZONTAL);
+
+            TextView minDbTextView = new TextView(this);
+            minDbTextView.setLayoutParams(new ViewGroup.LayoutParams(
+                    ViewGroup.LayoutParams.WRAP_CONTENT,
+                    ViewGroup.LayoutParams.WRAP_CONTENT));
+            minDbTextView.setText((minEQLevel / 100) + " dB");
+
+            TextView maxDbTextView = new TextView(this);
+            maxDbTextView.setLayoutParams(new ViewGroup.LayoutParams(
+                    ViewGroup.LayoutParams.WRAP_CONTENT,
+                    ViewGroup.LayoutParams.WRAP_CONTENT));
+            maxDbTextView.setText((maxEQLevel / 100) + " dB");
+
+            LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(
+                    ViewGroup.LayoutParams.FILL_PARENT,
+                    ViewGroup.LayoutParams.WRAP_CONTENT);
+            layoutParams.weight = 1;
+            SeekBar bar = new SeekBar(this);
+            bar.setLayoutParams(layoutParams);
+            bar.setMax(maxEQLevel - minEQLevel);
+            bar.setProgress(mEqualizer.getBandLevel(band));
+
+            bar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
+                public void onProgressChanged(SeekBar seekBar, int progress,
+                        boolean fromUser) {
+                    mEqualizer.setBandLevel(band, (short) (progress + minEQLevel));
+                }
+
+                public void onStartTrackingTouch(SeekBar seekBar) {}
+                public void onStopTrackingTouch(SeekBar seekBar) {}
+            });
+
+            row.addView(minDbTextView);
+            row.addView(bar);
+            row.addView(maxDbTextView);
+
+            mLinearLayout.addView(row);
+        }
+    }
+
+    private void setupVisualizerFxAndUI() {
+        // Create a VisualizerView (defined below), which will render the simplified audio
+        // wave form to a Canvas.
+        mVisualizerView = new VisualizerView(this);
+        mVisualizerView.setLayoutParams(new ViewGroup.LayoutParams(
+                ViewGroup.LayoutParams.FILL_PARENT,
+                (int)(VISUALIZER_HEIGHT_DIP * getResources().getDisplayMetrics().density)));
+        mLinearLayout.addView(mVisualizerView);
+
+        // Create the Visualizer object and attach it to our media player.
+        mVisualizer = new Visualizer(mMediaPlayer.getAudioSessionId());
+        mVisualizer.setCaptureSize(Visualizer.getCaptureSizeRange()[1]);
+        mVisualizer.setDataCaptureListener(new Visualizer.OnDataCaptureListener() {
+            public void onWaveFormDataCapture(Visualizer visualizer, byte[] bytes,
+                    int samplingRate) {
+                mVisualizerView.updateVisualizer(bytes);
+            }
+
+            public void onFftDataCapture(Visualizer visualizer, byte[] bytes, int samplingRate) {}
+        }, Visualizer.getMaxCaptureRate() / 2, true, false);
+    }
+
+    @Override
+    protected void onPause() {
+        super.onPause();
+
+        if (isFinishing() && mMediaPlayer != null) {
+            mVisualizer.release();
+            mEqualizer.release();
+            mMediaPlayer.release();
+            mMediaPlayer = null;
+        }
+    }
+}
+
+/**
+ * A simple class that draws waveform data received from a
+ * {@link Visualizer.OnDataCaptureListener#onWaveFormDataCapture }
+ */
+class VisualizerView extends View {
+    private byte[] mBytes;
+    private float[] mPoints;
+    private Rect mRect = new Rect();
+
+    private Paint mForePaint = new Paint();
+
+    public VisualizerView(Context context) {
+        super(context);
+        init();
+    }
+
+    private void init() {
+        mBytes = null;
+
+        mForePaint.setStrokeWidth(1f);
+        mForePaint.setAntiAlias(true);
+        mForePaint.setColor(Color.rgb(0, 128, 255));
+    }
+
+    public void updateVisualizer(byte[] bytes) {
+        mBytes = bytes;
+        invalidate();
+    }
+
+    @Override
+    protected void onDraw(Canvas canvas) {
+        super.onDraw(canvas);
+
+        if (mBytes == null) {
+            return;
+        }
+
+        if (mPoints == null || mPoints.length < mBytes.length * 4) {
+            mPoints = new float[mBytes.length * 4];
+        }
+
+        mRect.set(0, 0, getWidth(), getHeight());
+
+        for (int i = 0; i < mBytes.length - 1; i++) {
+            mPoints[i * 4] = mRect.width() * i / (mBytes.length - 1);
+            mPoints[i * 4 + 1] = mRect.height() / 2
+                    + ((byte) (mBytes[i] + 128)) * (mRect.height() / 2) / 128;
+            mPoints[i * 4 + 2] = mRect.width() * (i + 1) / (mBytes.length - 1);
+            mPoints[i * 4 + 3] = mRect.height() / 2
+                    + ((byte) (mBytes[i + 1] + 128)) * (mRect.height() / 2) / 128;
+        }
+
+        canvas.drawLines(mPoints, mForePaint);
+    }
+}
diff --git a/samples/ApiDemos/src/com/example/android/apis/view/SecureView.java b/samples/ApiDemos/src/com/example/android/apis/view/SecureView.java
new file mode 100644
index 0000000..b9aaeab
--- /dev/null
+++ b/samples/ApiDemos/src/com/example/android/apis/view/SecureView.java
@@ -0,0 +1,144 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.android.apis.view;
+
+import com.example.android.apis.R;
+
+import android.app.Activity;
+import android.app.AlertDialog;
+import android.os.Bundle;
+import android.view.Gravity;
+import android.view.MotionEvent;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.view.View.OnTouchListener;
+import android.widget.Button;
+import android.widget.Toast;
+
+
+/**
+ * This activity demonstrates two different ways in which views can be made more secure to
+ * touch spoofing attacks by leveraging framework features.
+ *
+ * The activity presents 3 buttons that obtensibly perform a risky security critical
+ * function.  Under ordinary circumstances, the user would never click on these buttons
+ * or would at least think long and hard about it.  However, a carefully crafted toast can
+ * overlay the contents of the activity in such a way as to make the user believe the buttons
+ * are innocuous.  Since the toast cannot receive input, the touches are passed down to the
+ * activity potentially yielding an effect other than what the user intended.
+ *
+ * To simulate the spoofing risk, this activity pops up a specially crafted overlay as
+ * a toast layed out so as to cover the buttons and part of the descriptive text.
+ * For the purposes of this demonstration, pretend that the overlay was actually popped
+ * up by a malicious application published by the International Cabal of Evil Penguins.
+ *
+ * The 3 buttons are set up as follows:
+ *
+ * 1. The "unsecured button" does not apply any touch filtering of any kind.
+ *    When the toast appears, this button remains clickable as usual which creates an
+ *    opportunity for spoofing to occur.
+ *
+ * 2. The "built-in secured button" leverages the android:filterTouchesWhenObscured view
+ *    attribute to ask the framework to filter out touches when the window is obscured.
+ *    When the toast appears, the button does not receive the touch and appears to be inoperable.
+ *
+ * 3. The "custom secured button" adds a touch listener to the button which intercepts the
+ *    touch event and checks whether the window is obscured.  If so, it warns the user and
+ *    drops the touch event.  This example is intended to demonstrate how a view can
+ *    perform its own filtering and provide additional feedback by examining the {@MotionEvent}
+ *    flags to determine whether the window is obscured.  Here we use a touch listener but
+ *    a custom view subclass could perform the filtering by overriding
+ *    {@link View#onFilterTouchEventForSecurity(MotionEvent)}.
+ *
+ * Refer to the comments on {@View} for more information about view security.
+ */
+public class SecureView extends Activity {
+    private int mClickCount;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        setContentView(R.layout.secure_view);
+
+        Button toastButton = (Button) findViewById(R.id.secure_view_toast_button);
+        toastButton.setOnClickListener(new OnClickListener() {
+            public void onClick(View v) {
+                showOverlay();
+            }
+        });
+
+        Button unsecureButton = (Button) findViewById(R.id.secure_view_unsecure_button);
+        setClickedAction(unsecureButton);
+
+        Button builtinSecureButton = (Button) findViewById(R.id.secure_view_builtin_secure_button);
+        setClickedAction(builtinSecureButton);
+
+        Button customSecureButton = (Button) findViewById(R.id.secure_view_custom_secure_button);
+        setClickedAction(customSecureButton);
+        setTouchFilter(customSecureButton);
+    }
+
+    private void showOverlay() {
+        // Generate a toast view with a special layout that will position itself right
+        // on top of this view's interesting widgets.  Sneaky huh?
+        SecureViewOverlay overlay = (SecureViewOverlay)
+                getLayoutInflater().inflate(R.layout.secure_view_overlay, null);
+        overlay.setActivityToSpoof(this);
+
+        Toast toast = new Toast(getApplicationContext());
+        toast.setGravity(Gravity.FILL, 0, 0);
+        toast.setView(overlay);
+        toast.show();
+    }
+
+    private void setClickedAction(Button button) {
+        button.setOnClickListener(new OnClickListener() {
+            public void onClick(View v) {
+                String[] messages = getResources().getStringArray(R.array.secure_view_clicked);
+                String message = messages[mClickCount++ % messages.length];
+
+                new AlertDialog.Builder(SecureView.this)
+                    .setTitle(R.string.secure_view_action_dialog_title)
+                    .setMessage(message)
+                    .setNeutralButton(getResources().getString(
+                            R.string.secure_view_action_dialog_dismiss), null)
+                    .show();
+            }
+        });
+    }
+
+    private void setTouchFilter(Button button) {
+        button.setOnTouchListener(new OnTouchListener() {
+            public boolean onTouch(View v, MotionEvent event) {
+                if ((event.getFlags() & MotionEvent.FLAG_WINDOW_IS_OBSCURED) != 0) {
+                    if (event.getAction() == MotionEvent.ACTION_UP) {
+                        new AlertDialog.Builder(SecureView.this)
+                            .setTitle(R.string.secure_view_caught_dialog_title)
+                            .setMessage(R.string.secure_view_caught_dialog_message)
+                            .setNeutralButton(getResources().getString(
+                                    R.string.secure_view_caught_dialog_dismiss), null)
+                            .show();
+                    }
+                    // Return true to prevent the button from processing the touch.
+                    return true;
+                }
+                return false;
+            }
+        });
+    }
+}
diff --git a/samples/ApiDemos/src/com/example/android/apis/view/SecureViewOverlay.java b/samples/ApiDemos/src/com/example/android/apis/view/SecureViewOverlay.java
new file mode 100644
index 0000000..2095fee
--- /dev/null
+++ b/samples/ApiDemos/src/com/example/android/apis/view/SecureViewOverlay.java
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.android.apis.view;
+
+import com.example.android.apis.R;
+
+import android.content.Context;
+import android.util.AttributeSet;
+import android.view.View;
+import android.view.ViewGroup;
+
+/**
+ * This view is part of the {@link SecureView} demonstration activity.
+ *
+ * This view is constructed in such a way as to obscure the buttons and descriptive
+ * text of the activity in a poor attempt to fool the user into clicking on the buttons
+ * despite the activity telling the user that they may be harmful.
+ */
+public class SecureViewOverlay extends ViewGroup {
+    private SecureView mActivity;
+
+    public SecureViewOverlay(Context context, AttributeSet attrs) {
+        super(context, attrs);
+    }
+
+    public void setActivityToSpoof(SecureView activity) {
+        this.mActivity = activity;
+    }
+
+    @Override
+    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
+        measureChildren(widthMeasureSpec, heightMeasureSpec);
+
+        super.onMeasure(widthMeasureSpec, heightMeasureSpec);
+    }
+
+    @Override
+    protected void onLayout(boolean changed, int l, int t, int r, int b) {
+        spoofLayout(findViewById(R.id.secure_view_overlay_description),
+                mActivity.findViewById(R.id.secure_view_description));
+        spoofLayout(findViewById(R.id.secure_view_overlay_button1),
+                mActivity.findViewById(R.id.secure_view_unsecure_button));
+        spoofLayout(findViewById(R.id.secure_view_overlay_button2),
+                mActivity.findViewById(R.id.secure_view_builtin_secure_button));
+        spoofLayout(findViewById(R.id.secure_view_overlay_button3),
+                mActivity.findViewById(R.id.secure_view_custom_secure_button));
+    }
+
+    private void spoofLayout(View spoof, View original) {
+        final int[] globalPos = new int[2];
+        getLocationOnScreen(globalPos);
+        int x = globalPos[0];
+        int y = globalPos[1];
+
+        original.getLocationOnScreen(globalPos);
+        x = globalPos[0] - x;
+        y = globalPos[1] - y;
+        spoof.layout(x, y, x + original.getWidth(), y + original.getHeight());
+    }
+}
diff --git a/samples/BrowserPlugin/Android.mk b/samples/BrowserPlugin/Android.mk
index 16047d5..827700f 100644
--- a/samples/BrowserPlugin/Android.mk
+++ b/samples/BrowserPlugin/Android.mk
@@ -24,6 +24,8 @@
 
 LOCAL_SRC_FILES := $(call all-subdir-java-files)
 
+LOCAL_PROGUARD_ENABLED := disabled
+
 LOCAL_PACKAGE_NAME := SampleBrowserPlugin
 
 LOCAL_JNI_SHARED_LIBRARIES := libsampleplugin
diff --git a/samples/CrossCompatibility/AndroidManifest.xml b/samples/CrossCompatibility/AndroidManifest.xml
new file mode 100644
index 0000000..1097a4d
--- /dev/null
+++ b/samples/CrossCompatibility/AndroidManifest.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+      package="com.example.android.touchexample"
+      android:versionCode="1"
+      android:versionName="1.0">
+    <application android:icon="@drawable/icon" android:label="@string/app_name">
+        <activity android:name=".TouchExampleActivity"
+                  android:label="@string/app_name">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.LAUNCHER" />
+            </intent-filter>
+        </activity>
+
+    </application>
+    <uses-sdk android:minSdkVersion="3" android:targetSdkVersion="8" />
+</manifest>
diff --git a/samples/CrossCompatibility/_index.html b/samples/CrossCompatibility/_index.html
new file mode 100644
index 0000000..42683b0
--- /dev/null
+++ b/samples/CrossCompatibility/_index.html
@@ -0,0 +1,20 @@
+<p>This sample demonstrates how to design an application that is compatible across different Android versions. Applications
+should degrade gracefully on older platform versions, dropping features or providing
+when the platform support needed by features or functionality isn't available.</p>
+
+<p>In this case, the CrossCompatibility application shows how to use APIs that are not available in all Android versions and 
+still create a single <code>.apk</code> that runs on all Android versions.</p>
+
+<ul>
+<li>The main application's <a
+href="AndroidManifest.html">AndroidManifest.xml</a> file declares that it is backwards compatible with API level 3 devices with attribute <code>minSdkVersion</code> in the <code>uses-sdk</code> tag.
+ </li>
+<li>
+<a
+href="src/com/example/android/touchexample/VersionedGestureDetector.html">VersionedGestureDetector.java</a>
+is a version independent abstract class which factors out multitouch APIs that differ between platform versions. </li>
+
+</ul>
+
+<p> For more information on how to make your applications cross-compatible, please check out the original
+blogpost <a href="http://android-developers.blogspot.com/2010/07/how-to-have-your-cupcake-and-eat-it-too.html">here</a>.</p>
diff --git a/samples/CrossCompatibility/build.xml b/samples/CrossCompatibility/build.xml
new file mode 100644
index 0000000..805e30c
--- /dev/null
+++ b/samples/CrossCompatibility/build.xml
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="TouchExampleActivity" default="help">
+
+    <!-- The local.properties file is created and updated by the 'android' tool.
+         It contains the path to the SDK. It should *NOT* be checked in in Version
+         Control Systems. -->
+    <property file="local.properties" />
+
+    <!-- The build.properties file can be created by you and is never touched
+         by the 'android' tool. This is the place to change some of the default property values
+         used by the Ant rules.
+         Here are some properties you may want to change/update:
+
+         application.package
+             the name of your application package as defined in the manifest. Used by the
+             'uninstall' rule.
+         source.dir
+             the name of the source directory. Default is 'src'.
+         out.dir
+             the name of the output directory. Default is 'bin'.
+
+         Properties related to the SDK location or the project target should be updated
+          using the 'android' tool with the 'update' action.
+
+         This file is an integral part of the build system for your application and
+         should be checked in in Version Control Systems.
+
+         -->
+    <property file="build.properties" />
+
+    <!-- The default.properties file is created and updated by the 'android' tool, as well
+         as ADT.
+         This file is an integral part of the build system for your application and
+         should be checked in in Version Control Systems. -->
+    <property file="default.properties" />
+
+    <!-- Custom Android task to deal with the project target, and import the proper rules.
+         This requires ant 1.6.0 or above. -->
+    <path id="android.antlibs">
+        <pathelement path="${sdk.dir}/tools/lib/anttasks.jar" />
+        <pathelement path="${sdk.dir}/tools/lib/sdklib.jar" />
+        <pathelement path="${sdk.dir}/tools/lib/androidprefs.jar" />
+        <pathelement path="${sdk.dir}/tools/lib/apkbuilder.jar" />
+        <pathelement path="${sdk.dir}/tools/lib/jarutils.jar" />
+    </path>
+
+    <taskdef name="setup"
+        classname="com.android.ant.SetupTask"
+        classpathref="android.antlibs" />
+
+    <!-- Execute the Android Setup task that will setup some properties specific to the target,
+         and import the build rules files.
+
+         The rules file is imported from
+            <SDK>/platforms/<target_platform>/templates/android_rules.xml
+
+         To customize some build steps for your project:
+         - copy the content of the main node <project> from android_rules.xml
+         - paste it in this build.xml below the <setup /> task.
+         - disable the import by changing the setup task below to <setup import="false" />
+
+         This will ensure that the properties are setup correctly but that your customized
+         build steps are used.
+    -->
+    <setup />
+
+</project>
diff --git a/samples/CrossCompatibility/res/drawable-hdpi/icon.png b/samples/CrossCompatibility/res/drawable-hdpi/icon.png
new file mode 100644
index 0000000..8074c4c
--- /dev/null
+++ b/samples/CrossCompatibility/res/drawable-hdpi/icon.png
Binary files differ
diff --git a/samples/CrossCompatibility/res/drawable-ldpi/icon.png b/samples/CrossCompatibility/res/drawable-ldpi/icon.png
new file mode 100644
index 0000000..1095584
--- /dev/null
+++ b/samples/CrossCompatibility/res/drawable-ldpi/icon.png
Binary files differ
diff --git a/samples/CrossCompatibility/res/drawable-mdpi/icon.png b/samples/CrossCompatibility/res/drawable-mdpi/icon.png
new file mode 100644
index 0000000..a07c69f
--- /dev/null
+++ b/samples/CrossCompatibility/res/drawable-mdpi/icon.png
Binary files differ
diff --git a/samples/CrossCompatibility/res/drawable/icon.png b/samples/CrossCompatibility/res/drawable/icon.png
new file mode 100644
index 0000000..a07c69f
--- /dev/null
+++ b/samples/CrossCompatibility/res/drawable/icon.png
Binary files differ
diff --git a/samples/CrossCompatibility/res/values/strings.xml b/samples/CrossCompatibility/res/values/strings.xml
new file mode 100644
index 0000000..a150242
--- /dev/null
+++ b/samples/CrossCompatibility/res/values/strings.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <string name="app_name">TouchExample</string>
+</resources>
diff --git a/samples/CrossCompatibility/src/com/example/android/touchexample/TouchExampleActivity.java b/samples/CrossCompatibility/src/com/example/android/touchexample/TouchExampleActivity.java
new file mode 100644
index 0000000..aac9987
--- /dev/null
+++ b/samples/CrossCompatibility/src/com/example/android/touchexample/TouchExampleActivity.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.example.android.touchexample;
+
+import android.app.Activity;
+import android.os.Bundle;
+import android.view.ViewGroup;
+
+public class TouchExampleActivity extends Activity {
+    /** Called when the activity is first created. */
+    @Override
+    public void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        TouchExampleView view = new TouchExampleView(this);
+        view.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
+                ViewGroup.LayoutParams.MATCH_PARENT));
+
+        setContentView(view);
+    }
+}
diff --git a/samples/CrossCompatibility/src/com/example/android/touchexample/TouchExampleView.java b/samples/CrossCompatibility/src/com/example/android/touchexample/TouchExampleView.java
new file mode 100644
index 0000000..c567b0f
--- /dev/null
+++ b/samples/CrossCompatibility/src/com/example/android/touchexample/TouchExampleView.java
@@ -0,0 +1,82 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.example.android.touchexample;
+
+import android.content.Context;
+import android.graphics.Canvas;
+import android.graphics.drawable.Drawable;
+import android.util.AttributeSet;
+import android.view.MotionEvent;
+import android.view.View;
+
+public class TouchExampleView extends View {
+    private Drawable mIcon;
+    private float mPosX;
+    private float mPosY;
+
+    private VersionedGestureDetector mDetector;
+    private float mScaleFactor = 1.f;
+
+    public TouchExampleView(Context context) {
+        this(context, null, 0);
+    }
+
+    public TouchExampleView(Context context, AttributeSet attrs) {
+        this(context, attrs, 0);
+    }
+
+    public TouchExampleView(Context context, AttributeSet attrs, int defStyle) {
+        super(context, attrs, defStyle);
+        mIcon = context.getResources().getDrawable(R.drawable.icon);
+        mIcon.setBounds(0, 0, mIcon.getIntrinsicWidth(), mIcon.getIntrinsicHeight());
+
+        mDetector = VersionedGestureDetector.newInstance(context, new GestureCallback());
+    }
+
+    @Override
+    public boolean onTouchEvent(MotionEvent ev) {
+        mDetector.onTouchEvent(ev);
+        return true;
+    }
+
+    @Override
+    public void onDraw(Canvas canvas) {
+        super.onDraw(canvas);
+
+        canvas.save();
+        canvas.translate(mPosX, mPosY);
+        canvas.scale(mScaleFactor, mScaleFactor);
+        mIcon.draw(canvas);
+        canvas.restore();
+    }
+
+    private class GestureCallback implements VersionedGestureDetector.OnGestureListener {
+        public void onDrag(float dx, float dy) {
+            mPosX += dx;
+            mPosY += dy;
+            invalidate();
+        }
+
+        public void onScale(float scaleFactor) {
+            mScaleFactor *= scaleFactor;
+
+            // Don't let the object get too small or too large.
+            mScaleFactor = Math.max(0.1f, Math.min(mScaleFactor, 5.0f));
+
+            invalidate();
+        }
+    }
+}
diff --git a/samples/CrossCompatibility/src/com/example/android/touchexample/VersionedGestureDetector.java b/samples/CrossCompatibility/src/com/example/android/touchexample/VersionedGestureDetector.java
new file mode 100644
index 0000000..75d4ee2
--- /dev/null
+++ b/samples/CrossCompatibility/src/com/example/android/touchexample/VersionedGestureDetector.java
@@ -0,0 +1,165 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.example.android.touchexample;
+
+import android.content.Context;
+import android.os.Build;
+import android.util.Log;
+import android.view.MotionEvent;
+import android.view.ScaleGestureDetector;
+
+public abstract class VersionedGestureDetector {
+    private static final String TAG = "VersionedGestureDetector";
+
+    OnGestureListener mListener;
+
+    public static VersionedGestureDetector newInstance(Context context,
+            OnGestureListener listener) {
+        final int sdkVersion = Integer.parseInt(Build.VERSION.SDK);
+        VersionedGestureDetector detector = null;
+        if (sdkVersion < Build.VERSION_CODES.ECLAIR) {
+            detector = new CupcakeDetector();
+        } else if (sdkVersion < Build.VERSION_CODES.FROYO) {
+            detector = new EclairDetector();
+        } else {
+            detector = new FroyoDetector(context);
+        }
+
+        Log.d(TAG, "Created new " + detector.getClass());
+        detector.mListener = listener;
+
+        return detector;
+    }
+
+    public abstract boolean onTouchEvent(MotionEvent ev);
+
+    public interface OnGestureListener {
+        public void onDrag(float dx, float dy);
+        public void onScale(float scaleFactor);
+    }
+
+    private static class CupcakeDetector extends VersionedGestureDetector {
+        float mLastTouchX;
+        float mLastTouchY;
+
+        float getActiveX(MotionEvent ev) {
+            return ev.getX();
+        }
+
+        float getActiveY(MotionEvent ev) {
+            return ev.getY();
+        }
+
+        boolean shouldDrag() {
+            return true;
+        }
+
+        @Override
+        public boolean onTouchEvent(MotionEvent ev) {
+            switch (ev.getAction()) {
+            case MotionEvent.ACTION_DOWN: {
+                mLastTouchX = getActiveX(ev);
+                mLastTouchY = getActiveY(ev);
+                break;
+            }
+            case MotionEvent.ACTION_MOVE: {
+                final float x = getActiveX(ev);
+                final float y = getActiveY(ev);
+
+                if (shouldDrag()) {
+                    mListener.onDrag(x - mLastTouchX, y - mLastTouchY);
+                }
+
+                mLastTouchX = x;
+                mLastTouchY = y;
+                break;
+            }
+            }
+            return true;
+        }
+    }
+
+    private static class EclairDetector extends CupcakeDetector {
+        private static final int INVALID_POINTER_ID = -1;
+        private int mActivePointerId = INVALID_POINTER_ID;
+        private int mActivePointerIndex = 0;
+
+        @Override
+        float getActiveX(MotionEvent ev) {
+            return ev.getX(mActivePointerIndex);
+        }
+
+        @Override
+        float getActiveY(MotionEvent ev) {
+            return ev.getY(mActivePointerIndex);
+        }
+
+        @Override
+        public boolean onTouchEvent(MotionEvent ev) {
+            final int action = ev.getAction();
+            switch (action & MotionEvent.ACTION_MASK) {
+            case MotionEvent.ACTION_DOWN:
+                mActivePointerId = ev.getPointerId(0);
+                break;
+            case MotionEvent.ACTION_CANCEL:
+            case MotionEvent.ACTION_UP:
+                mActivePointerId = INVALID_POINTER_ID;
+                break;
+            case MotionEvent.ACTION_POINTER_UP:
+                final int pointerIndex = (ev.getAction() & MotionEvent.ACTION_POINTER_INDEX_MASK)
+                        >> MotionEvent.ACTION_POINTER_INDEX_SHIFT;
+                final int pointerId = ev.getPointerId(pointerIndex);
+                if (pointerId == mActivePointerId) {
+                    // This was our active pointer going up. Choose a new
+                    // active pointer and adjust accordingly.
+                    final int newPointerIndex = pointerIndex == 0 ? 1 : 0;
+                    mActivePointerId = ev.getPointerId(newPointerIndex);
+                    mLastTouchX = ev.getX(newPointerIndex);
+                    mLastTouchY = ev.getY(newPointerIndex);
+                }
+                break;
+            }
+
+            mActivePointerIndex = ev.findPointerIndex(mActivePointerId);
+            return super.onTouchEvent(ev);
+        }
+    }
+
+    private static class FroyoDetector extends EclairDetector {
+        private ScaleGestureDetector mDetector;
+
+        public FroyoDetector(Context context) {
+            mDetector = new ScaleGestureDetector(context,
+                    new ScaleGestureDetector.SimpleOnScaleGestureListener() {
+                @Override public boolean onScale(ScaleGestureDetector detector) {
+                    mListener.onScale(detector.getScaleFactor());
+                    return true;
+                }
+            });
+        }
+
+        @Override
+        boolean shouldDrag() {
+            return !mDetector.isInProgress();
+        }
+
+        @Override
+        public boolean onTouchEvent(MotionEvent ev) {
+            mDetector.onTouchEvent(ev);
+            return super.onTouchEvent(ev);
+        }
+    }
+}
diff --git a/samples/HeavyWeight/Android.mk b/samples/HeavyWeight/Android.mk
new file mode 100644
index 0000000..d791ae5
--- /dev/null
+++ b/samples/HeavyWeight/Android.mk
@@ -0,0 +1,17 @@
+LOCAL_PATH:= $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_TAGS := samples
+
+# Only compile source java files in this apk.
+LOCAL_SRC_FILES := $(call all-java-files-under, src)
+
+LOCAL_PACKAGE_NAME := HeavyWeight
+
+LOCAL_SDK_VERSION := current
+
+# Currently doesn't build
+#include $(BUILD_PACKAGE)
+
+# Use the following include to make our test apk.
+#include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/samples/HeavyWeight/AndroidManifest.xml b/samples/HeavyWeight/AndroidManifest.xml
new file mode 100644
index 0000000..e3a5c49
--- /dev/null
+++ b/samples/HeavyWeight/AndroidManifest.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2010 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+  
+          http://www.apache.org/licenses/LICENSE-2.0
+  
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<!-- Declare the contents of this Android application.  The namespace
+     attribute brings in the Android platform namespace, and the package
+     supplies a unique name for the application.  When writing your
+     own application, the package name must be changed from "com.example.*"
+     to come from a domain that you own or have control over. -->
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+    package="com.example.android.heavyweight">
+    <application android:label="Heavy Weight" android:cantSaveState="true">
+        <activity android:name="HeavyWeight">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN"/>
+                <category android:name="android.intent.category.LAUNCHER"/>
+            </intent-filter>
+        </activity>
+    </application>
+</manifest>
diff --git a/samples/HeavyWeight/res/layout/heavy_weight.xml b/samples/HeavyWeight/res/layout/heavy_weight.xml
new file mode 100644
index 0000000..345d75e
--- /dev/null
+++ b/samples/HeavyWeight/res/layout/heavy_weight.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2010 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+  
+          http://www.apache.org/licenses/LICENSE-2.0
+  
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:orientation="vertical" android:padding="4dip"
+    android:gravity="center_horizontal"
+    android:layout_width="match_parent" android:layout_height="match_parent">
+
+    <TextView
+        android:layout_width="match_parent" android:layout_height="wrap_content"
+        android:layout_weight="0"
+        android:paddingBottom="4dp"
+        android:text="@string/content_text"/>
+
+    <Button android:id="@+id/stop"
+        android:layout_width="wrap_content" android:layout_height="wrap_content" 
+        android:text="@string/stop">
+        <requestFocus />
+    </Button>
+
+</LinearLayout>
diff --git a/samples/HeavyWeight/res/values/strings.xml b/samples/HeavyWeight/res/values/strings.xml
new file mode 100644
index 0000000..88bc413
--- /dev/null
+++ b/samples/HeavyWeight/res/values/strings.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2010 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+  
+          http://www.apache.org/licenses/LICENSE-2.0
+  
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<resources>
+
+    <string name="content_text">A heavy-weight application will not be killed until explicitly stopped.</string>
+    <string name="stop">Stop</string>
+
+</resources>
diff --git a/samples/HeavyWeight/src/com/example/android/heavyweight/HeavyWeight.java b/samples/HeavyWeight/src/com/example/android/heavyweight/HeavyWeight.java
new file mode 100644
index 0000000..f6024e9
--- /dev/null
+++ b/samples/HeavyWeight/src/com/example/android/heavyweight/HeavyWeight.java
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.android.heavyweight;
+
+import android.app.Activity;
+import android.os.Bundle;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.widget.Button;
+
+/**
+ * Basic "heavy-weight" application, which will not be killed by Android
+ * while it is in the background.
+ */
+public class HeavyWeight extends Activity {
+    @Override
+    public void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.heavy_weight);
+        
+        Button button = (Button)findViewById(R.id.stop);
+        button.setOnClickListener(mStopListener);
+    }
+    
+    private OnClickListener mStopListener = new OnClickListener() {
+        public void onClick(View v) {
+            finish();
+        }
+    };
+}
+
diff --git a/samples/HelloActivity/src/com/example/android/helloactivity/HelloActivity.java b/samples/HelloActivity/src/com/example/android/helloactivity/HelloActivity.java
index 62bf5ca..a5a5c96 100644
--- a/samples/HelloActivity/src/com/example/android/helloactivity/HelloActivity.java
+++ b/samples/HelloActivity/src/com/example/android/helloactivity/HelloActivity.java
@@ -24,9 +24,6 @@
  * A minimal "Hello, World!" application.
  */
 public class HelloActivity extends Activity {
-    public HelloActivity() {
-    }
-
     /**
      * Called with the activity is first created.
      */
diff --git a/samples/NotePad/AndroidManifest.xml b/samples/NotePad/AndroidManifest.xml
index 04f4dbe..b87dfe3 100644
--- a/samples/NotePad/AndroidManifest.xml
+++ b/samples/NotePad/AndroidManifest.xml
@@ -20,16 +20,15 @@
      own application, the package name must be changed from "com.example.*"
      to come from a domain that you own or have control over. -->
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.android.notepad"
->
-    <application android:icon="@drawable/app_notes"
-        android:label="@string/app_name"
-    >
-        <provider android:name="NotePadProvider"
-            android:authorities="com.google.provider.NotePad"
-        />
+    package="com.example.android.notepad" >
 
-        <activity android:name="NotesList" android:label="@string/title_notes_list">
+    <application android:icon="@drawable/app_notes"
+        android:label="@string/app_name" >
+        <provider android:name="NotePadProvider"
+            android:authorities="com.example.notepad.provider.NotePad" />
+
+        <activity android:name="NotesList"
+            android:label="@string/title_notes_list">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
                 <category android:name="android.intent.category.LAUNCHER" />
@@ -50,16 +49,13 @@
 
         <activity android:name="NoteEditor"
             android:theme="@android:style/Theme.Light"
-            android:label="@string/title_note"
-            android:screenOrientation="sensor"
-            android:configChanges="keyboardHidden|orientation"
-        >
+            android:configChanges="keyboardHidden|orientation">
             <!-- This filter says that we can view or edit the data of
                  a single note -->
             <intent-filter android:label="@string/resolve_edit">
                 <action android:name="android.intent.action.VIEW" />
                 <action android:name="android.intent.action.EDIT" />
-                <action android:name="com.android.notepad.action.EDIT_NOTE" />
+                <action android:name="com.android.notes.action.EDIT_NOTE" />
                 <category android:name="android.intent.category.DEFAULT" />
                 <data android:mimeType="vnd.android.cursor.item/vnd.google.note" />
             </intent-filter>
@@ -77,6 +73,7 @@
         <activity android:name="TitleEditor"
             android:label="@string/title_edit_title"
             android:theme="@android:style/Theme.Dialog"
+            android:icon="@drawable/ic_menu_edit"
             android:windowSoftInputMode="stateVisible">
             <!-- This activity implements an alternative action that can be
                  performed on notes: editing their title.  It can be used as
@@ -110,6 +107,6 @@
 
     </application>
 
-    <uses-sdk android:targetSdkVersion="4" android:minSdkVersion="3"/>
+    <uses-sdk android:minSdkVersion="3" android:targetSdkVersion="4"/>
 </manifest>
 
diff --git a/samples/NotePad/res/drawable-hdpi-v6/app_notes.png b/samples/NotePad/res/drawable-hdpi-v6/app_notes.png
deleted file mode 100644
index 3491823..0000000
--- a/samples/NotePad/res/drawable-hdpi-v6/app_notes.png
+++ /dev/null
Binary files differ
diff --git a/samples/NotePad/res/drawable-hdpi/app_notes.png b/samples/NotePad/res/drawable-hdpi/app_notes.png
old mode 100755
new mode 100644
index 258d3d1..3491823
--- a/samples/NotePad/res/drawable-hdpi/app_notes.png
+++ b/samples/NotePad/res/drawable-hdpi/app_notes.png
Binary files differ
diff --git a/samples/NotePad/res/drawable-hdpi/ic_menu_compose.png b/samples/NotePad/res/drawable-hdpi/ic_menu_compose.png
new file mode 100644
index 0000000..6ad379e
--- /dev/null
+++ b/samples/NotePad/res/drawable-hdpi/ic_menu_compose.png
Binary files differ
diff --git a/samples/NotePad/res/drawable-hdpi/ic_menu_delete.png b/samples/NotePad/res/drawable-hdpi/ic_menu_delete.png
new file mode 100644
index 0000000..2aed26a
--- /dev/null
+++ b/samples/NotePad/res/drawable-hdpi/ic_menu_delete.png
Binary files differ
diff --git a/samples/NotePad/res/drawable-hdpi/ic_menu_discard.png b/samples/NotePad/res/drawable-hdpi/ic_menu_discard.png
new file mode 100644
index 0000000..a54ea9d
--- /dev/null
+++ b/samples/NotePad/res/drawable-hdpi/ic_menu_discard.png
Binary files differ
diff --git a/samples/NotePad/res/drawable-hdpi/ic_menu_edit.png b/samples/NotePad/res/drawable-hdpi/ic_menu_edit.png
new file mode 100644
index 0000000..602dd10
--- /dev/null
+++ b/samples/NotePad/res/drawable-hdpi/ic_menu_edit.png
Binary files differ
diff --git a/samples/NotePad/res/drawable-hdpi/ic_menu_revert.png b/samples/NotePad/res/drawable-hdpi/ic_menu_revert.png
new file mode 100644
index 0000000..11860a4
--- /dev/null
+++ b/samples/NotePad/res/drawable-hdpi/ic_menu_revert.png
Binary files differ
diff --git a/samples/NotePad/res/drawable-hdpi/ic_menu_save.png b/samples/NotePad/res/drawable-hdpi/ic_menu_save.png
new file mode 100644
index 0000000..fc26c5d
--- /dev/null
+++ b/samples/NotePad/res/drawable-hdpi/ic_menu_save.png
Binary files differ
diff --git a/samples/NotePad/res/drawable-hdpi-v6/live_folder_notes.png b/samples/NotePad/res/drawable-hdpi/live_folder_notes.png
similarity index 100%
rename from samples/NotePad/res/drawable-hdpi-v6/live_folder_notes.png
rename to samples/NotePad/res/drawable-hdpi/live_folder_notes.png
Binary files differ
diff --git a/samples/NotePad/res/drawable-ldpi-v6/app_notes.png b/samples/NotePad/res/drawable-ldpi/app_notes.png
similarity index 100%
rename from samples/NotePad/res/drawable-ldpi-v6/app_notes.png
rename to samples/NotePad/res/drawable-ldpi/app_notes.png
Binary files differ
diff --git a/samples/NotePad/res/drawable-ldpi-v6/live_folder_notes.png b/samples/NotePad/res/drawable-ldpi/live_folder_notes.png
similarity index 100%
rename from samples/NotePad/res/drawable-ldpi-v6/live_folder_notes.png
rename to samples/NotePad/res/drawable-ldpi/live_folder_notes.png
Binary files differ
diff --git a/samples/NotePad/res/drawable-mdpi/app_notes.png b/samples/NotePad/res/drawable-mdpi/app_notes.png
deleted file mode 100644
index 0479138..0000000
--- a/samples/NotePad/res/drawable-mdpi/app_notes.png
+++ /dev/null
Binary files differ
diff --git a/samples/NotePad/res/drawable-mdpi/live_folder_notes.png b/samples/NotePad/res/drawable-mdpi/live_folder_notes.png
deleted file mode 100644
index ac54a49..0000000
--- a/samples/NotePad/res/drawable-mdpi/live_folder_notes.png
+++ /dev/null
Binary files differ
diff --git a/samples/NotePad/res/drawable-mdpi-v6/app_notes.png b/samples/NotePad/res/drawable/app_notes.png
similarity index 100%
rename from samples/NotePad/res/drawable-mdpi-v6/app_notes.png
rename to samples/NotePad/res/drawable/app_notes.png
Binary files differ
diff --git a/samples/NotePad/res/drawable/ic_menu_compose.png b/samples/NotePad/res/drawable/ic_menu_compose.png
new file mode 100644
index 0000000..1b4733e
--- /dev/null
+++ b/samples/NotePad/res/drawable/ic_menu_compose.png
Binary files differ
diff --git a/samples/NotePad/res/drawable/ic_menu_delete.png b/samples/NotePad/res/drawable/ic_menu_delete.png
new file mode 100755
index 0000000..7d95494
--- /dev/null
+++ b/samples/NotePad/res/drawable/ic_menu_delete.png
Binary files differ
diff --git a/samples/NotePad/res/drawable/ic_menu_discard.png b/samples/NotePad/res/drawable/ic_menu_discard.png
new file mode 100644
index 0000000..78222ea
--- /dev/null
+++ b/samples/NotePad/res/drawable/ic_menu_discard.png
Binary files differ
diff --git a/samples/NotePad/res/drawable/ic_menu_edit.png b/samples/NotePad/res/drawable/ic_menu_edit.png
new file mode 100755
index 0000000..41a9c2e
--- /dev/null
+++ b/samples/NotePad/res/drawable/ic_menu_edit.png
Binary files differ
diff --git a/samples/NotePad/res/drawable/ic_menu_revert.png b/samples/NotePad/res/drawable/ic_menu_revert.png
new file mode 100644
index 0000000..e7e04f5
--- /dev/null
+++ b/samples/NotePad/res/drawable/ic_menu_revert.png
Binary files differ
diff --git a/samples/NotePad/res/drawable/ic_menu_save.png b/samples/NotePad/res/drawable/ic_menu_save.png
new file mode 100644
index 0000000..36d50b3
--- /dev/null
+++ b/samples/NotePad/res/drawable/ic_menu_save.png
Binary files differ
diff --git a/samples/NotePad/res/drawable-mdpi-v6/live_folder_notes.png b/samples/NotePad/res/drawable/live_folder_notes.png
similarity index 100%
rename from samples/NotePad/res/drawable-mdpi-v6/live_folder_notes.png
rename to samples/NotePad/res/drawable/live_folder_notes.png
Binary files differ
diff --git a/samples/NotePad/res/layout/note_editor.xml b/samples/NotePad/res/layout/note_editor.xml
index d7da99e..f142c71 100644
--- a/samples/NotePad/res/layout/note_editor.xml
+++ b/samples/NotePad/res/layout/note_editor.xml
@@ -13,17 +13,15 @@
      See the License for the specific language governing permissions and
      limitations under the License.
 -->
-
 <view xmlns:android="http://schemas.android.com/apk/res/android"
     class="com.example.android.notepad.NoteEditor$LinedEditText"
     android:id="@+id/note"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
+    android:layout_width="fill_parent"
+    android:layout_height="fill_parent"
     android:background="@android:color/transparent"
-    android:padding="5dip"
+    android:padding="5dp"
     android:scrollbars="vertical"
     android:fadingEdge="vertical"
     android:gravity="top"
     android:textSize="22sp"
-    android:capitalize="sentences"
-/>
+    android:capitalize="sentences" />
diff --git a/samples/NotePad/res/layout/noteslist_item.xml b/samples/NotePad/res/layout/noteslist_item.xml
index e11c5ee..b167734 100644
--- a/samples/NotePad/res/layout/noteslist_item.xml
+++ b/samples/NotePad/res/layout/noteslist_item.xml
@@ -16,7 +16,7 @@
 
 <TextView xmlns:android="http://schemas.android.com/apk/res/android"
     android:id="@android:id/text1"
-    android:layout_width="match_parent"
+    android:layout_width="fill_parent"
     android:layout_height="?android:attr/listPreferredItemHeight"
     android:textAppearance="?android:attr/textAppearanceLarge"
     android:gravity="center_vertical"
diff --git a/samples/NotePad/res/menu/editor_options_menu.xml b/samples/NotePad/res/menu/editor_options_menu.xml
new file mode 100644
index 0000000..b2d14ac
--- /dev/null
+++ b/samples/NotePad/res/menu/editor_options_menu.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<menu xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:id="@+id/menu_save"
+          android:icon="@drawable/ic_menu_save"
+          android:alphabeticShortcut='s'
+          android:title="@string/menu_save" />
+    <group android:id="@+id/menu_group_edit">
+        <item android:id="@+id/menu_revert"
+              android:icon="@drawable/ic_menu_revert"
+              android:title="@string/menu_revert" />
+        <item android:id="@+id/menu_delete"
+              android:icon="@drawable/ic_menu_delete"
+              android:title="@string/menu_delete" />
+    </group>
+    <group android:id="@+id/menu_group_insert">
+        <item android:id="@+id/menu_discard"
+              android:icon="@drawable/ic_menu_discard"
+              android:title="@string/menu_discard" />
+    </group>
+</menu>
\ No newline at end of file
diff --git a/samples/NotePad/res/menu/list_context_menu.xml b/samples/NotePad/res/menu/list_context_menu.xml
new file mode 100644
index 0000000..acc8edd
--- /dev/null
+++ b/samples/NotePad/res/menu/list_context_menu.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<menu xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:id="@+id/context_open"
+          android:title="@string/menu_open" />
+    <item android:id="@+id/context_delete"
+          android:title="@string/menu_delete" />
+</menu>
\ No newline at end of file
diff --git a/samples/NotePad/res/menu/list_options_menu.xml b/samples/NotePad/res/menu/list_options_menu.xml
new file mode 100644
index 0000000..9754554
--- /dev/null
+++ b/samples/NotePad/res/menu/list_options_menu.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<menu xmlns:android="http://schemas.android.com/apk/res/android">
+    <!--  This is our one standard application action (creating a new note). -->
+    <item android:id="@+id/menu_add"
+          android:icon="@drawable/ic_menu_compose"
+          android:alphabeticShortcut='a'
+          android:title="@string/menu_add" />
+</menu>
\ No newline at end of file
diff --git a/samples/NotePad/res/values/strings.xml b/samples/NotePad/res/values/strings.xml
index 168db92..4100652 100644
--- a/samples/NotePad/res/values/strings.xml
+++ b/samples/NotePad/res/values/strings.xml
@@ -15,25 +15,28 @@
 -->
 
 <resources>
-    <string name="menu_delete">Delete</string>
-    <string name="menu_insert">Add note</string>
-    <string name="menu_revert">Revert</string>
-    <string name="menu_discard">Discard</string>
-
-    <string name="resolve_edit">Edit note</string>
-    <string name="resolve_title">Edit title</string>  
-
+    <string name="app_name">NotePad</string>
+    <string name="live_folder_name">Notes</string>
+    
+    <string name="title_edit_title">Note title:</string>
     <string name="title_create">Create note</string>
-    <string name="title_edit">Edit note</string>
-	<string name="title_notes_list">Note pad</string>   
-	<string name="title_note">Note</string>  
-	<string name="title_edit_title">Note title:</string>  
-	
-	<string name="app_name">Note Pad</string>  
-	<string name="live_folder_name">Notes</string>
-	
-	<string name="button_ok">OK</string>  
-	
-	<string name="error_title">Error</string>
-	<string name="error_message">Error loading note</string>
-</resources>
+    <string name="title_edit">Edit: \"%1$s\"</string>
+    <string name="title_notes_list">Notes</string>
+    
+    <string name="menu_add">Add note</string>
+    <string name="menu_save">Save</string>
+    <string name="menu_delete">Delete</string>
+    <string name="menu_open">Open</string>
+    <string name="menu_revert">Revert changes</string>
+    <string name="menu_discard">Discard</string>
+    
+    <string name="button_ok">OK</string>  
+    <string name="text_title">Title:</string>
+    
+    <string name="resolve_edit">Edit note</string>
+    <string name="resolve_title">Edit title</string>
+    
+    <string name="error_title">Error</string>
+    <string name="error_message">Error loading note</string>
+    <string name="nothing_to_save">There is nothing to save</string>
+</resources>
\ No newline at end of file
diff --git a/samples/NotePad/src/com/example/android/notepad/NoteEditor.java b/samples/NotePad/src/com/example/android/notepad/NoteEditor.java
index e45efd8..66f4ce6 100644
--- a/samples/NotePad/src/com/example/android/notepad/NoteEditor.java
+++ b/samples/NotePad/src/com/example/android/notepad/NoteEditor.java
@@ -16,13 +16,12 @@
 
 package com.example.android.notepad;
 
-import com.example.android.notepad.NotePad.Notes;
-
 import android.app.Activity;
 import android.content.ComponentName;
 import android.content.ContentValues;
 import android.content.Context;
 import android.content.Intent;
+import android.content.res.Resources;
 import android.database.Cursor;
 import android.graphics.Canvas;
 import android.graphics.Paint;
@@ -32,8 +31,12 @@
 import android.util.AttributeSet;
 import android.util.Log;
 import android.view.Menu;
+import android.view.MenuInflater;
 import android.view.MenuItem;
 import android.widget.EditText;
+import android.widget.Toast;
+
+import com.example.android.notepad.NotePad.NoteColumns;
 
 /**
  * A generic activity for editing a note in a database.  This can be used
@@ -41,32 +44,29 @@
  * {@link Intent#ACTION_EDIT}, or create a new note {@link Intent#ACTION_INSERT}.  
  */
 public class NoteEditor extends Activity {
-    private static final String TAG = "Notes";
+    private static final String TAG = "NoteEditor";
 
     /**
      * Standard projection for the interesting columns of a normal note.
      */
     private static final String[] PROJECTION = new String[] {
-            Notes._ID, // 0
-            Notes.NOTE, // 1
+        NoteColumns._ID, // 0
+        NoteColumns.NOTE, // 1
+        NoteColumns.TITLE, // 2
     };
     /** The index of the note column */
     private static final int COLUMN_INDEX_NOTE = 1;
+    /** The index of the title column */
+    private static final int COLUMN_INDEX_TITLE = 2;
     
     // This is our state data that is stored when freezing.
     private static final String ORIGINAL_CONTENT = "origContent";
 
-    // Identifiers for our menu items.
-    private static final int REVERT_ID = Menu.FIRST;
-    private static final int DISCARD_ID = Menu.FIRST + 1;
-    private static final int DELETE_ID = Menu.FIRST + 2;
-
     // The different distinct states the activity can be run in.
     private static final int STATE_EDIT = 0;
     private static final int STATE_INSERT = 1;
 
     private int mState;
-    private boolean mNoteOnly = false;
     private Uri mUri;
     private Cursor mCursor;
     private EditText mText;
@@ -112,7 +112,6 @@
         final Intent intent = getIntent();
 
         // Do some setup based on the action being performed.
-
         final String action = intent.getAction();
         if (Intent.ACTION_EDIT.equals(action)) {
             // Requested to edit: set that state, and the data being edited.
@@ -163,16 +162,21 @@
     @Override
     protected void onResume() {
         super.onResume();
-
         // If we didn't have any trouble retrieving the data, it is now
         // time to get at the stuff.
         if (mCursor != null) {
+            // Requery in case something changed while paused (such as the title)
+            mCursor.requery();
             // Make sure we are at the one and only row in the cursor.
             mCursor.moveToFirst();
 
             // Modify our overall title depending on the mode we are running in.
             if (mState == STATE_EDIT) {
-                setTitle(getText(R.string.title_edit));
+                // Set the title of the Activity to include the note title
+                String title = mCursor.getString(COLUMN_INDEX_TITLE);
+                Resources res = getResources();
+                String text = String.format(res.getString(R.string.title_edit), title);
+                setTitle(text);
             } else if (mState == STATE_INSERT) {
                 setTitle(getText(R.string.title_create));
             }
@@ -206,109 +210,129 @@
     @Override
     protected void onPause() {
         super.onPause();
+        // The user is going somewhere, so make sure changes are saved
 
-        // The user is going somewhere else, so make sure their current
-        // changes are safely saved away in the provider.  We don't need
-        // to do this if only editing.
-        if (mCursor != null) {
-            String text = mText.getText().toString();
-            int length = text.length();
+        String text = mText.getText().toString();
+        int length = text.length();
 
-            // If this activity is finished, and there is no text, then we
-            // do something a little special: simply delete the note entry.
-            // Note that we do this both for editing and inserting...  it
-            // would be reasonable to only do it when inserting.
-            if (isFinishing() && (length == 0) && !mNoteOnly) {
-                setResult(RESULT_CANCELED);
-                deleteNote();
-
-            // Get out updates into the provider.
-            } else {
-                ContentValues values = new ContentValues();
-
-                // This stuff is only done when working with a full-fledged note.
-                if (!mNoteOnly) {
-                    // Bump the modification time to now.
-                    values.put(Notes.MODIFIED_DATE, System.currentTimeMillis());
-
-                    // If we are creating a new note, then we want to also create
-                    // an initial title for it.
-                    if (mState == STATE_INSERT) {
-                        String title = text.substring(0, Math.min(30, length));
-                        if (length > 30) {
-                            int lastSpace = title.lastIndexOf(' ');
-                            if (lastSpace > 0) {
-                                title = title.substring(0, lastSpace);
-                            }
-                        }
-                        values.put(Notes.TITLE, title);
-                    }
-                }
-
-                // Write our text back into the provider.
-                values.put(Notes.NOTE, text);
-
-                // Commit all of our changes to persistent storage. When the update completes
-                // the content provider will notify the cursor of the change, which will
-                // cause the UI to be updated.
-                getContentResolver().update(mUri, values, null, null);
-            }
+        // If this activity is finished, and there is no text, then we
+        // simply delete the note entry.
+        // Note that we do this both for editing and inserting...  it
+        // would be reasonable to only do it when inserting.
+        if (isFinishing() && (length == 0) && mCursor != null) {
+            setResult(RESULT_CANCELED);
+            deleteNote();
+        } else {
+            saveNote();
         }
     }
 
     @Override
     public boolean onCreateOptionsMenu(Menu menu) {
-        super.onCreateOptionsMenu(menu);
+        // Inflate menu from XML resource
+        MenuInflater inflater = getMenuInflater();
+        inflater.inflate(R.menu.editor_options_menu, menu);
 
-        // Build the menus that are shown when editing.
-        if (mState == STATE_EDIT) {
-            menu.add(0, REVERT_ID, 0, R.string.menu_revert)
-                    .setShortcut('0', 'r')
-                    .setIcon(android.R.drawable.ic_menu_revert);
-            if (!mNoteOnly) {
-                menu.add(0, DELETE_ID, 0, R.string.menu_delete)
-                        .setShortcut('1', 'd')
-                        .setIcon(android.R.drawable.ic_menu_delete);
-            }
-
-        // Build the menus that are shown when inserting.
-        } else {
-            menu.add(0, DISCARD_ID, 0, R.string.menu_discard)
-                    .setShortcut('0', 'd')
-                    .setIcon(android.R.drawable.ic_menu_delete);
-        }
-
-        // If we are working on a full note, then append to the
+        // Append to the
         // menu items for any other activities that can do stuff with it
         // as well.  This does a query on the system for any activities that
         // implement the ALTERNATIVE_ACTION for our data, adding a menu item
         // for each one that is found.
-        if (!mNoteOnly) {
-            Intent intent = new Intent(null, getIntent().getData());
-            intent.addCategory(Intent.CATEGORY_ALTERNATIVE);
-            menu.addIntentOptions(Menu.CATEGORY_ALTERNATIVE, 0, 0,
-                    new ComponentName(this, NoteEditor.class), null, intent, 0, null);
-        }
+        Intent intent = new Intent(null, getIntent().getData());
+        intent.addCategory(Intent.CATEGORY_ALTERNATIVE);
+        menu.addIntentOptions(Menu.CATEGORY_ALTERNATIVE, 0, 0,
+                new ComponentName(this, NoteEditor.class), null, intent, 0, null);
 
-        return true;
+        return super.onCreateOptionsMenu(menu);
+    }
+    
+    
+
+    @Override
+    public boolean onPrepareOptionsMenu(Menu menu) {
+        if (mState == STATE_EDIT) {
+            menu.setGroupVisible(R.id.menu_group_edit, true);
+            menu.setGroupVisible(R.id.menu_group_insert, false);
+            
+            // Check if note has changed and enable/disable the revert option
+            String savedNote = mCursor.getString(COLUMN_INDEX_NOTE);
+            String currentNote = mText.getText().toString();
+            if (savedNote.equals(currentNote)) {
+                menu.findItem(R.id.menu_revert).setEnabled(false);
+            } else {
+                menu.findItem(R.id.menu_revert).setEnabled(true);
+            }
+        } else {
+            menu.setGroupVisible(R.id.menu_group_edit, false);
+            menu.setGroupVisible(R.id.menu_group_insert, true);
+        }
+        return super.onPrepareOptionsMenu(menu);
     }
 
     @Override
     public boolean onOptionsItemSelected(MenuItem item) {
         // Handle all of the possible menu actions.
         switch (item.getItemId()) {
-        case DELETE_ID:
+        case R.id.menu_save:
+            saveNote();
+            finish();
+            break;
+        case R.id.menu_delete:
             deleteNote();
             finish();
             break;
-        case DISCARD_ID:
-            cancelNote();
-            break;
-        case REVERT_ID:
+        case R.id.menu_revert:
+        case R.id.menu_discard:
             cancelNote();
             break;
         }
         return super.onOptionsItemSelected(item);
+        
+    }
+    
+    private final void saveNote() {
+        // Make sure their current
+        // changes are safely saved away in the provider.  We don't need
+        // to do this if only editing.
+        if (mCursor != null) {
+            // Get out updates into the provider.
+            ContentValues values = new ContentValues();
+
+            // Bump the modification time to now.
+            values.put(NoteColumns.MODIFIED_DATE, System.currentTimeMillis());
+
+            String text = mText.getText().toString();
+            int length = text.length();
+            // If we are creating a new note, then we want to also create
+            // an initial title for it.
+            if (mState == STATE_INSERT) {
+                if (length == 0) {
+                    Toast.makeText(this, R.string.nothing_to_save, Toast.LENGTH_SHORT).show();
+                    return;
+                }
+                String title = text.substring(0, Math.min(30, length));
+                if (length > 30) {
+                    int lastSpace = title.lastIndexOf(' ');
+                    if (lastSpace > 0) {
+                        title = title.substring(0, lastSpace);
+                    }
+                }
+                values.put(NoteColumns.TITLE, title);
+            }
+
+            // Write our text back into the provider.
+            values.put(NoteColumns.NOTE, text);
+
+            // Commit all of our changes to persistent storage. When the update completes
+            // the content provider will notify the cursor of the change, which will
+            // cause the UI to be updated.
+            try {
+                getContentResolver().update(mUri, values, null, null);
+            } catch (NullPointerException e) {
+                Log.e(TAG, e.getMessage());
+            }
+            
+        }
     }
 
     /**
@@ -322,7 +346,7 @@
                 mCursor.close();
                 mCursor = null;
                 ContentValues values = new ContentValues();
-                values.put(Notes.NOTE, mOriginalContent);
+                values.put(NoteColumns.NOTE, mOriginalContent);
                 getContentResolver().update(mUri, values, null, null);
             } else if (mState == STATE_INSERT) {
                 // We inserted an empty note, make sure to delete it
diff --git a/samples/NotePad/src/com/example/android/notepad/NotePad.java b/samples/NotePad/src/com/example/android/notepad/NotePad.java
index 25be23e..09087db 100644
--- a/samples/NotePad/src/com/example/android/notepad/NotePad.java
+++ b/samples/NotePad/src/com/example/android/notepad/NotePad.java
@@ -23,7 +23,7 @@
  * Convenience definitions for NotePadProvider
  */
 public final class NotePad {
-    public static final String AUTHORITY = "com.google.provider.NotePad";
+    public static final String AUTHORITY = "com.example.notepad.provider.NotePad";
 
     // This class cannot be instantiated
     private NotePad() {}
@@ -31,9 +31,9 @@
     /**
      * Notes table
      */
-    public static final class Notes implements BaseColumns {
+    public static final class NoteColumns implements BaseColumns {
         // This class cannot be instantiated
-        private Notes() {}
+        private NoteColumns() {}
 
         /**
          * The content:// style URL for this table
diff --git a/samples/NotePad/src/com/example/android/notepad/NotePadProvider.java b/samples/NotePad/src/com/example/android/notepad/NotePadProvider.java
index 58cdc8f..5c349c5 100644
--- a/samples/NotePad/src/com/example/android/notepad/NotePadProvider.java
+++ b/samples/NotePad/src/com/example/android/notepad/NotePadProvider.java
@@ -16,7 +16,7 @@
 
 package com.example.android.notepad;
 
-import com.example.android.notepad.NotePad.Notes;
+import com.example.android.notepad.NotePad.NoteColumns;
 
 import android.content.ContentProvider;
 import android.content.ContentUris;
@@ -44,7 +44,7 @@
 
     private static final String TAG = "NotePadProvider";
 
-    private static final String DATABASE_NAME = "note_pad.db";
+    private static final String DATABASE_NAME = "notepad.db";
     private static final int DATABASE_VERSION = 2;
     private static final String NOTES_TABLE_NAME = "notes";
 
@@ -69,11 +69,11 @@
         @Override
         public void onCreate(SQLiteDatabase db) {
             db.execSQL("CREATE TABLE " + NOTES_TABLE_NAME + " ("
-                    + Notes._ID + " INTEGER PRIMARY KEY,"
-                    + Notes.TITLE + " TEXT,"
-                    + Notes.NOTE + " TEXT,"
-                    + Notes.CREATED_DATE + " INTEGER,"
-                    + Notes.MODIFIED_DATE + " INTEGER"
+                    + NoteColumns._ID + " INTEGER PRIMARY KEY,"
+                    + NoteColumns.TITLE + " TEXT,"
+                    + NoteColumns.NOTE + " TEXT,"
+                    + NoteColumns.CREATED_DATE + " INTEGER,"
+                    + NoteColumns.MODIFIED_DATE + " INTEGER"
                     + ");");
         }
 
@@ -107,7 +107,7 @@
 
         case NOTE_ID:
             qb.setProjectionMap(sNotesProjectionMap);
-            qb.appendWhere(Notes._ID + "=" + uri.getPathSegments().get(1));
+            qb.appendWhere(NoteColumns._ID + "=" + uri.getPathSegments().get(1));
             break;
 
         case LIVE_FOLDER_NOTES:
@@ -121,7 +121,7 @@
         // If no sort order is specified use the default
         String orderBy;
         if (TextUtils.isEmpty(sortOrder)) {
-            orderBy = NotePad.Notes.DEFAULT_SORT_ORDER;
+            orderBy = NoteColumns.DEFAULT_SORT_ORDER;
         } else {
             orderBy = sortOrder;
         }
@@ -140,10 +140,10 @@
         switch (sUriMatcher.match(uri)) {
         case NOTES:
         case LIVE_FOLDER_NOTES:
-            return Notes.CONTENT_TYPE;
+            return NoteColumns.CONTENT_TYPE;
 
         case NOTE_ID:
-            return Notes.CONTENT_ITEM_TYPE;
+            return NoteColumns.CONTENT_ITEM_TYPE;
 
         default:
             throw new IllegalArgumentException("Unknown URI " + uri);
@@ -167,27 +167,27 @@
         Long now = Long.valueOf(System.currentTimeMillis());
 
         // Make sure that the fields are all set
-        if (values.containsKey(NotePad.Notes.CREATED_DATE) == false) {
-            values.put(NotePad.Notes.CREATED_DATE, now);
+        if (values.containsKey(NoteColumns.CREATED_DATE) == false) {
+            values.put(NoteColumns.CREATED_DATE, now);
         }
 
-        if (values.containsKey(NotePad.Notes.MODIFIED_DATE) == false) {
-            values.put(NotePad.Notes.MODIFIED_DATE, now);
+        if (values.containsKey(NoteColumns.MODIFIED_DATE) == false) {
+            values.put(NoteColumns.MODIFIED_DATE, now);
         }
 
-        if (values.containsKey(NotePad.Notes.TITLE) == false) {
+        if (values.containsKey(NoteColumns.TITLE) == false) {
             Resources r = Resources.getSystem();
-            values.put(NotePad.Notes.TITLE, r.getString(android.R.string.untitled));
+            values.put(NoteColumns.TITLE, r.getString(android.R.string.untitled));
         }
 
-        if (values.containsKey(NotePad.Notes.NOTE) == false) {
-            values.put(NotePad.Notes.NOTE, "");
+        if (values.containsKey(NoteColumns.NOTE) == false) {
+            values.put(NoteColumns.NOTE, "");
         }
 
         SQLiteDatabase db = mOpenHelper.getWritableDatabase();
-        long rowId = db.insert(NOTES_TABLE_NAME, Notes.NOTE, values);
+        long rowId = db.insert(NOTES_TABLE_NAME, NoteColumns.NOTE, values);
         if (rowId > 0) {
-            Uri noteUri = ContentUris.withAppendedId(NotePad.Notes.CONTENT_URI, rowId);
+            Uri noteUri = ContentUris.withAppendedId(NoteColumns.CONTENT_URI, rowId);
             getContext().getContentResolver().notifyChange(noteUri, null);
             return noteUri;
         }
@@ -206,7 +206,7 @@
 
         case NOTE_ID:
             String noteId = uri.getPathSegments().get(1);
-            count = db.delete(NOTES_TABLE_NAME, Notes._ID + "=" + noteId
+            count = db.delete(NOTES_TABLE_NAME, NoteColumns._ID + "=" + noteId
                     + (!TextUtils.isEmpty(where) ? " AND (" + where + ')' : ""), whereArgs);
             break;
 
@@ -229,7 +229,7 @@
 
         case NOTE_ID:
             String noteId = uri.getPathSegments().get(1);
-            count = db.update(NOTES_TABLE_NAME, values, Notes._ID + "=" + noteId
+            count = db.update(NOTES_TABLE_NAME, values, NoteColumns._ID + "=" + noteId
                     + (!TextUtils.isEmpty(where) ? " AND (" + where + ')' : ""), whereArgs);
             break;
 
@@ -248,17 +248,17 @@
         sUriMatcher.addURI(NotePad.AUTHORITY, "live_folders/notes", LIVE_FOLDER_NOTES);
 
         sNotesProjectionMap = new HashMap<String, String>();
-        sNotesProjectionMap.put(Notes._ID, Notes._ID);
-        sNotesProjectionMap.put(Notes.TITLE, Notes.TITLE);
-        sNotesProjectionMap.put(Notes.NOTE, Notes.NOTE);
-        sNotesProjectionMap.put(Notes.CREATED_DATE, Notes.CREATED_DATE);
-        sNotesProjectionMap.put(Notes.MODIFIED_DATE, Notes.MODIFIED_DATE);
+        sNotesProjectionMap.put(NoteColumns._ID, NoteColumns._ID);
+        sNotesProjectionMap.put(NoteColumns.TITLE, NoteColumns.TITLE);
+        sNotesProjectionMap.put(NoteColumns.NOTE, NoteColumns.NOTE);
+        sNotesProjectionMap.put(NoteColumns.CREATED_DATE, NoteColumns.CREATED_DATE);
+        sNotesProjectionMap.put(NoteColumns.MODIFIED_DATE, NoteColumns.MODIFIED_DATE);
 
         // Support for Live Folders.
         sLiveFolderProjectionMap = new HashMap<String, String>();
-        sLiveFolderProjectionMap.put(LiveFolders._ID, Notes._ID + " AS " +
+        sLiveFolderProjectionMap.put(LiveFolders._ID, NoteColumns._ID + " AS " +
                 LiveFolders._ID);
-        sLiveFolderProjectionMap.put(LiveFolders.NAME, Notes.TITLE + " AS " +
+        sLiveFolderProjectionMap.put(LiveFolders.NAME, NoteColumns.TITLE + " AS " +
                 LiveFolders.NAME);
         // Add more columns here for more robust Live Folders.
     }
diff --git a/samples/NotePad/src/com/example/android/notepad/NotesList.java b/samples/NotePad/src/com/example/android/notepad/NotesList.java
index ceaaa3c..ec80902 100644
--- a/samples/NotePad/src/com/example/android/notepad/NotesList.java
+++ b/samples/NotePad/src/com/example/android/notepad/NotesList.java
@@ -16,8 +16,6 @@
 
 package com.example.android.notepad;
 
-import com.example.android.notepad.NotePad.Notes;
-
 import android.app.ListActivity;
 import android.content.ComponentName;
 import android.content.ContentUris;
@@ -28,6 +26,7 @@
 import android.util.Log;
 import android.view.ContextMenu;
 import android.view.Menu;
+import android.view.MenuInflater;
 import android.view.MenuItem;
 import android.view.View;
 import android.view.ContextMenu.ContextMenuInfo;
@@ -35,24 +34,22 @@
 import android.widget.ListView;
 import android.widget.SimpleCursorAdapter;
 
+import com.example.android.notepad.NotePad.NoteColumns;
+
 /**
  * Displays a list of notes. Will display notes from the {@link Uri}
  * provided in the intent if there is one, otherwise defaults to displaying the
- * contents of the {@link NotePadProvider}
+ * contents of the {@link NoteProvider}
  */
 public class NotesList extends ListActivity {
     private static final String TAG = "NotesList";
 
-    // Menu item ids
-    public static final int MENU_ITEM_DELETE = Menu.FIRST;
-    public static final int MENU_ITEM_INSERT = Menu.FIRST + 1;
-
     /**
      * The columns we are interested in from the database
      */
     private static final String[] PROJECTION = new String[] {
-            Notes._ID, // 0
-            Notes.TITLE, // 1
+        NoteColumns._ID, // 0
+        NoteColumns.TITLE, // 1
     };
 
     /** The index of the title column */
@@ -68,7 +65,7 @@
         // as a MAIN activity), then use our default content provider.
         Intent intent = getIntent();
         if (intent.getData() == null) {
-            intent.setData(Notes.CONTENT_URI);
+            intent.setData(NoteColumns.CONTENT_URI);
         }
 
         // Inform the list we provide context menus for items
@@ -77,24 +74,20 @@
         // Perform a managed query. The Activity will handle closing and requerying the cursor
         // when needed.
         Cursor cursor = managedQuery(getIntent().getData(), PROJECTION, null, null,
-                Notes.DEFAULT_SORT_ORDER);
+                                        NoteColumns.DEFAULT_SORT_ORDER);
 
         // Used to map notes entries from the database to views
         SimpleCursorAdapter adapter = new SimpleCursorAdapter(this, R.layout.noteslist_item, cursor,
-                new String[] { Notes.TITLE }, new int[] { android.R.id.text1 });
+                new String[] { NoteColumns.TITLE }, new int[] { android.R.id.text1 });
         setListAdapter(adapter);
     }
 
     @Override
     public boolean onCreateOptionsMenu(Menu menu) {
-        super.onCreateOptionsMenu(menu);
-
-        // This is our one standard application action -- inserting a
-        // new note into the list.
-        menu.add(0, MENU_ITEM_INSERT, 0, R.string.menu_insert)
-                .setShortcut('3', 'a')
-                .setIcon(android.R.drawable.ic_menu_add);
-
+        // Inflate menu from XML resource
+        MenuInflater inflater = getMenuInflater();
+        inflater.inflate(R.menu.list_options_menu, menu);
+        
         // Generate any additional actions that can be performed on the
         // overall list.  In a normal install, there are no additional
         // actions found here, but this allows other applications to extend
@@ -104,54 +97,19 @@
         menu.addIntentOptions(Menu.CATEGORY_ALTERNATIVE, 0, 0,
                 new ComponentName(this, NotesList.class), null, intent, 0, null);
 
-        return true;
-    }
-
-    @Override
-    public boolean onPrepareOptionsMenu(Menu menu) {
-        super.onPrepareOptionsMenu(menu);
-        final boolean haveItems = getListAdapter().getCount() > 0;
-
-        // If there are any notes in the list (which implies that one of
-        // them is selected), then we need to generate the actions that
-        // can be performed on the current selection.  This will be a combination
-        // of our own specific actions along with any extensions that can be
-        // found.
-        if (haveItems) {
-            // This is the selected item.
-            Uri uri = ContentUris.withAppendedId(getIntent().getData(), getSelectedItemId());
-
-            // Build menu...  always starts with the EDIT action...
-            Intent[] specifics = new Intent[1];
-            specifics[0] = new Intent(Intent.ACTION_EDIT, uri);
-            MenuItem[] items = new MenuItem[1];
-
-            // ... is followed by whatever other actions are available...
-            Intent intent = new Intent(null, uri);
-            intent.addCategory(Intent.CATEGORY_ALTERNATIVE);
-            menu.addIntentOptions(Menu.CATEGORY_ALTERNATIVE, 0, 0, null, specifics, intent, 0,
-                    items);
-
-            // Give a shortcut to the edit action.
-            if (items[0] != null) {
-                items[0].setShortcut('1', 'e');
-            }
-        } else {
-            menu.removeGroup(Menu.CATEGORY_ALTERNATIVE);
-        }
-
-        return true;
+        return super.onCreateOptionsMenu(menu);
     }
 
     @Override
     public boolean onOptionsItemSelected(MenuItem item) {
         switch (item.getItemId()) {
-        case MENU_ITEM_INSERT:
+        case R.id.menu_add:
             // Launch activity to insert a new item
             startActivity(new Intent(Intent.ACTION_INSERT, getIntent().getData()));
             return true;
+        default:
+            return super.onOptionsItemSelected(item);
         }
-        return super.onOptionsItemSelected(item);
     }
 
     @Override
@@ -170,11 +128,23 @@
             return;
         }
 
-        // Setup the menu header
+        // Inflate menu from XML resource
+        MenuInflater inflater = getMenuInflater();
+        inflater.inflate(R.menu.list_context_menu, menu);
+        
+        // Set the context menu header
         menu.setHeaderTitle(cursor.getString(COLUMN_INDEX_TITLE));
-
-        // Add a menu item to delete the note
-        menu.add(0, MENU_ITEM_DELETE, 0, R.string.menu_delete);
+        
+        // Append to the
+        // menu items for any other activities that can do stuff with it
+        // as well.  This does a query on the system for any activities that
+        // implement the ALTERNATIVE_ACTION for our data, adding a menu item
+        // for each one that is found.
+        Intent intent = new Intent(null, Uri.withAppendedPath(getIntent().getData(), 
+                                        Integer.toString((int) info.id) ));
+        intent.addCategory(Intent.CATEGORY_ALTERNATIVE);
+        menu.addIntentOptions(Menu.CATEGORY_ALTERNATIVE, 0, 0,
+                new ComponentName(this, NotesList.class), null, intent, 0, null);
     }
         
     @Override
@@ -186,30 +156,35 @@
             Log.e(TAG, "bad menuInfo", e);
             return false;
         }
+        
+        Uri noteUri = ContentUris.withAppendedId(getIntent().getData(), info.id);
 
         switch (item.getItemId()) {
-            case MENU_ITEM_DELETE: {
-                // Delete the note that the context menu is for
-                Uri noteUri = ContentUris.withAppendedId(getIntent().getData(), info.id);
-                getContentResolver().delete(noteUri, null, null);
-                return true;
-            }
+        case R.id.context_open:
+            // Launch activity to view/edit the currently selected item
+            startActivity(new Intent(Intent.ACTION_EDIT, noteUri));
+            return true;
+        case R.id.context_delete:
+            // Delete the note that the context menu is for
+            getContentResolver().delete(noteUri, null, null);
+            return true;
+        default:
+            return super.onContextItemSelected(item);
         }
-        return false;
     }
 
     @Override
     protected void onListItemClick(ListView l, View v, int position, long id) {
-        Uri uri = ContentUris.withAppendedId(getIntent().getData(), id);
+        Uri noteUri = ContentUris.withAppendedId(getIntent().getData(), id);
         
         String action = getIntent().getAction();
         if (Intent.ACTION_PICK.equals(action) || Intent.ACTION_GET_CONTENT.equals(action)) {
             // The caller is waiting for us to return a note selected by
             // the user.  The have clicked on one, so return it now.
-            setResult(RESULT_OK, new Intent().setData(uri));
+            setResult(RESULT_OK, new Intent().setData(noteUri));
         } else {
             // Launch activity to view/edit the currently selected item
-            startActivity(new Intent(Intent.ACTION_EDIT, uri));
+            startActivity(new Intent(Intent.ACTION_EDIT, noteUri));
         }
     }
 }
diff --git a/samples/NotePad/src/com/example/android/notepad/TitleEditor.java b/samples/NotePad/src/com/example/android/notepad/TitleEditor.java
index 50d38e5..fe232ed 100644
--- a/samples/NotePad/src/com/example/android/notepad/TitleEditor.java
+++ b/samples/NotePad/src/com/example/android/notepad/TitleEditor.java
@@ -16,8 +16,6 @@
 
 package com.example.android.notepad;
 
-import com.example.android.notepad.NotePad.Notes;
-
 import android.app.Activity;
 import android.content.ContentValues;
 import android.database.Cursor;
@@ -27,6 +25,8 @@
 import android.widget.Button;
 import android.widget.EditText;
 
+import com.example.android.notepad.NotePad.NoteColumns;
+
 /**
  * An activity that will edit the title of a note. Displays a floating
  * window with a text field.
@@ -42,8 +42,8 @@
      * An array of the columns we are interested in.
      */
     private static final String[] PROJECTION = new String[] {
-            NotePad.Notes._ID, // 0
-            NotePad.Notes.TITLE, // 1
+        NoteColumns._ID, // 0
+        NoteColumns.TITLE, // 1
     };
     /** Index of the title column */
     private static final int COLUMN_INDEX_TITLE = 1;
@@ -102,7 +102,7 @@
         if (mCursor != null) {
             // Write the title back to the note 
             ContentValues values = new ContentValues();
-            values.put(Notes.TITLE, mText.getText().toString());
+            values.put(NoteColumns.TITLE, mText.getText().toString());
             getContentResolver().update(mUri, values, null, null);
         }
     }
diff --git a/samples/NotePad/src/com/google/provider/NotePad.java b/samples/NotePad/src/com/google/provider/NotePad.java
deleted file mode 100644
index f8de69b..0000000
--- a/samples/NotePad/src/com/google/provider/NotePad.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/* 
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.provider;
-
-import android.net.Uri;
-import android.provider.BaseColumns;
-
-/**
- * Convenience definitions for NotePadProvider
- */
-public final class NotePad {
-    /**
-     * Notes table
-     */
-    public static final class Notes implements BaseColumns {
-        /**
-         * The content:// style URL for this table
-         */
-        public static final Uri CONTENT_URI
-                = Uri.parse("content://com.google.provider.NotePad/notes");
-
-        /**
-         * The default sort order for this table
-         */
-        public static final String DEFAULT_SORT_ORDER = "modified DESC";
-
-        /**
-         * The title of the note
-         * <P>Type: TEXT</P>
-         */
-        public static final String TITLE = "title";
-
-        /**
-         * The note itself
-         * <P>Type: TEXT</P>
-         */
-        public static final String NOTE = "note";
-
-        /**
-         * The timestamp for when the note was created
-         * <P>Type: INTEGER (long)</P>
-         */
-        public static final String CREATED_DATE = "created";
-
-        /**
-         * The timestamp for when the note was last modified
-         * <P>Type: INTEGER (long)</P>
-         */
-        public static final String MODIFIED_DATE = "modified";
-    }
-}
diff --git a/samples/Obb/Android.mk b/samples/Obb/Android.mk
new file mode 100644
index 0000000..3418d76
--- /dev/null
+++ b/samples/Obb/Android.mk
@@ -0,0 +1,16 @@
+LOCAL_PATH:= $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_TAGS := samples
+
+# Only compile source java files in this apk.
+LOCAL_SRC_FILES := $(call all-java-files-under, src)
+
+LOCAL_PACKAGE_NAME := ObbApp
+
+LOCAL_SDK_VERSION := current
+
+include $(BUILD_PACKAGE)
+
+# Use the following include to make our test apk.
+include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/samples/Obb/AndroidManifest.xml b/samples/Obb/AndroidManifest.xml
new file mode 100644
index 0000000..189a86e
--- /dev/null
+++ b/samples/Obb/AndroidManifest.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2007 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+    package="com.example.android.obbapp">
+
+    <!-- OBBs were introduced in SDK version 9 -->
+    <!-- <uses-sdk android:minSdkVersion="9"/> -->
+
+    <application android:label="@string/obb_app">
+        <activity android:name="ObbMountActivity">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.LAUNCHER" />
+            </intent-filter>
+        </activity>
+    </application>
+</manifest>
diff --git a/samples/Obb/res/layout/obb_mount_activity.xml b/samples/Obb/res/layout/obb_mount_activity.xml
new file mode 100644
index 0000000..061a7fa
--- /dev/null
+++ b/samples/Obb/res/layout/obb_mount_activity.xml
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2007 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<!-- This file describes the layout of the main SkeletonApp activity
+     user interface.
+ -->
+
+<!-- The top view is a layout manager that places its child views into
+     a row, here set to be vertical (so the first is at the top) -->
+
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent" android:layout_height="match_parent">
+
+    <Button android:id="@+id/mount"
+        android:layout_width="wrap_content" android:layout_height="wrap_content" 
+        android:text="@string/mount" />
+
+    <Button android:id="@+id/unmount"
+        android:layout_width="wrap_content" android:layout_height="wrap_content"
+        android:layout_toRightOf="@+id/mount"
+        android:text="@string/unmount" />
+
+    <TextView android:id="@+id/status_label" android:layout_below="@+id/mount"
+        android:layout_width="wrap_content" android:layout_height="wrap_content"
+        android:text="@string/status_label" />
+
+    <TextView android:id="@+id/status" android:layout_below="@+id/mount"
+        android:layout_width="wrap_content" android:layout_height="wrap_content"
+        android:layout_toRightOf="@+id/status_label" />
+
+    <TextView android:id="@+id/path_label" android:layout_below="@+id/status_label"
+        android:layout_width="wrap_content" android:layout_height="wrap_content"
+        android:text="@string/path_label" />
+
+    <TextView android:id="@+id/path" android:layout_below="@+id/status_label"
+        android:layout_width="wrap_content" android:layout_height="wrap_content"
+        android:layout_toRightOf="@+id/path_label" />
+
+</RelativeLayout>
diff --git a/samples/Obb/res/values/strings.xml b/samples/Obb/res/values/strings.xml
new file mode 100644
index 0000000..95635e8
--- /dev/null
+++ b/samples/Obb/res/values/strings.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2010 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<!-- This file contains resource definitions for displayed strings, allowing
+     them to be changed based on the locale and options. -->
+
+<resources>
+    <string name="obb_app">Obb App</string>
+
+    <string name="mount">Mount</string>
+    <string name="unmount">Unmount</string>
+
+    <string name="path_label">Path:</string>
+    <string name="status_label">Status:</string>
+
+    <string name="obb_already_mounted">OBB already mounted!</string>
+    <string name="obb_not_mounted">OBB is not mounted!</string>
+
+    <string name="failed_to_start_mount">Failed to start mount process...</string>
+    <string name="failed_to_start_unmount">Failed to start unmount process...</string>
+
+    <string name="attempting_mount">Attempting to mount...</string>
+    <string name="attempting_unmount">Attempting to unmount...</string>
+</resources>
diff --git a/samples/Obb/src/com/example/android/obbapp/ObbMountActivity.java b/samples/Obb/src/com/example/android/obbapp/ObbMountActivity.java
new file mode 100644
index 0000000..c4e952c
--- /dev/null
+++ b/samples/Obb/src/com/example/android/obbapp/ObbMountActivity.java
@@ -0,0 +1,148 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.android.obbapp;
+
+import android.app.Activity;
+import android.os.Bundle;
+import android.os.Environment;
+import android.os.storage.OnObbStateChangeListener;
+import android.os.storage.StorageManager;
+import android.util.Log;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.widget.Button;
+import android.widget.TextView;
+
+import java.io.File;
+
+/**
+ * This class provides a basic demonstration of how to manage an OBB file. It
+ * provides two buttons: one to mount an OBB and another to unmount an OBB. The
+ * main feature is that it implements an OnObbStateChangeListener which updates
+ * some text fields with relevant information.
+ */
+public class ObbMountActivity extends Activity {
+    private static final String TAG = "ObbMount";
+
+    private static String mObbPath;
+
+    private TextView mStatus;
+    private TextView mPath;
+
+    private StorageManager mSM;
+
+    /** Called with the activity is first created. */
+    @Override
+    public void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        // Inflate our UI from its XML layout description.
+        setContentView(R.layout.obb_mount_activity);
+
+        // Hook up button presses to the appropriate event handler.
+        ((Button) findViewById(R.id.mount)).setOnClickListener(mMountListener);
+        ((Button) findViewById(R.id.unmount)).setOnClickListener(mUnmountListener);
+
+        // Text indications of current status
+        mStatus = (TextView) findViewById(R.id.status);
+        mPath = (TextView) findViewById(R.id.path);
+
+        ObbState state = (ObbState) getLastNonConfigurationInstance();
+
+        if (state != null) {
+            mSM = state.storageManager;
+            mStatus.setText(state.status);
+            mPath.setText(state.path);
+        } else {
+            // Get an instance of the StorageManager
+            mSM = (StorageManager) getApplicationContext().getSystemService(STORAGE_SERVICE);
+        }
+
+        mObbPath = new File(Environment.getExternalStorageDirectory(), "test1.obb").getPath();
+    }
+
+    OnObbStateChangeListener mEventListener = new OnObbStateChangeListener() {
+        @Override
+        public void onObbStateChange(String path, int state) {
+            Log.d(TAG, "path=" + path + "; state=" + state);
+            mStatus.setText(String.valueOf(state));
+            if (state == OnObbStateChangeListener.MOUNTED) {
+                mPath.setText(mSM.getMountedObbPath(mObbPath));
+            } else {
+                mPath.setText("");
+            }
+        }
+    };
+
+    /**
+     * A call-back for when the user presses the back button.
+     */
+    OnClickListener mMountListener = new OnClickListener() {
+        public void onClick(View v) {
+            try {
+                // We don't need to synchronize here to avoid clobbering the
+                // content of mStatus because the callback comes to our main
+                // looper.
+                if (mSM.mountObb(mObbPath, null, mEventListener)) {
+                    mStatus.setText(R.string.attempting_mount);
+                } else {
+                    mStatus.setText(R.string.failed_to_start_mount);
+                }
+            } catch (IllegalArgumentException e) {
+                mStatus.setText(R.string.obb_already_mounted);
+                Log.d(TAG, "OBB already mounted");
+            }
+        }
+    };
+
+    /**
+     * A call-back for when the user presses the clear button.
+     */
+    OnClickListener mUnmountListener = new OnClickListener() {
+        public void onClick(View v) {
+            try {
+                if (mSM.unmountObb(mObbPath, false, mEventListener)) {
+                    mStatus.setText(R.string.attempting_unmount);
+                } else {
+                    mStatus.setText(R.string.failed_to_start_unmount);
+                }
+            } catch (IllegalArgumentException e) {
+                mStatus.setText(R.string.obb_not_mounted);
+                Log.d(TAG, "OBB not mounted");
+            }
+        }
+    };
+
+    @Override
+    public Object onRetainNonConfigurationInstance() {
+        // Since our OBB mount is tied to the StorageManager, retain it
+        ObbState state = new ObbState(mSM, mStatus.getText(), mPath.getText());
+        return state;
+    }
+
+    private static class ObbState {
+        public StorageManager storageManager;
+        public CharSequence status;
+        public CharSequence path;
+
+        ObbState(StorageManager storageManager, CharSequence status, CharSequence path) {
+            this.storageManager = storageManager;
+            this.status = status;
+            this.path = path;
+        }
+    }
+}
diff --git a/samples/README b/samples/README
new file mode 100644
index 0000000..8181040
--- /dev/null
+++ b/samples/README
@@ -0,0 +1,5 @@
+Adding a new folder in development/samples is not enough to have it
+be packaged with the SDK.
+
+Make sure to edit development/build/sdk.atree to add the sample to the SDK
+build.
\ No newline at end of file
diff --git a/samples/SearchableDictionary/res/values/strings.xml b/samples/SearchableDictionary/res/values/strings.xml
index 569e1d9..ee628ce 100644
--- a/samples/SearchableDictionary/res/values/strings.xml
+++ b/samples/SearchableDictionary/res/values/strings.xml
@@ -38,8 +38,8 @@
 
     <!-- Shown above search results when we receive a search request. -->
     <plurals name="search_results">
-      <item quantity="one">%d result for \"%s\": </item>
-      <item quantity="other">%d results for \"%s\": </item>
+      <item quantity="one">%1$d result for \"%2$s\": </item>
+      <item quantity="other">%1$d results for \"%2$s\": </item>
     </plurals>
 
     <!-- Search failure message. -->
diff --git a/samples/SipDemo/Android.mk b/samples/SipDemo/Android.mk
new file mode 100644
index 0000000..6363727
--- /dev/null
+++ b/samples/SipDemo/Android.mk
@@ -0,0 +1,16 @@
+LOCAL_PATH:= $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_TAGS := samples
+
+# Only compile source java files in this apk.
+LOCAL_SRC_FILES := $(call all-java-files-under, src)
+
+LOCAL_PACKAGE_NAME := SipDemo
+
+LOCAL_SDK_VERSION := current
+
+include $(BUILD_PACKAGE)
+
+# Use the following include to make our test apk.
+include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/samples/SipDemo/AndroidManifest.xml b/samples/SipDemo/AndroidManifest.xml
new file mode 100644
index 0000000..8fb7675
--- /dev/null
+++ b/samples/SipDemo/AndroidManifest.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  Copyright (C) 2010 The Android Open Source Project
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+ -->
+
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+          package="com.example.android.sip">
+    <application android:icon="@drawable/icon" android:label="SipDemo">
+      <activity android:name=".WalkieTalkieActivity"
+          android:configChanges="orientation|keyboardHidden">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN"/>
+                <category android:name="android.intent.category.LAUNCHER"/>
+            </intent-filter>
+        </activity>
+        <activity android:name=".SipSettings" android:label="set_preferences"/>
+
+
+        <receiver android:name=".IncomingCallReceiver" android:label="Call Receiver"/>
+    </application>
+    <uses-sdk android:minSdkVersion="9" />
+    <uses-permission android:name="android.permission.USE_SIP" />
+    <uses-permission android:name="android.permission.INTERNET" />
+    <uses-permission android:name="android.permission.VIBRATE" />
+    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
+    <uses-permission android:name="android.permission.WAKE_LOCK" />
+    <uses-permission android:name="android.permission.RECORD_AUDIO" />
+
+    <uses-feature android:name="android.hardware.sip.voip" android:required="true" />
+    <uses-feature android:name="android.hardware.wifi" android:required="true" />
+    <uses-feature android:name="android.hardware.microphone" android:required="true" />
+</manifest>
diff --git a/samples/SipDemo/_index.html b/samples/SipDemo/_index.html
new file mode 100644
index 0000000..dbc9037
--- /dev/null
+++ b/samples/SipDemo/_index.html
@@ -0,0 +1,52 @@
+<p>This is a demo application highlighting how to make internet-based calls with
+the SIP API.  The application uses a walkie-talkie style interface, allowing you
+to only be heard when the button is pushed down.</p>
+
+<p>The source code for this demo app shows how to accomplish three key things
+with SIP:  Make a call, receive a call, and signal to the Android platform that
+your app wants to receive incoming SIP calls, so that they can be handled from
+within the application.</p>
+
+
+<p>The application includes:<p>
+<ul> <li><a
+    href="src/com/example/android/sip/SipSettings.html"><code>SipSettings</code></a>
+  &mdash; a <code>PreferenceActivity</code> that supplies basic settings for SIP
+  authentication.</li> <li><a
+    href="src/com/example/android/sip/cube1/IncomingCallReceiver.html"><code>
+      IncomingCallReceiver</code></a> &mdash; a <code>BroadcastReceiver</code>
+  that listens for incoming SIP calls and passes them to
+  <code>WalkieTalkieActivity</code> for handling.</li> <li><a
+    href="src/com/example/android/sip/WalkieTalkieActivity.html"><code>WalkieTalkieActivity</code></a>
+  &mdash; a activity that login to SIP provider and registers the device to
+  receive incoming SIP, handles incoming calls and makes outgoing calls, managing
+  UI during the call.</li> </ul>
+<p>If you are developing an application that uses the SIP API, remember that the
+feature is supported only on Android 2.3 (API level 9) and higher versions of
+the platform. Also, among devices running Android 2.3 (API level 9) or higher,
+not all devices will offer SIP support. To ensure that your application can only
+be installed on devices that are capable of supporting SIP, remember to add the
+following to the application's manifest before publishing to Android Market:</p>
+<ul> <li><code>&lt;uses-sdk android:minSdkVersion="9" /&gt;</code>, which
+  indicates to Android Market and the platform that your application requires
+  Android 2.3 or higher. For more information, see <a
+    href="../../../guide/appendix/api-levels.html">API Levels</a> and the
+  documentation for the <a
+    href="../../../guide/topics/manifest/uses-sdk-element.html"><code>&lt;uses-sdk&gt;</code></a>
+  element.</li> </ul> <p>To control how Android Market filters your application
+from devices that do not support SIP, remember to add the following to the
+application's manifest <ul> <li><code>&lt;uses-feature
+    android:name="android.hardware.sip.voip" /&gt;</code>, which tells Android
+  Market that your application uses the SIP API. The declaration should include
+  an <code>android:required</code> attribute that indicates whether you want
+  Android Market to filter the application from devices that do not offer SIP
+  support. Other <code>&lt;uses-feature&gt;</code> declarations may also be
+  needed, depending on your implementation. For more information, see the
+  documentation for the <a
+    href="../../../guide/topics/manifest/uses-feature-element.html"><code>&lt;uses-feature&gt;</code></a>
+  element.</li> </ul>
+<p>For more information about using the SIP API, see the <a
+  href="../../../reference/android/net/sip/package-summary.html"><code>android.net.sip</a></code>
+documentation. </p>
+
+<img alt="" src="../images/SipDemo.png" />
diff --git a/samples/SipDemo/res/drawable/btn_record.xml b/samples/SipDemo/res/drawable/btn_record.xml
new file mode 100644
index 0000000..a803da1
--- /dev/null
+++ b/samples/SipDemo/res/drawable/btn_record.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0"?>
+<!--
+  Copyright (C) 2010 The Android Open Source Project
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+ -->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:state_pressed="true" android:drawable="@drawable/btn_speak_pressed" />
+    <item android:state_selected="true" android:drawable="@drawable/btn_speak_pressed" />
+    <item android:drawable="@drawable/btn_speak_normal" />
+</selector>
+
diff --git a/samples/SipDemo/res/drawable/btn_speak_normal.png b/samples/SipDemo/res/drawable/btn_speak_normal.png
new file mode 100644
index 0000000..fb86ceb
--- /dev/null
+++ b/samples/SipDemo/res/drawable/btn_speak_normal.png
Binary files differ
diff --git a/samples/SipDemo/res/drawable/btn_speak_pressed.png b/samples/SipDemo/res/drawable/btn_speak_pressed.png
new file mode 100644
index 0000000..cffdf91
--- /dev/null
+++ b/samples/SipDemo/res/drawable/btn_speak_pressed.png
Binary files differ
diff --git a/samples/SipDemo/res/drawable/btn_speak_selected.png b/samples/SipDemo/res/drawable/btn_speak_selected.png
new file mode 100644
index 0000000..99a1a6f
--- /dev/null
+++ b/samples/SipDemo/res/drawable/btn_speak_selected.png
Binary files differ
diff --git a/samples/SipDemo/res/drawable/icon.png b/samples/SipDemo/res/drawable/icon.png
new file mode 100644
index 0000000..64e3601
--- /dev/null
+++ b/samples/SipDemo/res/drawable/icon.png
Binary files differ
diff --git a/samples/SipDemo/res/layout/call_address_dialog.xml b/samples/SipDemo/res/layout/call_address_dialog.xml
new file mode 100644
index 0000000..2bd7556
--- /dev/null
+++ b/samples/SipDemo/res/layout/call_address_dialog.xml
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  Copyright (C) 2010 The Android Open Source Project
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+ -->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="fill_parent"
+    android:layout_height="wrap_content"
+    android:orientation="vertical">
+
+    <TextView
+        android:id="@+id/calladdress_view"
+        android:layout_height="wrap_content"
+        android:layout_width="wrap_content"
+        android:layout_marginLeft="20dip"
+        android:layout_marginRight="20dip"
+        android:text="@+string/contactAddress"
+        android:gravity="left"
+        android:textAppearance="?android:attr/textAppearanceMedium" />
+
+    <EditText
+        android:id="@+id/calladdress_edit"
+        android:layout_height="wrap_content"
+        android:layout_width="fill_parent"
+        android:layout_marginLeft="20dip"
+        android:layout_marginRight="20dip"
+        android:scrollHorizontally="true"
+        android:autoText="false"
+        android:capitalize="none"
+        android:gravity="fill_horizontal"
+        android:textAppearance="?android:attr/textAppearanceMedium" />
+
+</LinearLayout>
diff --git a/samples/SipDemo/res/layout/walkietalkie.xml b/samples/SipDemo/res/layout/walkietalkie.xml
new file mode 100644
index 0000000..bdf634c
--- /dev/null
+++ b/samples/SipDemo/res/layout/walkietalkie.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  Copyright (C) 2010 The Android Open Source Project
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+ -->
+
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+   android:layout_width="fill_parent"
+   android:layout_height="fill_parent">
+    <RelativeLayout android:padding="12dp"
+        android:id="@+id/mainlayout"
+        android:orientation="vertical"
+        android:layout_width="fill_parent"
+        android:layout_height="fill_parent">
+
+        <TextView
+            android:id="@+id/sipLabel"
+            android:layout_width="fill_parent"
+            android:layout_height="fill_parent"
+            android:layout_centerHorizontal="true"
+            android:textAppearance="?android:attr/textAppearanceLarge"
+        />
+
+        <ToggleButton
+            android:layout_height="400dp"
+            android:layout_width="400dp"
+            android:text="@+string/talk"
+            android:id="@+id/pushToTalk"
+
+            android:layout_centerHorizontal="true"
+            android:layout_centerVertical="true"
+            android:background="@drawable/btn_record"
+            android:textOff=""
+            android:textOn=""
+            android:layout_marginTop="-20dp" />
+
+    </RelativeLayout>
+</FrameLayout>
diff --git a/samples/SipDemo/res/values/strings.xml b/samples/SipDemo/res/values/strings.xml
new file mode 100644
index 0000000..a0d49bc
--- /dev/null
+++ b/samples/SipDemo/res/values/strings.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  Copyright (C) 2010 The Android Open Source Project
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+ -->
+
+<resources>
+    <string name="app_name">SIP Demo</string>
+    <string name="contactAddress">SIP Address to contact</string>
+    <string name="talk">Talk</string>
+  </resources>
diff --git a/samples/SipDemo/res/xml/preferences.xml b/samples/SipDemo/res/xml/preferences.xml
new file mode 100644
index 0000000..590e092
--- /dev/null
+++ b/samples/SipDemo/res/xml/preferences.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  Copyright (C) 2010 The Android Open Source Project
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+ -->
+
+<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
+    <EditTextPreference
+        android:name="SIP Username"
+        android:summary="Username for your SIP Account"
+        android:defaultValue=""
+        android:title="Enter Username"
+        android:key="namePref" />
+    <EditTextPreference
+        android:name="SIP Domain"
+        android:summary="Domain for your SIP Account"
+        android:defaultValue=""
+        android:title="Enter Domain"
+        android:key="domainPref" />
+    <EditTextPreference
+        android:name="SIP Password"
+        android:summary="Password for your SIP Account"
+        android:defaultValue=""
+        android:title="Enter Password"
+        android:key="passPref"
+        android:password="true" />
+</PreferenceScreen>
diff --git a/samples/SipDemo/src/com/example/android/sip/IncomingCallReceiver.java b/samples/SipDemo/src/com/example/android/sip/IncomingCallReceiver.java
new file mode 100644
index 0000000..ea27a0a
--- /dev/null
+++ b/samples/SipDemo/src/com/example/android/sip/IncomingCallReceiver.java
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.android.sip;
+
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+import android.net.sip.*;
+import android.util.Log;
+
+/**
+ * Listens for incoming SIP calls, intercepts and hands them off to WalkieTalkieActivity.
+ */
+public class IncomingCallReceiver extends BroadcastReceiver {
+    /**
+     * Processes the incoming call, answers it, and hands it over to the
+     * WalkieTalkieActivity.
+     * @param context The context under which the receiver is running.
+     * @param intent The intent being received.
+     */
+    @Override
+    public void onReceive(Context context, Intent intent) {
+        SipAudioCall incomingCall = null;
+        try {
+
+            SipAudioCall.Listener listener = new SipAudioCall.Listener() {
+                @Override
+                public void onRinging(SipAudioCall call, SipProfile caller) {
+                    try {
+                        call.answerCall(30);
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                }
+            };
+
+            WalkieTalkieActivity wtActivity = (WalkieTalkieActivity) context;
+
+            incomingCall = wtActivity.manager.takeAudioCall(intent, listener);
+            incomingCall.answerCall(30);
+            incomingCall.startAudio();
+            incomingCall.setSpeakerMode(true);
+            if(incomingCall.isMuted()) {
+                incomingCall.toggleMute();
+            }
+
+            wtActivity.call = incomingCall;
+
+            wtActivity.updateStatus(incomingCall);
+
+        } catch (Exception e) {
+            if (incomingCall != null) {
+                incomingCall.close();
+            }
+        }
+    }
+
+}
diff --git a/samples/SipDemo/src/com/example/android/sip/SipSettings.java b/samples/SipDemo/src/com/example/android/sip/SipSettings.java
new file mode 100644
index 0000000..2f0624b
--- /dev/null
+++ b/samples/SipDemo/src/com/example/android/sip/SipSettings.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.android.sip;
+
+import android.os.Bundle;
+import android.preference.PreferenceActivity;
+
+/**
+ * Handles SIP authentication settings for the Walkie Talkie app.
+ */
+public class SipSettings extends PreferenceActivity {
+
+    @Override
+    public void onCreate(Bundle savedInstanceState) {
+        // Note that none of the preferences are actually defined here.
+        // They're all in the XML file res/xml/preferences.xml.
+        super.onCreate(savedInstanceState);
+        addPreferencesFromResource(R.xml.preferences);
+    }
+}
diff --git a/samples/SipDemo/src/com/example/android/sip/WalkieTalkieActivity.java b/samples/SipDemo/src/com/example/android/sip/WalkieTalkieActivity.java
new file mode 100644
index 0000000..4c187ed
--- /dev/null
+++ b/samples/SipDemo/src/com/example/android/sip/WalkieTalkieActivity.java
@@ -0,0 +1,358 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.android.sip;
+
+import android.app.Activity;
+import android.app.AlertDialog;
+import android.app.Dialog;
+import android.app.PendingIntent;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.content.IntentFilter;
+import android.content.SharedPreferences;
+import android.os.Bundle;
+import android.preference.PreferenceManager;
+import android.util.Log;
+import android.view.*;
+import android.net.sip.*;
+import android.widget.EditText;
+import android.widget.TextView;
+import android.widget.ToggleButton;
+
+import java.text.ParseException;
+
+/**
+ * Handles all calling, receiving calls, and UI interaction in the WalkieTalkie app.
+ */
+public class WalkieTalkieActivity extends Activity implements View.OnTouchListener {
+
+    public String sipAddress = null;
+
+    public SipManager manager = null;
+    public SipProfile me = null;
+    public SipAudioCall call = null;
+    public IncomingCallReceiver callReceiver;
+
+    private static final int CALL_ADDRESS = 1;
+    private static final int SET_AUTH_INFO = 2;
+    private static final int UPDATE_SETTINGS_DIALOG = 3;
+    private static final int HANG_UP = 4;
+
+
+    @Override
+    public void onCreate(Bundle savedInstanceState) {
+
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.walkietalkie);
+
+        ToggleButton pushToTalkButton = (ToggleButton) findViewById(R.id.pushToTalk);
+        pushToTalkButton.setOnTouchListener(this);
+
+        // Set up the intent filter.  This will be used to fire an
+        // IncomingCallReceiver when someone calls the SIP address used by this
+        // application.
+        IntentFilter filter = new IntentFilter();
+        filter.addAction("android.SipDemo.INCOMING_CALL");
+        callReceiver = new IncomingCallReceiver();
+        this.registerReceiver(callReceiver, filter);
+
+        // "Push to talk" can be a serious pain when the screen keeps turning off.
+        // Let's prevent that.
+        getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
+
+        initializeManager();
+    }
+
+    @Override
+    public void onStart() {
+        super.onStart();
+        // When we get back from the preference setting Activity, assume
+        // settings have changed, and re-login with new auth info.
+        initializeManager();
+    }
+
+    @Override
+    public void onDestroy() {
+        super.onDestroy();
+        if (call != null) {
+            call.close();
+        }
+
+        closeLocalProfile();
+
+        if (callReceiver != null) {
+            this.unregisterReceiver(callReceiver);
+        }
+    }
+
+    public void initializeManager() {
+        if(manager == null) {
+          manager = SipManager.newInstance(this);
+        }
+
+        initializeLocalProfile();
+    }
+
+    /**
+     * Logs you into your SIP provider, registering this device as the location to
+     * send SIP calls to for your SIP address.
+     */
+    public void initializeLocalProfile() {
+        if (manager == null) {
+            return;
+        }
+
+        if (me != null) {
+            closeLocalProfile();
+        }
+
+        SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getBaseContext());
+        String username = prefs.getString("namePref", "");
+        String domain = prefs.getString("domainPref", "");
+        String password = prefs.getString("passPref", "");
+
+        if (username.length() == 0 || domain.length() == 0 || password.length() == 0) {
+            showDialog(UPDATE_SETTINGS_DIALOG);
+            return;
+        }
+
+        try {
+            SipProfile.Builder builder = new SipProfile.Builder(username, domain);
+            builder.setPassword(password);
+            me = builder.build();
+
+            Intent i = new Intent();
+            i.setAction("android.SipDemo.INCOMING_CALL");
+            PendingIntent pi = PendingIntent.getBroadcast(this, 0, i, Intent.FILL_IN_DATA);
+            manager.open(me, pi, null);
+
+
+            // This listener must be added AFTER manager.open is called,
+            // Otherwise the methods aren't guaranteed to fire.
+
+            manager.setRegistrationListener(me.getUriString(), new SipRegistrationListener() {
+                    public void onRegistering(String localProfileUri) {
+                        updateStatus("Registering with SIP Server...");
+                    }
+
+                    public void onRegistrationDone(String localProfileUri, long expiryTime) {
+                        updateStatus("Ready");
+                    }
+
+                    public void onRegistrationFailed(String localProfileUri, int errorCode,
+                            String errorMessage) {
+                        updateStatus("Registration failed.  Please check settings.");
+                    }
+                });
+        } catch (ParseException pe) {
+            updateStatus("Connection Error.");
+        } catch (SipException se) {
+            updateStatus("Connection error.");
+        }
+    }
+
+    /**
+     * Closes out your local profile, freeing associated objects into memory
+     * and unregistering your device from the server.
+     */
+    public void closeLocalProfile() {
+        if (manager == null) {
+            return;
+        }
+        try {
+            if (me != null) {
+                manager.close(me.getUriString());
+            }
+        } catch (Exception ee) {
+            Log.d("WalkieTalkieActivity/onDestroy", "Failed to close local profile.", ee);
+        }
+    }
+
+    /**
+     * Make an outgoing call.
+     */
+    public void initiateCall() {
+
+        updateStatus(sipAddress);
+
+        try {
+            SipAudioCall.Listener listener = new SipAudioCall.Listener() {
+                // Much of the client's interaction with the SIP Stack will
+                // happen via listeners.  Even making an outgoing call, don't
+                // forget to set up a listener to set things up once the call is established.
+                @Override
+                public void onCallEstablished(SipAudioCall call) {
+                    call.startAudio();
+                    call.setSpeakerMode(true);
+                    call.toggleMute();
+                    updateStatus(call);
+                }
+
+                @Override
+                public void onCallEnded(SipAudioCall call) {
+                    updateStatus("Ready.");
+                }
+            };
+
+            call = manager.makeAudioCall(me.getUriString(), sipAddress, listener, 30);
+
+        }
+        catch (Exception e) {
+            Log.i("WalkieTalkieActivity/InitiateCall", "Error when trying to close manager.", e);
+            if (me != null) {
+                try {
+                    manager.close(me.getUriString());
+                } catch (Exception ee) {
+                    Log.i("WalkieTalkieActivity/InitiateCall",
+                            "Error when trying to close manager.", ee);
+                    ee.printStackTrace();
+                }
+            }
+            if (call != null) {
+                call.close();
+            }
+        }
+    }
+
+    /**
+     * Updates the status box at the top of the UI with a messege of your choice.
+     * @param status The String to display in the status box.
+     */
+    public void updateStatus(final String status) {
+        // Be a good citizen.  Make sure UI changes fire on the UI thread.
+        this.runOnUiThread(new Runnable() {
+            public void run() {
+                TextView labelView = (TextView) findViewById(R.id.sipLabel);
+                labelView.setText(status);
+            }
+        });
+    }
+
+    /**
+     * Updates the status box with the SIP address of the current call.
+     * @param call The current, active call.
+     */
+    public void updateStatus(SipAudioCall call) {
+        String useName = call.getPeerProfile().getDisplayName();
+        if(useName == null) {
+          useName = call.getPeerProfile().getUserName();
+        }
+        updateStatus(useName + "@" + call.getPeerProfile().getSipDomain());
+    }
+
+    /**
+     * Updates whether or not the user's voice is muted, depending on whether the button is pressed.
+     * @param v The View where the touch event is being fired.
+     * @param event The motion to act on.
+     * @return boolean Returns false to indicate that the parent view should handle the touch event
+     * as it normally would.
+     */
+    public boolean onTouch(View v, MotionEvent event) {
+        if (call == null) {
+            return false;
+        } else if (event.getAction() == MotionEvent.ACTION_DOWN && call != null && call.isMuted()) {
+            call.toggleMute();
+        } else if (event.getAction() == MotionEvent.ACTION_UP && !call.isMuted()) {
+            call.toggleMute();
+        }
+        return false;
+    }
+
+    public boolean onCreateOptionsMenu(Menu menu) {
+        menu.add(0, CALL_ADDRESS, 0, "Call someone");
+        menu.add(0, SET_AUTH_INFO, 0, "Edit your SIP Info.");
+        menu.add(0, HANG_UP, 0, "End Current Call.");
+
+        return true;
+    }
+
+    public boolean onOptionsItemSelected(MenuItem item) {
+        switch (item.getItemId()) {
+            case CALL_ADDRESS:
+                showDialog(CALL_ADDRESS);
+                break;
+            case SET_AUTH_INFO:
+                updatePreferences();
+                break;
+            case HANG_UP:
+                if(call != null) {
+                    try {
+                      call.endCall();
+                    } catch (SipException se) {
+                        Log.d("WalkieTalkieActivity/onOptionsItemSelected",
+                                "Error ending call.", se);
+                    }
+                    call.close();
+                }
+                break;
+        }
+        return true;
+    }
+
+    @Override
+    protected Dialog onCreateDialog(int id) {
+        switch (id) {
+            case CALL_ADDRESS:
+
+                LayoutInflater factory = LayoutInflater.from(this);
+                final View textBoxView = factory.inflate(R.layout.call_address_dialog, null);
+                return new AlertDialog.Builder(this)
+                        .setTitle("Call Someone.")
+                        .setView(textBoxView)
+                        .setPositiveButton(
+                                android.R.string.ok, new DialogInterface.OnClickListener() {
+                                    public void onClick(DialogInterface dialog, int whichButton) {
+                                        EditText textField = (EditText)
+                                                (textBoxView.findViewById(R.id.calladdress_edit));
+                                        sipAddress = textField.getText().toString();
+                                        initiateCall();
+
+                                    }
+                        })
+                        .setNegativeButton(
+                                android.R.string.cancel, new DialogInterface.OnClickListener() {
+                                    public void onClick(DialogInterface dialog, int whichButton) {
+                                        // Noop.
+                                    }
+                        })
+                        .create();
+
+            case UPDATE_SETTINGS_DIALOG:
+                return new AlertDialog.Builder(this)
+                        .setMessage("Please update your SIP Account Settings.")
+                        .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
+                            public void onClick(DialogInterface dialog, int whichButton) {
+                                updatePreferences();
+                            }
+                        })
+                        .setNegativeButton(
+                                android.R.string.cancel, new DialogInterface.OnClickListener() {
+                                    public void onClick(DialogInterface dialog, int whichButton) {
+                                        // Noop.
+                                    }
+                        })
+                        .create();
+        }
+        return null;
+    }
+
+    public void updatePreferences() {
+        Intent settingsActivity = new Intent(getBaseContext(),
+                SipSettings.class);
+        startActivity(settingsActivity);
+    }
+}
diff --git a/samples/Wiktionary/res/values/strings.xml b/samples/Wiktionary/res/values/strings.xml
index 38d9937..ace4428 100644
--- a/samples/Wiktionary/res/values/strings.xml
+++ b/samples/Wiktionary/res/values/strings.xml
@@ -19,9 +19,9 @@
     <string name="app_descrip">Example of a fast Wiktionary browser and Word-of-day widget</string>
     <string name="app_credits">"All dictionary content provided by Wiktionary under a GFDL license.  http://en.wiktionary.org\n\nIcon derived from Tango Desktop Project under a public domain license.  http://tango.freedesktop.org"</string>
 
-    <string name="template_user_agent">"%s/%s (Linux; Android)"</string>
-    <string name="template_wotd_title">"Wiktionary:Word of the day/%s %s"</string>
-    <string name="template_define_url">"http://en.wiktionary.org/wiki/%s"</string>
+    <string name="template_user_agent" translatable="false">"%1$s/%2$s (Linux; Android)"</string>
+    <string name="template_wotd_title">"Wiktionary:Word of the day/%1$s %2$s"</string>
+    <string name="template_define_url" translatable="false">"http://en.wiktionary.org/wiki/%s"</string>
 
     <string name="widget_name">Wiktionary</string>
 
diff --git a/samples/WiktionarySimple/res/values/strings.xml b/samples/WiktionarySimple/res/values/strings.xml
index 65e44cb..7c76585 100644
--- a/samples/WiktionarySimple/res/values/strings.xml
+++ b/samples/WiktionarySimple/res/values/strings.xml
@@ -17,9 +17,9 @@
 <resources>
     <string name="app_name">Wiktionary simple example</string>
 
-    <string name="template_user_agent">"%s/%s (Linux; Android)"</string>
-    <string name="template_wotd_title">"Wiktionary:Word of the day/%s %s"</string>
-    <string name="template_define_url">"http://en.wiktionary.org/wiki/%s"</string>
+    <string name="template_user_agent" translatable="false">"%1$s/%2$s (Linux; Android)"</string>
+    <string name="template_wotd_title">"Wiktionary:Word of the day/%1$s %2$s"</string>
+    <string name="template_define_url" translatable="false">"http://en.wiktionary.org/wiki/%s"</string>
 
     <string name="widget_name">Wiktionary simple</string>
 
diff --git a/samples/source.properties b/samples/source.properties
index 96c520a..2afedc5 100644
--- a/samples/source.properties
+++ b/samples/source.properties
@@ -1,5 +1,5 @@
 Pkg.UserSrc=false
 Pkg.Revision=1
-AndroidVersion.ApiLevel=8
-#AndroidVersion.CodeName=
+AndroidVersion.ApiLevel=9
+#AndroidVersion.CodeName=gingerbread
 
diff --git a/scripts/app_engine_server/app.yaml b/scripts/app_engine_server/app.yaml
index 8e3a149..15f02e1 100755
--- a/scripts/app_engine_server/app.yaml
+++ b/scripts/app_engine_server/app.yaml
@@ -4,6 +4,10 @@
 api_version: 1
 
 handlers:
+- url: /remote_api
+  script: $PYTHON_LIB/google/appengine/ext/remote_api/handler.py
+  login: admin
+
 - url: /gae_shell/static
   static_dir: gae_shell/static
   expiration: 1d
diff --git a/sdk/doc_source.properties b/sdk/doc_source.properties
index 96c520a..4418853 100644
--- a/sdk/doc_source.properties
+++ b/sdk/doc_source.properties
@@ -1,5 +1,5 @@
 Pkg.UserSrc=false
 Pkg.Revision=1
-AndroidVersion.ApiLevel=8
+AndroidVersion.ApiLevel=9
 #AndroidVersion.CodeName=
 
diff --git a/sdk/platform_source.properties b/sdk/platform_source.properties
index 4c7f2a6..6dadea5 100644
--- a/sdk/platform_source.properties
+++ b/sdk/platform_source.properties
@@ -1,6 +1,6 @@
-Pkg.Desc=Android SDK Platform 2.2_r1
+Pkg.Desc=Android SDK Platform 2.3_r1
 Pkg.UserSrc=false
-Platform.Version=2.2
-Pkg.Revision=2
-AndroidVersion.ApiLevel=8
+Platform.Version=2.3
+Pkg.Revision=1
+AndroidVersion.ApiLevel=9
 #AndroidVersion.CodeName=
diff --git a/sdk_overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml b/sdk_overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml
index 0d211a8..c4a990e 100644
--- a/sdk_overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml
+++ b/sdk_overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml
@@ -17,5 +17,8 @@
  */
 -->
 <resources>
+    <!-- The SDK builds do not talk to a remote backend, and enabling by
+         default makes for the best developer experience. -->
+    <bool name="def_backup_enabled">true</bool>
     <string name="def_backup_transport">android/com.android.internal.backup.LocalTransport</string>
 </resources>
diff --git a/simulator/app/DeviceManager.cpp b/simulator/app/DeviceManager.cpp
index a859c63..c387d3a 100644
--- a/simulator/app/DeviceManager.cpp
+++ b/simulator/app/DeviceManager.cpp
@@ -278,7 +278,7 @@
  *
  * The events are defined in display_device.h.
  */
-void DeviceManager::SendKeyEvent(KeyCode keyCode, bool down)
+void DeviceManager::SendKeyEvent(int32_t keyCode, bool down)
 {
     android::MessageStream* pStream = GetStream();
     if (pStream == NULL)
diff --git a/simulator/app/DeviceManager.h b/simulator/app/DeviceManager.h
index bd4371e..e3d8af3 100644
--- a/simulator/app/DeviceManager.h
+++ b/simulator/app/DeviceManager.h
@@ -107,7 +107,7 @@
 #endif
 
     // send a key-up or key-down event to the runtime
-    void SendKeyEvent(KeyCode keyCode, bool down);
+    void SendKeyEvent(int32_t keyCode, bool down);
     // send touch-screen events
     void SendTouchEvent(android::Simulator::TouchMode mode, int x, int y);
 
diff --git a/simulator/app/MessageStream.cpp b/simulator/app/MessageStream.cpp
index 2397c63..c52e7c4 100644
--- a/simulator/app/MessageStream.cpp
+++ b/simulator/app/MessageStream.cpp
@@ -8,6 +8,7 @@
 
 #include "utils/Log.h"
 
+#include <stdint.h>
 #include <string.h>
 #include <assert.h>
 
@@ -338,7 +339,7 @@
      * and capability flags.
      */
     if (initiateHello) {
-        long data = kHelloMsg;
+        int32_t data = kHelloMsg;
         Message msg;
 
         /* send hello */
@@ -357,14 +358,15 @@
             return false;
         }
 
-        const long* pAck;
-        pAck = (const long*) msg.getData();
+        const int32_t* pAck;
+        pAck = (const int32_t*) msg.getData();
         if (pAck == NULL || *pAck != kHelloAckMsg) {
-            LOG(LOG_WARN, "", "hello ack was bad\n");
+            LOG(LOG_WARN, "", "hello ack was bad (%08x vs %08x)\n",
+                *pAck, kHelloAckMsg);
             return false;
         }
     } else {
-        long data = kHelloAckMsg;
+        int32_t data = kHelloAckMsg;
         Message msg;
 
         LOG(LOG_DEBUG, "", "waiting for hello from peer\n");
@@ -375,8 +377,8 @@
             return false;
         }
 
-        const long* pAck;
-        pAck = (const long*) msg.getData();
+        const int32_t* pAck;
+        pAck = (const int32_t*) msg.getData();
         if (pAck == NULL || *pAck != kHelloMsg) {
             LOG(LOG_WARN, "", "hello was bad\n");
             return false;
diff --git a/simulator/app/PhoneButton.cpp b/simulator/app/PhoneButton.cpp
index eca7ddc..15c5109 100644
--- a/simulator/app/PhoneButton.cpp
+++ b/simulator/app/PhoneButton.cpp
@@ -27,7 +27,7 @@
     assert(!mHasImage);     // quick check for re-use
 
     mKeyCode = LookupKeyCode(label);
-    if (mKeyCode == kKeyCodeUnknown) {
+    if (mKeyCode == AKEYCODE_UNKNOWN) {
         fprintf(stderr, "WARNING: key code '%s' not recognized\n", label);
         // keep going
     }
@@ -129,9 +129,9 @@
 /*
  * Look up a key code based on a string.
  *
- * Returns kKeyCodeUnknown if the label doesn't match anything.
+ * Returns AKEYCODE_UNKNOWN if the label doesn't match anything.
  */
-KeyCode PhoneButton::LookupKeyCode(const char* label) const
+int32_t PhoneButton::LookupKeyCode(const char* label) const
 {
     static const struct {
         const char* label;
@@ -172,9 +172,9 @@
 
     for (int i = 0; i < numCodes; i++) {
         if (strcmp(label, codeList[i].label) == 0)
-            return (KeyCode) codeList[i].keyCode;
+            return codeList[i].keyCode;
     }
 
-    return kKeyCodeUnknown;
+    return AKEYCODE_UNKNOWN;
 };
 
diff --git a/simulator/app/PhoneButton.h b/simulator/app/PhoneButton.h
index 4bbaf56..86c32dd 100644
--- a/simulator/app/PhoneButton.h
+++ b/simulator/app/PhoneButton.h
@@ -21,11 +21,11 @@
 class PhoneButton {
 public:
     PhoneButton(void)
-        : mHasImage(false), mKeyCode(kKeyCodeUnknown)
+        : mHasImage(false), mKeyCode(AKEYCODE_UNKNOWN)
         {}
     virtual ~PhoneButton(void) {}
     PhoneButton(const PhoneButton& src)
-        : mHasImage(false), mKeyCode(kKeyCodeUnknown)
+        : mHasImage(false), mKeyCode(AKEYCODE_UNKNOWN)
     {
         CopyMembers(src);
     }
@@ -60,7 +60,7 @@
     }
 
     bool CheckCollision(int x, int y) const;
-    KeyCode GetKeyCode(void) const { return mKeyCode; }
+    int32_t GetKeyCode(void) const { return mKeyCode; }
 
     // load or unload the image bitmap, if any
     bool LoadResources(void);
@@ -68,13 +68,13 @@
 
 private:
     void CreateHighlightedBitmap(void);
-    KeyCode LookupKeyCode(const char* label) const;
+    int32_t LookupKeyCode(const char* label) const;
 
     LoadableImage       mSelectedImage;
     wxBitmap            mHighlightedBitmap;
     bool                mHasImage;          // both exist or neither exist
 
-    KeyCode    mKeyCode;
+    int32_t mKeyCode;
 };
 
 #endif // _SIM_PHONE_BUTTON_H
diff --git a/simulator/app/PhoneData.cpp b/simulator/app/PhoneData.cpp
index f15df2b..f6756f5 100644
--- a/simulator/app/PhoneData.cpp
+++ b/simulator/app/PhoneData.cpp
@@ -413,7 +413,7 @@
 /*
  * Find the first button with a matching key code.
  */
-PhoneButton* PhoneView::FindButtonByKey(KeyCode keyCode)
+PhoneButton* PhoneView::FindButtonByKey(int32_t keyCode)
 {
     typedef List<PhoneButton>::iterator Iter;
 
diff --git a/simulator/app/PhoneData.h b/simulator/app/PhoneData.h
index 2d7003a..5a95796 100644
--- a/simulator/app/PhoneData.h
+++ b/simulator/app/PhoneData.h
@@ -178,7 +178,7 @@
     PhoneButton* FindButtonHit(int x, int y);
 
     // find the first button with a matching key code
-    PhoneButton* FindButtonByKey(KeyCode keyCode);
+    PhoneButton* FindButtonByKey(int32_t keyCode);
 
     bool ProcessAndValidate(TiXmlNode* pNode, const char* directory);
     bool ProcessImage(TiXmlNode* pNode, const char* directory);
diff --git a/simulator/app/PhoneWindow.cpp b/simulator/app/PhoneWindow.cpp
index 60a9809..0a87762 100644
--- a/simulator/app/PhoneWindow.cpp
+++ b/simulator/app/PhoneWindow.cpp
@@ -54,7 +54,7 @@
         wxDEFAULT_DIALOG_STYLE),
       mpMOHViewIndex(-1),
       mpMOHButton(NULL),
-      mMouseKeySent(kKeyCodeUnknown),
+      mMouseKeySent(AKEYCODE_UNKNOWN),
       mpViewInfo(NULL),
       mNumViewInfo(0),
       mpDeviceWindow(NULL),
@@ -113,7 +113,7 @@
     if (!event.GetActive()) {
         ListIter iter;
         for (iter = mPressedKeys.begin(); iter != mPressedKeys.end(); ) {
-            KeyCode keyCode = (*iter).GetKeyCode();
+            int32_t keyCode = (*iter).GetKeyCode();
             GetDeviceManager()->SendKeyEvent(keyCode, false);
             iter = mPressedKeys.erase(iter);
         }
@@ -474,27 +474,27 @@
     case WXK_NUMPAD_NEXT:
     case WXK_NUMPAD9:
     case '9':                   return KEY_9;
-    case WXK_NUMPAD_MULTIPLY:   return KEY_SWITCHVIDEOMODE; //kKeyCodeStar;
+    case WXK_NUMPAD_MULTIPLY:   return KEY_SWITCHVIDEOMODE; //AKEYCODE_STAR;
     case WXK_LEFT:              return KEY_LEFT;
     case WXK_RIGHT:             return KEY_RIGHT;
     case WXK_UP:                return KEY_UP;
     case WXK_DOWN:              return KEY_DOWN;
-    case WXK_NUMPAD_ENTER:      return KEY_REPLY; //kKeyCodeDpadCenter;
+    case WXK_NUMPAD_ENTER:      return KEY_REPLY; //AKEYCODE_DPAD_CENTER;
     case WXK_HOME:              return KEY_HOME;
     case WXK_PRIOR:
-    case WXK_PAGEUP:            return KEY_MENU; //kKeyCodeSoftLeft;
+    case WXK_PAGEUP:            return KEY_MENU; //AKEYCODE_SOFT_LEFT;
     case WXK_NEXT:
-    case WXK_PAGEDOWN:          return KEY_KBDILLUMUP; //kKeyCodeSoftRight;
+    case WXK_PAGEDOWN:          return KEY_KBDILLUMUP; //AKEYCODE_SOFT_RIGHT;
     case WXK_DELETE:            
-    case WXK_BACK:              return KEY_BACKSPACE; //kKeyCodeDel;
+    case WXK_BACK:              return KEY_BACKSPACE; //AKEYCODE_DEL;
     case WXK_ESCAPE:
-    case WXK_END:               return KEY_BACK; //kKeyCodeBack;
+    case WXK_END:               return KEY_BACK; //AKEYCODE_BACK;
     case WXK_NUMPAD_DELETE:
-    case WXK_NUMPAD_DECIMAL:    return KEY_KBDILLUMTOGGLE; //kKeyCodePound;
-    case WXK_SPACE:             return KEY_SPACE; //kKeyCodeSpace;
-    case WXK_RETURN:            return KEY_ENTER; //kKeyCodeNewline;
-    case WXK_F3:                return KEY_F3; //kKeyCodeCall;
-    case WXK_F4:                return KEY_F4; //kKeyCodeEndCall;
+    case WXK_NUMPAD_DECIMAL:    return KEY_KBDILLUMTOGGLE; //AKEYCODE_POUND;
+    case WXK_SPACE:             return KEY_SPACE; //AKEYCODE_SPACE;
+    case WXK_RETURN:            return KEY_ENTER; //AKEYCODE_ENTER;
+    case WXK_F3:                return KEY_F3; //AKEYCODE_CALL;
+    case WXK_F4:                return KEY_F4; //AKEYCODE_END_CALL;
     case WXK_NUMPAD_ADD:
     case WXK_F5:                return KEY_VOLUMEUP;
     case WXK_NUMPAD_SUBTRACT:
@@ -552,7 +552,7 @@
         break;
     }
 
-    return kKeyCodeUnknown;
+    return AKEYCODE_UNKNOWN;
 }
 
 
@@ -566,10 +566,10 @@
  */
 void PhoneWindow::OnKeyDown(wxKeyEvent& event)
 {
-    KeyCode keyCode;
+    int32_t keyCode;
 
-    keyCode = (KeyCode) ConvertKeyCode(event.GetKeyCode());
-    if (keyCode != kKeyCodeUnknown) {
+    keyCode = ConvertKeyCode(event.GetKeyCode());
+    if (keyCode != AKEYCODE_UNKNOWN) {
         if (!IsKeyPressed(keyCode)) {
             //printf("PW: down: key %d\n", keyCode);
             GetDeviceManager()->SendKeyEvent(keyCode, true);
@@ -586,10 +586,10 @@
  */
 void PhoneWindow::OnKeyUp(wxKeyEvent& event)
 {
-    KeyCode keyCode;
+    int32_t keyCode;
 
-    keyCode = (KeyCode) ConvertKeyCode(event.GetKeyCode());
-    if (keyCode != kKeyCodeUnknown) {
+    keyCode = ConvertKeyCode(event.GetKeyCode());
+    if (keyCode != AKEYCODE_UNKNOWN) {
         // Send the key event if we already have this key pressed.
         if (IsKeyPressed(keyCode)) {
             //printf("PW:   up: key %d\n", keyCode);
@@ -617,7 +617,7 @@
 {
     if (mpMOHButton != NULL) {
         //printf("PW: left down\n");
-        KeyCode keyCode = mpMOHButton->GetKeyCode();
+        int32_t keyCode = mpMOHButton->GetKeyCode();
         GetDeviceManager()->SendKeyEvent(keyCode, true);
         mMouseKeySent = keyCode;
         AddPressedKey(keyCode);
@@ -644,7 +644,7 @@
  */
 void PhoneWindow::OnMouseLeftUp(wxMouseEvent& WXUNUSED(event))
 {
-    if (mMouseKeySent != kKeyCodeUnknown) {
+    if (mMouseKeySent != AKEYCODE_UNKNOWN) {
         //printf("PW: left up\n");
         GetDeviceManager()->SendKeyEvent(mMouseKeySent, false);
         RemovePressedKey(mMouseKeySent);
@@ -658,7 +658,7 @@
             //printf("(ignoring left-up)\n");
         }
     }
-    mMouseKeySent = kKeyCodeUnknown;
+    mMouseKeySent = AKEYCODE_UNKNOWN;
 }
 
 void PhoneWindow::OnMouseRightDown(wxMouseEvent& event)
@@ -909,7 +909,7 @@
 
         ListIter iter;
         for (iter = mPressedKeys.begin(); iter != mPressedKeys.end(); ++iter) {
-            KeyCode keyCode;
+            int32_t keyCode;
             PhoneButton* pButton;
 
             keyCode = (*iter).GetKeyCode();
@@ -933,7 +933,7 @@
  *
  * Schedules a screen refresh if the set of held-down keys changes.
  */
-void PhoneWindow::AddPressedKey(KeyCode keyCode)
+void PhoneWindow::AddPressedKey(int32_t keyCode)
 {
     /*
      * See if the key is already down.  This usually means that the key
@@ -943,8 +943,8 @@
      * a second time.  This way, if we did lose a key-up somehow, they
      * can "clear" the stuck key by hitting it again.
      */
-    if (keyCode == kKeyCodeUnknown) {
-        //printf("--- not adding kKeyCodeUnknown!\n");
+    if (keyCode == AKEYCODE_UNKNOWN) {
+        //printf("--- not adding AKEYCODE_UNKNOWN!\n");
         return;
     }
 
@@ -969,7 +969,7 @@
  *
  * Schedules a screen refresh if the set of held-down keys changes.
  */
-void PhoneWindow::RemovePressedKey(KeyCode keyCode)
+void PhoneWindow::RemovePressedKey(int32_t keyCode)
 {
     /*
      * Release the key.  If it's not in the list, we either missed a
@@ -1000,7 +1000,7 @@
     if (!mPressedKeys.empty()) {
         ListIter iter = mPressedKeys.begin();
         while (iter != mPressedKeys.end()) {
-            KeyCode keyCode = (*iter).GetKeyCode();
+            int32_t keyCode = (*iter).GetKeyCode();
             GetDeviceManager()->SendKeyEvent(keyCode, false);
             iter = mPressedKeys.erase(iter);
         }
@@ -1011,7 +1011,7 @@
 /*
  * Returns "true" if the specified key is currently pressed.
  */
-bool PhoneWindow::IsKeyPressed(KeyCode keyCode)
+bool PhoneWindow::IsKeyPressed(int32_t keyCode)
 {
     ListIter iter;
     for (iter = mPressedKeys.begin(); iter != mPressedKeys.end(); ++iter) {
diff --git a/simulator/app/PhoneWindow.h b/simulator/app/PhoneWindow.h
index 5eb1800..a346e9c 100644
--- a/simulator/app/PhoneWindow.h
+++ b/simulator/app/PhoneWindow.h
@@ -89,7 +89,7 @@
      */
     class KeyInfo {
     public:
-        KeyInfo(void) : mKeyCode(kKeyCodeUnknown) {}
+        KeyInfo(void) : mKeyCode(AKEYCODE_UNKNOWN) {}
         KeyInfo(const KeyInfo& src) {
             mKeyCode = src.mKeyCode;
         }
@@ -102,14 +102,14 @@
             return *this;
         }
 
-        KeyCode GetKeyCode(void) const { return mKeyCode; }
-        void SetKeyCode(KeyCode keyCode) { mKeyCode = keyCode; }
+        int32_t GetKeyCode(void) const { return mKeyCode; }
+        void SetKeyCode(int32_t keyCode) { mKeyCode = keyCode; }
 
         //PhoneButton* GetPhoneButton(void) const { return mpButton; }
         //void SetPhoneButton(PhoneButton* pButton) { mpButton = pButton; }
 
     private:
-        KeyCode    mKeyCode;
+        int32_t mKeyCode;
         //PhoneButton*        mpButton;
     };
 
@@ -135,13 +135,13 @@
     int ConvertKeyCode(int wxKeyCode) const;
 
     /* press a key on the device */
-    void AddPressedKey(KeyCode keyCode);
+    void AddPressedKey(int32_t keyCode);
     /* release a key on the device */
-    void RemovePressedKey(KeyCode keyCode);
+    void RemovePressedKey(int32_t keyCode);
     /* "raise" all keys */
     void ClearPressedKeys(void);
     /* determine whether a key is down */
-    bool IsKeyPressed(KeyCode keyCode);
+    bool IsKeyPressed(int32_t keyCode);
 
     /* manage the device runtime */
     DeviceManager   mDeviceManager;
@@ -149,7 +149,7 @@
     /* button mouse-over highlight handling */
     int             mpMOHViewIndex;     // mouse is in this view
     PhoneButton*    mpMOHButton;        //   over this button
-    KeyCode         mMouseKeySent;     // to handle "key up" for mouse button
+    int32_t         mMouseKeySent;     // to handle "key up" for mouse button
 
     /* handle multiple simultaneous key presses */
     android::List<KeyInfo>  mPressedKeys;
diff --git a/simulator/app/PropertyServer.cpp b/simulator/app/PropertyServer.cpp
index eb1bfc3..4a0a2ac 100644
--- a/simulator/app/PropertyServer.cpp
+++ b/simulator/app/PropertyServer.cpp
@@ -112,6 +112,10 @@
         { "ro.HOME_APP_MEM", "4096" },
         { "ro.BACKUP_APP_ADJ", "2" },
         { "ro.BACKUP_APP_MEM", "4096" },
+        { "ro.PERCEPTIBLE_APP_ADJ", "2" },
+        { "ro.PERCEPTIBLE_APP_MEM", "4096" },
+        { "ro.HEAVY_WEIGHT_APP_ADJ", "3" },
+        { "ro.HEAVY_WEIGHT_APP_MEM", "4096" },
         //{ "init.svc.adbd", "running" },       // causes ADB-JDWP
         { "init.svc.usbd", "running" },
         { "init.svc.debuggerd", "running" },
diff --git a/simulator/wrapsim/SimMgr.c b/simulator/wrapsim/SimMgr.c
index a35c7c6..9b566cf 100644
--- a/simulator/wrapsim/SimMgr.c
+++ b/simulator/wrapsim/SimMgr.c
@@ -763,8 +763,8 @@
                     goto bail;
             }
         } else if (msg.mType == kTypeConfig) {
-            const char *name;
-            const char *val;
+            const char* name = NULL;
+            const char* val = NULL;
             getConfig(&msg, &name, &val);
             if(strcmp(name, "keycharmap") == 0) {
                 free((void*)gWrapSim.keyMap);
diff --git a/testrunner/Android.mk b/testrunner/Android.mk
index b6bde55..d0f773d 100644
--- a/testrunner/Android.mk
+++ b/testrunner/Android.mk
@@ -3,17 +3,23 @@
 #
 
 # where to install the sample files on the device
-# 
+#
 local_target_dir := $(TARGET_OUT_DATA)/testinfo
 LOCAL_PATH := $(call my-dir)
 
 ########################
 include $(CLEAR_VARS)
-
 LOCAL_MODULE := test_defs.xml
 LOCAL_MODULE_TAGS := tests
 LOCAL_MODULE_CLASS := ETC
 LOCAL_MODULE_PATH := $(local_target_dir)
 LOCAL_SRC_FILES := $(LOCAL_MODULE)
+include $(BUILD_PREBUILT)
 
+include $(CLEAR_VARS)
+LOCAL_MODULE := coverage_targets.xml
+LOCAL_MODULE_TAGS := tests
+LOCAL_MODULE_CLASS := ETC
+LOCAL_MODULE_PATH := $(local_target_dir)
+LOCAL_SRC_FILES := $(LOCAL_MODULE)
 include $(BUILD_PREBUILT)
diff --git a/testrunner/adb_interface.py b/testrunner/adb_interface.py
index ad31fb2..1928c73 100755
--- a/testrunner/adb_interface.py
+++ b/testrunner/adb_interface.py
@@ -148,6 +148,19 @@
       return False
     return True
 
+  def EnableAdbRoot(self):
+    """Enable adb root on device."""
+    output = self.SendCommand("root")
+    if "adbd is already running as root" in output:
+      return True
+    elif "restarting adbd as root" in output:
+      # device will disappear from adb, wait for it to come back
+      self.SendCommand("wait-for-device")
+      return True
+    else:
+      logger.Log("Unrecognized output from adb root: %s" % output)
+      return False
+
   def StartInstrumentationForPackage(
       self, package_name, runner_name, timeout_time=60*10,
       no_window_animation=False, instrumentation_args={}):
@@ -406,13 +419,44 @@
     if not success:
       raise errors.WaitForResponseTimedOutError()
 
-  def Sync(self, retry_count=3):
+  def WaitForBootComplete(self, wait_time=120):
+    """Waits for targeted device's bootcomplete flag to be set.
+
+    Args:
+      wait_time: time in seconds to wait
+
+    Raises:
+      WaitForResponseTimedOutError if wait_time elapses and pm still does not
+      respond.
+    """
+    logger.Log("Waiting for boot complete...")
+    self.SendCommand("wait-for-device")
+    # Now the device is there, but may not be running.
+    # Query the package manager with a basic command
+    boot_complete = False
+    attempts = 0
+    wait_period = 5
+    while not boot_complete and (attempts*wait_period) < wait_time:
+      output = self.SendShellCommand("getprop dev.bootcomplete", retry_count=1)
+      output = output.strip()
+      if output == "1":
+        boot_complete = True
+      else:
+        time.sleep(wait_period)
+        attempts += 1
+    if not boot_complete:
+      raise errors.WaitForResponseTimedOutError(
+          "dev.bootcomplete flag was not set after %s seconds" % wait_time)
+
+  def Sync(self, retry_count=3, runtime_restart=False):
     """Perform a adb sync.
 
     Blocks until device package manager is responding.
 
     Args:
       retry_count: number of times to retry sync before failing
+      runtime_restart: stop runtime during sync and restart afterwards, useful
+        for syncing system libraries (core, framework etc)
 
     Raises:
       WaitForResponseTimedOutError if package manager does not respond
@@ -420,6 +464,13 @@
     """
     output = ""
     error = None
+    if runtime_restart:
+      self.SendShellCommand("setprop ro.monkey 1", retry_count=retry_count)
+      # manual rest bootcomplete flag
+      self.SendShellCommand("setprop dev.bootcomplete 0",
+                            retry_count=retry_count)
+      self.SendShellCommand("stop", retry_count=retry_count)
+
     try:
       output = self.SendCommand("sync", retry_count=retry_count)
     except errors.AbortError, e:
@@ -440,10 +491,17 @@
       # exception occurred that cannot be recovered from
       raise error
     logger.SilentLog(output)
-    self.WaitForDevicePm()
+    if runtime_restart:
+      # start runtime and wait till boot complete flag is set
+      self.SendShellCommand("start", retry_count=retry_count)
+      self.WaitForBootComplete()
+      # press the MENU key, this will disable key guard if runtime is started
+      # with ro.monkey set to 1
+      self.SendShellCommand("input keyevent 82", retry_count=retry_count)
+    else:
+      self.WaitForDevicePm()
     return output
 
   def GetSerialNumber(self):
     """Returns the serial number of the targeted device."""
     return self.SendCommand("get-serialno").strip()
-
diff --git a/testrunner/coverage.py b/testrunner/coverage.py
index 52e8a8c..4322e26 100755
--- a/testrunner/coverage.py
+++ b/testrunner/coverage.py
@@ -62,28 +62,6 @@
     self._adb = adb_interface
     self._targets_manifest = self._ReadTargets()
 
-  def TestDeviceCoverageSupport(self):
-    """Check if device has support for generating code coverage metrics.
-
-    Currently this will check if the emma.jar file is on the device's boot
-    classpath.
-
-    Returns:
-      True if device can support code coverage. False otherwise.
-    """
-    try:
-      output = self._adb.SendShellCommand("cat init.rc | grep BOOTCLASSPATH | "
-                                          "grep emma.jar")
-      if len(output) > 0:
-        return True
-    except errors.AbortError:
-      pass
-    logger.Log("Error: Targeted device does not have emma.jar on its "
-               "BOOTCLASSPATH.")
-    logger.Log("Modify the BOOTCLASSPATH entry in system/core/rootdir/init.rc"
-               " to add emma.jar")
-    return False
-
   def ExtractReport(self, test_suite,
                     device_coverage_path,
                     output_path=None,
@@ -311,6 +289,25 @@
   os.environ["EMMA_INSTRUMENT"] = "true"
 
 
+def TestDeviceCoverageSupport(adb):
+  """Check if device has support for generating code coverage metrics.
+
+  This tries to dump emma help information on device, a response containing
+  help information will indicate that emma is already on system class path.
+
+  Returns:
+    True if device can support code coverage. False otherwise.
+  """
+  try:
+    output = adb.SendShellCommand("exec app_process / emma -h")
+
+    if output.find('emma usage:') == 0:
+      return True
+  except errors.AbortError:
+    pass
+  return False
+
+
 def Run():
   """Does coverage operations based on command line args."""
   # TODO: do we want to support combining coverage for a single target
diff --git a/testrunner/runtest.py b/testrunner/runtest.py
index d53312f..4a86a63 100755
--- a/testrunner/runtest.py
+++ b/testrunner/runtest.py
@@ -70,6 +70,8 @@
   # default value for make -jX
   _DEFAULT_JOBS = 4
 
+  _DALVIK_VERIFIER_OFF_PROP = "dalvik.vm.dexopt-flags = v=n"
+
   def __init__(self):
     # disable logging of timestamp
     self._root_path = android_build.GetTop()
@@ -157,7 +159,6 @@
     group.add_option("-s", "--serial", dest="serial",
                      help="use specific serial")
     parser.add_option_group(group)
-
     self._options, self._test_args = parser.parse_args()
 
     if (not self._options.only_list_tests
@@ -228,9 +229,27 @@
     for test_suite in tests:
       self._AddBuildTarget(test_suite, target_set, extra_args_set)
 
+    if not self._options.preview:
+      self._adb.EnableAdbRoot()
+    else:
+      logger.Log("adb root")
+    rebuild_libcore = False
     if target_set:
       if self._options.coverage:
         coverage.EnableCoverageBuild()
+        # hack to remove core library intermediates
+        # hack is needed because:
+        # 1. EMMA_INSTRUMENT changes what source files to include in libcore
+        #    but it does not trigger a rebuild
+        # 2. there's no target (like "clear-intermediates") to remove the files
+        #    decently
+        rebuild_libcore = not coverage.TestDeviceCoverageSupport(self._adb)
+        if rebuild_libcore:
+          cmd = "rm -rf %s" % os.path.join(
+              self._root_path,
+              "out/target/common/obj/JAVA_LIBRARIES/core_intermediates/")
+          logger.Log(cmd)
+          run_command.RunCommand(cmd, return_output=False)
 
       # hack to build cts dependencies
       # TODO: remove this when build dependency support added to runtest or
@@ -245,6 +264,8 @@
           os.chdir(self._root_path)
           run_command.RunCommand(cmd, return_output=False)
           os.chdir(old_dir)
+      # turn off dalvik verifier if necessary
+      self._TurnOffVerifier(tests)
       target_build_string = " ".join(list(target_set))
       extra_args_string = " ".join(list(extra_args_set))
       # mmm cannot be used from python, so perform a similar operation using
@@ -259,9 +280,11 @@
         # run
         logger.Log("adb sync")
       else:
-        run_command.RunCommand(cmd, return_output=False)
+        # set timeout for build to 10 minutes, since libcore may need to
+        # be rebuilt
+        run_command.RunCommand(cmd, return_output=False, timeout_time=600)
         logger.Log("Syncing to device...")
-        self._adb.Sync()
+        self._adb.Sync(runtime_restart=rebuild_libcore)
 
   def _AddBuildTarget(self, test_suite, target_set, extra_args_set):
     build_dir = test_suite.GetBuildPath()
@@ -313,6 +336,36 @@
         return True
     return False
 
+  def _TurnOffVerifier(self, test_list):
+    """Turn off the dalvik verifier if needed by given tests.
+
+    If one or more tests needs dalvik verifier off, and it is not already off,
+    turns off verifier and reboots device to allow change to take effect.
+    """
+    # hack to check if these are framework/base tests. If so, turn off verifier
+    # to allow framework tests to access package-private framework api
+    framework_test = False
+    for test in test_list:
+      if os.path.commonprefix([test.GetBuildPath(), "frameworks/base"]):
+        framework_test = True
+    if framework_test:
+      # check if verifier is off already - to avoid the reboot if not
+      # necessary
+      output = self._adb.SendShellCommand("cat /data/local.prop")
+      if not self._DALVIK_VERIFIER_OFF_PROP in output:
+        if self._options.preview:
+          logger.Log("adb shell \"echo %s >> /data/local.prop\""
+                     % self._DALVIK_VERIFIER_OFF_PROP)
+          logger.Log("adb reboot")
+          logger.Log("adb wait-for-device")
+        else:
+          logger.Log("Turning off dalvik verifier and rebooting")
+          self._adb.SendShellCommand("\"echo %s >> /data/local.prop\""
+                                     % self._DALVIK_VERIFIER_OFF_PROP)
+          self._adb.SendCommand("reboot")
+          self._adb.SendCommand("wait-for-device", timeout_time=60,
+                                retry_count=3)
+
   def RunTests(self):
     """Main entry method - executes the tests according to command line args."""
     try:
diff --git a/testrunner/test_defs.xml b/testrunner/test_defs.xml
index d6ce4c5..f83d32d 100644
--- a/testrunner/test_defs.xml
+++ b/testrunner/test_defs.xml
@@ -36,6 +36,13 @@
     coverage_target="framework"
     continuous="true" />
 
+<!-- will not run in the continuous test as it needs both Wifi & 3G -->
+<test name="frameworks-connectivity"
+    build_path="frameworks/base/core/tests/ConnectivityManagerTest/"
+    package="com.android.connectivitymanagertest"
+    runner=".ConnectivityManagerUnitTestRunner"
+    coverage_target="framework" />
+
 <test name="frameworks-graphics"
     build_path="frameworks/base/graphics/tests/graphicstests"
     package="com.android.frameworks.graphicstests"
@@ -110,6 +117,14 @@
     coverage_target="framework"
     continuous="true" />
 
+<test-native name="libui"
+    build_path="frameworks/base/libs/ui/tests"
+    description="Framework libui unit tests." />
+
+<test-native name="libutils"
+    build_path="frameworks/base/libs/utils/tests"
+    description="Framework libutils unit tests." />
+
 <!--  end of framework tests -->
 
 <!-- media framework tests -->
@@ -382,6 +397,11 @@
     package="com.android.browser.tests"
     coverage_target="Browser" />
 
+<test name="calculator"
+    build_path="packages/apps/Calculator"
+    package="com.android.calculator2.tests"
+    coverage_target="Calculator" />
+
 <test name="calendar"
     build_path="packages/apps/Calendar"
     package="com.android.calendar.tests"
diff --git a/testrunner/test_defs/instrumentation_test.py b/testrunner/test_defs/instrumentation_test.py
index f0a8656..8782615 100644
--- a/testrunner/test_defs/instrumentation_test.py
+++ b/testrunner/test_defs/instrumentation_test.py
@@ -32,8 +32,8 @@
 
   DEFAULT_RUNNER = "android.test.InstrumentationTestRunner"
 
-    # build path to Emma target Makefile
-  _EMMA_BUILD_PATH = os.path.join("external", "emma")
+  # dependency on libcore (used for Emma)
+  _LIBCORE_BUILD_PATH = "libcore"
 
   def __init__(self):
     test_suite.AbstractTestSuite.__init__(self)
@@ -87,7 +87,7 @@
 
   def GetBuildDependencies(self, options):
     if options.coverage:
-      return [self._EMMA_BUILD_PATH]
+      return [self._LIBCORE_BUILD_PATH]
     return []
 
   def Run(self, options, adb):
@@ -144,8 +144,6 @@
       logger.Log(adb_cmd)
     elif options.coverage:
       coverage_gen = coverage.CoverageGenerator(adb)
-      if not coverage_gen.TestDeviceCoverageSupport():
-        raise errors.AbortError
       adb.WaitForInstrumentation(self.GetPackageName(),
                                  self.GetRunnerName())
       # need to parse test output to determine path to coverage file
diff --git a/tools/zoneinfo/generate b/tools/zoneinfo/generate
index 7cd8a26..a34a1fa 100755
--- a/tools/zoneinfo/generate
+++ b/tools/zoneinfo/generate
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-version=tzdata2009s
+version=tzdata2010k
 
 mkdir data
 
diff --git a/tools/zoneinfo/tzdata2009s/africa b/tools/zoneinfo/tzdata2009s/africa
deleted file mode 100644
index ad89bb7..0000000
--- a/tools/zoneinfo/tzdata2009s/africa
+++ /dev/null
@@ -1,997 +0,0 @@
-# <pre>
-# @(#)africa	8.23
-# This file is in the public domain, so clarified as of
-# 2009-05-17 by Arthur David Olson.
-
-# This data is by no means authoritative; if you think you know better,
-# go ahead and edit the file (and please send any changes to
-# tz@elsie.nci.nih.gov for general use in the future).
-
-# From Paul Eggert (2006-03-22):
-#
-# A good source for time zone historical data outside the U.S. is
-# Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
-# San Diego: ACS Publications, Inc. (2003).
-#
-# Gwillim Law writes that a good source
-# for recent time zone data is the International Air Transport
-# Association's Standard Schedules Information Manual (IATA SSIM),
-# published semiannually.  Law sent in several helpful summaries
-# of the IATA's data after 1990.
-#
-# Except where otherwise noted, Shanks & Pottenger is the source for
-# entries through 1990, and IATA SSIM is the source for entries afterwards.
-#
-# Another source occasionally used is Edward W. Whitman, World Time Differences,
-# Whitman Publishing Co, 2 Niagara Av, Ealing, London (undated), which
-# I found in the UCLA library.
-#
-# A reliable and entertaining source about time zones is
-# Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997).
-#
-# Previous editions of this database used WAT, CAT, SAT, and EAT
-# for +0:00 through +3:00, respectively,
-# but Mark R V Murray reports that
-# `SAST' is the official abbreviation for +2:00 in the country of South Africa,
-# `CAT' is commonly used for +2:00 in countries north of South Africa, and
-# `WAT' is probably the best name for +1:00, as the common phrase for
-# the area that includes Nigeria is ``West Africa''.
-# He has heard of ``Western Sahara Time'' for +0:00 but can find no reference.
-#
-# To make things confusing, `WAT' seems to have been used for -1:00 long ago;
-# I'd guess that this was because people needed _some_ name for -1:00,
-# and at the time, far west Africa was the only major land area in -1:00.
-# This usage is now obsolete, as the last use of -1:00 on the African
-# mainland seems to have been 1976 in Western Sahara.
-#
-# To summarize, the following abbreviations seem to have some currency:
-#	-1:00	WAT	West Africa Time (no longer used)
-#	 0:00	GMT	Greenwich Mean Time
-#	 2:00	CAT	Central Africa Time
-#	 2:00	SAST	South Africa Standard Time
-# and Murray suggests the following abbreviation:
-#	 1:00	WAT	West Africa Time
-# I realize that this leads to `WAT' being used for both -1:00 and 1:00
-# for times before 1976, but this is the best I can think of
-# until we get more information.
-#
-# I invented the following abbreviations; corrections are welcome!
-#	 2:00	WAST	West Africa Summer Time
-#	 2:30	BEAT	British East Africa Time (no longer used)
-#	 2:44:45 BEAUT	British East Africa Unified Time (no longer used)
-#	 3:00	CAST	Central Africa Summer Time (no longer used)
-#	 3:00	SAST	South Africa Summer Time (no longer used)
-#	 3:00	EAT	East Africa Time
-#	 4:00	EAST	East Africa Summer Time (no longer used)
-
-# Algeria
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Algeria	1916	only	-	Jun	14	23:00s	1:00	S
-Rule	Algeria	1916	1919	-	Oct	Sun>=1	23:00s	0	-
-Rule	Algeria	1917	only	-	Mar	24	23:00s	1:00	S
-Rule	Algeria	1918	only	-	Mar	 9	23:00s	1:00	S
-Rule	Algeria	1919	only	-	Mar	 1	23:00s	1:00	S
-Rule	Algeria	1920	only	-	Feb	14	23:00s	1:00	S
-Rule	Algeria	1920	only	-	Oct	23	23:00s	0	-
-Rule	Algeria	1921	only	-	Mar	14	23:00s	1:00	S
-Rule	Algeria	1921	only	-	Jun	21	23:00s	0	-
-Rule	Algeria	1939	only	-	Sep	11	23:00s	1:00	S
-Rule	Algeria	1939	only	-	Nov	19	 1:00	0	-
-Rule	Algeria	1944	1945	-	Apr	Mon>=1	 2:00	1:00	S
-Rule	Algeria	1944	only	-	Oct	 8	 2:00	0	-
-Rule	Algeria	1945	only	-	Sep	16	 1:00	0	-
-Rule	Algeria	1971	only	-	Apr	25	23:00s	1:00	S
-Rule	Algeria	1971	only	-	Sep	26	23:00s	0	-
-Rule	Algeria	1977	only	-	May	 6	 0:00	1:00	S
-Rule	Algeria	1977	only	-	Oct	21	 0:00	0	-
-Rule	Algeria	1978	only	-	Mar	24	 1:00	1:00	S
-Rule	Algeria	1978	only	-	Sep	22	 3:00	0	-
-Rule	Algeria	1980	only	-	Apr	25	 0:00	1:00	S
-Rule	Algeria	1980	only	-	Oct	31	 2:00	0	-
-# Shanks & Pottenger give 0:09:20 for Paris Mean Time; go with Howse's
-# more precise 0:09:21.
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Africa/Algiers	0:12:12 -	LMT	1891 Mar 15 0:01
-			0:09:21	-	PMT	1911 Mar 11    # Paris Mean Time
-			0:00	Algeria	WE%sT	1940 Feb 25 2:00
-			1:00	Algeria	CE%sT	1946 Oct  7
-			0:00	-	WET	1956 Jan 29
-			1:00	-	CET	1963 Apr 14
-			0:00	Algeria	WE%sT	1977 Oct 21
-			1:00	Algeria	CE%sT	1979 Oct 26
-			0:00	Algeria	WE%sT	1981 May
-			1:00	-	CET
-
-# Angola
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Africa/Luanda	0:52:56	-	LMT	1892
-			0:52:04	-	AOT	1911 May 26 # Angola Time
-			1:00	-	WAT
-
-# Benin
-# Whitman says they switched to 1:00 in 1946, not 1934;
-# go with Shanks & Pottenger.
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone Africa/Porto-Novo	0:10:28	-	LMT	1912
-			0:00	-	GMT	1934 Feb 26
-			1:00	-	WAT
-
-# Botswana
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Africa/Gaborone	1:43:40 -	LMT	1885
-			2:00	-	CAT	1943 Sep 19 2:00
-			2:00	1:00	CAST	1944 Mar 19 2:00
-			2:00	-	CAT
-
-# Burkina Faso
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone Africa/Ouagadougou	-0:06:04 -	LMT	1912
-			 0:00	-	GMT
-
-# Burundi
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone Africa/Bujumbura	1:57:28	-	LMT	1890
-			2:00	-	CAT
-
-# Cameroon
-# Whitman says they switched to 1:00 in 1920; go with Shanks & Pottenger.
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Africa/Douala	0:38:48	-	LMT	1912
-			1:00	-	WAT
-
-# Cape Verde
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone Atlantic/Cape_Verde -1:34:04 -	LMT	1907			# Praia
-			-2:00	-	CVT	1942 Sep
-			-2:00	1:00	CVST	1945 Oct 15
-			-2:00	-	CVT	1975 Nov 25 2:00
-			-1:00	-	CVT
-
-# Central African Republic
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Africa/Bangui	1:14:20	-	LMT	1912
-			1:00	-	WAT
-
-# Chad
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Africa/Ndjamena	1:00:12 -	LMT	1912
-			1:00	-	WAT	1979 Oct 14
-			1:00	1:00	WAST	1980 Mar  8
-			1:00	-	WAT
-
-# Comoros
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Indian/Comoro	2:53:04 -	LMT	1911 Jul   # Moroni, Gran Comoro
-			3:00	-	EAT
-
-# Democratic Republic of Congo
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone Africa/Kinshasa	1:01:12 -	LMT	1897 Nov 9
-			1:00	-	WAT
-Zone Africa/Lubumbashi	1:49:52 -	LMT	1897 Nov 9
-			2:00	-	CAT
-
-# Republic of the Congo
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone Africa/Brazzaville	1:01:08 -	LMT	1912
-			1:00	-	WAT
-
-# Cote D'Ivoire
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Africa/Abidjan	-0:16:08 -	LMT	1912
-			 0:00	-	GMT
-
-# Djibouti
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Africa/Djibouti	2:52:36 -	LMT	1911 Jul
-			3:00	-	EAT
-
-###############################################################################
-
-# Egypt
-
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Egypt	1940	only	-	Jul	15	0:00	1:00	S
-Rule	Egypt	1940	only	-	Oct	 1	0:00	0	-
-Rule	Egypt	1941	only	-	Apr	15	0:00	1:00	S
-Rule	Egypt	1941	only	-	Sep	16	0:00	0	-
-Rule	Egypt	1942	1944	-	Apr	 1	0:00	1:00	S
-Rule	Egypt	1942	only	-	Oct	27	0:00	0	-
-Rule	Egypt	1943	1945	-	Nov	 1	0:00	0	-
-Rule	Egypt	1945	only	-	Apr	16	0:00	1:00	S
-Rule	Egypt	1957	only	-	May	10	0:00	1:00	S
-Rule	Egypt	1957	1958	-	Oct	 1	0:00	0	-
-Rule	Egypt	1958	only	-	May	 1	0:00	1:00	S
-Rule	Egypt	1959	1981	-	May	 1	1:00	1:00	S
-Rule	Egypt	1959	1965	-	Sep	30	3:00	0	-
-Rule	Egypt	1966	1994	-	Oct	 1	3:00	0	-
-Rule	Egypt	1982	only	-	Jul	25	1:00	1:00	S
-Rule	Egypt	1983	only	-	Jul	12	1:00	1:00	S
-Rule	Egypt	1984	1988	-	May	 1	1:00	1:00	S
-Rule	Egypt	1989	only	-	May	 6	1:00	1:00	S
-Rule	Egypt	1990	1994	-	May	 1	1:00	1:00	S
-# IATA (after 1990) says transitions are at 0:00.
-# Go with IATA starting in 1995, except correct 1995 entry from 09-30 to 09-29.
-Rule	Egypt	1995	max	-	Apr	lastFri	 0:00s	1:00	S
-Rule	Egypt	1995	2005	-	Sep	lastThu	23:00s	0	-
-# From Steffen Thorsen (2006-09-19):
-# The Egyptian Gazette, issue 41,090 (2006-09-18), page 1, reports:
-# Egypt will turn back clocks by one hour at the midnight of Thursday
-# after observing the daylight saving time since May.
-# http://news.gom.com.eg/gazette/pdf/2006/09/18/01.pdf
-Rule	Egypt	2006	only	-	Sep	21	23:00s	0	-
-# From Dirk Losch (2007-08-14):
-# I received a mail from an airline which says that the daylight
-# saving time in Egypt will end in the night of 2007-09-06 to 2007-09-07.
-# From Jesper Norgaard Welen (2007-08-15): [The following agree:]
-# http://www.nentjes.info/Bill/bill5.htm 
-# http://www.timeanddate.com/worldclock/city.html?n=53
-# From Steffen Thorsen (2007-09-04): The official information...:
-# http://www.sis.gov.eg/En/EgyptOnline/Miscellaneous/000002/0207000000000000001580.htm
-Rule	Egypt	2007	only	-	Sep	Thu>=1	23:00s	0	-
-# From Abdelrahman Hassan (2007-09-06):
-# Due to the Hijri (lunar Islamic calendar) year being 11 days shorter
-# than the year of the Gregorian calendar, Ramadan shifts earlier each
-# year. This year it will be observed September 13 (September is quite
-# hot in Egypt), and the idea is to make fasting easier for workers by
-# shifting business hours one hour out of daytime heat. Consequently,
-# unless discontinued, next DST may end Thursday 28 August 2008.
-# From Paul Eggert (2007-08-17):
-# For lack of better info, assume the new rule is last Thursday in August.
-
-# From Petr Machata (2009-04-06):
-# The following appeared in Red Hat bugzilla[1] (edited):
-#
-# > $ zdump -v /usr/share/zoneinfo/Africa/Cairo | grep 2009
-# > /usr/share/zoneinfo/Africa/Cairo  Thu Apr 23 21:59:59 2009 UTC = Thu =
-# Apr 23
-# > 23:59:59 2009 EET isdst=0 gmtoff=7200
-# > /usr/share/zoneinfo/Africa/Cairo  Thu Apr 23 22:00:00 2009 UTC = Fri =
-# Apr 24
-# > 01:00:00 2009 EEST isdst=1 gmtoff=10800
-# > /usr/share/zoneinfo/Africa/Cairo  Thu Aug 27 20:59:59 2009 UTC = Thu =
-# Aug 27
-# > 23:59:59 2009 EEST isdst=1 gmtoff=10800
-# > /usr/share/zoneinfo/Africa/Cairo  Thu Aug 27 21:00:00 2009 UTC = Thu =
-# Aug 27
-# > 23:00:00 2009 EET isdst=0 gmtoff=7200
-#
-# > end date should be Thu Sep 24 2009 (Last Thursday in September at 23:59=
-# :59)
-# > http://support.microsoft.com/kb/958729/
-#
-# timeanddate[2] and another site I've found[3] also support that.
-#
-# [1] <a href="https://bugzilla.redhat.com/show_bug.cgi?id=492263">
-# https://bugzilla.redhat.com/show_bug.cgi?id=492263
-# </a>
-# [2] <a href="http://www.timeanddate.com/worldclock/clockchange.html?n=53">
-# http://www.timeanddate.com/worldclock/clockchange.html?n=53
-# </a>
-# [3] <a href="http://wwp.greenwichmeantime.com/time-zone/africa/egypt/">
-# http://wwp.greenwichmeantime.com/time-zone/africa/egypt/
-# </a>
-
-# From Arthur David Olson (2009-04-20):
-# In 2009 (and for the next several years), Ramadan ends before the fourth
-# Thursday in September; Egypt is expected to revert to the last Thursday
-# in September.
-
-# From Steffen Thorsen (2009-08-11):
-# We have been able to confirm the August change with the Egyptian Cabinet 
-# Information and Decision Support Center:
-# <a href="http://www.timeanddate.com/news/time/egypt-dst-ends-2009.html">
-# http://www.timeanddate.com/news/time/egypt-dst-ends-2009.html
-# </a>
-# 
-# The Middle East News Agency
-# <a href="http://www.mena.org.eg/index.aspx">
-# http://www.mena.org.eg/index.aspx
-# </a>
-# also reports "Egypt starts winter time on August 21"
-# today in article numbered "71, 11/08/2009 12:25 GMT." 
-# Only the title above is available without a subscription to their service,
-# and can be found by searching for "winter" in their search engine
-# (at least today).
-
-Rule	Egypt	2008	only	-	Aug	lastThu	23:00s	0	-
-Rule	Egypt	2009	only	-	Aug	20	23:00s	0	-
-Rule	Egypt	2010	max	-	Sep	lastThu	23:00s	0	-
-
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Africa/Cairo	2:05:00 -	LMT	1900 Oct
-			2:00	Egypt	EE%sT
-
-# Equatorial Guinea
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Africa/Malabo	0:35:08 -	LMT	1912
-			0:00	-	GMT	1963 Dec 15
-			1:00	-	WAT
-
-# Eritrea
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Africa/Asmara	2:35:32 -	LMT	1870
-			2:35:32	-	AMT	1890	      # Asmara Mean Time
-			2:35:20	-	ADMT	1936 May 5    # Adis Dera MT
-			3:00	-	EAT
-
-# Ethiopia
-# From Paul Eggert (2006-03-22):
-# Shanks & Pottenger write that Ethiopia had six narrowly-spaced time zones
-# between 1870 and 1890, and that they merged to 38E50 (2:35:20) in 1890.
-# We'll guess that 38E50 is for Adis Dera.
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone Africa/Addis_Ababa	2:34:48 -	LMT	1870
-			2:35:20	-	ADMT	1936 May 5    # Adis Dera MT
-			3:00	-	EAT
-
-# Gabon
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone Africa/Libreville	0:37:48 -	LMT	1912
-			1:00	-	WAT
-
-# Gambia
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Africa/Banjul	-1:06:36 -	LMT	1912
-			-1:06:36 -	BMT	1935	# Banjul Mean Time
-			-1:00	-	WAT	1964
-			 0:00	-	GMT
-
-# Ghana
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-# Whitman says DST was observed from 1931 to ``the present'';
-# go with Shanks & Pottenger.
-Rule	Ghana	1936	1942	-	Sep	 1	0:00	0:20	GHST
-Rule	Ghana	1936	1942	-	Dec	31	0:00	0	GMT
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Africa/Accra	-0:00:52 -	LMT	1918
-			 0:00	Ghana	%s
-
-# Guinea
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Africa/Conakry	-0:54:52 -	LMT	1912
-			 0:00	-	GMT	1934 Feb 26
-			-1:00	-	WAT	1960
-			 0:00	-	GMT
-
-# Guinea-Bissau
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Africa/Bissau	-1:02:20 -	LMT	1911 May 26
-			-1:00	-	WAT	1975
-			 0:00	-	GMT
-
-# Kenya
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Africa/Nairobi	2:27:16	-	LMT	1928 Jul
-			3:00	-	EAT	1930
-			2:30	-	BEAT	1940
-			2:44:45	-	BEAUT	1960
-			3:00	-	EAT
-
-# Lesotho
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Africa/Maseru	1:50:00 -	LMT	1903 Mar
-			2:00	-	SAST	1943 Sep 19 2:00
-			2:00	1:00	SAST	1944 Mar 19 2:00
-			2:00	-	SAST
-
-# Liberia
-# From Paul Eggert (2006-03-22):
-# In 1972 Liberia was the last country to switch
-# from a UTC offset that was not a multiple of 15 or 20 minutes.
-# Howse reports that it was in honor of their president's birthday.
-# Shank & Pottenger report the date as May 1, whereas Howse reports Jan;
-# go with Shanks & Pottenger.
-# For Liberia before 1972, Shanks & Pottenger report -0:44, whereas Howse and
-# Whitman each report -0:44:30; go with the more precise figure.
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Africa/Monrovia	-0:43:08 -	LMT	1882
-			-0:43:08 -	MMT	1919 Mar # Monrovia Mean Time
-			-0:44:30 -	LRT	1972 May # Liberia Time
-			 0:00	-	GMT
-
-###############################################################################
-
-# Libya
-
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Libya	1951	only	-	Oct	14	2:00	1:00	S
-Rule	Libya	1952	only	-	Jan	 1	0:00	0	-
-Rule	Libya	1953	only	-	Oct	 9	2:00	1:00	S
-Rule	Libya	1954	only	-	Jan	 1	0:00	0	-
-Rule	Libya	1955	only	-	Sep	30	0:00	1:00	S
-Rule	Libya	1956	only	-	Jan	 1	0:00	0	-
-Rule	Libya	1982	1984	-	Apr	 1	0:00	1:00	S
-Rule	Libya	1982	1985	-	Oct	 1	0:00	0	-
-Rule	Libya	1985	only	-	Apr	 6	0:00	1:00	S
-Rule	Libya	1986	only	-	Apr	 4	0:00	1:00	S
-Rule	Libya	1986	only	-	Oct	 3	0:00	0	-
-Rule	Libya	1987	1989	-	Apr	 1	0:00	1:00	S
-Rule	Libya	1987	1989	-	Oct	 1	0:00	0	-
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Africa/Tripoli	0:52:44 -	LMT	1920
-			1:00	Libya	CE%sT	1959
-			2:00	-	EET	1982
-			1:00	Libya	CE%sT	1990 May  4
-# The following entries are from Shanks & Pottenger;
-# the IATA SSIM data contain some obvious errors.
-			2:00	-	EET	1996 Sep 30
-			1:00	-	CET	1997 Apr  4
-			1:00	1:00	CEST	1997 Oct  4
-			2:00	-	EET
-
-# Madagascar
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone Indian/Antananarivo 3:10:04 -	LMT	1911 Jul
-			3:00	-	EAT	1954 Feb 27 23:00s
-			3:00	1:00	EAST	1954 May 29 23:00s
-			3:00	-	EAT
-
-# Malawi
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Africa/Blantyre	2:20:00 -	LMT	1903 Mar
-			2:00	-	CAT
-
-# Mali
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Africa/Bamako	-0:32:00 -	LMT	1912
-			 0:00	-	GMT	1934 Feb 26
-			-1:00	-	WAT	1960 Jun 20
-			 0:00	-	GMT
-
-# Mauritania
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone Africa/Nouakchott	-1:03:48 -	LMT	1912
-			 0:00	-	GMT	1934 Feb 26
-			-1:00	-	WAT	1960 Nov 28
-			 0:00	-	GMT
-
-# Mauritius
-
-# From Steffen Thorsen (2008-06-25):
-# Mauritius plans to observe DST from 2008-11-01 to 2009-03-31 on a trial
-# basis....
-# It seems that Mauritius observed daylight saving time from 1982-10-10 to 
-# 1983-03-20 as well, but that was not successful....
-# http://www.timeanddate.com/news/time/mauritius-daylight-saving-time.html
-
-# From Alex Krivenyshev (2008-06-25):
-# http://economicdevelopment.gov.mu/portal/site/Mainhomepage/menuitem.a42b24128104d9845dabddd154508a0c/?content_id=0a7cee8b5d69a110VgnVCM1000000a04a8c0RCRD
-
-# From Arthur David Olson (2008-06-30):
-# The www.timeanddate.com article cited by Steffen Thorsen notes that "A
-# final decision has yet to be made on the times that daylight saving
-# would begin and end on these dates." As a place holder, use midnight.
-
-# From Paul Eggert (2008-06-30):
-# Follow Thorsen on DST in 1982/1983, instead of Shanks & Pottenger.
-
-# From Steffen Thorsen (2008-07-10):
-# According to
-# <a href="http://www.lexpress.mu/display_article.php?news_id=111216">
-# http://www.lexpress.mu/display_article.php?news_id=111216
-# </a>
-# (in French), Mauritius will start and end their DST a few days earlier
-# than previously announced (2008-11-01 to 2009-03-31).  The new start
-# date is 2008-10-26 at 02:00 and the new end date is 2009-03-27 (no time
-# given, but it is probably at either 2 or 3 wall clock time).
-# 
-# A little strange though, since the article says that they moved the date 
-# to align itself with Europe and USA which also change time on that date, 
-# but that means they have not paid attention to what happened in 
-# USA/Canada last year (DST ends first Sunday in November). I also wonder 
-# why that they end on a Friday, instead of aligning with Europe which 
-# changes two days later.
-
-# From Alex Krivenyshev (2008-07-11):
-# Seems that English language article "The revival of daylight saving
-# time:  Energy conservation?"-# No. 16578 (07/11/2008) was originally
-# published on Monday, June 30, 2008...
-#
-# I guess that article in French "Le gouvernement avance l'introduction
-# de l'heure d'ete" stating that DST in Mauritius starting on October 26
-# and ending on March 27, 2009 is the most recent one.
-# ...
-# <a href="http://www.worldtimezone.com/dst_news/dst_news_mauritius02.html">
-# http://www.worldtimezone.com/dst_news/dst_news_mauritius02.html
-# </a>
-
-# From Riad M. Hossen Ally (2008-08-03):
-# The Government of Mauritius weblink
-# <a href="http://www.gov.mu/portal/site/pmosite/menuitem.4ca0efdee47462e7440a600248a521ca/?content_id=4728ca68b2a5b110VgnVCM1000000a04a8c0RCRD">
-# http://www.gov.mu/portal/site/pmosite/menuitem.4ca0efdee47462e7440a600248a521ca/?content_id=4728ca68b2a5b110VgnVCM1000000a04a8c0RCRD
-# </a>
-# Cabinet Decision of July 18th, 2008 states as follows:
-#
-# 4. ...Cabinet has agreed to the introduction into the National Assembly
-# of the Time Bill which provides for the introduction of summer time in
-# Mauritius. The summer time period which will be of one hour ahead of
-# the standard time, will be aligned with that in Europe and the United
-# States of America. It will start at two o'clock in the morning on the
-# last Sunday of October and will end at two o'clock in the morning on
-# the last Sunday of March the following year. The summer time for the
-# year 2008 - 2009 will, therefore, be effective as from 26 October 2008
-# and end on 29 March 2009.
-
-# From Ed Maste (2008-10-07):
-# THE TIME BILL (No. XXVII of 2008) Explanatory Memorandum states the
-# beginning / ending of summer time is 2 o'clock standard time in the
-# morning of the last Sunday of October / last Sunday of March.
-# <a href="http://www.gov.mu/portal/goc/assemblysite/file/bill2708.pdf">
-# http://www.gov.mu/portal/goc/assemblysite/file/bill2708.pdf
-# </a>
-
-# From Steffen Thorsen (2009-06-05):
-# According to several sources, Mauritius will not continue to observe
-# DST the coming summer...
-#
-# Some sources, in French:
-# <a href="http://www.defimedia.info/news/946/Rashid-Beebeejaun-:-%C2%AB-L%E2%80%99heure-d%E2%80%99%C3%A9t%C3%A9-ne-sera-pas-appliqu%C3%A9e-cette-ann%C3%A9e-%C2%BB">
-# http://www.defimedia.info/news/946/Rashid-Beebeejaun-:-%C2%AB-L%E2%80%99heure-d%E2%80%99%C3%A9t%C3%A9-ne-sera-pas-appliqu%C3%A9e-cette-ann%C3%A9e-%C2%BB
-# </a>
-# <a href="http://lexpress.mu/Story/3398~Beebeejaun---Les-objectifs-d-%C3%A9conomie-d-%C3%A9nergie-de-l-heure-d-%C3%A9t%C3%A9-ont-%C3%A9t%C3%A9-atteints-">
-# http://lexpress.mu/Story/3398~Beebeejaun---Les-objectifs-d-%C3%A9conomie-d-%C3%A9nergie-de-l-heure-d-%C3%A9t%C3%A9-ont-%C3%A9t%C3%A9-atteints-
-# </a>
-#
-# Our wrap-up:
-# <a href="http://www.timeanddate.com/news/time/mauritius-dst-will-not-repeat.html">
-# http://www.timeanddate.com/news/time/mauritius-dst-will-not-repeat.html
-# </a>
-
-# From Arthur David Olson (2009-07-11):
-# The "mauritius-dst-will-not-repeat" wrapup includes this: 
-# "The trial ended on March 29, 2009, when the clocks moved back by one hour
-# at 2am (or 02:00) local time..."
-
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule Mauritius	1982	only	-	Oct	10	0:00	1:00	S
-Rule Mauritius	1983	only	-	Mar	21	0:00	0	-
-Rule Mauritius	2008	only	-	Oct	lastSun	2:00	1:00	S
-Rule Mauritius	2009	only	-	Mar	lastSun	2:00	0	-
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone Indian/Mauritius	3:50:00 -	LMT	1907		# Port Louis
-			4:00 Mauritius	MU%sT	# Mauritius Time
-# Agalega Is, Rodriguez
-# no information; probably like Indian/Mauritius
-
-# Mayotte
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Indian/Mayotte	3:00:56 -	LMT	1911 Jul	# Mamoutzou
-			3:00	-	EAT
-
-# Morocco
-# See the `europe' file for Spanish Morocco (Africa/Ceuta).
-
-# From Alex Krivenyshev (2008-05-09):
-# Here is an article that Morocco plan to introduce Daylight Saving Time between
-# 1 June, 2008 and 27 September, 2008.
-#
-# "... Morocco is to save energy by adjusting its clock during summer so it will
-# be one hour ahead of GMT between 1 June and 27 September, according to
-# Communication Minister and Gov ernment Spokesman, Khalid Naciri...."
-#
-# <a href="http://www.worldtimezone.net/dst_news/dst_news_morocco01.html">
-# http://www.worldtimezone.net/dst_news/dst_news_morocco01.html
-# </a>
-# OR
-# <a href="http://en.afrik.com/news11892.html">
-# http://en.afrik.com/news11892.html
-# </a>
-
-# From Alex Krivenyshev (2008-05-09):
-# The Morocco time change can be confirmed on Morocco web site Maghreb Arabe Presse:
-# <a href="http://www.map.ma/eng/sections/box3/morocco_shifts_to_da/view">
-# http://www.map.ma/eng/sections/box3/morocco_shifts_to_da/view
-# </a>
-#
-# Morocco shifts to daylight time on June 1st through September 27, Govt.
-# spokesman.
-
-# From Patrice Scattolin (2008-05-09):
-# According to this article:
-# <a href="http://www.avmaroc.com/actualite/heure-dete-comment-a127896.html">
-# http://www.avmaroc.com/actualite/heure-dete-comment-a127896.html
-# </a>
-# (and republished here:
-# <a href="http://www.actu.ma/heure-dete-comment_i127896_0.html">
-# http://www.actu.ma/heure-dete-comment_i127896_0.html
-# </a>
-# )
-# the changes occurs at midnight:
-#
-# saturday night may 31st at midnight (which in french is to be
-# intrepreted as the night between saturday and sunday)
-# sunday night the 28th  at midnight
-#
-# Seeing that the 28th is monday, I am guessing that she intends to say
-# the midnight of the 28th which is the midnight between sunday and
-# monday, which jives with other sources that say that it's inclusive
-# june1st to sept 27th.
-#
-# The decision was taken by decree *2-08-224 *but I can't find the decree
-# published on the web.
-#
-# It's also confirmed here:
-# <a href="http://www.maroc.ma/NR/exeres/FACF141F-D910-44B0-B7FA-6E03733425D1.htm">
-# http://www.maroc.ma/NR/exeres/FACF141F-D910-44B0-B7FA-6E03733425D1.htm
-# </a>
-# on a government portal as being  between june 1st and sept 27th (not yet
-# posted in english).
-#
-# The following google query will generate many relevant hits:
-# <a href="http://www.google.com/search?hl=en&q=Conseil+de+gouvernement+maroc+heure+avance&btnG=Search">
-# http://www.google.com/search?hl=en&q=Conseil+de+gouvernement+maroc+heure+avance&btnG=Search
-# </a>
-
-# From Alex Krivenyshev (2008-05-09):
-# Is Western Sahara (part which administrated by Morocco) going to follow
-# Morocco DST changes?  Any information?  What about other part of
-# Western Sahara - under administration of POLISARIO Front (also named
-# SADR Saharawi Arab Democratic Republic)?
-
-# From Arthur David Olson (2008-05-09):
-# XXX--guess that it is only Morocco for now; guess only 2008 for now.
-
-# From Steffen Thorsen (2008-08-27):
-# Morocco will change the clocks back on the midnight between August 31 
-# and September 1. They originally planned to observe DST to near the end 
-# of September:
-#
-# One article about it (in French):
-# <a href="http://www.menara.ma/fr/Actualites/Maroc/Societe/ci.retour_a_l_heure_gmt_a_partir_du_dimanche_31_aout_a_minuit_officiel_.default">
-# http://www.menara.ma/fr/Actualites/Maroc/Societe/ci.retour_a_l_heure_gmt_a_partir_du_dimanche_31_aout_a_minuit_officiel_.default
-# </a>
-#
-# We have some further details posted here:
-# <a href="http://www.timeanddate.com/news/time/morocco-ends-dst-early-2008.html">
-# http://www.timeanddate.com/news/time/morocco-ends-dst-early-2008.html
-# </a>
-
-# From Steffen Thorsen (2009-03-17):
-# Morocco will observe DST from 2009-06-01 00:00 to 2009-08-21 00:00 according
-# to many sources, such as
-# <a href="http://news.marweb.com/morocco/entertainment/morocco-daylight-saving.html">
-# http://news.marweb.com/morocco/entertainment/morocco-daylight-saving.html
-# </a>
-# <a href="http://www.medi1sat.ma/fr/depeche.aspx?idp=2312">
-# http://www.medi1sat.ma/fr/depeche.aspx?idp=2312
-# </a>
-# (French)
-#
-# Our summary:
-# <a href="http://www.timeanddate.com/news/time/morocco-starts-dst-2009.html">
-# http://www.timeanddate.com/news/time/morocco-starts-dst-2009.html
-# </a>
-
-# From Alexander Krivenyshev (2009-03-17):
-# Here is a link to official document from Royaume du Maroc Premier Ministre,
-# Ministere de la Modernisation des Secteurs Publics
-#
-# Under Article 1 of Royal Decree No. 455-67 of Act 23 safar 1387 (2 june 1967)
-# concerning the amendment of the legal time, the Ministry of Modernization of
-# Public Sectors announced that the official time in the Kingdom will be
-# advanced 60 minutes from Sunday 31 May 2009 at midnight.
-#
-# <a href="http://www.mmsp.gov.ma/francais/Actualites_fr/PDF_Actualites_Fr/HeureEte_FR.pdf">
-# http://www.mmsp.gov.ma/francais/Actualites_fr/PDF_Actualites_Fr/HeureEte_FR.pdf
-# </a>
-#
-# <a href="http://www.worldtimezone.com/dst_news/dst_news_morocco03.html">
-# http://www.worldtimezone.com/dst_news/dst_news_morocco03.html
-# </a>
-
-# RULE	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-
-Rule	Morocco	1939	only	-	Sep	12	 0:00	1:00	S
-Rule	Morocco	1939	only	-	Nov	19	 0:00	0	-
-Rule	Morocco	1940	only	-	Feb	25	 0:00	1:00	S
-Rule	Morocco	1945	only	-	Nov	18	 0:00	0	-
-Rule	Morocco	1950	only	-	Jun	11	 0:00	1:00	S
-Rule	Morocco	1950	only	-	Oct	29	 0:00	0	-
-Rule	Morocco	1967	only	-	Jun	 3	12:00	1:00	S
-Rule	Morocco	1967	only	-	Oct	 1	 0:00	0	-
-Rule	Morocco	1974	only	-	Jun	24	 0:00	1:00	S
-Rule	Morocco	1974	only	-	Sep	 1	 0:00	0	-
-Rule	Morocco	1976	1977	-	May	 1	 0:00	1:00	S
-Rule	Morocco	1976	only	-	Aug	 1	 0:00	0	-
-Rule	Morocco	1977	only	-	Sep	28	 0:00	0	-
-Rule	Morocco	1978	only	-	Jun	 1	 0:00	1:00	S
-Rule	Morocco	1978	only	-	Aug	 4	 0:00	0	-
-Rule	Morocco	2008	only	-	Jun	 1	 0:00	1:00	S
-Rule	Morocco	2008	only	-	Sep	 1	 0:00	0	-
-Rule	Morocco	2009	only	-	Jun	 1	 0:00	1:00	S
-Rule	Morocco	2009	only	-	Aug	 21	 0:00	0	-
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone Africa/Casablanca	-0:30:20 -	LMT	1913 Oct 26
-			 0:00	Morocco	WE%sT	1984 Mar 16
-			 1:00	-	CET	1986
-			 0:00	Morocco	WE%sT
-# Western Sahara
-Zone Africa/El_Aaiun	-0:52:48 -	LMT	1934 Jan
-			-1:00	-	WAT	1976 Apr 14
-			 0:00	-	WET
-
-# Mozambique
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Africa/Maputo	2:10:20 -	LMT	1903 Mar
-			2:00	-	CAT
-
-# Namibia
-# The 1994-04-03 transition is from Shanks & Pottenger.
-# Shanks & Pottenger report no DST after 1998-04; go with IATA.
-
-# From Petronella Sibeene (2007-03-30) in
-# <http://allafrica.com/stories/200703300178.html>:
-# While the entire country changes its time, Katima Mulilo and other
-# settlements in Caprivi unofficially will not because the sun there
-# rises and sets earlier compared to other regions.  Chief of
-# Forecasting Riaan van Zyl explained that the far eastern parts of
-# the country are close to 40 minutes earlier in sunrise than the rest
-# of the country.
-# 
-# From Paul Eggert (2007-03-31):
-# Apparently the Caprivi Strip informally observes Botswana time, but
-# we have no details.  In the meantime people there can use Africa/Gaborone.
-
-# RULE	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Namibia	1994	max	-	Sep	Sun>=1	2:00	1:00	S
-Rule	Namibia	1995	max	-	Apr	Sun>=1	2:00	0	-
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Africa/Windhoek	1:08:24 -	LMT	1892 Feb 8
-			1:30	-	SWAT	1903 Mar	# SW Africa Time
-			2:00	-	SAST	1942 Sep 20 2:00
-			2:00	1:00	SAST	1943 Mar 21 2:00
-			2:00	-	SAST	1990 Mar 21 # independence
-			2:00	-	CAT	1994 Apr  3
-			1:00	Namibia	WA%sT
-
-# Niger
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Africa/Niamey	 0:08:28 -	LMT	1912
-			-1:00	-	WAT	1934 Feb 26
-			 0:00	-	GMT	1960
-			 1:00	-	WAT
-
-# Nigeria
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Africa/Lagos	0:13:36 -	LMT	1919 Sep
-			1:00	-	WAT
-
-# Reunion
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Indian/Reunion	3:41:52 -	LMT	1911 Jun	# Saint-Denis
-			4:00	-	RET	# Reunion Time
-#
-# Scattered Islands (Iles Eparses) administered from Reunion are as follows.
-# The following information about them is taken from
-# Iles Eparses (www.outre-mer.gouv.fr/domtom/ile.htm, 1997-07-22, in French;
-# no longer available as of 1999-08-17).
-# We have no info about their time zone histories.
-#
-# Bassas da India - uninhabited
-# Europa Island - inhabited from 1905 to 1910 by two families
-# Glorioso Is - inhabited until at least 1958
-# Juan de Nova - uninhabited
-# Tromelin - inhabited until at least 1958
-
-# Rwanda
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Africa/Kigali	2:00:16 -	LMT	1935 Jun
-			2:00	-	CAT
-
-# St Helena
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone Atlantic/St_Helena	-0:22:48 -	LMT	1890		# Jamestown
-			-0:22:48 -	JMT	1951	# Jamestown Mean Time
-			 0:00	-	GMT
-# The other parts of the St Helena territory are similar:
-#	Tristan da Cunha: on GMT, say Whitman and the CIA
-#	Ascension: on GMT, says usno1995 and the CIA
-#	Gough (scientific station since 1955; sealers wintered previously):
-#		on GMT, says the CIA
-#	Inaccessible, Nightingale: no information, but probably GMT
-
-# Sao Tome and Principe
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Africa/Sao_Tome	 0:26:56 -	LMT	1884
-			-0:36:32 -	LMT	1912	# Lisbon Mean Time
-			 0:00	-	GMT
-
-# Senegal
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Africa/Dakar	-1:09:44 -	LMT	1912
-			-1:00	-	WAT	1941 Jun
-			 0:00	-	GMT
-
-# Seychelles
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Indian/Mahe	3:41:48 -	LMT	1906 Jun	# Victoria
-			4:00	-	SCT	# Seychelles Time
-# From Paul Eggert (2001-05-30):
-# Aldabra, Farquhar, and Desroches, originally dependencies of the
-# Seychelles, were transferred to the British Indian Ocean Territory
-# in 1965 and returned to Seychelles control in 1976.  We don't know
-# whether this affected their time zone, so omit this for now.
-# Possibly the islands were uninhabited.
-
-# Sierra Leone
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-# Whitman gives Mar 31 - Aug 31 for 1931 on; go with Shanks & Pottenger.
-Rule	SL	1935	1942	-	Jun	 1	0:00	0:40	SLST
-Rule	SL	1935	1942	-	Oct	 1	0:00	0	WAT
-Rule	SL	1957	1962	-	Jun	 1	0:00	1:00	SLST
-Rule	SL	1957	1962	-	Sep	 1	0:00	0	GMT
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Africa/Freetown	-0:53:00 -	LMT	1882
-			-0:53:00 -	FMT	1913 Jun # Freetown Mean Time
-			-1:00	SL	%s	1957
-			 0:00	SL	%s
-
-# Somalia
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone Africa/Mogadishu	3:01:28 -	LMT	1893 Nov
-			3:00	-	EAT	1931
-			2:30	-	BEAT	1957
-			3:00	-	EAT
-
-# South Africa
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	SA	1942	1943	-	Sep	Sun>=15	2:00	1:00	-
-Rule	SA	1943	1944	-	Mar	Sun>=15	2:00	0	-
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone Africa/Johannesburg 1:52:00 -	LMT	1892 Feb 8
-			1:30	-	SAST	1903 Mar
-			2:00	SA	SAST
-# Marion and Prince Edward Is
-# scientific station since 1947
-# no information
-
-# Sudan
-#
-# From <a href="http://www.sunanews.net/sn13jane.html">
-# Sudan News Agency (2000-01-13)
-# </a>, also reported by Michael De Beukelaer-Dossche via Steffen Thorsen:
-# Clocks will be moved ahead for 60 minutes all over the Sudan as of noon
-# Saturday....  This was announced Thursday by Caretaker State Minister for
-# Manpower Abdul-Rahman Nur-Eddin.
-#
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Sudan	1970	only	-	May	 1	0:00	1:00	S
-Rule	Sudan	1970	1985	-	Oct	15	0:00	0	-
-Rule	Sudan	1971	only	-	Apr	30	0:00	1:00	S
-Rule	Sudan	1972	1985	-	Apr	lastSun	0:00	1:00	S
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Africa/Khartoum	2:10:08 -	LMT	1931
-			2:00	Sudan	CA%sT	2000 Jan 15 12:00
-			3:00	-	EAT
-
-# Swaziland
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Africa/Mbabane	2:04:24 -	LMT	1903 Mar
-			2:00	-	SAST
-
-# Tanzania
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone Africa/Dar_es_Salaam 2:37:08 -	LMT	1931
-			3:00	-	EAT	1948
-			2:44:45	-	BEAUT	1961
-			3:00	-	EAT
-
-# Togo
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Africa/Lome	0:04:52 -	LMT	1893
-			0:00	-	GMT
-
-# Tunisia
-
-# From Gwillim Law (2005-04-30):
-# My correspondent, Risto Nykanen, has alerted me to another adoption of DST,
-# this time in Tunisia.  According to Yahoo France News
-# <http://fr.news.yahoo.com/050426/5/4dumk.html>, in a story attributed to AP
-# and dated 2005-04-26, "Tunisia has decided to advance its official time by
-# one hour, starting on Sunday, May 1.  Henceforth, Tunisian time will be
-# UTC+2 instead of UTC+1.  The change will take place at 23:00 UTC next
-# Saturday."  (My translation)
-#
-# From Oscar van Vlijmen (2005-05-02):
-# LaPresse, the first national daily newspaper ...
-# <http://www.lapresse.tn/archives/archives280405/actualites/lheure.html>
-# ... DST for 2005: on: Sun May 1 0h standard time, off: Fri Sept. 30,
-# 1h standard time.
-#
-# From Atef Loukil (2006-03-28):
-# The daylight saving time will be the same each year:
-# Beginning      : the last Sunday of March at 02:00
-# Ending         : the last Sunday of October at 03:00 ...
-# http://www.tap.info.tn/en/index.php?option=com_content&task=view&id=1188&Itemid=50
-
-# From Steffen Thorsen (2009-03-16):
-# According to several news sources, Tunisia will not observe DST this year.
-# (Arabic)
-# <a href="http://www.elbashayer.com/?page=viewn&nid=42546">
-# http://www.elbashayer.com/?page=viewn&nid=42546
-# </a>
-# <a href="http://www.babnet.net/kiwidetail-15295.asp">
-# http://www.babnet.net/kiwidetail-15295.asp
-# </a>
-#
-# We have also confirmed this with the US embassy in Tunisia.
-# We have a wrap-up about this on the following page:
-# <a href="http://www.timeanddate.com/news/time/tunisia-cancels-dst-2009.html">
-# http://www.timeanddate.com/news/time/tunisia-cancels-dst-2009.html
-# </a>
-
-# From Alexander Krivenyshev (2009-03-17):
-# Here is a link to Tunis Afrique Presse News Agency
-#
-# Standard time to be kept the whole year long (tap.info.tn):
-#
-# (in English)
-# <a href="http://www.tap.info.tn/en/index.php?option=com_content&task=view&id=26813&Itemid=157">
-# http://www.tap.info.tn/en/index.php?option=com_content&task=view&id=26813&Itemid=157
-# </a>
-#
-# (in Arabic)
-# <a href="http://www.tap.info.tn/ar/index.php?option=com_content&task=view&id=61240&Itemid=1">
-# http://www.tap.info.tn/ar/index.php?option=com_content&task=view&id=61240&Itemid=1
-# </a>
-
-# From Arthur David Olson (2009--3-18):
-# The Tunis Afrique Presse News Agency notice contains this: "This measure is due to the fact
-# that the fasting month of ramadan coincides with the period concerned by summer time.
-# Therefore, the standard time will be kept unchanged the whole year long."
-# So foregoing DST seems to be an exception (albeit one that may be repeated in the  future).
-
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Tunisia	1939	only	-	Apr	15	23:00s	1:00	S
-Rule	Tunisia	1939	only	-	Nov	18	23:00s	0	-
-Rule	Tunisia	1940	only	-	Feb	25	23:00s	1:00	S
-Rule	Tunisia	1941	only	-	Oct	 6	 0:00	0	-
-Rule	Tunisia	1942	only	-	Mar	 9	 0:00	1:00	S
-Rule	Tunisia	1942	only	-	Nov	 2	 3:00	0	-
-Rule	Tunisia	1943	only	-	Mar	29	 2:00	1:00	S
-Rule	Tunisia	1943	only	-	Apr	17	 2:00	0	-
-Rule	Tunisia	1943	only	-	Apr	25	 2:00	1:00	S
-Rule	Tunisia	1943	only	-	Oct	 4	 2:00	0	-
-Rule	Tunisia	1944	1945	-	Apr	Mon>=1	 2:00	1:00	S
-Rule	Tunisia	1944	only	-	Oct	 8	 0:00	0	-
-Rule	Tunisia	1945	only	-	Sep	16	 0:00	0	-
-Rule	Tunisia	1977	only	-	Apr	30	 0:00s	1:00	S
-Rule	Tunisia	1977	only	-	Sep	24	 0:00s	0	-
-Rule	Tunisia	1978	only	-	May	 1	 0:00s	1:00	S
-Rule	Tunisia	1978	only	-	Oct	 1	 0:00s	0	-
-Rule	Tunisia	1988	only	-	Jun	 1	 0:00s	1:00	S
-Rule	Tunisia	1988	1990	-	Sep	lastSun	 0:00s	0	-
-Rule	Tunisia	1989	only	-	Mar	26	 0:00s	1:00	S
-Rule	Tunisia	1990	only	-	May	 1	 0:00s	1:00	S
-Rule	Tunisia	2005	only	-	May	 1	 0:00s	1:00	S
-Rule	Tunisia	2005	only	-	Sep	30	 1:00s	0	-
-Rule	Tunisia	2006	2008	-	Mar	lastSun	 2:00s	1:00	S
-Rule	Tunisia	2006	2008	-	Oct	lastSun	 2:00s	0	-
-Rule	Tunisia	2010	max	-	Mar	lastSun	 2:00s	1:00	S
-Rule	Tunisia	2010	max	-	Oct	lastSun	 2:00s	0	-
-# Shanks & Pottenger give 0:09:20 for Paris Mean Time; go with Howse's
-# more precise 0:09:21.
-# Shanks & Pottenger say the 1911 switch was on Mar 9; go with Howse's Mar 11.
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Africa/Tunis	0:40:44 -	LMT	1881 May 12
-			0:09:21	-	PMT	1911 Mar 11    # Paris Mean Time
-			1:00	Tunisia	CE%sT
-
-# Uganda
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Africa/Kampala	2:09:40 -	LMT	1928 Jul
-			3:00	-	EAT	1930
-			2:30	-	BEAT	1948
-			2:44:45	-	BEAUT	1957
-			3:00	-	EAT
-
-# Zambia
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Africa/Lusaka	1:53:08 -	LMT	1903 Mar
-			2:00	-	CAT
-
-# Zimbabwe
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Africa/Harare	2:04:12 -	LMT	1903 Mar
-			2:00	-	CAT
diff --git a/tools/zoneinfo/tzdata2009s/antarctica b/tools/zoneinfo/tzdata2009s/antarctica
deleted file mode 100644
index f18ae95..0000000
--- a/tools/zoneinfo/tzdata2009s/antarctica
+++ /dev/null
@@ -1,352 +0,0 @@
-# <pre>
-# @(#)antarctica	8.7
-# This file is in the public domain, so clarified as of
-# 2009-05-17 by Arthur David Olson.
-
-# From Paul Eggert (1999-11-15):
-# To keep things manageable, we list only locations occupied year-round; see
-# <a href="http://www.comnap.aq/comnap/comnap.nsf/P/Stations/">
-# COMNAP - Stations and Bases
-# </a>
-# and
-# <a href="http://www.spri.cam.ac.uk/bob/periant.htm">
-# Summary of the Peri-Antarctic Islands (1998-07-23)
-# </a>
-# for information.
-# Unless otherwise specified, we have no time zone information.
-#
-# Except for the French entries,
-# I made up all time zone abbreviations mentioned here; corrections welcome!
-# FORMAT is `zzz' and GMTOFF is 0 for locations while uninhabited.
-
-# These rules are stolen from the `europe' file.
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	RussAQ	1981	1984	-	Apr	 1	 0:00	1:00	S
-Rule	RussAQ	1981	1983	-	Oct	 1	 0:00	0	-
-Rule	RussAQ	1984	1991	-	Sep	lastSun	 2:00s	0	-
-Rule	RussAQ	1985	1991	-	Mar	lastSun	 2:00s	1:00	S
-Rule	RussAQ	1992	only	-	Mar	lastSat	 23:00	1:00	S
-Rule	RussAQ	1992	only	-	Sep	lastSat	 23:00	0	-
-Rule	RussAQ	1993	max	-	Mar	lastSun	 2:00s	1:00	S
-Rule	RussAQ	1993	1995	-	Sep	lastSun	 2:00s	0	-
-Rule	RussAQ	1996	max	-	Oct	lastSun	 2:00s	0	-
-
-# These rules are stolen from the `southamerica' file.
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	ArgAQ	1964	1966	-	Mar	 1	0:00	0	-
-Rule	ArgAQ	1964	1966	-	Oct	15	0:00	1:00	S
-Rule	ArgAQ	1967	only	-	Apr	 2	0:00	0	-
-Rule	ArgAQ	1967	1968	-	Oct	Sun>=1	0:00	1:00	S
-Rule	ArgAQ	1968	1969	-	Apr	Sun>=1	0:00	0	-
-Rule	ArgAQ	1974	only	-	Jan	23	0:00	1:00	S
-Rule	ArgAQ	1974	only	-	May	 1	0:00	0	-
-Rule	ChileAQ	1972	1986	-	Mar	Sun>=9	3:00u	0	-
-Rule	ChileAQ	1974	1987	-	Oct	Sun>=9	4:00u	1:00	S
-Rule	ChileAQ	1987	only	-	Apr	12	3:00u	0	-
-Rule	ChileAQ	1988	1989	-	Mar	Sun>=9	3:00u	0	-
-Rule	ChileAQ	1988	only	-	Oct	Sun>=1	4:00u	1:00	S
-Rule	ChileAQ	1989	only	-	Oct	Sun>=9	4:00u	1:00	S
-Rule	ChileAQ	1990	only	-	Mar	18	3:00u	0	-
-Rule	ChileAQ	1990	only	-	Sep	16	4:00u	1:00	S
-Rule	ChileAQ	1991	1996	-	Mar	Sun>=9	3:00u	0	-
-Rule	ChileAQ	1991	1997	-	Oct	Sun>=9	4:00u	1:00	S
-Rule	ChileAQ	1997	only	-	Mar	30	3:00u	0	-
-Rule	ChileAQ	1998	only	-	Mar	Sun>=9	3:00u	0	-
-Rule	ChileAQ	1998	only	-	Sep	27	4:00u	1:00	S
-Rule	ChileAQ	1999	only	-	Apr	 4	3:00u	0	-
-Rule	ChileAQ	1999	max	-	Oct	Sun>=9	4:00u	1:00	S
-Rule	ChileAQ	2000	max	-	Mar	Sun>=9	3:00u	0	-
-
-
-# Argentina - year-round bases
-# Belgrano II, Confin Coast, -770227-0343737, since 1972-02-05
-# Esperanza, San Martin Land, -6323-05659, since 1952-12-17
-# Jubany, Potter Peninsula, King George Island, -6414-0602320, since 1982-01
-# Marambio, Seymour I, -6414-05637, since 1969-10-29
-# Orcadas, Laurie I, -6016-04444, since 1904-02-22
-# San Martin, Debenham I, -6807-06708, since 1951-03-21
-#	(except 1960-03 / 1976-03-21)
-
-# Australia - territories
-# Heard Island, McDonald Islands (uninhabited)
-#	previously sealers and scientific personnel wintered
-#	<a href="http://web.archive.org/web/20021204222245/http://www.dstc.qut.edu.au/DST/marg/daylight.html">
-#	Margaret Turner reports
-#	</a> (1999-09-30) that they're UTC+5, with no DST;
-#	presumably this is when they have visitors.
-#
-# year-round bases
-# Casey, Bailey Peninsula, -6617+11032, since 1969
-# Davis, Vestfold Hills, -6835+07759, since 1957-01-13
-#	(except 1964-11 - 1969-02)
-# Mawson, Holme Bay, -6736+06253, since 1954-02-13
-
-# From Steffen Thorsen (2009-03-11):
-# Three Australian stations in Antarctica have changed their time zone:
-# Casey moved from UTC+8 to UTC+11
-# Davis moved from UTC+7 to UTC+5
-# Mawson moved from UTC+6 to UTC+5
-# The changes occurred on 2009-10-18 at 02:00 (local times).
-#
-# Government source: (Australian Antarctic Division)
-# <a href="http://www.aad.gov.au/default.asp?casid=37079">
-# http://www.aad.gov.au/default.asp?casid=37079
-# </a>
-#
-# We have more background information here:
-# <a href="http://www.timeanddate.com/news/time/antarctica-new-times.html">
-# http://www.timeanddate.com/news/time/antarctica-new-times.html
-# </a>
-
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone Antarctica/Casey	0	-	zzz	1969
-			8:00	-	WST	2009 Oct 18 2:00
-						# Western (Aus) Standard Time
-			11:00	-	CAST	# Casey Time
-Zone Antarctica/Davis	0	-	zzz	1957 Jan 13
-			7:00	-	DAVT	1964 Nov # Davis Time
-			0	-	zzz	1969 Feb
-			7:00	-	DAVT	2009 Oct 18 2:00
-			5:00	-	DAVT
-Zone Antarctica/Mawson	0	-	zzz	1954 Feb 13
-			6:00	-	MAWT	2009 Oct 18 2:00
-						# Mawson Time
-			5:00	-	MAWT
-# References:
-# <a href="http://www.antdiv.gov.au/aad/exop/sfo/casey/casey_aws.html">
-# Casey Weather (1998-02-26)
-# </a>
-# <a href="http://www.antdiv.gov.au/aad/exop/sfo/davis/video.html">
-# Davis Station, Antarctica (1998-02-26)
-# </a>
-# <a href="http://www.antdiv.gov.au/aad/exop/sfo/mawson/video.html">
-# Mawson Station, Antarctica (1998-02-25)
-# </a>
-
-# Brazil - year-round base
-# Comandante Ferraz, King George Island, -6205+05824, since 1983/4
-
-# Chile - year-round bases and towns
-# Escudero, South Shetland Is, -621157-0585735, since 1994
-# Presidente Eduadro Frei, King George Island, -6214-05848, since 1969-03-07
-# General Bernardo O'Higgins, Antarctic Peninsula, -6319-05704, since 1948-02
-# Capitan Arturo Prat, -6230-05941
-# Villa Las Estrellas (a town), around the Frei base, since 1984-04-09
-# These locations have always used Santiago time; use TZ='America/Santiago'.
-
-# China - year-round bases
-# Great Wall, King George Island, -6213-05858, since 1985-02-20
-# Zhongshan, Larsemann Hills, Prydz Bay, -6922+07623, since 1989-02-26
-
-# France - year-round bases
-#
-# From Antoine Leca (1997-01-20):
-# Time data are from Nicole Pailleau at the IFRTP
-# (French Institute for Polar Research and Technology).
-# She confirms that French Southern Territories and Terre Adelie bases
-# don't observe daylight saving time, even if Terre Adelie supplies came
-# from Tasmania.
-#
-# French Southern Territories with year-round inhabitants
-#
-# Martin-de-Vivies Base, Amsterdam Island, -374105+0773155, since 1950
-# Alfred-Faure Base, Crozet Islands, -462551+0515152, since 1964
-# Port-aux-Francais, Kerguelen Islands, -492110+0701303, since 1951;
-#	whaling & sealing station operated 1908/1914, 1920/1929, and 1951/1956
-#
-# St Paul Island - near Amsterdam, uninhabited
-#	fishing stations operated variously 1819/1931
-#
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone Indian/Kerguelen	0	-	zzz	1950	# Port-aux-Francais
-			5:00	-	TFT	# ISO code TF Time
-#
-# year-round base in the main continent
-# Dumont-d'Urville, Ile des Petrels, -6640+14001, since 1956-11
-#
-# Another base at Port-Martin, 50km east, began operation in 1947.
-# It was destroyed by fire on 1952-01-14.
-#
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone Antarctica/DumontDUrville 0 -	zzz	1947
-			10:00	-	PMT	1952 Jan 14 # Port-Martin Time
-			0	-	zzz	1956 Nov
-			10:00	-	DDUT	# Dumont-d'Urville Time
-# Reference:
-# <a href="http://en.wikipedia.org/wiki/Dumont_d'Urville_Station">
-# Dumont d'Urville Station (2005-12-05)
-# </a>
-
-# Germany - year-round base
-# Georg von Neumayer, -7039-00815
-
-# India - year-round base
-# Dakshin Gangotri, -7005+01200
-
-# Japan - year-round bases
-# Dome Fuji, -7719+03942
-# Syowa, -690022+0393524
-#
-# From Hideyuki Suzuki (1999-02-06):
-# In all Japanese stations, +0300 is used as the standard time.
-#
-# Syowa station, which is the first antarctic station of Japan,
-# was established on 1957-01-29.  Since Syowa station is still the main
-# station of Japan, it's appropriate for the principal location.
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone Antarctica/Syowa	0	-	zzz	1957 Jan 29
-			3:00	-	SYOT	# Syowa Time
-# See:
-# <a href="http://www.nipr.ac.jp/english/ara01.html">
-# NIPR Antarctic Research Activities (1999-08-17)
-# </a>
-
-# S Korea - year-round base
-# King Sejong, King George Island, -6213-05847, since 1988
-
-# New Zealand - claims
-# Balleny Islands (never inhabited)
-# Scott Island (never inhabited)
-#
-# year-round base
-# Scott, Ross Island, since 1957-01, is like Antarctica/McMurdo.
-#
-# These rules for New Zealand are stolen from the `australasia' file.
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	NZAQ	1974	only	-	Nov	 3	2:00s	1:00	D
-Rule	NZAQ	1975	1988	-	Oct	lastSun	2:00s	1:00	D
-Rule	NZAQ	1989	only	-	Oct	 8	2:00s	1:00	D
-Rule	NZAQ	1990	2006	-	Oct	Sun>=1	2:00s	1:00	D
-Rule	NZAQ	1975	only	-	Feb	23	2:00s	0	S
-Rule	NZAQ	1976	1989	-	Mar	Sun>=1	2:00s	0	S
-Rule	NZAQ	1990	2007	-	Mar	Sun>=15	2:00s	0	S
-Rule	NZAQ	2007	max	-	Sep	lastSun	2:00s	1:00	D
-Rule	NZAQ	2008	max	-	Apr	Sun>=1	2:00s	0	S
-
-# Norway - territories
-# Bouvet (never inhabited)
-#
-# claims
-# Peter I Island (never inhabited)
-
-# Poland - year-round base
-# Arctowski, King George Island, -620945-0582745, since 1977
-
-# Russia - year-round bases
-# Bellingshausen, King George Island, -621159-0585337, since 1968-02-22
-# Mirny, Davis coast, -6633+09301, since 1956-02
-# Molodezhnaya, Alasheyev Bay, -6740+04551,
-#	year-round from 1962-02 to 1999-07-01
-# Novolazarevskaya, Queen Maud Land, -7046+01150,
-#	year-round from 1960/61 to 1992
-
-# Vostok, since 1957-12-16, temporarily closed 1994-02/1994-11
-# <a href="http://quest.arc.nasa.gov/antarctica/QA/computers/Directions,Time,ZIP">
-# From Craig Mundell (1994-12-15)</a>:
-# Vostok, which is one of the Russian stations, is set on the same
-# time as Moscow, Russia.
-#
-# From Lee Hotz (2001-03-08):
-# I queried the folks at Columbia who spent the summer at Vostok and this is
-# what they had to say about time there:
-# ``in the US Camp (East Camp) we have been on New Zealand (McMurdo)
-# time, which is 12 hours ahead of GMT. The Russian Station Vostok was
-# 6 hours behind that (although only 2 miles away, i.e. 6 hours ahead
-# of GMT). This is a time zone I think two hours east of Moscow. The
-# natural time zone is in between the two: 8 hours ahead of GMT.''
-#
-# From Paul Eggert (2001-05-04):
-# This seems to be hopelessly confusing, so I asked Lee Hotz about it
-# in person.  He said that some Antartic locations set their local
-# time so that noon is the warmest part of the day, and that this
-# changes during the year and does not necessarily correspond to mean
-# solar noon.  So the Vostok time might have been whatever the clocks
-# happened to be during their visit.  So we still don't really know what time
-# it is at Vostok.  But we'll guess UTC+6.
-#
-Zone Antarctica/Vostok	0	-	zzz	1957 Dec 16
-			6:00	-	VOST	# Vostok time
-
-# S Africa - year-round bases
-# Marion Island, -4653+03752
-# Sanae, -7141-00250
-
-# UK
-#
-# British Antarctic Territories (BAT) claims
-# South Orkney Islands
-#	scientific station from 1903
-#	whaling station at Signy I 1920/1926
-# South Shetland Islands
-#
-# year-round bases
-# Bird Island, South Georgia, -5400-03803, since 1983
-# Deception Island, -6259-06034, whaling station 1912/1931,
-#	scientific station 1943/1967,
-#	previously sealers and a scientific expedition wintered by accident,
-#	and a garrison was deployed briefly
-# Halley, Coates Land, -7535-02604, since 1956-01-06
-#	Halley is on a moving ice shelf and is periodically relocated
-#	so that it is never more than 10km from its nominal location.
-# Rothera, Adelaide Island, -6734-6808, since 1976-12-01
-#
-# From Paul Eggert (2002-10-22)
-# <http://webexhibits.org/daylightsaving/g.html> says Rothera is -03 all year.
-#
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone Antarctica/Rothera	0	-	zzz	1976 Dec  1
-			-3:00	-	ROTT	# Rothera time
-
-# Uruguay - year round base
-# Artigas, King George Island, -621104-0585107
-
-# USA - year-round bases
-#
-# Palmer, Anvers Island, since 1965 (moved 2 miles in 1968)
-#
-# From Ethan Dicks (1996-10-06):
-# It keeps the same time as Punta Arenas, Chile, because, just like us
-# and the South Pole, that's the other end of their supply line....
-# I verified with someone who was there that since 1980,
-# Palmer has followed Chile.  Prior to that, before the Falklands War,
-# Palmer used to be supplied from Argentina.
-#
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone Antarctica/Palmer	0	-	zzz	1965
-			-4:00	ArgAQ	AR%sT	1969 Oct 5
-			-3:00	ArgAQ	AR%sT	1982 May
-			-4:00	ChileAQ	CL%sT
-#
-#
-# McMurdo, Ross Island, since 1955-12
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone Antarctica/McMurdo	0	-	zzz	1956
-			12:00	NZAQ	NZ%sT
-#
-# Amundsen-Scott, South Pole, continuously occupied since 1956-11-20
-#
-# From Paul Eggert (1996-09-03):
-# Normally it wouldn't have a separate entry, since it's like the
-# larger Antarctica/McMurdo since 1970, but it's too famous to omit.
-#
-# From Chris Carrier (1996-06-27):
-# Siple, the first commander of the South Pole station,
-# stated that he would have liked to have kept GMT at the station,
-# but that he found it more convenient to keep GMT+12
-# as supplies for the station were coming from McMurdo Sound,
-# which was on GMT+12 because New Zealand was on GMT+12 all year
-# at that time (1957).  (Source: Siple's book 90 degrees SOUTH.)
-#
-# From Susan Smith
-# http://www.cybertours.com/whs/pole10.html
-# (1995-11-13 16:24:56 +1300, no longer available):
-# We use the same time as McMurdo does.
-# And they use the same time as Christchurch, NZ does....
-# One last quirk about South Pole time.
-# All the electric clocks are usually wrong.
-# Something about the generators running at 60.1hertz or something
-# makes all of the clocks run fast.  So every couple of days,
-# we have to go around and set them back 5 minutes or so.
-# Maybe if we let them run fast all of the time, we'd get to leave here sooner!!
-#
-Link	Antarctica/McMurdo	Antarctica/South_Pole
diff --git a/tools/zoneinfo/tzdata2009s/asia b/tools/zoneinfo/tzdata2009s/asia
deleted file mode 100644
index 1987fc8..0000000
--- a/tools/zoneinfo/tzdata2009s/asia
+++ /dev/null
@@ -1,2396 +0,0 @@
-# @(#)asia	8.44
-# This file is in the public domain, so clarified as of
-# 2009-05-17 by Arthur David Olson.
-
-# This data is by no means authoritative; if you think you know better,
-# go ahead and edit the file (and please send any changes to
-# tz@elsie.nci.nih.gov for general use in the future).
-
-# From Paul Eggert (2006-03-22):
-#
-# A good source for time zone historical data outside the U.S. is
-# Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
-# San Diego: ACS Publications, Inc. (2003).
-#
-# Gwillim Law writes that a good source
-# for recent time zone data is the International Air Transport
-# Association's Standard Schedules Information Manual (IATA SSIM),
-# published semiannually.  Law sent in several helpful summaries
-# of the IATA's data after 1990.
-#
-# Except where otherwise noted, Shanks & Pottenger is the source for
-# entries through 1990, and IATA SSIM is the source for entries afterwards.
-#
-# Another source occasionally used is Edward W. Whitman, World Time Differences,
-# Whitman Publishing Co, 2 Niagara Av, Ealing, London (undated), which
-# I found in the UCLA library.
-#
-# A reliable and entertaining source about time zones is
-# Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997).
-#
-# I invented the abbreviations marked `*' in the following table;
-# the rest are from earlier versions of this file, or from other sources.
-# Corrections are welcome!
-#	     std  dst
-#	     LMT	Local Mean Time
-#	2:00 EET  EEST	Eastern European Time
-#	2:00 IST  IDT	Israel
-#	3:00 AST  ADT	Arabia*
-#	3:30 IRST IRDT	Iran
-#	4:00 GST	Gulf*
-#	5:30 IST	India
-#	7:00 ICT	Indochina*
-#	7:00 WIT	west Indonesia
-#	8:00 CIT	central Indonesia
-#	8:00 CST	China
-#	9:00 CJT	Central Japanese Time (1896/1937)*
-#	9:00 EIT	east Indonesia
-#	9:00 JST  JDT	Japan
-#	9:00 KST  KDT	Korea
-#	9:30 CST	(Australian) Central Standard Time
-#
-# See the `europe' file for Russia and Turkey in Asia.
-
-# From Guy Harris:
-# Incorporates data for Singapore from Robert Elz' asia 1.1, as well as
-# additional information from Tom Yap, Sun Microsystems Intercontinental
-# Technical Support (including a page from the Official Airline Guide -
-# Worldwide Edition).  The names for time zones are guesses.
-
-###############################################################################
-
-# These rules are stolen from the `europe' file.
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	EUAsia	1981	max	-	Mar	lastSun	 1:00u	1:00	S
-Rule	EUAsia	1979	1995	-	Sep	lastSun	 1:00u	0	-
-Rule	EUAsia	1996	max	-	Oct	lastSun	 1:00u	0	-
-Rule E-EurAsia	1981	max	-	Mar	lastSun	 0:00	1:00	S
-Rule E-EurAsia	1979	1995	-	Sep	lastSun	 0:00	0	-
-Rule E-EurAsia	1996	max	-	Oct	lastSun	 0:00	0	-
-Rule RussiaAsia	1981	1984	-	Apr	1	 0:00	1:00	S
-Rule RussiaAsia	1981	1983	-	Oct	1	 0:00	0	-
-Rule RussiaAsia	1984	1991	-	Sep	lastSun	 2:00s	0	-
-Rule RussiaAsia	1985	1991	-	Mar	lastSun	 2:00s	1:00	S
-Rule RussiaAsia	1992	only	-	Mar	lastSat	23:00	1:00	S
-Rule RussiaAsia	1992	only	-	Sep	lastSat	23:00	0	-
-Rule RussiaAsia	1993	max	-	Mar	lastSun	 2:00s	1:00	S
-Rule RussiaAsia	1993	1995	-	Sep	lastSun	 2:00s	0	-
-Rule RussiaAsia	1996	max	-	Oct	lastSun	 2:00s	0	-
-
-# Afghanistan
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Asia/Kabul	4:36:48 -	LMT	1890
-			4:00	-	AFT	1945
-			4:30	-	AFT
-
-# Armenia
-# From Paul Eggert (2006-03-22):
-# Shanks & Pottenger have Yerevan switching to 3:00 (with Russian DST)
-# in spring 1991, then to 4:00 with no DST in fall 1995, then
-# readopting Russian DST in 1997.  Go with Shanks & Pottenger, even
-# when they disagree with others.  Edgar Der-Danieliantz
-# reported (1996-05-04) that Yerevan probably wouldn't use DST
-# in 1996, though it did use DST in 1995.  IATA SSIM (1991/1998) reports that
-# Armenia switched from 3:00 to 4:00 in 1998 and observed DST after 1991,
-# but started switching at 3:00s in 1998.
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Asia/Yerevan	2:58:00 -	LMT	1924 May  2
-			3:00	-	YERT	1957 Mar    # Yerevan Time
-			4:00 RussiaAsia YER%sT	1991 Mar 31 2:00s
-			3:00	1:00	YERST	1991 Sep 23 # independence
-			3:00 RussiaAsia	AM%sT	1995 Sep 24 2:00s
-			4:00	-	AMT	1997
-			4:00 RussiaAsia	AM%sT
-
-# Azerbaijan
-# From Rustam Aliyev of the Azerbaijan Internet Forum (2005-10-23):
-# According to the resolution of Cabinet of Ministers, 1997
-# Resolution available at: http://aif.az/docs/daylight_res.pdf
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Azer	1997	max	-	Mar	lastSun	 4:00	1:00	S
-Rule	Azer	1997	max	-	Oct	lastSun	 5:00	0	-
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Asia/Baku	3:19:24 -	LMT	1924 May  2
-			3:00	-	BAKT	1957 Mar    # Baku Time
-			4:00 RussiaAsia BAK%sT	1991 Mar 31 2:00s
-			3:00	1:00	BAKST	1991 Aug 30 # independence
-			3:00 RussiaAsia	AZ%sT	1992 Sep lastSat 23:00
-			4:00	-	AZT	1996 # Azerbaijan time
-			4:00	EUAsia	AZ%sT	1997
-			4:00	Azer	AZ%sT
-
-# Bahrain
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Asia/Bahrain	3:22:20 -	LMT	1920		# Al Manamah
-			4:00	-	GST	1972 Jun
-			3:00	-	AST
-
-# Bangladesh
-# From Alexander Krivenyshev (2009-05-13):
-# According to newspaper Asian Tribune (May 6, 2009) Bangladesh may introduce
-# Daylight Saving Time from June 16 to Sept 30
-#
-# Bangladesh to introduce daylight saving time likely from June 16
-# <a href="http://www.asiantribune.com/?q=node/17288">
-# http://www.asiantribune.com/?q=node/17288
-# </a>
-# or
-# <a href="http://www.worldtimezone.com/dst_news/dst_news_bangladesh02.html">
-# http://www.worldtimezone.com/dst_news/dst_news_bangladesh02.html
-# </a>
-#
-# "... Bangladesh government has decided to switch daylight saving time from
-# June
-# 16 till September 30 in a bid to ensure maximum use of daylight to cope with
-# crippling power crisis. "
-#
-# The switch will remain in effect from June 16 to Sept 30 (2009) but if
-# implemented the next year, it will come in force from April 1, 2010
-
-# From Steffen Thorsen (2009-06-02):
-# They have finally decided now, but changed the start date to midnight between
-# the 19th and 20th, and they have not set the end date yet.
-#
-# Some sources:
-# <a href="http://in.reuters.com/article/southAsiaNews/idINIndia-40017620090601">
-# http://in.reuters.com/article/southAsiaNews/idINIndia-40017620090601
-# </a>
-# <a href="http://bdnews24.com/details.php?id=85889&cid=2">
-# http://bdnews24.com/details.php?id=85889&cid=2
-# </a>
-#
-# Our wrap-up:
-# <a href="http://www.timeanddate.com/news/time/bangladesh-daylight-saving-2009.html">
-# http://www.timeanddate.com/news/time/bangladesh-daylight-saving-2009.html
-# </a>
-
-# From A. N. M. Kamrus Saadat (2009-06-15):
-# Finally we've got the official mail regarding DST start time where DST start 
-# time is mentioned as Jun 19 2009, 23:00 from BTRC (Bangladesh 
-# Telecommunication Regulatory Commission). 
-#
-# No DST end date has been announced yet.
-
-# From Alexander Krivenyshev (2009-09-25):
-# Bangladesh won't go back to Standard Time from October 1, 2009, 
-# instead it will continue DST measure till the cabinet makes a fresh decision. 
-#
-# Following report by same newspaper-"The Daily Star Friday":
-# "DST change awaits cabinet decision-Clock won't go back by 1-hr from Oct 1"
-# <a href="http://www.thedailystar.net/newDesign/news-details.php?nid=107021">
-# http://www.thedailystar.net/newDesign/news-details.php?nid=107021
-# </a>
-# or
-# <a href="http://www.worldtimezone.com/dst_news/dst_news_bangladesh04.html">
-# http://www.worldtimezone.com/dst_news/dst_news_bangladesh04.html
-# </a>
-
-# From Steffen Thorsen (2009-10-13):
-# IANS (Indo-Asian News Service) now reports:
-# Bangladesh has decided that the clock advanced by an hour to make 
-# maximum use of daylight hours as an energy saving measure would 
-# "continue for an indefinite period."
-#
-# One of many places where it is published:
-# <a href="http://www.thaindian.com/newsportal/business/bangladesh-to-continue-indefinitely-with-advanced-time_100259987.html">
-# http://www.thaindian.com/newsportal/business/bangladesh-to-continue-indefinitely-with-advanced-time_100259987.html
-# </a>
-
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Asia/Dhaka	6:01:40 -	LMT	1890
-			5:53:20	-	HMT	1941 Oct    # Howrah Mean Time?
-			6:30	-	BURT	1942 May 15 # Burma Time
-			5:30	-	IST	1942 Sep
-			6:30	-	BURT	1951 Sep 30
-			6:00	-	DACT	1971 Mar 26 # Dacca Time
-			6:00	-	BDT	2009 Jun 19 23:00 # Bangladesh Time
-			6:00	1:00	BDST
-
-# Bhutan
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Asia/Thimphu	5:58:36 -	LMT	1947 Aug 15 # or Thimbu
-			5:30	-	IST	1987 Oct
-			6:00	-	BTT	# Bhutan Time
-
-# British Indian Ocean Territory
-# Whitman and the 1995 CIA time zone map say 5:00, but the
-# 1997 and later maps say 6:00.  Assume the switch occurred in 1996.
-# We have no information as to when standard time was introduced;
-# assume it occurred in 1907, the same year as Mauritius (which
-# then contained the Chagos Archipelago).
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Indian/Chagos	4:49:40	-	LMT	1907
-			5:00	-	IOT	1996 # BIOT Time
-			6:00	-	IOT
-
-# Brunei
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Asia/Brunei	7:39:40 -	LMT	1926 Mar   # Bandar Seri Begawan
-			7:30	-	BNT	1933
-			8:00	-	BNT
-
-# Burma / Myanmar
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Asia/Rangoon	6:24:40 -	LMT	1880		# or Yangon
-			6:24:36	-	RMT	1920	   # Rangoon Mean Time?
-			6:30	-	BURT	1942 May   # Burma Time
-			9:00	-	JST	1945 May 3
-			6:30	-	MMT		   # Myanmar Time
-
-# Cambodia
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Asia/Phnom_Penh	6:59:40 -	LMT	1906 Jun  9
-			7:06:20	-	SMT	1911 Mar 11 0:01 # Saigon MT?
-			7:00	-	ICT	1912 May
-			8:00	-	ICT	1931 May
-			7:00	-	ICT
-
-# China
-
-# From Guy Harris:
-# People's Republic of China.  Yes, they really have only one time zone.
-
-# From Bob Devine (1988-01-28):
-# No they don't.  See TIME mag, 1986-02-17 p.52.  Even though
-# China is across 4 physical time zones, before Feb 1, 1986 only the
-# Peking (Bejing) time zone was recognized.  Since that date, China
-# has two of 'em -- Peking's and Urumqi (named after the capital of
-# the Xinjiang Uyghur Autonomous Region).  I don't know about DST for it.
-#
-# . . .I just deleted the DST table and this editor makes it too
-# painful to suck in another copy..  So, here is what I have for
-# DST start/end dates for Peking's time zone (info from AP):
-#
-#     1986 May 4 - Sept 14
-#     1987 mid-April - ??
-
-# From U. S. Naval Observatory (1989-01-19):
-# CHINA               8 H  AHEAD OF UTC  ALL OF CHINA, INCL TAIWAN
-# CHINA               9 H  AHEAD OF UTC  APR 17 - SEP 10
-
-# From Paul Eggert (2006-03-22):
-# Shanks & Pottenger write that China (except for Hong Kong and Macau)
-# has had a single time zone since 1980 May 1, observing summer DST
-# from 1986 through 1991; this contradicts Devine's
-# note about Time magazine, though apparently _something_ happened in 1986.
-# Go with Shanks & Pottenger for now.  I made up names for the other
-# pre-1980 time zones.
-
-# From Shanks & Pottenger:
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Shang	1940	only	-	Jun	 3	0:00	1:00	D
-Rule	Shang	1940	1941	-	Oct	 1	0:00	0	S
-Rule	Shang	1941	only	-	Mar	16	0:00	1:00	D
-Rule	PRC	1986	only	-	May	 4	0:00	1:00	D
-Rule	PRC	1986	1991	-	Sep	Sun>=11	0:00	0	S
-Rule	PRC	1987	1991	-	Apr	Sun>=10	0:00	1:00	D
-
-# From Anthony Fok (2001-12-20):
-# BTW, I did some research on-line and found some info regarding these five
-# historic timezones from some Taiwan websites.  And yes, there are official
-# Chinese names for these locales (before 1949).
-#
-# From Jesper Norgaard Welen (2006-07-14):
-# I have investigated the timezones around 1970 on the
-# http://www.astro.com/atlas site [with provinces and county
-# boundaries summarized below]....  A few other exceptions were two
-# counties on the Sichuan side of the Xizang-Sichuan border,
-# counties Dege and Baiyu which lies on the Sichuan side and are
-# therefore supposed to be GMT+7, Xizang region being GMT+6, but Dege
-# county is GMT+8 according to astro.com while Baiyu county is GMT+6
-# (could be true), for the moment I am assuming that those two
-# counties are mistakes in the astro.com data.
-
-# From Paul Eggert (2008-02-11):
-# I just now checked Google News for western news sources that talk
-# about China's single time zone, and couldn't find anything before 1986
-# talking about China being in one time zone.  (That article was: Jim
-# Mann, "A clumsy embrace for another western custom: China on daylight
-# time--sort of", Los Angeles Times, 1986-05-05.  By the way, this
-# article confirms the tz database's data claiming that China began
-# observing daylight saving time in 1986.
-#
-# From Thomas S. Mullaney (2008-02-11):
-# I think you're combining two subjects that need to treated 
-# separately: daylight savings (which, you're correct, wasn't 
-# implemented until the 1980s) and the unified time zone centered near 
-# Beijing (which was implemented in 1949). Briefly, there was also a 
-# "Lhasa Time" in Tibet and "Urumqi Time" in Xinjiang. The first was 
-# ceased, and the second eventually recognized (again, in the 1980s).
-#
-# From Paul Eggert (2008-06-30):
-# There seems to be a good chance China switched to a single time zone in 1949
-# rather than in 1980 as Shanks & Pottenger have it, but we don't have a
-# reliable documentary source saying so yet, so for now we still go with
-# Shanks & Pottenger.
-
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-# Changbai Time ("Long-white Time", Long-white = Heilongjiang area)
-# Heilongjiang (except Mohe county), Jilin
-Zone	Asia/Harbin	8:26:44	-	LMT	1928 # or Haerbin
-			8:30	-	CHAT	1932 Mar # Changbai Time
-			8:00	-	CST	1940
-			9:00	-	CHAT	1966 May
-			8:30	-	CHAT	1980 May
-			8:00	PRC	C%sT
-# Zhongyuan Time ("Central plain Time")
-# most of China
-Zone	Asia/Shanghai	8:05:52	-	LMT	1928
-			8:00	Shang	C%sT	1949
-			8:00	PRC	C%sT
-# Long-shu Time (probably due to Long and Shu being two names of that area)
-# Guangxi, Guizhou, Hainan, Ningxia, Sichuan, Shaanxi, and Yunnan;
-# most of Gansu; west Inner Mongolia; west Qinghai; and the Guangdong
-# counties Deqing, Enping, Kaiping, Luoding, Taishan, Xinxing,
-# Yangchun, Yangjiang, Yu'nan, and Yunfu.
-Zone	Asia/Chongqing	7:06:20	-	LMT	1928 # or Chungking
-			7:00	-	LONT	1980 May # Long-shu Time
-			8:00	PRC	C%sT
-# Xin-zang Time ("Xinjiang-Tibet Time")
-# The Gansu counties Aksay, Anxi, Dunhuang, Subei; west Qinghai;
-# the Guangdong counties  Xuwen, Haikang, Suixi, Lianjiang,
-# Zhanjiang, Wuchuan, Huazhou, Gaozhou, Maoming, Dianbai, and Xinyi;
-# east Tibet, including Lhasa, Chamdo, Shigaise, Jimsar, Shawan and Hutubi;
-# east Xinjiang, including Urumqi, Turpan, Karamay, Korla, Minfeng, Jinghe,
-# Wusu, Qiemo, Xinyan, Wulanwusu, Jinghe, Yumin, Tacheng, Tuoli, Emin,
-# Shihezi, Changji, Yanqi, Heshuo, Tuokexun, Tulufan, Shanshan, Hami,
-# Fukang, Kuitun, Kumukuli, Miquan, Qitai, and Turfan.
-Zone	Asia/Urumqi	5:50:20	-	LMT	1928 # or Urumchi
-			6:00	-	URUT	1980 May # Urumqi Time
-			8:00	PRC	C%sT
-# Kunlun Time
-# West Tibet, including Pulan, Aheqi, Shufu, Shule;
-# West Xinjiang, including Aksu, Atushi, Yining, Hetian, Cele, Luopu, Nileke,
-# Zhaosu, Tekesi, Gongliu, Chabuchaer, Huocheng, Bole, Pishan, Suiding,
-# and Yarkand.
-Zone	Asia/Kashgar	5:03:56	-	LMT	1928 # or Kashi or Kaxgar
-			5:30	-	KAST	1940	 # Kashgar Time
-			5:00	-	KAST	1980 May
-			8:00	PRC	C%sT
-
-
-# From Lee Yiu Chung (2009-10-24):
-# I found there are some mistakes for the historial DST rule for Hong
-# Kong. Accoring to the DST record from Hong Kong Observatory (actually,
-# it is not [an] observatory, but the official meteorological agency of HK,
-# and also serves as the official timing agency), there are some missing
-# and incorrect rules. Although the exact switch over time is missing, I
-# think 3:30 is correct. The official DST record for Hong Kong can be
-# obtained from
-# <a href="http://www.hko.gov.hk/gts/time/Summertime.htm">
-# http://www.hko.gov.hk/gts/time/Summertime.htm
-# </a>.
-
-# From Arthur David Olson (2009-10-28):
-# Here are the dates given at
-# <a href="http://www.hko.gov.hk/gts/time/Summertime.htm">
-# http://www.hko.gov.hk/gts/time/Summertime.htm
-# </a>
-# as of 2009-10-28:
-# Year        Period
-# 1941        1 Apr to 30 Sep
-# 1942        Whole year 
-# 1943        Whole year
-# 1944        Whole year
-# 1945        Whole year
-# 1946        20 Apr to 1 Dec
-# 1947        13 Apr to 30 Dec
-# 1948        2 May to 31 Oct
-# 1949        3 Apr to 30 Oct
-# 1950        2 Apr to 29 Oct
-# 1951        1 Apr to 28 Oct
-# 1952        6 Apr to 25 Oct
-# 1953        5 Apr to 1 Nov
-# 1954        21 Mar to 31 Oct
-# 1955        20 Mar to 6 Nov
-# 1956        18 Mar to 4 Nov
-# 1957        24 Mar to 3 Nov
-# 1958        23 Mar to 2 Nov
-# 1959        22 Mar to 1 Nov
-# 1960        20 Mar to 6 Nov
-# 1961        19 Mar to 5 Nov
-# 1962        18 Mar to 4 Nov
-# 1963        24 Mar to 3 Nov
-# 1964        22 Mar to 1 Nov
-# 1965        18 Apr to 17 Oct
-# 1966        17 Apr to 16 Oct
-# 1967        16 Apr to 22 Oct
-# 1968        21 Apr to 20 Oct
-# 1969        20 Apr to 19 Oct
-# 1970        19 Apr to 18 Oct
-# 1971        18 Apr to 17 Oct
-# 1972        16 Apr to 22 Oct
-# 1973        22 Apr to 21 Oct
-# 1973/74     30 Dec 73 to 20 Oct 74
-# 1975        20 Apr to 19 Oct
-# 1976        18 Apr to 17 Oct
-# 1977        Nil
-# 1978        Nil
-# 1979        13 May to 21 Oct
-# 1980 to Now Nil
-# The page does not give start or end times of day.
-# The page does not give a start date for 1942.
-# The page does not givw an end date for 1945.
-# The Japanese occupation of Hong Kong began on 1941-12-25.
-# The Japanese surrender of Hong Kong was signed 1945-09-15.
-# For lack of anything better, use start of those days as the transition times.
-
-# Hong Kong (Xianggang)
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	HK	1941	only	-	Apr	1	3:30	1:00	S
-Rule	HK	1941	only	-	Sep	30	3:30	0	-
-Rule	HK	1946	only	-	Apr	20	3:30	1:00	S
-Rule	HK	1946	only	-	Dec	1	3:30	0	-
-Rule	HK	1947	only	-	Apr	13	3:30	1:00	S
-Rule	HK	1947	only	-	Dec	30	3:30	0	-
-Rule	HK	1948	only	-	May	2	3:30	1:00	S
-Rule	HK	1948	1951	-	Oct	lastSun	3:30	0	-
-Rule	HK	1952	only	-	Oct	25	3:30	0	-
-Rule	HK	1949	1953	-	Apr	Sun>=1	3:30	1:00	S
-Rule	HK	1953	only	-	Nov	1	3:30	0	-
-Rule	HK	1954	1964	-	Mar	Sun>=18	3:30	1:00	S
-Rule	HK	1954	only	-	Oct	31	3:30	0	-
-Rule	HK	1955	1964	-	Nov	Sun>=1	3:30	0	-
-Rule	HK	1965	1977	-	Apr	Sun>=16	3:30	1:00	S
-Rule	HK	1965	1977	-	Oct	Sun>=16	3:30	0	-
-Rule	HK	1973	only	-	Dec	30	3:30	1:00	S
-Rule	HK	1979	only	-	May	Sun>=8	3:30	1:00	S
-Rule	HK	1979	only	-	Oct	Sun>=16	3:30	0	-
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Asia/Hong_Kong	7:36:36 -	LMT	1904 Oct 30
-			8:00	HK	HK%sT	1941 Dec 25
-			9:00	-	JST	1945 Sep 15
-			8:00	HK	HK%sT
-
-###############################################################################
-
-# Taiwan
-
-# Shanks & Pottenger write that Taiwan observed DST during 1945, when it
-# was still controlled by Japan.  This is hard to believe, but we don't
-# have any other information.
-
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Taiwan	1945	1951	-	May	1	0:00	1:00	D
-Rule	Taiwan	1945	1951	-	Oct	1	0:00	0	S
-Rule	Taiwan	1952	only	-	Mar	1	0:00	1:00	D
-Rule	Taiwan	1952	1954	-	Nov	1	0:00	0	S
-Rule	Taiwan	1953	1959	-	Apr	1	0:00	1:00	D
-Rule	Taiwan	1955	1961	-	Oct	1	0:00	0	S
-Rule	Taiwan	1960	1961	-	Jun	1	0:00	1:00	D
-Rule	Taiwan	1974	1975	-	Apr	1	0:00	1:00	D
-Rule	Taiwan	1974	1975	-	Oct	1	0:00	0	S
-Rule	Taiwan	1980	only	-	Jun	30	0:00	1:00	D
-Rule	Taiwan	1980	only	-	Sep	30	0:00	0	S
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Asia/Taipei	8:06:00 -	LMT	1896 # or Taibei or T'ai-pei
-			8:00	Taiwan	C%sT
-
-# Macau (Macao, Aomen)
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Macau	1961	1962	-	Mar	Sun>=16	3:30	1:00	S
-Rule	Macau	1961	1964	-	Nov	Sun>=1	3:30	0	-
-Rule	Macau	1963	only	-	Mar	Sun>=16	0:00	1:00	S
-Rule	Macau	1964	only	-	Mar	Sun>=16	3:30	1:00	S
-Rule	Macau	1965	only	-	Mar	Sun>=16	0:00	1:00	S
-Rule	Macau	1965	only	-	Oct	31	0:00	0	-
-Rule	Macau	1966	1971	-	Apr	Sun>=16	3:30	1:00	S
-Rule	Macau	1966	1971	-	Oct	Sun>=16	3:30	0	-
-Rule	Macau	1972	1974	-	Apr	Sun>=15	0:00	1:00	S
-Rule	Macau	1972	1973	-	Oct	Sun>=15	0:00	0	-
-Rule	Macau	1974	1977	-	Oct	Sun>=15	3:30	0	-
-Rule	Macau	1975	1977	-	Apr	Sun>=15	3:30	1:00	S
-Rule	Macau	1978	1980	-	Apr	Sun>=15	0:00	1:00	S
-Rule	Macau	1978	1980	-	Oct	Sun>=15	0:00	0	-
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Asia/Macau	7:34:20 -	LMT	1912
-			8:00	Macau	MO%sT	1999 Dec 20 # return to China
-			8:00	PRC	C%sT
-
-
-###############################################################################
-
-# Cyprus
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Cyprus	1975	only	-	Apr	13	0:00	1:00	S
-Rule	Cyprus	1975	only	-	Oct	12	0:00	0	-
-Rule	Cyprus	1976	only	-	May	15	0:00	1:00	S
-Rule	Cyprus	1976	only	-	Oct	11	0:00	0	-
-Rule	Cyprus	1977	1980	-	Apr	Sun>=1	0:00	1:00	S
-Rule	Cyprus	1977	only	-	Sep	25	0:00	0	-
-Rule	Cyprus	1978	only	-	Oct	2	0:00	0	-
-Rule	Cyprus	1979	1997	-	Sep	lastSun	0:00	0	-
-Rule	Cyprus	1981	1998	-	Mar	lastSun	0:00	1:00	S
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Asia/Nicosia	2:13:28 -	LMT	1921 Nov 14
-			2:00	Cyprus	EE%sT	1998 Sep
-			2:00	EUAsia	EE%sT
-# IATA SSIM (1998-09) has Cyprus using EU rules for the first time.
-
-# Classically, Cyprus belongs to Asia; e.g. see Herodotus, Histories, I.72.
-# However, for various reasons many users expect to find it under Europe.
-Link	Asia/Nicosia	Europe/Nicosia
-
-# Georgia
-# From Paul Eggert (1994-11-19):
-# Today's _Economist_ (p 60) reports that Georgia moved its clocks forward
-# an hour recently, due to a law proposed by Zurab Murvanidze,
-# an MP who went on a hunger strike for 11 days to force discussion about it!
-# We have no details, but we'll guess they didn't move the clocks back in fall.
-#
-# From Mathew Englander, quoting AP (1996-10-23 13:05-04):
-# Instead of putting back clocks at the end of October, Georgia
-# will stay on daylight savings time this winter to save energy,
-# President Eduard Shevardnadze decreed Wednesday.
-#
-# From the BBC via Joseph S. Myers (2004-06-27):
-#
-# Georgia moved closer to Western Europe on Sunday...  The former Soviet
-# republic has changed its time zone back to that of Moscow.  As a result it
-# is now just four hours ahead of Greenwich Mean Time, rather than five hours
-# ahead.  The switch was decreed by the pro-Western president of Georgia,
-# Mikhail Saakashvili, who said the change was partly prompted by the process
-# of integration into Europe.
-
-# From Teimuraz Abashidze (2005-11-07):
-# Government of Georgia ... decided to NOT CHANGE daylight savings time on
-# [Oct.] 30, as it was done before during last more than 10 years.
-# Currently, we are in fact GMT +4:00, as before 30 October it was GMT
-# +3:00.... The problem is, there is NO FORMAL LAW or governmental document
-# about it.  As far as I can find, I was told, that there is no document,
-# because we just DIDN'T ISSUE document about switching to winter time....
-# I don't know what can be done, especially knowing that some years ago our
-# DST rules where changed THREE TIMES during one month.
-
-
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Asia/Tbilisi	2:59:16 -	LMT	1880
-			2:59:16	-	TBMT	1924 May  2 # Tbilisi Mean Time
-			3:00	-	TBIT	1957 Mar    # Tbilisi Time
-			4:00 RussiaAsia TBI%sT	1991 Mar 31 2:00s
-			3:00	1:00	TBIST	1991 Apr  9 # independence
-			3:00 RussiaAsia GE%sT	1992 # Georgia Time
-			3:00 E-EurAsia	GE%sT	1994 Sep lastSun
-			4:00 E-EurAsia	GE%sT	1996 Oct lastSun
-			4:00	1:00	GEST	1997 Mar lastSun
-			4:00 E-EurAsia	GE%sT	2004 Jun 27
-			3:00 RussiaAsia	GE%sT	2005 Mar lastSun 2:00
-			4:00	-	GET
-
-# East Timor
-
-# See Indonesia for the 1945 transition.
-
-# From Joao Carrascalao, brother of the former governor of East Timor, in
-# <a href="http://etan.org/et99c/december/26-31/30ETMAY.htm">
-# East Timor may be late for its millennium
-# </a> (1999-12-26/31):
-# Portugal tried to change the time forward in 1974 because the sun
-# rises too early but the suggestion raised a lot of problems with the
-# Timorese and I still don't think it would work today because it
-# conflicts with their way of life.
-
-# From Paul Eggert (2000-12-04):
-# We don't have any record of the above attempt.
-# Most likely our records are incomplete, but we have no better data.
-
-# <a href="http://www.hri.org/news/world/undh/last/00-08-16.undh.html">
-# From Manoel de Almeida e Silva, Deputy Spokesman for the UN Secretary-General
-# (2000-08-16)</a>:
-# The Cabinet of the East Timor Transition Administration decided
-# today to advance East Timor's time by one hour.  The time change,
-# which will be permanent, with no seasonal adjustment, will happen at
-# midnight on Saturday, September 16.
-
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Asia/Dili	8:22:20 -	LMT	1912
-			8:00	-	TLT	1942 Feb 21 23:00 # E Timor Time
-			9:00	-	JST	1945 Sep 23
-			9:00	-	TLT	1976 May  3
-			8:00	-	CIT	2000 Sep 17 00:00
-			9:00	-	TLT
-
-# India
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Asia/Kolkata	5:53:28 -	LMT	1880	# Kolkata
-			5:53:20	-	HMT	1941 Oct    # Howrah Mean Time?
-			6:30	-	BURT	1942 May 15 # Burma Time
-			5:30	-	IST	1942 Sep
-			5:30	1:00	IST	1945 Oct 15
-			5:30	-	IST
-# The following are like Asia/Kolkata:
-#	Andaman Is
-#	Lakshadweep (Laccadive, Minicoy and Amindivi Is)
-#	Nicobar Is
-
-# Indonesia
-#
-# From Gwillim Law (2001-05-28), overriding Shanks & Pottenger:
-# <http://www.sumatera-inc.com/go_to_invest/about_indonesia.asp#standtime>
-# says that Indonesia's time zones changed on 1988-01-01.  Looking at some
-# time zone maps, I think that must refer to Western Borneo (Kalimantan Barat
-# and Kalimantan Tengah) switching from UTC+8 to UTC+7.
-#
-# From Paul Eggert (2007-03-10):
-# Here is another correction to Shanks & Pottenger.
-# JohnTWB writes that Japanese forces did not surrender control in
-# Indonesia until 1945-09-01 00:00 at the earliest (in Jakarta) and
-# other formal surrender ceremonies were September 9, 11, and 13, plus
-# September 12 for the regional surrender to Mountbatten in Singapore.
-# These would be the earliest possible times for a change.
-# Regimes horaires pour le monde entier, by Henri Le Corre, (Editions
-# Traditionnelles, 1987, Paris) says that Java and Madura switched
-# from JST to UTC+07:30 on 1945-09-23, and gives 1944-09-01 for Jayapura
-# (Hollandia).  For now, assume all Indonesian locations other than Jayapura
-# switched on 1945-09-23.
-#
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone Asia/Jakarta	7:07:12 -	LMT	1867 Aug 10
-# Shanks & Pottenger say the next transition was at 1924 Jan 1 0:13,
-# but this must be a typo.
-			7:07:12	-	JMT	1923 Dec 31 23:47:12 # Jakarta
-			7:20	-	JAVT	1932 Nov	 # Java Time
-			7:30	-	WIT	1942 Mar 23
-			9:00	-	JST	1945 Sep 23
-			7:30	-	WIT	1948 May
-			8:00	-	WIT	1950 May
-			7:30	-	WIT	1964
-			7:00	-	WIT
-Zone Asia/Pontianak	7:17:20	-	LMT	1908 May
-			7:17:20	-	PMT	1932 Nov    # Pontianak MT
-			7:30	-	WIT	1942 Jan 29
-			9:00	-	JST	1945 Sep 23
-			7:30	-	WIT	1948 May
-			8:00	-	WIT	1950 May
-			7:30	-	WIT	1964
-			8:00	-	CIT	1988 Jan  1
-			7:00	-	WIT
-Zone Asia/Makassar	7:57:36 -	LMT	1920
-			7:57:36	-	MMT	1932 Nov    # Macassar MT
-			8:00	-	CIT	1942 Feb  9
-			9:00	-	JST	1945 Sep 23
-			8:00	-	CIT
-Zone Asia/Jayapura	9:22:48 -	LMT	1932 Nov
-			9:00	-	EIT	1944 Sep  1
-			9:30	-	CST	1964
-			9:00	-	EIT
-
-# Iran
-
-# From Roozbeh Pournader (2003-03-15):
-# This is an English translation of what I just found (originally in Persian).
-# The Gregorian dates in brackets are mine:
-#
-#	Official Newspaper No. 13548-1370/6/25 [1991-09-16]
-#	No. 16760/T233 H				1370/6/10 [1991-09-01]
-#
-#	The Rule About Change of the Official Time of the Country
-#
-#	The Board of Ministers, in the meeting dated 1370/5/23 [1991-08-14],
-#	based on the suggestion number 2221/D dated 1370/4/22 [1991-07-13]
-#	of the Country's Organization for Official and Employment Affairs,
-#	and referring to the law for equating the working hours of workers
-#	and officers in the whole country dated 1359/4/23 [1980-07-14], and
-#	for synchronizing the official times of the country, agreed that:
-#
-#	The official time of the country will should move forward one hour
-#	at the 24[:00] hours of the first day of Farvardin and should return
-#	to its previous state at the 24[:00] hours of the 30th day of
-#	Shahrivar.
-#
-#	First Deputy to the President - Hassan Habibi
-#
-# From personal experience, that agrees with what has been followed
-# for at least the last 5 years.  Before that, for a few years, the
-# date used was the first Thursday night of Farvardin and the last
-# Thursday night of Shahrivar, but I can't give exact dates....
-# I have also changed the abbreviations to what is considered correct
-# here in Iran, IRST for regular time and IRDT for daylight saving time.
-#
-# From Roozbeh Pournader (2005-04-05):
-# The text of the Iranian law, in effect since 1925, clearly mentions
-# that the true solar year is the measure, and there is no arithmetic
-# leap year calculation involved.  There has never been any serious
-# plan to change that law....
-#
-# From Paul Eggert (2006-03-22):
-# Go with Shanks & Pottenger before Sept. 1991, and with Pournader thereafter.
-# I used Ed Reingold's cal-persia in GNU Emacs 21.2 to check Persian dates,
-# stopping after 2037 when 32-bit time_t's overflow.
-# That cal-persia used Birashk's approximation, which disagrees with the solar
-# calendar predictions for the year 2025, so I corrected those dates by hand.
-#
-# From Oscar van Vlijmen (2005-03-30), writing about future
-# discrepancies between cal-persia and the Iranian calendar:
-# For 2091 solar-longitude-after yields 2091-03-20 08:40:07.7 UT for
-# the vernal equinox and that gets so close to 12:00 some local
-# Iranian time that the definition of the correct location needs to be
-# known exactly, amongst other factors.  2157 is even closer:
-# 2157-03-20 08:37:15.5 UT.  But the Gregorian year 2025 should give
-# no interpretation problem whatsoever.  By the way, another instant
-# in the near future where there will be a discrepancy between
-# arithmetical and astronomical Iranian calendars will be in 2058:
-# vernal equinox on 2058-03-20 09:03:05.9 UT.  The Java version of
-# Reingold's/Dershowitz' calculator gives correctly the Gregorian date
-# 2058-03-21 for 1 Farvardin 1437 (astronomical).
-#
-# From Steffen Thorsen (2006-03-22):
-# Several of my users have reported that Iran will not observe DST anymore:
-# http://www.irna.ir/en/news/view/line-17/0603193812164948.htm
-#
-# From Reuters (2007-09-16), with a heads-up from Jesper Norgaard Welen:
-# ... the Guardian Council ... approved a law on Sunday to re-introduce
-# daylight saving time ...
-# http://uk.reuters.com/article/oilRpt/idUKBLA65048420070916
-#
-# From Roozbeh Pournader (2007-11-05):
-# This is quoted from Official Gazette of the Islamic Republic of
-# Iran, Volume 63, Number 18242, dated Tuesday 1386/6/24
-# [2007-10-16]. I am doing the best translation I can:...
-# The official time of the country will be moved forward for one hour
-# on the 24 hours of the first day of the month of Farvardin and will
-# be changed back to its previous state on the 24 hours of the
-# thirtieth day of Shahrivar.
-#
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Iran	1978	1980	-	Mar	21	0:00	1:00	D
-Rule	Iran	1978	only	-	Oct	21	0:00	0	S
-Rule	Iran	1979	only	-	Sep	19	0:00	0	S
-Rule	Iran	1980	only	-	Sep	23	0:00	0	S
-Rule	Iran	1991	only	-	May	 3	0:00	1:00	D
-Rule	Iran	1992	1995	-	Mar	22	0:00	1:00	D
-Rule	Iran	1991	1995	-	Sep	22	0:00	0	S
-Rule	Iran	1996	only	-	Mar	21	0:00	1:00	D
-Rule	Iran	1996	only	-	Sep	21	0:00	0	S
-Rule	Iran	1997	1999	-	Mar	22	0:00	1:00	D
-Rule	Iran	1997	1999	-	Sep	22	0:00	0	S
-Rule	Iran	2000	only	-	Mar	21	0:00	1:00	D
-Rule	Iran	2000	only	-	Sep	21	0:00	0	S
-Rule	Iran	2001	2003	-	Mar	22	0:00	1:00	D
-Rule	Iran	2001	2003	-	Sep	22	0:00	0	S
-Rule	Iran	2004	only	-	Mar	21	0:00	1:00	D
-Rule	Iran	2004	only	-	Sep	21	0:00	0	S
-Rule	Iran	2005	only	-	Mar	22	0:00	1:00	D
-Rule	Iran	2005	only	-	Sep	22	0:00	0	S
-Rule	Iran	2008	only	-	Mar	21	0:00	1:00	D
-Rule	Iran	2008	only	-	Sep	21	0:00	0	S
-Rule	Iran	2009	2011	-	Mar	22	0:00	1:00	D
-Rule	Iran	2009	2011	-	Sep	22	0:00	0	S
-Rule	Iran	2012	only	-	Mar	21	0:00	1:00	D
-Rule	Iran	2012	only	-	Sep	21	0:00	0	S
-Rule	Iran	2013	2015	-	Mar	22	0:00	1:00	D
-Rule	Iran	2013	2015	-	Sep	22	0:00	0	S
-Rule	Iran	2016	only	-	Mar	21	0:00	1:00	D
-Rule	Iran	2016	only	-	Sep	21	0:00	0	S
-Rule	Iran	2017	2019	-	Mar	22	0:00	1:00	D
-Rule	Iran	2017	2019	-	Sep	22	0:00	0	S
-Rule	Iran	2020	only	-	Mar	21	0:00	1:00	D
-Rule	Iran	2020	only	-	Sep	21	0:00	0	S
-Rule	Iran	2021	2023	-	Mar	22	0:00	1:00	D
-Rule	Iran	2021	2023	-	Sep	22	0:00	0	S
-Rule	Iran	2024	only	-	Mar	21	0:00	1:00	D
-Rule	Iran	2024	only	-	Sep	21	0:00	0	S
-Rule	Iran	2025	2027	-	Mar	22	0:00	1:00	D
-Rule	Iran	2025	2027	-	Sep	22	0:00	0	S
-Rule	Iran	2028	2029	-	Mar	21	0:00	1:00	D
-Rule	Iran	2028	2029	-	Sep	21	0:00	0	S
-Rule	Iran	2030	2031	-	Mar	22	0:00	1:00	D
-Rule	Iran	2030	2031	-	Sep	22	0:00	0	S
-Rule	Iran	2032	2033	-	Mar	21	0:00	1:00	D
-Rule	Iran	2032	2033	-	Sep	21	0:00	0	S
-Rule	Iran	2034	2035	-	Mar	22	0:00	1:00	D
-Rule	Iran	2034	2035	-	Sep	22	0:00	0	S
-Rule	Iran	2036	2037	-	Mar	21	0:00	1:00	D
-Rule	Iran	2036	2037	-	Sep	21	0:00	0	S
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Asia/Tehran	3:25:44	-	LMT	1916
-			3:25:44	-	TMT	1946	# Tehran Mean Time
-			3:30	-	IRST	1977 Nov
-			4:00	Iran	IR%sT	1979
-			3:30	Iran	IR%sT
-
-
-# Iraq
-#
-# From Jonathan Lennox (2000-06-12):
-# An article in this week's Economist ("Inside the Saddam-free zone", p. 50 in
-# the U.S. edition) on the Iraqi Kurds contains a paragraph:
-# "The three northern provinces ... switched their clocks this spring and
-# are an hour ahead of Baghdad."
-#
-# But Rives McDow (2000-06-18) quotes a contact in Iraqi-Kurdistan as follows:
-# In the past, some Kurdish nationalists, as a protest to the Iraqi
-# Government, did not adhere to daylight saving time.  They referred
-# to daylight saving as Saddam time.  But, as of today, the time zone
-# in Iraqi-Kurdistan is on standard time with Baghdad, Iraq.
-#
-# So we'll ignore the Economist's claim.
-
-# From Steffen Thorsen (2008-03-10):
-# The cabinet in Iraq abolished DST last week, according to the following
-# news sources (in Arabic):
-# <a href="http://www.aljeeran.net/wesima_articles/news-20080305-98602.html">
-# http://www.aljeeran.net/wesima_articles/news-20080305-98602.html
-# </a>
-# <a href="http://www.aswataliraq.info/look/article.tpl?id=2047&IdLanguage=17&IdPublication=4&NrArticle=71743&NrIssue=1&NrSection=10">
-# http://www.aswataliraq.info/look/article.tpl?id=2047&IdLanguage=17&IdPublication=4&NrArticle=71743&NrIssue=1&NrSection=10
-# </a>
-#
-# We have published a short article in English about the change:
-# <a href="http://www.timeanddate.com/news/time/iraq-dumps-daylight-saving.html">
-# http://www.timeanddate.com/news/time/iraq-dumps-daylight-saving.html
-# </a>
-
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Iraq	1982	only	-	May	1	0:00	1:00	D
-Rule	Iraq	1982	1984	-	Oct	1	0:00	0	S
-Rule	Iraq	1983	only	-	Mar	31	0:00	1:00	D
-Rule	Iraq	1984	1985	-	Apr	1	0:00	1:00	D
-Rule	Iraq	1985	1990	-	Sep	lastSun	1:00s	0	S
-Rule	Iraq	1986	1990	-	Mar	lastSun	1:00s	1:00	D
-# IATA SSIM (1991/1996) says Apr 1 12:01am UTC; guess the `:01' is a typo.
-# Shanks & Pottenger say Iraq did not observe DST 1992/1997; ignore this.
-#
-Rule	Iraq	1991	2007	-	Apr	 1	3:00s	1:00	D
-Rule	Iraq	1991	2007	-	Oct	 1	3:00s	0	S
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Asia/Baghdad	2:57:40	-	LMT	1890
-			2:57:36	-	BMT	1918	    # Baghdad Mean Time?
-			3:00	-	AST	1982 May
-			3:00	Iraq	A%sT
-
-
-###############################################################################
-
-# Israel
-
-# From Ephraim Silverberg (2001-01-11):
-#
-# I coined "IST/IDT" circa 1988.  Until then there were three
-# different abbreviations in use:
-#
-# JST  Jerusalem Standard Time [Danny Braniss, Hebrew University]
-# IZT  Israel Zonal (sic) Time [Prof. Haim Papo, Technion]
-# EEST Eastern Europe Standard Time [used by almost everyone else]
-#
-# Since timezones should be called by country and not capital cities,
-# I ruled out JST.  As Israel is in Asia Minor and not Eastern Europe,
-# EEST was equally unacceptable.  Since "zonal" was not compatible with
-# any other timezone abbreviation, I felt that 'IST' was the way to go
-# and, indeed, it has received almost universal acceptance in timezone
-# settings in Israeli computers.
-#
-# In any case, I am happy to share timezone abbreviations with India,
-# high on my favorite-country list (and not only because my wife's
-# family is from India).
-
-# From Shanks & Pottenger:
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Zion	1940	only	-	Jun	 1	0:00	1:00	D
-Rule	Zion	1942	1944	-	Nov	 1	0:00	0	S
-Rule	Zion	1943	only	-	Apr	 1	2:00	1:00	D
-Rule	Zion	1944	only	-	Apr	 1	0:00	1:00	D
-Rule	Zion	1945	only	-	Apr	16	0:00	1:00	D
-Rule	Zion	1945	only	-	Nov	 1	2:00	0	S
-Rule	Zion	1946	only	-	Apr	16	2:00	1:00	D
-Rule	Zion	1946	only	-	Nov	 1	0:00	0	S
-Rule	Zion	1948	only	-	May	23	0:00	2:00	DD
-Rule	Zion	1948	only	-	Sep	 1	0:00	1:00	D
-Rule	Zion	1948	1949	-	Nov	 1	2:00	0	S
-Rule	Zion	1949	only	-	May	 1	0:00	1:00	D
-Rule	Zion	1950	only	-	Apr	16	0:00	1:00	D
-Rule	Zion	1950	only	-	Sep	15	3:00	0	S
-Rule	Zion	1951	only	-	Apr	 1	0:00	1:00	D
-Rule	Zion	1951	only	-	Nov	11	3:00	0	S
-Rule	Zion	1952	only	-	Apr	20	2:00	1:00	D
-Rule	Zion	1952	only	-	Oct	19	3:00	0	S
-Rule	Zion	1953	only	-	Apr	12	2:00	1:00	D
-Rule	Zion	1953	only	-	Sep	13	3:00	0	S
-Rule	Zion	1954	only	-	Jun	13	0:00	1:00	D
-Rule	Zion	1954	only	-	Sep	12	0:00	0	S
-Rule	Zion	1955	only	-	Jun	11	2:00	1:00	D
-Rule	Zion	1955	only	-	Sep	11	0:00	0	S
-Rule	Zion	1956	only	-	Jun	 3	0:00	1:00	D
-Rule	Zion	1956	only	-	Sep	30	3:00	0	S
-Rule	Zion	1957	only	-	Apr	29	2:00	1:00	D
-Rule	Zion	1957	only	-	Sep	22	0:00	0	S
-Rule	Zion	1974	only	-	Jul	 7	0:00	1:00	D
-Rule	Zion	1974	only	-	Oct	13	0:00	0	S
-Rule	Zion	1975	only	-	Apr	20	0:00	1:00	D
-Rule	Zion	1975	only	-	Aug	31	0:00	0	S
-Rule	Zion	1985	only	-	Apr	14	0:00	1:00	D
-Rule	Zion	1985	only	-	Sep	15	0:00	0	S
-Rule	Zion	1986	only	-	May	18	0:00	1:00	D
-Rule	Zion	1986	only	-	Sep	 7	0:00	0	S
-Rule	Zion	1987	only	-	Apr	15	0:00	1:00	D
-Rule	Zion	1987	only	-	Sep	13	0:00	0	S
-Rule	Zion	1988	only	-	Apr	 9	0:00	1:00	D
-Rule	Zion	1988	only	-	Sep	 3	0:00	0	S
-
-# From Ephraim Silverberg
-# (1997-03-04, 1998-03-16, 1998-12-28, 2000-01-17, 2000-07-25, 2004-12-22,
-# and 2005-02-17):
-
-# According to the Office of the Secretary General of the Ministry of
-# Interior, there is NO set rule for Daylight-Savings/Standard time changes.
-# One thing is entrenched in law, however: that there must be at least 150
-# days of daylight savings time annually.  From 1993-1998, the change to
-# daylight savings time was on a Friday morning from midnight IST to
-# 1 a.m IDT; up until 1998, the change back to standard time was on a
-# Saturday night from midnight daylight savings time to 11 p.m. standard
-# time.  1996 is an exception to this rule where the change back to standard
-# time took place on Sunday night instead of Saturday night to avoid
-# conflicts with the Jewish New Year.  In 1999, the change to
-# daylight savings time was still on a Friday morning but from
-# 2 a.m. IST to 3 a.m. IDT; furthermore, the change back to standard time
-# was also on a Friday morning from 2 a.m. IDT to 1 a.m. IST for
-# 1999 only.  In the year 2000, the change to daylight savings time was
-# similar to 1999, but although the change back will be on a Friday, it
-# will take place from 1 a.m. IDT to midnight IST.  Starting in 2001, all
-# changes to/from will take place at 1 a.m. old time, but now there is no
-# rule as to what day of the week it will take place in as the start date
-# (except in 2003) is the night after the Passover Seder (i.e. the eve
-# of the 16th of Nisan in the lunar Hebrew calendar) and the end date
-# (except in 2002) is three nights before Yom Kippur [Day of Atonement]
-# (the eve of the 7th of Tishrei in the lunar Hebrew calendar).
-
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Zion	1989	only	-	Apr	30	0:00	1:00	D
-Rule	Zion	1989	only	-	Sep	 3	0:00	0	S
-Rule	Zion	1990	only	-	Mar	25	0:00	1:00	D
-Rule	Zion	1990	only	-	Aug	26	0:00	0	S
-Rule	Zion	1991	only	-	Mar	24	0:00	1:00	D
-Rule	Zion	1991	only	-	Sep	 1	0:00	0	S
-Rule	Zion	1992	only	-	Mar	29	0:00	1:00	D
-Rule	Zion	1992	only	-	Sep	 6	0:00	0	S
-Rule	Zion	1993	only	-	Apr	 2	0:00	1:00	D
-Rule	Zion	1993	only	-	Sep	 5	0:00	0	S
-
-# The dates for 1994-1995 were obtained from Office of the Spokeswoman for the
-# Ministry of Interior, Jerusalem, Israel.  The spokeswoman can be reached by
-# calling the office directly at 972-2-6701447 or 972-2-6701448.
-
-# Rule	NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
-Rule	Zion	1994	only	-	Apr	 1	0:00	1:00	D
-Rule	Zion	1994	only	-	Aug	28	0:00	0	S
-Rule	Zion	1995	only	-	Mar	31	0:00	1:00	D
-Rule	Zion	1995	only	-	Sep	 3	0:00	0	S
-
-# The dates for 1996 were determined by the Minister of Interior of the
-# time, Haim Ramon.  The official announcement regarding 1996-1998
-# (with the dates for 1997-1998 no longer being relevant) can be viewed at:
-#
-#   ftp://ftp.cs.huji.ac.il/pub/tz/announcements/1996-1998.ramon.ps.gz
-#
-# The dates for 1997-1998 were altered by his successor, Rabbi Eli Suissa.
-#
-# The official announcements for the years 1997-1999 can be viewed at:
-#
-#   ftp://ftp.cs.huji.ac.il/pub/tz/announcements/YYYY.ps.gz
-#
-#       where YYYY is the relevant year.
-
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Zion	1996	only	-	Mar	15	0:00	1:00	D
-Rule	Zion	1996	only	-	Sep	16	0:00	0	S
-Rule	Zion	1997	only	-	Mar	21	0:00	1:00	D
-Rule	Zion	1997	only	-	Sep	14	0:00	0	S
-Rule	Zion	1998	only	-	Mar	20	0:00	1:00	D
-Rule	Zion	1998	only	-	Sep	 6	0:00	0	S
-Rule	Zion	1999	only	-	Apr	 2	2:00	1:00	D
-Rule	Zion	1999	only	-	Sep	 3	2:00	0	S
-
-# The Knesset Interior Committee has changed the dates for 2000 for
-# the third time in just over a year and have set new dates for the
-# years 2001-2004 as well.
-#
-# The official announcement for the start date of 2000 can be viewed at:
-#
-#	ftp://ftp.cs.huji.ac.il/pub/tz/announcements/2000-start.ps.gz
-#
-# The official announcement for the end date of 2000 and the dates
-# for the years 2001-2004 can be viewed at:
-#
-#	ftp://ftp.cs.huji.ac.il/pub/tz/announcements/2000-2004.ps.gz
-
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Zion	2000	only	-	Apr	14	2:00	1:00	D
-Rule	Zion	2000	only	-	Oct	 6	1:00	0	S
-Rule	Zion	2001	only	-	Apr	 9	1:00	1:00	D
-Rule	Zion	2001	only	-	Sep	24	1:00	0	S
-Rule	Zion	2002	only	-	Mar	29	1:00	1:00	D
-Rule	Zion	2002	only	-	Oct	 7	1:00	0	S
-Rule	Zion	2003	only	-	Mar	28	1:00	1:00	D
-Rule	Zion	2003	only	-	Oct	 3	1:00	0	S
-Rule	Zion	2004	only	-	Apr	 7	1:00	1:00	D
-Rule	Zion	2004	only	-	Sep	22	1:00	0	S
-
-# The proposed law agreed upon by the Knesset Interior Committee on
-# 2005-02-14 is that, for 2005 and beyond, DST starts at 02:00 the
-# last Friday before April 2nd (i.e. the last Friday in March or April
-# 1st itself if it falls on a Friday) and ends at 02:00 on the Saturday
-# night _before_ the fast of Yom Kippur.
-#
-# Those who can read Hebrew can view the announcement at:
-#
-#	ftp://ftp.cs.huji.ac.il/pub/tz/announcements/2005+beyond.ps
-
-# From Paul Eggert (2005-02-22):
-# I used Ephraim Silverberg's dst-israel.el program
-# <ftp://ftp.cs.huji.ac.il/pub/tz/software/dst-israel.el> (2005-02-20)
-# along with Ed Reingold's cal-hebrew in GNU Emacs 21.4,
-# to generate the transitions in this list.
-# (I replaced "lastFri" with "Fri>=26" by hand.)
-# The spring transitions below all correspond to the following Rule:
-#
-# Rule	Zion	2005	max	-	Mar	Fri>=26	2:00	1:00	D
-#
-# but older zic implementations (e.g., Solaris 8) do not support
-# "Fri>=26" to mean April 1 in years like 2005, so for now we list the
-# springtime transitions explicitly.
-
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Zion	2005	only	-	Apr	 1	2:00	1:00	D
-Rule	Zion	2005	only	-	Oct	 9	2:00	0	S
-Rule	Zion	2006	2010	-	Mar	Fri>=26	2:00	1:00	D
-Rule	Zion	2006	only	-	Oct	 1	2:00	0	S
-Rule	Zion	2007	only	-	Sep	16	2:00	0	S
-Rule	Zion	2008	only	-	Oct	 5	2:00	0	S
-Rule	Zion	2009	only	-	Sep	27	2:00	0	S
-Rule	Zion	2010	only	-	Sep	12	2:00	0	S
-Rule	Zion	2011	only	-	Apr	 1	2:00	1:00	D
-Rule	Zion	2011	only	-	Oct	 2	2:00	0	S
-Rule	Zion	2012	2015	-	Mar	Fri>=26	2:00	1:00	D
-Rule	Zion	2012	only	-	Sep	23	2:00	0	S
-Rule	Zion	2013	only	-	Sep	 8	2:00	0	S
-Rule	Zion	2014	only	-	Sep	28	2:00	0	S
-Rule	Zion	2015	only	-	Sep	20	2:00	0	S
-Rule	Zion	2016	only	-	Apr	 1	2:00	1:00	D
-Rule	Zion	2016	only	-	Oct	 9	2:00	0	S
-Rule	Zion	2017	2021	-	Mar	Fri>=26	2:00	1:00	D
-Rule	Zion	2017	only	-	Sep	24	2:00	0	S
-Rule	Zion	2018	only	-	Sep	16	2:00	0	S
-Rule	Zion	2019	only	-	Oct	 6	2:00	0	S
-Rule	Zion	2020	only	-	Sep	27	2:00	0	S
-Rule	Zion	2021	only	-	Sep	12	2:00	0	S
-Rule	Zion	2022	only	-	Apr	 1	2:00	1:00	D
-Rule	Zion	2022	only	-	Oct	 2	2:00	0	S
-Rule	Zion	2023	2032	-	Mar	Fri>=26	2:00	1:00	D
-Rule	Zion	2023	only	-	Sep	24	2:00	0	S
-Rule	Zion	2024	only	-	Oct	 6	2:00	0	S
-Rule	Zion	2025	only	-	Sep	28	2:00	0	S
-Rule	Zion	2026	only	-	Sep	20	2:00	0	S
-Rule	Zion	2027	only	-	Oct	10	2:00	0	S
-Rule	Zion	2028	only	-	Sep	24	2:00	0	S
-Rule	Zion	2029	only	-	Sep	16	2:00	0	S
-Rule	Zion	2030	only	-	Oct	 6	2:00	0	S
-Rule	Zion	2031	only	-	Sep	21	2:00	0	S
-Rule	Zion	2032	only	-	Sep	12	2:00	0	S
-Rule	Zion	2033	only	-	Apr	 1	2:00	1:00	D
-Rule	Zion	2033	only	-	Oct	 2	2:00	0	S
-Rule	Zion	2034	2037	-	Mar	Fri>=26	2:00	1:00	D
-Rule	Zion	2034	only	-	Sep	17	2:00	0	S
-Rule	Zion	2035	only	-	Oct	 7	2:00	0	S
-Rule	Zion	2036	only	-	Sep	28	2:00	0	S
-Rule	Zion	2037	only	-	Sep	13	2:00	0	S
-
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Asia/Jerusalem	2:20:56 -	LMT	1880
-			2:20:40	-	JMT	1918	# Jerusalem Mean Time?
-			2:00	Zion	I%sT
-
-
-
-###############################################################################
-
-# Japan
-
-# `9:00' and `JST' is from Guy Harris.
-
-# From Paul Eggert (1995-03-06):
-# Today's _Asahi Evening News_ (page 4) reports that Japan had
-# daylight saving between 1948 and 1951, but ``the system was discontinued
-# because the public believed it would lead to longer working hours.''
-
-# From Mayumi Negishi in the 2005-08-10 Japan Times
-# <http://www.japantimes.co.jp/cgi-bin/getarticle.pl5?nn20050810f2.htm>:
-# Occupation authorities imposed daylight-saving time on Japan on
-# [1948-05-01]....  But lack of prior debate and the execution of
-# daylight-saving time just three days after the bill was passed generated
-# deep hatred of the concept....  The Diet unceremoniously passed a bill to
-# dump the unpopular system in October 1951, less than a month after the San
-# Francisco Peace Treaty was signed.  (A government poll in 1951 showed 53%
-# of the Japanese wanted to scrap daylight-saving time, as opposed to 30% who
-# wanted to keep it.)
-
-# From Paul Eggert (2006-03-22):
-# Shanks & Pottenger write that DST in Japan during those years was as follows:
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Japan	1948	only	-	May	Sun>=1	2:00	1:00	D
-Rule	Japan	1948	1951	-	Sep	Sat>=8	2:00	0	S
-Rule	Japan	1949	only	-	Apr	Sun>=1	2:00	1:00	D
-Rule	Japan	1950	1951	-	May	Sun>=1	2:00	1:00	D
-# but the only locations using it (for birth certificates, presumably, since
-# their audience is astrologers) were US military bases.  For now, assume
-# that for most purposes daylight-saving time was observed; otherwise, what
-# would have been the point of the 1951 poll?
-
-# From Hideyuki Suzuki (1998-11-09):
-# 'Tokyo' usually stands for the former location of Tokyo Astronomical
-# Observatory: E 139 44' 40".90 (9h 18m 58s.727), N 35 39' 16".0.
-# This data is from 'Rika Nenpyou (Chronological Scientific Tables) 1996'
-# edited by National Astronomical Observatory of Japan....
-# JST (Japan Standard Time) has been used since 1888-01-01 00:00 (JST).
-# The law is enacted on 1886-07-07.
-
-# From Hideyuki Suzuki (1998-11-16):
-# The ordinance No. 51 (1886) established "standard time" in Japan,
-# which stands for the time on E 135 degree.
-# In the ordinance No. 167 (1895), "standard time" was renamed to "central
-# standard time".  And the same ordinance also established "western standard
-# time", which stands for the time on E 120 degree....  But "western standard
-# time" was abolished in the ordinance No. 529 (1937).  In the ordinance No.
-# 167, there is no mention regarding for what place western standard time is
-# standard....
-#
-# I wrote "ordinance" above, but I don't know how to translate.
-# In Japanese it's "chokurei", which means ordinance from emperor.
-
-# Shanks & Pottenger claim JST in use since 1896, and that a few
-# places (e.g. Ishigaki) use +0800; go with Suzuki.  Guess that all
-# ordinances took effect on Jan 1.
-
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Asia/Tokyo	9:18:59	-	LMT	1887 Dec 31 15:00u
-			9:00	-	JST	1896
-			9:00	-	CJT	1938
-			9:00	Japan	J%sT
-# Since 1938, all Japanese possessions have been like Asia/Tokyo.
-
-# Jordan
-#
-# From <a href="http://star.arabia.com/990701/JO9.html">
-# Jordan Week (1999-07-01) </a> via Steffen Thorsen (1999-09-09):
-# Clocks in Jordan were forwarded one hour on Wednesday at midnight,
-# in accordance with the government's decision to implement summer time
-# all year round.
-#
-# From <a href="http://star.arabia.com/990930/JO9.html">
-# Jordan Week (1999-09-30) </a> via Steffen Thorsen (1999-11-09):
-# Winter time starts today Thursday, 30 September. Clocks will be turned back
-# by one hour.  This is the latest government decision and it's final!
-# The decision was taken because of the increase in working hours in
-# government's departments from six to seven hours.
-#
-# From Paul Eggert (2005-11-22):
-# Starting 2003 transitions are from Steffen Thorsen's web site timeanddate.com.
-#
-# From Steffen Thorsen (2005-11-23):
-# For Jordan I have received multiple independent user reports every year
-# about DST end dates, as the end-rule is different every year.
-#
-# From Steffen Thorsen (2006-10-01), after a heads-up from Hilal Malawi:
-# http://www.petranews.gov.jo/nepras/2006/Sep/05/4000.htm
-# "Jordan will switch to winter time on Friday, October 27".
-#
-
-# From Phil Pizzey (2009-04-02):
-# ...I think I may have spotted an error in the timezone data for
-# Jordan.
-# The current (2009d) asia file shows Jordan going to daylight
-# saving
-# time on the last Thursday in March.
-#
-# Rule  Jordan      2000  max	-  Mar   lastThu     0:00s 1:00  S
-#
-# However timeanddate.com, which I usually find reliable, shows Jordan
-# going to daylight saving time on the last Friday in March since 2002.
-# Please see
-# <a href="http://www.timeanddate.com/worldclock/timezone.html?n=11">
-# http://www.timeanddate.com/worldclock/timezone.html?n=11
-# </a>
-
-# From Steffen Thorsen (2009-04-02):
-# This single one might be good enough, (2009-03-24, Arabic):
-# <a href="http://petra.gov.jo/Artical.aspx?Lng=2&Section=8&Artical=95279">
-# http://petra.gov.jo/Artical.aspx?Lng=2&Section=8&Artical=95279
-# </a>
-#
-# Google's translation:
-#
-# > The Council of Ministers decided in 2002 to adopt the principle of timely
-# > submission of the summer at 60 minutes as of midnight on the last Thursday
-# > of the month of March of each year.
-#
-# So - this means the midnight between Thursday and Friday since 2002.
-
-# From Arthur David Olson (2009-04-06):
-# We still have Jordan switching to DST on Thursdays in 2000 and 2001.
-
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Jordan	1973	only	-	Jun	6	0:00	1:00	S
-Rule	Jordan	1973	1975	-	Oct	1	0:00	0	-
-Rule	Jordan	1974	1977	-	May	1	0:00	1:00	S
-Rule	Jordan	1976	only	-	Nov	1	0:00	0	-
-Rule	Jordan	1977	only	-	Oct	1	0:00	0	-
-Rule	Jordan	1978	only	-	Apr	30	0:00	1:00	S
-Rule	Jordan	1978	only	-	Sep	30	0:00	0	-
-Rule	Jordan	1985	only	-	Apr	1	0:00	1:00	S
-Rule	Jordan	1985	only	-	Oct	1	0:00	0	-
-Rule	Jordan	1986	1988	-	Apr	Fri>=1	0:00	1:00	S
-Rule	Jordan	1986	1990	-	Oct	Fri>=1	0:00	0	-
-Rule	Jordan	1989	only	-	May	8	0:00	1:00	S
-Rule	Jordan	1990	only	-	Apr	27	0:00	1:00	S
-Rule	Jordan	1991	only	-	Apr	17	0:00	1:00	S
-Rule	Jordan	1991	only	-	Sep	27	0:00	0	-
-Rule	Jordan	1992	only	-	Apr	10	0:00	1:00	S
-Rule	Jordan	1992	1993	-	Oct	Fri>=1	0:00	0	-
-Rule	Jordan	1993	1998	-	Apr	Fri>=1	0:00	1:00	S
-Rule	Jordan	1994	only	-	Sep	Fri>=15	0:00	0	-
-Rule	Jordan	1995	1998	-	Sep	Fri>=15	0:00s	0	-
-Rule	Jordan	1999	only	-	Jul	 1	0:00s	1:00	S
-Rule	Jordan	1999	2002	-	Sep	lastFri	0:00s	0	-
-Rule	Jordan	2000	2001	-	Mar	lastThu	0:00s	1:00	S
-Rule	Jordan	2002	max	-	Mar	lastThu	24:00	1:00	S
-Rule	Jordan	2003	only	-	Oct	24	0:00s	0	-
-Rule	Jordan	2004	only	-	Oct	15	0:00s	0	-
-Rule	Jordan	2005	only	-	Sep	lastFri	0:00s	0	-
-Rule	Jordan	2006	max	-	Oct	lastFri	0:00s	0	-
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Asia/Amman	2:23:44 -	LMT	1931
-			2:00	Jordan	EE%sT
-
-
-# Kazakhstan
-
-# From Paul Eggert (1996-11-22):
-# Andrew Evtichov (1996-04-13) writes that Kazakhstan
-# stayed in sync with Moscow after 1990, and that Aqtobe (formerly Aktyubinsk)
-# and Aqtau (formerly Shevchenko) are the largest cities in their zones.
-# Guess that Aqtau and Aqtobe diverged in 1995, since that's the first time
-# IATA SSIM mentions a third time zone in Kazakhstan.
-
-# From Paul Eggert (2006-03-22):
-# German Iofis, ELSI, Almaty (2001-10-09) reports that Kazakhstan uses
-# RussiaAsia rules, instead of switching at 00:00 as the IATA has it.
-# Go with Shanks & Pottenger, who have them always using RussiaAsia rules.
-# Also go with the following claims of Shanks & Pottenger:
-#
-# - Kazakhstan did not observe DST in 1991.
-# - Qyzylorda switched from +5:00 to +6:00 on 1992-01-19 02:00.
-# - Oral switched from +5:00 to +4:00 in spring 1989.
-
-# <a href="http://www.kazsociety.org.uk/news/2005/03/30.htm">
-# From Kazakhstan Embassy's News Bulletin #11 (2005-03-21):
-# </a>
-# The Government of Kazakhstan passed a resolution March 15 abolishing
-# daylight saving time citing lack of economic benefits and health
-# complications coupled with a decrease in productivity.
-#
-# From Branislav Kojic (in Astana) via Gwillim Law (2005-06-28):
-# ... what happened was that the former Kazakhstan Eastern time zone
-# was "blended" with the Central zone.  Therefore, Kazakhstan now has
-# two time zones, and difference between them is one hour.  The zone
-# closer to UTC is the former Western zone (probably still called the
-# same), encompassing four provinces in the west: Aqtobe, Atyrau,
-# Mangghystau, and West Kazakhstan.  The other zone encompasses
-# everything else....  I guess that would make Kazakhstan time zones
-# de jure UTC+5 and UTC+6 respectively.
-
-#
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-#
-# Almaty (formerly Alma-Ata), representing most locations in Kazakhstan
-Zone	Asia/Almaty	5:07:48 -	LMT	1924 May  2 # or Alma-Ata
-			5:00	-	ALMT	1930 Jun 21 # Alma-Ata Time
-			6:00 RussiaAsia ALM%sT	1991
-			6:00	-	ALMT	1992
-			6:00 RussiaAsia	ALM%sT	2005 Mar 15
-			6:00	-	ALMT
-# Qyzylorda (aka Kyzylorda, Kizilorda, Kzyl-Orda, etc.)
-Zone	Asia/Qyzylorda	4:21:52 -	LMT	1924 May  2
-			4:00	-	KIZT	1930 Jun 21 # Kizilorda Time
-			5:00	-	KIZT	1981 Apr  1
-			5:00	1:00	KIZST	1981 Oct  1
-			6:00	-	KIZT	1982 Apr  1
-			5:00 RussiaAsia	KIZ%sT	1991
-			5:00	-	KIZT	1991 Dec 16 # independence
-			5:00	-	QYZT	1992 Jan 19 2:00
-			6:00 RussiaAsia	QYZ%sT	2005 Mar 15
-			6:00	-	QYZT
-# Aqtobe (aka Aktobe, formerly Akt'ubinsk)
-Zone	Asia/Aqtobe	3:48:40	-	LMT	1924 May  2
-			4:00	-	AKTT	1930 Jun 21 # Aktyubinsk Time
-			5:00	-	AKTT	1981 Apr  1
-			5:00	1:00	AKTST	1981 Oct  1
-			6:00	-	AKTT	1982 Apr  1
-			5:00 RussiaAsia	AKT%sT	1991
-			5:00	-	AKTT	1991 Dec 16 # independence
-			5:00 RussiaAsia	AQT%sT	2005 Mar 15 # Aqtobe Time
-			5:00	-	AQTT
-# Mangghystau
-# Aqtau was not founded until 1963, but it represents an inhabited region,
-# so include time stamps before 1963.
-Zone	Asia/Aqtau	3:21:04	-	LMT	1924 May  2
-			4:00	-	FORT	1930 Jun 21 # Fort Shevchenko T
-			5:00	-	FORT	1963
-			5:00	-	SHET	1981 Oct  1 # Shevchenko Time
-			6:00	-	SHET	1982 Apr  1
-			5:00 RussiaAsia	SHE%sT	1991
-			5:00	-	SHET	1991 Dec 16 # independence
-			5:00 RussiaAsia	AQT%sT	1995 Mar lastSun 2:00 # Aqtau Time
-			4:00 RussiaAsia	AQT%sT	2005 Mar 15
-			5:00	-	AQTT
-# West Kazakhstan
-Zone	Asia/Oral	3:25:24	-	LMT	1924 May  2 # or Ural'sk
-			4:00	-	URAT	1930 Jun 21 # Ural'sk time
-			5:00	-	URAT	1981 Apr  1
-			5:00	1:00	URAST	1981 Oct  1
-			6:00	-	URAT	1982 Apr  1
-			5:00 RussiaAsia	URA%sT	1989 Mar 26 2:00
-			4:00 RussiaAsia	URA%sT	1991
-			4:00	-	URAT	1991 Dec 16 # independence
-			4:00 RussiaAsia	ORA%sT	2005 Mar 15 # Oral Time
-			5:00	-	ORAT
-
-# Kyrgyzstan (Kirgizstan)
-# Transitions through 1991 are from Shanks & Pottenger.
-
-# From Paul Eggert (2005-08-15):
-# According to an article dated today in the Kyrgyzstan Development Gateway
-# <http://eng.gateway.kg/cgi-bin/page.pl?id=1&story_name=doc9979.shtml>
-# Kyrgyzstan is canceling the daylight saving time system.  I take the article
-# to mean that they will leave their clocks at 6 hours ahead of UTC.
-# From Malik Abdugaliev (2005-09-21):
-# Our government cancels daylight saving time 6th of August 2005.
-# From 2005-08-12 our GMT-offset is +6, w/o any daylight saving.
-
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Kyrgyz	1992	1996	-	Apr	Sun>=7	0:00s	1:00	S
-Rule	Kyrgyz	1992	1996	-	Sep	lastSun	0:00	0	-
-Rule	Kyrgyz	1997	2005	-	Mar	lastSun	2:30	1:00	S
-Rule	Kyrgyz	1997	2004	-	Oct	lastSun	2:30	0	-
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Asia/Bishkek	4:58:24 -	LMT	1924 May  2
-			5:00	-	FRUT	1930 Jun 21 # Frunze Time
-			6:00 RussiaAsia FRU%sT	1991 Mar 31 2:00s
-			5:00	1:00	FRUST	1991 Aug 31 2:00 # independence
-			5:00	Kyrgyz	KG%sT	2005 Aug 12    # Kyrgyzstan Time
-			6:00	-	KGT
-
-###############################################################################
-
-# Korea (North and South)
-
-# From Annie I. Bang (2006-07-10) in
-# <http://www.koreaherald.co.kr/SITE/data/html_dir/2006/07/10/200607100012.asp>:
-# The Ministry of Commerce, Industry and Energy has already
-# commissioned a research project [to reintroduce DST] and has said
-# the system may begin as early as 2008....  Korea ran a daylight
-# saving program from 1949-61 but stopped it during the 1950-53 Korean War.
-
-# From Shanks & Pottenger:
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	ROK	1960	only	-	May	15	0:00	1:00	D
-Rule	ROK	1960	only	-	Sep	13	0:00	0	S
-Rule	ROK	1987	1988	-	May	Sun>=8	0:00	1:00	D
-Rule	ROK	1987	1988	-	Oct	Sun>=8	0:00	0	S
-
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Asia/Seoul	8:27:52	-	LMT	1890
-			8:30	-	KST	1904 Dec
-			9:00	-	KST	1928
-			8:30	-	KST	1932
-			9:00	-	KST	1954 Mar 21
-			8:00	ROK	K%sT	1961 Aug 10
-			8:30	-	KST	1968 Oct
-			9:00	ROK	K%sT
-Zone	Asia/Pyongyang	8:23:00 -	LMT	1890
-			8:30	-	KST	1904 Dec
-			9:00	-	KST	1928
-			8:30	-	KST	1932
-			9:00	-	KST	1954 Mar 21
-			8:00	-	KST	1961 Aug 10
-			9:00	-	KST
-
-###############################################################################
-
-# Kuwait
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-# From the Arab Times (2007-03-14):
-# The Civil Service Commission (CSC) has approved a proposal forwarded
-# by MP Ahmad Baqer on implementing the daylight saving time (DST) in
-# Kuwait starting from April until the end of Sept this year, reports Al-Anba.
-# <http://www.arabtimesonline.com/arabtimes/kuwait/Viewdet.asp?ID=9950>.
-# From Paul Eggert (2007-03-29):
-# We don't know the details, or whether the approval means it'll happen,
-# so for now we assume no DST.
-Zone	Asia/Kuwait	3:11:56 -	LMT	1950
-			3:00	-	AST
-
-# Laos
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Asia/Vientiane	6:50:24 -	LMT	1906 Jun  9 # or Viangchan
-			7:06:20	-	SMT	1911 Mar 11 0:01 # Saigon MT?
-			7:00	-	ICT	1912 May
-			8:00	-	ICT	1931 May
-			7:00	-	ICT
-
-# Lebanon
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Lebanon	1920	only	-	Mar	28	0:00	1:00	S
-Rule	Lebanon	1920	only	-	Oct	25	0:00	0	-
-Rule	Lebanon	1921	only	-	Apr	3	0:00	1:00	S
-Rule	Lebanon	1921	only	-	Oct	3	0:00	0	-
-Rule	Lebanon	1922	only	-	Mar	26	0:00	1:00	S
-Rule	Lebanon	1922	only	-	Oct	8	0:00	0	-
-Rule	Lebanon	1923	only	-	Apr	22	0:00	1:00	S
-Rule	Lebanon	1923	only	-	Sep	16	0:00	0	-
-Rule	Lebanon	1957	1961	-	May	1	0:00	1:00	S
-Rule	Lebanon	1957	1961	-	Oct	1	0:00	0	-
-Rule	Lebanon	1972	only	-	Jun	22	0:00	1:00	S
-Rule	Lebanon	1972	1977	-	Oct	1	0:00	0	-
-Rule	Lebanon	1973	1977	-	May	1	0:00	1:00	S
-Rule	Lebanon	1978	only	-	Apr	30	0:00	1:00	S
-Rule	Lebanon	1978	only	-	Sep	30	0:00	0	-
-Rule	Lebanon	1984	1987	-	May	1	0:00	1:00	S
-Rule	Lebanon	1984	1991	-	Oct	16	0:00	0	-
-Rule	Lebanon	1988	only	-	Jun	1	0:00	1:00	S
-Rule	Lebanon	1989	only	-	May	10	0:00	1:00	S
-Rule	Lebanon	1990	1992	-	May	1	0:00	1:00	S
-Rule	Lebanon	1992	only	-	Oct	4	0:00	0	-
-Rule	Lebanon	1993	max	-	Mar	lastSun	0:00	1:00	S
-Rule	Lebanon	1993	1998	-	Sep	lastSun	0:00	0	-
-Rule	Lebanon	1999	max	-	Oct	lastSun	0:00	0	-
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Asia/Beirut	2:22:00 -	LMT	1880
-			2:00	Lebanon	EE%sT
-
-# Malaysia
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	NBorneo	1935	1941	-	Sep	14	0:00	0:20	TS # one-Third Summer
-Rule	NBorneo	1935	1941	-	Dec	14	0:00	0	-
-#
-# peninsular Malaysia
-# The data here are taken from Mok Ly Yng (2003-10-30)
-# <http://www.math.nus.edu.sg/aslaksen/teaching/timezone.html>.
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone Asia/Kuala_Lumpur	6:46:46 -	LMT	1901 Jan  1
-			6:55:25	-	SMT	1905 Jun  1 # Singapore M.T.
-			7:00	-	MALT	1933 Jan  1 # Malaya Time
-			7:00	0:20	MALST	1936 Jan  1
-			7:20	-	MALT	1941 Sep  1
-			7:30	-	MALT	1942 Feb 16
-			9:00	-	JST	1945 Sep 12
-			7:30	-	MALT	1982 Jan  1
-			8:00	-	MYT	# Malaysia Time
-# Sabah & Sarawak
-# From Paul Eggert (2006-03-22):
-# The data here are mostly from Shanks & Pottenger, but the 1942, 1945 and 1982
-# transition dates are from Mok Ly Yng.
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone Asia/Kuching	7:21:20	-	LMT	1926 Mar
-			7:30	-	BORT	1933	# Borneo Time
-			8:00	NBorneo	BOR%sT	1942 Feb 16
-			9:00	-	JST	1945 Sep 12
-			8:00	-	BORT	1982 Jan  1
-			8:00	-	MYT
-
-# Maldives
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Indian/Maldives	4:54:00 -	LMT	1880	# Male
-			4:54:00	-	MMT	1960	# Male Mean Time
-			5:00	-	MVT		# Maldives Time
-
-# Mongolia
-
-# Shanks & Pottenger say that Mongolia has three time zones, but
-# usno1995 and the CIA map Standard Time Zones of the World (2005-03)
-# both say that it has just one.
-
-# From Oscar van Vlijmen (1999-12-11):
-# <a href="http://www.mongoliatourism.gov.mn/general.htm">
-# General Information Mongolia
-# </a> (1999-09)
-# "Time: Mongolia has two time zones. Three westernmost provinces of
-# Bayan-Ulgii, Uvs, and Hovd are one hour earlier than the capital city, and
-# the rest of the country follows the Ulaanbaatar time, which is UTC/GMT plus
-# eight hours."
-
-# From Rives McDow (1999-12-13):
-# Mongolia discontinued the use of daylight savings time in 1999; 1998
-# being the last year it was implemented.  The dates of implementation I am
-# unsure of, but most probably it was similar to Russia, except for the time
-# of implementation may have been different....
-# Some maps in the past have indicated that there was an additional time
-# zone in the eastern part of Mongolia, including the provinces of Dornod,
-# Suhbaatar, and possibly Khentij.
-
-# From Paul Eggert (1999-12-15):
-# Naming and spelling is tricky in Mongolia.
-# We'll use Hovd (also spelled Chovd and Khovd) to represent the west zone;
-# the capital of the Hovd province is sometimes called Hovd, sometimes Dund-Us,
-# and sometimes Jirgalanta (with variant spellings), but the name Hovd
-# is good enough for our purposes.
-
-# From Rives McDow (2001-05-13):
-# In addition to Mongolia starting daylight savings as reported earlier
-# (adopted DST on 2001-04-27 02:00 local time, ending 2001-09-28),
-# there are three time zones.
-#
-# Provinces [at 7:00]: Bayan-ulgii, Uvs, Khovd, Zavkhan, Govi-Altai
-# Provinces [at 8:00]: Khovsgol, Bulgan, Arkhangai, Khentii, Tov,
-#	Bayankhongor, Ovorkhangai, Dundgovi, Dornogovi, Omnogovi
-# Provinces [at 9:00]: Dornod, Sukhbaatar
-#
-# [The province of Selenge is omitted from the above lists.]
-
-# From Ganbold Ts., Ulaanbaatar (2004-04-17):
-# Daylight saving occurs at 02:00 local time last Saturday of March.
-# It will change back to normal at 02:00 local time last Saturday of
-# September.... As I remember this rule was changed in 2001.
-#
-# From Paul Eggert (2004-04-17):
-# For now, assume Rives McDow's informant got confused about Friday vs
-# Saturday, and that his 2001 dates should have 1 added to them.
-
-# From Paul Eggert (2005-07-26):
-# We have wildly conflicting information about Mongolia's time zones.
-# Bill Bonnet (2005-05-19) reports that the US Embassy in Ulaanbaatar says
-# there is only one time zone and that DST is observed, citing Microsoft
-# Windows XP as the source.  Risto Nykanen (2005-05-16) reports that
-# travelmongolia.org says there are two time zones (UTC+7, UTC+8) with no DST.
-# Oscar van Vlijmen (2005-05-20) reports that the Mongolian Embassy in
-# Washington, DC says there are two time zones, with DST observed.
-# He also found
-# <http://ubpost.mongolnews.mn/index.php?subaction=showcomments&id=1111634894&archive=&start_from=&ucat=1&>
-# which also says that there is DST, and which has a comment by "Toddius"
-# (2005-03-31 06:05 +0700) saying "Mongolia actually has 3.5 time zones.
-# The West (OLGII) is +7 GMT, most of the country is ULAT is +8 GMT
-# and some Eastern provinces are +9 GMT but Sukhbaatar Aimag is SUHK +8.5 GMT.
-# The SUKH timezone is new this year, it is one of the few things the
-# parliament passed during the tumultuous winter session."
-# For now, let's ignore this information, until we have more confirmation.
-
-# From Ganbold Ts. (2007-02-26):
-# Parliament of Mongolia has just changed the daylight-saving rule in February.
-# They decided not to adopt daylight-saving time....
-# http://www.mongolnews.mn/index.php?module=unuudur&sec=view&id=15742
-
-# From Deborah Goldsmith (2008-03-30):
-# We received a bug report claiming that the tz database UTC offset for
-# Asia/Choibalsan (GMT+09:00) is incorrect, and that it should be GMT
-# +08:00 instead. Different sources appear to disagree with the tz
-# database on this, e.g.:
-#
-# <a href="http://www.timeanddate.com/worldclock/city.html?n=1026">
-# http://www.timeanddate.com/worldclock/city.html?n=1026
-# </a>
-# <a href="http://www.worldtimeserver.com/current_time_in_MN.aspx">
-# http://www.worldtimeserver.com/current_time_in_MN.aspx
-# </a>
-#
-# both say GMT+08:00.
-
-# From Steffen Thorsen (2008-03-31):
-# eznis airways, which operates several domestic flights, has a flight
-# schedule here:
-# <a href="http://www.eznis.com/Container.jsp?id=112">
-# http://www.eznis.com/Container.jsp?id=112
-# </a>
-# (click the English flag for English)
-#
-# There it appears that flights between Choibalsan and Ulaanbatar arrive
-# about 1:35 - 1:50 hours later in local clock time, no matter the
-# direction, while Ulaanbaatar-Khvod takes 2 hours in the Eastern
-# direction and 3:35 back, which indicates that Ulaanbatar and Khvod are
-# in different time zones (like we know about), while Choibalsan and
-# Ulaanbatar are in the same time zone (correction needed).
-
-# From Arthur David Olson (2008-05-19):
-# Assume that Choibalsan is indeed offset by 8:00.
-# XXX--in the absence of better information, assume that transition
-# was at the start of 2008-03-31 (the day of Steffen Thorsen's report);
-# this is almost surely wrong.
-
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Mongol	1983	1984	-	Apr	1	0:00	1:00	S
-Rule	Mongol	1983	only	-	Oct	1	0:00	0	-
-# Shanks & Pottenger and IATA SSIM say 1990s switches occurred at 00:00,
-# but McDow says the 2001 switches occurred at 02:00.  Also, IATA SSIM
-# (1996-09) says 1996-10-25.  Go with Shanks & Pottenger through 1998.
-#
-# Shanks & Pottenger say that the Sept. 1984 through Sept. 1990 switches
-# in Choibalsan (more precisely, in Dornod and Sukhbaatar) took place
-# at 02:00 standard time, not at 00:00 local time as in the rest of
-# the country.  That would be odd, and possibly is a result of their
-# correction of 02:00 (in the previous edition) not being done correctly
-# in the latest edition; so ignore it for now.
-
-Rule	Mongol	1985	1998	-	Mar	lastSun	0:00	1:00	S
-Rule	Mongol	1984	1998	-	Sep	lastSun	0:00	0	-
-# IATA SSIM (1999-09) says Mongolia no longer observes DST.
-Rule	Mongol	2001	only	-	Apr	lastSat	2:00	1:00	S
-Rule	Mongol	2001	2006	-	Sep	lastSat	2:00	0	-
-Rule	Mongol	2002	2006	-	Mar	lastSat	2:00	1:00	S
-
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-# Hovd, a.k.a. Chovd, Dund-Us, Dzhargalant, Khovd, Jirgalanta
-Zone	Asia/Hovd	6:06:36 -	LMT	1905 Aug
-			6:00	-	HOVT	1978	# Hovd Time
-			7:00	Mongol	HOV%sT
-# Ulaanbaatar, a.k.a. Ulan Bataar, Ulan Bator, Urga
-Zone	Asia/Ulaanbaatar 7:07:32 -	LMT	1905 Aug
-			7:00	-	ULAT	1978	# Ulaanbaatar Time
-			8:00	Mongol	ULA%sT
-# Choibalsan, a.k.a. Bajan Tuemen, Bajan Tumen, Chojbalsan,
-# Choybalsan, Sanbejse, Tchoibalsan
-Zone	Asia/Choibalsan	7:38:00 -	LMT	1905 Aug
-			7:00	-	ULAT	1978
-			8:00	-	ULAT	1983 Apr
-			9:00	Mongol	CHO%sT	2008 Mar 31 # Choibalsan Time
-			8:00	Mongol	CHO%sT
-
-# Nepal
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Asia/Kathmandu	5:41:16 -	LMT	1920
-			5:30	-	IST	1986
-			5:45	-	NPT	# Nepal Time
-
-# Oman
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Asia/Muscat	3:54:20 -	LMT	1920
-			4:00	-	GST
-
-# Pakistan
-
-# From Rives McDow (2002-03-13):
-# I have been advised that Pakistan has decided to adopt dst on a
-# TRIAL basis for one year, starting 00:01 local time on April 7, 2002
-# and ending at 00:01 local time October 6, 2002.  This is what I was
-# told, but I believe that the actual time of change may be 00:00; the
-# 00:01 was to make it clear which day it was on.
-
-# From Paul Eggert (2002-03-15):
-# Jesper Norgaard found this URL:
-# http://www.pak.gov.pk/public/news/app/app06_dec.htm
-# (dated 2001-12-06) which says that the Cabinet adopted a scheme "to
-# advance the clocks by one hour on the night between the first
-# Saturday and Sunday of April and revert to the original position on
-# 15th October each year".  This agrees with McDow's 04-07 at 00:00,
-# but disagrees about the October transition, and makes it sound like
-# it's not on a trial basis.  Also, the "between the first Saturday
-# and Sunday of April" phrase, if taken literally, means that the
-# transition takes place at 00:00 on the first Sunday on or after 04-02.
-
-# From Paul Eggert (2003-02-09):
-# DAWN <http://www.dawn.com/2002/10/06/top13.htm> reported on 2002-10-05
-# that 2002 DST ended that day at midnight.  Go with McDow for now.
-
-# From Steffen Thorsen (2003-03-14):
-# According to http://www.dawn.com/2003/03/07/top15.htm
-# there will be no DST in Pakistan this year:
-#
-# ISLAMABAD, March 6: Information and Media Development Minister Sheikh
-# Rashid Ahmed on Thursday said the cabinet had reversed a previous
-# decision to advance clocks by one hour in summer and put them back by
-# one hour in winter with the aim of saving light hours and energy.
-#
-# The minister told a news conference that the experiment had rather
-# shown 8 per cent higher consumption of electricity.
-
-# From Alex Krivenyshev (2008-05-15):
-# 
-# Here is an article that Pakistan plan to introduce Daylight Saving Time 
-# on June 1, 2008 for 3 months.
-# 
-# "... The federal cabinet on Wednesday announced a new conservation plan to help 
-# reduce load shedding by approving the closure of commercial centres at 9pm and 
-# moving clocks forward by one hour for the next three months. 
-# ...."
-# 
-# <a href="http://www.worldtimezone.net/dst_news/dst_news_pakistan01.html">
-# http://www.worldtimezone.net/dst_news/dst_news_pakistan01.html
-# </a>
-# OR
-# <a href="http://www.dailytimes.com.pk/default.asp?page=2008%5C05%5C15%5Cstory_15-5-2008_pg1_4">
-# http://www.dailytimes.com.pk/default.asp?page=2008%5C05%5C15%5Cstory_15-5-2008_pg1_4
-# </a>
-
-# From Arthur David Olson (2008-05-19):
-# XXX--midnight transitions is a guess; 2008 only is a guess.
-
-# From Alexander Krivenyshev (2008-08-28):
-# Pakistan government has decided to keep the watches one-hour advanced
-# for another 2 months--plan to return to Standard Time on October 31
-# instead of August 31.
-#
-# <a href="http://www.worldtimezone.com/dst_news/dst_news_pakistan02.html">
-# http://www.worldtimezone.com/dst_news/dst_news_pakistan02.html
-# </a>
-# OR
-# <a href="http://dailymailnews.com/200808/28/news/dmbrn03.html">
-# http://dailymailnews.com/200808/28/news/dmbrn03.html
-# </a>
-
-# From Alexander Krivenyshev (2009-04-08):
-# Based on previous media reports that "... proposed plan to
-# advance clocks by one hour from May 1 will cause disturbance
-# to the working schedules rather than bringing discipline in
-# official working."
-# <a href="http://www.thenews.com.pk/daily_detail.asp?id=171280">
-# http://www.thenews.com.pk/daily_detail.asp?id=171280
-# </a>
-#
-# recent news that instead of May 2009 - Pakistan plan to
-# introduce DST from April 15, 2009
-#
-# FYI: Associated Press Of Pakistan
-# April 08, 2009
-# Cabinet okays proposal to advance clocks by one hour from April 15
-# <a href="http://www.app.com.pk/en_/index.php?option=com_content&task=view&id=73043&Itemid=1">
-# http://www.app.com.pk/en_/index.php?option=com_content&task=view&id=73043&Itemid=1
-# </a>
-#
-# or
-#
-# <a href="http://www.worldtimezone.com/dst_news/dst_news_pakistan05.html">
-# http://www.worldtimezone.com/dst_news/dst_news_pakistan05.html
-# </a>
-#
-# ....
-# The Federal Cabinet on Wednesday approved the proposal to
-# advance clocks in the country by one hour from April 15 to
-# conserve energy"
-
-# From Steffen Thorsen (2009-09-17):
-# "The News International," Pakistan reports that: "The Federal
-# Government has decided to restore the previous time by moving the
-# clocks backward by one hour from October 1. A formal announcement to
-# this effect will be made after the Prime Minister grants approval in
-# this regard." 
-# <a href="http://www.thenews.com.pk/updates.asp?id=87168">
-# http://www.thenews.com.pk/updates.asp?id=87168
-# </a>
-
-# From Alexander Krivenyshev (2009-09-28):
-# According to Associated Press Of Pakistan, it is confirmed that
-# Pakistan clocks across the country would be turned back by an hour from October
-# 1, 2009.
-#
-# "Clocks to go back one hour from 1 Oct"
-# <a href="http://www.app.com.pk/en_/index.php?option=com_content&task=view&id=86715&Itemid=2">
-# http://www.app.com.pk/en_/index.php?option=com_content&task=view&id=86715&Itemid=2
-# </a>
-# or
-# <a href="http://www.worldtimezone.com/dst_news/dst_news_pakistan07.htm">
-# http://www.worldtimezone.com/dst_news/dst_news_pakistan07.htm
-# </a>
-
-# From Steffen Thorsen (2009-09-29):
-# Alexander Krivenyshev wrote:
-# > According to Associated Press Of Pakistan, it is confirmed that
-# > Pakistan clocks across the country would be turned back by an hour from October
-# > 1, 2009.
-#
-# Now they seem to have changed their mind, November 1 is the new date:
-# <a href="http://www.thenews.com.pk/top_story_detail.asp?Id=24742">
-# http://www.thenews.com.pk/top_story_detail.asp?Id=24742
-# </a>
-# "The country's clocks will be reversed by one hour on November 1.
-# Officials of Federal Ministry for Interior told this to Geo News on
-# Monday."
-#
-# And more importantly, it seems that these dates will be kept every year:
-# "It has now been decided that clocks will be wound forward by one hour
-# on April 15 and reversed by an hour on November 1 every year without
-# obtaining prior approval, the officials added."
-#
-# We have confirmed this year's end date with both with the Ministry of
-# Water and Power and the Pakistan Electric Power Company:
-# <a href="http://www.timeanddate.com/news/time/pakistan-ends-dst09.html">
-# http://www.timeanddate.com/news/time/pakistan-ends-dst09.html
-# </a>
-
-# From Christoph Goehre (2009-10-01):
-# [T]he German Consulate General in Karachi reported me today that Pakistan
-# will go back to standard time on 1st of November.
-
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule Pakistan	2002	only	-	Apr	Sun>=2	0:01	1:00	S
-Rule Pakistan	2002	only	-	Oct	Sun>=2	0:01	0	-
-Rule Pakistan	2008	only	-	Jun	1	0:00	1:00	S
-Rule Pakistan	2008	only	-	Nov	1	0:00	0	-
-Rule Pakistan	2009	max	-	Apr	15	0:00	1:00	S
-Rule Pakistan	2009	max	-	Nov	1	0:00	0	-
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Asia/Karachi	4:28:12 -	LMT	1907
-			5:30	-	IST	1942 Sep
-			5:30	1:00	IST	1945 Oct 15
-			5:30	-	IST	1951 Sep 30
-			5:00	-	KART	1971 Mar 26 # Karachi Time
-			5:00 Pakistan	PK%sT	# Pakistan Time
-
-# Palestine
-
-# From Amos Shapir (1998-02-15):
-#
-# From 1917 until 1948-05-15, all of Palestine, including the parts now
-# known as the Gaza Strip and the West Bank, was under British rule.
-# Therefore the rules given for Israel for that period, apply there too...
-#
-# The Gaza Strip was under Egyptian rule between 1948-05-15 until 1967-06-05
-# (except a short occupation by Israel from 1956-11 till 1957-03, but no
-# time zone was affected then).  It was never formally annexed to Egypt,
-# though.
-#
-# The rest of Palestine was under Jordanian rule at that time, formally
-# annexed in 1950 as the West Bank (and the word "Trans" was dropped from
-# the country's previous name of "the Hashemite Kingdom of the
-# Trans-Jordan").  So the rules for Jordan for that time apply.  Major
-# towns in that area are Nablus (Shchem), El-Halil (Hebron), Ramallah, and
-# East Jerusalem.
-#
-# Both areas were occupied by Israel in June 1967, but not annexed (except
-# for East Jerusalem).  They were on Israel time since then; there might
-# have been a Military Governor's order about time zones, but I'm not aware
-# of any (such orders may have been issued semi-annually whenever summer
-# time was in effect, but maybe the legal aspect of time was just neglected).
-#
-# The Palestinian Authority was established in 1993, and got hold of most
-# towns in the West Bank and Gaza by 1995.  I know that in order to
-# demonstrate...independence, they have been switching to
-# summer time and back on a different schedule than Israel's, but I don't
-# know when this was started, or what algorithm is used (most likely the
-# Jordanian one).
-#
-# To summarize, the table should probably look something like that:
-#
-# Area \ when | 1918-1947 | 1948-1967 | 1967-1995 | 1996-
-# ------------+-----------+-----------+-----------+-----------
-# Israel      | Zion      | Zion      | Zion      | Zion
-# West bank   | Zion      | Jordan    | Zion      | Jordan
-# Gaza        | Zion      | Egypt     | Zion      | Jordan
-#
-# I guess more info may be available from the PA's web page (if/when they
-# have one).
-
-# From Paul Eggert (2006-03-22):
-# Shanks & Pottenger write that Gaza did not observe DST until 1957, but go
-# with Shapir and assume that it observed DST from 1940 through 1947,
-# and that it used Jordanian rules starting in 1996.
-# We don't yet need a separate entry for the West Bank, since
-# the only differences between it and Gaza that we know about
-# occurred before our cutoff date of 1970.
-# However, as we get more information, we may need to add entries
-# for parts of the West Bank as they transitioned from Israel's rules
-# to Palestine's rules.  If you have more info about this, please
-# send it to tz@elsie.nci.nih.gov for incorporation into future editions.
-
-# From IINS News Service - Israel - 1998-03-23 10:38:07 Israel time,
-# forwarded by Ephraim Silverberg:
-#
-# Despite the fact that Israel changed over to daylight savings time
-# last week, the PLO Authority (PA) has decided not to turn its clocks
-# one-hour forward at this time.  As a sign of independence from Israeli rule,
-# the PA has decided to implement DST in April.
-
-# From Paul Eggert (1999-09-20):
-# Daoud Kuttab writes in
-# <a href="http://www.jpost.com/com/Archive/22.Apr.1999/Opinion/Article-2.html">
-# Holiday havoc
-# </a> (Jerusalem Post, 1999-04-22) that
-# the Palestinian National Authority changed to DST on 1999-04-15.
-# I vaguely recall that they switch back in October (sorry, forgot the source).
-# For now, let's assume that the spring switch was at 24:00,
-# and that they switch at 0:00 on the 3rd Fridays of April and October.
-
-# From Paul Eggert (2005-11-22):
-# Starting 2004 transitions are from Steffen Thorsen's web site timeanddate.com.
-
-# From Steffen Thorsen (2005-11-23):
-# A user from Gaza reported that Gaza made the change early because of
-# the Ramadan.  Next year Ramadan will be even earlier, so I think
-# there is a good chance next year's end date will be around two weeks
-# earlier--the same goes for Jordan.
-
-# From Steffen Thorsen (2006-08-17):
-# I was informed by a user in Bethlehem that in Bethlehem it started the
-# same day as Israel, and after checking with other users in the area, I
-# was informed that they started DST one day after Israel.  I was not
-# able to find any authoritative sources at the time, nor details if
-# Gaza changed as well, but presumed Gaza to follow the same rules as
-# the West Bank.
-
-# From Steffen Thorsen (2006-09-26):
-# according to the Palestine News Network (2006-09-19):
-# http://english.pnn.ps/index.php?option=com_content&task=view&id=596&Itemid=5
-# > The Council of Ministers announced that this year its winter schedule
-# > will begin early, as of midnight Thursday.  It is also time to turn
-# > back the clocks for winter.  Friday will begin an hour late this week.
-# I guess it is likely that next year's date will be moved as well,
-# because of the Ramadan.
-
-# From Jesper Norgaard Welen (2007-09-18):
-# According to Steffen Thorsen's web site the Gaza Strip and the rest of the
-# Palestinian territories left DST early on 13.th. of September at 2:00.
-
-# From Paul Eggert (2007-09-20):
-# My understanding is that Gaza and the West Bank disagree even over when
-# the weekend is (Thursday+Friday versus Friday+Saturday), so I'd be a bit
-# surprised if they agreed about DST.  But for now, assume they agree.
-# For lack of better information, predict that future changes will be
-# the 2nd Thursday of September at 02:00.
-
-# From Alexander Krivenyshev (2008-08-28):
-# Here is an article, that Mideast running on different clocks at Ramadan.
-#
-# Gaza Strip (as Egypt) ended DST at midnight Thursday (Aug 28, 2008), while
-# the West Bank will end Daylight Saving Time at midnight Sunday (Aug 31, 2008).
-#
-# <a href="http://www.guardian.co.uk/world/feedarticle/7759001">
-# http://www.guardian.co.uk/world/feedarticle/7759001
-# </a>
-# <a href="http://www.abcnews.go.com/International/wireStory?id=5676087">
-# http://www.abcnews.go.com/International/wireStory?id=5676087
-# </a>
-# or
-# <a href="http://www.worldtimezone.com/dst_news/dst_news_gazastrip01.html">
-# http://www.worldtimezone.com/dst_news/dst_news_gazastrip01.html
-# </a>
-
-# From Alexander Krivenyshev (2009-03-26):
-# According to the Palestine News Network (arabic.pnn.ps), Palestinian
-# government decided to start Daylight Time on Thursday night March
-# 26 and continue until the night of 27 September 2009.
-#
-# (in Arabic)
-# <a href="http://arabic.pnn.ps/index.php?option=com_content&task=view&id=50850">
-# http://arabic.pnn.ps/index.php?option=com_content&task=view&id=50850
-# </a>
-#
-# or
-# (English translation)
-# <a href="http://www.worldtimezone.com/dst_news/dst_news_westbank01.html">
-# http://www.worldtimezone.com/dst_news/dst_news_westbank01.html
-# </a>
-
-# From Steffen Thorsen (2009-08-31):
-# Palestine's Council of Ministers announced that they will revert back to
-# winter time on Friday, 2009-09-04.
-#
-# One news source:
-# <a href="http://www.safa.ps/ara/?action=showdetail&seid=4158">
-# http://www.safa.ps/ara/?action=showdetail&seid=4158
-# </a>
-# (Palestinian press agency, Arabic),
-# Google translate: "Decided that the Palestinian government in Ramallah
-# headed by Salam Fayyad, the start of work in time for the winter of
-# 2009, starting on Friday approved the fourth delay Sept. clock sixty
-# minutes per hour as of Friday morning."
-#
-# We are not sure if Gaza will do the same, last year they had a different
-# end date, we will keep this page updated:
-# <a href="http://www.timeanddate.com/news/time/westbank-gaza-dst-2009.html">
-# http://www.timeanddate.com/news/time/westbank-gaza-dst-2009.html
-# </a>
-
-# From Alexander Krivenyshev (2009-09-02):
-# Seems that Gaza Strip will go back to Winter Time same date as West Bank.
-#
-# According to Palestinian Ministry Of Interior, West Bank and Gaza Strip plan
-# to change time back to Standard time on September 4, 2009.
-#
-# "Winter time unite the West Bank and Gaza"
-# (from Palestinian National Authority):
-# <a href="http://www.moi.gov.ps/en/?page=633167343250594025&nid=11505
-# http://www.moi.gov.ps/en/?page=633167343250594025&nid=11505
-# </a>
-# or
-# <a href="http://www.worldtimezone.com/dst_news/dst_news_gazastrip02.html>
-# http://www.worldtimezone.com/dst_news/dst_news_gazastrip02.html
-# </a>
-
-# The rules for Egypt are stolen from the `africa' file.
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule EgyptAsia	1957	only	-	May	10	0:00	1:00	S
-Rule EgyptAsia	1957	1958	-	Oct	 1	0:00	0	-
-Rule EgyptAsia	1958	only	-	May	 1	0:00	1:00	S
-Rule EgyptAsia	1959	1967	-	May	 1	1:00	1:00	S
-Rule EgyptAsia	1959	1965	-	Sep	30	3:00	0	-
-Rule EgyptAsia	1966	only	-	Oct	 1	3:00	0	-
-
-Rule Palestine	1999	2005	-	Apr	Fri>=15	0:00	1:00	S
-Rule Palestine	1999	2003	-	Oct	Fri>=15	0:00	0	-
-Rule Palestine	2004	only	-	Oct	 1	1:00	0	-
-Rule Palestine	2005	only	-	Oct	 4	2:00	0	-
-Rule Palestine	2006	2008	-	Apr	 1	0:00	1:00	S
-Rule Palestine	2006	only	-	Sep	22	0:00	0	-
-Rule Palestine	2007	only	-	Sep	Thu>=8	2:00	0	-
-Rule Palestine	2008	only	-	Aug	lastFri	2:00	0	-
-Rule Palestine	2009	max	-	Mar	lastFri	0:00	1:00	S
-Rule Palestine	2009	max	-	Sep	Fri>=1	2:00	0	-
-
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Asia/Gaza	2:17:52	-	LMT	1900 Oct
-			2:00	Zion	EET	1948 May 15
-			2:00 EgyptAsia	EE%sT	1967 Jun  5
-			2:00	Zion	I%sT	1996
-			2:00	Jordan	EE%sT	1999
-			2:00 Palestine	EE%sT
-
-# Paracel Is
-# no information
-
-# Philippines
-# On 1844-08-16, Narciso Claveria, governor-general of the
-# Philippines, issued a proclamation announcing that 1844-12-30 was to
-# be immediately followed by 1845-01-01.  Robert H. van Gent has a
-# transcript of the decree in <http://www.phys.uu.nl/~vgent/idl/idl.htm>.
-# The rest of the data are from Shanks & Pottenger.
-
-# From Paul Eggert (2006-04-25):
-# Tomorrow's Manila Standard reports that the Philippines Department of
-# Trade and Industry is considering adopting DST this June when the
-# rainy season begins.  See
-# <http://www.manilastandardtoday.com/?page=politics02_april26_2006>.
-# For now, we'll ignore this, since it's not definite and we lack details.
-#
-# From Jesper Norgaard Welen (2006-04-26):
-# ... claims that Philippines had DST last time in 1990:
-# http://story.philippinetimes.com/p.x/ct/9/id/145be20cc6b121c0/cid/3e5bbccc730d258c/
-# [a story dated 2006-04-25 by Cris Larano of Dow Jones Newswires,
-# but no details]
-
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Phil	1936	only	-	Nov	1	0:00	1:00	S
-Rule	Phil	1937	only	-	Feb	1	0:00	0	-
-Rule	Phil	1954	only	-	Apr	12	0:00	1:00	S
-Rule	Phil	1954	only	-	Jul	1	0:00	0	-
-Rule	Phil	1978	only	-	Mar	22	0:00	1:00	S
-Rule	Phil	1978	only	-	Sep	21	0:00	0	-
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Asia/Manila	-15:56:00 -	LMT	1844 Dec 31
-			8:04:00 -	LMT	1899 May 11
-			8:00	Phil	PH%sT	1942 May
-			9:00	-	JST	1944 Nov
-			8:00	Phil	PH%sT
-
-# Qatar
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Asia/Qatar	3:26:08 -	LMT	1920	# Al Dawhah / Doha
-			4:00	-	GST	1972 Jun
-			3:00	-	AST
-
-# Saudi Arabia
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Asia/Riyadh	3:06:52 -	LMT	1950
-			3:00	-	AST
-
-# Singapore
-# The data here are taken from Mok Ly Yng (2003-10-30)
-# <http://www.math.nus.edu.sg/aslaksen/teaching/timezone.html>.
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Asia/Singapore	6:55:25 -	LMT	1901 Jan  1
-			6:55:25	-	SMT	1905 Jun  1 # Singapore M.T.
-			7:00	-	MALT	1933 Jan  1 # Malaya Time
-			7:00	0:20	MALST	1936 Jan  1
-			7:20	-	MALT	1941 Sep  1
-			7:30	-	MALT	1942 Feb 16
-			9:00	-	JST	1945 Sep 12
-			7:30	-	MALT	1965 Aug  9 # independence
-			7:30	-	SGT	1982 Jan  1 # Singapore Time
-			8:00	-	SGT
-
-# Spratly Is
-# no information
-
-# Sri Lanka
-# From Paul Eggert (1996-09-03):
-# "Sri Lanka advances clock by an hour to avoid blackout"
-# (www.virtual-pc.com/lankaweb/news/items/240596-2.html, 1996-05-24,
-# no longer available as of 1999-08-17)
-# reported ``the country's standard time will be put forward by one hour at
-# midnight Friday (1830 GMT) `in the light of the present power crisis'.''
-#
-# From Dharmasiri Senanayake, Sri Lanka Media Minister (1996-10-24), as quoted
-# by Shamindra in
-# <a href="news:54rka5$m5h@mtinsc01-mgt.ops.worldnet.att.net">
-# Daily News - Hot News Section (1996-10-26)
-# </a>:
-# With effect from 12.30 a.m. on 26th October 1996
-# Sri Lanka will be six (06) hours ahead of GMT.
-
-# From Jesper Norgaard Welen (2006-04-14), quoting Sri Lanka News Online
-# <http://news.sinhalaya.com/wmview.php?ArtID=11002> (2006-04-13):
-# 0030 hrs on April 15, 2006 (midnight of April 14, 2006 +30 minutes)
-# at present, become 2400 hours of April 14, 2006 (midnight of April 14, 2006).
-
-# From Peter Apps and Ranga Sirila of Reuters (2006-04-12) in:
-# <http://today.reuters.co.uk/news/newsArticle.aspx?type=scienceNews&storyID=2006-04-12T172228Z_01_COL295762_RTRIDST_0_SCIENCE-SRILANKA-TIME-DC.XML>
-# [The Tamil Tigers] never accepted the original 1996 time change and simply
-# kept their clocks set five and a half hours ahead of Greenwich Mean
-# Time (GMT), in line with neighbor India.
-# From Paul Eggert (2006-04-18):
-# People who live in regions under Tamil control can use [TZ='Asia/Kolkata'],
-# as that zone has agreed with the Tamil areas since our cutoff date of 1970.
-
-# From K Sethu (2006-04-25):
-# I think the abbreviation LKT originated from the world of computers at
-# the time of or subsequent to the time zone changes by SL Government
-# twice in 1996 and probably SL Government or its standardization
-# agencies never declared an abbreviation as a national standard.
-#
-# I recollect before the recent change the government annoucemments
-# mentioning it as simply changing Sri Lanka Standard Time or Sri Lanka
-# Time and no mention was made about the abbreviation.
-#
-# If we look at Sri Lanka Department of Government's "Official News
-# Website of Sri Lanka" ... http://www.news.lk/ we can see that they
-# use SLT as abbreviation in time stamp at the beginning of each news
-# item....
-#
-# Within Sri Lanka I think LKT is well known among computer users and
-# adminsitrators.  In my opinion SLT may not be a good choice because the
-# nation's largest telcom / internet operator Sri Lanka Telcom is well
-# known by that abbreviation - simply as SLT (there IP domains are
-# slt.lk and sltnet.lk).
-#
-# But if indeed our government has adopted SLT as standard abbreviation
-# (that we have not known so far) then  it is better that it be used for
-# all computers.
-
-# From Paul Eggert (2006-04-25):
-# One possibility is that we wait for a bit for the dust to settle down
-# and then see what people actually say in practice.
-
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Asia/Colombo	5:19:24 -	LMT	1880
-			5:19:32	-	MMT	1906	# Moratuwa Mean Time
-			5:30	-	IST	1942 Jan  5
-			5:30	0:30	IHST	1942 Sep
-			5:30	1:00	IST	1945 Oct 16 2:00
-			5:30	-	IST	1996 May 25 0:00
-			6:30	-	LKT	1996 Oct 26 0:30
-			6:00	-	LKT	2006 Apr 15 0:30
-			5:30	-	IST
-
-# Syria
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Syria	1920	1923	-	Apr	Sun>=15	2:00	1:00	S
-Rule	Syria	1920	1923	-	Oct	Sun>=1	2:00	0	-
-Rule	Syria	1962	only	-	Apr	29	2:00	1:00	S
-Rule	Syria	1962	only	-	Oct	1	2:00	0	-
-Rule	Syria	1963	1965	-	May	1	2:00	1:00	S
-Rule	Syria	1963	only	-	Sep	30	2:00	0	-
-Rule	Syria	1964	only	-	Oct	1	2:00	0	-
-Rule	Syria	1965	only	-	Sep	30	2:00	0	-
-Rule	Syria	1966	only	-	Apr	24	2:00	1:00	S
-Rule	Syria	1966	1976	-	Oct	1	2:00	0	-
-Rule	Syria	1967	1978	-	May	1	2:00	1:00	S
-Rule	Syria	1977	1978	-	Sep	1	2:00	0	-
-Rule	Syria	1983	1984	-	Apr	9	2:00	1:00	S
-Rule	Syria	1983	1984	-	Oct	1	2:00	0	-
-Rule	Syria	1986	only	-	Feb	16	2:00	1:00	S
-Rule	Syria	1986	only	-	Oct	9	2:00	0	-
-Rule	Syria	1987	only	-	Mar	1	2:00	1:00	S
-Rule	Syria	1987	1988	-	Oct	31	2:00	0	-
-Rule	Syria	1988	only	-	Mar	15	2:00	1:00	S
-Rule	Syria	1989	only	-	Mar	31	2:00	1:00	S
-Rule	Syria	1989	only	-	Oct	1	2:00	0	-
-Rule	Syria	1990	only	-	Apr	1	2:00	1:00	S
-Rule	Syria	1990	only	-	Sep	30	2:00	0	-
-Rule	Syria	1991	only	-	Apr	 1	0:00	1:00	S
-Rule	Syria	1991	1992	-	Oct	 1	0:00	0	-
-Rule	Syria	1992	only	-	Apr	 8	0:00	1:00	S
-Rule	Syria	1993	only	-	Mar	26	0:00	1:00	S
-Rule	Syria	1993	only	-	Sep	25	0:00	0	-
-# IATA SSIM (1998-02) says 1998-04-02;
-# (1998-09) says 1999-03-29 and 1999-09-29; (1999-02) says 1999-04-02,
-# 2000-04-02, and 2001-04-02; (1999-09) says 2000-03-31 and 2001-03-31;
-# (2006) says 2006-03-31 and 2006-09-22;
-# for now ignore all these claims and go with Shanks & Pottenger,
-# except for the 2006-09-22 claim (which seems right for Ramadan).
-Rule	Syria	1994	1996	-	Apr	 1	0:00	1:00	S
-Rule	Syria	1994	2005	-	Oct	 1	0:00	0	-
-Rule	Syria	1997	1998	-	Mar	lastMon	0:00	1:00	S
-Rule	Syria	1999	2006	-	Apr	 1	0:00	1:00	S
-# From Stephen Colebourne (2006-09-18):
-# According to IATA data, Syria will change DST on 21st September [21:00 UTC]
-# this year [only]....  This is probably related to Ramadan, like Egypt.
-Rule	Syria	2006	only	-	Sep	22	0:00	0	-
-# From Paul Eggert (2007-03-29):
-# Today the AP reported "Syria will switch to summertime at midnight Thursday."
-# http://www.iht.com/articles/ap/2007/03/29/africa/ME-GEN-Syria-Time-Change.php
-Rule	Syria	2007	only	-	Mar	lastFri	0:00	1:00	S
-# From Jesper Norgard (2007-10-27):
-# The sister center ICARDA of my work CIMMYT is confirming that Syria DST will
-# not take place 1.st November at 0:00 o'clock but 1.st November at 24:00 or
-# rather Midnight between Thursday and Friday. This does make more sence than
-# having it between Wednesday and Thursday (two workdays in Syria) since the
-# weekend in Syria is not Saturday and Sunday, but Friday and Saturday. So now
-# it is implemented at midnight of the last workday before weekend...
-# 
-# From Steffen Thorsen (2007-10-27):
-# Jesper Norgaard Welen wrote:
-# 
-# > "Winter local time in Syria will be observed at midnight of Thursday 1
-# > November 2007, and the clock will be put back 1 hour."
-# 
-# I found confirmation on this in this gov.sy-article (Arabic):
-# http://wehda.alwehda.gov.sy/_print_veiw.asp?FileName=12521710520070926111247
-# 
-# which using Google's translate tools says:
-# Council of Ministers also approved the commencement of work on 
-# identifying the winter time as of Friday, 2/11/2007 where the 60th 
-# minute delay at midnight Thursday 1/11/2007.
-Rule	Syria	2007	only	-	Nov	 Fri>=1	0:00	0	-
-
-# From Stephen Colebourne (2008-03-17):
-# For everyone's info, I saw an IATA time zone change for [Syria] for
-# this month (March 2008) in the last day or so...This is the data IATA
-# are now using:
-# Country     Time Standard   --- DST Start ---   --- DST End ---  DST
-# Name        Zone Variation   Time    Date        Time    Date
-# Variation
-# Syrian Arab
-# Republic    SY    +0200      2200  03APR08       2100  30SEP08   +0300
-#                              2200  02APR09       2100  30SEP09   +0300
-#                              2200  01APR10       2100  30SEP10   +0300
-
-# From Arthur David Olson (2008-03-17):
-# Here's a link to English-language coverage by the Syrian Arab News
-# Agency (SANA)...
-# <a href="http://www.sana.sy/eng/21/2008/03/11/165173.htm">
-# http://www.sana.sy/eng/21/2008/03/11/165173.htm
-# </a>...which reads (in part) "The Cabinet approved the suggestion of the
-# Ministry of Electricity to begin daylight savings time on Friday April
-# 4th, advancing clocks one hour ahead on midnight of Thursday April 3rd."
-# Since Syria is two hours east of UTC, the 2200 and 2100 transition times
-# shown above match up with midnight in Syria.
-
-# From Arthur David Olson (2008-03-18):
-# My buest guess at a Syrian rule is "the Friday nearest April 1";
-# coding that involves either using a "Mar Fri>=29" construct that old time zone
-# compilers can't handle  or having multiple Rules (a la Israel).
-# For now, use "Apr Fri>=1", and go with IATA on a uniform Sep 30 end.
-
-# From Steffen Thorsen (2008-10-07):
-# Syria has now officially decided to end DST on 2008-11-01 this year,
-# according to the following article in the Syrian Arab News Agency (SANA).
-#
-# The article is in Arabic, and seems to tell that they will go back to
-# winter time on 2008-11-01 at 00:00 local daylight time (delaying/setting
-# clocks back 60 minutes).
-#
-# <a href="http://sana.sy/ara/2/2008/10/07/195459.htm">
-# http://sana.sy/ara/2/2008/10/07/195459.htm
-# </a>
-
-# From Steffen Thorsen (2009-03-19):
-# Syria will start DST on 2009-03-27 00:00 this year according to many sources,
-# two examples:
-#
-# <a href="http://www.sana.sy/eng/21/2009/03/17/217563.htm">
-# http://www.sana.sy/eng/21/2009/03/17/217563.htm
-# </a>
-# (English, Syrian Arab News # Agency)
-# <a href="http://thawra.alwehda.gov.sy/_View_news2.asp?FileName=94459258720090318012209">
-# http://thawra.alwehda.gov.sy/_View_news2.asp?FileName=94459258720090318012209
-# </a>
-# (Arabic, gov-site)
-#
-# We have not found any sources saying anything about when DST ends this year.
-#
-# Our summary
-# <a href="http://www.timeanddate.com/news/time/syria-dst-starts-march-27-2009.html">
-# http://www.timeanddate.com/news/time/syria-dst-starts-march-27-2009.html
-# </a>
-
-# From Steffen Thorsen (2009-10-27):
-# The Syrian Arab News Network on 2009-09-29 reported that Syria will 
-# revert back to winter (standard) time on midnight between Thursday 
-# 2009-10-29 and Friday 2009-10-30:
-# <a href="http://www.sana.sy/ara/2/2009/09/29/247012.htm">
-# http://www.sana.sy/ara/2/2009/09/29/247012.htm (Arabic)
-# </a>
-
-# From Arthur David Olson (2009-10-28):
-# We'll see if future DST switching times turn out to be end of the last
-# Thursday of the month or the start of the last Friday of the month or
-# something else. For now, use the start of the last Friday.
-
-Rule	Syria	2008	only	-	Apr	Fri>=1	0:00	1:00	S
-Rule	Syria	2008	only	-	Nov	1	0:00	0	-
-Rule	Syria	2009	max	-	Mar	lastFri	0:00	1:00	S
-Rule	Syria	2009	max	-	Oct	lastFri	0:00	0	-
-
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Asia/Damascus	2:25:12 -	LMT	1920	# Dimashq
-			2:00	Syria	EE%sT
-
-# Tajikistan
-# From Shanks & Pottenger.
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Asia/Dushanbe	4:35:12 -	LMT	1924 May  2
-			5:00	-	DUST	1930 Jun 21 # Dushanbe Time
-			6:00 RussiaAsia DUS%sT	1991 Mar 31 2:00s
-			5:00	1:00	DUSST	1991 Sep  9 2:00s
-			5:00	-	TJT		    # Tajikistan Time
-
-# Thailand
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Asia/Bangkok	6:42:04	-	LMT	1880
-			6:42:04	-	BMT	1920 Apr # Bangkok Mean Time
-			7:00	-	ICT
-
-# Turkmenistan
-# From Shanks & Pottenger.
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Asia/Ashgabat	3:53:32 -	LMT	1924 May  2 # or Ashkhabad
-			4:00	-	ASHT	1930 Jun 21 # Ashkhabad Time
-			5:00 RussiaAsia	ASH%sT	1991 Mar 31 2:00
-			4:00 RussiaAsia	ASH%sT	1991 Oct 27 # independence
-			4:00 RussiaAsia	TM%sT	1992 Jan 19 2:00
-			5:00	-	TMT
-
-# United Arab Emirates
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Asia/Dubai	3:41:12 -	LMT	1920
-			4:00	-	GST
-
-# Uzbekistan
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Asia/Samarkand	4:27:12 -	LMT	1924 May  2
-			4:00	-	SAMT	1930 Jun 21 # Samarkand Time
-			5:00	-	SAMT	1981 Apr  1
-			5:00	1:00	SAMST	1981 Oct  1
-			6:00	-	TAST	1982 Apr  1 # Tashkent Time
-			5:00 RussiaAsia	SAM%sT	1991 Sep  1 # independence
-			5:00 RussiaAsia	UZ%sT	1992
-			5:00	-	UZT
-Zone	Asia/Tashkent	4:37:12 -	LMT	1924 May  2
-			5:00	-	TAST	1930 Jun 21 # Tashkent Time
-			6:00 RussiaAsia	TAS%sT	1991 Mar 31 2:00
-			5:00 RussiaAsia	TAS%sT	1991 Sep  1 # independence
-			5:00 RussiaAsia	UZ%sT	1992
-			5:00	-	UZT
-
-# Vietnam
-
-# From Arthur David Olson (2008-03-18):
-# The English-language name of Vietnam's most populous city is "Ho Chi Min City";
-# we use Ho_Chi_Minh below to avoid a name of more than 14 characters.
-
-# From Shanks & Pottenger:
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Asia/Ho_Chi_Minh	7:06:40 -	LMT	1906 Jun  9
-			7:06:20	-	SMT	1911 Mar 11 0:01 # Saigon MT?
-			7:00	-	ICT	1912 May
-			8:00	-	ICT	1931 May
-			7:00	-	ICT
-
-# Yemen
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Asia/Aden	3:00:48	-	LMT	1950
-			3:00	-	AST
diff --git a/tools/zoneinfo/tzdata2009s/australasia b/tools/zoneinfo/tzdata2009s/australasia
deleted file mode 100644
index 3812390..0000000
--- a/tools/zoneinfo/tzdata2009s/australasia
+++ /dev/null
@@ -1,1560 +0,0 @@
-# <pre>
-# @(#)australasia	8.15
-# This file is in the public domain, so clarified as of
-# 2009-05-17 by Arthur David Olson.
-
-# This file also includes Pacific islands.
-
-# Notes are at the end of this file
-
-###############################################################################
-
-# Australia
-
-# Please see the notes below for the controversy about "EST" versus "AEST" etc.
-
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Aus	1917	only	-	Jan	 1	0:01	1:00	-
-Rule	Aus	1917	only	-	Mar	25	2:00	0	-
-Rule	Aus	1942	only	-	Jan	 1	2:00	1:00	-
-Rule	Aus	1942	only	-	Mar	29	2:00	0	-
-Rule	Aus	1942	only	-	Sep	27	2:00	1:00	-
-Rule	Aus	1943	1944	-	Mar	lastSun	2:00	0	-
-Rule	Aus	1943	only	-	Oct	 3	2:00	1:00	-
-# Go with Whitman and the Australian National Standards Commission, which
-# says W Australia didn't use DST in 1943/1944.  Ignore Whitman's claim that
-# 1944/1945 was just like 1943/1944.
-
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-# Northern Territory
-Zone Australia/Darwin	 8:43:20 -	LMT	1895 Feb
-			 9:00	-	CST	1899 May
-			 9:30	Aus	CST
-# Western Australia
-#
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	AW	1974	only	-	Oct	lastSun	2:00s	1:00	-
-Rule	AW	1975	only	-	Mar	Sun>=1	2:00s	0	-
-Rule	AW	1983	only	-	Oct	lastSun	2:00s	1:00	-
-Rule	AW	1984	only	-	Mar	Sun>=1	2:00s	0	-
-Rule	AW	1991	only	-	Nov	17	2:00s	1:00	-
-Rule	AW	1992	only	-	Mar	Sun>=1	2:00s	0	-
-Rule	AW	2006	only	-	Dec	 3	2:00s	1:00	-
-Rule	AW	2007	2009	-	Mar	lastSun	2:00s	0	-
-Rule	AW	2007	2008	-	Oct	lastSun	2:00s	1:00	-
-Zone Australia/Perth	 7:43:24 -	LMT	1895 Dec
-			 8:00	Aus	WST	1943 Jul
-			 8:00	AW	WST
-Zone Australia/Eucla	 8:35:28 -	LMT	1895 Dec
-			 8:45	Aus	CWST	1943 Jul
-			 8:45	AW	CWST
-
-# Queensland
-#
-# From Alex Livingston (1996-11-01):
-# I have heard or read more than once that some resort islands off the coast
-# of Queensland chose to keep observing daylight-saving time even after
-# Queensland ceased to.
-#
-# From Paul Eggert (1996-11-22):
-# IATA SSIM (1993-02/1994-09) say that the Holiday Islands (Hayman, Lindeman,
-# Hamilton) observed DST for two years after the rest of Queensland stopped.
-# Hamilton is the largest, but there is also a Hamilton in Victoria,
-# so use Lindeman.
-#
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	AQ	1971	only	-	Oct	lastSun	2:00s	1:00	-
-Rule	AQ	1972	only	-	Feb	lastSun	2:00s	0	-
-Rule	AQ	1989	1991	-	Oct	lastSun	2:00s	1:00	-
-Rule	AQ	1990	1992	-	Mar	Sun>=1	2:00s	0	-
-Rule	Holiday	1992	1993	-	Oct	lastSun	2:00s	1:00	-
-Rule	Holiday	1993	1994	-	Mar	Sun>=1	2:00s	0	-
-Zone Australia/Brisbane	10:12:08 -	LMT	1895
-			10:00	Aus	EST	1971
-			10:00	AQ	EST
-Zone Australia/Lindeman  9:55:56 -	LMT	1895
-			10:00	Aus	EST	1971
-			10:00	AQ	EST	1992 Jul
-			10:00	Holiday	EST
-
-# South Australia
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	AS	1971	1985	-	Oct	lastSun	2:00s	1:00	-
-Rule	AS	1986	only	-	Oct	19	2:00s	1:00	-
-Rule	AS	1987	2007	-	Oct	lastSun	2:00s	1:00	-
-Rule	AS	1972	only	-	Feb	27	2:00s	0	-
-Rule	AS	1973	1985	-	Mar	Sun>=1	2:00s	0	-
-Rule	AS	1986	1989	-	Mar	Sun>=15	2:00s	0	-
-Rule	AS	1990	only	-	Mar	Sun>=18	2:00s	0	-
-Rule	AS	1991	only	-	Mar	Sun>=1	2:00s	0	-
-Rule	AS	1992	only	-	Mar	Sun>=18	2:00s	0	-
-Rule	AS	1993	only	-	Mar	Sun>=1	2:00s	0	-
-Rule	AS	1994	only	-	Mar	Sun>=18	2:00s	0	-
-Rule	AS	1995	2005	-	Mar	lastSun	2:00s	0	-
-Rule	AS	2006	only	-	Apr	Sun>=1	2:00s	0	-
-Rule	AS	2007	only	-	Mar	lastSun	2:00s	0	-
-Rule	AS	2008	max	-	Apr	Sun>=1	2:00s	0	-
-Rule	AS	2008	max	-	Oct	Sun>=1	2:00s	1:00	-
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone Australia/Adelaide	9:14:20 -	LMT	1895 Feb
-			9:00	-	CST	1899 May
-			9:30	Aus	CST	1971
-			9:30	AS	CST
-
-# Tasmania
-#
-# From Paul Eggert (2005-08-16):
-# <http://www.bom.gov.au/climate/averages/tables/dst_times.shtml>
-# says King Island didn't observe DST from WWII until late 1971.
-#
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	AT	1967	only	-	Oct	Sun>=1	2:00s	1:00	-
-Rule	AT	1968	only	-	Mar	lastSun	2:00s	0	-
-Rule	AT	1968	1985	-	Oct	lastSun	2:00s	1:00	-
-Rule	AT	1969	1971	-	Mar	Sun>=8	2:00s	0	-
-Rule	AT	1972	only	-	Feb	lastSun	2:00s	0	-
-Rule	AT	1973	1981	-	Mar	Sun>=1	2:00s	0	-
-Rule	AT	1982	1983	-	Mar	lastSun	2:00s	0	-
-Rule	AT	1984	1986	-	Mar	Sun>=1	2:00s	0	-
-Rule	AT	1986	only	-	Oct	Sun>=15	2:00s	1:00	-
-Rule	AT	1987	1990	-	Mar	Sun>=15	2:00s	0	-
-Rule	AT	1987	only	-	Oct	Sun>=22	2:00s	1:00	-
-Rule	AT	1988	1990	-	Oct	lastSun	2:00s	1:00	-
-Rule	AT	1991	1999	-	Oct	Sun>=1	2:00s	1:00	-
-Rule	AT	1991	2005	-	Mar	lastSun	2:00s	0	-
-Rule	AT	2000	only	-	Aug	lastSun	2:00s	1:00	-
-Rule	AT	2001	max	-	Oct	Sun>=1	2:00s	1:00	-
-Rule	AT	2006	only	-	Apr	Sun>=1	2:00s	0	-
-Rule	AT	2007	only	-	Mar	lastSun	2:00s	0	-
-Rule	AT	2008	max	-	Apr	Sun>=1	2:00s	0	-
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone Australia/Hobart	9:49:16	-	LMT	1895 Sep
-			10:00	-	EST	1916 Oct 1 2:00
-			10:00	1:00	EST	1917 Feb
-			10:00	Aus	EST	1967
-			10:00	AT	EST
-Zone Australia/Currie	9:35:28	-	LMT	1895 Sep
-			10:00	-	EST	1916 Oct 1 2:00
-			10:00	1:00	EST	1917 Feb
-			10:00	Aus	EST	1971 Jul
-			10:00	AT	EST
-
-# Victoria
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	AV	1971	1985	-	Oct	lastSun	2:00s	1:00	-
-Rule	AV	1972	only	-	Feb	lastSun	2:00s	0	-
-Rule	AV	1973	1985	-	Mar	Sun>=1	2:00s	0	-
-Rule	AV	1986	1990	-	Mar	Sun>=15	2:00s	0	-
-Rule	AV	1986	1987	-	Oct	Sun>=15	2:00s	1:00	-
-Rule	AV	1988	1999	-	Oct	lastSun	2:00s	1:00	-
-Rule	AV	1991	1994	-	Mar	Sun>=1	2:00s	0	-
-Rule	AV	1995	2005	-	Mar	lastSun	2:00s	0	-
-Rule	AV	2000	only	-	Aug	lastSun	2:00s	1:00	-
-Rule	AV	2001	2007	-	Oct	lastSun	2:00s	1:00	-
-Rule	AV	2006	only	-	Apr	Sun>=1	2:00s	0	-
-Rule	AV	2007	only	-	Mar	lastSun	2:00s	0	-
-Rule	AV	2008	max	-	Apr	Sun>=1	2:00s	0	-
-Rule	AV	2008	max	-	Oct	Sun>=1	2:00s	1:00	-
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone Australia/Melbourne 9:39:52 -	LMT	1895 Feb
-			10:00	Aus	EST	1971
-			10:00	AV	EST
-
-# New South Wales
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	AN	1971	1985	-	Oct	lastSun	2:00s	1:00	-
-Rule	AN	1972	only	-	Feb	27	2:00s	0	-
-Rule	AN	1973	1981	-	Mar	Sun>=1	2:00s	0	-
-Rule	AN	1982	only	-	Apr	Sun>=1	2:00s	0	-
-Rule	AN	1983	1985	-	Mar	Sun>=1	2:00s	0	-
-Rule	AN	1986	1989	-	Mar	Sun>=15	2:00s	0	-
-Rule	AN	1986	only	-	Oct	19	2:00s	1:00	-
-Rule	AN	1987	1999	-	Oct	lastSun	2:00s	1:00	-
-Rule	AN	1990	1995	-	Mar	Sun>=1	2:00s	0	-
-Rule	AN	1996	2005	-	Mar	lastSun	2:00s	0	-
-Rule	AN	2000	only	-	Aug	lastSun	2:00s	1:00	-
-Rule	AN	2001	2007	-	Oct	lastSun	2:00s	1:00	-
-Rule	AN	2006	only	-	Apr	Sun>=1	2:00s	0	-
-Rule	AN	2007	only	-	Mar	lastSun	2:00s	0	-
-Rule	AN	2008	max	-	Apr	Sun>=1	2:00s	0	-
-Rule	AN	2008	max	-	Oct	Sun>=1	2:00s	1:00	-
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone Australia/Sydney	10:04:52 -	LMT	1895 Feb
-			10:00	Aus	EST	1971
-			10:00	AN	EST
-Zone Australia/Broken_Hill 9:25:48 -	LMT	1895 Feb
-			10:00	-	EST	1896 Aug 23
-			9:00	-	CST	1899 May
-			9:30	Aus	CST	1971
-			9:30	AN	CST	2000
-			9:30	AS	CST
-
-# Lord Howe Island
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	LH	1981	1984	-	Oct	lastSun	2:00	1:00	-
-Rule	LH	1982	1985	-	Mar	Sun>=1	2:00	0	-
-Rule	LH	1985	only	-	Oct	lastSun	2:00	0:30	-
-Rule	LH	1986	1989	-	Mar	Sun>=15	2:00	0	-
-Rule	LH	1986	only	-	Oct	19	2:00	0:30	-
-Rule	LH	1987	1999	-	Oct	lastSun	2:00	0:30	-
-Rule	LH	1990	1995	-	Mar	Sun>=1	2:00	0	-
-Rule	LH	1996	2005	-	Mar	lastSun	2:00	0	-
-Rule	LH	2000	only	-	Aug	lastSun	2:00	0:30	-
-Rule	LH	2001	2007	-	Oct	lastSun	2:00	0:30	-
-Rule	LH	2006	only	-	Apr	Sun>=1	2:00	0	-
-Rule	LH	2007	only	-	Mar	lastSun	2:00	0	-
-Rule	LH	2008	max	-	Apr	Sun>=1	2:00	0	-
-Rule	LH	2008	max	-	Oct	Sun>=1	2:00	0:30	-
-Zone Australia/Lord_Howe 10:36:20 -	LMT	1895 Feb
-			10:00	-	EST	1981 Mar
-			10:30	LH	LHST
-
-# Australian miscellany
-#
-# Ashmore Is, Cartier
-# no indigenous inhabitants; only seasonal caretakers
-# no times are set
-#
-# Coral Sea Is
-# no indigenous inhabitants; only meteorologists
-# no times are set
-#
-# Macquarie
-# permanent occupation (scientific station) since 1948;
-# sealing and penguin oil station operated 1888/1917
-# like Australia/Hobart
-
-# Christmas
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone Indian/Christmas	7:02:52 -	LMT	1895 Feb
-			7:00	-	CXT	# Christmas Island Time
-
-# Cook Is
-# From Shanks & Pottenger:
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Cook	1978	only	-	Nov	12	0:00	0:30	HS
-Rule	Cook	1979	1991	-	Mar	Sun>=1	0:00	0	-
-Rule	Cook	1979	1990	-	Oct	lastSun	0:00	0:30	HS
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone Pacific/Rarotonga	-10:39:04 -	LMT	1901		# Avarua
-			-10:30	-	CKT	1978 Nov 12	# Cook Is Time
-			-10:00	Cook	CK%sT
-
-# Cocos
-# These islands were ruled by the Ross family from about 1830 to 1978.
-# We don't know when standard time was introduced; for now, we guess 1900.
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Indian/Cocos	6:27:40	-	LMT	1900
-			6:30	-	CCT	# Cocos Islands Time
-
-# Fiji
-# From Alexander Krivenyshev (2009-11-10):
-# According to Fiji Broadcasting Corporation,  Fiji plans to re-introduce DST
-# from November 29th 2009  to April 25th 2010.
-#
-# "Daylight savings to commence this month"
-# <a href="http://www.radiofiji.com.fj/fullstory.php?id=23719">
-# http://www.radiofiji.com.fj/fullstory.php?id=23719
-# </a>
-# or
-# <a href="http://www.worldtimezone.com/dst_news/dst_news_fiji01.html">
-# http://www.worldtimezone.com/dst_news/dst_news_fiji01.html
-# </a>
-
-# From Steffen Thorsen (2009-11-10):
-# The Fiji Government has posted some more details about the approved
-# amendments:
-# <a href="http://www.fiji.gov.fj/publish/page_16198.shtml">
-# http://www.fiji.gov.fj/publish/page_16198.shtml
-# </a>
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Fiji	1998	1999	-	Nov	Sun>=1	2:00	1:00	S
-Rule	Fiji	1999	2000	-	Feb	lastSun	3:00	0	-
-Rule	Fiji	2009	only	-	Nov	29	2:00	1:00	S
-Rule	Fiji	2010	only	-	Apr	25	3:00	0	-
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Pacific/Fiji	11:53:40 -	LMT	1915 Oct 26	# Suva
-			12:00	Fiji	FJ%sT	# Fiji Time
-
-# French Polynesia
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Pacific/Gambier	 -8:59:48 -	LMT	1912 Oct	# Rikitea
-			 -9:00	-	GAMT	# Gambier Time
-Zone	Pacific/Marquesas -9:18:00 -	LMT	1912 Oct
-			 -9:30	-	MART	# Marquesas Time
-Zone	Pacific/Tahiti	 -9:58:16 -	LMT	1912 Oct	# Papeete
-			-10:00	-	TAHT	# Tahiti Time
-# Clipperton (near North America) is administered from French Polynesia;
-# it is uninhabited.
-
-# Guam
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Pacific/Guam	-14:21:00 -	LMT	1844 Dec 31
-			 9:39:00 -	LMT	1901		# Agana
-			10:00	-	GST	2000 Dec 23	# Guam
-			10:00	-	ChST	# Chamorro Standard Time
-
-# Kiribati
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone Pacific/Tarawa	 11:32:04 -	LMT	1901		# Bairiki
-			 12:00	-	GILT		 # Gilbert Is Time
-Zone Pacific/Enderbury	-11:24:20 -	LMT	1901
-			-12:00	-	PHOT	1979 Oct # Phoenix Is Time
-			-11:00	-	PHOT	1995
-			 13:00	-	PHOT
-Zone Pacific/Kiritimati	-10:29:20 -	LMT	1901
-			-10:40	-	LINT	1979 Oct # Line Is Time
-			-10:00	-	LINT	1995
-			 14:00	-	LINT
-
-# N Mariana Is
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone Pacific/Saipan	-14:17:00 -	LMT	1844 Dec 31
-			 9:43:00 -	LMT	1901
-			 9:00	-	MPT	1969 Oct # N Mariana Is Time
-			10:00	-	MPT	2000 Dec 23
-			10:00	-	ChST	# Chamorro Standard Time
-
-# Marshall Is
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone Pacific/Majuro	11:24:48 -	LMT	1901
-			11:00	-	MHT	1969 Oct # Marshall Islands Time
-			12:00	-	MHT
-Zone Pacific/Kwajalein	11:09:20 -	LMT	1901
-			11:00	-	MHT	1969 Oct
-			-12:00	-	KWAT	1993 Aug 20	# Kwajalein Time
-			12:00	-	MHT
-
-# Micronesia
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone Pacific/Truk	10:07:08 -	LMT	1901
-			10:00	-	TRUT			# Truk Time
-Zone Pacific/Ponape	10:32:52 -	LMT	1901		# Kolonia
-			11:00	-	PONT			# Ponape Time
-Zone Pacific/Kosrae	10:51:56 -	LMT	1901
-			11:00	-	KOST	1969 Oct	# Kosrae Time
-			12:00	-	KOST	1999
-			11:00	-	KOST
-
-# Nauru
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Pacific/Nauru	11:07:40 -	LMT	1921 Jan 15	# Uaobe
-			11:30	-	NRT	1942 Mar 15	# Nauru Time
-			9:00	-	JST	1944 Aug 15
-			11:30	-	NRT	1979 May
-			12:00	-	NRT
-
-# New Caledonia
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	NC	1977	1978	-	Dec	Sun>=1	0:00	1:00	S
-Rule	NC	1978	1979	-	Feb	27	0:00	0	-
-Rule	NC	1996	only	-	Dec	 1	2:00s	1:00	S
-# Shanks & Pottenger say the following was at 2:00; go with IATA.
-Rule	NC	1997	only	-	Mar	 2	2:00s	0	-
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Pacific/Noumea	11:05:48 -	LMT	1912 Jan 13
-			11:00	NC	NC%sT
-
-
-###############################################################################
-
-# New Zealand
-
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	NZ	1927	only	-	Nov	 6	2:00	1:00	S
-Rule	NZ	1928	only	-	Mar	 4	2:00	0	M
-Rule	NZ	1928	1933	-	Oct	Sun>=8	2:00	0:30	S
-Rule	NZ	1929	1933	-	Mar	Sun>=15	2:00	0	M
-Rule	NZ	1934	1940	-	Apr	lastSun	2:00	0	M
-Rule	NZ	1934	1940	-	Sep	lastSun	2:00	0:30	S
-Rule	NZ	1946	only	-	Jan	 1	0:00	0	S
-# Since 1957 Chatham has been 45 minutes ahead of NZ, but there's no
-# convenient notation for this so we must duplicate the Rule lines.
-Rule	NZ	1974	only	-	Nov	Sun>=1	2:00s	1:00	D
-Rule	Chatham	1974	only	-	Nov	Sun>=1	2:45s	1:00	D
-Rule	NZ	1975	only	-	Feb	lastSun	2:00s	0	S
-Rule	Chatham	1975	only	-	Feb	lastSun	2:45s	0	S
-Rule	NZ	1975	1988	-	Oct	lastSun	2:00s	1:00	D
-Rule	Chatham	1975	1988	-	Oct	lastSun	2:45s	1:00	D
-Rule	NZ	1976	1989	-	Mar	Sun>=1	2:00s	0	S
-Rule	Chatham	1976	1989	-	Mar	Sun>=1	2:45s	0	S
-Rule	NZ	1989	only	-	Oct	Sun>=8	2:00s	1:00	D
-Rule	Chatham	1989	only	-	Oct	Sun>=8	2:45s	1:00	D
-Rule	NZ	1990	2006	-	Oct	Sun>=1	2:00s	1:00	D
-Rule	Chatham	1990	2006	-	Oct	Sun>=1	2:45s	1:00	D
-Rule	NZ	1990	2007	-	Mar	Sun>=15	2:00s	0	S
-Rule	Chatham	1990	2007	-	Mar	Sun>=15	2:45s	0	S
-Rule	NZ	2007	max	-	Sep	lastSun	2:00s	1:00	D
-Rule	Chatham	2007	max	-	Sep	lastSun	2:45s	1:00	D
-Rule	NZ	2008	max	-	Apr	Sun>=1	2:00s	0	S
-Rule	Chatham	2008	max	-	Apr	Sun>=1	2:45s	0	S
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone Pacific/Auckland	11:39:04 -	LMT	1868 Nov  2
-			11:30	NZ	NZ%sT	1946 Jan  1
-			12:00	NZ	NZ%sT
-Zone Pacific/Chatham	12:13:48 -	LMT	1957 Jan  1
-			12:45	Chatham	CHA%sT
-
-
-# Auckland Is
-# uninhabited; Maori and Moriori, colonial settlers, pastoralists, sealers,
-# and scientific personnel have wintered
-
-# Campbell I
-# minor whaling stations operated 1909/1914
-# scientific station operated 1941/1995;
-# previously whalers, sealers, pastoralists, and scientific personnel wintered
-# was probably like Pacific/Auckland
-
-###############################################################################
-
-
-# Niue
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Pacific/Niue	-11:19:40 -	LMT	1901		# Alofi
-			-11:20	-	NUT	1951	# Niue Time
-			-11:30	-	NUT	1978 Oct 1
-			-11:00	-	NUT
-
-# Norfolk
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Pacific/Norfolk	11:11:52 -	LMT	1901		# Kingston
-			11:12	-	NMT	1951	# Norfolk Mean Time
-			11:30	-	NFT		# Norfolk Time
-
-# Palau (Belau)
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone Pacific/Palau	8:57:56 -	LMT	1901		# Koror
-			9:00	-	PWT	# Palau Time
-
-# Papua New Guinea
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone Pacific/Port_Moresby 9:48:40 -	LMT	1880
-			9:48:32	-	PMMT	1895	# Port Moresby Mean Time
-			10:00	-	PGT		# Papua New Guinea Time
-
-# Pitcairn
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone Pacific/Pitcairn	-8:40:20 -	LMT	1901		# Adamstown
-			-8:30	-	PNT	1998 Apr 27 00:00
-			-8:00	-	PST	# Pitcairn Standard Time
-
-# American Samoa
-Zone Pacific/Pago_Pago	 12:37:12 -	LMT	1879 Jul  5
-			-11:22:48 -	LMT	1911
-			-11:30	-	SAMT	1950		# Samoa Time
-			-11:00	-	NST	1967 Apr	# N=Nome
-			-11:00	-	BST	1983 Nov 30	# B=Bering
-			-11:00	-	SST			# S=Samoa
-
-# Samoa
-
-# From Alexander Krivenyshev (2008-12-06):
-# The Samoa government (Western Samoa) may implement DST on the first Sunday of 
-# October 2009 (October 4, 2009) until the last Sunday of March 2010 (March 28, 
-# 2010). 
-# 
-# "Selected Committee reports to Cabinet on Daylight Saving Time",
-# Government of Samoa:
-# <a href="http://www.govt.ws/pr_article.cfm?pr_id=560">
-# http://www.govt.ws/pr_article.cfm?pr_id=560
-# </a>
-# or
-# <a href="http://www.worldtimezone.com/dst_news/dst_news_samoa01.html">
-# http://www.worldtimezone.com/dst_news/dst_news_samoa01.html
-# </a>
-
-# From Steffen Thorsen (2009-08-27):
-# Samoa's parliament passed the Daylight Saving Bill 2009, and will start 
-# daylight saving time on the first Sunday of October 2009 and end on the 
-# last Sunday of March 2010. We hope that the full text will be published 
-# soon, but we believe that the bill is only valid for 2009-2010. Samoa's 
-# Daylight Saving Act 2009 will be enforced as soon as the Head of State 
-# executes a proclamation publicizing this Act.
-#
-# Some background information here, which will be updated once we have 
-# more details:
-# <a href="http://www.timeanddate.com/news/time/samoa-dst-plan-2009.html">
-# http://www.timeanddate.com/news/time/samoa-dst-plan-2009.html
-# </a>
-
-# From Alexander Krivenyshev (2009-10-03):
-# First, my deepest condolences to people of Samoa islands and all families and
-# loved ones around the world who lost their lives in the earthquake and tsunami.
-#
-# Considering the recent devastation on Samoa by earthquake and tsunami and that
-# many government offices/ ministers are closed- not sure if "Daylight Saving
-# Bill 2009" will be implemented in next few days- on October 4, 2009.
-#
-# Here is reply from Consulate-General of Samoa in New Zealand
-# ---------------------------
-# Consul General
-# consulgeneral@samoaconsulate.org.nz
-#
-# Talofa Alexander,
-#
-# Thank you for your sympathy for our country but at this time we have not
-# been informed about the Daylight Savings Time Change.  Most Ministries in
-# Apia are closed or relocating due to weather concerns.
-#
-# When we do find out if they are still proceeding with the time change we
-# will advise you soonest.
-#
-# Kind Regards,
-# Lana
-# for: Consul General
-
-# From Steffen Thorsen (2009-10-05):
-# We have called a hotel in Samoa and asked about local time there - they 
-# are still on standard time.
-
-Zone Pacific/Apia	 12:33:04 -	LMT	1879 Jul  5
-			-11:26:56 -	LMT	1911
-			-11:30	-	SAMT	1950		# Samoa Time
-			-11:00	-	WST	2009 Oct 4
-			-11:00	1:00	WSDT	2010 Mar 28
-			-11:00	-	WST
-
-# Solomon Is
-# excludes Bougainville, for which see Papua New Guinea
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone Pacific/Guadalcanal 10:39:48 -	LMT	1912 Oct	# Honiara
-			11:00	-	SBT	# Solomon Is Time
-
-# Tokelau Is
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Pacific/Fakaofo	-11:24:56 -	LMT	1901
-			-10:00	-	TKT	# Tokelau Time
-
-# Tonga
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Tonga	1999	only	-	Oct	 7	2:00s	1:00	S
-Rule	Tonga	2000	only	-	Mar	19	2:00s	0	-
-Rule	Tonga	2000	2001	-	Nov	Sun>=1	2:00	1:00	S
-Rule	Tonga	2001	2002	-	Jan	lastSun	2:00	0	-
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone Pacific/Tongatapu	12:19:20 -	LMT	1901
-			12:20	-	TOT	1941 # Tonga Time
-			13:00	-	TOT	1999
-			13:00	Tonga	TO%sT
-
-# Tuvalu
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone Pacific/Funafuti	11:56:52 -	LMT	1901
-			12:00	-	TVT	# Tuvalu Time
-
-
-# US minor outlying islands
-
-# Howland, Baker
-# Howland was mined for guano by American companies 1857-1878 and British
-# 1886-1891; Baker was similar but exact dates are not known.
-# Inhabited by civilians 1935-1942; U.S. military bases 1943-1944;
-# uninhabited thereafter.
-# Howland observed Hawaii Standard Time (UTC-10:30) in 1937;
-# see page 206 of Elgen M. Long and Marie K. Long,
-# Amelia Earhart: the Mystery Solved, Simon & Schuster (2000).
-# So most likely Howland and Baker observed Hawaii Time from 1935
-# until they were abandoned after the war.
-
-# Jarvis
-# Mined for guano by American companies 1857-1879 and British 1883?-1891?.
-# Inhabited by civilians 1935-1942; IGY scientific base 1957-1958;
-# uninhabited thereafter.
-# no information; was probably like Pacific/Kiritimati
-
-# Johnston
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone Pacific/Johnston	-10:00	-	HST
-
-# Kingman
-# uninhabited
-
-# Midway
-#
-# From Mark Brader (2005-01-23):
-# [Fallacies and Fantasies of Air Transport History, by R.E.G. Davies,
-# published 1994 by Paladwr Press, McLean, VA, USA; ISBN 0-9626483-5-3]
-# reproduced a Pan American Airways timeables from 1936, for their weekly
-# "Orient Express" flights between San Francisco and Manila, and connecting
-# flights to Chicago and the US East Coast.  As it uses some time zone
-# designations that I've never seen before:....
-# Fri. 6:30A Lv. HONOLOLU (Pearl Harbor), H.I.   H.L.T. Ar. 5:30P Sun.
-#  "   3:00P Ar. MIDWAY ISLAND . . . . . . . . . M.L.T. Lv. 6:00A  "
-#
-Zone Pacific/Midway	-11:49:28 -	LMT	1901
-			-11:00	-	NST	1956 Jun  3
-			-11:00	1:00	NDT	1956 Sep  2
-			-11:00	-	NST	1967 Apr	# N=Nome
-			-11:00	-	BST	1983 Nov 30	# B=Bering
-			-11:00	-	SST			# S=Samoa
-
-# Palmyra
-# uninhabited since World War II; was probably like Pacific/Kiritimati
-
-# Wake
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Pacific/Wake	11:06:28 -	LMT	1901
-			12:00	-	WAKT	# Wake Time
-
-
-# Vanuatu
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Vanuatu	1983	only	-	Sep	25	0:00	1:00	S
-Rule	Vanuatu	1984	1991	-	Mar	Sun>=23	0:00	0	-
-Rule	Vanuatu	1984	only	-	Oct	23	0:00	1:00	S
-Rule	Vanuatu	1985	1991	-	Sep	Sun>=23	0:00	1:00	S
-Rule	Vanuatu	1992	1993	-	Jan	Sun>=23	0:00	0	-
-Rule	Vanuatu	1992	only	-	Oct	Sun>=23	0:00	1:00	S
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Pacific/Efate	11:13:16 -	LMT	1912 Jan 13		# Vila
-			11:00	Vanuatu	VU%sT	# Vanuatu Time
-
-# Wallis and Futuna
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Pacific/Wallis	12:15:20 -	LMT	1901
-			12:00	-	WFT	# Wallis & Futuna Time
-
-###############################################################################
-
-# NOTES
-
-# This data is by no means authoritative; if you think you know better,
-# go ahead and edit the file (and please send any changes to
-# tz@elsie.nci.nih.gov for general use in the future).
-
-# From Paul Eggert (2006-03-22):
-# A good source for time zone historical data outside the U.S. is
-# Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
-# San Diego: ACS Publications, Inc. (2003).
-#
-# Gwillim Law writes that a good source
-# for recent time zone data is the International Air Transport
-# Association's Standard Schedules Information Manual (IATA SSIM),
-# published semiannually.  Law sent in several helpful summaries
-# of the IATA's data after 1990.
-#
-# Except where otherwise noted, Shanks & Pottenger is the source for
-# entries through 1990, and IATA SSIM is the source for entries afterwards.
-#
-# Another source occasionally used is Edward W. Whitman, World Time Differences,
-# Whitman Publishing Co, 2 Niagara Av, Ealing, London (undated), which
-# I found in the UCLA library.
-#
-# A reliable and entertaining source about time zones is
-# Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997).
-#
-# I invented the abbreviations marked `*' in the following table;
-# the rest are from earlier versions of this file, or from other sources.
-# Corrections are welcome!
-#		std dst
-#		LMT	Local Mean Time
-#	  8:00	WST WST	Western Australia
-#	  8:45	CWST CWST Central Western Australia*
-#	  9:00	JST	Japan
-#	  9:30	CST CST	Central Australia
-#	 10:00	EST EST	Eastern Australia
-#	 10:00	ChST	Chamorro
-#	 10:30	LHST LHST Lord Howe*
-#	 11:30	NZMT NZST New Zealand through 1945
-#	 12:00	NZST NZDT New Zealand 1946-present
-#	 12:45	CHAST CHADT Chatham*
-#	-11:00	SST	Samoa
-#	-10:00	HST	Hawaii
-#	- 8:00	PST	Pitcairn*
-#
-# See the `northamerica' file for Hawaii.
-# See the `southamerica' file for Easter I and the Galapagos Is.
-
-###############################################################################
-
-# Australia
-
-# From Paul Eggert (2005-12-08):
-# <a href="http://www.bom.gov.au/climate/averages/tables/dst_times.shtml">
-# Implementation Dates of Daylight Saving Time within Australia
-# </a> summarizes daylight saving issues in Australia.
-
-# From Arthur David Olson (2005-12-12):
-# <a href="http://www.lawlink.nsw.gov.au/lawlink/Corporate/ll_agdinfo.nsf/pages/community_relations_daylight_saving">
-# Lawlink NSW:Daylight Saving in New South Wales
-# </a> covers New South Wales in particular.
-
-# From John Mackin (1991-03-06):
-# We in Australia have _never_ referred to DST as `daylight' time.
-# It is called `summer' time.  Now by a happy coincidence, `summer'
-# and `standard' happen to start with the same letter; hence, the
-# abbreviation does _not_ change...
-# The legislation does not actually define abbreviations, at least
-# in this State, but the abbreviation is just commonly taken to be the
-# initials of the phrase, and the legislation here uniformly uses
-# the phrase `summer time' and does not use the phrase `daylight
-# time'.
-# Announcers on the Commonwealth radio network, the ABC (for Australian
-# Broadcasting Commission), use the phrases `Eastern Standard Time'
-# or `Eastern Summer Time'.  (Note, though, that as I say in the
-# current australasia file, there is really no such thing.)  Announcers
-# on its overseas service, Radio Australia, use the same phrases
-# prefixed by the word `Australian' when referring to local times;
-# time announcements on that service, naturally enough, are made in UTC.
-
-# From Arthur David Olson (1992-03-08):
-# Given the above, what's chosen for year-round use is:
-#	CST	for any place operating at a GMTOFF of 9:30
-#	WST	for any place operating at a GMTOFF of 8:00
-#	EST	for any place operating at a GMTOFF of 10:00
-
-# From Chuck Soper (2006-06-01):
-# I recently found this Australian government web page on time zones:
-# <http://www.australia.gov.au/about-australia-13time>
-# And this government web page lists time zone names and abbreviations:
-# <http://www.bom.gov.au/climate/averages/tables/daysavtm.shtml>
-
-# From Paul Eggert (2001-04-05), summarizing a long discussion about "EST"
-# versus "AEST" etc.:
-#
-# I see the following points of dispute:
-#
-# * How important are unique time zone abbreviations?
-#
-#   Here I tend to agree with the point (most recently made by Chris
-#   Newman) that unique abbreviations should not be essential for proper
-#   operation of software.  We have other instances of ambiguity
-#   (e.g. "IST" denoting both "Israel Standard Time" and "Indian
-#   Standard Time"), and they are not likely to go away any time soon.
-#   In the old days, some software mistakenly relied on unique
-#   abbreviations, but this is becoming less true with time, and I don't
-#   think it's that important to cater to such software these days.
-#
-#   On the other hand, there is another motivation for unambiguous
-#   abbreviations: it cuts down on human confusion.  This is
-#   particularly true for Australia, where "EST" can mean one thing for
-#   time T and a different thing for time T plus 1 second.
-#
-# * Does the relevant legislation indicate which abbreviations should be used?
-#
-#   Here I tend to think that things are a mess, just as they are in
-#   many other countries.  We Americans are currently disagreeing about
-#   which abbreviation to use for the newly legislated Chamorro Standard
-#   Time, for example.
-#
-#   Personally, I would prefer to use common practice; I would like to
-#   refer to legislation only for examples of common practice, or as a
-#   tiebreaker.
-#
-# * Do Australians more often use "Eastern Daylight Time" or "Eastern
-#   Summer Time"?  Do they typically prefix the time zone names with
-#   the word "Australian"?
-#
-#   My own impression is that both "Daylight Time" and "Summer Time" are
-#   common and are widely understood, but that "Summer Time" is more
-#   popular; and that the leading "A" is also common but is omitted more
-#   often than not.  I just used AltaVista advanced search and got the
-#   following count of page hits:
-#
-#     1,103 "Eastern Summer Time" AND domain:au
-#       971 "Australian Eastern Summer Time" AND domain:au
-#       613 "Eastern Daylight Time" AND domain:au
-#       127 "Australian Eastern Daylight Time" AND domain:au
-#
-#   Here "Summer" seems quite a bit more popular than "Daylight",
-#   particularly when we know the time zone is Australian and not US,
-#   say.  The "Australian" prefix seems to be popular for Eastern Summer
-#   Time, but unpopular for Eastern Daylight Time.
-#
-#   For abbreviations, tools like AltaVista are less useful because of
-#   ambiguity.  Many hits are not really time zones, unfortunately, and
-#   many hits denote US time zones and not Australian ones.  But here
-#   are the hit counts anyway:
-#
-#     161,304 "EST" and domain:au
-#      25,156 "EDT" and domain:au
-#      18,263 "AEST" and domain:au
-#      10,416 "AEDT" and domain:au
-#
-#      14,538 "CST" and domain:au
-#       5,728 "CDT" and domain:au
-#         176 "ACST" and domain:au
-#          29 "ACDT" and domain:au
-#
-#       7,539 "WST" and domain:au
-#          68 "AWST" and domain:au
-#
-#   This data suggest that Australians tend to omit the "A" prefix in
-#   practice.  The situation for "ST" versus "DT" is less clear, given
-#   the ambiguities involved.
-#
-# * How do Australians feel about the abbreviations in the tz database?
-#
-#   If you just count Australians on this list, I count 2 in favor and 3
-#   against.  One of the "against" votes (David Keegel) counseled delay,
-#   saying that both AEST/AEDT and EST/EST are widely used and
-#   understood in Australia.
-
-# From Paul Eggert (1995-12-19):
-# Shanks & Pottenger report 2:00 for all autumn changes in Australia and NZ.
-# Mark Prior writes that his newspaper
-# reports that NSW's fall 1995 change will occur at 2:00,
-# but Robert Elz says it's been 3:00 in Victoria since 1970
-# and perhaps the newspaper's `2:00' is referring to standard time.
-# For now we'll continue to assume 2:00s for changes since 1960.
-
-# From Eric Ulevik (1998-01-05):
-#
-# Here are some URLs to Australian time legislation. These URLs are stable,
-# and should probably be included in the data file. There are probably more
-# relevant entries in this database.
-#
-# NSW (including LHI and Broken Hill):
-# <a href="http://www.austlii.edu.au/au/legis/nsw/consol_act/sta1987137/index.html">
-# Standard Time Act 1987 (updated 1995-04-04)
-# </a>
-# ACT
-# <a href="http://www.austlii.edu.au/au/legis/act/consol_act/stasta1972279/index.html">
-# Standard Time and Summer Time Act 1972
-# </a>
-# SA
-# <a href="http://www.austlii.edu.au/au/legis/sa/consol_act/sta1898137/index.html">
-# Standard Time Act, 1898
-# </a>
-
-# From David Grosz (2005-06-13):
-# It was announced last week that Daylight Saving would be extended by
-# one week next year to allow for the 2006 Commonwealth Games.
-# Daylight Saving is now to end for next year only on the first Sunday
-# in April instead of the last Sunday in March.
-#
-# From Gwillim Law (2005-06-14):
-# I did some Googling and found that all of those states (and territory) plan
-# to extend DST together in 2006.
-# ACT: http://www.cmd.act.gov.au/mediareleases/fileread.cfm?file=86.txt
-# New South Wales: http://www.thecouriermail.news.com.au/common/story_page/0,5936,15538869%255E1702,00.html
-# South Australia: http://www.news.com.au/story/0,10117,15555031-1246,00.html
-# Tasmania: http://www.media.tas.gov.au/release.php?id=14772
-# Victoria: I wasn't able to find anything separate, but the other articles
-# allude to it.
-# But not Queensland
-# http://www.news.com.au/story/0,10117,15564030-1248,00.html.
-
-# Northern Territory
-
-# From George Shepherd via Simon Woodhead via Robert Elz (1991-03-06):
-# # The NORTHERN TERRITORY..  [ Courtesy N.T. Dept of the Chief Minister ]
-# #					[ Nov 1990 ]
-# #	N.T. have never utilised any DST due to sub-tropical/tropical location.
-# ...
-# Zone        Australia/North         9:30    -       CST
-
-# From Bradley White (1991-03-04):
-# A recent excerpt from an Australian newspaper...
-# the Northern Territory do[es] not have daylight saving.
-
-# Western Australia
-
-# From George Shepherd via Simon Woodhead via Robert Elz (1991-03-06):
-# #  The state of WESTERN AUSTRALIA..  [ Courtesy W.A. dept Premier+Cabinet ]
-# #						[ Nov 1990 ]
-# #	W.A. suffers from a great deal of public and political opposition to
-# #	DST in principle. A bill is brought before parliament in most years, but
-# #	usually defeated either in the upper house, or in party caucus
-# #	before reaching parliament.
-# ...
-# Zone	Australia/West		8:00	AW	%sST
-# ...
-# Rule	AW	1974	only	-	Oct	lastSun	2:00	1:00	D
-# Rule	AW	1975	only	-	Mar	Sun>=1	3:00	0	W
-# Rule	AW	1983	only	-	Oct	lastSun	2:00	1:00	D
-# Rule	AW	1984	only	-	Mar	Sun>=1	3:00	0	W
-
-# From Bradley White (1991-03-04):
-# A recent excerpt from an Australian newspaper...
-# Western Australia...do[es] not have daylight saving.
-
-# From John D. Newman via Bradley White (1991-11-02):
-# Western Australia is still on "winter time". Some DH in Sydney
-# rang me at home a few days ago at 6.00am. (He had just arrived at
-# work at 9.00am.)
-# W.A. is switching to Summer Time on Nov 17th just to confuse
-# everybody again.
-
-# From Arthur David Olson (1992-03-08):
-# The 1992 ending date used in the rules is a best guess;
-# it matches what was used in the past.
-
-# <a href="http://www.bom.gov.au/faq/faqgen.htm">
-# The Australian Bureau of Meteorology FAQ
-# </a> (1999-09-27) writes that Giles Meteorological Station uses
-# South Australian time even though it's located in Western Australia.
-
-# Queensland
-# From George Shepherd via Simon Woodhead via Robert Elz (1991-03-06):
-# #   The state of QUEENSLAND.. [ Courtesy Qld. Dept Premier Econ&Trade Devel ]
-# #						[ Dec 1990 ]
-# ...
-# Zone	Australia/Queensland	10:00	AQ	%sST
-# ...
-# Rule	AQ	1971	only	-	Oct	lastSun	2:00	1:00	D
-# Rule	AQ	1972	only	-	Feb	lastSun	3:00	0	E
-# Rule	AQ	1989	max	-	Oct	lastSun	2:00	1:00	D
-# Rule	AQ	1990	max	-	Mar	Sun>=1	3:00	0	E
-
-# From Bradley White (1989-12-24):
-# "Australia/Queensland" now observes daylight time (i.e. from
-# October 1989).
-
-# From Bradley White (1991-03-04):
-# A recent excerpt from an Australian newspaper...
-# ...Queensland...[has] agreed to end daylight saving
-# at 3am tomorrow (March 3)...
-
-# From John Mackin (1991-03-06):
-# I can certainly confirm for my part that Daylight Saving in NSW did in fact
-# end on Sunday, 3 March.  I don't know at what hour, though.  (It surprised
-# me.)
-
-# From Bradley White (1992-03-08):
-# ...there was recently a referendum in Queensland which resulted
-# in the experimental daylight saving system being abandoned. So, ...
-# ...
-# Rule	QLD	1989	1991	-	Oct	lastSun	2:00	1:00	D
-# Rule	QLD	1990	1992	-	Mar	Sun>=1	3:00	0	S
-# ...
-
-# From Arthur David Olson (1992-03-08):
-# The chosen rules the union of the 1971/1972 change and the 1989-1992 changes.
-
-# From Christopher Hunt (2006-11-21), after an advance warning
-# from Jesper Norgaard Welen (2006-11-01):
-# WA are trialing DST for three years.
-# <http://www.parliament.wa.gov.au/parliament/bills.nsf/9A1B183144403DA54825721200088DF1/$File/Bill175-1B.pdf>
-
-# From Rives McDow (2002-04-09):
-# The most interesting region I have found consists of three towns on the
-# southern coast....  South Australia observes daylight saving time; Western
-# Australia does not.  The two states are one and a half hours apart.  The
-# residents decided to forget about this nonsense of changing the clock so
-# much and set the local time 20 hours and 45 minutes from the
-# international date line, or right in the middle of the time of South
-# Australia and Western Australia....
-#
-# From Paul Eggert (2002-04-09):
-# This is confirmed by the section entitled
-# "What's the deal with time zones???" in
-# <http://www.earthsci.unimelb.edu.au/~awatkins/null.html>.
-#
-# From Alex Livingston (2006-12-07):
-# ... it was just on four years ago that I drove along the Eyre Highway,
-# which passes through eastern Western Australia close to the southern
-# coast of the continent.
-#
-# I paid particular attention to the time kept there. There can be no
-# dispute that UTC+08:45 was considered "the time" from the border
-# village just inside the border with South Australia to as far west
-# as just east of Caiguna. There can also be no dispute that Eucla is
-# the largest population centre in this zone....
-#
-# Now that Western Australia is observing daylight saving, the
-# question arose whether this part of the state would follow suit. I
-# just called the border village and confirmed that indeed they have,
-# meaning that they are now observing UTC+09:45.
-#
-# (2006-12-09):
-# I personally doubt that either experimentation with daylight saving
-# in WA or its introduction in SA had anything to do with the genesis
-# of this time zone.  My hunch is that it's been around since well
-# before 1975.  I remember seeing it noted on road maps decades ago.
-
-# From Paul Eggert (2006-12-15):
-# For lack of better info, assume the tradition dates back to the
-# introduction of standard time in 1895.
-
-
-# southeast Australia
-#
-# From Paul Eggert (2007-07-23):
-# Starting autumn 2008 Victoria, NSW, South Australia, Tasmania and the ACT
-# end DST the first Sunday in April and start DST the first Sunday in October.
-# http://www.theage.com.au/news/national/daylight-savings-to-span-six-months/2007/06/27/1182623966703.html
-
-
-# South Australia
-
-# From Bradley White (1991-03-04):
-# A recent excerpt from an Australian newspaper...
-# ...South Australia...[has] agreed to end daylight saving
-# at 3am tomorrow (March 3)...
-
-# From George Shepherd via Simon Woodhead via Robert Elz (1991-03-06):
-# #   The state of SOUTH AUSTRALIA....[ Courtesy of S.A. Dept of Labour ]
-# #						[ Nov 1990 ]
-# ...
-# Zone	Australia/South		9:30	AS	%sST
-# ...
-# Rule	 AS	1971	max	-	Oct	lastSun	2:00	1:00	D
-# Rule	 AS	1972	1985	-	Mar	Sun>=1	3:00	0	C
-# Rule	 AS	1986	1990	-	Mar	Sun>=15	3:00	0	C
-# Rule	 AS	1991	max	-	Mar	Sun>=1	3:00	0	C
-
-# From Bradley White (1992-03-11):
-# Recent correspondence with a friend in Adelaide
-# contained the following exchange:  "Due to the Adelaide Festival,
-# South Australia delays setting back our clocks for a few weeks."
-
-# From Robert Elz (1992-03-13):
-# I heard that apparently (or at least, it appears that)
-# South Aus will have an extra 3 weeks daylight saving every even
-# numbered year (from 1990).  That's when the Adelaide Festival
-# is on...
-
-# From Robert Elz (1992-03-16, 00:57:07 +1000):
-# DST didn't end in Adelaide today (yesterday)....
-# But whether it's "4th Sunday" or "2nd last Sunday" I have no idea whatever...
-# (it's just as likely to be "the Sunday we pick for this year"...).
-
-# From Bradley White (1994-04-11):
-# If Sun, 15 March, 1992 was at +1030 as kre asserts, but yet Sun, 20 March,
-# 1994 was at +0930 as John Connolly's customer seems to assert, then I can
-# only conclude that the actual rule is more complicated....
-
-# From John Warburton (1994-10-07):
-# The new Daylight Savings dates for South Australia ...
-# was gazetted in the Government Hansard on Sep 26 1994....
-# start on last Sunday in October and end in last sunday in March.
-
-# From Paul Eggert (2007-07-23):
-# See "southeast Australia" above for 2008 and later.
-
-# Tasmania
-
-# The rules for 1967 through 1991 were reported by George Shepherd
-# via Simon Woodhead via Robert Elz (1991-03-06):
-# #  The state of TASMANIA.. [Courtesy Tasmanian Dept of Premier + Cabinet ]
-# #					[ Nov 1990 ]
-
-# From Bill Hart via Guy Harris (1991-10-10):
-# Oh yes, the new daylight savings rules are uniquely tasmanian, we have
-# 6 weeks a year now when we are out of sync with the rest of Australia
-# (but nothing new about that).
-
-# From Alex Livingston (1999-10-04):
-# I heard on the ABC (Australian Broadcasting Corporation) radio news on the
-# (long) weekend that Tasmania, which usually goes its own way in this regard,
-# has decided to join with most of NSW, the ACT, and most of Victoria
-# (Australia) and start daylight saving on the last Sunday in August in 2000
-# instead of the first Sunday in October.
-
-# Sim Alam (2000-07-03) reported a legal citation for the 2000/2001 rules:
-# http://www.thelaw.tas.gov.au/fragview/42++1968+GS3A@EN+2000070300
-
-# From Paul Eggert (2007-07-23):
-# See "southeast Australia" above for 2008 and later.
-
-# Victoria
-
-# The rules for 1971 through 1991 were reported by George Shepherd
-# via Simon Woodhead via Robert Elz (1991-03-06):
-# #   The state of VICTORIA.. [ Courtesy of Vic. Dept of Premier + Cabinet ]
-# #						[ Nov 1990 ]
-
-# From Scott Harrington (2001-08-29):
-# On KQED's "City Arts and Lectures" program last night I heard an
-# interesting story about daylight savings time.  Dr. John Heilbron was
-# discussing his book "The Sun in the Church: Cathedrals as Solar
-# Observatories"[1], and in particular the Shrine of Remembrance[2] located
-# in Melbourne, Australia.
-#
-# Apparently the shrine's main purpose is a beam of sunlight which
-# illuminates a special spot on the floor at the 11th hour of the 11th day
-# of the 11th month (Remembrance Day) every year in memory of Australia's
-# fallen WWI soldiers.  And if you go there on Nov. 11, at 11am local time,
-# you will indeed see the sunbeam illuminate the special spot at the
-# expected time.
-#
-# However, that is only because of some special mirror contraption that had
-# to be employed, since due to daylight savings time, the true solar time of
-# the remembrance moment occurs one hour later (or earlier?).  Perhaps
-# someone with more information on this jury-rig can tell us more.
-#
-# [1] http://www.hup.harvard.edu/catalog/HEISUN.html
-# [2] http://www.shrine.org.au
-
-# From Paul Eggert (2007-07-23):
-# See "southeast Australia" above for 2008 and later.
-
-# New South Wales
-
-# From Arthur David Olson:
-# New South Wales and subjurisdictions have their own ideas of a fun time.
-# Based on law library research by John Mackin,
-# who notes:
-#	In Australia, time is not legislated federally, but rather by the
-#	individual states.  Thus, while such terms as ``Eastern Standard Time''
-#	[I mean, of course, Australian EST, not any other kind] are in common
-#	use, _they have NO REAL MEANING_, as they are not defined in the
-#	legislation.  This is very important to understand.
-#	I have researched New South Wales time only...
-
-# From Eric Ulevik (1999-05-26):
-# DST will start in NSW on the last Sunday of August, rather than the usual
-# October in 2000.  [See: Matthew Moore,
-# <a href="http://www.smh.com.au/news/9905/26/pageone/pageone4.html">
-# Two months more daylight saving
-# </a>
-# Sydney Morning Herald (1999-05-26).]
-
-# From Paul Eggert (1999-09-27):
-# See the following official NSW source:
-# <a href="http://dir.gis.nsw.gov.au/cgi-bin/genobject/document/other/daylightsaving/tigGmZ">
-# Daylight Saving in New South Wales.
-# </a>
-#
-# Narrabri Shire (NSW) council has announced it will ignore the extension of
-# daylight saving next year.  See:
-# <a href="http://abc.net.au/news/regionals/neweng/monthly/regeng-22jul1999-1.htm">
-# Narrabri Council to ignore daylight saving
-# </a> (1999-07-22).  For now, we'll wait to see if this really happens.
-#
-# Victoria will following NSW.  See:
-# <a href="http://abc.net.au/local/news/olympics/1999/07/item19990728112314_1.htm">
-# Vic to extend daylight saving
-# </a> (1999-07-28).
-#
-# However, South Australia rejected the DST request.  See:
-# <a href="http://abc.net.au/news/olympics/1999/07/item19990719151754_1.htm">
-# South Australia rejects Olympics daylight savings request
-# </a> (1999-07-19).
-#
-# Queensland also will not observe DST for the Olympics.  See:
-# <a href="http://abc.net.au/news/olympics/1999/06/item19990601114608_1.htm">
-# Qld says no to daylight savings for Olympics
-# </a> (1999-06-01), which quotes Queensland Premier Peter Beattie as saying
-# ``Look you've got to remember in my family when this came up last time
-# I voted for it, my wife voted against it and she said to me it's all very
-# well for you, you don't have to worry about getting the children out of
-# bed, getting them to school, getting them to sleep at night.
-# I've been through all this argument domestically...my wife rules.''
-#
-# Broken Hill will stick with South Australian time in 2000.  See:
-# <a href="http://abc.net.au/news/regionals/brokenh/monthly/regbrok-21jul1999-6.htm">
-# Broken Hill to be behind the times
-# </a> (1999-07-21).
-
-# IATA SSIM (1998-09) says that the spring 2000 change for Australian
-# Capital Territory, New South Wales except Lord Howe Island and Broken
-# Hill, and Victoria will be August 27, presumably due to the Sydney Olympics.
-
-# From Eric Ulevik, referring to Sydney's Sun Herald (2000-08-13), page 29:
-# The Queensland Premier Peter Beattie is encouraging northern NSW
-# towns to use Queensland time.
-
-# From Paul Eggert (2007-07-23):
-# See "southeast Australia" above for 2008 and later.
-
-# Yancowinna
-
-# From John Mackin (1989-01-04):
-# `Broken Hill' means the County of Yancowinna.
-
-# From George Shepherd via Simon Woodhead via Robert Elz (1991-03-06):
-# # YANCOWINNA..  [ Confirmation courtesy of Broken Hill Postmaster ]
-# #					[ Dec 1990 ]
-# ...
-# # Yancowinna uses Central Standard Time, despite [its] location on the
-# # New South Wales side of the S.A. border. Most business and social dealings
-# # are with CST zones, therefore CST is legislated by local government
-# # although the switch to Summer Time occurs in line with N.S.W. There have
-# # been years when this did not apply, but the historical data is not
-# # presently available.
-# Zone	Australia/Yancowinna	9:30	 AY	%sST
-# ...
-# Rule	 AY	1971	1985	-	Oct	lastSun	2:00	1:00	D
-# Rule	 AY	1972	only	-	Feb	lastSun	3:00	0	C
-# [followed by other Rules]
-
-# Lord Howe Island
-
-# From George Shepherd via Simon Woodhead via Robert Elz (1991-03-06):
-# LHI...		[ Courtesy of Pauline Van Winsen ]
-#					[ Dec 1990 ]
-# Lord Howe Island is located off the New South Wales coast, and is half an
-# hour ahead of NSW time.
-
-# From James Lonergan, Secretary, Lord Howe Island Board (2000-01-27):
-# Lord Howe Island summer time in 2000/2001 will commence on the same
-# date as the rest of NSW (i.e. 2000-08-27).  For your information the
-# Lord Howe Island Board (controlling authority for the Island) is
-# seeking the community's views on various options for summer time
-# arrangements on the Island, e.g. advance clocks by 1 full hour
-# instead of only 30 minutes.  Dependant on the wishes of residents
-# the Board may approach the NSW government to change the existing
-# arrangements.  The starting date for summer time on the Island will
-# however always coincide with the rest of NSW.
-
-# From James Lonergan, Secretary, Lord Howe Island Board (2000-10-25):
-# Lord Howe Island advances clocks by 30 minutes during DST in NSW and retards
-# clocks by 30 minutes when DST finishes. Since DST was most recently
-# introduced in NSW, the "changeover" time on the Island has been 02:00 as
-# shown on clocks on LHI. I guess this means that for 30 minutes at the start
-# of DST, LHI is actually 1 hour ahead of the rest of NSW.
-
-# From Paul Eggert (2006-03-22):
-# For Lord Howe dates we use Shanks & Pottenger through 1989, and
-# Lonergan thereafter.  For times we use Lonergan.
-
-# From Paul Eggert (2007-07-23):
-# See "southeast Australia" above for 2008 and later.
-
-# From Steffen Thorsen (2009-04-28):
-# According to the official press release, South Australia's extended daylight 
-# saving period will continue with the same rules as used during the 2008-2009 
-# summer (southern hemisphere).
-# 
-# From
-# <a href="http://www.safework.sa.gov.au/uploaded_files/DaylightDatesSet.pdf">
-# http://www.safework.sa.gov.au/uploaded_files/DaylightDatesSet.pdf
-# </a>
-# The extended daylight saving period that South Australia has been trialling 
-# for over the last year is now set to be ongoing.
-# Daylight saving will continue to start on the first Sunday in October each 
-# year and finish on the first Sunday in April the following year.
-# Industrial Relations Minister, Paul Caica, says this provides South Australia 
-# with a consistent half hour time difference with NSW, Victoria, Tasmania and 
-# the ACT for all 52 weeks of the year...
-# 
-# We have a wrap-up here:
-# <a href="http://www.timeanddate.com/news/time/south-australia-extends-dst.html">
-# http://www.timeanddate.com/news/time/south-australia-extends-dst.html
-# </a>
-###############################################################################
-
-# New Zealand
-
-# From Mark Davies (1990-10-03):
-# the 1989/90 year was a trial of an extended "daylight saving" period.
-# This trial was deemed successful and the extended period adopted for
-# subsequent years (with the addition of a further week at the start).
-# source -- phone call to Ministry of Internal Affairs Head Office.
-
-# From George Shepherd via Simon Woodhead via Robert Elz (1991-03-06):
-# # The Country of New Zealand   (Australia's east island -) Gee they hate that!
-# #				   or is Australia the west island of N.Z.
-# #	[ courtesy of Geoff Tribble.. Auckland N.Z. ]
-# #				[ Nov 1990 ]
-# ...
-# Rule	NZ      1974    1988	-	Oct	lastSun	2:00	1:00	D
-# Rule	NZ	1989	max	-	Oct	Sun>=1	2:00	1:00	D
-# Rule	NZ      1975    1989	-	Mar	Sun>=1	3:00	0	S
-# Rule	NZ	1990	max	-	Mar	lastSun	3:00	0	S
-# ...
-# Zone	NZ			12:00	NZ		NZ%sT	# New Zealand
-# Zone	NZ-CHAT			12:45	-		NZ-CHAT # Chatham Island
-
-# From Arthur David Olson (1992-03-08):
-# The chosen rules use the Davies October 8 values for the start of DST in 1989
-# rather than the October 1 value.
-
-# From Paul Eggert (1995-12-19);
-# Shank & Pottenger report 2:00 for all autumn changes in Australia and NZ.
-# Robert Uzgalis writes that the New Zealand Daylight
-# Savings Time Order in Council dated 1990-06-18 specifies 2:00 standard
-# time on both the first Sunday in October and the third Sunday in March.
-# As with Australia, we'll assume the tradition is 2:00s, not 2:00.
-#
-# From Paul Eggert (2006-03-22):
-# The Department of Internal Affairs (DIA) maintains a brief history,
-# as does Carol Squires; see tz-link.htm for the full references.
-# Use these sources in preference to Shanks & Pottenger.
-#
-# For Chatham, IATA SSIM (1991/1999) gives the NZ rules but with
-# transitions at 2:45 local standard time; this confirms that Chatham
-# is always exactly 45 minutes ahead of Auckland.
-
-# From Colin Sharples (2007-04-30):
-# DST will now start on the last Sunday in September, and end on the
-# first Sunday in April.  The changes take effect this year, meaning
-# that DST will begin on 2007-09-30 2008-04-06.
-# http://www.dia.govt.nz/diawebsite.nsf/wpg_URL/Services-Daylight-Saving-Daylight-saving-to-be-extended
-
-###############################################################################
-
-
-# Fiji
-
-# Howse writes (p 153) that in 1879 the British governor of Fiji
-# enacted an ordinance standardizing the islands on Antipodean Time
-# instead of the American system (which was one day behind).
-
-# From Rives McDow (1998-10-08):
-# Fiji will introduce DST effective 0200 local time, 1998-11-01
-# until 0300 local time 1999-02-28.  Each year the DST period will
-# be from the first Sunday in November until the last Sunday in February.
-
-# From Paul Eggert (2000-01-08):
-# IATA SSIM (1999-09) says DST ends 0100 local time.  Go with McDow.
-
-# From the BBC World Service (1998-10-31 11:32 UTC):
-# The Fijiian government says the main reasons for the time change is to
-# improve productivity and reduce road accidents.  But correspondents say it
-# also hopes the move will boost Fiji's ability to compete with other pacific
-# islands in the effort to attract tourists to witness the dawning of the new
-# millenium.
-
-# http://www.fiji.gov.fj/press/2000_09/2000_09_13-05.shtml (2000-09-13)
-# reports that Fiji has discontinued DST.
-
-# Johnston
-
-# Johnston data is from usno1995.
-
-
-# Kiribati
-
-# From Paul Eggert (1996-01-22):
-# Today's _Wall Street Journal_ (page 1) reports that Kiribati
-# ``declared it the same day throught the country as of Jan. 1, 1995''
-# as part of the competition to be first into the 21st century.
-
-
-# Kwajalein
-
-# In comp.risks 14.87 (26 August 1993), Peter Neumann writes:
-# I wonder what happened in Kwajalein, where there was NO Friday,
-# 1993-08-20.  Thursday night at midnight Kwajalein switched sides with
-# respect to the International Date Line, to rejoin its fellow islands,
-# going from 11:59 p.m. Thursday to 12:00 m. Saturday in a blink.
-
-
-# N Mariana Is, Guam
-
-# Howse writes (p 153) ``The Spaniards, on the other hand, reached the
-# Philippines and the Ladrones from America,'' and implies that the Ladrones
-# (now called the Marianas) kept American date for quite some time.
-# For now, we assume the Ladrones switched at the same time as the Philippines;
-# see Asia/Manila.
-
-# US Public Law 106-564 (2000-12-23) made UTC+10 the official standard time,
-# under the name "Chamorro Standard Time".  There is no official abbreviation,
-# but Congressman Robert A. Underwood, author of the bill that became law,
-# wrote in a press release (2000-12-27) that he will seek the use of "ChST".
-
-
-# Micronesia
-
-# Alan Eugene Davis writes (1996-03-16),
-# ``I am certain, having lived there for the past decade, that "Truk"
-# (now properly known as Chuuk) ... is in the time zone GMT+10.''
-#
-# Shanks & Pottenger write that Truk switched from UTC+10 to UTC+11
-# on 1978-10-01; ignore this for now.
-
-# From Paul Eggert (1999-10-29):
-# The Federated States of Micronesia Visitors Board writes in
-# <a href="http://www.fsmgov.org/info/clocks.html">
-# The Federated States of Micronesia - Visitor Information
-# </a> (1999-01-26)
-# that Truk and Yap are UTC+10, and Ponape and Kosrae are UTC+11.
-# We don't know when Kosrae switched from UTC+12; assume January 1 for now.
-
-
-# Midway
-
-# From Charles T O'Connor, KMTH DJ (1956),
-# quoted in the KTMH section of the Radio Heritage Collection
-# <http://radiodx.com/spdxr/KMTH.htm> (2002-12-31):
-# For the past two months we've been on what is known as Daylight
-# Saving Time.  This time has put us on air at 5am in the morning,
-# your time down there in New Zealand.  Starting September 2, 1956
-# we'll again go back to Standard Time.  This'll mean that we'll go to
-# air at 6am your time.
-#
-# From Paul Eggert (2003-03-23):
-# We don't know the date of that quote, but we'll guess they
-# started DST on June 3.  Possibly DST was observed other years
-# in Midway, but we have no record of it.
-
-
-# Pitcairn
-
-# From Rives McDow (1999-11-08):
-# A Proclamation was signed by the Governor of Pitcairn on the 27th March 1998
-# with regard to Pitcairn Standard Time.  The Proclamation is as follows.
-#
-#	The local time for general purposes in the Islands shall be
-#	Co-ordinated Universal time minus 8 hours and shall be known
-#	as Pitcairn Standard Time.
-#
-# ... I have also seen Pitcairn listed as UTC minus 9 hours in several
-# references, and can only assume that this was an error in interpretation
-# somehow in light of this proclamation.
-
-# From Rives McDow (1999-11-09):
-# The Proclamation regarding Pitcairn time came into effect on 27 April 1998
-# ... at midnight.
-
-# From Howie Phelps (1999-11-10), who talked to a Pitcairner via shortwave:
-# Betty Christian told me yesterday that their local time is the same as
-# Pacific Standard Time. They used to be 1/2 hour different from us here in
-# Sacramento but it was changed a couple of years ago.
-
-
-# Samoa
-
-# Howse writes (p 153, citing p 10 of the 1883-11-18 New York Herald)
-# that in 1879 the King of Samoa decided to change
-# ``the date in his kingdom from the Antipodean to the American system,
-# ordaining -- by a masterpiece of diplomatic flattery -- that
-# the Fourth of July should be celebrated twice in that year.''
-
-
-# Tonga
-
-# From Paul Eggert (1996-01-22):
-# Today's _Wall Street Journal_ (p 1) reports that ``Tonga has been plotting
-# to sneak ahead of [New Zealanders] by introducing daylight-saving time.''
-# Since Kiribati has moved the Date Line it's not clear what Tonga will do.
-
-# Don Mundell writes in the 1997-02-20 Tonga Chronicle
-# <a href="http://www.tongatapu.net.to/tonga/homeland/timebegins.htm">
-# How Tonga became `The Land where Time Begins'
-# </a>:
-
-# Until 1941 Tonga maintained a standard time 50 minutes ahead of NZST
-# 12 hours and 20 minutes ahead of GMT.  When New Zealand adjusted its
-# standard time in 1940s, Tonga had the choice of subtracting from its
-# local time to come on the same standard time as New Zealand or of
-# advancing its time to maintain the differential of 13 degrees
-# (approximately 50 minutes ahead of New Zealand time).
-#
-# Because His Majesty King Taufa'ahau Tupou IV, then Crown Prince
-# Tungi, preferred to ensure Tonga's title as the land where time
-# begins, the Legislative Assembly approved the latter change.
-#
-# But some of the older, more conservative members from the outer
-# islands objected. "If at midnight on Dec. 31, we move ahead 40
-# minutes, as your Royal Highness wishes, what becomes of the 40
-# minutes we have lost?"
-#
-# The Crown Prince, presented an unanswerable argument: "Remember that
-# on the World Day of Prayer, you would be the first people on Earth
-# to say your prayers in the morning."
-
-# From Paul Eggert (2006-03-22):
-# Shanks & Pottenger say the transition was on 1968-10-01; go with Mundell.
-
-# From Eric Ulevik (1999-05-03):
-# Tonga's director of tourism, who is also secretary of the National Millenium
-# Committee, has a plan to get Tonga back in front.
-# He has proposed a one-off move to tropical daylight saving for Tonga from
-# October to March, which has won approval in principle from the Tongan
-# Government.
-
-# From Steffen Thorsen (1999-09-09):
-# * Tonga will introduce DST in November
-#
-# I was given this link by John Letts:
-# <a href="http://news.bbc.co.uk/hi/english/world/asia-pacific/newsid_424000/424764.stm">
-# http://news.bbc.co.uk/hi/english/world/asia-pacific/newsid_424000/424764.stm
-# </a>
-#
-# I have not been able to find exact dates for the transition in November
-# yet. By reading this article it seems like Fiji will be 14 hours ahead
-# of UTC as well, but as far as I know Fiji will only be 13 hours ahead
-# (12 + 1 hour DST).
-
-# From Arthur David Olson (1999-09-20):
-# According to <a href="http://www.tongaonline.com/news/sept1799.html">
-# http://www.tongaonline.com/news/sept1799.html
-# </a>:
-# "Daylight Savings Time will take effect on Oct. 2 through April 15, 2000
-# and annually thereafter from the first Saturday in October through the
-# third Saturday of April.  Under the system approved by Privy Council on
-# Sept. 10, clocks must be turned ahead one hour on the opening day and
-# set back an hour on the closing date."
-# Alas, no indication of the time of day.
-
-# From Rives McDow (1999-10-06):
-# Tonga started its Daylight Saving on Saturday morning October 2nd at 0200am.
-# Daylight Saving ends on April 16 at 0300am which is Sunday morning.
-
-# From Steffen Thorsen (2000-10-31):
-# Back in March I found a notice on the website http://www.tongaonline.com
-# that Tonga changed back to standard time one month early, on March 19
-# instead of the original reported date April 16. Unfortunately, the article
-# is no longer available on the site, and I did not make a copy of the
-# text, and I have forgotten to report it here.
-# (Original URL was: http://www.tongaonline.com/news/march162000.htm )
-
-# From Rives McDow (2000-12-01):
-# Tonga is observing DST as of 2000-11-04 and will stop on 2001-01-27.
-
-# From Sione Moala-Mafi (2001-09-20) via Rives McDow:
-# At 2:00am on the first Sunday of November, the standard time in the Kingdom
-# shall be moved forward by one hour to 3:00am.  At 2:00am on the last Sunday
-# of January the standard time in the Kingdom shall be moved backward by one
-# hour to 1:00am.
-
-# From Pulu 'Anau (2002-11-05):
-# The law was for 3 years, supposedly to get renewed.  It wasn't.
-
-
-# Wake
-
-# From Vernice Anderson, Personal Secretary to Philip Jessup,
-# US Ambassador At Large (oral history interview, 1971-02-02):
-#
-# Saturday, the 14th [of October, 1950] -- ...  The time was all the
-# more confusing at that point, because we had crossed the
-# International Date Line, thus getting two Sundays.  Furthermore, we
-# discovered that Wake Island had two hours of daylight saving time
-# making calculation of time in Washington difficult if not almost
-# impossible.
-#
-# http://www.trumanlibrary.org/wake/meeting.htm
-
-# From Paul Eggert (2003-03-23):
-# We have no other report of DST in Wake Island, so omit this info for now.
-
-###############################################################################
-
-# The International Date Line
-
-# From Gwillim Law (2000-01-03):
-#
-# The International Date Line is not defined by any international standard,
-# convention, or treaty.  Mapmakers are free to draw it as they please.
-# Reputable mapmakers will simply ensure that every point of land appears on
-# the correct side of the IDL, according to the date legally observed there.
-#
-# When Kiribati adopted a uniform date in 1995, thereby moving the Phoenix and
-# Line Islands to the west side of the IDL (or, if you prefer, moving the IDL
-# to the east side of the Phoenix and Line Islands), I suppose that most
-# mapmakers redrew the IDL following the boundary of Kiribati.  Even that line
-# has a rather arbitrary nature.  The straight-line boundaries between Pacific
-# island nations that are shown on many maps are based on an international
-# convention, but are not legally binding national borders.... The date is
-# governed by the IDL; therefore, even on the high seas, there may be some
-# places as late as fourteen hours later than UTC.  And, since the IDL is not
-# an international standard, there are some places on the high seas where the
-# correct date is ambiguous.
-
-# From Wikipedia <http://en.wikipedia.org/wiki/Time_zone> (2005-08-31):
-# Before 1920, all ships kept local apparent time on the high seas by setting
-# their clocks at night or at the morning sight so that, given the ship's
-# speed and direction, it would be 12 o'clock when the Sun crossed the ship's
-# meridian (12 o'clock = local apparent noon).  During 1917, at the
-# Anglo-French Conference on Time-keeping at Sea, it was recommended that all
-# ships, both military and civilian, should adopt hourly standard time zones
-# on the high seas.  Whenever a ship was within the territorial waters of any
-# nation it would use that nation's standard time.  The captain was permitted
-# to change his ship's clocks at a time of his choice following his ship's
-# entry into another zone time--he often chose midnight.  These zones were
-# adopted by all major fleets between 1920 and 1925 but not by many
-# independent merchant ships until World War II.
-
-# From Paul Eggert, using references suggested by Oscar van Vlijmen
-# (2005-03-20):
-#
-# The American Practical Navigator (2002)
-# <http://pollux.nss.nima.mil/pubs/pubs_j_apn_sections.html?rid=187>
-# talks only about the 180-degree meridian with respect to ships in
-# international waters; it ignores the international date line.
diff --git a/tools/zoneinfo/tzdata2009s/backward b/tools/zoneinfo/tzdata2009s/backward
deleted file mode 100644
index c896968..0000000
--- a/tools/zoneinfo/tzdata2009s/backward
+++ /dev/null
@@ -1,116 +0,0 @@
-# <pre>
-# @(#)backward	8.8
-# This file is in the public domain, so clarified as of
-# 2009-05-17 by Arthur David Olson.
-
-# This file provides links between current names for time zones
-# and their old names.  Many names changed in late 1993.
-
-Link	Africa/Asmara		Africa/Asmera
-Link	Africa/Bamako		Africa/Timbuktu
-Link	America/Argentina/Catamarca	America/Argentina/ComodRivadavia
-Link	America/Adak		America/Atka
-Link	America/Argentina/Buenos_Aires	America/Buenos_Aires
-Link	America/Argentina/Catamarca	America/Catamarca
-Link	America/Atikokan	America/Coral_Harbour
-Link	America/Argentina/Cordoba	America/Cordoba
-Link	America/Tijuana		America/Ensenada
-Link	America/Indiana/Indianapolis	America/Fort_Wayne
-Link	America/Indiana/Indianapolis	America/Indianapolis
-Link	America/Argentina/Jujuy	America/Jujuy
-Link	America/Indiana/Knox	America/Knox_IN
-Link	America/Kentucky/Louisville	America/Louisville
-Link	America/Argentina/Mendoza	America/Mendoza
-Link	America/Rio_Branco	America/Porto_Acre
-Link	America/Argentina/Cordoba	America/Rosario
-Link	America/St_Thomas	America/Virgin
-Link	Asia/Ashgabat		Asia/Ashkhabad
-Link	Asia/Chongqing		Asia/Chungking
-Link	Asia/Dhaka		Asia/Dacca
-Link	Asia/Kathmandu		Asia/Katmandu
-Link	Asia/Kolkata		Asia/Calcutta
-Link	Asia/Macau		Asia/Macao
-Link	Asia/Jerusalem		Asia/Tel_Aviv
-Link	Asia/Ho_Chi_Minh	Asia/Saigon
-Link	Asia/Thimphu		Asia/Thimbu
-Link	Asia/Makassar		Asia/Ujung_Pandang
-Link	Asia/Ulaanbaatar	Asia/Ulan_Bator
-Link	Atlantic/Faroe		Atlantic/Faeroe
-Link	Europe/Oslo		Atlantic/Jan_Mayen
-Link	Australia/Sydney	Australia/ACT
-Link	Australia/Sydney	Australia/Canberra
-Link	Australia/Lord_Howe	Australia/LHI
-Link	Australia/Sydney	Australia/NSW
-Link	Australia/Darwin	Australia/North
-Link	Australia/Brisbane	Australia/Queensland
-Link	Australia/Adelaide	Australia/South
-Link	Australia/Hobart	Australia/Tasmania
-Link	Australia/Melbourne	Australia/Victoria
-Link	Australia/Perth		Australia/West
-Link	Australia/Broken_Hill	Australia/Yancowinna
-Link	America/Rio_Branco	Brazil/Acre
-Link	America/Noronha		Brazil/DeNoronha
-Link	America/Sao_Paulo	Brazil/East
-Link	America/Manaus		Brazil/West
-Link	America/Halifax		Canada/Atlantic
-Link	America/Winnipeg	Canada/Central
-Link	America/Regina		Canada/East-Saskatchewan
-Link	America/Toronto		Canada/Eastern
-Link	America/Edmonton	Canada/Mountain
-Link	America/St_Johns	Canada/Newfoundland
-Link	America/Vancouver	Canada/Pacific
-Link	America/Regina		Canada/Saskatchewan
-Link	America/Whitehorse	Canada/Yukon
-Link	America/Santiago	Chile/Continental
-Link	Pacific/Easter		Chile/EasterIsland
-Link	America/Havana		Cuba
-Link	Africa/Cairo		Egypt
-Link	Europe/Dublin		Eire
-Link	Europe/London		Europe/Belfast
-Link	Europe/Chisinau		Europe/Tiraspol
-Link	Europe/London		GB
-Link	Europe/London		GB-Eire
-Link	Etc/GMT			GMT+0
-Link	Etc/GMT			GMT-0
-Link	Etc/GMT			GMT0
-Link	Etc/GMT			Greenwich
-Link	Asia/Hong_Kong		Hongkong
-Link	Atlantic/Reykjavik	Iceland
-Link	Asia/Tehran		Iran
-Link	Asia/Jerusalem		Israel
-Link	America/Jamaica		Jamaica
-Link	Asia/Tokyo		Japan
-Link	Pacific/Kwajalein	Kwajalein
-Link	Africa/Tripoli		Libya
-Link	America/Tijuana		Mexico/BajaNorte
-Link	America/Mazatlan	Mexico/BajaSur
-Link	America/Mexico_City	Mexico/General
-Link	Pacific/Auckland	NZ
-Link	Pacific/Chatham		NZ-CHAT
-Link	America/Denver		Navajo
-Link	Asia/Shanghai		PRC
-Link	Pacific/Pago_Pago	Pacific/Samoa
-Link	Pacific/Truk		Pacific/Yap
-Link	Europe/Warsaw		Poland
-Link	Europe/Lisbon		Portugal
-Link	Asia/Taipei		ROC
-Link	Asia/Seoul		ROK
-Link	Asia/Singapore		Singapore
-Link	Europe/Istanbul		Turkey
-Link	Etc/UCT			UCT
-Link	America/Anchorage	US/Alaska
-Link	America/Adak		US/Aleutian
-Link	America/Phoenix		US/Arizona
-Link	America/Chicago		US/Central
-Link	America/Indiana/Indianapolis	US/East-Indiana
-Link	America/New_York	US/Eastern
-Link	Pacific/Honolulu	US/Hawaii
-Link	America/Indiana/Knox	US/Indiana-Starke
-Link	America/Detroit		US/Michigan
-Link	America/Denver		US/Mountain
-Link	America/Los_Angeles	US/Pacific
-Link	Pacific/Pago_Pago	US/Samoa
-Link	Etc/UTC			UTC
-Link	Etc/UTC			Universal
-Link	Europe/Moscow		W-SU
-Link	Etc/UTC			Zulu
diff --git a/tools/zoneinfo/tzdata2009s/europe b/tools/zoneinfo/tzdata2009s/europe
deleted file mode 100644
index 66ab880..0000000
--- a/tools/zoneinfo/tzdata2009s/europe
+++ /dev/null
@@ -1,2683 +0,0 @@
-# <pre>
-# @(#)europe	8.24
-# This file is in the public domain, so clarified as of
-# 2009-05-17 by Arthur David Olson.
-
-# This data is by no means authoritative; if you think you know better,
-# go ahead and edit the file (and please send any changes to
-# tz@elsie.nci.nih.gov for general use in the future).
-
-# From Paul Eggert (2006-03-22):
-# A good source for time zone historical data outside the U.S. is
-# Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
-# San Diego: ACS Publications, Inc. (2003).
-#
-# Gwillim Law writes that a good source
-# for recent time zone data is the International Air Transport
-# Association's Standard Schedules Information Manual (IATA SSIM),
-# published semiannually.  Law sent in several helpful summaries
-# of the IATA's data after 1990.
-#
-# Except where otherwise noted, Shanks & Pottenger is the source for
-# entries through 1991, and IATA SSIM is the source for entries afterwards.
-#
-# Other sources occasionally used include:
-#
-#	Edward W. Whitman, World Time Differences,
-#	Whitman Publishing Co, 2 Niagara Av, Ealing, London (undated),
-#	which I found in the UCLA library.
-#
-#	<a href="http://www.pettswoodvillage.co.uk/Daylight_Savings_William_Willett.pdf">
-#	William Willett, The Waste of Daylight, 19th edition
-#	</a> (1914-03)
-#
-#	Brazil's Departamento Servico da Hora (DSH),
-#	<a href="http://pcdsh01.on.br/HISTHV.htm">
-#	History of Summer Time
-#	</a> (1998-09-21, in Portuguese)
-
-#
-# I invented the abbreviations marked `*' in the following table;
-# the rest are from earlier versions of this file, or from other sources.
-# Corrections are welcome!
-#                   std dst  2dst
-#                   LMT           Local Mean Time
-#       -4:00       AST ADT       Atlantic
-#       -3:00       WGT WGST      Western Greenland*
-#       -1:00       EGT EGST      Eastern Greenland*
-#        0:00       GMT BST  BDST Greenwich, British Summer
-#        0:00       GMT IST       Greenwich, Irish Summer
-#        0:00       WET WEST WEMT Western Europe
-#        0:19:32.13 AMT NST       Amsterdam, Netherlands Summer (1835-1937)*
-#        0:20       NET NEST      Netherlands (1937-1940)*
-#        1:00       CET CEST CEMT Central Europe
-#        1:00:14    SET           Swedish (1879-1899)*
-#        2:00       EET EEST      Eastern Europe
-#        3:00       MSK MSD       Moscow
-#
-# A reliable and entertaining source about time zones, especially in Britain,
-# Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997).
-
-# From Peter Ilieve (1994-12-04),
-# The original six [EU members]: Belgium, France, (West) Germany, Italy,
-# Luxembourg, the Netherlands.
-# Plus, from 1 Jan 73: Denmark, Ireland, United Kingdom.
-# Plus, from 1 Jan 81: Greece.
-# Plus, from 1 Jan 86: Spain, Portugal.
-# Plus, from 1 Jan 95: Austria, Finland, Sweden. (Norway negotiated terms for
-# entry but in a referendum on 28 Nov 94 the people voted No by 52.2% to 47.8%
-# on a turnout of 88.6%. This was almost the same result as Norway's previous
-# referendum in 1972, they are the only country to have said No twice.
-# Referendums in the other three countries voted Yes.)
-# ...
-# Estonia ... uses EU dates but not at 01:00 GMT, they use midnight GMT.
-# I don't think they know yet what they will do from 1996 onwards.
-# ...
-# There shouldn't be any [current members who are not using EU rules].
-# A Directive has the force of law, member states are obliged to enact
-# national law to implement it. The only contentious issue was the
-# different end date for the UK and Ireland, and this was always allowed
-# in the Directive.
-
-
-###############################################################################
-
-# Britain (United Kingdom) and Ireland (Eire)
-
-# From Peter Ilieve (1994-07-06):
-#
-# On 17 Jan 1994 the Independent, a UK quality newspaper, had a piece about
-# historical vistas along the Thames in west London. There was a photo
-# and a sketch map showing some of the sightlines involved. One paragraph
-# of the text said:
-#
-# `An old stone obelisk marking a forgotten terrestrial meridian stands
-# beside the river at Kew. In the 18th century, before time and longitude
-# was standardised by the Royal Observatory in Greenwich, scholars observed
-# this stone and the movement of stars from Kew Observatory nearby. They
-# made their calculations and set the time for the Horse Guards and Parliament,
-# but now the stone is obscured by scrubwood and can only be seen by walking
-# along the towpath within a few yards of it.'
-#
-# I have a one inch to one mile map of London and my estimate of the stone's
-# position is 51 deg. 28' 30" N, 0 deg. 18' 45" W. The longitude should
-# be within about +-2". The Ordnance Survey grid reference is TQ172761.
-#
-# [This yields GMTOFF = -0:01:15 for London LMT in the 18th century.]
-
-# From Paul Eggert (1993-11-18):
-#
-# Howse writes that Britain was the first country to use standard time.
-# The railways cared most about the inconsistencies of local mean time,
-# and it was they who forced a uniform time on the country.
-# The original idea was credited to Dr. William Hyde Wollaston (1766-1828)
-# and was popularized by Abraham Follett Osler (1808-1903).
-# The first railway to adopt London time was the Great Western Railway
-# in November 1840; other railways followed suit, and by 1847 most
-# (though not all) railways used London time.  On 1847-09-22 the
-# Railway Clearing House, an industry standards body, recommended that GMT be
-# adopted at all stations as soon as the General Post Office permitted it.
-# The transition occurred on 12-01 for the L&NW, the Caledonian,
-# and presumably other railways; the January 1848 Bradshaw's lists many
-# railways as using GMT.  By 1855 the vast majority of public
-# clocks in Britain were set to GMT (though some, like the great clock
-# on Tom Tower at Christ Church, Oxford, were fitted with two minute hands,
-# one for local time and one for GMT).  The last major holdout was the legal
-# system, which stubbornly stuck to local time for many years, leading
-# to oddities like polls opening at 08:13 and closing at 16:13.
-# The legal system finally switched to GMT when the Statutes (Definition
-# of Time) Act took effect; it received the Royal Assent on 1880-08-02.
-#
-# In the tables below, we condense this complicated story into a single
-# transition date for London, namely 1847-12-01.  We don't know as much
-# about Dublin, so we use 1880-08-02, the legal transition time.
-
-# From Paul Eggert (2003-09-27):
-# Summer Time was first seriously proposed by William Willett (1857-1915),
-# a London builder and member of the Royal Astronomical Society
-# who circulated a pamphlet ``The Waste of Daylight'' (1907)
-# that proposed advancing clocks 20 minutes on each of four Sundays in April,
-# and retarding them by the same amount on four Sundays in September.
-# A bill was drafted in 1909 and introduced in Parliament several times,
-# but it met with ridicule and opposition, especially from farming interests.
-# Later editions of the pamphlet proposed one-hour summer time, and
-# it was eventually adopted as a wartime measure in 1916.
-# See: Summer Time Arrives Early, The Times (2000-05-18).
-# A monument to Willett was unveiled on 1927-05-21, in an open space in
-# a 45-acre wood near Chislehurst, Kent that was purchased by popular
-# subscription and open to the public.  On the south face of the monolith,
-# designed by G. W. Miller, is the the William Willett Memorial Sundial,
-# which is permanently set to Summer Time.
-
-# From Winston Churchill (1934-04-28):
-# It is one of the paradoxes of history that we should owe the boon of
-# summer time, which gives every year to the people of this country
-# between 160 and 170 hours more daylight leisure, to a war which
-# plunged Europe into darkness for four years, and shook the
-# foundations of civilization throughout the world.
-#	-- <a href="http://www.winstonchurchill.org/fh114willett.htm">
-#	"A Silent Toast to William Willett", Pictorial Weekly
-#	</a>
-
-# From Paul Eggert (1996-09-03):
-# The OED Supplement says that the English originally said ``Daylight Saving''
-# when they were debating the adoption of DST in 1908; but by 1916 this
-# term appears only in quotes taken from DST's opponents, whereas the
-# proponents (who eventually won the argument) are quoted as using ``Summer''.
-
-# From Arthur David Olson (1989-01-19):
-#
-# A source at the British Information Office in New York avers that it's
-# known as "British" Summer Time in all parts of the United Kingdom.
-
-# Date: 4 Jan 89 08:57:25 GMT (Wed)
-# From: Jonathan Leffler
-# [British Summer Time] is fixed annually by Act of Parliament.
-# If you can predict what Parliament will do, you should be in
-# politics making a fortune, not computing.
-
-# From Chris Carrier (1996-06-14):
-# I remember reading in various wartime issues of the London Times the
-# acronym BDST for British Double Summer Time.  Look for the published
-# time of sunrise and sunset in The Times, when BDST was in effect, and
-# if you find a zone reference it will say, "All times B.D.S.T."
-
-# From Joseph S. Myers (1999-09-02):
-# ... some military cables (WO 219/4100 - this is a copy from the
-# main SHAEF archives held in the US National Archives, SHAEF/5252/8/516)
-# agree that the usage is BDST (this appears in a message dated 17 Feb 1945).
-
-# From Joseph S. Myers (2000-10-03):
-# On 18th April 1941, Sir Stephen Tallents of the BBC wrote to Sir
-# Alexander Maxwell of the Home Office asking whether there was any
-# official designation; the reply of the 21st was that there wasn't
-# but he couldn't think of anything better than the "Double British
-# Summer Time" that the BBC had been using informally.
-# http://student.cusu.cam.ac.uk/~jsm28/british-time/bbc-19410418.png
-# http://student.cusu.cam.ac.uk/~jsm28/british-time/ho-19410421.png
-
-# From Sir Alexander Maxwell in the above-mentioned letter (1941-04-21):
-# [N]o official designation has as far as I know been adopted for the time
-# which is to be introduced in May....
-# I cannot think of anything better than "Double British Summer Time"
-# which could not be said to run counter to any official description.
-
-# From Paul Eggert (2000-10-02):
-# Howse writes (p 157) `DBST' too, but `BDST' seems to have been common
-# and follows the more usual convention of putting the location name first,
-# so we use `BDST'.
-
-# Peter Ilieve (1998-04-19) described at length
-# the history of summer time legislation in the United Kingdom.
-# Since 1998 Joseph S. Myers has been updating
-# and extending this list, which can be found in
-# <a href="http://student.cusu.cam.ac.uk/~jsm28/british-time/">
-# History of legal time in Britain
-# </a>
-
-# From Joseph S. Myers (1998-01-06):
-#
-# The legal time in the UK outside of summer time is definitely GMT, not UTC;
-# see Lord Tanlaw's speech
-# <a href="http://www.parliament.the-stationery-office.co.uk/pa/ld199697/ldhansrd/pdvn/lds97/text/70611-20.htm#70611-20_head0">
-# (Lords Hansard 11 June 1997 columns 964 to 976)
-# </a>.
-
-# From Paul Eggert (2006-03-22):
-#
-# For lack of other data, follow Shanks & Pottenger for Eire in 1940-1948.
-#
-# Given Ilieve and Myers's data, the following claims by Shanks & Pottenger
-# are incorrect:
-#     * Wales did not switch from GMT to daylight saving time until
-#	1921 Apr 3, when they began to conform with the rest of Great Britain.
-# Actually, Wales was identical after 1880.
-#     * Eire had two transitions on 1916 Oct 1.
-# It actually just had one transition.
-#     * Northern Ireland used single daylight saving time throughout WW II.
-# Actually, it conformed to Britain.
-#     * GB-Eire changed standard time to 1 hour ahead of GMT on 1968-02-18.
-# Actually, that date saw the usual switch to summer time.
-# Standard time was not changed until 1968-10-27 (the clocks didn't change).
-#
-# Here is another incorrect claim by Shanks & Pottenger:
-#     * Jersey, Guernsey, and the Isle of Man did not switch from GMT
-#	to daylight saving time until 1921 Apr 3, when they began to
-#	conform with Great Britain.
-# S.R.&O. 1916, No. 382 and HO 45/10811/312364 (quoted above) say otherwise.
-#
-# The following claim by Shanks & Pottenger is possible though doubtful;
-# we'll ignore it for now.
-#     * Dublin's 1971-10-31 switch was at 02:00, even though London's was 03:00.
-#
-#
-# Whitman says Dublin Mean Time was -0:25:21, which is more precise than
-# Shanks & Pottenger.
-# Perhaps this was Dunsink Observatory Time, as Dunsink Observatory
-# (8 km NW of Dublin's center) seemingly was to Dublin as Greenwich was
-# to London.  For example:
-#
-#   "Timeball on the ballast office is down.  Dunsink time."
-#   -- James Joyce, Ulysses
-
-# From Joseph S. Myers (2005-01-26):
-# Irish laws are available online at www.irishstatutebook.ie.  These include
-# various relating to legal time, for example:
-#
-# ZZA13Y1923.html ZZA12Y1924.html ZZA8Y1925.html ZZSIV20PG1267.html
-#
-# ZZSI71Y1947.html ZZSI128Y1948.html ZZSI23Y1949.html ZZSI41Y1950.html
-# ZZSI27Y1951.html ZZSI73Y1952.html
-#
-# ZZSI11Y1961.html ZZSI232Y1961.html ZZSI182Y1962.html
-# ZZSI167Y1963.html ZZSI257Y1964.html ZZSI198Y1967.html
-# ZZA23Y1968.html ZZA17Y1971.html
-#
-# ZZSI67Y1981.html ZZSI212Y1982.html ZZSI45Y1986.html
-# ZZSI264Y1988.html ZZSI52Y1990.html ZZSI371Y1992.html
-# ZZSI395Y1994.html ZZSI484Y1997.html ZZSI506Y2001.html
-#
-# [These are all relative to the root, e.g., the first is
-# <http://www.irishstatutebook.ie/ZZA13Y1923.html>.]
-#
-# (These are those I found, but there could be more.  In any case these
-# should allow various updates to the comments in the europe file to cover
-# the laws applicable in Ireland.)
-#
-# (Note that the time in the Republic of Ireland since 1968 has been defined
-# in terms of standard time being GMT+1 with a period of winter time when it
-# is GMT, rather than standard time being GMT with a period of summer time
-# being GMT+1.)
-
-# From Paul Eggert (1999-03-28):
-# Clive Feather (<news:859845706.26043.0@office.demon.net>, 1997-03-31)
-# reports that Folkestone (Cheriton) Shuttle Terminal uses Concession Time
-# (CT), equivalent to French civil time.
-# Julian Hill (<news:36118128.5A14@virgin.net>, 1998-09-30) reports that
-# trains between Dollands Moor (the freight facility next door)
-# and Frethun run in CT.
-# My admittedly uninformed guess is that the terminal has two authorities,
-# the French concession operators and the British civil authorities,
-# and that the time depends on who you're talking to.
-# If, say, the British police were called to the station for some reason,
-# I would expect the official police report to use GMT/BST and not CET/CEST.
-# This is a borderline case, but for now let's stick to GMT/BST.
-
-# From an anonymous contributor (1996-06-02):
-# The law governing time in Ireland is under Statutory Instrument SI 395/94,
-# which gives force to European Union 7th Council Directive # 94/21/EC.
-# Under this directive, the Minister for Justice in Ireland makes appropriate
-# regulations. I spoke this morning with the Secretary of the Department of
-# Justice (tel +353 1 678 9711) who confirmed to me that the correct name is
-# "Irish Summer Time", abbreviated to "IST".
-
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-# Summer Time Act, 1916
-Rule	GB-Eire	1916	only	-	May	21	2:00s	1:00	BST
-Rule	GB-Eire	1916	only	-	Oct	 1	2:00s	0	GMT
-# S.R.&O. 1917, No. 358
-Rule	GB-Eire	1917	only	-	Apr	 8	2:00s	1:00	BST
-Rule	GB-Eire	1917	only	-	Sep	17	2:00s	0	GMT
-# S.R.&O. 1918, No. 274
-Rule	GB-Eire	1918	only	-	Mar	24	2:00s	1:00	BST
-Rule	GB-Eire	1918	only	-	Sep	30	2:00s	0	GMT
-# S.R.&O. 1919, No. 297
-Rule	GB-Eire	1919	only	-	Mar	30	2:00s	1:00	BST
-Rule	GB-Eire	1919	only	-	Sep	29	2:00s	0	GMT
-# S.R.&O. 1920, No. 458
-Rule	GB-Eire	1920	only	-	Mar	28	2:00s	1:00	BST
-# S.R.&O. 1920, No. 1844
-Rule	GB-Eire	1920	only	-	Oct	25	2:00s	0	GMT
-# S.R.&O. 1921, No. 363
-Rule	GB-Eire	1921	only	-	Apr	 3	2:00s	1:00	BST
-Rule	GB-Eire	1921	only	-	Oct	 3	2:00s	0	GMT
-# S.R.&O. 1922, No. 264
-Rule	GB-Eire	1922	only	-	Mar	26	2:00s	1:00	BST
-Rule	GB-Eire	1922	only	-	Oct	 8	2:00s	0	GMT
-# The Summer Time Act, 1922
-Rule	GB-Eire	1923	only	-	Apr	Sun>=16	2:00s	1:00	BST
-Rule	GB-Eire	1923	1924	-	Sep	Sun>=16	2:00s	0	GMT
-Rule	GB-Eire	1924	only	-	Apr	Sun>=9	2:00s	1:00	BST
-Rule	GB-Eire	1925	1926	-	Apr	Sun>=16	2:00s	1:00	BST
-# The Summer Time Act, 1925
-Rule	GB-Eire	1925	1938	-	Oct	Sun>=2	2:00s	0	GMT
-Rule	GB-Eire	1927	only	-	Apr	Sun>=9	2:00s	1:00	BST
-Rule	GB-Eire	1928	1929	-	Apr	Sun>=16	2:00s	1:00	BST
-Rule	GB-Eire	1930	only	-	Apr	Sun>=9	2:00s	1:00	BST
-Rule	GB-Eire	1931	1932	-	Apr	Sun>=16	2:00s	1:00	BST
-Rule	GB-Eire	1933	only	-	Apr	Sun>=9	2:00s	1:00	BST
-Rule	GB-Eire	1934	only	-	Apr	Sun>=16	2:00s	1:00	BST
-Rule	GB-Eire	1935	only	-	Apr	Sun>=9	2:00s	1:00	BST
-Rule	GB-Eire	1936	1937	-	Apr	Sun>=16	2:00s	1:00	BST
-Rule	GB-Eire	1938	only	-	Apr	Sun>=9	2:00s	1:00	BST
-Rule	GB-Eire	1939	only	-	Apr	Sun>=16	2:00s	1:00	BST
-# S.R.&O. 1939, No. 1379
-Rule	GB-Eire	1939	only	-	Nov	Sun>=16	2:00s	0	GMT
-# S.R.&O. 1940, No. 172 and No. 1883
-Rule	GB-Eire	1940	only	-	Feb	Sun>=23	2:00s	1:00	BST
-# S.R.&O. 1941, No. 476
-Rule	GB-Eire	1941	only	-	May	Sun>=2	1:00s	2:00	BDST
-Rule	GB-Eire	1941	1943	-	Aug	Sun>=9	1:00s	1:00	BST
-# S.R.&O. 1942, No. 506
-Rule	GB-Eire	1942	1944	-	Apr	Sun>=2	1:00s	2:00	BDST
-# S.R.&O. 1944, No. 932
-Rule	GB-Eire	1944	only	-	Sep	Sun>=16	1:00s	1:00	BST
-# S.R.&O. 1945, No. 312
-Rule	GB-Eire	1945	only	-	Apr	Mon>=2	1:00s	2:00	BDST
-Rule	GB-Eire	1945	only	-	Jul	Sun>=9	1:00s	1:00	BST
-# S.R.&O. 1945, No. 1208
-Rule	GB-Eire	1945	1946	-	Oct	Sun>=2	2:00s	0	GMT
-Rule	GB-Eire	1946	only	-	Apr	Sun>=9	2:00s	1:00	BST
-# The Summer Time Act, 1947
-Rule	GB-Eire	1947	only	-	Mar	16	2:00s	1:00	BST
-Rule	GB-Eire	1947	only	-	Apr	13	1:00s	2:00	BDST
-Rule	GB-Eire	1947	only	-	Aug	10	1:00s	1:00	BST
-Rule	GB-Eire	1947	only	-	Nov	 2	2:00s	0	GMT
-# Summer Time Order, 1948 (S.I. 1948/495)
-Rule	GB-Eire	1948	only	-	Mar	14	2:00s	1:00	BST
-Rule	GB-Eire	1948	only	-	Oct	31	2:00s	0	GMT
-# Summer Time Order, 1949 (S.I. 1949/373)
-Rule	GB-Eire	1949	only	-	Apr	 3	2:00s	1:00	BST
-Rule	GB-Eire	1949	only	-	Oct	30	2:00s	0	GMT
-# Summer Time Order, 1950 (S.I. 1950/518)
-# Summer Time Order, 1951 (S.I. 1951/430)
-# Summer Time Order, 1952 (S.I. 1952/451)
-Rule	GB-Eire	1950	1952	-	Apr	Sun>=14	2:00s	1:00	BST
-Rule	GB-Eire	1950	1952	-	Oct	Sun>=21	2:00s	0	GMT
-# revert to the rules of the Summer Time Act, 1925
-Rule	GB-Eire	1953	only	-	Apr	Sun>=16	2:00s	1:00	BST
-Rule	GB-Eire	1953	1960	-	Oct	Sun>=2	2:00s	0	GMT
-Rule	GB-Eire	1954	only	-	Apr	Sun>=9	2:00s	1:00	BST
-Rule	GB-Eire	1955	1956	-	Apr	Sun>=16	2:00s	1:00	BST
-Rule	GB-Eire	1957	only	-	Apr	Sun>=9	2:00s	1:00	BST
-Rule	GB-Eire	1958	1959	-	Apr	Sun>=16	2:00s	1:00	BST
-Rule	GB-Eire	1960	only	-	Apr	Sun>=9	2:00s	1:00	BST
-# Summer Time Order, 1961 (S.I. 1961/71)
-# Summer Time (1962) Order, 1961 (S.I. 1961/2465)
-# Summer Time Order, 1963 (S.I. 1963/81)
-Rule	GB-Eire	1961	1963	-	Mar	lastSun	2:00s	1:00	BST
-Rule	GB-Eire	1961	1968	-	Oct	Sun>=23	2:00s	0	GMT
-# Summer Time (1964) Order, 1963 (S.I. 1963/2101)
-# Summer Time Order, 1964 (S.I. 1964/1201)
-# Summer Time Order, 1967 (S.I. 1967/1148)
-Rule	GB-Eire	1964	1967	-	Mar	Sun>=19	2:00s	1:00	BST
-# Summer Time Order, 1968 (S.I. 1968/117)
-Rule	GB-Eire	1968	only	-	Feb	18	2:00s	1:00	BST
-# The British Standard Time Act, 1968
-#	(no summer time)
-# The Summer Time Act, 1972
-Rule	GB-Eire	1972	1980	-	Mar	Sun>=16	2:00s	1:00	BST
-Rule	GB-Eire	1972	1980	-	Oct	Sun>=23	2:00s	0	GMT
-# Summer Time Order, 1980 (S.I. 1980/1089)
-# Summer Time Order, 1982 (S.I. 1982/1673)
-# Summer Time Order, 1986 (S.I. 1986/223)
-# Summer Time Order, 1988 (S.I. 1988/931)
-Rule	GB-Eire	1981	1995	-	Mar	lastSun	1:00u	1:00	BST
-Rule	GB-Eire 1981	1989	-	Oct	Sun>=23	1:00u	0	GMT
-# Summer Time Order, 1989 (S.I. 1989/985)
-# Summer Time Order, 1992 (S.I. 1992/1729)
-# Summer Time Order 1994 (S.I. 1994/2798)
-Rule	GB-Eire 1990	1995	-	Oct	Sun>=22	1:00u	0	GMT
-# Summer Time Order 1997 (S.I. 1997/2982)
-# See EU for rules starting in 1996.
-
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Europe/London	-0:01:15 -	LMT	1847 Dec  1 0:00s
-			 0:00	GB-Eire	%s	1968 Oct 27
-			 1:00	-	BST	1971 Oct 31 2:00u
-			 0:00	GB-Eire	%s	1996
-			 0:00	EU	GMT/BST
-Link	Europe/London	Europe/Jersey
-Link	Europe/London	Europe/Guernsey
-Link	Europe/London	Europe/Isle_of_Man
-Zone	Europe/Dublin	-0:25:00 -	LMT	1880 Aug  2
-			-0:25:21 -	DMT	1916 May 21 2:00
-			-0:25:21 1:00	IST	1916 Oct  1 2:00s
-			 0:00	GB-Eire	%s	1921 Dec  6 # independence
-			 0:00	GB-Eire	GMT/IST	1940 Feb 25 2:00
-			 0:00	1:00	IST	1946 Oct  6 2:00
-			 0:00	-	GMT	1947 Mar 16 2:00
-			 0:00	1:00	IST	1947 Nov  2 2:00
-			 0:00	-	GMT	1948 Apr 18 2:00
-			 0:00	GB-Eire	GMT/IST	1968 Oct 27
-			 1:00	-	IST	1971 Oct 31 2:00u
-			 0:00	GB-Eire	GMT/IST	1996
-			 0:00	EU	GMT/IST
-
-###############################################################################
-
-# Europe
-
-# EU rules are for the European Union, previously known as the EC, EEC,
-# Common Market, etc.
-
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	EU	1977	1980	-	Apr	Sun>=1	 1:00u	1:00	S
-Rule	EU	1977	only	-	Sep	lastSun	 1:00u	0	-
-Rule	EU	1978	only	-	Oct	 1	 1:00u	0	-
-Rule	EU	1979	1995	-	Sep	lastSun	 1:00u	0	-
-Rule	EU	1981	max	-	Mar	lastSun	 1:00u	1:00	S
-Rule	EU	1996	max	-	Oct	lastSun	 1:00u	0	-
-# The most recent directive covers the years starting in 2002.  See:
-# <a="http://eur-lex.europa.eu/LexUriServ/LexUriServ.do?uri=CELEX:32000L0084:EN:NOT">
-# Directive 2000/84/EC of the European Parliament and of the Council
-# of 19 January 2001 on summer-time arrangements.
-# </a>
-
-# W-Eur differs from EU only in that W-Eur uses standard time.
-Rule	W-Eur	1977	1980	-	Apr	Sun>=1	 1:00s	1:00	S
-Rule	W-Eur	1977	only	-	Sep	lastSun	 1:00s	0	-
-Rule	W-Eur	1978	only	-	Oct	 1	 1:00s	0	-
-Rule	W-Eur	1979	1995	-	Sep	lastSun	 1:00s	0	-
-Rule	W-Eur	1981	max	-	Mar	lastSun	 1:00s	1:00	S
-Rule	W-Eur	1996	max	-	Oct	lastSun	 1:00s	0	-
-
-# Older C-Eur rules are for convenience in the tables.
-# From 1977 on, C-Eur differs from EU only in that C-Eur uses standard time.
-Rule	C-Eur	1916	only	-	Apr	30	23:00	1:00	S
-Rule	C-Eur	1916	only	-	Oct	 1	 1:00	0	-
-Rule	C-Eur	1917	1918	-	Apr	Mon>=15	 2:00s	1:00	S
-Rule	C-Eur	1917	1918	-	Sep	Mon>=15	 2:00s	0	-
-Rule	C-Eur	1940	only	-	Apr	 1	 2:00s	1:00	S
-Rule	C-Eur	1942	only	-	Nov	 2	 2:00s	0	-
-Rule	C-Eur	1943	only	-	Mar	29	 2:00s	1:00	S
-Rule	C-Eur	1943	only	-	Oct	 4	 2:00s	0	-
-Rule	C-Eur	1944	1945	-	Apr	Mon>=1	 2:00s	1:00	S
-# Whitman gives 1944 Oct 7; go with Shanks & Pottenger.
-Rule	C-Eur	1944	only	-	Oct	 2	 2:00s	0	-
-# From Jesper Norgaard Welen (2008-07-13):
-#
-# I found what is probably a typo of 2:00 which should perhaps be 2:00s
-# in the C-Eur rule from tz database version 2008d (this part was
-# corrected in version 2008d). The circumstancial evidence is simply the
-# tz database itself, as seen below:
-#
-# Zone Europe/Paris 0:09:21 - LMT 1891 Mar 15  0:01
-#    0:00 France WE%sT 1945 Sep 16  3:00
-#
-# Zone Europe/Monaco 0:29:32 - LMT 1891 Mar 15
-#    0:00 France WE%sT 1945 Sep 16 3:00
-#
-# Zone Europe/Belgrade 1:22:00 - LMT 1884
-#    1:00 1:00 CEST 1945 Sep 16  2:00s
-#
-# Rule France 1945 only - Sep 16  3:00 0 -
-# Rule Belgium 1945 only - Sep 16  2:00s 0 -
-# Rule Neth 1945 only - Sep 16 2:00s 0 -
-#
-# The rule line to be changed is:
-#
-# Rule C-Eur 1945 only - Sep 16  2:00 0 -
-#
-# It seems that Paris, Monaco, Rule France, Rule Belgium all agree on
-# 2:00 standard time, e.g. 3:00 local time.  However there are no
-# countries that use C-Eur rules in September 1945, so the only items
-# affected are apparently these ficticious zones that translates acronyms
-# CET and MET:
-#
-# Zone CET  1:00 C-Eur CE%sT
-# Zone MET  1:00 C-Eur ME%sT
-#
-# It this is right then the corrected version would look like:
-#
-# Rule C-Eur 1945 only - Sep 16  2:00s 0 -
-#
-# A small step for mankind though 8-)
-Rule	C-Eur	1945	only	-	Sep	16	 2:00s	0	-
-Rule	C-Eur	1977	1980	-	Apr	Sun>=1	 2:00s	1:00	S
-Rule	C-Eur	1977	only	-	Sep	lastSun	 2:00s	0	-
-Rule	C-Eur	1978	only	-	Oct	 1	 2:00s	0	-
-Rule	C-Eur	1979	1995	-	Sep	lastSun	 2:00s	0	-
-Rule	C-Eur	1981	max	-	Mar	lastSun	 2:00s	1:00	S
-Rule	C-Eur	1996	max	-	Oct	lastSun	 2:00s	0	-
-
-# E-Eur differs from EU only in that E-Eur switches at midnight local time.
-Rule	E-Eur	1977	1980	-	Apr	Sun>=1	 0:00	1:00	S
-Rule	E-Eur	1977	only	-	Sep	lastSun	 0:00	0	-
-Rule	E-Eur	1978	only	-	Oct	 1	 0:00	0	-
-Rule	E-Eur	1979	1995	-	Sep	lastSun	 0:00	0	-
-Rule	E-Eur	1981	max	-	Mar	lastSun	 0:00	1:00	S
-Rule	E-Eur	1996	max	-	Oct	lastSun	 0:00	0	-
-
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Russia	1917	only	-	Jul	 1	23:00	1:00	MST	# Moscow Summer Time
-Rule	Russia	1917	only	-	Dec	28	 0:00	0	MMT	# Moscow Mean Time
-Rule	Russia	1918	only	-	May	31	22:00	2:00	MDST	# Moscow Double Summer Time
-Rule	Russia	1918	only	-	Sep	16	 1:00	1:00	MST
-Rule	Russia	1919	only	-	May	31	23:00	2:00	MDST
-Rule	Russia	1919	only	-	Jul	 1	 2:00	1:00	S
-Rule	Russia	1919	only	-	Aug	16	 0:00	0	-
-Rule	Russia	1921	only	-	Feb	14	23:00	1:00	S
-Rule	Russia	1921	only	-	Mar	20	23:00	2:00	M # Midsummer
-Rule	Russia	1921	only	-	Sep	 1	 0:00	1:00	S
-Rule	Russia	1921	only	-	Oct	 1	 0:00	0	-
-# Act No.925 of the Council of Ministers of the USSR (1980-10-24):
-Rule	Russia	1981	1984	-	Apr	 1	 0:00	1:00	S
-Rule	Russia	1981	1983	-	Oct	 1	 0:00	0	-
-# Act No.967 of the Council of Ministers of the USSR (1984-09-13), repeated in
-# Act No.227 of the Council of Ministers of the USSR (1989-03-14):
-Rule	Russia	1984	1991	-	Sep	lastSun	 2:00s	0	-
-Rule	Russia	1985	1991	-	Mar	lastSun	 2:00s	1:00	S
-#
-Rule	Russia	1992	only	-	Mar	lastSat	 23:00	1:00	S
-Rule	Russia	1992	only	-	Sep	lastSat	 23:00	0	-
-Rule	Russia	1993	max	-	Mar	lastSun	 2:00s	1:00	S
-Rule	Russia	1993	1995	-	Sep	lastSun	 2:00s	0	-
-Rule	Russia	1996	max	-	Oct	lastSun	 2:00s	0	-
-
-# These are for backward compatibility with older versions.
-
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	WET		0:00	EU	WE%sT
-Zone	CET		1:00	C-Eur	CE%sT
-Zone	MET		1:00	C-Eur	ME%sT
-Zone	EET		2:00	EU	EE%sT
-
-# Previous editions of this database used abbreviations like MET DST
-# for Central European Summer Time, but this didn't agree with common usage.
-
-# From Markus Kuhn (1996-07-12):
-# The official German names ... are
-#
-#	Mitteleuropaeische Zeit (MEZ)         = UTC+01:00
-#	Mitteleuropaeische Sommerzeit (MESZ)  = UTC+02:00
-#
-# as defined in the German Time Act (Gesetz ueber die Zeitbestimmung (ZeitG),
-# 1978-07-25, Bundesgesetzblatt, Jahrgang 1978, Teil I, S. 1110-1111)....
-# I wrote ... to the German Federal Physical-Technical Institution
-#
-#	Physikalisch-Technische Bundesanstalt (PTB)
-#	Laboratorium 4.41 "Zeiteinheit"
-#	Postfach 3345
-#	D-38023 Braunschweig
-#	phone: +49 531 592-0
-#
-# ... I received today an answer letter from Dr. Peter Hetzel, head of the PTB
-# department for time and frequency transmission.  He explained that the
-# PTB translates MEZ and MESZ into English as
-#
-#	Central European Time (CET)         = UTC+01:00
-#	Central European Summer Time (CEST) = UTC+02:00
-
-
-# Albania
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Albania	1940	only	-	Jun	16	0:00	1:00	S
-Rule	Albania	1942	only	-	Nov	 2	3:00	0	-
-Rule	Albania	1943	only	-	Mar	29	2:00	1:00	S
-Rule	Albania	1943	only	-	Apr	10	3:00	0	-
-Rule	Albania	1974	only	-	May	 4	0:00	1:00	S
-Rule	Albania	1974	only	-	Oct	 2	0:00	0	-
-Rule	Albania	1975	only	-	May	 1	0:00	1:00	S
-Rule	Albania	1975	only	-	Oct	 2	0:00	0	-
-Rule	Albania	1976	only	-	May	 2	0:00	1:00	S
-Rule	Albania	1976	only	-	Oct	 3	0:00	0	-
-Rule	Albania	1977	only	-	May	 8	0:00	1:00	S
-Rule	Albania	1977	only	-	Oct	 2	0:00	0	-
-Rule	Albania	1978	only	-	May	 6	0:00	1:00	S
-Rule	Albania	1978	only	-	Oct	 1	0:00	0	-
-Rule	Albania	1979	only	-	May	 5	0:00	1:00	S
-Rule	Albania	1979	only	-	Sep	30	0:00	0	-
-Rule	Albania	1980	only	-	May	 3	0:00	1:00	S
-Rule	Albania	1980	only	-	Oct	 4	0:00	0	-
-Rule	Albania	1981	only	-	Apr	26	0:00	1:00	S
-Rule	Albania	1981	only	-	Sep	27	0:00	0	-
-Rule	Albania	1982	only	-	May	 2	0:00	1:00	S
-Rule	Albania	1982	only	-	Oct	 3	0:00	0	-
-Rule	Albania	1983	only	-	Apr	18	0:00	1:00	S
-Rule	Albania	1983	only	-	Oct	 1	0:00	0	-
-Rule	Albania	1984	only	-	Apr	 1	0:00	1:00	S
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Europe/Tirane	1:19:20 -	LMT	1914
-			1:00	-	CET	1940 Jun 16
-			1:00	Albania	CE%sT	1984 Jul
-			1:00	EU	CE%sT
-
-# Andorra
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Europe/Andorra	0:06:04 -	LMT	1901
-			0:00	-	WET	1946 Sep 30
-			1:00	-	CET	1985 Mar 31 2:00
-			1:00	EU	CE%sT
-
-# Austria
-
-# From Paul Eggert (2006-03-22): Shanks & Pottenger give 1918-06-16 and
-# 1945-11-18, but the Austrian Federal Office of Metrology and
-# Surveying (BEV) gives 1918-09-16 and for Vienna gives the "alleged"
-# date of 1945-04-12 with no time.  For the 1980-04-06 transition
-# Shanks & Pottenger give 02:00, the BEV 00:00.  Go with the BEV,
-# and guess 02:00 for 1945-04-12.
-
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Austria	1920	only	-	Apr	 5	2:00s	1:00	S
-Rule	Austria	1920	only	-	Sep	13	2:00s	0	-
-Rule	Austria	1946	only	-	Apr	14	2:00s	1:00	S
-Rule	Austria	1946	1948	-	Oct	Sun>=1	2:00s	0	-
-Rule	Austria	1947	only	-	Apr	 6	2:00s	1:00	S
-Rule	Austria	1948	only	-	Apr	18	2:00s	1:00	S
-Rule	Austria	1980	only	-	Apr	 6	0:00	1:00	S
-Rule	Austria	1980	only	-	Sep	28	0:00	0	-
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Europe/Vienna	1:05:20 -	LMT	1893 Apr
-			1:00	C-Eur	CE%sT	1920
-			1:00	Austria	CE%sT	1940 Apr  1 2:00s
-			1:00	C-Eur	CE%sT	1945 Apr  2 2:00s
-			1:00	1:00	CEST	1945 Apr 12 2:00s
-			1:00	-	CET	1946
-			1:00	Austria	CE%sT	1981
-			1:00	EU	CE%sT
-
-# Belarus
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Europe/Minsk	1:50:16 -	LMT	1880
-			1:50	-	MMT	1924 May 2 # Minsk Mean Time
-			2:00	-	EET	1930 Jun 21
-			3:00	-	MSK	1941 Jun 28
-			1:00	C-Eur	CE%sT	1944 Jul  3
-			3:00	Russia	MSK/MSD	1990
-			3:00	-	MSK	1991 Mar 31 2:00s
-			2:00	1:00	EEST	1991 Sep 29 2:00s
-			2:00	-	EET	1992 Mar 29 0:00s
-			2:00	1:00	EEST	1992 Sep 27 0:00s
-			2:00	Russia	EE%sT
-
-# Belgium
-#
-# From Paul Eggert (1997-07-02):
-# Entries from 1918 through 1991 are taken from:
-#	Annuaire de L'Observatoire Royal de Belgique,
-#	Avenue Circulaire, 3, B-1180 BRUXELLES, CLVIIe annee, 1991
-#	(Imprimerie HAYEZ, s.p.r.l., Rue Fin, 4, 1080 BRUXELLES, MCMXC),
-#	pp 8-9.
-# LMT before 1892 was 0:17:30, according to the official journal of Belgium:
-#	Moniteur Belge, Samedi 30 Avril 1892, N.121.
-# Thanks to Pascal Delmoitie for these references.
-# The 1918 rules are listed for completeness; they apply to unoccupied Belgium.
-# Assume Brussels switched to WET in 1918 when the armistice took effect.
-#
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Belgium	1918	only	-	Mar	 9	 0:00s	1:00	S
-Rule	Belgium	1918	1919	-	Oct	Sat>=1	23:00s	0	-
-Rule	Belgium	1919	only	-	Mar	 1	23:00s	1:00	S
-Rule	Belgium	1920	only	-	Feb	14	23:00s	1:00	S
-Rule	Belgium	1920	only	-	Oct	23	23:00s	0	-
-Rule	Belgium	1921	only	-	Mar	14	23:00s	1:00	S
-Rule	Belgium	1921	only	-	Oct	25	23:00s	0	-
-Rule	Belgium	1922	only	-	Mar	25	23:00s	1:00	S
-Rule	Belgium	1922	1927	-	Oct	Sat>=1	23:00s	0	-
-Rule	Belgium	1923	only	-	Apr	21	23:00s	1:00	S
-Rule	Belgium	1924	only	-	Mar	29	23:00s	1:00	S
-Rule	Belgium	1925	only	-	Apr	 4	23:00s	1:00	S
-# DSH writes that a royal decree of 1926-02-22 specified the Sun following 3rd
-# Sat in Apr (except if it's Easter, in which case it's one Sunday earlier),
-# to Sun following 1st Sat in Oct, and that a royal decree of 1928-09-15
-# changed the transition times to 02:00 GMT.
-Rule	Belgium	1926	only	-	Apr	17	23:00s	1:00	S
-Rule	Belgium	1927	only	-	Apr	 9	23:00s	1:00	S
-Rule	Belgium	1928	only	-	Apr	14	23:00s	1:00	S
-Rule	Belgium	1928	1938	-	Oct	Sun>=2	 2:00s	0	-
-Rule	Belgium	1929	only	-	Apr	21	 2:00s	1:00	S
-Rule	Belgium	1930	only	-	Apr	13	 2:00s	1:00	S
-Rule	Belgium	1931	only	-	Apr	19	 2:00s	1:00	S
-Rule	Belgium	1932	only	-	Apr	 3	 2:00s	1:00	S
-Rule	Belgium	1933	only	-	Mar	26	 2:00s	1:00	S
-Rule	Belgium	1934	only	-	Apr	 8	 2:00s	1:00	S
-Rule	Belgium	1935	only	-	Mar	31	 2:00s	1:00	S
-Rule	Belgium	1936	only	-	Apr	19	 2:00s	1:00	S
-Rule	Belgium	1937	only	-	Apr	 4	 2:00s	1:00	S
-Rule	Belgium	1938	only	-	Mar	27	 2:00s	1:00	S
-Rule	Belgium	1939	only	-	Apr	16	 2:00s	1:00	S
-Rule	Belgium	1939	only	-	Nov	19	 2:00s	0	-
-Rule	Belgium	1940	only	-	Feb	25	 2:00s	1:00	S
-Rule	Belgium	1944	only	-	Sep	17	 2:00s	0	-
-Rule	Belgium	1945	only	-	Apr	 2	 2:00s	1:00	S
-Rule	Belgium	1945	only	-	Sep	16	 2:00s	0	-
-Rule	Belgium	1946	only	-	May	19	 2:00s	1:00	S
-Rule	Belgium	1946	only	-	Oct	 7	 2:00s	0	-
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Europe/Brussels	0:17:30 -	LMT	1880
-			0:17:30	-	BMT	1892 May  1 12:00 # Brussels MT
-			0:00	-	WET	1914 Nov  8
-			1:00	-	CET	1916 May  1  0:00
-			1:00	C-Eur	CE%sT	1918 Nov 11 11:00u
-			0:00	Belgium	WE%sT	1940 May 20  2:00s
-			1:00	C-Eur	CE%sT	1944 Sep  3
-			1:00	Belgium	CE%sT	1977
-			1:00	EU	CE%sT
-
-# Bosnia and Herzegovina
-# see Serbia
-
-# Bulgaria
-#
-# From Plamen Simenov via Steffen Thorsen (1999-09-09):
-# A document of Government of Bulgaria (No.94/1997) says:
-# EET --> EETDST is in 03:00 Local time in last Sunday of March ...
-# EETDST --> EET is in 04:00 Local time in last Sunday of October
-#
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Bulg	1979	only	-	Mar	31	23:00	1:00	S
-Rule	Bulg	1979	only	-	Oct	 1	 1:00	0	-
-Rule	Bulg	1980	1982	-	Apr	Sat>=1	23:00	1:00	S
-Rule	Bulg	1980	only	-	Sep	29	 1:00	0	-
-Rule	Bulg	1981	only	-	Sep	27	 2:00	0	-
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Europe/Sofia	1:33:16 -	LMT	1880
-			1:56:56	-	IMT	1894 Nov 30 # Istanbul MT?
-			2:00	-	EET	1942 Nov  2  3:00
-			1:00	C-Eur	CE%sT	1945
-			1:00	-	CET	1945 Apr 2 3:00
-			2:00	-	EET	1979 Mar 31 23:00
-			2:00	Bulg	EE%sT	1982 Sep 26  2:00
-			2:00	C-Eur	EE%sT	1991
-			2:00	E-Eur	EE%sT	1997
-			2:00	EU	EE%sT
-
-# Croatia
-# see Serbia
-
-# Cyprus
-# Please see the `asia' file for Asia/Nicosia.
-
-# Czech Republic
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Czech	1945	only	-	Apr	 8	2:00s	1:00	S
-Rule	Czech	1945	only	-	Nov	18	2:00s	0	-
-Rule	Czech	1946	only	-	May	 6	2:00s	1:00	S
-Rule	Czech	1946	1949	-	Oct	Sun>=1	2:00s	0	-
-Rule	Czech	1947	only	-	Apr	20	2:00s	1:00	S
-Rule	Czech	1948	only	-	Apr	18	2:00s	1:00	S
-Rule	Czech	1949	only	-	Apr	 9	2:00s	1:00	S
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Europe/Prague	0:57:44 -	LMT	1850
-			0:57:44	-	PMT	1891 Oct     # Prague Mean Time
-			1:00	C-Eur	CE%sT	1944 Sep 17 2:00s
-			1:00	Czech	CE%sT	1979
-			1:00	EU	CE%sT
-
-# Denmark, Faroe Islands, and Greenland
-
-# From Jesper Norgaard Welen (2005-04-26):
-# http://www.hum.aau.dk/~poe/tid/tine/DanskTid.htm says that the law
-# [introducing standard time] was in effect from 1894-01-01....
-# The page http://www.retsinfo.dk/_GETDOCI_/ACCN/A18930008330-REGL
-# confirms this, and states that the law was put forth 1893-03-29.
-#
-# The EU treaty with effect from 1973:
-# http://www.retsinfo.dk/_GETDOCI_/ACCN/A19722110030-REGL
-#
-# This provoked a new law from 1974 to make possible summer time changes
-# in subsequenet decrees with the law
-# http://www.retsinfo.dk/_GETDOCI_/ACCN/A19740022330-REGL
-#
-# It seems however that no decree was set forward until 1980.  I have
-# not found any decree, but in another related law, the effecting DST
-# changes are stated explicitly to be from 1980-04-06 at 02:00 to
-# 1980-09-28 at 02:00.  If this is true, this differs slightly from
-# the EU rule in that DST runs to 02:00, not 03:00.  We don't know
-# when Denmark began using the EU rule correctly, but we have only
-# confirmation of the 1980-time, so I presume it was correct in 1981:
-# The law is about the management of the extra hour, concerning
-# working hours reported and effect on obligatory-rest rules (which
-# was suspended on that night):
-# http://www.retsinfo.dk/_GETDOCI_/ACCN/C19801120554-REGL
-
-# From Jesper Norgaard Welen (2005-06-11):
-# The Herning Folkeblad (1980-09-26) reported that the night between
-# Saturday and Sunday the clock is set back from three to two.
-
-# From Paul Eggert (2005-06-11):
-# Hence the "02:00" of the 1980 law refers to standard time, not
-# wall-clock time, and so the EU rules were in effect in 1980.
-
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Denmark	1916	only	-	May	14	23:00	1:00	S
-Rule	Denmark	1916	only	-	Sep	30	23:00	0	-
-Rule	Denmark	1940	only	-	May	15	 0:00	1:00	S
-Rule	Denmark	1945	only	-	Apr	 2	 2:00s	1:00	S
-Rule	Denmark	1945	only	-	Aug	15	 2:00s	0	-
-Rule	Denmark	1946	only	-	May	 1	 2:00s	1:00	S
-Rule	Denmark	1946	only	-	Sep	 1	 2:00s	0	-
-Rule	Denmark	1947	only	-	May	 4	 2:00s	1:00	S
-Rule	Denmark	1947	only	-	Aug	10	 2:00s	0	-
-Rule	Denmark	1948	only	-	May	 9	 2:00s	1:00	S
-Rule	Denmark	1948	only	-	Aug	 8	 2:00s	0	-
-#
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone Europe/Copenhagen	 0:50:20 -	LMT	1890
-			 0:50:20 -	CMT	1894 Jan  1 # Copenhagen MT
-			 1:00	Denmark	CE%sT	1942 Nov  2 2:00s
-			 1:00	C-Eur	CE%sT	1945 Apr  2 2:00
-			 1:00	Denmark	CE%sT	1980
-			 1:00	EU	CE%sT
-Zone Atlantic/Faroe	-0:27:04 -	LMT	1908 Jan 11	# Torshavn
-			 0:00	-	WET	1981
-			 0:00	EU	WE%sT
-#
-# From Paul Eggert (2004-10-31):
-# During World War II, Germany maintained secret manned weather stations in
-# East Greenland and Franz Josef Land, but we don't know their time zones.
-# My source for this is Wilhelm Dege's book mentioned under Svalbard.
-#
-# From Paul Eggert (2006-03-22):
-# Greenland joined the EU as part of Denmark, obtained home rule on 1979-05-01,
-# and left the EU on 1985-02-01.  It therefore should have been using EU
-# rules at least through 1984.  Shanks & Pottenger say Scoresbysund and Godthab
-# used C-Eur rules after 1980, but IATA SSIM (1991/1996) says they use EU
-# rules since at least 1991.  Assume EU rules since 1980.
-
-# From Gwillin Law (2001-06-06), citing
-# <http://www.statkart.no/efs/efshefter/2001/efs5-2001.pdf> (2001-03-15),
-# and with translations corrected by Steffen Thorsen:
-#
-# Greenland has four local times, and the relation to UTC
-# is according to the following time line:
-#
-# The military zone near Thule	UTC-4
-# Standard Greenland time	UTC-3
-# Scoresbysund			UTC-1
-# Danmarkshavn			UTC
-#
-# In the military area near Thule and in Danmarkshavn DST will not be
-# introduced.
-
-# From Rives McDow (2001-11-01):
-#
-# I correspond regularly with the Dansk Polarcenter, and wrote them at
-# the time to clarify the situation in Thule.  Unfortunately, I have
-# not heard back from them regarding my recent letter.  [But I have
-# info from earlier correspondence.]
-#
-# According to the center, a very small local time zone around Thule
-# Air Base keeps the time according to UTC-4, implementing daylight
-# savings using North America rules, changing the time at 02:00 local time....
-#
-# The east coast of Greenland north of the community of Scoresbysund
-# uses UTC in the same way as in Iceland, year round, with no dst.
-# There are just a few stations on this coast, including the
-# Danmarkshavn ICAO weather station mentioned in your September 29th
-# email.  The other stations are two sledge patrol stations in
-# Mestersvig and Daneborg, the air force base at Station Nord, and the
-# DPC research station at Zackenberg.
-#
-# Scoresbysund and two small villages nearby keep time UTC-1 and use
-# the same daylight savings time period as in West Greenland (Godthab).
-#
-# The rest of Greenland, including Godthab (this area, although it
-# includes central Greenland, is known as west Greenland), keeps time
-# UTC-3, with daylight savings methods according to European rules.
-#
-# It is common procedure to use UTC 0 in the wilderness of East and
-# North Greenland, because it is mainly Icelandic aircraft operators
-# maintaining traffic in these areas.  However, the official status of
-# this area is that it sticks with Godthab time.  This area might be
-# considered a dual time zone in some respects because of this.
-
-# From Rives McDow (2001-11-19):
-# I heard back from someone stationed at Thule; the time change took place
-# there at 2:00 AM.
-
-# From Paul Eggert (2006-03-22):
-# From 1997 on the CIA map shows Danmarkshavn on GMT;
-# the 1995 map as like Godthab.
-# For lack of better info, assume they were like Godthab before 1996.
-# startkart.no says Thule does not observe DST, but this is clearly an error,
-# so go with Shanks & Pottenger for Thule transitions until this year.
-# For 2007 on assume Thule will stay in sync with US DST rules.
-#
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Thule	1991	1992	-	Mar	lastSun	2:00	1:00	D
-Rule	Thule	1991	1992	-	Sep	lastSun	2:00	0	S
-Rule	Thule	1993	2006	-	Apr	Sun>=1	2:00	1:00	D
-Rule	Thule	1993	2006	-	Oct	lastSun	2:00	0	S
-Rule	Thule	2007	max	-	Mar	Sun>=8	2:00	1:00	D
-Rule	Thule	2007	max	-	Nov	Sun>=1	2:00	0	S
-#
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone America/Danmarkshavn -1:14:40 -	LMT	1916 Jul 28
-			-3:00	-	WGT	1980 Apr  6 2:00
-			-3:00	EU	WG%sT	1996
-			0:00	-	GMT
-Zone America/Scoresbysund -1:27:52 -	LMT	1916 Jul 28 # Ittoqqortoormiit
-			-2:00	-	CGT	1980 Apr  6 2:00
-			-2:00	C-Eur	CG%sT	1981 Mar 29
-			-1:00	EU	EG%sT
-Zone America/Godthab	-3:26:56 -	LMT	1916 Jul 28 # Nuuk
-			-3:00	-	WGT	1980 Apr  6 2:00
-			-3:00	EU	WG%sT
-Zone America/Thule	-4:35:08 -	LMT	1916 Jul 28 # Pituffik air base
-			-4:00	Thule	A%sT
-
-# Estonia
-# From Peter Ilieve (1994-10-15):
-# A relative in Tallinn confirms the accuracy of the data for 1989 onwards
-# [through 1994] and gives the legal authority for it,
-# a regulation of the Government of Estonia, No. 111 of 1989....
-#
-# From Peter Ilieve (1996-10-28):
-# [IATA SSIM (1992/1996) claims that the Baltic republics switch at 01:00s,
-# but a relative confirms that Estonia still switches at 02:00s, writing:]
-# ``I do not [know] exactly but there are some little different
-# (confusing) rules for International Air and Railway Transport Schedules
-# conversion in Sunday connected with end of summer time in Estonia....
-# A discussion is running about the summer time efficiency and effect on
-# human physiology.  It seems that Estonia maybe will not change to
-# summer time next spring.''
-
-# From Peter Ilieve (1998-11-04), heavily edited:
-# <a href="http://trip.rk.ee/cgi-bin/thw?${BASE}=akt&${OOHTML}=rtd&TA=1998&TO=1&AN=1390">
-# The 1998-09-22 Estonian time law
-# </a>
-# refers to the Eighth Directive and cites the association agreement between
-# the EU and Estonia, ratified by the Estonian law (RT II 1995, 22--27, 120).
-#
-# I also asked [my relative] whether they use any standard abbreviation
-# for their standard and summer times. He says no, they use "suveaeg"
-# (summer time) and "talveaeg" (winter time).
-
-# From <a href="http://www.baltictimes.com/">The Baltic Times</a> (1999-09-09)
-# via Steffen Thorsen:
-# This year will mark the last time Estonia shifts to summer time,
-# a council of the ruling coalition announced Sept. 6....
-# But what this could mean for Estonia's chances of joining the European
-# Union are still unclear.  In 1994, the EU declared summer time compulsory
-# for all member states until 2001.  Brussels has yet to decide what to do
-# after that.
-
-# From Mart Oruaas (2000-01-29):
-# Regulation no. 301 (1999-10-12) obsoletes previous regulation
-# no. 206 (1998-09-22) and thus sticks Estonia to +02:00 GMT for all
-# the year round.  The regulation is effective 1999-11-01.
-
-# From Toomas Soome (2002-02-21):
-# The Estonian government has changed once again timezone politics.
-# Now we are using again EU rules.
-#
-# From Urmet Jaanes (2002-03-28):
-# The legislative reference is Government decree No. 84 on 2002-02-21.
-
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Europe/Tallinn	1:39:00	-	LMT	1880
-			1:39:00	-	TMT	1918 Feb # Tallinn Mean Time
-			1:00	C-Eur	CE%sT	1919 Jul
-			1:39:00	-	TMT	1921 May
-			2:00	-	EET	1940 Aug  6
-			3:00	-	MSK	1941 Sep 15
-			1:00	C-Eur	CE%sT	1944 Sep 22
-			3:00	Russia	MSK/MSD	1989 Mar 26 2:00s
-			2:00	1:00	EEST	1989 Sep 24 2:00s
-			2:00	C-Eur	EE%sT	1998 Sep 22
-			2:00	EU	EE%sT	1999 Nov  1
-			2:00	-	EET	2002 Feb 21
-			2:00	EU	EE%sT
-
-# Finland
-#
-# From Hannu Strang (1994-09-25 06:03:37 UTC):
-# Well, here in Helsinki we're just changing from summer time to regular one,
-# and it's supposed to change at 4am...
-#
-# From Paul Eggert (2006-03-22):
-# Shanks & Pottenger say Finland has switched at 02:00 standard time
-# since 1981.  Go with Strang instead.
-#
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Finland	1942	only	-	Apr	3	0:00	1:00	S
-Rule	Finland	1942	only	-	Oct	3	0:00	0	-
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Europe/Helsinki	1:39:52 -	LMT	1878 May 31
-			1:39:52	-	HMT	1921 May    # Helsinki Mean Time
-			2:00	Finland	EE%sT	1981 Mar 29 2:00
-			2:00	EU	EE%sT
-
-# Aaland Is
-Link	Europe/Helsinki	Europe/Mariehamn
-
-
-# France
-
-# From Ciro Discepolo (2000-12-20):
-#
-# Henri Le Corre, Regimes Horaires pour le monde entier, Editions
-# Traditionnelles - Paris 2 books, 1993
-#
-# Gabriel, Traite de l'heure dans le monde, Guy Tredaniel editeur,
-# Paris, 1991
-#
-# Francoise Gauquelin, Problemes de l'heure resolus en astrologie,
-# Guy tredaniel, Paris 1987
-
-
-#
-# Shank & Pottenger seem to use `24:00' ambiguously; resolve it with Whitman.
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	France	1916	only	-	Jun	14	23:00s	1:00	S
-Rule	France	1916	1919	-	Oct	Sun>=1	23:00s	0	-
-Rule	France	1917	only	-	Mar	24	23:00s	1:00	S
-Rule	France	1918	only	-	Mar	 9	23:00s	1:00	S
-Rule	France	1919	only	-	Mar	 1	23:00s	1:00	S
-Rule	France	1920	only	-	Feb	14	23:00s	1:00	S
-Rule	France	1920	only	-	Oct	23	23:00s	0	-
-Rule	France	1921	only	-	Mar	14	23:00s	1:00	S
-Rule	France	1921	only	-	Oct	25	23:00s	0	-
-Rule	France	1922	only	-	Mar	25	23:00s	1:00	S
-# DSH writes that a law of 1923-05-24 specified 3rd Sat in Apr at 23:00 to 1st
-# Sat in Oct at 24:00; and that in 1930, because of Easter, the transitions
-# were Apr 12 and Oct 5.  Go with Shanks & Pottenger.
-Rule	France	1922	1938	-	Oct	Sat>=1	23:00s	0	-
-Rule	France	1923	only	-	May	26	23:00s	1:00	S
-Rule	France	1924	only	-	Mar	29	23:00s	1:00	S
-Rule	France	1925	only	-	Apr	 4	23:00s	1:00	S
-Rule	France	1926	only	-	Apr	17	23:00s	1:00	S
-Rule	France	1927	only	-	Apr	 9	23:00s	1:00	S
-Rule	France	1928	only	-	Apr	14	23:00s	1:00	S
-Rule	France	1929	only	-	Apr	20	23:00s	1:00	S
-Rule	France	1930	only	-	Apr	12	23:00s	1:00	S
-Rule	France	1931	only	-	Apr	18	23:00s	1:00	S
-Rule	France	1932	only	-	Apr	 2	23:00s	1:00	S
-Rule	France	1933	only	-	Mar	25	23:00s	1:00	S
-Rule	France	1934	only	-	Apr	 7	23:00s	1:00	S
-Rule	France	1935	only	-	Mar	30	23:00s	1:00	S
-Rule	France	1936	only	-	Apr	18	23:00s	1:00	S
-Rule	France	1937	only	-	Apr	 3	23:00s	1:00	S
-Rule	France	1938	only	-	Mar	26	23:00s	1:00	S
-Rule	France	1939	only	-	Apr	15	23:00s	1:00	S
-Rule	France	1939	only	-	Nov	18	23:00s	0	-
-Rule	France	1940	only	-	Feb	25	 2:00	1:00	S
-# The French rules for 1941-1944 were not used in Paris, but Shanks & Pottenger
-# write that they were used in Monaco and in many French locations.
-# Le Corre writes that the upper limit of the free zone was Arneguy, Orthez,
-# Mont-de-Marsan, Bazas, Langon, Lamotte-Montravel, Marouil, La
-# Rochefoucault, Champagne-Mouton, La Roche-Posay, La Haye-Decartes,
-# Loches, Montrichard, Vierzon, Bourges, Moulins, Digoin,
-# Paray-le-Monial, Montceau-les-Mines, Chalons-sur-Saone, Arbois,
-# Dole, Morez, St-Claude, and Collognes (Haute-Savioe).
-Rule	France	1941	only	-	May	 5	 0:00	2:00	M # Midsummer
-# Shanks & Pottenger say this transition occurred at Oct 6 1:00,
-# but go with Denis Excoffier (1997-12-12),
-# who quotes the Ephemerides Astronomiques for 1998 from Bureau des Longitudes
-# as saying 5/10/41 22hUT.
-Rule	France	1941	only	-	Oct	 6	 0:00	1:00	S
-Rule	France	1942	only	-	Mar	 9	 0:00	2:00	M
-Rule	France	1942	only	-	Nov	 2	 3:00	1:00	S
-Rule	France	1943	only	-	Mar	29	 2:00	2:00	M
-Rule	France	1943	only	-	Oct	 4	 3:00	1:00	S
-Rule	France	1944	only	-	Apr	 3	 2:00	2:00	M
-Rule	France	1944	only	-	Oct	 8	 1:00	1:00	S
-Rule	France	1945	only	-	Apr	 2	 2:00	2:00	M
-Rule	France	1945	only	-	Sep	16	 3:00	0	-
-# Shanks & Pottenger give Mar 28 2:00 and Sep 26 3:00;
-# go with Excoffier's 28/3/76 0hUT and 25/9/76 23hUT.
-Rule	France	1976	only	-	Mar	28	 1:00	1:00	S
-Rule	France	1976	only	-	Sep	26	 1:00	0	-
-# Shanks & Pottenger give 0:09:20 for Paris Mean Time, and Whitman 0:09:05,
-# but Howse quotes the actual French legislation as saying 0:09:21.
-# Go with Howse.  Howse writes that the time in France was officially based
-# on PMT-0:09:21 until 1978-08-09, when the time base finally switched to UTC.
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Europe/Paris	0:09:21 -	LMT	1891 Mar 15  0:01
-			0:09:21	-	PMT	1911 Mar 11  0:01  # Paris MT
-# Shanks & Pottenger give 1940 Jun 14 0:00; go with Excoffier and Le Corre.
-			0:00	France	WE%sT	1940 Jun 14 23:00
-# Le Corre says Paris stuck with occupied-France time after the liberation;
-# go with Shanks & Pottenger.
-			1:00	C-Eur	CE%sT	1944 Aug 25
-			0:00	France	WE%sT	1945 Sep 16  3:00
-			1:00	France	CE%sT	1977
-			1:00	EU	CE%sT
-
-# Germany
-
-# From Markus Kuhn (1998-09-29):
-# The German time zone web site by the Physikalisch-Technische
-# Bundesanstalt contains DST information back to 1916.
-# [See tz-link.htm for the URL.]
-
-# From Joerg Schilling (2002-10-23):
-# In 1945, Berlin was switched to Moscow Summer time (GMT+4) by
-# <a href="http://www.dhm.de/lemo/html/biografien/BersarinNikolai/">
-# General [Nikolai] Bersarin</a>.
-
-# From Paul Eggert (2003-03-08):
-# <a href="http://www.parlament-berlin.de/pds-fraktion.nsf/727459127c8b66ee8525662300459099/defc77cb784f180ac1256c2b0030274b/$FILE/bersarint.pdf">
-# http://www.parlament-berlin.de/pds-fraktion.nsf/727459127c8b66ee8525662300459099/defc77cb784f180ac1256c2b0030274b/$FILE/bersarint.pdf
-# </a>
-# says that Bersarin issued an order to use Moscow time on May 20.
-# However, Moscow did not observe daylight saving in 1945, so
-# this was equivalent to CEMT (GMT+3), not GMT+4.
-
-
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Germany	1946	only	-	Apr	14	2:00s	1:00	S
-Rule	Germany	1946	only	-	Oct	 7	2:00s	0	-
-Rule	Germany	1947	1949	-	Oct	Sun>=1	2:00s	0	-
-# http://www.ptb.de/de/org/4/44/441/salt.htm says the following transition
-# occurred at 3:00 MEZ, not the 2:00 MEZ given in Shanks & Pottenger.
-# Go with the PTB.
-Rule	Germany	1947	only	-	Apr	 6	3:00s	1:00	S
-Rule	Germany	1947	only	-	May	11	2:00s	2:00	M
-Rule	Germany	1947	only	-	Jun	29	3:00	1:00	S
-Rule	Germany	1948	only	-	Apr	18	2:00s	1:00	S
-Rule	Germany	1949	only	-	Apr	10	2:00s	1:00	S
-
-Rule SovietZone	1945	only	-	May	24	2:00	2:00	M # Midsummer
-Rule SovietZone	1945	only	-	Sep	24	3:00	1:00	S
-Rule SovietZone	1945	only	-	Nov	18	2:00s	0	-
-
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Europe/Berlin	0:53:28 -	LMT	1893 Apr
-			1:00	C-Eur	CE%sT	1945 May 24 2:00
-			1:00 SovietZone	CE%sT	1946
-			1:00	Germany	CE%sT	1980
-			1:00	EU	CE%sT
-
-# Georgia
-# Please see the "asia" file for Asia/Tbilisi.
-# Herodotus (Histories, IV.45) says Georgia north of the Phasis (now Rioni)
-# is in Europe.  Our reference location Tbilisi is in the Asian part.
-
-# Gibraltar
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone Europe/Gibraltar	-0:21:24 -	LMT	1880 Aug  2 0:00s
-			0:00	GB-Eire	%s	1957 Apr 14 2:00
-			1:00	-	CET	1982
-			1:00	EU	CE%sT
-
-# Greece
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-# Whitman gives 1932 Jul 5 - Nov 1; go with Shanks & Pottenger.
-Rule	Greece	1932	only	-	Jul	 7	0:00	1:00	S
-Rule	Greece	1932	only	-	Sep	 1	0:00	0	-
-# Whitman gives 1941 Apr 25 - ?; go with Shanks & Pottenger.
-Rule	Greece	1941	only	-	Apr	 7	0:00	1:00	S
-# Whitman gives 1942 Feb 2 - ?; go with Shanks & Pottenger.
-Rule	Greece	1942	only	-	Nov	 2	3:00	0	-
-Rule	Greece	1943	only	-	Mar	30	0:00	1:00	S
-Rule	Greece	1943	only	-	Oct	 4	0:00	0	-
-# Whitman gives 1944 Oct 3 - Oct 31; go with Shanks & Pottenger.
-Rule	Greece	1952	only	-	Jul	 1	0:00	1:00	S
-Rule	Greece	1952	only	-	Nov	 2	0:00	0	-
-Rule	Greece	1975	only	-	Apr	12	0:00s	1:00	S
-Rule	Greece	1975	only	-	Nov	26	0:00s	0	-
-Rule	Greece	1976	only	-	Apr	11	2:00s	1:00	S
-Rule	Greece	1976	only	-	Oct	10	2:00s	0	-
-Rule	Greece	1977	1978	-	Apr	Sun>=1	2:00s	1:00	S
-Rule	Greece	1977	only	-	Sep	26	2:00s	0	-
-Rule	Greece	1978	only	-	Sep	24	4:00	0	-
-Rule	Greece	1979	only	-	Apr	 1	9:00	1:00	S
-Rule	Greece	1979	only	-	Sep	29	2:00	0	-
-Rule	Greece	1980	only	-	Apr	 1	0:00	1:00	S
-Rule	Greece	1980	only	-	Sep	28	0:00	0	-
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Europe/Athens	1:34:52 -	LMT	1895 Sep 14
-			1:34:52	-	AMT	1916 Jul 28 0:01     # Athens MT
-			2:00	Greece	EE%sT	1941 Apr 30
-			1:00	Greece	CE%sT	1944 Apr  4
-			2:00	Greece	EE%sT	1981
-			# Shanks & Pottenger say it switched to C-Eur in 1981;
-			# go with EU instead, since Greece joined it on Jan 1.
-			2:00	EU	EE%sT
-
-# Hungary
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Hungary	1918	only	-	Apr	 1	 3:00	1:00	S
-Rule	Hungary	1918	only	-	Sep	29	 3:00	0	-
-Rule	Hungary	1919	only	-	Apr	15	 3:00	1:00	S
-Rule	Hungary	1919	only	-	Sep	15	 3:00	0	-
-Rule	Hungary	1920	only	-	Apr	 5	 3:00	1:00	S
-Rule	Hungary	1920	only	-	Sep	30	 3:00	0	-
-Rule	Hungary	1945	only	-	May	 1	23:00	1:00	S
-Rule	Hungary	1945	only	-	Nov	 3	 0:00	0	-
-Rule	Hungary	1946	only	-	Mar	31	 2:00s	1:00	S
-Rule	Hungary	1946	1949	-	Oct	Sun>=1	 2:00s	0	-
-Rule	Hungary	1947	1949	-	Apr	Sun>=4	 2:00s	1:00	S
-Rule	Hungary	1950	only	-	Apr	17	 2:00s	1:00	S
-Rule	Hungary	1950	only	-	Oct	23	 2:00s	0	-
-Rule	Hungary	1954	1955	-	May	23	 0:00	1:00	S
-Rule	Hungary	1954	1955	-	Oct	 3	 0:00	0	-
-Rule	Hungary	1956	only	-	Jun	Sun>=1	 0:00	1:00	S
-Rule	Hungary	1956	only	-	Sep	lastSun	 0:00	0	-
-Rule	Hungary	1957	only	-	Jun	Sun>=1	 1:00	1:00	S
-Rule	Hungary	1957	only	-	Sep	lastSun	 3:00	0	-
-Rule	Hungary	1980	only	-	Apr	 6	 1:00	1:00	S
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Europe/Budapest	1:16:20 -	LMT	1890 Oct
-			1:00	C-Eur	CE%sT	1918
-			1:00	Hungary	CE%sT	1941 Apr  6  2:00
-			1:00	C-Eur	CE%sT	1945
-			1:00	Hungary	CE%sT	1980 Sep 28  2:00s
-			1:00	EU	CE%sT
-
-# Iceland
-#
-# From Adam David (1993-11-06):
-# The name of the timezone in Iceland for system / mail / news purposes is GMT.
-#
-# (1993-12-05):
-# This material is paraphrased from the 1988 edition of the University of
-# Iceland Almanak.
-#
-# From January 1st, 1908 the whole of Iceland was standardised at 1 hour
-# behind GMT. Previously, local mean solar time was used in different parts
-# of Iceland, the almanak had been based on Reykjavik mean solar time which
-# was 1 hour and 28 minutes behind GMT.
-#
-# "first day of winter" referred to [below] means the first day of the 26 weeks
-# of winter, according to the old icelandic calendar that dates back to the
-# time the norsemen first settled Iceland.  The first day of winter is always
-# Saturday, but is not dependent on the Julian or Gregorian calendars.
-#
-# (1993-12-10):
-# I have a reference from the Oxford Icelandic-English dictionary for the
-# beginning of winter, which ties it to the ecclesiastical calendar (and thus
-# to the julian/gregorian calendar) over the period in question.
-#	the winter begins on the Saturday next before St. Luke's day
-#	(old style), or on St. Luke's day, if a Saturday.
-# St. Luke's day ought to be traceable from ecclesiastical sources. "old style"
-# might be a reference to the Julian calendar as opposed to Gregorian, or it
-# might mean something else (???).
-#
-# From Paul Eggert (2006-03-22):
-# The Iceland Almanak, Shanks & Pottenger, and Whitman disagree on many points.
-# We go with the Almanak, except for one claim from Shanks & Pottenger, namely
-# that Reykavik was 21W57 from 1837 to 1908, local mean time before that.
-#
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Iceland	1917	1918	-	Feb	19	23:00	1:00	S
-Rule	Iceland	1917	only	-	Oct	21	 1:00	0	-
-Rule	Iceland	1918	only	-	Nov	16	 1:00	0	-
-Rule	Iceland	1939	only	-	Apr	29	23:00	1:00	S
-Rule	Iceland	1939	only	-	Nov	29	 2:00	0	-
-Rule	Iceland	1940	only	-	Feb	25	 2:00	1:00	S
-Rule	Iceland	1940	only	-	Nov	 3	 2:00	0	-
-Rule	Iceland	1941	only	-	Mar	 2	 1:00s	1:00	S
-Rule	Iceland	1941	only	-	Nov	 2	 1:00s	0	-
-Rule	Iceland	1942	only	-	Mar	 8	 1:00s	1:00	S
-Rule	Iceland	1942	only	-	Oct	25	 1:00s	0	-
-# 1943-1946 - first Sunday in March until first Sunday in winter
-Rule	Iceland	1943	1946	-	Mar	Sun>=1	 1:00s	1:00	S
-Rule	Iceland	1943	1948	-	Oct	Sun>=22	 1:00s	0	-
-# 1947-1967 - first Sunday in April until first Sunday in winter
-Rule	Iceland	1947	1967	-	Apr	Sun>=1	 1:00s	1:00	S
-# 1949 Oct transition delayed by 1 week
-Rule	Iceland	1949	only	-	Oct	30	 1:00s	0	-
-Rule	Iceland	1950	1966	-	Oct	Sun>=22	 1:00s	0	-
-Rule	Iceland	1967	only	-	Oct	29	 1:00s	0	-
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone Atlantic/Reykjavik	-1:27:24 -	LMT	1837
-			-1:27:48 -	RMT	1908 # Reykjavik Mean Time?
-			-1:00	Iceland	IS%sT	1968 Apr 7 1:00s
-			 0:00	-	GMT
-
-# Italy
-#
-# From Paul Eggert (2001-03-06):
-# Sicily and Sardinia each had their own time zones from 1866 to 1893,
-# called Palermo Time (+00:53:28) and Cagliari Time (+00:36:32).
-# During World War II, German-controlled Italy used German time.
-# But these events all occurred before the 1970 cutoff,
-# so record only the time in Rome.
-#
-# From Paul Eggert (2006-03-22):
-# For Italian DST we have three sources: Shanks & Pottenger, Whitman, and
-# F. Pollastri
-# <a href="http://toi.iriti.cnr.it/uk/ienitlt.html">
-# Day-light Saving Time in Italy (2006-02-03)
-# </a>
-# (`FP' below), taken from an Italian National Electrotechnical Institute
-# publication. When the three sources disagree, guess who's right, as follows:
-#
-# year	FP	Shanks&P. (S)	Whitman (W)	Go with:
-# 1916	06-03	06-03 24:00	06-03 00:00	FP & W
-#	09-30	09-30 24:00	09-30 01:00	FP; guess 24:00s
-# 1917	04-01	03-31 24:00	03-31 00:00	FP & S
-#	09-30	09-29 24:00	09-30 01:00	FP & W
-# 1918	03-09	03-09 24:00	03-09 00:00	FP & S
-#	10-06	10-05 24:00	10-06 01:00	FP & W
-# 1919	03-01	03-01 24:00	03-01 00:00	FP & S
-#	10-04	10-04 24:00	10-04 01:00	FP; guess 24:00s
-# 1920	03-20	03-20 24:00	03-20 00:00	FP & S
-#	09-18	09-18 24:00	10-01 01:00	FP; guess 24:00s
-# 1944	04-02	04-03 02:00			S (see C-Eur)
-#	09-16	10-02 03:00			FP; guess 24:00s
-# 1945	09-14	09-16 24:00			FP; guess 24:00s
-# 1970	05-21	05-31 00:00			S
-#	09-20	09-27 00:00			S
-#
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Italy	1916	only	-	Jun	 3	0:00s	1:00	S
-Rule	Italy	1916	only	-	Oct	 1	0:00s	0	-
-Rule	Italy	1917	only	-	Apr	 1	0:00s	1:00	S
-Rule	Italy	1917	only	-	Sep	30	0:00s	0	-
-Rule	Italy	1918	only	-	Mar	10	0:00s	1:00	S
-Rule	Italy	1918	1919	-	Oct	Sun>=1	0:00s	0	-
-Rule	Italy	1919	only	-	Mar	 2	0:00s	1:00	S
-Rule	Italy	1920	only	-	Mar	21	0:00s	1:00	S
-Rule	Italy	1920	only	-	Sep	19	0:00s	0	-
-Rule	Italy	1940	only	-	Jun	15	0:00s	1:00	S
-Rule	Italy	1944	only	-	Sep	17	0:00s	0	-
-Rule	Italy	1945	only	-	Apr	 2	2:00	1:00	S
-Rule	Italy	1945	only	-	Sep	15	0:00s	0	-
-Rule	Italy	1946	only	-	Mar	17	2:00s	1:00	S
-Rule	Italy	1946	only	-	Oct	 6	2:00s	0	-
-Rule	Italy	1947	only	-	Mar	16	0:00s	1:00	S
-Rule	Italy	1947	only	-	Oct	 5	0:00s	0	-
-Rule	Italy	1948	only	-	Feb	29	2:00s	1:00	S
-Rule	Italy	1948	only	-	Oct	 3	2:00s	0	-
-Rule	Italy	1966	1968	-	May	Sun>=22	0:00	1:00	S
-Rule	Italy	1966	1969	-	Sep	Sun>=22	0:00	0	-
-Rule	Italy	1969	only	-	Jun	 1	0:00	1:00	S
-Rule	Italy	1970	only	-	May	31	0:00	1:00	S
-Rule	Italy	1970	only	-	Sep	lastSun	0:00	0	-
-Rule	Italy	1971	1972	-	May	Sun>=22	0:00	1:00	S
-Rule	Italy	1971	only	-	Sep	lastSun	1:00	0	-
-Rule	Italy	1972	only	-	Oct	 1	0:00	0	-
-Rule	Italy	1973	only	-	Jun	 3	0:00	1:00	S
-Rule	Italy	1973	1974	-	Sep	lastSun	0:00	0	-
-Rule	Italy	1974	only	-	May	26	0:00	1:00	S
-Rule	Italy	1975	only	-	Jun	 1	0:00s	1:00	S
-Rule	Italy	1975	1977	-	Sep	lastSun	0:00s	0	-
-Rule	Italy	1976	only	-	May	30	0:00s	1:00	S
-Rule	Italy	1977	1979	-	May	Sun>=22	0:00s	1:00	S
-Rule	Italy	1978	only	-	Oct	 1	0:00s	0	-
-Rule	Italy	1979	only	-	Sep	30	0:00s	0	-
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Europe/Rome	0:49:56 -	LMT	1866 Sep 22
-			0:49:56	-	RMT	1893 Nov  1 0:00s # Rome Mean
-			1:00	Italy	CE%sT	1942 Nov  2 2:00s
-			1:00	C-Eur	CE%sT	1944 Jul
-			1:00	Italy	CE%sT	1980
-			1:00	EU	CE%sT
-
-Link	Europe/Rome	Europe/Vatican
-Link	Europe/Rome	Europe/San_Marino
-
-# Latvia
-
-# From Liene Kanepe (1998-09-17):
-
-# I asked about this matter Scientific Secretary of the Institute of Astronomy
-# of The University of Latvia Dr. paed Mr. Ilgonis Vilks. I also searched the
-# correct data in juridical acts and I found some juridical documents about
-# changes in the counting of time in Latvia from 1981....
-#
-# Act No.35 of the Council of Ministers of Latvian SSR of 1981-01-22 ...
-# according to the Act No.925 of the Council of Ministers of USSR of 1980-10-24
-# ...: all year round the time of 2nd time zone + 1 hour, in addition turning
-# the hands of the clock 1 hour forward on 1 April at 00:00 (GMT 31 March 21:00)
-# and 1 hour backward on the 1 October at 00:00 (GMT 30 September 20:00).
-#
-# Act No.592 of the Council of Ministers of Latvian SSR of 1984-09-24 ...
-# according to the Act No.967 of the Council of Ministers of USSR of 1984-09-13
-# ...: all year round the time of 2nd time zone + 1 hour, in addition turning
-# the hands of the clock 1 hour forward on the last Sunday of March at 02:00
-# (GMT 23:00 on the previous day) and 1 hour backward on the last Sunday of
-# September at 03:00 (GMT 23:00 on the previous day).
-#
-# Act No.81 of the Council of Ministers of Latvian SSR of 1989-03-22 ...
-# according to the Act No.227 of the Council of Ministers of USSR of 1989-03-14
-# ...: since the last Sunday of March 1989 in Lithuanian SSR, Latvian SSR,
-# Estonian SSR and Kaliningrad region of Russian Federation all year round the
-# time of 2nd time zone (Moscow time minus one hour). On the territory of Latvia
-# transition to summer time is performed on the last Sunday of March at 02:00
-# (GMT 00:00), turning the hands of the clock 1 hour forward.  The end of
-# daylight saving time is performed on the last Sunday of September at 03:00
-# (GMT 00:00), turning the hands of the clock 1 hour backward. Exception is
-# 1989-03-26, when we must not turn the hands of the clock....
-#
-# The Regulations of the Cabinet of Ministers of the Republic of Latvia of
-# 1997-01-21 on transition to Summer time ... established the same order of
-# daylight savings time settings as in the States of the European Union.
-
-# From Andrei Ivanov (2000-03-06):
-# This year Latvia will not switch to Daylight Savings Time (as specified in
-# <a href="http://www.lv-laiks.lv/wwwraksti/2000/071072/vd4.htm">
-# The Regulations of the Cabinet of Ministers of the Rep. of Latvia of
-# 29-Feb-2000 (#79)</a>, in Latvian for subscribers only).
-
-# <a href="http://www.rferl.org/newsline/2001/01/3-CEE/cee-030101.html">
-# From RFE/RL Newsline (2001-01-03), noted after a heads-up by Rives McDow:
-# </a>
-# The Latvian government on 2 January decided that the country will
-# institute daylight-saving time this spring, LETA reported.
-# Last February the three Baltic states decided not to turn back their
-# clocks one hour in the spring....
-# Minister of Economy Aigars Kalvitis noted that Latvia had too few
-# daylight hours and thus decided to comply with a draft European
-# Commission directive that provides for instituting daylight-saving
-# time in EU countries between 2002 and 2006. The Latvian government
-# urged Lithuania and Estonia to adopt a similar time policy, but it
-# appears that they will not do so....
-
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Latvia	1989	1996	-	Mar	lastSun	 2:00s	1:00	S
-Rule	Latvia	1989	1996	-	Sep	lastSun	 2:00s	0	-
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Europe/Riga	1:36:24	-	LMT	1880
-			1:36:24	-	RMT	1918 Apr 15 2:00 #Riga Mean Time
-			1:36:24	1:00	LST	1918 Sep 16 3:00 #Latvian Summer
-			1:36:24	-	RMT	1919 Apr  1 2:00
-			1:36:24	1:00	LST	1919 May 22 3:00
-			1:36:24	-	RMT	1926 May 11
-			2:00	-	EET	1940 Aug  5
-			3:00	-	MSK	1941 Jul
-			1:00	C-Eur	CE%sT	1944 Oct 13
-			3:00	Russia	MSK/MSD	1989 Mar lastSun 2:00s
-			2:00	1:00	EEST	1989 Sep lastSun 2:00s
-			2:00	Latvia	EE%sT	1997 Jan 21
-			2:00	EU	EE%sT	2000 Feb 29
-			2:00	-	EET	2001 Jan  2
-			2:00	EU	EE%sT
-
-# Liechtenstein
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Europe/Vaduz	0:38:04 -	LMT	1894 Jun
-			1:00	-	CET	1981
-			1:00	EU	CE%sT
-
-# Lithuania
-
-# From Paul Eggert (1996-11-22):
-# IATA SSIM (1992/1996) says Lithuania uses W-Eur rules, but since it is
-# known to be wrong about Estonia and Latvia, assume it's wrong here too.
-
-# From Marius Gedminas (1998-08-07):
-# I would like to inform that in this year Lithuanian time zone
-# (Europe/Vilnius) was changed.
-
-# From <a href="http://www.elta.lt/">ELTA</a> No. 972 (2582) (1999-09-29),
-# via Steffen Thorsen:
-# Lithuania has shifted back to the second time zone (GMT plus two hours)
-# to be valid here starting from October 31,
-# as decided by the national government on Wednesday....
-# The Lithuanian government also announced plans to consider a
-# motion to give up shifting to summer time in spring, as it was
-# already done by Estonia.
-
-# From the <a href="http://www.tourism.lt/informa/ff.htm">
-# Fact File, Lithuanian State Department of Tourism
-# </a> (2000-03-27): Local time is GMT+2 hours ..., no daylight saving.
-
-# From a user via Klaus Marten (2003-02-07):
-# As a candidate for membership of the European Union, Lithuania will
-# observe Summer Time in 2003, changing its clocks at the times laid
-# down in EU Directive 2000/84 of 19.I.01 (i.e. at the same times as its
-# neighbour Latvia). The text of the Lithuanian government Order of
-# 7.XI.02 to this effect can be found at
-# http://www.lrvk.lt/nut/11/n1749.htm
-
-
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Europe/Vilnius	1:41:16	-	LMT	1880
-			1:24:00	-	WMT	1917	    # Warsaw Mean Time
-			1:35:36	-	KMT	1919 Oct 10 # Kaunas Mean Time
-			1:00	-	CET	1920 Jul 12
-			2:00	-	EET	1920 Oct  9
-			1:00	-	CET	1940 Aug  3
-			3:00	-	MSK	1941 Jun 24
-			1:00	C-Eur	CE%sT	1944 Aug
-			3:00	Russia	MSK/MSD	1991 Mar 31 2:00s
-			2:00	1:00	EEST	1991 Sep 29 2:00s
-			2:00	C-Eur	EE%sT	1998
-			2:00	-	EET	1998 Mar 29 1:00u
-			1:00	EU	CE%sT	1999 Oct 31 1:00u
-			2:00	-	EET	2003 Jan  1
-			2:00	EU	EE%sT
-
-# Luxembourg
-# Whitman disagrees with most of these dates in minor ways;
-# go with Shanks & Pottenger.
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Lux	1916	only	-	May	14	23:00	1:00	S
-Rule	Lux	1916	only	-	Oct	 1	 1:00	0	-
-Rule	Lux	1917	only	-	Apr	28	23:00	1:00	S
-Rule	Lux	1917	only	-	Sep	17	 1:00	0	-
-Rule	Lux	1918	only	-	Apr	Mon>=15	 2:00s	1:00	S
-Rule	Lux	1918	only	-	Sep	Mon>=15	 2:00s	0	-
-Rule	Lux	1919	only	-	Mar	 1	23:00	1:00	S
-Rule	Lux	1919	only	-	Oct	 5	 3:00	0	-
-Rule	Lux	1920	only	-	Feb	14	23:00	1:00	S
-Rule	Lux	1920	only	-	Oct	24	 2:00	0	-
-Rule	Lux	1921	only	-	Mar	14	23:00	1:00	S
-Rule	Lux	1921	only	-	Oct	26	 2:00	0	-
-Rule	Lux	1922	only	-	Mar	25	23:00	1:00	S
-Rule	Lux	1922	only	-	Oct	Sun>=2	 1:00	0	-
-Rule	Lux	1923	only	-	Apr	21	23:00	1:00	S
-Rule	Lux	1923	only	-	Oct	Sun>=2	 2:00	0	-
-Rule	Lux	1924	only	-	Mar	29	23:00	1:00	S
-Rule	Lux	1924	1928	-	Oct	Sun>=2	 1:00	0	-
-Rule	Lux	1925	only	-	Apr	 5	23:00	1:00	S
-Rule	Lux	1926	only	-	Apr	17	23:00	1:00	S
-Rule	Lux	1927	only	-	Apr	 9	23:00	1:00	S
-Rule	Lux	1928	only	-	Apr	14	23:00	1:00	S
-Rule	Lux	1929	only	-	Apr	20	23:00	1:00	S
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone Europe/Luxembourg	0:24:36 -	LMT	1904 Jun
-			1:00	Lux	CE%sT	1918 Nov 25
-			0:00	Lux	WE%sT	1929 Oct  6 2:00s
-			0:00	Belgium	WE%sT	1940 May 14 3:00
-			1:00	C-Eur	WE%sT	1944 Sep 18 3:00
-			1:00	Belgium	CE%sT	1977
-			1:00	EU	CE%sT
-
-# Macedonia
-# see Serbia
-
-# Malta
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Malta	1973	only	-	Mar	31	0:00s	1:00	S
-Rule	Malta	1973	only	-	Sep	29	0:00s	0	-
-Rule	Malta	1974	only	-	Apr	21	0:00s	1:00	S
-Rule	Malta	1974	only	-	Sep	16	0:00s	0	-
-Rule	Malta	1975	1979	-	Apr	Sun>=15	2:00	1:00	S
-Rule	Malta	1975	1980	-	Sep	Sun>=15	2:00	0	-
-Rule	Malta	1980	only	-	Mar	31	2:00	1:00	S
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Europe/Malta	0:58:04 -	LMT	1893 Nov  2 0:00s # Valletta
-			1:00	Italy	CE%sT	1942 Nov  2 2:00s
-			1:00	C-Eur	CE%sT	1945 Apr  2 2:00s
-			1:00	Italy	CE%sT	1973 Mar 31
-			1:00	Malta	CE%sT	1981
-			1:00	EU	CE%sT
-
-# Moldova
-
-# From Paul Eggert (2006-03-22):
-# A previous version of this database followed Shanks & Pottenger, who write
-# that Tiraspol switched to Moscow time on 1992-01-19 at 02:00.
-# However, this is most likely an error, as Moldova declared independence
-# on 1991-08-27 (the 1992-01-19 date is that of a Russian decree).
-# In early 1992 there was large-scale interethnic violence in the area
-# and it's possible that some Russophones continued to observe Moscow time.
-# But [two people] separately reported via
-# Jesper Norgaard that as of 2001-01-24 Tiraspol was like Chisinau.
-# The Tiraspol entry has therefore been removed for now.
-
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Europe/Chisinau	1:55:20 -	LMT	1880
-			1:55	-	CMT	1918 Feb 15 # Chisinau MT
-			1:44:24	-	BMT	1931 Jul 24 # Bucharest MT
-			2:00	Romania	EE%sT	1940 Aug 15
-			2:00	1:00	EEST	1941 Jul 17
-			1:00	C-Eur	CE%sT	1944 Aug 24
-			3:00	Russia	MSK/MSD	1990
-			3:00	-	MSK	1990 May 6
-			2:00	-	EET	1991
-			2:00	Russia	EE%sT	1992
-			2:00	E-Eur	EE%sT	1997
-# See Romania commentary for the guessed 1997 transition to EU rules.
-			2:00	EU	EE%sT
-
-# Monaco
-# Shanks & Pottenger give 0:09:20 for Paris Mean Time; go with Howse's
-# more precise 0:09:21.
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Europe/Monaco	0:29:32 -	LMT	1891 Mar 15
-			0:09:21	-	PMT	1911 Mar 11    # Paris Mean Time
-			0:00	France	WE%sT	1945 Sep 16 3:00
-			1:00	France	CE%sT	1977
-			1:00	EU	CE%sT
-
-# Montenegro
-# see Serbia
-
-# Netherlands
-
-# Howse writes that the Netherlands' railways used GMT between 1892 and 1940,
-# but for other purposes the Netherlands used Amsterdam mean time.
-
-# However, Robert H. van Gent writes (2001-04-01):
-# Howse's statement is only correct up to 1909. From 1909-05-01 (00:00:00
-# Amsterdam mean time) onwards, the whole of the Netherlands (including
-# the Dutch railways) was required by law to observe Amsterdam mean time
-# (19 minutes 32.13 seconds ahead of GMT). This had already been the
-# common practice (except for the railways) for many decades but it was
-# not until 1909 when the Dutch government finally defined this by law.
-# On 1937-07-01 this was changed to 20 minutes (exactly) ahead of GMT and
-# was generally known as Dutch Time ("Nederlandse Tijd").
-#
-# (2001-04-08):
-# 1892-05-01 was the date when the Dutch railways were by law required to
-# observe GMT while the remainder of the Netherlands adhered to the common
-# practice of following Amsterdam mean time.
-#
-# (2001-04-09):
-# In 1835 the authorities of the province of North Holland requested the
-# municipal authorities of the towns and cities in the province to observe
-# Amsterdam mean time but I do not know in how many cases this request was
-# actually followed.
-#
-# From 1852 onwards the Dutch telegraph offices were by law required to
-# observe Amsterdam mean time. As the time signals from the observatory of
-# Leiden were also distributed by the telegraph system, I assume that most
-# places linked up with the telegraph (and railway) system automatically
-# adopted Amsterdam mean time.
-#
-# Although the early Dutch railway companies initially observed a variety
-# of times, most of them had adopted Amsterdam mean time by 1858 but it
-# was not until 1866 when they were all required by law to observe
-# Amsterdam mean time.
-
-# The data before 1945 are taken from
-# <http://www.phys.uu.nl/~vgent/wettijd/wettijd.htm>.
-
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Neth	1916	only	-	May	 1	0:00	1:00	NST	# Netherlands Summer Time
-Rule	Neth	1916	only	-	Oct	 1	0:00	0	AMT	# Amsterdam Mean Time
-Rule	Neth	1917	only	-	Apr	16	2:00s	1:00	NST
-Rule	Neth	1917	only	-	Sep	17	2:00s	0	AMT
-Rule	Neth	1918	1921	-	Apr	Mon>=1	2:00s	1:00	NST
-Rule	Neth	1918	1921	-	Sep	lastMon	2:00s	0	AMT
-Rule	Neth	1922	only	-	Mar	lastSun	2:00s	1:00	NST
-Rule	Neth	1922	1936	-	Oct	Sun>=2	2:00s	0	AMT
-Rule	Neth	1923	only	-	Jun	Fri>=1	2:00s	1:00	NST
-Rule	Neth	1924	only	-	Mar	lastSun	2:00s	1:00	NST
-Rule	Neth	1925	only	-	Jun	Fri>=1	2:00s	1:00	NST
-# From 1926 through 1939 DST began 05-15, except that it was delayed by a week
-# in years when 05-15 fell in the Pentecost weekend.
-Rule	Neth	1926	1931	-	May	15	2:00s	1:00	NST
-Rule	Neth	1932	only	-	May	22	2:00s	1:00	NST
-Rule	Neth	1933	1936	-	May	15	2:00s	1:00	NST
-Rule	Neth	1937	only	-	May	22	2:00s	1:00	NST
-Rule	Neth	1937	only	-	Jul	 1	0:00	1:00	S
-Rule	Neth	1937	1939	-	Oct	Sun>=2	2:00s	0	-
-Rule	Neth	1938	1939	-	May	15	2:00s	1:00	S
-Rule	Neth	1945	only	-	Apr	 2	2:00s	1:00	S
-Rule	Neth	1945	only	-	Sep	16	2:00s	0	-
-#
-# Amsterdam Mean Time was +00:19:32.13 exactly, but the .13 is omitted
-# below because the current format requires GMTOFF to be an integer.
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone Europe/Amsterdam	0:19:32 -	LMT	1835
-			0:19:32	Neth	%s	1937 Jul  1
-			0:20	Neth	NE%sT	1940 May 16 0:00 # Dutch Time
-			1:00	C-Eur	CE%sT	1945 Apr  2 2:00
-			1:00	Neth	CE%sT	1977
-			1:00	EU	CE%sT
-
-# Norway
-# http://met.no/met/met_lex/q_u/sommertid.html (2004-01) agrees with Shanks &
-# Pottenger.
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Norway	1916	only	-	May	22	1:00	1:00	S
-Rule	Norway	1916	only	-	Sep	30	0:00	0	-
-Rule	Norway	1945	only	-	Apr	 2	2:00s	1:00	S
-Rule	Norway	1945	only	-	Oct	 1	2:00s	0	-
-Rule	Norway	1959	1964	-	Mar	Sun>=15	2:00s	1:00	S
-Rule	Norway	1959	1965	-	Sep	Sun>=15	2:00s	0	-
-Rule	Norway	1965	only	-	Apr	25	2:00s	1:00	S
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Europe/Oslo	0:43:00 -	LMT	1895 Jan  1
-			1:00	Norway	CE%sT	1940 Aug 10 23:00
-			1:00	C-Eur	CE%sT	1945 Apr  2  2:00
-			1:00	Norway	CE%sT	1980
-			1:00	EU	CE%sT
-
-# Svalbard & Jan Mayen
-
-# From Steffen Thorsen (2001-05-01):
-# Although I could not find it explicitly, it seems that Jan Mayen and
-# Svalbard have been using the same time as Norway at least since the
-# time they were declared as parts of Norway.  Svalbard was declared
-# as a part of Norway by law of 1925-07-17 no 11, section 4 and Jan
-# Mayen by law of 1930-02-27 no 2, section 2. (From
-# http://www.lovdata.no/all/nl-19250717-011.html and
-# http://www.lovdata.no/all/nl-19300227-002.html).  The law/regulation
-# for normal/standard time in Norway is from 1894-06-29 no 1 (came
-# into operation on 1895-01-01) and Svalbard/Jan Mayen seem to be a
-# part of this law since 1925/1930. (From
-# http://www.lovdata.no/all/nl-18940629-001.html ) I have not been
-# able to find if Jan Mayen used a different time zone (e.g. -0100)
-# before 1930. Jan Mayen has only been "inhabitated" since 1921 by
-# Norwegian meteorologists and maybe used the same time as Norway ever
-# since 1921.  Svalbard (Arctic/Longyearbyen) has been inhabited since
-# before 1895, and therefore probably changed the local time somewhere
-# between 1895 and 1925 (inclusive).
-
-# From Paul Eggert (2001-05-01):
-#
-# Actually, Jan Mayen was never occupied by Germany during World War II,
-# so it must have diverged from Oslo time during the war, as Oslo was
-# keeping Berlin time.
-#
-# <http://home.no.net/janmayen/history.htm> says that the meteorologists
-# burned down their station in 1940 and left the island, but returned in
-# 1941 with a small Norwegian garrison and continued operations despite
-# frequent air ttacks from Germans.  In 1943 the Americans established a
-# radiolocating station on the island, called "Atlantic City".  Possibly
-# the UTC offset changed during the war, but I think it unlikely that
-# Jan Mayen used German daylight-saving rules.
-#
-# Svalbard is more complicated, as it was raided in August 1941 by an
-# Allied party that evacuated the civilian population to England (says
-# <http://www.bartleby.com/65/sv/Svalbard.html>).  The Svalbard FAQ
-# <http://www.svalbard.com/SvalbardFAQ.html> says that the Germans were
-# expelled on 1942-05-14.  However, small parties of Germans did return,
-# and according to Wilhelm Dege's book "War North of 80" (1954)
-# <http://www.ucalgary.ca/UofC/departments/UP/1-55238/1-55238-110-2.html>
-# the German armed forces at the Svalbard weather station code-named
-# Haudegen did not surrender to the Allies until September 1945.
-#
-# All these events predate our cutoff date of 1970.  Unless we can
-# come up with more definitive info about the timekeeping during the
-# war years it's probably best just do do the following for now:
-Link	Europe/Oslo	Arctic/Longyearbyen
-
-# Poland
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Poland	1918	1919	-	Sep	16	2:00s	0	-
-Rule	Poland	1919	only	-	Apr	15	2:00s	1:00	S
-Rule	Poland	1944	only	-	Apr	 3	2:00s	1:00	S
-# Whitman gives 1944 Nov 30; go with Shanks & Pottenger.
-Rule	Poland	1944	only	-	Oct	 4	2:00	0	-
-# For 1944-1948 Whitman gives the previous day; go with Shanks & Pottenger.
-Rule	Poland	1945	only	-	Apr	29	0:00	1:00	S
-Rule	Poland	1945	only	-	Nov	 1	0:00	0	-
-# For 1946 on the source is Kazimierz Borkowski,
-# Torun Center for Astronomy, Dept. of Radio Astronomy, Nicolaus Copernicus U.,
-# <http://www.astro.uni.torun.pl/~kb/Artykuly/U-PA/Czas2.htm#tth_tAb1>
-# Thanks to Przemyslaw Augustyniak (2005-05-28) for this reference.
-# He also gives these further references:
-# Mon Pol nr 13, poz 162 (1995) <http://www.abc.com.pl/serwis/mp/1995/0162.htm>
-# Druk nr 2180 (2003) <http://www.senat.gov.pl/k5/dok/sejm/053/2180.pdf>
-Rule	Poland	1946	only	-	Apr	14	0:00s	1:00	S
-Rule	Poland	1946	only	-	Oct	 7	2:00s	0	-
-Rule	Poland	1947	only	-	May	 4	2:00s	1:00	S
-Rule	Poland	1947	1949	-	Oct	Sun>=1	2:00s	0	-
-Rule	Poland	1948	only	-	Apr	18	2:00s	1:00	S
-Rule	Poland	1949	only	-	Apr	10	2:00s	1:00	S
-Rule	Poland	1957	only	-	Jun	 2	1:00s	1:00	S
-Rule	Poland	1957	1958	-	Sep	lastSun	1:00s	0	-
-Rule	Poland	1958	only	-	Mar	30	1:00s	1:00	S
-Rule	Poland	1959	only	-	May	31	1:00s	1:00	S
-Rule	Poland	1959	1961	-	Oct	Sun>=1	1:00s	0	-
-Rule	Poland	1960	only	-	Apr	 3	1:00s	1:00	S
-Rule	Poland	1961	1964	-	May	lastSun	1:00s	1:00	S
-Rule	Poland	1962	1964	-	Sep	lastSun	1:00s	0	-
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Europe/Warsaw	1:24:00 -	LMT	1880
-			1:24:00	-	WMT	1915 Aug  5   # Warsaw Mean Time
-			1:00	C-Eur	CE%sT	1918 Sep 16 3:00
-			2:00	Poland	EE%sT	1922 Jun
-			1:00	Poland	CE%sT	1940 Jun 23 2:00
-			1:00	C-Eur	CE%sT	1944 Oct
-			1:00	Poland	CE%sT	1977
-			1:00	W-Eur	CE%sT	1988
-			1:00	EU	CE%sT
-
-# Portugal
-#
-# From Rui Pedro Salgueiro (1992-11-12):
-# Portugal has recently (September, 27) changed timezone
-# (from WET to MET or CET) to harmonize with EEC.
-#
-# Martin Bruckmann (1996-02-29) reports via Peter Ilieve
-# that Portugal is reverting to 0:00 by not moving its clocks this spring.
-# The new Prime Minister was fed up with getting up in the dark in the winter.
-#
-# From Paul Eggert (1996-11-12):
-# IATA SSIM (1991-09) reports several 1991-09 and 1992-09 transitions
-# at 02:00u, not 01:00u.  Assume that these are typos.
-# IATA SSIM (1991/1992) reports that the Azores were at -1:00.
-# IATA SSIM (1993-02) says +0:00; later issues (through 1996-09) say -1:00.
-# Guess that the Azores changed to EU rules in 1992 (since that's when Portugal
-# harmonized with the EU), and that they stayed +0:00 that winter.
-#
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-# DSH writes that despite Decree 1,469 (1915), the change to the clocks was not
-# done every year, depending on what Spain did, because of railroad schedules.
-# Go with Shanks & Pottenger.
-Rule	Port	1916	only	-	Jun	17	23:00	1:00	S
-# Whitman gives 1916 Oct 31; go with Shanks & Pottenger.
-Rule	Port	1916	only	-	Nov	 1	 1:00	0	-
-Rule	Port	1917	only	-	Feb	28	23:00s	1:00	S
-Rule	Port	1917	1921	-	Oct	14	23:00s	0	-
-Rule	Port	1918	only	-	Mar	 1	23:00s	1:00	S
-Rule	Port	1919	only	-	Feb	28	23:00s	1:00	S
-Rule	Port	1920	only	-	Feb	29	23:00s	1:00	S
-Rule	Port	1921	only	-	Feb	28	23:00s	1:00	S
-Rule	Port	1924	only	-	Apr	16	23:00s	1:00	S
-Rule	Port	1924	only	-	Oct	14	23:00s	0	-
-Rule	Port	1926	only	-	Apr	17	23:00s	1:00	S
-Rule	Port	1926	1929	-	Oct	Sat>=1	23:00s	0	-
-Rule	Port	1927	only	-	Apr	 9	23:00s	1:00	S
-Rule	Port	1928	only	-	Apr	14	23:00s	1:00	S
-Rule	Port	1929	only	-	Apr	20	23:00s	1:00	S
-Rule	Port	1931	only	-	Apr	18	23:00s	1:00	S
-# Whitman gives 1931 Oct 8; go with Shanks & Pottenger.
-Rule	Port	1931	1932	-	Oct	Sat>=1	23:00s	0	-
-Rule	Port	1932	only	-	Apr	 2	23:00s	1:00	S
-Rule	Port	1934	only	-	Apr	 7	23:00s	1:00	S
-# Whitman gives 1934 Oct 5; go with Shanks & Pottenger.
-Rule	Port	1934	1938	-	Oct	Sat>=1	23:00s	0	-
-# Shanks & Pottenger give 1935 Apr 30; go with Whitman.
-Rule	Port	1935	only	-	Mar	30	23:00s	1:00	S
-Rule	Port	1936	only	-	Apr	18	23:00s	1:00	S
-# Whitman gives 1937 Apr 2; go with Shanks & Pottenger.
-Rule	Port	1937	only	-	Apr	 3	23:00s	1:00	S
-Rule	Port	1938	only	-	Mar	26	23:00s	1:00	S
-Rule	Port	1939	only	-	Apr	15	23:00s	1:00	S
-# Whitman gives 1939 Oct 7; go with Shanks & Pottenger.
-Rule	Port	1939	only	-	Nov	18	23:00s	0	-
-Rule	Port	1940	only	-	Feb	24	23:00s	1:00	S
-# Shanks & Pottenger give 1940 Oct 7; go with Whitman.
-Rule	Port	1940	1941	-	Oct	 5	23:00s	0	-
-Rule	Port	1941	only	-	Apr	 5	23:00s	1:00	S
-Rule	Port	1942	1945	-	Mar	Sat>=8	23:00s	1:00	S
-Rule	Port	1942	only	-	Apr	25	22:00s	2:00	M # Midsummer
-Rule	Port	1942	only	-	Aug	15	22:00s	1:00	S
-Rule	Port	1942	1945	-	Oct	Sat>=24	23:00s	0	-
-Rule	Port	1943	only	-	Apr	17	22:00s	2:00	M
-Rule	Port	1943	1945	-	Aug	Sat>=25	22:00s	1:00	S
-Rule	Port	1944	1945	-	Apr	Sat>=21	22:00s	2:00	M
-Rule	Port	1946	only	-	Apr	Sat>=1	23:00s	1:00	S
-Rule	Port	1946	only	-	Oct	Sat>=1	23:00s	0	-
-Rule	Port	1947	1949	-	Apr	Sun>=1	 2:00s	1:00	S
-Rule	Port	1947	1949	-	Oct	Sun>=1	 2:00s	0	-
-# Shanks & Pottenger say DST was observed in 1950; go with Whitman.
-# Whitman gives Oct lastSun for 1952 on; go with Shanks & Pottenger.
-Rule	Port	1951	1965	-	Apr	Sun>=1	 2:00s	1:00	S
-Rule	Port	1951	1965	-	Oct	Sun>=1	 2:00s	0	-
-Rule	Port	1977	only	-	Mar	27	 0:00s	1:00	S
-Rule	Port	1977	only	-	Sep	25	 0:00s	0	-
-Rule	Port	1978	1979	-	Apr	Sun>=1	 0:00s	1:00	S
-Rule	Port	1978	only	-	Oct	 1	 0:00s	0	-
-Rule	Port	1979	1982	-	Sep	lastSun	 1:00s	0	-
-Rule	Port	1980	only	-	Mar	lastSun	 0:00s	1:00	S
-Rule	Port	1981	1982	-	Mar	lastSun	 1:00s	1:00	S
-Rule	Port	1983	only	-	Mar	lastSun	 2:00s	1:00	S
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-# Shanks & Pottenger say the transition from LMT to WET occurred 1911-05-24;
-# Willett says 1912-01-01.  Go with Willett.
-Zone	Europe/Lisbon	-0:36:32 -	LMT	1884
-			-0:36:32 -	LMT	1912 Jan  1  # Lisbon Mean Time
-			 0:00	Port	WE%sT	1966 Apr  3 2:00
-			 1:00	-	CET	1976 Sep 26 1:00
-			 0:00	Port	WE%sT	1983 Sep 25 1:00s
-			 0:00	W-Eur	WE%sT	1992 Sep 27 1:00s
-			 1:00	EU	CE%sT	1996 Mar 31 1:00u
-			 0:00	EU	WE%sT
-Zone Atlantic/Azores	-1:42:40 -	LMT	1884		# Ponta Delgada
-			-1:54:32 -	HMT	1911 May 24  # Horta Mean Time
-			-2:00	Port	AZO%sT	1966 Apr  3 2:00 # Azores Time
-			-1:00	Port	AZO%sT	1983 Sep 25 1:00s
-			-1:00	W-Eur	AZO%sT	1992 Sep 27 1:00s
-			 0:00	EU	WE%sT	1993 Mar 28 1:00u
-			-1:00	EU	AZO%sT
-Zone Atlantic/Madeira	-1:07:36 -	LMT	1884		# Funchal
-			-1:07:36 -	FMT	1911 May 24  # Funchal Mean Time
-			-1:00	Port	MAD%sT	1966 Apr  3 2:00 # Madeira Time
-			 0:00	Port	WE%sT	1983 Sep 25 1:00s
-			 0:00	EU	WE%sT
-
-# Romania
-#
-# From Paul Eggert (1999-10-07):
-# <a href="http://www.nineoclock.ro/POL/1778pol.html">
-# Nine O'clock</a> (1998-10-23) reports that the switch occurred at
-# 04:00 local time in fall 1998.  For lack of better info,
-# assume that Romania and Moldova switched to EU rules in 1997,
-# the same year as Bulgaria.
-#
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Romania	1932	only	-	May	21	 0:00s	1:00	S
-Rule	Romania	1932	1939	-	Oct	Sun>=1	 0:00s	0	-
-Rule	Romania	1933	1939	-	Apr	Sun>=2	 0:00s	1:00	S
-Rule	Romania	1979	only	-	May	27	 0:00	1:00	S
-Rule	Romania	1979	only	-	Sep	lastSun	 0:00	0	-
-Rule	Romania	1980	only	-	Apr	 5	23:00	1:00	S
-Rule	Romania	1980	only	-	Sep	lastSun	 1:00	0	-
-Rule	Romania	1991	1993	-	Mar	lastSun	 0:00s	1:00	S
-Rule	Romania	1991	1993	-	Sep	lastSun	 0:00s	0	-
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone Europe/Bucharest	1:44:24 -	LMT	1891 Oct
-			1:44:24	-	BMT	1931 Jul 24	# Bucharest MT
-			2:00	Romania	EE%sT	1981 Mar 29 2:00s
-			2:00	C-Eur	EE%sT	1991
-			2:00	Romania	EE%sT	1994
-			2:00	E-Eur	EE%sT	1997
-			2:00	EU	EE%sT
-
-# Russia
-
-# From Paul Eggert (2006-03-22):
-# Except for Moscow after 1919-07-01, I invented the time zone abbreviations.
-# Moscow time zone abbreviations after 1919-07-01, and Moscow rules after 1991,
-# are from Andrey A. Chernov.  The rest is from Shanks & Pottenger,
-# except we follow Chernov's report that 1992 DST transitions were Sat
-# 23:00, not Sun 02:00s.
-#
-# From Stanislaw A. Kuzikowski (1994-06-29):
-# But now it is some months since Novosibirsk is 3 hours ahead of Moscow!
-# I do not know why they have decided to make this change;
-# as far as I remember it was done exactly during winter->summer switching
-# so we (Novosibirsk) simply did not switch.
-#
-# From Andrey A. Chernov (1996-10-04):
-# `MSK' and `MSD' were born and used initially on Moscow computers with
-# UNIX-like OSes by several developer groups (e.g. Demos group, Kiae group)....
-# The next step was the UUCP network, the Relcom predecessor
-# (used mainly for mail), and MSK/MSD was actively used there.
-#
-# From Chris Carrier (1996-10-30):
-# According to a friend of mine who rode the Trans-Siberian Railroad from
-# Moscow to Irkutsk in 1995, public air and rail transport in Russia ...
-# still follows Moscow time, no matter where in Russia it is located.
-#
-# For Grozny, Chechnya, we have the following story from
-# John Daniszewski, "Scavengers in the Rubble", Los Angeles Times (2001-02-07):
-# News--often false--is spread by word of mouth.  A rumor that it was
-# time to move the clocks back put this whole city out of sync with
-# the rest of Russia for two weeks--even soldiers stationed here began
-# enforcing curfew at the wrong time.
-#
-# From Gwillim Law (2001-06-05):
-# There's considerable evidence that Sakhalin Island used to be in
-# UTC+11, and has changed to UTC+10, in this decade.  I start with the
-# SSIM, which listed Yuzhno-Sakhalinsk in zone RU10 along with Magadan
-# until February 1997, and then in RU9 with Khabarovsk and Vladivostok
-# since September 1997....  Although the Kuril Islands are
-# administratively part of Sakhalin oblast', they appear to have
-# remained on UTC+11 along with Magadan.
-#
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-#
-# Kaliningradskaya oblast'.
-Zone Europe/Kaliningrad	 1:22:00 -	LMT	1893 Apr
-			 1:00	C-Eur	CE%sT	1945
-			 2:00	Poland	CE%sT	1946
-			 3:00	Russia	MSK/MSD	1991 Mar 31 2:00s
-			 2:00	Russia	EE%sT
-#
-# From Oscar van Vlijmen (2001-08-25): [This region consists of]
-# Respublika Adygeya, Arkhangel'skaya oblast',
-# Belgorodskaya oblast', Bryanskaya oblast', Vladimirskaya oblast',
-# Vologodskaya oblast', Voronezhskaya oblast',
-# Respublika Dagestan, Ivanovskaya oblast', Respublika Ingushetiya,
-# Kabarbino-Balkarskaya Respublika, Respublika Kalmykiya,
-# Kalyzhskaya oblast', Respublika Karachaevo-Cherkessiya,
-# Respublika Kareliya, Respublika Komi,
-# Kostromskaya oblast', Krasnodarskij kraj, Kurskaya oblast',
-# Leningradskaya oblast', Lipetskaya oblast', Respublika Marij El,
-# Respublika Mordoviya, Moskva, Moskovskaya oblast',
-# Murmanskaya oblast', Nenetskij avtonomnyj okrug,
-# Nizhegorodskaya oblast', Novgorodskaya oblast', Orlovskaya oblast',
-# Penzenskaya oblast', Pskovskaya oblast', Rostovskaya oblast',
-# Ryazanskaya oblast', Sankt-Peterburg,
-# Respublika Severnaya Osetiya, Smolenskaya oblast',
-# Stavropol'skij kraj, Tambovskaya oblast', Respublika Tatarstan,
-# Tverskaya oblast', Tyl'skaya oblast', Ul'yanovskaya oblast',
-# Chechenskaya Respublika, Chuvashskaya oblast',
-# Yaroslavskaya oblast'
-Zone Europe/Moscow	 2:30:20 -	LMT	1880
-			 2:30	-	MMT	1916 Jul  3 # Moscow Mean Time
-			 2:30:48 Russia	%s	1919 Jul  1 2:00
-			 3:00	Russia	MSK/MSD	1922 Oct
-			 2:00	-	EET	1930 Jun 21
-			 3:00	Russia	MSK/MSD	1991 Mar 31 2:00s
-			 2:00	Russia	EE%sT	1992 Jan 19 2:00s
-			 3:00	Russia	MSK/MSD
-#
-# Astrakhanskaya oblast', Kirovskaya oblast', Saratovskaya oblast',
-# Volgogradskaya oblast'.  Shanks & Pottenger say Kirov is still at +0400
-# but Wikipedia (2006-05-09) says +0300.  Perhaps it switched after the
-# others?  But we have no data.
-Zone Europe/Volgograd	 2:57:40 -	LMT	1920 Jan  3
-			 3:00	-	TSAT	1925 Apr  6 # Tsaritsyn Time
-			 3:00	-	STAT	1930 Jun 21 # Stalingrad Time
-			 4:00	-	STAT	1961 Nov 11
-			 4:00	Russia	VOL%sT	1989 Mar 26 2:00s # Volgograd T
-			 3:00	Russia	VOL%sT	1991 Mar 31 2:00s
-			 4:00	-	VOLT	1992 Mar 29 2:00s
-			 3:00	Russia	VOL%sT
-#
-# From Oscar van Vlijmen (2001-08-25): [This region consists of]
-# Samarskaya oblast', Udmyrtskaya respublika
-Zone Europe/Samara	 3:20:36 -	LMT	1919 Jul  1 2:00
-			 3:00	-	SAMT	1930 Jun 21
-			 4:00	-	SAMT	1935 Jan 27
-			 4:00	Russia	KUY%sT	1989 Mar 26 2:00s # Kuybyshev
-			 3:00	Russia	KUY%sT	1991 Mar 31 2:00s
-			 2:00	Russia	KUY%sT	1991 Sep 29 2:00s
-			 3:00	-	KUYT	1991 Oct 20 3:00
-			 4:00	Russia	SAM%sT	# Samara Time
-#
-# From Oscar van Vlijmen (2001-08-25): [This region consists of]
-# Respublika Bashkortostan, Komi-Permyatskij avtonomnyj okrug,
-# Kurganskaya oblast', Orenburgskaya oblast', Permskaya oblast',
-# Sverdlovskaya oblast', Tyumenskaya oblast',
-# Khanty-Manskijskij avtonomnyj okrug, Chelyabinskaya oblast',
-# Yamalo-Nenetskij avtonomnyj okrug.
-Zone Asia/Yekaterinburg	 4:02:24 -	LMT	1919 Jul 15 4:00
-			 4:00	-	SVET	1930 Jun 21 # Sverdlovsk Time
-			 5:00	Russia	SVE%sT	1991 Mar 31 2:00s
-			 4:00	Russia	SVE%sT	1992 Jan 19 2:00s
-			 5:00	Russia	YEK%sT	# Yekaterinburg Time
-#
-# From Oscar van Vlijmen (2001-08-25): [This region consists of]
-# Respublika Altaj, Altajskij kraj, Omskaya oblast'.
-Zone Asia/Omsk		 4:53:36 -	LMT	1919 Nov 14
-			 5:00	-	OMST	1930 Jun 21 # Omsk TIme
-			 6:00	Russia	OMS%sT	1991 Mar 31 2:00s
-			 5:00	Russia	OMS%sT	1992 Jan 19 2:00s
-			 6:00	Russia	OMS%sT
-#
-# From Paul Eggert (2006-08-19): I'm guessing about Tomsk here; it's
-# not clear when it switched from +7 to +6.
-# Novosibirskaya oblast', Tomskaya oblast'.
-Zone Asia/Novosibirsk	 5:31:40 -	LMT	1919 Dec 14 6:00
-			 6:00	-	NOVT	1930 Jun 21 # Novosibirsk Time
-			 7:00	Russia	NOV%sT	1991 Mar 31 2:00s
-			 6:00	Russia	NOV%sT	1992 Jan 19 2:00s
-			 7:00	Russia	NOV%sT	1993 May 23 # say Shanks & P.
-			 6:00	Russia	NOV%sT
-
-# From Alexander Krivenyshev (2009-10-13):
-# Kemerovo oblast' (Kemerovo region) in Russia will change current time zone on
-# March 28, 2010:
-# from current Russia Zone 6 - Krasnoyarsk Time Zone (KRA) UTC +0700
-# to Russia Zone 5 - Novosibirsk Time Zone (NOV) UTC +0600
-#
-# This is according to Government of Russia decree # 740, on September
-# 14, 2009 "Application in the territory of the Kemerovo region the Fifth
-# time zone." ("Russia Zone 5" or old "USSR Zone 5" is GMT +0600)
-#
-# Russian Government web site (Russian language)
-# <a href="http://www.government.ru/content/governmentactivity/rfgovernmentdecisions/archiv">
-# http://www.government.ru/content/governmentactivity/rfgovernmentdecisions/archive/2009/09/14/991633.htm
-# </a>
-# or Russian-English translation by WorldTimeZone.com with reference
-# map to local region and new Russia Time Zone map after March 28, 2010
-# <a href="http://www.worldtimezone.com/dst_news/dst_news_russia03.html">
-# http://www.worldtimezone.com/dst_news/dst_news_russia03.html
-# </a>
-#
-# Thus, when Russia will switch to DST on the night of March 28, 2010
-# Kemerovo region (Kemerovo oblast') will not change the clock.
-#
-# As a result, Kemerovo oblast' will be in the same time zone as
-# Novosibirsk, Omsk, Tomsk, Barnaul and Altai Republic.
-
-Zone Asia/Novokuznetsk	 5:48:48 -	NMT	1920 Jan  6
-			 6:00	-	KRAT	1930 Jun 21 # Krasnoyarsk Time
-			 7:00	Russia	KRA%sT	1991 Mar 31 2:00s
-			 6:00	Russia	KRA%sT	1992 Jan 19 2:00s
-			 7:00	Russia	KRA%sT	2010 Mar 28 2:00s
-			 6:00	Russia	NOV%sT # Novosibirsk/Novokuznetsk Time
-
-#
-# From Oscar van Vlijmen (2001-08-25): [This region consists of]
-# Krasnoyarskij kraj,
-# Tajmyrskij (Dolgano-Nenetskij) avtonomnyj okrug,
-# Respublika Tuva, Respublika Khakasiya, Evenkijskij avtonomnyj okrug.
-Zone Asia/Krasnoyarsk	 6:11:20 -	LMT	1920 Jan  6
-			 6:00	-	KRAT	1930 Jun 21 # Krasnoyarsk Time
-			 7:00	Russia	KRA%sT	1991 Mar 31 2:00s
-			 6:00	Russia	KRA%sT	1992 Jan 19 2:00s
-			 7:00	Russia	KRA%sT
-#
-# From Oscar van Vlijmen (2001-08-25): [This region consists of]
-# Respublika Buryatiya, Irkutskaya oblast',
-# Ust'-Ordynskij Buryatskij avtonomnyj okrug.
-Zone Asia/Irkutsk	 6:57:20 -	LMT	1880
-			 6:57:20 -	IMT	1920 Jan 25 # Irkutsk Mean Time
-			 7:00	-	IRKT	1930 Jun 21 # Irkutsk Time
-			 8:00	Russia	IRK%sT	1991 Mar 31 2:00s
-			 7:00	Russia	IRK%sT	1992 Jan 19 2:00s
-			 8:00	Russia	IRK%sT
-#
-# From Oscar van Vlijmen (2003-10-18): [This region consists of]
-# Aginskij Buryatskij avtonomnyj okrug, Amurskaya oblast',
-# [parts of] Respublika Sakha (Yakutiya), Chitinskaya oblast'.
-# The Sakha districts are: Aldanskij, Amginskij, Anabarskij,
-# Bulunskij, Verkhnekolymskij, Verkhnevilyujskij, Vilyujskij, Gornyj,
-# Zhiganskij, Kobyajskij, Lenskij, Megino-Kangalasskij, Mirninskij,
-# Namskij, Nyurbinskij, Olenekskij, Olekminskij, Srednekolymskij,
-# Suntarskij, Tattinskij, Ust'-Aldanskij, Khangalasskij,
-# Churapchinskij, Eveno-Bytantajskij.
-Zone Asia/Yakutsk	 8:38:40 -	LMT	1919 Dec 15
-			 8:00	-	YAKT	1930 Jun 21 # Yakutsk Time
-			 9:00	Russia	YAK%sT	1991 Mar 31 2:00s
-			 8:00	Russia	YAK%sT	1992 Jan 19 2:00s
-			 9:00	Russia	YAK%sT
-#
-# From Oscar van Vlijmen (2003-10-18): [This region consists of]
-# Evrejskaya avtonomnaya oblast', Khabarovskij kraj, Primorskij kraj,
-# [parts of] Respublika Sakha (Yakutiya).
-# The Sakha districts are: Verkhoyanskij, Tomponskij, Ust'-Majskij,
-# Ust'-Yanskij.
-Zone Asia/Vladivostok	 8:47:44 -	LMT	1922 Nov 15
-			 9:00	-	VLAT	1930 Jun 21 # Vladivostok Time
-			10:00	Russia	VLA%sT	1991 Mar 31 2:00s
-			 9:00	Russia	VLA%sST	1992 Jan 19 2:00s
-			10:00	Russia	VLA%sT
-#
-# Sakhalinskaya oblast'.
-# The Zone name should be Yuzhno-Sakhalinsk, but that's too long.
-Zone Asia/Sakhalin	 9:30:48 -	LMT	1905 Aug 23
-			 9:00	-	CJT	1938
-			 9:00	-	JST	1945 Aug 25
-			11:00	Russia	SAK%sT	1991 Mar 31 2:00s # Sakhalin T.
-			10:00	Russia	SAK%sT	1992 Jan 19 2:00s
-			11:00	Russia	SAK%sT	1997 Mar lastSun 2:00s
-			10:00	Russia	SAK%sT
-#
-# From Oscar van Vlijmen (2003-10-18): [This region consists of]
-# Magadanskaya oblast', Respublika Sakha (Yakutiya).
-# Probably also: Kuril Islands.
-# The Sakha districts are: Abyjskij, Allaikhovskij, Momskij,
-# Nizhnekolymskij, Ojmyakonskij.
-Zone Asia/Magadan	10:03:12 -	LMT	1924 May  2
-			10:00	-	MAGT	1930 Jun 21 # Magadan Time
-			11:00	Russia	MAG%sT	1991 Mar 31 2:00s
-			10:00	Russia	MAG%sT	1992 Jan 19 2:00s
-			11:00	Russia	MAG%sT
-#
-# From Oscar van Vlijmen (2001-08-25): [This region consists of]
-# Kamchatskaya oblast', Koryakskij avtonomnyj okrug.
-#
-# The Zone name should be Asia/Petropavlovsk-Kamchatski, but that's too long.
-Zone Asia/Kamchatka	10:34:36 -	LMT	1922 Nov 10
-			11:00	-	PETT	1930 Jun 21 # P-K Time
-			12:00	Russia	PET%sT	1991 Mar 31 2:00s
-			11:00	Russia	PET%sT	1992 Jan 19 2:00s
-			12:00	Russia	PET%sT
-#
-# Chukotskij avtonomnyj okrug
-Zone Asia/Anadyr	11:49:56 -	LMT	1924 May  2
-			12:00	-	ANAT	1930 Jun 21 # Anadyr Time
-			13:00	Russia	ANA%sT	1982 Apr  1 0:00s
-			12:00	Russia	ANA%sT	1991 Mar 31 2:00s
-			11:00	Russia	ANA%sT	1992 Jan 19 2:00s
-			12:00	Russia	ANA%sT
-
-# Serbia
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Europe/Belgrade	1:22:00	-	LMT	1884
-			1:00	-	CET	1941 Apr 18 23:00
-			1:00	C-Eur	CE%sT	1945
-			1:00	-	CET	1945 May 8 2:00s
-			1:00	1:00	CEST	1945 Sep 16  2:00s
-# Metod Kozelj reports that the legal date of
-# transition to EU rules was 1982-11-27, for all of Yugoslavia at the time.
-# Shanks & Pottenger don't give as much detail, so go with Kozelj.
-			1:00	-	CET	1982 Nov 27
-			1:00	EU	CE%sT
-Link Europe/Belgrade Europe/Ljubljana	# Slovenia
-Link Europe/Belgrade Europe/Podgorica	# Montenegro
-Link Europe/Belgrade Europe/Sarajevo	# Bosnia and Herzegovina
-Link Europe/Belgrade Europe/Skopje	# Macedonia
-Link Europe/Belgrade Europe/Zagreb	# Croatia
-
-# Slovakia
-Link Europe/Prague Europe/Bratislava
-
-# Slovenia
-# see Serbia
-
-# Spain
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-# For 1917-1919 Whitman gives Apr Sat>=1 - Oct Sat>=1;
-# go with Shanks & Pottenger.
-Rule	Spain	1917	only	-	May	 5	23:00s	1:00	S
-Rule	Spain	1917	1919	-	Oct	 6	23:00s	0	-
-Rule	Spain	1918	only	-	Apr	15	23:00s	1:00	S
-Rule	Spain	1919	only	-	Apr	 5	23:00s	1:00	S
-# Whitman gives 1921 Feb 28 - Oct 14; go with Shanks & Pottenger.
-Rule	Spain	1924	only	-	Apr	16	23:00s	1:00	S
-# Whitman gives 1924 Oct 14; go with Shanks & Pottenger.
-Rule	Spain	1924	only	-	Oct	 4	23:00s	0	-
-Rule	Spain	1926	only	-	Apr	17	23:00s	1:00	S
-# Whitman says no DST in 1929; go with Shanks & Pottenger.
-Rule	Spain	1926	1929	-	Oct	Sat>=1	23:00s	0	-
-Rule	Spain	1927	only	-	Apr	 9	23:00s	1:00	S
-Rule	Spain	1928	only	-	Apr	14	23:00s	1:00	S
-Rule	Spain	1929	only	-	Apr	20	23:00s	1:00	S
-# Whitman gives 1937 Jun 16, 1938 Apr 16, 1940 Apr 13;
-# go with Shanks & Pottenger.
-Rule	Spain	1937	only	-	May	22	23:00s	1:00	S
-Rule	Spain	1937	1939	-	Oct	Sat>=1	23:00s	0	-
-Rule	Spain	1938	only	-	Mar	22	23:00s	1:00	S
-Rule	Spain	1939	only	-	Apr	15	23:00s	1:00	S
-Rule	Spain	1940	only	-	Mar	16	23:00s	1:00	S
-# Whitman says no DST 1942-1945; go with Shanks & Pottenger.
-Rule	Spain	1942	only	-	May	 2	22:00s	2:00	M # Midsummer
-Rule	Spain	1942	only	-	Sep	 1	22:00s	1:00	S
-Rule	Spain	1943	1946	-	Apr	Sat>=13	22:00s	2:00	M
-Rule	Spain	1943	only	-	Oct	 3	22:00s	1:00	S
-Rule	Spain	1944	only	-	Oct	10	22:00s	1:00	S
-Rule	Spain	1945	only	-	Sep	30	 1:00	1:00	S
-Rule	Spain	1946	only	-	Sep	30	 0:00	0	-
-Rule	Spain	1949	only	-	Apr	30	23:00	1:00	S
-Rule	Spain	1949	only	-	Sep	30	 1:00	0	-
-Rule	Spain	1974	1975	-	Apr	Sat>=13	23:00	1:00	S
-Rule	Spain	1974	1975	-	Oct	Sun>=1	 1:00	0	-
-Rule	Spain	1976	only	-	Mar	27	23:00	1:00	S
-Rule	Spain	1976	1977	-	Sep	lastSun	 1:00	0	-
-Rule	Spain	1977	1978	-	Apr	 2	23:00	1:00	S
-Rule	Spain	1978	only	-	Oct	 1	 1:00	0	-
-# The following rules are copied from Morocco from 1967 through 1978.
-Rule SpainAfrica 1967	only	-	Jun	 3	12:00	1:00	S
-Rule SpainAfrica 1967	only	-	Oct	 1	 0:00	0	-
-Rule SpainAfrica 1974	only	-	Jun	24	 0:00	1:00	S
-Rule SpainAfrica 1974	only	-	Sep	 1	 0:00	0	-
-Rule SpainAfrica 1976	1977	-	May	 1	 0:00	1:00	S
-Rule SpainAfrica 1976	only	-	Aug	 1	 0:00	0	-
-Rule SpainAfrica 1977	only	-	Sep	28	 0:00	0	-
-Rule SpainAfrica 1978	only	-	Jun	 1	 0:00	1:00	S
-Rule SpainAfrica 1978	only	-	Aug	 4	 0:00	0	-
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Europe/Madrid	-0:14:44 -	LMT	1901 Jan  1  0:00s
-			 0:00	Spain	WE%sT	1946 Sep 30
-			 1:00	Spain	CE%sT	1979
-			 1:00	EU	CE%sT
-Zone	Africa/Ceuta	-0:21:16 -	LMT	1901
-			 0:00	-	WET	1918 May  6 23:00
-			 0:00	1:00	WEST	1918 Oct  7 23:00
-			 0:00	-	WET	1924
-			 0:00	Spain	WE%sT	1929
-			 0:00 SpainAfrica WE%sT 1984 Mar 16
-			 1:00	-	CET	1986
-			 1:00	EU	CE%sT
-Zone	Atlantic/Canary	-1:01:36 -	LMT	1922 Mar # Las Palmas de Gran C.
-			-1:00	-	CANT	1946 Sep 30 1:00 # Canaries Time
-			 0:00	-	WET	1980 Apr  6 0:00s
-			 0:00	1:00	WEST	1980 Sep 28 0:00s
-			 0:00	EU	WE%sT
-# IATA SSIM (1996-09) says the Canaries switch at 2:00u, not 1:00u.
-# Ignore this for now, as the Canaries are part of the EU.
-
-# Sweden
-
-# From Ivan Nilsson (2001-04-13), superseding Shanks & Pottenger:
-#
-# The law "Svensk forfattningssamling 1878, no 14" about standard time in 1879:
-# From the beginning of 1879 (that is 01-01 00:00) the time for all
-# places in the country is "the mean solar time for the meridian at
-# three degrees, or twelve minutes of time, to the west of the
-# meridian of the Observatory of Stockholm".  The law is dated 1878-05-31.
-#
-# The observatory at that time had the meridian 18 degrees 03' 30"
-# eastern longitude = 01:12:14 in time.  Less 12 minutes gives the
-# national standard time as 01:00:14 ahead of GMT....
-#
-# About the beginning of CET in Sweden. The lawtext ("Svensk
-# forfattningssamling 1899, no 44") states, that "from the beginning
-# of 1900... ... the same as the mean solar time for the meridian at
-# the distance of one hour of time from the meridian of the English
-# observatory at Greenwich, or at 12 minutes 14 seconds to the west
-# from the meridian of the Observatory of Stockholm". The law is dated
-# 1899-06-16.  In short: At 1900-01-01 00:00:00 the new standard time
-# in Sweden is 01:00:00 ahead of GMT.
-#
-# 1916: The lawtext ("Svensk forfattningssamling 1916, no 124") states
-# that "1916-05-15 is considered to begin one hour earlier". It is
-# pretty obvious that at 05-14 23:00 the clocks are set to 05-15 00:00....
-# Further the law says, that "1916-09-30 is considered to end one hour later".
-#
-# The laws regulating [DST] are available on the site of the Swedish
-# Parliament beginning with 1985 - the laws regulating 1980/1984 are
-# not available on the site (to my knowledge they are only available
-# in Swedish): <http://www.riksdagen.se/english/work/sfst.asp> (type
-# "sommartid" without the quotes in the field "Fritext" and then click
-# the Sok-button).
-#
-# (2001-05-13):
-#
-# I have now found a newspaper stating that at 1916-10-01 01:00
-# summertime the church-clocks etc were set back one hour to show
-# 1916-10-01 00:00 standard time.  The article also reports that some
-# people thought the switch to standard time would take place already
-# at 1916-10-01 00:00 summer time, but they had to wait for another
-# hour before the event took place.
-#
-# Source: The newspaper "Dagens Nyheter", 1916-10-01, page 7 upper left.
-
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone Europe/Stockholm	1:12:12 -	LMT	1879 Jan  1
-			1:00:14	-	SET	1900 Jan  1	# Swedish Time
-			1:00	-	CET	1916 May 14 23:00
-			1:00	1:00	CEST	1916 Oct  1 01:00
-			1:00	-	CET	1980
-			1:00	EU	CE%sT
-
-# Switzerland
-# From Howse:
-# By the end of the 18th century clocks and watches became commonplace
-# and their performance improved enormously.  Communities began to keep
-# mean time in preference to apparent time -- Geneva from 1780 ....
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-# From Whitman (who writes ``Midnight?''):
-# Rule	Swiss	1940	only	-	Nov	 2	0:00	1:00	S
-# Rule	Swiss	1940	only	-	Dec	31	0:00	0	-
-# From Shanks & Pottenger:
-# Rule	Swiss	1941	1942	-	May	Sun>=1	2:00	1:00	S
-# Rule	Swiss	1941	1942	-	Oct	Sun>=1	0:00	0	-
-
-# From Alois Treindl (2008-12-17):
-# I have researched the DST usage in Switzerland during the 1940ies.
-#
-# As I wrote in an earlier message, I suspected the current tzdata values
-# to be wrong. This is now verified.
-#
-# I have found copies of the original ruling by the Swiss Federal
-# government, in 'Eidgen[o]ssische Gesetzessammlung 1941 and 1942' (Swiss
-# federal law collection)...
-#
-# DST began on Monday 5 May 1941, 1:00 am by shifting the clocks to 2:00 am
-# DST ended on Monday 6 Oct 1941, 2:00 am by shifting the clocks to 1:00 am.
-#
-# DST began on Monday, 4 May 1942 at 01:00 am
-# DST ended on Monday, 5 Oct 1942 at 02:00 am
-#
-# There was no DST in 1940, I have checked the law collection carefully.
-# It is also indicated by the fact that the 1942 entry in the law
-# collection points back to 1941 as a reference, but no reference to any
-# other years are made.
-#
-# Newspaper articles I have read in the archives on 6 May 1941 reported
-# about the introduction of DST (Sommerzeit in German) during the previous
-# night as an absolute novelty, because this was the first time that such
-# a thing had happened in Switzerland.
-#
-# I have also checked 1916, because one book source (Gabriel, Traite de
-# l'heure dans le monde) claims that Switzerland had DST in 1916. This is
-# false, no official document could be found. Probably Gabriel got misled
-# by references to Germany, which introduced DST in 1916 for the first time.
-#
-# The tzdata rules for Switzerland must be changed to:
-# Rule  Swiss   1941    1942    -       May     Mon>=1  1:00    1:00    S
-# Rule  Swiss   1941    1942    -       Oct     Mon>=1  2:00    0       -
-#
-# The 1940 rules must be deleted.
-#
-# One further detail for Switzerland, which is probably out of scope for
-# most users of tzdata:
-# The zone file
-# Zone    Europe/Zurich   0:34:08 -       LMT     1848 Sep 12
-#                          0:29:44 -       BMT     1894 Jun #Bern Mean Time
-#                          1:00    Swiss   CE%sT   1981
-#                          1:00    EU      CE%sT
-# describes all of Switzerland correctly, with the exception of
-# the Cantone Geneve (Geneva, Genf). Between 1848 and 1894 Geneve did not
-# follow Bern Mean Time but kept its own local mean time.
-# To represent this, an extra zone would be needed.
-
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Swiss	1941	1942	-	May	Mon>=1	1:00	1:00	S
-Rule	Swiss	1941	1942	-	Oct	Mon>=1	2:00	0	-
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Europe/Zurich	0:34:08 -	LMT	1848 Sep 12
-			0:29:44	-	BMT	1894 Jun # Bern Mean Time
-			1:00	Swiss	CE%sT	1981
-			1:00	EU	CE%sT
-
-# Turkey
-
-# From Amar Devegowda (2007-01-03):
-# The time zone rules for Istanbul, Turkey have not been changed for years now.
-# ... The latest rules are available at -
-# http://www.timeanddate.com/worldclock/timezone.html?n=107
-# From Steffen Thorsen (2007-01-03):
-# I have been able to find press records back to 1996 which all say that
-# DST started 01:00 local time and end at 02:00 local time.  I am not sure
-# what happened before that.  One example for each year from 1996 to 2001:
-# http://newspot.byegm.gov.tr/arsiv/1996/21/N4.htm
-# http://www.byegm.gov.tr/YAYINLARIMIZ/CHR/ING97/03/97X03X25.TXT
-# http://www.byegm.gov.tr/YAYINLARIMIZ/CHR/ING98/03/98X03X02.HTM
-# http://www.byegm.gov.tr/YAYINLARIMIZ/CHR/ING99/10/99X10X26.HTM#%2016
-# http://www.byegm.gov.tr/YAYINLARIMIZ/CHR/ING2000/03/00X03X06.HTM#%2021
-# http://www.byegm.gov.tr/YAYINLARIMIZ/CHR/ING2001/03/23x03x01.HTM#%2027
-# From Paul Eggert (2007-01-03):
-# Prefer the above source to Shanks & Pottenger for time stamps after 1990.
-
-# From Steffen Thorsen (2007-03-09):
-# Starting 2007 though, it seems that they are adopting EU's 1:00 UTC
-# start/end time, according to the following page (2007-03-07):
-# http://www.ntvmsnbc.com/news/402029.asp
-# The official document is located here - it is in Turkish...:
-# http://rega.basbakanlik.gov.tr/eskiler/2007/03/20070307-7.htm
-# I was able to locate the following seemingly official document
-# (on a non-government server though) describing dates between 2002 and 2006:
-# http://www.alomaliye.com/bkk_2002_3769.htm
-
-# From Sue Williams (2008-08-11):
-# I spotted this news article about a potential change in Turkey.
-#
-# <a href="http://www.hurriyet.com.tr/english/domestic/9626174.asp?scr=1">
-# http://www.hurriyet.com.tr/english/domestic/9626174.asp?scr=1
-# </a>
-
-# From Sue Williams (2008-08-20):
-# This article says that around the end of March 2011, Turkey wants to
-# adjust the clocks forward by 1/2 hour and stay that way permanently.
-# The article indicates that this is a change in timezone offset in addition
-# to stopping observance of DST.
-# This proposal has not yet been approved.
-#
-# Read more here...
-#
-# Turkey to abandon daylight saving time in 2011
-# <a href="http://www.turkishdailynews.com.tr/article.php?enewsid=112989">
-# http://www.turkishdailynews.com.tr/article.php?enewsid=112989
-# </a>
-
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Turkey	1916	only	-	May	 1	0:00	1:00	S
-Rule	Turkey	1916	only	-	Oct	 1	0:00	0	-
-Rule	Turkey	1920	only	-	Mar	28	0:00	1:00	S
-Rule	Turkey	1920	only	-	Oct	25	0:00	0	-
-Rule	Turkey	1921	only	-	Apr	 3	0:00	1:00	S
-Rule	Turkey	1921	only	-	Oct	 3	0:00	0	-
-Rule	Turkey	1922	only	-	Mar	26	0:00	1:00	S
-Rule	Turkey	1922	only	-	Oct	 8	0:00	0	-
-# Whitman gives 1923 Apr 28 - Sep 16 and no DST in 1924-1925;
-# go with Shanks & Pottenger.
-Rule	Turkey	1924	only	-	May	13	0:00	1:00	S
-Rule	Turkey	1924	1925	-	Oct	 1	0:00	0	-
-Rule	Turkey	1925	only	-	May	 1	0:00	1:00	S
-Rule	Turkey	1940	only	-	Jun	30	0:00	1:00	S
-Rule	Turkey	1940	only	-	Oct	 5	0:00	0	-
-Rule	Turkey	1940	only	-	Dec	 1	0:00	1:00	S
-Rule	Turkey	1941	only	-	Sep	21	0:00	0	-
-Rule	Turkey	1942	only	-	Apr	 1	0:00	1:00	S
-# Whitman omits the next two transition and gives 1945 Oct 1;
-# go with Shanks & Pottenger.
-Rule	Turkey	1942	only	-	Nov	 1	0:00	0	-
-Rule	Turkey	1945	only	-	Apr	 2	0:00	1:00	S
-Rule	Turkey	1945	only	-	Oct	 8	0:00	0	-
-Rule	Turkey	1946	only	-	Jun	 1	0:00	1:00	S
-Rule	Turkey	1946	only	-	Oct	 1	0:00	0	-
-Rule	Turkey	1947	1948	-	Apr	Sun>=16	0:00	1:00	S
-Rule	Turkey	1947	1950	-	Oct	Sun>=2	0:00	0	-
-Rule	Turkey	1949	only	-	Apr	10	0:00	1:00	S
-Rule	Turkey	1950	only	-	Apr	19	0:00	1:00	S
-Rule	Turkey	1951	only	-	Apr	22	0:00	1:00	S
-Rule	Turkey	1951	only	-	Oct	 8	0:00	0	-
-Rule	Turkey	1962	only	-	Jul	15	0:00	1:00	S
-Rule	Turkey	1962	only	-	Oct	 8	0:00	0	-
-Rule	Turkey	1964	only	-	May	15	0:00	1:00	S
-Rule	Turkey	1964	only	-	Oct	 1	0:00	0	-
-Rule	Turkey	1970	1972	-	May	Sun>=2	0:00	1:00	S
-Rule	Turkey	1970	1972	-	Oct	Sun>=2	0:00	0	-
-Rule	Turkey	1973	only	-	Jun	 3	1:00	1:00	S
-Rule	Turkey	1973	only	-	Nov	 4	3:00	0	-
-Rule	Turkey	1974	only	-	Mar	31	2:00	1:00	S
-Rule	Turkey	1974	only	-	Nov	 3	5:00	0	-
-Rule	Turkey	1975	only	-	Mar	30	0:00	1:00	S
-Rule	Turkey	1975	1976	-	Oct	lastSun	0:00	0	-
-Rule	Turkey	1976	only	-	Jun	 1	0:00	1:00	S
-Rule	Turkey	1977	1978	-	Apr	Sun>=1	0:00	1:00	S
-Rule	Turkey	1977	only	-	Oct	16	0:00	0	-
-Rule	Turkey	1979	1980	-	Apr	Sun>=1	3:00	1:00	S
-Rule	Turkey	1979	1982	-	Oct	Mon>=11	0:00	0	-
-Rule	Turkey	1981	1982	-	Mar	lastSun	3:00	1:00	S
-Rule	Turkey	1983	only	-	Jul	31	0:00	1:00	S
-Rule	Turkey	1983	only	-	Oct	 2	0:00	0	-
-Rule	Turkey	1985	only	-	Apr	20	0:00	1:00	S
-Rule	Turkey	1985	only	-	Sep	28	0:00	0	-
-Rule	Turkey	1986	1990	-	Mar	lastSun	2:00s	1:00	S
-Rule	Turkey	1986	1990	-	Sep	lastSun	2:00s	0	-
-Rule	Turkey	1991	2006	-	Mar	lastSun	1:00s	1:00	S
-Rule	Turkey	1991	1995	-	Sep	lastSun	1:00s	0	-
-Rule	Turkey	1996	2006	-	Oct	lastSun	1:00s	0	-
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Europe/Istanbul	1:55:52 -	LMT	1880
-			1:56:56	-	IMT	1910 Oct # Istanbul Mean Time?
-			2:00	Turkey	EE%sT	1978 Oct 15
-			3:00	Turkey	TR%sT	1985 Apr 20 # Turkey Time
-			2:00	Turkey	EE%sT	2007
-			2:00	EU	EE%sT
-Link	Europe/Istanbul	Asia/Istanbul	# Istanbul is in both continents.
-
-# Ukraine
-#
-# From Igor Karpov, who works for the Ukranian Ministry of Justice,
-# via Garrett Wollman (2003-01-27):
-# BTW, I've found the official document on this matter. It's goverment
-# regulations number 509, May 13, 1996. In my poor translation it says:
-# "Time in Ukraine is set to second timezone (Kiev time). Each last Sunday
-# of March at 3am the time is changing to 4am and each last Sunday of
-# October the time at 4am is changing to 3am"
-
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-# Most of Ukraine since 1970 has been like Kiev.
-# "Kyiv" is the transliteration of the Ukrainian name, but
-# "Kiev" is more common in English.
-Zone Europe/Kiev	2:02:04 -	LMT	1880
-			2:02:04	-	KMT	1924 May  2 # Kiev Mean Time
-			2:00	-	EET	1930 Jun 21
-			3:00	-	MSK	1941 Sep 20
-			1:00	C-Eur	CE%sT	1943 Nov  6
-			3:00	Russia	MSK/MSD	1990
-			3:00	-	MSK	1990 Jul  1 2:00
-			2:00	-	EET	1992
-			2:00	E-Eur	EE%sT	1995
-			2:00	EU	EE%sT
-# Ruthenia used CET 1990/1991.
-# "Uzhhorod" is the transliteration of the Ukrainian name, but
-# "Uzhgorod" is more common in English.
-Zone Europe/Uzhgorod	1:29:12 -	LMT	1890 Oct
-			1:00	-	CET	1940
-			1:00	C-Eur	CE%sT	1944 Oct
-			1:00	1:00	CEST	1944 Oct 26
-			1:00	-	CET	1945 Jun 29
-			3:00	Russia	MSK/MSD	1990
-			3:00	-	MSK	1990 Jul  1 2:00
-			1:00	-	CET	1991 Mar 31 3:00
-			2:00	-	EET	1992
-			2:00	E-Eur	EE%sT	1995
-			2:00	EU	EE%sT
-# Zaporozh'ye and eastern Lugansk oblasts observed DST 1990/1991.
-# "Zaporizhia" is the transliteration of the Ukrainian name, but
-# "Zaporozh'ye" is more common in English.  Use the common English
-# spelling, except omit the apostrophe as it is not allowed in
-# portable Posix file names.
-Zone Europe/Zaporozhye	2:20:40 -	LMT	1880
-			2:20	-	CUT	1924 May  2 # Central Ukraine T
-			2:00	-	EET	1930 Jun 21
-			3:00	-	MSK	1941 Aug 25
-			1:00	C-Eur	CE%sT	1943 Oct 25
-			3:00	Russia	MSK/MSD	1991 Mar 31 2:00
-			2:00	E-Eur	EE%sT	1995
-			2:00	EU	EE%sT
-# Central Crimea used Moscow time 1994/1997.
-Zone Europe/Simferopol	2:16:24 -	LMT	1880
-			2:16	-	SMT	1924 May  2 # Simferopol Mean T
-			2:00	-	EET	1930 Jun 21
-			3:00	-	MSK	1941 Nov
-			1:00	C-Eur	CE%sT	1944 Apr 13
-			3:00	Russia	MSK/MSD	1990
-			3:00	-	MSK	1990 Jul  1 2:00
-			2:00	-	EET	1992
-# From Paul Eggert (2006-03-22):
-# The _Economist_ (1994-05-28, p 45) reports that central Crimea switched
-# from Kiev to Moscow time sometime after the January 1994 elections.
-# Shanks (1999) says ``date of change uncertain'', but implies that it happened
-# sometime between the 1994 DST switches.  Shanks & Pottenger simply say
-# 1994-09-25 03:00, but that can't be right.  For now, guess it
-# changed in May.
-			2:00	E-Eur	EE%sT	1994 May
-# From IATA SSIM (1994/1997), which also says that Kerch is still like Kiev.
-			3:00	E-Eur	MSK/MSD	1996 Mar 31 3:00s
-			3:00	1:00	MSD	1996 Oct 27 3:00s
-# IATA SSIM (1997-09) says Crimea switched to EET/EEST.
-# Assume it happened in March by not changing the clocks.
-			3:00	Russia	MSK/MSD	1997
-			3:00	-	MSK	1997 Mar lastSun 1:00u
-			2:00	EU	EE%sT
-
-###############################################################################
-
-# One source shows that Bulgaria, Cyprus, Finland, and Greece observe DST from
-# the last Sunday in March to the last Sunday in September in 1986.
-# The source shows Romania changing a day later than everybody else.
-#
-# According to Bernard Sieloff's source, Poland is in the MET time zone but
-# uses the WE DST rules.  The Western USSR uses EET+1 and ME DST rules.
-# Bernard Sieloff's source claims Romania switches on the same day, but at
-# 00:00 standard time (i.e., 01:00 DST).  It also claims that Turkey
-# switches on the same day, but switches on at 01:00 standard time
-# and off at 00:00 standard time (i.e., 01:00 DST)
-
-# ...
-# Date: Wed, 28 Jan 87 16:56:27 -0100
-# From: Tom Hofmann
-# ...
-#
-# ...the European time rules are...standardized since 1981, when
-# most European coun[tr]ies started DST.  Before that year, only
-# a few countries (UK, France, Italy) had DST, each according
-# to own national rules.  In 1981, however, DST started on
-# 'Apr firstSun', and not on 'Mar lastSun' as in the following
-# years...
-# But also since 1981 there are some more national exceptions
-# than listed in 'europe': Switzerland, for example, joined DST
-# one year later, Denmark ended DST on 'Oct 1' instead of 'Sep
-# lastSun' in 1981---I don't know how they handle now.
-#
-# Finally, DST ist always from 'Apr 1' to 'Oct 1' in the
-# Soviet Union (as far as I know).
-#
-# Tom Hofmann, Scientific Computer Center, CIBA-GEIGY AG,
-# 4002 Basle, Switzerland
-# ...
-
-# ...
-# Date: Wed, 4 Feb 87 22:35:22 +0100
-# From: Dik T. Winter
-# ...
-#
-# The information from Tom Hofmann is (as far as I know) not entirely correct.
-# After a request from chongo at amdahl I tried to retrieve all information
-# about DST in Europe.  I was able to find all from about 1969.
-#
-# ...standardization on DST in Europe started in about 1977 with switches on
-# first Sunday in April and last Sunday in September...
-# In 1981 UK joined Europe insofar that
-# the starting day for both shifted to last Sunday in March.  And from 1982
-# the whole of Europe used DST, with switch dates April 1 and October 1 in
-# the Sov[i]et Union.  In 1985 the SU reverted to standard Europe[a]n switch
-# dates...
-#
-# It should also be remembered that time-zones are not constants; e.g.
-# Portugal switched in 1976 from MET (or CET) to WET with DST...
-# Note also that though there were rules for switch dates not
-# all countries abided to these dates, and many individual deviations
-# occurred, though not since 1982 I believe.  Another note: it is always
-# assumed that DST is 1 hour ahead of normal time, this need not be the
-# case; at least in the Netherlands there have been times when DST was 2 hours
-# in advance of normal time.
-#
-# ...
-# dik t. winter, cwi, amsterdam, nederland
-# ...
-
-# From Bob Devine (1988-01-28):
-# ...
-# Greece: Last Sunday in April to last Sunday in September (iffy on dates).
-# Since 1978.  Change at midnight.
-# ...
-# Monaco: has same DST as France.
-# ...
diff --git a/tools/zoneinfo/tzdata2009s/leapseconds b/tools/zoneinfo/tzdata2009s/leapseconds
deleted file mode 100644
index a3c95ef..0000000
--- a/tools/zoneinfo/tzdata2009s/leapseconds
+++ /dev/null
@@ -1,87 +0,0 @@
-# <pre>
-# @(#)leapseconds	8.9
-# This file is in the public domain, so clarified as of
-# 2009-05-17 by Arthur David Olson.
-
-# Allowance for leapseconds added to each timezone file.
-
-# The International Earth Rotation Service periodically uses leap seconds
-# to keep UTC to within 0.9 s of UT1
-# (which measures the true angular orientation of the earth in space); see
-# Terry J Quinn, The BIPM and the accurate measure of time,
-# Proc IEEE 79, 7 (July 1991), 894-905.
-# There were no leap seconds before 1972, because the official mechanism
-# accounting for the discrepancy between atomic time and the earth's rotation
-# did not exist until the early 1970s.
-
-# The correction (+ or -) is made at the given time, so lines
-# will typically look like:
-#	Leap	YEAR	MON	DAY	23:59:60	+	R/S
-# or
-#	Leap	YEAR	MON	DAY	23:59:59	-	R/S
-
-# If the leapsecond is Rolling (R) the given time is local time
-# If the leapsecond is Stationary (S) the given time is UTC
-
-# Leap	YEAR	MONTH	DAY	HH:MM:SS	CORR	R/S
-Leap	1972	Jun	30	23:59:60	+	S
-Leap	1972	Dec	31	23:59:60	+	S
-Leap	1973	Dec	31	23:59:60	+	S
-Leap	1974	Dec	31	23:59:60	+	S
-Leap	1975	Dec	31	23:59:60	+	S
-Leap	1976	Dec	31	23:59:60	+	S
-Leap	1977	Dec	31	23:59:60	+	S
-Leap	1978	Dec	31	23:59:60	+	S
-Leap	1979	Dec	31	23:59:60	+	S
-Leap	1981	Jun	30	23:59:60	+	S
-Leap	1982	Jun	30	23:59:60	+	S
-Leap	1983	Jun	30	23:59:60	+	S
-Leap	1985	Jun	30	23:59:60	+	S
-Leap	1987	Dec	31	23:59:60	+	S
-Leap	1989	Dec	31	23:59:60	+	S
-Leap	1990	Dec	31	23:59:60	+	S
-Leap	1992	Jun	30	23:59:60	+	S
-Leap	1993	Jun	30	23:59:60	+	S
-Leap	1994	Jun	30	23:59:60	+	S
-Leap	1995	Dec	31	23:59:60	+	S
-Leap	1997	Jun	30	23:59:60	+	S
-Leap	1998	Dec	31	23:59:60	+	S
-Leap	2005	Dec	31	23:59:60	+	S
-Leap	2008	Dec	31	23:59:60	+	S
-
-# INTERNATIONAL EARTH ROTATION AND REFERENCE SYSTEMS SERVICE (IERS)
-#
-# SERVICE INTERNATIONAL DE LA ROTATION TERRESTRE ET DES SYSTEMES DE REFERENCE
-#
-# SERVICE DE LA ROTATION TERRESTRE
-# OBSERVATOIRE DE PARIS
-# 61, Av. de l'Observatoire 75014 PARIS (France)
-# Tel.      : 33 (0) 1 40 51 22 26
-# FAX       : 33 (0) 1 40 51 22 91
-# Internet  : services.iers@obspm.fr
-#
-# Paris, 4 July 2009
-#
-# Bulletin C 38
-#
-# To authorities responsible
-# for the measurement and
-# distribution of time
-#
-# INFORMATION ON UTC - TAI
-#
-# NO positive leap second will be introduced at the end of December 2009.
-# The difference between Coordinated Universal Time UTC and the
-# International Atomic Time TAI is :		
-#
-# from 2009 January 1, 0h UTC, until further notice : UTC-TAI = -34 s
-#
-# Leap seconds can be introduced in UTC at the end of the months of December
-# or June,  depending on the evolution of UT1-TAI. Bulletin C is mailed every
-# six months, either to announce a time step in UTC, or to confirm that there
-# will be no time step at the next possible date.
-#
-# Daniel GAMBIS
-# Director			
-# Earth Orientation Center of IERS
-# Observatoire de Paris, France
diff --git a/tools/zoneinfo/tzdata2009s/northamerica b/tools/zoneinfo/tzdata2009s/northamerica
deleted file mode 100644
index 236922d..0000000
--- a/tools/zoneinfo/tzdata2009s/northamerica
+++ /dev/null
@@ -1,2680 +0,0 @@
-# <pre>
-# @(#)northamerica	8.28
-# This file is in the public domain, so clarified as of
-# 2009-05-17 by Arthur David Olson.
-
-# also includes Central America and the Caribbean
-
-# This data is by no means authoritative; if you think you know better,
-# go ahead and edit the file (and please send any changes to
-# tz@elsie.nci.nih.gov for general use in the future).
-
-# From Paul Eggert (1999-03-22):
-# A reliable and entertaining source about time zones is
-# Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997).
-
-###############################################################################
-
-# United States
-
-# From Paul Eggert (1999-03-31):
-# Howse writes (pp 121-125) that time zones were invented by
-# Professor Charles Ferdinand Dowd (1825-1904),
-# Principal of Temple Grove Ladies' Seminary (Saratoga Springs, NY).
-# His pamphlet ``A System of National Time for Railroads'' (1870)
-# was the result of his proposals at the Convention of Railroad Trunk Lines
-# in New York City (1869-10).  His 1870 proposal was based on Washington, DC,
-# but in 1872-05 he moved the proposed origin to Greenwich.
-# His proposal was adopted by the railroads on 1883-11-18 at 12:00,
-# and the most of the country soon followed suit.
-
-# From Paul Eggert (2005-04-16):
-# That 1883 transition occurred at 12:00 new time, not at 12:00 old time.
-# See p 46 of David Prerau, Seize the daylight, Thunder's Mouth Press (2005).
-
-# From Paul Eggert (2006-03-22):
-# A good source for time zone historical data in the US is
-# Thomas G. Shanks, The American Atlas (5th edition),
-# San Diego: ACS Publications, Inc. (1991).
-# Make sure you have the errata sheet; the book is somewhat useless without it.
-# It is the source for most of the pre-1991 US entries below.
-
-# From Paul Eggert (2001-03-06):
-# Daylight Saving Time was first suggested as a joke by Benjamin Franklin
-# in his whimsical essay ``An Economical Project for Diminishing the Cost
-# of Light'' published in the Journal de Paris (1784-04-26).
-# Not everyone is happy with the results:
-#
-#	I don't really care how time is reckoned so long as there is some
-#	agreement about it, but I object to being told that I am saving
-#	daylight when my reason tells me that I am doing nothing of the kind.
-#	I even object to the implication that I am wasting something
-#	valuable if I stay in bed after the sun has risen.  As an admirer
-#	of moonlight I resent the bossy insistence of those who want to
-#	reduce my time for enjoying it.  At the back of the Daylight Saving
-#	scheme I detect the bony, blue-fingered hand of Puritanism, eager
-#	to push people into bed earlier, and get them up earlier, to make
-#	them healthy, wealthy and wise in spite of themselves.
-#
-#	-- Robertson Davies, The diary of Samuel Marchbanks,
-#	   Clarke, Irwin (1947), XIX, Sunday
-#
-# For more about the first ten years of DST in the United States, see
-# Robert Garland's <a href="http://www.clpgh.org/exhibit/dst.html">
-# Ten years of daylight saving from the Pittsburgh standpoint
-# (Carnegie Library of Pittsburgh, 1927)</a>.
-#
-# Shanks says that DST was called "War Time" in the US in 1918 and 1919.
-# However, DST was imposed by the Standard Time Act of 1918, which
-# was the first nationwide legal time standard, and apparently
-# time was just called "Standard Time" or "Daylight Saving Time".
-
-# From Arthur David Olson:
-# US Daylight Saving Time ended on the last Sunday of *October* in 1974.
-# See, for example, the front page of the Saturday, 1974-10-26
-# and Sunday, 1974-10-27 editions of the Washington Post.
-
-# From Arthur David Olson:
-# Before the Uniform Time Act of 1966 took effect in 1967, observance of
-# Daylight Saving Time in the US was by local option, except during wartime.
-
-# From Arthur David Olson (2000-09-25):
-# Last night I heard part of a rebroadcast of a 1945 Arch Oboler radio drama.
-# In the introduction, Oboler spoke of "Eastern Peace Time."
-# An AltaVista search turned up
-# <a href="http://rowayton.org/rhs/hstaug45.html">:
-# "When the time is announced over the radio now, it is 'Eastern Peace
-# Time' instead of the old familiar 'Eastern War Time.'  Peace is wonderful."
-# </a> (August 1945) by way of confirmation.
-
-# From Joseph Gallant citing
-# George H. Douglas, _The Early Days of Radio Broadcasting_ (1987):
-# At 7 P.M. (Eastern War Time) [on 1945-08-14], the networks were set
-# to switch to London for Attlee's address, but the American people
-# never got to hear his speech live. According to one press account,
-# CBS' Bob Trout was first to announce the word of Japan's surrender,
-# but a few seconds later, NBC, ABC and Mutual also flashed the word
-# of surrender, all of whom interrupting the bells of Big Ben in
-# London which were to precede Mr. Attlee's speech.
-
-# From Paul Eggert (2003-02-09): It was Robert St John, not Bob Trout.  From
-# Myrna Oliver's obituary of St John on page B16 of today's Los Angeles Times:
-#
-# ... a war-weary U.S. clung to radios, awaiting word of Japan's surrender.
-# Any announcement from Asia would reach St. John's New York newsroom on a
-# wire service teletype machine, which had prescribed signals for major news.
-# Associated Press, for example, would ring five bells before spewing out
-# typed copy of an important story, and 10 bells for news "of transcendental
-# importance."
-#
-# On Aug. 14, stalling while talking steadily into the NBC networks' open
-# microphone, St. John heard five bells and waited only to hear a sixth bell,
-# before announcing confidently: "Ladies and gentlemen, World War II is over.
-# The Japanese have agreed to our surrender terms."
-#
-# He had scored a 20-second scoop on other broadcasters.
-
-# From Arthur David Olson (2005-08-22):
-# Paul has been careful to use the "US" rules only in those locations
-# that are part of the United States; this reflects the real scope of
-# U.S. government action.  So even though the "US" rules have changed
-# in the latest release, other countries won't be affected.
-
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	US	1918	1919	-	Mar	lastSun	2:00	1:00	D
-Rule	US	1918	1919	-	Oct	lastSun	2:00	0	S
-Rule	US	1942	only	-	Feb	9	2:00	1:00	W # War
-Rule	US	1945	only	-	Aug	14	23:00u	1:00	P # Peace
-Rule	US	1945	only	-	Sep	30	2:00	0	S
-Rule	US	1967	2006	-	Oct	lastSun	2:00	0	S
-Rule	US	1967	1973	-	Apr	lastSun	2:00	1:00	D
-Rule	US	1974	only	-	Jan	6	2:00	1:00	D
-Rule	US	1975	only	-	Feb	23	2:00	1:00	D
-Rule	US	1976	1986	-	Apr	lastSun	2:00	1:00	D
-Rule	US	1987	2006	-	Apr	Sun>=1	2:00	1:00	D
-Rule	US	2007	max	-	Mar	Sun>=8	2:00	1:00	D
-Rule	US	2007	max	-	Nov	Sun>=1	2:00	0	S
-
-# From Arthur David Olson, 2005-12-19
-# We generate the files specified below to guard against old files with
-# obsolete information being left in the time zone binary directory.
-# We limit the list to names that have appeared in previous versions of
-# this time zone package.
-# We do these as separate Zones rather than as Links to avoid problems if
-# a particular place changes whether it observes DST.
-# We put these specifications here in the northamerica file both to
-# increase the chances that they'll actually get compiled and to
-# avoid the need to duplicate the US rules in another file.
-
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	EST		 -5:00	-	EST
-Zone	MST		 -7:00	-	MST
-Zone	HST		-10:00	-	HST
-Zone	EST5EDT		 -5:00	US	E%sT
-Zone	CST6CDT		 -6:00	US	C%sT
-Zone	MST7MDT		 -7:00	US	M%sT
-Zone	PST8PDT		 -8:00	US	P%sT
-
-# From Bob Devine (1988-01-28):
-# ...Alaska (and Hawaii) had the timezone names changed in 1967.
-#    old			 new
-#    Pacific Standard Time(PST)  -same-
-#    Yukon Standard Time(YST)    -same-
-#    Central Alaska S.T. (CAT)   Alaska-Hawaii St[an]dard Time (AHST)
-#    Nome Standard Time (NT)     Bering Standard Time (BST)
-#
-# ...Alaska's timezone lines were redrawn in 1983 to give only 2 tz.
-#    The YST zone now covers nearly all of the state, AHST just part
-#    of the Aleutian islands.   No DST.
-
-# From Paul Eggert (1995-12-19):
-# The tables below use `NST', not `NT', for Nome Standard Time.
-# I invented `CAWT' for Central Alaska War Time.
-
-# From U. S. Naval Observatory (1989-01-19):
-# USA  EASTERN       5 H  BEHIND UTC    NEW YORK, WASHINGTON
-# USA  EASTERN       4 H  BEHIND UTC    APR 3 - OCT 30
-# USA  CENTRAL       6 H  BEHIND UTC    CHICAGO, HOUSTON
-# USA  CENTRAL       5 H  BEHIND UTC    APR 3 - OCT 30
-# USA  MOUNTAIN      7 H  BEHIND UTC    DENVER
-# USA  MOUNTAIN      6 H  BEHIND UTC    APR 3 - OCT 30
-# USA  PACIFIC       8 H  BEHIND UTC    L.A., SAN FRANCISCO
-# USA  PACIFIC       7 H  BEHIND UTC    APR 3 - OCT 30
-# USA  ALASKA STD    9 H  BEHIND UTC    MOST OF ALASKA     (AKST)
-# USA  ALASKA STD    8 H  BEHIND UTC    APR 3 - OCT 30 (AKDT)
-# USA  ALEUTIAN     10 H  BEHIND UTC    ISLANDS WEST OF 170W
-# USA  - " -         9 H  BEHIND UTC    APR 3 - OCT 30
-# USA  HAWAII       10 H  BEHIND UTC
-# USA  BERING       11 H  BEHIND UTC    SAMOA, MIDWAY
-
-# From Arthur David Olson (1989-01-21):
-# The above dates are for 1988.
-# Note the "AKST" and "AKDT" abbreviations, the claim that there's
-# no DST in Samoa, and the claim that there is DST in Alaska and the
-# Aleutians.
-
-# From Arthur David Olson (1988-02-13):
-# Legal standard time zone names, from United States Code (1982 Edition and
-# Supplement III), Title 15, Chapter 6, Section 260 and forward.  First, names
-# up to 1967-04-01 (when most provisions of the Uniform Time Act of 1966
-# took effect), as explained in sections 263 and 261:
-#	(none)
-#	United States standard eastern time
-#	United States standard mountain time
-#	United States standard central time
-#	United States standard Pacific time
-#	(none)
-#	United States standard Alaska time
-#	(none)
-# Next, names from 1967-04-01 until 1983-11-30 (the date for
-# public law 98-181):
-#	Atlantic standard time
-#	eastern standard time
-#	central standard time
-#	mountain standard time
-#	Pacific standard time
-#	Yukon standard time
-#	Alaska-Hawaii standard time
-#	Bering standard time
-# And after 1983-11-30:
-#	Atlantic standard time
-#	eastern standard time
-#	central standard time
-#	mountain standard time
-#	Pacific standard time
-#	Alaska standard time
-#	Hawaii-Aleutian standard time
-#	Samoa standard time
-# The law doesn't give abbreviations.
-#
-# From Paul Eggert (2000-01-08), following a heads-up from Rives McDow:
-# Public law 106-564 (2000-12-23) introduced the abbreviation
-# "Chamorro Standard Time" for time in Guam and the Northern Marianas.
-# See the file "australasia".
-
-# From Arthur David Olson, 2005-08-09
-# The following was signed into law on 2005-08-08.
-#
-# H.R. 6, Energy Policy Act of 2005, SEC. 110. DAYLIGHT SAVINGS.
-#   (a) Amendment- Section 3(a) of the Uniform Time Act of 1966 (15
-#   U.S.C. 260a(a)) is amended--
-#     (1) by striking `first Sunday of April' and inserting `second
-#     Sunday of March'; and
-#     (2) by striking `last Sunday of October' and inserting `first
-#     Sunday of November'.
-#   (b) Effective Date- Subsection (a) shall take effect 1 year after the
-#   date of enactment of this Act or March 1, 2007, whichever is later.
-#   (c) Report to Congress- Not later than 9 months after the effective
-#   date stated in subsection (b), the Secretary shall report to Congress
-#   on the impact of this section on energy consumption in the United
-#   States.
-#   (d) Right to Revert- Congress retains the right to revert the
-#   Daylight Saving Time back to the 2005 time schedules once the
-#   Department study is complete.
-
-# US eastern time, represented by New York
-
-# Connecticut, Delaware, District of Columbia, most of Florida,
-# Georgia, southeast Indiana (Dearborn and Ohio counties), eastern Kentucky
-# (except America/Kentucky/Louisville below), Maine, Maryland, Massachusetts,
-# New Hampshire, New Jersey, New York, North Carolina, Ohio,
-# Pennsylvania, Rhode Island, South Carolina, eastern Tennessee,
-# Vermont, Virginia, West Virginia
-
-# From Dave Cantor (2004-11-02):
-# Early this summer I had the occasion to visit the Mount Washington
-# Observatory weather station atop (of course!) Mount Washington [, NH]....
-# One of the staff members said that the station was on Eastern Standard Time
-# and didn't change their clocks for Daylight Saving ... so that their
-# reports will always have times which are 5 hours behind UTC.
-
-# From Paul Eggert (2005-08-26):
-# According to today's Huntsville Times
-# <http://www.al.com/news/huntsvilletimes/index.ssf?/base/news/1125047783228320.xml&coll=1>
-# a few towns on Alabama's "eastern border with Georgia, such as Phenix City
-# in Russell County, Lanett in Chambers County and some towns in Lee County,
-# set their watches and clocks on Eastern time."  It quotes H.H. "Bubba"
-# Roberts, city administrator in Phenix City. as saying "We are in the Central
-# time zone, but we do go by the Eastern time zone because so many people work
-# in Columbus."
-
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER
-Rule	NYC	1920	only	-	Mar	lastSun	2:00	1:00	D
-Rule	NYC	1920	only	-	Oct	lastSun	2:00	0	S
-Rule	NYC	1921	1966	-	Apr	lastSun	2:00	1:00	D
-Rule	NYC	1921	1954	-	Sep	lastSun	2:00	0	S
-Rule	NYC	1955	1966	-	Oct	lastSun	2:00	0	S
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone America/New_York	-4:56:02 -	LMT	1883 Nov 18 12:03:58
-			-5:00	US	E%sT	1920
-			-5:00	NYC	E%sT	1942
-			-5:00	US	E%sT	1946
-			-5:00	NYC	E%sT	1967
-			-5:00	US	E%sT
-
-# US central time, represented by Chicago
-
-# Alabama, Arkansas, Florida panhandle (Bay, Calhoun, Escambia,
-# Gulf, Holmes, Jackson, Okaloosa, Santa Rosa, Walton, and
-# Washington counties), Illinois, western Indiana
-# (Gibson, Jasper, Lake, LaPorte, Newton, Porter, Posey, Spencer,
-# Vanderburgh, and Warrick counties), Iowa, most of Kansas, western
-# Kentucky, Louisiana, Minnesota, Mississippi, Missouri, eastern
-# Nebraska, eastern North Dakota, Oklahoma, eastern South Dakota,
-# western Tennessee, most of Texas, Wisconsin
-
-# From Larry M. Smith (2006-04-26) re Wisconsin:
-# http://www.legis.state.wi.us/statutes/Stat0175.pdf ...
-# is currently enforced at the 01:00 time of change.  Because the local
-# "bar time" in the state corresponds to 02:00, a number of citations
-# are issued for the "sale of class 'B' alcohol after prohibited
-# hours" within the deviated hour of this change every year....
-#
-# From Douglas R. Bomberg (2007-03-12):
-# Wisconsin has enacted (nearly eleventh-hour) legislation to get WI
-# Statue 175 closer in synch with the US Congress' intent....
-# http://www.legis.state.wi.us/2007/data/acts/07Act3.pdf
-
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER
-Rule	Chicago	1920	only	-	Jun	13	2:00	1:00	D
-Rule	Chicago	1920	1921	-	Oct	lastSun	2:00	0	S
-Rule	Chicago	1921	only	-	Mar	lastSun	2:00	1:00	D
-Rule	Chicago	1922	1966	-	Apr	lastSun	2:00	1:00	D
-Rule	Chicago	1922	1954	-	Sep	lastSun	2:00	0	S
-Rule	Chicago	1955	1966	-	Oct	lastSun	2:00	0	S
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone America/Chicago	-5:50:36 -	LMT	1883 Nov 18 12:09:24
-			-6:00	US	C%sT	1920
-			-6:00	Chicago	C%sT	1936 Mar  1 2:00
-			-5:00	-	EST	1936 Nov 15 2:00
-			-6:00	Chicago	C%sT	1942
-			-6:00	US	C%sT	1946
-			-6:00	Chicago	C%sT	1967
-			-6:00	US	C%sT
-# Oliver County, ND switched from mountain to central time on 1992-10-25.
-Zone America/North_Dakota/Center -6:45:12 - LMT	1883 Nov 18 12:14:48
-			-7:00	US	M%sT	1992 Oct 25 02:00
-			-6:00	US	C%sT
-# Morton County, ND, switched from mountain to central time on
-# 2003-10-26, except for the area around Mandan which was already central time.
-# See <http://dmses.dot.gov/docimages/p63/135818.pdf>.
-# Officially this switch also included part of Sioux County, and
-# Jones, Mellette, and Todd Counties in South Dakota;
-# but in practice these other counties were already observing central time.
-# See <http://www.epa.gov/fedrgstr/EPA-IMPACT/2003/October/Day-28/i27056.htm>.
-Zone America/North_Dakota/New_Salem -6:45:39 - LMT 1883 Nov 18 12:14:21
-			-7:00	US	M%sT	2003 Oct 26 02:00
-			-6:00	US	C%sT
-
-# US mountain time, represented by Denver
-#
-# Colorado, far western Kansas, Montana, western
-# Nebraska, Nevada border (Jackpot, Owyhee, and Mountain City),
-# New Mexico, southwestern North Dakota,
-# western South Dakota, far western Texas (El Paso County, Hudspeth County,
-# and Pine Springs and Nickel Creek in Culberson County), Utah, Wyoming
-#
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER
-Rule	Denver	1920	1921	-	Mar	lastSun	2:00	1:00	D
-Rule	Denver	1920	only	-	Oct	lastSun	2:00	0	S
-Rule	Denver	1921	only	-	May	22	2:00	0	S
-Rule	Denver	1965	1966	-	Apr	lastSun	2:00	1:00	D
-Rule	Denver	1965	1966	-	Oct	lastSun	2:00	0	S
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone America/Denver	-6:59:56 -	LMT	1883 Nov 18 12:00:04
-			-7:00	US	M%sT	1920
-			-7:00	Denver	M%sT	1942
-			-7:00	US	M%sT	1946
-			-7:00	Denver	M%sT	1967
-			-7:00	US	M%sT
-
-# US Pacific time, represented by Los Angeles
-#
-# California, northern Idaho (Benewah, Bonner, Boundary, Clearwater,
-# Idaho, Kootenai, Latah, Lewis, Nez Perce, and Shoshone counties,
-# and the northern three-quarters of Idaho county),
-# most of Nevada, most of Oregon, and Washington
-#
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER
-Rule	CA	1948	only	-	Mar	14	2:00	1:00	D
-Rule	CA	1949	only	-	Jan	 1	2:00	0	S
-Rule	CA	1950	1966	-	Apr	lastSun	2:00	1:00	D
-Rule	CA	1950	1961	-	Sep	lastSun	2:00	0	S
-Rule	CA	1962	1966	-	Oct	lastSun	2:00	0	S
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone America/Los_Angeles -7:52:58 -	LMT	1883 Nov 18 12:07:02
-			-8:00	US	P%sT	1946
-			-8:00	CA	P%sT	1967
-			-8:00	US	P%sT
-
-# Alaska
-# AK%sT is the modern abbreviation for -9:00 per USNO.
-#
-# From Paul Eggert (2001-05-30):
-# Howse writes that Alaska switched from the Julian to the Gregorian calendar,
-# and from east-of-GMT to west-of-GMT days, when the US bought it from Russia.
-# This was on 1867-10-18, a Friday; the previous day was 1867-10-06 Julian,
-# also a Friday.  Include only the time zone part of this transition,
-# ignoring the switch from Julian to Gregorian, since we can't represent
-# the Julian calendar.
-#
-# As far as we know, none of the exact locations mentioned below were
-# permanently inhabited in 1867 by anyone using either calendar.
-# (Yakutat was colonized by the Russians in 1799, but the settlement
-# was destroyed in 1805 by a Yakutat-kon war party.)  However, there
-# were nearby inhabitants in some cases and for our purposes perhaps
-# it's best to simply use the official transition.
-#
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone America/Juneau	 15:02:19 -	LMT	1867 Oct 18
-			 -8:57:41 -	LMT	1900 Aug 20 12:00
-			 -8:00	-	PST	1942
-			 -8:00	US	P%sT	1946
-			 -8:00	-	PST	1969
-			 -8:00	US	P%sT	1983 Oct 30 2:00
-			 -9:00	US	Y%sT	1983 Nov 30
-			 -9:00	US	AK%sT
-Zone America/Yakutat	 14:41:05 -	LMT	1867 Oct 18
-			 -9:18:55 -	LMT	1900 Aug 20 12:00
-			 -9:00	-	YST	1942
-			 -9:00	US	Y%sT	1946
-			 -9:00	-	YST	1969
-			 -9:00	US	Y%sT	1983 Nov 30
-			 -9:00	US	AK%sT
-Zone America/Anchorage	 14:00:24 -	LMT	1867 Oct 18
-			 -9:59:36 -	LMT	1900 Aug 20 12:00
-			-10:00	-	CAT	1942
-			-10:00	US	CAT/CAWT 1945 Aug 14 23:00u
-			-10:00	US	CAT/CAPT 1946 # Peace
-			-10:00	-	CAT	1967 Apr
-			-10:00	-	AHST	1969
-			-10:00	US	AH%sT	1983 Oct 30 2:00
-			 -9:00	US	Y%sT	1983 Nov 30
-			 -9:00	US	AK%sT
-Zone America/Nome	 12:58:21 -	LMT	1867 Oct 18
-			-11:01:38 -	LMT	1900 Aug 20 12:00
-			-11:00	-	NST	1942
-			-11:00	US	N%sT	1946
-			-11:00	-	NST	1967 Apr
-			-11:00	-	BST	1969
-			-11:00	US	B%sT	1983 Oct 30 2:00
-			 -9:00	US	Y%sT	1983 Nov 30
-			 -9:00	US	AK%sT
-Zone America/Adak	 12:13:21 -	LMT	1867 Oct 18
-			-11:46:38 -	LMT	1900 Aug 20 12:00
-			-11:00	-	NST	1942
-			-11:00	US	N%sT	1946
-			-11:00	-	NST	1967 Apr
-			-11:00	-	BST	1969
-			-11:00	US	B%sT	1983 Oct 30 2:00
-			-10:00	US	AH%sT	1983 Nov 30
-			-10:00	US	HA%sT
-# The following switches don't quite make our 1970 cutoff.
-#
-# Shanks writes that part of southwest Alaska (e.g. Aniak)
-# switched from -11:00 to -10:00 on 1968-09-22 at 02:00,
-# and another part (e.g. Akiak) made the same switch five weeks later.
-#
-# From David Flater (2004-11-09):
-# In e-mail, 2004-11-02, Ray Hudson, historian/liaison to the Unalaska
-# Historic Preservation Commission, provided this information, which
-# suggests that Unalaska deviated from statutory time from early 1967
-# possibly until 1983:
-#
-#  Minutes of the Unalaska City Council Meeting, January 10, 1967:
-#  "Except for St. Paul and Akutan, Unalaska is the only important
-#  location not on Alaska Standard Time.  The following resolution was
-#  made by William Robinson and seconded by Henry Swanson:  Be it
-#  resolved that the City of Unalaska hereby goes to Alaska Standard
-#  Time as of midnight Friday, January 13, 1967 (1 A.M. Saturday,
-#  January 14, Alaska Standard Time.)  This resolution was passed with
-#  three votes for and one against."
-
-# Hawaii
-#
-# From Arthur David Olson:
-# And then there's Hawaii.
-# DST was observed for one day in 1933;
-# standard time was changed by half an hour in 1947;
-# it's always standard as of 1986.
-#
-# From Paul Eggert:
-# Shanks says the 1933 experiment lasted for three weeks.  Go with Shanks.
-#
-Zone Pacific/Honolulu	-10:31:26 -	LMT	1900 Jan  1 12:00
-			-10:30	-	HST	1933 Apr 30 2:00
-			-10:30	1:00	HDT	1933 May 21 2:00
-			-10:30	US	H%sT	1947 Jun  8 2:00
-			-10:00	-	HST
-
-# Now we turn to US areas that have diverged from the consensus since 1970.
-
-# Arizona mostly uses MST.
-
-# From Paul Eggert (2002-10-20):
-#
-# The information in the rest of this paragraph is derived from the
-# <a href="http://www.dlapr.lib.az.us/links/daylight.htm">
-# Daylight Saving Time web page (2002-01-23)</a> maintained by the
-# Arizona State Library, Archives and Public Records.
-# Between 1944-01-01 and 1944-04-01 the State of Arizona used standard
-# time, but by federal law railroads, airlines, bus lines, military
-# personnel, and some engaged in interstate commerce continued to
-# observe war (i.e., daylight saving) time.  The 1944-03-17 Phoenix
-# Gazette says that was the date the law changed, and that 04-01 was
-# the date the state's clocks would change.  In 1945 the State of
-# Arizona used standard time all year, again with exceptions only as
-# mandated by federal law.  Arizona observed DST in 1967, but Arizona
-# Laws 1968, ch. 183 (effective 1968-03-21) repealed DST.
-#
-# Shanks says the 1944 experiment came to an end on 1944-03-17.
-# Go with the Arizona State Library instead.
-
-Zone America/Phoenix	-7:28:18 -	LMT	1883 Nov 18 11:31:42
-			-7:00	US	M%sT	1944 Jan  1 00:01
-			-7:00	-	MST	1944 Apr  1 00:01
-			-7:00	US	M%sT	1944 Oct  1 00:01
-			-7:00	-	MST	1967
-			-7:00	US	M%sT	1968 Mar 21
-			-7:00	-	MST
-# From Arthur David Olson (1988-02-13):
-# A writer from the Inter Tribal Council of Arizona, Inc.,
-# notes in private correspondence dated 1987-12-28 that "Presently, only the
-# Navajo Nation participates in the Daylight Saving Time policy, due to its
-# large size and location in three states."  (The "only" means that other
-# tribal nations don't use DST.)
-
-Link America/Denver America/Shiprock
-
-# Southern Idaho (Ada, Adams, Bannock, Bear Lake, Bingham, Blaine,
-# Boise, Bonneville, Butte, Camas, Canyon, Caribou, Cassia, Clark,
-# Custer, Elmore, Franklin, Fremont, Gem, Gooding, Jefferson, Jerome,
-# Lemhi, Lincoln, Madison, Minidoka, Oneida, Owyhee, Payette, Power,
-# Teton, Twin Falls, Valley, Washington counties, and the southern
-# quarter of Idaho county) and eastern Oregon (most of Malheur County)
-# switched four weeks late in 1974.
-#
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone America/Boise	-7:44:49 -	LMT	1883 Nov 18 12:15:11
-			-8:00	US	P%sT	1923 May 13 2:00
-			-7:00	US	M%sT	1974
-			-7:00	-	MST	1974 Feb  3 2:00
-			-7:00	US	M%sT
-
-# Indiana
-#
-# For a map of Indiana's time zone regions, see:
-# <a href="http://www.mccsc.edu/time.html">
-# What time is it in Indiana?
-# </a> (2006-03-01)
-#
-# From Paul Eggert (2007-08-17):
-# Since 1970, most of Indiana has been like America/Indiana/Indianapolis,
-# with the following exceptions:
-#
-# - Gibson, Jasper, Lake, LaPorte, Newton, Porter, Posey, Spencer,
-#   Vandenburgh, and Warrick counties have been like America/Chicago.
-#
-# - Dearborn and Ohio counties have been like America/New_York.
-#
-# - Clark, Floyd, and Harrison counties have been like
-#   America/Kentucky/Louisville.
-#
-# - Crawford, Daviess, Dubois, Knox, Martin, Perry, Pike, Pulaski, Starke,
-#   and Switzerland counties have their own time zone histories as noted below.
-#
-# Shanks partitioned Indiana into 345 regions, each with its own time history,
-# and wrote ``Even newspaper reports present contradictory information.''
-# Those Hoosiers!  Such a flighty and changeable people!
-# Fortunately, most of the complexity occurred before our cutoff date of 1970.
-#
-# Other than Indianapolis, the Indiana place names are so nondescript
-# that they would be ambiguous if we left them at the `America' level.
-# So we reluctantly put them all in a subdirectory `America/Indiana'.
-
-# From Paul Eggert (2005-08-16):
-# http://www.mccsc.edu/time.html says that Indiana will use DST starting 2006.
-
-# From Nathan Stratton Treadway (2006-03-30):
-# http://www.dot.gov/affairs/dot0406.htm [3705 B]
-# From Deborah Goldsmith (2006-01-18):
-# http://dmses.dot.gov/docimages/pdf95/382329_web.pdf [2.9 MB]
-# From Paul Eggert (2006-01-20):
-# It says "DOT is relocating the time zone boundary in Indiana to move Starke,
-# Pulaski, Knox, Daviess, Martin, Pike, Dubois, and Perry Counties from the
-# Eastern Time Zone to the Central Time Zone.... The effective date of
-# this rule is 2:OO a.m. EST Sunday, April 2, 2006, which is the
-# changeover date from standard time to Daylight Saving Time."
-# Strictly speaking, this means the affected counties will change their
-# clocks twice that night, but this obviously is in error.  The intent
-# is that 01:59:59 EST be followed by 02:00:00 CDT.
-
-# From Gwillim Law (2007-02-10):
-# The Associated Press has been reporting that Pulaski County, Indiana is
-# going to switch from Central to Eastern Time on March 11, 2007....
-# http://www.indystar.com/apps/pbcs.dll/article?AID=/20070207/LOCAL190108/702070524/0/LOCAL
-
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER
-Rule Indianapolis 1941	only	-	Jun	22	2:00	1:00	D
-Rule Indianapolis 1941	1954	-	Sep	lastSun	2:00	0	S
-Rule Indianapolis 1946	1954	-	Apr	lastSun	2:00	1:00	D
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone America/Indiana/Indianapolis -5:44:38 - LMT 1883 Nov 18 12:15:22
-			-6:00	US	C%sT	1920
-			-6:00 Indianapolis C%sT	1942
-			-6:00	US	C%sT	1946
-			-6:00 Indianapolis C%sT	1955 Apr 24 2:00
-			-5:00	-	EST	1957 Sep 29 2:00
-			-6:00	-	CST	1958 Apr 27 2:00
-			-5:00	-	EST	1969
-			-5:00	US	E%sT	1971
-			-5:00	-	EST	2006
-			-5:00	US	E%sT
-#
-# Eastern Crawford County, Indiana, left its clocks alone in 1974,
-# as well as from 1976 through 2005.
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER
-Rule	Marengo	1951	only	-	Apr	lastSun	2:00	1:00	D
-Rule	Marengo	1951	only	-	Sep	lastSun	2:00	0	S
-Rule	Marengo	1954	1960	-	Apr	lastSun	2:00	1:00	D
-Rule	Marengo	1954	1960	-	Sep	lastSun	2:00	0	S
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone America/Indiana/Marengo -5:45:23 -	LMT	1883 Nov 18 12:14:37
-			-6:00	US	C%sT	1951
-			-6:00	Marengo	C%sT	1961 Apr 30 2:00
-			-5:00	-	EST	1969
-			-5:00	US	E%sT	1974 Jan  6 2:00
-			-6:00	1:00	CDT	1974 Oct 27 2:00
-			-5:00	US	E%sT	1976
-			-5:00	-	EST	2006
-			-5:00	US	E%sT
-#
-# Daviess, Dubois, Knox, and Martin Counties, Indiana,
-# switched from eastern to central time in April 2006, then switched back
-# in November 2007.
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER
-Rule Vincennes	1946	only	-	Apr	lastSun	2:00	1:00	D
-Rule Vincennes	1946	only	-	Sep	lastSun	2:00	0	S
-Rule Vincennes	1953	1954	-	Apr	lastSun	2:00	1:00	D
-Rule Vincennes	1953	1959	-	Sep	lastSun	2:00	0	S
-Rule Vincennes	1955	only	-	May	 1	0:00	1:00	D
-Rule Vincennes	1956	1963	-	Apr	lastSun	2:00	1:00	D
-Rule Vincennes	1960	only	-	Oct	lastSun	2:00	0	S
-Rule Vincennes	1961	only	-	Sep	lastSun	2:00	0	S
-Rule Vincennes	1962	1963	-	Oct	lastSun	2:00	0	S
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone America/Indiana/Vincennes -5:50:07 - LMT	1883 Nov 18 12:09:53
-			-6:00	US	C%sT	1946
-			-6:00 Vincennes	C%sT	1964 Apr 26 2:00
-			-5:00	-	EST	1969
-			-5:00	US	E%sT	1971
-			-5:00	-	EST	2006 Apr  2 2:00
-			-6:00	US	C%sT	2007 Nov  4 2:00
-			-5:00	US	E%sT
-#
-# Perry County, Indiana, switched from eastern to central time in April 2006.
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER
-Rule Perry	1946	only	-	Apr	lastSun	2:00	1:00	D
-Rule Perry	1946	only	-	Sep	lastSun	2:00	0	S
-Rule Perry	1953	1954	-	Apr	lastSun	2:00	1:00	D
-Rule Perry	1953	1959	-	Sep	lastSun	2:00	0	S
-Rule Perry	1955	only	-	May	 1	0:00	1:00	D
-Rule Perry	1956	1963	-	Apr	lastSun	2:00	1:00	D
-Rule Perry	1960	only	-	Oct	lastSun	2:00	0	S
-Rule Perry	1961	only	-	Sep	lastSun	2:00	0	S
-Rule Perry	1962	1963	-	Oct	lastSun	2:00	0	S
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone America/Indiana/Tell_City -5:47:03 - LMT	1883 Nov 18 12:12:57
-			-6:00	US	C%sT	1946
-			-6:00 Perry	C%sT	1964 Apr 26 2:00
-			-5:00	-	EST	1969
-			-5:00	US	E%sT	1971
-			-5:00	-	EST	2006 Apr  2 2:00
-			-6:00	US	C%sT
-#
-# Pike County, Indiana moved from central to eastern time in 1977,
-# then switched back in 2006, then switched back again in 2007.
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER
-Rule	Pike	1955	only	-	May	 1	0:00	1:00	D
-Rule	Pike	1955	1960	-	Sep	lastSun	2:00	0	S
-Rule	Pike	1956	1964	-	Apr	lastSun	2:00	1:00	D
-Rule	Pike	1961	1964	-	Oct	lastSun	2:00	0	S
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone America/Indiana/Petersburg -5:49:07 - LMT	1883 Nov 18 12:10:53
-			-6:00	US	C%sT	1955
-			-6:00	Pike	C%sT	1965 Apr 25 2:00
-			-5:00	-	EST	1966 Oct 30 2:00
-			-6:00	US	C%sT	1977 Oct 30 2:00
-			-5:00	-	EST	2006 Apr  2 2:00
-			-6:00	US	C%sT	2007 Nov  4 2:00
-			-5:00	US	E%sT
-#
-# Starke County, Indiana moved from central to eastern time in 1991,
-# then switched back in 2006.
-# From Arthur David Olson (1991-10-28):
-# An article on page A3 of the Sunday, 1991-10-27 Washington Post
-# notes that Starke County switched from Central time to Eastern time as of
-# 1991-10-27.
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER
-Rule	Starke	1947	1961	-	Apr	lastSun	2:00	1:00	D
-Rule	Starke	1947	1954	-	Sep	lastSun	2:00	0	S
-Rule	Starke	1955	1956	-	Oct	lastSun	2:00	0	S
-Rule	Starke	1957	1958	-	Sep	lastSun	2:00	0	S
-Rule	Starke	1959	1961	-	Oct	lastSun	2:00	0	S
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone America/Indiana/Knox -5:46:30 -	LMT	1883 Nov 18 12:13:30
-			-6:00	US	C%sT	1947
-			-6:00	Starke	C%sT	1962 Apr 29 2:00
-			-5:00	-	EST	1963 Oct 27 2:00
-			-6:00	US	C%sT	1991 Oct 27 2:00
-			-5:00	-	EST	2006 Apr  2 2:00
-			-6:00	US	C%sT
-#
-# Pulaski County, Indiana, switched from eastern to central time in
-# April 2006 and then switched back in March 2007.
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER
-Rule	Pulaski	1946	1960	-	Apr	lastSun	2:00	1:00	D
-Rule	Pulaski	1946	1954	-	Sep	lastSun	2:00	0	S
-Rule	Pulaski	1955	1956	-	Oct	lastSun	2:00	0	S
-Rule	Pulaski	1957	1960	-	Sep	lastSun	2:00	0	S
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone America/Indiana/Winamac -5:46:25 - LMT	1883 Nov 18 12:13:35
-			-6:00	US	C%sT	1946
-			-6:00	Pulaski	C%sT	1961 Apr 30 2:00
-			-5:00	-	EST	1969
-			-5:00	US	E%sT	1971
-			-5:00	-	EST	2006 Apr  2 2:00
-			-6:00	US	C%sT	2007 Mar 11 2:00
-			-5:00	US	E%sT
-#
-# Switzerland County, Indiana, did not observe DST from 1973 through 2005.
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone America/Indiana/Vevay -5:40:16 -	LMT	1883 Nov 18 12:19:44
-			-6:00	US	C%sT	1954 Apr 25 2:00
-			-5:00	-	EST	1969
-			-5:00	US	E%sT	1973
-			-5:00	-	EST	2006
-			-5:00	US	E%sT
-
-# Part of Kentucky left its clocks alone in 1974.
-# This also includes Clark, Floyd, and Harrison counties in Indiana.
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER
-Rule Louisville	1921	only	-	May	1	2:00	1:00	D
-Rule Louisville	1921	only	-	Sep	1	2:00	0	S
-Rule Louisville	1941	1961	-	Apr	lastSun	2:00	1:00	D
-Rule Louisville	1941	only	-	Sep	lastSun	2:00	0	S
-Rule Louisville	1946	only	-	Jun	2	2:00	0	S
-Rule Louisville	1950	1955	-	Sep	lastSun	2:00	0	S
-Rule Louisville	1956	1960	-	Oct	lastSun	2:00	0	S
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone America/Kentucky/Louisville -5:43:02 -	LMT	1883 Nov 18 12:16:58
-			-6:00	US	C%sT	1921
-			-6:00 Louisville C%sT	1942
-			-6:00	US	C%sT	1946
-			-6:00 Louisville C%sT	1961 Jul 23 2:00
-			-5:00	-	EST	1968
-			-5:00	US	E%sT	1974 Jan  6 2:00
-			-6:00	1:00	CDT	1974 Oct 27 2:00
-			-5:00	US	E%sT
-#
-# Wayne County, Kentucky
-#
-# From
-# <a href="http://www.lake-cumberland.com/life/archive/news990129time.shtml">
-# Lake Cumberland LIFE
-# </a> (1999-01-29) via WKYM-101.7:
-# Clinton County has joined Wayne County in asking the DoT to change from
-# the Central to the Eastern time zone....  The Wayne County government made
-# the same request in December.  And while Russell County officials have not
-# taken action, the majority of respondents to a poll conducted there in
-# August indicated they would like to change to "fast time" also.
-# The three Lake Cumberland counties are the farthest east of any U.S.
-# location in the Central time zone.
-#
-# From Rich Wales (2000-08-29):
-# After prolonged debate, and despite continuing deep differences of opinion,
-# Wayne County (central Kentucky) is switching from Central (-0600) to Eastern
-# (-0500) time.  They won't "fall back" this year.  See Sara Shipley,
-# The difference an hour makes, Nando Times (2000-08-29 15:33 -0400).
-#
-# From Paul Eggert (2001-07-16):
-# The final rule was published in the
-# <a href="http://frwebgate.access.gpo.gov/cgi-bin/getdoc.cgi?dbname=2000_register&docid=fr17au00-22">
-# Federal Register 65, 160 (2000-08-17), page 50154-50158.
-# </a>
-#
-Zone America/Kentucky/Monticello -5:39:24 - LMT	1883 Nov 18 12:20:36
-			-6:00	US	C%sT	1946
-			-6:00	-	CST	1968
-			-6:00	US	C%sT	2000 Oct 29  2:00
-			-5:00	US	E%sT
-
-
-# From Rives McDow (2000-08-30):
-# Here ... are all the changes in the US since 1985.
-# Kearny County, KS (put all of county on central;
-#	previously split between MST and CST) ... 1990-10
-# Starke County, IN (from CST to EST) ... 1991-10
-# Oliver County, ND (from MST to CST) ... 1992-10
-# West Wendover, NV (from PST TO MST) ... 1999-10
-# Wayne County, KY (from CST to EST) ... 2000-10
-#
-# From Paul Eggert (2001-07-17):
-# We don't know where the line used to be within Kearny County, KS,
-# so omit that change for now.
-# See America/Indiana/Knox for the Starke County, IN change.
-# See America/North_Dakota/Center for the Oliver County, ND change.
-# West Wendover, NV officially switched from Pacific to mountain time on
-# 1999-10-31.  See the
-# <a href="http://frwebgate.access.gpo.gov/cgi-bin/getdoc.cgi?dbname=1999_register&docid=fr21oc99-15">
-# Federal Register 64, 203 (1999-10-21), page 56705-56707.
-# </a>
-# However, the Federal Register says that West Wendover already operated
-# on mountain time, and the rule merely made this official;
-# hence a separate tz entry is not needed.
-
-# Michigan
-#
-# From Bob Devine (1988-01-28):
-# Michigan didn't observe DST from 1968 to 1973.
-#
-# From Paul Eggert (1999-03-31):
-# Shanks writes that Michigan started using standard time on 1885-09-18,
-# but Howse writes (pp 124-125, referring to Popular Astronomy, 1901-01)
-# that Detroit kept
-#
-#	local time until 1900 when the City Council decreed that clocks should
-#	be put back twenty-eight minutes to Central Standard Time.  Half the
-#	city obeyed, half refused.  After considerable debate, the decision
-#	was rescinded and the city reverted to Sun time.  A derisive offer to
-#	erect a sundial in front of the city hall was referred to the
-#	Committee on Sewers.  Then, in 1905, Central time was adopted
-#	by city vote.
-#
-# This story is too entertaining to be false, so go with Howse over Shanks.
-#
-# From Paul Eggert (2001-03-06):
-# Garland (1927) writes ``Cleveland and Detroit advanced their clocks
-# one hour in 1914.''  This change is not in Shanks.  We have no more
-# info, so omit this for now.
-#
-# Most of Michigan observed DST from 1973 on, but was a bit late in 1975.
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER
-Rule	Detroit	1948	only	-	Apr	lastSun	2:00	1:00	D
-Rule	Detroit	1948	only	-	Sep	lastSun	2:00	0	S
-Rule	Detroit	1967	only	-	Jun	14	2:00	1:00	D
-Rule	Detroit	1967	only	-	Oct	lastSun	2:00	0	S
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone America/Detroit	-5:32:11 -	LMT	1905
-			-6:00	-	CST	1915 May 15 2:00
-			-5:00	-	EST	1942
-			-5:00	US	E%sT	1946
-			-5:00	Detroit	E%sT	1973
-			-5:00	US	E%sT	1975
-			-5:00	-	EST	1975 Apr 27 2:00
-			-5:00	US	E%sT
-#
-# Dickinson, Gogebic, Iron, and Menominee Counties, Michigan,
-# switched from EST to CST/CDT in 1973.
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER
-Rule Menominee	1946	only	-	Apr	lastSun	2:00	1:00	D
-Rule Menominee	1946	only	-	Sep	lastSun	2:00	0	S
-Rule Menominee	1966	only	-	Apr	lastSun	2:00	1:00	D
-Rule Menominee	1966	only	-	Oct	lastSun	2:00	0	S
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone America/Menominee	-5:50:27 -	LMT	1885 Sep 18 12:00
-			-6:00	US	C%sT	1946
-			-6:00 Menominee	C%sT	1969 Apr 27 2:00
-			-5:00	-	EST	1973 Apr 29 2:00
-			-6:00	US	C%sT
-
-# Navassa
-# administered by the US Fish and Wildlife Service
-# claimed by US under the provisions of the 1856 Guano Islands Act
-# also claimed by Haiti
-# occupied 1857/1900 by the Navassa Phosphate Co
-# US lighthouse 1917/1996-09
-# currently uninhabited
-# see Mark Fineman, ``An Isle Rich in Guano and Discord'',
-# _Los Angeles Times_ (1998-11-10), A1, A10; it cites
-# Jimmy Skaggs, _The Great Guano Rush_ (1994).
-
-################################################################################
-
-
-# From Paul Eggert (2006-03-22):
-# A good source for time zone historical data outside the U.S. is
-# Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
-# San Diego: ACS Publications, Inc. (2003).
-#
-# Gwillim Law writes that a good source
-# for recent time zone data is the International Air Transport
-# Association's Standard Schedules Information Manual (IATA SSIM),
-# published semiannually.  Law sent in several helpful summaries
-# of the IATA's data after 1990.
-#
-# Except where otherwise noted, Shanks & Pottenger is the source for
-# entries through 1990, and IATA SSIM is the source for entries afterwards.
-#
-# Other sources occasionally used include:
-#
-#	Edward W. Whitman, World Time Differences,
-#	Whitman Publishing Co, 2 Niagara Av, Ealing, London (undated),
-#	which I found in the UCLA library.
-#
-#	<a href="http://www.pettswoodvillage.co.uk/Daylight_Savings_William_Willett.pdf">
-#	William Willett, The Waste of Daylight, 19th edition
-#	</a> (1914-03)
-#
-# See the `europe' file for Greenland.
-
-# Canada
-
-# From Alain LaBont<e'> (1994-11-14):
-# I post here the time zone abbreviations standardized in Canada
-# for both English and French in the CAN/CSA-Z234.4-89 standard....
-#
-#	UTC	Standard time	Daylight savings time
-#	offset	French	English	French	English
-#	-2:30	-	-	HAT	NDT
-#	-3	-	-	HAA	ADT
-#	-3:30	HNT	NST	-	-
-#	-4	HNA	AST	HAE	EDT
-#	-5	HNE	EST	HAC	CDT
-#	-6	HNC	CST	HAR	MDT
-#	-7	HNR	MST	HAP	PDT
-#	-8	HNP	PST	HAY	YDT
-#	-9	HNY	YST	-	-
-#
-#	HN: Heure Normale	ST: Standard Time
-#	HA: Heure Avanc<e'>e	DT: Daylight saving Time
-#
-#	A: de l'Atlantique	Atlantic
-#	C: du Centre		Central
-#	E: de l'Est		Eastern
-#	M:			Mountain
-#	N:			Newfoundland
-#	P: du Pacifique		Pacific
-#	R: des Rocheuses
-#	T: de Terre-Neuve
-#	Y: du Yukon		Yukon
-#
-# From Paul Eggert (1994-11-22):
-# Alas, this sort of thing must be handled by localization software.
-
-# Unless otherwise specified, the data for Canada are all from Shanks
-# & Pottenger.
-
-# From Chris Walton (2006-04-01, 2006-04-25, 2006-06-26, 2007-01-31,
-# 2007-03-01):
-# The British Columbia government announced yesterday that it will
-# adjust daylight savings next year to align with changes in the
-# U.S. and the rest of Canada....
-# http://www2.news.gov.bc.ca/news_releases_2005-2009/2006AG0014-000330.htm
-# ...
-# Nova Scotia
-# Daylight saving time will be extended by four weeks starting in 2007....
-# http://www.gov.ns.ca/just/regulations/rg2/2006/ma1206.pdf
-#
-# [For New Brunswick] the new legislation dictates that the time change is to
-# be done at 02:00 instead of 00:01.
-# http://www.gnb.ca/0062/acts/BBA-2006/Chap-19.pdf
-# ...
-# Manitoba has traditionally changed the clock every fall at 03:00.
-# As of 2006, the transition is to take place one hour earlier at 02:00.
-# http://web2.gov.mb.ca/laws/statutes/ccsm/o030e.php
-# ...
-# [Alberta, Ontario, Quebec] will follow US rules.
-# http://www.qp.gov.ab.ca/documents/spring/CH03_06.CFM
-# http://www.e-laws.gov.on.ca/DBLaws/Source/Regs/English/2006/R06111_e.htm
-# http://www2.publicationsduquebec.gouv.qc.ca/dynamicSearch/telecharge.php?type=5&file=2006C39A.PDF
-# ...
-# P.E.I. will follow US rules....
-# http://www.assembly.pe.ca/bills/pdf_chapter/62/3/chapter-41.pdf
-# ...
-# Province of Newfoundland and Labrador....
-# http://www.hoa.gov.nl.ca/hoa/bills/Bill0634.htm
-# ...
-# Yukon
-# http://www.gov.yk.ca/legislation/regs/oic2006_127.pdf
-# ...
-# N.W.T. will follow US rules.  Whoever maintains the government web site
-# does not seem to believe in bookmarks.  To see the news release, click the
-# following link and search for "Daylight Savings Time Change".  Press the
-# "Daylight Savings Time Change" link; it will fire off a popup using
-# JavaScript.
-# http://www.exec.gov.nt.ca/currentnews/currentPR.asp?mode=archive
-# ...
-# Nunavut
-# An amendment to the Interpretation Act was registered on February 19/2007....
-# http://action.attavik.ca/home/justice-gn/attach/2007/gaz02part2.pdf
-
-# From Paul Eggert (2006-04-25):
-# H. David Matthews and Mary Vincent's map
-# <a href="http://www.canadiangeographic.ca/Magazine/SO98/geomap.asp">
-# "It's about TIME", _Canadian Geographic_ (September-October 1998)
-# </a> contains detailed boundaries for regions observing nonstandard
-# time and daylight saving time arrangements in Canada circa 1998.
-#
-# INMS, the Institute for National Measurement Standards in Ottawa, has <a
-# href="http://inms-ienm.nrc-cnrc.gc.ca/en/time_services/daylight_saving_e.php">
-# information about standard and daylight saving time zones in Canada.
-# </a> (updated periodically).
-# Its unofficial information is often taken from Matthews and Vincent.
-
-# From Paul Eggert (2006-06-27):
-# For now, assume all of DST-observing Canada will fall into line with the
-# new US DST rules,
-
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Canada	1918	only	-	Apr	14	2:00	1:00	D
-Rule	Canada	1918	only	-	Oct	31	2:00	0	S
-Rule	Canada	1942	only	-	Feb	 9	2:00	1:00	W # War
-Rule	Canada	1945	only	-	Aug	14	23:00u	1:00	P # Peace
-Rule	Canada	1945	only	-	Sep	30	2:00	0	S
-Rule	Canada	1974	1986	-	Apr	lastSun	2:00	1:00	D
-Rule	Canada	1974	2006	-	Oct	lastSun	2:00	0	S
-Rule	Canada	1987	2006	-	Apr	Sun>=1	2:00	1:00	D
-Rule	Canada	2007	max	-	Mar	Sun>=8	2:00	1:00	D
-Rule	Canada	2007	max	-	Nov	Sun>=1	2:00	0	S
-
-
-# Newfoundland and Labrador
-
-# From Paul Eggert (2000-10-02):
-# Matthews and Vincent (1998) write that Labrador should use NST/NDT,
-# but the only part of Labrador that follows the rules is the
-# southeast corner, including Port Hope Simpson and Mary's Harbour,
-# but excluding, say, Black Tickle.
-
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	StJohns	1917	only	-	Apr	 8	2:00	1:00	D
-Rule	StJohns	1917	only	-	Sep	17	2:00	0	S
-# Whitman gives 1919 Apr 5 and 1920 Apr 5; go with Shanks & Pottenger.
-Rule	StJohns	1919	only	-	May	 5	23:00	1:00	D
-Rule	StJohns	1919	only	-	Aug	12	23:00	0	S
-# For 1931-1935 Whitman gives Apr same date; go with Shanks & Pottenger.
-Rule	StJohns	1920	1935	-	May	Sun>=1	23:00	1:00	D
-Rule	StJohns	1920	1935	-	Oct	lastSun	23:00	0	S
-# For 1936-1941 Whitman gives May Sun>=8 and Oct Sun>=1; go with Shanks &
-# Pottenger.
-Rule	StJohns	1936	1941	-	May	Mon>=9	0:00	1:00	D
-Rule	StJohns	1936	1941	-	Oct	Mon>=2	0:00	0	S
-# Whitman gives the following transitions:
-# 1942 03-01/12-31, 1943 05-30/09-05, 1944 07-10/09-02, 1945 01-01/10-07
-# but go with Shanks & Pottenger and assume they used Canadian rules.
-# For 1946-9 Whitman gives May 5,4,9,1 - Oct 1,5,3,2, and for 1950 he gives
-# Apr 30 - Sep 24; go with Shanks & Pottenger.
-Rule	StJohns	1946	1950	-	May	Sun>=8	2:00	1:00	D
-Rule	StJohns	1946	1950	-	Oct	Sun>=2	2:00	0	S
-Rule	StJohns	1951	1986	-	Apr	lastSun	2:00	1:00	D
-Rule	StJohns	1951	1959	-	Sep	lastSun	2:00	0	S
-Rule	StJohns	1960	1986	-	Oct	lastSun	2:00	0	S
-# From Paul Eggert (2000-10-02):
-# INMS (2000-09-12) says that, since 1988 at least, Newfoundland switches
-# at 00:01 local time.  For now, assume it started in 1987.
-Rule	StJohns	1987	only	-	Apr	Sun>=1	0:01	1:00	D
-Rule	StJohns	1987	2006	-	Oct	lastSun	0:01	0	S
-Rule	StJohns	1988	only	-	Apr	Sun>=1	0:01	2:00	DD
-Rule	StJohns	1989	2006	-	Apr	Sun>=1	0:01	1:00	D
-Rule	StJohns	2007	max	-	Mar	Sun>=8	0:01	1:00	D
-Rule	StJohns	2007	max	-	Nov	Sun>=1	0:01	0	S
-#
-# St John's has an apostrophe, but Posix file names can't have apostrophes.
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone America/St_Johns	-3:30:52 -	LMT	1884
-			-3:30:52 StJohns N%sT	1918
-			-3:30:52 Canada	N%sT	1919
-			-3:30:52 StJohns N%sT	1935 Mar 30
-			-3:30	StJohns	N%sT	1942 May 11
-			-3:30	Canada	N%sT	1946
-			-3:30	StJohns	N%sT
-
-# most of east Labrador
-
-# The name `Happy Valley-Goose Bay' is too long; use `Goose Bay'.
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone America/Goose_Bay	-4:01:40 -	LMT	1884 # Happy Valley-Goose Bay
-			-3:30:52 -	NST	1918
-			-3:30:52 Canada N%sT	1919
-			-3:30:52 -	NST	1935 Mar 30
-			-3:30	-	NST	1936
-			-3:30	StJohns	N%sT	1942 May 11
-			-3:30	Canada	N%sT	1946
-			-3:30	StJohns	N%sT	1966 Mar 15 2:00
-			-4:00	StJohns	A%sT
-
-
-# west Labrador, Nova Scotia, Prince Edward I
-
-# From Paul Eggert (2006-03-22):
-# Shanks & Pottenger write that since 1970 most of this region has been like
-# Halifax.  Many locales did not observe peacetime DST until 1972;
-# Glace Bay, NS is the largest that we know of.
-# Shanks & Pottenger also write that Liverpool, NS was the only town
-# in Canada to observe DST in 1971 but not 1970; for now we'll assume
-# this is a typo.
-
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Halifax	1916	only	-	Apr	 1	0:00	1:00	D
-Rule	Halifax	1916	only	-	Oct	 1	0:00	0	S
-Rule	Halifax	1920	only	-	May	 9	0:00	1:00	D
-Rule	Halifax	1920	only	-	Aug	29	0:00	0	S
-Rule	Halifax	1921	only	-	May	 6	0:00	1:00	D
-Rule	Halifax	1921	1922	-	Sep	 5	0:00	0	S
-Rule	Halifax	1922	only	-	Apr	30	0:00	1:00	D
-Rule	Halifax	1923	1925	-	May	Sun>=1	0:00	1:00	D
-Rule	Halifax	1923	only	-	Sep	 4	0:00	0	S
-Rule	Halifax	1924	only	-	Sep	15	0:00	0	S
-Rule	Halifax	1925	only	-	Sep	28	0:00	0	S
-Rule	Halifax	1926	only	-	May	16	0:00	1:00	D
-Rule	Halifax	1926	only	-	Sep	13	0:00	0	S
-Rule	Halifax	1927	only	-	May	 1	0:00	1:00	D
-Rule	Halifax	1927	only	-	Sep	26	0:00	0	S
-Rule	Halifax	1928	1931	-	May	Sun>=8	0:00	1:00	D
-Rule	Halifax	1928	only	-	Sep	 9	0:00	0	S
-Rule	Halifax	1929	only	-	Sep	 3	0:00	0	S
-Rule	Halifax	1930	only	-	Sep	15	0:00	0	S
-Rule	Halifax	1931	1932	-	Sep	Mon>=24	0:00	0	S
-Rule	Halifax	1932	only	-	May	 1	0:00	1:00	D
-Rule	Halifax	1933	only	-	Apr	30	0:00	1:00	D
-Rule	Halifax	1933	only	-	Oct	 2	0:00	0	S
-Rule	Halifax	1934	only	-	May	20	0:00	1:00	D
-Rule	Halifax	1934	only	-	Sep	16	0:00	0	S
-Rule	Halifax	1935	only	-	Jun	 2	0:00	1:00	D
-Rule	Halifax	1935	only	-	Sep	30	0:00	0	S
-Rule	Halifax	1936	only	-	Jun	 1	0:00	1:00	D
-Rule	Halifax	1936	only	-	Sep	14	0:00	0	S
-Rule	Halifax	1937	1938	-	May	Sun>=1	0:00	1:00	D
-Rule	Halifax	1937	1941	-	Sep	Mon>=24	0:00	0	S
-Rule	Halifax	1939	only	-	May	28	0:00	1:00	D
-Rule	Halifax	1940	1941	-	May	Sun>=1	0:00	1:00	D
-Rule	Halifax	1946	1949	-	Apr	lastSun	2:00	1:00	D
-Rule	Halifax	1946	1949	-	Sep	lastSun	2:00	0	S
-Rule	Halifax	1951	1954	-	Apr	lastSun	2:00	1:00	D
-Rule	Halifax	1951	1954	-	Sep	lastSun	2:00	0	S
-Rule	Halifax	1956	1959	-	Apr	lastSun	2:00	1:00	D
-Rule	Halifax	1956	1959	-	Sep	lastSun	2:00	0	S
-Rule	Halifax	1962	1973	-	Apr	lastSun	2:00	1:00	D
-Rule	Halifax	1962	1973	-	Oct	lastSun	2:00	0	S
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone America/Halifax	-4:14:24 -	LMT	1902 Jun 15
-			-4:00	Halifax	A%sT	1918
-			-4:00	Canada	A%sT	1919
-			-4:00	Halifax	A%sT	1942 Feb  9 2:00s
-			-4:00	Canada	A%sT	1946
-			-4:00	Halifax	A%sT	1974
-			-4:00	Canada	A%sT
-Zone America/Glace_Bay	-3:59:48 -	LMT	1902 Jun 15
-			-4:00	Canada	A%sT	1953
-			-4:00	Halifax	A%sT	1954
-			-4:00	-	AST	1972
-			-4:00	Halifax	A%sT	1974
-			-4:00	Canada	A%sT
-
-# New Brunswick
-
-# From Paul Eggert (2007-01-31):
-# The Time Definition Act <http://www.gnb.ca/0062/PDF-acts/t-06.pdf>
-# says they changed at 00:01 through 2006, and
-# <http://www.canlii.org/nb/laws/sta/t-6/20030127/whole.html> makes it
-# clear that this was the case since at least 1993.
-# For now, assume it started in 1993.
-
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Moncton	1933	1935	-	Jun	Sun>=8	1:00	1:00	D
-Rule	Moncton	1933	1935	-	Sep	Sun>=8	1:00	0	S
-Rule	Moncton	1936	1938	-	Jun	Sun>=1	1:00	1:00	D
-Rule	Moncton	1936	1938	-	Sep	Sun>=1	1:00	0	S
-Rule	Moncton	1939	only	-	May	27	1:00	1:00	D
-Rule	Moncton	1939	1941	-	Sep	Sat>=21	1:00	0	S
-Rule	Moncton	1940	only	-	May	19	1:00	1:00	D
-Rule	Moncton	1941	only	-	May	 4	1:00	1:00	D
-Rule	Moncton	1946	1972	-	Apr	lastSun	2:00	1:00	D
-Rule	Moncton	1946	1956	-	Sep	lastSun	2:00	0	S
-Rule	Moncton	1957	1972	-	Oct	lastSun	2:00	0	S
-Rule	Moncton	1993	2006	-	Apr	Sun>=1	0:01	1:00	D
-Rule	Moncton	1993	2006	-	Oct	lastSun	0:01	0	S
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone America/Moncton	-4:19:08 -	LMT	1883 Dec  9
-			-5:00	-	EST	1902 Jun 15
-			-4:00	Canada	A%sT	1933
-			-4:00	Moncton	A%sT	1942
-			-4:00	Canada	A%sT	1946
-			-4:00	Moncton	A%sT	1973
-			-4:00	Canada	A%sT	1993
-			-4:00	Moncton	A%sT	2007
-			-4:00	Canada	A%sT
-
-# Quebec
-
-# From Paul Eggert (2006-07-09):
-# Shanks & Pottenger write that since 1970 most of Quebec has been
-# like Montreal.
-
-# From Paul Eggert (2006-06-27):
-# Matthews and Vincent (1998) also write that Quebec east of the -63
-# meridian is supposed to observe AST, but residents as far east as
-# Natashquan use EST/EDT, and residents east of Natashquan use AST.
-# In "Official time in Quebec" the Quebec department of justice writes in
-# http://www.justice.gouv.qc.ca/english/publications/generale/temps-regl-1-a.htm
-# that "The residents of the Municipality of the
-# Cote-Nord-du-Golfe-Saint-Laurent and the municipalities of Saint-Augustin,
-# Bonne-Esperance and Blanc-Sablon apply the Official Time Act as it is
-# written and use Atlantic standard time all year round. The same applies to
-# the residents of the Native facilities along the lower North Shore."
-# <http://www.assnat.qc.ca/eng/37legislature2/Projets-loi/Publics/06-a002.htm>
-# says this common practice was codified into law as of 2007.
-# For lack of better info, guess this practice began around 1970, contra to
-# Shanks & Pottenger who have this region observing AST/ADT.
-
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Mont	1917	only	-	Mar	25	2:00	1:00	D
-Rule	Mont	1917	only	-	Apr	24	0:00	0	S
-Rule	Mont	1919	only	-	Mar	31	2:30	1:00	D
-Rule	Mont	1919	only	-	Oct	25	2:30	0	S
-Rule	Mont	1920	only	-	May	 2	2:30	1:00	D
-Rule	Mont	1920	1922	-	Oct	Sun>=1	2:30	0	S
-Rule	Mont	1921	only	-	May	 1	2:00	1:00	D
-Rule	Mont	1922	only	-	Apr	30	2:00	1:00	D
-Rule	Mont	1924	only	-	May	17	2:00	1:00	D
-Rule	Mont	1924	1926	-	Sep	lastSun	2:30	0	S
-Rule	Mont	1925	1926	-	May	Sun>=1	2:00	1:00	D
-# The 1927-to-1937 rules can be expressed more simply as
-# Rule	Mont	1927	1937	-	Apr	lastSat	24:00	1:00	D
-# Rule	Mont	1927	1937	-	Sep	lastSat	24:00	0	S
-# The rules below avoid use of 24:00
-# (which pre-1998 versions of zic cannot handle).
-Rule	Mont	1927	only	-	May	1	0:00	1:00	D
-Rule	Mont	1927	1932	-	Sep	lastSun	0:00	0	S
-Rule	Mont	1928	1931	-	Apr	lastSun	0:00	1:00	D
-Rule	Mont	1932	only	-	May	1	0:00	1:00	D
-Rule	Mont	1933	1940	-	Apr	lastSun	0:00	1:00	D
-Rule	Mont	1933	only	-	Oct	1	0:00	0	S
-Rule	Mont	1934	1939	-	Sep	lastSun	0:00	0	S
-Rule	Mont	1946	1973	-	Apr	lastSun	2:00	1:00	D
-Rule	Mont	1945	1948	-	Sep	lastSun	2:00	0	S
-Rule	Mont	1949	1950	-	Oct	lastSun	2:00	0	S
-Rule	Mont	1951	1956	-	Sep	lastSun	2:00	0	S
-Rule	Mont	1957	1973	-	Oct	lastSun	2:00	0	S
-
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone America/Blanc-Sablon -3:48:28 -	LMT	1884
-			-4:00	Canada	A%sT	1970
-			-4:00	-	AST
-Zone America/Montreal	-4:54:16 -	LMT	1884
-			-5:00	Mont	E%sT	1918
-			-5:00	Canada	E%sT	1919
-			-5:00	Mont	E%sT	1942 Feb  9 2:00s
-			-5:00	Canada	E%sT	1946
-			-5:00	Mont	E%sT	1974
-			-5:00	Canada	E%sT
-
-
-# Ontario
-
-# From Paul Eggert (2006-07-09):
-# Shanks & Pottenger write that since 1970 most of Ontario has been like
-# Toronto.
-# Thunder Bay skipped DST in 1973.
-# Many smaller locales did not observe peacetime DST until 1974;
-# Nipigon (EST) and Rainy River (CST) are the largest that we know of.
-# Far west Ontario is like Winnipeg; far east Quebec is like Halifax.
-
-# From Mark Brader (2003-07-26):
-# [According to the Toronto Star] Orillia, Ontario, adopted DST
-# effective Saturday, 1912-06-22, 22:00; the article mentions that
-# Port Arthur (now part of Thunder Bay, Ontario) as well as Moose Jaw
-# have already done so.  In Orillia DST was to run until Saturday,
-# 1912-08-31 (no time mentioned), but it was met with considerable
-# hostility from certain segments of the public, and was revoked after
-# only two weeks -- I copied it as Saturday, 1912-07-07, 22:00, but
-# presumably that should be -07-06.  (1912-06-19, -07-12; also letters
-# earlier in June).
-#
-# Kenora, Ontario, was to abandon DST on 1914-06-01 (-05-21).
-
-# From Paul Eggert (1997-10-17):
-# Mark Brader writes that an article in the 1997-10-14 Toronto Star
-# says that Atikokan, Ontario currently does not observe DST,
-# but will vote on 11-10 whether to use EST/EDT.
-# He also writes that the
-# <a href="http://www.gov.on.ca/MBS/english/publications/statregs/conttext.html">
-# Ontario Time Act (1990, Chapter T.9)
-# </a>
-# says that Ontario east of 90W uses EST/EDT, and west of 90W uses CST/CDT.
-# Officially Atikokan is therefore on CST/CDT, and most likely this report
-# concerns a non-official time observed as a matter of local practice.
-#
-# From Paul Eggert (2000-10-02):
-# Matthews and Vincent (1998) write that Atikokan, Pickle Lake, and
-# New Osnaburgh observe CST all year, that Big Trout Lake observes
-# CST/CDT, and that Upsala and Shebandowan observe EST/EDT, all in
-# violation of the official Ontario rules.
-#
-# From Paul Eggert (2006-07-09):
-# Chris Walton (2006-07-06) mentioned an article by Stephanie MacLellan in the
-# 2005-07-21 Chronicle-Journal, which said:
-#
-#	The clocks in Atikokan stay set on standard time year-round.
-#	This means they spend about half the time on central time and
-#	the other half on eastern time.
-#
-#	For the most part, the system works, Mayor Dennis Brown said.
-#
-#	"The majority of businesses in Atikokan deal more with Eastern
-#	Canada, but there are some that deal with Western Canada," he
-#	said.  "I don't see any changes happening here."
-#
-# Walton also writes "Supposedly Pickle Lake and Mishkeegogamang
-# [New Osnaburgh] follow the same practice."
-
-# From Garry McKinnon (2006-07-14) via Chris Walton:
-# I chatted with a member of my board who has an outstanding memory
-# and a long history in Atikokan (and in the telecom industry) and he
-# can say for certain that Atikokan has been practicing the current
-# time keeping since 1952, at least.
-
-# From Paul Eggert (2006-07-17):
-# Shanks & Pottenger say that Atikokan has agreed with Rainy River
-# ever since standard time was introduced, but the information from
-# McKinnon sounds more authoritative.  For now, assume that Atikokan
-# switched to EST immediately after WWII era daylight saving time
-# ended.  This matches the old (less-populous) America/Coral_Harbour
-# entry since our cutoff date of 1970, so we can move
-# America/Coral_Harbour to the 'backward' file.
-
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Toronto	1919	only	-	Mar	30	23:30	1:00	D
-Rule	Toronto	1919	only	-	Oct	26	0:00	0	S
-Rule	Toronto	1920	only	-	May	 2	2:00	1:00	D
-Rule	Toronto	1920	only	-	Sep	26	0:00	0	S
-Rule	Toronto	1921	only	-	May	15	2:00	1:00	D
-Rule	Toronto	1921	only	-	Sep	15	2:00	0	S
-Rule	Toronto	1922	1923	-	May	Sun>=8	2:00	1:00	D
-# Shanks & Pottenger say 1923-09-19; assume it's a typo and that "-16"
-# was meant.
-Rule	Toronto	1922	1926	-	Sep	Sun>=15	2:00	0	S
-Rule	Toronto	1924	1927	-	May	Sun>=1	2:00	1:00	D
-# The 1927-to-1939 rules can be expressed more simply as
-# Rule	Toronto	1927	1937	-	Sep	Sun>=25	2:00	0	S
-# Rule	Toronto	1928	1937	-	Apr	Sun>=25	2:00	1:00	D
-# Rule	Toronto	1938	1940	-	Apr	lastSun	2:00	1:00	D
-# Rule	Toronto	1938	1939	-	Sep	lastSun	2:00	0	S
-# The rules below avoid use of Sun>=25
-# (which pre-2004 versions of zic cannot handle).
-Rule	Toronto	1927	1932	-	Sep	lastSun	2:00	0	S
-Rule	Toronto	1928	1931	-	Apr	lastSun	2:00	1:00	D
-Rule	Toronto	1932	only	-	May	1	2:00	1:00	D
-Rule	Toronto	1933	1940	-	Apr	lastSun	2:00	1:00	D
-Rule	Toronto	1933	only	-	Oct	1	2:00	0	S
-Rule	Toronto	1934	1939	-	Sep	lastSun	2:00	0	S
-Rule	Toronto	1945	1946	-	Sep	lastSun	2:00	0	S
-Rule	Toronto	1946	only	-	Apr	lastSun	2:00	1:00	D
-Rule	Toronto	1947	1949	-	Apr	lastSun	0:00	1:00	D
-Rule	Toronto	1947	1948	-	Sep	lastSun	0:00	0	S
-Rule	Toronto	1949	only	-	Nov	lastSun	0:00	0	S
-Rule	Toronto	1950	1973	-	Apr	lastSun	2:00	1:00	D
-Rule	Toronto	1950	only	-	Nov	lastSun	2:00	0	S
-Rule	Toronto	1951	1956	-	Sep	lastSun	2:00	0	S
-# Shanks & Pottenger say Toronto ended DST a week early in 1971,
-# namely on 1971-10-24, but Mark Brader wrote (2003-05-31) that this
-# is wrong, and that he had confirmed it by checking the 1971-10-30
-# Toronto Star, which said that DST was ending 1971-10-31 as usual.
-Rule	Toronto	1957	1973	-	Oct	lastSun	2:00	0	S
-
-# From Paul Eggert (2003-07-27):
-# Willett (1914-03) writes (p. 17) "In the Cities of Fort William, and
-# Port Arthur, Ontario, the principle of the Bill has been in
-# operation for the past three years, and in the City of Moose Jaw,
-# Saskatchewan, for one year."
-
-# From David Bryan via Tory Tronrud, Director/Curator,
-# Thunder Bay Museum (2003-11-12):
-# There is some suggestion, however, that, by-law or not, daylight
-# savings time was being practiced in Fort William and Port Arthur
-# before 1909.... [I]n 1910, the line between the Eastern and Central
-# Time Zones was permanently moved about two hundred miles west to
-# include the Thunder Bay area....  When Canada adopted daylight
-# savings time in 1916, Fort William and Port Arthur, having done so
-# already, did not change their clocks....  During the Second World
-# War,... [t]he cities agreed to implement DST during the summer
-# months for the remainder of the war years.
-
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone America/Toronto	-5:17:32 -	LMT	1895
-			-5:00	Canada	E%sT	1919
-			-5:00	Toronto	E%sT	1942 Feb  9 2:00s
-			-5:00	Canada	E%sT	1946
-			-5:00	Toronto	E%sT	1974
-			-5:00	Canada	E%sT
-Zone America/Thunder_Bay -5:57:00 -	LMT	1895
-			-6:00	-	CST	1910
-			-5:00	-	EST	1942
-			-5:00	Canada	E%sT	1970
-			-5:00	Mont	E%sT	1973
-			-5:00	-	EST	1974
-			-5:00	Canada	E%sT
-Zone America/Nipigon	-5:53:04 -	LMT	1895
-			-5:00	Canada	E%sT	1940 Sep 29
-			-5:00	1:00	EDT	1942 Feb  9 2:00s
-			-5:00	Canada	E%sT
-Zone America/Rainy_River -6:18:16 -	LMT	1895
-			-6:00	Canada	C%sT	1940 Sep 29
-			-6:00	1:00	CDT	1942 Feb  9 2:00s
-			-6:00	Canada	C%sT
-Zone America/Atikokan	-6:06:28 -	LMT	1895
-			-6:00	Canada	C%sT	1940 Sep 29
-			-6:00	1:00	CDT	1942 Feb  9 2:00s
-			-6:00	Canada	C%sT	1945 Sep 30 2:00
-			-5:00	-	EST
-
-
-# Manitoba
-
-# From Rob Douglas (2006-04-06):
-# the old Manitoba Time Act - as amended by Bill 2, assented to
-# March 27, 1987 ... said ...
-# "between two o'clock Central Standard Time in the morning of
-# the first Sunday of April of each year and two o'clock Central
-# Standard Time in the morning of the last Sunday of October next
-# following, one hour in advance of Central Standard Time."...
-# I believe that the English legislation [of the old time act] had =
-# been assented to (March 22, 1967)....
-# Also, as far as I can tell, there was no order-in-council varying
-# the time of Daylight Saving Time for 2005 and so the provisions of
-# the 1987 version would apply - the changeover was at 2:00 Central
-# Standard Time (i.e. not until 3:00 Central Daylight Time).
-
-# From Paul Eggert (2006-04-10):
-# Shanks & Pottenger say Manitoba switched at 02:00 (not 02:00s)
-# starting 1966.  Since 02:00s is clearly correct for 1967 on, assume
-# it was also 02:00s in 1966.
-
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Winn	1916	only	-	Apr	23	0:00	1:00	D
-Rule	Winn	1916	only	-	Sep	17	0:00	0	S
-Rule	Winn	1918	only	-	Apr	14	2:00	1:00	D
-Rule	Winn	1918	only	-	Oct	31	2:00	0	S
-Rule	Winn	1937	only	-	May	16	2:00	1:00	D
-Rule	Winn	1937	only	-	Sep	26	2:00	0	S
-Rule	Winn	1942	only	-	Feb	 9	2:00	1:00	W # War
-Rule	Winn	1945	only	-	Aug	14	23:00u	1:00	P # Peace
-Rule	Winn	1945	only	-	Sep	lastSun	2:00	0	S
-Rule	Winn	1946	only	-	May	12	2:00	1:00	D
-Rule	Winn	1946	only	-	Oct	13	2:00	0	S
-Rule	Winn	1947	1949	-	Apr	lastSun	2:00	1:00	D
-Rule	Winn	1947	1949	-	Sep	lastSun	2:00	0	S
-Rule	Winn	1950	only	-	May	 1	2:00	1:00	D
-Rule	Winn	1950	only	-	Sep	30	2:00	0	S
-Rule	Winn	1951	1960	-	Apr	lastSun	2:00	1:00	D
-Rule	Winn	1951	1958	-	Sep	lastSun	2:00	0	S
-Rule	Winn	1959	only	-	Oct	lastSun	2:00	0	S
-Rule	Winn	1960	only	-	Sep	lastSun	2:00	0	S
-Rule	Winn	1963	only	-	Apr	lastSun	2:00	1:00	D
-Rule	Winn	1963	only	-	Sep	22	2:00	0	S
-Rule	Winn	1966	1986	-	Apr	lastSun	2:00s	1:00	D
-Rule	Winn	1966	2005	-	Oct	lastSun	2:00s	0	S
-Rule	Winn	1987	2005	-	Apr	Sun>=1	2:00s	1:00	D
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone America/Winnipeg	-6:28:36 -	LMT	1887 Jul 16
-			-6:00	Winn	C%sT	2006
-			-6:00	Canada	C%sT
-
-
-# Saskatchewan
-
-# From Mark Brader (2003-07-26):
-# The first actual adoption of DST in Canada was at the municipal
-# level.  As the [Toronto] Star put it (1912-06-07), "While people
-# elsewhere have long been talking of legislation to save daylight,
-# the city of Moose Jaw [Saskatchewan] has acted on its own hook."
-# DST in Moose Jaw began on Saturday, 1912-06-01 (no time mentioned:
-# presumably late evening, as below), and would run until "the end of
-# the summer".  The discrepancy between municipal time and railroad
-# time was noted.
-
-# From Paul Eggert (2003-07-27):
-# Willett (1914-03) notes that DST "has been in operation ... in the
-# City of Moose Jaw, Saskatchewan, for one year."
-
-# From Paul Eggert (2006-03-22):
-# Shanks & Pottenger say that since 1970 this region has mostly been as Regina.
-# Some western towns (e.g. Swift Current) switched from MST/MDT to CST in 1972.
-# Other western towns (e.g. Lloydminster) are like Edmonton.
-# Matthews and Vincent (1998) write that Denare Beach and Creighton
-# are like Winnipeg, in violation of Saskatchewan law.
-
-# From W. Jones (1992-11-06):
-# The. . .below is based on information I got from our law library, the
-# provincial archives, and the provincial Community Services department.
-# A precise history would require digging through newspaper archives, and
-# since you didn't say what you wanted, I didn't bother.
-#
-# Saskatchewan is split by a time zone meridian (105W) and over the years
-# the boundary became pretty ragged as communities near it reevaluated
-# their affiliations in one direction or the other.  In 1965 a provincial
-# referendum favoured legislating common time practices.
-#
-# On 15 April 1966 the Time Act (c. T-14, Revised Statutes of
-# Saskatchewan 1978) was proclaimed, and established that the eastern
-# part of Saskatchewan would use CST year round, that districts in
-# northwest Saskatchewan would by default follow CST but could opt to
-# follow Mountain Time rules (thus 1 hour difference in the winter and
-# zero in the summer), and that districts in southwest Saskatchewan would
-# by default follow MT but could opt to follow CST.
-#
-# It took a few years for the dust to settle (I know one story of a town
-# on one time zone having its school in another, such that a mom had to
-# serve her family lunch in two shifts), but presently it seems that only
-# a few towns on the border with Alberta (e.g. Lloydminster) follow MT
-# rules any more; all other districts appear to have used CST year round
-# since sometime in the 1960s.
-
-# From Chris Walton (2006-06-26):
-# The Saskatchewan time act which was last updated in 1996 is about 30 pages
-# long and rather painful to read.
-# http://www.qp.gov.sk.ca/documents/English/Statutes/Statutes/T14.pdf
-
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Regina	1918	only	-	Apr	14	2:00	1:00	D
-Rule	Regina	1918	only	-	Oct	31	2:00	0	S
-Rule	Regina	1930	1934	-	May	Sun>=1	0:00	1:00	D
-Rule	Regina	1930	1934	-	Oct	Sun>=1	0:00	0	S
-Rule	Regina	1937	1941	-	Apr	Sun>=8	0:00	1:00	D
-Rule	Regina	1937	only	-	Oct	Sun>=8	0:00	0	S
-Rule	Regina	1938	only	-	Oct	Sun>=1	0:00	0	S
-Rule	Regina	1939	1941	-	Oct	Sun>=8	0:00	0	S
-Rule	Regina	1942	only	-	Feb	 9	2:00	1:00	W # War
-Rule	Regina	1945	only	-	Aug	14	23:00u	1:00	P # Peace
-Rule	Regina	1945	only	-	Sep	lastSun	2:00	0	S
-Rule	Regina	1946	only	-	Apr	Sun>=8	2:00	1:00	D
-Rule	Regina	1946	only	-	Oct	Sun>=8	2:00	0	S
-Rule	Regina	1947	1957	-	Apr	lastSun	2:00	1:00	D
-Rule	Regina	1947	1957	-	Sep	lastSun	2:00	0	S
-Rule	Regina	1959	only	-	Apr	lastSun	2:00	1:00	D
-Rule	Regina	1959	only	-	Oct	lastSun	2:00	0	S
-#
-Rule	Swift	1957	only	-	Apr	lastSun	2:00	1:00	D
-Rule	Swift	1957	only	-	Oct	lastSun	2:00	0	S
-Rule	Swift	1959	1961	-	Apr	lastSun	2:00	1:00	D
-Rule	Swift	1959	only	-	Oct	lastSun	2:00	0	S
-Rule	Swift	1960	1961	-	Sep	lastSun	2:00	0	S
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone America/Regina	-6:58:36 -	LMT	1905 Sep
-			-7:00	Regina	M%sT	1960 Apr lastSun 2:00
-			-6:00	-	CST
-Zone America/Swift_Current -7:11:20 -	LMT	1905 Sep
-			-7:00	Canada	M%sT	1946 Apr lastSun 2:00
-			-7:00	Regina	M%sT	1950
-			-7:00	Swift	M%sT	1972 Apr lastSun 2:00
-			-6:00	-	CST
-
-
-# Alberta
-
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Edm	1918	1919	-	Apr	Sun>=8	2:00	1:00	D
-Rule	Edm	1918	only	-	Oct	31	2:00	0	S
-Rule	Edm	1919	only	-	May	27	2:00	0	S
-Rule	Edm	1920	1923	-	Apr	lastSun	2:00	1:00	D
-Rule	Edm	1920	only	-	Oct	lastSun	2:00	0	S
-Rule	Edm	1921	1923	-	Sep	lastSun	2:00	0	S
-Rule	Edm	1942	only	-	Feb	 9	2:00	1:00	W # War
-Rule	Edm	1945	only	-	Aug	14	23:00u	1:00	P # Peace
-Rule	Edm	1945	only	-	Sep	lastSun	2:00	0	S
-Rule	Edm	1947	only	-	Apr	lastSun	2:00	1:00	D
-Rule	Edm	1947	only	-	Sep	lastSun	2:00	0	S
-Rule	Edm	1967	only	-	Apr	lastSun	2:00	1:00	D
-Rule	Edm	1967	only	-	Oct	lastSun	2:00	0	S
-Rule	Edm	1969	only	-	Apr	lastSun	2:00	1:00	D
-Rule	Edm	1969	only	-	Oct	lastSun	2:00	0	S
-Rule	Edm	1972	1986	-	Apr	lastSun	2:00	1:00	D
-Rule	Edm	1972	2006	-	Oct	lastSun	2:00	0	S
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone America/Edmonton	-7:33:52 -	LMT	1906 Sep
-			-7:00	Edm	M%sT	1987
-			-7:00	Canada	M%sT
-
-
-# British Columbia
-
-# From Paul Eggert (2006-03-22):
-# Shanks & Pottenger write that since 1970 most of this region has
-# been like Vancouver.
-# Dawson Creek uses MST.  Much of east BC is like Edmonton.
-# Matthews and Vincent (1998) write that Creston is like Dawson Creek.
-
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Vanc	1918	only	-	Apr	14	2:00	1:00	D
-Rule	Vanc	1918	only	-	Oct	31	2:00	0	S
-Rule	Vanc	1942	only	-	Feb	 9	2:00	1:00	W # War
-Rule	Vanc	1945	only	-	Aug	14	23:00u	1:00	P # Peace
-Rule	Vanc	1945	only	-	Sep	30	2:00	0	S
-Rule	Vanc	1946	1986	-	Apr	lastSun	2:00	1:00	D
-Rule	Vanc	1946	only	-	Oct	13	2:00	0	S
-Rule	Vanc	1947	1961	-	Sep	lastSun	2:00	0	S
-Rule	Vanc	1962	2006	-	Oct	lastSun	2:00	0	S
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone America/Vancouver	-8:12:28 -	LMT	1884
-			-8:00	Vanc	P%sT	1987
-			-8:00	Canada	P%sT
-Zone America/Dawson_Creek -8:00:56 -	LMT	1884
-			-8:00	Canada	P%sT	1947
-			-8:00	Vanc	P%sT	1972 Aug 30 2:00
-			-7:00	-	MST
-
-
-# Northwest Territories, Nunavut, Yukon
-
-# From Paul Eggert (2006-03-22):
-# Dawson switched to PST in 1973.  Inuvik switched to MST in 1979.
-# Mathew Englander (1996-10-07) gives the following refs:
-#	* 1967. Paragraph 28(34)(g) of the Interpretation Act, S.C. 1967-68,
-#	c. 7 defines Yukon standard time as UTC-9.  This is still valid;
-#	see Interpretation Act, R.S.C. 1985, c. I-21, s. 35(1).
-#	* C.O. 1973/214 switched Yukon to PST on 1973-10-28 00:00.
-#	* O.I.C. 1980/02 established DST.
-#	* O.I.C. 1987/056 changed DST to Apr firstSun 2:00 to Oct lastSun 2:00.
-# Shanks & Pottenger say Yukon's 1973-10-28 switch was at 2:00; go
-# with Englander.
-# From Chris Walton (2006-06-26):
-# Here is a link to the old daylight saving portion of the interpretation
-# act which was last updated in 1987:
-# http://www.gov.yk.ca/legislation/regs/oic1987_056.pdf
-
-# From Rives McDow (1999-09-04):
-# Nunavut ... moved ... to incorporate the whole territory into one time zone.
-# <a href="http://www.nunatsiaq.com/nunavut/nvt90903_13.html">
-# Nunavut moves to single time zone Oct. 31
-# </a>
-#
-# From Antoine Leca (1999-09-06):
-# We then need to create a new timezone for the Kitikmeot region of Nunavut
-# to differentiate it from the Yellowknife region.
-
-# From Paul Eggert (1999-09-20):
-# <a href="http://www.nunavut.com/basicfacts/english/basicfacts_1territory.html">
-# Basic Facts: The New Territory
-# </a> (1999) reports that Pangnirtung operates on eastern time,
-# and that Coral Harbour does not observe DST.  We don't know when
-# Pangnirtung switched to eastern time; we'll guess 1995.
-
-# From Rives McDow (1999-11-08):
-# On October 31, when the rest of Nunavut went to Central time,
-# Pangnirtung wobbled.  Here is the result of their wobble:
-#
-# The following businesses and organizations in Pangnirtung use Central Time:
-#
-#	First Air, Power Corp, Nunavut Construction, Health Center, RCMP,
-#	Eastern Arctic National Parks, A & D Specialist
-#
-# The following businesses and organizations in Pangnirtung use Eastern Time:
-#
-#	Hamlet office, All other businesses, Both schools, Airport operator
-#
-# This has made for an interesting situation there, which warranted the news.
-# No one there that I spoke with seems concerned, or has plans to
-# change the local methods of keeping time, as it evidently does not
-# really interfere with any activities or make things difficult locally.
-# They plan to celebrate New Year's turn-over twice, one hour apart,
-# so it appears that the situation will last at least that long.
-# The Nunavut Intergovernmental Affairs hopes that they will "come to
-# their senses", but the locals evidently don't see any problem with
-# the current state of affairs.
-
-# From Michaela Rodrigue, writing in the
-# <a href="http://www.nunatsiaq.com/archives/nunavut991130/nvt91119_17.html">
-# Nunatsiaq News (1999-11-19)</a>:
-# Clyde River, Pangnirtung and Sanikiluaq now operate with two time zones,
-# central - or Nunavut time - for government offices, and eastern time
-# for municipal offices and schools....  Igloolik [was similar but then]
-# made the switch to central time on Saturday, Nov. 6.
-
-# From Paul Eggert (2000-10-02):
-# Matthews and Vincent (1998) say the following, but we lack histories
-# for these potential new Zones.
-#
-# The Canadian Forces station at Alert uses Eastern Time while the
-# handful of residents at the Eureka weather station [in the Central
-# zone] skip daylight savings.  Baffin Island, which is crossed by the
-# Central, Eastern and Atlantic Time zones only uses Eastern Time.
-# Gjoa Haven, Taloyoak and Pelly Bay all use Mountain instead of
-# Central Time and Southampton Island [in the Central zone] is not
-# required to use daylight savings.
-
-# From
-# <a href="http://www.nunatsiaq.com/archives/nunavut001130/nvt21110_02.html">
-# Nunavut now has two time zones
-# </a> (2000-11-10):
-# The Nunavut government would allow its employees in Kugluktuk and
-# Cambridge Bay to operate on central time year-round, putting them
-# one hour behind the rest of Nunavut for six months during the winter.
-# At the end of October the two communities had rebelled against
-# Nunavut's unified time zone, refusing to shift to eastern time with
-# the rest of the territory for the winter.  Cambridge Bay remained on
-# central time, while Kugluktuk, even farther west, reverted to
-# mountain time, which they had used before the advent of Nunavut's
-# unified time zone in 1999.
-#
-# From Rives McDow (2001-01-20), quoting the Nunavut government:
-# The preceding decision came into effect at midnight, Saturday Nov 4, 2000.
-
-# From Paul Eggert (2000-12-04):
-# Let's just keep track of the official times for now.
-
-# From Rives McDow (2001-03-07):
-# The premier of Nunavut has issued a ministerial statement advising
-# that effective 2001-04-01, the territory of Nunavut will revert
-# back to three time zones (mountain, central, and eastern).  Of the
-# cities in Nunavut, Coral Harbor is the only one that I know of that
-# has said it will not observe dst, staying on EST year round.  I'm
-# checking for more info, and will get back to you if I come up with
-# more.
-# [Also see <http://www.nunatsiaq.com/nunavut/nvt10309_06.html> (2001-03-09).]
-
-# From Gwillim Law (2005-05-21):
-# According to maps at
-# http://inms-ienm.nrc-cnrc.gc.ca/images/time_services/TZ01SWE.jpg
-# http://inms-ienm.nrc-cnrc.gc.ca/images/time_services/TZ01SSE.jpg
-# (both dated 2003), and
-# http://www.canadiangeographic.ca/Magazine/SO98/geomap.asp
-# (from a 1998 Canadian Geographic article), the de facto and de jure time
-# for Southampton Island (at the north end of Hudson Bay) is UTC-5 all year
-# round.  Using Google, it's easy to find other websites that confirm this.
-# I wasn't able to find how far back this time regimen goes, but since it
-# predates the creation of Nunavut, it probably goes back many years....
-# The Inuktitut name of Coral Harbour is Sallit, but it's rarely used.
-#
-# From Paul Eggert (2005-07-26):
-# For lack of better information, assume that Southampton Island observed
-# daylight saving only during wartime.
-
-# From Chris Walton (2007-03-01):
-# ... the community of Resolute (located on Cornwallis Island in
-# Nunavut) moved from Central Time to Eastern Time last November.
-# Basically the community did not change its clocks at the end of
-# daylight saving....
-# http://www.nnsl.com/frames/newspapers/2006-11/nov13_06none.html
-
-# From Chris Walton (2007-03-14):
-# Today I phoned the "hamlet office" to find out what Resolute was doing with
-# its clocks.
-#
-# The individual that answered the phone confirmed that the clocks did not
-# move at the end of daylight saving on October 29/2006.  He also told me that
-# the clocks did not move this past weekend (March 11/2007)....
-
-# From Chris Walton (2008-11-13):
-# ...the residents of Resolute believe that they are changing "time zones"
-# twice a year.  In winter months, local time is qualified with "Eastern
-# Time" which is really "Eastern Standard Time (UTC-5)".  In summer
-# months, local time is qualified with "Central Time" which is really
-# "Central Daylight Time (UTC-5)"...
-
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	NT_YK	1918	only	-	Apr	14	2:00	1:00	D
-Rule	NT_YK	1918	only	-	Oct	27	2:00	0	S
-Rule	NT_YK	1919	only	-	May	25	2:00	1:00	D
-Rule	NT_YK	1919	only	-	Nov	 1	0:00	0	S
-Rule	NT_YK	1942	only	-	Feb	 9	2:00	1:00	W # War
-Rule	NT_YK	1945	only	-	Aug	14	23:00u	1:00	P # Peace
-Rule	NT_YK	1945	only	-	Sep	30	2:00	0	S
-Rule	NT_YK	1965	only	-	Apr	lastSun	0:00	2:00	DD
-Rule	NT_YK	1965	only	-	Oct	lastSun	2:00	0	S
-Rule	NT_YK	1980	1986	-	Apr	lastSun	2:00	1:00	D
-Rule	NT_YK	1980	2006	-	Oct	lastSun	2:00	0	S
-Rule	NT_YK	1987	2006	-	Apr	Sun>=1	2:00	1:00	D
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-# aka Panniqtuuq
-Zone America/Pangnirtung 0	-	zzz	1921 # trading post est.
-			-4:00	NT_YK	A%sT	1995 Apr Sun>=1 2:00
-			-5:00	Canada	E%sT	1999 Oct 31 2:00
-			-6:00	Canada	C%sT	2000 Oct 29 2:00
-			-5:00	Canada	E%sT
-# formerly Frobisher Bay
-Zone America/Iqaluit	0	-	zzz	1942 Aug # Frobisher Bay est.
-			-5:00	NT_YK	E%sT	1999 Oct 31 2:00
-			-6:00	Canada	C%sT	2000 Oct 29 2:00
-			-5:00	Canada	E%sT
-# aka Qausuittuq
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Resolute 2006	max	-	Nov	Sun>=1	2:00	0	ES
-Rule	Resolute 2007	max	-	Mar	Sun>=8	2:00	0	CD
-Zone America/Resolute	0	-	zzz	1947 Aug 31 # Resolute founded
-			-6:00	NT_YK	C%sT	2000 Oct 29 2:00
-			-5:00	-	EST	2001 Apr  1 3:00
-			-6:00	Canada	C%sT	2006 Oct 29 2:00
-			-5:00	Resolute	%sT
-# aka Kangiqiniq
-Zone America/Rankin_Inlet 0	-	zzz	1957 # Rankin Inlet founded
-			-6:00	NT_YK	C%sT	2000 Oct 29 2:00
-			-5:00	-	EST	2001 Apr  1 3:00
-			-6:00	Canada	C%sT
-# aka Iqaluktuuttiaq
-Zone America/Cambridge_Bay 0	-	zzz	1920 # trading post est.?
-			-7:00	NT_YK	M%sT	1999 Oct 31 2:00
-			-6:00	Canada	C%sT	2000 Oct 29 2:00
-			-5:00	-	EST	2000 Nov  5 0:00
-			-6:00	-	CST	2001 Apr  1 3:00
-			-7:00	Canada	M%sT
-Zone America/Yellowknife 0	-	zzz	1935 # Yellowknife founded?
-			-7:00	NT_YK	M%sT	1980
-			-7:00	Canada	M%sT
-Zone America/Inuvik	0	-	zzz	1953 # Inuvik founded
-			-8:00	NT_YK	P%sT	1979 Apr lastSun 2:00
-			-7:00	NT_YK	M%sT	1980
-			-7:00	Canada	M%sT
-Zone America/Whitehorse	-9:00:12 -	LMT	1900 Aug 20
-			-9:00	NT_YK	Y%sT	1966 Jul 1 2:00
-			-8:00	NT_YK	P%sT	1980
-			-8:00	Canada	P%sT
-Zone America/Dawson	-9:17:40 -	LMT	1900 Aug 20
-			-9:00	NT_YK	Y%sT	1973 Oct 28 0:00
-			-8:00	NT_YK	P%sT	1980
-			-8:00	Canada	P%sT
-
-
-###############################################################################
-
-# Mexico
-
-# From Paul Eggert (2001-03-05):
-# The Investigation and Analysis Service of the
-# Mexican Library of Congress (MLoC) has published a
-# <a href="http://www.cddhcu.gob.mx/bibliot/publica/inveyana/polisoc/horver/">
-# history of Mexican local time (in Spanish)
-# </a>.
-#
-# Here are the discrepancies between Shanks & Pottenger (S&P) and the MLoC.
-# (In all cases we go with the MLoC.)
-# S&P report that Baja was at -8:00 in 1922/1923.
-# S&P say the 1930 transition in Baja was 1930-11-16.
-# S&P report no DST during summer 1931.
-# S&P report a transition at 1932-03-30 23:00, not 1932-04-01.
-
-# From Gwillim Law (2001-02-20):
-# There are some other discrepancies between the Decrees page and the
-# tz database.  I think they can best be explained by supposing that
-# the researchers who prepared the Decrees page failed to find some of
-# the relevant documents.
-
-# From Alan Perry (1996-02-15):
-# A guy from our Mexico subsidiary finally found the Presidential Decree
-# outlining the timezone changes in Mexico.
-#
-# ------------- Begin Forwarded Message -------------
-#
-# I finally got my hands on the Official Presidential Decree that sets up the
-# rules for the DST changes. The rules are:
-#
-# 1. The country is divided in 3 timezones:
-#    - Baja California Norte (the Mexico/BajaNorte TZ)
-#    - Baja California Sur, Nayarit, Sinaloa and Sonora (the Mexico/BajaSur TZ)
-#    - The rest of the country (the Mexico/General TZ)
-#
-# 2. From the first Sunday in April at 2:00 AM to the last Sunday in October
-#    at 2:00 AM, the times in each zone are as follows:
-#    BajaNorte: GMT+7
-#    BajaSur:   GMT+6
-#    General:   GMT+5
-#
-# 3. The rest of the year, the times are as follows:
-#    BajaNorte: GMT+8
-#    BajaSur:   GMT+7
-#    General:   GMT+6
-#
-# The Decree was published in Mexico's Official Newspaper on January 4th.
-#
-# -------------- End Forwarded Message --------------
-# From Paul Eggert (1996-06-12):
-# For an English translation of the decree, see
-# <a href="http://mexico-travel.com/extra/timezone_eng.html">
-# ``Diario Oficial: Time Zone Changeover'' (1996-01-04).
-# </a>
-
-# From Rives McDow (1998-10-08):
-# The State of Quintana Roo has reverted back to central STD and DST times
-# (i.e. UTC -0600 and -0500 as of 1998-08-02).
-
-# From Rives McDow (2000-01-10):
-# Effective April 4, 1999 at 2:00 AM local time, Sonora changed to the time
-# zone 5 hours from the International Date Line, and will not observe daylight
-# savings time so as to stay on the same time zone as the southern part of
-# Arizona year round.
-
-# From Jesper Norgaard, translating
-# <http://www.reforma.com/nacional/articulo/064327/> (2001-01-17):
-# In Oaxaca, the 55.000 teachers from the Section 22 of the National
-# Syndicate of Education Workers, refuse to apply daylight saving each
-# year, so that the more than 10,000 schools work at normal hour the
-# whole year.
-
-# From Gwillim Law (2001-01-19):
-# <http://www.reforma.com/negocios_y_dinero/articulo/064481/> ... says
-# (translated):...
-# January 17, 2000 - The Energy Secretary, Ernesto Martens, announced
-# that Summer Time will be reduced from seven to five months, starting
-# this year....
-# <http://www.publico.com.mx/scripts/texto3.asp?action=pagina&pag=21&pos=p&secc=naci&date=01/17/2001>
-# [translated], says "summer time will ... take effect on the first Sunday
-# in May, and end on the last Sunday of September.
-
-# From Arthur David Olson (2001-01-25):
-# The 2001-01-24 traditional Washington Post contained the page one
-# story "Timely Issue Divides Mexicans."...
-# http://www.washingtonpost.com/wp-dyn/articles/A37383-2001Jan23.html
-# ... Mexico City Mayor Lopez Obrador "...is threatening to keep
-# Mexico City and its 20 million residents on a different time than
-# the rest of the country..." In particular, Lopez Obrador would abolish
-# observation of Daylight Saving Time.
-
-# <a href="http://www.conae.gob.mx/ahorro/decretohorver2001.html#decre">
-# Official statute published by the Energy Department
-# </a> (2001-02-01) shows Baja and Chihauhua as still using US DST rules,
-# and Sonora with no DST.  This was reported by Jesper Norgaard (2001-02-03).
-
-# From Paul Eggert (2001-03-03):
-#
-# <a href="http://www.latimes.com/news/nation/20010303/t000018766.html">
-# James F. Smith writes in today's LA Times
-# </a>
-# * Sonora will continue to observe standard time.
-# * Last week Mexico City's mayor Andres Manuel Lopez Obrador decreed that
-#   the Federal District will not adopt DST.
-# * 4 of 16 district leaders announced they'll ignore the decree.
-# * The decree does not affect federal-controlled facilities including
-#   the airport, banks, hospitals, and schools.
-#
-# For now we'll assume that the Federal District will bow to federal rules.
-
-# From Jesper Norgaard (2001-04-01):
-# I found some references to the Mexican application of daylight
-# saving, which modifies what I had already sent you, stating earlier
-# that a number of northern Mexican states would go on daylight
-# saving. The modification reverts this to only cover Baja California
-# (Norte), while all other states (except Sonora, who has no daylight
-# saving all year) will follow the original decree of president
-# Vicente Fox, starting daylight saving May 6, 2001 and ending
-# September 30, 2001.
-# References: "Diario de Monterrey" <www.diariodemonterrey.com/index.asp>
-# Palabra <http://palabra.infosel.com/010331/primera/ppri3101.pdf> (2001-03-31)
-
-# From Reuters (2001-09-04):
-# Mexico's Supreme Court on Tuesday declared that daylight savings was
-# unconstitutional in Mexico City, creating the possibility the
-# capital will be in a different time zone from the rest of the nation
-# next year....  The Supreme Court's ruling takes effect at 2:00
-# a.m. (0800 GMT) on Sept. 30, when Mexico is scheduled to revert to
-# standard time. "This is so residents of the Federal District are not
-# subject to unexpected time changes," a statement from the court said.
-
-# From Jesper Norgaard Welen (2002-03-12):
-# ... consulting my local grocery store(!) and my coworkers, they all insisted
-# that a new decision had been made to reinstate US style DST in Mexico....
-# http://www.conae.gob.mx/ahorro/horaver2001_m1_2002.html (2002-02-20)
-# confirms this.  Sonora as usual is the only state where DST is not applied.
-
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Mexico	1939	only	-	Feb	5	0:00	1:00	D
-Rule	Mexico	1939	only	-	Jun	25	0:00	0	S
-Rule	Mexico	1940	only	-	Dec	9	0:00	1:00	D
-Rule	Mexico	1941	only	-	Apr	1	0:00	0	S
-Rule	Mexico	1943	only	-	Dec	16	0:00	1:00	W # War
-Rule	Mexico	1944	only	-	May	1	0:00	0	S
-Rule	Mexico	1950	only	-	Feb	12	0:00	1:00	D
-Rule	Mexico	1950	only	-	Jul	30	0:00	0	S
-Rule	Mexico	1996	2000	-	Apr	Sun>=1	2:00	1:00	D
-Rule	Mexico	1996	2000	-	Oct	lastSun	2:00	0	S
-Rule	Mexico	2001	only	-	May	Sun>=1	2:00	1:00	D
-Rule	Mexico	2001	only	-	Sep	lastSun	2:00	0	S
-Rule	Mexico	2002	max	-	Apr	Sun>=1	2:00	1:00	D
-Rule	Mexico	2002	max	-	Oct	lastSun	2:00	0	S
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-# Quintana Roo
-Zone America/Cancun	-5:47:04 -	LMT	1922 Jan  1  0:12:56
-			-6:00	-	CST	1981 Dec 23
-			-5:00	Mexico	E%sT	1998 Aug  2  2:00
-			-6:00	Mexico	C%sT
-# Campeche, Yucatan
-Zone America/Merida	-5:58:28 -	LMT	1922 Jan  1  0:01:32
-			-6:00	-	CST	1981 Dec 23
-			-5:00	-	EST	1982 Dec  2
-			-6:00	Mexico	C%sT
-# Coahuila, Durango, Nuevo Leon, Tamaulipas
-Zone America/Monterrey	-6:41:16 -	LMT	1921 Dec 31 23:18:44
-			-6:00	-	CST	1988
-			-6:00	US	C%sT	1989
-			-6:00	Mexico	C%sT
-# Central Mexico
-Zone America/Mexico_City -6:36:36 -	LMT	1922 Jan  1  0:23:24
-			-7:00	-	MST	1927 Jun 10 23:00
-			-6:00	-	CST	1930 Nov 15
-			-7:00	-	MST	1931 May  1 23:00
-			-6:00	-	CST	1931 Oct
-			-7:00	-	MST	1932 Apr  1
-			-6:00	Mexico	C%sT	2001 Sep 30 02:00
-			-6:00	-	CST	2002 Feb 20
-			-6:00	Mexico	C%sT
-# Chihuahua
-Zone America/Chihuahua	-7:04:20 -	LMT	1921 Dec 31 23:55:40
-			-7:00	-	MST	1927 Jun 10 23:00
-			-6:00	-	CST	1930 Nov 15
-			-7:00	-	MST	1931 May  1 23:00
-			-6:00	-	CST	1931 Oct
-			-7:00	-	MST	1932 Apr  1
-			-6:00	-	CST	1996
-			-6:00	Mexico	C%sT	1998
-			-6:00	-	CST	1998 Apr Sun>=1 3:00
-			-7:00	Mexico	M%sT
-# Sonora
-Zone America/Hermosillo	-7:23:52 -	LMT	1921 Dec 31 23:36:08
-			-7:00	-	MST	1927 Jun 10 23:00
-			-6:00	-	CST	1930 Nov 15
-			-7:00	-	MST	1931 May  1 23:00
-			-6:00	-	CST	1931 Oct
-			-7:00	-	MST	1932 Apr  1
-			-6:00	-	CST	1942 Apr 24
-			-7:00	-	MST	1949 Jan 14
-			-8:00	-	PST	1970
-			-7:00	Mexico	M%sT	1999
-			-7:00	-	MST
-# Baja California Sur, Nayarit, Sinaloa
-Zone America/Mazatlan	-7:05:40 -	LMT	1921 Dec 31 23:54:20
-			-7:00	-	MST	1927 Jun 10 23:00
-			-6:00	-	CST	1930 Nov 15
-			-7:00	-	MST	1931 May  1 23:00
-			-6:00	-	CST	1931 Oct
-			-7:00	-	MST	1932 Apr  1
-			-6:00	-	CST	1942 Apr 24
-			-7:00	-	MST	1949 Jan 14
-			-8:00	-	PST	1970
-			-7:00	Mexico	M%sT
-# Baja California
-Zone America/Tijuana	-7:48:04 -	LMT	1922 Jan  1  0:11:56
-			-7:00	-	MST	1924
-			-8:00	-	PST	1927 Jun 10 23:00
-			-7:00	-	MST	1930 Nov 15
-			-8:00	-	PST	1931 Apr  1
-			-8:00	1:00	PDT	1931 Sep 30
-			-8:00	-	PST	1942 Apr 24
-			-8:00	1:00	PWT	1945 Aug 14 23:00u
-			-8:00	1:00	PPT	1945 Nov 12 # Peace
-			-8:00	-	PST	1948 Apr  5
-			-8:00	1:00	PDT	1949 Jan 14
-			-8:00	-	PST	1954
-			-8:00	CA	P%sT	1961
-			-8:00	-	PST	1976
-			-8:00	US	P%sT	1996
-			-8:00	Mexico	P%sT	2001
-			-8:00	US	P%sT	2002 Feb 20
-			-8:00	Mexico	P%sT
-# From Paul Eggert (2006-03-22):
-# Formerly there was an America/Ensenada zone, which differed from
-# America/Tijuana only in that it did not observe DST from 1976
-# through 1995.  This was as per Shanks (1999).  But Shanks & Pottenger say
-# Ensenada did not observe DST from 1948 through 1975.  Guy Harris reports
-# that the 1987 OAG says "Only Ensenada, Mexicale, San Felipe and
-# Tijuana observe DST," which agrees with Shanks & Pottenger but implies that
-# DST-observance was a town-by-town matter back then.  This concerns
-# data after 1970 so most likely there should be at least one Zone
-# other than America/Tijuana for Baja, but it's not clear yet what its
-# name or contents should be.
-#
-# Revillagigedo Is
-# no information
-
-###############################################################################
-
-# Anguilla
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone America/Anguilla	-4:12:16 -	LMT	1912 Mar 2
-			-4:00	-	AST
-
-# Antigua and Barbuda
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	America/Antigua	-4:07:12 -	LMT	1912 Mar 2
-			-5:00	-	EST	1951
-			-4:00	-	AST
-
-# Bahamas
-#
-# From Sue Williams (2006-12-07):
-# The Bahamas announced about a month ago that they plan to change their DST
-# rules to sync with the U.S. starting in 2007....
-# http://www.jonesbahamas.com/?c=45&a=10412
-
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Bahamas	1964	1975	-	Oct	lastSun	2:00	0	S
-Rule	Bahamas	1964	1975	-	Apr	lastSun	2:00	1:00	D
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	America/Nassau	-5:09:24 -	LMT	1912 Mar 2
-			-5:00	Bahamas	E%sT	1976
-			-5:00	US	E%sT
-
-# Barbados
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Barb	1977	only	-	Jun	12	2:00	1:00	D
-Rule	Barb	1977	1978	-	Oct	Sun>=1	2:00	0	S
-Rule	Barb	1978	1980	-	Apr	Sun>=15	2:00	1:00	D
-Rule	Barb	1979	only	-	Sep	30	2:00	0	S
-Rule	Barb	1980	only	-	Sep	25	2:00	0	S
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone America/Barbados	-3:58:28 -	LMT	1924		# Bridgetown
-			-3:58:28 -	BMT	1932	  # Bridgetown Mean Time
-			-4:00	Barb	A%sT
-
-# Belize
-# Whitman entirely disagrees with Shanks; go with Shanks & Pottenger.
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Belize	1918	1942	-	Oct	Sun>=2	0:00	0:30	HD
-Rule	Belize	1919	1943	-	Feb	Sun>=9	0:00	0	S
-Rule	Belize	1973	only	-	Dec	 5	0:00	1:00	D
-Rule	Belize	1974	only	-	Feb	 9	0:00	0	S
-Rule	Belize	1982	only	-	Dec	18	0:00	1:00	D
-Rule	Belize	1983	only	-	Feb	12	0:00	0	S
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	America/Belize	-5:52:48 -	LMT	1912 Apr
-			-6:00	Belize	C%sT
-
-# Bermuda
-
-# From Dan Jones, reporting in The Royal Gazette (2006-06-26):
-
-# Next year, however, clocks in the US will go forward on the second Sunday
-# in March, until the first Sunday in November.  And, after the Time Zone
-# (Seasonal Variation) Bill 2006 was passed in the House of Assembly on
-# Friday, the same thing will happen in Bermuda.
-# http://www.theroyalgazette.com/apps/pbcs.dll/article?AID=/20060529/NEWS/105290135
-
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone Atlantic/Bermuda	-4:19:04 -	LMT	1930 Jan  1 2:00    # Hamilton
-			-4:00	-	AST	1974 Apr 28 2:00
-			-4:00	Bahamas	A%sT	1976
-			-4:00	US	A%sT
-
-# Cayman Is
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	America/Cayman	-5:25:32 -	LMT	1890		# Georgetown
-			-5:07:12 -	KMT	1912 Feb    # Kingston Mean Time
-			-5:00	-	EST
-
-# Costa Rica
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	CR	1979	1980	-	Feb	lastSun	0:00	1:00	D
-Rule	CR	1979	1980	-	Jun	Sun>=1	0:00	0	S
-Rule	CR	1991	1992	-	Jan	Sat>=15	0:00	1:00	D
-# IATA SSIM (1991-09) says the following was at 1:00;
-# go with Shanks & Pottenger.
-Rule	CR	1991	only	-	Jul	 1	0:00	0	S
-Rule	CR	1992	only	-	Mar	15	0:00	0	S
-# There are too many San Joses elsewhere, so we'll use `Costa Rica'.
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone America/Costa_Rica	-5:36:20 -	LMT	1890		# San Jose
-			-5:36:20 -	SJMT	1921 Jan 15 # San Jose Mean Time
-			-6:00	CR	C%sT
-# Coco
-# no information; probably like America/Costa_Rica
-
-# Cuba
-
-# From Arthur David Olson (1999-03-29):
-# The 1999-03-28 exhibition baseball game held in Havana, Cuba, between
-# the Cuban National Team and the Baltimore Orioles was carried live on
-# the Orioles Radio Network, including affiliate WTOP in Washington, DC.
-# During the game, play-by-play announcer Jim Hunter noted that
-# "We'll be losing two hours of sleep...Cuba switched to Daylight Saving
-# Time today."  (The "two hour" remark referred to losing one hour of
-# sleep on 1999-03-28--when the announcers were in Cuba as it switched
-# to DST--and one more hour on 1999-04-04--when the announcers will have
-# returned to Baltimore, which switches on that date.)
-
-# From Evert van der Veer via Steffen Thorsen (2004-10-28):
-# Cuba is not going back to standard time this year.
-# From Paul Eggert (2006-03-22):
-# http://www.granma.cu/ingles/2004/septiembre/juev30/41medid-i.html
-# says that it's due to a problem at the Antonio Guiteras
-# thermoelectric plant, and says "This October there will be no return
-# to normal hours (after daylight saving time)".
-# For now, let's assume that it's a temporary measure.
-
-# From Carlos A. Carnero Delgado (2005-11-12):
-# This year (just like in 2004-2005) there's no change in time zone
-# adjustment in Cuba.  We will stay in daylight saving time:
-# http://www.granma.cu/espanol/2005/noviembre/mier9/horario.html
-
-# From Jesper Norgaard Welen (2006-10-21):
-# An article in GRANMA INTERNACIONAL claims that Cuba will end
-# the 3 years of permanent DST next weekend, see
-# http://www.granma.cu/ingles/2006/octubre/lun16/43horario.html
-# "On Saturday night, October 28 going into Sunday, October 29, at 01:00,
-# watches should be set back one hour -- going back to 00:00 hours -- returning
-# to the normal schedule....
-
-# From Paul Eggert (2007-03-02):
-# http://www.granma.cubaweb.cu/english/news/art89.html, dated yesterday,
-# says Cuban clocks will advance at midnight on March 10.
-# For lack of better information, assume Cuba will use US rules,
-# except that it switches at midnight standard time as usual.
-#
-# From Steffen Thorsen (2007-10-25):
-# Carlos Alberto Fonseca Arauz informed me that Cuba will end DST one week 
-# earlier - on the last Sunday of October, just like in 2006.
-# 
-# He supplied these references:
-# 
-# http://www.prensalatina.com.mx/article.asp?ID=%7B4CC32C1B-A9F7-42FB-8A07-8631AFC923AF%7D&language=ES
-# http://actualidad.terra.es/sociedad/articulo/cuba_llama_ahorrar_energia_cambio_1957044.htm
-# 
-# From Alex Kryvenishev (2007-10-25):
-# Here is also article from Granma (Cuba):
-# 
-# [Regira] el Horario Normal desde el [proximo] domingo 28 de octubre
-# http://www.granma.cubaweb.cu/2007/10/24/nacional/artic07.html
-# 
-# http://www.worldtimezone.com/dst_news/dst_news_cuba03.html
-
-# From Arthur David Olson (2008-03-09):
-# I'm in Maryland which is now observing United States Eastern Daylight
-# Time. At 9:44 local time I used RealPlayer to listen to
-# <a href="http://media.enet.cu/radioreloj">
-# http://media.enet.cu/radioreloj
-# </a>, a Cuban information station, and heard
-# the time announced as "ocho cuarenta y cuatro" ("eight forty-four"),
-# indicating that Cuba is still on standard time.
-
-# From Steffen Thorsen (2008-03-12):
-# It seems that Cuba will start DST on Sunday, 2007-03-16...
-# It was announced yesterday, according to this source (in Spanish):
-# <a href="http://www.nnc.cubaweb.cu/marzo-2008/cien-1-11-3-08.htm">
-# http://www.nnc.cubaweb.cu/marzo-2008/cien-1-11-3-08.htm
-# </a>
-#
-# Some more background information is posted here:
-# <a href="http://www.timeanddate.com/news/time/cuba-starts-dst-march-16.html">
-# http://www.timeanddate.com/news/time/cuba-starts-dst-march-16.html
-# </a>
-#
-# The article also says that Cuba has been observing DST since 1963,
-# while Shanks (and tzdata) has 1965 as the first date (except in the
-# 1940's). Many other web pages in Cuba also claim that it has been
-# observed since 1963, but with the exception of 1970 - an exception
-# which is not present in tzdata/Shanks. So there is a chance we need to
-# change some historic records as well.
-#
-# One example:
-# <a href="http://www.radiohc.cu/espanol/noticias/mar07/11mar/hor.htm">
-# http://www.radiohc.cu/espanol/noticias/mar07/11mar/hor.htm
-# </a>
-
-# From Jesper Norgaard Welen (2008-03-13):
-# The Cuban time change has just been confirmed on the most authoritative
-# web site, the Granma.  Please check out
-# <a href="http://www.granma.cubaweb.cu/2008/03/13/nacional/artic10.html">
-# http://www.granma.cubaweb.cu/2008/03/13/nacional/artic10.html
-# </a>
-#
-# Basically as expected after Steffen Thorsens information, the change
-# will take place midnight between Saturday and Sunday.
-
-# From Arthur David Olson (2008-03-12):
-# Assume Sun>=15 (third Sunday) going forward.
-
-# From Alexander Krivenyshev (2009-03-04)
-# According to the Radio Reloj - Cuba will start Daylight Saving Time on
-# midnight between Saturday, March 07, 2009 and Sunday, March 08, 2009-
-# not on midnight March 14 / March 15 as previously thought.
-#
-# <a href="http://www.worldtimezone.com/dst_news/dst_news_cuba05.html">
-# http://www.worldtimezone.com/dst_news/dst_news_cuba05.html
-# (in Spanish)
-# </a>
-
-# From Arthur David Olson (2009-03-09)
-# I listened over the Internet to
-# <a href="http://media.enet.cu/readioreloj">
-# http://media.enet.cu/readioreloj
-# </a>
-# this morning; when it was 10:05 a. m. here in Bethesda, Maryland the
-# the time was announced as "diez cinco"--the same time as here, indicating
-# that has indeed switched to DST. Assume second Sunday from 2009 forward.
-
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Cuba	1928	only	-	Jun	10	0:00	1:00	D
-Rule	Cuba	1928	only	-	Oct	10	0:00	0	S
-Rule	Cuba	1940	1942	-	Jun	Sun>=1	0:00	1:00	D
-Rule	Cuba	1940	1942	-	Sep	Sun>=1	0:00	0	S
-Rule	Cuba	1945	1946	-	Jun	Sun>=1	0:00	1:00	D
-Rule	Cuba	1945	1946	-	Sep	Sun>=1	0:00	0	S
-Rule	Cuba	1965	only	-	Jun	1	0:00	1:00	D
-Rule	Cuba	1965	only	-	Sep	30	0:00	0	S
-Rule	Cuba	1966	only	-	May	29	0:00	1:00	D
-Rule	Cuba	1966	only	-	Oct	2	0:00	0	S
-Rule	Cuba	1967	only	-	Apr	8	0:00	1:00	D
-Rule	Cuba	1967	1968	-	Sep	Sun>=8	0:00	0	S
-Rule	Cuba	1968	only	-	Apr	14	0:00	1:00	D
-Rule	Cuba	1969	1977	-	Apr	lastSun	0:00	1:00	D
-Rule	Cuba	1969	1971	-	Oct	lastSun	0:00	0	S
-Rule	Cuba	1972	1974	-	Oct	8	0:00	0	S
-Rule	Cuba	1975	1977	-	Oct	lastSun	0:00	0	S
-Rule	Cuba	1978	only	-	May	7	0:00	1:00	D
-Rule	Cuba	1978	1990	-	Oct	Sun>=8	0:00	0	S
-Rule	Cuba	1979	1980	-	Mar	Sun>=15	0:00	1:00	D
-Rule	Cuba	1981	1985	-	May	Sun>=5	0:00	1:00	D
-Rule	Cuba	1986	1989	-	Mar	Sun>=14	0:00	1:00	D
-Rule	Cuba	1990	1997	-	Apr	Sun>=1	0:00	1:00	D
-Rule	Cuba	1991	1995	-	Oct	Sun>=8	0:00s	0	S
-Rule	Cuba	1996	only	-	Oct	 6	0:00s	0	S
-Rule	Cuba	1997	only	-	Oct	12	0:00s	0	S
-Rule	Cuba	1998	1999	-	Mar	lastSun	0:00s	1:00	D
-Rule	Cuba	1998	2003	-	Oct	lastSun	0:00s	0	S
-Rule	Cuba	2000	2004	-	Apr	Sun>=1	0:00s	1:00	D
-Rule	Cuba	2006	max	-	Oct	lastSun	0:00s	0	S
-Rule	Cuba	2007	only	-	Mar	Sun>=8	0:00s	1:00	D
-Rule	Cuba	2008	only	-	Mar	Sun>=15	0:00s	1:00	D
-Rule	Cuba	2009	max	-	Mar	Sun>=8	0:00s	1:00	D
-
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	America/Havana	-5:29:28 -	LMT	1890
-			-5:29:36 -	HMT	1925 Jul 19 12:00 # Havana MT
-			-5:00	Cuba	C%sT
-
-# Dominica
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone America/Dominica	-4:05:36 -	LMT	1911 Jul 1 0:01		# Roseau
-			-4:00	-	AST
-
-# Dominican Republic
-
-# From Steffen Thorsen (2000-10-30):
-# Enrique Morales reported to me that the Dominican Republic has changed the
-# time zone to Eastern Standard Time as of Sunday 29 at 2 am....
-# http://www.listin.com.do/antes/261000/republica/princi.html
-
-# From Paul Eggert (2000-12-04):
-# That URL (2000-10-26, in Spanish) says they planned to use US-style DST.
-
-# From Rives McDow (2000-12-01):
-# Dominican Republic changed its mind and presidential decree on Tuesday,
-# November 28, 2000, with a new decree.  On Sunday, December 3 at 1:00 AM the
-# Dominican Republic will be reverting to 8 hours from the International Date
-# Line, and will not be using DST in the foreseeable future.  The reason they
-# decided to use DST was to be in synch with Puerto Rico, who was also going
-# to implement DST.  When Puerto Rico didn't implement DST, the president
-# decided to revert.
-
-
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	DR	1966	only	-	Oct	30	0:00	1:00	D
-Rule	DR	1967	only	-	Feb	28	0:00	0	S
-Rule	DR	1969	1973	-	Oct	lastSun	0:00	0:30	HD
-Rule	DR	1970	only	-	Feb	21	0:00	0	S
-Rule	DR	1971	only	-	Jan	20	0:00	0	S
-Rule	DR	1972	1974	-	Jan	21	0:00	0	S
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone America/Santo_Domingo -4:39:36 -	LMT	1890
-			-4:40	-	SDMT	1933 Apr  1 12:00 # S. Dom. MT
-			-5:00	DR	E%sT	1974 Oct 27
-			-4:00	-	AST	2000 Oct 29 02:00
-			-5:00	US	E%sT	2000 Dec  3 01:00
-			-4:00	-	AST
-
-# El Salvador
-
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Salv	1987	1988	-	May	Sun>=1	0:00	1:00	D
-Rule	Salv	1987	1988	-	Sep	lastSun	0:00	0	S
-# There are too many San Salvadors elsewhere, so use America/El_Salvador
-# instead of America/San_Salvador.
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone America/El_Salvador -5:56:48 -	LMT	1921		# San Salvador
-			-6:00	Salv	C%sT
-
-# Grenada
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	America/Grenada	-4:07:00 -	LMT	1911 Jul	# St George's
-			-4:00	-	AST
-
-# Guadeloupe
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone America/Guadeloupe	-4:06:08 -	LMT	1911 Jun 8	# Pointe a Pitre
-			-4:00	-	AST
-# St Barthelemy
-Link America/Guadeloupe	America/St_Barthelemy
-# St Martin (French part)
-Link America/Guadeloupe	America/Marigot
-
-# Guatemala
-#
-# From Gwillim Law (2006-04-22), after a heads-up from Oscar van Vlijmen:
-# Diario Co Latino, at
-# http://www.diariocolatino.com/internacionales/detalles.asp?NewsID=8079,
-# says in an article dated 2006-04-19 that the Guatemalan government had
-# decided on that date to advance official time by 60 minutes, to lessen the
-# impact of the elevated cost of oil....  Daylight saving time will last from
-# 2006-04-29 24:00 (Guatemalan standard time) to 2006-09-30 (time unspecified).
-# From Paul Eggert (2006-06-22):
-# The Ministry of Energy and Mines, press release CP-15/2006
-# (2006-04-19), says DST ends at 24:00.  See
-# <http://www.sieca.org.gt/Sitio_publico/Energeticos/Doc/Medidas/Cambio_Horario_Nac_190406.pdf>.
-
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Guat	1973	only	-	Nov	25	0:00	1:00	D
-Rule	Guat	1974	only	-	Feb	24	0:00	0	S
-Rule	Guat	1983	only	-	May	21	0:00	1:00	D
-Rule	Guat	1983	only	-	Sep	22	0:00	0	S
-Rule	Guat	1991	only	-	Mar	23	0:00	1:00	D
-Rule	Guat	1991	only	-	Sep	 7	0:00	0	S
-Rule	Guat	2006	only	-	Apr	30	0:00	1:00	D
-Rule	Guat	2006	only	-	Oct	 1	0:00	0	S
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone America/Guatemala	-6:02:04 -	LMT	1918 Oct 5
-			-6:00	Guat	C%sT
-
-# Haiti
-# From Gwillim Law (2005-04-15):
-# Risto O. Nykanen wrote me that Haiti is now on DST.
-# I searched for confirmation, and I found a
-# <a href="http://www.haitianconsulate.org/time.doc"> press release
-# on the Web page of the Haitian Consulate in Chicago (2005-03-31),
-# </a>.  Translated from French, it says:
-#
-#  "The Prime Minister's Communication Office notifies the public in general
-#   and the press in particular that, following a decision of the Interior
-#   Ministry and the Territorial Collectivities [I suppose that means the
-#   provinces], Haiti will move to Eastern Daylight Time in the night from next
-#   Saturday the 2nd to Sunday the 3rd.
-#
-#  "Consequently, the Prime Minister's Communication Office wishes to inform
-#   the population that the country's clocks will be set forward one hour
-#   starting at midnight.  This provision will hold until the last Saturday in
-#   October 2005.
-#
-#  "Port-au-Prince, March 31, 2005"
-#
-# From Steffen Thorsen (2006-04-04):
-# I have been informed by users that Haiti observes DST this year like
-# last year, so the current "only" rule for 2005 might be changed to a
-# "max" rule or to last until 2006. (Who knows if they will observe DST
-# next year or if they will extend their DST like US/Canada next year).
-#
-# I have found this article about it (in French):
-# http://www.haitipressnetwork.com/news.cfm?articleID=7612
-#
-# The reason seems to be an energy crisis.
-
-# From Stephen Colebourne (2007-02-22):
-# Some IATA info: Haiti won't be having DST in 2007.
-
-
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Haiti	1983	only	-	May	8	0:00	1:00	D
-Rule	Haiti	1984	1987	-	Apr	lastSun	0:00	1:00	D
-Rule	Haiti	1983	1987	-	Oct	lastSun	0:00	0	S
-# Shanks & Pottenger say AT is 2:00, but IATA SSIM (1991/1997) says 1:00s.
-# Go with IATA.
-Rule	Haiti	1988	1997	-	Apr	Sun>=1	1:00s	1:00	D
-Rule	Haiti	1988	1997	-	Oct	lastSun	1:00s	0	S
-Rule	Haiti	2005	2006	-	Apr	Sun>=1	0:00	1:00	D
-Rule	Haiti	2005	2006	-	Oct	lastSun	0:00	0	S
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone America/Port-au-Prince -4:49:20 -	LMT	1890
-			-4:49	-	PPMT	1917 Jan 24 12:00 # P-a-P MT
-			-5:00	Haiti	E%sT
-
-# Honduras
-# Shanks & Pottenger say 1921 Jan 1; go with Whitman's more precise Apr 1.
-
-# From Paul Eggert (2006-05-05):
-# worldtimezone.com reports a 2006-05-02 Spanish-language AP article
-# saying Honduras will start using DST midnight Saturday, effective 4
-# months until September.  La Tribuna reported today
-# <http://www.latribuna.hn/99299.html> that Manuel Zelaya, the president
-# of Honduras, refused to back down on this.
-
-# From Jesper Norgaard Welen (2006-08-08):
-# It seems that Honduras has returned from DST to standard time this Monday at
-# 00:00 hours (prolonging Sunday to 25 hours duration).
-# http://www.worldtimezone.com/dst_news/dst_news_honduras04.html
-
-# From Paul Eggert (2006-08-08):
-# Also see Diario El Heraldo, The country returns to standard time (2006-08-08)
-# <http://www.elheraldo.hn/nota.php?nid=54941&sec=12>.
-# It mentions executive decree 18-2006.
-
-# From Steffen Thorsen (2006-08-17):
-# Honduras will observe DST from 2007 to 2009, exact dates are not
-# published, I have located this authoritative source:
-# http://www.presidencia.gob.hn/noticia.aspx?nId=47
-
-# From Steffen Thorsen (2007-03-30):
-# http://www.laprensahn.com/pais_nota.php?id04962=7386
-# So it seems that Honduras will not enter DST this year....
-
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Hond	1987	1988	-	May	Sun>=1	0:00	1:00	D
-Rule	Hond	1987	1988	-	Sep	lastSun	0:00	0	S
-Rule	Hond	2006	only	-	May	Sun>=1	0:00	1:00	D
-Rule	Hond	2006	only	-	Aug	Mon>=1	0:00	0	S
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone America/Tegucigalpa -5:48:52 -	LMT	1921 Apr
-			-6:00	Hond	C%sT
-#
-# Great Swan I ceded by US to Honduras in 1972
-
-# Jamaica
-
-# From Bob Devine (1988-01-28):
-# Follows US rules.
-
-# From U. S. Naval Observatory (1989-01-19):
-# JAMAICA             5 H  BEHIND UTC
-
-# From Shanks & Pottenger:
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	America/Jamaica	-5:07:12 -	LMT	1890		# Kingston
-			-5:07:12 -	KMT	1912 Feb    # Kingston Mean Time
-			-5:00	-	EST	1974 Apr 28 2:00
-			-5:00	US	E%sT	1984
-			-5:00	-	EST
-
-# Martinique
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone America/Martinique	-4:04:20 -      LMT	1890		# Fort-de-France
-			-4:04:20 -	FFMT	1911 May     # Fort-de-France MT
-			-4:00	-	AST	1980 Apr  6
-			-4:00	1:00	ADT	1980 Sep 28
-			-4:00	-	AST
-
-# Montserrat
-# From Paul Eggert (2006-03-22):
-# In 1995 volcanic eruptions forced evacuation of Plymouth, the capital.
-# world.gazetteer.com says Cork Hill is the most populous location now.
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone America/Montserrat	-4:08:52 -	LMT	1911 Jul 1 0:01   # Cork Hill
-			-4:00	-	AST
-
-# Nicaragua
-#
-# This uses Shanks & Pottenger for times before 2005.
-#
-# From Steffen Thorsen (2005-04-12):
-# I've got reports from 8 different people that Nicaragua just started
-# DST on Sunday 2005-04-10, in order to save energy because of
-# expensive petroleum.  The exact end date for DST is not yet
-# announced, only "September" but some sites also say "mid-September".
-# Some background information is available on the President's official site:
-# http://www.presidencia.gob.ni/Presidencia/Files_index/Secretaria/Notas%20de%20Prensa/Presidente/2005/ABRIL/Gobierno-de-nicaragua-adelanta-hora-oficial-06abril.htm
-# The Decree, no 23-2005 is available here:
-# http://www.presidencia.gob.ni/buscador_gaceta/BD/DECRETOS/2005/Decreto%2023-2005%20Se%20adelanta%20en%20una%20hora%20en%20todo%20el%20territorio%20nacional%20apartir%20de%20las%2024horas%20del%2009%20de%20Abril.pdf
-#
-# From Paul Eggert (2005-05-01):
-# The decree doesn't say anything about daylight saving, but for now let's
-# assume that it is daylight saving....
-#
-# From Gwillim Law (2005-04-21):
-# The Associated Press story on the time change, which can be found at
-# http://www.lapalmainteractivo.com/guias/content/gen/ap/America_Latina/AMC_GEN_NICARAGUA_HORA.html
-# and elsewhere, says (fifth paragraph, translated from Spanish):  "The last
-# time that a change of clocks was applied to save energy was in the year 2000
-# during the Arnoldo Aleman administration."...
-# The northamerica file says that Nicaragua has been on UTC-6 continuously
-# since December 1998.  I wasn't able to find any details of Nicaraguan time
-# changes in 2000.  Perhaps a note could be added to the northamerica file, to
-# the effect that we have indirect evidence that DST was observed in 2000.
-#
-# From Jesper Norgaard Welen (2005-11-02):
-# Nicaragua left DST the 2005-10-02 at 00:00 (local time).
-# http://www.presidencia.gob.ni/presidencia/files_index/secretaria/comunicados/2005/septiembre/26septiembre-cambio-hora.htm
-# (2005-09-26)
-#
-# From Jesper Norgaard Welen (2006-05-05):
-# http://www.elnuevodiario.com.ni/2006/05/01/nacionales/18410
-# (my informal translation)
-# By order of the president of the republic, Enrique Bolanos, Nicaragua
-# advanced by sixty minutes their official time, yesterday at 2 in the
-# morning, and will stay that way until 30.th. of september.
-#
-# From Jesper Norgaard Welen (2006-09-30):
-# http://www.presidencia.gob.ni/buscador_gaceta/BD/DECRETOS/2006/D-063-2006P-PRN-Cambio-Hora.pdf
-# My informal translation runs:
-# The natural sun time is restored in all the national territory, in that the
-# time is returned one hour at 01:00 am of October 1 of 2006.
-#
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Nic	1979	1980	-	Mar	Sun>=16	0:00	1:00	D
-Rule	Nic	1979	1980	-	Jun	Mon>=23	0:00	0	S
-Rule	Nic	2005	only	-	Apr	10	0:00	1:00	D
-Rule	Nic	2005	only	-	Oct	Sun>=1	0:00	0	S
-Rule	Nic	2006	only	-	Apr	30	2:00	1:00	D
-Rule	Nic	2006	only	-	Oct	Sun>=1	1:00	0	S
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	America/Managua	-5:45:08 -	LMT	1890
-			-5:45:12 -	MMT	1934 Jun 23 # Managua Mean Time?
-			-6:00	-	CST	1973 May
-			-5:00	-	EST	1975 Feb 16
-			-6:00	Nic	C%sT	1992 Jan  1 4:00
-			-5:00	-	EST	1992 Sep 24
-			-6:00	-	CST	1993
-			-5:00	-	EST	1997
-			-6:00	Nic	C%sT
-
-# Panama
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	America/Panama	-5:18:08 -	LMT	1890
-			-5:19:36 -	CMT	1908 Apr 22   # Colon Mean Time
-			-5:00	-	EST
-
-# Puerto Rico
-# There are too many San Juans elsewhere, so we'll use `Puerto_Rico'.
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone America/Puerto_Rico -4:24:25 -	LMT	1899 Mar 28 12:00    # San Juan
-			-4:00	-	AST	1942 May  3
-			-4:00	US	A%sT	1946
-			-4:00	-	AST
-
-# St Kitts-Nevis
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone America/St_Kitts	-4:10:52 -	LMT	1912 Mar 2	# Basseterre
-			-4:00	-	AST
-
-# St Lucia
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone America/St_Lucia	-4:04:00 -	LMT	1890		# Castries
-			-4:04:00 -	CMT	1912	    # Castries Mean Time
-			-4:00	-	AST
-
-# St Pierre and Miquelon
-# There are too many St Pierres elsewhere, so we'll use `Miquelon'.
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone America/Miquelon	-3:44:40 -	LMT	1911 May 15	# St Pierre
-			-4:00	-	AST	1980 May
-			-3:00	-	PMST	1987 # Pierre & Miquelon Time
-			-3:00	Canada	PM%sT
-
-# St Vincent and the Grenadines
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone America/St_Vincent	-4:04:56 -	LMT	1890		# Kingstown
-			-4:04:56 -	KMT	1912	   # Kingstown Mean Time
-			-4:00	-	AST
-
-# Turks and Caicos
-#
-# From Chris Dunn in
-# <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=415007>
-# (2007-03-15): In the Turks & Caicos Islands (America/Grand_Turk) the
-# daylight saving dates for time changes have been adjusted to match
-# the recent U.S. change of dates.
-#
-# From Brian Inglis (2007-04-28):
-# http://www.turksandcaicos.tc/calendar/index.htm [2007-04-26]
-# there is an entry for Nov 4 "Daylight Savings Time Ends 2007" and three
-# rows before that there is an out of date entry for Oct:
-# "Eastern Standard Times Begins 2007
-# Clocks are set back one hour at 2:00 a.m. local Daylight Saving Time"
-# indicating that the normal ET rules are followed.
-#
-# From Paul Eggert (2006-05-01):
-# Shanks & Pottenger say they use US DST rules, but IATA SSIM (1991/1998)
-# says they switch at midnight.  Go with Shanks & Pottenger.
-#
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	TC	1979	1986	-	Apr	lastSun	2:00	1:00	D
-Rule	TC	1979	2006	-	Oct	lastSun	2:00	0	S
-Rule	TC	1987	2006	-	Apr	Sun>=1	2:00	1:00	D
-Rule	TC	2007	max	-	Mar	Sun>=8	2:00	1:00	D
-Rule	TC	2007	max	-	Nov	Sun>=1	2:00	0	S
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone America/Grand_Turk	-4:44:32 -	LMT	1890
-			-5:07:12 -	KMT	1912 Feb    # Kingston Mean Time
-			-5:00	TC	E%sT
-
-# British Virgin Is
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone America/Tortola	-4:18:28 -	LMT	1911 Jul    # Road Town
-			-4:00	-	AST
-
-# Virgin Is
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone America/St_Thomas	-4:19:44 -	LMT	1911 Jul    # Charlotte Amalie
-			-4:00	-	AST
diff --git a/tools/zoneinfo/tzdata2009s/southamerica b/tools/zoneinfo/tzdata2009s/southamerica
deleted file mode 100644
index 9c4edcb..0000000
--- a/tools/zoneinfo/tzdata2009s/southamerica
+++ /dev/null
@@ -1,1517 +0,0 @@
-# <pre>
-# @(#)southamerica	8.40
-# This file is in the public domain, so clarified as of
-# 2009-05-17 by Arthur David Olson.
-
-# This data is by no means authoritative; if you think you know better,
-# go ahead and edit the file (and please send any changes to
-# tz@elsie.nci.nih.gov for general use in the future).
-
-# From Paul Eggert (2006-03-22):
-# A good source for time zone historical data outside the U.S. is
-# Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
-# San Diego: ACS Publications, Inc. (2003).
-#
-# Gwillim Law writes that a good source
-# for recent time zone data is the International Air Transport
-# Association's Standard Schedules Information Manual (IATA SSIM),
-# published semiannually.  Law sent in several helpful summaries
-# of the IATA's data after 1990.
-#
-# Except where otherwise noted, Shanks & Pottenger is the source for
-# entries through 1990, and IATA SSIM is the source for entries afterwards.
-#
-# Earlier editions of these tables used the North American style (e.g. ARST and
-# ARDT for Argentine Standard and Daylight Time), but the following quote
-# suggests that it's better to use European style (e.g. ART and ARST).
-#	I suggest the use of _Summer time_ instead of the more cumbersome
-#	_daylight-saving time_.  _Summer time_ seems to be in general use
-#	in Europe and South America.
-#	-- E O Cutler, _New York Times_ (1937-02-14), quoted in
-#	H L Mencken, _The American Language: Supplement I_ (1960), p 466
-#
-# Earlier editions of these tables also used the North American style
-# for time zones in Brazil, but this was incorrect, as Brazilians say
-# "summer time".  Reinaldo Goulart, a Sao Paulo businessman active in
-# the railroad sector, writes (1999-07-06):
-#	The subject of time zones is currently a matter of discussion/debate in
-#	Brazil.  Let's say that "the Brasilia time" is considered the
-#	"official time" because Brasilia is the capital city.
-#	The other three time zones are called "Brasilia time "minus one" or
-#	"plus one" or "plus two".  As far as I know there is no such
-#	name/designation as "Eastern Time" or "Central Time".
-# So I invented the following (English-language) abbreviations for now.
-# Corrections are welcome!
-#		std	dst
-#	-2:00	FNT	FNST	Fernando de Noronha
-#	-3:00	BRT	BRST	Brasilia
-#	-4:00	AMT	AMST	Amazon
-#	-5:00	ACT	ACST	Acre
-
-###############################################################################
-
-###############################################################################
-
-# Argentina
-
-# From Bob Devine (1988-01-28):
-# Argentina: first Sunday in October to first Sunday in April since 1976.
-# Double Summer time from 1969 to 1974.  Switches at midnight.
-
-# From U. S. Naval Observatory (1988-01-199):
-# ARGENTINA           3 H BEHIND   UTC
-
-# From Hernan G. Otero (1995-06-26):
-# I am sending modifications to the Argentine time zone table...
-# AR was chosen because they are the ISO letters that represent Argentina.
-
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Arg	1930	only	-	Dec	 1	0:00	1:00	S
-Rule	Arg	1931	only	-	Apr	 1	0:00	0	-
-Rule	Arg	1931	only	-	Oct	15	0:00	1:00	S
-Rule	Arg	1932	1940	-	Mar	 1	0:00	0	-
-Rule	Arg	1932	1939	-	Nov	 1	0:00	1:00	S
-Rule	Arg	1940	only	-	Jul	 1	0:00	1:00	S
-Rule	Arg	1941	only	-	Jun	15	0:00	0	-
-Rule	Arg	1941	only	-	Oct	15	0:00	1:00	S
-Rule	Arg	1943	only	-	Aug	 1	0:00	0	-
-Rule	Arg	1943	only	-	Oct	15	0:00	1:00	S
-Rule	Arg	1946	only	-	Mar	 1	0:00	0	-
-Rule	Arg	1946	only	-	Oct	 1	0:00	1:00	S
-Rule	Arg	1963	only	-	Oct	 1	0:00	0	-
-Rule	Arg	1963	only	-	Dec	15	0:00	1:00	S
-Rule	Arg	1964	1966	-	Mar	 1	0:00	0	-
-Rule	Arg	1964	1966	-	Oct	15	0:00	1:00	S
-Rule	Arg	1967	only	-	Apr	 2	0:00	0	-
-Rule	Arg	1967	1968	-	Oct	Sun>=1	0:00	1:00	S
-Rule	Arg	1968	1969	-	Apr	Sun>=1	0:00	0	-
-Rule	Arg	1974	only	-	Jan	23	0:00	1:00	S
-Rule	Arg	1974	only	-	May	 1	0:00	0	-
-Rule	Arg	1988	only	-	Dec	 1	0:00	1:00	S
-#
-# From Hernan G. Otero (1995-06-26):
-# These corrections were contributed by InterSoft Argentina S.A.,
-# obtaining the data from the:
-# Talleres de Hidrografia Naval Argentina
-# (Argentine Naval Hydrography Institute)
-Rule	Arg	1989	1993	-	Mar	Sun>=1	0:00	0	-
-Rule	Arg	1989	1992	-	Oct	Sun>=15	0:00	1:00	S
-#
-# From Hernan G. Otero (1995-06-26):
-# From this moment on, the law that mandated the daylight saving
-# time corrections was derogated and no more modifications
-# to the time zones (for daylight saving) are now made.
-#
-# From Rives McDow (2000-01-10):
-# On October 3, 1999, 0:00 local, Argentina implemented daylight savings time,
-# which did not result in the switch of a time zone, as they stayed 9 hours
-# from the International Date Line.
-Rule	Arg	1999	only	-	Oct	Sun>=1	0:00	1:00	S
-# From Paul Eggert (2007-12-28):
-# DST was set to expire on March 5, not March 3, but since it was converted
-# to standard time on March 3 it's more convenient for us to pretend that
-# it ended on March 3.
-Rule	Arg	2000	only	-	Mar	3	0:00	0	-
-#
-# From Peter Gradelski via Steffen Thorsen (2000-03-01):
-# We just checked with our Sao Paulo office and they say the government of
-# Argentina decided not to become one of the countries that go on or off DST.
-# So Buenos Aires should be -3 hours from GMT at all times.
-#
-# From Fabian L. Arce Jofre (2000-04-04):
-# The law that claimed DST for Argentina was derogated by President Fernando
-# de la Rua on March 2, 2000, because it would make people spend more energy
-# in the winter time, rather than less.  The change took effect on March 3.
-#
-# From Mariano Absatz (2001-06-06):
-# one of the major newspapers here in Argentina said that the 1999
-# Timezone Law (which never was effectively applied) will (would?) be
-# in effect.... The article is at
-# http://ar.clarin.com/diario/2001-06-06/e-01701.htm
-# ... The Law itself is "Ley No 25155", sanctioned on 1999-08-25, enacted
-# 1999-09-17, and published 1999-09-21.  The official publication is at:
-# http://www.boletin.jus.gov.ar/BON/Primera/1999/09-Septiembre/21/PDF/BO21-09-99LEG.PDF
-# Regretfully, you have to subscribe (and pay) for the on-line version....
-#
-# (2001-06-12):
-# the timezone for Argentina will not change next Sunday.
-# Apparently it will do so on Sunday 24th....
-# http://ar.clarin.com/diario/2001-06-12/s-03501.htm
-#
-# (2001-06-25):
-# Last Friday (yes, the last working day before the date of the change), the
-# Senate annulled the 1999 law that introduced the changes later postponed.
-# http://www.clarin.com.ar/diario/2001-06-22/s-03601.htm
-# It remains the vote of the Deputies..., but it will be the same....
-# This kind of things had always been done this way in Argentina.
-# We are still -03:00 all year round in all of the country.
-#
-# From Steffen Thorsen (2007-12-21):
-# A user (Leonardo Chaim) reported that Argentina will adopt DST....
-# all of the country (all Zone-entries) are affected.  News reports like
-# http://www.lanacion.com.ar/opinion/nota.asp?nota_id=973037 indicate
-# that Argentina will use DST next year as well, from October to
-# March, although exact rules are not given.
-#
-# From Jesper Norgaard Welen (2007-12-26)
-# The last hurdle of Argentina DST is over, the proposal was approved in
-# the lower chamber too (Deputados) with a vote 192 for and 2 against.
-# By the way thanks to Mariano Absatz and Daniel Mario Vega for the link to
-# the original scanned proposal, where the dates and the zero hours are
-# clear and unambiguous...This is the article about final approval:
-# <a href="http://www.lanacion.com.ar/politica/nota.asp?nota_id=973996">
-# http://www.lanacion.com.ar/politica/nota.asp?nota_id=973996
-# </a>
-#
-# From Paul Eggert (2007-12-22):
-# For dates after mid-2008, the following rules are my guesses and
-# are quite possibly wrong, but are more likely than no DST at all.
-
-# From Alexander Krivenyshev (2008-09-05):
-# As per message from Carlos Alberto Fonseca Arauz (Nicaragua),
-# Argentina will start DST on Sunday October 19, 2008.
-#
-# <a href="http://www.worldtimezone.com/dst_news/dst_news_argentina03.html">
-# http://www.worldtimezone.com/dst_news/dst_news_argentina03.html
-# </a>
-# OR
-# <a href="http://www.impulsobaires.com.ar/nota.php?id=57832 (in spanish)">
-# http://www.impulsobaires.com.ar/nota.php?id=57832 (in spanish)
-# </a>
-
-# From Rodrigo Severo (2008-10-06):
-# Here is some info available at a Gentoo bug related to TZ on Argentina's DST:
-# ...
-# ------- Comment #1 from [jmdocile]  2008-10-06 16:28 0000 -------
-# Hi, there is a problem with timezone-data-2008e and maybe with
-# timezone-data-2008f
-# Argentinian law [Number] 25.155 is no longer valid.
-# <a href="http://www.infoleg.gov.ar/infolegInternet/anexos/60000-64999/60036/norma.htm">
-# http://www.infoleg.gov.ar/infolegInternet/anexos/60000-64999/60036/norma.htm
-# </a>
-# The new one is law [Number] 26.350
-# <a href="http://www.infoleg.gov.ar/infolegInternet/anexos/135000-139999/136191/norma.htm">
-# http://www.infoleg.gov.ar/infolegInternet/anexos/135000-139999/136191/norma.htm
-# </a>
-# So there is no summer time in Argentina for now.
-
-# From Mariano Absatz (2008-10-20):
-# Decree 1693/2008 applies Law 26.350 for the summer 2008/2009 establishing DST in Argentina
-# From 2008-10-19 until 2009-03-15
-# <a href="http://www.boletinoficial.gov.ar/Bora.Portal/CustomControls/PdfContent.aspx?fp=16102008&pi=3&pf=4&s=0&sec=01">
-# http://www.boletinoficial.gov.ar/Bora.Portal/CustomControls/PdfContent.aspx?fp=16102008&pi=3&pf=4&s=0&sec=01
-# </a>
-#
-# Decree 1705/2008 excepting 12 Provinces from applying DST in the summer 2008/2009:
-# Catamarca, La Rioja, Mendoza, Salta, San Juan, San Luis, La Pampa, Neuquen, Rio Negro, Chubut, Santa Cruz
-# and Tierra del Fuego
-# <a href="http://www.boletinoficial.gov.ar/Bora.Portal/CustomControls/PdfContent.aspx?fp=17102008&pi=1&pf=1&s=0&sec=01">
-# http://www.boletinoficial.gov.ar/Bora.Portal/CustomControls/PdfContent.aspx?fp=17102008&pi=1&pf=1&s=0&sec=01
-# </a>
-#
-# Press release 235 dated Saturday October 18th, from the Government of the Province of Jujuy saying
-# it will not apply DST either (even when it was not included in Decree 1705/2008)
-# <a href="http://www.jujuy.gov.ar/index2/partes_prensa/18_10_08/235-181008.doc">
-# http://www.jujuy.gov.ar/index2/partes_prensa/18_10_08/235-181008.doc
-# </a>
-
-# From fullinet (2009-10-18):
-# As announced in
-# <a hef="http://www.argentina.gob.ar/argentina/portal/paginas.dhtml?pagina=356">
-# http://www.argentina.gob.ar/argentina/portal/paginas.dhtml?pagina=356
-# </a>
-# (an official .gob.ar) under title: "Sin Cambio de Hora" (english: "No hour change")
-#
-# "Por el momento, el Gobierno Nacional resolvio no modificar la hora
-# oficial, decision que estaba en estudio para su implementacion el
-# domingo 18 de octubre. Desde el Ministerio de Planificacion se anuncio
-# que la Argentina hoy, en estas condiciones meteorologicas, no necesita
-# la modificacion del huso horario, ya que 2009 nos encuentra con
-# crecimiento en la produccion y distribucion energetica."
-
-Rule	Arg	2007	only	-	Dec	30	0:00	1:00	S
-Rule	Arg	2008	2009	-	Mar	Sun>=15	0:00	0	-
-Rule	Arg	2008	only	-	Oct	Sun>=15	0:00	1:00	S
- 
-# From Mariano Absatz (2004-05-21):
-# Today it was officially published that the Province of Mendoza is changing
-# its timezone this winter... starting tomorrow night....
-# http://www.gobernac.mendoza.gov.ar/boletin/pdf/20040521-27158-normas.pdf
-# From Paul Eggert (2004-05-24):
-# It's Law No. 7,210.  This change is due to a public power emergency, so for
-# now we'll assume it's for this year only.
-#
-# From Paul Eggert (2006-03-22):
-# <a href="http://www.spicasc.net/horvera.html">
-# Hora de verano para la Republica Argentina (2003-06-08)
-# </a> says that standard time in Argentina from 1894-10-31
-# to 1920-05-01 was -4:16:48.25.  Go with this more-precise value
-# over Shanks & Pottenger.
-#
-# From Mariano Absatz (2004-06-05):
-# These media articles from a major newspaper mostly cover the current state:
-# http://www.lanacion.com.ar/04/05/27/de_604825.asp
-# http://www.lanacion.com.ar/04/05/28/de_605203.asp
-#
-# The following eight (8) provinces pulled clocks back to UTC-04:00 at
-# midnight Monday May 31st. (that is, the night between 05/31 and 06/01).
-# Apparently, all nine provinces would go back to UTC-03:00 at the same
-# time in October 17th.
-#
-# Catamarca, Chubut, La Rioja, San Juan, San Luis, Santa Cruz,
-# Tierra del Fuego, Tucuman.
-#
-# From Mariano Absatz (2004-06-14):
-# ... this weekend, the Province of Tucuman decided it'd go back to UTC-03:00
-# yesterday midnight (that is, at 24:00 Saturday 12th), since the people's
-# annoyance with the change is much higher than the power savings obtained....
-#
-# From Gwillim Law (2004-06-14):
-# http://www.lanacion.com.ar/04/06/10/de_609078.asp ...
-#     "The time change in Tierra del Fuego was a conflicted decision from
-#   the start.  The government had decreed that the measure would take
-#   effect on June 1, but a normative error forced the new time to begin
-#   three days earlier, from a Saturday to a Sunday....
-# Our understanding was that the change was originally scheduled to take place
-# on June 1 at 00:00 in Chubut, Santa Cruz, Tierra del Fuego (and some other
-# provinces).  Sunday was May 30, only two days earlier.  So the article
-# contains a contradiction.  I would give more credence to the Saturday/Sunday
-# date than the "three days earlier" phrase, and conclude that Tierra del
-# Fuego set its clocks back at 2004-05-30 00:00.
-#
-# From Steffen Thorsen (2004-10-05):
-# The previous law 7210 which changed the province of Mendoza's time zone
-# back in May have been modified slightly in a new law 7277, which set the
-# new end date to 2004-09-26 (original date was 2004-10-17).
-# http://www.gobernac.mendoza.gov.ar/boletin/pdf/20040924-27244-normas.pdf
-#
-# From Mariano Absatz (2004-10-05):
-# San Juan changed from UTC-03:00 to UTC-04:00 at midnight between
-# Sunday, May 30th and Monday, May 31st.  It changed back to UTC-03:00
-# at midnight between Saturday, July 24th and Sunday, July 25th....
-# http://www.sanjuan.gov.ar/prensa/archivo/000329.html
-# http://www.sanjuan.gov.ar/prensa/archivo/000426.html
-# http://www.sanjuan.gov.ar/prensa/archivo/000441.html
-
-# From Alex Krivenyshev (2008-01-17):
-# Here are articles that Argentina Province San Luis is planning to end DST
-# as earlier as upcoming Monday January 21, 2008 or February 2008:
-#
-# Provincia argentina retrasa reloj y marca diferencia con resto del pais
-# (Argentine Province delayed clock and mark difference with the rest of the
-# country)
-# <a href="http://cl.invertia.com/noticias/noticia.aspx?idNoticia=200801171849_EFE_ET4373&idtel">
-# http://cl.invertia.com/noticias/noticia.aspx?idNoticia=200801171849_EFE_ET4373&idtel
-# </a>
-#
-# Es inminente que en San Luis atrasen una hora los relojes
-# (It is imminent in San Luis clocks one hour delay)
-# <a href="http://www.lagaceta.com.ar/vernotae.asp?id_nota=253414">
-# http://www.lagaceta.com.ar/vernotae.asp?id_nota=253414
-# </a>
-#
-# <a href="http://www.worldtimezone.net/dst_news/dst_news_argentina02.html">
-# http://www.worldtimezone.net/dst_news/dst_news_argentina02.html
-# </a>
-
-# From Jesper Norgaard Welen (2008-01-18):
-# The page of the San Luis provincial government
-# <a href="http://www.sanluis.gov.ar/notas.asp?idCanal=0&id=22812">
-# http://www.sanluis.gov.ar/notas.asp?idCanal=0&id=22812
-# </a>
-# confirms what Alex Krivenyshev has earlier sent to the tz
-# emailing list about that San Luis plans to return to standard
-# time much earlier than the rest of the country. It also
-# confirms that upon request the provinces San Juan and Mendoza 
-# refused to follow San Luis in this change. 
-# 
-# The change is supposed to take place Monday the 21.st at 0:00
-# hours. As far as I understand it if this goes ahead, we need
-# a new timezone for San Luis (although there are also documented
-# independent changes in the southamerica file of San Luis in
-# 1990 and 1991 which has not been confirmed).
-
-# From Jesper Norgaard Welen (2008-01-25):
-# Unfortunately the below page has become defunct, about the San Luis
-# time change. Perhaps because it now is part of a group of pages "Most
-# important pages of 2008."
-#
-# You can use
-# <a href="http://www.sanluis.gov.ar/notas.asp?idCanal=8141&id=22834">
-# http://www.sanluis.gov.ar/notas.asp?idCanal=8141&id=22834
-# </a>
-# instead it seems. Or use "Buscador" from the main page of the San Luis
-# government, and fill in "huso" and click OK, and you will get 3 pages
-# from which the first one is identical to the above.
-
-# From Mariano Absatz (2008-01-28):
-# I can confirm that the Province of San Luis (and so far only that
-# province) decided to go back to UTC-3 effective midnight Jan 20th 2008
-# (that is, Monday 21st at 0:00 is the time the clocks were delayed back
-# 1 hour), and they intend to keep UTC-3 as their timezone all year round
-# (that is, unless they change their mind any minute now).
-#
-# So we'll have to add yet another city to 'southamerica' (I think San
-# Luis city is the mos populated city in the Province, so it'd be
-# America/Argentina/San_Luis... of course I can't remember if San Luis's
-# history of particular changes goes along with Mendoza or San Juan :-(
-# (I only remember not being able to collect hard facts about San Luis
-# back in 2004, when these provinces changed to UTC-4 for a few days, I
-# mailed them personally and never got an answer).
-
-# From Paul Eggert (2008-06-30):
-# Unless otherwise specified, data are from Shanks & Pottenger through 1992,
-# from the IATA otherwise.  As noted below, Shanks & Pottenger say that
-# America/Cordoba split into 6 subregions during 1991/1992, one of which
-# was America/San_Luis, but we haven't verified this yet so for now we'll
-# keep America/Cordoba a single region rather than splitting it into the
-# other 5 subregions.
-
-# From Mariano Absatz (2009-03-13):
-# Yesterday (with our usual 2-day notice) the Province of San Luis
-# decided that next Sunday instead of "staying" @utc-03:00 they will go
-# to utc-04:00 until the second Saturday in October...
-#
-# The press release is at
-# <a href="http://www.sanluis.gov.ar/SL/Paginas/NoticiaDetalle.asp?TemaId=1&InfoPrensaId=3102">
-# http://www.sanluis.gov.ar/SL/Paginas/NoticiaDetalle.asp?TemaId=1&InfoPrensaId=3102
-# </a>
-# (I couldn't find the decree, but
-# <a href="http://www.sanluis.gov.ar">
-# www.sanluis.gov.ar
-# <a/>
-# is the official page for the Province Government).
-#
-# There's also a note in only one of the major national papers (La Nación) at
-# <a href="http://www.lanacion.com.ar/nota.asp?nota_id=1107912">
-# http://www.lanacion.com.ar/nota.asp?nota_id=1107912
-# </a>
-# 
-# The press release says:
-#  (...) anunció que el próximo domingo a las 00:00 los puntanos deberán
-# atrasar una hora sus relojes.
-#
-# A partir de entonces, San Luis establecerá el huso horario propio de
-# la Provincia. De esta manera, durante el periodo del calendario anual
-# 2009, el cambio horario quedará comprendido entre las 00:00 del tercer
-# domingo de marzo y las 24:00 del segundo sábado de octubre.
-# Quick&dirty translation
-# (...) announced that next Sunday, at 00:00, Puntanos (the San Luis
-# inhabitants) will have to turn back one hour their clocks
-#
-# Since then, San Luis will establish its own Province timezone. Thus,
-# during 2009, this timezone change will run from 00:00 the third Sunday
-# in March until 24:00 of the second Saturday in October.
-
-# From Mariano Absatz (2009-10-16):
-# ...the Province of San Luis is a case in itself.
-#
-# The Law at
-# <a href="http://www.diputadossanluis.gov.ar/diputadosasp/paginas/verNorma.asp?NormaID=276>"
-# http://www.diputadossanluis.gov.ar/diputadosasp/paginas/verNorma.asp?NormaID=276
-# </a>
-# is ambiguous because establishes a calendar from the 2nd Sunday in
-# October at 0:00 thru the 2nd Saturday in March at 24:00 and the
-# complement of that starting on the 2nd Sunday of March at 0:00 and
-# ending on the 2nd Saturday of March at 24:00.
-#
-# This clearly breaks every time the 1st of March or October is a Sunday.
-#
-# IMHO, the "spirit of the Law" is to make the changes at 0:00 on the 2nd
-# Sunday of October and March.
-#
-# The problem is that the changes in the rest of the Provinces that did
-# change in 2007/2008, were made according to the Federal Law and Decrees
-# that did so on the 3rd Sunday of October and March.
-#
-# In fact, San Luis actually switched from UTC-4 to UTC-3 last Sunday
-# (October 11th) at 0:00.
-#
-# So I guess a new set of rules, besides "Arg", must be made and the last
-# America/Argentina/San_Luis entries should change to use these...
-#
-# I'm enclosing a patch that does what I say... regretfully, the San Luis
-# timezone must be called "WART/WARST" even when most of the time (like,
-# right now) WARST == ART... that is, since last Sunday, all the country
-# is using UTC-3, but in my patch, San Luis calls it "WARST" and the rest
-# of the country calls it "ART".
-# ...
-
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-#
-# Buenos Aires (BA), Capital Federal (CF),
-Zone America/Argentina/Buenos_Aires -3:53:48 - LMT 1894 Oct 31
-			-4:16:48 -	CMT	1920 May # Cordoba Mean Time
-			-4:00	-	ART	1930 Dec
-			-4:00	Arg	AR%sT	1969 Oct  5
-			-3:00	Arg	AR%sT	1999 Oct  3
-			-4:00	Arg	AR%sT	2000 Mar  3
-			-3:00	Arg	AR%sT
-#
-# Cordoba (CB), Santa Fe (SF), Entre Rios (ER), Corrientes (CN), Misiones (MN),
-# Chaco (CC), Formosa (FM), Santiago del Estero (SE)
-#
-# Shanks & Pottenger also make the following claims, which we haven't verified:
-# - Formosa switched to -3:00 on 1991-01-07.
-# - Misiones switched to -3:00 on 1990-12-29.
-# - Chaco switched to -3:00 on 1991-01-04.
-# - Santiago del Estero switched to -4:00 on 1991-04-01,
-#   then to -3:00 on 1991-04-26.
-#
-Zone America/Argentina/Cordoba -4:16:48 - LMT	1894 Oct 31
-			-4:16:48 -	CMT	1920 May
-			-4:00	-	ART	1930 Dec
-			-4:00	Arg	AR%sT	1969 Oct  5
-			-3:00	Arg	AR%sT	1991 Mar  3
-			-4:00	-	WART	1991 Oct 20
-			-3:00	Arg	AR%sT	1999 Oct  3
-			-4:00	Arg	AR%sT	2000 Mar  3
-			-3:00	Arg	AR%sT
-#
-# Salta (SA), La Pampa (LP), Neuquen (NQ), Rio Negro (RN)
-Zone America/Argentina/Salta -4:21:40 - LMT	1894 Oct 31
-			-4:16:48 -	CMT	1920 May
-			-4:00	-	ART	1930 Dec
-			-4:00	Arg	AR%sT	1969 Oct  5
-			-3:00	Arg	AR%sT	1991 Mar  3
-			-4:00	-	WART	1991 Oct 20
-			-3:00	Arg	AR%sT	1999 Oct  3
-			-4:00	Arg	AR%sT	2000 Mar  3
-			-3:00	Arg	AR%sT	2008 Oct 18
-			-3:00	-	ART
-#
-# Tucuman (TM)
-Zone America/Argentina/Tucuman -4:20:52 - LMT	1894 Oct 31
-			-4:16:48 -	CMT	1920 May
-			-4:00	-	ART	1930 Dec
-			-4:00	Arg	AR%sT	1969 Oct  5
-			-3:00	Arg	AR%sT	1991 Mar  3
-			-4:00	-	WART	1991 Oct 20
-			-3:00	Arg	AR%sT	1999 Oct  3
-			-4:00	Arg	AR%sT	2000 Mar  3
-			-3:00	-	ART	2004 Jun  1
-			-4:00	-	WART	2004 Jun 13
-			-3:00	Arg	AR%sT
-#
-# La Rioja (LR)
-Zone America/Argentina/La_Rioja -4:27:24 - LMT	1894 Oct 31
-			-4:16:48 -	CMT	1920 May
-			-4:00	-	ART	1930 Dec
-			-4:00	Arg	AR%sT	1969 Oct  5
-			-3:00	Arg	AR%sT	1991 Mar  1
-			-4:00	-	WART	1991 May  7
-			-3:00	Arg	AR%sT	1999 Oct  3
-			-4:00	Arg	AR%sT	2000 Mar  3
-			-3:00	-	ART	2004 Jun  1
-			-4:00	-	WART	2004 Jun 20
-			-3:00	Arg	AR%sT	2008 Oct 18
-			-3:00	-	ART
-#
-# San Juan (SJ)
-Zone America/Argentina/San_Juan -4:34:04 - LMT	1894 Oct 31
-			-4:16:48 -	CMT	1920 May
-			-4:00	-	ART	1930 Dec
-			-4:00	Arg	AR%sT	1969 Oct  5
-			-3:00	Arg	AR%sT	1991 Mar  1
-			-4:00	-	WART	1991 May  7
-			-3:00	Arg	AR%sT	1999 Oct  3
-			-4:00	Arg	AR%sT	2000 Mar  3
-			-3:00	-	ART	2004 May 31
-			-4:00	-	WART	2004 Jul 25
-			-3:00	Arg	AR%sT	2008 Oct 18
-			-3:00	-	ART
-#
-# Jujuy (JY)
-Zone America/Argentina/Jujuy -4:21:12 -	LMT	1894 Oct 31
-			-4:16:48 -	CMT	1920 May
-			-4:00	-	ART	1930 Dec
-			-4:00	Arg	AR%sT	1969 Oct  5
-			-3:00	Arg	AR%sT	1990 Mar  4
-			-4:00	-	WART	1990 Oct 28
-			-4:00	1:00	WARST	1991 Mar 17
-			-4:00	-	WART	1991 Oct  6
-			-3:00	1:00	ARST	1992
-			-3:00	Arg	AR%sT	1999 Oct  3
-			-4:00	Arg	AR%sT	2000 Mar  3
-			-3:00	Arg	AR%sT	2008 Oct 18
-			-3:00	-	ART
-#
-# Catamarca (CT), Chubut (CH)
-Zone America/Argentina/Catamarca -4:23:08 - LMT	1894 Oct 31
-			-4:16:48 -	CMT	1920 May
-			-4:00	-	ART	1930 Dec
-			-4:00	Arg	AR%sT	1969 Oct  5
-			-3:00	Arg	AR%sT	1991 Mar  3
-			-4:00	-	WART	1991 Oct 20
-			-3:00	Arg	AR%sT	1999 Oct  3
-			-4:00	Arg	AR%sT	2000 Mar  3
-			-3:00	-	ART	2004 Jun  1
-			-4:00	-	WART	2004 Jun 20
-			-3:00	Arg	AR%sT	2008 Oct 18
-			-3:00	-	ART
-#
-# Mendoza (MZ)
-Zone America/Argentina/Mendoza -4:35:16 - LMT	1894 Oct 31
-			-4:16:48 -	CMT	1920 May
-			-4:00	-	ART	1930 Dec
-			-4:00	Arg	AR%sT	1969 Oct  5
-			-3:00	Arg	AR%sT	1990 Mar  4
-			-4:00	-	WART	1990 Oct 15
-			-4:00	1:00	WARST	1991 Mar  1
-			-4:00	-	WART	1991 Oct 15
-			-4:00	1:00	WARST	1992 Mar  1
-			-4:00	-	WART	1992 Oct 18
-			-3:00	Arg	AR%sT	1999 Oct  3
-			-4:00	Arg	AR%sT	2000 Mar  3
-			-3:00	-	ART	2004 May 23
-			-4:00	-	WART	2004 Sep 26
-			-3:00	Arg	AR%sT	2008 Oct 18
-			-3:00	-	ART
-#
-# San Luis (SL)
-
-Rule	SanLuis	2008	max	-	Mar	Sun>=8	0:00	0	-
-Rule	SanLuis	2007	max	-	Oct	Sun>=8	0:00	1:00	S
-
-Zone America/Argentina/San_Luis -4:25:24 - LMT	1894 Oct 31
-			-4:16:48 -	CMT	1920 May
-			-4:00	-	ART	1930 Dec
-			-4:00	Arg	AR%sT	1969 Oct  5
-			-3:00	Arg	AR%sT	1990
-			-3:00	1:00	ARST	1990 Mar 14
-			-4:00	-	WART	1990 Oct 15
-			-4:00	1:00	WARST	1991 Mar  1
-			-4:00	-	WART	1991 Jun  1
-			-3:00	-	ART	1999 Oct  3
-			-4:00	1:00	WARST	2000 Mar  3
-			-3:00	-	ART	2004 May 31
-			-4:00	-	WART	2004 Jul 25
-			-3:00	Arg	AR%sT	2008 Jan 21
-			-4:00	SanLuis	WAR%sT
-#
-# Santa Cruz (SC)
-Zone America/Argentina/Rio_Gallegos -4:36:52 - LMT 1894 Oct 31
-			-4:16:48 -	CMT	1920 May # Cordoba Mean Time
-			-4:00	-	ART	1930 Dec
-			-4:00	Arg	AR%sT	1969 Oct  5
-			-3:00	Arg	AR%sT	1999 Oct  3
-			-4:00	Arg	AR%sT	2000 Mar  3
-			-3:00	-	ART	2004 Jun  1
-			-4:00	-	WART	2004 Jun 20
-			-3:00	Arg	AR%sT	2008 Oct 18
-			-3:00	-	ART
-#
-# Tierra del Fuego, Antartida e Islas del Atlantico Sur (TF)
-Zone America/Argentina/Ushuaia -4:33:12 - LMT 1894 Oct 31
-			-4:16:48 -	CMT	1920 May # Cordoba Mean Time
-			-4:00	-	ART	1930 Dec
-			-4:00	Arg	AR%sT	1969 Oct  5
-			-3:00	Arg	AR%sT	1999 Oct  3
-			-4:00	Arg	AR%sT	2000 Mar  3
-			-3:00	-	ART	2004 May 30
-			-4:00	-	WART	2004 Jun 20
-			-3:00	Arg	AR%sT	2008 Oct 18
-			-3:00	-	ART
-
-# Aruba
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	America/Aruba	-4:40:24 -	LMT	1912 Feb 12	# Oranjestad
-			-4:30	-	ANT	1965 # Netherlands Antilles Time
-			-4:00	-	AST
-
-# Bolivia
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	America/La_Paz	-4:32:36 -	LMT	1890
-			-4:32:36 -	CMT	1931 Oct 15 # Calamarca MT
-			-4:32:36 1:00	BOST	1932 Mar 21 # Bolivia ST
-			-4:00	-	BOT	# Bolivia Time
-
-# Brazil
-
-# From Paul Eggert (1993-11-18):
-# The mayor of Rio recently attempted to change the time zone rules
-# just in his city, in order to leave more summer time for the tourist trade.
-# The rule change lasted only part of the day;
-# the federal government refused to follow the city's rules, and business
-# was in a chaos, so the mayor backed down that afternoon.
-
-# From IATA SSIM (1996-02):
-# _Only_ the following states in BR1 observe DST: Rio Grande do Sul (RS),
-# Santa Catarina (SC), Parana (PR), Sao Paulo (SP), Rio de Janeiro (RJ),
-# Espirito Santo (ES), Minas Gerais (MG), Bahia (BA), Goias (GO),
-# Distrito Federal (DF), Tocantins (TO), Sergipe [SE] and Alagoas [AL].
-# [The last three states are new to this issue of the IATA SSIM.]
-
-# From Gwillim Law (1996-10-07):
-# Geography, history (Tocantins was part of Goias until 1989), and other
-# sources of time zone information lead me to believe that AL, SE, and TO were
-# always in BR1, and so the only change was whether or not they observed DST....
-# The earliest issue of the SSIM I have is 2/91.  Each issue from then until
-# 9/95 says that DST is observed only in the ten states I quoted from 9/95,
-# along with Mato Grosso (MT) and Mato Grosso do Sul (MS), which are in BR2
-# (UTC-4)....  The other two time zones given for Brazil are BR3, which is
-# UTC-5, no DST, and applies only in the state of Acre (AC); and BR4, which is
-# UTC-2, and applies to Fernando de Noronha (formerly FN, but I believe it's
-# become part of the state of Pernambuco).  The boundary between BR1 and BR2
-# has never been clearly stated.  They've simply been called East and West.
-# However, some conclusions can be drawn from another IATA manual: the Airline
-# Coding Directory, which lists close to 400 airports in Brazil.  For each
-# airport it gives a time zone which is coded to the SSIM.  From that
-# information, I'm led to conclude that the states of Amapa (AP), Ceara (CE),
-# Maranhao (MA), Paraiba (PR), Pernambuco (PE), Piaui (PI), and Rio Grande do
-# Norte (RN), and the eastern part of Para (PA) are all in BR1 without DST.
-
-# From Marcos Tadeu (1998-09-27):
-# <a href="http://pcdsh01.on.br/verao1.html">
-# Brazilian official page
-# </a>
-
-# From Jesper Norgaard (2000-11-03):
-# [For an official list of which regions in Brazil use which time zones, see:]
-# http://pcdsh01.on.br/Fusbr.htm
-# http://pcdsh01.on.br/Fusbrhv.htm
-
-# From Celso Doria via David Madeo (2002-10-09):
-# The reason for the delay this year has to do with elections in Brazil.
-#
-# Unlike in the United States, elections in Brazil are 100% computerized and
-# the results are known almost immediately.  Yesterday, it was the first
-# round of the elections when 115 million Brazilians voted for President,
-# Governor, Senators, Federal Deputies, and State Deputies.  Nobody is
-# counting (or re-counting) votes anymore and we know there will be a second
-# round for the Presidency and also for some Governors.  The 2nd round will
-# take place on October 27th.
-#
-# The reason why the DST will only begin November 3rd is that the thousands
-# of electoral machines used cannot have their time changed, and since the
-# Constitution says the elections must begin at 8:00 AM and end at 5:00 PM,
-# the Government decided to postpone DST, instead of changing the Constitution
-# (maybe, for the next elections, it will be possible to change the clock)...
-
-# From Rodrigo Severo (2004-10-04):
-# It's just the biannual change made necessary by the much hyped, supposedly
-# modern Brazilian eletronic voting machines which, apparently, can't deal
-# with a time change between the first and the second rounds of the elections.
-
-# From Steffen Thorsen (2007-09-20):
-# Brazil will start DST on 2007-10-14 00:00 and end on 2008-02-17 00:00:
-# http://www.mme.gov.br/site/news/detail.do;jsessionid=BBA06811AFCAAC28F0285210913513DA?newsId=13975
-
-# From Paul Schulze (2008-06-24):
-# ...by law number 11.662 of April 24, 2008 (published in the "Diario
-# Oficial da Uniao"...) in Brazil there are changes in the timezones,
-# effective today (00:00am at June 24, 2008) as follows:
-#
-# a) The timezone UTC+5 is e[x]tinguished, with all the Acre state and the
-# part of the Amazonas state that had this timezone now being put to the
-# timezone UTC+4
-# b) The whole Para state now is put at timezone UTC+3, instead of just
-# part of it, as was before.
-#
-# This change follows a proposal of senator Tiao Viana of Acre state, that
-# proposed it due to concerns about open television channels displaying
-# programs inappropriate to youths in the states that had the timezone
-# UTC+5 too early in the night. In the occasion, some more corrections
-# were proposed, trying to unify the timezones of any given state. This
-# change modifies timezone rules defined in decree 2.784 of 18 June,
-# 1913.
-
-# From Rodrigo Severo (2008-06-24):
-# Just correcting the URL:
-# <a href="https://www.in.gov.br/imprensa/visualiza/index.jsp?jornal=do&secao=1&pagina=1&data=25/04/2008">
-# https://www.in.gov.br/imprensa/visualiza/index.jsp?jornal=do&secao=1&pagina=1&data=25/04/2008
-# </a>
-#
-# As a result of the above Decree I believe the America/Rio_Branco
-# timezone shall be modified from UTC-5 to UTC-4 and a new timezone shall
-# be created to represent the the west side of the Para State. I
-# suggest this new timezone be called Santarem as the most
-# important/populated city in the affected area.
-#
-# This new timezone would be the same as the Rio_Branco timezone up to
-# the 2008/06/24 change which would be to UTC-3 instead of UTC-4.
-
-# From Alex Krivenyshev (2008-06-24):
-# This is a quick reference page for New and Old Brazil Time Zones map.
-# <a href="http://www.worldtimezone.com/brazil-time-new-old.php">
-# http://www.worldtimezone.com/brazil-time-new-old.php
-# </a>
-#
-# - 4 time zones replaced by 3 time zones-eliminating time zone UTC- 05
-# (state Acre and the part of the Amazonas will be UTC/GMT- 04) - western
-# part of Par state is moving to one timezone UTC- 03 (from UTC -04).
-
-# From Paul Eggert (2002-10-10):
-# The official decrees referenced below are mostly taken from
-# <a href="http://pcdsh01.on.br/DecHV.html">
-# Decretos sobre o Horario de Verao no Brasil
-# </a>.
-
-# From Steffen Thorsen (2008-08-29):
-# As announced by the government and many newspapers in Brazil late
-# yesterday, Brazil will start DST on 2008-10-19 (need to change rule) and
-# it will end on 2009-02-15 (current rule for Brazil is fine). Based on
-# past years experience with the elections, there was a good chance that
-# the start was postponed to November, but it did not happen this year.
-#
-# It has not yet been posted to http://pcdsh01.on.br/DecHV.html
-#
-# An official page about it:
-# <a href="http://www.mme.gov.br/site/news/detail.do?newsId=16722">
-# http://www.mme.gov.br/site/news/detail.do?newsId=16722
-# </a>
-# Note that this link does not always work directly, but must be accessed
-# by going to
-# <a href="http://www.mme.gov.br/first">
-# http://www.mme.gov.br/first
-# </a>
-#
-# One example link that works directly:
-# <a href="http://jornale.com.br/index.php?option=com_content&task=view&id=13530&Itemid=54">
-# http://jornale.com.br/index.php?option=com_content&task=view&id=13530&Itemid=54
-# (Portuguese)
-# </a>
-#
-# We have a written a short article about it as well:
-# <a href="http://www.timeanddate.com/news/time/brazil-dst-2008-2009.html">
-# http://www.timeanddate.com/news/time/brazil-dst-2008-2009.html
-# </a>
-
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-# Decree <a href="http://pcdsh01.on.br/HV20466.htm">20,466</a> (1931-10-01)
-# Decree <a href="http://pcdsh01.on.br/HV21896.htm">21,896</a> (1932-01-10)
-Rule	Brazil	1931	only	-	Oct	 3	11:00	1:00	S
-Rule	Brazil	1932	1933	-	Apr	 1	 0:00	0	-
-Rule	Brazil	1932	only	-	Oct	 3	 0:00	1:00	S
-# Decree <a href="http://pcdsh01.on.br/HV23195.htm">23,195</a> (1933-10-10)
-# revoked DST.
-# Decree <a href="http://pcdsh01.on.br/HV27496.htm">27,496</a> (1949-11-24)
-# Decree <a href="http://pcdsh01.on.br/HV27998.htm">27,998</a> (1950-04-13)
-Rule	Brazil	1949	1952	-	Dec	 1	 0:00	1:00	S
-Rule	Brazil	1950	only	-	Apr	16	 1:00	0	-
-Rule	Brazil	1951	1952	-	Apr	 1	 0:00	0	-
-# Decree <a href="http://pcdsh01.on.br/HV32308.htm">32,308</a> (1953-02-24)
-Rule	Brazil	1953	only	-	Mar	 1	 0:00	0	-
-# Decree <a href="http://pcdsh01.on.br/HV34724.htm">34,724</a> (1953-11-30)
-# revoked DST.
-# Decree <a href="http://pcdsh01.on.br/HV52700.htm">52,700</a> (1963-10-18)
-# established DST from 1963-10-23 00:00 to 1964-02-29 00:00
-# in SP, RJ, GB, MG, ES, due to the prolongation of the drought.
-# Decree <a href="http://pcdsh01.on.br/HV53071.htm">53,071</a> (1963-12-03)
-# extended the above decree to all of the national territory on 12-09.
-Rule	Brazil	1963	only	-	Dec	 9	 0:00	1:00	S
-# Decree <a href="http://pcdsh01.on.br/HV53604.htm">53,604</a> (1964-02-25)
-# extended summer time by one day to 1964-03-01 00:00 (start of school).
-Rule	Brazil	1964	only	-	Mar	 1	 0:00	0	-
-# Decree <a href="http://pcdsh01.on.br/HV55639.htm">55,639</a> (1965-01-27)
-Rule	Brazil	1965	only	-	Jan	31	 0:00	1:00	S
-Rule	Brazil	1965	only	-	Mar	31	 0:00	0	-
-# Decree <a href="http://pcdsh01.on.br/HV57303.htm">57,303</a> (1965-11-22)
-Rule	Brazil	1965	only	-	Dec	 1	 0:00	1:00	S
-# Decree <a href="http://pcdsh01.on.br/HV57843.htm">57,843</a> (1966-02-18)
-Rule	Brazil	1966	1968	-	Mar	 1	 0:00	0	-
-Rule	Brazil	1966	1967	-	Nov	 1	 0:00	1:00	S
-# Decree <a href="http://pcdsh01.on.br/HV63429.htm">63,429</a> (1968-10-15)
-# revoked DST.
-# Decree <a href="http://pcdsh01.on.br/HV91698.htm">91,698</a> (1985-09-27)
-Rule	Brazil	1985	only	-	Nov	 2	 0:00	1:00	S
-# Decree 92,310 (1986-01-21)
-# Decree 92,463 (1986-03-13)
-Rule	Brazil	1986	only	-	Mar	15	 0:00	0	-
-# Decree 93,316 (1986-10-01)
-Rule	Brazil	1986	only	-	Oct	25	 0:00	1:00	S
-Rule	Brazil	1987	only	-	Feb	14	 0:00	0	-
-# Decree <a href="http://pcdsh01.on.br/HV94922.htm">94,922</a> (1987-09-22)
-Rule	Brazil	1987	only	-	Oct	25	 0:00	1:00	S
-Rule	Brazil	1988	only	-	Feb	 7	 0:00	0	-
-# Decree <a href="http://pcdsh01.on.br/HV96676.htm">96,676</a> (1988-09-12)
-# except for the states of AC, AM, PA, RR, RO, and AP (then a territory)
-Rule	Brazil	1988	only	-	Oct	16	 0:00	1:00	S
-Rule	Brazil	1989	only	-	Jan	29	 0:00	0	-
-# Decree <a href="http://pcdsh01.on.br/HV98077.htm">98,077</a> (1989-08-21)
-# with the same exceptions
-Rule	Brazil	1989	only	-	Oct	15	 0:00	1:00	S
-Rule	Brazil	1990	only	-	Feb	11	 0:00	0	-
-# Decree <a href="http://pcdsh01.on.br/HV99530.htm">99,530</a> (1990-09-17)
-# adopted by RS, SC, PR, SP, RJ, ES, MG, GO, MS, DF.
-# Decree 99,629 (1990-10-19) adds BA, MT.
-Rule	Brazil	1990	only	-	Oct	21	 0:00	1:00	S
-Rule	Brazil	1991	only	-	Feb	17	 0:00	0	-
-# <a href="http://pcdsh01.on.br/HV1991.htm">Unnumbered decree</a> (1991-09-25)
-# adopted by RS, SC, PR, SP, RJ, ES, MG, BA, GO, MT, MS, DF.
-Rule	Brazil	1991	only	-	Oct	20	 0:00	1:00	S
-Rule	Brazil	1992	only	-	Feb	 9	 0:00	0	-
-# <a href="http://pcdsh01.on.br/HV1992.htm">Unnumbered decree</a> (1992-10-16)
-# adopted by same states.
-Rule	Brazil	1992	only	-	Oct	25	 0:00	1:00	S
-Rule	Brazil	1993	only	-	Jan	31	 0:00	0	-
-# Decree <a href="http://pcdsh01.on.br/HV942.htm">942</a> (1993-09-28)
-# adopted by same states, plus AM.
-# Decree <a href="http://pcdsh01.on.br/HV1252.htm">1,252</a> (1994-09-22;
-# web page corrected 2004-01-07) adopted by same states, minus AM.
-# Decree <a href="http://pcdsh01.on.br/HV1636.htm">1,636</a> (1995-09-14)
-# adopted by same states, plus MT and TO.
-# Decree <a href="http://pcdsh01.on.br/HV1674.htm">1,674</a> (1995-10-13)
-# adds AL, SE.
-Rule	Brazil	1993	1995	-	Oct	Sun>=11	 0:00	1:00	S
-Rule	Brazil	1994	1995	-	Feb	Sun>=15	 0:00	0	-
-Rule	Brazil	1996	only	-	Feb	11	 0:00	0	-
-# Decree <a href="http://pcdsh01.on.br/HV2000.htm">2,000</a> (1996-09-04)
-# adopted by same states, minus AL, SE.
-Rule	Brazil	1996	only	-	Oct	 6	 0:00	1:00	S
-Rule	Brazil	1997	only	-	Feb	16	 0:00	0	-
-# From Daniel C. Sobral (1998-02-12):
-# In 1997, the DS began on October 6. The stated reason was that
-# because international television networks ignored Brazil's policy on DS,
-# they bought the wrong times on satellite for coverage of Pope's visit.
-# This year, the ending date of DS was postponed to March 1
-# to help dealing with the shortages of electric power.
-#
-# Decree 2,317 (1997-09-04), adopted by same states.
-Rule	Brazil	1997	only	-	Oct	 6	 0:00	1:00	S
-# Decree <a href="http://pcdsh01.on.br/figuras/HV2495.JPG">2,495</a>
-# (1998-02-10)
-Rule	Brazil	1998	only	-	Mar	 1	 0:00	0	-
-# Decree <a href="http://pcdsh01.on.br/figuras/Hv98.jpg">2,780</a> (1998-09-11)
-# adopted by the same states as before.
-Rule	Brazil	1998	only	-	Oct	11	 0:00	1:00	S
-Rule	Brazil	1999	only	-	Feb	21	 0:00	0	-
-# Decree <a href="http://pcdsh01.on.br/figuras/HV3150.gif">3,150</a>
-# (1999-08-23) adopted by same states.
-# Decree <a href="http://pcdsh01.on.br/DecHV99.gif">3,188</a> (1999-09-30)
-# adds SE, AL, PB, PE, RN, CE, PI, MA and RR.
-Rule	Brazil	1999	only	-	Oct	 3	 0:00	1:00	S
-Rule	Brazil	2000	only	-	Feb	27	 0:00	0	-
-# Decree <a href="http://pcdsh01.on.br/DEC3592.htm">3,592</a> (2000-09-06)
-# adopted by the same states as before.
-# Decree <a href="http://pcdsh01.on.br/Dec3630.jpg">3,630</a> (2000-10-13)
-# repeals DST in PE and RR, effective 2000-10-15 00:00.
-# Decree <a href="http://pcdsh01.on.br/Dec3632.jpg">3,632</a> (2000-10-17)
-# repeals DST in SE, AL, PB, RN, CE, PI and MA, effective 2000-10-22 00:00.
-# Decree <a href="http://pcdsh01.on.br/figuras/HV3916.gif">3,916</a>
-# (2001-09-13) reestablishes DST in AL, CE, MA, PB, PE, PI, RN, SE.
-Rule	Brazil	2000	2001	-	Oct	Sun>=8	 0:00	1:00	S
-Rule	Brazil	2001	2006	-	Feb	Sun>=15	 0:00	0	-
-# Decree 4,399 (2002-10-01) repeals DST in AL, CE, MA, PB, PE, PI, RN, SE.
-# <a href="http://www.presidencia.gov.br/CCIVIL/decreto/2002/D4399.htm">4,399</a>
-Rule	Brazil	2002	only	-	Nov	 3	 0:00	1:00	S
-# Decree 4,844 (2003-09-24; corrected 2003-09-26) repeals DST in BA, MT, TO.
-# <a href="http://www.presidencia.gov.br/CCIVIL/decreto/2003/D4844.htm">4,844</a>
-Rule	Brazil	2003	only	-	Oct	19	 0:00	1:00	S
-# Decree 5,223 (2004-10-01) reestablishes DST in MT.
-# <a href="http://www.planalto.gov.br/ccivil_03/_Ato2004-2006/2004/Decreto/D5223.htm">5,223</a>
-Rule	Brazil	2004	only	-	Nov	 2	 0:00	1:00	S
-# Decree <a href="http://pcdsh01.on.br/DecHV5539.gif">5,539</a> (2005-09-19),
-# adopted by the same states as before.
-Rule	Brazil	2005	only	-	Oct	16	 0:00	1:00	S
-# Decree <a href="http://pcdsh01.on.br/DecHV5920.gif">5,920</a> (2006-10-03),
-# adopted by the same states as before.
-Rule	Brazil	2006	only	-	Nov	 5	 0:00	1:00	S
-Rule	Brazil	2007	only	-	Feb	25	 0:00	0	-
-# Decree <a href="http://pcdsh01.on.br/DecHV6212.gif">6,212</a> (2007-09-26),
-# adopted by the same states as before.
-Rule	Brazil	2007	only	-	Oct	Sun>=8	 0:00	1:00	S
-# From Frederico A. C. Neves (2008-09-10):
-# Acording to this decree
-# <a href="http://www.planalto.gov.br/ccivil_03/_Ato2007-2010/2008/Decreto/D6558.htm">
-# http://www.planalto.gov.br/ccivil_03/_Ato2007-2010/2008/Decreto/D6558.htm
-# </a>
-# [t]he DST period in Brazil now on will be from the 3rd Oct Sunday to the
-# 3rd Feb Sunday. There is an exception on the return date when this is
-# the Carnival Sunday then the return date will be the next Sunday...
-Rule	Brazil	2008	max	-	Oct	Sun>=15	0:00	1:00	S
-Rule	Brazil	2008	2011	-	Feb	Sun>=15	0:00	0	-
-Rule	Brazil	2012	only	-	Feb	Sun>=22	0:00	0	-
-Rule	Brazil	2013	2014	-	Feb	Sun>=15	0:00	0	-
-Rule	Brazil	2015	only	-	Feb	Sun>=22	0:00	0	-
-Rule	Brazil	2016	2022	-	Feb	Sun>=15	0:00	0	-
-Rule	Brazil	2023	only	-	Feb	Sun>=22	0:00	0	-
-Rule	Brazil	2024	2025	-	Feb	Sun>=15	0:00	0	-
-Rule	Brazil	2026	only	-	Feb	Sun>=22	0:00	0	-
-Rule	Brazil	2027	2033	-	Feb	Sun>=15	0:00	0	-
-Rule	Brazil	2034	only	-	Feb	Sun>=22	0:00	0	-
-Rule	Brazil	2035	2036	-	Feb	Sun>=15	0:00	0	-
-Rule	Brazil	2037	only	-	Feb	Sun>=22	0:00	0	-
-# From Arthur David Olson (2008-09-29):
-# The next is wrong in some years but is better than nothing.
-Rule	Brazil	2038	max	-	Feb	Sun>=15	0:00	0	-
-
-# The latest ruleset listed above says that the following states observe DST:
-# DF, ES, GO, MG, MS, MT, PR, RJ, RS, SC, SP.
-
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-#
-# Fernando de Noronha (administratively part of PE)
-Zone America/Noronha	-2:09:40 -	LMT	1914
-			-2:00	Brazil	FN%sT	1990 Sep 17
-			-2:00	-	FNT	1999 Sep 30
-			-2:00	Brazil	FN%sT	2000 Oct 15
-			-2:00	-	FNT	2001 Sep 13
-			-2:00	Brazil	FN%sT	2002 Oct  1
-			-2:00	-	FNT
-# Other Atlantic islands have no permanent settlement.
-# These include Trindade and Martin Vaz (administratively part of ES),
-# Atol das Rocas (RN), and Penedos de Sao Pedro e Sao Paulo (PE).
-# Fernando de Noronha was a separate territory from 1942-09-02 to 1989-01-01;
-# it also included the Penedos.
-#
-# Amapa (AP), east Para (PA)
-# East Para includes Belem, Maraba, Serra Norte, and Sao Felix do Xingu.
-# The division between east and west Para is the river Xingu.
-# In the north a very small part from the river Javary (now Jari I guess,
-# the border with Amapa) to the Amazon, then to the Xingu.
-Zone America/Belem	-3:13:56 -	LMT	1914
-			-3:00	Brazil	BR%sT	1988 Sep 12
-			-3:00	-	BRT
-#
-# west Para (PA)
-# West Para includes Altamira, Oribidos, Prainha, Oriximina, and Santarem.
-Zone America/Santarem	-3:38:48 -	LMT	1914
-			-4:00	Brazil	AM%sT	1988 Sep 12
-			-4:00	-	AMT	2008 Jun 24 00:00
-			-3:00	-	BRT
-#
-# Maranhao (MA), Piaui (PI), Ceara (CE), Rio Grande do Norte (RN),
-# Paraiba (PB)
-Zone America/Fortaleza	-2:34:00 -	LMT	1914
-			-3:00	Brazil	BR%sT	1990 Sep 17
-			-3:00	-	BRT	1999 Sep 30
-			-3:00	Brazil	BR%sT	2000 Oct 22
-			-3:00	-	BRT	2001 Sep 13
-			-3:00	Brazil	BR%sT	2002 Oct  1
-			-3:00	-	BRT
-#
-# Pernambuco (PE) (except Atlantic islands)
-Zone America/Recife	-2:19:36 -	LMT	1914
-			-3:00	Brazil	BR%sT	1990 Sep 17
-			-3:00	-	BRT	1999 Sep 30
-			-3:00	Brazil	BR%sT	2000 Oct 15
-			-3:00	-	BRT	2001 Sep 13
-			-3:00	Brazil	BR%sT	2002 Oct  1
-			-3:00	-	BRT
-#
-# Tocantins (TO)
-Zone America/Araguaina	-3:12:48 -	LMT	1914
-			-3:00	Brazil	BR%sT	1990 Sep 17
-			-3:00	-	BRT	1995 Sep 14
-			-3:00	Brazil	BR%sT	2003 Sep 24
-			-3:00	-	BRT
-#
-# Alagoas (AL), Sergipe (SE)
-Zone America/Maceio	-2:22:52 -	LMT	1914
-			-3:00	Brazil	BR%sT	1990 Sep 17
-			-3:00	-	BRT	1995 Oct 13
-			-3:00	Brazil	BR%sT	1996 Sep  4
-			-3:00	-	BRT	1999 Sep 30
-			-3:00	Brazil	BR%sT	2000 Oct 22
-			-3:00	-	BRT	2001 Sep 13
-			-3:00	Brazil	BR%sT	2002 Oct  1
-			-3:00	-	BRT
-#
-# Bahia (BA)
-# There are too many Salvadors elsewhere, so use America/Bahia instead
-# of America/Salvador.
-Zone America/Bahia	-2:34:04 -	LMT	1914
-			-3:00	Brazil	BR%sT	2003 Sep 24
-			-3:00	-	BRT
-#
-# Goias (GO), Distrito Federal (DF), Minas Gerais (MG),
-# Espirito Santo (ES), Rio de Janeiro (RJ), Sao Paulo (SP), Parana (PR),
-# Santa Catarina (SC), Rio Grande do Sul (RS)
-Zone America/Sao_Paulo	-3:06:28 -	LMT	1914
-			-3:00	Brazil	BR%sT	1963 Oct 23 00:00
-			-3:00	1:00	BRST	1964
-			-3:00	Brazil	BR%sT
-#
-# Mato Grosso do Sul (MS)
-Zone America/Campo_Grande -3:38:28 -	LMT	1914
-			-4:00	Brazil	AM%sT
-#
-# Mato Grosso (MT)
-Zone America/Cuiaba	-3:44:20 -	LMT	1914
-			-4:00	Brazil	AM%sT	2003 Sep 24
-			-4:00	-	AMT	2004 Oct  1
-			-4:00	Brazil	AM%sT
-#
-# Rondonia (RO)
-Zone America/Porto_Velho -4:15:36 -	LMT	1914
-			-4:00	Brazil	AM%sT	1988 Sep 12
-			-4:00	-	AMT
-#
-# Roraima (RR)
-Zone America/Boa_Vista	-4:02:40 -	LMT	1914
-			-4:00	Brazil	AM%sT	1988 Sep 12
-			-4:00	-	AMT	1999 Sep 30
-			-4:00	Brazil	AM%sT	2000 Oct 15
-			-4:00	-	AMT
-#
-# east Amazonas (AM): Boca do Acre, Jutai, Manaus, Floriano Peixoto
-# The great circle line from Tabatinga to Porto Acre divides
-# east from west Amazonas.
-Zone America/Manaus	-4:00:04 -	LMT	1914
-			-4:00	Brazil	AM%sT	1988 Sep 12
-			-4:00	-	AMT	1993 Sep 28
-			-4:00	Brazil	AM%sT	1994 Sep 22
-			-4:00	-	AMT
-#
-# west Amazonas (AM): Atalaia do Norte, Boca do Maoco, Benjamin Constant,
-#	Eirunepe, Envira, Ipixuna
-Zone America/Eirunepe	-4:39:28 -	LMT	1914
-			-5:00	Brazil	AC%sT	1988 Sep 12
-			-5:00	-	ACT	1993 Sep 28
-			-5:00	Brazil	AC%sT	1994 Sep 22
-			-5:00	-	ACT	2008 Jun 24 00:00
-			-4:00	-	AMT
-#
-# Acre (AC)
-Zone America/Rio_Branco	-4:31:12 -	LMT	1914
-			-5:00	Brazil	AC%sT	1988 Sep 12
-			-5:00	-	ACT	2008 Jun 24 00:00
-			-4:00	-	AMT
-
-# Chile
-
-# From Eduardo Krell (1995-10-19):
-# The law says to switch to DST at midnight [24:00] on the second SATURDAY
-# of October....  The law is the same for March and October.
-# (1998-09-29):
-# Because of the drought this year, the government decided to go into
-# DST earlier (saturday 9/26 at 24:00). This is a one-time change only ...
-# (unless there's another dry season next year, I guess).
-
-# From Julio I. Pacheco Troncoso (1999-03-18):
-# Because of the same drought, the government decided to end DST later,
-# on April 3, (one-time change).
-
-# From Oscar van Vlijmen (2006-10-08):
-# http://www.horaoficial.cl/cambio.htm
-
-# From Jesper Norgaard Welen (2006-10-08):
-# I think that there are some obvious mistakes in the suggested link
-# from Oscar van Vlijmen,... for instance entry 66 says that GMT-4
-# ended 1990-09-12 while entry 67 only begins GMT-3 at 1990-09-15
-# (they should have been 1990-09-15 and 1990-09-16 respectively), but
-# anyhow it clears up some doubts too.
-
-# From Paul Eggert (2006-12-27):
-# The following data for Chile and America/Santiago are from
-# <http://www.horaoficial.cl/horaof.htm> (2006-09-20), transcribed by
-# Jesper Norgaard Welen.  The data for Pacific/Easter are from Shanks
-# & Pottenger, except with DST transitions after 1932 cloned from
-# America/Santiago.  The pre-1980 Pacific/Easter data are dubious,
-# but we have no other source.
-
-# From German Poo-Caaman~o (2008-03-03):
-# Due to drought, Chile extends Daylight Time in three weeks.  This
-# is one-time change (Saturday 3/29 at 24:00 for America/Santiago
-# and Saturday 3/29 at 22:00 for Pacific/Easter)
-# The Supreme Decree is located at 
-# <a href="http://www.shoa.cl/servicios/supremo316.pdf">
-# http://www.shoa.cl/servicios/supremo316.pdf
-# </a>
-# and the instructions for 2008 are located in:
-# <a href="http://www.horaoficial.cl/cambio.htm">
-# http://www.horaoficial.cl/cambio.htm
-# </a>.
-
-# From Jose Miguel Garrido (2008-03-05):
-# ...
-# You could see the announces of the change on 
-# <a href="http://www.shoa.cl/noticias/2008/04hora/hora.htm">
-# http://www.shoa.cl/noticias/2008/04hora/hora.htm
-# </a>.
-
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Chile	1927	1932	-	Sep	 1	0:00	1:00	S
-Rule	Chile	1928	1932	-	Apr	 1	0:00	0	-
-Rule	Chile	1942	only	-	Jun	 1	4:00u	0	-
-Rule	Chile	1942	only	-	Aug	 1	5:00u	1:00	S
-Rule	Chile	1946	only	-	Jul	15	4:00u	1:00	S
-Rule	Chile	1946	only	-	Sep	 1	3:00u	0:00	-
-Rule	Chile	1947	only	-	Apr	 1	4:00u	0	-
-Rule	Chile	1968	only	-	Nov	 3	4:00u	1:00	S
-Rule	Chile	1969	only	-	Mar	30	3:00u	0	-
-Rule	Chile	1969	only	-	Nov	23	4:00u	1:00	S
-Rule	Chile	1970	only	-	Mar	29	3:00u	0	-
-Rule	Chile	1971	only	-	Mar	14	3:00u	0	-
-Rule	Chile	1970	1972	-	Oct	Sun>=9	4:00u	1:00	S
-Rule	Chile	1972	1986	-	Mar	Sun>=9	3:00u	0	-
-Rule	Chile	1973	only	-	Sep	30	4:00u	1:00	S
-Rule	Chile	1974	1987	-	Oct	Sun>=9	4:00u	1:00	S
-Rule	Chile	1987	only	-	Apr	12	3:00u	0	-
-Rule	Chile	1988	1989	-	Mar	Sun>=9	3:00u	0	-
-Rule	Chile	1988	only	-	Oct	Sun>=1	4:00u	1:00	S
-Rule	Chile	1989	only	-	Oct	Sun>=9	4:00u	1:00	S
-Rule	Chile	1990	only	-	Mar	18	3:00u	0	-
-Rule	Chile	1990	only	-	Sep	16	4:00u	1:00	S
-Rule	Chile	1991	1996	-	Mar	Sun>=9	3:00u	0	-
-Rule	Chile	1991	1997	-	Oct	Sun>=9	4:00u	1:00	S
-Rule	Chile	1997	only	-	Mar	30	3:00u	0	-
-Rule	Chile	1998	only	-	Mar	Sun>=9	3:00u	0	-
-Rule	Chile	1998	only	-	Sep	27	4:00u	1:00	S
-Rule	Chile	1999	only	-	Apr	 4	3:00u	0	-
-Rule	Chile	1999	max	-	Oct	Sun>=9	4:00u	1:00	S
-Rule	Chile	2000	2007	-	Mar	Sun>=9	3:00u	0	-
-# N.B.: the end of March 29 in Chile is March 30 in Universal time,
-# which is used below in specifying the transition.
-Rule	Chile	2008	only	-	Mar	30	3:00u	0	-
-Rule	Chile	2009	max	-	Mar	Sun>=9	3:00u	0	-
-# IATA SSIM anomalies: (1992-02) says 1992-03-14;
-# (1996-09) says 1998-03-08.  Ignore these.
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone America/Santiago	-4:42:46 -	LMT	1890
-			-4:42:46 -	SMT	1910 	    # Santiago Mean Time
-			-5:00	-	CLT	1916 Jul  1 # Chile Time
-			-4:42:46 -	SMT	1918 Sep  1 # Santiago Mean Time
-			-4:00	-	CLT	1919 Jul  1 # Chile Time
-			-4:42:46 -	SMT	1927 Sep  1 # Santiago Mean Time
-			-5:00	Chile	CL%sT	1947 May 22 # Chile Time
-			-4:00	Chile	CL%sT
-Zone Pacific/Easter	-7:17:44 -	LMT	1890
-			-7:17:28 -	EMT	1932 Sep    # Easter Mean Time
-			-7:00	Chile	EAS%sT	1982 Mar 13 21:00 # Easter I Time
-			-6:00	Chile	EAS%sT
-#
-# Sala y Gomez Island is like Pacific/Easter.
-# Other Chilean locations, including Juan Fernandez Is, San Ambrosio,
-# San Felix, and Antarctic bases, are like America/Santiago.
-
-# Colombia
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	CO	1992	only	-	May	 3	0:00	1:00	S
-Rule	CO	1993	only	-	Apr	 4	0:00	0	-
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	America/Bogota	-4:56:20 -	LMT	1884 Mar 13
-			-4:56:20 -	BMT	1914 Nov 23 # Bogota Mean Time
-			-5:00	CO	CO%sT	# Colombia Time
-# Malpelo, Providencia, San Andres
-# no information; probably like America/Bogota
-
-# Curacao
-#
-# From Paul Eggert (2006-03-22):
-# Shanks & Pottenger say that The Bottom and Philipsburg have been at
-# -4:00 since standard time was introduced on 1912-03-02; and that
-# Kralendijk and Rincon used Kralendijk Mean Time (-4:33:08) from
-# 1912-02-02 to 1965-01-01.  The former is dubious, since S&P also say
-# Saba Island has been like Curacao.
-# This all predates our 1970 cutoff, though.
-#
-# By July 2007 Curacao and St Maarten are planned to become
-# associated states within the Netherlands, much like Aruba;
-# Bonaire, Saba and St Eustatius would become directly part of the
-# Netherlands as Kingdom Islands.  This won't affect their time zones
-# though, as far as we know.
-#
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	America/Curacao	-4:35:44 -	LMT	1912 Feb 12	# Willemstad
-			-4:30	-	ANT	1965 # Netherlands Antilles Time
-			-4:00	-	AST
-
-# Ecuador
-#
-# From Paul Eggert (2007-03-04):
-# Apparently Ecuador had a failed experiment with DST in 1992.
-# <http://midena.gov.ec/content/view/1261/208/> (2007-02-27) and
-# <http://www.hoy.com.ec/NoticiaNue.asp?row_id=249856> (2006-11-06) both
-# talk about "hora Sixto".  Leave this alone for now, as we have no data.
-#
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone America/Guayaquil	-5:19:20 -	LMT	1890
-			-5:14:00 -	QMT	1931 # Quito Mean Time
-			-5:00	-	ECT	     # Ecuador Time
-Zone Pacific/Galapagos	-5:58:24 -	LMT	1931 # Puerto Baquerizo Moreno
-			-5:00	-	ECT	1986
-			-6:00	-	GALT	     # Galapagos Time
-
-# Falklands
-
-# From Paul Eggert (2006-03-22):
-# Between 1990 and 2000 inclusive, Shanks & Pottenger and the IATA agree except
-# the IATA gives 1996-09-08.  Go with Shanks & Pottenger.
-
-# From Falkland Islands Government Office, London (2001-01-22)
-# via Jesper Norgaard:
-# ... the clocks revert back to Local Mean Time at 2 am on Sunday 15
-# April 2001 and advance one hour to summer time at 2 am on Sunday 2
-# September.  It is anticipated that the clocks will revert back at 2
-# am on Sunday 21 April 2002 and advance to summer time at 2 am on
-# Sunday 1 September.
-
-# From Rives McDow (2001-02-13):
-#
-# I have communicated several times with people there, and the last
-# time I had communications that was helpful was in 1998.  Here is
-# what was said then:
-#
-# "The general rule was that Stanley used daylight saving and the Camp
-# did not. However for various reasons many people in the Camp have
-# started to use daylight saving (known locally as 'Stanley Time')
-# There is no rule as to who uses daylight saving - it is a matter of
-# personal choice and so it is impossible to draw a map showing who
-# uses it and who does not. Any list would be out of date as soon as
-# it was produced. This year daylight saving ended on April 18/19th
-# and started again on September 12/13th.  I do not know what the rule
-# is, but can find out if you like.  We do not change at the same time
-# as UK or Chile."
-#
-# I did have in my notes that the rule was "Second Saturday in Sep at
-# 0:00 until third Saturday in Apr at 0:00".  I think that this does
-# not agree in some cases with Shanks; is this true?
-#
-# Also, there is no mention in the list that some areas in the
-# Falklands do not use DST.  I have found in my communications there
-# that these areas are on the western half of East Falkland and all of
-# West Falkland.  Stanley is the only place that consistently observes
-# DST.  Again, as in other places in the world, the farmers don't like
-# it.  West Falkland is almost entirely sheep farmers.
-#
-# I know one lady there that keeps a list of which farm keeps DST and
-# which doesn't each year.  She runs a shop in Stanley, and says that
-# the list changes each year.  She uses it to communicate to her
-# customers, catching them when they are home for lunch or dinner.
-
-# From Paul Eggert (2001-03-05):
-# For now, we'll just record the time in Stanley, since we have no
-# better info.
-
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Falk	1937	1938	-	Sep	lastSun	0:00	1:00	S
-Rule	Falk	1938	1942	-	Mar	Sun>=19	0:00	0	-
-Rule	Falk	1939	only	-	Oct	1	0:00	1:00	S
-Rule	Falk	1940	1942	-	Sep	lastSun	0:00	1:00	S
-Rule	Falk	1943	only	-	Jan	1	0:00	0	-
-Rule	Falk	1983	only	-	Sep	lastSun	0:00	1:00	S
-Rule	Falk	1984	1985	-	Apr	lastSun	0:00	0	-
-Rule	Falk	1984	only	-	Sep	16	0:00	1:00	S
-Rule	Falk	1985	2000	-	Sep	Sun>=9	0:00	1:00	S
-Rule	Falk	1986	2000	-	Apr	Sun>=16	0:00	0	-
-Rule	Falk	2001	max	-	Apr	Sun>=15	2:00	0	-
-Rule	Falk	2001	max	-	Sep	Sun>=1	2:00	1:00	S
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone Atlantic/Stanley	-3:51:24 -	LMT	1890
-			-3:51:24 -	SMT	1912 Mar 12  # Stanley Mean Time
-			-4:00	Falk	FK%sT	1983 May     # Falkland Is Time
-			-3:00	Falk	FK%sT	1985 Sep 15
-			-4:00	Falk	FK%sT
-
-# French Guiana
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone America/Cayenne	-3:29:20 -	LMT	1911 Jul
-			-4:00	-	GFT	1967 Oct # French Guiana Time
-			-3:00	-	GFT
-
-# Guyana
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	America/Guyana	-3:52:40 -	LMT	1915 Mar	# Georgetown
-			-3:45	-	GBGT	1966 May 26 # Br Guiana Time
-			-3:45	-	GYT	1975 Jul 31 # Guyana Time
-			-3:00	-	GYT	1991
-# IATA SSIM (1996-06) says -4:00.  Assume a 1991 switch.
-			-4:00	-	GYT
-
-# Paraguay
-# From Paul Eggert (2006-03-22):
-# Shanks & Pottenger say that spring transitions are from 01:00 -> 02:00,
-# and autumn transitions are from 00:00 -> 23:00.  Go with pre-1999
-# editions of Shanks, and with the IATA, who say transitions occur at 00:00.
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Para	1975	1988	-	Oct	 1	0:00	1:00	S
-Rule	Para	1975	1978	-	Mar	 1	0:00	0	-
-Rule	Para	1979	1991	-	Apr	 1	0:00	0	-
-Rule	Para	1989	only	-	Oct	22	0:00	1:00	S
-Rule	Para	1990	only	-	Oct	 1	0:00	1:00	S
-Rule	Para	1991	only	-	Oct	 6	0:00	1:00	S
-Rule	Para	1992	only	-	Mar	 1	0:00	0	-
-Rule	Para	1992	only	-	Oct	 5	0:00	1:00	S
-Rule	Para	1993	only	-	Mar	31	0:00	0	-
-Rule	Para	1993	1995	-	Oct	 1	0:00	1:00	S
-Rule	Para	1994	1995	-	Feb	lastSun	0:00	0	-
-Rule	Para	1996	only	-	Mar	 1	0:00	0	-
-# IATA SSIM (2000-02) says 1999-10-10; ignore this for now.
-# From Steffen Thorsen (2000-10-02):
-# I have three independent reports that Paraguay changed to DST this Sunday
-# (10-01).
-#
-# Translated by Gwillim Law (2001-02-27) from
-# <a href="http://www.diarionoticias.com.py/011000/nacional/naciona1.htm">
-# Noticias, a daily paper in Asuncion, Paraguay (2000-10-01)
-# </a>:
-# Starting at 0:00 today, the clock will be set forward 60 minutes, in
-# fulfillment of Decree No. 7,273 of the Executive Power....  The time change
-# system has been operating for several years.  Formerly there was a separate
-# decree each year; the new law has the same effect, but permanently.  Every
-# year, the time will change on the first Sunday of October; likewise, the
-# clock will be set back on the first Sunday of March.
-#
-Rule	Para	1996	2001	-	Oct	Sun>=1	0:00	1:00	S
-# IATA SSIM (1997-09) says Mar 1; go with Shanks & Pottenger.
-Rule	Para	1997	only	-	Feb	lastSun	0:00	0	-
-# Shanks & Pottenger say 1999-02-28; IATA SSIM (1999-02) says 1999-02-27, but
-# (1999-09) reports no date; go with above sources and Gerd Knops (2001-02-27).
-Rule	Para	1998	2001	-	Mar	Sun>=1	0:00	0	-
-# From Rives McDow (2002-02-28):
-# A decree was issued in Paraguay (no. 16350) on 2002-02-26 that changed the
-# dst method to be from the first Sunday in September to the first Sunday in
-# April.
-Rule	Para	2002	2004	-	Apr	Sun>=1	0:00	0	-
-Rule	Para	2002	2003	-	Sep	Sun>=1	0:00	1:00	S
-#
-# From Jesper Norgaard Welen (2005-01-02):
-# There are several sources that claim that Paraguay made
-# a timezone rule change in autumn 2004.
-# From Steffen Thorsen (2005-01-05):
-# Decree 1,867 (2004-03-05)
-# From Carlos Raul Perasso via Jesper Norgaard Welen (2006-10-13)
-# <http://www.presidencia.gov.py/decretos/D1867.pdf>
-Rule	Para	2004	max	-	Oct	Sun>=15	0:00	1:00	S
-Rule	Para	2005	max	-	Mar	Sun>=8	0:00	0	-
-
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone America/Asuncion	-3:50:40 -	LMT	1890
-			-3:50:40 -	AMT	1931 Oct 10 # Asuncion Mean Time
-			-4:00	-	PYT	1972 Oct # Paraguay Time
-			-3:00	-	PYT	1974 Apr
-			-4:00	Para	PY%sT
-
-# Peru
-#
-# <a href="news:xrGmb.39935$gA1.13896113@news4.srv.hcvlny.cv.net">
-# From Evelyn C. Leeper via Mark Brader (2003-10-26):</a>
-# When we were in Peru in 1985-1986, they apparently switched over
-# sometime between December 29 and January 3 while we were on the Amazon.
-#
-# From Paul Eggert (2006-03-22):
-# Shanks & Pottenger don't have this transition.  Assume 1986 was like 1987.
-
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Peru	1938	only	-	Jan	 1	0:00	1:00	S
-Rule	Peru	1938	only	-	Apr	 1	0:00	0	-
-Rule	Peru	1938	1939	-	Sep	lastSun	0:00	1:00	S
-Rule	Peru	1939	1940	-	Mar	Sun>=24	0:00	0	-
-Rule	Peru	1986	1987	-	Jan	 1	0:00	1:00	S
-Rule	Peru	1986	1987	-	Apr	 1	0:00	0	-
-Rule	Peru	1990	only	-	Jan	 1	0:00	1:00	S
-Rule	Peru	1990	only	-	Apr	 1	0:00	0	-
-# IATA is ambiguous for 1993/1995; go with Shanks & Pottenger.
-Rule	Peru	1994	only	-	Jan	 1	0:00	1:00	S
-Rule	Peru	1994	only	-	Apr	 1	0:00	0	-
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	America/Lima	-5:08:12 -	LMT	1890
-			-5:08:36 -	LMT	1908 Jul 28 # Lima Mean Time?
-			-5:00	Peru	PE%sT	# Peru Time
-
-# South Georgia
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone Atlantic/South_Georgia -2:26:08 -	LMT	1890		# Grytviken
-			-2:00	-	GST	# South Georgia Time
-
-# South Sandwich Is
-# uninhabited; scientific personnel have wintered
-
-# Suriname
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone America/Paramaribo	-3:40:40 -	LMT	1911
-			-3:40:52 -	PMT	1935     # Paramaribo Mean Time
-			-3:40:36 -	PMT	1945 Oct # The capital moved?
-			-3:30	-	NEGT	1975 Nov 20 # Dutch Guiana Time
-			-3:30	-	SRT	1984 Oct # Suriname Time
-			-3:00	-	SRT
-
-# Trinidad and Tobago
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone America/Port_of_Spain -4:06:04 -	LMT	1912 Mar 2
-			-4:00	-	AST
-
-# Uruguay
-# From Paul Eggert (1993-11-18):
-# Uruguay wins the prize for the strangest peacetime manipulation of the rules.
-# From Shanks & Pottenger:
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-# Whitman gives 1923 Oct 1; go with Shanks & Pottenger.
-Rule	Uruguay	1923	only	-	Oct	 2	 0:00	0:30	HS
-Rule	Uruguay	1924	1926	-	Apr	 1	 0:00	0	-
-Rule	Uruguay	1924	1925	-	Oct	 1	 0:00	0:30	HS
-Rule	Uruguay	1933	1935	-	Oct	lastSun	 0:00	0:30	HS
-# Shanks & Pottenger give 1935 Apr 1 0:00 & 1936 Mar 30 0:00; go with Whitman.
-Rule	Uruguay	1934	1936	-	Mar	Sat>=25	23:30s	0	-
-Rule	Uruguay	1936	only	-	Nov	 1	 0:00	0:30	HS
-Rule	Uruguay	1937	1941	-	Mar	lastSun	 0:00	0	-
-# Whitman gives 1937 Oct 3; go with Shanks & Pottenger.
-Rule	Uruguay	1937	1940	-	Oct	lastSun	 0:00	0:30	HS
-# Whitman gives 1941 Oct 24 - 1942 Mar 27, 1942 Dec 14 - 1943 Apr 13,
-# and 1943 Apr 13 ``to present time''; go with Shanks & Pottenger.
-Rule	Uruguay	1941	only	-	Aug	 1	 0:00	0:30	HS
-Rule	Uruguay	1942	only	-	Jan	 1	 0:00	0	-
-Rule	Uruguay	1942	only	-	Dec	14	 0:00	1:00	S
-Rule	Uruguay	1943	only	-	Mar	14	 0:00	0	-
-Rule	Uruguay	1959	only	-	May	24	 0:00	1:00	S
-Rule	Uruguay	1959	only	-	Nov	15	 0:00	0	-
-Rule	Uruguay	1960	only	-	Jan	17	 0:00	1:00	S
-Rule	Uruguay	1960	only	-	Mar	 6	 0:00	0	-
-Rule	Uruguay	1965	1967	-	Apr	Sun>=1	 0:00	1:00	S
-Rule	Uruguay	1965	only	-	Sep	26	 0:00	0	-
-Rule	Uruguay	1966	1967	-	Oct	31	 0:00	0	-
-Rule	Uruguay	1968	1970	-	May	27	 0:00	0:30	HS
-Rule	Uruguay	1968	1970	-	Dec	 2	 0:00	0	-
-Rule	Uruguay	1972	only	-	Apr	24	 0:00	1:00	S
-Rule	Uruguay	1972	only	-	Aug	15	 0:00	0	-
-Rule	Uruguay	1974	only	-	Mar	10	 0:00	0:30	HS
-Rule	Uruguay	1974	only	-	Dec	22	 0:00	1:00	S
-Rule	Uruguay	1976	only	-	Oct	 1	 0:00	0	-
-Rule	Uruguay	1977	only	-	Dec	 4	 0:00	1:00	S
-Rule	Uruguay	1978	only	-	Apr	 1	 0:00	0	-
-Rule	Uruguay	1979	only	-	Oct	 1	 0:00	1:00	S
-Rule	Uruguay	1980	only	-	May	 1	 0:00	0	-
-Rule	Uruguay	1987	only	-	Dec	14	 0:00	1:00	S
-Rule	Uruguay	1988	only	-	Mar	14	 0:00	0	-
-Rule	Uruguay	1988	only	-	Dec	11	 0:00	1:00	S
-Rule	Uruguay	1989	only	-	Mar	12	 0:00	0	-
-Rule	Uruguay	1989	only	-	Oct	29	 0:00	1:00	S
-# Shanks & Pottenger say no DST was observed in 1990/1 and 1991/2,
-# and that 1992/3's DST was from 10-25 to 03-01.  Go with IATA.
-Rule	Uruguay	1990	1992	-	Mar	Sun>=1	 0:00	0	-
-Rule	Uruguay	1990	1991	-	Oct	Sun>=21	 0:00	1:00	S
-Rule	Uruguay	1992	only	-	Oct	18	 0:00	1:00	S
-Rule	Uruguay	1993	only	-	Feb	28	 0:00	0	-
-# From Eduardo Cota (2004-09-20):
-# The uruguayan government has decreed a change in the local time....
-# http://www.presidencia.gub.uy/decretos/2004091502.htm
-Rule	Uruguay	2004	only	-	Sep	19	 0:00	1:00	S
-# From Steffen Thorsen (2005-03-11):
-# Uruguay's DST was scheduled to end on Sunday, 2005-03-13, but in order to
-# save energy ... it was postponed two weeks....
-# http://www.presidencia.gub.uy/_Web/noticias/2005/03/2005031005.htm
-Rule	Uruguay	2005	only	-	Mar	27	 2:00	0	-
-# From Eduardo Cota (2005-09-27):
-# http://www.presidencia.gub.uy/_Web/decretos/2005/09/CM%20119_09%2009%202005_00001.PDF
-# This means that from 2005-10-09 at 02:00 local time, until 2006-03-12 at
-# 02:00 local time, official time in Uruguay will be at GMT -2.
-Rule	Uruguay	2005	only	-	Oct	 9	 2:00	1:00	S
-Rule	Uruguay	2006	only	-	Mar	12	 2:00	0	-
-# From Jesper Norgaard Welen (2006-09-06):
-# http://www.presidencia.gub.uy/_web/decretos/2006/09/CM%20210_08%2006%202006_00001.PDF
-Rule	Uruguay	2006	max	-	Oct	Sun>=1	 2:00	1:00	S
-Rule	Uruguay	2007	max	-	Mar	Sun>=8	 2:00	0	-
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone America/Montevideo	-3:44:44 -	LMT	1898 Jun 28
-			-3:44:44 -	MMT	1920 May  1	# Montevideo MT
-			-3:30	Uruguay	UY%sT	1942 Dec 14	# Uruguay Time
-			-3:00	Uruguay	UY%sT
-
-# Venezuela
-#
-# From John Stainforth (2007-11-28):
-# ... the change for Venezuela originally expected for 2007-12-31 has
-# been brought forward to 2007-12-09.  The official announcement was
-# published today in the "Gaceta Oficial de la Republica Bolivariana
-# de Venezuela, numero 38.819" (official document for all laws or
-# resolution publication)
-# http://www.globovision.com/news.php?nid=72208
-
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	America/Caracas	-4:27:44 -	LMT	1890
-			-4:27:40 -	CMT	1912 Feb 12 # Caracas Mean Time?
-			-4:30	-	VET	1965	     # Venezuela Time
-			-4:00	-	VET	2007 Dec  9 03:00
-			-4:30	-	VET
diff --git a/tools/zoneinfo/tzdata2009s/zone.tab b/tools/zoneinfo/tzdata2009s/zone.tab
deleted file mode 100644
index 0f91941..0000000
--- a/tools/zoneinfo/tzdata2009s/zone.tab
+++ /dev/null
@@ -1,429 +0,0 @@
-# <pre>
-# @(#)zone.tab	8.29
-# This file is in the public domain, so clarified as of
-# 2009-05-17 by Arthur David Olson.
-#
-# TZ zone descriptions
-#
-# From Paul Eggert (1996-08-05):
-#
-# This file contains a table with the following columns:
-# 1.  ISO 3166 2-character country code.  See the file `iso3166.tab'.
-# 2.  Latitude and longitude of the zone's principal location
-#     in ISO 6709 sign-degrees-minutes-seconds format,
-#     either +-DDMM+-DDDMM or +-DDMMSS+-DDDMMSS,
-#     first latitude (+ is north), then longitude (+ is east).
-# 3.  Zone name used in value of TZ environment variable.
-# 4.  Comments; present if and only if the country has multiple rows.
-#
-# Columns are separated by a single tab.
-# The table is sorted first by country, then an order within the country that
-# (1) makes some geographical sense, and
-# (2) puts the most populous zones first, where that does not contradict (1).
-#
-# Lines beginning with `#' are comments.
-#
-#country-
-#code	coordinates	TZ			comments
-AD	+4230+00131	Europe/Andorra
-AE	+2518+05518	Asia/Dubai
-AF	+3431+06912	Asia/Kabul
-AG	+1703-06148	America/Antigua
-AI	+1812-06304	America/Anguilla
-AL	+4120+01950	Europe/Tirane
-AM	+4011+04430	Asia/Yerevan
-AN	+1211-06900	America/Curacao
-AO	-0848+01314	Africa/Luanda
-AQ	-7750+16636	Antarctica/McMurdo	McMurdo Station, Ross Island
-AQ	-9000+00000	Antarctica/South_Pole	Amundsen-Scott Station, South Pole
-AQ	-6734-06808	Antarctica/Rothera	Rothera Station, Adelaide Island
-AQ	-6448-06406	Antarctica/Palmer	Palmer Station, Anvers Island
-AQ	-6736+06253	Antarctica/Mawson	Mawson Station, Holme Bay
-AQ	-6835+07758	Antarctica/Davis	Davis Station, Vestfold Hills
-AQ	-6617+11031	Antarctica/Casey	Casey Station, Bailey Peninsula
-AQ	-7824+10654	Antarctica/Vostok	Vostok Station, S Magnetic Pole
-AQ	-6640+14001	Antarctica/DumontDUrville	Dumont-d'Urville Station, Terre Adelie
-AQ	-690022+0393524	Antarctica/Syowa	Syowa Station, E Ongul I
-AR	-3436-05827	America/Argentina/Buenos_Aires	Buenos Aires (BA, CF)
-AR	-3124-06411	America/Argentina/Cordoba	most locations (CB, CC, CN, ER, FM, MN, SE, SF)
-AR	-2447-06525	America/Argentina/Salta	(SA, LP, NQ, RN)
-AR	-2411-06518	America/Argentina/Jujuy	Jujuy (JY)
-AR	-2649-06513	America/Argentina/Tucuman	Tucuman (TM)
-AR	-2828-06547	America/Argentina/Catamarca	Catamarca (CT), Chubut (CH)
-AR	-2926-06651	America/Argentina/La_Rioja	La Rioja (LR)
-AR	-3132-06831	America/Argentina/San_Juan	San Juan (SJ)
-AR	-3253-06849	America/Argentina/Mendoza	Mendoza (MZ)
-AR	-3319-06621	America/Argentina/San_Luis	San Luis (SL)
-AR	-5138-06913	America/Argentina/Rio_Gallegos	Santa Cruz (SC)
-AR	-5448-06818	America/Argentina/Ushuaia	Tierra del Fuego (TF)
-AS	-1416-17042	Pacific/Pago_Pago
-AT	+4813+01620	Europe/Vienna
-AU	-3133+15905	Australia/Lord_Howe	Lord Howe Island
-AU	-4253+14719	Australia/Hobart	Tasmania - most locations
-AU	-3956+14352	Australia/Currie	Tasmania - King Island
-AU	-3749+14458	Australia/Melbourne	Victoria
-AU	-3352+15113	Australia/Sydney	New South Wales - most locations
-AU	-3157+14127	Australia/Broken_Hill	New South Wales - Yancowinna
-AU	-2728+15302	Australia/Brisbane	Queensland - most locations
-AU	-2016+14900	Australia/Lindeman	Queensland - Holiday Islands
-AU	-3455+13835	Australia/Adelaide	South Australia
-AU	-1228+13050	Australia/Darwin	Northern Territory
-AU	-3157+11551	Australia/Perth	Western Australia - most locations
-AU	-3143+12852	Australia/Eucla	Western Australia - Eucla area
-AW	+1230-06958	America/Aruba
-AX	+6006+01957	Europe/Mariehamn
-AZ	+4023+04951	Asia/Baku
-BA	+4352+01825	Europe/Sarajevo
-BB	+1306-05937	America/Barbados
-BD	+2343+09025	Asia/Dhaka
-BE	+5050+00420	Europe/Brussels
-BF	+1222-00131	Africa/Ouagadougou
-BG	+4241+02319	Europe/Sofia
-BH	+2623+05035	Asia/Bahrain
-BI	-0323+02922	Africa/Bujumbura
-BJ	+0629+00237	Africa/Porto-Novo
-BL	+1753-06251	America/St_Barthelemy
-BM	+3217-06446	Atlantic/Bermuda
-BN	+0456+11455	Asia/Brunei
-BO	-1630-06809	America/La_Paz
-BR	-0351-03225	America/Noronha	Atlantic islands
-BR	-0127-04829	America/Belem	Amapa, E Para
-BR	-0343-03830	America/Fortaleza	NE Brazil (MA, PI, CE, RN, PB)
-BR	-0803-03454	America/Recife	Pernambuco
-BR	-0712-04812	America/Araguaina	Tocantins
-BR	-0940-03543	America/Maceio	Alagoas, Sergipe
-BR	-1259-03831	America/Bahia	Bahia
-BR	-2332-04637	America/Sao_Paulo	S & SE Brazil (GO, DF, MG, ES, RJ, SP, PR, SC, RS)
-BR	-2027-05437	America/Campo_Grande	Mato Grosso do Sul
-BR	-1535-05605	America/Cuiaba	Mato Grosso
-BR	-0226-05452	America/Santarem	W Para
-BR	-0846-06354	America/Porto_Velho	Rondonia
-BR	+0249-06040	America/Boa_Vista	Roraima
-BR	-0308-06001	America/Manaus	E Amazonas
-BR	-0640-06952	America/Eirunepe	W Amazonas
-BR	-0958-06748	America/Rio_Branco	Acre
-BS	+2505-07721	America/Nassau
-BT	+2728+08939	Asia/Thimphu
-BW	-2439+02555	Africa/Gaborone
-BY	+5354+02734	Europe/Minsk
-BZ	+1730-08812	America/Belize
-CA	+4734-05243	America/St_Johns	Newfoundland Time, including SE Labrador
-CA	+4439-06336	America/Halifax	Atlantic Time - Nova Scotia (most places), PEI
-CA	+4612-05957	America/Glace_Bay	Atlantic Time - Nova Scotia - places that did not observe DST 1966-1971
-CA	+4606-06447	America/Moncton	Atlantic Time - New Brunswick
-CA	+5320-06025	America/Goose_Bay	Atlantic Time - Labrador - most locations
-CA	+5125-05707	America/Blanc-Sablon	Atlantic Standard Time - Quebec - Lower North Shore
-CA	+4531-07334	America/Montreal	Eastern Time - Quebec - most locations
-CA	+4339-07923	America/Toronto	Eastern Time - Ontario - most locations
-CA	+4901-08816	America/Nipigon	Eastern Time - Ontario & Quebec - places that did not observe DST 1967-1973
-CA	+4823-08915	America/Thunder_Bay	Eastern Time - Thunder Bay, Ontario
-CA	+6344-06828	America/Iqaluit	Eastern Time - east Nunavut - most locations
-CA	+6608-06544	America/Pangnirtung	Eastern Time - Pangnirtung, Nunavut
-CA	+744144-0944945	America/Resolute	Eastern Standard Time - Resolute, Nunavut
-CA	+484531-0913718	America/Atikokan	Eastern Standard Time - Atikokan, Ontario and Southampton I, Nunavut
-CA	+624900-0920459	America/Rankin_Inlet	Central Time - central Nunavut
-CA	+4953-09709	America/Winnipeg	Central Time - Manitoba & west Ontario
-CA	+4843-09434	America/Rainy_River	Central Time - Rainy River & Fort Frances, Ontario
-CA	+5024-10439	America/Regina	Central Standard Time - Saskatchewan - most locations
-CA	+5017-10750	America/Swift_Current	Central Standard Time - Saskatchewan - midwest
-CA	+5333-11328	America/Edmonton	Mountain Time - Alberta, east British Columbia & west Saskatchewan
-CA	+690650-1050310	America/Cambridge_Bay	Mountain Time - west Nunavut
-CA	+6227-11421	America/Yellowknife	Mountain Time - central Northwest Territories
-CA	+682059-1334300	America/Inuvik	Mountain Time - west Northwest Territories
-CA	+5946-12014	America/Dawson_Creek	Mountain Standard Time - Dawson Creek & Fort Saint John, British Columbia
-CA	+4916-12307	America/Vancouver	Pacific Time - west British Columbia
-CA	+6043-13503	America/Whitehorse	Pacific Time - south Yukon
-CA	+6404-13925	America/Dawson	Pacific Time - north Yukon
-CC	-1210+09655	Indian/Cocos
-CD	-0418+01518	Africa/Kinshasa	west Dem. Rep. of Congo
-CD	-1140+02728	Africa/Lubumbashi	east Dem. Rep. of Congo
-CF	+0422+01835	Africa/Bangui
-CG	-0416+01517	Africa/Brazzaville
-CH	+4723+00832	Europe/Zurich
-CI	+0519-00402	Africa/Abidjan
-CK	-2114-15946	Pacific/Rarotonga
-CL	-3327-07040	America/Santiago	most locations
-CL	-2709-10926	Pacific/Easter	Easter Island & Sala y Gomez
-CM	+0403+00942	Africa/Douala
-CN	+3114+12128	Asia/Shanghai	east China - Beijing, Guangdong, Shanghai, etc.
-CN	+4545+12641	Asia/Harbin	Heilongjiang (except Mohe), Jilin
-CN	+2934+10635	Asia/Chongqing	central China - Sichuan, Yunnan, Guangxi, Shaanxi, Guizhou, etc.
-CN	+4348+08735	Asia/Urumqi	most of Tibet & Xinjiang
-CN	+3929+07559	Asia/Kashgar	west Tibet & Xinjiang
-CO	+0436-07405	America/Bogota
-CR	+0956-08405	America/Costa_Rica
-CU	+2308-08222	America/Havana
-CV	+1455-02331	Atlantic/Cape_Verde
-CX	-1025+10543	Indian/Christmas
-CY	+3510+03322	Asia/Nicosia
-CZ	+5005+01426	Europe/Prague
-DE	+5230+01322	Europe/Berlin
-DJ	+1136+04309	Africa/Djibouti
-DK	+5540+01235	Europe/Copenhagen
-DM	+1518-06124	America/Dominica
-DO	+1828-06954	America/Santo_Domingo
-DZ	+3647+00303	Africa/Algiers
-EC	-0210-07950	America/Guayaquil	mainland
-EC	-0054-08936	Pacific/Galapagos	Galapagos Islands
-EE	+5925+02445	Europe/Tallinn
-EG	+3003+03115	Africa/Cairo
-EH	+2709-01312	Africa/El_Aaiun
-ER	+1520+03853	Africa/Asmara
-ES	+4024-00341	Europe/Madrid	mainland
-ES	+3553-00519	Africa/Ceuta	Ceuta & Melilla
-ES	+2806-01524	Atlantic/Canary	Canary Islands
-ET	+0902+03842	Africa/Addis_Ababa
-FI	+6010+02458	Europe/Helsinki
-FJ	-1808+17825	Pacific/Fiji
-FK	-5142-05751	Atlantic/Stanley
-FM	+0725+15147	Pacific/Truk	Truk (Chuuk) and Yap
-FM	+0658+15813	Pacific/Ponape	Ponape (Pohnpei)
-FM	+0519+16259	Pacific/Kosrae	Kosrae
-FO	+6201-00646	Atlantic/Faroe
-FR	+4852+00220	Europe/Paris
-GA	+0023+00927	Africa/Libreville
-GB	+513030-0000731	Europe/London
-GD	+1203-06145	America/Grenada
-GE	+4143+04449	Asia/Tbilisi
-GF	+0456-05220	America/Cayenne
-GG	+4927-00232	Europe/Guernsey
-GH	+0533-00013	Africa/Accra
-GI	+3608-00521	Europe/Gibraltar
-GL	+6411-05144	America/Godthab	most locations
-GL	+7646-01840	America/Danmarkshavn	east coast, north of Scoresbysund
-GL	+7029-02158	America/Scoresbysund	Scoresbysund / Ittoqqortoormiit
-GL	+7634-06847	America/Thule	Thule / Pituffik
-GM	+1328-01639	Africa/Banjul
-GN	+0931-01343	Africa/Conakry
-GP	+1614-06132	America/Guadeloupe
-GQ	+0345+00847	Africa/Malabo
-GR	+3758+02343	Europe/Athens
-GS	-5416-03632	Atlantic/South_Georgia
-GT	+1438-09031	America/Guatemala
-GU	+1328+14445	Pacific/Guam
-GW	+1151-01535	Africa/Bissau
-GY	+0648-05810	America/Guyana
-HK	+2217+11409	Asia/Hong_Kong
-HN	+1406-08713	America/Tegucigalpa
-HR	+4548+01558	Europe/Zagreb
-HT	+1832-07220	America/Port-au-Prince
-HU	+4730+01905	Europe/Budapest
-ID	-0610+10648	Asia/Jakarta	Java & Sumatra
-ID	-0002+10920	Asia/Pontianak	west & central Borneo
-ID	-0507+11924	Asia/Makassar	east & south Borneo, Celebes, Bali, Nusa Tengarra, west Timor
-ID	-0232+14042	Asia/Jayapura	Irian Jaya & the Moluccas
-IE	+5320-00615	Europe/Dublin
-IL	+3146+03514	Asia/Jerusalem
-IM	+5409-00428	Europe/Isle_of_Man
-IN	+2232+08822	Asia/Kolkata
-IO	-0720+07225	Indian/Chagos
-IQ	+3321+04425	Asia/Baghdad
-IR	+3540+05126	Asia/Tehran
-IS	+6409-02151	Atlantic/Reykjavik
-IT	+4154+01229	Europe/Rome
-JE	+4912-00207	Europe/Jersey
-JM	+1800-07648	America/Jamaica
-JO	+3157+03556	Asia/Amman
-JP	+353916+1394441	Asia/Tokyo
-KE	-0117+03649	Africa/Nairobi
-KG	+4254+07436	Asia/Bishkek
-KH	+1133+10455	Asia/Phnom_Penh
-KI	+0125+17300	Pacific/Tarawa	Gilbert Islands
-KI	-0308-17105	Pacific/Enderbury	Phoenix Islands
-KI	+0152-15720	Pacific/Kiritimati	Line Islands
-KM	-1141+04316	Indian/Comoro
-KN	+1718-06243	America/St_Kitts
-KP	+3901+12545	Asia/Pyongyang
-KR	+3733+12658	Asia/Seoul
-KW	+2920+04759	Asia/Kuwait
-KY	+1918-08123	America/Cayman
-KZ	+4315+07657	Asia/Almaty	most locations
-KZ	+4448+06528	Asia/Qyzylorda	Qyzylorda (Kyzylorda, Kzyl-Orda)
-KZ	+5017+05710	Asia/Aqtobe	Aqtobe (Aktobe)
-KZ	+4431+05016	Asia/Aqtau	Atyrau (Atirau, Gur'yev), Mangghystau (Mankistau)
-KZ	+5113+05121	Asia/Oral	West Kazakhstan
-LA	+1758+10236	Asia/Vientiane
-LB	+3353+03530	Asia/Beirut
-LC	+1401-06100	America/St_Lucia
-LI	+4709+00931	Europe/Vaduz
-LK	+0656+07951	Asia/Colombo
-LR	+0618-01047	Africa/Monrovia
-LS	-2928+02730	Africa/Maseru
-LT	+5441+02519	Europe/Vilnius
-LU	+4936+00609	Europe/Luxembourg
-LV	+5657+02406	Europe/Riga
-LY	+3254+01311	Africa/Tripoli
-MA	+3339-00735	Africa/Casablanca
-MC	+4342+00723	Europe/Monaco
-MD	+4700+02850	Europe/Chisinau
-ME	+4226+01916	Europe/Podgorica
-MF	+1804-06305	America/Marigot
-MG	-1855+04731	Indian/Antananarivo
-MH	+0709+17112	Pacific/Majuro	most locations
-MH	+0905+16720	Pacific/Kwajalein	Kwajalein
-MK	+4159+02126	Europe/Skopje
-ML	+1239-00800	Africa/Bamako
-MM	+1647+09610	Asia/Rangoon
-MN	+4755+10653	Asia/Ulaanbaatar	most locations
-MN	+4801+09139	Asia/Hovd	Bayan-Olgiy, Govi-Altai, Hovd, Uvs, Zavkhan
-MN	+4804+11430	Asia/Choibalsan	Dornod, Sukhbaatar
-MO	+2214+11335	Asia/Macau
-MP	+1512+14545	Pacific/Saipan
-MQ	+1436-06105	America/Martinique
-MR	+1806-01557	Africa/Nouakchott
-MS	+1643-06213	America/Montserrat
-MT	+3554+01431	Europe/Malta
-MU	-2010+05730	Indian/Mauritius
-MV	+0410+07330	Indian/Maldives
-MW	-1547+03500	Africa/Blantyre
-MX	+1924-09909	America/Mexico_City	Central Time - most locations
-MX	+2105-08646	America/Cancun	Central Time - Quintana Roo
-MX	+2058-08937	America/Merida	Central Time - Campeche, Yucatan
-MX	+2540-10019	America/Monterrey	Central Time - Coahuila, Durango, Nuevo Leon, Tamaulipas
-MX	+2313-10625	America/Mazatlan	Mountain Time - S Baja, Nayarit, Sinaloa
-MX	+2838-10605	America/Chihuahua	Mountain Time - Chihuahua
-MX	+2904-11058	America/Hermosillo	Mountain Standard Time - Sonora
-MX	+3232-11701	America/Tijuana	Pacific Time
-MY	+0310+10142	Asia/Kuala_Lumpur	peninsular Malaysia
-MY	+0133+11020	Asia/Kuching	Sabah & Sarawak
-MZ	-2558+03235	Africa/Maputo
-NA	-2234+01706	Africa/Windhoek
-NC	-2216+16627	Pacific/Noumea
-NE	+1331+00207	Africa/Niamey
-NF	-2903+16758	Pacific/Norfolk
-NG	+0627+00324	Africa/Lagos
-NI	+1209-08617	America/Managua
-NL	+5222+00454	Europe/Amsterdam
-NO	+5955+01045	Europe/Oslo
-NP	+2743+08519	Asia/Kathmandu
-NR	-0031+16655	Pacific/Nauru
-NU	-1901-16955	Pacific/Niue
-NZ	-3652+17446	Pacific/Auckland	most locations
-NZ	-4357-17633	Pacific/Chatham	Chatham Islands
-OM	+2336+05835	Asia/Muscat
-PA	+0858-07932	America/Panama
-PE	-1203-07703	America/Lima
-PF	-1732-14934	Pacific/Tahiti	Society Islands
-PF	-0900-13930	Pacific/Marquesas	Marquesas Islands
-PF	-2308-13457	Pacific/Gambier	Gambier Islands
-PG	-0930+14710	Pacific/Port_Moresby
-PH	+1435+12100	Asia/Manila
-PK	+2452+06703	Asia/Karachi
-PL	+5215+02100	Europe/Warsaw
-PM	+4703-05620	America/Miquelon
-PN	-2504-13005	Pacific/Pitcairn
-PR	+182806-0660622	America/Puerto_Rico
-PS	+3130+03428	Asia/Gaza
-PT	+3843-00908	Europe/Lisbon	mainland
-PT	+3238-01654	Atlantic/Madeira	Madeira Islands
-PT	+3744-02540	Atlantic/Azores	Azores
-PW	+0720+13429	Pacific/Palau
-PY	-2516-05740	America/Asuncion
-QA	+2517+05132	Asia/Qatar
-RE	-2052+05528	Indian/Reunion
-RO	+4426+02606	Europe/Bucharest
-RS	+4450+02030	Europe/Belgrade
-RU	+5443+02030	Europe/Kaliningrad	Moscow-01 - Kaliningrad
-RU	+5545+03735	Europe/Moscow	Moscow+00 - west Russia
-RU	+4844+04425	Europe/Volgograd	Moscow+00 - Caspian Sea
-RU	+5312+05009	Europe/Samara	Moscow+01 - Samara, Udmurtia
-RU	+5651+06036	Asia/Yekaterinburg	Moscow+02 - Urals
-RU	+5500+07324	Asia/Omsk	Moscow+03 - west Siberia
-RU	+5502+08255	Asia/Novosibirsk	Moscow+03 - Novosibirsk
-RU	+5345+08707	Asia/Novokuznetsk	Moscow+03 - Novokuznetsk
-RU	+5601+09250	Asia/Krasnoyarsk	Moscow+04 - Yenisei River
-RU	+5216+10420	Asia/Irkutsk	Moscow+05 - Lake Baikal
-RU	+6200+12940	Asia/Yakutsk	Moscow+06 - Lena River
-RU	+4310+13156	Asia/Vladivostok	Moscow+07 - Amur River
-RU	+4658+14242	Asia/Sakhalin	Moscow+07 - Sakhalin Island
-RU	+5934+15048	Asia/Magadan	Moscow+08 - Magadan
-RU	+5301+15839	Asia/Kamchatka	Moscow+09 - Kamchatka
-RU	+6445+17729	Asia/Anadyr	Moscow+10 - Bering Sea
-RW	-0157+03004	Africa/Kigali
-SA	+2438+04643	Asia/Riyadh
-SB	-0932+16012	Pacific/Guadalcanal
-SC	-0440+05528	Indian/Mahe
-SD	+1536+03232	Africa/Khartoum
-SE	+5920+01803	Europe/Stockholm
-SG	+0117+10351	Asia/Singapore
-SH	-1555-00542	Atlantic/St_Helena
-SI	+4603+01431	Europe/Ljubljana
-SJ	+7800+01600	Arctic/Longyearbyen
-SK	+4809+01707	Europe/Bratislava
-SL	+0830-01315	Africa/Freetown
-SM	+4355+01228	Europe/San_Marino
-SN	+1440-01726	Africa/Dakar
-SO	+0204+04522	Africa/Mogadishu
-SR	+0550-05510	America/Paramaribo
-ST	+0020+00644	Africa/Sao_Tome
-SV	+1342-08912	America/El_Salvador
-SY	+3330+03618	Asia/Damascus
-SZ	-2618+03106	Africa/Mbabane
-TC	+2128-07108	America/Grand_Turk
-TD	+1207+01503	Africa/Ndjamena
-TF	-492110+0701303	Indian/Kerguelen
-TG	+0608+00113	Africa/Lome
-TH	+1345+10031	Asia/Bangkok
-TJ	+3835+06848	Asia/Dushanbe
-TK	-0922-17114	Pacific/Fakaofo
-TL	-0833+12535	Asia/Dili
-TM	+3757+05823	Asia/Ashgabat
-TN	+3648+01011	Africa/Tunis
-TO	-2110-17510	Pacific/Tongatapu
-TR	+4101+02858	Europe/Istanbul
-TT	+1039-06131	America/Port_of_Spain
-TV	-0831+17913	Pacific/Funafuti
-TW	+2503+12130	Asia/Taipei
-TZ	-0648+03917	Africa/Dar_es_Salaam
-UA	+5026+03031	Europe/Kiev	most locations
-UA	+4837+02218	Europe/Uzhgorod	Ruthenia
-UA	+4750+03510	Europe/Zaporozhye	Zaporozh'ye, E Lugansk / Zaporizhia, E Luhansk
-UA	+4457+03406	Europe/Simferopol	central Crimea
-UG	+0019+03225	Africa/Kampala
-UM	+1645-16931	Pacific/Johnston	Johnston Atoll
-UM	+2813-17722	Pacific/Midway	Midway Islands
-UM	+1917+16637	Pacific/Wake	Wake Island
-US	+404251-0740023	America/New_York	Eastern Time
-US	+421953-0830245	America/Detroit	Eastern Time - Michigan - most locations
-US	+381515-0854534	America/Kentucky/Louisville	Eastern Time - Kentucky - Louisville area
-US	+364947-0845057	America/Kentucky/Monticello	Eastern Time - Kentucky - Wayne County
-US	+394606-0860929	America/Indiana/Indianapolis	Eastern Time - Indiana - most locations
-US	+384038-0873143	America/Indiana/Vincennes	Eastern Time - Indiana - Daviess, Dubois, Knox & Martin Counties
-US	+410305-0863611	America/Indiana/Winamac	Eastern Time - Indiana - Pulaski County
-US	+382232-0862041	America/Indiana/Marengo	Eastern Time - Indiana - Crawford County
-US	+382931-0871643	America/Indiana/Petersburg	Eastern Time - Indiana - Pike County
-US	+384452-0850402	America/Indiana/Vevay	Eastern Time - Indiana - Switzerland County
-US	+415100-0873900	America/Chicago	Central Time
-US	+375711-0864541	America/Indiana/Tell_City	Central Time - Indiana - Perry County
-US	+411745-0863730	America/Indiana/Knox	Central Time - Indiana - Starke County
-US	+450628-0873651	America/Menominee	Central Time - Michigan - Dickinson, Gogebic, Iron & Menominee Counties
-US	+470659-1011757	America/North_Dakota/Center	Central Time - North Dakota - Oliver County
-US	+465042-1012439	America/North_Dakota/New_Salem	Central Time - North Dakota - Morton County (except Mandan area)
-US	+394421-1045903	America/Denver	Mountain Time
-US	+433649-1161209	America/Boise	Mountain Time - south Idaho & east Oregon
-US	+364708-1084111	America/Shiprock	Mountain Time - Navajo
-US	+332654-1120424	America/Phoenix	Mountain Standard Time - Arizona
-US	+340308-1181434	America/Los_Angeles	Pacific Time
-US	+611305-1495401	America/Anchorage	Alaska Time
-US	+581807-1342511	America/Juneau	Alaska Time - Alaska panhandle
-US	+593249-1394338	America/Yakutat	Alaska Time - Alaska panhandle neck
-US	+643004-1652423	America/Nome	Alaska Time - west Alaska
-US	+515248-1763929	America/Adak	Aleutian Islands
-US	+211825-1575130	Pacific/Honolulu	Hawaii
-UY	-3453-05611	America/Montevideo
-UZ	+3940+06648	Asia/Samarkand	west Uzbekistan
-UZ	+4120+06918	Asia/Tashkent	east Uzbekistan
-VA	+415408+0122711	Europe/Vatican
-VC	+1309-06114	America/St_Vincent
-VE	+1030-06656	America/Caracas
-VG	+1827-06437	America/Tortola
-VI	+1821-06456	America/St_Thomas
-VN	+1045+10640	Asia/Ho_Chi_Minh
-VU	-1740+16825	Pacific/Efate
-WF	-1318-17610	Pacific/Wallis
-WS	-1350-17144	Pacific/Apia
-YE	+1245+04512	Asia/Aden
-YT	-1247+04514	Indian/Mayotte
-ZA	-2615+02800	Africa/Johannesburg
-ZM	-1525+02817	Africa/Lusaka
-ZW	-1750+03103	Africa/Harare
diff --git a/tools/zoneinfo/tzdata2009s/MODULE_LICENSE_PUBLIC_DOMAIN b/tools/zoneinfo/tzdata2010k/MODULE_LICENSE_PUBLIC_DOMAIN
similarity index 100%
rename from tools/zoneinfo/tzdata2009s/MODULE_LICENSE_PUBLIC_DOMAIN
rename to tools/zoneinfo/tzdata2010k/MODULE_LICENSE_PUBLIC_DOMAIN
diff --git a/tools/zoneinfo/tzdata2010k/africa b/tools/zoneinfo/tzdata2010k/africa
new file mode 100644
index 0000000..0c37506
--- /dev/null
+++ b/tools/zoneinfo/tzdata2010k/africa
@@ -0,0 +1,1048 @@
+# <pre>
+# @(#)africa	8.27
+# This file is in the public domain, so clarified as of
+# 2009-05-17 by Arthur David Olson.
+
+# This data is by no means authoritative; if you think you know better,
+# go ahead and edit the file (and please send any changes to
+# tz@elsie.nci.nih.gov for general use in the future).
+
+# From Paul Eggert (2006-03-22):
+#
+# A good source for time zone historical data outside the U.S. is
+# Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
+# San Diego: ACS Publications, Inc. (2003).
+#
+# Gwillim Law writes that a good source
+# for recent time zone data is the International Air Transport
+# Association's Standard Schedules Information Manual (IATA SSIM),
+# published semiannually.  Law sent in several helpful summaries
+# of the IATA's data after 1990.
+#
+# Except where otherwise noted, Shanks & Pottenger is the source for
+# entries through 1990, and IATA SSIM is the source for entries afterwards.
+#
+# Another source occasionally used is Edward W. Whitman, World Time Differences,
+# Whitman Publishing Co, 2 Niagara Av, Ealing, London (undated), which
+# I found in the UCLA library.
+#
+# A reliable and entertaining source about time zones is
+# Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997).
+#
+# Previous editions of this database used WAT, CAT, SAT, and EAT
+# for +0:00 through +3:00, respectively,
+# but Mark R V Murray reports that
+# `SAST' is the official abbreviation for +2:00 in the country of South Africa,
+# `CAT' is commonly used for +2:00 in countries north of South Africa, and
+# `WAT' is probably the best name for +1:00, as the common phrase for
+# the area that includes Nigeria is ``West Africa''.
+# He has heard of ``Western Sahara Time'' for +0:00 but can find no reference.
+#
+# To make things confusing, `WAT' seems to have been used for -1:00 long ago;
+# I'd guess that this was because people needed _some_ name for -1:00,
+# and at the time, far west Africa was the only major land area in -1:00.
+# This usage is now obsolete, as the last use of -1:00 on the African
+# mainland seems to have been 1976 in Western Sahara.
+#
+# To summarize, the following abbreviations seem to have some currency:
+#	-1:00	WAT	West Africa Time (no longer used)
+#	 0:00	GMT	Greenwich Mean Time
+#	 2:00	CAT	Central Africa Time
+#	 2:00	SAST	South Africa Standard Time
+# and Murray suggests the following abbreviation:
+#	 1:00	WAT	West Africa Time
+# I realize that this leads to `WAT' being used for both -1:00 and 1:00
+# for times before 1976, but this is the best I can think of
+# until we get more information.
+#
+# I invented the following abbreviations; corrections are welcome!
+#	 2:00	WAST	West Africa Summer Time
+#	 2:30	BEAT	British East Africa Time (no longer used)
+#	 2:44:45 BEAUT	British East Africa Unified Time (no longer used)
+#	 3:00	CAST	Central Africa Summer Time (no longer used)
+#	 3:00	SAST	South Africa Summer Time (no longer used)
+#	 3:00	EAT	East Africa Time
+#	 4:00	EAST	East Africa Summer Time (no longer used)
+
+# Algeria
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Algeria	1916	only	-	Jun	14	23:00s	1:00	S
+Rule	Algeria	1916	1919	-	Oct	Sun>=1	23:00s	0	-
+Rule	Algeria	1917	only	-	Mar	24	23:00s	1:00	S
+Rule	Algeria	1918	only	-	Mar	 9	23:00s	1:00	S
+Rule	Algeria	1919	only	-	Mar	 1	23:00s	1:00	S
+Rule	Algeria	1920	only	-	Feb	14	23:00s	1:00	S
+Rule	Algeria	1920	only	-	Oct	23	23:00s	0	-
+Rule	Algeria	1921	only	-	Mar	14	23:00s	1:00	S
+Rule	Algeria	1921	only	-	Jun	21	23:00s	0	-
+Rule	Algeria	1939	only	-	Sep	11	23:00s	1:00	S
+Rule	Algeria	1939	only	-	Nov	19	 1:00	0	-
+Rule	Algeria	1944	1945	-	Apr	Mon>=1	 2:00	1:00	S
+Rule	Algeria	1944	only	-	Oct	 8	 2:00	0	-
+Rule	Algeria	1945	only	-	Sep	16	 1:00	0	-
+Rule	Algeria	1971	only	-	Apr	25	23:00s	1:00	S
+Rule	Algeria	1971	only	-	Sep	26	23:00s	0	-
+Rule	Algeria	1977	only	-	May	 6	 0:00	1:00	S
+Rule	Algeria	1977	only	-	Oct	21	 0:00	0	-
+Rule	Algeria	1978	only	-	Mar	24	 1:00	1:00	S
+Rule	Algeria	1978	only	-	Sep	22	 3:00	0	-
+Rule	Algeria	1980	only	-	Apr	25	 0:00	1:00	S
+Rule	Algeria	1980	only	-	Oct	31	 2:00	0	-
+# Shanks & Pottenger give 0:09:20 for Paris Mean Time; go with Howse's
+# more precise 0:09:21.
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Africa/Algiers	0:12:12 -	LMT	1891 Mar 15 0:01
+			0:09:21	-	PMT	1911 Mar 11    # Paris Mean Time
+			0:00	Algeria	WE%sT	1940 Feb 25 2:00
+			1:00	Algeria	CE%sT	1946 Oct  7
+			0:00	-	WET	1956 Jan 29
+			1:00	-	CET	1963 Apr 14
+			0:00	Algeria	WE%sT	1977 Oct 21
+			1:00	Algeria	CE%sT	1979 Oct 26
+			0:00	Algeria	WE%sT	1981 May
+			1:00	-	CET
+
+# Angola
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Africa/Luanda	0:52:56	-	LMT	1892
+			0:52:04	-	AOT	1911 May 26 # Angola Time
+			1:00	-	WAT
+
+# Benin
+# Whitman says they switched to 1:00 in 1946, not 1934;
+# go with Shanks & Pottenger.
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone Africa/Porto-Novo	0:10:28	-	LMT	1912
+			0:00	-	GMT	1934 Feb 26
+			1:00	-	WAT
+
+# Botswana
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Africa/Gaborone	1:43:40 -	LMT	1885
+			2:00	-	CAT	1943 Sep 19 2:00
+			2:00	1:00	CAST	1944 Mar 19 2:00
+			2:00	-	CAT
+
+# Burkina Faso
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone Africa/Ouagadougou	-0:06:04 -	LMT	1912
+			 0:00	-	GMT
+
+# Burundi
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone Africa/Bujumbura	1:57:28	-	LMT	1890
+			2:00	-	CAT
+
+# Cameroon
+# Whitman says they switched to 1:00 in 1920; go with Shanks & Pottenger.
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Africa/Douala	0:38:48	-	LMT	1912
+			1:00	-	WAT
+
+# Cape Verde
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone Atlantic/Cape_Verde -1:34:04 -	LMT	1907			# Praia
+			-2:00	-	CVT	1942 Sep
+			-2:00	1:00	CVST	1945 Oct 15
+			-2:00	-	CVT	1975 Nov 25 2:00
+			-1:00	-	CVT
+
+# Central African Republic
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Africa/Bangui	1:14:20	-	LMT	1912
+			1:00	-	WAT
+
+# Chad
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Africa/Ndjamena	1:00:12 -	LMT	1912
+			1:00	-	WAT	1979 Oct 14
+			1:00	1:00	WAST	1980 Mar  8
+			1:00	-	WAT
+
+# Comoros
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Indian/Comoro	2:53:04 -	LMT	1911 Jul   # Moroni, Gran Comoro
+			3:00	-	EAT
+
+# Democratic Republic of Congo
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone Africa/Kinshasa	1:01:12 -	LMT	1897 Nov 9
+			1:00	-	WAT
+Zone Africa/Lubumbashi	1:49:52 -	LMT	1897 Nov 9
+			2:00	-	CAT
+
+# Republic of the Congo
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone Africa/Brazzaville	1:01:08 -	LMT	1912
+			1:00	-	WAT
+
+# Cote D'Ivoire
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Africa/Abidjan	-0:16:08 -	LMT	1912
+			 0:00	-	GMT
+
+# Djibouti
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Africa/Djibouti	2:52:36 -	LMT	1911 Jul
+			3:00	-	EAT
+
+###############################################################################
+
+# Egypt
+
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Egypt	1940	only	-	Jul	15	0:00	1:00	S
+Rule	Egypt	1940	only	-	Oct	 1	0:00	0	-
+Rule	Egypt	1941	only	-	Apr	15	0:00	1:00	S
+Rule	Egypt	1941	only	-	Sep	16	0:00	0	-
+Rule	Egypt	1942	1944	-	Apr	 1	0:00	1:00	S
+Rule	Egypt	1942	only	-	Oct	27	0:00	0	-
+Rule	Egypt	1943	1945	-	Nov	 1	0:00	0	-
+Rule	Egypt	1945	only	-	Apr	16	0:00	1:00	S
+Rule	Egypt	1957	only	-	May	10	0:00	1:00	S
+Rule	Egypt	1957	1958	-	Oct	 1	0:00	0	-
+Rule	Egypt	1958	only	-	May	 1	0:00	1:00	S
+Rule	Egypt	1959	1981	-	May	 1	1:00	1:00	S
+Rule	Egypt	1959	1965	-	Sep	30	3:00	0	-
+Rule	Egypt	1966	1994	-	Oct	 1	3:00	0	-
+Rule	Egypt	1982	only	-	Jul	25	1:00	1:00	S
+Rule	Egypt	1983	only	-	Jul	12	1:00	1:00	S
+Rule	Egypt	1984	1988	-	May	 1	1:00	1:00	S
+Rule	Egypt	1989	only	-	May	 6	1:00	1:00	S
+Rule	Egypt	1990	1994	-	May	 1	1:00	1:00	S
+# IATA (after 1990) says transitions are at 0:00.
+# Go with IATA starting in 1995, except correct 1995 entry from 09-30 to 09-29.
+Rule	Egypt	1995	max	-	Apr	lastFri	 0:00s	1:00	S
+Rule	Egypt	1995	2005	-	Sep	lastThu	23:00s	0	-
+# From Steffen Thorsen (2006-09-19):
+# The Egyptian Gazette, issue 41,090 (2006-09-18), page 1, reports:
+# Egypt will turn back clocks by one hour at the midnight of Thursday
+# after observing the daylight saving time since May.
+# http://news.gom.com.eg/gazette/pdf/2006/09/18/01.pdf
+Rule	Egypt	2006	only	-	Sep	21	23:00s	0	-
+# From Dirk Losch (2007-08-14):
+# I received a mail from an airline which says that the daylight
+# saving time in Egypt will end in the night of 2007-09-06 to 2007-09-07.
+# From Jesper Norgaard Welen (2007-08-15): [The following agree:]
+# http://www.nentjes.info/Bill/bill5.htm 
+# http://www.timeanddate.com/worldclock/city.html?n=53
+# From Steffen Thorsen (2007-09-04): The official information...:
+# http://www.sis.gov.eg/En/EgyptOnline/Miscellaneous/000002/0207000000000000001580.htm
+Rule	Egypt	2007	only	-	Sep	Thu>=1	23:00s	0	-
+# From Abdelrahman Hassan (2007-09-06):
+# Due to the Hijri (lunar Islamic calendar) year being 11 days shorter
+# than the year of the Gregorian calendar, Ramadan shifts earlier each
+# year. This year it will be observed September 13 (September is quite
+# hot in Egypt), and the idea is to make fasting easier for workers by
+# shifting business hours one hour out of daytime heat. Consequently,
+# unless discontinued, next DST may end Thursday 28 August 2008.
+# From Paul Eggert (2007-08-17):
+# For lack of better info, assume the new rule is last Thursday in August.
+
+# From Petr Machata (2009-04-06):
+# The following appeared in Red Hat bugzilla[1] (edited):
+#
+# > $ zdump -v /usr/share/zoneinfo/Africa/Cairo | grep 2009
+# > /usr/share/zoneinfo/Africa/Cairo  Thu Apr 23 21:59:59 2009 UTC = Thu =
+# Apr 23
+# > 23:59:59 2009 EET isdst=0 gmtoff=7200
+# > /usr/share/zoneinfo/Africa/Cairo  Thu Apr 23 22:00:00 2009 UTC = Fri =
+# Apr 24
+# > 01:00:00 2009 EEST isdst=1 gmtoff=10800
+# > /usr/share/zoneinfo/Africa/Cairo  Thu Aug 27 20:59:59 2009 UTC = Thu =
+# Aug 27
+# > 23:59:59 2009 EEST isdst=1 gmtoff=10800
+# > /usr/share/zoneinfo/Africa/Cairo  Thu Aug 27 21:00:00 2009 UTC = Thu =
+# Aug 27
+# > 23:00:00 2009 EET isdst=0 gmtoff=7200
+#
+# > end date should be Thu Sep 24 2009 (Last Thursday in September at 23:59=
+# :59)
+# > http://support.microsoft.com/kb/958729/
+#
+# timeanddate[2] and another site I've found[3] also support that.
+#
+# [1] <a href="https://bugzilla.redhat.com/show_bug.cgi?id=492263">
+# https://bugzilla.redhat.com/show_bug.cgi?id=492263
+# </a>
+# [2] <a href="http://www.timeanddate.com/worldclock/clockchange.html?n=53">
+# http://www.timeanddate.com/worldclock/clockchange.html?n=53
+# </a>
+# [3] <a href="http://wwp.greenwichmeantime.com/time-zone/africa/egypt/">
+# http://wwp.greenwichmeantime.com/time-zone/africa/egypt/
+# </a>
+
+# From Arthur David Olson (2009-04-20):
+# In 2009 (and for the next several years), Ramadan ends before the fourth
+# Thursday in September; Egypt is expected to revert to the last Thursday
+# in September.
+
+# From Steffen Thorsen (2009-08-11):
+# We have been able to confirm the August change with the Egyptian Cabinet 
+# Information and Decision Support Center:
+# <a href="http://www.timeanddate.com/news/time/egypt-dst-ends-2009.html">
+# http://www.timeanddate.com/news/time/egypt-dst-ends-2009.html
+# </a>
+# 
+# The Middle East News Agency
+# <a href="http://www.mena.org.eg/index.aspx">
+# http://www.mena.org.eg/index.aspx
+# </a>
+# also reports "Egypt starts winter time on August 21"
+# today in article numbered "71, 11/08/2009 12:25 GMT." 
+# Only the title above is available without a subscription to their service,
+# and can be found by searching for "winter" in their search engine
+# (at least today).
+
+# From Alexander Krivenyshev (2010-07-20):
+# According to News from Egypt -  Al-Masry Al-Youm Egypt's cabinet has
+# decided that Daylight Saving Time will not be used in Egypt during
+# Ramadan.
+#
+# Arabic translation:
+# "Clocks to go back during Ramadan--and then forward again"
+# <a href="http://www.almasryalyoum.com/en/news/clocks-go-back-during-ramadan-and-then-forward-again">
+# http://www.almasryalyoum.com/en/news/clocks-go-back-during-ramadan-and-then-forward-again
+# </a>
+# or
+# <a href="http://www.worldtimezone.com/dst_news/dst_news_egypt02.html">
+# http://www.worldtimezone.com/dst_news/dst_news_egypt02.html
+# </a>
+
+Rule	Egypt	2008	only	-	Aug	lastThu	23:00s	0	-
+Rule	Egypt	2009	only	-	Aug	20	23:00s	0	-
+Rule	Egypt	2010	only	-	Aug	10	23:00s	0	-
+Rule	Egypt	2010	only	-	Sep	9	0:00s	1:00	S
+Rule	Egypt	2010	max	-	Sep	lastThu	23:00s	0	-
+
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Africa/Cairo	2:05:00 -	LMT	1900 Oct
+			2:00	Egypt	EE%sT
+
+# Equatorial Guinea
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Africa/Malabo	0:35:08 -	LMT	1912
+			0:00	-	GMT	1963 Dec 15
+			1:00	-	WAT
+
+# Eritrea
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Africa/Asmara	2:35:32 -	LMT	1870
+			2:35:32	-	AMT	1890	      # Asmara Mean Time
+			2:35:20	-	ADMT	1936 May 5    # Adis Dera MT
+			3:00	-	EAT
+
+# Ethiopia
+# From Paul Eggert (2006-03-22):
+# Shanks & Pottenger write that Ethiopia had six narrowly-spaced time zones
+# between 1870 and 1890, and that they merged to 38E50 (2:35:20) in 1890.
+# We'll guess that 38E50 is for Adis Dera.
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone Africa/Addis_Ababa	2:34:48 -	LMT	1870
+			2:35:20	-	ADMT	1936 May 5    # Adis Dera MT
+			3:00	-	EAT
+
+# Gabon
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone Africa/Libreville	0:37:48 -	LMT	1912
+			1:00	-	WAT
+
+# Gambia
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Africa/Banjul	-1:06:36 -	LMT	1912
+			-1:06:36 -	BMT	1935	# Banjul Mean Time
+			-1:00	-	WAT	1964
+			 0:00	-	GMT
+
+# Ghana
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+# Whitman says DST was observed from 1931 to ``the present'';
+# go with Shanks & Pottenger.
+Rule	Ghana	1936	1942	-	Sep	 1	0:00	0:20	GHST
+Rule	Ghana	1936	1942	-	Dec	31	0:00	0	GMT
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Africa/Accra	-0:00:52 -	LMT	1918
+			 0:00	Ghana	%s
+
+# Guinea
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Africa/Conakry	-0:54:52 -	LMT	1912
+			 0:00	-	GMT	1934 Feb 26
+			-1:00	-	WAT	1960
+			 0:00	-	GMT
+
+# Guinea-Bissau
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Africa/Bissau	-1:02:20 -	LMT	1911 May 26
+			-1:00	-	WAT	1975
+			 0:00	-	GMT
+
+# Kenya
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Africa/Nairobi	2:27:16	-	LMT	1928 Jul
+			3:00	-	EAT	1930
+			2:30	-	BEAT	1940
+			2:44:45	-	BEAUT	1960
+			3:00	-	EAT
+
+# Lesotho
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Africa/Maseru	1:50:00 -	LMT	1903 Mar
+			2:00	-	SAST	1943 Sep 19 2:00
+			2:00	1:00	SAST	1944 Mar 19 2:00
+			2:00	-	SAST
+
+# Liberia
+# From Paul Eggert (2006-03-22):
+# In 1972 Liberia was the last country to switch
+# from a UTC offset that was not a multiple of 15 or 20 minutes.
+# Howse reports that it was in honor of their president's birthday.
+# Shank & Pottenger report the date as May 1, whereas Howse reports Jan;
+# go with Shanks & Pottenger.
+# For Liberia before 1972, Shanks & Pottenger report -0:44, whereas Howse and
+# Whitman each report -0:44:30; go with the more precise figure.
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Africa/Monrovia	-0:43:08 -	LMT	1882
+			-0:43:08 -	MMT	1919 Mar # Monrovia Mean Time
+			-0:44:30 -	LRT	1972 May # Liberia Time
+			 0:00	-	GMT
+
+###############################################################################
+
+# Libya
+
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Libya	1951	only	-	Oct	14	2:00	1:00	S
+Rule	Libya	1952	only	-	Jan	 1	0:00	0	-
+Rule	Libya	1953	only	-	Oct	 9	2:00	1:00	S
+Rule	Libya	1954	only	-	Jan	 1	0:00	0	-
+Rule	Libya	1955	only	-	Sep	30	0:00	1:00	S
+Rule	Libya	1956	only	-	Jan	 1	0:00	0	-
+Rule	Libya	1982	1984	-	Apr	 1	0:00	1:00	S
+Rule	Libya	1982	1985	-	Oct	 1	0:00	0	-
+Rule	Libya	1985	only	-	Apr	 6	0:00	1:00	S
+Rule	Libya	1986	only	-	Apr	 4	0:00	1:00	S
+Rule	Libya	1986	only	-	Oct	 3	0:00	0	-
+Rule	Libya	1987	1989	-	Apr	 1	0:00	1:00	S
+Rule	Libya	1987	1989	-	Oct	 1	0:00	0	-
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Africa/Tripoli	0:52:44 -	LMT	1920
+			1:00	Libya	CE%sT	1959
+			2:00	-	EET	1982
+			1:00	Libya	CE%sT	1990 May  4
+# The following entries are from Shanks & Pottenger;
+# the IATA SSIM data contain some obvious errors.
+			2:00	-	EET	1996 Sep 30
+			1:00	-	CET	1997 Apr  4
+			1:00	1:00	CEST	1997 Oct  4
+			2:00	-	EET
+
+# Madagascar
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone Indian/Antananarivo 3:10:04 -	LMT	1911 Jul
+			3:00	-	EAT	1954 Feb 27 23:00s
+			3:00	1:00	EAST	1954 May 29 23:00s
+			3:00	-	EAT
+
+# Malawi
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Africa/Blantyre	2:20:00 -	LMT	1903 Mar
+			2:00	-	CAT
+
+# Mali
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Africa/Bamako	-0:32:00 -	LMT	1912
+			 0:00	-	GMT	1934 Feb 26
+			-1:00	-	WAT	1960 Jun 20
+			 0:00	-	GMT
+
+# Mauritania
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone Africa/Nouakchott	-1:03:48 -	LMT	1912
+			 0:00	-	GMT	1934 Feb 26
+			-1:00	-	WAT	1960 Nov 28
+			 0:00	-	GMT
+
+# Mauritius
+
+# From Steffen Thorsen (2008-06-25):
+# Mauritius plans to observe DST from 2008-11-01 to 2009-03-31 on a trial
+# basis....
+# It seems that Mauritius observed daylight saving time from 1982-10-10 to 
+# 1983-03-20 as well, but that was not successful....
+# http://www.timeanddate.com/news/time/mauritius-daylight-saving-time.html
+
+# From Alex Krivenyshev (2008-06-25):
+# http://economicdevelopment.gov.mu/portal/site/Mainhomepage/menuitem.a42b24128104d9845dabddd154508a0c/?content_id=0a7cee8b5d69a110VgnVCM1000000a04a8c0RCRD
+
+# From Arthur David Olson (2008-06-30):
+# The www.timeanddate.com article cited by Steffen Thorsen notes that "A
+# final decision has yet to be made on the times that daylight saving
+# would begin and end on these dates." As a place holder, use midnight.
+
+# From Paul Eggert (2008-06-30):
+# Follow Thorsen on DST in 1982/1983, instead of Shanks & Pottenger.
+
+# From Steffen Thorsen (2008-07-10):
+# According to
+# <a href="http://www.lexpress.mu/display_article.php?news_id=111216">
+# http://www.lexpress.mu/display_article.php?news_id=111216
+# </a>
+# (in French), Mauritius will start and end their DST a few days earlier
+# than previously announced (2008-11-01 to 2009-03-31).  The new start
+# date is 2008-10-26 at 02:00 and the new end date is 2009-03-27 (no time
+# given, but it is probably at either 2 or 3 wall clock time).
+# 
+# A little strange though, since the article says that they moved the date 
+# to align itself with Europe and USA which also change time on that date, 
+# but that means they have not paid attention to what happened in 
+# USA/Canada last year (DST ends first Sunday in November). I also wonder 
+# why that they end on a Friday, instead of aligning with Europe which 
+# changes two days later.
+
+# From Alex Krivenyshev (2008-07-11):
+# Seems that English language article "The revival of daylight saving
+# time:  Energy conservation?"-# No. 16578 (07/11/2008) was originally
+# published on Monday, June 30, 2008...
+#
+# I guess that article in French "Le gouvernement avance l'introduction
+# de l'heure d'ete" stating that DST in Mauritius starting on October 26
+# and ending on March 27, 2009 is the most recent one.
+# ...
+# <a href="http://www.worldtimezone.com/dst_news/dst_news_mauritius02.html">
+# http://www.worldtimezone.com/dst_news/dst_news_mauritius02.html
+# </a>
+
+# From Riad M. Hossen Ally (2008-08-03):
+# The Government of Mauritius weblink
+# <a href="http://www.gov.mu/portal/site/pmosite/menuitem.4ca0efdee47462e7440a600248a521ca/?content_id=4728ca68b2a5b110VgnVCM1000000a04a8c0RCRD">
+# http://www.gov.mu/portal/site/pmosite/menuitem.4ca0efdee47462e7440a600248a521ca/?content_id=4728ca68b2a5b110VgnVCM1000000a04a8c0RCRD
+# </a>
+# Cabinet Decision of July 18th, 2008 states as follows:
+#
+# 4. ...Cabinet has agreed to the introduction into the National Assembly
+# of the Time Bill which provides for the introduction of summer time in
+# Mauritius. The summer time period which will be of one hour ahead of
+# the standard time, will be aligned with that in Europe and the United
+# States of America. It will start at two o'clock in the morning on the
+# last Sunday of October and will end at two o'clock in the morning on
+# the last Sunday of March the following year. The summer time for the
+# year 2008 - 2009 will, therefore, be effective as from 26 October 2008
+# and end on 29 March 2009.
+
+# From Ed Maste (2008-10-07):
+# THE TIME BILL (No. XXVII of 2008) Explanatory Memorandum states the
+# beginning / ending of summer time is 2 o'clock standard time in the
+# morning of the last Sunday of October / last Sunday of March.
+# <a href="http://www.gov.mu/portal/goc/assemblysite/file/bill2708.pdf">
+# http://www.gov.mu/portal/goc/assemblysite/file/bill2708.pdf
+# </a>
+
+# From Steffen Thorsen (2009-06-05):
+# According to several sources, Mauritius will not continue to observe
+# DST the coming summer...
+#
+# Some sources, in French:
+# <a href="http://www.defimedia.info/news/946/Rashid-Beebeejaun-:-%C2%AB-L%E2%80%99heure-d%E2%80%99%C3%A9t%C3%A9-ne-sera-pas-appliqu%C3%A9e-cette-ann%C3%A9e-%C2%BB">
+# http://www.defimedia.info/news/946/Rashid-Beebeejaun-:-%C2%AB-L%E2%80%99heure-d%E2%80%99%C3%A9t%C3%A9-ne-sera-pas-appliqu%C3%A9e-cette-ann%C3%A9e-%C2%BB
+# </a>
+# <a href="http://lexpress.mu/Story/3398~Beebeejaun---Les-objectifs-d-%C3%A9conomie-d-%C3%A9nergie-de-l-heure-d-%C3%A9t%C3%A9-ont-%C3%A9t%C3%A9-atteints-">
+# http://lexpress.mu/Story/3398~Beebeejaun---Les-objectifs-d-%C3%A9conomie-d-%C3%A9nergie-de-l-heure-d-%C3%A9t%C3%A9-ont-%C3%A9t%C3%A9-atteints-
+# </a>
+#
+# Our wrap-up:
+# <a href="http://www.timeanddate.com/news/time/mauritius-dst-will-not-repeat.html">
+# http://www.timeanddate.com/news/time/mauritius-dst-will-not-repeat.html
+# </a>
+
+# From Arthur David Olson (2009-07-11):
+# The "mauritius-dst-will-not-repeat" wrapup includes this: 
+# "The trial ended on March 29, 2009, when the clocks moved back by one hour
+# at 2am (or 02:00) local time..."
+
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule Mauritius	1982	only	-	Oct	10	0:00	1:00	S
+Rule Mauritius	1983	only	-	Mar	21	0:00	0	-
+Rule Mauritius	2008	only	-	Oct	lastSun	2:00	1:00	S
+Rule Mauritius	2009	only	-	Mar	lastSun	2:00	0	-
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone Indian/Mauritius	3:50:00 -	LMT	1907		# Port Louis
+			4:00 Mauritius	MU%sT	# Mauritius Time
+# Agalega Is, Rodriguez
+# no information; probably like Indian/Mauritius
+
+# Mayotte
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Indian/Mayotte	3:00:56 -	LMT	1911 Jul	# Mamoutzou
+			3:00	-	EAT
+
+# Morocco
+# See the `europe' file for Spanish Morocco (Africa/Ceuta).
+
+# From Alex Krivenyshev (2008-05-09):
+# Here is an article that Morocco plan to introduce Daylight Saving Time between
+# 1 June, 2008 and 27 September, 2008.
+#
+# "... Morocco is to save energy by adjusting its clock during summer so it will
+# be one hour ahead of GMT between 1 June and 27 September, according to
+# Communication Minister and Gov ernment Spokesman, Khalid Naciri...."
+#
+# <a href="http://www.worldtimezone.net/dst_news/dst_news_morocco01.html">
+# http://www.worldtimezone.net/dst_news/dst_news_morocco01.html
+# </a>
+# OR
+# <a href="http://en.afrik.com/news11892.html">
+# http://en.afrik.com/news11892.html
+# </a>
+
+# From Alex Krivenyshev (2008-05-09):
+# The Morocco time change can be confirmed on Morocco web site Maghreb Arabe Presse:
+# <a href="http://www.map.ma/eng/sections/box3/morocco_shifts_to_da/view">
+# http://www.map.ma/eng/sections/box3/morocco_shifts_to_da/view
+# </a>
+#
+# Morocco shifts to daylight time on June 1st through September 27, Govt.
+# spokesman.
+
+# From Patrice Scattolin (2008-05-09):
+# According to this article:
+# <a href="http://www.avmaroc.com/actualite/heure-dete-comment-a127896.html">
+# http://www.avmaroc.com/actualite/heure-dete-comment-a127896.html
+# </a>
+# (and republished here:
+# <a href="http://www.actu.ma/heure-dete-comment_i127896_0.html">
+# http://www.actu.ma/heure-dete-comment_i127896_0.html
+# </a>
+# )
+# the changes occurs at midnight:
+#
+# saturday night may 31st at midnight (which in french is to be
+# intrepreted as the night between saturday and sunday)
+# sunday night the 28th  at midnight
+#
+# Seeing that the 28th is monday, I am guessing that she intends to say
+# the midnight of the 28th which is the midnight between sunday and
+# monday, which jives with other sources that say that it's inclusive
+# june1st to sept 27th.
+#
+# The decision was taken by decree *2-08-224 *but I can't find the decree
+# published on the web.
+#
+# It's also confirmed here:
+# <a href="http://www.maroc.ma/NR/exeres/FACF141F-D910-44B0-B7FA-6E03733425D1.htm">
+# http://www.maroc.ma/NR/exeres/FACF141F-D910-44B0-B7FA-6E03733425D1.htm
+# </a>
+# on a government portal as being  between june 1st and sept 27th (not yet
+# posted in english).
+#
+# The following google query will generate many relevant hits:
+# <a href="http://www.google.com/search?hl=en&q=Conseil+de+gouvernement+maroc+heure+avance&btnG=Search">
+# http://www.google.com/search?hl=en&q=Conseil+de+gouvernement+maroc+heure+avance&btnG=Search
+# </a>
+
+# From Alex Krivenyshev (2008-05-09):
+# Is Western Sahara (part which administrated by Morocco) going to follow
+# Morocco DST changes?  Any information?  What about other part of
+# Western Sahara - under administration of POLISARIO Front (also named
+# SADR Saharawi Arab Democratic Republic)?
+
+# From Arthur David Olson (2008-05-09):
+# XXX--guess that it is only Morocco for now; guess only 2008 for now.
+
+# From Steffen Thorsen (2008-08-27):
+# Morocco will change the clocks back on the midnight between August 31 
+# and September 1. They originally planned to observe DST to near the end 
+# of September:
+#
+# One article about it (in French):
+# <a href="http://www.menara.ma/fr/Actualites/Maroc/Societe/ci.retour_a_l_heure_gmt_a_partir_du_dimanche_31_aout_a_minuit_officiel_.default">
+# http://www.menara.ma/fr/Actualites/Maroc/Societe/ci.retour_a_l_heure_gmt_a_partir_du_dimanche_31_aout_a_minuit_officiel_.default
+# </a>
+#
+# We have some further details posted here:
+# <a href="http://www.timeanddate.com/news/time/morocco-ends-dst-early-2008.html">
+# http://www.timeanddate.com/news/time/morocco-ends-dst-early-2008.html
+# </a>
+
+# From Steffen Thorsen (2009-03-17):
+# Morocco will observe DST from 2009-06-01 00:00 to 2009-08-21 00:00 according
+# to many sources, such as
+# <a href="http://news.marweb.com/morocco/entertainment/morocco-daylight-saving.html">
+# http://news.marweb.com/morocco/entertainment/morocco-daylight-saving.html
+# </a>
+# <a href="http://www.medi1sat.ma/fr/depeche.aspx?idp=2312">
+# http://www.medi1sat.ma/fr/depeche.aspx?idp=2312
+# </a>
+# (French)
+#
+# Our summary:
+# <a href="http://www.timeanddate.com/news/time/morocco-starts-dst-2009.html">
+# http://www.timeanddate.com/news/time/morocco-starts-dst-2009.html
+# </a>
+
+# From Alexander Krivenyshev (2009-03-17):
+# Here is a link to official document from Royaume du Maroc Premier Ministre,
+# Ministere de la Modernisation des Secteurs Publics
+#
+# Under Article 1 of Royal Decree No. 455-67 of Act 23 safar 1387 (2 june 1967)
+# concerning the amendment of the legal time, the Ministry of Modernization of
+# Public Sectors announced that the official time in the Kingdom will be
+# advanced 60 minutes from Sunday 31 May 2009 at midnight.
+#
+# <a href="http://www.mmsp.gov.ma/francais/Actualites_fr/PDF_Actualites_Fr/HeureEte_FR.pdf">
+# http://www.mmsp.gov.ma/francais/Actualites_fr/PDF_Actualites_Fr/HeureEte_FR.pdf
+# </a>
+#
+# <a href="http://www.worldtimezone.com/dst_news/dst_news_morocco03.html">
+# http://www.worldtimezone.com/dst_news/dst_news_morocco03.html
+# </a>
+
+# From Steffen Thorsen (2010-04-13):
+# Several news media in Morocco report that the Ministry of Modernization
+# of Public Sectors has announced that Morocco will have DST from
+# 2010-05-02 to 2010-08-08.
+#
+# Example:
+# <a href="http://www.lavieeco.com/actualites/4099-le-maroc-passera-a-l-heure-d-ete-gmt1-le-2-mai.html">
+# http://www.lavieeco.com/actualites/4099-le-maroc-passera-a-l-heure-d-ete-gmt1-le-2-mai.html
+# </a>
+# (French)
+# Our page:
+# <a href="http://www.timeanddate.com/news/time/morocco-starts-dst-2010.html">
+# http://www.timeanddate.com/news/time/morocco-starts-dst-2010.html
+# </a>
+
+# RULE	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+
+Rule	Morocco	1939	only	-	Sep	12	 0:00	1:00	S
+Rule	Morocco	1939	only	-	Nov	19	 0:00	0	-
+Rule	Morocco	1940	only	-	Feb	25	 0:00	1:00	S
+Rule	Morocco	1945	only	-	Nov	18	 0:00	0	-
+Rule	Morocco	1950	only	-	Jun	11	 0:00	1:00	S
+Rule	Morocco	1950	only	-	Oct	29	 0:00	0	-
+Rule	Morocco	1967	only	-	Jun	 3	12:00	1:00	S
+Rule	Morocco	1967	only	-	Oct	 1	 0:00	0	-
+Rule	Morocco	1974	only	-	Jun	24	 0:00	1:00	S
+Rule	Morocco	1974	only	-	Sep	 1	 0:00	0	-
+Rule	Morocco	1976	1977	-	May	 1	 0:00	1:00	S
+Rule	Morocco	1976	only	-	Aug	 1	 0:00	0	-
+Rule	Morocco	1977	only	-	Sep	28	 0:00	0	-
+Rule	Morocco	1978	only	-	Jun	 1	 0:00	1:00	S
+Rule	Morocco	1978	only	-	Aug	 4	 0:00	0	-
+Rule	Morocco	2008	only	-	Jun	 1	 0:00	1:00	S
+Rule	Morocco	2008	only	-	Sep	 1	 0:00	0	-
+Rule	Morocco	2009	only	-	Jun	 1	 0:00	1:00	S
+Rule	Morocco	2009	only	-	Aug	 21	 0:00	0	-
+Rule	Morocco	2010	only	-	May	 2	 0:00	1:00	S
+Rule	Morocco	2010	only	-	Aug	 8	 0:00	0	-
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone Africa/Casablanca	-0:30:20 -	LMT	1913 Oct 26
+			 0:00	Morocco	WE%sT	1984 Mar 16
+			 1:00	-	CET	1986
+			 0:00	Morocco	WE%sT
+# Western Sahara
+Zone Africa/El_Aaiun	-0:52:48 -	LMT	1934 Jan
+			-1:00	-	WAT	1976 Apr 14
+			 0:00	-	WET
+
+# Mozambique
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Africa/Maputo	2:10:20 -	LMT	1903 Mar
+			2:00	-	CAT
+
+# Namibia
+# The 1994-04-03 transition is from Shanks & Pottenger.
+# Shanks & Pottenger report no DST after 1998-04; go with IATA.
+
+# From Petronella Sibeene (2007-03-30) in
+# <http://allafrica.com/stories/200703300178.html>:
+# While the entire country changes its time, Katima Mulilo and other
+# settlements in Caprivi unofficially will not because the sun there
+# rises and sets earlier compared to other regions.  Chief of
+# Forecasting Riaan van Zyl explained that the far eastern parts of
+# the country are close to 40 minutes earlier in sunrise than the rest
+# of the country.
+# 
+# From Paul Eggert (2007-03-31):
+# Apparently the Caprivi Strip informally observes Botswana time, but
+# we have no details.  In the meantime people there can use Africa/Gaborone.
+
+# RULE	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Namibia	1994	max	-	Sep	Sun>=1	2:00	1:00	S
+Rule	Namibia	1995	max	-	Apr	Sun>=1	2:00	0	-
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Africa/Windhoek	1:08:24 -	LMT	1892 Feb 8
+			1:30	-	SWAT	1903 Mar	# SW Africa Time
+			2:00	-	SAST	1942 Sep 20 2:00
+			2:00	1:00	SAST	1943 Mar 21 2:00
+			2:00	-	SAST	1990 Mar 21 # independence
+			2:00	-	CAT	1994 Apr  3
+			1:00	Namibia	WA%sT
+
+# Niger
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Africa/Niamey	 0:08:28 -	LMT	1912
+			-1:00	-	WAT	1934 Feb 26
+			 0:00	-	GMT	1960
+			 1:00	-	WAT
+
+# Nigeria
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Africa/Lagos	0:13:36 -	LMT	1919 Sep
+			1:00	-	WAT
+
+# Reunion
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Indian/Reunion	3:41:52 -	LMT	1911 Jun	# Saint-Denis
+			4:00	-	RET	# Reunion Time
+#
+# Scattered Islands (Iles Eparses) administered from Reunion are as follows.
+# The following information about them is taken from
+# Iles Eparses (www.outre-mer.gouv.fr/domtom/ile.htm, 1997-07-22, in French;
+# no longer available as of 1999-08-17).
+# We have no info about their time zone histories.
+#
+# Bassas da India - uninhabited
+# Europa Island - inhabited from 1905 to 1910 by two families
+# Glorioso Is - inhabited until at least 1958
+# Juan de Nova - uninhabited
+# Tromelin - inhabited until at least 1958
+
+# Rwanda
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Africa/Kigali	2:00:16 -	LMT	1935 Jun
+			2:00	-	CAT
+
+# St Helena
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone Atlantic/St_Helena	-0:22:48 -	LMT	1890		# Jamestown
+			-0:22:48 -	JMT	1951	# Jamestown Mean Time
+			 0:00	-	GMT
+# The other parts of the St Helena territory are similar:
+#	Tristan da Cunha: on GMT, say Whitman and the CIA
+#	Ascension: on GMT, says usno1995 and the CIA
+#	Gough (scientific station since 1955; sealers wintered previously):
+#		on GMT, says the CIA
+#	Inaccessible, Nightingale: no information, but probably GMT
+
+# Sao Tome and Principe
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Africa/Sao_Tome	 0:26:56 -	LMT	1884
+			-0:36:32 -	LMT	1912	# Lisbon Mean Time
+			 0:00	-	GMT
+
+# Senegal
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Africa/Dakar	-1:09:44 -	LMT	1912
+			-1:00	-	WAT	1941 Jun
+			 0:00	-	GMT
+
+# Seychelles
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Indian/Mahe	3:41:48 -	LMT	1906 Jun	# Victoria
+			4:00	-	SCT	# Seychelles Time
+# From Paul Eggert (2001-05-30):
+# Aldabra, Farquhar, and Desroches, originally dependencies of the
+# Seychelles, were transferred to the British Indian Ocean Territory
+# in 1965 and returned to Seychelles control in 1976.  We don't know
+# whether this affected their time zone, so omit this for now.
+# Possibly the islands were uninhabited.
+
+# Sierra Leone
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+# Whitman gives Mar 31 - Aug 31 for 1931 on; go with Shanks & Pottenger.
+Rule	SL	1935	1942	-	Jun	 1	0:00	0:40	SLST
+Rule	SL	1935	1942	-	Oct	 1	0:00	0	WAT
+Rule	SL	1957	1962	-	Jun	 1	0:00	1:00	SLST
+Rule	SL	1957	1962	-	Sep	 1	0:00	0	GMT
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Africa/Freetown	-0:53:00 -	LMT	1882
+			-0:53:00 -	FMT	1913 Jun # Freetown Mean Time
+			-1:00	SL	%s	1957
+			 0:00	SL	%s
+
+# Somalia
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone Africa/Mogadishu	3:01:28 -	LMT	1893 Nov
+			3:00	-	EAT	1931
+			2:30	-	BEAT	1957
+			3:00	-	EAT
+
+# South Africa
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	SA	1942	1943	-	Sep	Sun>=15	2:00	1:00	-
+Rule	SA	1943	1944	-	Mar	Sun>=15	2:00	0	-
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone Africa/Johannesburg 1:52:00 -	LMT	1892 Feb 8
+			1:30	-	SAST	1903 Mar
+			2:00	SA	SAST
+# Marion and Prince Edward Is
+# scientific station since 1947
+# no information
+
+# Sudan
+#
+# From <a href="http://www.sunanews.net/sn13jane.html">
+# Sudan News Agency (2000-01-13)
+# </a>, also reported by Michael De Beukelaer-Dossche via Steffen Thorsen:
+# Clocks will be moved ahead for 60 minutes all over the Sudan as of noon
+# Saturday....  This was announced Thursday by Caretaker State Minister for
+# Manpower Abdul-Rahman Nur-Eddin.
+#
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Sudan	1970	only	-	May	 1	0:00	1:00	S
+Rule	Sudan	1970	1985	-	Oct	15	0:00	0	-
+Rule	Sudan	1971	only	-	Apr	30	0:00	1:00	S
+Rule	Sudan	1972	1985	-	Apr	lastSun	0:00	1:00	S
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Africa/Khartoum	2:10:08 -	LMT	1931
+			2:00	Sudan	CA%sT	2000 Jan 15 12:00
+			3:00	-	EAT
+
+# Swaziland
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Africa/Mbabane	2:04:24 -	LMT	1903 Mar
+			2:00	-	SAST
+
+# Tanzania
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone Africa/Dar_es_Salaam 2:37:08 -	LMT	1931
+			3:00	-	EAT	1948
+			2:44:45	-	BEAUT	1961
+			3:00	-	EAT
+
+# Togo
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Africa/Lome	0:04:52 -	LMT	1893
+			0:00	-	GMT
+
+# Tunisia
+
+# From Gwillim Law (2005-04-30):
+# My correspondent, Risto Nykanen, has alerted me to another adoption of DST,
+# this time in Tunisia.  According to Yahoo France News
+# <http://fr.news.yahoo.com/050426/5/4dumk.html>, in a story attributed to AP
+# and dated 2005-04-26, "Tunisia has decided to advance its official time by
+# one hour, starting on Sunday, May 1.  Henceforth, Tunisian time will be
+# UTC+2 instead of UTC+1.  The change will take place at 23:00 UTC next
+# Saturday."  (My translation)
+#
+# From Oscar van Vlijmen (2005-05-02):
+# LaPresse, the first national daily newspaper ...
+# <http://www.lapresse.tn/archives/archives280405/actualites/lheure.html>
+# ... DST for 2005: on: Sun May 1 0h standard time, off: Fri Sept. 30,
+# 1h standard time.
+#
+# From Atef Loukil (2006-03-28):
+# The daylight saving time will be the same each year:
+# Beginning      : the last Sunday of March at 02:00
+# Ending         : the last Sunday of October at 03:00 ...
+# http://www.tap.info.tn/en/index.php?option=com_content&task=view&id=1188&Itemid=50
+
+# From Steffen Thorsen (2009-03-16):
+# According to several news sources, Tunisia will not observe DST this year.
+# (Arabic)
+# <a href="http://www.elbashayer.com/?page=viewn&nid=42546">
+# http://www.elbashayer.com/?page=viewn&nid=42546
+# </a>
+# <a href="http://www.babnet.net/kiwidetail-15295.asp">
+# http://www.babnet.net/kiwidetail-15295.asp
+# </a>
+#
+# We have also confirmed this with the US embassy in Tunisia.
+# We have a wrap-up about this on the following page:
+# <a href="http://www.timeanddate.com/news/time/tunisia-cancels-dst-2009.html">
+# http://www.timeanddate.com/news/time/tunisia-cancels-dst-2009.html
+# </a>
+
+# From Alexander Krivenyshev (2009-03-17):
+# Here is a link to Tunis Afrique Presse News Agency
+#
+# Standard time to be kept the whole year long (tap.info.tn):
+#
+# (in English)
+# <a href="http://www.tap.info.tn/en/index.php?option=com_content&task=view&id=26813&Itemid=157">
+# http://www.tap.info.tn/en/index.php?option=com_content&task=view&id=26813&Itemid=157
+# </a>
+#
+# (in Arabic)
+# <a href="http://www.tap.info.tn/ar/index.php?option=com_content&task=view&id=61240&Itemid=1">
+# http://www.tap.info.tn/ar/index.php?option=com_content&task=view&id=61240&Itemid=1
+# </a>
+
+# From Arthur David Olson (2009--3-18):
+# The Tunis Afrique Presse News Agency notice contains this: "This measure is due to the fact
+# that the fasting month of ramadan coincides with the period concerned by summer time.
+# Therefore, the standard time will be kept unchanged the whole year long."
+# So foregoing DST seems to be an exception (albeit one that may be repeated in the  future).
+
+# From Alexander Krivenyshev (2010-03-27):
+# According to some news reports Tunis confirmed not to use DST in 2010
+#
+# (translation):
+# "The Tunisian government has decided to abandon DST, which was scheduled on
+# Sunday...
+# Tunisian authorities had suspended the DST for the first time last year also
+# coincided with the month of Ramadan..."
+#
+# (in Arabic)
+# <a href="http://www.moheet.com/show_news.aspx?nid=358861&pg=1">
+# http://www.moheet.com/show_news.aspx?nid=358861&pg=1
+# <a href="http://www.almadenahnews.com/newss/news.php?c=118&id=38036">
+# http://www.almadenahnews.com/newss/news.php?c=118&id=38036
+# or
+# <a href="http://www.worldtimezone.com/dst_news/dst_news_tunis02.html">
+# http://www.worldtimezone.com/dst_news/dst_news_tunis02.html
+
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Tunisia	1939	only	-	Apr	15	23:00s	1:00	S
+Rule	Tunisia	1939	only	-	Nov	18	23:00s	0	-
+Rule	Tunisia	1940	only	-	Feb	25	23:00s	1:00	S
+Rule	Tunisia	1941	only	-	Oct	 6	 0:00	0	-
+Rule	Tunisia	1942	only	-	Mar	 9	 0:00	1:00	S
+Rule	Tunisia	1942	only	-	Nov	 2	 3:00	0	-
+Rule	Tunisia	1943	only	-	Mar	29	 2:00	1:00	S
+Rule	Tunisia	1943	only	-	Apr	17	 2:00	0	-
+Rule	Tunisia	1943	only	-	Apr	25	 2:00	1:00	S
+Rule	Tunisia	1943	only	-	Oct	 4	 2:00	0	-
+Rule	Tunisia	1944	1945	-	Apr	Mon>=1	 2:00	1:00	S
+Rule	Tunisia	1944	only	-	Oct	 8	 0:00	0	-
+Rule	Tunisia	1945	only	-	Sep	16	 0:00	0	-
+Rule	Tunisia	1977	only	-	Apr	30	 0:00s	1:00	S
+Rule	Tunisia	1977	only	-	Sep	24	 0:00s	0	-
+Rule	Tunisia	1978	only	-	May	 1	 0:00s	1:00	S
+Rule	Tunisia	1978	only	-	Oct	 1	 0:00s	0	-
+Rule	Tunisia	1988	only	-	Jun	 1	 0:00s	1:00	S
+Rule	Tunisia	1988	1990	-	Sep	lastSun	 0:00s	0	-
+Rule	Tunisia	1989	only	-	Mar	26	 0:00s	1:00	S
+Rule	Tunisia	1990	only	-	May	 1	 0:00s	1:00	S
+Rule	Tunisia	2005	only	-	May	 1	 0:00s	1:00	S
+Rule	Tunisia	2005	only	-	Sep	30	 1:00s	0	-
+Rule	Tunisia	2006	2008	-	Mar	lastSun	 2:00s	1:00	S
+Rule	Tunisia	2006	2008	-	Oct	lastSun	 2:00s	0	-
+
+# Shanks & Pottenger give 0:09:20 for Paris Mean Time; go with Howse's
+# more precise 0:09:21.
+# Shanks & Pottenger say the 1911 switch was on Mar 9; go with Howse's Mar 11.
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Africa/Tunis	0:40:44 -	LMT	1881 May 12
+			0:09:21	-	PMT	1911 Mar 11    # Paris Mean Time
+			1:00	Tunisia	CE%sT
+
+# Uganda
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Africa/Kampala	2:09:40 -	LMT	1928 Jul
+			3:00	-	EAT	1930
+			2:30	-	BEAT	1948
+			2:44:45	-	BEAUT	1957
+			3:00	-	EAT
+
+# Zambia
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Africa/Lusaka	1:53:08 -	LMT	1903 Mar
+			2:00	-	CAT
+
+# Zimbabwe
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Africa/Harare	2:04:12 -	LMT	1903 Mar
+			2:00	-	CAT
diff --git a/tools/zoneinfo/tzdata2010k/antarctica b/tools/zoneinfo/tzdata2010k/antarctica
new file mode 100644
index 0000000..629b2d7
--- /dev/null
+++ b/tools/zoneinfo/tzdata2010k/antarctica
@@ -0,0 +1,411 @@
+# <pre>
+# @(#)antarctica	8.8
+# This file is in the public domain, so clarified as of
+# 2009-05-17 by Arthur David Olson.
+
+# From Paul Eggert (1999-11-15):
+# To keep things manageable, we list only locations occupied year-round; see
+# <a href="http://www.comnap.aq/comnap/comnap.nsf/P/Stations/">
+# COMNAP - Stations and Bases
+# </a>
+# and
+# <a href="http://www.spri.cam.ac.uk/bob/periant.htm">
+# Summary of the Peri-Antarctic Islands (1998-07-23)
+# </a>
+# for information.
+# Unless otherwise specified, we have no time zone information.
+#
+# Except for the French entries,
+# I made up all time zone abbreviations mentioned here; corrections welcome!
+# FORMAT is `zzz' and GMTOFF is 0 for locations while uninhabited.
+
+# These rules are stolen from the `europe' file.
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	RussAQ	1981	1984	-	Apr	 1	 0:00	1:00	S
+Rule	RussAQ	1981	1983	-	Oct	 1	 0:00	0	-
+Rule	RussAQ	1984	1991	-	Sep	lastSun	 2:00s	0	-
+Rule	RussAQ	1985	1991	-	Mar	lastSun	 2:00s	1:00	S
+Rule	RussAQ	1992	only	-	Mar	lastSat	 23:00	1:00	S
+Rule	RussAQ	1992	only	-	Sep	lastSat	 23:00	0	-
+Rule	RussAQ	1993	max	-	Mar	lastSun	 2:00s	1:00	S
+Rule	RussAQ	1993	1995	-	Sep	lastSun	 2:00s	0	-
+Rule	RussAQ	1996	max	-	Oct	lastSun	 2:00s	0	-
+
+# These rules are stolen from the `southamerica' file.
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	ArgAQ	1964	1966	-	Mar	 1	0:00	0	-
+Rule	ArgAQ	1964	1966	-	Oct	15	0:00	1:00	S
+Rule	ArgAQ	1967	only	-	Apr	 2	0:00	0	-
+Rule	ArgAQ	1967	1968	-	Oct	Sun>=1	0:00	1:00	S
+Rule	ArgAQ	1968	1969	-	Apr	Sun>=1	0:00	0	-
+Rule	ArgAQ	1974	only	-	Jan	23	0:00	1:00	S
+Rule	ArgAQ	1974	only	-	May	 1	0:00	0	-
+Rule	ChileAQ	1972	1986	-	Mar	Sun>=9	3:00u	0	-
+Rule	ChileAQ	1974	1987	-	Oct	Sun>=9	4:00u	1:00	S
+Rule	ChileAQ	1987	only	-	Apr	12	3:00u	0	-
+Rule	ChileAQ	1988	1989	-	Mar	Sun>=9	3:00u	0	-
+Rule	ChileAQ	1988	only	-	Oct	Sun>=1	4:00u	1:00	S
+Rule	ChileAQ	1989	only	-	Oct	Sun>=9	4:00u	1:00	S
+Rule	ChileAQ	1990	only	-	Mar	18	3:00u	0	-
+Rule	ChileAQ	1990	only	-	Sep	16	4:00u	1:00	S
+Rule	ChileAQ	1991	1996	-	Mar	Sun>=9	3:00u	0	-
+Rule	ChileAQ	1991	1997	-	Oct	Sun>=9	4:00u	1:00	S
+Rule	ChileAQ	1997	only	-	Mar	30	3:00u	0	-
+Rule	ChileAQ	1998	only	-	Mar	Sun>=9	3:00u	0	-
+Rule	ChileAQ	1998	only	-	Sep	27	4:00u	1:00	S
+Rule	ChileAQ	1999	only	-	Apr	 4	3:00u	0	-
+Rule	ChileAQ	1999	max	-	Oct	Sun>=9	4:00u	1:00	S
+Rule	ChileAQ	2000	max	-	Mar	Sun>=9	3:00u	0	-
+
+# These rules are stolen from the `australasia' file.
+Rule	AusAQ	1917	only	-	Jan	 1	0:01	1:00	-
+Rule	AusAQ	1917	only	-	Mar	25	2:00	0	-
+Rule	AusAQ	1942	only	-	Jan	 1	2:00	1:00	-
+Rule	AusAQ	1942	only	-	Mar	29	2:00	0	-
+Rule	AusAQ	1942	only	-	Sep	27	2:00	1:00	-
+Rule	AusAQ	1943	1944	-	Mar	lastSun	2:00	0	-
+Rule	AusAQ	1943	only	-	Oct	 3	2:00	1:00	-
+Rule	ATAQ	1967	only	-	Oct	Sun>=1	2:00s	1:00	-
+Rule	ATAQ	1968	only	-	Mar	lastSun	2:00s	0	-
+Rule	ATAQ	1968	1985	-	Oct	lastSun	2:00s	1:00	-
+Rule	ATAQ	1969	1971	-	Mar	Sun>=8	2:00s	0	-
+Rule	ATAQ	1972	only	-	Feb	lastSun	2:00s	0	-
+Rule	ATAQ	1973	1981	-	Mar	Sun>=1	2:00s	0	-
+Rule	ATAQ	1982	1983	-	Mar	lastSun	2:00s	0	-
+Rule	ATAQ	1984	1986	-	Mar	Sun>=1	2:00s	0	-
+Rule	ATAQ	1986	only	-	Oct	Sun>=15	2:00s	1:00	-
+Rule	ATAQ	1987	1990	-	Mar	Sun>=15	2:00s	0	-
+Rule	ATAQ	1987	only	-	Oct	Sun>=22	2:00s	1:00	-
+Rule	ATAQ	1988	1990	-	Oct	lastSun	2:00s	1:00	-
+Rule	ATAQ	1991	1999	-	Oct	Sun>=1	2:00s	1:00	-
+Rule	ATAQ	1991	2005	-	Mar	lastSun	2:00s	0	-
+Rule	ATAQ	2000	only	-	Aug	lastSun	2:00s	1:00	-
+Rule	ATAQ	2001	max	-	Oct	Sun>=1	2:00s	1:00	-
+Rule	ATAQ	2006	only	-	Apr	Sun>=1	2:00s	0	-
+Rule	ATAQ	2007	only	-	Mar	lastSun	2:00s	0	-
+Rule	ATAQ	2008	max	-	Apr	Sun>=1	2:00s	0	-
+
+# Argentina - year-round bases
+# Belgrano II, Confin Coast, -770227-0343737, since 1972-02-05
+# Esperanza, San Martin Land, -6323-05659, since 1952-12-17
+# Jubany, Potter Peninsula, King George Island, -6414-0602320, since 1982-01
+# Marambio, Seymour I, -6414-05637, since 1969-10-29
+# Orcadas, Laurie I, -6016-04444, since 1904-02-22
+# San Martin, Debenham I, -6807-06708, since 1951-03-21
+#	(except 1960-03 / 1976-03-21)
+
+# Australia - territories
+# Heard Island, McDonald Islands (uninhabited)
+#	previously sealers and scientific personnel wintered
+#	<a href="http://web.archive.org/web/20021204222245/http://www.dstc.qut.edu.au/DST/marg/daylight.html">
+#	Margaret Turner reports
+#	</a> (1999-09-30) that they're UTC+5, with no DST;
+#	presumably this is when they have visitors.
+#
+# year-round bases
+# Casey, Bailey Peninsula, -6617+11032, since 1969
+# Davis, Vestfold Hills, -6835+07759, since 1957-01-13
+#	(except 1964-11 - 1969-02)
+# Mawson, Holme Bay, -6736+06253, since 1954-02-13
+
+# From Steffen Thorsen (2009-03-11):
+# Three Australian stations in Antarctica have changed their time zone:
+# Casey moved from UTC+8 to UTC+11
+# Davis moved from UTC+7 to UTC+5
+# Mawson moved from UTC+6 to UTC+5
+# The changes occurred on 2009-10-18 at 02:00 (local times).
+#
+# Government source: (Australian Antarctic Division)
+# <a href="http://www.aad.gov.au/default.asp?casid=37079">
+# http://www.aad.gov.au/default.asp?casid=37079
+# </a>
+#
+# We have more background information here:
+# <a href="http://www.timeanddate.com/news/time/antarctica-new-times.html">
+# http://www.timeanddate.com/news/time/antarctica-new-times.html
+# </a>
+
+# From Steffen Thorsen (2010-03-10):
+# We got these changes from the Australian Antarctic Division:
+# - Macquarie Island will stay on UTC+11 for winter and therefore not
+# switch back from daylight savings time when other parts of Australia do
+# on 4 April.
+#
+# - Casey station reverted to its normal time of UTC+8 on 5 March 2010.
+# The change to UTC+11 is being considered as a regular summer thing but
+# has not been decided yet.
+#
+# - Davis station will revert to its normal time of UTC+7 at 10 March 2010
+# 20:00 UTC.
+#
+# - Mawson station stays on UTC+5.
+#
+# In addition to the Rule changes for Casey/Davis, it means that Macquarie
+# will no longer be like Hobart and will have to have its own Zone created.
+#
+# Background:
+# <a href="http://www.timeanddate.com/news/time/antartica-time-changes-2010.html">
+# http://www.timeanddate.com/news/time/antartica-time-changes-2010.html
+# </a>
+
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone Antarctica/Casey	0	-	zzz	1969
+			8:00	-	WST	2009 Oct 18 2:00
+						# Western (Aus) Standard Time
+			11:00	-	CAST	2010 Mar 5 2:00
+						# Casey Time
+			8:00	-	WST
+Zone Antarctica/Davis	0	-	zzz	1957 Jan 13
+			7:00	-	DAVT	1964 Nov # Davis Time
+			0	-	zzz	1969 Feb
+			7:00	-	DAVT	2009 Oct 18 2:00
+			5:00	-	DAVT	2010 Mar 10 20:00u
+			7:00	-	DAVT
+Zone Antarctica/Mawson	0	-	zzz	1954 Feb 13
+			6:00	-	MAWT	2009 Oct 18 2:00
+						# Mawson Time
+			5:00	-	MAWT
+Zone Antarctica/Macquarie 0	-	zzz	1911
+			10:00	-	EST	1916 Oct 1 2:00
+			10:00	1:00	EST	1917 Feb
+			10:00	AusAQ	EST	1967
+			10:00	ATAQ	EST	2010 Apr 4 3:00
+			11:00	-	MIST	# Macquarie Island Time
+# References:
+# <a href="http://www.antdiv.gov.au/aad/exop/sfo/casey/casey_aws.html">
+# Casey Weather (1998-02-26)
+# </a>
+# <a href="http://www.antdiv.gov.au/aad/exop/sfo/davis/video.html">
+# Davis Station, Antarctica (1998-02-26)
+# </a>
+# <a href="http://www.antdiv.gov.au/aad/exop/sfo/mawson/video.html">
+# Mawson Station, Antarctica (1998-02-25)
+# </a>
+
+# Brazil - year-round base
+# Comandante Ferraz, King George Island, -6205+05824, since 1983/4
+
+# Chile - year-round bases and towns
+# Escudero, South Shetland Is, -621157-0585735, since 1994
+# Presidente Eduadro Frei, King George Island, -6214-05848, since 1969-03-07
+# General Bernardo O'Higgins, Antarctic Peninsula, -6319-05704, since 1948-02
+# Capitan Arturo Prat, -6230-05941
+# Villa Las Estrellas (a town), around the Frei base, since 1984-04-09
+# These locations have always used Santiago time; use TZ='America/Santiago'.
+
+# China - year-round bases
+# Great Wall, King George Island, -6213-05858, since 1985-02-20
+# Zhongshan, Larsemann Hills, Prydz Bay, -6922+07623, since 1989-02-26
+
+# France - year-round bases
+#
+# From Antoine Leca (1997-01-20):
+# Time data are from Nicole Pailleau at the IFRTP
+# (French Institute for Polar Research and Technology).
+# She confirms that French Southern Territories and Terre Adelie bases
+# don't observe daylight saving time, even if Terre Adelie supplies came
+# from Tasmania.
+#
+# French Southern Territories with year-round inhabitants
+#
+# Martin-de-Vivies Base, Amsterdam Island, -374105+0773155, since 1950
+# Alfred-Faure Base, Crozet Islands, -462551+0515152, since 1964
+# Port-aux-Francais, Kerguelen Islands, -492110+0701303, since 1951;
+#	whaling & sealing station operated 1908/1914, 1920/1929, and 1951/1956
+#
+# St Paul Island - near Amsterdam, uninhabited
+#	fishing stations operated variously 1819/1931
+#
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone Indian/Kerguelen	0	-	zzz	1950	# Port-aux-Francais
+			5:00	-	TFT	# ISO code TF Time
+#
+# year-round base in the main continent
+# Dumont-d'Urville, Ile des Petrels, -6640+14001, since 1956-11
+#
+# Another base at Port-Martin, 50km east, began operation in 1947.
+# It was destroyed by fire on 1952-01-14.
+#
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone Antarctica/DumontDUrville 0 -	zzz	1947
+			10:00	-	PMT	1952 Jan 14 # Port-Martin Time
+			0	-	zzz	1956 Nov
+			10:00	-	DDUT	# Dumont-d'Urville Time
+# Reference:
+# <a href="http://en.wikipedia.org/wiki/Dumont_d'Urville_Station">
+# Dumont d'Urville Station (2005-12-05)
+# </a>
+
+# Germany - year-round base
+# Georg von Neumayer, -7039-00815
+
+# India - year-round base
+# Dakshin Gangotri, -7005+01200
+
+# Japan - year-round bases
+# Dome Fuji, -7719+03942
+# Syowa, -690022+0393524
+#
+# From Hideyuki Suzuki (1999-02-06):
+# In all Japanese stations, +0300 is used as the standard time.
+#
+# Syowa station, which is the first antarctic station of Japan,
+# was established on 1957-01-29.  Since Syowa station is still the main
+# station of Japan, it's appropriate for the principal location.
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone Antarctica/Syowa	0	-	zzz	1957 Jan 29
+			3:00	-	SYOT	# Syowa Time
+# See:
+# <a href="http://www.nipr.ac.jp/english/ara01.html">
+# NIPR Antarctic Research Activities (1999-08-17)
+# </a>
+
+# S Korea - year-round base
+# King Sejong, King George Island, -6213-05847, since 1988
+
+# New Zealand - claims
+# Balleny Islands (never inhabited)
+# Scott Island (never inhabited)
+#
+# year-round base
+# Scott, Ross Island, since 1957-01, is like Antarctica/McMurdo.
+#
+# These rules for New Zealand are stolen from the `australasia' file.
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	NZAQ	1974	only	-	Nov	 3	2:00s	1:00	D
+Rule	NZAQ	1975	1988	-	Oct	lastSun	2:00s	1:00	D
+Rule	NZAQ	1989	only	-	Oct	 8	2:00s	1:00	D
+Rule	NZAQ	1990	2006	-	Oct	Sun>=1	2:00s	1:00	D
+Rule	NZAQ	1975	only	-	Feb	23	2:00s	0	S
+Rule	NZAQ	1976	1989	-	Mar	Sun>=1	2:00s	0	S
+Rule	NZAQ	1990	2007	-	Mar	Sun>=15	2:00s	0	S
+Rule	NZAQ	2007	max	-	Sep	lastSun	2:00s	1:00	D
+Rule	NZAQ	2008	max	-	Apr	Sun>=1	2:00s	0	S
+
+# Norway - territories
+# Bouvet (never inhabited)
+#
+# claims
+# Peter I Island (never inhabited)
+
+# Poland - year-round base
+# Arctowski, King George Island, -620945-0582745, since 1977
+
+# Russia - year-round bases
+# Bellingshausen, King George Island, -621159-0585337, since 1968-02-22
+# Mirny, Davis coast, -6633+09301, since 1956-02
+# Molodezhnaya, Alasheyev Bay, -6740+04551,
+#	year-round from 1962-02 to 1999-07-01
+# Novolazarevskaya, Queen Maud Land, -7046+01150,
+#	year-round from 1960/61 to 1992
+
+# Vostok, since 1957-12-16, temporarily closed 1994-02/1994-11
+# <a href="http://quest.arc.nasa.gov/antarctica/QA/computers/Directions,Time,ZIP">
+# From Craig Mundell (1994-12-15)</a>:
+# Vostok, which is one of the Russian stations, is set on the same
+# time as Moscow, Russia.
+#
+# From Lee Hotz (2001-03-08):
+# I queried the folks at Columbia who spent the summer at Vostok and this is
+# what they had to say about time there:
+# ``in the US Camp (East Camp) we have been on New Zealand (McMurdo)
+# time, which is 12 hours ahead of GMT. The Russian Station Vostok was
+# 6 hours behind that (although only 2 miles away, i.e. 6 hours ahead
+# of GMT). This is a time zone I think two hours east of Moscow. The
+# natural time zone is in between the two: 8 hours ahead of GMT.''
+#
+# From Paul Eggert (2001-05-04):
+# This seems to be hopelessly confusing, so I asked Lee Hotz about it
+# in person.  He said that some Antartic locations set their local
+# time so that noon is the warmest part of the day, and that this
+# changes during the year and does not necessarily correspond to mean
+# solar noon.  So the Vostok time might have been whatever the clocks
+# happened to be during their visit.  So we still don't really know what time
+# it is at Vostok.  But we'll guess UTC+6.
+#
+Zone Antarctica/Vostok	0	-	zzz	1957 Dec 16
+			6:00	-	VOST	# Vostok time
+
+# S Africa - year-round bases
+# Marion Island, -4653+03752
+# Sanae, -7141-00250
+
+# UK
+#
+# British Antarctic Territories (BAT) claims
+# South Orkney Islands
+#	scientific station from 1903
+#	whaling station at Signy I 1920/1926
+# South Shetland Islands
+#
+# year-round bases
+# Bird Island, South Georgia, -5400-03803, since 1983
+# Deception Island, -6259-06034, whaling station 1912/1931,
+#	scientific station 1943/1967,
+#	previously sealers and a scientific expedition wintered by accident,
+#	and a garrison was deployed briefly
+# Halley, Coates Land, -7535-02604, since 1956-01-06
+#	Halley is on a moving ice shelf and is periodically relocated
+#	so that it is never more than 10km from its nominal location.
+# Rothera, Adelaide Island, -6734-6808, since 1976-12-01
+#
+# From Paul Eggert (2002-10-22)
+# <http://webexhibits.org/daylightsaving/g.html> says Rothera is -03 all year.
+#
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone Antarctica/Rothera	0	-	zzz	1976 Dec  1
+			-3:00	-	ROTT	# Rothera time
+
+# Uruguay - year round base
+# Artigas, King George Island, -621104-0585107
+
+# USA - year-round bases
+#
+# Palmer, Anvers Island, since 1965 (moved 2 miles in 1968)
+#
+# From Ethan Dicks (1996-10-06):
+# It keeps the same time as Punta Arenas, Chile, because, just like us
+# and the South Pole, that's the other end of their supply line....
+# I verified with someone who was there that since 1980,
+# Palmer has followed Chile.  Prior to that, before the Falklands War,
+# Palmer used to be supplied from Argentina.
+#
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone Antarctica/Palmer	0	-	zzz	1965
+			-4:00	ArgAQ	AR%sT	1969 Oct 5
+			-3:00	ArgAQ	AR%sT	1982 May
+			-4:00	ChileAQ	CL%sT
+#
+#
+# McMurdo, Ross Island, since 1955-12
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone Antarctica/McMurdo	0	-	zzz	1956
+			12:00	NZAQ	NZ%sT
+#
+# Amundsen-Scott, South Pole, continuously occupied since 1956-11-20
+#
+# From Paul Eggert (1996-09-03):
+# Normally it wouldn't have a separate entry, since it's like the
+# larger Antarctica/McMurdo since 1970, but it's too famous to omit.
+#
+# From Chris Carrier (1996-06-27):
+# Siple, the first commander of the South Pole station,
+# stated that he would have liked to have kept GMT at the station,
+# but that he found it more convenient to keep GMT+12
+# as supplies for the station were coming from McMurdo Sound,
+# which was on GMT+12 because New Zealand was on GMT+12 all year
+# at that time (1957).  (Source: Siple's book 90 degrees SOUTH.)
+#
+# From Susan Smith
+# http://www.cybertours.com/whs/pole10.html
+# (1995-11-13 16:24:56 +1300, no longer available):
+# We use the same time as McMurdo does.
+# And they use the same time as Christchurch, NZ does....
+# One last quirk about South Pole time.
+# All the electric clocks are usually wrong.
+# Something about the generators running at 60.1hertz or something
+# makes all of the clocks run fast.  So every couple of days,
+# we have to go around and set them back 5 minutes or so.
+# Maybe if we let them run fast all of the time, we'd get to leave here sooner!!
+#
+Link	Antarctica/McMurdo	Antarctica/South_Pole
diff --git a/tools/zoneinfo/tzdata2010k/asia b/tools/zoneinfo/tzdata2010k/asia
new file mode 100644
index 0000000..78ff2ff
--- /dev/null
+++ b/tools/zoneinfo/tzdata2010k/asia
@@ -0,0 +1,2573 @@
+# @(#)asia	8.60
+# This file is in the public domain, so clarified as of
+# 2009-05-17 by Arthur David Olson.
+
+# This data is by no means authoritative; if you think you know better,
+# go ahead and edit the file (and please send any changes to
+# tz@elsie.nci.nih.gov for general use in the future).
+
+# From Paul Eggert (2006-03-22):
+#
+# A good source for time zone historical data outside the U.S. is
+# Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
+# San Diego: ACS Publications, Inc. (2003).
+#
+# Gwillim Law writes that a good source
+# for recent time zone data is the International Air Transport
+# Association's Standard Schedules Information Manual (IATA SSIM),
+# published semiannually.  Law sent in several helpful summaries
+# of the IATA's data after 1990.
+#
+# Except where otherwise noted, Shanks & Pottenger is the source for
+# entries through 1990, and IATA SSIM is the source for entries afterwards.
+#
+# Another source occasionally used is Edward W. Whitman, World Time Differences,
+# Whitman Publishing Co, 2 Niagara Av, Ealing, London (undated), which
+# I found in the UCLA library.
+#
+# A reliable and entertaining source about time zones is
+# Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997).
+#
+# I invented the abbreviations marked `*' in the following table;
+# the rest are from earlier versions of this file, or from other sources.
+# Corrections are welcome!
+#	     std  dst
+#	     LMT	Local Mean Time
+#	2:00 EET  EEST	Eastern European Time
+#	2:00 IST  IDT	Israel
+#	3:00 AST  ADT	Arabia*
+#	3:30 IRST IRDT	Iran
+#	4:00 GST	Gulf*
+#	5:30 IST	India
+#	7:00 ICT	Indochina*
+#	7:00 WIT	west Indonesia
+#	8:00 CIT	central Indonesia
+#	8:00 CST	China
+#	9:00 CJT	Central Japanese Time (1896/1937)*
+#	9:00 EIT	east Indonesia
+#	9:00 JST  JDT	Japan
+#	9:00 KST  KDT	Korea
+#	9:30 CST	(Australian) Central Standard Time
+#
+# See the `europe' file for Russia and Turkey in Asia.
+
+# From Guy Harris:
+# Incorporates data for Singapore from Robert Elz' asia 1.1, as well as
+# additional information from Tom Yap, Sun Microsystems Intercontinental
+# Technical Support (including a page from the Official Airline Guide -
+# Worldwide Edition).  The names for time zones are guesses.
+
+###############################################################################
+
+# These rules are stolen from the `europe' file.
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	EUAsia	1981	max	-	Mar	lastSun	 1:00u	1:00	S
+Rule	EUAsia	1979	1995	-	Sep	lastSun	 1:00u	0	-
+Rule	EUAsia	1996	max	-	Oct	lastSun	 1:00u	0	-
+Rule E-EurAsia	1981	max	-	Mar	lastSun	 0:00	1:00	S
+Rule E-EurAsia	1979	1995	-	Sep	lastSun	 0:00	0	-
+Rule E-EurAsia	1996	max	-	Oct	lastSun	 0:00	0	-
+Rule RussiaAsia	1981	1984	-	Apr	1	 0:00	1:00	S
+Rule RussiaAsia	1981	1983	-	Oct	1	 0:00	0	-
+Rule RussiaAsia	1984	1991	-	Sep	lastSun	 2:00s	0	-
+Rule RussiaAsia	1985	1991	-	Mar	lastSun	 2:00s	1:00	S
+Rule RussiaAsia	1992	only	-	Mar	lastSat	23:00	1:00	S
+Rule RussiaAsia	1992	only	-	Sep	lastSat	23:00	0	-
+Rule RussiaAsia	1993	max	-	Mar	lastSun	 2:00s	1:00	S
+Rule RussiaAsia	1993	1995	-	Sep	lastSun	 2:00s	0	-
+Rule RussiaAsia	1996	max	-	Oct	lastSun	 2:00s	0	-
+
+# Afghanistan
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Asia/Kabul	4:36:48 -	LMT	1890
+			4:00	-	AFT	1945
+			4:30	-	AFT
+
+# Armenia
+# From Paul Eggert (2006-03-22):
+# Shanks & Pottenger have Yerevan switching to 3:00 (with Russian DST)
+# in spring 1991, then to 4:00 with no DST in fall 1995, then
+# readopting Russian DST in 1997.  Go with Shanks & Pottenger, even
+# when they disagree with others.  Edgar Der-Danieliantz
+# reported (1996-05-04) that Yerevan probably wouldn't use DST
+# in 1996, though it did use DST in 1995.  IATA SSIM (1991/1998) reports that
+# Armenia switched from 3:00 to 4:00 in 1998 and observed DST after 1991,
+# but started switching at 3:00s in 1998.
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Asia/Yerevan	2:58:00 -	LMT	1924 May  2
+			3:00	-	YERT	1957 Mar    # Yerevan Time
+			4:00 RussiaAsia YER%sT	1991 Mar 31 2:00s
+			3:00	1:00	YERST	1991 Sep 23 # independence
+			3:00 RussiaAsia	AM%sT	1995 Sep 24 2:00s
+			4:00	-	AMT	1997
+			4:00 RussiaAsia	AM%sT
+
+# Azerbaijan
+# From Rustam Aliyev of the Azerbaijan Internet Forum (2005-10-23):
+# According to the resolution of Cabinet of Ministers, 1997
+# Resolution available at: http://aif.az/docs/daylight_res.pdf
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Azer	1997	max	-	Mar	lastSun	 4:00	1:00	S
+Rule	Azer	1997	max	-	Oct	lastSun	 5:00	0	-
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Asia/Baku	3:19:24 -	LMT	1924 May  2
+			3:00	-	BAKT	1957 Mar    # Baku Time
+			4:00 RussiaAsia BAK%sT	1991 Mar 31 2:00s
+			3:00	1:00	BAKST	1991 Aug 30 # independence
+			3:00 RussiaAsia	AZ%sT	1992 Sep lastSat 23:00
+			4:00	-	AZT	1996 # Azerbaijan time
+			4:00	EUAsia	AZ%sT	1997
+			4:00	Azer	AZ%sT
+
+# Bahrain
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Asia/Bahrain	3:22:20 -	LMT	1920		# Al Manamah
+			4:00	-	GST	1972 Jun
+			3:00	-	AST
+
+# Bangladesh
+# From Alexander Krivenyshev (2009-05-13):
+# According to newspaper Asian Tribune (May 6, 2009) Bangladesh may introduce
+# Daylight Saving Time from June 16 to Sept 30
+#
+# Bangladesh to introduce daylight saving time likely from June 16
+# <a href="http://www.asiantribune.com/?q=node/17288">
+# http://www.asiantribune.com/?q=node/17288
+# </a>
+# or
+# <a href="http://www.worldtimezone.com/dst_news/dst_news_bangladesh02.html">
+# http://www.worldtimezone.com/dst_news/dst_news_bangladesh02.html
+# </a>
+#
+# "... Bangladesh government has decided to switch daylight saving time from
+# June
+# 16 till September 30 in a bid to ensure maximum use of daylight to cope with
+# crippling power crisis. "
+#
+# The switch will remain in effect from June 16 to Sept 30 (2009) but if
+# implemented the next year, it will come in force from April 1, 2010
+
+# From Steffen Thorsen (2009-06-02):
+# They have finally decided now, but changed the start date to midnight between
+# the 19th and 20th, and they have not set the end date yet.
+#
+# Some sources:
+# <a href="http://in.reuters.com/article/southAsiaNews/idINIndia-40017620090601">
+# http://in.reuters.com/article/southAsiaNews/idINIndia-40017620090601
+# </a>
+# <a href="http://bdnews24.com/details.php?id=85889&cid=2">
+# http://bdnews24.com/details.php?id=85889&cid=2
+# </a>
+#
+# Our wrap-up:
+# <a href="http://www.timeanddate.com/news/time/bangladesh-daylight-saving-2009.html">
+# http://www.timeanddate.com/news/time/bangladesh-daylight-saving-2009.html
+# </a>
+
+# From A. N. M. Kamrus Saadat (2009-06-15):
+# Finally we've got the official mail regarding DST start time where DST start 
+# time is mentioned as Jun 19 2009, 23:00 from BTRC (Bangladesh 
+# Telecommunication Regulatory Commission). 
+#
+# No DST end date has been announced yet.
+
+# From Alexander Krivenyshev (2009-09-25):
+# Bangladesh won't go back to Standard Time from October 1, 2009, 
+# instead it will continue DST measure till the cabinet makes a fresh decision. 
+#
+# Following report by same newspaper-"The Daily Star Friday":
+# "DST change awaits cabinet decision-Clock won't go back by 1-hr from Oct 1"
+# <a href="http://www.thedailystar.net/newDesign/news-details.php?nid=107021">
+# http://www.thedailystar.net/newDesign/news-details.php?nid=107021
+# </a>
+# or
+# <a href="http://www.worldtimezone.com/dst_news/dst_news_bangladesh04.html">
+# http://www.worldtimezone.com/dst_news/dst_news_bangladesh04.html
+# </a>
+
+# From Steffen Thorsen (2009-10-13):
+# IANS (Indo-Asian News Service) now reports:
+# Bangladesh has decided that the clock advanced by an hour to make 
+# maximum use of daylight hours as an energy saving measure would 
+# "continue for an indefinite period."
+#
+# One of many places where it is published:
+# <a href="http://www.thaindian.com/newsportal/business/bangladesh-to-continue-indefinitely-with-advanced-time_100259987.html">
+# http://www.thaindian.com/newsportal/business/bangladesh-to-continue-indefinitely-with-advanced-time_100259987.html
+# </a>
+
+# From Alexander Krivenyshev (2009-12-24):
+# According to Bangladesh newspaper "The Daily Star,"
+# Bangladesh will change its clock back to Standard Time on Dec 31, 2009.
+#
+# Clock goes back 1-hr on Dec 31 night.
+# <a href="http://www.thedailystar.net/newDesign/news-details.php?nid=119228">
+# http://www.thedailystar.net/newDesign/news-details.php?nid=119228
+# </a>
+# and
+# <a href="http://www.worldtimezone.com/dst_news/dst_news_bangladesh05.html">
+# http://www.worldtimezone.com/dst_news/dst_news_bangladesh05.html
+# </a>
+#
+# "...The government yesterday decided to put the clock back by one hour
+# on December 31 midnight and the new time will continue until March 31,
+# 2010 midnight. The decision came at a cabinet meeting at the Prime
+# Minister's Office last night..."
+
+# From Alexander Krivenyshev (2010-03-22):
+# According to Bangladesh newspaper "The Daily Star,"
+# Cabinet cancels Daylight Saving Time 
+# <a href="http://www.thedailystar.net/newDesign/latest_news.php?nid=22817">
+# http://www.thedailystar.net/newDesign/latest_news.php?nid=22817
+# </a>
+# or
+# <a href="http://www.worldtimezone.com/dst_news/dst_news_bangladesh06.html">
+# http://www.worldtimezone.com/dst_news/dst_news_bangladesh06.html
+# </a>
+
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Dhaka	2009	only	-	Jun	19	23:00	1:00	S
+Rule	Dhaka	2009	only	-	Dec	31	23:59	0	-
+
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Asia/Dhaka	6:01:40 -	LMT	1890
+			5:53:20	-	HMT	1941 Oct    # Howrah Mean Time?
+			6:30	-	BURT	1942 May 15 # Burma Time
+			5:30	-	IST	1942 Sep
+			6:30	-	BURT	1951 Sep 30
+			6:00	-	DACT	1971 Mar 26 # Dacca Time
+			6:00	-	BDT	2009
+			6:00	Dhaka	BD%sT
+
+# Bhutan
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Asia/Thimphu	5:58:36 -	LMT	1947 Aug 15 # or Thimbu
+			5:30	-	IST	1987 Oct
+			6:00	-	BTT	# Bhutan Time
+
+# British Indian Ocean Territory
+# Whitman and the 1995 CIA time zone map say 5:00, but the
+# 1997 and later maps say 6:00.  Assume the switch occurred in 1996.
+# We have no information as to when standard time was introduced;
+# assume it occurred in 1907, the same year as Mauritius (which
+# then contained the Chagos Archipelago).
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Indian/Chagos	4:49:40	-	LMT	1907
+			5:00	-	IOT	1996 # BIOT Time
+			6:00	-	IOT
+
+# Brunei
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Asia/Brunei	7:39:40 -	LMT	1926 Mar   # Bandar Seri Begawan
+			7:30	-	BNT	1933
+			8:00	-	BNT
+
+# Burma / Myanmar
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Asia/Rangoon	6:24:40 -	LMT	1880		# or Yangon
+			6:24:36	-	RMT	1920	   # Rangoon Mean Time?
+			6:30	-	BURT	1942 May   # Burma Time
+			9:00	-	JST	1945 May 3
+			6:30	-	MMT		   # Myanmar Time
+
+# Cambodia
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Asia/Phnom_Penh	6:59:40 -	LMT	1906 Jun  9
+			7:06:20	-	SMT	1911 Mar 11 0:01 # Saigon MT?
+			7:00	-	ICT	1912 May
+			8:00	-	ICT	1931 May
+			7:00	-	ICT
+
+# China
+
+# From Guy Harris:
+# People's Republic of China.  Yes, they really have only one time zone.
+
+# From Bob Devine (1988-01-28):
+# No they don't.  See TIME mag, 1986-02-17 p.52.  Even though
+# China is across 4 physical time zones, before Feb 1, 1986 only the
+# Peking (Bejing) time zone was recognized.  Since that date, China
+# has two of 'em -- Peking's and Urumqi (named after the capital of
+# the Xinjiang Uyghur Autonomous Region).  I don't know about DST for it.
+#
+# . . .I just deleted the DST table and this editor makes it too
+# painful to suck in another copy..  So, here is what I have for
+# DST start/end dates for Peking's time zone (info from AP):
+#
+#     1986 May 4 - Sept 14
+#     1987 mid-April - ??
+
+# From U. S. Naval Observatory (1989-01-19):
+# CHINA               8 H  AHEAD OF UTC  ALL OF CHINA, INCL TAIWAN
+# CHINA               9 H  AHEAD OF UTC  APR 17 - SEP 10
+
+# From Paul Eggert (2006-03-22):
+# Shanks & Pottenger write that China (except for Hong Kong and Macau)
+# has had a single time zone since 1980 May 1, observing summer DST
+# from 1986 through 1991; this contradicts Devine's
+# note about Time magazine, though apparently _something_ happened in 1986.
+# Go with Shanks & Pottenger for now.  I made up names for the other
+# pre-1980 time zones.
+
+# From Shanks & Pottenger:
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Shang	1940	only	-	Jun	 3	0:00	1:00	D
+Rule	Shang	1940	1941	-	Oct	 1	0:00	0	S
+Rule	Shang	1941	only	-	Mar	16	0:00	1:00	D
+Rule	PRC	1986	only	-	May	 4	0:00	1:00	D
+Rule	PRC	1986	1991	-	Sep	Sun>=11	0:00	0	S
+Rule	PRC	1987	1991	-	Apr	Sun>=10	0:00	1:00	D
+
+# From Anthony Fok (2001-12-20):
+# BTW, I did some research on-line and found some info regarding these five
+# historic timezones from some Taiwan websites.  And yes, there are official
+# Chinese names for these locales (before 1949).
+#
+# From Jesper Norgaard Welen (2006-07-14):
+# I have investigated the timezones around 1970 on the
+# http://www.astro.com/atlas site [with provinces and county
+# boundaries summarized below]....  A few other exceptions were two
+# counties on the Sichuan side of the Xizang-Sichuan border,
+# counties Dege and Baiyu which lies on the Sichuan side and are
+# therefore supposed to be GMT+7, Xizang region being GMT+6, but Dege
+# county is GMT+8 according to astro.com while Baiyu county is GMT+6
+# (could be true), for the moment I am assuming that those two
+# counties are mistakes in the astro.com data.
+
+# From Paul Eggert (2008-02-11):
+# I just now checked Google News for western news sources that talk
+# about China's single time zone, and couldn't find anything before 1986
+# talking about China being in one time zone.  (That article was: Jim
+# Mann, "A clumsy embrace for another western custom: China on daylight
+# time--sort of", Los Angeles Times, 1986-05-05.  By the way, this
+# article confirms the tz database's data claiming that China began
+# observing daylight saving time in 1986.
+#
+# From Thomas S. Mullaney (2008-02-11):
+# I think you're combining two subjects that need to treated 
+# separately: daylight savings (which, you're correct, wasn't 
+# implemented until the 1980s) and the unified time zone centered near 
+# Beijing (which was implemented in 1949). Briefly, there was also a 
+# "Lhasa Time" in Tibet and "Urumqi Time" in Xinjiang. The first was 
+# ceased, and the second eventually recognized (again, in the 1980s).
+#
+# From Paul Eggert (2008-06-30):
+# There seems to be a good chance China switched to a single time zone in 1949
+# rather than in 1980 as Shanks & Pottenger have it, but we don't have a
+# reliable documentary source saying so yet, so for now we still go with
+# Shanks & Pottenger.
+
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+# Changbai Time ("Long-white Time", Long-white = Heilongjiang area)
+# Heilongjiang (except Mohe county), Jilin
+Zone	Asia/Harbin	8:26:44	-	LMT	1928 # or Haerbin
+			8:30	-	CHAT	1932 Mar # Changbai Time
+			8:00	-	CST	1940
+			9:00	-	CHAT	1966 May
+			8:30	-	CHAT	1980 May
+			8:00	PRC	C%sT
+# Zhongyuan Time ("Central plain Time")
+# most of China
+Zone	Asia/Shanghai	8:05:52	-	LMT	1928
+			8:00	Shang	C%sT	1949
+			8:00	PRC	C%sT
+# Long-shu Time (probably due to Long and Shu being two names of that area)
+# Guangxi, Guizhou, Hainan, Ningxia, Sichuan, Shaanxi, and Yunnan;
+# most of Gansu; west Inner Mongolia; west Qinghai; and the Guangdong
+# counties Deqing, Enping, Kaiping, Luoding, Taishan, Xinxing,
+# Yangchun, Yangjiang, Yu'nan, and Yunfu.
+Zone	Asia/Chongqing	7:06:20	-	LMT	1928 # or Chungking
+			7:00	-	LONT	1980 May # Long-shu Time
+			8:00	PRC	C%sT
+# Xin-zang Time ("Xinjiang-Tibet Time")
+# The Gansu counties Aksay, Anxi, Dunhuang, Subei; west Qinghai;
+# the Guangdong counties  Xuwen, Haikang, Suixi, Lianjiang,
+# Zhanjiang, Wuchuan, Huazhou, Gaozhou, Maoming, Dianbai, and Xinyi;
+# east Tibet, including Lhasa, Chamdo, Shigaise, Jimsar, Shawan and Hutubi;
+# east Xinjiang, including Urumqi, Turpan, Karamay, Korla, Minfeng, Jinghe,
+# Wusu, Qiemo, Xinyan, Wulanwusu, Jinghe, Yumin, Tacheng, Tuoli, Emin,
+# Shihezi, Changji, Yanqi, Heshuo, Tuokexun, Tulufan, Shanshan, Hami,
+# Fukang, Kuitun, Kumukuli, Miquan, Qitai, and Turfan.
+Zone	Asia/Urumqi	5:50:20	-	LMT	1928 # or Urumchi
+			6:00	-	URUT	1980 May # Urumqi Time
+			8:00	PRC	C%sT
+# Kunlun Time
+# West Tibet, including Pulan, Aheqi, Shufu, Shule;
+# West Xinjiang, including Aksu, Atushi, Yining, Hetian, Cele, Luopu, Nileke,
+# Zhaosu, Tekesi, Gongliu, Chabuchaer, Huocheng, Bole, Pishan, Suiding,
+# and Yarkand.
+
+# From Luther Ma (2009-10-17):
+# Almost all (>99.9%) ethnic Chinese (properly ethnic Han) living in
+# Xinjiang use Chinese Standard Time. Some are aware of Xinjiang time,
+# but have no need of it. All planes, trains, and schools function on
+# what is called "Beijing time." When Han make an appointment in Chinese
+# they implicitly use Beijing time.
+#
+# On the other hand, ethnic Uyghurs, who make up about half the
+# population of Xinjiang, typically use "Xinjiang time" which is two
+# hours behind Beijing time, or UTC +0600. The government of the Xinjiang
+# Uyghur Autonomous Region, (XAUR, or just Xinjiang for short) as well as
+# local governments such as the Urumqi city government use both times in
+# publications, referring to what is popularly called Xinjiang time as
+# "Urumqi time." When Uyghurs make an appointment in the Uyghur language
+# they almost invariably use Xinjiang time.
+#
+# (Their ethnic Han compatriots would typically have no clue of its
+# widespread use, however, because so extremely few of them are fluent in
+# Uyghur, comparable to the number of Anglo-Americans fluent in Navajo.)
+#
+# (...As with the rest of China there was a brief interval ending in 1990
+# or 1991 when summer time was in use.  The confusion was severe, with
+# the province not having dual times but four times in use at the same
+# time. Some areas remained on standard Xinjiang time or Beijing time and
+# others moving their clocks ahead.)
+#
+# ...an example of an official website using of Urumqi time.
+#
+# The first few lines of the Google translation of
+# <a href="http://www.fjysgl.gov.cn/show.aspx?id=2379&cid=39">
+# http://www.fjysgl.gov.cn/show.aspx?id=2379&cid=39
+# </a>
+# (retrieved 2009-10-13)
+# > Urumqi fire seven people are missing the alleged losses of at least
+# > 500 million yuan
+# >
+# > (Reporter Dong Liu) the day before 20:20 or so (Urumqi Time 18:20),
+# > Urumqi City Department of International Plaza Luther Qiantang River
+# > burst fire. As of yesterday, 18:30, Urumqi City Fire officers and men
+# > have worked continuously for 22 hours...
+
+# From Luther Ma (2009-11-19):
+# With the risk of being redundant to previous answers these are the most common
+# English "transliterations" (w/o using non-English symbols):
+#
+# 1. Wulumuqi...
+# 2. Kashi...
+# 3. Urumqi...
+# 4. Kashgar...
+# ...
+# 5. It seems that Uyghurs in Urumqi has been using Xinjiang since at least the
+# 1960's. I know of one Han, now over 50, who grew up in the surrounding
+# countryside and used Xinjiang time as a child.
+#
+# 6. Likewise for Kashgar and the rest of south Xinjiang I don't know of any
+# start date for Xinjiang time.
+#
+# Without having access to local historical records, nor the ability to legally
+# publish them, I would go with October 1, 1949, when Xinjiang became the Uyghur
+# Autonomous Region under the PRC. (Before that Uyghurs, of course, would also
+# not be using Beijing time, but some local time.)
+
+Zone	Asia/Kashgar	5:03:56	-	LMT	1928 # or Kashi or Kaxgar
+			5:30	-	KAST	1940	 # Kashgar Time
+			5:00	-	KAST	1980 May
+			8:00	PRC	C%sT
+
+
+# From Lee Yiu Chung (2009-10-24):
+# I found there are some mistakes for the...DST rule for Hong
+# Kong. [According] to the DST record from Hong Kong Observatory (actually,
+# it is not [an] observatory, but the official meteorological agency of HK,
+# and also serves as the official timing agency), there are some missing
+# and incorrect rules. Although the exact switch over time is missing, I
+# think 3:30 is correct. The official DST record for Hong Kong can be
+# obtained from
+# <a href="http://www.hko.gov.hk/gts/time/Summertime.htm">
+# http://www.hko.gov.hk/gts/time/Summertime.htm
+# </a>.
+
+# From Arthur David Olson (2009-10-28):
+# Here are the dates given at
+# <a href="http://www.hko.gov.hk/gts/time/Summertime.htm">
+# http://www.hko.gov.hk/gts/time/Summertime.htm
+# </a>
+# as of 2009-10-28:
+# Year        Period
+# 1941        1 Apr to 30 Sep
+# 1942        Whole year 
+# 1943        Whole year
+# 1944        Whole year
+# 1945        Whole year
+# 1946        20 Apr to 1 Dec
+# 1947        13 Apr to 30 Dec
+# 1948        2 May to 31 Oct
+# 1949        3 Apr to 30 Oct
+# 1950        2 Apr to 29 Oct
+# 1951        1 Apr to 28 Oct
+# 1952        6 Apr to 25 Oct
+# 1953        5 Apr to 1 Nov
+# 1954        21 Mar to 31 Oct
+# 1955        20 Mar to 6 Nov
+# 1956        18 Mar to 4 Nov
+# 1957        24 Mar to 3 Nov
+# 1958        23 Mar to 2 Nov
+# 1959        22 Mar to 1 Nov
+# 1960        20 Mar to 6 Nov
+# 1961        19 Mar to 5 Nov
+# 1962        18 Mar to 4 Nov
+# 1963        24 Mar to 3 Nov
+# 1964        22 Mar to 1 Nov
+# 1965        18 Apr to 17 Oct
+# 1966        17 Apr to 16 Oct
+# 1967        16 Apr to 22 Oct
+# 1968        21 Apr to 20 Oct
+# 1969        20 Apr to 19 Oct
+# 1970        19 Apr to 18 Oct
+# 1971        18 Apr to 17 Oct
+# 1972        16 Apr to 22 Oct
+# 1973        22 Apr to 21 Oct
+# 1973/74     30 Dec 73 to 20 Oct 74
+# 1975        20 Apr to 19 Oct
+# 1976        18 Apr to 17 Oct
+# 1977        Nil
+# 1978        Nil
+# 1979        13 May to 21 Oct
+# 1980 to Now Nil
+# The page does not give start or end times of day.
+# The page does not give a start date for 1942.
+# The page does not givw an end date for 1945.
+# The Japanese occupation of Hong Kong began on 1941-12-25.
+# The Japanese surrender of Hong Kong was signed 1945-09-15.
+# For lack of anything better, use start of those days as the transition times.
+
+# Hong Kong (Xianggang)
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	HK	1941	only	-	Apr	1	3:30	1:00	S
+Rule	HK	1941	only	-	Sep	30	3:30	0	-
+Rule	HK	1946	only	-	Apr	20	3:30	1:00	S
+Rule	HK	1946	only	-	Dec	1	3:30	0	-
+Rule	HK	1947	only	-	Apr	13	3:30	1:00	S
+Rule	HK	1947	only	-	Dec	30	3:30	0	-
+Rule	HK	1948	only	-	May	2	3:30	1:00	S
+Rule	HK	1948	1951	-	Oct	lastSun	3:30	0	-
+Rule	HK	1952	only	-	Oct	25	3:30	0	-
+Rule	HK	1949	1953	-	Apr	Sun>=1	3:30	1:00	S
+Rule	HK	1953	only	-	Nov	1	3:30	0	-
+Rule	HK	1954	1964	-	Mar	Sun>=18	3:30	1:00	S
+Rule	HK	1954	only	-	Oct	31	3:30	0	-
+Rule	HK	1955	1964	-	Nov	Sun>=1	3:30	0	-
+Rule	HK	1965	1977	-	Apr	Sun>=16	3:30	1:00	S
+Rule	HK	1965	1977	-	Oct	Sun>=16	3:30	0	-
+Rule	HK	1973	only	-	Dec	30	3:30	1:00	S
+Rule	HK	1979	only	-	May	Sun>=8	3:30	1:00	S
+Rule	HK	1979	only	-	Oct	Sun>=16	3:30	0	-
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Asia/Hong_Kong	7:36:36 -	LMT	1904 Oct 30
+			8:00	HK	HK%sT	1941 Dec 25
+			9:00	-	JST	1945 Sep 15
+			8:00	HK	HK%sT
+
+###############################################################################
+
+# Taiwan
+
+# Shanks & Pottenger write that Taiwan observed DST during 1945, when it
+# was still controlled by Japan.  This is hard to believe, but we don't
+# have any other information.
+
+# From smallufo (2010-04-03):
+# According to Taiwan's CWB,
+# <a href="http://www.cwb.gov.tw/V6/astronomy/cdata/summert.htm">
+# http://www.cwb.gov.tw/V6/astronomy/cdata/summert.htm
+# </a>
+# Taipei has DST in 1979 between July 1st and Sep 30.
+
+# From Arthur David Olson (2010-04-07):
+# Here's Google's translation of the table at the bottom of the "summert.htm" page:
+# Decade 	                                                    Name                      Start and end date
+# Republic of China 34 years to 40 years (AD 1945-1951 years) Summer Time               May 1 to September 30 
+# 41 years of the Republic of China (AD 1952)                 Daylight Saving Time      March 1 to October 31 
+# Republic of China 42 years to 43 years (AD 1953-1954 years) Daylight Saving Time      April 1 to October 31 
+# In the 44 years to 45 years (AD 1955-1956 years)            Daylight Saving Time      April 1 to September 30 
+# Republic of China 46 years to 48 years (AD 1957-1959)       Summer Time               April 1 to September 30 
+# Republic of China 49 years to 50 years (AD 1960-1961)       Summer Time               June 1 to September 30 
+# Republic of China 51 years to 62 years (AD 1962-1973 years) Stop Summer Time 
+# Republic of China 63 years to 64 years (1974-1975 AD)       Daylight Saving Time      April 1 to September 30 
+# Republic of China 65 years to 67 years (1976-1978 AD)       Stop Daylight Saving Time 
+# Republic of China 68 years (AD 1979)                        Daylight Saving Time      July 1 to September 30 
+# Republic of China since 69 years (AD 1980)                  Stop Daylight Saving Time
+
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Taiwan	1945	1951	-	May	1	0:00	1:00	D
+Rule	Taiwan	1945	1951	-	Oct	1	0:00	0	S
+Rule	Taiwan	1952	only	-	Mar	1	0:00	1:00	D
+Rule	Taiwan	1952	1954	-	Nov	1	0:00	0	S
+Rule	Taiwan	1953	1959	-	Apr	1	0:00	1:00	D
+Rule	Taiwan	1955	1961	-	Oct	1	0:00	0	S
+Rule	Taiwan	1960	1961	-	Jun	1	0:00	1:00	D
+Rule	Taiwan	1974	1975	-	Apr	1	0:00	1:00	D
+Rule	Taiwan	1974	1975	-	Oct	1	0:00	0	S
+Rule	Taiwan	1979	only	-	Jun	30	0:00	1:00	D
+Rule	Taiwan	1979	only	-	Sep	30	0:00	0	S
+
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Asia/Taipei	8:06:00 -	LMT	1896 # or Taibei or T'ai-pei
+			8:00	Taiwan	C%sT
+
+# Macau (Macao, Aomen)
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Macau	1961	1962	-	Mar	Sun>=16	3:30	1:00	S
+Rule	Macau	1961	1964	-	Nov	Sun>=1	3:30	0	-
+Rule	Macau	1963	only	-	Mar	Sun>=16	0:00	1:00	S
+Rule	Macau	1964	only	-	Mar	Sun>=16	3:30	1:00	S
+Rule	Macau	1965	only	-	Mar	Sun>=16	0:00	1:00	S
+Rule	Macau	1965	only	-	Oct	31	0:00	0	-
+Rule	Macau	1966	1971	-	Apr	Sun>=16	3:30	1:00	S
+Rule	Macau	1966	1971	-	Oct	Sun>=16	3:30	0	-
+Rule	Macau	1972	1974	-	Apr	Sun>=15	0:00	1:00	S
+Rule	Macau	1972	1973	-	Oct	Sun>=15	0:00	0	-
+Rule	Macau	1974	1977	-	Oct	Sun>=15	3:30	0	-
+Rule	Macau	1975	1977	-	Apr	Sun>=15	3:30	1:00	S
+Rule	Macau	1978	1980	-	Apr	Sun>=15	0:00	1:00	S
+Rule	Macau	1978	1980	-	Oct	Sun>=15	0:00	0	-
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Asia/Macau	7:34:20 -	LMT	1912
+			8:00	Macau	MO%sT	1999 Dec 20 # return to China
+			8:00	PRC	C%sT
+
+
+###############################################################################
+
+# Cyprus
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Cyprus	1975	only	-	Apr	13	0:00	1:00	S
+Rule	Cyprus	1975	only	-	Oct	12	0:00	0	-
+Rule	Cyprus	1976	only	-	May	15	0:00	1:00	S
+Rule	Cyprus	1976	only	-	Oct	11	0:00	0	-
+Rule	Cyprus	1977	1980	-	Apr	Sun>=1	0:00	1:00	S
+Rule	Cyprus	1977	only	-	Sep	25	0:00	0	-
+Rule	Cyprus	1978	only	-	Oct	2	0:00	0	-
+Rule	Cyprus	1979	1997	-	Sep	lastSun	0:00	0	-
+Rule	Cyprus	1981	1998	-	Mar	lastSun	0:00	1:00	S
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Asia/Nicosia	2:13:28 -	LMT	1921 Nov 14
+			2:00	Cyprus	EE%sT	1998 Sep
+			2:00	EUAsia	EE%sT
+# IATA SSIM (1998-09) has Cyprus using EU rules for the first time.
+
+# Classically, Cyprus belongs to Asia; e.g. see Herodotus, Histories, I.72.
+# However, for various reasons many users expect to find it under Europe.
+Link	Asia/Nicosia	Europe/Nicosia
+
+# Georgia
+# From Paul Eggert (1994-11-19):
+# Today's _Economist_ (p 60) reports that Georgia moved its clocks forward
+# an hour recently, due to a law proposed by Zurab Murvanidze,
+# an MP who went on a hunger strike for 11 days to force discussion about it!
+# We have no details, but we'll guess they didn't move the clocks back in fall.
+#
+# From Mathew Englander, quoting AP (1996-10-23 13:05-04):
+# Instead of putting back clocks at the end of October, Georgia
+# will stay on daylight savings time this winter to save energy,
+# President Eduard Shevardnadze decreed Wednesday.
+#
+# From the BBC via Joseph S. Myers (2004-06-27):
+#
+# Georgia moved closer to Western Europe on Sunday...  The former Soviet
+# republic has changed its time zone back to that of Moscow.  As a result it
+# is now just four hours ahead of Greenwich Mean Time, rather than five hours
+# ahead.  The switch was decreed by the pro-Western president of Georgia,
+# Mikhail Saakashvili, who said the change was partly prompted by the process
+# of integration into Europe.
+
+# From Teimuraz Abashidze (2005-11-07):
+# Government of Georgia ... decided to NOT CHANGE daylight savings time on
+# [Oct.] 30, as it was done before during last more than 10 years.
+# Currently, we are in fact GMT +4:00, as before 30 October it was GMT
+# +3:00.... The problem is, there is NO FORMAL LAW or governmental document
+# about it.  As far as I can find, I was told, that there is no document,
+# because we just DIDN'T ISSUE document about switching to winter time....
+# I don't know what can be done, especially knowing that some years ago our
+# DST rules where changed THREE TIMES during one month.
+
+
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Asia/Tbilisi	2:59:16 -	LMT	1880
+			2:59:16	-	TBMT	1924 May  2 # Tbilisi Mean Time
+			3:00	-	TBIT	1957 Mar    # Tbilisi Time
+			4:00 RussiaAsia TBI%sT	1991 Mar 31 2:00s
+			3:00	1:00	TBIST	1991 Apr  9 # independence
+			3:00 RussiaAsia GE%sT	1992 # Georgia Time
+			3:00 E-EurAsia	GE%sT	1994 Sep lastSun
+			4:00 E-EurAsia	GE%sT	1996 Oct lastSun
+			4:00	1:00	GEST	1997 Mar lastSun
+			4:00 E-EurAsia	GE%sT	2004 Jun 27
+			3:00 RussiaAsia	GE%sT	2005 Mar lastSun 2:00
+			4:00	-	GET
+
+# East Timor
+
+# See Indonesia for the 1945 transition.
+
+# From Joao Carrascalao, brother of the former governor of East Timor, in
+# <a href="http://etan.org/et99c/december/26-31/30ETMAY.htm">
+# East Timor may be late for its millennium
+# </a> (1999-12-26/31):
+# Portugal tried to change the time forward in 1974 because the sun
+# rises too early but the suggestion raised a lot of problems with the
+# Timorese and I still don't think it would work today because it
+# conflicts with their way of life.
+
+# From Paul Eggert (2000-12-04):
+# We don't have any record of the above attempt.
+# Most likely our records are incomplete, but we have no better data.
+
+# <a href="http://www.hri.org/news/world/undh/last/00-08-16.undh.html">
+# From Manoel de Almeida e Silva, Deputy Spokesman for the UN Secretary-General
+# (2000-08-16)</a>:
+# The Cabinet of the East Timor Transition Administration decided
+# today to advance East Timor's time by one hour.  The time change,
+# which will be permanent, with no seasonal adjustment, will happen at
+# midnight on Saturday, September 16.
+
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Asia/Dili	8:22:20 -	LMT	1912
+			8:00	-	TLT	1942 Feb 21 23:00 # E Timor Time
+			9:00	-	JST	1945 Sep 23
+			9:00	-	TLT	1976 May  3
+			8:00	-	CIT	2000 Sep 17 00:00
+			9:00	-	TLT
+
+# India
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Asia/Kolkata	5:53:28 -	LMT	1880	# Kolkata
+			5:53:20	-	HMT	1941 Oct    # Howrah Mean Time?
+			6:30	-	BURT	1942 May 15 # Burma Time
+			5:30	-	IST	1942 Sep
+			5:30	1:00	IST	1945 Oct 15
+			5:30	-	IST
+# The following are like Asia/Kolkata:
+#	Andaman Is
+#	Lakshadweep (Laccadive, Minicoy and Amindivi Is)
+#	Nicobar Is
+
+# Indonesia
+#
+# From Gwillim Law (2001-05-28), overriding Shanks & Pottenger:
+# <http://www.sumatera-inc.com/go_to_invest/about_indonesia.asp#standtime>
+# says that Indonesia's time zones changed on 1988-01-01.  Looking at some
+# time zone maps, I think that must refer to Western Borneo (Kalimantan Barat
+# and Kalimantan Tengah) switching from UTC+8 to UTC+7.
+#
+# From Paul Eggert (2007-03-10):
+# Here is another correction to Shanks & Pottenger.
+# JohnTWB writes that Japanese forces did not surrender control in
+# Indonesia until 1945-09-01 00:00 at the earliest (in Jakarta) and
+# other formal surrender ceremonies were September 9, 11, and 13, plus
+# September 12 for the regional surrender to Mountbatten in Singapore.
+# These would be the earliest possible times for a change.
+# Regimes horaires pour le monde entier, by Henri Le Corre, (Editions
+# Traditionnelles, 1987, Paris) says that Java and Madura switched
+# from JST to UTC+07:30 on 1945-09-23, and gives 1944-09-01 for Jayapura
+# (Hollandia).  For now, assume all Indonesian locations other than Jayapura
+# switched on 1945-09-23.
+#
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone Asia/Jakarta	7:07:12 -	LMT	1867 Aug 10
+# Shanks & Pottenger say the next transition was at 1924 Jan 1 0:13,
+# but this must be a typo.
+			7:07:12	-	JMT	1923 Dec 31 23:47:12 # Jakarta
+			7:20	-	JAVT	1932 Nov	 # Java Time
+			7:30	-	WIT	1942 Mar 23
+			9:00	-	JST	1945 Sep 23
+			7:30	-	WIT	1948 May
+			8:00	-	WIT	1950 May
+			7:30	-	WIT	1964
+			7:00	-	WIT
+Zone Asia/Pontianak	7:17:20	-	LMT	1908 May
+			7:17:20	-	PMT	1932 Nov    # Pontianak MT
+			7:30	-	WIT	1942 Jan 29
+			9:00	-	JST	1945 Sep 23
+			7:30	-	WIT	1948 May
+			8:00	-	WIT	1950 May
+			7:30	-	WIT	1964
+			8:00	-	CIT	1988 Jan  1
+			7:00	-	WIT
+Zone Asia/Makassar	7:57:36 -	LMT	1920
+			7:57:36	-	MMT	1932 Nov    # Macassar MT
+			8:00	-	CIT	1942 Feb  9
+			9:00	-	JST	1945 Sep 23
+			8:00	-	CIT
+Zone Asia/Jayapura	9:22:48 -	LMT	1932 Nov
+			9:00	-	EIT	1944 Sep  1
+			9:30	-	CST	1964
+			9:00	-	EIT
+
+# Iran
+
+# From Roozbeh Pournader (2003-03-15):
+# This is an English translation of what I just found (originally in Persian).
+# The Gregorian dates in brackets are mine:
+#
+#	Official Newspaper No. 13548-1370/6/25 [1991-09-16]
+#	No. 16760/T233 H				1370/6/10 [1991-09-01]
+#
+#	The Rule About Change of the Official Time of the Country
+#
+#	The Board of Ministers, in the meeting dated 1370/5/23 [1991-08-14],
+#	based on the suggestion number 2221/D dated 1370/4/22 [1991-07-13]
+#	of the Country's Organization for Official and Employment Affairs,
+#	and referring to the law for equating the working hours of workers
+#	and officers in the whole country dated 1359/4/23 [1980-07-14], and
+#	for synchronizing the official times of the country, agreed that:
+#
+#	The official time of the country will should move forward one hour
+#	at the 24[:00] hours of the first day of Farvardin and should return
+#	to its previous state at the 24[:00] hours of the 30th day of
+#	Shahrivar.
+#
+#	First Deputy to the President - Hassan Habibi
+#
+# From personal experience, that agrees with what has been followed
+# for at least the last 5 years.  Before that, for a few years, the
+# date used was the first Thursday night of Farvardin and the last
+# Thursday night of Shahrivar, but I can't give exact dates....
+# I have also changed the abbreviations to what is considered correct
+# here in Iran, IRST for regular time and IRDT for daylight saving time.
+#
+# From Roozbeh Pournader (2005-04-05):
+# The text of the Iranian law, in effect since 1925, clearly mentions
+# that the true solar year is the measure, and there is no arithmetic
+# leap year calculation involved.  There has never been any serious
+# plan to change that law....
+#
+# From Paul Eggert (2006-03-22):
+# Go with Shanks & Pottenger before Sept. 1991, and with Pournader thereafter.
+# I used Ed Reingold's cal-persia in GNU Emacs 21.2 to check Persian dates,
+# stopping after 2037 when 32-bit time_t's overflow.
+# That cal-persia used Birashk's approximation, which disagrees with the solar
+# calendar predictions for the year 2025, so I corrected those dates by hand.
+#
+# From Oscar van Vlijmen (2005-03-30), writing about future
+# discrepancies between cal-persia and the Iranian calendar:
+# For 2091 solar-longitude-after yields 2091-03-20 08:40:07.7 UT for
+# the vernal equinox and that gets so close to 12:00 some local
+# Iranian time that the definition of the correct location needs to be
+# known exactly, amongst other factors.  2157 is even closer:
+# 2157-03-20 08:37:15.5 UT.  But the Gregorian year 2025 should give
+# no interpretation problem whatsoever.  By the way, another instant
+# in the near future where there will be a discrepancy between
+# arithmetical and astronomical Iranian calendars will be in 2058:
+# vernal equinox on 2058-03-20 09:03:05.9 UT.  The Java version of
+# Reingold's/Dershowitz' calculator gives correctly the Gregorian date
+# 2058-03-21 for 1 Farvardin 1437 (astronomical).
+#
+# From Steffen Thorsen (2006-03-22):
+# Several of my users have reported that Iran will not observe DST anymore:
+# http://www.irna.ir/en/news/view/line-17/0603193812164948.htm
+#
+# From Reuters (2007-09-16), with a heads-up from Jesper Norgaard Welen:
+# ... the Guardian Council ... approved a law on Sunday to re-introduce
+# daylight saving time ...
+# http://uk.reuters.com/article/oilRpt/idUKBLA65048420070916
+#
+# From Roozbeh Pournader (2007-11-05):
+# This is quoted from Official Gazette of the Islamic Republic of
+# Iran, Volume 63, Number 18242, dated Tuesday 1386/6/24
+# [2007-10-16]. I am doing the best translation I can:...
+# The official time of the country will be moved forward for one hour
+# on the 24 hours of the first day of the month of Farvardin and will
+# be changed back to its previous state on the 24 hours of the
+# thirtieth day of Shahrivar.
+#
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Iran	1978	1980	-	Mar	21	0:00	1:00	D
+Rule	Iran	1978	only	-	Oct	21	0:00	0	S
+Rule	Iran	1979	only	-	Sep	19	0:00	0	S
+Rule	Iran	1980	only	-	Sep	23	0:00	0	S
+Rule	Iran	1991	only	-	May	 3	0:00	1:00	D
+Rule	Iran	1992	1995	-	Mar	22	0:00	1:00	D
+Rule	Iran	1991	1995	-	Sep	22	0:00	0	S
+Rule	Iran	1996	only	-	Mar	21	0:00	1:00	D
+Rule	Iran	1996	only	-	Sep	21	0:00	0	S
+Rule	Iran	1997	1999	-	Mar	22	0:00	1:00	D
+Rule	Iran	1997	1999	-	Sep	22	0:00	0	S
+Rule	Iran	2000	only	-	Mar	21	0:00	1:00	D
+Rule	Iran	2000	only	-	Sep	21	0:00	0	S
+Rule	Iran	2001	2003	-	Mar	22	0:00	1:00	D
+Rule	Iran	2001	2003	-	Sep	22	0:00	0	S
+Rule	Iran	2004	only	-	Mar	21	0:00	1:00	D
+Rule	Iran	2004	only	-	Sep	21	0:00	0	S
+Rule	Iran	2005	only	-	Mar	22	0:00	1:00	D
+Rule	Iran	2005	only	-	Sep	22	0:00	0	S
+Rule	Iran	2008	only	-	Mar	21	0:00	1:00	D
+Rule	Iran	2008	only	-	Sep	21	0:00	0	S
+Rule	Iran	2009	2011	-	Mar	22	0:00	1:00	D
+Rule	Iran	2009	2011	-	Sep	22	0:00	0	S
+Rule	Iran	2012	only	-	Mar	21	0:00	1:00	D
+Rule	Iran	2012	only	-	Sep	21	0:00	0	S
+Rule	Iran	2013	2015	-	Mar	22	0:00	1:00	D
+Rule	Iran	2013	2015	-	Sep	22	0:00	0	S
+Rule	Iran	2016	only	-	Mar	21	0:00	1:00	D
+Rule	Iran	2016	only	-	Sep	21	0:00	0	S
+Rule	Iran	2017	2019	-	Mar	22	0:00	1:00	D
+Rule	Iran	2017	2019	-	Sep	22	0:00	0	S
+Rule	Iran	2020	only	-	Mar	21	0:00	1:00	D
+Rule	Iran	2020	only	-	Sep	21	0:00	0	S
+Rule	Iran	2021	2023	-	Mar	22	0:00	1:00	D
+Rule	Iran	2021	2023	-	Sep	22	0:00	0	S
+Rule	Iran	2024	only	-	Mar	21	0:00	1:00	D
+Rule	Iran	2024	only	-	Sep	21	0:00	0	S
+Rule	Iran	2025	2027	-	Mar	22	0:00	1:00	D
+Rule	Iran	2025	2027	-	Sep	22	0:00	0	S
+Rule	Iran	2028	2029	-	Mar	21	0:00	1:00	D
+Rule	Iran	2028	2029	-	Sep	21	0:00	0	S
+Rule	Iran	2030	2031	-	Mar	22	0:00	1:00	D
+Rule	Iran	2030	2031	-	Sep	22	0:00	0	S
+Rule	Iran	2032	2033	-	Mar	21	0:00	1:00	D
+Rule	Iran	2032	2033	-	Sep	21	0:00	0	S
+Rule	Iran	2034	2035	-	Mar	22	0:00	1:00	D
+Rule	Iran	2034	2035	-	Sep	22	0:00	0	S
+Rule	Iran	2036	2037	-	Mar	21	0:00	1:00	D
+Rule	Iran	2036	2037	-	Sep	21	0:00	0	S
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Asia/Tehran	3:25:44	-	LMT	1916
+			3:25:44	-	TMT	1946	# Tehran Mean Time
+			3:30	-	IRST	1977 Nov
+			4:00	Iran	IR%sT	1979
+			3:30	Iran	IR%sT
+
+
+# Iraq
+#
+# From Jonathan Lennox (2000-06-12):
+# An article in this week's Economist ("Inside the Saddam-free zone", p. 50 in
+# the U.S. edition) on the Iraqi Kurds contains a paragraph:
+# "The three northern provinces ... switched their clocks this spring and
+# are an hour ahead of Baghdad."
+#
+# But Rives McDow (2000-06-18) quotes a contact in Iraqi-Kurdistan as follows:
+# In the past, some Kurdish nationalists, as a protest to the Iraqi
+# Government, did not adhere to daylight saving time.  They referred
+# to daylight saving as Saddam time.  But, as of today, the time zone
+# in Iraqi-Kurdistan is on standard time with Baghdad, Iraq.
+#
+# So we'll ignore the Economist's claim.
+
+# From Steffen Thorsen (2008-03-10):
+# The cabinet in Iraq abolished DST last week, according to the following
+# news sources (in Arabic):
+# <a href="http://www.aljeeran.net/wesima_articles/news-20080305-98602.html">
+# http://www.aljeeran.net/wesima_articles/news-20080305-98602.html
+# </a>
+# <a href="http://www.aswataliraq.info/look/article.tpl?id=2047&IdLanguage=17&IdPublication=4&NrArticle=71743&NrIssue=1&NrSection=10">
+# http://www.aswataliraq.info/look/article.tpl?id=2047&IdLanguage=17&IdPublication=4&NrArticle=71743&NrIssue=1&NrSection=10
+# </a>
+#
+# We have published a short article in English about the change:
+# <a href="http://www.timeanddate.com/news/time/iraq-dumps-daylight-saving.html">
+# http://www.timeanddate.com/news/time/iraq-dumps-daylight-saving.html
+# </a>
+
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Iraq	1982	only	-	May	1	0:00	1:00	D
+Rule	Iraq	1982	1984	-	Oct	1	0:00	0	S
+Rule	Iraq	1983	only	-	Mar	31	0:00	1:00	D
+Rule	Iraq	1984	1985	-	Apr	1	0:00	1:00	D
+Rule	Iraq	1985	1990	-	Sep	lastSun	1:00s	0	S
+Rule	Iraq	1986	1990	-	Mar	lastSun	1:00s	1:00	D
+# IATA SSIM (1991/1996) says Apr 1 12:01am UTC; guess the `:01' is a typo.
+# Shanks & Pottenger say Iraq did not observe DST 1992/1997; ignore this.
+#
+Rule	Iraq	1991	2007	-	Apr	 1	3:00s	1:00	D
+Rule	Iraq	1991	2007	-	Oct	 1	3:00s	0	S
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Asia/Baghdad	2:57:40	-	LMT	1890
+			2:57:36	-	BMT	1918	    # Baghdad Mean Time?
+			3:00	-	AST	1982 May
+			3:00	Iraq	A%sT
+
+
+###############################################################################
+
+# Israel
+
+# From Ephraim Silverberg (2001-01-11):
+#
+# I coined "IST/IDT" circa 1988.  Until then there were three
+# different abbreviations in use:
+#
+# JST  Jerusalem Standard Time [Danny Braniss, Hebrew University]
+# IZT  Israel Zonal (sic) Time [Prof. Haim Papo, Technion]
+# EEST Eastern Europe Standard Time [used by almost everyone else]
+#
+# Since timezones should be called by country and not capital cities,
+# I ruled out JST.  As Israel is in Asia Minor and not Eastern Europe,
+# EEST was equally unacceptable.  Since "zonal" was not compatible with
+# any other timezone abbreviation, I felt that 'IST' was the way to go
+# and, indeed, it has received almost universal acceptance in timezone
+# settings in Israeli computers.
+#
+# In any case, I am happy to share timezone abbreviations with India,
+# high on my favorite-country list (and not only because my wife's
+# family is from India).
+
+# From Shanks & Pottenger:
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Zion	1940	only	-	Jun	 1	0:00	1:00	D
+Rule	Zion	1942	1944	-	Nov	 1	0:00	0	S
+Rule	Zion	1943	only	-	Apr	 1	2:00	1:00	D
+Rule	Zion	1944	only	-	Apr	 1	0:00	1:00	D
+Rule	Zion	1945	only	-	Apr	16	0:00	1:00	D
+Rule	Zion	1945	only	-	Nov	 1	2:00	0	S
+Rule	Zion	1946	only	-	Apr	16	2:00	1:00	D
+Rule	Zion	1946	only	-	Nov	 1	0:00	0	S
+Rule	Zion	1948	only	-	May	23	0:00	2:00	DD
+Rule	Zion	1948	only	-	Sep	 1	0:00	1:00	D
+Rule	Zion	1948	1949	-	Nov	 1	2:00	0	S
+Rule	Zion	1949	only	-	May	 1	0:00	1:00	D
+Rule	Zion	1950	only	-	Apr	16	0:00	1:00	D
+Rule	Zion	1950	only	-	Sep	15	3:00	0	S
+Rule	Zion	1951	only	-	Apr	 1	0:00	1:00	D
+Rule	Zion	1951	only	-	Nov	11	3:00	0	S
+Rule	Zion	1952	only	-	Apr	20	2:00	1:00	D
+Rule	Zion	1952	only	-	Oct	19	3:00	0	S
+Rule	Zion	1953	only	-	Apr	12	2:00	1:00	D
+Rule	Zion	1953	only	-	Sep	13	3:00	0	S
+Rule	Zion	1954	only	-	Jun	13	0:00	1:00	D
+Rule	Zion	1954	only	-	Sep	12	0:00	0	S
+Rule	Zion	1955	only	-	Jun	11	2:00	1:00	D
+Rule	Zion	1955	only	-	Sep	11	0:00	0	S
+Rule	Zion	1956	only	-	Jun	 3	0:00	1:00	D
+Rule	Zion	1956	only	-	Sep	30	3:00	0	S
+Rule	Zion	1957	only	-	Apr	29	2:00	1:00	D
+Rule	Zion	1957	only	-	Sep	22	0:00	0	S
+Rule	Zion	1974	only	-	Jul	 7	0:00	1:00	D
+Rule	Zion	1974	only	-	Oct	13	0:00	0	S
+Rule	Zion	1975	only	-	Apr	20	0:00	1:00	D
+Rule	Zion	1975	only	-	Aug	31	0:00	0	S
+Rule	Zion	1985	only	-	Apr	14	0:00	1:00	D
+Rule	Zion	1985	only	-	Sep	15	0:00	0	S
+Rule	Zion	1986	only	-	May	18	0:00	1:00	D
+Rule	Zion	1986	only	-	Sep	 7	0:00	0	S
+Rule	Zion	1987	only	-	Apr	15	0:00	1:00	D
+Rule	Zion	1987	only	-	Sep	13	0:00	0	S
+Rule	Zion	1988	only	-	Apr	 9	0:00	1:00	D
+Rule	Zion	1988	only	-	Sep	 3	0:00	0	S
+
+# From Ephraim Silverberg
+# (1997-03-04, 1998-03-16, 1998-12-28, 2000-01-17, 2000-07-25, 2004-12-22,
+# and 2005-02-17):
+
+# According to the Office of the Secretary General of the Ministry of
+# Interior, there is NO set rule for Daylight-Savings/Standard time changes.
+# One thing is entrenched in law, however: that there must be at least 150
+# days of daylight savings time annually.  From 1993-1998, the change to
+# daylight savings time was on a Friday morning from midnight IST to
+# 1 a.m IDT; up until 1998, the change back to standard time was on a
+# Saturday night from midnight daylight savings time to 11 p.m. standard
+# time.  1996 is an exception to this rule where the change back to standard
+# time took place on Sunday night instead of Saturday night to avoid
+# conflicts with the Jewish New Year.  In 1999, the change to
+# daylight savings time was still on a Friday morning but from
+# 2 a.m. IST to 3 a.m. IDT; furthermore, the change back to standard time
+# was also on a Friday morning from 2 a.m. IDT to 1 a.m. IST for
+# 1999 only.  In the year 2000, the change to daylight savings time was
+# similar to 1999, but although the change back will be on a Friday, it
+# will take place from 1 a.m. IDT to midnight IST.  Starting in 2001, all
+# changes to/from will take place at 1 a.m. old time, but now there is no
+# rule as to what day of the week it will take place in as the start date
+# (except in 2003) is the night after the Passover Seder (i.e. the eve
+# of the 16th of Nisan in the lunar Hebrew calendar) and the end date
+# (except in 2002) is three nights before Yom Kippur [Day of Atonement]
+# (the eve of the 7th of Tishrei in the lunar Hebrew calendar).
+
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Zion	1989	only	-	Apr	30	0:00	1:00	D
+Rule	Zion	1989	only	-	Sep	 3	0:00	0	S
+Rule	Zion	1990	only	-	Mar	25	0:00	1:00	D
+Rule	Zion	1990	only	-	Aug	26	0:00	0	S
+Rule	Zion	1991	only	-	Mar	24	0:00	1:00	D
+Rule	Zion	1991	only	-	Sep	 1	0:00	0	S
+Rule	Zion	1992	only	-	Mar	29	0:00	1:00	D
+Rule	Zion	1992	only	-	Sep	 6	0:00	0	S
+Rule	Zion	1993	only	-	Apr	 2	0:00	1:00	D
+Rule	Zion	1993	only	-	Sep	 5	0:00	0	S
+
+# The dates for 1994-1995 were obtained from Office of the Spokeswoman for the
+# Ministry of Interior, Jerusalem, Israel.  The spokeswoman can be reached by
+# calling the office directly at 972-2-6701447 or 972-2-6701448.
+
+# Rule	NAME    FROM    TO      TYPE    IN      ON      AT      SAVE    LETTER/S
+Rule	Zion	1994	only	-	Apr	 1	0:00	1:00	D
+Rule	Zion	1994	only	-	Aug	28	0:00	0	S
+Rule	Zion	1995	only	-	Mar	31	0:00	1:00	D
+Rule	Zion	1995	only	-	Sep	 3	0:00	0	S
+
+# The dates for 1996 were determined by the Minister of Interior of the
+# time, Haim Ramon.  The official announcement regarding 1996-1998
+# (with the dates for 1997-1998 no longer being relevant) can be viewed at:
+#
+#   ftp://ftp.cs.huji.ac.il/pub/tz/announcements/1996-1998.ramon.ps.gz
+#
+# The dates for 1997-1998 were altered by his successor, Rabbi Eli Suissa.
+#
+# The official announcements for the years 1997-1999 can be viewed at:
+#
+#   ftp://ftp.cs.huji.ac.il/pub/tz/announcements/YYYY.ps.gz
+#
+#       where YYYY is the relevant year.
+
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Zion	1996	only	-	Mar	15	0:00	1:00	D
+Rule	Zion	1996	only	-	Sep	16	0:00	0	S
+Rule	Zion	1997	only	-	Mar	21	0:00	1:00	D
+Rule	Zion	1997	only	-	Sep	14	0:00	0	S
+Rule	Zion	1998	only	-	Mar	20	0:00	1:00	D
+Rule	Zion	1998	only	-	Sep	 6	0:00	0	S
+Rule	Zion	1999	only	-	Apr	 2	2:00	1:00	D
+Rule	Zion	1999	only	-	Sep	 3	2:00	0	S
+
+# The Knesset Interior Committee has changed the dates for 2000 for
+# the third time in just over a year and have set new dates for the
+# years 2001-2004 as well.
+#
+# The official announcement for the start date of 2000 can be viewed at:
+#
+#	ftp://ftp.cs.huji.ac.il/pub/tz/announcements/2000-start.ps.gz
+#
+# The official announcement for the end date of 2000 and the dates
+# for the years 2001-2004 can be viewed at:
+#
+#	ftp://ftp.cs.huji.ac.il/pub/tz/announcements/2000-2004.ps.gz
+
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Zion	2000	only	-	Apr	14	2:00	1:00	D
+Rule	Zion	2000	only	-	Oct	 6	1:00	0	S
+Rule	Zion	2001	only	-	Apr	 9	1:00	1:00	D
+Rule	Zion	2001	only	-	Sep	24	1:00	0	S
+Rule	Zion	2002	only	-	Mar	29	1:00	1:00	D
+Rule	Zion	2002	only	-	Oct	 7	1:00	0	S
+Rule	Zion	2003	only	-	Mar	28	1:00	1:00	D
+Rule	Zion	2003	only	-	Oct	 3	1:00	0	S
+Rule	Zion	2004	only	-	Apr	 7	1:00	1:00	D
+Rule	Zion	2004	only	-	Sep	22	1:00	0	S
+
+# The proposed law agreed upon by the Knesset Interior Committee on
+# 2005-02-14 is that, for 2005 and beyond, DST starts at 02:00 the
+# last Friday before April 2nd (i.e. the last Friday in March or April
+# 1st itself if it falls on a Friday) and ends at 02:00 on the Saturday
+# night _before_ the fast of Yom Kippur.
+#
+# Those who can read Hebrew can view the announcement at:
+#
+#	ftp://ftp.cs.huji.ac.il/pub/tz/announcements/2005+beyond.ps
+
+# From Paul Eggert (2005-02-22):
+# I used Ephraim Silverberg's dst-israel.el program
+# <ftp://ftp.cs.huji.ac.il/pub/tz/software/dst-israel.el> (2005-02-20)
+# along with Ed Reingold's cal-hebrew in GNU Emacs 21.4,
+# to generate the transitions in this list.
+# (I replaced "lastFri" with "Fri>=26" by hand.)
+# The spring transitions below all correspond to the following Rule:
+#
+# Rule	Zion	2005	max	-	Mar	Fri>=26	2:00	1:00	D
+#
+# but older zic implementations (e.g., Solaris 8) do not support
+# "Fri>=26" to mean April 1 in years like 2005, so for now we list the
+# springtime transitions explicitly.
+
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Zion	2005	only	-	Apr	 1	2:00	1:00	D
+Rule	Zion	2005	only	-	Oct	 9	2:00	0	S
+Rule	Zion	2006	2010	-	Mar	Fri>=26	2:00	1:00	D
+Rule	Zion	2006	only	-	Oct	 1	2:00	0	S
+Rule	Zion	2007	only	-	Sep	16	2:00	0	S
+Rule	Zion	2008	only	-	Oct	 5	2:00	0	S
+Rule	Zion	2009	only	-	Sep	27	2:00	0	S
+Rule	Zion	2010	only	-	Sep	12	2:00	0	S
+Rule	Zion	2011	only	-	Apr	 1	2:00	1:00	D
+Rule	Zion	2011	only	-	Oct	 2	2:00	0	S
+Rule	Zion	2012	2015	-	Mar	Fri>=26	2:00	1:00	D
+Rule	Zion	2012	only	-	Sep	23	2:00	0	S
+Rule	Zion	2013	only	-	Sep	 8	2:00	0	S
+Rule	Zion	2014	only	-	Sep	28	2:00	0	S
+Rule	Zion	2015	only	-	Sep	20	2:00	0	S
+Rule	Zion	2016	only	-	Apr	 1	2:00	1:00	D
+Rule	Zion	2016	only	-	Oct	 9	2:00	0	S
+Rule	Zion	2017	2021	-	Mar	Fri>=26	2:00	1:00	D
+Rule	Zion	2017	only	-	Sep	24	2:00	0	S
+Rule	Zion	2018	only	-	Sep	16	2:00	0	S
+Rule	Zion	2019	only	-	Oct	 6	2:00	0	S
+Rule	Zion	2020	only	-	Sep	27	2:00	0	S
+Rule	Zion	2021	only	-	Sep	12	2:00	0	S
+Rule	Zion	2022	only	-	Apr	 1	2:00	1:00	D
+Rule	Zion	2022	only	-	Oct	 2	2:00	0	S
+Rule	Zion	2023	2032	-	Mar	Fri>=26	2:00	1:00	D
+Rule	Zion	2023	only	-	Sep	24	2:00	0	S
+Rule	Zion	2024	only	-	Oct	 6	2:00	0	S
+Rule	Zion	2025	only	-	Sep	28	2:00	0	S
+Rule	Zion	2026	only	-	Sep	20	2:00	0	S
+Rule	Zion	2027	only	-	Oct	10	2:00	0	S
+Rule	Zion	2028	only	-	Sep	24	2:00	0	S
+Rule	Zion	2029	only	-	Sep	16	2:00	0	S
+Rule	Zion	2030	only	-	Oct	 6	2:00	0	S
+Rule	Zion	2031	only	-	Sep	21	2:00	0	S
+Rule	Zion	2032	only	-	Sep	12	2:00	0	S
+Rule	Zion	2033	only	-	Apr	 1	2:00	1:00	D
+Rule	Zion	2033	only	-	Oct	 2	2:00	0	S
+Rule	Zion	2034	2037	-	Mar	Fri>=26	2:00	1:00	D
+Rule	Zion	2034	only	-	Sep	17	2:00	0	S
+Rule	Zion	2035	only	-	Oct	 7	2:00	0	S
+Rule	Zion	2036	only	-	Sep	28	2:00	0	S
+Rule	Zion	2037	only	-	Sep	13	2:00	0	S
+
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Asia/Jerusalem	2:20:56 -	LMT	1880
+			2:20:40	-	JMT	1918	# Jerusalem Mean Time?
+			2:00	Zion	I%sT
+
+
+
+###############################################################################
+
+# Japan
+
+# `9:00' and `JST' is from Guy Harris.
+
+# From Paul Eggert (1995-03-06):
+# Today's _Asahi Evening News_ (page 4) reports that Japan had
+# daylight saving between 1948 and 1951, but ``the system was discontinued
+# because the public believed it would lead to longer working hours.''
+
+# From Mayumi Negishi in the 2005-08-10 Japan Times
+# <http://www.japantimes.co.jp/cgi-bin/getarticle.pl5?nn20050810f2.htm>:
+# Occupation authorities imposed daylight-saving time on Japan on
+# [1948-05-01]....  But lack of prior debate and the execution of
+# daylight-saving time just three days after the bill was passed generated
+# deep hatred of the concept....  The Diet unceremoniously passed a bill to
+# dump the unpopular system in October 1951, less than a month after the San
+# Francisco Peace Treaty was signed.  (A government poll in 1951 showed 53%
+# of the Japanese wanted to scrap daylight-saving time, as opposed to 30% who
+# wanted to keep it.)
+
+# From Paul Eggert (2006-03-22):
+# Shanks & Pottenger write that DST in Japan during those years was as follows:
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Japan	1948	only	-	May	Sun>=1	2:00	1:00	D
+Rule	Japan	1948	1951	-	Sep	Sat>=8	2:00	0	S
+Rule	Japan	1949	only	-	Apr	Sun>=1	2:00	1:00	D
+Rule	Japan	1950	1951	-	May	Sun>=1	2:00	1:00	D
+# but the only locations using it (for birth certificates, presumably, since
+# their audience is astrologers) were US military bases.  For now, assume
+# that for most purposes daylight-saving time was observed; otherwise, what
+# would have been the point of the 1951 poll?
+
+# From Hideyuki Suzuki (1998-11-09):
+# 'Tokyo' usually stands for the former location of Tokyo Astronomical
+# Observatory: E 139 44' 40".90 (9h 18m 58s.727), N 35 39' 16".0.
+# This data is from 'Rika Nenpyou (Chronological Scientific Tables) 1996'
+# edited by National Astronomical Observatory of Japan....
+# JST (Japan Standard Time) has been used since 1888-01-01 00:00 (JST).
+# The law is enacted on 1886-07-07.
+
+# From Hideyuki Suzuki (1998-11-16):
+# The ordinance No. 51 (1886) established "standard time" in Japan,
+# which stands for the time on E 135 degree.
+# In the ordinance No. 167 (1895), "standard time" was renamed to "central
+# standard time".  And the same ordinance also established "western standard
+# time", which stands for the time on E 120 degree....  But "western standard
+# time" was abolished in the ordinance No. 529 (1937).  In the ordinance No.
+# 167, there is no mention regarding for what place western standard time is
+# standard....
+#
+# I wrote "ordinance" above, but I don't know how to translate.
+# In Japanese it's "chokurei", which means ordinance from emperor.
+
+# Shanks & Pottenger claim JST in use since 1896, and that a few
+# places (e.g. Ishigaki) use +0800; go with Suzuki.  Guess that all
+# ordinances took effect on Jan 1.
+
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Asia/Tokyo	9:18:59	-	LMT	1887 Dec 31 15:00u
+			9:00	-	JST	1896
+			9:00	-	CJT	1938
+			9:00	Japan	J%sT
+# Since 1938, all Japanese possessions have been like Asia/Tokyo.
+
+# Jordan
+#
+# From <a href="http://star.arabia.com/990701/JO9.html">
+# Jordan Week (1999-07-01) </a> via Steffen Thorsen (1999-09-09):
+# Clocks in Jordan were forwarded one hour on Wednesday at midnight,
+# in accordance with the government's decision to implement summer time
+# all year round.
+#
+# From <a href="http://star.arabia.com/990930/JO9.html">
+# Jordan Week (1999-09-30) </a> via Steffen Thorsen (1999-11-09):
+# Winter time starts today Thursday, 30 September. Clocks will be turned back
+# by one hour.  This is the latest government decision and it's final!
+# The decision was taken because of the increase in working hours in
+# government's departments from six to seven hours.
+#
+# From Paul Eggert (2005-11-22):
+# Starting 2003 transitions are from Steffen Thorsen's web site timeanddate.com.
+#
+# From Steffen Thorsen (2005-11-23):
+# For Jordan I have received multiple independent user reports every year
+# about DST end dates, as the end-rule is different every year.
+#
+# From Steffen Thorsen (2006-10-01), after a heads-up from Hilal Malawi:
+# http://www.petranews.gov.jo/nepras/2006/Sep/05/4000.htm
+# "Jordan will switch to winter time on Friday, October 27".
+#
+
+# From Phil Pizzey (2009-04-02):
+# ...I think I may have spotted an error in the timezone data for
+# Jordan.
+# The current (2009d) asia file shows Jordan going to daylight
+# saving
+# time on the last Thursday in March.
+#
+# Rule  Jordan      2000  max	-  Mar   lastThu     0:00s 1:00  S
+#
+# However timeanddate.com, which I usually find reliable, shows Jordan
+# going to daylight saving time on the last Friday in March since 2002.
+# Please see
+# <a href="http://www.timeanddate.com/worldclock/timezone.html?n=11">
+# http://www.timeanddate.com/worldclock/timezone.html?n=11
+# </a>
+
+# From Steffen Thorsen (2009-04-02):
+# This single one might be good enough, (2009-03-24, Arabic):
+# <a href="http://petra.gov.jo/Artical.aspx?Lng=2&Section=8&Artical=95279">
+# http://petra.gov.jo/Artical.aspx?Lng=2&Section=8&Artical=95279
+# </a>
+#
+# Google's translation:
+#
+# > The Council of Ministers decided in 2002 to adopt the principle of timely
+# > submission of the summer at 60 minutes as of midnight on the last Thursday
+# > of the month of March of each year.
+#
+# So - this means the midnight between Thursday and Friday since 2002.
+
+# From Arthur David Olson (2009-04-06):
+# We still have Jordan switching to DST on Thursdays in 2000 and 2001.
+
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Jordan	1973	only	-	Jun	6	0:00	1:00	S
+Rule	Jordan	1973	1975	-	Oct	1	0:00	0	-
+Rule	Jordan	1974	1977	-	May	1	0:00	1:00	S
+Rule	Jordan	1976	only	-	Nov	1	0:00	0	-
+Rule	Jordan	1977	only	-	Oct	1	0:00	0	-
+Rule	Jordan	1978	only	-	Apr	30	0:00	1:00	S
+Rule	Jordan	1978	only	-	Sep	30	0:00	0	-
+Rule	Jordan	1985	only	-	Apr	1	0:00	1:00	S
+Rule	Jordan	1985	only	-	Oct	1	0:00	0	-
+Rule	Jordan	1986	1988	-	Apr	Fri>=1	0:00	1:00	S
+Rule	Jordan	1986	1990	-	Oct	Fri>=1	0:00	0	-
+Rule	Jordan	1989	only	-	May	8	0:00	1:00	S
+Rule	Jordan	1990	only	-	Apr	27	0:00	1:00	S
+Rule	Jordan	1991	only	-	Apr	17	0:00	1:00	S
+Rule	Jordan	1991	only	-	Sep	27	0:00	0	-
+Rule	Jordan	1992	only	-	Apr	10	0:00	1:00	S
+Rule	Jordan	1992	1993	-	Oct	Fri>=1	0:00	0	-
+Rule	Jordan	1993	1998	-	Apr	Fri>=1	0:00	1:00	S
+Rule	Jordan	1994	only	-	Sep	Fri>=15	0:00	0	-
+Rule	Jordan	1995	1998	-	Sep	Fri>=15	0:00s	0	-
+Rule	Jordan	1999	only	-	Jul	 1	0:00s	1:00	S
+Rule	Jordan	1999	2002	-	Sep	lastFri	0:00s	0	-
+Rule	Jordan	2000	2001	-	Mar	lastThu	0:00s	1:00	S
+Rule	Jordan	2002	max	-	Mar	lastThu	24:00	1:00	S
+Rule	Jordan	2003	only	-	Oct	24	0:00s	0	-
+Rule	Jordan	2004	only	-	Oct	15	0:00s	0	-
+Rule	Jordan	2005	only	-	Sep	lastFri	0:00s	0	-
+Rule	Jordan	2006	max	-	Oct	lastFri	0:00s	0	-
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Asia/Amman	2:23:44 -	LMT	1931
+			2:00	Jordan	EE%sT
+
+
+# Kazakhstan
+
+# From Paul Eggert (1996-11-22):
+# Andrew Evtichov (1996-04-13) writes that Kazakhstan
+# stayed in sync with Moscow after 1990, and that Aqtobe (formerly Aktyubinsk)
+# and Aqtau (formerly Shevchenko) are the largest cities in their zones.
+# Guess that Aqtau and Aqtobe diverged in 1995, since that's the first time
+# IATA SSIM mentions a third time zone in Kazakhstan.
+
+# From Paul Eggert (2006-03-22):
+# German Iofis, ELSI, Almaty (2001-10-09) reports that Kazakhstan uses
+# RussiaAsia rules, instead of switching at 00:00 as the IATA has it.
+# Go with Shanks & Pottenger, who have them always using RussiaAsia rules.
+# Also go with the following claims of Shanks & Pottenger:
+#
+# - Kazakhstan did not observe DST in 1991.
+# - Qyzylorda switched from +5:00 to +6:00 on 1992-01-19 02:00.
+# - Oral switched from +5:00 to +4:00 in spring 1989.
+
+# <a href="http://www.kazsociety.org.uk/news/2005/03/30.htm">
+# From Kazakhstan Embassy's News Bulletin #11 (2005-03-21):
+# </a>
+# The Government of Kazakhstan passed a resolution March 15 abolishing
+# daylight saving time citing lack of economic benefits and health
+# complications coupled with a decrease in productivity.
+#
+# From Branislav Kojic (in Astana) via Gwillim Law (2005-06-28):
+# ... what happened was that the former Kazakhstan Eastern time zone
+# was "blended" with the Central zone.  Therefore, Kazakhstan now has
+# two time zones, and difference between them is one hour.  The zone
+# closer to UTC is the former Western zone (probably still called the
+# same), encompassing four provinces in the west: Aqtobe, Atyrau,
+# Mangghystau, and West Kazakhstan.  The other zone encompasses
+# everything else....  I guess that would make Kazakhstan time zones
+# de jure UTC+5 and UTC+6 respectively.
+
+#
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+#
+# Almaty (formerly Alma-Ata), representing most locations in Kazakhstan
+Zone	Asia/Almaty	5:07:48 -	LMT	1924 May  2 # or Alma-Ata
+			5:00	-	ALMT	1930 Jun 21 # Alma-Ata Time
+			6:00 RussiaAsia ALM%sT	1991
+			6:00	-	ALMT	1992
+			6:00 RussiaAsia	ALM%sT	2005 Mar 15
+			6:00	-	ALMT
+# Qyzylorda (aka Kyzylorda, Kizilorda, Kzyl-Orda, etc.)
+Zone	Asia/Qyzylorda	4:21:52 -	LMT	1924 May  2
+			4:00	-	KIZT	1930 Jun 21 # Kizilorda Time
+			5:00	-	KIZT	1981 Apr  1
+			5:00	1:00	KIZST	1981 Oct  1
+			6:00	-	KIZT	1982 Apr  1
+			5:00 RussiaAsia	KIZ%sT	1991
+			5:00	-	KIZT	1991 Dec 16 # independence
+			5:00	-	QYZT	1992 Jan 19 2:00
+			6:00 RussiaAsia	QYZ%sT	2005 Mar 15
+			6:00	-	QYZT
+# Aqtobe (aka Aktobe, formerly Akt'ubinsk)
+Zone	Asia/Aqtobe	3:48:40	-	LMT	1924 May  2
+			4:00	-	AKTT	1930 Jun 21 # Aktyubinsk Time
+			5:00	-	AKTT	1981 Apr  1
+			5:00	1:00	AKTST	1981 Oct  1
+			6:00	-	AKTT	1982 Apr  1
+			5:00 RussiaAsia	AKT%sT	1991
+			5:00	-	AKTT	1991 Dec 16 # independence
+			5:00 RussiaAsia	AQT%sT	2005 Mar 15 # Aqtobe Time
+			5:00	-	AQTT
+# Mangghystau
+# Aqtau was not founded until 1963, but it represents an inhabited region,
+# so include time stamps before 1963.
+Zone	Asia/Aqtau	3:21:04	-	LMT	1924 May  2
+			4:00	-	FORT	1930 Jun 21 # Fort Shevchenko T
+			5:00	-	FORT	1963
+			5:00	-	SHET	1981 Oct  1 # Shevchenko Time
+			6:00	-	SHET	1982 Apr  1
+			5:00 RussiaAsia	SHE%sT	1991
+			5:00	-	SHET	1991 Dec 16 # independence
+			5:00 RussiaAsia	AQT%sT	1995 Mar lastSun 2:00 # Aqtau Time
+			4:00 RussiaAsia	AQT%sT	2005 Mar 15
+			5:00	-	AQTT
+# West Kazakhstan
+Zone	Asia/Oral	3:25:24	-	LMT	1924 May  2 # or Ural'sk
+			4:00	-	URAT	1930 Jun 21 # Ural'sk time
+			5:00	-	URAT	1981 Apr  1
+			5:00	1:00	URAST	1981 Oct  1
+			6:00	-	URAT	1982 Apr  1
+			5:00 RussiaAsia	URA%sT	1989 Mar 26 2:00
+			4:00 RussiaAsia	URA%sT	1991
+			4:00	-	URAT	1991 Dec 16 # independence
+			4:00 RussiaAsia	ORA%sT	2005 Mar 15 # Oral Time
+			5:00	-	ORAT
+
+# Kyrgyzstan (Kirgizstan)
+# Transitions through 1991 are from Shanks & Pottenger.
+
+# From Paul Eggert (2005-08-15):
+# According to an article dated today in the Kyrgyzstan Development Gateway
+# <http://eng.gateway.kg/cgi-bin/page.pl?id=1&story_name=doc9979.shtml>
+# Kyrgyzstan is canceling the daylight saving time system.  I take the article
+# to mean that they will leave their clocks at 6 hours ahead of UTC.
+# From Malik Abdugaliev (2005-09-21):
+# Our government cancels daylight saving time 6th of August 2005.
+# From 2005-08-12 our GMT-offset is +6, w/o any daylight saving.
+
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Kyrgyz	1992	1996	-	Apr	Sun>=7	0:00s	1:00	S
+Rule	Kyrgyz	1992	1996	-	Sep	lastSun	0:00	0	-
+Rule	Kyrgyz	1997	2005	-	Mar	lastSun	2:30	1:00	S
+Rule	Kyrgyz	1997	2004	-	Oct	lastSun	2:30	0	-
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Asia/Bishkek	4:58:24 -	LMT	1924 May  2
+			5:00	-	FRUT	1930 Jun 21 # Frunze Time
+			6:00 RussiaAsia FRU%sT	1991 Mar 31 2:00s
+			5:00	1:00	FRUST	1991 Aug 31 2:00 # independence
+			5:00	Kyrgyz	KG%sT	2005 Aug 12    # Kyrgyzstan Time
+			6:00	-	KGT
+
+###############################################################################
+
+# Korea (North and South)
+
+# From Annie I. Bang (2006-07-10) in
+# <http://www.koreaherald.co.kr/SITE/data/html_dir/2006/07/10/200607100012.asp>:
+# The Ministry of Commerce, Industry and Energy has already
+# commissioned a research project [to reintroduce DST] and has said
+# the system may begin as early as 2008....  Korea ran a daylight
+# saving program from 1949-61 but stopped it during the 1950-53 Korean War.
+
+# From Shanks & Pottenger:
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	ROK	1960	only	-	May	15	0:00	1:00	D
+Rule	ROK	1960	only	-	Sep	13	0:00	0	S
+Rule	ROK	1987	1988	-	May	Sun>=8	0:00	1:00	D
+Rule	ROK	1987	1988	-	Oct	Sun>=8	0:00	0	S
+
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Asia/Seoul	8:27:52	-	LMT	1890
+			8:30	-	KST	1904 Dec
+			9:00	-	KST	1928
+			8:30	-	KST	1932
+			9:00	-	KST	1954 Mar 21
+			8:00	ROK	K%sT	1961 Aug 10
+			8:30	-	KST	1968 Oct
+			9:00	ROK	K%sT
+Zone	Asia/Pyongyang	8:23:00 -	LMT	1890
+			8:30	-	KST	1904 Dec
+			9:00	-	KST	1928
+			8:30	-	KST	1932
+			9:00	-	KST	1954 Mar 21
+			8:00	-	KST	1961 Aug 10
+			9:00	-	KST
+
+###############################################################################
+
+# Kuwait
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+# From the Arab Times (2007-03-14):
+# The Civil Service Commission (CSC) has approved a proposal forwarded
+# by MP Ahmad Baqer on implementing the daylight saving time (DST) in
+# Kuwait starting from April until the end of Sept this year, reports Al-Anba.
+# <http://www.arabtimesonline.com/arabtimes/kuwait/Viewdet.asp?ID=9950>.
+# From Paul Eggert (2007-03-29):
+# We don't know the details, or whether the approval means it'll happen,
+# so for now we assume no DST.
+Zone	Asia/Kuwait	3:11:56 -	LMT	1950
+			3:00	-	AST
+
+# Laos
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Asia/Vientiane	6:50:24 -	LMT	1906 Jun  9 # or Viangchan
+			7:06:20	-	SMT	1911 Mar 11 0:01 # Saigon MT?
+			7:00	-	ICT	1912 May
+			8:00	-	ICT	1931 May
+			7:00	-	ICT
+
+# Lebanon
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Lebanon	1920	only	-	Mar	28	0:00	1:00	S
+Rule	Lebanon	1920	only	-	Oct	25	0:00	0	-
+Rule	Lebanon	1921	only	-	Apr	3	0:00	1:00	S
+Rule	Lebanon	1921	only	-	Oct	3	0:00	0	-
+Rule	Lebanon	1922	only	-	Mar	26	0:00	1:00	S
+Rule	Lebanon	1922	only	-	Oct	8	0:00	0	-
+Rule	Lebanon	1923	only	-	Apr	22	0:00	1:00	S
+Rule	Lebanon	1923	only	-	Sep	16	0:00	0	-
+Rule	Lebanon	1957	1961	-	May	1	0:00	1:00	S
+Rule	Lebanon	1957	1961	-	Oct	1	0:00	0	-
+Rule	Lebanon	1972	only	-	Jun	22	0:00	1:00	S
+Rule	Lebanon	1972	1977	-	Oct	1	0:00	0	-
+Rule	Lebanon	1973	1977	-	May	1	0:00	1:00	S
+Rule	Lebanon	1978	only	-	Apr	30	0:00	1:00	S
+Rule	Lebanon	1978	only	-	Sep	30	0:00	0	-
+Rule	Lebanon	1984	1987	-	May	1	0:00	1:00	S
+Rule	Lebanon	1984	1991	-	Oct	16	0:00	0	-
+Rule	Lebanon	1988	only	-	Jun	1	0:00	1:00	S
+Rule	Lebanon	1989	only	-	May	10	0:00	1:00	S
+Rule	Lebanon	1990	1992	-	May	1	0:00	1:00	S
+Rule	Lebanon	1992	only	-	Oct	4	0:00	0	-
+Rule	Lebanon	1993	max	-	Mar	lastSun	0:00	1:00	S
+Rule	Lebanon	1993	1998	-	Sep	lastSun	0:00	0	-
+Rule	Lebanon	1999	max	-	Oct	lastSun	0:00	0	-
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Asia/Beirut	2:22:00 -	LMT	1880
+			2:00	Lebanon	EE%sT
+
+# Malaysia
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	NBorneo	1935	1941	-	Sep	14	0:00	0:20	TS # one-Third Summer
+Rule	NBorneo	1935	1941	-	Dec	14	0:00	0	-
+#
+# peninsular Malaysia
+# The data here are taken from Mok Ly Yng (2003-10-30)
+# <http://www.math.nus.edu.sg/aslaksen/teaching/timezone.html>.
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone Asia/Kuala_Lumpur	6:46:46 -	LMT	1901 Jan  1
+			6:55:25	-	SMT	1905 Jun  1 # Singapore M.T.
+			7:00	-	MALT	1933 Jan  1 # Malaya Time
+			7:00	0:20	MALST	1936 Jan  1
+			7:20	-	MALT	1941 Sep  1
+			7:30	-	MALT	1942 Feb 16
+			9:00	-	JST	1945 Sep 12
+			7:30	-	MALT	1982 Jan  1
+			8:00	-	MYT	# Malaysia Time
+# Sabah & Sarawak
+# From Paul Eggert (2006-03-22):
+# The data here are mostly from Shanks & Pottenger, but the 1942, 1945 and 1982
+# transition dates are from Mok Ly Yng.
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone Asia/Kuching	7:21:20	-	LMT	1926 Mar
+			7:30	-	BORT	1933	# Borneo Time
+			8:00	NBorneo	BOR%sT	1942 Feb 16
+			9:00	-	JST	1945 Sep 12
+			8:00	-	BORT	1982 Jan  1
+			8:00	-	MYT
+
+# Maldives
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Indian/Maldives	4:54:00 -	LMT	1880	# Male
+			4:54:00	-	MMT	1960	# Male Mean Time
+			5:00	-	MVT		# Maldives Time
+
+# Mongolia
+
+# Shanks & Pottenger say that Mongolia has three time zones, but
+# usno1995 and the CIA map Standard Time Zones of the World (2005-03)
+# both say that it has just one.
+
+# From Oscar van Vlijmen (1999-12-11):
+# <a href="http://www.mongoliatourism.gov.mn/general.htm">
+# General Information Mongolia
+# </a> (1999-09)
+# "Time: Mongolia has two time zones. Three westernmost provinces of
+# Bayan-Ulgii, Uvs, and Hovd are one hour earlier than the capital city, and
+# the rest of the country follows the Ulaanbaatar time, which is UTC/GMT plus
+# eight hours."
+
+# From Rives McDow (1999-12-13):
+# Mongolia discontinued the use of daylight savings time in 1999; 1998
+# being the last year it was implemented.  The dates of implementation I am
+# unsure of, but most probably it was similar to Russia, except for the time
+# of implementation may have been different....
+# Some maps in the past have indicated that there was an additional time
+# zone in the eastern part of Mongolia, including the provinces of Dornod,
+# Suhbaatar, and possibly Khentij.
+
+# From Paul Eggert (1999-12-15):
+# Naming and spelling is tricky in Mongolia.
+# We'll use Hovd (also spelled Chovd and Khovd) to represent the west zone;
+# the capital of the Hovd province is sometimes called Hovd, sometimes Dund-Us,
+# and sometimes Jirgalanta (with variant spellings), but the name Hovd
+# is good enough for our purposes.
+
+# From Rives McDow (2001-05-13):
+# In addition to Mongolia starting daylight savings as reported earlier
+# (adopted DST on 2001-04-27 02:00 local time, ending 2001-09-28),
+# there are three time zones.
+#
+# Provinces [at 7:00]: Bayan-ulgii, Uvs, Khovd, Zavkhan, Govi-Altai
+# Provinces [at 8:00]: Khovsgol, Bulgan, Arkhangai, Khentii, Tov,
+#	Bayankhongor, Ovorkhangai, Dundgovi, Dornogovi, Omnogovi
+# Provinces [at 9:00]: Dornod, Sukhbaatar
+#
+# [The province of Selenge is omitted from the above lists.]
+
+# From Ganbold Ts., Ulaanbaatar (2004-04-17):
+# Daylight saving occurs at 02:00 local time last Saturday of March.
+# It will change back to normal at 02:00 local time last Saturday of
+# September.... As I remember this rule was changed in 2001.
+#
+# From Paul Eggert (2004-04-17):
+# For now, assume Rives McDow's informant got confused about Friday vs
+# Saturday, and that his 2001 dates should have 1 added to them.
+
+# From Paul Eggert (2005-07-26):
+# We have wildly conflicting information about Mongolia's time zones.
+# Bill Bonnet (2005-05-19) reports that the US Embassy in Ulaanbaatar says
+# there is only one time zone and that DST is observed, citing Microsoft
+# Windows XP as the source.  Risto Nykanen (2005-05-16) reports that
+# travelmongolia.org says there are two time zones (UTC+7, UTC+8) with no DST.
+# Oscar van Vlijmen (2005-05-20) reports that the Mongolian Embassy in
+# Washington, DC says there are two time zones, with DST observed.
+# He also found
+# <http://ubpost.mongolnews.mn/index.php?subaction=showcomments&id=1111634894&archive=&start_from=&ucat=1&>
+# which also says that there is DST, and which has a comment by "Toddius"
+# (2005-03-31 06:05 +0700) saying "Mongolia actually has 3.5 time zones.
+# The West (OLGII) is +7 GMT, most of the country is ULAT is +8 GMT
+# and some Eastern provinces are +9 GMT but Sukhbaatar Aimag is SUHK +8.5 GMT.
+# The SUKH timezone is new this year, it is one of the few things the
+# parliament passed during the tumultuous winter session."
+# For now, let's ignore this information, until we have more confirmation.
+
+# From Ganbold Ts. (2007-02-26):
+# Parliament of Mongolia has just changed the daylight-saving rule in February.
+# They decided not to adopt daylight-saving time....
+# http://www.mongolnews.mn/index.php?module=unuudur&sec=view&id=15742
+
+# From Deborah Goldsmith (2008-03-30):
+# We received a bug report claiming that the tz database UTC offset for
+# Asia/Choibalsan (GMT+09:00) is incorrect, and that it should be GMT
+# +08:00 instead. Different sources appear to disagree with the tz
+# database on this, e.g.:
+#
+# <a href="http://www.timeanddate.com/worldclock/city.html?n=1026">
+# http://www.timeanddate.com/worldclock/city.html?n=1026
+# </a>
+# <a href="http://www.worldtimeserver.com/current_time_in_MN.aspx">
+# http://www.worldtimeserver.com/current_time_in_MN.aspx
+# </a>
+#
+# both say GMT+08:00.
+
+# From Steffen Thorsen (2008-03-31):
+# eznis airways, which operates several domestic flights, has a flight
+# schedule here:
+# <a href="http://www.eznis.com/Container.jsp?id=112">
+# http://www.eznis.com/Container.jsp?id=112
+# </a>
+# (click the English flag for English)
+#
+# There it appears that flights between Choibalsan and Ulaanbatar arrive
+# about 1:35 - 1:50 hours later in local clock time, no matter the
+# direction, while Ulaanbaatar-Khvod takes 2 hours in the Eastern
+# direction and 3:35 back, which indicates that Ulaanbatar and Khvod are
+# in different time zones (like we know about), while Choibalsan and
+# Ulaanbatar are in the same time zone (correction needed).
+
+# From Arthur David Olson (2008-05-19):
+# Assume that Choibalsan is indeed offset by 8:00.
+# XXX--in the absence of better information, assume that transition
+# was at the start of 2008-03-31 (the day of Steffen Thorsen's report);
+# this is almost surely wrong.
+
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Mongol	1983	1984	-	Apr	1	0:00	1:00	S
+Rule	Mongol	1983	only	-	Oct	1	0:00	0	-
+# Shanks & Pottenger and IATA SSIM say 1990s switches occurred at 00:00,
+# but McDow says the 2001 switches occurred at 02:00.  Also, IATA SSIM
+# (1996-09) says 1996-10-25.  Go with Shanks & Pottenger through 1998.
+#
+# Shanks & Pottenger say that the Sept. 1984 through Sept. 1990 switches
+# in Choibalsan (more precisely, in Dornod and Sukhbaatar) took place
+# at 02:00 standard time, not at 00:00 local time as in the rest of
+# the country.  That would be odd, and possibly is a result of their
+# correction of 02:00 (in the previous edition) not being done correctly
+# in the latest edition; so ignore it for now.
+
+Rule	Mongol	1985	1998	-	Mar	lastSun	0:00	1:00	S
+Rule	Mongol	1984	1998	-	Sep	lastSun	0:00	0	-
+# IATA SSIM (1999-09) says Mongolia no longer observes DST.
+Rule	Mongol	2001	only	-	Apr	lastSat	2:00	1:00	S
+Rule	Mongol	2001	2006	-	Sep	lastSat	2:00	0	-
+Rule	Mongol	2002	2006	-	Mar	lastSat	2:00	1:00	S
+
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+# Hovd, a.k.a. Chovd, Dund-Us, Dzhargalant, Khovd, Jirgalanta
+Zone	Asia/Hovd	6:06:36 -	LMT	1905 Aug
+			6:00	-	HOVT	1978	# Hovd Time
+			7:00	Mongol	HOV%sT
+# Ulaanbaatar, a.k.a. Ulan Bataar, Ulan Bator, Urga
+Zone	Asia/Ulaanbaatar 7:07:32 -	LMT	1905 Aug
+			7:00	-	ULAT	1978	# Ulaanbaatar Time
+			8:00	Mongol	ULA%sT
+# Choibalsan, a.k.a. Bajan Tuemen, Bajan Tumen, Chojbalsan,
+# Choybalsan, Sanbejse, Tchoibalsan
+Zone	Asia/Choibalsan	7:38:00 -	LMT	1905 Aug
+			7:00	-	ULAT	1978
+			8:00	-	ULAT	1983 Apr
+			9:00	Mongol	CHO%sT	2008 Mar 31 # Choibalsan Time
+			8:00	Mongol	CHO%sT
+
+# Nepal
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Asia/Kathmandu	5:41:16 -	LMT	1920
+			5:30	-	IST	1986
+			5:45	-	NPT	# Nepal Time
+
+# Oman
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Asia/Muscat	3:54:20 -	LMT	1920
+			4:00	-	GST
+
+# Pakistan
+
+# From Rives McDow (2002-03-13):
+# I have been advised that Pakistan has decided to adopt dst on a
+# TRIAL basis for one year, starting 00:01 local time on April 7, 2002
+# and ending at 00:01 local time October 6, 2002.  This is what I was
+# told, but I believe that the actual time of change may be 00:00; the
+# 00:01 was to make it clear which day it was on.
+
+# From Paul Eggert (2002-03-15):
+# Jesper Norgaard found this URL:
+# http://www.pak.gov.pk/public/news/app/app06_dec.htm
+# (dated 2001-12-06) which says that the Cabinet adopted a scheme "to
+# advance the clocks by one hour on the night between the first
+# Saturday and Sunday of April and revert to the original position on
+# 15th October each year".  This agrees with McDow's 04-07 at 00:00,
+# but disagrees about the October transition, and makes it sound like
+# it's not on a trial basis.  Also, the "between the first Saturday
+# and Sunday of April" phrase, if taken literally, means that the
+# transition takes place at 00:00 on the first Sunday on or after 04-02.
+
+# From Paul Eggert (2003-02-09):
+# DAWN <http://www.dawn.com/2002/10/06/top13.htm> reported on 2002-10-05
+# that 2002 DST ended that day at midnight.  Go with McDow for now.
+
+# From Steffen Thorsen (2003-03-14):
+# According to http://www.dawn.com/2003/03/07/top15.htm
+# there will be no DST in Pakistan this year:
+#
+# ISLAMABAD, March 6: Information and Media Development Minister Sheikh
+# Rashid Ahmed on Thursday said the cabinet had reversed a previous
+# decision to advance clocks by one hour in summer and put them back by
+# one hour in winter with the aim of saving light hours and energy.
+#
+# The minister told a news conference that the experiment had rather
+# shown 8 per cent higher consumption of electricity.
+
+# From Alex Krivenyshev (2008-05-15):
+# 
+# Here is an article that Pakistan plan to introduce Daylight Saving Time 
+# on June 1, 2008 for 3 months.
+# 
+# "... The federal cabinet on Wednesday announced a new conservation plan to help 
+# reduce load shedding by approving the closure of commercial centres at 9pm and 
+# moving clocks forward by one hour for the next three months. 
+# ...."
+# 
+# <a href="http://www.worldtimezone.net/dst_news/dst_news_pakistan01.html">
+# http://www.worldtimezone.net/dst_news/dst_news_pakistan01.html
+# </a>
+# OR
+# <a href="http://www.dailytimes.com.pk/default.asp?page=2008%5C05%5C15%5Cstory_15-5-2008_pg1_4">
+# http://www.dailytimes.com.pk/default.asp?page=2008%5C05%5C15%5Cstory_15-5-2008_pg1_4
+# </a>
+
+# From Arthur David Olson (2008-05-19):
+# XXX--midnight transitions is a guess; 2008 only is a guess.
+
+# From Alexander Krivenyshev (2008-08-28):
+# Pakistan government has decided to keep the watches one-hour advanced
+# for another 2 months--plan to return to Standard Time on October 31
+# instead of August 31.
+#
+# <a href="http://www.worldtimezone.com/dst_news/dst_news_pakistan02.html">
+# http://www.worldtimezone.com/dst_news/dst_news_pakistan02.html
+# </a>
+# OR
+# <a href="http://dailymailnews.com/200808/28/news/dmbrn03.html">
+# http://dailymailnews.com/200808/28/news/dmbrn03.html
+# </a>
+
+# From Alexander Krivenyshev (2009-04-08):
+# Based on previous media reports that "... proposed plan to
+# advance clocks by one hour from May 1 will cause disturbance
+# to the working schedules rather than bringing discipline in
+# official working."
+# <a href="http://www.thenews.com.pk/daily_detail.asp?id=171280">
+# http://www.thenews.com.pk/daily_detail.asp?id=171280
+# </a>
+#
+# recent news that instead of May 2009 - Pakistan plan to
+# introduce DST from April 15, 2009
+#
+# FYI: Associated Press Of Pakistan
+# April 08, 2009
+# Cabinet okays proposal to advance clocks by one hour from April 15
+# <a href="http://www.app.com.pk/en_/index.php?option=com_content&task=view&id=73043&Itemid=1">
+# http://www.app.com.pk/en_/index.php?option=com_content&task=view&id=73043&Itemid=1
+# </a>
+#
+# or
+#
+# <a href="http://www.worldtimezone.com/dst_news/dst_news_pakistan05.html">
+# http://www.worldtimezone.com/dst_news/dst_news_pakistan05.html
+# </a>
+#
+# ....
+# The Federal Cabinet on Wednesday approved the proposal to
+# advance clocks in the country by one hour from April 15 to
+# conserve energy"
+
+# From Steffen Thorsen (2009-09-17):
+# "The News International," Pakistan reports that: "The Federal
+# Government has decided to restore the previous time by moving the
+# clocks backward by one hour from October 1. A formal announcement to
+# this effect will be made after the Prime Minister grants approval in
+# this regard." 
+# <a href="http://www.thenews.com.pk/updates.asp?id=87168">
+# http://www.thenews.com.pk/updates.asp?id=87168
+# </a>
+
+# From Alexander Krivenyshev (2009-09-28):
+# According to Associated Press Of Pakistan, it is confirmed that
+# Pakistan clocks across the country would be turned back by an hour from October
+# 1, 2009.
+#
+# "Clocks to go back one hour from 1 Oct"
+# <a href="http://www.app.com.pk/en_/index.php?option=com_content&task=view&id=86715&Itemid=2">
+# http://www.app.com.pk/en_/index.php?option=com_content&task=view&id=86715&Itemid=2
+# </a>
+# or
+# <a href="http://www.worldtimezone.com/dst_news/dst_news_pakistan07.htm">
+# http://www.worldtimezone.com/dst_news/dst_news_pakistan07.htm
+# </a>
+
+# From Steffen Thorsen (2009-09-29):
+# Alexander Krivenyshev wrote:
+# > According to Associated Press Of Pakistan, it is confirmed that
+# > Pakistan clocks across the country would be turned back by an hour from October
+# > 1, 2009.
+#
+# Now they seem to have changed their mind, November 1 is the new date:
+# <a href="http://www.thenews.com.pk/top_story_detail.asp?Id=24742">
+# http://www.thenews.com.pk/top_story_detail.asp?Id=24742
+# </a>
+# "The country's clocks will be reversed by one hour on November 1.
+# Officials of Federal Ministry for Interior told this to Geo News on
+# Monday."
+#
+# And more importantly, it seems that these dates will be kept every year:
+# "It has now been decided that clocks will be wound forward by one hour
+# on April 15 and reversed by an hour on November 1 every year without
+# obtaining prior approval, the officials added."
+#
+# We have confirmed this year's end date with both with the Ministry of
+# Water and Power and the Pakistan Electric Power Company:
+# <a href="http://www.timeanddate.com/news/time/pakistan-ends-dst09.html">
+# http://www.timeanddate.com/news/time/pakistan-ends-dst09.html
+# </a>
+
+# From Christoph Goehre (2009-10-01):
+# [T]he German Consulate General in Karachi reported me today that Pakistan
+# will go back to standard time on 1st of November.
+
+# From Steffen Thorsen (2010-03-26):
+# Steffen Thorsen wrote:
+# > On Thursday (2010-03-25) it was announced that DST would start in
+# > Pakistan on 2010-04-01.
+# >
+# > Then today, the president said that they might have to revert the
+# > decision if it is not supported by the parliament. So at the time
+# > being, it seems unclear if DST will be actually observed or not - but
+# > April 1 could be a more likely date than April 15.
+# Now, it seems that the decision to not observe DST in final:
+#
+# "Govt Withdraws Plan To Advance Clocks"
+# <a href="http://www.apakistannews.com/govt-withdraws-plan-to-advance-clocks-172041">
+# http://www.apakistannews.com/govt-withdraws-plan-to-advance-clocks-172041
+# </a>
+#
+# "People laud PM's announcement to end DST"
+# <a href="http://www.app.com.pk/en_/index.php?option=com_content&task=view&id=99374&Itemid=2">
+# http://www.app.com.pk/en_/index.php?option=com_content&task=view&id=99374&Itemid=2
+# </a>
+
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule Pakistan	2002	only	-	Apr	Sun>=2	0:01	1:00	S
+Rule Pakistan	2002	only	-	Oct	Sun>=2	0:01	0	-
+Rule Pakistan	2008	only	-	Jun	1	0:00	1:00	S
+Rule Pakistan	2008	only	-	Nov	1	0:00	0	-
+Rule Pakistan	2009	only	-	Apr	15	0:00	1:00	S
+Rule Pakistan	2009	only	-	Nov	1	0:00	0	-
+
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Asia/Karachi	4:28:12 -	LMT	1907
+			5:30	-	IST	1942 Sep
+			5:30	1:00	IST	1945 Oct 15
+			5:30	-	IST	1951 Sep 30
+			5:00	-	KART	1971 Mar 26 # Karachi Time
+			5:00 Pakistan	PK%sT	# Pakistan Time
+
+# Palestine
+
+# From Amos Shapir (1998-02-15):
+#
+# From 1917 until 1948-05-15, all of Palestine, including the parts now
+# known as the Gaza Strip and the West Bank, was under British rule.
+# Therefore the rules given for Israel for that period, apply there too...
+#
+# The Gaza Strip was under Egyptian rule between 1948-05-15 until 1967-06-05
+# (except a short occupation by Israel from 1956-11 till 1957-03, but no
+# time zone was affected then).  It was never formally annexed to Egypt,
+# though.
+#
+# The rest of Palestine was under Jordanian rule at that time, formally
+# annexed in 1950 as the West Bank (and the word "Trans" was dropped from
+# the country's previous name of "the Hashemite Kingdom of the
+# Trans-Jordan").  So the rules for Jordan for that time apply.  Major
+# towns in that area are Nablus (Shchem), El-Halil (Hebron), Ramallah, and
+# East Jerusalem.
+#
+# Both areas were occupied by Israel in June 1967, but not annexed (except
+# for East Jerusalem).  They were on Israel time since then; there might
+# have been a Military Governor's order about time zones, but I'm not aware
+# of any (such orders may have been issued semi-annually whenever summer
+# time was in effect, but maybe the legal aspect of time was just neglected).
+#
+# The Palestinian Authority was established in 1993, and got hold of most
+# towns in the West Bank and Gaza by 1995.  I know that in order to
+# demonstrate...independence, they have been switching to
+# summer time and back on a different schedule than Israel's, but I don't
+# know when this was started, or what algorithm is used (most likely the
+# Jordanian one).
+#
+# To summarize, the table should probably look something like that:
+#
+# Area \ when | 1918-1947 | 1948-1967 | 1967-1995 | 1996-
+# ------------+-----------+-----------+-----------+-----------
+# Israel      | Zion      | Zion      | Zion      | Zion
+# West bank   | Zion      | Jordan    | Zion      | Jordan
+# Gaza        | Zion      | Egypt     | Zion      | Jordan
+#
+# I guess more info may be available from the PA's web page (if/when they
+# have one).
+
+# From Paul Eggert (2006-03-22):
+# Shanks & Pottenger write that Gaza did not observe DST until 1957, but go
+# with Shapir and assume that it observed DST from 1940 through 1947,
+# and that it used Jordanian rules starting in 1996.
+# We don't yet need a separate entry for the West Bank, since
+# the only differences between it and Gaza that we know about
+# occurred before our cutoff date of 1970.
+# However, as we get more information, we may need to add entries
+# for parts of the West Bank as they transitioned from Israel's rules
+# to Palestine's rules.  If you have more info about this, please
+# send it to tz@elsie.nci.nih.gov for incorporation into future editions.
+
+# From IINS News Service - Israel - 1998-03-23 10:38:07 Israel time,
+# forwarded by Ephraim Silverberg:
+#
+# Despite the fact that Israel changed over to daylight savings time
+# last week, the PLO Authority (PA) has decided not to turn its clocks
+# one-hour forward at this time.  As a sign of independence from Israeli rule,
+# the PA has decided to implement DST in April.
+
+# From Paul Eggert (1999-09-20):
+# Daoud Kuttab writes in
+# <a href="http://www.jpost.com/com/Archive/22.Apr.1999/Opinion/Article-2.html">
+# Holiday havoc
+# </a> (Jerusalem Post, 1999-04-22) that
+# the Palestinian National Authority changed to DST on 1999-04-15.
+# I vaguely recall that they switch back in October (sorry, forgot the source).
+# For now, let's assume that the spring switch was at 24:00,
+# and that they switch at 0:00 on the 3rd Fridays of April and October.
+
+# From Paul Eggert (2005-11-22):
+# Starting 2004 transitions are from Steffen Thorsen's web site timeanddate.com.
+
+# From Steffen Thorsen (2005-11-23):
+# A user from Gaza reported that Gaza made the change early because of
+# the Ramadan.  Next year Ramadan will be even earlier, so I think
+# there is a good chance next year's end date will be around two weeks
+# earlier--the same goes for Jordan.
+
+# From Steffen Thorsen (2006-08-17):
+# I was informed by a user in Bethlehem that in Bethlehem it started the
+# same day as Israel, and after checking with other users in the area, I
+# was informed that they started DST one day after Israel.  I was not
+# able to find any authoritative sources at the time, nor details if
+# Gaza changed as well, but presumed Gaza to follow the same rules as
+# the West Bank.
+
+# From Steffen Thorsen (2006-09-26):
+# according to the Palestine News Network (2006-09-19):
+# http://english.pnn.ps/index.php?option=com_content&task=view&id=596&Itemid=5
+# > The Council of Ministers announced that this year its winter schedule
+# > will begin early, as of midnight Thursday.  It is also time to turn
+# > back the clocks for winter.  Friday will begin an hour late this week.
+# I guess it is likely that next year's date will be moved as well,
+# because of the Ramadan.
+
+# From Jesper Norgaard Welen (2007-09-18):
+# According to Steffen Thorsen's web site the Gaza Strip and the rest of the
+# Palestinian territories left DST early on 13.th. of September at 2:00.
+
+# From Paul Eggert (2007-09-20):
+# My understanding is that Gaza and the West Bank disagree even over when
+# the weekend is (Thursday+Friday versus Friday+Saturday), so I'd be a bit
+# surprised if they agreed about DST.  But for now, assume they agree.
+# For lack of better information, predict that future changes will be
+# the 2nd Thursday of September at 02:00.
+
+# From Alexander Krivenyshev (2008-08-28):
+# Here is an article, that Mideast running on different clocks at Ramadan.
+#
+# Gaza Strip (as Egypt) ended DST at midnight Thursday (Aug 28, 2008), while
+# the West Bank will end Daylight Saving Time at midnight Sunday (Aug 31, 2008).
+#
+# <a href="http://www.guardian.co.uk/world/feedarticle/7759001">
+# http://www.guardian.co.uk/world/feedarticle/7759001
+# </a>
+# <a href="http://www.abcnews.go.com/International/wireStory?id=5676087">
+# http://www.abcnews.go.com/International/wireStory?id=5676087
+# </a>
+# or
+# <a href="http://www.worldtimezone.com/dst_news/dst_news_gazastrip01.html">
+# http://www.worldtimezone.com/dst_news/dst_news_gazastrip01.html
+# </a>
+
+# From Alexander Krivenyshev (2009-03-26):
+# According to the Palestine News Network (arabic.pnn.ps), Palestinian
+# government decided to start Daylight Time on Thursday night March
+# 26 and continue until the night of 27 September 2009.
+#
+# (in Arabic)
+# <a href="http://arabic.pnn.ps/index.php?option=com_content&task=view&id=50850">
+# http://arabic.pnn.ps/index.php?option=com_content&task=view&id=50850
+# </a>
+#
+# or
+# (English translation)
+# <a href="http://www.worldtimezone.com/dst_news/dst_news_westbank01.html">
+# http://www.worldtimezone.com/dst_news/dst_news_westbank01.html
+# </a>
+
+# From Steffen Thorsen (2009-08-31):
+# Palestine's Council of Ministers announced that they will revert back to
+# winter time on Friday, 2009-09-04.
+#
+# One news source:
+# <a href="http://www.safa.ps/ara/?action=showdetail&seid=4158">
+# http://www.safa.ps/ara/?action=showdetail&seid=4158
+# </a>
+# (Palestinian press agency, Arabic),
+# Google translate: "Decided that the Palestinian government in Ramallah
+# headed by Salam Fayyad, the start of work in time for the winter of
+# 2009, starting on Friday approved the fourth delay Sept. clock sixty
+# minutes per hour as of Friday morning."
+#
+# We are not sure if Gaza will do the same, last year they had a different
+# end date, we will keep this page updated:
+# <a href="http://www.timeanddate.com/news/time/westbank-gaza-dst-2009.html">
+# http://www.timeanddate.com/news/time/westbank-gaza-dst-2009.html
+# </a>
+
+# From Alexander Krivenyshev (2009-09-02):
+# Seems that Gaza Strip will go back to Winter Time same date as West Bank.
+#
+# According to Palestinian Ministry Of Interior, West Bank and Gaza Strip plan
+# to change time back to Standard time on September 4, 2009.
+#
+# "Winter time unite the West Bank and Gaza"
+# (from Palestinian National Authority):
+# <a href="http://www.moi.gov.ps/en/?page=633167343250594025&nid=11505
+# http://www.moi.gov.ps/en/?page=633167343250594025&nid=11505
+# </a>
+# or
+# <a href="http://www.worldtimezone.com/dst_news/dst_news_gazastrip02.html>
+# http://www.worldtimezone.com/dst_news/dst_news_gazastrip02.html
+# </a>
+
+# From Alexander Krivenyshev (2010-03-19):
+# According to Voice of Palestine DST will last for 191 days, from March
+# 26, 2010 till "the last Sunday before the tenth day of Tishri
+# (October), each year" (October 03, 2010?)
+#
+# <a href="http://palvoice.org/forums/showthread.php?t=245697">
+# http://palvoice.org/forums/showthread.php?t=245697
+# </a>
+# (in Arabic)
+# or
+# <a href="http://www.worldtimezone.com/dst_news/dst_news_westbank03.html">
+# http://www.worldtimezone.com/dst_news/dst_news_westbank03.html
+# </a>
+
+# From Steffen Thorsen (2010-03-24):
+# ...Ma'an News Agency reports that Hamas cabinet has decided it will
+# start one day later, at 12:01am. Not sure if they really mean 12:01am or
+# noon though:
+#
+# <a href="http://www.maannews.net/eng/ViewDetails.aspx?ID=271178">
+# http://www.maannews.net/eng/ViewDetails.aspx?ID=271178
+# </a>
+# (Ma'an News Agency)
+# "At 12:01am Friday, clocks in Israel and the West Bank will change to
+# 1:01am, while Gaza clocks will change at 12:01am Saturday morning."
+
+# The rules for Egypt are stolen from the `africa' file.
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule EgyptAsia	1957	only	-	May	10	0:00	1:00	S
+Rule EgyptAsia	1957	1958	-	Oct	 1	0:00	0	-
+Rule EgyptAsia	1958	only	-	May	 1	0:00	1:00	S
+Rule EgyptAsia	1959	1967	-	May	 1	1:00	1:00	S
+Rule EgyptAsia	1959	1965	-	Sep	30	3:00	0	-
+Rule EgyptAsia	1966	only	-	Oct	 1	3:00	0	-
+
+Rule Palestine	1999	2005	-	Apr	Fri>=15	0:00	1:00	S
+Rule Palestine	1999	2003	-	Oct	Fri>=15	0:00	0	-
+Rule Palestine	2004	only	-	Oct	 1	1:00	0	-
+Rule Palestine	2005	only	-	Oct	 4	2:00	0	-
+Rule Palestine	2006	2008	-	Apr	 1	0:00	1:00	S
+Rule Palestine	2006	only	-	Sep	22	0:00	0	-
+Rule Palestine	2007	only	-	Sep	Thu>=8	2:00	0	-
+Rule Palestine	2008	only	-	Aug	lastFri	2:00	0	-
+Rule Palestine	2009	only	-	Mar	lastFri	0:00	1:00	S
+Rule Palestine	2010	max	-	Mar	lastSat	0:01	1:00	S
+Rule Palestine	2009	max	-	Sep	Fri>=1	2:00	0	-
+
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Asia/Gaza	2:17:52	-	LMT	1900 Oct
+			2:00	Zion	EET	1948 May 15
+			2:00 EgyptAsia	EE%sT	1967 Jun  5
+			2:00	Zion	I%sT	1996
+			2:00	Jordan	EE%sT	1999
+			2:00 Palestine	EE%sT
+
+# Paracel Is
+# no information
+
+# Philippines
+# On 1844-08-16, Narciso Claveria, governor-general of the
+# Philippines, issued a proclamation announcing that 1844-12-30 was to
+# be immediately followed by 1845-01-01.  Robert H. van Gent has a
+# transcript of the decree in <http://www.phys.uu.nl/~vgent/idl/idl.htm>.
+# The rest of the data are from Shanks & Pottenger.
+
+# From Paul Eggert (2006-04-25):
+# Tomorrow's Manila Standard reports that the Philippines Department of
+# Trade and Industry is considering adopting DST this June when the
+# rainy season begins.  See
+# <http://www.manilastandardtoday.com/?page=politics02_april26_2006>.
+# For now, we'll ignore this, since it's not definite and we lack details.
+#
+# From Jesper Norgaard Welen (2006-04-26):
+# ... claims that Philippines had DST last time in 1990:
+# http://story.philippinetimes.com/p.x/ct/9/id/145be20cc6b121c0/cid/3e5bbccc730d258c/
+# [a story dated 2006-04-25 by Cris Larano of Dow Jones Newswires,
+# but no details]
+
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Phil	1936	only	-	Nov	1	0:00	1:00	S
+Rule	Phil	1937	only	-	Feb	1	0:00	0	-
+Rule	Phil	1954	only	-	Apr	12	0:00	1:00	S
+Rule	Phil	1954	only	-	Jul	1	0:00	0	-
+Rule	Phil	1978	only	-	Mar	22	0:00	1:00	S
+Rule	Phil	1978	only	-	Sep	21	0:00	0	-
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Asia/Manila	-15:56:00 -	LMT	1844 Dec 31
+			8:04:00 -	LMT	1899 May 11
+			8:00	Phil	PH%sT	1942 May
+			9:00	-	JST	1944 Nov
+			8:00	Phil	PH%sT
+
+# Qatar
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Asia/Qatar	3:26:08 -	LMT	1920	# Al Dawhah / Doha
+			4:00	-	GST	1972 Jun
+			3:00	-	AST
+
+# Saudi Arabia
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Asia/Riyadh	3:06:52 -	LMT	1950
+			3:00	-	AST
+
+# Singapore
+# The data here are taken from Mok Ly Yng (2003-10-30)
+# <http://www.math.nus.edu.sg/aslaksen/teaching/timezone.html>.
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Asia/Singapore	6:55:25 -	LMT	1901 Jan  1
+			6:55:25	-	SMT	1905 Jun  1 # Singapore M.T.
+			7:00	-	MALT	1933 Jan  1 # Malaya Time
+			7:00	0:20	MALST	1936 Jan  1
+			7:20	-	MALT	1941 Sep  1
+			7:30	-	MALT	1942 Feb 16
+			9:00	-	JST	1945 Sep 12
+			7:30	-	MALT	1965 Aug  9 # independence
+			7:30	-	SGT	1982 Jan  1 # Singapore Time
+			8:00	-	SGT
+
+# Spratly Is
+# no information
+
+# Sri Lanka
+# From Paul Eggert (1996-09-03):
+# "Sri Lanka advances clock by an hour to avoid blackout"
+# (www.virtual-pc.com/lankaweb/news/items/240596-2.html, 1996-05-24,
+# no longer available as of 1999-08-17)
+# reported ``the country's standard time will be put forward by one hour at
+# midnight Friday (1830 GMT) `in the light of the present power crisis'.''
+#
+# From Dharmasiri Senanayake, Sri Lanka Media Minister (1996-10-24), as quoted
+# by Shamindra in
+# <a href="news:54rka5$m5h@mtinsc01-mgt.ops.worldnet.att.net">
+# Daily News - Hot News Section (1996-10-26)
+# </a>:
+# With effect from 12.30 a.m. on 26th October 1996
+# Sri Lanka will be six (06) hours ahead of GMT.
+
+# From Jesper Norgaard Welen (2006-04-14), quoting Sri Lanka News Online
+# <http://news.sinhalaya.com/wmview.php?ArtID=11002> (2006-04-13):
+# 0030 hrs on April 15, 2006 (midnight of April 14, 2006 +30 minutes)
+# at present, become 2400 hours of April 14, 2006 (midnight of April 14, 2006).
+
+# From Peter Apps and Ranga Sirila of Reuters (2006-04-12) in:
+# <http://today.reuters.co.uk/news/newsArticle.aspx?type=scienceNews&storyID=2006-04-12T172228Z_01_COL295762_RTRIDST_0_SCIENCE-SRILANKA-TIME-DC.XML>
+# [The Tamil Tigers] never accepted the original 1996 time change and simply
+# kept their clocks set five and a half hours ahead of Greenwich Mean
+# Time (GMT), in line with neighbor India.
+# From Paul Eggert (2006-04-18):
+# People who live in regions under Tamil control can use [TZ='Asia/Kolkata'],
+# as that zone has agreed with the Tamil areas since our cutoff date of 1970.
+
+# From K Sethu (2006-04-25):
+# I think the abbreviation LKT originated from the world of computers at
+# the time of or subsequent to the time zone changes by SL Government
+# twice in 1996 and probably SL Government or its standardization
+# agencies never declared an abbreviation as a national standard.
+#
+# I recollect before the recent change the government annoucemments
+# mentioning it as simply changing Sri Lanka Standard Time or Sri Lanka
+# Time and no mention was made about the abbreviation.
+#
+# If we look at Sri Lanka Department of Government's "Official News
+# Website of Sri Lanka" ... http://www.news.lk/ we can see that they
+# use SLT as abbreviation in time stamp at the beginning of each news
+# item....
+#
+# Within Sri Lanka I think LKT is well known among computer users and
+# adminsitrators.  In my opinion SLT may not be a good choice because the
+# nation's largest telcom / internet operator Sri Lanka Telcom is well
+# known by that abbreviation - simply as SLT (there IP domains are
+# slt.lk and sltnet.lk).
+#
+# But if indeed our government has adopted SLT as standard abbreviation
+# (that we have not known so far) then  it is better that it be used for
+# all computers.
+
+# From Paul Eggert (2006-04-25):
+# One possibility is that we wait for a bit for the dust to settle down
+# and then see what people actually say in practice.
+
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Asia/Colombo	5:19:24 -	LMT	1880
+			5:19:32	-	MMT	1906	# Moratuwa Mean Time
+			5:30	-	IST	1942 Jan  5
+			5:30	0:30	IHST	1942 Sep
+			5:30	1:00	IST	1945 Oct 16 2:00
+			5:30	-	IST	1996 May 25 0:00
+			6:30	-	LKT	1996 Oct 26 0:30
+			6:00	-	LKT	2006 Apr 15 0:30
+			5:30	-	IST
+
+# Syria
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Syria	1920	1923	-	Apr	Sun>=15	2:00	1:00	S
+Rule	Syria	1920	1923	-	Oct	Sun>=1	2:00	0	-
+Rule	Syria	1962	only	-	Apr	29	2:00	1:00	S
+Rule	Syria	1962	only	-	Oct	1	2:00	0	-
+Rule	Syria	1963	1965	-	May	1	2:00	1:00	S
+Rule	Syria	1963	only	-	Sep	30	2:00	0	-
+Rule	Syria	1964	only	-	Oct	1	2:00	0	-
+Rule	Syria	1965	only	-	Sep	30	2:00	0	-
+Rule	Syria	1966	only	-	Apr	24	2:00	1:00	S
+Rule	Syria	1966	1976	-	Oct	1	2:00	0	-
+Rule	Syria	1967	1978	-	May	1	2:00	1:00	S
+Rule	Syria	1977	1978	-	Sep	1	2:00	0	-
+Rule	Syria	1983	1984	-	Apr	9	2:00	1:00	S
+Rule	Syria	1983	1984	-	Oct	1	2:00	0	-
+Rule	Syria	1986	only	-	Feb	16	2:00	1:00	S
+Rule	Syria	1986	only	-	Oct	9	2:00	0	-
+Rule	Syria	1987	only	-	Mar	1	2:00	1:00	S
+Rule	Syria	1987	1988	-	Oct	31	2:00	0	-
+Rule	Syria	1988	only	-	Mar	15	2:00	1:00	S
+Rule	Syria	1989	only	-	Mar	31	2:00	1:00	S
+Rule	Syria	1989	only	-	Oct	1	2:00	0	-
+Rule	Syria	1990	only	-	Apr	1	2:00	1:00	S
+Rule	Syria	1990	only	-	Sep	30	2:00	0	-
+Rule	Syria	1991	only	-	Apr	 1	0:00	1:00	S
+Rule	Syria	1991	1992	-	Oct	 1	0:00	0	-
+Rule	Syria	1992	only	-	Apr	 8	0:00	1:00	S
+Rule	Syria	1993	only	-	Mar	26	0:00	1:00	S
+Rule	Syria	1993	only	-	Sep	25	0:00	0	-
+# IATA SSIM (1998-02) says 1998-04-02;
+# (1998-09) says 1999-03-29 and 1999-09-29; (1999-02) says 1999-04-02,
+# 2000-04-02, and 2001-04-02; (1999-09) says 2000-03-31 and 2001-03-31;
+# (2006) says 2006-03-31 and 2006-09-22;
+# for now ignore all these claims and go with Shanks & Pottenger,
+# except for the 2006-09-22 claim (which seems right for Ramadan).
+Rule	Syria	1994	1996	-	Apr	 1	0:00	1:00	S
+Rule	Syria	1994	2005	-	Oct	 1	0:00	0	-
+Rule	Syria	1997	1998	-	Mar	lastMon	0:00	1:00	S
+Rule	Syria	1999	2006	-	Apr	 1	0:00	1:00	S
+# From Stephen Colebourne (2006-09-18):
+# According to IATA data, Syria will change DST on 21st September [21:00 UTC]
+# this year [only]....  This is probably related to Ramadan, like Egypt.
+Rule	Syria	2006	only	-	Sep	22	0:00	0	-
+# From Paul Eggert (2007-03-29):
+# Today the AP reported "Syria will switch to summertime at midnight Thursday."
+# http://www.iht.com/articles/ap/2007/03/29/africa/ME-GEN-Syria-Time-Change.php
+Rule	Syria	2007	only	-	Mar	lastFri	0:00	1:00	S
+# From Jesper Norgard (2007-10-27):
+# The sister center ICARDA of my work CIMMYT is confirming that Syria DST will
+# not take place 1.st November at 0:00 o'clock but 1.st November at 24:00 or
+# rather Midnight between Thursday and Friday. This does make more sence than
+# having it between Wednesday and Thursday (two workdays in Syria) since the
+# weekend in Syria is not Saturday and Sunday, but Friday and Saturday. So now
+# it is implemented at midnight of the last workday before weekend...
+# 
+# From Steffen Thorsen (2007-10-27):
+# Jesper Norgaard Welen wrote:
+# 
+# > "Winter local time in Syria will be observed at midnight of Thursday 1
+# > November 2007, and the clock will be put back 1 hour."
+# 
+# I found confirmation on this in this gov.sy-article (Arabic):
+# http://wehda.alwehda.gov.sy/_print_veiw.asp?FileName=12521710520070926111247
+# 
+# which using Google's translate tools says:
+# Council of Ministers also approved the commencement of work on 
+# identifying the winter time as of Friday, 2/11/2007 where the 60th 
+# minute delay at midnight Thursday 1/11/2007.
+Rule	Syria	2007	only	-	Nov	 Fri>=1	0:00	0	-
+
+# From Stephen Colebourne (2008-03-17):
+# For everyone's info, I saw an IATA time zone change for [Syria] for
+# this month (March 2008) in the last day or so...This is the data IATA
+# are now using:
+# Country     Time Standard   --- DST Start ---   --- DST End ---  DST
+# Name        Zone Variation   Time    Date        Time    Date
+# Variation
+# Syrian Arab
+# Republic    SY    +0200      2200  03APR08       2100  30SEP08   +0300
+#                              2200  02APR09       2100  30SEP09   +0300
+#                              2200  01APR10       2100  30SEP10   +0300
+
+# From Arthur David Olson (2008-03-17):
+# Here's a link to English-language coverage by the Syrian Arab News
+# Agency (SANA)...
+# <a href="http://www.sana.sy/eng/21/2008/03/11/165173.htm">
+# http://www.sana.sy/eng/21/2008/03/11/165173.htm
+# </a>...which reads (in part) "The Cabinet approved the suggestion of the
+# Ministry of Electricity to begin daylight savings time on Friday April
+# 4th, advancing clocks one hour ahead on midnight of Thursday April 3rd."
+# Since Syria is two hours east of UTC, the 2200 and 2100 transition times
+# shown above match up with midnight in Syria.
+
+# From Arthur David Olson (2008-03-18):
+# My buest guess at a Syrian rule is "the Friday nearest April 1";
+# coding that involves either using a "Mar Fri>=29" construct that old time zone
+# compilers can't handle  or having multiple Rules (a la Israel).
+# For now, use "Apr Fri>=1", and go with IATA on a uniform Sep 30 end.
+
+# From Steffen Thorsen (2008-10-07):
+# Syria has now officially decided to end DST on 2008-11-01 this year,
+# according to the following article in the Syrian Arab News Agency (SANA).
+#
+# The article is in Arabic, and seems to tell that they will go back to
+# winter time on 2008-11-01 at 00:00 local daylight time (delaying/setting
+# clocks back 60 minutes).
+#
+# <a href="http://sana.sy/ara/2/2008/10/07/195459.htm">
+# http://sana.sy/ara/2/2008/10/07/195459.htm
+# </a>
+
+# From Steffen Thorsen (2009-03-19):
+# Syria will start DST on 2009-03-27 00:00 this year according to many sources,
+# two examples:
+#
+# <a href="http://www.sana.sy/eng/21/2009/03/17/217563.htm">
+# http://www.sana.sy/eng/21/2009/03/17/217563.htm
+# </a>
+# (English, Syrian Arab News # Agency)
+# <a href="http://thawra.alwehda.gov.sy/_View_news2.asp?FileName=94459258720090318012209">
+# http://thawra.alwehda.gov.sy/_View_news2.asp?FileName=94459258720090318012209
+# </a>
+# (Arabic, gov-site)
+#
+# We have not found any sources saying anything about when DST ends this year.
+#
+# Our summary
+# <a href="http://www.timeanddate.com/news/time/syria-dst-starts-march-27-2009.html">
+# http://www.timeanddate.com/news/time/syria-dst-starts-march-27-2009.html
+# </a>
+
+# From Steffen Thorsen (2009-10-27):
+# The Syrian Arab News Network on 2009-09-29 reported that Syria will 
+# revert back to winter (standard) time on midnight between Thursday 
+# 2009-10-29 and Friday 2009-10-30:
+# <a href="http://www.sana.sy/ara/2/2009/09/29/247012.htm">
+# http://www.sana.sy/ara/2/2009/09/29/247012.htm (Arabic)
+# </a>
+
+# From Arthur David Olson (2009-10-28):
+# We'll see if future DST switching times turn out to be end of the last
+# Thursday of the month or the start of the last Friday of the month or
+# something else. For now, use the start of the last Friday.
+
+# From Steffen Thorsen (2010-03-17):
+# The "Syrian News Station" reported on 2010-03-16 that the Council of
+# Ministers has decided that Syria will start DST on midnight Thursday
+# 2010-04-01: (midnight between Thursday and Friday):
+# <a href="http://sns.sy/sns/?path=news/read/11421">
+# http://sns.sy/sns/?path=news/read/11421 (Arabic)
+# </a>
+
+Rule	Syria	2008	only	-	Apr	Fri>=1	0:00	1:00	S
+Rule	Syria	2008	only	-	Nov	1	0:00	0	-
+Rule	Syria	2009	only	-	Mar	lastFri	0:00	1:00	S
+Rule	Syria	2010	max	-	Apr	Fri>=1	0:00	1:00	S
+Rule	Syria	2009	max	-	Oct	lastFri	0:00	0	-
+
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Asia/Damascus	2:25:12 -	LMT	1920	# Dimashq
+			2:00	Syria	EE%sT
+
+# Tajikistan
+# From Shanks & Pottenger.
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Asia/Dushanbe	4:35:12 -	LMT	1924 May  2
+			5:00	-	DUST	1930 Jun 21 # Dushanbe Time
+			6:00 RussiaAsia DUS%sT	1991 Mar 31 2:00s
+			5:00	1:00	DUSST	1991 Sep  9 2:00s
+			5:00	-	TJT		    # Tajikistan Time
+
+# Thailand
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Asia/Bangkok	6:42:04	-	LMT	1880
+			6:42:04	-	BMT	1920 Apr # Bangkok Mean Time
+			7:00	-	ICT
+
+# Turkmenistan
+# From Shanks & Pottenger.
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Asia/Ashgabat	3:53:32 -	LMT	1924 May  2 # or Ashkhabad
+			4:00	-	ASHT	1930 Jun 21 # Ashkhabad Time
+			5:00 RussiaAsia	ASH%sT	1991 Mar 31 2:00
+			4:00 RussiaAsia	ASH%sT	1991 Oct 27 # independence
+			4:00 RussiaAsia	TM%sT	1992 Jan 19 2:00
+			5:00	-	TMT
+
+# United Arab Emirates
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Asia/Dubai	3:41:12 -	LMT	1920
+			4:00	-	GST
+
+# Uzbekistan
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Asia/Samarkand	4:27:12 -	LMT	1924 May  2
+			4:00	-	SAMT	1930 Jun 21 # Samarkand Time
+			5:00	-	SAMT	1981 Apr  1
+			5:00	1:00	SAMST	1981 Oct  1
+			6:00	-	TAST	1982 Apr  1 # Tashkent Time
+			5:00 RussiaAsia	SAM%sT	1991 Sep  1 # independence
+			5:00 RussiaAsia	UZ%sT	1992
+			5:00	-	UZT
+Zone	Asia/Tashkent	4:37:12 -	LMT	1924 May  2
+			5:00	-	TAST	1930 Jun 21 # Tashkent Time
+			6:00 RussiaAsia	TAS%sT	1991 Mar 31 2:00
+			5:00 RussiaAsia	TAS%sT	1991 Sep  1 # independence
+			5:00 RussiaAsia	UZ%sT	1992
+			5:00	-	UZT
+
+# Vietnam
+
+# From Arthur David Olson (2008-03-18):
+# The English-language name of Vietnam's most populous city is "Ho Chi Min City";
+# we use Ho_Chi_Minh below to avoid a name of more than 14 characters.
+
+# From Shanks & Pottenger:
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Asia/Ho_Chi_Minh	7:06:40 -	LMT	1906 Jun  9
+			7:06:20	-	SMT	1911 Mar 11 0:01 # Saigon MT?
+			7:00	-	ICT	1912 May
+			8:00	-	ICT	1931 May
+			7:00	-	ICT
+
+# Yemen
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Asia/Aden	3:00:48	-	LMT	1950
+			3:00	-	AST
diff --git a/tools/zoneinfo/tzdata2010k/australasia b/tools/zoneinfo/tzdata2010k/australasia
new file mode 100644
index 0000000..36a81b0
--- /dev/null
+++ b/tools/zoneinfo/tzdata2010k/australasia
@@ -0,0 +1,1539 @@
+# <pre>
+# @(#)australasia	8.18
+# This file is in the public domain, so clarified as of
+# 2009-05-17 by Arthur David Olson.
+
+# This file also includes Pacific islands.
+
+# Notes are at the end of this file
+
+###############################################################################
+
+# Australia
+
+# Please see the notes below for the controversy about "EST" versus "AEST" etc.
+
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Aus	1917	only	-	Jan	 1	0:01	1:00	-
+Rule	Aus	1917	only	-	Mar	25	2:00	0	-
+Rule	Aus	1942	only	-	Jan	 1	2:00	1:00	-
+Rule	Aus	1942	only	-	Mar	29	2:00	0	-
+Rule	Aus	1942	only	-	Sep	27	2:00	1:00	-
+Rule	Aus	1943	1944	-	Mar	lastSun	2:00	0	-
+Rule	Aus	1943	only	-	Oct	 3	2:00	1:00	-
+# Go with Whitman and the Australian National Standards Commission, which
+# says W Australia didn't use DST in 1943/1944.  Ignore Whitman's claim that
+# 1944/1945 was just like 1943/1944.
+
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+# Northern Territory
+Zone Australia/Darwin	 8:43:20 -	LMT	1895 Feb
+			 9:00	-	CST	1899 May
+			 9:30	Aus	CST
+# Western Australia
+#
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	AW	1974	only	-	Oct	lastSun	2:00s	1:00	-
+Rule	AW	1975	only	-	Mar	Sun>=1	2:00s	0	-
+Rule	AW	1983	only	-	Oct	lastSun	2:00s	1:00	-
+Rule	AW	1984	only	-	Mar	Sun>=1	2:00s	0	-
+Rule	AW	1991	only	-	Nov	17	2:00s	1:00	-
+Rule	AW	1992	only	-	Mar	Sun>=1	2:00s	0	-
+Rule	AW	2006	only	-	Dec	 3	2:00s	1:00	-
+Rule	AW	2007	2009	-	Mar	lastSun	2:00s	0	-
+Rule	AW	2007	2008	-	Oct	lastSun	2:00s	1:00	-
+Zone Australia/Perth	 7:43:24 -	LMT	1895 Dec
+			 8:00	Aus	WST	1943 Jul
+			 8:00	AW	WST
+Zone Australia/Eucla	 8:35:28 -	LMT	1895 Dec
+			 8:45	Aus	CWST	1943 Jul
+			 8:45	AW	CWST
+
+# Queensland
+#
+# From Alex Livingston (1996-11-01):
+# I have heard or read more than once that some resort islands off the coast
+# of Queensland chose to keep observing daylight-saving time even after
+# Queensland ceased to.
+#
+# From Paul Eggert (1996-11-22):
+# IATA SSIM (1993-02/1994-09) say that the Holiday Islands (Hayman, Lindeman,
+# Hamilton) observed DST for two years after the rest of Queensland stopped.
+# Hamilton is the largest, but there is also a Hamilton in Victoria,
+# so use Lindeman.
+#
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	AQ	1971	only	-	Oct	lastSun	2:00s	1:00	-
+Rule	AQ	1972	only	-	Feb	lastSun	2:00s	0	-
+Rule	AQ	1989	1991	-	Oct	lastSun	2:00s	1:00	-
+Rule	AQ	1990	1992	-	Mar	Sun>=1	2:00s	0	-
+Rule	Holiday	1992	1993	-	Oct	lastSun	2:00s	1:00	-
+Rule	Holiday	1993	1994	-	Mar	Sun>=1	2:00s	0	-
+Zone Australia/Brisbane	10:12:08 -	LMT	1895
+			10:00	Aus	EST	1971
+			10:00	AQ	EST
+Zone Australia/Lindeman  9:55:56 -	LMT	1895
+			10:00	Aus	EST	1971
+			10:00	AQ	EST	1992 Jul
+			10:00	Holiday	EST
+
+# South Australia
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	AS	1971	1985	-	Oct	lastSun	2:00s	1:00	-
+Rule	AS	1986	only	-	Oct	19	2:00s	1:00	-
+Rule	AS	1987	2007	-	Oct	lastSun	2:00s	1:00	-
+Rule	AS	1972	only	-	Feb	27	2:00s	0	-
+Rule	AS	1973	1985	-	Mar	Sun>=1	2:00s	0	-
+Rule	AS	1986	1989	-	Mar	Sun>=15	2:00s	0	-
+Rule	AS	1990	only	-	Mar	Sun>=18	2:00s	0	-
+Rule	AS	1991	only	-	Mar	Sun>=1	2:00s	0	-
+Rule	AS	1992	only	-	Mar	Sun>=18	2:00s	0	-
+Rule	AS	1993	only	-	Mar	Sun>=1	2:00s	0	-
+Rule	AS	1994	only	-	Mar	Sun>=18	2:00s	0	-
+Rule	AS	1995	2005	-	Mar	lastSun	2:00s	0	-
+Rule	AS	2006	only	-	Apr	Sun>=1	2:00s	0	-
+Rule	AS	2007	only	-	Mar	lastSun	2:00s	0	-
+Rule	AS	2008	max	-	Apr	Sun>=1	2:00s	0	-
+Rule	AS	2008	max	-	Oct	Sun>=1	2:00s	1:00	-
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone Australia/Adelaide	9:14:20 -	LMT	1895 Feb
+			9:00	-	CST	1899 May
+			9:30	Aus	CST	1971
+			9:30	AS	CST
+
+# Tasmania
+#
+# From Paul Eggert (2005-08-16):
+# <http://www.bom.gov.au/climate/averages/tables/dst_times.shtml>
+# says King Island didn't observe DST from WWII until late 1971.
+#
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	AT	1967	only	-	Oct	Sun>=1	2:00s	1:00	-
+Rule	AT	1968	only	-	Mar	lastSun	2:00s	0	-
+Rule	AT	1968	1985	-	Oct	lastSun	2:00s	1:00	-
+Rule	AT	1969	1971	-	Mar	Sun>=8	2:00s	0	-
+Rule	AT	1972	only	-	Feb	lastSun	2:00s	0	-
+Rule	AT	1973	1981	-	Mar	Sun>=1	2:00s	0	-
+Rule	AT	1982	1983	-	Mar	lastSun	2:00s	0	-
+Rule	AT	1984	1986	-	Mar	Sun>=1	2:00s	0	-
+Rule	AT	1986	only	-	Oct	Sun>=15	2:00s	1:00	-
+Rule	AT	1987	1990	-	Mar	Sun>=15	2:00s	0	-
+Rule	AT	1987	only	-	Oct	Sun>=22	2:00s	1:00	-
+Rule	AT	1988	1990	-	Oct	lastSun	2:00s	1:00	-
+Rule	AT	1991	1999	-	Oct	Sun>=1	2:00s	1:00	-
+Rule	AT	1991	2005	-	Mar	lastSun	2:00s	0	-
+Rule	AT	2000	only	-	Aug	lastSun	2:00s	1:00	-
+Rule	AT	2001	max	-	Oct	Sun>=1	2:00s	1:00	-
+Rule	AT	2006	only	-	Apr	Sun>=1	2:00s	0	-
+Rule	AT	2007	only	-	Mar	lastSun	2:00s	0	-
+Rule	AT	2008	max	-	Apr	Sun>=1	2:00s	0	-
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone Australia/Hobart	9:49:16	-	LMT	1895 Sep
+			10:00	-	EST	1916 Oct 1 2:00
+			10:00	1:00	EST	1917 Feb
+			10:00	Aus	EST	1967
+			10:00	AT	EST
+Zone Australia/Currie	9:35:28	-	LMT	1895 Sep
+			10:00	-	EST	1916 Oct 1 2:00
+			10:00	1:00	EST	1917 Feb
+			10:00	Aus	EST	1971 Jul
+			10:00	AT	EST
+
+# Victoria
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	AV	1971	1985	-	Oct	lastSun	2:00s	1:00	-
+Rule	AV	1972	only	-	Feb	lastSun	2:00s	0	-
+Rule	AV	1973	1985	-	Mar	Sun>=1	2:00s	0	-
+Rule	AV	1986	1990	-	Mar	Sun>=15	2:00s	0	-
+Rule	AV	1986	1987	-	Oct	Sun>=15	2:00s	1:00	-
+Rule	AV	1988	1999	-	Oct	lastSun	2:00s	1:00	-
+Rule	AV	1991	1994	-	Mar	Sun>=1	2:00s	0	-
+Rule	AV	1995	2005	-	Mar	lastSun	2:00s	0	-
+Rule	AV	2000	only	-	Aug	lastSun	2:00s	1:00	-
+Rule	AV	2001	2007	-	Oct	lastSun	2:00s	1:00	-
+Rule	AV	2006	only	-	Apr	Sun>=1	2:00s	0	-
+Rule	AV	2007	only	-	Mar	lastSun	2:00s	0	-
+Rule	AV	2008	max	-	Apr	Sun>=1	2:00s	0	-
+Rule	AV	2008	max	-	Oct	Sun>=1	2:00s	1:00	-
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone Australia/Melbourne 9:39:52 -	LMT	1895 Feb
+			10:00	Aus	EST	1971
+			10:00	AV	EST
+
+# New South Wales
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	AN	1971	1985	-	Oct	lastSun	2:00s	1:00	-
+Rule	AN	1972	only	-	Feb	27	2:00s	0	-
+Rule	AN	1973	1981	-	Mar	Sun>=1	2:00s	0	-
+Rule	AN	1982	only	-	Apr	Sun>=1	2:00s	0	-
+Rule	AN	1983	1985	-	Mar	Sun>=1	2:00s	0	-
+Rule	AN	1986	1989	-	Mar	Sun>=15	2:00s	0	-
+Rule	AN	1986	only	-	Oct	19	2:00s	1:00	-
+Rule	AN	1987	1999	-	Oct	lastSun	2:00s	1:00	-
+Rule	AN	1990	1995	-	Mar	Sun>=1	2:00s	0	-
+Rule	AN	1996	2005	-	Mar	lastSun	2:00s	0	-
+Rule	AN	2000	only	-	Aug	lastSun	2:00s	1:00	-
+Rule	AN	2001	2007	-	Oct	lastSun	2:00s	1:00	-
+Rule	AN	2006	only	-	Apr	Sun>=1	2:00s	0	-
+Rule	AN	2007	only	-	Mar	lastSun	2:00s	0	-
+Rule	AN	2008	max	-	Apr	Sun>=1	2:00s	0	-
+Rule	AN	2008	max	-	Oct	Sun>=1	2:00s	1:00	-
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone Australia/Sydney	10:04:52 -	LMT	1895 Feb
+			10:00	Aus	EST	1971
+			10:00	AN	EST
+Zone Australia/Broken_Hill 9:25:48 -	LMT	1895 Feb
+			10:00	-	EST	1896 Aug 23
+			9:00	-	CST	1899 May
+			9:30	Aus	CST	1971
+			9:30	AN	CST	2000
+			9:30	AS	CST
+
+# Lord Howe Island
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	LH	1981	1984	-	Oct	lastSun	2:00	1:00	-
+Rule	LH	1982	1985	-	Mar	Sun>=1	2:00	0	-
+Rule	LH	1985	only	-	Oct	lastSun	2:00	0:30	-
+Rule	LH	1986	1989	-	Mar	Sun>=15	2:00	0	-
+Rule	LH	1986	only	-	Oct	19	2:00	0:30	-
+Rule	LH	1987	1999	-	Oct	lastSun	2:00	0:30	-
+Rule	LH	1990	1995	-	Mar	Sun>=1	2:00	0	-
+Rule	LH	1996	2005	-	Mar	lastSun	2:00	0	-
+Rule	LH	2000	only	-	Aug	lastSun	2:00	0:30	-
+Rule	LH	2001	2007	-	Oct	lastSun	2:00	0:30	-
+Rule	LH	2006	only	-	Apr	Sun>=1	2:00	0	-
+Rule	LH	2007	only	-	Mar	lastSun	2:00	0	-
+Rule	LH	2008	max	-	Apr	Sun>=1	2:00	0	-
+Rule	LH	2008	max	-	Oct	Sun>=1	2:00	0:30	-
+Zone Australia/Lord_Howe 10:36:20 -	LMT	1895 Feb
+			10:00	-	EST	1981 Mar
+			10:30	LH	LHST
+
+# Australian miscellany
+#
+# Ashmore Is, Cartier
+# no indigenous inhabitants; only seasonal caretakers
+# no times are set
+#
+# Coral Sea Is
+# no indigenous inhabitants; only meteorologists
+# no times are set
+#
+# Macquarie
+# permanent occupation (scientific station) since 1948;
+# sealing and penguin oil station operated 1888/1917
+# like Australia/Hobart
+
+# Christmas
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone Indian/Christmas	7:02:52 -	LMT	1895 Feb
+			7:00	-	CXT	# Christmas Island Time
+
+# Cook Is
+# From Shanks & Pottenger:
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Cook	1978	only	-	Nov	12	0:00	0:30	HS
+Rule	Cook	1979	1991	-	Mar	Sun>=1	0:00	0	-
+Rule	Cook	1979	1990	-	Oct	lastSun	0:00	0:30	HS
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone Pacific/Rarotonga	-10:39:04 -	LMT	1901		# Avarua
+			-10:30	-	CKT	1978 Nov 12	# Cook Is Time
+			-10:00	Cook	CK%sT
+
+# Cocos
+# These islands were ruled by the Ross family from about 1830 to 1978.
+# We don't know when standard time was introduced; for now, we guess 1900.
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Indian/Cocos	6:27:40	-	LMT	1900
+			6:30	-	CCT	# Cocos Islands Time
+
+# Fiji
+# From Alexander Krivenyshev (2009-11-10):
+# According to Fiji Broadcasting Corporation,  Fiji plans to re-introduce DST
+# from November 29th 2009  to April 25th 2010.
+#
+# "Daylight savings to commence this month"
+# <a href="http://www.radiofiji.com.fj/fullstory.php?id=23719">
+# http://www.radiofiji.com.fj/fullstory.php?id=23719
+# </a>
+# or
+# <a href="http://www.worldtimezone.com/dst_news/dst_news_fiji01.html">
+# http://www.worldtimezone.com/dst_news/dst_news_fiji01.html
+# </a>
+
+# From Steffen Thorsen (2009-11-10):
+# The Fiji Government has posted some more details about the approved
+# amendments:
+# <a href="http://www.fiji.gov.fj/publish/page_16198.shtml">
+# http://www.fiji.gov.fj/publish/page_16198.shtml
+# </a>
+
+# From Steffen Thorsen (2010-03-03):
+# The Cabinet in Fiji has decided to end DST about a month early, on
+# 2010-03-28 at 03:00.
+# The plan is to observe DST again, from 2010-10-24 to sometime in March
+# 2011 (last Sunday a good guess?).
+#
+# Official source:
+# <a href="http://www.fiji.gov.fj/index.php?option=com_content&view=article&id=1096:3310-cabinet-approves-change-in-daylight-savings-dates&catid=49:cabinet-releases&Itemid=166">
+# http://www.fiji.gov.fj/index.php?option=com_content&view=article&id=1096:3310-cabinet-approves-change-in-daylight-savings-dates&catid=49:cabinet-releases&Itemid=166
+# </a>
+#
+# A bit more background info here:
+# <a href="http://www.timeanddate.com/news/time/fiji-dst-ends-march-2010.html">
+# http://www.timeanddate.com/news/time/fiji-dst-ends-march-2010.html
+# </a>
+
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Fiji	1998	1999	-	Nov	Sun>=1	2:00	1:00	S
+Rule	Fiji	1999	2000	-	Feb	lastSun	3:00	0	-
+Rule	Fiji	2009	only	-	Nov	29	2:00	1:00	S
+Rule	Fiji	2010	only	-	Mar	lastSun	3:00	0	-
+Rule	Fiji	2010	only	-	Oct	24	2:00	1:00	S
+Rule	Fiji	2011	only	-	Mar	lastSun 3:00	0	-
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Pacific/Fiji	11:53:40 -	LMT	1915 Oct 26	# Suva
+			12:00	Fiji	FJ%sT	# Fiji Time
+
+# French Polynesia
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Pacific/Gambier	 -8:59:48 -	LMT	1912 Oct	# Rikitea
+			 -9:00	-	GAMT	# Gambier Time
+Zone	Pacific/Marquesas -9:18:00 -	LMT	1912 Oct
+			 -9:30	-	MART	# Marquesas Time
+Zone	Pacific/Tahiti	 -9:58:16 -	LMT	1912 Oct	# Papeete
+			-10:00	-	TAHT	# Tahiti Time
+# Clipperton (near North America) is administered from French Polynesia;
+# it is uninhabited.
+
+# Guam
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Pacific/Guam	-14:21:00 -	LMT	1844 Dec 31
+			 9:39:00 -	LMT	1901		# Agana
+			10:00	-	GST	2000 Dec 23	# Guam
+			10:00	-	ChST	# Chamorro Standard Time
+
+# Kiribati
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone Pacific/Tarawa	 11:32:04 -	LMT	1901		# Bairiki
+			 12:00	-	GILT		 # Gilbert Is Time
+Zone Pacific/Enderbury	-11:24:20 -	LMT	1901
+			-12:00	-	PHOT	1979 Oct # Phoenix Is Time
+			-11:00	-	PHOT	1995
+			 13:00	-	PHOT
+Zone Pacific/Kiritimati	-10:29:20 -	LMT	1901
+			-10:40	-	LINT	1979 Oct # Line Is Time
+			-10:00	-	LINT	1995
+			 14:00	-	LINT
+
+# N Mariana Is
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone Pacific/Saipan	-14:17:00 -	LMT	1844 Dec 31
+			 9:43:00 -	LMT	1901
+			 9:00	-	MPT	1969 Oct # N Mariana Is Time
+			10:00	-	MPT	2000 Dec 23
+			10:00	-	ChST	# Chamorro Standard Time
+
+# Marshall Is
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone Pacific/Majuro	11:24:48 -	LMT	1901
+			11:00	-	MHT	1969 Oct # Marshall Islands Time
+			12:00	-	MHT
+Zone Pacific/Kwajalein	11:09:20 -	LMT	1901
+			11:00	-	MHT	1969 Oct
+			-12:00	-	KWAT	1993 Aug 20	# Kwajalein Time
+			12:00	-	MHT
+
+# Micronesia
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone Pacific/Chuuk	10:07:08 -	LMT	1901
+			10:00	-	CHUT			# Chuuk Time
+Zone Pacific/Pohnpei	10:32:52 -	LMT	1901		# Kolonia
+			11:00	-	PONT			# Pohnpei Time
+Zone Pacific/Kosrae	10:51:56 -	LMT	1901
+			11:00	-	KOST	1969 Oct	# Kosrae Time
+			12:00	-	KOST	1999
+			11:00	-	KOST
+
+# Nauru
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Pacific/Nauru	11:07:40 -	LMT	1921 Jan 15	# Uaobe
+			11:30	-	NRT	1942 Mar 15	# Nauru Time
+			9:00	-	JST	1944 Aug 15
+			11:30	-	NRT	1979 May
+			12:00	-	NRT
+
+# New Caledonia
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	NC	1977	1978	-	Dec	Sun>=1	0:00	1:00	S
+Rule	NC	1978	1979	-	Feb	27	0:00	0	-
+Rule	NC	1996	only	-	Dec	 1	2:00s	1:00	S
+# Shanks & Pottenger say the following was at 2:00; go with IATA.
+Rule	NC	1997	only	-	Mar	 2	2:00s	0	-
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Pacific/Noumea	11:05:48 -	LMT	1912 Jan 13
+			11:00	NC	NC%sT
+
+
+###############################################################################
+
+# New Zealand
+
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	NZ	1927	only	-	Nov	 6	2:00	1:00	S
+Rule	NZ	1928	only	-	Mar	 4	2:00	0	M
+Rule	NZ	1928	1933	-	Oct	Sun>=8	2:00	0:30	S
+Rule	NZ	1929	1933	-	Mar	Sun>=15	2:00	0	M
+Rule	NZ	1934	1940	-	Apr	lastSun	2:00	0	M
+Rule	NZ	1934	1940	-	Sep	lastSun	2:00	0:30	S
+Rule	NZ	1946	only	-	Jan	 1	0:00	0	S
+# Since 1957 Chatham has been 45 minutes ahead of NZ, but there's no
+# convenient notation for this so we must duplicate the Rule lines.
+Rule	NZ	1974	only	-	Nov	Sun>=1	2:00s	1:00	D
+Rule	Chatham	1974	only	-	Nov	Sun>=1	2:45s	1:00	D
+Rule	NZ	1975	only	-	Feb	lastSun	2:00s	0	S
+Rule	Chatham	1975	only	-	Feb	lastSun	2:45s	0	S
+Rule	NZ	1975	1988	-	Oct	lastSun	2:00s	1:00	D
+Rule	Chatham	1975	1988	-	Oct	lastSun	2:45s	1:00	D
+Rule	NZ	1976	1989	-	Mar	Sun>=1	2:00s	0	S
+Rule	Chatham	1976	1989	-	Mar	Sun>=1	2:45s	0	S
+Rule	NZ	1989	only	-	Oct	Sun>=8	2:00s	1:00	D
+Rule	Chatham	1989	only	-	Oct	Sun>=8	2:45s	1:00	D
+Rule	NZ	1990	2006	-	Oct	Sun>=1	2:00s	1:00	D
+Rule	Chatham	1990	2006	-	Oct	Sun>=1	2:45s	1:00	D
+Rule	NZ	1990	2007	-	Mar	Sun>=15	2:00s	0	S
+Rule	Chatham	1990	2007	-	Mar	Sun>=15	2:45s	0	S
+Rule	NZ	2007	max	-	Sep	lastSun	2:00s	1:00	D
+Rule	Chatham	2007	max	-	Sep	lastSun	2:45s	1:00	D
+Rule	NZ	2008	max	-	Apr	Sun>=1	2:00s	0	S
+Rule	Chatham	2008	max	-	Apr	Sun>=1	2:45s	0	S
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone Pacific/Auckland	11:39:04 -	LMT	1868 Nov  2
+			11:30	NZ	NZ%sT	1946 Jan  1
+			12:00	NZ	NZ%sT
+Zone Pacific/Chatham	12:13:48 -	LMT	1957 Jan  1
+			12:45	Chatham	CHA%sT
+
+
+# Auckland Is
+# uninhabited; Maori and Moriori, colonial settlers, pastoralists, sealers,
+# and scientific personnel have wintered
+
+# Campbell I
+# minor whaling stations operated 1909/1914
+# scientific station operated 1941/1995;
+# previously whalers, sealers, pastoralists, and scientific personnel wintered
+# was probably like Pacific/Auckland
+
+###############################################################################
+
+
+# Niue
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Pacific/Niue	-11:19:40 -	LMT	1901		# Alofi
+			-11:20	-	NUT	1951	# Niue Time
+			-11:30	-	NUT	1978 Oct 1
+			-11:00	-	NUT
+
+# Norfolk
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Pacific/Norfolk	11:11:52 -	LMT	1901		# Kingston
+			11:12	-	NMT	1951	# Norfolk Mean Time
+			11:30	-	NFT		# Norfolk Time
+
+# Palau (Belau)
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone Pacific/Palau	8:57:56 -	LMT	1901		# Koror
+			9:00	-	PWT	# Palau Time
+
+# Papua New Guinea
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone Pacific/Port_Moresby 9:48:40 -	LMT	1880
+			9:48:32	-	PMMT	1895	# Port Moresby Mean Time
+			10:00	-	PGT		# Papua New Guinea Time
+
+# Pitcairn
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone Pacific/Pitcairn	-8:40:20 -	LMT	1901		# Adamstown
+			-8:30	-	PNT	1998 Apr 27 00:00
+			-8:00	-	PST	# Pitcairn Standard Time
+
+# American Samoa
+Zone Pacific/Pago_Pago	 12:37:12 -	LMT	1879 Jul  5
+			-11:22:48 -	LMT	1911
+			-11:30	-	SAMT	1950		# Samoa Time
+			-11:00	-	NST	1967 Apr	# N=Nome
+			-11:00	-	BST	1983 Nov 30	# B=Bering
+			-11:00	-	SST			# S=Samoa
+
+# Samoa
+
+# From Steffen Thorsen (2009-10-16):
+# We have been in contact with the government of Samoa again, and received
+# the following info:
+#
+# "Cabinet has now approved Daylight Saving to be effected next year
+# commencing from the last Sunday of September 2010 and conclude first
+# Sunday of April 2011."
+#
+# Background info:
+# <a href="http://www.timeanddate.com/news/time/samoa-dst-plan-2009.html">
+# http://www.timeanddate.com/news/time/samoa-dst-plan-2009.html
+# </a>
+#
+# Samoa's Daylight Saving Time Act 2009 is available here, but does not
+# contain any dates:
+# <a href="http://www.parliament.gov.ws/documents/acts/Daylight%20Saving%20Act%20%202009%20%28English%29%20-%20Final%207-7-091.pdf">
+# http://www.parliament.gov.ws/documents/acts/Daylight%20Saving%20Act%20%202009%20%28English%29%20-%20Final%207-7-091.pdf
+# </a>
+
+Zone Pacific/Apia	 12:33:04 -	LMT	1879 Jul  5
+			-11:26:56 -	LMT	1911
+			-11:30	-	SAMT	1950		# Samoa Time
+			-11:00	-	WST	2010 Sep 26
+			-11:00	1:00	WSDT	2011 Apr 3
+			-11:00	-	WST
+
+# Solomon Is
+# excludes Bougainville, for which see Papua New Guinea
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone Pacific/Guadalcanal 10:39:48 -	LMT	1912 Oct	# Honiara
+			11:00	-	SBT	# Solomon Is Time
+
+# Tokelau Is
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Pacific/Fakaofo	-11:24:56 -	LMT	1901
+			-10:00	-	TKT	# Tokelau Time
+
+# Tonga
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Tonga	1999	only	-	Oct	 7	2:00s	1:00	S
+Rule	Tonga	2000	only	-	Mar	19	2:00s	0	-
+Rule	Tonga	2000	2001	-	Nov	Sun>=1	2:00	1:00	S
+Rule	Tonga	2001	2002	-	Jan	lastSun	2:00	0	-
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone Pacific/Tongatapu	12:19:20 -	LMT	1901
+			12:20	-	TOT	1941 # Tonga Time
+			13:00	-	TOT	1999
+			13:00	Tonga	TO%sT
+
+# Tuvalu
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone Pacific/Funafuti	11:56:52 -	LMT	1901
+			12:00	-	TVT	# Tuvalu Time
+
+
+# US minor outlying islands
+
+# Howland, Baker
+# Howland was mined for guano by American companies 1857-1878 and British
+# 1886-1891; Baker was similar but exact dates are not known.
+# Inhabited by civilians 1935-1942; U.S. military bases 1943-1944;
+# uninhabited thereafter.
+# Howland observed Hawaii Standard Time (UTC-10:30) in 1937;
+# see page 206 of Elgen M. Long and Marie K. Long,
+# Amelia Earhart: the Mystery Solved, Simon & Schuster (2000).
+# So most likely Howland and Baker observed Hawaii Time from 1935
+# until they were abandoned after the war.
+
+# Jarvis
+# Mined for guano by American companies 1857-1879 and British 1883?-1891?.
+# Inhabited by civilians 1935-1942; IGY scientific base 1957-1958;
+# uninhabited thereafter.
+# no information; was probably like Pacific/Kiritimati
+
+# Johnston
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone Pacific/Johnston	-10:00	-	HST
+
+# Kingman
+# uninhabited
+
+# Midway
+#
+# From Mark Brader (2005-01-23):
+# [Fallacies and Fantasies of Air Transport History, by R.E.G. Davies,
+# published 1994 by Paladwr Press, McLean, VA, USA; ISBN 0-9626483-5-3]
+# reproduced a Pan American Airways timeables from 1936, for their weekly
+# "Orient Express" flights between San Francisco and Manila, and connecting
+# flights to Chicago and the US East Coast.  As it uses some time zone
+# designations that I've never seen before:....
+# Fri. 6:30A Lv. HONOLOLU (Pearl Harbor), H.I.   H.L.T. Ar. 5:30P Sun.
+#  "   3:00P Ar. MIDWAY ISLAND . . . . . . . . . M.L.T. Lv. 6:00A  "
+#
+Zone Pacific/Midway	-11:49:28 -	LMT	1901
+			-11:00	-	NST	1956 Jun  3
+			-11:00	1:00	NDT	1956 Sep  2
+			-11:00	-	NST	1967 Apr	# N=Nome
+			-11:00	-	BST	1983 Nov 30	# B=Bering
+			-11:00	-	SST			# S=Samoa
+
+# Palmyra
+# uninhabited since World War II; was probably like Pacific/Kiritimati
+
+# Wake
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Pacific/Wake	11:06:28 -	LMT	1901
+			12:00	-	WAKT	# Wake Time
+
+
+# Vanuatu
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Vanuatu	1983	only	-	Sep	25	0:00	1:00	S
+Rule	Vanuatu	1984	1991	-	Mar	Sun>=23	0:00	0	-
+Rule	Vanuatu	1984	only	-	Oct	23	0:00	1:00	S
+Rule	Vanuatu	1985	1991	-	Sep	Sun>=23	0:00	1:00	S
+Rule	Vanuatu	1992	1993	-	Jan	Sun>=23	0:00	0	-
+Rule	Vanuatu	1992	only	-	Oct	Sun>=23	0:00	1:00	S
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Pacific/Efate	11:13:16 -	LMT	1912 Jan 13		# Vila
+			11:00	Vanuatu	VU%sT	# Vanuatu Time
+
+# Wallis and Futuna
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Pacific/Wallis	12:15:20 -	LMT	1901
+			12:00	-	WFT	# Wallis & Futuna Time
+
+###############################################################################
+
+# NOTES
+
+# This data is by no means authoritative; if you think you know better,
+# go ahead and edit the file (and please send any changes to
+# tz@elsie.nci.nih.gov for general use in the future).
+
+# From Paul Eggert (2006-03-22):
+# A good source for time zone historical data outside the U.S. is
+# Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
+# San Diego: ACS Publications, Inc. (2003).
+#
+# Gwillim Law writes that a good source
+# for recent time zone data is the International Air Transport
+# Association's Standard Schedules Information Manual (IATA SSIM),
+# published semiannually.  Law sent in several helpful summaries
+# of the IATA's data after 1990.
+#
+# Except where otherwise noted, Shanks & Pottenger is the source for
+# entries through 1990, and IATA SSIM is the source for entries afterwards.
+#
+# Another source occasionally used is Edward W. Whitman, World Time Differences,
+# Whitman Publishing Co, 2 Niagara Av, Ealing, London (undated), which
+# I found in the UCLA library.
+#
+# A reliable and entertaining source about time zones is
+# Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997).
+#
+# I invented the abbreviations marked `*' in the following table;
+# the rest are from earlier versions of this file, or from other sources.
+# Corrections are welcome!
+#		std dst
+#		LMT	Local Mean Time
+#	  8:00	WST WST	Western Australia
+#	  8:45	CWST CWST Central Western Australia*
+#	  9:00	JST	Japan
+#	  9:30	CST CST	Central Australia
+#	 10:00	EST EST	Eastern Australia
+#	 10:00	ChST	Chamorro
+#	 10:30	LHST LHST Lord Howe*
+#	 11:30	NZMT NZST New Zealand through 1945
+#	 12:00	NZST NZDT New Zealand 1946-present
+#	 12:45	CHAST CHADT Chatham*
+#	-11:00	SST	Samoa
+#	-10:00	HST	Hawaii
+#	- 8:00	PST	Pitcairn*
+#
+# See the `northamerica' file for Hawaii.
+# See the `southamerica' file for Easter I and the Galapagos Is.
+
+###############################################################################
+
+# Australia
+
+# From Paul Eggert (2005-12-08):
+# <a href="http://www.bom.gov.au/climate/averages/tables/dst_times.shtml">
+# Implementation Dates of Daylight Saving Time within Australia
+# </a> summarizes daylight saving issues in Australia.
+
+# From Arthur David Olson (2005-12-12):
+# <a href="http://www.lawlink.nsw.gov.au/lawlink/Corporate/ll_agdinfo.nsf/pages/community_relations_daylight_saving">
+# Lawlink NSW:Daylight Saving in New South Wales
+# </a> covers New South Wales in particular.
+
+# From John Mackin (1991-03-06):
+# We in Australia have _never_ referred to DST as `daylight' time.
+# It is called `summer' time.  Now by a happy coincidence, `summer'
+# and `standard' happen to start with the same letter; hence, the
+# abbreviation does _not_ change...
+# The legislation does not actually define abbreviations, at least
+# in this State, but the abbreviation is just commonly taken to be the
+# initials of the phrase, and the legislation here uniformly uses
+# the phrase `summer time' and does not use the phrase `daylight
+# time'.
+# Announcers on the Commonwealth radio network, the ABC (for Australian
+# Broadcasting Commission), use the phrases `Eastern Standard Time'
+# or `Eastern Summer Time'.  (Note, though, that as I say in the
+# current australasia file, there is really no such thing.)  Announcers
+# on its overseas service, Radio Australia, use the same phrases
+# prefixed by the word `Australian' when referring to local times;
+# time announcements on that service, naturally enough, are made in UTC.
+
+# From Arthur David Olson (1992-03-08):
+# Given the above, what's chosen for year-round use is:
+#	CST	for any place operating at a GMTOFF of 9:30
+#	WST	for any place operating at a GMTOFF of 8:00
+#	EST	for any place operating at a GMTOFF of 10:00
+
+# From Chuck Soper (2006-06-01):
+# I recently found this Australian government web page on time zones:
+# <http://www.australia.gov.au/about-australia-13time>
+# And this government web page lists time zone names and abbreviations:
+# <http://www.bom.gov.au/climate/averages/tables/daysavtm.shtml>
+
+# From Paul Eggert (2001-04-05), summarizing a long discussion about "EST"
+# versus "AEST" etc.:
+#
+# I see the following points of dispute:
+#
+# * How important are unique time zone abbreviations?
+#
+#   Here I tend to agree with the point (most recently made by Chris
+#   Newman) that unique abbreviations should not be essential for proper
+#   operation of software.  We have other instances of ambiguity
+#   (e.g. "IST" denoting both "Israel Standard Time" and "Indian
+#   Standard Time"), and they are not likely to go away any time soon.
+#   In the old days, some software mistakenly relied on unique
+#   abbreviations, but this is becoming less true with time, and I don't
+#   think it's that important to cater to such software these days.
+#
+#   On the other hand, there is another motivation for unambiguous
+#   abbreviations: it cuts down on human confusion.  This is
+#   particularly true for Australia, where "EST" can mean one thing for
+#   time T and a different thing for time T plus 1 second.
+#
+# * Does the relevant legislation indicate which abbreviations should be used?
+#
+#   Here I tend to think that things are a mess, just as they are in
+#   many other countries.  We Americans are currently disagreeing about
+#   which abbreviation to use for the newly legislated Chamorro Standard
+#   Time, for example.
+#
+#   Personally, I would prefer to use common practice; I would like to
+#   refer to legislation only for examples of common practice, or as a
+#   tiebreaker.
+#
+# * Do Australians more often use "Eastern Daylight Time" or "Eastern
+#   Summer Time"?  Do they typically prefix the time zone names with
+#   the word "Australian"?
+#
+#   My own impression is that both "Daylight Time" and "Summer Time" are
+#   common and are widely understood, but that "Summer Time" is more
+#   popular; and that the leading "A" is also common but is omitted more
+#   often than not.  I just used AltaVista advanced search and got the
+#   following count of page hits:
+#
+#     1,103 "Eastern Summer Time" AND domain:au
+#       971 "Australian Eastern Summer Time" AND domain:au
+#       613 "Eastern Daylight Time" AND domain:au
+#       127 "Australian Eastern Daylight Time" AND domain:au
+#
+#   Here "Summer" seems quite a bit more popular than "Daylight",
+#   particularly when we know the time zone is Australian and not US,
+#   say.  The "Australian" prefix seems to be popular for Eastern Summer
+#   Time, but unpopular for Eastern Daylight Time.
+#
+#   For abbreviations, tools like AltaVista are less useful because of
+#   ambiguity.  Many hits are not really time zones, unfortunately, and
+#   many hits denote US time zones and not Australian ones.  But here
+#   are the hit counts anyway:
+#
+#     161,304 "EST" and domain:au
+#      25,156 "EDT" and domain:au
+#      18,263 "AEST" and domain:au
+#      10,416 "AEDT" and domain:au
+#
+#      14,538 "CST" and domain:au
+#       5,728 "CDT" and domain:au
+#         176 "ACST" and domain:au
+#          29 "ACDT" and domain:au
+#
+#       7,539 "WST" and domain:au
+#          68 "AWST" and domain:au
+#
+#   This data suggest that Australians tend to omit the "A" prefix in
+#   practice.  The situation for "ST" versus "DT" is less clear, given
+#   the ambiguities involved.
+#
+# * How do Australians feel about the abbreviations in the tz database?
+#
+#   If you just count Australians on this list, I count 2 in favor and 3
+#   against.  One of the "against" votes (David Keegel) counseled delay,
+#   saying that both AEST/AEDT and EST/EST are widely used and
+#   understood in Australia.
+
+# From Paul Eggert (1995-12-19):
+# Shanks & Pottenger report 2:00 for all autumn changes in Australia and NZ.
+# Mark Prior writes that his newspaper
+# reports that NSW's fall 1995 change will occur at 2:00,
+# but Robert Elz says it's been 3:00 in Victoria since 1970
+# and perhaps the newspaper's `2:00' is referring to standard time.
+# For now we'll continue to assume 2:00s for changes since 1960.
+
+# From Eric Ulevik (1998-01-05):
+#
+# Here are some URLs to Australian time legislation. These URLs are stable,
+# and should probably be included in the data file. There are probably more
+# relevant entries in this database.
+#
+# NSW (including LHI and Broken Hill):
+# <a href="http://www.austlii.edu.au/au/legis/nsw/consol_act/sta1987137/index.html">
+# Standard Time Act 1987 (updated 1995-04-04)
+# </a>
+# ACT
+# <a href="http://www.austlii.edu.au/au/legis/act/consol_act/stasta1972279/index.html">
+# Standard Time and Summer Time Act 1972
+# </a>
+# SA
+# <a href="http://www.austlii.edu.au/au/legis/sa/consol_act/sta1898137/index.html">
+# Standard Time Act, 1898
+# </a>
+
+# From David Grosz (2005-06-13):
+# It was announced last week that Daylight Saving would be extended by
+# one week next year to allow for the 2006 Commonwealth Games.
+# Daylight Saving is now to end for next year only on the first Sunday
+# in April instead of the last Sunday in March.
+#
+# From Gwillim Law (2005-06-14):
+# I did some Googling and found that all of those states (and territory) plan
+# to extend DST together in 2006.
+# ACT: http://www.cmd.act.gov.au/mediareleases/fileread.cfm?file=86.txt
+# New South Wales: http://www.thecouriermail.news.com.au/common/story_page/0,5936,15538869%255E1702,00.html
+# South Australia: http://www.news.com.au/story/0,10117,15555031-1246,00.html
+# Tasmania: http://www.media.tas.gov.au/release.php?id=14772
+# Victoria: I wasn't able to find anything separate, but the other articles
+# allude to it.
+# But not Queensland
+# http://www.news.com.au/story/0,10117,15564030-1248,00.html.
+
+# Northern Territory
+
+# From George Shepherd via Simon Woodhead via Robert Elz (1991-03-06):
+# # The NORTHERN TERRITORY..  [ Courtesy N.T. Dept of the Chief Minister ]
+# #					[ Nov 1990 ]
+# #	N.T. have never utilised any DST due to sub-tropical/tropical location.
+# ...
+# Zone        Australia/North         9:30    -       CST
+
+# From Bradley White (1991-03-04):
+# A recent excerpt from an Australian newspaper...
+# the Northern Territory do[es] not have daylight saving.
+
+# Western Australia
+
+# From George Shepherd via Simon Woodhead via Robert Elz (1991-03-06):
+# #  The state of WESTERN AUSTRALIA..  [ Courtesy W.A. dept Premier+Cabinet ]
+# #						[ Nov 1990 ]
+# #	W.A. suffers from a great deal of public and political opposition to
+# #	DST in principle. A bill is brought before parliament in most years, but
+# #	usually defeated either in the upper house, or in party caucus
+# #	before reaching parliament.
+# ...
+# Zone	Australia/West		8:00	AW	%sST
+# ...
+# Rule	AW	1974	only	-	Oct	lastSun	2:00	1:00	D
+# Rule	AW	1975	only	-	Mar	Sun>=1	3:00	0	W
+# Rule	AW	1983	only	-	Oct	lastSun	2:00	1:00	D
+# Rule	AW	1984	only	-	Mar	Sun>=1	3:00	0	W
+
+# From Bradley White (1991-03-04):
+# A recent excerpt from an Australian newspaper...
+# Western Australia...do[es] not have daylight saving.
+
+# From John D. Newman via Bradley White (1991-11-02):
+# Western Australia is still on "winter time". Some DH in Sydney
+# rang me at home a few days ago at 6.00am. (He had just arrived at
+# work at 9.00am.)
+# W.A. is switching to Summer Time on Nov 17th just to confuse
+# everybody again.
+
+# From Arthur David Olson (1992-03-08):
+# The 1992 ending date used in the rules is a best guess;
+# it matches what was used in the past.
+
+# <a href="http://www.bom.gov.au/faq/faqgen.htm">
+# The Australian Bureau of Meteorology FAQ
+# </a> (1999-09-27) writes that Giles Meteorological Station uses
+# South Australian time even though it's located in Western Australia.
+
+# Queensland
+# From George Shepherd via Simon Woodhead via Robert Elz (1991-03-06):
+# #   The state of QUEENSLAND.. [ Courtesy Qld. Dept Premier Econ&Trade Devel ]
+# #						[ Dec 1990 ]
+# ...
+# Zone	Australia/Queensland	10:00	AQ	%sST
+# ...
+# Rule	AQ	1971	only	-	Oct	lastSun	2:00	1:00	D
+# Rule	AQ	1972	only	-	Feb	lastSun	3:00	0	E
+# Rule	AQ	1989	max	-	Oct	lastSun	2:00	1:00	D
+# Rule	AQ	1990	max	-	Mar	Sun>=1	3:00	0	E
+
+# From Bradley White (1989-12-24):
+# "Australia/Queensland" now observes daylight time (i.e. from
+# October 1989).
+
+# From Bradley White (1991-03-04):
+# A recent excerpt from an Australian newspaper...
+# ...Queensland...[has] agreed to end daylight saving
+# at 3am tomorrow (March 3)...
+
+# From John Mackin (1991-03-06):
+# I can certainly confirm for my part that Daylight Saving in NSW did in fact
+# end on Sunday, 3 March.  I don't know at what hour, though.  (It surprised
+# me.)
+
+# From Bradley White (1992-03-08):
+# ...there was recently a referendum in Queensland which resulted
+# in the experimental daylight saving system being abandoned. So, ...
+# ...
+# Rule	QLD	1989	1991	-	Oct	lastSun	2:00	1:00	D
+# Rule	QLD	1990	1992	-	Mar	Sun>=1	3:00	0	S
+# ...
+
+# From Arthur David Olson (1992-03-08):
+# The chosen rules the union of the 1971/1972 change and the 1989-1992 changes.
+
+# From Christopher Hunt (2006-11-21), after an advance warning
+# from Jesper Norgaard Welen (2006-11-01):
+# WA are trialing DST for three years.
+# <http://www.parliament.wa.gov.au/parliament/bills.nsf/9A1B183144403DA54825721200088DF1/$File/Bill175-1B.pdf>
+
+# From Rives McDow (2002-04-09):
+# The most interesting region I have found consists of three towns on the
+# southern coast....  South Australia observes daylight saving time; Western
+# Australia does not.  The two states are one and a half hours apart.  The
+# residents decided to forget about this nonsense of changing the clock so
+# much and set the local time 20 hours and 45 minutes from the
+# international date line, or right in the middle of the time of South
+# Australia and Western Australia....
+#
+# From Paul Eggert (2002-04-09):
+# This is confirmed by the section entitled
+# "What's the deal with time zones???" in
+# <http://www.earthsci.unimelb.edu.au/~awatkins/null.html>.
+#
+# From Alex Livingston (2006-12-07):
+# ... it was just on four years ago that I drove along the Eyre Highway,
+# which passes through eastern Western Australia close to the southern
+# coast of the continent.
+#
+# I paid particular attention to the time kept there. There can be no
+# dispute that UTC+08:45 was considered "the time" from the border
+# village just inside the border with South Australia to as far west
+# as just east of Caiguna. There can also be no dispute that Eucla is
+# the largest population centre in this zone....
+#
+# Now that Western Australia is observing daylight saving, the
+# question arose whether this part of the state would follow suit. I
+# just called the border village and confirmed that indeed they have,
+# meaning that they are now observing UTC+09:45.
+#
+# (2006-12-09):
+# I personally doubt that either experimentation with daylight saving
+# in WA or its introduction in SA had anything to do with the genesis
+# of this time zone.  My hunch is that it's been around since well
+# before 1975.  I remember seeing it noted on road maps decades ago.
+
+# From Paul Eggert (2006-12-15):
+# For lack of better info, assume the tradition dates back to the
+# introduction of standard time in 1895.
+
+
+# southeast Australia
+#
+# From Paul Eggert (2007-07-23):
+# Starting autumn 2008 Victoria, NSW, South Australia, Tasmania and the ACT
+# end DST the first Sunday in April and start DST the first Sunday in October.
+# http://www.theage.com.au/news/national/daylight-savings-to-span-six-months/2007/06/27/1182623966703.html
+
+
+# South Australia
+
+# From Bradley White (1991-03-04):
+# A recent excerpt from an Australian newspaper...
+# ...South Australia...[has] agreed to end daylight saving
+# at 3am tomorrow (March 3)...
+
+# From George Shepherd via Simon Woodhead via Robert Elz (1991-03-06):
+# #   The state of SOUTH AUSTRALIA....[ Courtesy of S.A. Dept of Labour ]
+# #						[ Nov 1990 ]
+# ...
+# Zone	Australia/South		9:30	AS	%sST
+# ...
+# Rule	 AS	1971	max	-	Oct	lastSun	2:00	1:00	D
+# Rule	 AS	1972	1985	-	Mar	Sun>=1	3:00	0	C
+# Rule	 AS	1986	1990	-	Mar	Sun>=15	3:00	0	C
+# Rule	 AS	1991	max	-	Mar	Sun>=1	3:00	0	C
+
+# From Bradley White (1992-03-11):
+# Recent correspondence with a friend in Adelaide
+# contained the following exchange:  "Due to the Adelaide Festival,
+# South Australia delays setting back our clocks for a few weeks."
+
+# From Robert Elz (1992-03-13):
+# I heard that apparently (or at least, it appears that)
+# South Aus will have an extra 3 weeks daylight saving every even
+# numbered year (from 1990).  That's when the Adelaide Festival
+# is on...
+
+# From Robert Elz (1992-03-16, 00:57:07 +1000):
+# DST didn't end in Adelaide today (yesterday)....
+# But whether it's "4th Sunday" or "2nd last Sunday" I have no idea whatever...
+# (it's just as likely to be "the Sunday we pick for this year"...).
+
+# From Bradley White (1994-04-11):
+# If Sun, 15 March, 1992 was at +1030 as kre asserts, but yet Sun, 20 March,
+# 1994 was at +0930 as John Connolly's customer seems to assert, then I can
+# only conclude that the actual rule is more complicated....
+
+# From John Warburton (1994-10-07):
+# The new Daylight Savings dates for South Australia ...
+# was gazetted in the Government Hansard on Sep 26 1994....
+# start on last Sunday in October and end in last sunday in March.
+
+# From Paul Eggert (2007-07-23):
+# See "southeast Australia" above for 2008 and later.
+
+# Tasmania
+
+# The rules for 1967 through 1991 were reported by George Shepherd
+# via Simon Woodhead via Robert Elz (1991-03-06):
+# #  The state of TASMANIA.. [Courtesy Tasmanian Dept of Premier + Cabinet ]
+# #					[ Nov 1990 ]
+
+# From Bill Hart via Guy Harris (1991-10-10):
+# Oh yes, the new daylight savings rules are uniquely tasmanian, we have
+# 6 weeks a year now when we are out of sync with the rest of Australia
+# (but nothing new about that).
+
+# From Alex Livingston (1999-10-04):
+# I heard on the ABC (Australian Broadcasting Corporation) radio news on the
+# (long) weekend that Tasmania, which usually goes its own way in this regard,
+# has decided to join with most of NSW, the ACT, and most of Victoria
+# (Australia) and start daylight saving on the last Sunday in August in 2000
+# instead of the first Sunday in October.
+
+# Sim Alam (2000-07-03) reported a legal citation for the 2000/2001 rules:
+# http://www.thelaw.tas.gov.au/fragview/42++1968+GS3A@EN+2000070300
+
+# From Paul Eggert (2007-07-23):
+# See "southeast Australia" above for 2008 and later.
+
+# Victoria
+
+# The rules for 1971 through 1991 were reported by George Shepherd
+# via Simon Woodhead via Robert Elz (1991-03-06):
+# #   The state of VICTORIA.. [ Courtesy of Vic. Dept of Premier + Cabinet ]
+# #						[ Nov 1990 ]
+
+# From Scott Harrington (2001-08-29):
+# On KQED's "City Arts and Lectures" program last night I heard an
+# interesting story about daylight savings time.  Dr. John Heilbron was
+# discussing his book "The Sun in the Church: Cathedrals as Solar
+# Observatories"[1], and in particular the Shrine of Remembrance[2] located
+# in Melbourne, Australia.
+#
+# Apparently the shrine's main purpose is a beam of sunlight which
+# illuminates a special spot on the floor at the 11th hour of the 11th day
+# of the 11th month (Remembrance Day) every year in memory of Australia's
+# fallen WWI soldiers.  And if you go there on Nov. 11, at 11am local time,
+# you will indeed see the sunbeam illuminate the special spot at the
+# expected time.
+#
+# However, that is only because of some special mirror contraption that had
+# to be employed, since due to daylight savings time, the true solar time of
+# the remembrance moment occurs one hour later (or earlier?).  Perhaps
+# someone with more information on this jury-rig can tell us more.
+#
+# [1] http://www.hup.harvard.edu/catalog/HEISUN.html
+# [2] http://www.shrine.org.au
+
+# From Paul Eggert (2007-07-23):
+# See "southeast Australia" above for 2008 and later.
+
+# New South Wales
+
+# From Arthur David Olson:
+# New South Wales and subjurisdictions have their own ideas of a fun time.
+# Based on law library research by John Mackin,
+# who notes:
+#	In Australia, time is not legislated federally, but rather by the
+#	individual states.  Thus, while such terms as ``Eastern Standard Time''
+#	[I mean, of course, Australian EST, not any other kind] are in common
+#	use, _they have NO REAL MEANING_, as they are not defined in the
+#	legislation.  This is very important to understand.
+#	I have researched New South Wales time only...
+
+# From Eric Ulevik (1999-05-26):
+# DST will start in NSW on the last Sunday of August, rather than the usual
+# October in 2000.  [See: Matthew Moore,
+# <a href="http://www.smh.com.au/news/9905/26/pageone/pageone4.html">
+# Two months more daylight saving
+# </a>
+# Sydney Morning Herald (1999-05-26).]
+
+# From Paul Eggert (1999-09-27):
+# See the following official NSW source:
+# <a href="http://dir.gis.nsw.gov.au/cgi-bin/genobject/document/other/daylightsaving/tigGmZ">
+# Daylight Saving in New South Wales.
+# </a>
+#
+# Narrabri Shire (NSW) council has announced it will ignore the extension of
+# daylight saving next year.  See:
+# <a href="http://abc.net.au/news/regionals/neweng/monthly/regeng-22jul1999-1.htm">
+# Narrabri Council to ignore daylight saving
+# </a> (1999-07-22).  For now, we'll wait to see if this really happens.
+#
+# Victoria will following NSW.  See:
+# <a href="http://abc.net.au/local/news/olympics/1999/07/item19990728112314_1.htm">
+# Vic to extend daylight saving
+# </a> (1999-07-28).
+#
+# However, South Australia rejected the DST request.  See:
+# <a href="http://abc.net.au/news/olympics/1999/07/item19990719151754_1.htm">
+# South Australia rejects Olympics daylight savings request
+# </a> (1999-07-19).
+#
+# Queensland also will not observe DST for the Olympics.  See:
+# <a href="http://abc.net.au/news/olympics/1999/06/item19990601114608_1.htm">
+# Qld says no to daylight savings for Olympics
+# </a> (1999-06-01), which quotes Queensland Premier Peter Beattie as saying
+# ``Look you've got to remember in my family when this came up last time
+# I voted for it, my wife voted against it and she said to me it's all very
+# well for you, you don't have to worry about getting the children out of
+# bed, getting them to school, getting them to sleep at night.
+# I've been through all this argument domestically...my wife rules.''
+#
+# Broken Hill will stick with South Australian time in 2000.  See:
+# <a href="http://abc.net.au/news/regionals/brokenh/monthly/regbrok-21jul1999-6.htm">
+# Broken Hill to be behind the times
+# </a> (1999-07-21).
+
+# IATA SSIM (1998-09) says that the spring 2000 change for Australian
+# Capital Territory, New South Wales except Lord Howe Island and Broken
+# Hill, and Victoria will be August 27, presumably due to the Sydney Olympics.
+
+# From Eric Ulevik, referring to Sydney's Sun Herald (2000-08-13), page 29:
+# The Queensland Premier Peter Beattie is encouraging northern NSW
+# towns to use Queensland time.
+
+# From Paul Eggert (2007-07-23):
+# See "southeast Australia" above for 2008 and later.
+
+# Yancowinna
+
+# From John Mackin (1989-01-04):
+# `Broken Hill' means the County of Yancowinna.
+
+# From George Shepherd via Simon Woodhead via Robert Elz (1991-03-06):
+# # YANCOWINNA..  [ Confirmation courtesy of Broken Hill Postmaster ]
+# #					[ Dec 1990 ]
+# ...
+# # Yancowinna uses Central Standard Time, despite [its] location on the
+# # New South Wales side of the S.A. border. Most business and social dealings
+# # are with CST zones, therefore CST is legislated by local government
+# # although the switch to Summer Time occurs in line with N.S.W. There have
+# # been years when this did not apply, but the historical data is not
+# # presently available.
+# Zone	Australia/Yancowinna	9:30	 AY	%sST
+# ...
+# Rule	 AY	1971	1985	-	Oct	lastSun	2:00	1:00	D
+# Rule	 AY	1972	only	-	Feb	lastSun	3:00	0	C
+# [followed by other Rules]
+
+# Lord Howe Island
+
+# From George Shepherd via Simon Woodhead via Robert Elz (1991-03-06):
+# LHI...		[ Courtesy of Pauline Van Winsen ]
+#					[ Dec 1990 ]
+# Lord Howe Island is located off the New South Wales coast, and is half an
+# hour ahead of NSW time.
+
+# From James Lonergan, Secretary, Lord Howe Island Board (2000-01-27):
+# Lord Howe Island summer time in 2000/2001 will commence on the same
+# date as the rest of NSW (i.e. 2000-08-27).  For your information the
+# Lord Howe Island Board (controlling authority for the Island) is
+# seeking the community's views on various options for summer time
+# arrangements on the Island, e.g. advance clocks by 1 full hour
+# instead of only 30 minutes.  Dependant on the wishes of residents
+# the Board may approach the NSW government to change the existing
+# arrangements.  The starting date for summer time on the Island will
+# however always coincide with the rest of NSW.
+
+# From James Lonergan, Secretary, Lord Howe Island Board (2000-10-25):
+# Lord Howe Island advances clocks by 30 minutes during DST in NSW and retards
+# clocks by 30 minutes when DST finishes. Since DST was most recently
+# introduced in NSW, the "changeover" time on the Island has been 02:00 as
+# shown on clocks on LHI. I guess this means that for 30 minutes at the start
+# of DST, LHI is actually 1 hour ahead of the rest of NSW.
+
+# From Paul Eggert (2006-03-22):
+# For Lord Howe dates we use Shanks & Pottenger through 1989, and
+# Lonergan thereafter.  For times we use Lonergan.
+
+# From Paul Eggert (2007-07-23):
+# See "southeast Australia" above for 2008 and later.
+
+# From Steffen Thorsen (2009-04-28):
+# According to the official press release, South Australia's extended daylight 
+# saving period will continue with the same rules as used during the 2008-2009 
+# summer (southern hemisphere).
+# 
+# From
+# <a href="http://www.safework.sa.gov.au/uploaded_files/DaylightDatesSet.pdf">
+# http://www.safework.sa.gov.au/uploaded_files/DaylightDatesSet.pdf
+# </a>
+# The extended daylight saving period that South Australia has been trialling 
+# for over the last year is now set to be ongoing.
+# Daylight saving will continue to start on the first Sunday in October each 
+# year and finish on the first Sunday in April the following year.
+# Industrial Relations Minister, Paul Caica, says this provides South Australia 
+# with a consistent half hour time difference with NSW, Victoria, Tasmania and 
+# the ACT for all 52 weeks of the year...
+# 
+# We have a wrap-up here:
+# <a href="http://www.timeanddate.com/news/time/south-australia-extends-dst.html">
+# http://www.timeanddate.com/news/time/south-australia-extends-dst.html
+# </a>
+###############################################################################
+
+# New Zealand
+
+# From Mark Davies (1990-10-03):
+# the 1989/90 year was a trial of an extended "daylight saving" period.
+# This trial was deemed successful and the extended period adopted for
+# subsequent years (with the addition of a further week at the start).
+# source -- phone call to Ministry of Internal Affairs Head Office.
+
+# From George Shepherd via Simon Woodhead via Robert Elz (1991-03-06):
+# # The Country of New Zealand   (Australia's east island -) Gee they hate that!
+# #				   or is Australia the west island of N.Z.
+# #	[ courtesy of Geoff Tribble.. Auckland N.Z. ]
+# #				[ Nov 1990 ]
+# ...
+# Rule	NZ      1974    1988	-	Oct	lastSun	2:00	1:00	D
+# Rule	NZ	1989	max	-	Oct	Sun>=1	2:00	1:00	D
+# Rule	NZ      1975    1989	-	Mar	Sun>=1	3:00	0	S
+# Rule	NZ	1990	max	-	Mar	lastSun	3:00	0	S
+# ...
+# Zone	NZ			12:00	NZ		NZ%sT	# New Zealand
+# Zone	NZ-CHAT			12:45	-		NZ-CHAT # Chatham Island
+
+# From Arthur David Olson (1992-03-08):
+# The chosen rules use the Davies October 8 values for the start of DST in 1989
+# rather than the October 1 value.
+
+# From Paul Eggert (1995-12-19);
+# Shank & Pottenger report 2:00 for all autumn changes in Australia and NZ.
+# Robert Uzgalis writes that the New Zealand Daylight
+# Savings Time Order in Council dated 1990-06-18 specifies 2:00 standard
+# time on both the first Sunday in October and the third Sunday in March.
+# As with Australia, we'll assume the tradition is 2:00s, not 2:00.
+#
+# From Paul Eggert (2006-03-22):
+# The Department of Internal Affairs (DIA) maintains a brief history,
+# as does Carol Squires; see tz-link.htm for the full references.
+# Use these sources in preference to Shanks & Pottenger.
+#
+# For Chatham, IATA SSIM (1991/1999) gives the NZ rules but with
+# transitions at 2:45 local standard time; this confirms that Chatham
+# is always exactly 45 minutes ahead of Auckland.
+
+# From Colin Sharples (2007-04-30):
+# DST will now start on the last Sunday in September, and end on the
+# first Sunday in April.  The changes take effect this year, meaning
+# that DST will begin on 2007-09-30 2008-04-06.
+# http://www.dia.govt.nz/diawebsite.nsf/wpg_URL/Services-Daylight-Saving-Daylight-saving-to-be-extended
+
+###############################################################################
+
+
+# Fiji
+
+# Howse writes (p 153) that in 1879 the British governor of Fiji
+# enacted an ordinance standardizing the islands on Antipodean Time
+# instead of the American system (which was one day behind).
+
+# From Rives McDow (1998-10-08):
+# Fiji will introduce DST effective 0200 local time, 1998-11-01
+# until 0300 local time 1999-02-28.  Each year the DST period will
+# be from the first Sunday in November until the last Sunday in February.
+
+# From Paul Eggert (2000-01-08):
+# IATA SSIM (1999-09) says DST ends 0100 local time.  Go with McDow.
+
+# From the BBC World Service (1998-10-31 11:32 UTC):
+# The Fijiian government says the main reasons for the time change is to
+# improve productivity and reduce road accidents.  But correspondents say it
+# also hopes the move will boost Fiji's ability to compete with other pacific
+# islands in the effort to attract tourists to witness the dawning of the new
+# millenium.
+
+# http://www.fiji.gov.fj/press/2000_09/2000_09_13-05.shtml (2000-09-13)
+# reports that Fiji has discontinued DST.
+
+# Johnston
+
+# Johnston data is from usno1995.
+
+
+# Kiribati
+
+# From Paul Eggert (1996-01-22):
+# Today's _Wall Street Journal_ (page 1) reports that Kiribati
+# ``declared it the same day throught the country as of Jan. 1, 1995''
+# as part of the competition to be first into the 21st century.
+
+
+# Kwajalein
+
+# In comp.risks 14.87 (26 August 1993), Peter Neumann writes:
+# I wonder what happened in Kwajalein, where there was NO Friday,
+# 1993-08-20.  Thursday night at midnight Kwajalein switched sides with
+# respect to the International Date Line, to rejoin its fellow islands,
+# going from 11:59 p.m. Thursday to 12:00 m. Saturday in a blink.
+
+
+# N Mariana Is, Guam
+
+# Howse writes (p 153) ``The Spaniards, on the other hand, reached the
+# Philippines and the Ladrones from America,'' and implies that the Ladrones
+# (now called the Marianas) kept American date for quite some time.
+# For now, we assume the Ladrones switched at the same time as the Philippines;
+# see Asia/Manila.
+
+# US Public Law 106-564 (2000-12-23) made UTC+10 the official standard time,
+# under the name "Chamorro Standard Time".  There is no official abbreviation,
+# but Congressman Robert A. Underwood, author of the bill that became law,
+# wrote in a press release (2000-12-27) that he will seek the use of "ChST".
+
+
+# Micronesia
+
+# Alan Eugene Davis writes (1996-03-16),
+# ``I am certain, having lived there for the past decade, that "Truk"
+# (now properly known as Chuuk) ... is in the time zone GMT+10.''
+#
+# Shanks & Pottenger write that Truk switched from UTC+10 to UTC+11
+# on 1978-10-01; ignore this for now.
+
+# From Paul Eggert (1999-10-29):
+# The Federated States of Micronesia Visitors Board writes in
+# <a href="http://www.fsmgov.org/info/clocks.html">
+# The Federated States of Micronesia - Visitor Information
+# </a> (1999-01-26)
+# that Truk and Yap are UTC+10, and Ponape and Kosrae are UTC+11.
+# We don't know when Kosrae switched from UTC+12; assume January 1 for now.
+
+
+# Midway
+
+# From Charles T O'Connor, KMTH DJ (1956),
+# quoted in the KTMH section of the Radio Heritage Collection
+# <http://radiodx.com/spdxr/KMTH.htm> (2002-12-31):
+# For the past two months we've been on what is known as Daylight
+# Saving Time.  This time has put us on air at 5am in the morning,
+# your time down there in New Zealand.  Starting September 2, 1956
+# we'll again go back to Standard Time.  This'll mean that we'll go to
+# air at 6am your time.
+#
+# From Paul Eggert (2003-03-23):
+# We don't know the date of that quote, but we'll guess they
+# started DST on June 3.  Possibly DST was observed other years
+# in Midway, but we have no record of it.
+
+
+# Pitcairn
+
+# From Rives McDow (1999-11-08):
+# A Proclamation was signed by the Governor of Pitcairn on the 27th March 1998
+# with regard to Pitcairn Standard Time.  The Proclamation is as follows.
+#
+#	The local time for general purposes in the Islands shall be
+#	Co-ordinated Universal time minus 8 hours and shall be known
+#	as Pitcairn Standard Time.
+#
+# ... I have also seen Pitcairn listed as UTC minus 9 hours in several
+# references, and can only assume that this was an error in interpretation
+# somehow in light of this proclamation.
+
+# From Rives McDow (1999-11-09):
+# The Proclamation regarding Pitcairn time came into effect on 27 April 1998
+# ... at midnight.
+
+# From Howie Phelps (1999-11-10), who talked to a Pitcairner via shortwave:
+# Betty Christian told me yesterday that their local time is the same as
+# Pacific Standard Time. They used to be 1/2 hour different from us here in
+# Sacramento but it was changed a couple of years ago.
+
+
+# Samoa
+
+# Howse writes (p 153, citing p 10 of the 1883-11-18 New York Herald)
+# that in 1879 the King of Samoa decided to change
+# ``the date in his kingdom from the Antipodean to the American system,
+# ordaining -- by a masterpiece of diplomatic flattery -- that
+# the Fourth of July should be celebrated twice in that year.''
+
+
+# Tonga
+
+# From Paul Eggert (1996-01-22):
+# Today's _Wall Street Journal_ (p 1) reports that ``Tonga has been plotting
+# to sneak ahead of [New Zealanders] by introducing daylight-saving time.''
+# Since Kiribati has moved the Date Line it's not clear what Tonga will do.
+
+# Don Mundell writes in the 1997-02-20 Tonga Chronicle
+# <a href="http://www.tongatapu.net.to/tonga/homeland/timebegins.htm">
+# How Tonga became `The Land where Time Begins'
+# </a>:
+
+# Until 1941 Tonga maintained a standard time 50 minutes ahead of NZST
+# 12 hours and 20 minutes ahead of GMT.  When New Zealand adjusted its
+# standard time in 1940s, Tonga had the choice of subtracting from its
+# local time to come on the same standard time as New Zealand or of
+# advancing its time to maintain the differential of 13 degrees
+# (approximately 50 minutes ahead of New Zealand time).
+#
+# Because His Majesty King Taufa'ahau Tupou IV, then Crown Prince
+# Tungi, preferred to ensure Tonga's title as the land where time
+# begins, the Legislative Assembly approved the latter change.
+#
+# But some of the older, more conservative members from the outer
+# islands objected. "If at midnight on Dec. 31, we move ahead 40
+# minutes, as your Royal Highness wishes, what becomes of the 40
+# minutes we have lost?"
+#
+# The Crown Prince, presented an unanswerable argument: "Remember that
+# on the World Day of Prayer, you would be the first people on Earth
+# to say your prayers in the morning."
+
+# From Paul Eggert (2006-03-22):
+# Shanks & Pottenger say the transition was on 1968-10-01; go with Mundell.
+
+# From Eric Ulevik (1999-05-03):
+# Tonga's director of tourism, who is also secretary of the National Millenium
+# Committee, has a plan to get Tonga back in front.
+# He has proposed a one-off move to tropical daylight saving for Tonga from
+# October to March, which has won approval in principle from the Tongan
+# Government.
+
+# From Steffen Thorsen (1999-09-09):
+# * Tonga will introduce DST in November
+#
+# I was given this link by John Letts:
+# <a href="http://news.bbc.co.uk/hi/english/world/asia-pacific/newsid_424000/424764.stm">
+# http://news.bbc.co.uk/hi/english/world/asia-pacific/newsid_424000/424764.stm
+# </a>
+#
+# I have not been able to find exact dates for the transition in November
+# yet. By reading this article it seems like Fiji will be 14 hours ahead
+# of UTC as well, but as far as I know Fiji will only be 13 hours ahead
+# (12 + 1 hour DST).
+
+# From Arthur David Olson (1999-09-20):
+# According to <a href="http://www.tongaonline.com/news/sept1799.html">
+# http://www.tongaonline.com/news/sept1799.html
+# </a>:
+# "Daylight Savings Time will take effect on Oct. 2 through April 15, 2000
+# and annually thereafter from the first Saturday in October through the
+# third Saturday of April.  Under the system approved by Privy Council on
+# Sept. 10, clocks must be turned ahead one hour on the opening day and
+# set back an hour on the closing date."
+# Alas, no indication of the time of day.
+
+# From Rives McDow (1999-10-06):
+# Tonga started its Daylight Saving on Saturday morning October 2nd at 0200am.
+# Daylight Saving ends on April 16 at 0300am which is Sunday morning.
+
+# From Steffen Thorsen (2000-10-31):
+# Back in March I found a notice on the website http://www.tongaonline.com
+# that Tonga changed back to standard time one month early, on March 19
+# instead of the original reported date April 16. Unfortunately, the article
+# is no longer available on the site, and I did not make a copy of the
+# text, and I have forgotten to report it here.
+# (Original URL was: http://www.tongaonline.com/news/march162000.htm )
+
+# From Rives McDow (2000-12-01):
+# Tonga is observing DST as of 2000-11-04 and will stop on 2001-01-27.
+
+# From Sione Moala-Mafi (2001-09-20) via Rives McDow:
+# At 2:00am on the first Sunday of November, the standard time in the Kingdom
+# shall be moved forward by one hour to 3:00am.  At 2:00am on the last Sunday
+# of January the standard time in the Kingdom shall be moved backward by one
+# hour to 1:00am.
+
+# From Pulu 'Anau (2002-11-05):
+# The law was for 3 years, supposedly to get renewed.  It wasn't.
+
+
+# Wake
+
+# From Vernice Anderson, Personal Secretary to Philip Jessup,
+# US Ambassador At Large (oral history interview, 1971-02-02):
+#
+# Saturday, the 14th [of October, 1950] -- ...  The time was all the
+# more confusing at that point, because we had crossed the
+# International Date Line, thus getting two Sundays.  Furthermore, we
+# discovered that Wake Island had two hours of daylight saving time
+# making calculation of time in Washington difficult if not almost
+# impossible.
+#
+# http://www.trumanlibrary.org/wake/meeting.htm
+
+# From Paul Eggert (2003-03-23):
+# We have no other report of DST in Wake Island, so omit this info for now.
+
+###############################################################################
+
+# The International Date Line
+
+# From Gwillim Law (2000-01-03):
+#
+# The International Date Line is not defined by any international standard,
+# convention, or treaty.  Mapmakers are free to draw it as they please.
+# Reputable mapmakers will simply ensure that every point of land appears on
+# the correct side of the IDL, according to the date legally observed there.
+#
+# When Kiribati adopted a uniform date in 1995, thereby moving the Phoenix and
+# Line Islands to the west side of the IDL (or, if you prefer, moving the IDL
+# to the east side of the Phoenix and Line Islands), I suppose that most
+# mapmakers redrew the IDL following the boundary of Kiribati.  Even that line
+# has a rather arbitrary nature.  The straight-line boundaries between Pacific
+# island nations that are shown on many maps are based on an international
+# convention, but are not legally binding national borders.... The date is
+# governed by the IDL; therefore, even on the high seas, there may be some
+# places as late as fourteen hours later than UTC.  And, since the IDL is not
+# an international standard, there are some places on the high seas where the
+# correct date is ambiguous.
+
+# From Wikipedia <http://en.wikipedia.org/wiki/Time_zone> (2005-08-31):
+# Before 1920, all ships kept local apparent time on the high seas by setting
+# their clocks at night or at the morning sight so that, given the ship's
+# speed and direction, it would be 12 o'clock when the Sun crossed the ship's
+# meridian (12 o'clock = local apparent noon).  During 1917, at the
+# Anglo-French Conference on Time-keeping at Sea, it was recommended that all
+# ships, both military and civilian, should adopt hourly standard time zones
+# on the high seas.  Whenever a ship was within the territorial waters of any
+# nation it would use that nation's standard time.  The captain was permitted
+# to change his ship's clocks at a time of his choice following his ship's
+# entry into another zone time--he often chose midnight.  These zones were
+# adopted by all major fleets between 1920 and 1925 but not by many
+# independent merchant ships until World War II.
+
+# From Paul Eggert, using references suggested by Oscar van Vlijmen
+# (2005-03-20):
+#
+# The American Practical Navigator (2002)
+# <http://pollux.nss.nima.mil/pubs/pubs_j_apn_sections.html?rid=187>
+# talks only about the 180-degree meridian with respect to ships in
+# international waters; it ignores the international date line.
diff --git a/tools/zoneinfo/tzdata2010k/backward b/tools/zoneinfo/tzdata2010k/backward
new file mode 100644
index 0000000..f1f95a8
--- /dev/null
+++ b/tools/zoneinfo/tzdata2010k/backward
@@ -0,0 +1,118 @@
+# <pre>
+# @(#)backward	8.9
+# This file is in the public domain, so clarified as of
+# 2009-05-17 by Arthur David Olson.
+
+# This file provides links between current names for time zones
+# and their old names.  Many names changed in late 1993.
+
+Link	Africa/Asmara		Africa/Asmera
+Link	Africa/Bamako		Africa/Timbuktu
+Link	America/Argentina/Catamarca	America/Argentina/ComodRivadavia
+Link	America/Adak		America/Atka
+Link	America/Argentina/Buenos_Aires	America/Buenos_Aires
+Link	America/Argentina/Catamarca	America/Catamarca
+Link	America/Atikokan	America/Coral_Harbour
+Link	America/Argentina/Cordoba	America/Cordoba
+Link	America/Tijuana		America/Ensenada
+Link	America/Indiana/Indianapolis	America/Fort_Wayne
+Link	America/Indiana/Indianapolis	America/Indianapolis
+Link	America/Argentina/Jujuy	America/Jujuy
+Link	America/Indiana/Knox	America/Knox_IN
+Link	America/Kentucky/Louisville	America/Louisville
+Link	America/Argentina/Mendoza	America/Mendoza
+Link	America/Rio_Branco	America/Porto_Acre
+Link	America/Argentina/Cordoba	America/Rosario
+Link	America/St_Thomas	America/Virgin
+Link	Asia/Ashgabat		Asia/Ashkhabad
+Link	Asia/Chongqing		Asia/Chungking
+Link	Asia/Dhaka		Asia/Dacca
+Link	Asia/Kathmandu		Asia/Katmandu
+Link	Asia/Kolkata		Asia/Calcutta
+Link	Asia/Macau		Asia/Macao
+Link	Asia/Jerusalem		Asia/Tel_Aviv
+Link	Asia/Ho_Chi_Minh	Asia/Saigon
+Link	Asia/Thimphu		Asia/Thimbu
+Link	Asia/Makassar		Asia/Ujung_Pandang
+Link	Asia/Ulaanbaatar	Asia/Ulan_Bator
+Link	Atlantic/Faroe		Atlantic/Faeroe
+Link	Europe/Oslo		Atlantic/Jan_Mayen
+Link	Australia/Sydney	Australia/ACT
+Link	Australia/Sydney	Australia/Canberra
+Link	Australia/Lord_Howe	Australia/LHI
+Link	Australia/Sydney	Australia/NSW
+Link	Australia/Darwin	Australia/North
+Link	Australia/Brisbane	Australia/Queensland
+Link	Australia/Adelaide	Australia/South
+Link	Australia/Hobart	Australia/Tasmania
+Link	Australia/Melbourne	Australia/Victoria
+Link	Australia/Perth		Australia/West
+Link	Australia/Broken_Hill	Australia/Yancowinna
+Link	America/Rio_Branco	Brazil/Acre
+Link	America/Noronha		Brazil/DeNoronha
+Link	America/Sao_Paulo	Brazil/East
+Link	America/Manaus		Brazil/West
+Link	America/Halifax		Canada/Atlantic
+Link	America/Winnipeg	Canada/Central
+Link	America/Regina		Canada/East-Saskatchewan
+Link	America/Toronto		Canada/Eastern
+Link	America/Edmonton	Canada/Mountain
+Link	America/St_Johns	Canada/Newfoundland
+Link	America/Vancouver	Canada/Pacific
+Link	America/Regina		Canada/Saskatchewan
+Link	America/Whitehorse	Canada/Yukon
+Link	America/Santiago	Chile/Continental
+Link	Pacific/Easter		Chile/EasterIsland
+Link	America/Havana		Cuba
+Link	Africa/Cairo		Egypt
+Link	Europe/Dublin		Eire
+Link	Europe/London		Europe/Belfast
+Link	Europe/Chisinau		Europe/Tiraspol
+Link	Europe/London		GB
+Link	Europe/London		GB-Eire
+Link	Etc/GMT			GMT+0
+Link	Etc/GMT			GMT-0
+Link	Etc/GMT			GMT0
+Link	Etc/GMT			Greenwich
+Link	Asia/Hong_Kong		Hongkong
+Link	Atlantic/Reykjavik	Iceland
+Link	Asia/Tehran		Iran
+Link	Asia/Jerusalem		Israel
+Link	America/Jamaica		Jamaica
+Link	Asia/Tokyo		Japan
+Link	Pacific/Kwajalein	Kwajalein
+Link	Africa/Tripoli		Libya
+Link	America/Tijuana		Mexico/BajaNorte
+Link	America/Mazatlan	Mexico/BajaSur
+Link	America/Mexico_City	Mexico/General
+Link	Pacific/Auckland	NZ
+Link	Pacific/Chatham		NZ-CHAT
+Link	America/Denver		Navajo
+Link	Asia/Shanghai		PRC
+Link	Pacific/Pago_Pago	Pacific/Samoa
+Link	Pacific/Chuuk		Pacific/Yap
+Link	Pacific/Chuuk		Pacific/Truk
+Link	Pacific/Pohnpei		Pacific/Ponape
+Link	Europe/Warsaw		Poland
+Link	Europe/Lisbon		Portugal
+Link	Asia/Taipei		ROC
+Link	Asia/Seoul		ROK
+Link	Asia/Singapore		Singapore
+Link	Europe/Istanbul		Turkey
+Link	Etc/UCT			UCT
+Link	America/Anchorage	US/Alaska
+Link	America/Adak		US/Aleutian
+Link	America/Phoenix		US/Arizona
+Link	America/Chicago		US/Central
+Link	America/Indiana/Indianapolis	US/East-Indiana
+Link	America/New_York	US/Eastern
+Link	Pacific/Honolulu	US/Hawaii
+Link	America/Indiana/Knox	US/Indiana-Starke
+Link	America/Detroit		US/Michigan
+Link	America/Denver		US/Mountain
+Link	America/Los_Angeles	US/Pacific
+Link	Pacific/Pago_Pago	US/Samoa
+Link	Etc/UTC			UTC
+Link	Etc/UTC			Universal
+Link	Europe/Moscow		W-SU
+Link	Etc/UTC			Zulu
diff --git a/tools/zoneinfo/tzdata2009s/etcetera b/tools/zoneinfo/tzdata2010k/etcetera
similarity index 100%
rename from tools/zoneinfo/tzdata2009s/etcetera
rename to tools/zoneinfo/tzdata2010k/etcetera
diff --git a/tools/zoneinfo/tzdata2010k/europe b/tools/zoneinfo/tzdata2010k/europe
new file mode 100644
index 0000000..8ca6d8f
--- /dev/null
+++ b/tools/zoneinfo/tzdata2010k/europe
@@ -0,0 +1,2724 @@
+# <pre>
+# @(#)europe	8.27
+# This file is in the public domain, so clarified as of
+# 2009-05-17 by Arthur David Olson.
+
+# This data is by no means authoritative; if you think you know better,
+# go ahead and edit the file (and please send any changes to
+# tz@elsie.nci.nih.gov for general use in the future).
+
+# From Paul Eggert (2006-03-22):
+# A good source for time zone historical data outside the U.S. is
+# Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
+# San Diego: ACS Publications, Inc. (2003).
+#
+# Gwillim Law writes that a good source
+# for recent time zone data is the International Air Transport
+# Association's Standard Schedules Information Manual (IATA SSIM),
+# published semiannually.  Law sent in several helpful summaries
+# of the IATA's data after 1990.
+#
+# Except where otherwise noted, Shanks & Pottenger is the source for
+# entries through 1991, and IATA SSIM is the source for entries afterwards.
+#
+# Other sources occasionally used include:
+#
+#	Edward W. Whitman, World Time Differences,
+#	Whitman Publishing Co, 2 Niagara Av, Ealing, London (undated),
+#	which I found in the UCLA library.
+#
+#	<a href="http://www.pettswoodvillage.co.uk/Daylight_Savings_William_Willett.pdf">
+#	William Willett, The Waste of Daylight, 19th edition
+#	</a> (1914-03)
+#
+#	Brazil's Departamento Servico da Hora (DSH),
+#	<a href="http://pcdsh01.on.br/HISTHV.htm">
+#	History of Summer Time
+#	</a> (1998-09-21, in Portuguese)
+
+#
+# I invented the abbreviations marked `*' in the following table;
+# the rest are from earlier versions of this file, or from other sources.
+# Corrections are welcome!
+#                   std dst  2dst
+#                   LMT           Local Mean Time
+#       -4:00       AST ADT       Atlantic
+#       -3:00       WGT WGST      Western Greenland*
+#       -1:00       EGT EGST      Eastern Greenland*
+#        0:00       GMT BST  BDST Greenwich, British Summer
+#        0:00       GMT IST       Greenwich, Irish Summer
+#        0:00       WET WEST WEMT Western Europe
+#        0:19:32.13 AMT NST       Amsterdam, Netherlands Summer (1835-1937)*
+#        0:20       NET NEST      Netherlands (1937-1940)*
+#        1:00       CET CEST CEMT Central Europe
+#        1:00:14    SET           Swedish (1879-1899)*
+#        2:00       EET EEST      Eastern Europe
+#        3:00       MSK MSD       Moscow
+#
+# A reliable and entertaining source about time zones, especially in Britain,
+# Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997).
+
+# From Peter Ilieve (1994-12-04),
+# The original six [EU members]: Belgium, France, (West) Germany, Italy,
+# Luxembourg, the Netherlands.
+# Plus, from 1 Jan 73: Denmark, Ireland, United Kingdom.
+# Plus, from 1 Jan 81: Greece.
+# Plus, from 1 Jan 86: Spain, Portugal.
+# Plus, from 1 Jan 95: Austria, Finland, Sweden. (Norway negotiated terms for
+# entry but in a referendum on 28 Nov 94 the people voted No by 52.2% to 47.8%
+# on a turnout of 88.6%. This was almost the same result as Norway's previous
+# referendum in 1972, they are the only country to have said No twice.
+# Referendums in the other three countries voted Yes.)
+# ...
+# Estonia ... uses EU dates but not at 01:00 GMT, they use midnight GMT.
+# I don't think they know yet what they will do from 1996 onwards.
+# ...
+# There shouldn't be any [current members who are not using EU rules].
+# A Directive has the force of law, member states are obliged to enact
+# national law to implement it. The only contentious issue was the
+# different end date for the UK and Ireland, and this was always allowed
+# in the Directive.
+
+
+###############################################################################
+
+# Britain (United Kingdom) and Ireland (Eire)
+
+# From Peter Ilieve (1994-07-06):
+#
+# On 17 Jan 1994 the Independent, a UK quality newspaper, had a piece about
+# historical vistas along the Thames in west London. There was a photo
+# and a sketch map showing some of the sightlines involved. One paragraph
+# of the text said:
+#
+# `An old stone obelisk marking a forgotten terrestrial meridian stands
+# beside the river at Kew. In the 18th century, before time and longitude
+# was standardised by the Royal Observatory in Greenwich, scholars observed
+# this stone and the movement of stars from Kew Observatory nearby. They
+# made their calculations and set the time for the Horse Guards and Parliament,
+# but now the stone is obscured by scrubwood and can only be seen by walking
+# along the towpath within a few yards of it.'
+#
+# I have a one inch to one mile map of London and my estimate of the stone's
+# position is 51 deg. 28' 30" N, 0 deg. 18' 45" W. The longitude should
+# be within about +-2". The Ordnance Survey grid reference is TQ172761.
+#
+# [This yields GMTOFF = -0:01:15 for London LMT in the 18th century.]
+
+# From Paul Eggert (1993-11-18):
+#
+# Howse writes that Britain was the first country to use standard time.
+# The railways cared most about the inconsistencies of local mean time,
+# and it was they who forced a uniform time on the country.
+# The original idea was credited to Dr. William Hyde Wollaston (1766-1828)
+# and was popularized by Abraham Follett Osler (1808-1903).
+# The first railway to adopt London time was the Great Western Railway
+# in November 1840; other railways followed suit, and by 1847 most
+# (though not all) railways used London time.  On 1847-09-22 the
+# Railway Clearing House, an industry standards body, recommended that GMT be
+# adopted at all stations as soon as the General Post Office permitted it.
+# The transition occurred on 12-01 for the L&NW, the Caledonian,
+# and presumably other railways; the January 1848 Bradshaw's lists many
+# railways as using GMT.  By 1855 the vast majority of public
+# clocks in Britain were set to GMT (though some, like the great clock
+# on Tom Tower at Christ Church, Oxford, were fitted with two minute hands,
+# one for local time and one for GMT).  The last major holdout was the legal
+# system, which stubbornly stuck to local time for many years, leading
+# to oddities like polls opening at 08:13 and closing at 16:13.
+# The legal system finally switched to GMT when the Statutes (Definition
+# of Time) Act took effect; it received the Royal Assent on 1880-08-02.
+#
+# In the tables below, we condense this complicated story into a single
+# transition date for London, namely 1847-12-01.  We don't know as much
+# about Dublin, so we use 1880-08-02, the legal transition time.
+
+# From Paul Eggert (2003-09-27):
+# Summer Time was first seriously proposed by William Willett (1857-1915),
+# a London builder and member of the Royal Astronomical Society
+# who circulated a pamphlet ``The Waste of Daylight'' (1907)
+# that proposed advancing clocks 20 minutes on each of four Sundays in April,
+# and retarding them by the same amount on four Sundays in September.
+# A bill was drafted in 1909 and introduced in Parliament several times,
+# but it met with ridicule and opposition, especially from farming interests.
+# Later editions of the pamphlet proposed one-hour summer time, and
+# it was eventually adopted as a wartime measure in 1916.
+# See: Summer Time Arrives Early, The Times (2000-05-18).
+# A monument to Willett was unveiled on 1927-05-21, in an open space in
+# a 45-acre wood near Chislehurst, Kent that was purchased by popular
+# subscription and open to the public.  On the south face of the monolith,
+# designed by G. W. Miller, is the the William Willett Memorial Sundial,
+# which is permanently set to Summer Time.
+
+# From Winston Churchill (1934-04-28):
+# It is one of the paradoxes of history that we should owe the boon of
+# summer time, which gives every year to the people of this country
+# between 160 and 170 hours more daylight leisure, to a war which
+# plunged Europe into darkness for four years, and shook the
+# foundations of civilization throughout the world.
+#	-- <a href="http://www.winstonchurchill.org/fh114willett.htm">
+#	"A Silent Toast to William Willett", Pictorial Weekly
+#	</a>
+
+# From Paul Eggert (1996-09-03):
+# The OED Supplement says that the English originally said ``Daylight Saving''
+# when they were debating the adoption of DST in 1908; but by 1916 this
+# term appears only in quotes taken from DST's opponents, whereas the
+# proponents (who eventually won the argument) are quoted as using ``Summer''.
+
+# From Arthur David Olson (1989-01-19):
+#
+# A source at the British Information Office in New York avers that it's
+# known as "British" Summer Time in all parts of the United Kingdom.
+
+# Date: 4 Jan 89 08:57:25 GMT (Wed)
+# From: Jonathan Leffler
+# [British Summer Time] is fixed annually by Act of Parliament.
+# If you can predict what Parliament will do, you should be in
+# politics making a fortune, not computing.
+
+# From Chris Carrier (1996-06-14):
+# I remember reading in various wartime issues of the London Times the
+# acronym BDST for British Double Summer Time.  Look for the published
+# time of sunrise and sunset in The Times, when BDST was in effect, and
+# if you find a zone reference it will say, "All times B.D.S.T."
+
+# From Joseph S. Myers (1999-09-02):
+# ... some military cables (WO 219/4100 - this is a copy from the
+# main SHAEF archives held in the US National Archives, SHAEF/5252/8/516)
+# agree that the usage is BDST (this appears in a message dated 17 Feb 1945).
+
+# From Joseph S. Myers (2000-10-03):
+# On 18th April 1941, Sir Stephen Tallents of the BBC wrote to Sir
+# Alexander Maxwell of the Home Office asking whether there was any
+# official designation; the reply of the 21st was that there wasn't
+# but he couldn't think of anything better than the "Double British
+# Summer Time" that the BBC had been using informally.
+# http://student.cusu.cam.ac.uk/~jsm28/british-time/bbc-19410418.png
+# http://student.cusu.cam.ac.uk/~jsm28/british-time/ho-19410421.png
+
+# From Sir Alexander Maxwell in the above-mentioned letter (1941-04-21):
+# [N]o official designation has as far as I know been adopted for the time
+# which is to be introduced in May....
+# I cannot think of anything better than "Double British Summer Time"
+# which could not be said to run counter to any official description.
+
+# From Paul Eggert (2000-10-02):
+# Howse writes (p 157) `DBST' too, but `BDST' seems to have been common
+# and follows the more usual convention of putting the location name first,
+# so we use `BDST'.
+
+# Peter Ilieve (1998-04-19) described at length
+# the history of summer time legislation in the United Kingdom.
+# Since 1998 Joseph S. Myers has been updating
+# and extending this list, which can be found in
+# <a href="http://student.cusu.cam.ac.uk/~jsm28/british-time/">
+# History of legal time in Britain
+# </a>
+
+# From Joseph S. Myers (1998-01-06):
+#
+# The legal time in the UK outside of summer time is definitely GMT, not UTC;
+# see Lord Tanlaw's speech
+# <a href="http://www.parliament.the-stationery-office.co.uk/pa/ld199697/ldhansrd/pdvn/lds97/text/70611-20.htm#70611-20_head0">
+# (Lords Hansard 11 June 1997 columns 964 to 976)
+# </a>.
+
+# From Paul Eggert (2006-03-22):
+#
+# For lack of other data, follow Shanks & Pottenger for Eire in 1940-1948.
+#
+# Given Ilieve and Myers's data, the following claims by Shanks & Pottenger
+# are incorrect:
+#     * Wales did not switch from GMT to daylight saving time until
+#	1921 Apr 3, when they began to conform with the rest of Great Britain.
+# Actually, Wales was identical after 1880.
+#     * Eire had two transitions on 1916 Oct 1.
+# It actually just had one transition.
+#     * Northern Ireland used single daylight saving time throughout WW II.
+# Actually, it conformed to Britain.
+#     * GB-Eire changed standard time to 1 hour ahead of GMT on 1968-02-18.
+# Actually, that date saw the usual switch to summer time.
+# Standard time was not changed until 1968-10-27 (the clocks didn't change).
+#
+# Here is another incorrect claim by Shanks & Pottenger:
+#     * Jersey, Guernsey, and the Isle of Man did not switch from GMT
+#	to daylight saving time until 1921 Apr 3, when they began to
+#	conform with Great Britain.
+# S.R.&O. 1916, No. 382 and HO 45/10811/312364 (quoted above) say otherwise.
+#
+# The following claim by Shanks & Pottenger is possible though doubtful;
+# we'll ignore it for now.
+#     * Dublin's 1971-10-31 switch was at 02:00, even though London's was 03:00.
+#
+#
+# Whitman says Dublin Mean Time was -0:25:21, which is more precise than
+# Shanks & Pottenger.
+# Perhaps this was Dunsink Observatory Time, as Dunsink Observatory
+# (8 km NW of Dublin's center) seemingly was to Dublin as Greenwich was
+# to London.  For example:
+#
+#   "Timeball on the ballast office is down.  Dunsink time."
+#   -- James Joyce, Ulysses
+
+# From Joseph S. Myers (2005-01-26):
+# Irish laws are available online at www.irishstatutebook.ie.  These include
+# various relating to legal time, for example:
+#
+# ZZA13Y1923.html ZZA12Y1924.html ZZA8Y1925.html ZZSIV20PG1267.html
+#
+# ZZSI71Y1947.html ZZSI128Y1948.html ZZSI23Y1949.html ZZSI41Y1950.html
+# ZZSI27Y1951.html ZZSI73Y1952.html
+#
+# ZZSI11Y1961.html ZZSI232Y1961.html ZZSI182Y1962.html
+# ZZSI167Y1963.html ZZSI257Y1964.html ZZSI198Y1967.html
+# ZZA23Y1968.html ZZA17Y1971.html
+#
+# ZZSI67Y1981.html ZZSI212Y1982.html ZZSI45Y1986.html
+# ZZSI264Y1988.html ZZSI52Y1990.html ZZSI371Y1992.html
+# ZZSI395Y1994.html ZZSI484Y1997.html ZZSI506Y2001.html
+#
+# [These are all relative to the root, e.g., the first is
+# <http://www.irishstatutebook.ie/ZZA13Y1923.html>.]
+#
+# (These are those I found, but there could be more.  In any case these
+# should allow various updates to the comments in the europe file to cover
+# the laws applicable in Ireland.)
+#
+# (Note that the time in the Republic of Ireland since 1968 has been defined
+# in terms of standard time being GMT+1 with a period of winter time when it
+# is GMT, rather than standard time being GMT with a period of summer time
+# being GMT+1.)
+
+# From Paul Eggert (1999-03-28):
+# Clive Feather (<news:859845706.26043.0@office.demon.net>, 1997-03-31)
+# reports that Folkestone (Cheriton) Shuttle Terminal uses Concession Time
+# (CT), equivalent to French civil time.
+# Julian Hill (<news:36118128.5A14@virgin.net>, 1998-09-30) reports that
+# trains between Dollands Moor (the freight facility next door)
+# and Frethun run in CT.
+# My admittedly uninformed guess is that the terminal has two authorities,
+# the French concession operators and the British civil authorities,
+# and that the time depends on who you're talking to.
+# If, say, the British police were called to the station for some reason,
+# I would expect the official police report to use GMT/BST and not CET/CEST.
+# This is a borderline case, but for now let's stick to GMT/BST.
+
+# From an anonymous contributor (1996-06-02):
+# The law governing time in Ireland is under Statutory Instrument SI 395/94,
+# which gives force to European Union 7th Council Directive # 94/21/EC.
+# Under this directive, the Minister for Justice in Ireland makes appropriate
+# regulations. I spoke this morning with the Secretary of the Department of
+# Justice (tel +353 1 678 9711) who confirmed to me that the correct name is
+# "Irish Summer Time", abbreviated to "IST".
+
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+# Summer Time Act, 1916
+Rule	GB-Eire	1916	only	-	May	21	2:00s	1:00	BST
+Rule	GB-Eire	1916	only	-	Oct	 1	2:00s	0	GMT
+# S.R.&O. 1917, No. 358
+Rule	GB-Eire	1917	only	-	Apr	 8	2:00s	1:00	BST
+Rule	GB-Eire	1917	only	-	Sep	17	2:00s	0	GMT
+# S.R.&O. 1918, No. 274
+Rule	GB-Eire	1918	only	-	Mar	24	2:00s	1:00	BST
+Rule	GB-Eire	1918	only	-	Sep	30	2:00s	0	GMT
+# S.R.&O. 1919, No. 297
+Rule	GB-Eire	1919	only	-	Mar	30	2:00s	1:00	BST
+Rule	GB-Eire	1919	only	-	Sep	29	2:00s	0	GMT
+# S.R.&O. 1920, No. 458
+Rule	GB-Eire	1920	only	-	Mar	28	2:00s	1:00	BST
+# S.R.&O. 1920, No. 1844
+Rule	GB-Eire	1920	only	-	Oct	25	2:00s	0	GMT
+# S.R.&O. 1921, No. 363
+Rule	GB-Eire	1921	only	-	Apr	 3	2:00s	1:00	BST
+Rule	GB-Eire	1921	only	-	Oct	 3	2:00s	0	GMT
+# S.R.&O. 1922, No. 264
+Rule	GB-Eire	1922	only	-	Mar	26	2:00s	1:00	BST
+Rule	GB-Eire	1922	only	-	Oct	 8	2:00s	0	GMT
+# The Summer Time Act, 1922
+Rule	GB-Eire	1923	only	-	Apr	Sun>=16	2:00s	1:00	BST
+Rule	GB-Eire	1923	1924	-	Sep	Sun>=16	2:00s	0	GMT
+Rule	GB-Eire	1924	only	-	Apr	Sun>=9	2:00s	1:00	BST
+Rule	GB-Eire	1925	1926	-	Apr	Sun>=16	2:00s	1:00	BST
+# The Summer Time Act, 1925
+Rule	GB-Eire	1925	1938	-	Oct	Sun>=2	2:00s	0	GMT
+Rule	GB-Eire	1927	only	-	Apr	Sun>=9	2:00s	1:00	BST
+Rule	GB-Eire	1928	1929	-	Apr	Sun>=16	2:00s	1:00	BST
+Rule	GB-Eire	1930	only	-	Apr	Sun>=9	2:00s	1:00	BST
+Rule	GB-Eire	1931	1932	-	Apr	Sun>=16	2:00s	1:00	BST
+Rule	GB-Eire	1933	only	-	Apr	Sun>=9	2:00s	1:00	BST
+Rule	GB-Eire	1934	only	-	Apr	Sun>=16	2:00s	1:00	BST
+Rule	GB-Eire	1935	only	-	Apr	Sun>=9	2:00s	1:00	BST
+Rule	GB-Eire	1936	1937	-	Apr	Sun>=16	2:00s	1:00	BST
+Rule	GB-Eire	1938	only	-	Apr	Sun>=9	2:00s	1:00	BST
+Rule	GB-Eire	1939	only	-	Apr	Sun>=16	2:00s	1:00	BST
+# S.R.&O. 1939, No. 1379
+Rule	GB-Eire	1939	only	-	Nov	Sun>=16	2:00s	0	GMT
+# S.R.&O. 1940, No. 172 and No. 1883
+Rule	GB-Eire	1940	only	-	Feb	Sun>=23	2:00s	1:00	BST
+# S.R.&O. 1941, No. 476
+Rule	GB-Eire	1941	only	-	May	Sun>=2	1:00s	2:00	BDST
+Rule	GB-Eire	1941	1943	-	Aug	Sun>=9	1:00s	1:00	BST
+# S.R.&O. 1942, No. 506
+Rule	GB-Eire	1942	1944	-	Apr	Sun>=2	1:00s	2:00	BDST
+# S.R.&O. 1944, No. 932
+Rule	GB-Eire	1944	only	-	Sep	Sun>=16	1:00s	1:00	BST
+# S.R.&O. 1945, No. 312
+Rule	GB-Eire	1945	only	-	Apr	Mon>=2	1:00s	2:00	BDST
+Rule	GB-Eire	1945	only	-	Jul	Sun>=9	1:00s	1:00	BST
+# S.R.&O. 1945, No. 1208
+Rule	GB-Eire	1945	1946	-	Oct	Sun>=2	2:00s	0	GMT
+Rule	GB-Eire	1946	only	-	Apr	Sun>=9	2:00s	1:00	BST
+# The Summer Time Act, 1947
+Rule	GB-Eire	1947	only	-	Mar	16	2:00s	1:00	BST
+Rule	GB-Eire	1947	only	-	Apr	13	1:00s	2:00	BDST
+Rule	GB-Eire	1947	only	-	Aug	10	1:00s	1:00	BST
+Rule	GB-Eire	1947	only	-	Nov	 2	2:00s	0	GMT
+# Summer Time Order, 1948 (S.I. 1948/495)
+Rule	GB-Eire	1948	only	-	Mar	14	2:00s	1:00	BST
+Rule	GB-Eire	1948	only	-	Oct	31	2:00s	0	GMT
+# Summer Time Order, 1949 (S.I. 1949/373)
+Rule	GB-Eire	1949	only	-	Apr	 3	2:00s	1:00	BST
+Rule	GB-Eire	1949	only	-	Oct	30	2:00s	0	GMT
+# Summer Time Order, 1950 (S.I. 1950/518)
+# Summer Time Order, 1951 (S.I. 1951/430)
+# Summer Time Order, 1952 (S.I. 1952/451)
+Rule	GB-Eire	1950	1952	-	Apr	Sun>=14	2:00s	1:00	BST
+Rule	GB-Eire	1950	1952	-	Oct	Sun>=21	2:00s	0	GMT
+# revert to the rules of the Summer Time Act, 1925
+Rule	GB-Eire	1953	only	-	Apr	Sun>=16	2:00s	1:00	BST
+Rule	GB-Eire	1953	1960	-	Oct	Sun>=2	2:00s	0	GMT
+Rule	GB-Eire	1954	only	-	Apr	Sun>=9	2:00s	1:00	BST
+Rule	GB-Eire	1955	1956	-	Apr	Sun>=16	2:00s	1:00	BST
+Rule	GB-Eire	1957	only	-	Apr	Sun>=9	2:00s	1:00	BST
+Rule	GB-Eire	1958	1959	-	Apr	Sun>=16	2:00s	1:00	BST
+Rule	GB-Eire	1960	only	-	Apr	Sun>=9	2:00s	1:00	BST
+# Summer Time Order, 1961 (S.I. 1961/71)
+# Summer Time (1962) Order, 1961 (S.I. 1961/2465)
+# Summer Time Order, 1963 (S.I. 1963/81)
+Rule	GB-Eire	1961	1963	-	Mar	lastSun	2:00s	1:00	BST
+Rule	GB-Eire	1961	1968	-	Oct	Sun>=23	2:00s	0	GMT
+# Summer Time (1964) Order, 1963 (S.I. 1963/2101)
+# Summer Time Order, 1964 (S.I. 1964/1201)
+# Summer Time Order, 1967 (S.I. 1967/1148)
+Rule	GB-Eire	1964	1967	-	Mar	Sun>=19	2:00s	1:00	BST
+# Summer Time Order, 1968 (S.I. 1968/117)
+Rule	GB-Eire	1968	only	-	Feb	18	2:00s	1:00	BST
+# The British Standard Time Act, 1968
+#	(no summer time)
+# The Summer Time Act, 1972
+Rule	GB-Eire	1972	1980	-	Mar	Sun>=16	2:00s	1:00	BST
+Rule	GB-Eire	1972	1980	-	Oct	Sun>=23	2:00s	0	GMT
+# Summer Time Order, 1980 (S.I. 1980/1089)
+# Summer Time Order, 1982 (S.I. 1982/1673)
+# Summer Time Order, 1986 (S.I. 1986/223)
+# Summer Time Order, 1988 (S.I. 1988/931)
+Rule	GB-Eire	1981	1995	-	Mar	lastSun	1:00u	1:00	BST
+Rule	GB-Eire 1981	1989	-	Oct	Sun>=23	1:00u	0	GMT
+# Summer Time Order, 1989 (S.I. 1989/985)
+# Summer Time Order, 1992 (S.I. 1992/1729)
+# Summer Time Order 1994 (S.I. 1994/2798)
+Rule	GB-Eire 1990	1995	-	Oct	Sun>=22	1:00u	0	GMT
+# Summer Time Order 1997 (S.I. 1997/2982)
+# See EU for rules starting in 1996.
+
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Europe/London	-0:01:15 -	LMT	1847 Dec  1 0:00s
+			 0:00	GB-Eire	%s	1968 Oct 27
+			 1:00	-	BST	1971 Oct 31 2:00u
+			 0:00	GB-Eire	%s	1996
+			 0:00	EU	GMT/BST
+Link	Europe/London	Europe/Jersey
+Link	Europe/London	Europe/Guernsey
+Link	Europe/London	Europe/Isle_of_Man
+Zone	Europe/Dublin	-0:25:00 -	LMT	1880 Aug  2
+			-0:25:21 -	DMT	1916 May 21 2:00
+			-0:25:21 1:00	IST	1916 Oct  1 2:00s
+			 0:00	GB-Eire	%s	1921 Dec  6 # independence
+			 0:00	GB-Eire	GMT/IST	1940 Feb 25 2:00
+			 0:00	1:00	IST	1946 Oct  6 2:00
+			 0:00	-	GMT	1947 Mar 16 2:00
+			 0:00	1:00	IST	1947 Nov  2 2:00
+			 0:00	-	GMT	1948 Apr 18 2:00
+			 0:00	GB-Eire	GMT/IST	1968 Oct 27
+			 1:00	-	IST	1971 Oct 31 2:00u
+			 0:00	GB-Eire	GMT/IST	1996
+			 0:00	EU	GMT/IST
+
+###############################################################################
+
+# Europe
+
+# EU rules are for the European Union, previously known as the EC, EEC,
+# Common Market, etc.
+
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	EU	1977	1980	-	Apr	Sun>=1	 1:00u	1:00	S
+Rule	EU	1977	only	-	Sep	lastSun	 1:00u	0	-
+Rule	EU	1978	only	-	Oct	 1	 1:00u	0	-
+Rule	EU	1979	1995	-	Sep	lastSun	 1:00u	0	-
+Rule	EU	1981	max	-	Mar	lastSun	 1:00u	1:00	S
+Rule	EU	1996	max	-	Oct	lastSun	 1:00u	0	-
+# The most recent directive covers the years starting in 2002.  See:
+# <a="http://eur-lex.europa.eu/LexUriServ/LexUriServ.do?uri=CELEX:32000L0084:EN:NOT">
+# Directive 2000/84/EC of the European Parliament and of the Council
+# of 19 January 2001 on summer-time arrangements.
+# </a>
+
+# W-Eur differs from EU only in that W-Eur uses standard time.
+Rule	W-Eur	1977	1980	-	Apr	Sun>=1	 1:00s	1:00	S
+Rule	W-Eur	1977	only	-	Sep	lastSun	 1:00s	0	-
+Rule	W-Eur	1978	only	-	Oct	 1	 1:00s	0	-
+Rule	W-Eur	1979	1995	-	Sep	lastSun	 1:00s	0	-
+Rule	W-Eur	1981	max	-	Mar	lastSun	 1:00s	1:00	S
+Rule	W-Eur	1996	max	-	Oct	lastSun	 1:00s	0	-
+
+# Older C-Eur rules are for convenience in the tables.
+# From 1977 on, C-Eur differs from EU only in that C-Eur uses standard time.
+Rule	C-Eur	1916	only	-	Apr	30	23:00	1:00	S
+Rule	C-Eur	1916	only	-	Oct	 1	 1:00	0	-
+Rule	C-Eur	1917	1918	-	Apr	Mon>=15	 2:00s	1:00	S
+Rule	C-Eur	1917	1918	-	Sep	Mon>=15	 2:00s	0	-
+Rule	C-Eur	1940	only	-	Apr	 1	 2:00s	1:00	S
+Rule	C-Eur	1942	only	-	Nov	 2	 2:00s	0	-
+Rule	C-Eur	1943	only	-	Mar	29	 2:00s	1:00	S
+Rule	C-Eur	1943	only	-	Oct	 4	 2:00s	0	-
+Rule	C-Eur	1944	1945	-	Apr	Mon>=1	 2:00s	1:00	S
+# Whitman gives 1944 Oct 7; go with Shanks & Pottenger.
+Rule	C-Eur	1944	only	-	Oct	 2	 2:00s	0	-
+# From Jesper Norgaard Welen (2008-07-13):
+#
+# I found what is probably a typo of 2:00 which should perhaps be 2:00s
+# in the C-Eur rule from tz database version 2008d (this part was
+# corrected in version 2008d). The circumstancial evidence is simply the
+# tz database itself, as seen below:
+#
+# Zone Europe/Paris 0:09:21 - LMT 1891 Mar 15  0:01
+#    0:00 France WE%sT 1945 Sep 16  3:00
+#
+# Zone Europe/Monaco 0:29:32 - LMT 1891 Mar 15
+#    0:00 France WE%sT 1945 Sep 16 3:00
+#
+# Zone Europe/Belgrade 1:22:00 - LMT 1884
+#    1:00 1:00 CEST 1945 Sep 16  2:00s
+#
+# Rule France 1945 only - Sep 16  3:00 0 -
+# Rule Belgium 1945 only - Sep 16  2:00s 0 -
+# Rule Neth 1945 only - Sep 16 2:00s 0 -
+#
+# The rule line to be changed is:
+#
+# Rule C-Eur 1945 only - Sep 16  2:00 0 -
+#
+# It seems that Paris, Monaco, Rule France, Rule Belgium all agree on
+# 2:00 standard time, e.g. 3:00 local time.  However there are no
+# countries that use C-Eur rules in September 1945, so the only items
+# affected are apparently these ficticious zones that translates acronyms
+# CET and MET:
+#
+# Zone CET  1:00 C-Eur CE%sT
+# Zone MET  1:00 C-Eur ME%sT
+#
+# It this is right then the corrected version would look like:
+#
+# Rule C-Eur 1945 only - Sep 16  2:00s 0 -
+#
+# A small step for mankind though 8-)
+Rule	C-Eur	1945	only	-	Sep	16	 2:00s	0	-
+Rule	C-Eur	1977	1980	-	Apr	Sun>=1	 2:00s	1:00	S
+Rule	C-Eur	1977	only	-	Sep	lastSun	 2:00s	0	-
+Rule	C-Eur	1978	only	-	Oct	 1	 2:00s	0	-
+Rule	C-Eur	1979	1995	-	Sep	lastSun	 2:00s	0	-
+Rule	C-Eur	1981	max	-	Mar	lastSun	 2:00s	1:00	S
+Rule	C-Eur	1996	max	-	Oct	lastSun	 2:00s	0	-
+
+# E-Eur differs from EU only in that E-Eur switches at midnight local time.
+Rule	E-Eur	1977	1980	-	Apr	Sun>=1	 0:00	1:00	S
+Rule	E-Eur	1977	only	-	Sep	lastSun	 0:00	0	-
+Rule	E-Eur	1978	only	-	Oct	 1	 0:00	0	-
+Rule	E-Eur	1979	1995	-	Sep	lastSun	 0:00	0	-
+Rule	E-Eur	1981	max	-	Mar	lastSun	 0:00	1:00	S
+Rule	E-Eur	1996	max	-	Oct	lastSun	 0:00	0	-
+
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Russia	1917	only	-	Jul	 1	23:00	1:00	MST	# Moscow Summer Time
+Rule	Russia	1917	only	-	Dec	28	 0:00	0	MMT	# Moscow Mean Time
+Rule	Russia	1918	only	-	May	31	22:00	2:00	MDST	# Moscow Double Summer Time
+Rule	Russia	1918	only	-	Sep	16	 1:00	1:00	MST
+Rule	Russia	1919	only	-	May	31	23:00	2:00	MDST
+Rule	Russia	1919	only	-	Jul	 1	 2:00	1:00	S
+Rule	Russia	1919	only	-	Aug	16	 0:00	0	-
+Rule	Russia	1921	only	-	Feb	14	23:00	1:00	S
+Rule	Russia	1921	only	-	Mar	20	23:00	2:00	M # Midsummer
+Rule	Russia	1921	only	-	Sep	 1	 0:00	1:00	S
+Rule	Russia	1921	only	-	Oct	 1	 0:00	0	-
+# Act No.925 of the Council of Ministers of the USSR (1980-10-24):
+Rule	Russia	1981	1984	-	Apr	 1	 0:00	1:00	S
+Rule	Russia	1981	1983	-	Oct	 1	 0:00	0	-
+# Act No.967 of the Council of Ministers of the USSR (1984-09-13), repeated in
+# Act No.227 of the Council of Ministers of the USSR (1989-03-14):
+Rule	Russia	1984	1991	-	Sep	lastSun	 2:00s	0	-
+Rule	Russia	1985	1991	-	Mar	lastSun	 2:00s	1:00	S
+#
+Rule	Russia	1992	only	-	Mar	lastSat	 23:00	1:00	S
+Rule	Russia	1992	only	-	Sep	lastSat	 23:00	0	-
+Rule	Russia	1993	max	-	Mar	lastSun	 2:00s	1:00	S
+Rule	Russia	1993	1995	-	Sep	lastSun	 2:00s	0	-
+Rule	Russia	1996	max	-	Oct	lastSun	 2:00s	0	-
+
+# These are for backward compatibility with older versions.
+
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	WET		0:00	EU	WE%sT
+Zone	CET		1:00	C-Eur	CE%sT
+Zone	MET		1:00	C-Eur	ME%sT
+Zone	EET		2:00	EU	EE%sT
+
+# Previous editions of this database used abbreviations like MET DST
+# for Central European Summer Time, but this didn't agree with common usage.
+
+# From Markus Kuhn (1996-07-12):
+# The official German names ... are
+#
+#	Mitteleuropaeische Zeit (MEZ)         = UTC+01:00
+#	Mitteleuropaeische Sommerzeit (MESZ)  = UTC+02:00
+#
+# as defined in the German Time Act (Gesetz ueber die Zeitbestimmung (ZeitG),
+# 1978-07-25, Bundesgesetzblatt, Jahrgang 1978, Teil I, S. 1110-1111)....
+# I wrote ... to the German Federal Physical-Technical Institution
+#
+#	Physikalisch-Technische Bundesanstalt (PTB)
+#	Laboratorium 4.41 "Zeiteinheit"
+#	Postfach 3345
+#	D-38023 Braunschweig
+#	phone: +49 531 592-0
+#
+# ... I received today an answer letter from Dr. Peter Hetzel, head of the PTB
+# department for time and frequency transmission.  He explained that the
+# PTB translates MEZ and MESZ into English as
+#
+#	Central European Time (CET)         = UTC+01:00
+#	Central European Summer Time (CEST) = UTC+02:00
+
+
+# Albania
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Albania	1940	only	-	Jun	16	0:00	1:00	S
+Rule	Albania	1942	only	-	Nov	 2	3:00	0	-
+Rule	Albania	1943	only	-	Mar	29	2:00	1:00	S
+Rule	Albania	1943	only	-	Apr	10	3:00	0	-
+Rule	Albania	1974	only	-	May	 4	0:00	1:00	S
+Rule	Albania	1974	only	-	Oct	 2	0:00	0	-
+Rule	Albania	1975	only	-	May	 1	0:00	1:00	S
+Rule	Albania	1975	only	-	Oct	 2	0:00	0	-
+Rule	Albania	1976	only	-	May	 2	0:00	1:00	S
+Rule	Albania	1976	only	-	Oct	 3	0:00	0	-
+Rule	Albania	1977	only	-	May	 8	0:00	1:00	S
+Rule	Albania	1977	only	-	Oct	 2	0:00	0	-
+Rule	Albania	1978	only	-	May	 6	0:00	1:00	S
+Rule	Albania	1978	only	-	Oct	 1	0:00	0	-
+Rule	Albania	1979	only	-	May	 5	0:00	1:00	S
+Rule	Albania	1979	only	-	Sep	30	0:00	0	-
+Rule	Albania	1980	only	-	May	 3	0:00	1:00	S
+Rule	Albania	1980	only	-	Oct	 4	0:00	0	-
+Rule	Albania	1981	only	-	Apr	26	0:00	1:00	S
+Rule	Albania	1981	only	-	Sep	27	0:00	0	-
+Rule	Albania	1982	only	-	May	 2	0:00	1:00	S
+Rule	Albania	1982	only	-	Oct	 3	0:00	0	-
+Rule	Albania	1983	only	-	Apr	18	0:00	1:00	S
+Rule	Albania	1983	only	-	Oct	 1	0:00	0	-
+Rule	Albania	1984	only	-	Apr	 1	0:00	1:00	S
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Europe/Tirane	1:19:20 -	LMT	1914
+			1:00	-	CET	1940 Jun 16
+			1:00	Albania	CE%sT	1984 Jul
+			1:00	EU	CE%sT
+
+# Andorra
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Europe/Andorra	0:06:04 -	LMT	1901
+			0:00	-	WET	1946 Sep 30
+			1:00	-	CET	1985 Mar 31 2:00
+			1:00	EU	CE%sT
+
+# Austria
+
+# From Paul Eggert (2006-03-22): Shanks & Pottenger give 1918-06-16 and
+# 1945-11-18, but the Austrian Federal Office of Metrology and
+# Surveying (BEV) gives 1918-09-16 and for Vienna gives the "alleged"
+# date of 1945-04-12 with no time.  For the 1980-04-06 transition
+# Shanks & Pottenger give 02:00, the BEV 00:00.  Go with the BEV,
+# and guess 02:00 for 1945-04-12.
+
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Austria	1920	only	-	Apr	 5	2:00s	1:00	S
+Rule	Austria	1920	only	-	Sep	13	2:00s	0	-
+Rule	Austria	1946	only	-	Apr	14	2:00s	1:00	S
+Rule	Austria	1946	1948	-	Oct	Sun>=1	2:00s	0	-
+Rule	Austria	1947	only	-	Apr	 6	2:00s	1:00	S
+Rule	Austria	1948	only	-	Apr	18	2:00s	1:00	S
+Rule	Austria	1980	only	-	Apr	 6	0:00	1:00	S
+Rule	Austria	1980	only	-	Sep	28	0:00	0	-
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Europe/Vienna	1:05:20 -	LMT	1893 Apr
+			1:00	C-Eur	CE%sT	1920
+			1:00	Austria	CE%sT	1940 Apr  1 2:00s
+			1:00	C-Eur	CE%sT	1945 Apr  2 2:00s
+			1:00	1:00	CEST	1945 Apr 12 2:00s
+			1:00	-	CET	1946
+			1:00	Austria	CE%sT	1981
+			1:00	EU	CE%sT
+
+# Belarus
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Europe/Minsk	1:50:16 -	LMT	1880
+			1:50	-	MMT	1924 May 2 # Minsk Mean Time
+			2:00	-	EET	1930 Jun 21
+			3:00	-	MSK	1941 Jun 28
+			1:00	C-Eur	CE%sT	1944 Jul  3
+			3:00	Russia	MSK/MSD	1990
+			3:00	-	MSK	1991 Mar 31 2:00s
+			2:00	1:00	EEST	1991 Sep 29 2:00s
+			2:00	-	EET	1992 Mar 29 0:00s
+			2:00	1:00	EEST	1992 Sep 27 0:00s
+			2:00	Russia	EE%sT
+
+# Belgium
+#
+# From Paul Eggert (1997-07-02):
+# Entries from 1918 through 1991 are taken from:
+#	Annuaire de L'Observatoire Royal de Belgique,
+#	Avenue Circulaire, 3, B-1180 BRUXELLES, CLVIIe annee, 1991
+#	(Imprimerie HAYEZ, s.p.r.l., Rue Fin, 4, 1080 BRUXELLES, MCMXC),
+#	pp 8-9.
+# LMT before 1892 was 0:17:30, according to the official journal of Belgium:
+#	Moniteur Belge, Samedi 30 Avril 1892, N.121.
+# Thanks to Pascal Delmoitie for these references.
+# The 1918 rules are listed for completeness; they apply to unoccupied Belgium.
+# Assume Brussels switched to WET in 1918 when the armistice took effect.
+#
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Belgium	1918	only	-	Mar	 9	 0:00s	1:00	S
+Rule	Belgium	1918	1919	-	Oct	Sat>=1	23:00s	0	-
+Rule	Belgium	1919	only	-	Mar	 1	23:00s	1:00	S
+Rule	Belgium	1920	only	-	Feb	14	23:00s	1:00	S
+Rule	Belgium	1920	only	-	Oct	23	23:00s	0	-
+Rule	Belgium	1921	only	-	Mar	14	23:00s	1:00	S
+Rule	Belgium	1921	only	-	Oct	25	23:00s	0	-
+Rule	Belgium	1922	only	-	Mar	25	23:00s	1:00	S
+Rule	Belgium	1922	1927	-	Oct	Sat>=1	23:00s	0	-
+Rule	Belgium	1923	only	-	Apr	21	23:00s	1:00	S
+Rule	Belgium	1924	only	-	Mar	29	23:00s	1:00	S
+Rule	Belgium	1925	only	-	Apr	 4	23:00s	1:00	S
+# DSH writes that a royal decree of 1926-02-22 specified the Sun following 3rd
+# Sat in Apr (except if it's Easter, in which case it's one Sunday earlier),
+# to Sun following 1st Sat in Oct, and that a royal decree of 1928-09-15
+# changed the transition times to 02:00 GMT.
+Rule	Belgium	1926	only	-	Apr	17	23:00s	1:00	S
+Rule	Belgium	1927	only	-	Apr	 9	23:00s	1:00	S
+Rule	Belgium	1928	only	-	Apr	14	23:00s	1:00	S
+Rule	Belgium	1928	1938	-	Oct	Sun>=2	 2:00s	0	-
+Rule	Belgium	1929	only	-	Apr	21	 2:00s	1:00	S
+Rule	Belgium	1930	only	-	Apr	13	 2:00s	1:00	S
+Rule	Belgium	1931	only	-	Apr	19	 2:00s	1:00	S
+Rule	Belgium	1932	only	-	Apr	 3	 2:00s	1:00	S
+Rule	Belgium	1933	only	-	Mar	26	 2:00s	1:00	S
+Rule	Belgium	1934	only	-	Apr	 8	 2:00s	1:00	S
+Rule	Belgium	1935	only	-	Mar	31	 2:00s	1:00	S
+Rule	Belgium	1936	only	-	Apr	19	 2:00s	1:00	S
+Rule	Belgium	1937	only	-	Apr	 4	 2:00s	1:00	S
+Rule	Belgium	1938	only	-	Mar	27	 2:00s	1:00	S
+Rule	Belgium	1939	only	-	Apr	16	 2:00s	1:00	S
+Rule	Belgium	1939	only	-	Nov	19	 2:00s	0	-
+Rule	Belgium	1940	only	-	Feb	25	 2:00s	1:00	S
+Rule	Belgium	1944	only	-	Sep	17	 2:00s	0	-
+Rule	Belgium	1945	only	-	Apr	 2	 2:00s	1:00	S
+Rule	Belgium	1945	only	-	Sep	16	 2:00s	0	-
+Rule	Belgium	1946	only	-	May	19	 2:00s	1:00	S
+Rule	Belgium	1946	only	-	Oct	 7	 2:00s	0	-
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Europe/Brussels	0:17:30 -	LMT	1880
+			0:17:30	-	BMT	1892 May  1 12:00 # Brussels MT
+			0:00	-	WET	1914 Nov  8
+			1:00	-	CET	1916 May  1  0:00
+			1:00	C-Eur	CE%sT	1918 Nov 11 11:00u
+			0:00	Belgium	WE%sT	1940 May 20  2:00s
+			1:00	C-Eur	CE%sT	1944 Sep  3
+			1:00	Belgium	CE%sT	1977
+			1:00	EU	CE%sT
+
+# Bosnia and Herzegovina
+# see Serbia
+
+# Bulgaria
+#
+# From Plamen Simenov via Steffen Thorsen (1999-09-09):
+# A document of Government of Bulgaria (No.94/1997) says:
+# EET --> EETDST is in 03:00 Local time in last Sunday of March ...
+# EETDST --> EET is in 04:00 Local time in last Sunday of October
+#
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Bulg	1979	only	-	Mar	31	23:00	1:00	S
+Rule	Bulg	1979	only	-	Oct	 1	 1:00	0	-
+Rule	Bulg	1980	1982	-	Apr	Sat>=1	23:00	1:00	S
+Rule	Bulg	1980	only	-	Sep	29	 1:00	0	-
+Rule	Bulg	1981	only	-	Sep	27	 2:00	0	-
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Europe/Sofia	1:33:16 -	LMT	1880
+			1:56:56	-	IMT	1894 Nov 30 # Istanbul MT?
+			2:00	-	EET	1942 Nov  2  3:00
+			1:00	C-Eur	CE%sT	1945
+			1:00	-	CET	1945 Apr 2 3:00
+			2:00	-	EET	1979 Mar 31 23:00
+			2:00	Bulg	EE%sT	1982 Sep 26  2:00
+			2:00	C-Eur	EE%sT	1991
+			2:00	E-Eur	EE%sT	1997
+			2:00	EU	EE%sT
+
+# Croatia
+# see Serbia
+
+# Cyprus
+# Please see the `asia' file for Asia/Nicosia.
+
+# Czech Republic
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Czech	1945	only	-	Apr	 8	2:00s	1:00	S
+Rule	Czech	1945	only	-	Nov	18	2:00s	0	-
+Rule	Czech	1946	only	-	May	 6	2:00s	1:00	S
+Rule	Czech	1946	1949	-	Oct	Sun>=1	2:00s	0	-
+Rule	Czech	1947	only	-	Apr	20	2:00s	1:00	S
+Rule	Czech	1948	only	-	Apr	18	2:00s	1:00	S
+Rule	Czech	1949	only	-	Apr	 9	2:00s	1:00	S
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Europe/Prague	0:57:44 -	LMT	1850
+			0:57:44	-	PMT	1891 Oct     # Prague Mean Time
+			1:00	C-Eur	CE%sT	1944 Sep 17 2:00s
+			1:00	Czech	CE%sT	1979
+			1:00	EU	CE%sT
+
+# Denmark, Faroe Islands, and Greenland
+
+# From Jesper Norgaard Welen (2005-04-26):
+# http://www.hum.aau.dk/~poe/tid/tine/DanskTid.htm says that the law
+# [introducing standard time] was in effect from 1894-01-01....
+# The page http://www.retsinfo.dk/_GETDOCI_/ACCN/A18930008330-REGL
+# confirms this, and states that the law was put forth 1893-03-29.
+#
+# The EU treaty with effect from 1973:
+# http://www.retsinfo.dk/_GETDOCI_/ACCN/A19722110030-REGL
+#
+# This provoked a new law from 1974 to make possible summer time changes
+# in subsequenet decrees with the law
+# http://www.retsinfo.dk/_GETDOCI_/ACCN/A19740022330-REGL
+#
+# It seems however that no decree was set forward until 1980.  I have
+# not found any decree, but in another related law, the effecting DST
+# changes are stated explicitly to be from 1980-04-06 at 02:00 to
+# 1980-09-28 at 02:00.  If this is true, this differs slightly from
+# the EU rule in that DST runs to 02:00, not 03:00.  We don't know
+# when Denmark began using the EU rule correctly, but we have only
+# confirmation of the 1980-time, so I presume it was correct in 1981:
+# The law is about the management of the extra hour, concerning
+# working hours reported and effect on obligatory-rest rules (which
+# was suspended on that night):
+# http://www.retsinfo.dk/_GETDOCI_/ACCN/C19801120554-REGL
+
+# From Jesper Norgaard Welen (2005-06-11):
+# The Herning Folkeblad (1980-09-26) reported that the night between
+# Saturday and Sunday the clock is set back from three to two.
+
+# From Paul Eggert (2005-06-11):
+# Hence the "02:00" of the 1980 law refers to standard time, not
+# wall-clock time, and so the EU rules were in effect in 1980.
+
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Denmark	1916	only	-	May	14	23:00	1:00	S
+Rule	Denmark	1916	only	-	Sep	30	23:00	0	-
+Rule	Denmark	1940	only	-	May	15	 0:00	1:00	S
+Rule	Denmark	1945	only	-	Apr	 2	 2:00s	1:00	S
+Rule	Denmark	1945	only	-	Aug	15	 2:00s	0	-
+Rule	Denmark	1946	only	-	May	 1	 2:00s	1:00	S
+Rule	Denmark	1946	only	-	Sep	 1	 2:00s	0	-
+Rule	Denmark	1947	only	-	May	 4	 2:00s	1:00	S
+Rule	Denmark	1947	only	-	Aug	10	 2:00s	0	-
+Rule	Denmark	1948	only	-	May	 9	 2:00s	1:00	S
+Rule	Denmark	1948	only	-	Aug	 8	 2:00s	0	-
+#
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone Europe/Copenhagen	 0:50:20 -	LMT	1890
+			 0:50:20 -	CMT	1894 Jan  1 # Copenhagen MT
+			 1:00	Denmark	CE%sT	1942 Nov  2 2:00s
+			 1:00	C-Eur	CE%sT	1945 Apr  2 2:00
+			 1:00	Denmark	CE%sT	1980
+			 1:00	EU	CE%sT
+Zone Atlantic/Faroe	-0:27:04 -	LMT	1908 Jan 11	# Torshavn
+			 0:00	-	WET	1981
+			 0:00	EU	WE%sT
+#
+# From Paul Eggert (2004-10-31):
+# During World War II, Germany maintained secret manned weather stations in
+# East Greenland and Franz Josef Land, but we don't know their time zones.
+# My source for this is Wilhelm Dege's book mentioned under Svalbard.
+#
+# From Paul Eggert (2006-03-22):
+# Greenland joined the EU as part of Denmark, obtained home rule on 1979-05-01,
+# and left the EU on 1985-02-01.  It therefore should have been using EU
+# rules at least through 1984.  Shanks & Pottenger say Scoresbysund and Godthab
+# used C-Eur rules after 1980, but IATA SSIM (1991/1996) says they use EU
+# rules since at least 1991.  Assume EU rules since 1980.
+
+# From Gwillin Law (2001-06-06), citing
+# <http://www.statkart.no/efs/efshefter/2001/efs5-2001.pdf> (2001-03-15),
+# and with translations corrected by Steffen Thorsen:
+#
+# Greenland has four local times, and the relation to UTC
+# is according to the following time line:
+#
+# The military zone near Thule	UTC-4
+# Standard Greenland time	UTC-3
+# Scoresbysund			UTC-1
+# Danmarkshavn			UTC
+#
+# In the military area near Thule and in Danmarkshavn DST will not be
+# introduced.
+
+# From Rives McDow (2001-11-01):
+#
+# I correspond regularly with the Dansk Polarcenter, and wrote them at
+# the time to clarify the situation in Thule.  Unfortunately, I have
+# not heard back from them regarding my recent letter.  [But I have
+# info from earlier correspondence.]
+#
+# According to the center, a very small local time zone around Thule
+# Air Base keeps the time according to UTC-4, implementing daylight
+# savings using North America rules, changing the time at 02:00 local time....
+#
+# The east coast of Greenland north of the community of Scoresbysund
+# uses UTC in the same way as in Iceland, year round, with no dst.
+# There are just a few stations on this coast, including the
+# Danmarkshavn ICAO weather station mentioned in your September 29th
+# email.  The other stations are two sledge patrol stations in
+# Mestersvig and Daneborg, the air force base at Station Nord, and the
+# DPC research station at Zackenberg.
+#
+# Scoresbysund and two small villages nearby keep time UTC-1 and use
+# the same daylight savings time period as in West Greenland (Godthab).
+#
+# The rest of Greenland, including Godthab (this area, although it
+# includes central Greenland, is known as west Greenland), keeps time
+# UTC-3, with daylight savings methods according to European rules.
+#
+# It is common procedure to use UTC 0 in the wilderness of East and
+# North Greenland, because it is mainly Icelandic aircraft operators
+# maintaining traffic in these areas.  However, the official status of
+# this area is that it sticks with Godthab time.  This area might be
+# considered a dual time zone in some respects because of this.
+
+# From Rives McDow (2001-11-19):
+# I heard back from someone stationed at Thule; the time change took place
+# there at 2:00 AM.
+
+# From Paul Eggert (2006-03-22):
+# From 1997 on the CIA map shows Danmarkshavn on GMT;
+# the 1995 map as like Godthab.
+# For lack of better info, assume they were like Godthab before 1996.
+# startkart.no says Thule does not observe DST, but this is clearly an error,
+# so go with Shanks & Pottenger for Thule transitions until this year.
+# For 2007 on assume Thule will stay in sync with US DST rules.
+#
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Thule	1991	1992	-	Mar	lastSun	2:00	1:00	D
+Rule	Thule	1991	1992	-	Sep	lastSun	2:00	0	S
+Rule	Thule	1993	2006	-	Apr	Sun>=1	2:00	1:00	D
+Rule	Thule	1993	2006	-	Oct	lastSun	2:00	0	S
+Rule	Thule	2007	max	-	Mar	Sun>=8	2:00	1:00	D
+Rule	Thule	2007	max	-	Nov	Sun>=1	2:00	0	S
+#
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone America/Danmarkshavn -1:14:40 -	LMT	1916 Jul 28
+			-3:00	-	WGT	1980 Apr  6 2:00
+			-3:00	EU	WG%sT	1996
+			0:00	-	GMT
+Zone America/Scoresbysund -1:27:52 -	LMT	1916 Jul 28 # Ittoqqortoormiit
+			-2:00	-	CGT	1980 Apr  6 2:00
+			-2:00	C-Eur	CG%sT	1981 Mar 29
+			-1:00	EU	EG%sT
+Zone America/Godthab	-3:26:56 -	LMT	1916 Jul 28 # Nuuk
+			-3:00	-	WGT	1980 Apr  6 2:00
+			-3:00	EU	WG%sT
+Zone America/Thule	-4:35:08 -	LMT	1916 Jul 28 # Pituffik air base
+			-4:00	Thule	A%sT
+
+# Estonia
+# From Peter Ilieve (1994-10-15):
+# A relative in Tallinn confirms the accuracy of the data for 1989 onwards
+# [through 1994] and gives the legal authority for it,
+# a regulation of the Government of Estonia, No. 111 of 1989....
+#
+# From Peter Ilieve (1996-10-28):
+# [IATA SSIM (1992/1996) claims that the Baltic republics switch at 01:00s,
+# but a relative confirms that Estonia still switches at 02:00s, writing:]
+# ``I do not [know] exactly but there are some little different
+# (confusing) rules for International Air and Railway Transport Schedules
+# conversion in Sunday connected with end of summer time in Estonia....
+# A discussion is running about the summer time efficiency and effect on
+# human physiology.  It seems that Estonia maybe will not change to
+# summer time next spring.''
+
+# From Peter Ilieve (1998-11-04), heavily edited:
+# <a href="http://trip.rk.ee/cgi-bin/thw?${BASE}=akt&${OOHTML}=rtd&TA=1998&TO=1&AN=1390">
+# The 1998-09-22 Estonian time law
+# </a>
+# refers to the Eighth Directive and cites the association agreement between
+# the EU and Estonia, ratified by the Estonian law (RT II 1995, 22--27, 120).
+#
+# I also asked [my relative] whether they use any standard abbreviation
+# for their standard and summer times. He says no, they use "suveaeg"
+# (summer time) and "talveaeg" (winter time).
+
+# From <a href="http://www.baltictimes.com/">The Baltic Times</a> (1999-09-09)
+# via Steffen Thorsen:
+# This year will mark the last time Estonia shifts to summer time,
+# a council of the ruling coalition announced Sept. 6....
+# But what this could mean for Estonia's chances of joining the European
+# Union are still unclear.  In 1994, the EU declared summer time compulsory
+# for all member states until 2001.  Brussels has yet to decide what to do
+# after that.
+
+# From Mart Oruaas (2000-01-29):
+# Regulation no. 301 (1999-10-12) obsoletes previous regulation
+# no. 206 (1998-09-22) and thus sticks Estonia to +02:00 GMT for all
+# the year round.  The regulation is effective 1999-11-01.
+
+# From Toomas Soome (2002-02-21):
+# The Estonian government has changed once again timezone politics.
+# Now we are using again EU rules.
+#
+# From Urmet Jaanes (2002-03-28):
+# The legislative reference is Government decree No. 84 on 2002-02-21.
+
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Europe/Tallinn	1:39:00	-	LMT	1880
+			1:39:00	-	TMT	1918 Feb # Tallinn Mean Time
+			1:00	C-Eur	CE%sT	1919 Jul
+			1:39:00	-	TMT	1921 May
+			2:00	-	EET	1940 Aug  6
+			3:00	-	MSK	1941 Sep 15
+			1:00	C-Eur	CE%sT	1944 Sep 22
+			3:00	Russia	MSK/MSD	1989 Mar 26 2:00s
+			2:00	1:00	EEST	1989 Sep 24 2:00s
+			2:00	C-Eur	EE%sT	1998 Sep 22
+			2:00	EU	EE%sT	1999 Nov  1
+			2:00	-	EET	2002 Feb 21
+			2:00	EU	EE%sT
+
+# Finland
+
+# From Hannu Strang (1994-09-25 06:03:37 UTC):
+# Well, here in Helsinki we're just changing from summer time to regular one,
+# and it's supposed to change at 4am...
+
+# From Janne Snabb (2010-0715):
+#
+# I noticed that the Finland data is not accurate for years 1981 and 1982.
+# During these two first trial years the DST adjustment was made one hour
+# earlier than in forthcoming years. Starting 1983 the adjustment was made
+# according to the central European standards.
+#
+# This is documented in Heikki Oja: Aikakirja 2007, published by The Almanac
+# Office of University of Helsinki, ISBN 952-10-3221-9, available online (in
+# Finnish) at
+#
+# <a href="http://almanakka.helsinki.fi/aikakirja/Aikakirja2007kokonaan.pdf">
+# http://almanakka.helsinki.fi/aikakirja/Aikakirja2007kokonaan.pdf
+# </a>
+#
+# Page 105 (56 in PDF version) has a handy table of all past daylight savings
+# transitions. It is easy enough to interpret without Finnish skills.
+#
+# This is also confirmed by Finnish Broadcasting Company's archive at:
+#
+# <a href="http://www.yle.fi/elavaarkisto/?s=s&g=1&ag=5&t=&a=3401">
+# http://www.yle.fi/elavaarkisto/?s=s&g=1&ag=5&t=&a=3401
+# </a>
+#
+# The news clip from 1981 says that "the time between 2 and 3 o'clock does not
+# exist tonight."
+
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Finland	1942	only	-	Apr	3	0:00	1:00	S
+Rule	Finland	1942	only	-	Oct	3	0:00	0	-
+Rule	Finland	1981	1982	-	Mar	lastSun	2:00	1:00	S
+Rule	Finland	1981	1982	-	Sep	lastSun	3:00	0	-
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Europe/Helsinki	1:39:52 -	LMT	1878 May 31
+			1:39:52	-	HMT	1921 May    # Helsinki Mean Time
+			2:00	Finland	EE%sT	1983
+			2:00	EU	EE%sT
+
+# Aaland Is
+Link	Europe/Helsinki	Europe/Mariehamn
+
+
+# France
+
+# From Ciro Discepolo (2000-12-20):
+#
+# Henri Le Corre, Regimes Horaires pour le monde entier, Editions
+# Traditionnelles - Paris 2 books, 1993
+#
+# Gabriel, Traite de l'heure dans le monde, Guy Tredaniel editeur,
+# Paris, 1991
+#
+# Francoise Gauquelin, Problemes de l'heure resolus en astrologie,
+# Guy tredaniel, Paris 1987
+
+
+#
+# Shank & Pottenger seem to use `24:00' ambiguously; resolve it with Whitman.
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	France	1916	only	-	Jun	14	23:00s	1:00	S
+Rule	France	1916	1919	-	Oct	Sun>=1	23:00s	0	-
+Rule	France	1917	only	-	Mar	24	23:00s	1:00	S
+Rule	France	1918	only	-	Mar	 9	23:00s	1:00	S
+Rule	France	1919	only	-	Mar	 1	23:00s	1:00	S
+Rule	France	1920	only	-	Feb	14	23:00s	1:00	S
+Rule	France	1920	only	-	Oct	23	23:00s	0	-
+Rule	France	1921	only	-	Mar	14	23:00s	1:00	S
+Rule	France	1921	only	-	Oct	25	23:00s	0	-
+Rule	France	1922	only	-	Mar	25	23:00s	1:00	S
+# DSH writes that a law of 1923-05-24 specified 3rd Sat in Apr at 23:00 to 1st
+# Sat in Oct at 24:00; and that in 1930, because of Easter, the transitions
+# were Apr 12 and Oct 5.  Go with Shanks & Pottenger.
+Rule	France	1922	1938	-	Oct	Sat>=1	23:00s	0	-
+Rule	France	1923	only	-	May	26	23:00s	1:00	S
+Rule	France	1924	only	-	Mar	29	23:00s	1:00	S
+Rule	France	1925	only	-	Apr	 4	23:00s	1:00	S
+Rule	France	1926	only	-	Apr	17	23:00s	1:00	S
+Rule	France	1927	only	-	Apr	 9	23:00s	1:00	S
+Rule	France	1928	only	-	Apr	14	23:00s	1:00	S
+Rule	France	1929	only	-	Apr	20	23:00s	1:00	S
+Rule	France	1930	only	-	Apr	12	23:00s	1:00	S
+Rule	France	1931	only	-	Apr	18	23:00s	1:00	S
+Rule	France	1932	only	-	Apr	 2	23:00s	1:00	S
+Rule	France	1933	only	-	Mar	25	23:00s	1:00	S
+Rule	France	1934	only	-	Apr	 7	23:00s	1:00	S
+Rule	France	1935	only	-	Mar	30	23:00s	1:00	S
+Rule	France	1936	only	-	Apr	18	23:00s	1:00	S
+Rule	France	1937	only	-	Apr	 3	23:00s	1:00	S
+Rule	France	1938	only	-	Mar	26	23:00s	1:00	S
+Rule	France	1939	only	-	Apr	15	23:00s	1:00	S
+Rule	France	1939	only	-	Nov	18	23:00s	0	-
+Rule	France	1940	only	-	Feb	25	 2:00	1:00	S
+# The French rules for 1941-1944 were not used in Paris, but Shanks & Pottenger
+# write that they were used in Monaco and in many French locations.
+# Le Corre writes that the upper limit of the free zone was Arneguy, Orthez,
+# Mont-de-Marsan, Bazas, Langon, Lamotte-Montravel, Marouil, La
+# Rochefoucault, Champagne-Mouton, La Roche-Posay, La Haye-Decartes,
+# Loches, Montrichard, Vierzon, Bourges, Moulins, Digoin,
+# Paray-le-Monial, Montceau-les-Mines, Chalons-sur-Saone, Arbois,
+# Dole, Morez, St-Claude, and Collognes (Haute-Savioe).
+Rule	France	1941	only	-	May	 5	 0:00	2:00	M # Midsummer
+# Shanks & Pottenger say this transition occurred at Oct 6 1:00,
+# but go with Denis Excoffier (1997-12-12),
+# who quotes the Ephemerides Astronomiques for 1998 from Bureau des Longitudes
+# as saying 5/10/41 22hUT.
+Rule	France	1941	only	-	Oct	 6	 0:00	1:00	S
+Rule	France	1942	only	-	Mar	 9	 0:00	2:00	M
+Rule	France	1942	only	-	Nov	 2	 3:00	1:00	S
+Rule	France	1943	only	-	Mar	29	 2:00	2:00	M
+Rule	France	1943	only	-	Oct	 4	 3:00	1:00	S
+Rule	France	1944	only	-	Apr	 3	 2:00	2:00	M
+Rule	France	1944	only	-	Oct	 8	 1:00	1:00	S
+Rule	France	1945	only	-	Apr	 2	 2:00	2:00	M
+Rule	France	1945	only	-	Sep	16	 3:00	0	-
+# Shanks & Pottenger give Mar 28 2:00 and Sep 26 3:00;
+# go with Excoffier's 28/3/76 0hUT and 25/9/76 23hUT.
+Rule	France	1976	only	-	Mar	28	 1:00	1:00	S
+Rule	France	1976	only	-	Sep	26	 1:00	0	-
+# Shanks & Pottenger give 0:09:20 for Paris Mean Time, and Whitman 0:09:05,
+# but Howse quotes the actual French legislation as saying 0:09:21.
+# Go with Howse.  Howse writes that the time in France was officially based
+# on PMT-0:09:21 until 1978-08-09, when the time base finally switched to UTC.
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Europe/Paris	0:09:21 -	LMT	1891 Mar 15  0:01
+			0:09:21	-	PMT	1911 Mar 11  0:01  # Paris MT
+# Shanks & Pottenger give 1940 Jun 14 0:00; go with Excoffier and Le Corre.
+			0:00	France	WE%sT	1940 Jun 14 23:00
+# Le Corre says Paris stuck with occupied-France time after the liberation;
+# go with Shanks & Pottenger.
+			1:00	C-Eur	CE%sT	1944 Aug 25
+			0:00	France	WE%sT	1945 Sep 16  3:00
+			1:00	France	CE%sT	1977
+			1:00	EU	CE%sT
+
+# Germany
+
+# From Markus Kuhn (1998-09-29):
+# The German time zone web site by the Physikalisch-Technische
+# Bundesanstalt contains DST information back to 1916.
+# [See tz-link.htm for the URL.]
+
+# From Joerg Schilling (2002-10-23):
+# In 1945, Berlin was switched to Moscow Summer time (GMT+4) by
+# <a href="http://www.dhm.de/lemo/html/biografien/BersarinNikolai/">
+# General [Nikolai] Bersarin</a>.
+
+# From Paul Eggert (2003-03-08):
+# <a href="http://www.parlament-berlin.de/pds-fraktion.nsf/727459127c8b66ee8525662300459099/defc77cb784f180ac1256c2b0030274b/$FILE/bersarint.pdf">
+# http://www.parlament-berlin.de/pds-fraktion.nsf/727459127c8b66ee8525662300459099/defc77cb784f180ac1256c2b0030274b/$FILE/bersarint.pdf
+# </a>
+# says that Bersarin issued an order to use Moscow time on May 20.
+# However, Moscow did not observe daylight saving in 1945, so
+# this was equivalent to CEMT (GMT+3), not GMT+4.
+
+
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Germany	1946	only	-	Apr	14	2:00s	1:00	S
+Rule	Germany	1946	only	-	Oct	 7	2:00s	0	-
+Rule	Germany	1947	1949	-	Oct	Sun>=1	2:00s	0	-
+# http://www.ptb.de/de/org/4/44/441/salt.htm says the following transition
+# occurred at 3:00 MEZ, not the 2:00 MEZ given in Shanks & Pottenger.
+# Go with the PTB.
+Rule	Germany	1947	only	-	Apr	 6	3:00s	1:00	S
+Rule	Germany	1947	only	-	May	11	2:00s	2:00	M
+Rule	Germany	1947	only	-	Jun	29	3:00	1:00	S
+Rule	Germany	1948	only	-	Apr	18	2:00s	1:00	S
+Rule	Germany	1949	only	-	Apr	10	2:00s	1:00	S
+
+Rule SovietZone	1945	only	-	May	24	2:00	2:00	M # Midsummer
+Rule SovietZone	1945	only	-	Sep	24	3:00	1:00	S
+Rule SovietZone	1945	only	-	Nov	18	2:00s	0	-
+
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Europe/Berlin	0:53:28 -	LMT	1893 Apr
+			1:00	C-Eur	CE%sT	1945 May 24 2:00
+			1:00 SovietZone	CE%sT	1946
+			1:00	Germany	CE%sT	1980
+			1:00	EU	CE%sT
+
+# Georgia
+# Please see the "asia" file for Asia/Tbilisi.
+# Herodotus (Histories, IV.45) says Georgia north of the Phasis (now Rioni)
+# is in Europe.  Our reference location Tbilisi is in the Asian part.
+
+# Gibraltar
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone Europe/Gibraltar	-0:21:24 -	LMT	1880 Aug  2 0:00s
+			0:00	GB-Eire	%s	1957 Apr 14 2:00
+			1:00	-	CET	1982
+			1:00	EU	CE%sT
+
+# Greece
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+# Whitman gives 1932 Jul 5 - Nov 1; go with Shanks & Pottenger.
+Rule	Greece	1932	only	-	Jul	 7	0:00	1:00	S
+Rule	Greece	1932	only	-	Sep	 1	0:00	0	-
+# Whitman gives 1941 Apr 25 - ?; go with Shanks & Pottenger.
+Rule	Greece	1941	only	-	Apr	 7	0:00	1:00	S
+# Whitman gives 1942 Feb 2 - ?; go with Shanks & Pottenger.
+Rule	Greece	1942	only	-	Nov	 2	3:00	0	-
+Rule	Greece	1943	only	-	Mar	30	0:00	1:00	S
+Rule	Greece	1943	only	-	Oct	 4	0:00	0	-
+# Whitman gives 1944 Oct 3 - Oct 31; go with Shanks & Pottenger.
+Rule	Greece	1952	only	-	Jul	 1	0:00	1:00	S
+Rule	Greece	1952	only	-	Nov	 2	0:00	0	-
+Rule	Greece	1975	only	-	Apr	12	0:00s	1:00	S
+Rule	Greece	1975	only	-	Nov	26	0:00s	0	-
+Rule	Greece	1976	only	-	Apr	11	2:00s	1:00	S
+Rule	Greece	1976	only	-	Oct	10	2:00s	0	-
+Rule	Greece	1977	1978	-	Apr	Sun>=1	2:00s	1:00	S
+Rule	Greece	1977	only	-	Sep	26	2:00s	0	-
+Rule	Greece	1978	only	-	Sep	24	4:00	0	-
+Rule	Greece	1979	only	-	Apr	 1	9:00	1:00	S
+Rule	Greece	1979	only	-	Sep	29	2:00	0	-
+Rule	Greece	1980	only	-	Apr	 1	0:00	1:00	S
+Rule	Greece	1980	only	-	Sep	28	0:00	0	-
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Europe/Athens	1:34:52 -	LMT	1895 Sep 14
+			1:34:52	-	AMT	1916 Jul 28 0:01     # Athens MT
+			2:00	Greece	EE%sT	1941 Apr 30
+			1:00	Greece	CE%sT	1944 Apr  4
+			2:00	Greece	EE%sT	1981
+			# Shanks & Pottenger say it switched to C-Eur in 1981;
+			# go with EU instead, since Greece joined it on Jan 1.
+			2:00	EU	EE%sT
+
+# Hungary
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Hungary	1918	only	-	Apr	 1	 3:00	1:00	S
+Rule	Hungary	1918	only	-	Sep	29	 3:00	0	-
+Rule	Hungary	1919	only	-	Apr	15	 3:00	1:00	S
+Rule	Hungary	1919	only	-	Sep	15	 3:00	0	-
+Rule	Hungary	1920	only	-	Apr	 5	 3:00	1:00	S
+Rule	Hungary	1920	only	-	Sep	30	 3:00	0	-
+Rule	Hungary	1945	only	-	May	 1	23:00	1:00	S
+Rule	Hungary	1945	only	-	Nov	 3	 0:00	0	-
+Rule	Hungary	1946	only	-	Mar	31	 2:00s	1:00	S
+Rule	Hungary	1946	1949	-	Oct	Sun>=1	 2:00s	0	-
+Rule	Hungary	1947	1949	-	Apr	Sun>=4	 2:00s	1:00	S
+Rule	Hungary	1950	only	-	Apr	17	 2:00s	1:00	S
+Rule	Hungary	1950	only	-	Oct	23	 2:00s	0	-
+Rule	Hungary	1954	1955	-	May	23	 0:00	1:00	S
+Rule	Hungary	1954	1955	-	Oct	 3	 0:00	0	-
+Rule	Hungary	1956	only	-	Jun	Sun>=1	 0:00	1:00	S
+Rule	Hungary	1956	only	-	Sep	lastSun	 0:00	0	-
+Rule	Hungary	1957	only	-	Jun	Sun>=1	 1:00	1:00	S
+Rule	Hungary	1957	only	-	Sep	lastSun	 3:00	0	-
+Rule	Hungary	1980	only	-	Apr	 6	 1:00	1:00	S
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Europe/Budapest	1:16:20 -	LMT	1890 Oct
+			1:00	C-Eur	CE%sT	1918
+			1:00	Hungary	CE%sT	1941 Apr  6  2:00
+			1:00	C-Eur	CE%sT	1945
+			1:00	Hungary	CE%sT	1980 Sep 28  2:00s
+			1:00	EU	CE%sT
+
+# Iceland
+#
+# From Adam David (1993-11-06):
+# The name of the timezone in Iceland for system / mail / news purposes is GMT.
+#
+# (1993-12-05):
+# This material is paraphrased from the 1988 edition of the University of
+# Iceland Almanak.
+#
+# From January 1st, 1908 the whole of Iceland was standardised at 1 hour
+# behind GMT. Previously, local mean solar time was used in different parts
+# of Iceland, the almanak had been based on Reykjavik mean solar time which
+# was 1 hour and 28 minutes behind GMT.
+#
+# "first day of winter" referred to [below] means the first day of the 26 weeks
+# of winter, according to the old icelandic calendar that dates back to the
+# time the norsemen first settled Iceland.  The first day of winter is always
+# Saturday, but is not dependent on the Julian or Gregorian calendars.
+#
+# (1993-12-10):
+# I have a reference from the Oxford Icelandic-English dictionary for the
+# beginning of winter, which ties it to the ecclesiastical calendar (and thus
+# to the julian/gregorian calendar) over the period in question.
+#	the winter begins on the Saturday next before St. Luke's day
+#	(old style), or on St. Luke's day, if a Saturday.
+# St. Luke's day ought to be traceable from ecclesiastical sources. "old style"
+# might be a reference to the Julian calendar as opposed to Gregorian, or it
+# might mean something else (???).
+#
+# From Paul Eggert (2006-03-22):
+# The Iceland Almanak, Shanks & Pottenger, and Whitman disagree on many points.
+# We go with the Almanak, except for one claim from Shanks & Pottenger, namely
+# that Reykavik was 21W57 from 1837 to 1908, local mean time before that.
+#
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Iceland	1917	1918	-	Feb	19	23:00	1:00	S
+Rule	Iceland	1917	only	-	Oct	21	 1:00	0	-
+Rule	Iceland	1918	only	-	Nov	16	 1:00	0	-
+Rule	Iceland	1939	only	-	Apr	29	23:00	1:00	S
+Rule	Iceland	1939	only	-	Nov	29	 2:00	0	-
+Rule	Iceland	1940	only	-	Feb	25	 2:00	1:00	S
+Rule	Iceland	1940	only	-	Nov	 3	 2:00	0	-
+Rule	Iceland	1941	only	-	Mar	 2	 1:00s	1:00	S
+Rule	Iceland	1941	only	-	Nov	 2	 1:00s	0	-
+Rule	Iceland	1942	only	-	Mar	 8	 1:00s	1:00	S
+Rule	Iceland	1942	only	-	Oct	25	 1:00s	0	-
+# 1943-1946 - first Sunday in March until first Sunday in winter
+Rule	Iceland	1943	1946	-	Mar	Sun>=1	 1:00s	1:00	S
+Rule	Iceland	1943	1948	-	Oct	Sun>=22	 1:00s	0	-
+# 1947-1967 - first Sunday in April until first Sunday in winter
+Rule	Iceland	1947	1967	-	Apr	Sun>=1	 1:00s	1:00	S
+# 1949 Oct transition delayed by 1 week
+Rule	Iceland	1949	only	-	Oct	30	 1:00s	0	-
+Rule	Iceland	1950	1966	-	Oct	Sun>=22	 1:00s	0	-
+Rule	Iceland	1967	only	-	Oct	29	 1:00s	0	-
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone Atlantic/Reykjavik	-1:27:24 -	LMT	1837
+			-1:27:48 -	RMT	1908 # Reykjavik Mean Time?
+			-1:00	Iceland	IS%sT	1968 Apr 7 1:00s
+			 0:00	-	GMT
+
+# Italy
+#
+# From Paul Eggert (2001-03-06):
+# Sicily and Sardinia each had their own time zones from 1866 to 1893,
+# called Palermo Time (+00:53:28) and Cagliari Time (+00:36:32).
+# During World War II, German-controlled Italy used German time.
+# But these events all occurred before the 1970 cutoff,
+# so record only the time in Rome.
+#
+# From Paul Eggert (2006-03-22):
+# For Italian DST we have three sources: Shanks & Pottenger, Whitman, and
+# F. Pollastri
+# <a href="http://toi.iriti.cnr.it/uk/ienitlt.html">
+# Day-light Saving Time in Italy (2006-02-03)
+# </a>
+# (`FP' below), taken from an Italian National Electrotechnical Institute
+# publication. When the three sources disagree, guess who's right, as follows:
+#
+# year	FP	Shanks&P. (S)	Whitman (W)	Go with:
+# 1916	06-03	06-03 24:00	06-03 00:00	FP & W
+#	09-30	09-30 24:00	09-30 01:00	FP; guess 24:00s
+# 1917	04-01	03-31 24:00	03-31 00:00	FP & S
+#	09-30	09-29 24:00	09-30 01:00	FP & W
+# 1918	03-09	03-09 24:00	03-09 00:00	FP & S
+#	10-06	10-05 24:00	10-06 01:00	FP & W
+# 1919	03-01	03-01 24:00	03-01 00:00	FP & S
+#	10-04	10-04 24:00	10-04 01:00	FP; guess 24:00s
+# 1920	03-20	03-20 24:00	03-20 00:00	FP & S
+#	09-18	09-18 24:00	10-01 01:00	FP; guess 24:00s
+# 1944	04-02	04-03 02:00			S (see C-Eur)
+#	09-16	10-02 03:00			FP; guess 24:00s
+# 1945	09-14	09-16 24:00			FP; guess 24:00s
+# 1970	05-21	05-31 00:00			S
+#	09-20	09-27 00:00			S
+#
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Italy	1916	only	-	Jun	 3	0:00s	1:00	S
+Rule	Italy	1916	only	-	Oct	 1	0:00s	0	-
+Rule	Italy	1917	only	-	Apr	 1	0:00s	1:00	S
+Rule	Italy	1917	only	-	Sep	30	0:00s	0	-
+Rule	Italy	1918	only	-	Mar	10	0:00s	1:00	S
+Rule	Italy	1918	1919	-	Oct	Sun>=1	0:00s	0	-
+Rule	Italy	1919	only	-	Mar	 2	0:00s	1:00	S
+Rule	Italy	1920	only	-	Mar	21	0:00s	1:00	S
+Rule	Italy	1920	only	-	Sep	19	0:00s	0	-
+Rule	Italy	1940	only	-	Jun	15	0:00s	1:00	S
+Rule	Italy	1944	only	-	Sep	17	0:00s	0	-
+Rule	Italy	1945	only	-	Apr	 2	2:00	1:00	S
+Rule	Italy	1945	only	-	Sep	15	0:00s	0	-
+Rule	Italy	1946	only	-	Mar	17	2:00s	1:00	S
+Rule	Italy	1946	only	-	Oct	 6	2:00s	0	-
+Rule	Italy	1947	only	-	Mar	16	0:00s	1:00	S
+Rule	Italy	1947	only	-	Oct	 5	0:00s	0	-
+Rule	Italy	1948	only	-	Feb	29	2:00s	1:00	S
+Rule	Italy	1948	only	-	Oct	 3	2:00s	0	-
+Rule	Italy	1966	1968	-	May	Sun>=22	0:00	1:00	S
+Rule	Italy	1966	1969	-	Sep	Sun>=22	0:00	0	-
+Rule	Italy	1969	only	-	Jun	 1	0:00	1:00	S
+Rule	Italy	1970	only	-	May	31	0:00	1:00	S
+Rule	Italy	1970	only	-	Sep	lastSun	0:00	0	-
+Rule	Italy	1971	1972	-	May	Sun>=22	0:00	1:00	S
+Rule	Italy	1971	only	-	Sep	lastSun	1:00	0	-
+Rule	Italy	1972	only	-	Oct	 1	0:00	0	-
+Rule	Italy	1973	only	-	Jun	 3	0:00	1:00	S
+Rule	Italy	1973	1974	-	Sep	lastSun	0:00	0	-
+Rule	Italy	1974	only	-	May	26	0:00	1:00	S
+Rule	Italy	1975	only	-	Jun	 1	0:00s	1:00	S
+Rule	Italy	1975	1977	-	Sep	lastSun	0:00s	0	-
+Rule	Italy	1976	only	-	May	30	0:00s	1:00	S
+Rule	Italy	1977	1979	-	May	Sun>=22	0:00s	1:00	S
+Rule	Italy	1978	only	-	Oct	 1	0:00s	0	-
+Rule	Italy	1979	only	-	Sep	30	0:00s	0	-
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Europe/Rome	0:49:56 -	LMT	1866 Sep 22
+			0:49:56	-	RMT	1893 Nov  1 0:00s # Rome Mean
+			1:00	Italy	CE%sT	1942 Nov  2 2:00s
+			1:00	C-Eur	CE%sT	1944 Jul
+			1:00	Italy	CE%sT	1980
+			1:00	EU	CE%sT
+
+Link	Europe/Rome	Europe/Vatican
+Link	Europe/Rome	Europe/San_Marino
+
+# Latvia
+
+# From Liene Kanepe (1998-09-17):
+
+# I asked about this matter Scientific Secretary of the Institute of Astronomy
+# of The University of Latvia Dr. paed Mr. Ilgonis Vilks. I also searched the
+# correct data in juridical acts and I found some juridical documents about
+# changes in the counting of time in Latvia from 1981....
+#
+# Act No.35 of the Council of Ministers of Latvian SSR of 1981-01-22 ...
+# according to the Act No.925 of the Council of Ministers of USSR of 1980-10-24
+# ...: all year round the time of 2nd time zone + 1 hour, in addition turning
+# the hands of the clock 1 hour forward on 1 April at 00:00 (GMT 31 March 21:00)
+# and 1 hour backward on the 1 October at 00:00 (GMT 30 September 20:00).
+#
+# Act No.592 of the Council of Ministers of Latvian SSR of 1984-09-24 ...
+# according to the Act No.967 of the Council of Ministers of USSR of 1984-09-13
+# ...: all year round the time of 2nd time zone + 1 hour, in addition turning
+# the hands of the clock 1 hour forward on the last Sunday of March at 02:00
+# (GMT 23:00 on the previous day) and 1 hour backward on the last Sunday of
+# September at 03:00 (GMT 23:00 on the previous day).
+#
+# Act No.81 of the Council of Ministers of Latvian SSR of 1989-03-22 ...
+# according to the Act No.227 of the Council of Ministers of USSR of 1989-03-14
+# ...: since the last Sunday of March 1989 in Lithuanian SSR, Latvian SSR,
+# Estonian SSR and Kaliningrad region of Russian Federation all year round the
+# time of 2nd time zone (Moscow time minus one hour). On the territory of Latvia
+# transition to summer time is performed on the last Sunday of March at 02:00
+# (GMT 00:00), turning the hands of the clock 1 hour forward.  The end of
+# daylight saving time is performed on the last Sunday of September at 03:00
+# (GMT 00:00), turning the hands of the clock 1 hour backward. Exception is
+# 1989-03-26, when we must not turn the hands of the clock....
+#
+# The Regulations of the Cabinet of Ministers of the Republic of Latvia of
+# 1997-01-21 on transition to Summer time ... established the same order of
+# daylight savings time settings as in the States of the European Union.
+
+# From Andrei Ivanov (2000-03-06):
+# This year Latvia will not switch to Daylight Savings Time (as specified in
+# <a href="http://www.lv-laiks.lv/wwwraksti/2000/071072/vd4.htm">
+# The Regulations of the Cabinet of Ministers of the Rep. of Latvia of
+# 29-Feb-2000 (#79)</a>, in Latvian for subscribers only).
+
+# <a href="http://www.rferl.org/newsline/2001/01/3-CEE/cee-030101.html">
+# From RFE/RL Newsline (2001-01-03), noted after a heads-up by Rives McDow:
+# </a>
+# The Latvian government on 2 January decided that the country will
+# institute daylight-saving time this spring, LETA reported.
+# Last February the three Baltic states decided not to turn back their
+# clocks one hour in the spring....
+# Minister of Economy Aigars Kalvitis noted that Latvia had too few
+# daylight hours and thus decided to comply with a draft European
+# Commission directive that provides for instituting daylight-saving
+# time in EU countries between 2002 and 2006. The Latvian government
+# urged Lithuania and Estonia to adopt a similar time policy, but it
+# appears that they will not do so....
+
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Latvia	1989	1996	-	Mar	lastSun	 2:00s	1:00	S
+Rule	Latvia	1989	1996	-	Sep	lastSun	 2:00s	0	-
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Europe/Riga	1:36:24	-	LMT	1880
+			1:36:24	-	RMT	1918 Apr 15 2:00 #Riga Mean Time
+			1:36:24	1:00	LST	1918 Sep 16 3:00 #Latvian Summer
+			1:36:24	-	RMT	1919 Apr  1 2:00
+			1:36:24	1:00	LST	1919 May 22 3:00
+			1:36:24	-	RMT	1926 May 11
+			2:00	-	EET	1940 Aug  5
+			3:00	-	MSK	1941 Jul
+			1:00	C-Eur	CE%sT	1944 Oct 13
+			3:00	Russia	MSK/MSD	1989 Mar lastSun 2:00s
+			2:00	1:00	EEST	1989 Sep lastSun 2:00s
+			2:00	Latvia	EE%sT	1997 Jan 21
+			2:00	EU	EE%sT	2000 Feb 29
+			2:00	-	EET	2001 Jan  2
+			2:00	EU	EE%sT
+
+# Liechtenstein
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Europe/Vaduz	0:38:04 -	LMT	1894 Jun
+			1:00	-	CET	1981
+			1:00	EU	CE%sT
+
+# Lithuania
+
+# From Paul Eggert (1996-11-22):
+# IATA SSIM (1992/1996) says Lithuania uses W-Eur rules, but since it is
+# known to be wrong about Estonia and Latvia, assume it's wrong here too.
+
+# From Marius Gedminas (1998-08-07):
+# I would like to inform that in this year Lithuanian time zone
+# (Europe/Vilnius) was changed.
+
+# From <a href="http://www.elta.lt/">ELTA</a> No. 972 (2582) (1999-09-29),
+# via Steffen Thorsen:
+# Lithuania has shifted back to the second time zone (GMT plus two hours)
+# to be valid here starting from October 31,
+# as decided by the national government on Wednesday....
+# The Lithuanian government also announced plans to consider a
+# motion to give up shifting to summer time in spring, as it was
+# already done by Estonia.
+
+# From the <a href="http://www.tourism.lt/informa/ff.htm">
+# Fact File, Lithuanian State Department of Tourism
+# </a> (2000-03-27): Local time is GMT+2 hours ..., no daylight saving.
+
+# From a user via Klaus Marten (2003-02-07):
+# As a candidate for membership of the European Union, Lithuania will
+# observe Summer Time in 2003, changing its clocks at the times laid
+# down in EU Directive 2000/84 of 19.I.01 (i.e. at the same times as its
+# neighbour Latvia). The text of the Lithuanian government Order of
+# 7.XI.02 to this effect can be found at
+# http://www.lrvk.lt/nut/11/n1749.htm
+
+
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Europe/Vilnius	1:41:16	-	LMT	1880
+			1:24:00	-	WMT	1917	    # Warsaw Mean Time
+			1:35:36	-	KMT	1919 Oct 10 # Kaunas Mean Time
+			1:00	-	CET	1920 Jul 12
+			2:00	-	EET	1920 Oct  9
+			1:00	-	CET	1940 Aug  3
+			3:00	-	MSK	1941 Jun 24
+			1:00	C-Eur	CE%sT	1944 Aug
+			3:00	Russia	MSK/MSD	1991 Mar 31 2:00s
+			2:00	1:00	EEST	1991 Sep 29 2:00s
+			2:00	C-Eur	EE%sT	1998
+			2:00	-	EET	1998 Mar 29 1:00u
+			1:00	EU	CE%sT	1999 Oct 31 1:00u
+			2:00	-	EET	2003 Jan  1
+			2:00	EU	EE%sT
+
+# Luxembourg
+# Whitman disagrees with most of these dates in minor ways;
+# go with Shanks & Pottenger.
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Lux	1916	only	-	May	14	23:00	1:00	S
+Rule	Lux	1916	only	-	Oct	 1	 1:00	0	-
+Rule	Lux	1917	only	-	Apr	28	23:00	1:00	S
+Rule	Lux	1917	only	-	Sep	17	 1:00	0	-
+Rule	Lux	1918	only	-	Apr	Mon>=15	 2:00s	1:00	S
+Rule	Lux	1918	only	-	Sep	Mon>=15	 2:00s	0	-
+Rule	Lux	1919	only	-	Mar	 1	23:00	1:00	S
+Rule	Lux	1919	only	-	Oct	 5	 3:00	0	-
+Rule	Lux	1920	only	-	Feb	14	23:00	1:00	S
+Rule	Lux	1920	only	-	Oct	24	 2:00	0	-
+Rule	Lux	1921	only	-	Mar	14	23:00	1:00	S
+Rule	Lux	1921	only	-	Oct	26	 2:00	0	-
+Rule	Lux	1922	only	-	Mar	25	23:00	1:00	S
+Rule	Lux	1922	only	-	Oct	Sun>=2	 1:00	0	-
+Rule	Lux	1923	only	-	Apr	21	23:00	1:00	S
+Rule	Lux	1923	only	-	Oct	Sun>=2	 2:00	0	-
+Rule	Lux	1924	only	-	Mar	29	23:00	1:00	S
+Rule	Lux	1924	1928	-	Oct	Sun>=2	 1:00	0	-
+Rule	Lux	1925	only	-	Apr	 5	23:00	1:00	S
+Rule	Lux	1926	only	-	Apr	17	23:00	1:00	S
+Rule	Lux	1927	only	-	Apr	 9	23:00	1:00	S
+Rule	Lux	1928	only	-	Apr	14	23:00	1:00	S
+Rule	Lux	1929	only	-	Apr	20	23:00	1:00	S
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone Europe/Luxembourg	0:24:36 -	LMT	1904 Jun
+			1:00	Lux	CE%sT	1918 Nov 25
+			0:00	Lux	WE%sT	1929 Oct  6 2:00s
+			0:00	Belgium	WE%sT	1940 May 14 3:00
+			1:00	C-Eur	WE%sT	1944 Sep 18 3:00
+			1:00	Belgium	CE%sT	1977
+			1:00	EU	CE%sT
+
+# Macedonia
+# see Serbia
+
+# Malta
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Malta	1973	only	-	Mar	31	0:00s	1:00	S
+Rule	Malta	1973	only	-	Sep	29	0:00s	0	-
+Rule	Malta	1974	only	-	Apr	21	0:00s	1:00	S
+Rule	Malta	1974	only	-	Sep	16	0:00s	0	-
+Rule	Malta	1975	1979	-	Apr	Sun>=15	2:00	1:00	S
+Rule	Malta	1975	1980	-	Sep	Sun>=15	2:00	0	-
+Rule	Malta	1980	only	-	Mar	31	2:00	1:00	S
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Europe/Malta	0:58:04 -	LMT	1893 Nov  2 0:00s # Valletta
+			1:00	Italy	CE%sT	1942 Nov  2 2:00s
+			1:00	C-Eur	CE%sT	1945 Apr  2 2:00s
+			1:00	Italy	CE%sT	1973 Mar 31
+			1:00	Malta	CE%sT	1981
+			1:00	EU	CE%sT
+
+# Moldova
+
+# From Paul Eggert (2006-03-22):
+# A previous version of this database followed Shanks & Pottenger, who write
+# that Tiraspol switched to Moscow time on 1992-01-19 at 02:00.
+# However, this is most likely an error, as Moldova declared independence
+# on 1991-08-27 (the 1992-01-19 date is that of a Russian decree).
+# In early 1992 there was large-scale interethnic violence in the area
+# and it's possible that some Russophones continued to observe Moscow time.
+# But [two people] separately reported via
+# Jesper Norgaard that as of 2001-01-24 Tiraspol was like Chisinau.
+# The Tiraspol entry has therefore been removed for now.
+
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Europe/Chisinau	1:55:20 -	LMT	1880
+			1:55	-	CMT	1918 Feb 15 # Chisinau MT
+			1:44:24	-	BMT	1931 Jul 24 # Bucharest MT
+			2:00	Romania	EE%sT	1940 Aug 15
+			2:00	1:00	EEST	1941 Jul 17
+			1:00	C-Eur	CE%sT	1944 Aug 24
+			3:00	Russia	MSK/MSD	1990
+			3:00	-	MSK	1990 May 6
+			2:00	-	EET	1991
+			2:00	Russia	EE%sT	1992
+			2:00	E-Eur	EE%sT	1997
+# See Romania commentary for the guessed 1997 transition to EU rules.
+			2:00	EU	EE%sT
+
+# Monaco
+# Shanks & Pottenger give 0:09:20 for Paris Mean Time; go with Howse's
+# more precise 0:09:21.
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Europe/Monaco	0:29:32 -	LMT	1891 Mar 15
+			0:09:21	-	PMT	1911 Mar 11    # Paris Mean Time
+			0:00	France	WE%sT	1945 Sep 16 3:00
+			1:00	France	CE%sT	1977
+			1:00	EU	CE%sT
+
+# Montenegro
+# see Serbia
+
+# Netherlands
+
+# Howse writes that the Netherlands' railways used GMT between 1892 and 1940,
+# but for other purposes the Netherlands used Amsterdam mean time.
+
+# However, Robert H. van Gent writes (2001-04-01):
+# Howse's statement is only correct up to 1909. From 1909-05-01 (00:00:00
+# Amsterdam mean time) onwards, the whole of the Netherlands (including
+# the Dutch railways) was required by law to observe Amsterdam mean time
+# (19 minutes 32.13 seconds ahead of GMT). This had already been the
+# common practice (except for the railways) for many decades but it was
+# not until 1909 when the Dutch government finally defined this by law.
+# On 1937-07-01 this was changed to 20 minutes (exactly) ahead of GMT and
+# was generally known as Dutch Time ("Nederlandse Tijd").
+#
+# (2001-04-08):
+# 1892-05-01 was the date when the Dutch railways were by law required to
+# observe GMT while the remainder of the Netherlands adhered to the common
+# practice of following Amsterdam mean time.
+#
+# (2001-04-09):
+# In 1835 the authorities of the province of North Holland requested the
+# municipal authorities of the towns and cities in the province to observe
+# Amsterdam mean time but I do not know in how many cases this request was
+# actually followed.
+#
+# From 1852 onwards the Dutch telegraph offices were by law required to
+# observe Amsterdam mean time. As the time signals from the observatory of
+# Leiden were also distributed by the telegraph system, I assume that most
+# places linked up with the telegraph (and railway) system automatically
+# adopted Amsterdam mean time.
+#
+# Although the early Dutch railway companies initially observed a variety
+# of times, most of them had adopted Amsterdam mean time by 1858 but it
+# was not until 1866 when they were all required by law to observe
+# Amsterdam mean time.
+
+# The data before 1945 are taken from
+# <http://www.phys.uu.nl/~vgent/wettijd/wettijd.htm>.
+
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Neth	1916	only	-	May	 1	0:00	1:00	NST	# Netherlands Summer Time
+Rule	Neth	1916	only	-	Oct	 1	0:00	0	AMT	# Amsterdam Mean Time
+Rule	Neth	1917	only	-	Apr	16	2:00s	1:00	NST
+Rule	Neth	1917	only	-	Sep	17	2:00s	0	AMT
+Rule	Neth	1918	1921	-	Apr	Mon>=1	2:00s	1:00	NST
+Rule	Neth	1918	1921	-	Sep	lastMon	2:00s	0	AMT
+Rule	Neth	1922	only	-	Mar	lastSun	2:00s	1:00	NST
+Rule	Neth	1922	1936	-	Oct	Sun>=2	2:00s	0	AMT
+Rule	Neth	1923	only	-	Jun	Fri>=1	2:00s	1:00	NST
+Rule	Neth	1924	only	-	Mar	lastSun	2:00s	1:00	NST
+Rule	Neth	1925	only	-	Jun	Fri>=1	2:00s	1:00	NST
+# From 1926 through 1939 DST began 05-15, except that it was delayed by a week
+# in years when 05-15 fell in the Pentecost weekend.
+Rule	Neth	1926	1931	-	May	15	2:00s	1:00	NST
+Rule	Neth	1932	only	-	May	22	2:00s	1:00	NST
+Rule	Neth	1933	1936	-	May	15	2:00s	1:00	NST
+Rule	Neth	1937	only	-	May	22	2:00s	1:00	NST
+Rule	Neth	1937	only	-	Jul	 1	0:00	1:00	S
+Rule	Neth	1937	1939	-	Oct	Sun>=2	2:00s	0	-
+Rule	Neth	1938	1939	-	May	15	2:00s	1:00	S
+Rule	Neth	1945	only	-	Apr	 2	2:00s	1:00	S
+Rule	Neth	1945	only	-	Sep	16	2:00s	0	-
+#
+# Amsterdam Mean Time was +00:19:32.13 exactly, but the .13 is omitted
+# below because the current format requires GMTOFF to be an integer.
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone Europe/Amsterdam	0:19:32 -	LMT	1835
+			0:19:32	Neth	%s	1937 Jul  1
+			0:20	Neth	NE%sT	1940 May 16 0:00 # Dutch Time
+			1:00	C-Eur	CE%sT	1945 Apr  2 2:00
+			1:00	Neth	CE%sT	1977
+			1:00	EU	CE%sT
+
+# Norway
+# http://met.no/met/met_lex/q_u/sommertid.html (2004-01) agrees with Shanks &
+# Pottenger.
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Norway	1916	only	-	May	22	1:00	1:00	S
+Rule	Norway	1916	only	-	Sep	30	0:00	0	-
+Rule	Norway	1945	only	-	Apr	 2	2:00s	1:00	S
+Rule	Norway	1945	only	-	Oct	 1	2:00s	0	-
+Rule	Norway	1959	1964	-	Mar	Sun>=15	2:00s	1:00	S
+Rule	Norway	1959	1965	-	Sep	Sun>=15	2:00s	0	-
+Rule	Norway	1965	only	-	Apr	25	2:00s	1:00	S
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Europe/Oslo	0:43:00 -	LMT	1895 Jan  1
+			1:00	Norway	CE%sT	1940 Aug 10 23:00
+			1:00	C-Eur	CE%sT	1945 Apr  2  2:00
+			1:00	Norway	CE%sT	1980
+			1:00	EU	CE%sT
+
+# Svalbard & Jan Mayen
+
+# From Steffen Thorsen (2001-05-01):
+# Although I could not find it explicitly, it seems that Jan Mayen and
+# Svalbard have been using the same time as Norway at least since the
+# time they were declared as parts of Norway.  Svalbard was declared
+# as a part of Norway by law of 1925-07-17 no 11, section 4 and Jan
+# Mayen by law of 1930-02-27 no 2, section 2. (From
+# http://www.lovdata.no/all/nl-19250717-011.html and
+# http://www.lovdata.no/all/nl-19300227-002.html).  The law/regulation
+# for normal/standard time in Norway is from 1894-06-29 no 1 (came
+# into operation on 1895-01-01) and Svalbard/Jan Mayen seem to be a
+# part of this law since 1925/1930. (From
+# http://www.lovdata.no/all/nl-18940629-001.html ) I have not been
+# able to find if Jan Mayen used a different time zone (e.g. -0100)
+# before 1930. Jan Mayen has only been "inhabitated" since 1921 by
+# Norwegian meteorologists and maybe used the same time as Norway ever
+# since 1921.  Svalbard (Arctic/Longyearbyen) has been inhabited since
+# before 1895, and therefore probably changed the local time somewhere
+# between 1895 and 1925 (inclusive).
+
+# From Paul Eggert (2001-05-01):
+#
+# Actually, Jan Mayen was never occupied by Germany during World War II,
+# so it must have diverged from Oslo time during the war, as Oslo was
+# keeping Berlin time.
+#
+# <http://home.no.net/janmayen/history.htm> says that the meteorologists
+# burned down their station in 1940 and left the island, but returned in
+# 1941 with a small Norwegian garrison and continued operations despite
+# frequent air ttacks from Germans.  In 1943 the Americans established a
+# radiolocating station on the island, called "Atlantic City".  Possibly
+# the UTC offset changed during the war, but I think it unlikely that
+# Jan Mayen used German daylight-saving rules.
+#
+# Svalbard is more complicated, as it was raided in August 1941 by an
+# Allied party that evacuated the civilian population to England (says
+# <http://www.bartleby.com/65/sv/Svalbard.html>).  The Svalbard FAQ
+# <http://www.svalbard.com/SvalbardFAQ.html> says that the Germans were
+# expelled on 1942-05-14.  However, small parties of Germans did return,
+# and according to Wilhelm Dege's book "War North of 80" (1954)
+# <http://www.ucalgary.ca/UofC/departments/UP/1-55238/1-55238-110-2.html>
+# the German armed forces at the Svalbard weather station code-named
+# Haudegen did not surrender to the Allies until September 1945.
+#
+# All these events predate our cutoff date of 1970.  Unless we can
+# come up with more definitive info about the timekeeping during the
+# war years it's probably best just do do the following for now:
+Link	Europe/Oslo	Arctic/Longyearbyen
+
+# Poland
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Poland	1918	1919	-	Sep	16	2:00s	0	-
+Rule	Poland	1919	only	-	Apr	15	2:00s	1:00	S
+Rule	Poland	1944	only	-	Apr	 3	2:00s	1:00	S
+# Whitman gives 1944 Nov 30; go with Shanks & Pottenger.
+Rule	Poland	1944	only	-	Oct	 4	2:00	0	-
+# For 1944-1948 Whitman gives the previous day; go with Shanks & Pottenger.
+Rule	Poland	1945	only	-	Apr	29	0:00	1:00	S
+Rule	Poland	1945	only	-	Nov	 1	0:00	0	-
+# For 1946 on the source is Kazimierz Borkowski,
+# Torun Center for Astronomy, Dept. of Radio Astronomy, Nicolaus Copernicus U.,
+# <http://www.astro.uni.torun.pl/~kb/Artykuly/U-PA/Czas2.htm#tth_tAb1>
+# Thanks to Przemyslaw Augustyniak (2005-05-28) for this reference.
+# He also gives these further references:
+# Mon Pol nr 13, poz 162 (1995) <http://www.abc.com.pl/serwis/mp/1995/0162.htm>
+# Druk nr 2180 (2003) <http://www.senat.gov.pl/k5/dok/sejm/053/2180.pdf>
+Rule	Poland	1946	only	-	Apr	14	0:00s	1:00	S
+Rule	Poland	1946	only	-	Oct	 7	2:00s	0	-
+Rule	Poland	1947	only	-	May	 4	2:00s	1:00	S
+Rule	Poland	1947	1949	-	Oct	Sun>=1	2:00s	0	-
+Rule	Poland	1948	only	-	Apr	18	2:00s	1:00	S
+Rule	Poland	1949	only	-	Apr	10	2:00s	1:00	S
+Rule	Poland	1957	only	-	Jun	 2	1:00s	1:00	S
+Rule	Poland	1957	1958	-	Sep	lastSun	1:00s	0	-
+Rule	Poland	1958	only	-	Mar	30	1:00s	1:00	S
+Rule	Poland	1959	only	-	May	31	1:00s	1:00	S
+Rule	Poland	1959	1961	-	Oct	Sun>=1	1:00s	0	-
+Rule	Poland	1960	only	-	Apr	 3	1:00s	1:00	S
+Rule	Poland	1961	1964	-	May	lastSun	1:00s	1:00	S
+Rule	Poland	1962	1964	-	Sep	lastSun	1:00s	0	-
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Europe/Warsaw	1:24:00 -	LMT	1880
+			1:24:00	-	WMT	1915 Aug  5   # Warsaw Mean Time
+			1:00	C-Eur	CE%sT	1918 Sep 16 3:00
+			2:00	Poland	EE%sT	1922 Jun
+			1:00	Poland	CE%sT	1940 Jun 23 2:00
+			1:00	C-Eur	CE%sT	1944 Oct
+			1:00	Poland	CE%sT	1977
+			1:00	W-Eur	CE%sT	1988
+			1:00	EU	CE%sT
+
+# Portugal
+#
+# From Rui Pedro Salgueiro (1992-11-12):
+# Portugal has recently (September, 27) changed timezone
+# (from WET to MET or CET) to harmonize with EEC.
+#
+# Martin Bruckmann (1996-02-29) reports via Peter Ilieve
+# that Portugal is reverting to 0:00 by not moving its clocks this spring.
+# The new Prime Minister was fed up with getting up in the dark in the winter.
+#
+# From Paul Eggert (1996-11-12):
+# IATA SSIM (1991-09) reports several 1991-09 and 1992-09 transitions
+# at 02:00u, not 01:00u.  Assume that these are typos.
+# IATA SSIM (1991/1992) reports that the Azores were at -1:00.
+# IATA SSIM (1993-02) says +0:00; later issues (through 1996-09) say -1:00.
+# Guess that the Azores changed to EU rules in 1992 (since that's when Portugal
+# harmonized with the EU), and that they stayed +0:00 that winter.
+#
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+# DSH writes that despite Decree 1,469 (1915), the change to the clocks was not
+# done every year, depending on what Spain did, because of railroad schedules.
+# Go with Shanks & Pottenger.
+Rule	Port	1916	only	-	Jun	17	23:00	1:00	S
+# Whitman gives 1916 Oct 31; go with Shanks & Pottenger.
+Rule	Port	1916	only	-	Nov	 1	 1:00	0	-
+Rule	Port	1917	only	-	Feb	28	23:00s	1:00	S
+Rule	Port	1917	1921	-	Oct	14	23:00s	0	-
+Rule	Port	1918	only	-	Mar	 1	23:00s	1:00	S
+Rule	Port	1919	only	-	Feb	28	23:00s	1:00	S
+Rule	Port	1920	only	-	Feb	29	23:00s	1:00	S
+Rule	Port	1921	only	-	Feb	28	23:00s	1:00	S
+Rule	Port	1924	only	-	Apr	16	23:00s	1:00	S
+Rule	Port	1924	only	-	Oct	14	23:00s	0	-
+Rule	Port	1926	only	-	Apr	17	23:00s	1:00	S
+Rule	Port	1926	1929	-	Oct	Sat>=1	23:00s	0	-
+Rule	Port	1927	only	-	Apr	 9	23:00s	1:00	S
+Rule	Port	1928	only	-	Apr	14	23:00s	1:00	S
+Rule	Port	1929	only	-	Apr	20	23:00s	1:00	S
+Rule	Port	1931	only	-	Apr	18	23:00s	1:00	S
+# Whitman gives 1931 Oct 8; go with Shanks & Pottenger.
+Rule	Port	1931	1932	-	Oct	Sat>=1	23:00s	0	-
+Rule	Port	1932	only	-	Apr	 2	23:00s	1:00	S
+Rule	Port	1934	only	-	Apr	 7	23:00s	1:00	S
+# Whitman gives 1934 Oct 5; go with Shanks & Pottenger.
+Rule	Port	1934	1938	-	Oct	Sat>=1	23:00s	0	-
+# Shanks & Pottenger give 1935 Apr 30; go with Whitman.
+Rule	Port	1935	only	-	Mar	30	23:00s	1:00	S
+Rule	Port	1936	only	-	Apr	18	23:00s	1:00	S
+# Whitman gives 1937 Apr 2; go with Shanks & Pottenger.
+Rule	Port	1937	only	-	Apr	 3	23:00s	1:00	S
+Rule	Port	1938	only	-	Mar	26	23:00s	1:00	S
+Rule	Port	1939	only	-	Apr	15	23:00s	1:00	S
+# Whitman gives 1939 Oct 7; go with Shanks & Pottenger.
+Rule	Port	1939	only	-	Nov	18	23:00s	0	-
+Rule	Port	1940	only	-	Feb	24	23:00s	1:00	S
+# Shanks & Pottenger give 1940 Oct 7; go with Whitman.
+Rule	Port	1940	1941	-	Oct	 5	23:00s	0	-
+Rule	Port	1941	only	-	Apr	 5	23:00s	1:00	S
+Rule	Port	1942	1945	-	Mar	Sat>=8	23:00s	1:00	S
+Rule	Port	1942	only	-	Apr	25	22:00s	2:00	M # Midsummer
+Rule	Port	1942	only	-	Aug	15	22:00s	1:00	S
+Rule	Port	1942	1945	-	Oct	Sat>=24	23:00s	0	-
+Rule	Port	1943	only	-	Apr	17	22:00s	2:00	M
+Rule	Port	1943	1945	-	Aug	Sat>=25	22:00s	1:00	S
+Rule	Port	1944	1945	-	Apr	Sat>=21	22:00s	2:00	M
+Rule	Port	1946	only	-	Apr	Sat>=1	23:00s	1:00	S
+Rule	Port	1946	only	-	Oct	Sat>=1	23:00s	0	-
+Rule	Port	1947	1949	-	Apr	Sun>=1	 2:00s	1:00	S
+Rule	Port	1947	1949	-	Oct	Sun>=1	 2:00s	0	-
+# Shanks & Pottenger say DST was observed in 1950; go with Whitman.
+# Whitman gives Oct lastSun for 1952 on; go with Shanks & Pottenger.
+Rule	Port	1951	1965	-	Apr	Sun>=1	 2:00s	1:00	S
+Rule	Port	1951	1965	-	Oct	Sun>=1	 2:00s	0	-
+Rule	Port	1977	only	-	Mar	27	 0:00s	1:00	S
+Rule	Port	1977	only	-	Sep	25	 0:00s	0	-
+Rule	Port	1978	1979	-	Apr	Sun>=1	 0:00s	1:00	S
+Rule	Port	1978	only	-	Oct	 1	 0:00s	0	-
+Rule	Port	1979	1982	-	Sep	lastSun	 1:00s	0	-
+Rule	Port	1980	only	-	Mar	lastSun	 0:00s	1:00	S
+Rule	Port	1981	1982	-	Mar	lastSun	 1:00s	1:00	S
+Rule	Port	1983	only	-	Mar	lastSun	 2:00s	1:00	S
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+# Shanks & Pottenger say the transition from LMT to WET occurred 1911-05-24;
+# Willett says 1912-01-01.  Go with Willett.
+Zone	Europe/Lisbon	-0:36:32 -	LMT	1884
+			-0:36:32 -	LMT	1912 Jan  1  # Lisbon Mean Time
+			 0:00	Port	WE%sT	1966 Apr  3 2:00
+			 1:00	-	CET	1976 Sep 26 1:00
+			 0:00	Port	WE%sT	1983 Sep 25 1:00s
+			 0:00	W-Eur	WE%sT	1992 Sep 27 1:00s
+			 1:00	EU	CE%sT	1996 Mar 31 1:00u
+			 0:00	EU	WE%sT
+Zone Atlantic/Azores	-1:42:40 -	LMT	1884		# Ponta Delgada
+			-1:54:32 -	HMT	1911 May 24  # Horta Mean Time
+			-2:00	Port	AZO%sT	1966 Apr  3 2:00 # Azores Time
+			-1:00	Port	AZO%sT	1983 Sep 25 1:00s
+			-1:00	W-Eur	AZO%sT	1992 Sep 27 1:00s
+			 0:00	EU	WE%sT	1993 Mar 28 1:00u
+			-1:00	EU	AZO%sT
+Zone Atlantic/Madeira	-1:07:36 -	LMT	1884		# Funchal
+			-1:07:36 -	FMT	1911 May 24  # Funchal Mean Time
+			-1:00	Port	MAD%sT	1966 Apr  3 2:00 # Madeira Time
+			 0:00	Port	WE%sT	1983 Sep 25 1:00s
+			 0:00	EU	WE%sT
+
+# Romania
+#
+# From Paul Eggert (1999-10-07):
+# <a href="http://www.nineoclock.ro/POL/1778pol.html">
+# Nine O'clock</a> (1998-10-23) reports that the switch occurred at
+# 04:00 local time in fall 1998.  For lack of better info,
+# assume that Romania and Moldova switched to EU rules in 1997,
+# the same year as Bulgaria.
+#
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Romania	1932	only	-	May	21	 0:00s	1:00	S
+Rule	Romania	1932	1939	-	Oct	Sun>=1	 0:00s	0	-
+Rule	Romania	1933	1939	-	Apr	Sun>=2	 0:00s	1:00	S
+Rule	Romania	1979	only	-	May	27	 0:00	1:00	S
+Rule	Romania	1979	only	-	Sep	lastSun	 0:00	0	-
+Rule	Romania	1980	only	-	Apr	 5	23:00	1:00	S
+Rule	Romania	1980	only	-	Sep	lastSun	 1:00	0	-
+Rule	Romania	1991	1993	-	Mar	lastSun	 0:00s	1:00	S
+Rule	Romania	1991	1993	-	Sep	lastSun	 0:00s	0	-
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone Europe/Bucharest	1:44:24 -	LMT	1891 Oct
+			1:44:24	-	BMT	1931 Jul 24	# Bucharest MT
+			2:00	Romania	EE%sT	1981 Mar 29 2:00s
+			2:00	C-Eur	EE%sT	1991
+			2:00	Romania	EE%sT	1994
+			2:00	E-Eur	EE%sT	1997
+			2:00	EU	EE%sT
+
+# Russia
+
+# From Paul Eggert (2006-03-22):
+# Except for Moscow after 1919-07-01, I invented the time zone abbreviations.
+# Moscow time zone abbreviations after 1919-07-01, and Moscow rules after 1991,
+# are from Andrey A. Chernov.  The rest is from Shanks & Pottenger,
+# except we follow Chernov's report that 1992 DST transitions were Sat
+# 23:00, not Sun 02:00s.
+#
+# From Stanislaw A. Kuzikowski (1994-06-29):
+# But now it is some months since Novosibirsk is 3 hours ahead of Moscow!
+# I do not know why they have decided to make this change;
+# as far as I remember it was done exactly during winter->summer switching
+# so we (Novosibirsk) simply did not switch.
+#
+# From Andrey A. Chernov (1996-10-04):
+# `MSK' and `MSD' were born and used initially on Moscow computers with
+# UNIX-like OSes by several developer groups (e.g. Demos group, Kiae group)....
+# The next step was the UUCP network, the Relcom predecessor
+# (used mainly for mail), and MSK/MSD was actively used there.
+#
+# From Chris Carrier (1996-10-30):
+# According to a friend of mine who rode the Trans-Siberian Railroad from
+# Moscow to Irkutsk in 1995, public air and rail transport in Russia ...
+# still follows Moscow time, no matter where in Russia it is located.
+#
+# For Grozny, Chechnya, we have the following story from
+# John Daniszewski, "Scavengers in the Rubble", Los Angeles Times (2001-02-07):
+# News--often false--is spread by word of mouth.  A rumor that it was
+# time to move the clocks back put this whole city out of sync with
+# the rest of Russia for two weeks--even soldiers stationed here began
+# enforcing curfew at the wrong time.
+#
+# From Gwillim Law (2001-06-05):
+# There's considerable evidence that Sakhalin Island used to be in
+# UTC+11, and has changed to UTC+10, in this decade.  I start with the
+# SSIM, which listed Yuzhno-Sakhalinsk in zone RU10 along with Magadan
+# until February 1997, and then in RU9 with Khabarovsk and Vladivostok
+# since September 1997....  Although the Kuril Islands are
+# administratively part of Sakhalin oblast', they appear to have
+# remained on UTC+11 along with Magadan.
+#
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+#
+# Kaliningradskaya oblast'.
+Zone Europe/Kaliningrad	 1:22:00 -	LMT	1893 Apr
+			 1:00	C-Eur	CE%sT	1945
+			 2:00	Poland	CE%sT	1946
+			 3:00	Russia	MSK/MSD	1991 Mar 31 2:00s
+			 2:00	Russia	EE%sT
+#
+# From Oscar van Vlijmen (2001-08-25): [This region consists of]
+# Respublika Adygeya, Arkhangel'skaya oblast',
+# Belgorodskaya oblast', Bryanskaya oblast', Vladimirskaya oblast',
+# Vologodskaya oblast', Voronezhskaya oblast',
+# Respublika Dagestan, Ivanovskaya oblast', Respublika Ingushetiya,
+# Kabarbino-Balkarskaya Respublika, Respublika Kalmykiya,
+# Kalyzhskaya oblast', Respublika Karachaevo-Cherkessiya,
+# Respublika Kareliya, Respublika Komi,
+# Kostromskaya oblast', Krasnodarskij kraj, Kurskaya oblast',
+# Leningradskaya oblast', Lipetskaya oblast', Respublika Marij El,
+# Respublika Mordoviya, Moskva, Moskovskaya oblast',
+# Murmanskaya oblast', Nenetskij avtonomnyj okrug,
+# Nizhegorodskaya oblast', Novgorodskaya oblast', Orlovskaya oblast',
+# Penzenskaya oblast', Pskovskaya oblast', Rostovskaya oblast',
+# Ryazanskaya oblast', Sankt-Peterburg,
+# Respublika Severnaya Osetiya, Smolenskaya oblast',
+# Stavropol'skij kraj, Tambovskaya oblast', Respublika Tatarstan,
+# Tverskaya oblast', Tyl'skaya oblast', Ul'yanovskaya oblast',
+# Chechenskaya Respublika, Chuvashskaya oblast',
+# Yaroslavskaya oblast'
+Zone Europe/Moscow	 2:30:20 -	LMT	1880
+			 2:30	-	MMT	1916 Jul  3 # Moscow Mean Time
+			 2:30:48 Russia	%s	1919 Jul  1 2:00
+			 3:00	Russia	MSK/MSD	1922 Oct
+			 2:00	-	EET	1930 Jun 21
+			 3:00	Russia	MSK/MSD	1991 Mar 31 2:00s
+			 2:00	Russia	EE%sT	1992 Jan 19 2:00s
+			 3:00	Russia	MSK/MSD
+#
+# Astrakhanskaya oblast', Kirovskaya oblast', Saratovskaya oblast',
+# Volgogradskaya oblast'.  Shanks & Pottenger say Kirov is still at +0400
+# but Wikipedia (2006-05-09) says +0300.  Perhaps it switched after the
+# others?  But we have no data.
+Zone Europe/Volgograd	 2:57:40 -	LMT	1920 Jan  3
+			 3:00	-	TSAT	1925 Apr  6 # Tsaritsyn Time
+			 3:00	-	STAT	1930 Jun 21 # Stalingrad Time
+			 4:00	-	STAT	1961 Nov 11
+			 4:00	Russia	VOL%sT	1989 Mar 26 2:00s # Volgograd T
+			 3:00	Russia	VOL%sT	1991 Mar 31 2:00s
+			 4:00	-	VOLT	1992 Mar 29 2:00s
+			 3:00	Russia	VOL%sT
+#
+# From Oscar van Vlijmen (2001-08-25): [This region consists of]
+# Samarskaya oblast', Udmyrtskaya respublika
+Zone Europe/Samara	 3:20:36 -	LMT	1919 Jul  1 2:00
+			 3:00	-	SAMT	1930 Jun 21
+			 4:00	-	SAMT	1935 Jan 27
+			 4:00	Russia	KUY%sT	1989 Mar 26 2:00s # Kuybyshev
+			 3:00	Russia	KUY%sT	1991 Mar 31 2:00s
+			 2:00	Russia	KUY%sT	1991 Sep 29 2:00s
+			 3:00	-	KUYT	1991 Oct 20 3:00
+			 4:00	Russia	SAM%sT	2010 Mar 28 2:00s # Samara Time
+			 3:00	Russia	SAM%sT
+
+#
+# From Oscar van Vlijmen (2001-08-25): [This region consists of]
+# Respublika Bashkortostan, Komi-Permyatskij avtonomnyj okrug,
+# Kurganskaya oblast', Orenburgskaya oblast', Permskaya oblast',
+# Sverdlovskaya oblast', Tyumenskaya oblast',
+# Khanty-Manskijskij avtonomnyj okrug, Chelyabinskaya oblast',
+# Yamalo-Nenetskij avtonomnyj okrug.
+Zone Asia/Yekaterinburg	 4:02:24 -	LMT	1919 Jul 15 4:00
+			 4:00	-	SVET	1930 Jun 21 # Sverdlovsk Time
+			 5:00	Russia	SVE%sT	1991 Mar 31 2:00s
+			 4:00	Russia	SVE%sT	1992 Jan 19 2:00s
+			 5:00	Russia	YEK%sT	# Yekaterinburg Time
+#
+# From Oscar van Vlijmen (2001-08-25): [This region consists of]
+# Respublika Altaj, Altajskij kraj, Omskaya oblast'.
+Zone Asia/Omsk		 4:53:36 -	LMT	1919 Nov 14
+			 5:00	-	OMST	1930 Jun 21 # Omsk TIme
+			 6:00	Russia	OMS%sT	1991 Mar 31 2:00s
+			 5:00	Russia	OMS%sT	1992 Jan 19 2:00s
+			 6:00	Russia	OMS%sT
+#
+# From Paul Eggert (2006-08-19): I'm guessing about Tomsk here; it's
+# not clear when it switched from +7 to +6.
+# Novosibirskaya oblast', Tomskaya oblast'.
+Zone Asia/Novosibirsk	 5:31:40 -	LMT	1919 Dec 14 6:00
+			 6:00	-	NOVT	1930 Jun 21 # Novosibirsk Time
+			 7:00	Russia	NOV%sT	1991 Mar 31 2:00s
+			 6:00	Russia	NOV%sT	1992 Jan 19 2:00s
+			 7:00	Russia	NOV%sT	1993 May 23 # say Shanks & P.
+			 6:00	Russia	NOV%sT
+
+# From Alexander Krivenyshev (2009-10-13):
+# Kemerovo oblast' (Kemerovo region) in Russia will change current time zone on
+# March 28, 2010:
+# from current Russia Zone 6 - Krasnoyarsk Time Zone (KRA) UTC +0700
+# to Russia Zone 5 - Novosibirsk Time Zone (NOV) UTC +0600
+#
+# This is according to Government of Russia decree # 740, on September
+# 14, 2009 "Application in the territory of the Kemerovo region the Fifth
+# time zone." ("Russia Zone 5" or old "USSR Zone 5" is GMT +0600)
+#
+# Russian Government web site (Russian language)
+# <a href="http://www.government.ru/content/governmentactivity/rfgovernmentdecisions/archiv">
+# http://www.government.ru/content/governmentactivity/rfgovernmentdecisions/archive/2009/09/14/991633.htm
+# </a>
+# or Russian-English translation by WorldTimeZone.com with reference
+# map to local region and new Russia Time Zone map after March 28, 2010
+# <a href="http://www.worldtimezone.com/dst_news/dst_news_russia03.html">
+# http://www.worldtimezone.com/dst_news/dst_news_russia03.html
+# </a>
+#
+# Thus, when Russia will switch to DST on the night of March 28, 2010
+# Kemerovo region (Kemerovo oblast') will not change the clock.
+#
+# As a result, Kemerovo oblast' will be in the same time zone as
+# Novosibirsk, Omsk, Tomsk, Barnaul and Altai Republic.
+
+Zone Asia/Novokuznetsk	 5:48:48 -	NMT	1920 Jan  6
+			 6:00	-	KRAT	1930 Jun 21 # Krasnoyarsk Time
+			 7:00	Russia	KRA%sT	1991 Mar 31 2:00s
+			 6:00	Russia	KRA%sT	1992 Jan 19 2:00s
+			 7:00	Russia	KRA%sT	2010 Mar 28 2:00s
+			 6:00	Russia	NOV%sT # Novosibirsk/Novokuznetsk Time
+
+#
+# From Oscar van Vlijmen (2001-08-25): [This region consists of]
+# Krasnoyarskij kraj,
+# Tajmyrskij (Dolgano-Nenetskij) avtonomnyj okrug,
+# Respublika Tuva, Respublika Khakasiya, Evenkijskij avtonomnyj okrug.
+Zone Asia/Krasnoyarsk	 6:11:20 -	LMT	1920 Jan  6
+			 6:00	-	KRAT	1930 Jun 21 # Krasnoyarsk Time
+			 7:00	Russia	KRA%sT	1991 Mar 31 2:00s
+			 6:00	Russia	KRA%sT	1992 Jan 19 2:00s
+			 7:00	Russia	KRA%sT
+#
+# From Oscar van Vlijmen (2001-08-25): [This region consists of]
+# Respublika Buryatiya, Irkutskaya oblast',
+# Ust'-Ordynskij Buryatskij avtonomnyj okrug.
+Zone Asia/Irkutsk	 6:57:20 -	LMT	1880
+			 6:57:20 -	IMT	1920 Jan 25 # Irkutsk Mean Time
+			 7:00	-	IRKT	1930 Jun 21 # Irkutsk Time
+			 8:00	Russia	IRK%sT	1991 Mar 31 2:00s
+			 7:00	Russia	IRK%sT	1992 Jan 19 2:00s
+			 8:00	Russia	IRK%sT
+#
+# From Oscar van Vlijmen (2003-10-18): [This region consists of]
+# Aginskij Buryatskij avtonomnyj okrug, Amurskaya oblast',
+# [parts of] Respublika Sakha (Yakutiya), Chitinskaya oblast'.
+
+# From Oscar van Vlijmen (2009-11-29):
+# ...some regions of RUssia were merged with others since 2005...
+# Some names were changed, no big deal, except for one instance: a new name.
+# YAK/YAKST: UTC+9 Zabajkal'skij kraj.
+
+# From Oscar van Vlijmen (2009-11-29):
+# The Sakha districts are: Aldanskij, Amginskij, Anabarskij,
+# Verkhnevilyujskij, Vilyujskij, Gornyj,
+# Zhiganskij, Kobyajskij, Lenskij, Megino-Kangalasskij, Mirninskij,
+# Namskij, Nyurbinskij, Olenyokskij, Olyokminskij,
+# Suntarskij, Tattinskij, Ust'-Aldanskij, Khangalasskij,
+# Churapchinskij, Eveno-Bytantajskij Natsional'nij.
+
+Zone Asia/Yakutsk	 8:38:40 -	LMT	1919 Dec 15
+			 8:00	-	YAKT	1930 Jun 21 # Yakutsk Time
+			 9:00	Russia	YAK%sT	1991 Mar 31 2:00s
+			 8:00	Russia	YAK%sT	1992 Jan 19 2:00s
+			 9:00	Russia	YAK%sT
+#
+# From Oscar van Vlijmen (2003-10-18): [This region consists of]
+# Evrejskaya avtonomnaya oblast', Khabarovskij kraj, Primorskij kraj,
+# [parts of] Respublika Sakha (Yakutiya).
+
+# From Oscar van Vlijmen (2009-11-29):
+# The Sakha districts are: Bulunskij, Verkhoyanskij, Tomponskij, Ust'-Majskij,
+# Ust'-Yanskij.
+Zone Asia/Vladivostok	 8:47:44 -	LMT	1922 Nov 15
+			 9:00	-	VLAT	1930 Jun 21 # Vladivostok Time
+			10:00	Russia	VLA%sT	1991 Mar 31 2:00s
+			 9:00	Russia	VLA%sST	1992 Jan 19 2:00s
+			10:00	Russia	VLA%sT
+#
+# Sakhalinskaya oblast'.
+# The Zone name should be Yuzhno-Sakhalinsk, but that's too long.
+Zone Asia/Sakhalin	 9:30:48 -	LMT	1905 Aug 23
+			 9:00	-	CJT	1938
+			 9:00	-	JST	1945 Aug 25
+			11:00	Russia	SAK%sT	1991 Mar 31 2:00s # Sakhalin T.
+			10:00	Russia	SAK%sT	1992 Jan 19 2:00s
+			11:00	Russia	SAK%sT	1997 Mar lastSun 2:00s
+			10:00	Russia	SAK%sT
+#
+# From Oscar van Vlijmen (2003-10-18): [This region consists of]
+# Magadanskaya oblast', Respublika Sakha (Yakutiya).
+# Probably also: Kuril Islands.
+
+# From Oscar van Vlijmen (2009-11-29):
+# The Sakha districts are: Abyjskij, Allaikhovskij, Verkhhhnekolymskij, Momskij,
+# Nizhnekolymskij, Ojmyakonskij, Srednekolymskij.
+Zone Asia/Magadan	10:03:12 -	LMT	1924 May  2
+			10:00	-	MAGT	1930 Jun 21 # Magadan Time
+			11:00	Russia	MAG%sT	1991 Mar 31 2:00s
+			10:00	Russia	MAG%sT	1992 Jan 19 2:00s
+			11:00	Russia	MAG%sT
+#
+# From Oscar van Vlijmen (2001-08-25): [This region consists of]
+# Kamchatskaya oblast', Koryakskij avtonomnyj okrug.
+#
+# The Zone name should be Asia/Petropavlovsk-Kamchatski, but that's too long.
+Zone Asia/Kamchatka	10:34:36 -	LMT	1922 Nov 10
+			11:00	-	PETT	1930 Jun 21 # P-K Time
+			12:00	Russia	PET%sT	1991 Mar 31 2:00s
+			11:00	Russia	PET%sT	1992 Jan 19 2:00s
+			12:00	Russia	PET%sT	2010 Mar 28 2:00s
+			11:00	Russia	PET%sT
+#
+# Chukotskij avtonomnyj okrug
+Zone Asia/Anadyr	11:49:56 -	LMT	1924 May  2
+			12:00	-	ANAT	1930 Jun 21 # Anadyr Time
+			13:00	Russia	ANA%sT	1982 Apr  1 0:00s
+			12:00	Russia	ANA%sT	1991 Mar 31 2:00s
+			11:00	Russia	ANA%sT	1992 Jan 19 2:00s
+			12:00	Russia	ANA%sT	2010 Mar 28 2:00s
+			11:00	Russia	ANA%sT
+
+# Serbia
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Europe/Belgrade	1:22:00	-	LMT	1884
+			1:00	-	CET	1941 Apr 18 23:00
+			1:00	C-Eur	CE%sT	1945
+			1:00	-	CET	1945 May 8 2:00s
+			1:00	1:00	CEST	1945 Sep 16  2:00s
+# Metod Kozelj reports that the legal date of
+# transition to EU rules was 1982-11-27, for all of Yugoslavia at the time.
+# Shanks & Pottenger don't give as much detail, so go with Kozelj.
+			1:00	-	CET	1982 Nov 27
+			1:00	EU	CE%sT
+Link Europe/Belgrade Europe/Ljubljana	# Slovenia
+Link Europe/Belgrade Europe/Podgorica	# Montenegro
+Link Europe/Belgrade Europe/Sarajevo	# Bosnia and Herzegovina
+Link Europe/Belgrade Europe/Skopje	# Macedonia
+Link Europe/Belgrade Europe/Zagreb	# Croatia
+
+# Slovakia
+Link Europe/Prague Europe/Bratislava
+
+# Slovenia
+# see Serbia
+
+# Spain
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+# For 1917-1919 Whitman gives Apr Sat>=1 - Oct Sat>=1;
+# go with Shanks & Pottenger.
+Rule	Spain	1917	only	-	May	 5	23:00s	1:00	S
+Rule	Spain	1917	1919	-	Oct	 6	23:00s	0	-
+Rule	Spain	1918	only	-	Apr	15	23:00s	1:00	S
+Rule	Spain	1919	only	-	Apr	 5	23:00s	1:00	S
+# Whitman gives 1921 Feb 28 - Oct 14; go with Shanks & Pottenger.
+Rule	Spain	1924	only	-	Apr	16	23:00s	1:00	S
+# Whitman gives 1924 Oct 14; go with Shanks & Pottenger.
+Rule	Spain	1924	only	-	Oct	 4	23:00s	0	-
+Rule	Spain	1926	only	-	Apr	17	23:00s	1:00	S
+# Whitman says no DST in 1929; go with Shanks & Pottenger.
+Rule	Spain	1926	1929	-	Oct	Sat>=1	23:00s	0	-
+Rule	Spain	1927	only	-	Apr	 9	23:00s	1:00	S
+Rule	Spain	1928	only	-	Apr	14	23:00s	1:00	S
+Rule	Spain	1929	only	-	Apr	20	23:00s	1:00	S
+# Whitman gives 1937 Jun 16, 1938 Apr 16, 1940 Apr 13;
+# go with Shanks & Pottenger.
+Rule	Spain	1937	only	-	May	22	23:00s	1:00	S
+Rule	Spain	1937	1939	-	Oct	Sat>=1	23:00s	0	-
+Rule	Spain	1938	only	-	Mar	22	23:00s	1:00	S
+Rule	Spain	1939	only	-	Apr	15	23:00s	1:00	S
+Rule	Spain	1940	only	-	Mar	16	23:00s	1:00	S
+# Whitman says no DST 1942-1945; go with Shanks & Pottenger.
+Rule	Spain	1942	only	-	May	 2	22:00s	2:00	M # Midsummer
+Rule	Spain	1942	only	-	Sep	 1	22:00s	1:00	S
+Rule	Spain	1943	1946	-	Apr	Sat>=13	22:00s	2:00	M
+Rule	Spain	1943	only	-	Oct	 3	22:00s	1:00	S
+Rule	Spain	1944	only	-	Oct	10	22:00s	1:00	S
+Rule	Spain	1945	only	-	Sep	30	 1:00	1:00	S
+Rule	Spain	1946	only	-	Sep	30	 0:00	0	-
+Rule	Spain	1949	only	-	Apr	30	23:00	1:00	S
+Rule	Spain	1949	only	-	Sep	30	 1:00	0	-
+Rule	Spain	1974	1975	-	Apr	Sat>=13	23:00	1:00	S
+Rule	Spain	1974	1975	-	Oct	Sun>=1	 1:00	0	-
+Rule	Spain	1976	only	-	Mar	27	23:00	1:00	S
+Rule	Spain	1976	1977	-	Sep	lastSun	 1:00	0	-
+Rule	Spain	1977	1978	-	Apr	 2	23:00	1:00	S
+Rule	Spain	1978	only	-	Oct	 1	 1:00	0	-
+# The following rules are copied from Morocco from 1967 through 1978.
+Rule SpainAfrica 1967	only	-	Jun	 3	12:00	1:00	S
+Rule SpainAfrica 1967	only	-	Oct	 1	 0:00	0	-
+Rule SpainAfrica 1974	only	-	Jun	24	 0:00	1:00	S
+Rule SpainAfrica 1974	only	-	Sep	 1	 0:00	0	-
+Rule SpainAfrica 1976	1977	-	May	 1	 0:00	1:00	S
+Rule SpainAfrica 1976	only	-	Aug	 1	 0:00	0	-
+Rule SpainAfrica 1977	only	-	Sep	28	 0:00	0	-
+Rule SpainAfrica 1978	only	-	Jun	 1	 0:00	1:00	S
+Rule SpainAfrica 1978	only	-	Aug	 4	 0:00	0	-
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Europe/Madrid	-0:14:44 -	LMT	1901 Jan  1  0:00s
+			 0:00	Spain	WE%sT	1946 Sep 30
+			 1:00	Spain	CE%sT	1979
+			 1:00	EU	CE%sT
+Zone	Africa/Ceuta	-0:21:16 -	LMT	1901
+			 0:00	-	WET	1918 May  6 23:00
+			 0:00	1:00	WEST	1918 Oct  7 23:00
+			 0:00	-	WET	1924
+			 0:00	Spain	WE%sT	1929
+			 0:00 SpainAfrica WE%sT 1984 Mar 16
+			 1:00	-	CET	1986
+			 1:00	EU	CE%sT
+Zone	Atlantic/Canary	-1:01:36 -	LMT	1922 Mar # Las Palmas de Gran C.
+			-1:00	-	CANT	1946 Sep 30 1:00 # Canaries Time
+			 0:00	-	WET	1980 Apr  6 0:00s
+			 0:00	1:00	WEST	1980 Sep 28 0:00s
+			 0:00	EU	WE%sT
+# IATA SSIM (1996-09) says the Canaries switch at 2:00u, not 1:00u.
+# Ignore this for now, as the Canaries are part of the EU.
+
+# Sweden
+
+# From Ivan Nilsson (2001-04-13), superseding Shanks & Pottenger:
+#
+# The law "Svensk forfattningssamling 1878, no 14" about standard time in 1879:
+# From the beginning of 1879 (that is 01-01 00:00) the time for all
+# places in the country is "the mean solar time for the meridian at
+# three degrees, or twelve minutes of time, to the west of the
+# meridian of the Observatory of Stockholm".  The law is dated 1878-05-31.
+#
+# The observatory at that time had the meridian 18 degrees 03' 30"
+# eastern longitude = 01:12:14 in time.  Less 12 minutes gives the
+# national standard time as 01:00:14 ahead of GMT....
+#
+# About the beginning of CET in Sweden. The lawtext ("Svensk
+# forfattningssamling 1899, no 44") states, that "from the beginning
+# of 1900... ... the same as the mean solar time for the meridian at
+# the distance of one hour of time from the meridian of the English
+# observatory at Greenwich, or at 12 minutes 14 seconds to the west
+# from the meridian of the Observatory of Stockholm". The law is dated
+# 1899-06-16.  In short: At 1900-01-01 00:00:00 the new standard time
+# in Sweden is 01:00:00 ahead of GMT.
+#
+# 1916: The lawtext ("Svensk forfattningssamling 1916, no 124") states
+# that "1916-05-15 is considered to begin one hour earlier". It is
+# pretty obvious that at 05-14 23:00 the clocks are set to 05-15 00:00....
+# Further the law says, that "1916-09-30 is considered to end one hour later".
+#
+# The laws regulating [DST] are available on the site of the Swedish
+# Parliament beginning with 1985 - the laws regulating 1980/1984 are
+# not available on the site (to my knowledge they are only available
+# in Swedish): <http://www.riksdagen.se/english/work/sfst.asp> (type
+# "sommartid" without the quotes in the field "Fritext" and then click
+# the Sok-button).
+#
+# (2001-05-13):
+#
+# I have now found a newspaper stating that at 1916-10-01 01:00
+# summertime the church-clocks etc were set back one hour to show
+# 1916-10-01 00:00 standard time.  The article also reports that some
+# people thought the switch to standard time would take place already
+# at 1916-10-01 00:00 summer time, but they had to wait for another
+# hour before the event took place.
+#
+# Source: The newspaper "Dagens Nyheter", 1916-10-01, page 7 upper left.
+
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone Europe/Stockholm	1:12:12 -	LMT	1879 Jan  1
+			1:00:14	-	SET	1900 Jan  1	# Swedish Time
+			1:00	-	CET	1916 May 14 23:00
+			1:00	1:00	CEST	1916 Oct  1 01:00
+			1:00	-	CET	1980
+			1:00	EU	CE%sT
+
+# Switzerland
+# From Howse:
+# By the end of the 18th century clocks and watches became commonplace
+# and their performance improved enormously.  Communities began to keep
+# mean time in preference to apparent time -- Geneva from 1780 ....
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+# From Whitman (who writes ``Midnight?''):
+# Rule	Swiss	1940	only	-	Nov	 2	0:00	1:00	S
+# Rule	Swiss	1940	only	-	Dec	31	0:00	0	-
+# From Shanks & Pottenger:
+# Rule	Swiss	1941	1942	-	May	Sun>=1	2:00	1:00	S
+# Rule	Swiss	1941	1942	-	Oct	Sun>=1	0:00	0	-
+
+# From Alois Treindl (2008-12-17):
+# I have researched the DST usage in Switzerland during the 1940ies.
+#
+# As I wrote in an earlier message, I suspected the current tzdata values
+# to be wrong. This is now verified.
+#
+# I have found copies of the original ruling by the Swiss Federal
+# government, in 'Eidgen[o]ssische Gesetzessammlung 1941 and 1942' (Swiss
+# federal law collection)...
+#
+# DST began on Monday 5 May 1941, 1:00 am by shifting the clocks to 2:00 am
+# DST ended on Monday 6 Oct 1941, 2:00 am by shifting the clocks to 1:00 am.
+#
+# DST began on Monday, 4 May 1942 at 01:00 am
+# DST ended on Monday, 5 Oct 1942 at 02:00 am
+#
+# There was no DST in 1940, I have checked the law collection carefully.
+# It is also indicated by the fact that the 1942 entry in the law
+# collection points back to 1941 as a reference, but no reference to any
+# other years are made.
+#
+# Newspaper articles I have read in the archives on 6 May 1941 reported
+# about the introduction of DST (Sommerzeit in German) during the previous
+# night as an absolute novelty, because this was the first time that such
+# a thing had happened in Switzerland.
+#
+# I have also checked 1916, because one book source (Gabriel, Traite de
+# l'heure dans le monde) claims that Switzerland had DST in 1916. This is
+# false, no official document could be found. Probably Gabriel got misled
+# by references to Germany, which introduced DST in 1916 for the first time.
+#
+# The tzdata rules for Switzerland must be changed to:
+# Rule  Swiss   1941    1942    -       May     Mon>=1  1:00    1:00    S
+# Rule  Swiss   1941    1942    -       Oct     Mon>=1  2:00    0       -
+#
+# The 1940 rules must be deleted.
+#
+# One further detail for Switzerland, which is probably out of scope for
+# most users of tzdata:
+# The zone file
+# Zone    Europe/Zurich   0:34:08 -       LMT     1848 Sep 12
+#                          0:29:44 -       BMT     1894 Jun #Bern Mean Time
+#                          1:00    Swiss   CE%sT   1981
+#                          1:00    EU      CE%sT
+# describes all of Switzerland correctly, with the exception of
+# the Cantone Geneve (Geneva, Genf). Between 1848 and 1894 Geneve did not
+# follow Bern Mean Time but kept its own local mean time.
+# To represent this, an extra zone would be needed.
+
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Swiss	1941	1942	-	May	Mon>=1	1:00	1:00	S
+Rule	Swiss	1941	1942	-	Oct	Mon>=1	2:00	0	-
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Europe/Zurich	0:34:08 -	LMT	1848 Sep 12
+			0:29:44	-	BMT	1894 Jun # Bern Mean Time
+			1:00	Swiss	CE%sT	1981
+			1:00	EU	CE%sT
+
+# Turkey
+
+# From Amar Devegowda (2007-01-03):
+# The time zone rules for Istanbul, Turkey have not been changed for years now.
+# ... The latest rules are available at -
+# http://www.timeanddate.com/worldclock/timezone.html?n=107
+# From Steffen Thorsen (2007-01-03):
+# I have been able to find press records back to 1996 which all say that
+# DST started 01:00 local time and end at 02:00 local time.  I am not sure
+# what happened before that.  One example for each year from 1996 to 2001:
+# http://newspot.byegm.gov.tr/arsiv/1996/21/N4.htm
+# http://www.byegm.gov.tr/YAYINLARIMIZ/CHR/ING97/03/97X03X25.TXT
+# http://www.byegm.gov.tr/YAYINLARIMIZ/CHR/ING98/03/98X03X02.HTM
+# http://www.byegm.gov.tr/YAYINLARIMIZ/CHR/ING99/10/99X10X26.HTM#%2016
+# http://www.byegm.gov.tr/YAYINLARIMIZ/CHR/ING2000/03/00X03X06.HTM#%2021
+# http://www.byegm.gov.tr/YAYINLARIMIZ/CHR/ING2001/03/23x03x01.HTM#%2027
+# From Paul Eggert (2007-01-03):
+# Prefer the above source to Shanks & Pottenger for time stamps after 1990.
+
+# From Steffen Thorsen (2007-03-09):
+# Starting 2007 though, it seems that they are adopting EU's 1:00 UTC
+# start/end time, according to the following page (2007-03-07):
+# http://www.ntvmsnbc.com/news/402029.asp
+# The official document is located here - it is in Turkish...:
+# http://rega.basbakanlik.gov.tr/eskiler/2007/03/20070307-7.htm
+# I was able to locate the following seemingly official document
+# (on a non-government server though) describing dates between 2002 and 2006:
+# http://www.alomaliye.com/bkk_2002_3769.htm
+
+# From Sue Williams (2008-08-11):
+# I spotted this news article about a potential change in Turkey.
+#
+# <a href="http://www.hurriyet.com.tr/english/domestic/9626174.asp?scr=1">
+# http://www.hurriyet.com.tr/english/domestic/9626174.asp?scr=1
+# </a>
+
+# From Sue Williams (2008-08-20):
+# This article says that around the end of March 2011, Turkey wants to
+# adjust the clocks forward by 1/2 hour and stay that way permanently.
+# The article indicates that this is a change in timezone offset in addition
+# to stopping observance of DST.
+# This proposal has not yet been approved.
+#
+# Read more here...
+#
+# Turkey to abandon daylight saving time in 2011
+# <a href="http://www.turkishdailynews.com.tr/article.php?enewsid=112989">
+# http://www.turkishdailynews.com.tr/article.php?enewsid=112989
+# </a>
+
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Turkey	1916	only	-	May	 1	0:00	1:00	S
+Rule	Turkey	1916	only	-	Oct	 1	0:00	0	-
+Rule	Turkey	1920	only	-	Mar	28	0:00	1:00	S
+Rule	Turkey	1920	only	-	Oct	25	0:00	0	-
+Rule	Turkey	1921	only	-	Apr	 3	0:00	1:00	S
+Rule	Turkey	1921	only	-	Oct	 3	0:00	0	-
+Rule	Turkey	1922	only	-	Mar	26	0:00	1:00	S
+Rule	Turkey	1922	only	-	Oct	 8	0:00	0	-
+# Whitman gives 1923 Apr 28 - Sep 16 and no DST in 1924-1925;
+# go with Shanks & Pottenger.
+Rule	Turkey	1924	only	-	May	13	0:00	1:00	S
+Rule	Turkey	1924	1925	-	Oct	 1	0:00	0	-
+Rule	Turkey	1925	only	-	May	 1	0:00	1:00	S
+Rule	Turkey	1940	only	-	Jun	30	0:00	1:00	S
+Rule	Turkey	1940	only	-	Oct	 5	0:00	0	-
+Rule	Turkey	1940	only	-	Dec	 1	0:00	1:00	S
+Rule	Turkey	1941	only	-	Sep	21	0:00	0	-
+Rule	Turkey	1942	only	-	Apr	 1	0:00	1:00	S
+# Whitman omits the next two transition and gives 1945 Oct 1;
+# go with Shanks & Pottenger.
+Rule	Turkey	1942	only	-	Nov	 1	0:00	0	-
+Rule	Turkey	1945	only	-	Apr	 2	0:00	1:00	S
+Rule	Turkey	1945	only	-	Oct	 8	0:00	0	-
+Rule	Turkey	1946	only	-	Jun	 1	0:00	1:00	S
+Rule	Turkey	1946	only	-	Oct	 1	0:00	0	-
+Rule	Turkey	1947	1948	-	Apr	Sun>=16	0:00	1:00	S
+Rule	Turkey	1947	1950	-	Oct	Sun>=2	0:00	0	-
+Rule	Turkey	1949	only	-	Apr	10	0:00	1:00	S
+Rule	Turkey	1950	only	-	Apr	19	0:00	1:00	S
+Rule	Turkey	1951	only	-	Apr	22	0:00	1:00	S
+Rule	Turkey	1951	only	-	Oct	 8	0:00	0	-
+Rule	Turkey	1962	only	-	Jul	15	0:00	1:00	S
+Rule	Turkey	1962	only	-	Oct	 8	0:00	0	-
+Rule	Turkey	1964	only	-	May	15	0:00	1:00	S
+Rule	Turkey	1964	only	-	Oct	 1	0:00	0	-
+Rule	Turkey	1970	1972	-	May	Sun>=2	0:00	1:00	S
+Rule	Turkey	1970	1972	-	Oct	Sun>=2	0:00	0	-
+Rule	Turkey	1973	only	-	Jun	 3	1:00	1:00	S
+Rule	Turkey	1973	only	-	Nov	 4	3:00	0	-
+Rule	Turkey	1974	only	-	Mar	31	2:00	1:00	S
+Rule	Turkey	1974	only	-	Nov	 3	5:00	0	-
+Rule	Turkey	1975	only	-	Mar	30	0:00	1:00	S
+Rule	Turkey	1975	1976	-	Oct	lastSun	0:00	0	-
+Rule	Turkey	1976	only	-	Jun	 1	0:00	1:00	S
+Rule	Turkey	1977	1978	-	Apr	Sun>=1	0:00	1:00	S
+Rule	Turkey	1977	only	-	Oct	16	0:00	0	-
+Rule	Turkey	1979	1980	-	Apr	Sun>=1	3:00	1:00	S
+Rule	Turkey	1979	1982	-	Oct	Mon>=11	0:00	0	-
+Rule	Turkey	1981	1982	-	Mar	lastSun	3:00	1:00	S
+Rule	Turkey	1983	only	-	Jul	31	0:00	1:00	S
+Rule	Turkey	1983	only	-	Oct	 2	0:00	0	-
+Rule	Turkey	1985	only	-	Apr	20	0:00	1:00	S
+Rule	Turkey	1985	only	-	Sep	28	0:00	0	-
+Rule	Turkey	1986	1990	-	Mar	lastSun	2:00s	1:00	S
+Rule	Turkey	1986	1990	-	Sep	lastSun	2:00s	0	-
+Rule	Turkey	1991	2006	-	Mar	lastSun	1:00s	1:00	S
+Rule	Turkey	1991	1995	-	Sep	lastSun	1:00s	0	-
+Rule	Turkey	1996	2006	-	Oct	lastSun	1:00s	0	-
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	Europe/Istanbul	1:55:52 -	LMT	1880
+			1:56:56	-	IMT	1910 Oct # Istanbul Mean Time?
+			2:00	Turkey	EE%sT	1978 Oct 15
+			3:00	Turkey	TR%sT	1985 Apr 20 # Turkey Time
+			2:00	Turkey	EE%sT	2007
+			2:00	EU	EE%sT
+Link	Europe/Istanbul	Asia/Istanbul	# Istanbul is in both continents.
+
+# Ukraine
+#
+# From Igor Karpov, who works for the Ukranian Ministry of Justice,
+# via Garrett Wollman (2003-01-27):
+# BTW, I've found the official document on this matter. It's goverment
+# regulations number 509, May 13, 1996. In my poor translation it says:
+# "Time in Ukraine is set to second timezone (Kiev time). Each last Sunday
+# of March at 3am the time is changing to 4am and each last Sunday of
+# October the time at 4am is changing to 3am"
+
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+# Most of Ukraine since 1970 has been like Kiev.
+# "Kyiv" is the transliteration of the Ukrainian name, but
+# "Kiev" is more common in English.
+Zone Europe/Kiev	2:02:04 -	LMT	1880
+			2:02:04	-	KMT	1924 May  2 # Kiev Mean Time
+			2:00	-	EET	1930 Jun 21
+			3:00	-	MSK	1941 Sep 20
+			1:00	C-Eur	CE%sT	1943 Nov  6
+			3:00	Russia	MSK/MSD	1990
+			3:00	-	MSK	1990 Jul  1 2:00
+			2:00	-	EET	1992
+			2:00	E-Eur	EE%sT	1995
+			2:00	EU	EE%sT
+# Ruthenia used CET 1990/1991.
+# "Uzhhorod" is the transliteration of the Ukrainian name, but
+# "Uzhgorod" is more common in English.
+Zone Europe/Uzhgorod	1:29:12 -	LMT	1890 Oct
+			1:00	-	CET	1940
+			1:00	C-Eur	CE%sT	1944 Oct
+			1:00	1:00	CEST	1944 Oct 26
+			1:00	-	CET	1945 Jun 29
+			3:00	Russia	MSK/MSD	1990
+			3:00	-	MSK	1990 Jul  1 2:00
+			1:00	-	CET	1991 Mar 31 3:00
+			2:00	-	EET	1992
+			2:00	E-Eur	EE%sT	1995
+			2:00	EU	EE%sT
+# Zaporozh'ye and eastern Lugansk oblasts observed DST 1990/1991.
+# "Zaporizhia" is the transliteration of the Ukrainian name, but
+# "Zaporozh'ye" is more common in English.  Use the common English
+# spelling, except omit the apostrophe as it is not allowed in
+# portable Posix file names.
+Zone Europe/Zaporozhye	2:20:40 -	LMT	1880
+			2:20	-	CUT	1924 May  2 # Central Ukraine T
+			2:00	-	EET	1930 Jun 21
+			3:00	-	MSK	1941 Aug 25
+			1:00	C-Eur	CE%sT	1943 Oct 25
+			3:00	Russia	MSK/MSD	1991 Mar 31 2:00
+			2:00	E-Eur	EE%sT	1995
+			2:00	EU	EE%sT
+# Central Crimea used Moscow time 1994/1997.
+Zone Europe/Simferopol	2:16:24 -	LMT	1880
+			2:16	-	SMT	1924 May  2 # Simferopol Mean T
+			2:00	-	EET	1930 Jun 21
+			3:00	-	MSK	1941 Nov
+			1:00	C-Eur	CE%sT	1944 Apr 13
+			3:00	Russia	MSK/MSD	1990
+			3:00	-	MSK	1990 Jul  1 2:00
+			2:00	-	EET	1992
+# From Paul Eggert (2006-03-22):
+# The _Economist_ (1994-05-28, p 45) reports that central Crimea switched
+# from Kiev to Moscow time sometime after the January 1994 elections.
+# Shanks (1999) says ``date of change uncertain'', but implies that it happened
+# sometime between the 1994 DST switches.  Shanks & Pottenger simply say
+# 1994-09-25 03:00, but that can't be right.  For now, guess it
+# changed in May.
+			2:00	E-Eur	EE%sT	1994 May
+# From IATA SSIM (1994/1997), which also says that Kerch is still like Kiev.
+			3:00	E-Eur	MSK/MSD	1996 Mar 31 3:00s
+			3:00	1:00	MSD	1996 Oct 27 3:00s
+# IATA SSIM (1997-09) says Crimea switched to EET/EEST.
+# Assume it happened in March by not changing the clocks.
+			3:00	Russia	MSK/MSD	1997
+			3:00	-	MSK	1997 Mar lastSun 1:00u
+			2:00	EU	EE%sT
+
+###############################################################################
+
+# One source shows that Bulgaria, Cyprus, Finland, and Greece observe DST from
+# the last Sunday in March to the last Sunday in September in 1986.
+# The source shows Romania changing a day later than everybody else.
+#
+# According to Bernard Sieloff's source, Poland is in the MET time zone but
+# uses the WE DST rules.  The Western USSR uses EET+1 and ME DST rules.
+# Bernard Sieloff's source claims Romania switches on the same day, but at
+# 00:00 standard time (i.e., 01:00 DST).  It also claims that Turkey
+# switches on the same day, but switches on at 01:00 standard time
+# and off at 00:00 standard time (i.e., 01:00 DST)
+
+# ...
+# Date: Wed, 28 Jan 87 16:56:27 -0100
+# From: Tom Hofmann
+# ...
+#
+# ...the European time rules are...standardized since 1981, when
+# most European coun[tr]ies started DST.  Before that year, only
+# a few countries (UK, France, Italy) had DST, each according
+# to own national rules.  In 1981, however, DST started on
+# 'Apr firstSun', and not on 'Mar lastSun' as in the following
+# years...
+# But also since 1981 there are some more national exceptions
+# than listed in 'europe': Switzerland, for example, joined DST
+# one year later, Denmark ended DST on 'Oct 1' instead of 'Sep
+# lastSun' in 1981---I don't know how they handle now.
+#
+# Finally, DST ist always from 'Apr 1' to 'Oct 1' in the
+# Soviet Union (as far as I know).
+#
+# Tom Hofmann, Scientific Computer Center, CIBA-GEIGY AG,
+# 4002 Basle, Switzerland
+# ...
+
+# ...
+# Date: Wed, 4 Feb 87 22:35:22 +0100
+# From: Dik T. Winter
+# ...
+#
+# The information from Tom Hofmann is (as far as I know) not entirely correct.
+# After a request from chongo at amdahl I tried to retrieve all information
+# about DST in Europe.  I was able to find all from about 1969.
+#
+# ...standardization on DST in Europe started in about 1977 with switches on
+# first Sunday in April and last Sunday in September...
+# In 1981 UK joined Europe insofar that
+# the starting day for both shifted to last Sunday in March.  And from 1982
+# the whole of Europe used DST, with switch dates April 1 and October 1 in
+# the Sov[i]et Union.  In 1985 the SU reverted to standard Europe[a]n switch
+# dates...
+#
+# It should also be remembered that time-zones are not constants; e.g.
+# Portugal switched in 1976 from MET (or CET) to WET with DST...
+# Note also that though there were rules for switch dates not
+# all countries abided to these dates, and many individual deviations
+# occurred, though not since 1982 I believe.  Another note: it is always
+# assumed that DST is 1 hour ahead of normal time, this need not be the
+# case; at least in the Netherlands there have been times when DST was 2 hours
+# in advance of normal time.
+#
+# ...
+# dik t. winter, cwi, amsterdam, nederland
+# ...
+
+# From Bob Devine (1988-01-28):
+# ...
+# Greece: Last Sunday in April to last Sunday in September (iffy on dates).
+# Since 1978.  Change at midnight.
+# ...
+# Monaco: has same DST as France.
+# ...
diff --git a/tools/zoneinfo/tzdata2009s/factory b/tools/zoneinfo/tzdata2010k/factory
similarity index 100%
rename from tools/zoneinfo/tzdata2009s/factory
rename to tools/zoneinfo/tzdata2010k/factory
diff --git a/tools/zoneinfo/tzdata2009s/iso3166.tab b/tools/zoneinfo/tzdata2010k/iso3166.tab
similarity index 100%
rename from tools/zoneinfo/tzdata2009s/iso3166.tab
rename to tools/zoneinfo/tzdata2010k/iso3166.tab
diff --git a/tools/zoneinfo/tzdata2010k/leapseconds b/tools/zoneinfo/tzdata2010k/leapseconds
new file mode 100644
index 0000000..d70185c
--- /dev/null
+++ b/tools/zoneinfo/tzdata2010k/leapseconds
@@ -0,0 +1,87 @@
+# <pre>
+# @(#)leapseconds	8.10
+# This file is in the public domain, so clarified as of
+# 2009-05-17 by Arthur David Olson.
+
+# Allowance for leapseconds added to each timezone file.
+
+# The International Earth Rotation Service periodically uses leap seconds
+# to keep UTC to within 0.9 s of UT1
+# (which measures the true angular orientation of the earth in space); see
+# Terry J Quinn, The BIPM and the accurate measure of time,
+# Proc IEEE 79, 7 (July 1991), 894-905.
+# There were no leap seconds before 1972, because the official mechanism
+# accounting for the discrepancy between atomic time and the earth's rotation
+# did not exist until the early 1970s.
+
+# The correction (+ or -) is made at the given time, so lines
+# will typically look like:
+#	Leap	YEAR	MON	DAY	23:59:60	+	R/S
+# or
+#	Leap	YEAR	MON	DAY	23:59:59	-	R/S
+
+# If the leapsecond is Rolling (R) the given time is local time
+# If the leapsecond is Stationary (S) the given time is UTC
+
+# Leap	YEAR	MONTH	DAY	HH:MM:SS	CORR	R/S
+Leap	1972	Jun	30	23:59:60	+	S
+Leap	1972	Dec	31	23:59:60	+	S
+Leap	1973	Dec	31	23:59:60	+	S
+Leap	1974	Dec	31	23:59:60	+	S
+Leap	1975	Dec	31	23:59:60	+	S
+Leap	1976	Dec	31	23:59:60	+	S
+Leap	1977	Dec	31	23:59:60	+	S
+Leap	1978	Dec	31	23:59:60	+	S
+Leap	1979	Dec	31	23:59:60	+	S
+Leap	1981	Jun	30	23:59:60	+	S
+Leap	1982	Jun	30	23:59:60	+	S
+Leap	1983	Jun	30	23:59:60	+	S
+Leap	1985	Jun	30	23:59:60	+	S
+Leap	1987	Dec	31	23:59:60	+	S
+Leap	1989	Dec	31	23:59:60	+	S
+Leap	1990	Dec	31	23:59:60	+	S
+Leap	1992	Jun	30	23:59:60	+	S
+Leap	1993	Jun	30	23:59:60	+	S
+Leap	1994	Jun	30	23:59:60	+	S
+Leap	1995	Dec	31	23:59:60	+	S
+Leap	1997	Jun	30	23:59:60	+	S
+Leap	1998	Dec	31	23:59:60	+	S
+Leap	2005	Dec	31	23:59:60	+	S
+Leap	2008	Dec	31	23:59:60	+	S
+
+# INTERNATIONAL EARTH ROTATION AND REFERENCE SYSTEMS SERVICE (IERS)
+#
+# SERVICE INTERNATIONAL DE LA ROTATION TERRESTRE ET DES SYSTEMES DE REFERENCE
+#
+# SERVICE DE LA ROTATION TERRESTRE
+# OBSERVATOIRE DE PARIS
+# 61, Av. de l'Observatoire 75014 PARIS (France)
+# Tel.      : 33 (0) 1 40 51 22 26
+# FAX       : 33 (0) 1 40 51 22 91
+# Internet  : services.iers@obspm.fr
+#
+# Paris, 14 July 2010
+#
+# Bulletin C 40
+#
+# To authorities responsible
+# for the measurement and
+# distribution of time
+#
+# INFORMATION ON UTC - TAI
+#
+# NO positive leap second will be introduced at the end of December 2010.
+# The difference between Coordinated Universal Time UTC and the
+# International Atomic Time TAI is :
+#
+# from 2009 January 1, 0h UTC, until further notice : UTC-TAI = -34 s
+#
+# Leap seconds can be introduced in UTC at the end of the months of December
+# or June,  depending on the evolution of UT1-TAI. Bulletin C is mailed every
+# six months, either to announce a time step in UTC, or to confirm that there
+# will be no time step at the next possible date.
+#
+# Daniel GAMBIS
+# Director
+# Earth Orientation Center of IERS
+# Observatoire de Paris, France
diff --git a/tools/zoneinfo/tzdata2010k/northamerica b/tools/zoneinfo/tzdata2010k/northamerica
new file mode 100644
index 0000000..7dfd064
--- /dev/null
+++ b/tools/zoneinfo/tzdata2010k/northamerica
@@ -0,0 +1,2897 @@
+# <pre>
+# @(#)northamerica	8.34
+# This file is in the public domain, so clarified as of
+# 2009-05-17 by Arthur David Olson.
+
+# also includes Central America and the Caribbean
+
+# This data is by no means authoritative; if you think you know better,
+# go ahead and edit the file (and please send any changes to
+# tz@elsie.nci.nih.gov for general use in the future).
+
+# From Paul Eggert (1999-03-22):
+# A reliable and entertaining source about time zones is
+# Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997).
+
+###############################################################################
+
+# United States
+
+# From Paul Eggert (1999-03-31):
+# Howse writes (pp 121-125) that time zones were invented by
+# Professor Charles Ferdinand Dowd (1825-1904),
+# Principal of Temple Grove Ladies' Seminary (Saratoga Springs, NY).
+# His pamphlet ``A System of National Time for Railroads'' (1870)
+# was the result of his proposals at the Convention of Railroad Trunk Lines
+# in New York City (1869-10).  His 1870 proposal was based on Washington, DC,
+# but in 1872-05 he moved the proposed origin to Greenwich.
+# His proposal was adopted by the railroads on 1883-11-18 at 12:00,
+# and the most of the country soon followed suit.
+
+# From Paul Eggert (2005-04-16):
+# That 1883 transition occurred at 12:00 new time, not at 12:00 old time.
+# See p 46 of David Prerau, Seize the daylight, Thunder's Mouth Press (2005).
+
+# From Paul Eggert (2006-03-22):
+# A good source for time zone historical data in the US is
+# Thomas G. Shanks, The American Atlas (5th edition),
+# San Diego: ACS Publications, Inc. (1991).
+# Make sure you have the errata sheet; the book is somewhat useless without it.
+# It is the source for most of the pre-1991 US entries below.
+
+# From Paul Eggert (2001-03-06):
+# Daylight Saving Time was first suggested as a joke by Benjamin Franklin
+# in his whimsical essay ``An Economical Project for Diminishing the Cost
+# of Light'' published in the Journal de Paris (1784-04-26).
+# Not everyone is happy with the results:
+#
+#	I don't really care how time is reckoned so long as there is some
+#	agreement about it, but I object to being told that I am saving
+#	daylight when my reason tells me that I am doing nothing of the kind.
+#	I even object to the implication that I am wasting something
+#	valuable if I stay in bed after the sun has risen.  As an admirer
+#	of moonlight I resent the bossy insistence of those who want to
+#	reduce my time for enjoying it.  At the back of the Daylight Saving
+#	scheme I detect the bony, blue-fingered hand of Puritanism, eager
+#	to push people into bed earlier, and get them up earlier, to make
+#	them healthy, wealthy and wise in spite of themselves.
+#
+#	-- Robertson Davies, The diary of Samuel Marchbanks,
+#	   Clarke, Irwin (1947), XIX, Sunday
+#
+# For more about the first ten years of DST in the United States, see
+# Robert Garland's <a href="http://www.clpgh.org/exhibit/dst.html">
+# Ten years of daylight saving from the Pittsburgh standpoint
+# (Carnegie Library of Pittsburgh, 1927)</a>.
+#
+# Shanks says that DST was called "War Time" in the US in 1918 and 1919.
+# However, DST was imposed by the Standard Time Act of 1918, which
+# was the first nationwide legal time standard, and apparently
+# time was just called "Standard Time" or "Daylight Saving Time".
+
+# From Arthur David Olson:
+# US Daylight Saving Time ended on the last Sunday of *October* in 1974.
+# See, for example, the front page of the Saturday, 1974-10-26
+# and Sunday, 1974-10-27 editions of the Washington Post.
+
+# From Arthur David Olson:
+# Before the Uniform Time Act of 1966 took effect in 1967, observance of
+# Daylight Saving Time in the US was by local option, except during wartime.
+
+# From Arthur David Olson (2000-09-25):
+# Last night I heard part of a rebroadcast of a 1945 Arch Oboler radio drama.
+# In the introduction, Oboler spoke of "Eastern Peace Time."
+# An AltaVista search turned up
+# <a href="http://rowayton.org/rhs/hstaug45.html">:
+# "When the time is announced over the radio now, it is 'Eastern Peace
+# Time' instead of the old familiar 'Eastern War Time.'  Peace is wonderful."
+# </a> (August 1945) by way of confirmation.
+
+# From Joseph Gallant citing
+# George H. Douglas, _The Early Days of Radio Broadcasting_ (1987):
+# At 7 P.M. (Eastern War Time) [on 1945-08-14], the networks were set
+# to switch to London for Attlee's address, but the American people
+# never got to hear his speech live. According to one press account,
+# CBS' Bob Trout was first to announce the word of Japan's surrender,
+# but a few seconds later, NBC, ABC and Mutual also flashed the word
+# of surrender, all of whom interrupting the bells of Big Ben in
+# London which were to precede Mr. Attlee's speech.
+
+# From Paul Eggert (2003-02-09): It was Robert St John, not Bob Trout.  From
+# Myrna Oliver's obituary of St John on page B16 of today's Los Angeles Times:
+#
+# ... a war-weary U.S. clung to radios, awaiting word of Japan's surrender.
+# Any announcement from Asia would reach St. John's New York newsroom on a
+# wire service teletype machine, which had prescribed signals for major news.
+# Associated Press, for example, would ring five bells before spewing out
+# typed copy of an important story, and 10 bells for news "of transcendental
+# importance."
+#
+# On Aug. 14, stalling while talking steadily into the NBC networks' open
+# microphone, St. John heard five bells and waited only to hear a sixth bell,
+# before announcing confidently: "Ladies and gentlemen, World War II is over.
+# The Japanese have agreed to our surrender terms."
+#
+# He had scored a 20-second scoop on other broadcasters.
+
+# From Arthur David Olson (2005-08-22):
+# Paul has been careful to use the "US" rules only in those locations
+# that are part of the United States; this reflects the real scope of
+# U.S. government action.  So even though the "US" rules have changed
+# in the latest release, other countries won't be affected.
+
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	US	1918	1919	-	Mar	lastSun	2:00	1:00	D
+Rule	US	1918	1919	-	Oct	lastSun	2:00	0	S
+Rule	US	1942	only	-	Feb	9	2:00	1:00	W # War
+Rule	US	1945	only	-	Aug	14	23:00u	1:00	P # Peace
+Rule	US	1945	only	-	Sep	30	2:00	0	S
+Rule	US	1967	2006	-	Oct	lastSun	2:00	0	S
+Rule	US	1967	1973	-	Apr	lastSun	2:00	1:00	D
+Rule	US	1974	only	-	Jan	6	2:00	1:00	D
+Rule	US	1975	only	-	Feb	23	2:00	1:00	D
+Rule	US	1976	1986	-	Apr	lastSun	2:00	1:00	D
+Rule	US	1987	2006	-	Apr	Sun>=1	2:00	1:00	D
+Rule	US	2007	max	-	Mar	Sun>=8	2:00	1:00	D
+Rule	US	2007	max	-	Nov	Sun>=1	2:00	0	S
+
+# From Arthur David Olson, 2005-12-19
+# We generate the files specified below to guard against old files with
+# obsolete information being left in the time zone binary directory.
+# We limit the list to names that have appeared in previous versions of
+# this time zone package.
+# We do these as separate Zones rather than as Links to avoid problems if
+# a particular place changes whether it observes DST.
+# We put these specifications here in the northamerica file both to
+# increase the chances that they'll actually get compiled and to
+# avoid the need to duplicate the US rules in another file.
+
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	EST		 -5:00	-	EST
+Zone	MST		 -7:00	-	MST
+Zone	HST		-10:00	-	HST
+Zone	EST5EDT		 -5:00	US	E%sT
+Zone	CST6CDT		 -6:00	US	C%sT
+Zone	MST7MDT		 -7:00	US	M%sT
+Zone	PST8PDT		 -8:00	US	P%sT
+
+# From Bob Devine (1988-01-28):
+# ...Alaska (and Hawaii) had the timezone names changed in 1967.
+#    old			 new
+#    Pacific Standard Time(PST)  -same-
+#    Yukon Standard Time(YST)    -same-
+#    Central Alaska S.T. (CAT)   Alaska-Hawaii St[an]dard Time (AHST)
+#    Nome Standard Time (NT)     Bering Standard Time (BST)
+#
+# ...Alaska's timezone lines were redrawn in 1983 to give only 2 tz.
+#    The YST zone now covers nearly all of the state, AHST just part
+#    of the Aleutian islands.   No DST.
+
+# From Paul Eggert (1995-12-19):
+# The tables below use `NST', not `NT', for Nome Standard Time.
+# I invented `CAWT' for Central Alaska War Time.
+
+# From U. S. Naval Observatory (1989-01-19):
+# USA  EASTERN       5 H  BEHIND UTC    NEW YORK, WASHINGTON
+# USA  EASTERN       4 H  BEHIND UTC    APR 3 - OCT 30
+# USA  CENTRAL       6 H  BEHIND UTC    CHICAGO, HOUSTON
+# USA  CENTRAL       5 H  BEHIND UTC    APR 3 - OCT 30
+# USA  MOUNTAIN      7 H  BEHIND UTC    DENVER
+# USA  MOUNTAIN      6 H  BEHIND UTC    APR 3 - OCT 30
+# USA  PACIFIC       8 H  BEHIND UTC    L.A., SAN FRANCISCO
+# USA  PACIFIC       7 H  BEHIND UTC    APR 3 - OCT 30
+# USA  ALASKA STD    9 H  BEHIND UTC    MOST OF ALASKA     (AKST)
+# USA  ALASKA STD    8 H  BEHIND UTC    APR 3 - OCT 30 (AKDT)
+# USA  ALEUTIAN     10 H  BEHIND UTC    ISLANDS WEST OF 170W
+# USA  - " -         9 H  BEHIND UTC    APR 3 - OCT 30
+# USA  HAWAII       10 H  BEHIND UTC
+# USA  BERING       11 H  BEHIND UTC    SAMOA, MIDWAY
+
+# From Arthur David Olson (1989-01-21):
+# The above dates are for 1988.
+# Note the "AKST" and "AKDT" abbreviations, the claim that there's
+# no DST in Samoa, and the claim that there is DST in Alaska and the
+# Aleutians.
+
+# From Arthur David Olson (1988-02-13):
+# Legal standard time zone names, from United States Code (1982 Edition and
+# Supplement III), Title 15, Chapter 6, Section 260 and forward.  First, names
+# up to 1967-04-01 (when most provisions of the Uniform Time Act of 1966
+# took effect), as explained in sections 263 and 261:
+#	(none)
+#	United States standard eastern time
+#	United States standard mountain time
+#	United States standard central time
+#	United States standard Pacific time
+#	(none)
+#	United States standard Alaska time
+#	(none)
+# Next, names from 1967-04-01 until 1983-11-30 (the date for
+# public law 98-181):
+#	Atlantic standard time
+#	eastern standard time
+#	central standard time
+#	mountain standard time
+#	Pacific standard time
+#	Yukon standard time
+#	Alaska-Hawaii standard time
+#	Bering standard time
+# And after 1983-11-30:
+#	Atlantic standard time
+#	eastern standard time
+#	central standard time
+#	mountain standard time
+#	Pacific standard time
+#	Alaska standard time
+#	Hawaii-Aleutian standard time
+#	Samoa standard time
+# The law doesn't give abbreviations.
+#
+# From Paul Eggert (2000-01-08), following a heads-up from Rives McDow:
+# Public law 106-564 (2000-12-23) introduced the abbreviation
+# "Chamorro Standard Time" for time in Guam and the Northern Marianas.
+# See the file "australasia".
+
+# From Arthur David Olson, 2005-08-09
+# The following was signed into law on 2005-08-08.
+#
+# H.R. 6, Energy Policy Act of 2005, SEC. 110. DAYLIGHT SAVINGS.
+#   (a) Amendment- Section 3(a) of the Uniform Time Act of 1966 (15
+#   U.S.C. 260a(a)) is amended--
+#     (1) by striking `first Sunday of April' and inserting `second
+#     Sunday of March'; and
+#     (2) by striking `last Sunday of October' and inserting `first
+#     Sunday of November'.
+#   (b) Effective Date- Subsection (a) shall take effect 1 year after the
+#   date of enactment of this Act or March 1, 2007, whichever is later.
+#   (c) Report to Congress- Not later than 9 months after the effective
+#   date stated in subsection (b), the Secretary shall report to Congress
+#   on the impact of this section on energy consumption in the United
+#   States.
+#   (d) Right to Revert- Congress retains the right to revert the
+#   Daylight Saving Time back to the 2005 time schedules once the
+#   Department study is complete.
+
+# US eastern time, represented by New York
+
+# Connecticut, Delaware, District of Columbia, most of Florida,
+# Georgia, southeast Indiana (Dearborn and Ohio counties), eastern Kentucky
+# (except America/Kentucky/Louisville below), Maine, Maryland, Massachusetts,
+# New Hampshire, New Jersey, New York, North Carolina, Ohio,
+# Pennsylvania, Rhode Island, South Carolina, eastern Tennessee,
+# Vermont, Virginia, West Virginia
+
+# From Dave Cantor (2004-11-02):
+# Early this summer I had the occasion to visit the Mount Washington
+# Observatory weather station atop (of course!) Mount Washington [, NH]....
+# One of the staff members said that the station was on Eastern Standard Time
+# and didn't change their clocks for Daylight Saving ... so that their
+# reports will always have times which are 5 hours behind UTC.
+
+# From Paul Eggert (2005-08-26):
+# According to today's Huntsville Times
+# <http://www.al.com/news/huntsvilletimes/index.ssf?/base/news/1125047783228320.xml&coll=1>
+# a few towns on Alabama's "eastern border with Georgia, such as Phenix City
+# in Russell County, Lanett in Chambers County and some towns in Lee County,
+# set their watches and clocks on Eastern time."  It quotes H.H. "Bubba"
+# Roberts, city administrator in Phenix City. as saying "We are in the Central
+# time zone, but we do go by the Eastern time zone because so many people work
+# in Columbus."
+
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER
+Rule	NYC	1920	only	-	Mar	lastSun	2:00	1:00	D
+Rule	NYC	1920	only	-	Oct	lastSun	2:00	0	S
+Rule	NYC	1921	1966	-	Apr	lastSun	2:00	1:00	D
+Rule	NYC	1921	1954	-	Sep	lastSun	2:00	0	S
+Rule	NYC	1955	1966	-	Oct	lastSun	2:00	0	S
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone America/New_York	-4:56:02 -	LMT	1883 Nov 18 12:03:58
+			-5:00	US	E%sT	1920
+			-5:00	NYC	E%sT	1942
+			-5:00	US	E%sT	1946
+			-5:00	NYC	E%sT	1967
+			-5:00	US	E%sT
+
+# US central time, represented by Chicago
+
+# Alabama, Arkansas, Florida panhandle (Bay, Calhoun, Escambia,
+# Gulf, Holmes, Jackson, Okaloosa, Santa Rosa, Walton, and
+# Washington counties), Illinois, western Indiana
+# (Gibson, Jasper, Lake, LaPorte, Newton, Porter, Posey, Spencer,
+# Vanderburgh, and Warrick counties), Iowa, most of Kansas, western
+# Kentucky, Louisiana, Minnesota, Mississippi, Missouri, eastern
+# Nebraska, eastern North Dakota, Oklahoma, eastern South Dakota,
+# western Tennessee, most of Texas, Wisconsin
+
+# From Larry M. Smith (2006-04-26) re Wisconsin:
+# http://www.legis.state.wi.us/statutes/Stat0175.pdf ...
+# is currently enforced at the 01:00 time of change.  Because the local
+# "bar time" in the state corresponds to 02:00, a number of citations
+# are issued for the "sale of class 'B' alcohol after prohibited
+# hours" within the deviated hour of this change every year....
+#
+# From Douglas R. Bomberg (2007-03-12):
+# Wisconsin has enacted (nearly eleventh-hour) legislation to get WI
+# Statue 175 closer in synch with the US Congress' intent....
+# http://www.legis.state.wi.us/2007/data/acts/07Act3.pdf
+
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER
+Rule	Chicago	1920	only	-	Jun	13	2:00	1:00	D
+Rule	Chicago	1920	1921	-	Oct	lastSun	2:00	0	S
+Rule	Chicago	1921	only	-	Mar	lastSun	2:00	1:00	D
+Rule	Chicago	1922	1966	-	Apr	lastSun	2:00	1:00	D
+Rule	Chicago	1922	1954	-	Sep	lastSun	2:00	0	S
+Rule	Chicago	1955	1966	-	Oct	lastSun	2:00	0	S
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone America/Chicago	-5:50:36 -	LMT	1883 Nov 18 12:09:24
+			-6:00	US	C%sT	1920
+			-6:00	Chicago	C%sT	1936 Mar  1 2:00
+			-5:00	-	EST	1936 Nov 15 2:00
+			-6:00	Chicago	C%sT	1942
+			-6:00	US	C%sT	1946
+			-6:00	Chicago	C%sT	1967
+			-6:00	US	C%sT
+# Oliver County, ND switched from mountain to central time on 1992-10-25.
+Zone America/North_Dakota/Center -6:45:12 - LMT	1883 Nov 18 12:14:48
+			-7:00	US	M%sT	1992 Oct 25 02:00
+			-6:00	US	C%sT
+# Morton County, ND, switched from mountain to central time on
+# 2003-10-26, except for the area around Mandan which was already central time.
+# See <http://dmses.dot.gov/docimages/p63/135818.pdf>.
+# Officially this switch also included part of Sioux County, and
+# Jones, Mellette, and Todd Counties in South Dakota;
+# but in practice these other counties were already observing central time.
+# See <http://www.epa.gov/fedrgstr/EPA-IMPACT/2003/October/Day-28/i27056.htm>.
+Zone America/North_Dakota/New_Salem -6:45:39 - LMT 1883 Nov 18 12:14:21
+			-7:00	US	M%sT	2003 Oct 26 02:00
+			-6:00	US	C%sT
+
+# US mountain time, represented by Denver
+#
+# Colorado, far western Kansas, Montana, western
+# Nebraska, Nevada border (Jackpot, Owyhee, and Mountain City),
+# New Mexico, southwestern North Dakota,
+# western South Dakota, far western Texas (El Paso County, Hudspeth County,
+# and Pine Springs and Nickel Creek in Culberson County), Utah, Wyoming
+#
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER
+Rule	Denver	1920	1921	-	Mar	lastSun	2:00	1:00	D
+Rule	Denver	1920	only	-	Oct	lastSun	2:00	0	S
+Rule	Denver	1921	only	-	May	22	2:00	0	S
+Rule	Denver	1965	1966	-	Apr	lastSun	2:00	1:00	D
+Rule	Denver	1965	1966	-	Oct	lastSun	2:00	0	S
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone America/Denver	-6:59:56 -	LMT	1883 Nov 18 12:00:04
+			-7:00	US	M%sT	1920
+			-7:00	Denver	M%sT	1942
+			-7:00	US	M%sT	1946
+			-7:00	Denver	M%sT	1967
+			-7:00	US	M%sT
+
+# US Pacific time, represented by Los Angeles
+#
+# California, northern Idaho (Benewah, Bonner, Boundary, Clearwater,
+# Idaho, Kootenai, Latah, Lewis, Nez Perce, and Shoshone counties,
+# and the northern three-quarters of Idaho county),
+# most of Nevada, most of Oregon, and Washington
+#
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER
+Rule	CA	1948	only	-	Mar	14	2:00	1:00	D
+Rule	CA	1949	only	-	Jan	 1	2:00	0	S
+Rule	CA	1950	1966	-	Apr	lastSun	2:00	1:00	D
+Rule	CA	1950	1961	-	Sep	lastSun	2:00	0	S
+Rule	CA	1962	1966	-	Oct	lastSun	2:00	0	S
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone America/Los_Angeles -7:52:58 -	LMT	1883 Nov 18 12:07:02
+			-8:00	US	P%sT	1946
+			-8:00	CA	P%sT	1967
+			-8:00	US	P%sT
+
+# Alaska
+# AK%sT is the modern abbreviation for -9:00 per USNO.
+#
+# From Paul Eggert (2001-05-30):
+# Howse writes that Alaska switched from the Julian to the Gregorian calendar,
+# and from east-of-GMT to west-of-GMT days, when the US bought it from Russia.
+# This was on 1867-10-18, a Friday; the previous day was 1867-10-06 Julian,
+# also a Friday.  Include only the time zone part of this transition,
+# ignoring the switch from Julian to Gregorian, since we can't represent
+# the Julian calendar.
+#
+# As far as we know, none of the exact locations mentioned below were
+# permanently inhabited in 1867 by anyone using either calendar.
+# (Yakutat was colonized by the Russians in 1799, but the settlement
+# was destroyed in 1805 by a Yakutat-kon war party.)  However, there
+# were nearby inhabitants in some cases and for our purposes perhaps
+# it's best to simply use the official transition.
+#
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone America/Juneau	 15:02:19 -	LMT	1867 Oct 18
+			 -8:57:41 -	LMT	1900 Aug 20 12:00
+			 -8:00	-	PST	1942
+			 -8:00	US	P%sT	1946
+			 -8:00	-	PST	1969
+			 -8:00	US	P%sT	1983 Oct 30 2:00
+			 -9:00	US	Y%sT	1983 Nov 30
+			 -9:00	US	AK%sT
+Zone America/Yakutat	 14:41:05 -	LMT	1867 Oct 18
+			 -9:18:55 -	LMT	1900 Aug 20 12:00
+			 -9:00	-	YST	1942
+			 -9:00	US	Y%sT	1946
+			 -9:00	-	YST	1969
+			 -9:00	US	Y%sT	1983 Nov 30
+			 -9:00	US	AK%sT
+Zone America/Anchorage	 14:00:24 -	LMT	1867 Oct 18
+			 -9:59:36 -	LMT	1900 Aug 20 12:00
+			-10:00	-	CAT	1942
+			-10:00	US	CAT/CAWT 1945 Aug 14 23:00u
+			-10:00	US	CAT/CAPT 1946 # Peace
+			-10:00	-	CAT	1967 Apr
+			-10:00	-	AHST	1969
+			-10:00	US	AH%sT	1983 Oct 30 2:00
+			 -9:00	US	Y%sT	1983 Nov 30
+			 -9:00	US	AK%sT
+Zone America/Nome	 12:58:21 -	LMT	1867 Oct 18
+			-11:01:38 -	LMT	1900 Aug 20 12:00
+			-11:00	-	NST	1942
+			-11:00	US	N%sT	1946
+			-11:00	-	NST	1967 Apr
+			-11:00	-	BST	1969
+			-11:00	US	B%sT	1983 Oct 30 2:00
+			 -9:00	US	Y%sT	1983 Nov 30
+			 -9:00	US	AK%sT
+Zone America/Adak	 12:13:21 -	LMT	1867 Oct 18
+			-11:46:38 -	LMT	1900 Aug 20 12:00
+			-11:00	-	NST	1942
+			-11:00	US	N%sT	1946
+			-11:00	-	NST	1967 Apr
+			-11:00	-	BST	1969
+			-11:00	US	B%sT	1983 Oct 30 2:00
+			-10:00	US	AH%sT	1983 Nov 30
+			-10:00	US	HA%sT
+# The following switches don't quite make our 1970 cutoff.
+#
+# Shanks writes that part of southwest Alaska (e.g. Aniak)
+# switched from -11:00 to -10:00 on 1968-09-22 at 02:00,
+# and another part (e.g. Akiak) made the same switch five weeks later.
+#
+# From David Flater (2004-11-09):
+# In e-mail, 2004-11-02, Ray Hudson, historian/liaison to the Unalaska
+# Historic Preservation Commission, provided this information, which
+# suggests that Unalaska deviated from statutory time from early 1967
+# possibly until 1983:
+#
+#  Minutes of the Unalaska City Council Meeting, January 10, 1967:
+#  "Except for St. Paul and Akutan, Unalaska is the only important
+#  location not on Alaska Standard Time.  The following resolution was
+#  made by William Robinson and seconded by Henry Swanson:  Be it
+#  resolved that the City of Unalaska hereby goes to Alaska Standard
+#  Time as of midnight Friday, January 13, 1967 (1 A.M. Saturday,
+#  January 14, Alaska Standard Time.)  This resolution was passed with
+#  three votes for and one against."
+
+# Hawaii
+#
+# From Arthur David Olson:
+# And then there's Hawaii.
+# DST was observed for one day in 1933;
+# standard time was changed by half an hour in 1947;
+# it's always standard as of 1986.
+#
+# From Paul Eggert:
+# Shanks says the 1933 experiment lasted for three weeks.  Go with Shanks.
+#
+Zone Pacific/Honolulu	-10:31:26 -	LMT	1900 Jan  1 12:00
+			-10:30	-	HST	1933 Apr 30 2:00
+			-10:30	1:00	HDT	1933 May 21 2:00
+			-10:30	US	H%sT	1947 Jun  8 2:00
+			-10:00	-	HST
+
+# Now we turn to US areas that have diverged from the consensus since 1970.
+
+# Arizona mostly uses MST.
+
+# From Paul Eggert (2002-10-20):
+#
+# The information in the rest of this paragraph is derived from the
+# <a href="http://www.dlapr.lib.az.us/links/daylight.htm">
+# Daylight Saving Time web page (2002-01-23)</a> maintained by the
+# Arizona State Library, Archives and Public Records.
+# Between 1944-01-01 and 1944-04-01 the State of Arizona used standard
+# time, but by federal law railroads, airlines, bus lines, military
+# personnel, and some engaged in interstate commerce continued to
+# observe war (i.e., daylight saving) time.  The 1944-03-17 Phoenix
+# Gazette says that was the date the law changed, and that 04-01 was
+# the date the state's clocks would change.  In 1945 the State of
+# Arizona used standard time all year, again with exceptions only as
+# mandated by federal law.  Arizona observed DST in 1967, but Arizona
+# Laws 1968, ch. 183 (effective 1968-03-21) repealed DST.
+#
+# Shanks says the 1944 experiment came to an end on 1944-03-17.
+# Go with the Arizona State Library instead.
+
+Zone America/Phoenix	-7:28:18 -	LMT	1883 Nov 18 11:31:42
+			-7:00	US	M%sT	1944 Jan  1 00:01
+			-7:00	-	MST	1944 Apr  1 00:01
+			-7:00	US	M%sT	1944 Oct  1 00:01
+			-7:00	-	MST	1967
+			-7:00	US	M%sT	1968 Mar 21
+			-7:00	-	MST
+# From Arthur David Olson (1988-02-13):
+# A writer from the Inter Tribal Council of Arizona, Inc.,
+# notes in private correspondence dated 1987-12-28 that "Presently, only the
+# Navajo Nation participates in the Daylight Saving Time policy, due to its
+# large size and location in three states."  (The "only" means that other
+# tribal nations don't use DST.)
+
+Link America/Denver America/Shiprock
+
+# Southern Idaho (Ada, Adams, Bannock, Bear Lake, Bingham, Blaine,
+# Boise, Bonneville, Butte, Camas, Canyon, Caribou, Cassia, Clark,
+# Custer, Elmore, Franklin, Fremont, Gem, Gooding, Jefferson, Jerome,
+# Lemhi, Lincoln, Madison, Minidoka, Oneida, Owyhee, Payette, Power,
+# Teton, Twin Falls, Valley, Washington counties, and the southern
+# quarter of Idaho county) and eastern Oregon (most of Malheur County)
+# switched four weeks late in 1974.
+#
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone America/Boise	-7:44:49 -	LMT	1883 Nov 18 12:15:11
+			-8:00	US	P%sT	1923 May 13 2:00
+			-7:00	US	M%sT	1974
+			-7:00	-	MST	1974 Feb  3 2:00
+			-7:00	US	M%sT
+
+# Indiana
+#
+# For a map of Indiana's time zone regions, see:
+# <a href="http://www.mccsc.edu/time.html">
+# What time is it in Indiana?
+# </a> (2006-03-01)
+#
+# From Paul Eggert (2007-08-17):
+# Since 1970, most of Indiana has been like America/Indiana/Indianapolis,
+# with the following exceptions:
+#
+# - Gibson, Jasper, Lake, LaPorte, Newton, Porter, Posey, Spencer,
+#   Vandenburgh, and Warrick counties have been like America/Chicago.
+#
+# - Dearborn and Ohio counties have been like America/New_York.
+#
+# - Clark, Floyd, and Harrison counties have been like
+#   America/Kentucky/Louisville.
+#
+# - Crawford, Daviess, Dubois, Knox, Martin, Perry, Pike, Pulaski, Starke,
+#   and Switzerland counties have their own time zone histories as noted below.
+#
+# Shanks partitioned Indiana into 345 regions, each with its own time history,
+# and wrote ``Even newspaper reports present contradictory information.''
+# Those Hoosiers!  Such a flighty and changeable people!
+# Fortunately, most of the complexity occurred before our cutoff date of 1970.
+#
+# Other than Indianapolis, the Indiana place names are so nondescript
+# that they would be ambiguous if we left them at the `America' level.
+# So we reluctantly put them all in a subdirectory `America/Indiana'.
+
+# From Paul Eggert (2005-08-16):
+# http://www.mccsc.edu/time.html says that Indiana will use DST starting 2006.
+
+# From Nathan Stratton Treadway (2006-03-30):
+# http://www.dot.gov/affairs/dot0406.htm [3705 B]
+# From Deborah Goldsmith (2006-01-18):
+# http://dmses.dot.gov/docimages/pdf95/382329_web.pdf [2.9 MB]
+# From Paul Eggert (2006-01-20):
+# It says "DOT is relocating the time zone boundary in Indiana to move Starke,
+# Pulaski, Knox, Daviess, Martin, Pike, Dubois, and Perry Counties from the
+# Eastern Time Zone to the Central Time Zone.... The effective date of
+# this rule is 2:OO a.m. EST Sunday, April 2, 2006, which is the
+# changeover date from standard time to Daylight Saving Time."
+# Strictly speaking, this means the affected counties will change their
+# clocks twice that night, but this obviously is in error.  The intent
+# is that 01:59:59 EST be followed by 02:00:00 CDT.
+
+# From Gwillim Law (2007-02-10):
+# The Associated Press has been reporting that Pulaski County, Indiana is
+# going to switch from Central to Eastern Time on March 11, 2007....
+# http://www.indystar.com/apps/pbcs.dll/article?AID=/20070207/LOCAL190108/702070524/0/LOCAL
+
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER
+Rule Indianapolis 1941	only	-	Jun	22	2:00	1:00	D
+Rule Indianapolis 1941	1954	-	Sep	lastSun	2:00	0	S
+Rule Indianapolis 1946	1954	-	Apr	lastSun	2:00	1:00	D
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone America/Indiana/Indianapolis -5:44:38 - LMT 1883 Nov 18 12:15:22
+			-6:00	US	C%sT	1920
+			-6:00 Indianapolis C%sT	1942
+			-6:00	US	C%sT	1946
+			-6:00 Indianapolis C%sT	1955 Apr 24 2:00
+			-5:00	-	EST	1957 Sep 29 2:00
+			-6:00	-	CST	1958 Apr 27 2:00
+			-5:00	-	EST	1969
+			-5:00	US	E%sT	1971
+			-5:00	-	EST	2006
+			-5:00	US	E%sT
+#
+# Eastern Crawford County, Indiana, left its clocks alone in 1974,
+# as well as from 1976 through 2005.
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER
+Rule	Marengo	1951	only	-	Apr	lastSun	2:00	1:00	D
+Rule	Marengo	1951	only	-	Sep	lastSun	2:00	0	S
+Rule	Marengo	1954	1960	-	Apr	lastSun	2:00	1:00	D
+Rule	Marengo	1954	1960	-	Sep	lastSun	2:00	0	S
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone America/Indiana/Marengo -5:45:23 -	LMT	1883 Nov 18 12:14:37
+			-6:00	US	C%sT	1951
+			-6:00	Marengo	C%sT	1961 Apr 30 2:00
+			-5:00	-	EST	1969
+			-5:00	US	E%sT	1974 Jan  6 2:00
+			-6:00	1:00	CDT	1974 Oct 27 2:00
+			-5:00	US	E%sT	1976
+			-5:00	-	EST	2006
+			-5:00	US	E%sT
+#
+# Daviess, Dubois, Knox, and Martin Counties, Indiana,
+# switched from eastern to central time in April 2006, then switched back
+# in November 2007.
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER
+Rule Vincennes	1946	only	-	Apr	lastSun	2:00	1:00	D
+Rule Vincennes	1946	only	-	Sep	lastSun	2:00	0	S
+Rule Vincennes	1953	1954	-	Apr	lastSun	2:00	1:00	D
+Rule Vincennes	1953	1959	-	Sep	lastSun	2:00	0	S
+Rule Vincennes	1955	only	-	May	 1	0:00	1:00	D
+Rule Vincennes	1956	1963	-	Apr	lastSun	2:00	1:00	D
+Rule Vincennes	1960	only	-	Oct	lastSun	2:00	0	S
+Rule Vincennes	1961	only	-	Sep	lastSun	2:00	0	S
+Rule Vincennes	1962	1963	-	Oct	lastSun	2:00	0	S
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone America/Indiana/Vincennes -5:50:07 - LMT	1883 Nov 18 12:09:53
+			-6:00	US	C%sT	1946
+			-6:00 Vincennes	C%sT	1964 Apr 26 2:00
+			-5:00	-	EST	1969
+			-5:00	US	E%sT	1971
+			-5:00	-	EST	2006 Apr  2 2:00
+			-6:00	US	C%sT	2007 Nov  4 2:00
+			-5:00	US	E%sT
+#
+# Perry County, Indiana, switched from eastern to central time in April 2006.
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER
+Rule Perry	1946	only	-	Apr	lastSun	2:00	1:00	D
+Rule Perry	1946	only	-	Sep	lastSun	2:00	0	S
+Rule Perry	1953	1954	-	Apr	lastSun	2:00	1:00	D
+Rule Perry	1953	1959	-	Sep	lastSun	2:00	0	S
+Rule Perry	1955	only	-	May	 1	0:00	1:00	D
+Rule Perry	1956	1963	-	Apr	lastSun	2:00	1:00	D
+Rule Perry	1960	only	-	Oct	lastSun	2:00	0	S
+Rule Perry	1961	only	-	Sep	lastSun	2:00	0	S
+Rule Perry	1962	1963	-	Oct	lastSun	2:00	0	S
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone America/Indiana/Tell_City -5:47:03 - LMT	1883 Nov 18 12:12:57
+			-6:00	US	C%sT	1946
+			-6:00 Perry	C%sT	1964 Apr 26 2:00
+			-5:00	-	EST	1969
+			-5:00	US	E%sT	1971
+			-5:00	-	EST	2006 Apr  2 2:00
+			-6:00	US	C%sT
+#
+# Pike County, Indiana moved from central to eastern time in 1977,
+# then switched back in 2006, then switched back again in 2007.
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER
+Rule	Pike	1955	only	-	May	 1	0:00	1:00	D
+Rule	Pike	1955	1960	-	Sep	lastSun	2:00	0	S
+Rule	Pike	1956	1964	-	Apr	lastSun	2:00	1:00	D
+Rule	Pike	1961	1964	-	Oct	lastSun	2:00	0	S
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone America/Indiana/Petersburg -5:49:07 - LMT	1883 Nov 18 12:10:53
+			-6:00	US	C%sT	1955
+			-6:00	Pike	C%sT	1965 Apr 25 2:00
+			-5:00	-	EST	1966 Oct 30 2:00
+			-6:00	US	C%sT	1977 Oct 30 2:00
+			-5:00	-	EST	2006 Apr  2 2:00
+			-6:00	US	C%sT	2007 Nov  4 2:00
+			-5:00	US	E%sT
+#
+# Starke County, Indiana moved from central to eastern time in 1991,
+# then switched back in 2006.
+# From Arthur David Olson (1991-10-28):
+# An article on page A3 of the Sunday, 1991-10-27 Washington Post
+# notes that Starke County switched from Central time to Eastern time as of
+# 1991-10-27.
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER
+Rule	Starke	1947	1961	-	Apr	lastSun	2:00	1:00	D
+Rule	Starke	1947	1954	-	Sep	lastSun	2:00	0	S
+Rule	Starke	1955	1956	-	Oct	lastSun	2:00	0	S
+Rule	Starke	1957	1958	-	Sep	lastSun	2:00	0	S
+Rule	Starke	1959	1961	-	Oct	lastSun	2:00	0	S
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone America/Indiana/Knox -5:46:30 -	LMT	1883 Nov 18 12:13:30
+			-6:00	US	C%sT	1947
+			-6:00	Starke	C%sT	1962 Apr 29 2:00
+			-5:00	-	EST	1963 Oct 27 2:00
+			-6:00	US	C%sT	1991 Oct 27 2:00
+			-5:00	-	EST	2006 Apr  2 2:00
+			-6:00	US	C%sT
+#
+# Pulaski County, Indiana, switched from eastern to central time in
+# April 2006 and then switched back in March 2007.
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER
+Rule	Pulaski	1946	1960	-	Apr	lastSun	2:00	1:00	D
+Rule	Pulaski	1946	1954	-	Sep	lastSun	2:00	0	S
+Rule	Pulaski	1955	1956	-	Oct	lastSun	2:00	0	S
+Rule	Pulaski	1957	1960	-	Sep	lastSun	2:00	0	S
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone America/Indiana/Winamac -5:46:25 - LMT	1883 Nov 18 12:13:35
+			-6:00	US	C%sT	1946
+			-6:00	Pulaski	C%sT	1961 Apr 30 2:00
+			-5:00	-	EST	1969
+			-5:00	US	E%sT	1971
+			-5:00	-	EST	2006 Apr  2 2:00
+			-6:00	US	C%sT	2007 Mar 11 2:00
+			-5:00	US	E%sT
+#
+# Switzerland County, Indiana, did not observe DST from 1973 through 2005.
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone America/Indiana/Vevay -5:40:16 -	LMT	1883 Nov 18 12:19:44
+			-6:00	US	C%sT	1954 Apr 25 2:00
+			-5:00	-	EST	1969
+			-5:00	US	E%sT	1973
+			-5:00	-	EST	2006
+			-5:00	US	E%sT
+
+# Part of Kentucky left its clocks alone in 1974.
+# This also includes Clark, Floyd, and Harrison counties in Indiana.
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER
+Rule Louisville	1921	only	-	May	1	2:00	1:00	D
+Rule Louisville	1921	only	-	Sep	1	2:00	0	S
+Rule Louisville	1941	1961	-	Apr	lastSun	2:00	1:00	D
+Rule Louisville	1941	only	-	Sep	lastSun	2:00	0	S
+Rule Louisville	1946	only	-	Jun	2	2:00	0	S
+Rule Louisville	1950	1955	-	Sep	lastSun	2:00	0	S
+Rule Louisville	1956	1960	-	Oct	lastSun	2:00	0	S
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone America/Kentucky/Louisville -5:43:02 -	LMT	1883 Nov 18 12:16:58
+			-6:00	US	C%sT	1921
+			-6:00 Louisville C%sT	1942
+			-6:00	US	C%sT	1946
+			-6:00 Louisville C%sT	1961 Jul 23 2:00
+			-5:00	-	EST	1968
+			-5:00	US	E%sT	1974 Jan  6 2:00
+			-6:00	1:00	CDT	1974 Oct 27 2:00
+			-5:00	US	E%sT
+#
+# Wayne County, Kentucky
+#
+# From
+# <a href="http://www.lake-cumberland.com/life/archive/news990129time.shtml">
+# Lake Cumberland LIFE
+# </a> (1999-01-29) via WKYM-101.7:
+# Clinton County has joined Wayne County in asking the DoT to change from
+# the Central to the Eastern time zone....  The Wayne County government made
+# the same request in December.  And while Russell County officials have not
+# taken action, the majority of respondents to a poll conducted there in
+# August indicated they would like to change to "fast time" also.
+# The three Lake Cumberland counties are the farthest east of any U.S.
+# location in the Central time zone.
+#
+# From Rich Wales (2000-08-29):
+# After prolonged debate, and despite continuing deep differences of opinion,
+# Wayne County (central Kentucky) is switching from Central (-0600) to Eastern
+# (-0500) time.  They won't "fall back" this year.  See Sara Shipley,
+# The difference an hour makes, Nando Times (2000-08-29 15:33 -0400).
+#
+# From Paul Eggert (2001-07-16):
+# The final rule was published in the
+# <a href="http://frwebgate.access.gpo.gov/cgi-bin/getdoc.cgi?dbname=2000_register&docid=fr17au00-22">
+# Federal Register 65, 160 (2000-08-17), page 50154-50158.
+# </a>
+#
+Zone America/Kentucky/Monticello -5:39:24 - LMT	1883 Nov 18 12:20:36
+			-6:00	US	C%sT	1946
+			-6:00	-	CST	1968
+			-6:00	US	C%sT	2000 Oct 29  2:00
+			-5:00	US	E%sT
+
+
+# From Rives McDow (2000-08-30):
+# Here ... are all the changes in the US since 1985.
+# Kearny County, KS (put all of county on central;
+#	previously split between MST and CST) ... 1990-10
+# Starke County, IN (from CST to EST) ... 1991-10
+# Oliver County, ND (from MST to CST) ... 1992-10
+# West Wendover, NV (from PST TO MST) ... 1999-10
+# Wayne County, KY (from CST to EST) ... 2000-10
+#
+# From Paul Eggert (2001-07-17):
+# We don't know where the line used to be within Kearny County, KS,
+# so omit that change for now.
+# See America/Indiana/Knox for the Starke County, IN change.
+# See America/North_Dakota/Center for the Oliver County, ND change.
+# West Wendover, NV officially switched from Pacific to mountain time on
+# 1999-10-31.  See the
+# <a href="http://frwebgate.access.gpo.gov/cgi-bin/getdoc.cgi?dbname=1999_register&docid=fr21oc99-15">
+# Federal Register 64, 203 (1999-10-21), page 56705-56707.
+# </a>
+# However, the Federal Register says that West Wendover already operated
+# on mountain time, and the rule merely made this official;
+# hence a separate tz entry is not needed.
+
+# Michigan
+#
+# From Bob Devine (1988-01-28):
+# Michigan didn't observe DST from 1968 to 1973.
+#
+# From Paul Eggert (1999-03-31):
+# Shanks writes that Michigan started using standard time on 1885-09-18,
+# but Howse writes (pp 124-125, referring to Popular Astronomy, 1901-01)
+# that Detroit kept
+#
+#	local time until 1900 when the City Council decreed that clocks should
+#	be put back twenty-eight minutes to Central Standard Time.  Half the
+#	city obeyed, half refused.  After considerable debate, the decision
+#	was rescinded and the city reverted to Sun time.  A derisive offer to
+#	erect a sundial in front of the city hall was referred to the
+#	Committee on Sewers.  Then, in 1905, Central time was adopted
+#	by city vote.
+#
+# This story is too entertaining to be false, so go with Howse over Shanks.
+#
+# From Paul Eggert (2001-03-06):
+# Garland (1927) writes ``Cleveland and Detroit advanced their clocks
+# one hour in 1914.''  This change is not in Shanks.  We have no more
+# info, so omit this for now.
+#
+# Most of Michigan observed DST from 1973 on, but was a bit late in 1975.
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER
+Rule	Detroit	1948	only	-	Apr	lastSun	2:00	1:00	D
+Rule	Detroit	1948	only	-	Sep	lastSun	2:00	0	S
+Rule	Detroit	1967	only	-	Jun	14	2:00	1:00	D
+Rule	Detroit	1967	only	-	Oct	lastSun	2:00	0	S
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone America/Detroit	-5:32:11 -	LMT	1905
+			-6:00	-	CST	1915 May 15 2:00
+			-5:00	-	EST	1942
+			-5:00	US	E%sT	1946
+			-5:00	Detroit	E%sT	1973
+			-5:00	US	E%sT	1975
+			-5:00	-	EST	1975 Apr 27 2:00
+			-5:00	US	E%sT
+#
+# Dickinson, Gogebic, Iron, and Menominee Counties, Michigan,
+# switched from EST to CST/CDT in 1973.
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER
+Rule Menominee	1946	only	-	Apr	lastSun	2:00	1:00	D
+Rule Menominee	1946	only	-	Sep	lastSun	2:00	0	S
+Rule Menominee	1966	only	-	Apr	lastSun	2:00	1:00	D
+Rule Menominee	1966	only	-	Oct	lastSun	2:00	0	S
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone America/Menominee	-5:50:27 -	LMT	1885 Sep 18 12:00
+			-6:00	US	C%sT	1946
+			-6:00 Menominee	C%sT	1969 Apr 27 2:00
+			-5:00	-	EST	1973 Apr 29 2:00
+			-6:00	US	C%sT
+
+# Navassa
+# administered by the US Fish and Wildlife Service
+# claimed by US under the provisions of the 1856 Guano Islands Act
+# also claimed by Haiti
+# occupied 1857/1900 by the Navassa Phosphate Co
+# US lighthouse 1917/1996-09
+# currently uninhabited
+# see Mark Fineman, ``An Isle Rich in Guano and Discord'',
+# _Los Angeles Times_ (1998-11-10), A1, A10; it cites
+# Jimmy Skaggs, _The Great Guano Rush_ (1994).
+
+################################################################################
+
+
+# From Paul Eggert (2006-03-22):
+# A good source for time zone historical data outside the U.S. is
+# Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
+# San Diego: ACS Publications, Inc. (2003).
+#
+# Gwillim Law writes that a good source
+# for recent time zone data is the International Air Transport
+# Association's Standard Schedules Information Manual (IATA SSIM),
+# published semiannually.  Law sent in several helpful summaries
+# of the IATA's data after 1990.
+#
+# Except where otherwise noted, Shanks & Pottenger is the source for
+# entries through 1990, and IATA SSIM is the source for entries afterwards.
+#
+# Other sources occasionally used include:
+#
+#	Edward W. Whitman, World Time Differences,
+#	Whitman Publishing Co, 2 Niagara Av, Ealing, London (undated),
+#	which I found in the UCLA library.
+#
+#	<a href="http://www.pettswoodvillage.co.uk/Daylight_Savings_William_Willett.pdf">
+#	William Willett, The Waste of Daylight, 19th edition
+#	</a> (1914-03)
+#
+# See the `europe' file for Greenland.
+
+# Canada
+
+# From Alain LaBont<e'> (1994-11-14):
+# I post here the time zone abbreviations standardized in Canada
+# for both English and French in the CAN/CSA-Z234.4-89 standard....
+#
+#	UTC	Standard time	Daylight savings time
+#	offset	French	English	French	English
+#	-2:30	-	-	HAT	NDT
+#	-3	-	-	HAA	ADT
+#	-3:30	HNT	NST	-	-
+#	-4	HNA	AST	HAE	EDT
+#	-5	HNE	EST	HAC	CDT
+#	-6	HNC	CST	HAR	MDT
+#	-7	HNR	MST	HAP	PDT
+#	-8	HNP	PST	HAY	YDT
+#	-9	HNY	YST	-	-
+#
+#	HN: Heure Normale	ST: Standard Time
+#	HA: Heure Avanc<e'>e	DT: Daylight saving Time
+#
+#	A: de l'Atlantique	Atlantic
+#	C: du Centre		Central
+#	E: de l'Est		Eastern
+#	M:			Mountain
+#	N:			Newfoundland
+#	P: du Pacifique		Pacific
+#	R: des Rocheuses
+#	T: de Terre-Neuve
+#	Y: du Yukon		Yukon
+#
+# From Paul Eggert (1994-11-22):
+# Alas, this sort of thing must be handled by localization software.
+
+# Unless otherwise specified, the data for Canada are all from Shanks
+# & Pottenger.
+
+# From Chris Walton (2006-04-01, 2006-04-25, 2006-06-26, 2007-01-31,
+# 2007-03-01):
+# The British Columbia government announced yesterday that it will
+# adjust daylight savings next year to align with changes in the
+# U.S. and the rest of Canada....
+# http://www2.news.gov.bc.ca/news_releases_2005-2009/2006AG0014-000330.htm
+# ...
+# Nova Scotia
+# Daylight saving time will be extended by four weeks starting in 2007....
+# http://www.gov.ns.ca/just/regulations/rg2/2006/ma1206.pdf
+#
+# [For New Brunswick] the new legislation dictates that the time change is to
+# be done at 02:00 instead of 00:01.
+# http://www.gnb.ca/0062/acts/BBA-2006/Chap-19.pdf
+# ...
+# Manitoba has traditionally changed the clock every fall at 03:00.
+# As of 2006, the transition is to take place one hour earlier at 02:00.
+# http://web2.gov.mb.ca/laws/statutes/ccsm/o030e.php
+# ...
+# [Alberta, Ontario, Quebec] will follow US rules.
+# http://www.qp.gov.ab.ca/documents/spring/CH03_06.CFM
+# http://www.e-laws.gov.on.ca/DBLaws/Source/Regs/English/2006/R06111_e.htm
+# http://www2.publicationsduquebec.gouv.qc.ca/dynamicSearch/telecharge.php?type=5&file=2006C39A.PDF
+# ...
+# P.E.I. will follow US rules....
+# http://www.assembly.pe.ca/bills/pdf_chapter/62/3/chapter-41.pdf
+# ...
+# Province of Newfoundland and Labrador....
+# http://www.hoa.gov.nl.ca/hoa/bills/Bill0634.htm
+# ...
+# Yukon
+# http://www.gov.yk.ca/legislation/regs/oic2006_127.pdf
+# ...
+# N.W.T. will follow US rules.  Whoever maintains the government web site
+# does not seem to believe in bookmarks.  To see the news release, click the
+# following link and search for "Daylight Savings Time Change".  Press the
+# "Daylight Savings Time Change" link; it will fire off a popup using
+# JavaScript.
+# http://www.exec.gov.nt.ca/currentnews/currentPR.asp?mode=archive
+# ...
+# Nunavut
+# An amendment to the Interpretation Act was registered on February 19/2007....
+# http://action.attavik.ca/home/justice-gn/attach/2007/gaz02part2.pdf
+
+# From Paul Eggert (2006-04-25):
+# H. David Matthews and Mary Vincent's map
+# <a href="http://www.canadiangeographic.ca/Magazine/SO98/geomap.asp">
+# "It's about TIME", _Canadian Geographic_ (September-October 1998)
+# </a> contains detailed boundaries for regions observing nonstandard
+# time and daylight saving time arrangements in Canada circa 1998.
+#
+# INMS, the Institute for National Measurement Standards in Ottawa, has <a
+# href="http://inms-ienm.nrc-cnrc.gc.ca/en/time_services/daylight_saving_e.php">
+# information about standard and daylight saving time zones in Canada.
+# </a> (updated periodically).
+# Its unofficial information is often taken from Matthews and Vincent.
+
+# From Paul Eggert (2006-06-27):
+# For now, assume all of DST-observing Canada will fall into line with the
+# new US DST rules,
+
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Canada	1918	only	-	Apr	14	2:00	1:00	D
+Rule	Canada	1918	only	-	Oct	31	2:00	0	S
+Rule	Canada	1942	only	-	Feb	 9	2:00	1:00	W # War
+Rule	Canada	1945	only	-	Aug	14	23:00u	1:00	P # Peace
+Rule	Canada	1945	only	-	Sep	30	2:00	0	S
+Rule	Canada	1974	1986	-	Apr	lastSun	2:00	1:00	D
+Rule	Canada	1974	2006	-	Oct	lastSun	2:00	0	S
+Rule	Canada	1987	2006	-	Apr	Sun>=1	2:00	1:00	D
+Rule	Canada	2007	max	-	Mar	Sun>=8	2:00	1:00	D
+Rule	Canada	2007	max	-	Nov	Sun>=1	2:00	0	S
+
+
+# Newfoundland and Labrador
+
+# From Paul Eggert (2000-10-02):
+# Matthews and Vincent (1998) write that Labrador should use NST/NDT,
+# but the only part of Labrador that follows the rules is the
+# southeast corner, including Port Hope Simpson and Mary's Harbour,
+# but excluding, say, Black Tickle.
+
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	StJohns	1917	only	-	Apr	 8	2:00	1:00	D
+Rule	StJohns	1917	only	-	Sep	17	2:00	0	S
+# Whitman gives 1919 Apr 5 and 1920 Apr 5; go with Shanks & Pottenger.
+Rule	StJohns	1919	only	-	May	 5	23:00	1:00	D
+Rule	StJohns	1919	only	-	Aug	12	23:00	0	S
+# For 1931-1935 Whitman gives Apr same date; go with Shanks & Pottenger.
+Rule	StJohns	1920	1935	-	May	Sun>=1	23:00	1:00	D
+Rule	StJohns	1920	1935	-	Oct	lastSun	23:00	0	S
+# For 1936-1941 Whitman gives May Sun>=8 and Oct Sun>=1; go with Shanks &
+# Pottenger.
+Rule	StJohns	1936	1941	-	May	Mon>=9	0:00	1:00	D
+Rule	StJohns	1936	1941	-	Oct	Mon>=2	0:00	0	S
+# Whitman gives the following transitions:
+# 1942 03-01/12-31, 1943 05-30/09-05, 1944 07-10/09-02, 1945 01-01/10-07
+# but go with Shanks & Pottenger and assume they used Canadian rules.
+# For 1946-9 Whitman gives May 5,4,9,1 - Oct 1,5,3,2, and for 1950 he gives
+# Apr 30 - Sep 24; go with Shanks & Pottenger.
+Rule	StJohns	1946	1950	-	May	Sun>=8	2:00	1:00	D
+Rule	StJohns	1946	1950	-	Oct	Sun>=2	2:00	0	S
+Rule	StJohns	1951	1986	-	Apr	lastSun	2:00	1:00	D
+Rule	StJohns	1951	1959	-	Sep	lastSun	2:00	0	S
+Rule	StJohns	1960	1986	-	Oct	lastSun	2:00	0	S
+# From Paul Eggert (2000-10-02):
+# INMS (2000-09-12) says that, since 1988 at least, Newfoundland switches
+# at 00:01 local time.  For now, assume it started in 1987.
+Rule	StJohns	1987	only	-	Apr	Sun>=1	0:01	1:00	D
+Rule	StJohns	1987	2006	-	Oct	lastSun	0:01	0	S
+Rule	StJohns	1988	only	-	Apr	Sun>=1	0:01	2:00	DD
+Rule	StJohns	1989	2006	-	Apr	Sun>=1	0:01	1:00	D
+Rule	StJohns	2007	max	-	Mar	Sun>=8	0:01	1:00	D
+Rule	StJohns	2007	max	-	Nov	Sun>=1	0:01	0	S
+#
+# St John's has an apostrophe, but Posix file names can't have apostrophes.
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone America/St_Johns	-3:30:52 -	LMT	1884
+			-3:30:52 StJohns N%sT	1918
+			-3:30:52 Canada	N%sT	1919
+			-3:30:52 StJohns N%sT	1935 Mar 30
+			-3:30	StJohns	N%sT	1942 May 11
+			-3:30	Canada	N%sT	1946
+			-3:30	StJohns	N%sT
+
+# most of east Labrador
+
+# The name `Happy Valley-Goose Bay' is too long; use `Goose Bay'.
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone America/Goose_Bay	-4:01:40 -	LMT	1884 # Happy Valley-Goose Bay
+			-3:30:52 -	NST	1918
+			-3:30:52 Canada N%sT	1919
+			-3:30:52 -	NST	1935 Mar 30
+			-3:30	-	NST	1936
+			-3:30	StJohns	N%sT	1942 May 11
+			-3:30	Canada	N%sT	1946
+			-3:30	StJohns	N%sT	1966 Mar 15 2:00
+			-4:00	StJohns	A%sT
+
+
+# west Labrador, Nova Scotia, Prince Edward I
+
+# From Paul Eggert (2006-03-22):
+# Shanks & Pottenger write that since 1970 most of this region has been like
+# Halifax.  Many locales did not observe peacetime DST until 1972;
+# Glace Bay, NS is the largest that we know of.
+# Shanks & Pottenger also write that Liverpool, NS was the only town
+# in Canada to observe DST in 1971 but not 1970; for now we'll assume
+# this is a typo.
+
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Halifax	1916	only	-	Apr	 1	0:00	1:00	D
+Rule	Halifax	1916	only	-	Oct	 1	0:00	0	S
+Rule	Halifax	1920	only	-	May	 9	0:00	1:00	D
+Rule	Halifax	1920	only	-	Aug	29	0:00	0	S
+Rule	Halifax	1921	only	-	May	 6	0:00	1:00	D
+Rule	Halifax	1921	1922	-	Sep	 5	0:00	0	S
+Rule	Halifax	1922	only	-	Apr	30	0:00	1:00	D
+Rule	Halifax	1923	1925	-	May	Sun>=1	0:00	1:00	D
+Rule	Halifax	1923	only	-	Sep	 4	0:00	0	S
+Rule	Halifax	1924	only	-	Sep	15	0:00	0	S
+Rule	Halifax	1925	only	-	Sep	28	0:00	0	S
+Rule	Halifax	1926	only	-	May	16	0:00	1:00	D
+Rule	Halifax	1926	only	-	Sep	13	0:00	0	S
+Rule	Halifax	1927	only	-	May	 1	0:00	1:00	D
+Rule	Halifax	1927	only	-	Sep	26	0:00	0	S
+Rule	Halifax	1928	1931	-	May	Sun>=8	0:00	1:00	D
+Rule	Halifax	1928	only	-	Sep	 9	0:00	0	S
+Rule	Halifax	1929	only	-	Sep	 3	0:00	0	S
+Rule	Halifax	1930	only	-	Sep	15	0:00	0	S
+Rule	Halifax	1931	1932	-	Sep	Mon>=24	0:00	0	S
+Rule	Halifax	1932	only	-	May	 1	0:00	1:00	D
+Rule	Halifax	1933	only	-	Apr	30	0:00	1:00	D
+Rule	Halifax	1933	only	-	Oct	 2	0:00	0	S
+Rule	Halifax	1934	only	-	May	20	0:00	1:00	D
+Rule	Halifax	1934	only	-	Sep	16	0:00	0	S
+Rule	Halifax	1935	only	-	Jun	 2	0:00	1:00	D
+Rule	Halifax	1935	only	-	Sep	30	0:00	0	S
+Rule	Halifax	1936	only	-	Jun	 1	0:00	1:00	D
+Rule	Halifax	1936	only	-	Sep	14	0:00	0	S
+Rule	Halifax	1937	1938	-	May	Sun>=1	0:00	1:00	D
+Rule	Halifax	1937	1941	-	Sep	Mon>=24	0:00	0	S
+Rule	Halifax	1939	only	-	May	28	0:00	1:00	D
+Rule	Halifax	1940	1941	-	May	Sun>=1	0:00	1:00	D
+Rule	Halifax	1946	1949	-	Apr	lastSun	2:00	1:00	D
+Rule	Halifax	1946	1949	-	Sep	lastSun	2:00	0	S
+Rule	Halifax	1951	1954	-	Apr	lastSun	2:00	1:00	D
+Rule	Halifax	1951	1954	-	Sep	lastSun	2:00	0	S
+Rule	Halifax	1956	1959	-	Apr	lastSun	2:00	1:00	D
+Rule	Halifax	1956	1959	-	Sep	lastSun	2:00	0	S
+Rule	Halifax	1962	1973	-	Apr	lastSun	2:00	1:00	D
+Rule	Halifax	1962	1973	-	Oct	lastSun	2:00	0	S
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone America/Halifax	-4:14:24 -	LMT	1902 Jun 15
+			-4:00	Halifax	A%sT	1918
+			-4:00	Canada	A%sT	1919
+			-4:00	Halifax	A%sT	1942 Feb  9 2:00s
+			-4:00	Canada	A%sT	1946
+			-4:00	Halifax	A%sT	1974
+			-4:00	Canada	A%sT
+Zone America/Glace_Bay	-3:59:48 -	LMT	1902 Jun 15
+			-4:00	Canada	A%sT	1953
+			-4:00	Halifax	A%sT	1954
+			-4:00	-	AST	1972
+			-4:00	Halifax	A%sT	1974
+			-4:00	Canada	A%sT
+
+# New Brunswick
+
+# From Paul Eggert (2007-01-31):
+# The Time Definition Act <http://www.gnb.ca/0062/PDF-acts/t-06.pdf>
+# says they changed at 00:01 through 2006, and
+# <http://www.canlii.org/nb/laws/sta/t-6/20030127/whole.html> makes it
+# clear that this was the case since at least 1993.
+# For now, assume it started in 1993.
+
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Moncton	1933	1935	-	Jun	Sun>=8	1:00	1:00	D
+Rule	Moncton	1933	1935	-	Sep	Sun>=8	1:00	0	S
+Rule	Moncton	1936	1938	-	Jun	Sun>=1	1:00	1:00	D
+Rule	Moncton	1936	1938	-	Sep	Sun>=1	1:00	0	S
+Rule	Moncton	1939	only	-	May	27	1:00	1:00	D
+Rule	Moncton	1939	1941	-	Sep	Sat>=21	1:00	0	S
+Rule	Moncton	1940	only	-	May	19	1:00	1:00	D
+Rule	Moncton	1941	only	-	May	 4	1:00	1:00	D
+Rule	Moncton	1946	1972	-	Apr	lastSun	2:00	1:00	D
+Rule	Moncton	1946	1956	-	Sep	lastSun	2:00	0	S
+Rule	Moncton	1957	1972	-	Oct	lastSun	2:00	0	S
+Rule	Moncton	1993	2006	-	Apr	Sun>=1	0:01	1:00	D
+Rule	Moncton	1993	2006	-	Oct	lastSun	0:01	0	S
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone America/Moncton	-4:19:08 -	LMT	1883 Dec  9
+			-5:00	-	EST	1902 Jun 15
+			-4:00	Canada	A%sT	1933
+			-4:00	Moncton	A%sT	1942
+			-4:00	Canada	A%sT	1946
+			-4:00	Moncton	A%sT	1973
+			-4:00	Canada	A%sT	1993
+			-4:00	Moncton	A%sT	2007
+			-4:00	Canada	A%sT
+
+# Quebec
+
+# From Paul Eggert (2006-07-09):
+# Shanks & Pottenger write that since 1970 most of Quebec has been
+# like Montreal.
+
+# From Paul Eggert (2006-06-27):
+# Matthews and Vincent (1998) also write that Quebec east of the -63
+# meridian is supposed to observe AST, but residents as far east as
+# Natashquan use EST/EDT, and residents east of Natashquan use AST.
+# In "Official time in Quebec" the Quebec department of justice writes in
+# http://www.justice.gouv.qc.ca/english/publications/generale/temps-regl-1-a.htm
+# that "The residents of the Municipality of the
+# Cote-Nord-du-Golfe-Saint-Laurent and the municipalities of Saint-Augustin,
+# Bonne-Esperance and Blanc-Sablon apply the Official Time Act as it is
+# written and use Atlantic standard time all year round. The same applies to
+# the residents of the Native facilities along the lower North Shore."
+# <http://www.assnat.qc.ca/eng/37legislature2/Projets-loi/Publics/06-a002.htm>
+# says this common practice was codified into law as of 2007.
+# For lack of better info, guess this practice began around 1970, contra to
+# Shanks & Pottenger who have this region observing AST/ADT.
+
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Mont	1917	only	-	Mar	25	2:00	1:00	D
+Rule	Mont	1917	only	-	Apr	24	0:00	0	S
+Rule	Mont	1919	only	-	Mar	31	2:30	1:00	D
+Rule	Mont	1919	only	-	Oct	25	2:30	0	S
+Rule	Mont	1920	only	-	May	 2	2:30	1:00	D
+Rule	Mont	1920	1922	-	Oct	Sun>=1	2:30	0	S
+Rule	Mont	1921	only	-	May	 1	2:00	1:00	D
+Rule	Mont	1922	only	-	Apr	30	2:00	1:00	D
+Rule	Mont	1924	only	-	May	17	2:00	1:00	D
+Rule	Mont	1924	1926	-	Sep	lastSun	2:30	0	S
+Rule	Mont	1925	1926	-	May	Sun>=1	2:00	1:00	D
+# The 1927-to-1937 rules can be expressed more simply as
+# Rule	Mont	1927	1937	-	Apr	lastSat	24:00	1:00	D
+# Rule	Mont	1927	1937	-	Sep	lastSat	24:00	0	S
+# The rules below avoid use of 24:00
+# (which pre-1998 versions of zic cannot handle).
+Rule	Mont	1927	only	-	May	1	0:00	1:00	D
+Rule	Mont	1927	1932	-	Sep	lastSun	0:00	0	S
+Rule	Mont	1928	1931	-	Apr	lastSun	0:00	1:00	D
+Rule	Mont	1932	only	-	May	1	0:00	1:00	D
+Rule	Mont	1933	1940	-	Apr	lastSun	0:00	1:00	D
+Rule	Mont	1933	only	-	Oct	1	0:00	0	S
+Rule	Mont	1934	1939	-	Sep	lastSun	0:00	0	S
+Rule	Mont	1946	1973	-	Apr	lastSun	2:00	1:00	D
+Rule	Mont	1945	1948	-	Sep	lastSun	2:00	0	S
+Rule	Mont	1949	1950	-	Oct	lastSun	2:00	0	S
+Rule	Mont	1951	1956	-	Sep	lastSun	2:00	0	S
+Rule	Mont	1957	1973	-	Oct	lastSun	2:00	0	S
+
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone America/Blanc-Sablon -3:48:28 -	LMT	1884
+			-4:00	Canada	A%sT	1970
+			-4:00	-	AST
+Zone America/Montreal	-4:54:16 -	LMT	1884
+			-5:00	Mont	E%sT	1918
+			-5:00	Canada	E%sT	1919
+			-5:00	Mont	E%sT	1942 Feb  9 2:00s
+			-5:00	Canada	E%sT	1946
+			-5:00	Mont	E%sT	1974
+			-5:00	Canada	E%sT
+
+
+# Ontario
+
+# From Paul Eggert (2006-07-09):
+# Shanks & Pottenger write that since 1970 most of Ontario has been like
+# Toronto.
+# Thunder Bay skipped DST in 1973.
+# Many smaller locales did not observe peacetime DST until 1974;
+# Nipigon (EST) and Rainy River (CST) are the largest that we know of.
+# Far west Ontario is like Winnipeg; far east Quebec is like Halifax.
+
+# From Mark Brader (2003-07-26):
+# [According to the Toronto Star] Orillia, Ontario, adopted DST
+# effective Saturday, 1912-06-22, 22:00; the article mentions that
+# Port Arthur (now part of Thunder Bay, Ontario) as well as Moose Jaw
+# have already done so.  In Orillia DST was to run until Saturday,
+# 1912-08-31 (no time mentioned), but it was met with considerable
+# hostility from certain segments of the public, and was revoked after
+# only two weeks -- I copied it as Saturday, 1912-07-07, 22:00, but
+# presumably that should be -07-06.  (1912-06-19, -07-12; also letters
+# earlier in June).
+#
+# Kenora, Ontario, was to abandon DST on 1914-06-01 (-05-21).
+
+# From Paul Eggert (1997-10-17):
+# Mark Brader writes that an article in the 1997-10-14 Toronto Star
+# says that Atikokan, Ontario currently does not observe DST,
+# but will vote on 11-10 whether to use EST/EDT.
+# He also writes that the
+# <a href="http://www.gov.on.ca/MBS/english/publications/statregs/conttext.html">
+# Ontario Time Act (1990, Chapter T.9)
+# </a>
+# says that Ontario east of 90W uses EST/EDT, and west of 90W uses CST/CDT.
+# Officially Atikokan is therefore on CST/CDT, and most likely this report
+# concerns a non-official time observed as a matter of local practice.
+#
+# From Paul Eggert (2000-10-02):
+# Matthews and Vincent (1998) write that Atikokan, Pickle Lake, and
+# New Osnaburgh observe CST all year, that Big Trout Lake observes
+# CST/CDT, and that Upsala and Shebandowan observe EST/EDT, all in
+# violation of the official Ontario rules.
+#
+# From Paul Eggert (2006-07-09):
+# Chris Walton (2006-07-06) mentioned an article by Stephanie MacLellan in the
+# 2005-07-21 Chronicle-Journal, which said:
+#
+#	The clocks in Atikokan stay set on standard time year-round.
+#	This means they spend about half the time on central time and
+#	the other half on eastern time.
+#
+#	For the most part, the system works, Mayor Dennis Brown said.
+#
+#	"The majority of businesses in Atikokan deal more with Eastern
+#	Canada, but there are some that deal with Western Canada," he
+#	said.  "I don't see any changes happening here."
+#
+# Walton also writes "Supposedly Pickle Lake and Mishkeegogamang
+# [New Osnaburgh] follow the same practice."
+
+# From Garry McKinnon (2006-07-14) via Chris Walton:
+# I chatted with a member of my board who has an outstanding memory
+# and a long history in Atikokan (and in the telecom industry) and he
+# can say for certain that Atikokan has been practicing the current
+# time keeping since 1952, at least.
+
+# From Paul Eggert (2006-07-17):
+# Shanks & Pottenger say that Atikokan has agreed with Rainy River
+# ever since standard time was introduced, but the information from
+# McKinnon sounds more authoritative.  For now, assume that Atikokan
+# switched to EST immediately after WWII era daylight saving time
+# ended.  This matches the old (less-populous) America/Coral_Harbour
+# entry since our cutoff date of 1970, so we can move
+# America/Coral_Harbour to the 'backward' file.
+
+# From Mark Brader (2010-03-06):
+#
+# Currently the database has:
+#
+# # Ontario
+#
+# # From Paul Eggert (2006-07-09):
+# # Shanks & Pottenger write that since 1970 most of Ontario has been like
+# # Toronto.
+# # Thunder Bay skipped DST in 1973.
+# # Many smaller locales did not observe peacetime DST until 1974;
+# # Nipigon (EST) and Rainy River (CST) are the largest that we know of.
+#
+# In the (Toronto) Globe and Mail for Saturday, 1955-09-24, in the bottom
+# right corner of page 1, it says that Toronto will return to standard
+# time at 2 am Sunday morning (which agrees with the database), and that:
+#
+#     The one-hour setback will go into effect throughout most of Ontario,
+#     except in areas like Windsor which remains on standard time all year.
+#
+# Windsor is, of course, a lot larger than Nipigon.
+#
+# I only came across this incidentally.  I don't know if Windsor began
+# observing DST when Detroit did, or in 1974, or on some other date.
+#
+# By the way, the article continues by noting that:
+#
+#     Some cities in the United States have pushed the deadline back
+#     three weeks and will change over from daylight saving in October.
+
+# From Arthur David Olson (2010-07-17):
+#
+# "Standard Time and Time Zones in Canada" appeared in
+# The Journal of The Royal Astronomical Society of Canada,
+# volume 26, number 2 (February 1932) and, as of 2010-07-17,
+# was available at
+# <a href="http://adsabs.harvard.edu/full/1932JRASC..26...49S">
+# http://adsabs.harvard.edu/full/1932JRASC..26...49S
+# </a>
+#
+# It includes the text below (starting on page 57):
+#
+#   A list of the places in Canada using daylight saving time would
+# require yearly revision. From information kindly furnished by
+# the provincial governments and by the postmasters in many cities
+# and towns, it is found that the following places used daylight sav-
+# ing in 1930. The information for the province of Quebec is definite,
+# for the other provinces only approximate:
+#
+# 	Province	Daylight saving time used
+# Prince Edward Island	Not used.
+# Nova Scotia		In Halifax only.
+# New Brunswick		In St. John only.
+# Quebec		In the following places:
+# 			Montreal	Lachine
+# 			Quebec		Mont-Royal
+# 			Levis		Iberville
+# 			St. Lambert	Cap de la Madeleine
+# 			Verdun		Loretteville
+# 			Westmount	Richmond
+# 			Outremont	St. Jerome
+# 			Longueuil	Greenfield Park
+# 			Arvida		Waterloo
+# 			Chambly-Canton	Beaulieu
+# 			Melbourne	La Tuque
+# 			St. Theophile	Buckingham
+# Ontario		Used generally in the cities and towns along
+# 			the southerly part of the province. Not
+# 			used in the northwesterlhy part.
+# Manitoba		Not used.
+# Saskatchewan		In Regina only.
+# Alberta		Not used.
+# British Columbia	Not used.
+#
+#   With some exceptions, the use of daylight saving may be said to be limited
+# to those cities and towns lying between Quebec city and Windsor, Ont.
+
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Toronto	1919	only	-	Mar	30	23:30	1:00	D
+Rule	Toronto	1919	only	-	Oct	26	0:00	0	S
+Rule	Toronto	1920	only	-	May	 2	2:00	1:00	D
+Rule	Toronto	1920	only	-	Sep	26	0:00	0	S
+Rule	Toronto	1921	only	-	May	15	2:00	1:00	D
+Rule	Toronto	1921	only	-	Sep	15	2:00	0	S
+Rule	Toronto	1922	1923	-	May	Sun>=8	2:00	1:00	D
+# Shanks & Pottenger say 1923-09-19; assume it's a typo and that "-16"
+# was meant.
+Rule	Toronto	1922	1926	-	Sep	Sun>=15	2:00	0	S
+Rule	Toronto	1924	1927	-	May	Sun>=1	2:00	1:00	D
+# The 1927-to-1939 rules can be expressed more simply as
+# Rule	Toronto	1927	1937	-	Sep	Sun>=25	2:00	0	S
+# Rule	Toronto	1928	1937	-	Apr	Sun>=25	2:00	1:00	D
+# Rule	Toronto	1938	1940	-	Apr	lastSun	2:00	1:00	D
+# Rule	Toronto	1938	1939	-	Sep	lastSun	2:00	0	S
+# The rules below avoid use of Sun>=25
+# (which pre-2004 versions of zic cannot handle).
+Rule	Toronto	1927	1932	-	Sep	lastSun	2:00	0	S
+Rule	Toronto	1928	1931	-	Apr	lastSun	2:00	1:00	D
+Rule	Toronto	1932	only	-	May	1	2:00	1:00	D
+Rule	Toronto	1933	1940	-	Apr	lastSun	2:00	1:00	D
+Rule	Toronto	1933	only	-	Oct	1	2:00	0	S
+Rule	Toronto	1934	1939	-	Sep	lastSun	2:00	0	S
+Rule	Toronto	1945	1946	-	Sep	lastSun	2:00	0	S
+Rule	Toronto	1946	only	-	Apr	lastSun	2:00	1:00	D
+Rule	Toronto	1947	1949	-	Apr	lastSun	0:00	1:00	D
+Rule	Toronto	1947	1948	-	Sep	lastSun	0:00	0	S
+Rule	Toronto	1949	only	-	Nov	lastSun	0:00	0	S
+Rule	Toronto	1950	1973	-	Apr	lastSun	2:00	1:00	D
+Rule	Toronto	1950	only	-	Nov	lastSun	2:00	0	S
+Rule	Toronto	1951	1956	-	Sep	lastSun	2:00	0	S
+# Shanks & Pottenger say Toronto ended DST a week early in 1971,
+# namely on 1971-10-24, but Mark Brader wrote (2003-05-31) that this
+# is wrong, and that he had confirmed it by checking the 1971-10-30
+# Toronto Star, which said that DST was ending 1971-10-31 as usual.
+Rule	Toronto	1957	1973	-	Oct	lastSun	2:00	0	S
+
+# From Paul Eggert (2003-07-27):
+# Willett (1914-03) writes (p. 17) "In the Cities of Fort William, and
+# Port Arthur, Ontario, the principle of the Bill has been in
+# operation for the past three years, and in the City of Moose Jaw,
+# Saskatchewan, for one year."
+
+# From David Bryan via Tory Tronrud, Director/Curator,
+# Thunder Bay Museum (2003-11-12):
+# There is some suggestion, however, that, by-law or not, daylight
+# savings time was being practiced in Fort William and Port Arthur
+# before 1909.... [I]n 1910, the line between the Eastern and Central
+# Time Zones was permanently moved about two hundred miles west to
+# include the Thunder Bay area....  When Canada adopted daylight
+# savings time in 1916, Fort William and Port Arthur, having done so
+# already, did not change their clocks....  During the Second World
+# War,... [t]he cities agreed to implement DST during the summer
+# months for the remainder of the war years.
+
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone America/Toronto	-5:17:32 -	LMT	1895
+			-5:00	Canada	E%sT	1919
+			-5:00	Toronto	E%sT	1942 Feb  9 2:00s
+			-5:00	Canada	E%sT	1946
+			-5:00	Toronto	E%sT	1974
+			-5:00	Canada	E%sT
+Zone America/Thunder_Bay -5:57:00 -	LMT	1895
+			-6:00	-	CST	1910
+			-5:00	-	EST	1942
+			-5:00	Canada	E%sT	1970
+			-5:00	Mont	E%sT	1973
+			-5:00	-	EST	1974
+			-5:00	Canada	E%sT
+Zone America/Nipigon	-5:53:04 -	LMT	1895
+			-5:00	Canada	E%sT	1940 Sep 29
+			-5:00	1:00	EDT	1942 Feb  9 2:00s
+			-5:00	Canada	E%sT
+Zone America/Rainy_River -6:18:16 -	LMT	1895
+			-6:00	Canada	C%sT	1940 Sep 29
+			-6:00	1:00	CDT	1942 Feb  9 2:00s
+			-6:00	Canada	C%sT
+Zone America/Atikokan	-6:06:28 -	LMT	1895
+			-6:00	Canada	C%sT	1940 Sep 29
+			-6:00	1:00	CDT	1942 Feb  9 2:00s
+			-6:00	Canada	C%sT	1945 Sep 30 2:00
+			-5:00	-	EST
+
+
+# Manitoba
+
+# From Rob Douglas (2006-04-06):
+# the old Manitoba Time Act - as amended by Bill 2, assented to
+# March 27, 1987 ... said ...
+# "between two o'clock Central Standard Time in the morning of
+# the first Sunday of April of each year and two o'clock Central
+# Standard Time in the morning of the last Sunday of October next
+# following, one hour in advance of Central Standard Time."...
+# I believe that the English legislation [of the old time act] had =
+# been assented to (March 22, 1967)....
+# Also, as far as I can tell, there was no order-in-council varying
+# the time of Daylight Saving Time for 2005 and so the provisions of
+# the 1987 version would apply - the changeover was at 2:00 Central
+# Standard Time (i.e. not until 3:00 Central Daylight Time).
+
+# From Paul Eggert (2006-04-10):
+# Shanks & Pottenger say Manitoba switched at 02:00 (not 02:00s)
+# starting 1966.  Since 02:00s is clearly correct for 1967 on, assume
+# it was also 02:00s in 1966.
+
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Winn	1916	only	-	Apr	23	0:00	1:00	D
+Rule	Winn	1916	only	-	Sep	17	0:00	0	S
+Rule	Winn	1918	only	-	Apr	14	2:00	1:00	D
+Rule	Winn	1918	only	-	Oct	31	2:00	0	S
+Rule	Winn	1937	only	-	May	16	2:00	1:00	D
+Rule	Winn	1937	only	-	Sep	26	2:00	0	S
+Rule	Winn	1942	only	-	Feb	 9	2:00	1:00	W # War
+Rule	Winn	1945	only	-	Aug	14	23:00u	1:00	P # Peace
+Rule	Winn	1945	only	-	Sep	lastSun	2:00	0	S
+Rule	Winn	1946	only	-	May	12	2:00	1:00	D
+Rule	Winn	1946	only	-	Oct	13	2:00	0	S
+Rule	Winn	1947	1949	-	Apr	lastSun	2:00	1:00	D
+Rule	Winn	1947	1949	-	Sep	lastSun	2:00	0	S
+Rule	Winn	1950	only	-	May	 1	2:00	1:00	D
+Rule	Winn	1950	only	-	Sep	30	2:00	0	S
+Rule	Winn	1951	1960	-	Apr	lastSun	2:00	1:00	D
+Rule	Winn	1951	1958	-	Sep	lastSun	2:00	0	S
+Rule	Winn	1959	only	-	Oct	lastSun	2:00	0	S
+Rule	Winn	1960	only	-	Sep	lastSun	2:00	0	S
+Rule	Winn	1963	only	-	Apr	lastSun	2:00	1:00	D
+Rule	Winn	1963	only	-	Sep	22	2:00	0	S
+Rule	Winn	1966	1986	-	Apr	lastSun	2:00s	1:00	D
+Rule	Winn	1966	2005	-	Oct	lastSun	2:00s	0	S
+Rule	Winn	1987	2005	-	Apr	Sun>=1	2:00s	1:00	D
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone America/Winnipeg	-6:28:36 -	LMT	1887 Jul 16
+			-6:00	Winn	C%sT	2006
+			-6:00	Canada	C%sT
+
+
+# Saskatchewan
+
+# From Mark Brader (2003-07-26):
+# The first actual adoption of DST in Canada was at the municipal
+# level.  As the [Toronto] Star put it (1912-06-07), "While people
+# elsewhere have long been talking of legislation to save daylight,
+# the city of Moose Jaw [Saskatchewan] has acted on its own hook."
+# DST in Moose Jaw began on Saturday, 1912-06-01 (no time mentioned:
+# presumably late evening, as below), and would run until "the end of
+# the summer".  The discrepancy between municipal time and railroad
+# time was noted.
+
+# From Paul Eggert (2003-07-27):
+# Willett (1914-03) notes that DST "has been in operation ... in the
+# City of Moose Jaw, Saskatchewan, for one year."
+
+# From Paul Eggert (2006-03-22):
+# Shanks & Pottenger say that since 1970 this region has mostly been as Regina.
+# Some western towns (e.g. Swift Current) switched from MST/MDT to CST in 1972.
+# Other western towns (e.g. Lloydminster) are like Edmonton.
+# Matthews and Vincent (1998) write that Denare Beach and Creighton
+# are like Winnipeg, in violation of Saskatchewan law.
+
+# From W. Jones (1992-11-06):
+# The. . .below is based on information I got from our law library, the
+# provincial archives, and the provincial Community Services department.
+# A precise history would require digging through newspaper archives, and
+# since you didn't say what you wanted, I didn't bother.
+#
+# Saskatchewan is split by a time zone meridian (105W) and over the years
+# the boundary became pretty ragged as communities near it reevaluated
+# their affiliations in one direction or the other.  In 1965 a provincial
+# referendum favoured legislating common time practices.
+#
+# On 15 April 1966 the Time Act (c. T-14, Revised Statutes of
+# Saskatchewan 1978) was proclaimed, and established that the eastern
+# part of Saskatchewan would use CST year round, that districts in
+# northwest Saskatchewan would by default follow CST but could opt to
+# follow Mountain Time rules (thus 1 hour difference in the winter and
+# zero in the summer), and that districts in southwest Saskatchewan would
+# by default follow MT but could opt to follow CST.
+#
+# It took a few years for the dust to settle (I know one story of a town
+# on one time zone having its school in another, such that a mom had to
+# serve her family lunch in two shifts), but presently it seems that only
+# a few towns on the border with Alberta (e.g. Lloydminster) follow MT
+# rules any more; all other districts appear to have used CST year round
+# since sometime in the 1960s.
+
+# From Chris Walton (2006-06-26):
+# The Saskatchewan time act which was last updated in 1996 is about 30 pages
+# long and rather painful to read.
+# http://www.qp.gov.sk.ca/documents/English/Statutes/Statutes/T14.pdf
+
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Regina	1918	only	-	Apr	14	2:00	1:00	D
+Rule	Regina	1918	only	-	Oct	31	2:00	0	S
+Rule	Regina	1930	1934	-	May	Sun>=1	0:00	1:00	D
+Rule	Regina	1930	1934	-	Oct	Sun>=1	0:00	0	S
+Rule	Regina	1937	1941	-	Apr	Sun>=8	0:00	1:00	D
+Rule	Regina	1937	only	-	Oct	Sun>=8	0:00	0	S
+Rule	Regina	1938	only	-	Oct	Sun>=1	0:00	0	S
+Rule	Regina	1939	1941	-	Oct	Sun>=8	0:00	0	S
+Rule	Regina	1942	only	-	Feb	 9	2:00	1:00	W # War
+Rule	Regina	1945	only	-	Aug	14	23:00u	1:00	P # Peace
+Rule	Regina	1945	only	-	Sep	lastSun	2:00	0	S
+Rule	Regina	1946	only	-	Apr	Sun>=8	2:00	1:00	D
+Rule	Regina	1946	only	-	Oct	Sun>=8	2:00	0	S
+Rule	Regina	1947	1957	-	Apr	lastSun	2:00	1:00	D
+Rule	Regina	1947	1957	-	Sep	lastSun	2:00	0	S
+Rule	Regina	1959	only	-	Apr	lastSun	2:00	1:00	D
+Rule	Regina	1959	only	-	Oct	lastSun	2:00	0	S
+#
+Rule	Swift	1957	only	-	Apr	lastSun	2:00	1:00	D
+Rule	Swift	1957	only	-	Oct	lastSun	2:00	0	S
+Rule	Swift	1959	1961	-	Apr	lastSun	2:00	1:00	D
+Rule	Swift	1959	only	-	Oct	lastSun	2:00	0	S
+Rule	Swift	1960	1961	-	Sep	lastSun	2:00	0	S
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone America/Regina	-6:58:36 -	LMT	1905 Sep
+			-7:00	Regina	M%sT	1960 Apr lastSun 2:00
+			-6:00	-	CST
+Zone America/Swift_Current -7:11:20 -	LMT	1905 Sep
+			-7:00	Canada	M%sT	1946 Apr lastSun 2:00
+			-7:00	Regina	M%sT	1950
+			-7:00	Swift	M%sT	1972 Apr lastSun 2:00
+			-6:00	-	CST
+
+
+# Alberta
+
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Edm	1918	1919	-	Apr	Sun>=8	2:00	1:00	D
+Rule	Edm	1918	only	-	Oct	31	2:00	0	S
+Rule	Edm	1919	only	-	May	27	2:00	0	S
+Rule	Edm	1920	1923	-	Apr	lastSun	2:00	1:00	D
+Rule	Edm	1920	only	-	Oct	lastSun	2:00	0	S
+Rule	Edm	1921	1923	-	Sep	lastSun	2:00	0	S
+Rule	Edm	1942	only	-	Feb	 9	2:00	1:00	W # War
+Rule	Edm	1945	only	-	Aug	14	23:00u	1:00	P # Peace
+Rule	Edm	1945	only	-	Sep	lastSun	2:00	0	S
+Rule	Edm	1947	only	-	Apr	lastSun	2:00	1:00	D
+Rule	Edm	1947	only	-	Sep	lastSun	2:00	0	S
+Rule	Edm	1967	only	-	Apr	lastSun	2:00	1:00	D
+Rule	Edm	1967	only	-	Oct	lastSun	2:00	0	S
+Rule	Edm	1969	only	-	Apr	lastSun	2:00	1:00	D
+Rule	Edm	1969	only	-	Oct	lastSun	2:00	0	S
+Rule	Edm	1972	1986	-	Apr	lastSun	2:00	1:00	D
+Rule	Edm	1972	2006	-	Oct	lastSun	2:00	0	S
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone America/Edmonton	-7:33:52 -	LMT	1906 Sep
+			-7:00	Edm	M%sT	1987
+			-7:00	Canada	M%sT
+
+
+# British Columbia
+
+# From Paul Eggert (2006-03-22):
+# Shanks & Pottenger write that since 1970 most of this region has
+# been like Vancouver.
+# Dawson Creek uses MST.  Much of east BC is like Edmonton.
+# Matthews and Vincent (1998) write that Creston is like Dawson Creek.
+
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Vanc	1918	only	-	Apr	14	2:00	1:00	D
+Rule	Vanc	1918	only	-	Oct	31	2:00	0	S
+Rule	Vanc	1942	only	-	Feb	 9	2:00	1:00	W # War
+Rule	Vanc	1945	only	-	Aug	14	23:00u	1:00	P # Peace
+Rule	Vanc	1945	only	-	Sep	30	2:00	0	S
+Rule	Vanc	1946	1986	-	Apr	lastSun	2:00	1:00	D
+Rule	Vanc	1946	only	-	Oct	13	2:00	0	S
+Rule	Vanc	1947	1961	-	Sep	lastSun	2:00	0	S
+Rule	Vanc	1962	2006	-	Oct	lastSun	2:00	0	S
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone America/Vancouver	-8:12:28 -	LMT	1884
+			-8:00	Vanc	P%sT	1987
+			-8:00	Canada	P%sT
+Zone America/Dawson_Creek -8:00:56 -	LMT	1884
+			-8:00	Canada	P%sT	1947
+			-8:00	Vanc	P%sT	1972 Aug 30 2:00
+			-7:00	-	MST
+
+
+# Northwest Territories, Nunavut, Yukon
+
+# From Paul Eggert (2006-03-22):
+# Dawson switched to PST in 1973.  Inuvik switched to MST in 1979.
+# Mathew Englander (1996-10-07) gives the following refs:
+#	* 1967. Paragraph 28(34)(g) of the Interpretation Act, S.C. 1967-68,
+#	c. 7 defines Yukon standard time as UTC-9.  This is still valid;
+#	see Interpretation Act, R.S.C. 1985, c. I-21, s. 35(1).
+#	* C.O. 1973/214 switched Yukon to PST on 1973-10-28 00:00.
+#	* O.I.C. 1980/02 established DST.
+#	* O.I.C. 1987/056 changed DST to Apr firstSun 2:00 to Oct lastSun 2:00.
+# Shanks & Pottenger say Yukon's 1973-10-28 switch was at 2:00; go
+# with Englander.
+# From Chris Walton (2006-06-26):
+# Here is a link to the old daylight saving portion of the interpretation
+# act which was last updated in 1987:
+# http://www.gov.yk.ca/legislation/regs/oic1987_056.pdf
+
+# From Rives McDow (1999-09-04):
+# Nunavut ... moved ... to incorporate the whole territory into one time zone.
+# <a href="http://www.nunatsiaq.com/nunavut/nvt90903_13.html">
+# Nunavut moves to single time zone Oct. 31
+# </a>
+#
+# From Antoine Leca (1999-09-06):
+# We then need to create a new timezone for the Kitikmeot region of Nunavut
+# to differentiate it from the Yellowknife region.
+
+# From Paul Eggert (1999-09-20):
+# <a href="http://www.nunavut.com/basicfacts/english/basicfacts_1territory.html">
+# Basic Facts: The New Territory
+# </a> (1999) reports that Pangnirtung operates on eastern time,
+# and that Coral Harbour does not observe DST.  We don't know when
+# Pangnirtung switched to eastern time; we'll guess 1995.
+
+# From Rives McDow (1999-11-08):
+# On October 31, when the rest of Nunavut went to Central time,
+# Pangnirtung wobbled.  Here is the result of their wobble:
+#
+# The following businesses and organizations in Pangnirtung use Central Time:
+#
+#	First Air, Power Corp, Nunavut Construction, Health Center, RCMP,
+#	Eastern Arctic National Parks, A & D Specialist
+#
+# The following businesses and organizations in Pangnirtung use Eastern Time:
+#
+#	Hamlet office, All other businesses, Both schools, Airport operator
+#
+# This has made for an interesting situation there, which warranted the news.
+# No one there that I spoke with seems concerned, or has plans to
+# change the local methods of keeping time, as it evidently does not
+# really interfere with any activities or make things difficult locally.
+# They plan to celebrate New Year's turn-over twice, one hour apart,
+# so it appears that the situation will last at least that long.
+# The Nunavut Intergovernmental Affairs hopes that they will "come to
+# their senses", but the locals evidently don't see any problem with
+# the current state of affairs.
+
+# From Michaela Rodrigue, writing in the
+# <a href="http://www.nunatsiaq.com/archives/nunavut991130/nvt91119_17.html">
+# Nunatsiaq News (1999-11-19)</a>:
+# Clyde River, Pangnirtung and Sanikiluaq now operate with two time zones,
+# central - or Nunavut time - for government offices, and eastern time
+# for municipal offices and schools....  Igloolik [was similar but then]
+# made the switch to central time on Saturday, Nov. 6.
+
+# From Paul Eggert (2000-10-02):
+# Matthews and Vincent (1998) say the following, but we lack histories
+# for these potential new Zones.
+#
+# The Canadian Forces station at Alert uses Eastern Time while the
+# handful of residents at the Eureka weather station [in the Central
+# zone] skip daylight savings.  Baffin Island, which is crossed by the
+# Central, Eastern and Atlantic Time zones only uses Eastern Time.
+# Gjoa Haven, Taloyoak and Pelly Bay all use Mountain instead of
+# Central Time and Southampton Island [in the Central zone] is not
+# required to use daylight savings.
+
+# From
+# <a href="http://www.nunatsiaq.com/archives/nunavut001130/nvt21110_02.html">
+# Nunavut now has two time zones
+# </a> (2000-11-10):
+# The Nunavut government would allow its employees in Kugluktuk and
+# Cambridge Bay to operate on central time year-round, putting them
+# one hour behind the rest of Nunavut for six months during the winter.
+# At the end of October the two communities had rebelled against
+# Nunavut's unified time zone, refusing to shift to eastern time with
+# the rest of the territory for the winter.  Cambridge Bay remained on
+# central time, while Kugluktuk, even farther west, reverted to
+# mountain time, which they had used before the advent of Nunavut's
+# unified time zone in 1999.
+#
+# From Rives McDow (2001-01-20), quoting the Nunavut government:
+# The preceding decision came into effect at midnight, Saturday Nov 4, 2000.
+
+# From Paul Eggert (2000-12-04):
+# Let's just keep track of the official times for now.
+
+# From Rives McDow (2001-03-07):
+# The premier of Nunavut has issued a ministerial statement advising
+# that effective 2001-04-01, the territory of Nunavut will revert
+# back to three time zones (mountain, central, and eastern).  Of the
+# cities in Nunavut, Coral Harbor is the only one that I know of that
+# has said it will not observe dst, staying on EST year round.  I'm
+# checking for more info, and will get back to you if I come up with
+# more.
+# [Also see <http://www.nunatsiaq.com/nunavut/nvt10309_06.html> (2001-03-09).]
+
+# From Gwillim Law (2005-05-21):
+# According to maps at
+# http://inms-ienm.nrc-cnrc.gc.ca/images/time_services/TZ01SWE.jpg
+# http://inms-ienm.nrc-cnrc.gc.ca/images/time_services/TZ01SSE.jpg
+# (both dated 2003), and
+# http://www.canadiangeographic.ca/Magazine/SO98/geomap.asp
+# (from a 1998 Canadian Geographic article), the de facto and de jure time
+# for Southampton Island (at the north end of Hudson Bay) is UTC-5 all year
+# round.  Using Google, it's easy to find other websites that confirm this.
+# I wasn't able to find how far back this time regimen goes, but since it
+# predates the creation of Nunavut, it probably goes back many years....
+# The Inuktitut name of Coral Harbour is Sallit, but it's rarely used.
+#
+# From Paul Eggert (2005-07-26):
+# For lack of better information, assume that Southampton Island observed
+# daylight saving only during wartime.
+
+# From Chris Walton (2007-03-01):
+# ... the community of Resolute (located on Cornwallis Island in
+# Nunavut) moved from Central Time to Eastern Time last November.
+# Basically the community did not change its clocks at the end of
+# daylight saving....
+# http://www.nnsl.com/frames/newspapers/2006-11/nov13_06none.html
+
+# From Chris Walton (2007-03-14):
+# Today I phoned the "hamlet office" to find out what Resolute was doing with
+# its clocks.
+#
+# The individual that answered the phone confirmed that the clocks did not
+# move at the end of daylight saving on October 29/2006.  He also told me that
+# the clocks did not move this past weekend (March 11/2007)....
+
+# From Chris Walton (2008-11-13):
+# ...the residents of Resolute believe that they are changing "time zones"
+# twice a year.  In winter months, local time is qualified with "Eastern
+# Time" which is really "Eastern Standard Time (UTC-5)".  In summer
+# months, local time is qualified with "Central Time" which is really
+# "Central Daylight Time (UTC-5)"...
+
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	NT_YK	1918	only	-	Apr	14	2:00	1:00	D
+Rule	NT_YK	1918	only	-	Oct	27	2:00	0	S
+Rule	NT_YK	1919	only	-	May	25	2:00	1:00	D
+Rule	NT_YK	1919	only	-	Nov	 1	0:00	0	S
+Rule	NT_YK	1942	only	-	Feb	 9	2:00	1:00	W # War
+Rule	NT_YK	1945	only	-	Aug	14	23:00u	1:00	P # Peace
+Rule	NT_YK	1945	only	-	Sep	30	2:00	0	S
+Rule	NT_YK	1965	only	-	Apr	lastSun	0:00	2:00	DD
+Rule	NT_YK	1965	only	-	Oct	lastSun	2:00	0	S
+Rule	NT_YK	1980	1986	-	Apr	lastSun	2:00	1:00	D
+Rule	NT_YK	1980	2006	-	Oct	lastSun	2:00	0	S
+Rule	NT_YK	1987	2006	-	Apr	Sun>=1	2:00	1:00	D
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+# aka Panniqtuuq
+Zone America/Pangnirtung 0	-	zzz	1921 # trading post est.
+			-4:00	NT_YK	A%sT	1995 Apr Sun>=1 2:00
+			-5:00	Canada	E%sT	1999 Oct 31 2:00
+			-6:00	Canada	C%sT	2000 Oct 29 2:00
+			-5:00	Canada	E%sT
+# formerly Frobisher Bay
+Zone America/Iqaluit	0	-	zzz	1942 Aug # Frobisher Bay est.
+			-5:00	NT_YK	E%sT	1999 Oct 31 2:00
+			-6:00	Canada	C%sT	2000 Oct 29 2:00
+			-5:00	Canada	E%sT
+# aka Qausuittuq
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Resolute 2006	max	-	Nov	Sun>=1	2:00	0	ES
+Rule	Resolute 2007	max	-	Mar	Sun>=8	2:00	0	CD
+Zone America/Resolute	0	-	zzz	1947 Aug 31 # Resolute founded
+			-6:00	NT_YK	C%sT	2000 Oct 29 2:00
+			-5:00	-	EST	2001 Apr  1 3:00
+			-6:00	Canada	C%sT	2006 Oct 29 2:00
+			-5:00	Resolute	%sT
+# aka Kangiqiniq
+Zone America/Rankin_Inlet 0	-	zzz	1957 # Rankin Inlet founded
+			-6:00	NT_YK	C%sT	2000 Oct 29 2:00
+			-5:00	-	EST	2001 Apr  1 3:00
+			-6:00	Canada	C%sT
+# aka Iqaluktuuttiaq
+Zone America/Cambridge_Bay 0	-	zzz	1920 # trading post est.?
+			-7:00	NT_YK	M%sT	1999 Oct 31 2:00
+			-6:00	Canada	C%sT	2000 Oct 29 2:00
+			-5:00	-	EST	2000 Nov  5 0:00
+			-6:00	-	CST	2001 Apr  1 3:00
+			-7:00	Canada	M%sT
+Zone America/Yellowknife 0	-	zzz	1935 # Yellowknife founded?
+			-7:00	NT_YK	M%sT	1980
+			-7:00	Canada	M%sT
+Zone America/Inuvik	0	-	zzz	1953 # Inuvik founded
+			-8:00	NT_YK	P%sT	1979 Apr lastSun 2:00
+			-7:00	NT_YK	M%sT	1980
+			-7:00	Canada	M%sT
+Zone America/Whitehorse	-9:00:12 -	LMT	1900 Aug 20
+			-9:00	NT_YK	Y%sT	1966 Jul 1 2:00
+			-8:00	NT_YK	P%sT	1980
+			-8:00	Canada	P%sT
+Zone America/Dawson	-9:17:40 -	LMT	1900 Aug 20
+			-9:00	NT_YK	Y%sT	1973 Oct 28 0:00
+			-8:00	NT_YK	P%sT	1980
+			-8:00	Canada	P%sT
+
+
+###############################################################################
+
+# Mexico
+
+# From Paul Eggert (2001-03-05):
+# The Investigation and Analysis Service of the
+# Mexican Library of Congress (MLoC) has published a
+# <a href="http://www.cddhcu.gob.mx/bibliot/publica/inveyana/polisoc/horver/">
+# history of Mexican local time (in Spanish)
+# </a>.
+#
+# Here are the discrepancies between Shanks & Pottenger (S&P) and the MLoC.
+# (In all cases we go with the MLoC.)
+# S&P report that Baja was at -8:00 in 1922/1923.
+# S&P say the 1930 transition in Baja was 1930-11-16.
+# S&P report no DST during summer 1931.
+# S&P report a transition at 1932-03-30 23:00, not 1932-04-01.
+
+# From Gwillim Law (2001-02-20):
+# There are some other discrepancies between the Decrees page and the
+# tz database.  I think they can best be explained by supposing that
+# the researchers who prepared the Decrees page failed to find some of
+# the relevant documents.
+
+# From Alan Perry (1996-02-15):
+# A guy from our Mexico subsidiary finally found the Presidential Decree
+# outlining the timezone changes in Mexico.
+#
+# ------------- Begin Forwarded Message -------------
+#
+# I finally got my hands on the Official Presidential Decree that sets up the
+# rules for the DST changes. The rules are:
+#
+# 1. The country is divided in 3 timezones:
+#    - Baja California Norte (the Mexico/BajaNorte TZ)
+#    - Baja California Sur, Nayarit, Sinaloa and Sonora (the Mexico/BajaSur TZ)
+#    - The rest of the country (the Mexico/General TZ)
+#
+# 2. From the first Sunday in April at 2:00 AM to the last Sunday in October
+#    at 2:00 AM, the times in each zone are as follows:
+#    BajaNorte: GMT+7
+#    BajaSur:   GMT+6
+#    General:   GMT+5
+#
+# 3. The rest of the year, the times are as follows:
+#    BajaNorte: GMT+8
+#    BajaSur:   GMT+7
+#    General:   GMT+6
+#
+# The Decree was published in Mexico's Official Newspaper on January 4th.
+#
+# -------------- End Forwarded Message --------------
+# From Paul Eggert (1996-06-12):
+# For an English translation of the decree, see
+# <a href="http://mexico-travel.com/extra/timezone_eng.html">
+# ``Diario Oficial: Time Zone Changeover'' (1996-01-04).
+# </a>
+
+# From Rives McDow (1998-10-08):
+# The State of Quintana Roo has reverted back to central STD and DST times
+# (i.e. UTC -0600 and -0500 as of 1998-08-02).
+
+# From Rives McDow (2000-01-10):
+# Effective April 4, 1999 at 2:00 AM local time, Sonora changed to the time
+# zone 5 hours from the International Date Line, and will not observe daylight
+# savings time so as to stay on the same time zone as the southern part of
+# Arizona year round.
+
+# From Jesper Norgaard, translating
+# <http://www.reforma.com/nacional/articulo/064327/> (2001-01-17):
+# In Oaxaca, the 55.000 teachers from the Section 22 of the National
+# Syndicate of Education Workers, refuse to apply daylight saving each
+# year, so that the more than 10,000 schools work at normal hour the
+# whole year.
+
+# From Gwillim Law (2001-01-19):
+# <http://www.reforma.com/negocios_y_dinero/articulo/064481/> ... says
+# (translated):...
+# January 17, 2000 - The Energy Secretary, Ernesto Martens, announced
+# that Summer Time will be reduced from seven to five months, starting
+# this year....
+# <http://www.publico.com.mx/scripts/texto3.asp?action=pagina&pag=21&pos=p&secc=naci&date=01/17/2001>
+# [translated], says "summer time will ... take effect on the first Sunday
+# in May, and end on the last Sunday of September.
+
+# From Arthur David Olson (2001-01-25):
+# The 2001-01-24 traditional Washington Post contained the page one
+# story "Timely Issue Divides Mexicans."...
+# http://www.washingtonpost.com/wp-dyn/articles/A37383-2001Jan23.html
+# ... Mexico City Mayor Lopez Obrador "...is threatening to keep
+# Mexico City and its 20 million residents on a different time than
+# the rest of the country..." In particular, Lopez Obrador would abolish
+# observation of Daylight Saving Time.
+
+# <a href="http://www.conae.gob.mx/ahorro/decretohorver2001.html#decre">
+# Official statute published by the Energy Department
+# </a> (2001-02-01) shows Baja and Chihauhua as still using US DST rules,
+# and Sonora with no DST.  This was reported by Jesper Norgaard (2001-02-03).
+
+# From Paul Eggert (2001-03-03):
+#
+# <a href="http://www.latimes.com/news/nation/20010303/t000018766.html">
+# James F. Smith writes in today's LA Times
+# </a>
+# * Sonora will continue to observe standard time.
+# * Last week Mexico City's mayor Andres Manuel Lopez Obrador decreed that
+#   the Federal District will not adopt DST.
+# * 4 of 16 district leaders announced they'll ignore the decree.
+# * The decree does not affect federal-controlled facilities including
+#   the airport, banks, hospitals, and schools.
+#
+# For now we'll assume that the Federal District will bow to federal rules.
+
+# From Jesper Norgaard (2001-04-01):
+# I found some references to the Mexican application of daylight
+# saving, which modifies what I had already sent you, stating earlier
+# that a number of northern Mexican states would go on daylight
+# saving. The modification reverts this to only cover Baja California
+# (Norte), while all other states (except Sonora, who has no daylight
+# saving all year) will follow the original decree of president
+# Vicente Fox, starting daylight saving May 6, 2001 and ending
+# September 30, 2001.
+# References: "Diario de Monterrey" <www.diariodemonterrey.com/index.asp>
+# Palabra <http://palabra.infosel.com/010331/primera/ppri3101.pdf> (2001-03-31)
+
+# From Reuters (2001-09-04):
+# Mexico's Supreme Court on Tuesday declared that daylight savings was
+# unconstitutional in Mexico City, creating the possibility the
+# capital will be in a different time zone from the rest of the nation
+# next year....  The Supreme Court's ruling takes effect at 2:00
+# a.m. (0800 GMT) on Sept. 30, when Mexico is scheduled to revert to
+# standard time. "This is so residents of the Federal District are not
+# subject to unexpected time changes," a statement from the court said.
+
+# From Jesper Norgaard Welen (2002-03-12):
+# ... consulting my local grocery store(!) and my coworkers, they all insisted
+# that a new decision had been made to reinstate US style DST in Mexico....
+# http://www.conae.gob.mx/ahorro/horaver2001_m1_2002.html (2002-02-20)
+# confirms this.  Sonora as usual is the only state where DST is not applied.
+
+# From Steffen Thorsen (2009-12-28):
+#
+# Steffen Thorsen wrote:
+# > Mexico's House of Representatives has approved a proposal for northern
+# > Mexico's border cities to share the same daylight saving schedule as
+# > the United States.
+# Now this has passed both the Congress and the Senate, so starting from
+# 2010, some border regions will be the same:
+# <a href="http://www.signonsandiego.com/news/2009/dec/28/clocks-will-match-both-sides-border/">
+# http://www.signonsandiego.com/news/2009/dec/28/clocks-will-match-both-sides-border/
+# </a>
+# <a href="http://www.elmananarey.com/diario/noticia/nacional/noticias/empatan_horario_de_frontera_con_eu/621939">
+# http://www.elmananarey.com/diario/noticia/nacional/noticias/empatan_horario_de_frontera_con_eu/621939
+# </a>
+# (Spanish)
+#
+# Could not find the new law text, but the proposed law text changes are here:
+# <a href="http://gaceta.diputados.gob.mx/Gaceta/61/2009/dic/20091210-V.pdf">
+# http://gaceta.diputados.gob.mx/Gaceta/61/2009/dic/20091210-V.pdf
+# </a>
+# (Gaceta Parlamentaria)
+#
+# There is also a list of the votes here:
+# <a href="http://gaceta.diputados.gob.mx/Gaceta/61/2009/dic/V2-101209.html">
+# http://gaceta.diputados.gob.mx/Gaceta/61/2009/dic/V2-101209.html
+# </a>
+#
+# Our page:
+# <a href="http://www.timeanddate.com/news/time/north-mexico-dst-change.html">
+# http://www.timeanddate.com/news/time/north-mexico-dst-change.html
+# </a>
+
+# From Arthur David Olson (2010-01-20):
+# The page
+# <a href="http://dof.gob.mx/nota_detalle.php?codigo=5127480&fecha=06/01/2010">
+# http://dof.gob.mx/nota_detalle.php?codigo=5127480&fecha=06/01/2010
+# </a>
+# includes this text:
+# En los municipios fronterizos de Tijuana y Mexicali en Baja California;
+# Ju&aacute;rez y Ojinaga en Chihuahua; Acu&ntilde;a y Piedras Negras en Coahuila;
+# An&aacute;huac en Nuevo Le&oacute;n; y Nuevo Laredo, Reynosa y Matamoros en
+# Tamaulipas, la aplicaci&oacute;n de este horario estacional surtir&aacute; efecto
+# desde las dos horas del segundo domingo de marzo y concluir&aacute; a las dos
+# horas del primer domingo de noviembre.
+# En los municipios fronterizos que se encuentren ubicados en la franja
+# fronteriza norte en el territorio comprendido entre la l&iacute;nea
+# internacional y la l&iacute;nea paralela ubicada a una distancia de veinte
+# kil&oacute;metros, as&iacute; como la Ciudad de Ensenada, Baja California, hacia el
+# interior del pa&iacute;s, la aplicaci&oacute;n de este horario estacional surtir&aacute;
+# efecto desde las dos horas del segundo domingo de marzo y concluir&aacute; a
+# las dos horas del primer domingo de noviembre.
+
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Mexico	1939	only	-	Feb	5	0:00	1:00	D
+Rule	Mexico	1939	only	-	Jun	25	0:00	0	S
+Rule	Mexico	1940	only	-	Dec	9	0:00	1:00	D
+Rule	Mexico	1941	only	-	Apr	1	0:00	0	S
+Rule	Mexico	1943	only	-	Dec	16	0:00	1:00	W # War
+Rule	Mexico	1944	only	-	May	1	0:00	0	S
+Rule	Mexico	1950	only	-	Feb	12	0:00	1:00	D
+Rule	Mexico	1950	only	-	Jul	30	0:00	0	S
+Rule	Mexico	1996	2000	-	Apr	Sun>=1	2:00	1:00	D
+Rule	Mexico	1996	2000	-	Oct	lastSun	2:00	0	S
+Rule	Mexico	2001	only	-	May	Sun>=1	2:00	1:00	D
+Rule	Mexico	2001	only	-	Sep	lastSun	2:00	0	S
+Rule	Mexico	2002	max	-	Apr	Sun>=1	2:00	1:00	D
+Rule	Mexico	2002	max	-	Oct	lastSun	2:00	0	S
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+# Quintana Roo
+Zone America/Cancun	-5:47:04 -	LMT	1922 Jan  1  0:12:56
+			-6:00	-	CST	1981 Dec 23
+			-5:00	Mexico	E%sT	1998 Aug  2  2:00
+			-6:00	Mexico	C%sT
+# Campeche, Yucatan
+Zone America/Merida	-5:58:28 -	LMT	1922 Jan  1  0:01:32
+			-6:00	-	CST	1981 Dec 23
+			-5:00	-	EST	1982 Dec  2
+			-6:00	Mexico	C%sT
+# Coahuila, Durango, Nuevo Leon, Tamaulipas (near US border)
+Zone America/Matamoros	-6:40:00 -	LMT	1921 Dec 31 23:20:00
+			-6:00	-	CST	1988
+			-6:00	US	C%sT	1989
+			-6:00	Mexico	C%sT	2010
+			-6:00	US	C%sT
+# Coahuila, Durango, Nuevo Leon, Tamaulipas (away from US border)
+Zone America/Monterrey	-6:41:16 -	LMT	1921 Dec 31 23:18:44
+			-6:00	-	CST	1988
+			-6:00	US	C%sT	1989
+			-6:00	Mexico	C%sT
+# Central Mexico
+Zone America/Mexico_City -6:36:36 -	LMT	1922 Jan  1 0:23:24
+			-7:00	-	MST	1927 Jun 10 23:00
+			-6:00	-	CST	1930 Nov 15
+			-7:00	-	MST	1931 May  1 23:00
+			-6:00	-	CST	1931 Oct
+			-7:00	-	MST	1932 Apr  1
+			-6:00	Mexico	C%sT	2001 Sep 30 02:00
+			-6:00	-	CST	2002 Feb 20
+			-6:00	Mexico	C%sT
+# Chihuahua (near US border)
+Zone America/Ojinaga	-6:57:40 -	LMT	1922 Jan 1 0:02:20
+			-7:00	-	MST	1927 Jun 10 23:00
+			-6:00	-	CST	1930 Nov 15
+			-7:00	-	MST	1931 May  1 23:00
+			-6:00	-	CST	1931 Oct
+			-7:00	-	MST	1932 Apr  1
+			-6:00	-	CST	1996
+			-6:00	Mexico	C%sT	1998
+			-6:00	-	CST	1998 Apr Sun>=1 3:00
+			-7:00	Mexico	M%sT	2010
+			-7:00	US	M%sT
+# Chihuahua (away from US border)
+Zone America/Chihuahua	-7:04:20 -	LMT	1921 Dec 31 23:55:40
+			-7:00	-	MST	1927 Jun 10 23:00
+			-6:00	-	CST	1930 Nov 15
+			-7:00	-	MST	1931 May  1 23:00
+			-6:00	-	CST	1931 Oct
+			-7:00	-	MST	1932 Apr  1
+			-6:00	-	CST	1996
+			-6:00	Mexico	C%sT	1998
+			-6:00	-	CST	1998 Apr Sun>=1 3:00
+			-7:00	Mexico	M%sT
+# Sonora
+Zone America/Hermosillo	-7:23:52 -	LMT	1921 Dec 31 23:36:08
+			-7:00	-	MST	1927 Jun 10 23:00
+			-6:00	-	CST	1930 Nov 15
+			-7:00	-	MST	1931 May  1 23:00
+			-6:00	-	CST	1931 Oct
+			-7:00	-	MST	1932 Apr  1
+			-6:00	-	CST	1942 Apr 24
+			-7:00	-	MST	1949 Jan 14
+			-8:00	-	PST	1970
+			-7:00	Mexico	M%sT	1999
+			-7:00	-	MST
+
+# From Alexander Krivenyshev (2010-04-21):
+# According to news, Bah&iacute;a de Banderas (Mexican state of Nayarit)
+# changed time zone UTC-7 to new time zone UTC-6 on April 4, 2010 (to
+# share the same time zone as nearby city Puerto Vallarta, Jalisco).
+#
+# (Spanish)
+# Bah&iacute;a de Banderas homologa su horario al del centro del
+# pa&iacute;s, a partir de este domingo
+# <a href="http://www.nayarit.gob.mx/notes.asp?id=20748">
+# http://www.nayarit.gob.mx/notes.asp?id=20748
+# </a>
+#
+# Bah&iacute;a de Banderas homologa su horario con el del Centro del
+# Pa&iacute;s
+# <a href="http://www.bahiadebanderas.gob.mx/principal/index.php?option=com_content&view=article&id=261:bahia-de-banderas-homologa-su-horario-con-el-del-centro-del-pais&catid=42:comunicacion-social&Itemid=50">
+# http://www.bahiadebanderas.gob.mx/principal/index.php?option=com_content&view=article&id=261:bahia-de-banderas-homologa-su-horario-con-el-del-centro-del-pais&catid=42:comunicacion-social&Itemid=50"
+# </a>
+#
+# (English)
+# Puerto Vallarta and Bah&iacute;a de Banderas: One Time Zone
+# <a href="http://virtualvallarta.com/puertovallarta/puertovallarta/localnews/2009-12-03-Puerto-Vallarta-and-Bahia-de-Banderas-One-Time-Zone.shtml">
+# http://virtualvallarta.com/puertovallarta/puertovallarta/localnews/2009-12-03-Puerto-Vallarta-and-Bahia-de-Banderas-One-Time-Zone.shtml
+# </a>
+#
+# or
+# <a href="http://www.worldtimezone.com/dst_news/dst_news_mexico08.html">
+# http://www.worldtimezone.com/dst_news/dst_news_mexico08.html
+# </a>
+#
+# "Mexico's Senate approved the amendments to the Mexican Schedule System that
+# will allow Bah&iacute;a de Banderas and Puerto Vallarta to share the same time
+# zone ..."
+# Baja California Sur, Nayarit, Sinaloa
+
+# From Arthur David Olson (2010-05-01):
+# Use "Bahia_Banderas" to keep the name to fourteen characters.
+
+Zone America/Mazatlan	-7:05:40 -	LMT	1921 Dec 31 23:54:20
+			-7:00	-	MST	1927 Jun 10 23:00
+			-6:00	-	CST	1930 Nov 15
+			-7:00	-	MST	1931 May  1 23:00
+			-6:00	-	CST	1931 Oct
+			-7:00	-	MST	1932 Apr  1
+			-6:00	-	CST	1942 Apr 24
+			-7:00	-	MST	1949 Jan 14
+			-8:00	-	PST	1970
+			-7:00	Mexico	M%sT
+
+Zone America/Bahia_Banderas	-7:01:00 -	LMT	1921 Dec 31 23:59:00
+			-7:00	-	MST	1927 Jun 10 23:00
+			-6:00	-	CST	1930 Nov 15
+			-7:00	-	MST	1931 May  1 23:00
+			-6:00	-	CST	1931 Oct
+			-7:00	-	MST	1932 Apr  1
+			-6:00	-	CST	1942 Apr 24
+			-7:00	-	MST	1949 Jan 14
+			-8:00	-	PST	1970
+			-7:00	Mexico	M%sT	2010 Apr 4 2:00
+			-6:00	Mexico	C%sT
+
+# Baja California (near US border)
+Zone America/Tijuana	-7:48:04 -	LMT	1922 Jan  1  0:11:56
+			-7:00	-	MST	1924
+			-8:00	-	PST	1927 Jun 10 23:00
+			-7:00	-	MST	1930 Nov 15
+			-8:00	-	PST	1931 Apr  1
+			-8:00	1:00	PDT	1931 Sep 30
+			-8:00	-	PST	1942 Apr 24
+			-8:00	1:00	PWT	1945 Aug 14 23:00u
+			-8:00	1:00	PPT	1945 Nov 12 # Peace
+			-8:00	-	PST	1948 Apr  5
+			-8:00	1:00	PDT	1949 Jan 14
+			-8:00	-	PST	1954
+			-8:00	CA	P%sT	1961
+			-8:00	-	PST	1976
+			-8:00	US	P%sT	1996
+			-8:00	Mexico	P%sT	2001
+			-8:00	US	P%sT	2002 Feb 20
+			-8:00	Mexico	P%sT	2010
+			-8:00	US	P%sT
+# Baja California (away from US border)
+Zone America/Santa_Isabel	-7:39:28 -	LMT	1922 Jan  1  0:20:32
+			-7:00	-	MST	1924
+			-8:00	-	PST	1927 Jun 10 23:00
+			-7:00	-	MST	1930 Nov 15
+			-8:00	-	PST	1931 Apr  1
+			-8:00	1:00	PDT	1931 Sep 30
+			-8:00	-	PST	1942 Apr 24
+			-8:00	1:00	PWT	1945 Aug 14 23:00u
+			-8:00	1:00	PPT	1945 Nov 12 # Peace
+			-8:00	-	PST	1948 Apr  5
+			-8:00	1:00	PDT	1949 Jan 14
+			-8:00	-	PST	1954
+			-8:00	CA	P%sT	1961
+			-8:00	-	PST	1976
+			-8:00	US	P%sT	1996
+			-8:00	Mexico	P%sT	2001
+			-8:00	US	P%sT	2002 Feb 20
+			-8:00	Mexico	P%sT
+# From Paul Eggert (2006-03-22):
+# Formerly there was an America/Ensenada zone, which differed from
+# America/Tijuana only in that it did not observe DST from 1976
+# through 1995.  This was as per Shanks (1999).  But Shanks & Pottenger say
+# Ensenada did not observe DST from 1948 through 1975.  Guy Harris reports
+# that the 1987 OAG says "Only Ensenada, Mexicale, San Felipe and
+# Tijuana observe DST," which agrees with Shanks & Pottenger but implies that
+# DST-observance was a town-by-town matter back then.  This concerns
+# data after 1970 so most likely there should be at least one Zone
+# other than America/Tijuana for Baja, but it's not clear yet what its
+# name or contents should be.
+#
+# Revillagigedo Is
+# no information
+
+###############################################################################
+
+# Anguilla
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone America/Anguilla	-4:12:16 -	LMT	1912 Mar 2
+			-4:00	-	AST
+
+# Antigua and Barbuda
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	America/Antigua	-4:07:12 -	LMT	1912 Mar 2
+			-5:00	-	EST	1951
+			-4:00	-	AST
+
+# Bahamas
+#
+# From Sue Williams (2006-12-07):
+# The Bahamas announced about a month ago that they plan to change their DST
+# rules to sync with the U.S. starting in 2007....
+# http://www.jonesbahamas.com/?c=45&a=10412
+
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Bahamas	1964	1975	-	Oct	lastSun	2:00	0	S
+Rule	Bahamas	1964	1975	-	Apr	lastSun	2:00	1:00	D
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	America/Nassau	-5:09:24 -	LMT	1912 Mar 2
+			-5:00	Bahamas	E%sT	1976
+			-5:00	US	E%sT
+
+# Barbados
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Barb	1977	only	-	Jun	12	2:00	1:00	D
+Rule	Barb	1977	1978	-	Oct	Sun>=1	2:00	0	S
+Rule	Barb	1978	1980	-	Apr	Sun>=15	2:00	1:00	D
+Rule	Barb	1979	only	-	Sep	30	2:00	0	S
+Rule	Barb	1980	only	-	Sep	25	2:00	0	S
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone America/Barbados	-3:58:28 -	LMT	1924		# Bridgetown
+			-3:58:28 -	BMT	1932	  # Bridgetown Mean Time
+			-4:00	Barb	A%sT
+
+# Belize
+# Whitman entirely disagrees with Shanks; go with Shanks & Pottenger.
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Belize	1918	1942	-	Oct	Sun>=2	0:00	0:30	HD
+Rule	Belize	1919	1943	-	Feb	Sun>=9	0:00	0	S
+Rule	Belize	1973	only	-	Dec	 5	0:00	1:00	D
+Rule	Belize	1974	only	-	Feb	 9	0:00	0	S
+Rule	Belize	1982	only	-	Dec	18	0:00	1:00	D
+Rule	Belize	1983	only	-	Feb	12	0:00	0	S
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	America/Belize	-5:52:48 -	LMT	1912 Apr
+			-6:00	Belize	C%sT
+
+# Bermuda
+
+# From Dan Jones, reporting in The Royal Gazette (2006-06-26):
+
+# Next year, however, clocks in the US will go forward on the second Sunday
+# in March, until the first Sunday in November.  And, after the Time Zone
+# (Seasonal Variation) Bill 2006 was passed in the House of Assembly on
+# Friday, the same thing will happen in Bermuda.
+# http://www.theroyalgazette.com/apps/pbcs.dll/article?AID=/20060529/NEWS/105290135
+
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone Atlantic/Bermuda	-4:19:04 -	LMT	1930 Jan  1 2:00    # Hamilton
+			-4:00	-	AST	1974 Apr 28 2:00
+			-4:00	Bahamas	A%sT	1976
+			-4:00	US	A%sT
+
+# Cayman Is
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	America/Cayman	-5:25:32 -	LMT	1890		# Georgetown
+			-5:07:12 -	KMT	1912 Feb    # Kingston Mean Time
+			-5:00	-	EST
+
+# Costa Rica
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	CR	1979	1980	-	Feb	lastSun	0:00	1:00	D
+Rule	CR	1979	1980	-	Jun	Sun>=1	0:00	0	S
+Rule	CR	1991	1992	-	Jan	Sat>=15	0:00	1:00	D
+# IATA SSIM (1991-09) says the following was at 1:00;
+# go with Shanks & Pottenger.
+Rule	CR	1991	only	-	Jul	 1	0:00	0	S
+Rule	CR	1992	only	-	Mar	15	0:00	0	S
+# There are too many San Joses elsewhere, so we'll use `Costa Rica'.
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone America/Costa_Rica	-5:36:20 -	LMT	1890		# San Jose
+			-5:36:20 -	SJMT	1921 Jan 15 # San Jose Mean Time
+			-6:00	CR	C%sT
+# Coco
+# no information; probably like America/Costa_Rica
+
+# Cuba
+
+# From Arthur David Olson (1999-03-29):
+# The 1999-03-28 exhibition baseball game held in Havana, Cuba, between
+# the Cuban National Team and the Baltimore Orioles was carried live on
+# the Orioles Radio Network, including affiliate WTOP in Washington, DC.
+# During the game, play-by-play announcer Jim Hunter noted that
+# "We'll be losing two hours of sleep...Cuba switched to Daylight Saving
+# Time today."  (The "two hour" remark referred to losing one hour of
+# sleep on 1999-03-28--when the announcers were in Cuba as it switched
+# to DST--and one more hour on 1999-04-04--when the announcers will have
+# returned to Baltimore, which switches on that date.)
+
+# From Evert van der Veer via Steffen Thorsen (2004-10-28):
+# Cuba is not going back to standard time this year.
+# From Paul Eggert (2006-03-22):
+# http://www.granma.cu/ingles/2004/septiembre/juev30/41medid-i.html
+# says that it's due to a problem at the Antonio Guiteras
+# thermoelectric plant, and says "This October there will be no return
+# to normal hours (after daylight saving time)".
+# For now, let's assume that it's a temporary measure.
+
+# From Carlos A. Carnero Delgado (2005-11-12):
+# This year (just like in 2004-2005) there's no change in time zone
+# adjustment in Cuba.  We will stay in daylight saving time:
+# http://www.granma.cu/espanol/2005/noviembre/mier9/horario.html
+
+# From Jesper Norgaard Welen (2006-10-21):
+# An article in GRANMA INTERNACIONAL claims that Cuba will end
+# the 3 years of permanent DST next weekend, see
+# http://www.granma.cu/ingles/2006/octubre/lun16/43horario.html
+# "On Saturday night, October 28 going into Sunday, October 29, at 01:00,
+# watches should be set back one hour -- going back to 00:00 hours -- returning
+# to the normal schedule....
+
+# From Paul Eggert (2007-03-02):
+# http://www.granma.cubaweb.cu/english/news/art89.html, dated yesterday,
+# says Cuban clocks will advance at midnight on March 10.
+# For lack of better information, assume Cuba will use US rules,
+# except that it switches at midnight standard time as usual.
+#
+# From Steffen Thorsen (2007-10-25):
+# Carlos Alberto Fonseca Arauz informed me that Cuba will end DST one week 
+# earlier - on the last Sunday of October, just like in 2006.
+# 
+# He supplied these references:
+# 
+# http://www.prensalatina.com.mx/article.asp?ID=%7B4CC32C1B-A9F7-42FB-8A07-8631AFC923AF%7D&language=ES
+# http://actualidad.terra.es/sociedad/articulo/cuba_llama_ahorrar_energia_cambio_1957044.htm
+# 
+# From Alex Kryvenishev (2007-10-25):
+# Here is also article from Granma (Cuba):
+# 
+# [Regira] el Horario Normal desde el [proximo] domingo 28 de octubre
+# http://www.granma.cubaweb.cu/2007/10/24/nacional/artic07.html
+# 
+# http://www.worldtimezone.com/dst_news/dst_news_cuba03.html
+
+# From Arthur David Olson (2008-03-09):
+# I'm in Maryland which is now observing United States Eastern Daylight
+# Time. At 9:44 local time I used RealPlayer to listen to
+# <a href="http://media.enet.cu/radioreloj">
+# http://media.enet.cu/radioreloj
+# </a>, a Cuban information station, and heard
+# the time announced as "ocho cuarenta y cuatro" ("eight forty-four"),
+# indicating that Cuba is still on standard time.
+
+# From Steffen Thorsen (2008-03-12):
+# It seems that Cuba will start DST on Sunday, 2007-03-16...
+# It was announced yesterday, according to this source (in Spanish):
+# <a href="http://www.nnc.cubaweb.cu/marzo-2008/cien-1-11-3-08.htm">
+# http://www.nnc.cubaweb.cu/marzo-2008/cien-1-11-3-08.htm
+# </a>
+#
+# Some more background information is posted here:
+# <a href="http://www.timeanddate.com/news/time/cuba-starts-dst-march-16.html">
+# http://www.timeanddate.com/news/time/cuba-starts-dst-march-16.html
+# </a>
+#
+# The article also says that Cuba has been observing DST since 1963,
+# while Shanks (and tzdata) has 1965 as the first date (except in the
+# 1940's). Many other web pages in Cuba also claim that it has been
+# observed since 1963, but with the exception of 1970 - an exception
+# which is not present in tzdata/Shanks. So there is a chance we need to
+# change some historic records as well.
+#
+# One example:
+# <a href="http://www.radiohc.cu/espanol/noticias/mar07/11mar/hor.htm">
+# http://www.radiohc.cu/espanol/noticias/mar07/11mar/hor.htm
+# </a>
+
+# From Jesper Norgaard Welen (2008-03-13):
+# The Cuban time change has just been confirmed on the most authoritative
+# web site, the Granma.  Please check out
+# <a href="http://www.granma.cubaweb.cu/2008/03/13/nacional/artic10.html">
+# http://www.granma.cubaweb.cu/2008/03/13/nacional/artic10.html
+# </a>
+#
+# Basically as expected after Steffen Thorsens information, the change
+# will take place midnight between Saturday and Sunday.
+
+# From Arthur David Olson (2008-03-12):
+# Assume Sun>=15 (third Sunday) going forward.
+
+# From Alexander Krivenyshev (2009-03-04)
+# According to the Radio Reloj - Cuba will start Daylight Saving Time on
+# midnight between Saturday, March 07, 2009 and Sunday, March 08, 2009-
+# not on midnight March 14 / March 15 as previously thought.
+#
+# <a href="http://www.worldtimezone.com/dst_news/dst_news_cuba05.html">
+# http://www.worldtimezone.com/dst_news/dst_news_cuba05.html
+# (in Spanish)
+# </a>
+
+# From Arthur David Olson (2009-03-09)
+# I listened over the Internet to
+# <a href="http://media.enet.cu/readioreloj">
+# http://media.enet.cu/readioreloj
+# </a>
+# this morning; when it was 10:05 a. m. here in Bethesda, Maryland the
+# the time was announced as "diez cinco"--the same time as here, indicating
+# that has indeed switched to DST. Assume second Sunday from 2009 forward.
+
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Cuba	1928	only	-	Jun	10	0:00	1:00	D
+Rule	Cuba	1928	only	-	Oct	10	0:00	0	S
+Rule	Cuba	1940	1942	-	Jun	Sun>=1	0:00	1:00	D
+Rule	Cuba	1940	1942	-	Sep	Sun>=1	0:00	0	S
+Rule	Cuba	1945	1946	-	Jun	Sun>=1	0:00	1:00	D
+Rule	Cuba	1945	1946	-	Sep	Sun>=1	0:00	0	S
+Rule	Cuba	1965	only	-	Jun	1	0:00	1:00	D
+Rule	Cuba	1965	only	-	Sep	30	0:00	0	S
+Rule	Cuba	1966	only	-	May	29	0:00	1:00	D
+Rule	Cuba	1966	only	-	Oct	2	0:00	0	S
+Rule	Cuba	1967	only	-	Apr	8	0:00	1:00	D
+Rule	Cuba	1967	1968	-	Sep	Sun>=8	0:00	0	S
+Rule	Cuba	1968	only	-	Apr	14	0:00	1:00	D
+Rule	Cuba	1969	1977	-	Apr	lastSun	0:00	1:00	D
+Rule	Cuba	1969	1971	-	Oct	lastSun	0:00	0	S
+Rule	Cuba	1972	1974	-	Oct	8	0:00	0	S
+Rule	Cuba	1975	1977	-	Oct	lastSun	0:00	0	S
+Rule	Cuba	1978	only	-	May	7	0:00	1:00	D
+Rule	Cuba	1978	1990	-	Oct	Sun>=8	0:00	0	S
+Rule	Cuba	1979	1980	-	Mar	Sun>=15	0:00	1:00	D
+Rule	Cuba	1981	1985	-	May	Sun>=5	0:00	1:00	D
+Rule	Cuba	1986	1989	-	Mar	Sun>=14	0:00	1:00	D
+Rule	Cuba	1990	1997	-	Apr	Sun>=1	0:00	1:00	D
+Rule	Cuba	1991	1995	-	Oct	Sun>=8	0:00s	0	S
+Rule	Cuba	1996	only	-	Oct	 6	0:00s	0	S
+Rule	Cuba	1997	only	-	Oct	12	0:00s	0	S
+Rule	Cuba	1998	1999	-	Mar	lastSun	0:00s	1:00	D
+Rule	Cuba	1998	2003	-	Oct	lastSun	0:00s	0	S
+Rule	Cuba	2000	2004	-	Apr	Sun>=1	0:00s	1:00	D
+Rule	Cuba	2006	max	-	Oct	lastSun	0:00s	0	S
+Rule	Cuba	2007	only	-	Mar	Sun>=8	0:00s	1:00	D
+Rule	Cuba	2008	only	-	Mar	Sun>=15	0:00s	1:00	D
+Rule	Cuba	2009	max	-	Mar	Sun>=8	0:00s	1:00	D
+
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	America/Havana	-5:29:28 -	LMT	1890
+			-5:29:36 -	HMT	1925 Jul 19 12:00 # Havana MT
+			-5:00	Cuba	C%sT
+
+# Dominica
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone America/Dominica	-4:05:36 -	LMT	1911 Jul 1 0:01		# Roseau
+			-4:00	-	AST
+
+# Dominican Republic
+
+# From Steffen Thorsen (2000-10-30):
+# Enrique Morales reported to me that the Dominican Republic has changed the
+# time zone to Eastern Standard Time as of Sunday 29 at 2 am....
+# http://www.listin.com.do/antes/261000/republica/princi.html
+
+# From Paul Eggert (2000-12-04):
+# That URL (2000-10-26, in Spanish) says they planned to use US-style DST.
+
+# From Rives McDow (2000-12-01):
+# Dominican Republic changed its mind and presidential decree on Tuesday,
+# November 28, 2000, with a new decree.  On Sunday, December 3 at 1:00 AM the
+# Dominican Republic will be reverting to 8 hours from the International Date
+# Line, and will not be using DST in the foreseeable future.  The reason they
+# decided to use DST was to be in synch with Puerto Rico, who was also going
+# to implement DST.  When Puerto Rico didn't implement DST, the president
+# decided to revert.
+
+
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	DR	1966	only	-	Oct	30	0:00	1:00	D
+Rule	DR	1967	only	-	Feb	28	0:00	0	S
+Rule	DR	1969	1973	-	Oct	lastSun	0:00	0:30	HD
+Rule	DR	1970	only	-	Feb	21	0:00	0	S
+Rule	DR	1971	only	-	Jan	20	0:00	0	S
+Rule	DR	1972	1974	-	Jan	21	0:00	0	S
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone America/Santo_Domingo -4:39:36 -	LMT	1890
+			-4:40	-	SDMT	1933 Apr  1 12:00 # S. Dom. MT
+			-5:00	DR	E%sT	1974 Oct 27
+			-4:00	-	AST	2000 Oct 29 02:00
+			-5:00	US	E%sT	2000 Dec  3 01:00
+			-4:00	-	AST
+
+# El Salvador
+
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Salv	1987	1988	-	May	Sun>=1	0:00	1:00	D
+Rule	Salv	1987	1988	-	Sep	lastSun	0:00	0	S
+# There are too many San Salvadors elsewhere, so use America/El_Salvador
+# instead of America/San_Salvador.
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone America/El_Salvador -5:56:48 -	LMT	1921		# San Salvador
+			-6:00	Salv	C%sT
+
+# Grenada
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	America/Grenada	-4:07:00 -	LMT	1911 Jul	# St George's
+			-4:00	-	AST
+
+# Guadeloupe
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone America/Guadeloupe	-4:06:08 -	LMT	1911 Jun 8	# Pointe a Pitre
+			-4:00	-	AST
+# St Barthelemy
+Link America/Guadeloupe	America/St_Barthelemy
+# St Martin (French part)
+Link America/Guadeloupe	America/Marigot
+
+# Guatemala
+#
+# From Gwillim Law (2006-04-22), after a heads-up from Oscar van Vlijmen:
+# Diario Co Latino, at
+# http://www.diariocolatino.com/internacionales/detalles.asp?NewsID=8079,
+# says in an article dated 2006-04-19 that the Guatemalan government had
+# decided on that date to advance official time by 60 minutes, to lessen the
+# impact of the elevated cost of oil....  Daylight saving time will last from
+# 2006-04-29 24:00 (Guatemalan standard time) to 2006-09-30 (time unspecified).
+# From Paul Eggert (2006-06-22):
+# The Ministry of Energy and Mines, press release CP-15/2006
+# (2006-04-19), says DST ends at 24:00.  See
+# <http://www.sieca.org.gt/Sitio_publico/Energeticos/Doc/Medidas/Cambio_Horario_Nac_190406.pdf>.
+
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Guat	1973	only	-	Nov	25	0:00	1:00	D
+Rule	Guat	1974	only	-	Feb	24	0:00	0	S
+Rule	Guat	1983	only	-	May	21	0:00	1:00	D
+Rule	Guat	1983	only	-	Sep	22	0:00	0	S
+Rule	Guat	1991	only	-	Mar	23	0:00	1:00	D
+Rule	Guat	1991	only	-	Sep	 7	0:00	0	S
+Rule	Guat	2006	only	-	Apr	30	0:00	1:00	D
+Rule	Guat	2006	only	-	Oct	 1	0:00	0	S
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone America/Guatemala	-6:02:04 -	LMT	1918 Oct 5
+			-6:00	Guat	C%sT
+
+# Haiti
+# From Gwillim Law (2005-04-15):
+# Risto O. Nykanen wrote me that Haiti is now on DST.
+# I searched for confirmation, and I found a
+# <a href="http://www.haitianconsulate.org/time.doc"> press release
+# on the Web page of the Haitian Consulate in Chicago (2005-03-31),
+# </a>.  Translated from French, it says:
+#
+#  "The Prime Minister's Communication Office notifies the public in general
+#   and the press in particular that, following a decision of the Interior
+#   Ministry and the Territorial Collectivities [I suppose that means the
+#   provinces], Haiti will move to Eastern Daylight Time in the night from next
+#   Saturday the 2nd to Sunday the 3rd.
+#
+#  "Consequently, the Prime Minister's Communication Office wishes to inform
+#   the population that the country's clocks will be set forward one hour
+#   starting at midnight.  This provision will hold until the last Saturday in
+#   October 2005.
+#
+#  "Port-au-Prince, March 31, 2005"
+#
+# From Steffen Thorsen (2006-04-04):
+# I have been informed by users that Haiti observes DST this year like
+# last year, so the current "only" rule for 2005 might be changed to a
+# "max" rule or to last until 2006. (Who knows if they will observe DST
+# next year or if they will extend their DST like US/Canada next year).
+#
+# I have found this article about it (in French):
+# http://www.haitipressnetwork.com/news.cfm?articleID=7612
+#
+# The reason seems to be an energy crisis.
+
+# From Stephen Colebourne (2007-02-22):
+# Some IATA info: Haiti won't be having DST in 2007.
+
+
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Haiti	1983	only	-	May	8	0:00	1:00	D
+Rule	Haiti	1984	1987	-	Apr	lastSun	0:00	1:00	D
+Rule	Haiti	1983	1987	-	Oct	lastSun	0:00	0	S
+# Shanks & Pottenger say AT is 2:00, but IATA SSIM (1991/1997) says 1:00s.
+# Go with IATA.
+Rule	Haiti	1988	1997	-	Apr	Sun>=1	1:00s	1:00	D
+Rule	Haiti	1988	1997	-	Oct	lastSun	1:00s	0	S
+Rule	Haiti	2005	2006	-	Apr	Sun>=1	0:00	1:00	D
+Rule	Haiti	2005	2006	-	Oct	lastSun	0:00	0	S
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone America/Port-au-Prince -4:49:20 -	LMT	1890
+			-4:49	-	PPMT	1917 Jan 24 12:00 # P-a-P MT
+			-5:00	Haiti	E%sT
+
+# Honduras
+# Shanks & Pottenger say 1921 Jan 1; go with Whitman's more precise Apr 1.
+
+# From Paul Eggert (2006-05-05):
+# worldtimezone.com reports a 2006-05-02 Spanish-language AP article
+# saying Honduras will start using DST midnight Saturday, effective 4
+# months until September.  La Tribuna reported today
+# <http://www.latribuna.hn/99299.html> that Manuel Zelaya, the president
+# of Honduras, refused to back down on this.
+
+# From Jesper Norgaard Welen (2006-08-08):
+# It seems that Honduras has returned from DST to standard time this Monday at
+# 00:00 hours (prolonging Sunday to 25 hours duration).
+# http://www.worldtimezone.com/dst_news/dst_news_honduras04.html
+
+# From Paul Eggert (2006-08-08):
+# Also see Diario El Heraldo, The country returns to standard time (2006-08-08)
+# <http://www.elheraldo.hn/nota.php?nid=54941&sec=12>.
+# It mentions executive decree 18-2006.
+
+# From Steffen Thorsen (2006-08-17):
+# Honduras will observe DST from 2007 to 2009, exact dates are not
+# published, I have located this authoritative source:
+# http://www.presidencia.gob.hn/noticia.aspx?nId=47
+
+# From Steffen Thorsen (2007-03-30):
+# http://www.laprensahn.com/pais_nota.php?id04962=7386
+# So it seems that Honduras will not enter DST this year....
+
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Hond	1987	1988	-	May	Sun>=1	0:00	1:00	D
+Rule	Hond	1987	1988	-	Sep	lastSun	0:00	0	S
+Rule	Hond	2006	only	-	May	Sun>=1	0:00	1:00	D
+Rule	Hond	2006	only	-	Aug	Mon>=1	0:00	0	S
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone America/Tegucigalpa -5:48:52 -	LMT	1921 Apr
+			-6:00	Hond	C%sT
+#
+# Great Swan I ceded by US to Honduras in 1972
+
+# Jamaica
+
+# From Bob Devine (1988-01-28):
+# Follows US rules.
+
+# From U. S. Naval Observatory (1989-01-19):
+# JAMAICA             5 H  BEHIND UTC
+
+# From Shanks & Pottenger:
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	America/Jamaica	-5:07:12 -	LMT	1890		# Kingston
+			-5:07:12 -	KMT	1912 Feb    # Kingston Mean Time
+			-5:00	-	EST	1974 Apr 28 2:00
+			-5:00	US	E%sT	1984
+			-5:00	-	EST
+
+# Martinique
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone America/Martinique	-4:04:20 -      LMT	1890		# Fort-de-France
+			-4:04:20 -	FFMT	1911 May     # Fort-de-France MT
+			-4:00	-	AST	1980 Apr  6
+			-4:00	1:00	ADT	1980 Sep 28
+			-4:00	-	AST
+
+# Montserrat
+# From Paul Eggert (2006-03-22):
+# In 1995 volcanic eruptions forced evacuation of Plymouth, the capital.
+# world.gazetteer.com says Cork Hill is the most populous location now.
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone America/Montserrat	-4:08:52 -	LMT	1911 Jul 1 0:01   # Cork Hill
+			-4:00	-	AST
+
+# Nicaragua
+#
+# This uses Shanks & Pottenger for times before 2005.
+#
+# From Steffen Thorsen (2005-04-12):
+# I've got reports from 8 different people that Nicaragua just started
+# DST on Sunday 2005-04-10, in order to save energy because of
+# expensive petroleum.  The exact end date for DST is not yet
+# announced, only "September" but some sites also say "mid-September".
+# Some background information is available on the President's official site:
+# http://www.presidencia.gob.ni/Presidencia/Files_index/Secretaria/Notas%20de%20Prensa/Presidente/2005/ABRIL/Gobierno-de-nicaragua-adelanta-hora-oficial-06abril.htm
+# The Decree, no 23-2005 is available here:
+# http://www.presidencia.gob.ni/buscador_gaceta/BD/DECRETOS/2005/Decreto%2023-2005%20Se%20adelanta%20en%20una%20hora%20en%20todo%20el%20territorio%20nacional%20apartir%20de%20las%2024horas%20del%2009%20de%20Abril.pdf
+#
+# From Paul Eggert (2005-05-01):
+# The decree doesn't say anything about daylight saving, but for now let's
+# assume that it is daylight saving....
+#
+# From Gwillim Law (2005-04-21):
+# The Associated Press story on the time change, which can be found at
+# http://www.lapalmainteractivo.com/guias/content/gen/ap/America_Latina/AMC_GEN_NICARAGUA_HORA.html
+# and elsewhere, says (fifth paragraph, translated from Spanish):  "The last
+# time that a change of clocks was applied to save energy was in the year 2000
+# during the Arnoldo Aleman administration."...
+# The northamerica file says that Nicaragua has been on UTC-6 continuously
+# since December 1998.  I wasn't able to find any details of Nicaraguan time
+# changes in 2000.  Perhaps a note could be added to the northamerica file, to
+# the effect that we have indirect evidence that DST was observed in 2000.
+#
+# From Jesper Norgaard Welen (2005-11-02):
+# Nicaragua left DST the 2005-10-02 at 00:00 (local time).
+# http://www.presidencia.gob.ni/presidencia/files_index/secretaria/comunicados/2005/septiembre/26septiembre-cambio-hora.htm
+# (2005-09-26)
+#
+# From Jesper Norgaard Welen (2006-05-05):
+# http://www.elnuevodiario.com.ni/2006/05/01/nacionales/18410
+# (my informal translation)
+# By order of the president of the republic, Enrique Bolanos, Nicaragua
+# advanced by sixty minutes their official time, yesterday at 2 in the
+# morning, and will stay that way until 30.th. of september.
+#
+# From Jesper Norgaard Welen (2006-09-30):
+# http://www.presidencia.gob.ni/buscador_gaceta/BD/DECRETOS/2006/D-063-2006P-PRN-Cambio-Hora.pdf
+# My informal translation runs:
+# The natural sun time is restored in all the national territory, in that the
+# time is returned one hour at 01:00 am of October 1 of 2006.
+#
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Nic	1979	1980	-	Mar	Sun>=16	0:00	1:00	D
+Rule	Nic	1979	1980	-	Jun	Mon>=23	0:00	0	S
+Rule	Nic	2005	only	-	Apr	10	0:00	1:00	D
+Rule	Nic	2005	only	-	Oct	Sun>=1	0:00	0	S
+Rule	Nic	2006	only	-	Apr	30	2:00	1:00	D
+Rule	Nic	2006	only	-	Oct	Sun>=1	1:00	0	S
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	America/Managua	-5:45:08 -	LMT	1890
+			-5:45:12 -	MMT	1934 Jun 23 # Managua Mean Time?
+			-6:00	-	CST	1973 May
+			-5:00	-	EST	1975 Feb 16
+			-6:00	Nic	C%sT	1992 Jan  1 4:00
+			-5:00	-	EST	1992 Sep 24
+			-6:00	-	CST	1993
+			-5:00	-	EST	1997
+			-6:00	Nic	C%sT
+
+# Panama
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	America/Panama	-5:18:08 -	LMT	1890
+			-5:19:36 -	CMT	1908 Apr 22   # Colon Mean Time
+			-5:00	-	EST
+
+# Puerto Rico
+# There are too many San Juans elsewhere, so we'll use `Puerto_Rico'.
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone America/Puerto_Rico -4:24:25 -	LMT	1899 Mar 28 12:00    # San Juan
+			-4:00	-	AST	1942 May  3
+			-4:00	US	A%sT	1946
+			-4:00	-	AST
+
+# St Kitts-Nevis
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone America/St_Kitts	-4:10:52 -	LMT	1912 Mar 2	# Basseterre
+			-4:00	-	AST
+
+# St Lucia
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone America/St_Lucia	-4:04:00 -	LMT	1890		# Castries
+			-4:04:00 -	CMT	1912	    # Castries Mean Time
+			-4:00	-	AST
+
+# St Pierre and Miquelon
+# There are too many St Pierres elsewhere, so we'll use `Miquelon'.
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone America/Miquelon	-3:44:40 -	LMT	1911 May 15	# St Pierre
+			-4:00	-	AST	1980 May
+			-3:00	-	PMST	1987 # Pierre & Miquelon Time
+			-3:00	Canada	PM%sT
+
+# St Vincent and the Grenadines
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone America/St_Vincent	-4:04:56 -	LMT	1890		# Kingstown
+			-4:04:56 -	KMT	1912	   # Kingstown Mean Time
+			-4:00	-	AST
+
+# Turks and Caicos
+#
+# From Chris Dunn in
+# <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=415007>
+# (2007-03-15): In the Turks & Caicos Islands (America/Grand_Turk) the
+# daylight saving dates for time changes have been adjusted to match
+# the recent U.S. change of dates.
+#
+# From Brian Inglis (2007-04-28):
+# http://www.turksandcaicos.tc/calendar/index.htm [2007-04-26]
+# there is an entry for Nov 4 "Daylight Savings Time Ends 2007" and three
+# rows before that there is an out of date entry for Oct:
+# "Eastern Standard Times Begins 2007
+# Clocks are set back one hour at 2:00 a.m. local Daylight Saving Time"
+# indicating that the normal ET rules are followed.
+#
+# From Paul Eggert (2006-05-01):
+# Shanks & Pottenger say they use US DST rules, but IATA SSIM (1991/1998)
+# says they switch at midnight.  Go with Shanks & Pottenger.
+#
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	TC	1979	1986	-	Apr	lastSun	2:00	1:00	D
+Rule	TC	1979	2006	-	Oct	lastSun	2:00	0	S
+Rule	TC	1987	2006	-	Apr	Sun>=1	2:00	1:00	D
+Rule	TC	2007	max	-	Mar	Sun>=8	2:00	1:00	D
+Rule	TC	2007	max	-	Nov	Sun>=1	2:00	0	S
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone America/Grand_Turk	-4:44:32 -	LMT	1890
+			-5:07:12 -	KMT	1912 Feb    # Kingston Mean Time
+			-5:00	TC	E%sT
+
+# British Virgin Is
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone America/Tortola	-4:18:28 -	LMT	1911 Jul    # Road Town
+			-4:00	-	AST
+
+# Virgin Is
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone America/St_Thomas	-4:19:44 -	LMT	1911 Jul    # Charlotte Amalie
+			-4:00	-	AST
diff --git a/tools/zoneinfo/tzdata2009s/pacificnew b/tools/zoneinfo/tzdata2010k/pacificnew
similarity index 100%
rename from tools/zoneinfo/tzdata2009s/pacificnew
rename to tools/zoneinfo/tzdata2010k/pacificnew
diff --git a/tools/zoneinfo/tzdata2009s/solar87 b/tools/zoneinfo/tzdata2010k/solar87
similarity index 100%
rename from tools/zoneinfo/tzdata2009s/solar87
rename to tools/zoneinfo/tzdata2010k/solar87
diff --git a/tools/zoneinfo/tzdata2009s/solar88 b/tools/zoneinfo/tzdata2010k/solar88
similarity index 100%
rename from tools/zoneinfo/tzdata2009s/solar88
rename to tools/zoneinfo/tzdata2010k/solar88
diff --git a/tools/zoneinfo/tzdata2009s/solar89 b/tools/zoneinfo/tzdata2010k/solar89
similarity index 100%
rename from tools/zoneinfo/tzdata2009s/solar89
rename to tools/zoneinfo/tzdata2010k/solar89
diff --git a/tools/zoneinfo/tzdata2010k/southamerica b/tools/zoneinfo/tzdata2010k/southamerica
new file mode 100644
index 0000000..7355022
--- /dev/null
+++ b/tools/zoneinfo/tzdata2010k/southamerica
@@ -0,0 +1,1568 @@
+# <pre>
+# @(#)southamerica	8.44
+# This file is in the public domain, so clarified as of
+# 2009-05-17 by Arthur David Olson.
+
+# This data is by no means authoritative; if you think you know better,
+# go ahead and edit the file (and please send any changes to
+# tz@elsie.nci.nih.gov for general use in the future).
+
+# From Paul Eggert (2006-03-22):
+# A good source for time zone historical data outside the U.S. is
+# Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
+# San Diego: ACS Publications, Inc. (2003).
+#
+# Gwillim Law writes that a good source
+# for recent time zone data is the International Air Transport
+# Association's Standard Schedules Information Manual (IATA SSIM),
+# published semiannually.  Law sent in several helpful summaries
+# of the IATA's data after 1990.
+#
+# Except where otherwise noted, Shanks & Pottenger is the source for
+# entries through 1990, and IATA SSIM is the source for entries afterwards.
+#
+# Earlier editions of these tables used the North American style (e.g. ARST and
+# ARDT for Argentine Standard and Daylight Time), but the following quote
+# suggests that it's better to use European style (e.g. ART and ARST).
+#	I suggest the use of _Summer time_ instead of the more cumbersome
+#	_daylight-saving time_.  _Summer time_ seems to be in general use
+#	in Europe and South America.
+#	-- E O Cutler, _New York Times_ (1937-02-14), quoted in
+#	H L Mencken, _The American Language: Supplement I_ (1960), p 466
+#
+# Earlier editions of these tables also used the North American style
+# for time zones in Brazil, but this was incorrect, as Brazilians say
+# "summer time".  Reinaldo Goulart, a Sao Paulo businessman active in
+# the railroad sector, writes (1999-07-06):
+#	The subject of time zones is currently a matter of discussion/debate in
+#	Brazil.  Let's say that "the Brasilia time" is considered the
+#	"official time" because Brasilia is the capital city.
+#	The other three time zones are called "Brasilia time "minus one" or
+#	"plus one" or "plus two".  As far as I know there is no such
+#	name/designation as "Eastern Time" or "Central Time".
+# So I invented the following (English-language) abbreviations for now.
+# Corrections are welcome!
+#		std	dst
+#	-2:00	FNT	FNST	Fernando de Noronha
+#	-3:00	BRT	BRST	Brasilia
+#	-4:00	AMT	AMST	Amazon
+#	-5:00	ACT	ACST	Acre
+
+###############################################################################
+
+###############################################################################
+
+# Argentina
+
+# From Bob Devine (1988-01-28):
+# Argentina: first Sunday in October to first Sunday in April since 1976.
+# Double Summer time from 1969 to 1974.  Switches at midnight.
+
+# From U. S. Naval Observatory (1988-01-199):
+# ARGENTINA           3 H BEHIND   UTC
+
+# From Hernan G. Otero (1995-06-26):
+# I am sending modifications to the Argentine time zone table...
+# AR was chosen because they are the ISO letters that represent Argentina.
+
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Arg	1930	only	-	Dec	 1	0:00	1:00	S
+Rule	Arg	1931	only	-	Apr	 1	0:00	0	-
+Rule	Arg	1931	only	-	Oct	15	0:00	1:00	S
+Rule	Arg	1932	1940	-	Mar	 1	0:00	0	-
+Rule	Arg	1932	1939	-	Nov	 1	0:00	1:00	S
+Rule	Arg	1940	only	-	Jul	 1	0:00	1:00	S
+Rule	Arg	1941	only	-	Jun	15	0:00	0	-
+Rule	Arg	1941	only	-	Oct	15	0:00	1:00	S
+Rule	Arg	1943	only	-	Aug	 1	0:00	0	-
+Rule	Arg	1943	only	-	Oct	15	0:00	1:00	S
+Rule	Arg	1946	only	-	Mar	 1	0:00	0	-
+Rule	Arg	1946	only	-	Oct	 1	0:00	1:00	S
+Rule	Arg	1963	only	-	Oct	 1	0:00	0	-
+Rule	Arg	1963	only	-	Dec	15	0:00	1:00	S
+Rule	Arg	1964	1966	-	Mar	 1	0:00	0	-
+Rule	Arg	1964	1966	-	Oct	15	0:00	1:00	S
+Rule	Arg	1967	only	-	Apr	 2	0:00	0	-
+Rule	Arg	1967	1968	-	Oct	Sun>=1	0:00	1:00	S
+Rule	Arg	1968	1969	-	Apr	Sun>=1	0:00	0	-
+Rule	Arg	1974	only	-	Jan	23	0:00	1:00	S
+Rule	Arg	1974	only	-	May	 1	0:00	0	-
+Rule	Arg	1988	only	-	Dec	 1	0:00	1:00	S
+#
+# From Hernan G. Otero (1995-06-26):
+# These corrections were contributed by InterSoft Argentina S.A.,
+# obtaining the data from the:
+# Talleres de Hidrografia Naval Argentina
+# (Argentine Naval Hydrography Institute)
+Rule	Arg	1989	1993	-	Mar	Sun>=1	0:00	0	-
+Rule	Arg	1989	1992	-	Oct	Sun>=15	0:00	1:00	S
+#
+# From Hernan G. Otero (1995-06-26):
+# From this moment on, the law that mandated the daylight saving
+# time corrections was derogated and no more modifications
+# to the time zones (for daylight saving) are now made.
+#
+# From Rives McDow (2000-01-10):
+# On October 3, 1999, 0:00 local, Argentina implemented daylight savings time,
+# which did not result in the switch of a time zone, as they stayed 9 hours
+# from the International Date Line.
+Rule	Arg	1999	only	-	Oct	Sun>=1	0:00	1:00	S
+# From Paul Eggert (2007-12-28):
+# DST was set to expire on March 5, not March 3, but since it was converted
+# to standard time on March 3 it's more convenient for us to pretend that
+# it ended on March 3.
+Rule	Arg	2000	only	-	Mar	3	0:00	0	-
+#
+# From Peter Gradelski via Steffen Thorsen (2000-03-01):
+# We just checked with our Sao Paulo office and they say the government of
+# Argentina decided not to become one of the countries that go on or off DST.
+# So Buenos Aires should be -3 hours from GMT at all times.
+#
+# From Fabian L. Arce Jofre (2000-04-04):
+# The law that claimed DST for Argentina was derogated by President Fernando
+# de la Rua on March 2, 2000, because it would make people spend more energy
+# in the winter time, rather than less.  The change took effect on March 3.
+#
+# From Mariano Absatz (2001-06-06):
+# one of the major newspapers here in Argentina said that the 1999
+# Timezone Law (which never was effectively applied) will (would?) be
+# in effect.... The article is at
+# http://ar.clarin.com/diario/2001-06-06/e-01701.htm
+# ... The Law itself is "Ley No 25155", sanctioned on 1999-08-25, enacted
+# 1999-09-17, and published 1999-09-21.  The official publication is at:
+# http://www.boletin.jus.gov.ar/BON/Primera/1999/09-Septiembre/21/PDF/BO21-09-99LEG.PDF
+# Regretfully, you have to subscribe (and pay) for the on-line version....
+#
+# (2001-06-12):
+# the timezone for Argentina will not change next Sunday.
+# Apparently it will do so on Sunday 24th....
+# http://ar.clarin.com/diario/2001-06-12/s-03501.htm
+#
+# (2001-06-25):
+# Last Friday (yes, the last working day before the date of the change), the
+# Senate annulled the 1999 law that introduced the changes later postponed.
+# http://www.clarin.com.ar/diario/2001-06-22/s-03601.htm
+# It remains the vote of the Deputies..., but it will be the same....
+# This kind of things had always been done this way in Argentina.
+# We are still -03:00 all year round in all of the country.
+#
+# From Steffen Thorsen (2007-12-21):
+# A user (Leonardo Chaim) reported that Argentina will adopt DST....
+# all of the country (all Zone-entries) are affected.  News reports like
+# http://www.lanacion.com.ar/opinion/nota.asp?nota_id=973037 indicate
+# that Argentina will use DST next year as well, from October to
+# March, although exact rules are not given.
+#
+# From Jesper Norgaard Welen (2007-12-26)
+# The last hurdle of Argentina DST is over, the proposal was approved in
+# the lower chamber too (Deputados) with a vote 192 for and 2 against.
+# By the way thanks to Mariano Absatz and Daniel Mario Vega for the link to
+# the original scanned proposal, where the dates and the zero hours are
+# clear and unambiguous...This is the article about final approval:
+# <a href="http://www.lanacion.com.ar/politica/nota.asp?nota_id=973996">
+# http://www.lanacion.com.ar/politica/nota.asp?nota_id=973996
+# </a>
+#
+# From Paul Eggert (2007-12-22):
+# For dates after mid-2008, the following rules are my guesses and
+# are quite possibly wrong, but are more likely than no DST at all.
+
+# From Alexander Krivenyshev (2008-09-05):
+# As per message from Carlos Alberto Fonseca Arauz (Nicaragua),
+# Argentina will start DST on Sunday October 19, 2008.
+#
+# <a href="http://www.worldtimezone.com/dst_news/dst_news_argentina03.html">
+# http://www.worldtimezone.com/dst_news/dst_news_argentina03.html
+# </a>
+# OR
+# <a href="http://www.impulsobaires.com.ar/nota.php?id=57832 (in spanish)">
+# http://www.impulsobaires.com.ar/nota.php?id=57832 (in spanish)
+# </a>
+
+# From Rodrigo Severo (2008-10-06):
+# Here is some info available at a Gentoo bug related to TZ on Argentina's DST:
+# ...
+# ------- Comment #1 from [jmdocile]  2008-10-06 16:28 0000 -------
+# Hi, there is a problem with timezone-data-2008e and maybe with
+# timezone-data-2008f
+# Argentinian law [Number] 25.155 is no longer valid.
+# <a href="http://www.infoleg.gov.ar/infolegInternet/anexos/60000-64999/60036/norma.htm">
+# http://www.infoleg.gov.ar/infolegInternet/anexos/60000-64999/60036/norma.htm
+# </a>
+# The new one is law [Number] 26.350
+# <a href="http://www.infoleg.gov.ar/infolegInternet/anexos/135000-139999/136191/norma.htm">
+# http://www.infoleg.gov.ar/infolegInternet/anexos/135000-139999/136191/norma.htm
+# </a>
+# So there is no summer time in Argentina for now.
+
+# From Mariano Absatz (2008-10-20):
+# Decree 1693/2008 applies Law 26.350 for the summer 2008/2009 establishing DST in Argentina
+# From 2008-10-19 until 2009-03-15
+# <a href="http://www.boletinoficial.gov.ar/Bora.Portal/CustomControls/PdfContent.aspx?fp=16102008&pi=3&pf=4&s=0&sec=01">
+# http://www.boletinoficial.gov.ar/Bora.Portal/CustomControls/PdfContent.aspx?fp=16102008&pi=3&pf=4&s=0&sec=01
+# </a>
+#
+# Decree 1705/2008 excepting 12 Provinces from applying DST in the summer 2008/2009:
+# Catamarca, La Rioja, Mendoza, Salta, San Juan, San Luis, La Pampa, Neuquen, Rio Negro, Chubut, Santa Cruz
+# and Tierra del Fuego
+# <a href="http://www.boletinoficial.gov.ar/Bora.Portal/CustomControls/PdfContent.aspx?fp=17102008&pi=1&pf=1&s=0&sec=01">
+# http://www.boletinoficial.gov.ar/Bora.Portal/CustomControls/PdfContent.aspx?fp=17102008&pi=1&pf=1&s=0&sec=01
+# </a>
+#
+# Press release 235 dated Saturday October 18th, from the Government of the Province of Jujuy saying
+# it will not apply DST either (even when it was not included in Decree 1705/2008)
+# <a href="http://www.jujuy.gov.ar/index2/partes_prensa/18_10_08/235-181008.doc">
+# http://www.jujuy.gov.ar/index2/partes_prensa/18_10_08/235-181008.doc
+# </a>
+
+# From fullinet (2009-10-18):
+# As announced in
+# <a hef="http://www.argentina.gob.ar/argentina/portal/paginas.dhtml?pagina=356">
+# http://www.argentina.gob.ar/argentina/portal/paginas.dhtml?pagina=356
+# </a>
+# (an official .gob.ar) under title: "Sin Cambio de Hora" (english: "No hour change")
+#
+# "Por el momento, el Gobierno Nacional resolvio no modificar la hora
+# oficial, decision que estaba en estudio para su implementacion el
+# domingo 18 de octubre. Desde el Ministerio de Planificacion se anuncio
+# que la Argentina hoy, en estas condiciones meteorologicas, no necesita
+# la modificacion del huso horario, ya que 2009 nos encuentra con
+# crecimiento en la produccion y distribucion energetica."
+
+Rule	Arg	2007	only	-	Dec	30	0:00	1:00	S
+Rule	Arg	2008	2009	-	Mar	Sun>=15	0:00	0	-
+Rule	Arg	2008	only	-	Oct	Sun>=15	0:00	1:00	S
+ 
+# From Mariano Absatz (2004-05-21):
+# Today it was officially published that the Province of Mendoza is changing
+# its timezone this winter... starting tomorrow night....
+# http://www.gobernac.mendoza.gov.ar/boletin/pdf/20040521-27158-normas.pdf
+# From Paul Eggert (2004-05-24):
+# It's Law No. 7,210.  This change is due to a public power emergency, so for
+# now we'll assume it's for this year only.
+#
+# From Paul Eggert (2006-03-22):
+# <a href="http://www.spicasc.net/horvera.html">
+# Hora de verano para la Republica Argentina (2003-06-08)
+# </a> says that standard time in Argentina from 1894-10-31
+# to 1920-05-01 was -4:16:48.25.  Go with this more-precise value
+# over Shanks & Pottenger.
+#
+# From Mariano Absatz (2004-06-05):
+# These media articles from a major newspaper mostly cover the current state:
+# http://www.lanacion.com.ar/04/05/27/de_604825.asp
+# http://www.lanacion.com.ar/04/05/28/de_605203.asp
+#
+# The following eight (8) provinces pulled clocks back to UTC-04:00 at
+# midnight Monday May 31st. (that is, the night between 05/31 and 06/01).
+# Apparently, all nine provinces would go back to UTC-03:00 at the same
+# time in October 17th.
+#
+# Catamarca, Chubut, La Rioja, San Juan, San Luis, Santa Cruz,
+# Tierra del Fuego, Tucuman.
+#
+# From Mariano Absatz (2004-06-14):
+# ... this weekend, the Province of Tucuman decided it'd go back to UTC-03:00
+# yesterday midnight (that is, at 24:00 Saturday 12th), since the people's
+# annoyance with the change is much higher than the power savings obtained....
+#
+# From Gwillim Law (2004-06-14):
+# http://www.lanacion.com.ar/04/06/10/de_609078.asp ...
+#     "The time change in Tierra del Fuego was a conflicted decision from
+#   the start.  The government had decreed that the measure would take
+#   effect on June 1, but a normative error forced the new time to begin
+#   three days earlier, from a Saturday to a Sunday....
+# Our understanding was that the change was originally scheduled to take place
+# on June 1 at 00:00 in Chubut, Santa Cruz, Tierra del Fuego (and some other
+# provinces).  Sunday was May 30, only two days earlier.  So the article
+# contains a contradiction.  I would give more credence to the Saturday/Sunday
+# date than the "three days earlier" phrase, and conclude that Tierra del
+# Fuego set its clocks back at 2004-05-30 00:00.
+#
+# From Steffen Thorsen (2004-10-05):
+# The previous law 7210 which changed the province of Mendoza's time zone
+# back in May have been modified slightly in a new law 7277, which set the
+# new end date to 2004-09-26 (original date was 2004-10-17).
+# http://www.gobernac.mendoza.gov.ar/boletin/pdf/20040924-27244-normas.pdf
+#
+# From Mariano Absatz (2004-10-05):
+# San Juan changed from UTC-03:00 to UTC-04:00 at midnight between
+# Sunday, May 30th and Monday, May 31st.  It changed back to UTC-03:00
+# at midnight between Saturday, July 24th and Sunday, July 25th....
+# http://www.sanjuan.gov.ar/prensa/archivo/000329.html
+# http://www.sanjuan.gov.ar/prensa/archivo/000426.html
+# http://www.sanjuan.gov.ar/prensa/archivo/000441.html
+
+# From Alex Krivenyshev (2008-01-17):
+# Here are articles that Argentina Province San Luis is planning to end DST
+# as earlier as upcoming Monday January 21, 2008 or February 2008:
+#
+# Provincia argentina retrasa reloj y marca diferencia con resto del pais
+# (Argentine Province delayed clock and mark difference with the rest of the
+# country)
+# <a href="http://cl.invertia.com/noticias/noticia.aspx?idNoticia=200801171849_EFE_ET4373&idtel">
+# http://cl.invertia.com/noticias/noticia.aspx?idNoticia=200801171849_EFE_ET4373&idtel
+# </a>
+#
+# Es inminente que en San Luis atrasen una hora los relojes
+# (It is imminent in San Luis clocks one hour delay)
+# <a href="http://www.lagaceta.com.ar/vernotae.asp?id_nota=253414">
+# http://www.lagaceta.com.ar/vernotae.asp?id_nota=253414
+# </a>
+#
+# <a href="http://www.worldtimezone.net/dst_news/dst_news_argentina02.html">
+# http://www.worldtimezone.net/dst_news/dst_news_argentina02.html
+# </a>
+
+# From Jesper Norgaard Welen (2008-01-18):
+# The page of the San Luis provincial government
+# <a href="http://www.sanluis.gov.ar/notas.asp?idCanal=0&id=22812">
+# http://www.sanluis.gov.ar/notas.asp?idCanal=0&id=22812
+# </a>
+# confirms what Alex Krivenyshev has earlier sent to the tz
+# emailing list about that San Luis plans to return to standard
+# time much earlier than the rest of the country. It also
+# confirms that upon request the provinces San Juan and Mendoza 
+# refused to follow San Luis in this change. 
+# 
+# The change is supposed to take place Monday the 21.st at 0:00
+# hours. As far as I understand it if this goes ahead, we need
+# a new timezone for San Luis (although there are also documented
+# independent changes in the southamerica file of San Luis in
+# 1990 and 1991 which has not been confirmed).
+
+# From Jesper Norgaard Welen (2008-01-25):
+# Unfortunately the below page has become defunct, about the San Luis
+# time change. Perhaps because it now is part of a group of pages "Most
+# important pages of 2008."
+#
+# You can use
+# <a href="http://www.sanluis.gov.ar/notas.asp?idCanal=8141&id=22834">
+# http://www.sanluis.gov.ar/notas.asp?idCanal=8141&id=22834
+# </a>
+# instead it seems. Or use "Buscador" from the main page of the San Luis
+# government, and fill in "huso" and click OK, and you will get 3 pages
+# from which the first one is identical to the above.
+
+# From Mariano Absatz (2008-01-28):
+# I can confirm that the Province of San Luis (and so far only that
+# province) decided to go back to UTC-3 effective midnight Jan 20th 2008
+# (that is, Monday 21st at 0:00 is the time the clocks were delayed back
+# 1 hour), and they intend to keep UTC-3 as their timezone all year round
+# (that is, unless they change their mind any minute now).
+#
+# So we'll have to add yet another city to 'southamerica' (I think San
+# Luis city is the mos populated city in the Province, so it'd be
+# America/Argentina/San_Luis... of course I can't remember if San Luis's
+# history of particular changes goes along with Mendoza or San Juan :-(
+# (I only remember not being able to collect hard facts about San Luis
+# back in 2004, when these provinces changed to UTC-4 for a few days, I
+# mailed them personally and never got an answer).
+
+# From Paul Eggert (2008-06-30):
+# Unless otherwise specified, data are from Shanks & Pottenger through 1992,
+# from the IATA otherwise.  As noted below, Shanks & Pottenger say that
+# America/Cordoba split into 6 subregions during 1991/1992, one of which
+# was America/San_Luis, but we haven't verified this yet so for now we'll
+# keep America/Cordoba a single region rather than splitting it into the
+# other 5 subregions.
+
+# From Mariano Absatz (2009-03-13):
+# Yesterday (with our usual 2-day notice) the Province of San Luis
+# decided that next Sunday instead of "staying" @utc-03:00 they will go
+# to utc-04:00 until the second Saturday in October...
+#
+# The press release is at
+# <a href="http://www.sanluis.gov.ar/SL/Paginas/NoticiaDetalle.asp?TemaId=1&InfoPrensaId=3102">
+# http://www.sanluis.gov.ar/SL/Paginas/NoticiaDetalle.asp?TemaId=1&InfoPrensaId=3102
+# </a>
+# (I couldn't find the decree, but
+# <a href="http://www.sanluis.gov.ar">
+# www.sanluis.gov.ar
+# <a/>
+# is the official page for the Province Government).
+#
+# There's also a note in only one of the major national papers (La Nación) at
+# <a href="http://www.lanacion.com.ar/nota.asp?nota_id=1107912">
+# http://www.lanacion.com.ar/nota.asp?nota_id=1107912
+# </a>
+# 
+# The press release says:
+#  (...) anunció que el próximo domingo a las 00:00 los puntanos deberán
+# atrasar una hora sus relojes.
+#
+# A partir de entonces, San Luis establecerá el huso horario propio de
+# la Provincia. De esta manera, durante el periodo del calendario anual
+# 2009, el cambio horario quedará comprendido entre las 00:00 del tercer
+# domingo de marzo y las 24:00 del segundo sábado de octubre.
+# Quick&dirty translation
+# (...) announced that next Sunday, at 00:00, Puntanos (the San Luis
+# inhabitants) will have to turn back one hour their clocks
+#
+# Since then, San Luis will establish its own Province timezone. Thus,
+# during 2009, this timezone change will run from 00:00 the third Sunday
+# in March until 24:00 of the second Saturday in October.
+
+# From Mariano Absatz (2009-10-16):
+# ...the Province of San Luis is a case in itself.
+#
+# The Law at
+# <a href="http://www.diputadossanluis.gov.ar/diputadosasp/paginas/verNorma.asp?NormaID=276>"
+# http://www.diputadossanluis.gov.ar/diputadosasp/paginas/verNorma.asp?NormaID=276
+# </a>
+# is ambiguous because establishes a calendar from the 2nd Sunday in
+# October at 0:00 thru the 2nd Saturday in March at 24:00 and the
+# complement of that starting on the 2nd Sunday of March at 0:00 and
+# ending on the 2nd Saturday of March at 24:00.
+#
+# This clearly breaks every time the 1st of March or October is a Sunday.
+#
+# IMHO, the "spirit of the Law" is to make the changes at 0:00 on the 2nd
+# Sunday of October and March.
+#
+# The problem is that the changes in the rest of the Provinces that did
+# change in 2007/2008, were made according to the Federal Law and Decrees
+# that did so on the 3rd Sunday of October and March.
+#
+# In fact, San Luis actually switched from UTC-4 to UTC-3 last Sunday
+# (October 11th) at 0:00.
+#
+# So I guess a new set of rules, besides "Arg", must be made and the last
+# America/Argentina/San_Luis entries should change to use these...
+#
+# I'm enclosing a patch that does what I say... regretfully, the San Luis
+# timezone must be called "WART/WARST" even when most of the time (like,
+# right now) WARST == ART... that is, since last Sunday, all the country
+# is using UTC-3, but in my patch, San Luis calls it "WARST" and the rest
+# of the country calls it "ART".
+# ...
+
+# From Alexander Krivenyshev (2010-04-09):
+# According to news reports from El Diario de la Republica Province San
+# Luis, Argentina (standard time UTC-04) will keep Daylight Saving Time
+# after April 11, 2010--will continue to have same time as rest of
+# Argentina (UTC-3) (no DST).
+#
+# Confirmaron la pr&oacute;rroga del huso horario de verano (Spanish)
+# <a href="http://www.eldiariodelarepublica.com/index.php?option=com_content&task=view&id=29383&Itemid=9">
+# http://www.eldiariodelarepublica.com/index.php?option=com_content&task=view&id=29383&Itemid=9
+# </a>
+# or (some English translation):
+# <a href="http://www.worldtimezone.com/dst_news/dst_news_argentina08.html">
+# http://www.worldtimezone.com/dst_news/dst_news_argentina08.html
+# </a>
+
+# From Mariano Absatz (2010-04-12):
+# yes...I can confirm this...and given that San Luis keeps calling
+# UTC-03:00 "summer time", we should't just let San Luis go back to "Arg"
+# rules...San Luis is still using "Western ARgentina Time" and it got
+# stuck on Summer daylight savings time even though the summer is over.
+
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+#
+# Buenos Aires (BA), Capital Federal (CF),
+Zone America/Argentina/Buenos_Aires -3:53:48 - LMT 1894 Oct 31
+			-4:16:48 -	CMT	1920 May # Cordoba Mean Time
+			-4:00	-	ART	1930 Dec
+			-4:00	Arg	AR%sT	1969 Oct  5
+			-3:00	Arg	AR%sT	1999 Oct  3
+			-4:00	Arg	AR%sT	2000 Mar  3
+			-3:00	Arg	AR%sT
+#
+# Cordoba (CB), Santa Fe (SF), Entre Rios (ER), Corrientes (CN), Misiones (MN),
+# Chaco (CC), Formosa (FM), Santiago del Estero (SE)
+#
+# Shanks & Pottenger also make the following claims, which we haven't verified:
+# - Formosa switched to -3:00 on 1991-01-07.
+# - Misiones switched to -3:00 on 1990-12-29.
+# - Chaco switched to -3:00 on 1991-01-04.
+# - Santiago del Estero switched to -4:00 on 1991-04-01,
+#   then to -3:00 on 1991-04-26.
+#
+Zone America/Argentina/Cordoba -4:16:48 - LMT	1894 Oct 31
+			-4:16:48 -	CMT	1920 May
+			-4:00	-	ART	1930 Dec
+			-4:00	Arg	AR%sT	1969 Oct  5
+			-3:00	Arg	AR%sT	1991 Mar  3
+			-4:00	-	WART	1991 Oct 20
+			-3:00	Arg	AR%sT	1999 Oct  3
+			-4:00	Arg	AR%sT	2000 Mar  3
+			-3:00	Arg	AR%sT
+#
+# Salta (SA), La Pampa (LP), Neuquen (NQ), Rio Negro (RN)
+Zone America/Argentina/Salta -4:21:40 - LMT	1894 Oct 31
+			-4:16:48 -	CMT	1920 May
+			-4:00	-	ART	1930 Dec
+			-4:00	Arg	AR%sT	1969 Oct  5
+			-3:00	Arg	AR%sT	1991 Mar  3
+			-4:00	-	WART	1991 Oct 20
+			-3:00	Arg	AR%sT	1999 Oct  3
+			-4:00	Arg	AR%sT	2000 Mar  3
+			-3:00	Arg	AR%sT	2008 Oct 18
+			-3:00	-	ART
+#
+# Tucuman (TM)
+Zone America/Argentina/Tucuman -4:20:52 - LMT	1894 Oct 31
+			-4:16:48 -	CMT	1920 May
+			-4:00	-	ART	1930 Dec
+			-4:00	Arg	AR%sT	1969 Oct  5
+			-3:00	Arg	AR%sT	1991 Mar  3
+			-4:00	-	WART	1991 Oct 20
+			-3:00	Arg	AR%sT	1999 Oct  3
+			-4:00	Arg	AR%sT	2000 Mar  3
+			-3:00	-	ART	2004 Jun  1
+			-4:00	-	WART	2004 Jun 13
+			-3:00	Arg	AR%sT
+#
+# La Rioja (LR)
+Zone America/Argentina/La_Rioja -4:27:24 - LMT	1894 Oct 31
+			-4:16:48 -	CMT	1920 May
+			-4:00	-	ART	1930 Dec
+			-4:00	Arg	AR%sT	1969 Oct  5
+			-3:00	Arg	AR%sT	1991 Mar  1
+			-4:00	-	WART	1991 May  7
+			-3:00	Arg	AR%sT	1999 Oct  3
+			-4:00	Arg	AR%sT	2000 Mar  3
+			-3:00	-	ART	2004 Jun  1
+			-4:00	-	WART	2004 Jun 20
+			-3:00	Arg	AR%sT	2008 Oct 18
+			-3:00	-	ART
+#
+# San Juan (SJ)
+Zone America/Argentina/San_Juan -4:34:04 - LMT	1894 Oct 31
+			-4:16:48 -	CMT	1920 May
+			-4:00	-	ART	1930 Dec
+			-4:00	Arg	AR%sT	1969 Oct  5
+			-3:00	Arg	AR%sT	1991 Mar  1
+			-4:00	-	WART	1991 May  7
+			-3:00	Arg	AR%sT	1999 Oct  3
+			-4:00	Arg	AR%sT	2000 Mar  3
+			-3:00	-	ART	2004 May 31
+			-4:00	-	WART	2004 Jul 25
+			-3:00	Arg	AR%sT	2008 Oct 18
+			-3:00	-	ART
+#
+# Jujuy (JY)
+Zone America/Argentina/Jujuy -4:21:12 -	LMT	1894 Oct 31
+			-4:16:48 -	CMT	1920 May
+			-4:00	-	ART	1930 Dec
+			-4:00	Arg	AR%sT	1969 Oct  5
+			-3:00	Arg	AR%sT	1990 Mar  4
+			-4:00	-	WART	1990 Oct 28
+			-4:00	1:00	WARST	1991 Mar 17
+			-4:00	-	WART	1991 Oct  6
+			-3:00	1:00	ARST	1992
+			-3:00	Arg	AR%sT	1999 Oct  3
+			-4:00	Arg	AR%sT	2000 Mar  3
+			-3:00	Arg	AR%sT	2008 Oct 18
+			-3:00	-	ART
+#
+# Catamarca (CT), Chubut (CH)
+Zone America/Argentina/Catamarca -4:23:08 - LMT	1894 Oct 31
+			-4:16:48 -	CMT	1920 May
+			-4:00	-	ART	1930 Dec
+			-4:00	Arg	AR%sT	1969 Oct  5
+			-3:00	Arg	AR%sT	1991 Mar  3
+			-4:00	-	WART	1991 Oct 20
+			-3:00	Arg	AR%sT	1999 Oct  3
+			-4:00	Arg	AR%sT	2000 Mar  3
+			-3:00	-	ART	2004 Jun  1
+			-4:00	-	WART	2004 Jun 20
+			-3:00	Arg	AR%sT	2008 Oct 18
+			-3:00	-	ART
+#
+# Mendoza (MZ)
+Zone America/Argentina/Mendoza -4:35:16 - LMT	1894 Oct 31
+			-4:16:48 -	CMT	1920 May
+			-4:00	-	ART	1930 Dec
+			-4:00	Arg	AR%sT	1969 Oct  5
+			-3:00	Arg	AR%sT	1990 Mar  4
+			-4:00	-	WART	1990 Oct 15
+			-4:00	1:00	WARST	1991 Mar  1
+			-4:00	-	WART	1991 Oct 15
+			-4:00	1:00	WARST	1992 Mar  1
+			-4:00	-	WART	1992 Oct 18
+			-3:00	Arg	AR%sT	1999 Oct  3
+			-4:00	Arg	AR%sT	2000 Mar  3
+			-3:00	-	ART	2004 May 23
+			-4:00	-	WART	2004 Sep 26
+			-3:00	Arg	AR%sT	2008 Oct 18
+			-3:00	-	ART
+#
+# San Luis (SL)
+
+Rule	SanLuis	2008	2009	-	Mar	Sun>=8	0:00	0	-
+Rule	SanLuis	2007	2009	-	Oct	Sun>=8	0:00	1:00	S
+
+Zone America/Argentina/San_Luis -4:25:24 - LMT	1894 Oct 31
+			-4:16:48 -	CMT	1920 May
+			-4:00	-	ART	1930 Dec
+			-4:00	Arg	AR%sT	1969 Oct  5
+			-3:00	Arg	AR%sT	1990
+			-3:00	1:00	ARST	1990 Mar 14
+			-4:00	-	WART	1990 Oct 15
+			-4:00	1:00	WARST	1991 Mar  1
+			-4:00	-	WART	1991 Jun  1
+			-3:00	-	ART	1999 Oct  3
+			-4:00	1:00	WARST	2000 Mar  3
+			-3:00	-	ART	2004 May 31
+			-4:00	-	WART	2004 Jul 25
+			-3:00	Arg	AR%sT	2008 Jan 21
+			-4:00	SanLuis	WAR%sT
+#
+# Santa Cruz (SC)
+Zone America/Argentina/Rio_Gallegos -4:36:52 - LMT 1894 Oct 31
+			-4:16:48 -	CMT	1920 May # Cordoba Mean Time
+			-4:00	-	ART	1930 Dec
+			-4:00	Arg	AR%sT	1969 Oct  5
+			-3:00	Arg	AR%sT	1999 Oct  3
+			-4:00	Arg	AR%sT	2000 Mar  3
+			-3:00	-	ART	2004 Jun  1
+			-4:00	-	WART	2004 Jun 20
+			-3:00	Arg	AR%sT	2008 Oct 18
+			-3:00	-	ART
+#
+# Tierra del Fuego, Antartida e Islas del Atlantico Sur (TF)
+Zone America/Argentina/Ushuaia -4:33:12 - LMT 1894 Oct 31
+			-4:16:48 -	CMT	1920 May # Cordoba Mean Time
+			-4:00	-	ART	1930 Dec
+			-4:00	Arg	AR%sT	1969 Oct  5
+			-3:00	Arg	AR%sT	1999 Oct  3
+			-4:00	Arg	AR%sT	2000 Mar  3
+			-3:00	-	ART	2004 May 30
+			-4:00	-	WART	2004 Jun 20
+			-3:00	Arg	AR%sT	2008 Oct 18
+			-3:00	-	ART
+
+# Aruba
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	America/Aruba	-4:40:24 -	LMT	1912 Feb 12	# Oranjestad
+			-4:30	-	ANT	1965 # Netherlands Antilles Time
+			-4:00	-	AST
+
+# Bolivia
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	America/La_Paz	-4:32:36 -	LMT	1890
+			-4:32:36 -	CMT	1931 Oct 15 # Calamarca MT
+			-4:32:36 1:00	BOST	1932 Mar 21 # Bolivia ST
+			-4:00	-	BOT	# Bolivia Time
+
+# Brazil
+
+# From Paul Eggert (1993-11-18):
+# The mayor of Rio recently attempted to change the time zone rules
+# just in his city, in order to leave more summer time for the tourist trade.
+# The rule change lasted only part of the day;
+# the federal government refused to follow the city's rules, and business
+# was in a chaos, so the mayor backed down that afternoon.
+
+# From IATA SSIM (1996-02):
+# _Only_ the following states in BR1 observe DST: Rio Grande do Sul (RS),
+# Santa Catarina (SC), Parana (PR), Sao Paulo (SP), Rio de Janeiro (RJ),
+# Espirito Santo (ES), Minas Gerais (MG), Bahia (BA), Goias (GO),
+# Distrito Federal (DF), Tocantins (TO), Sergipe [SE] and Alagoas [AL].
+# [The last three states are new to this issue of the IATA SSIM.]
+
+# From Gwillim Law (1996-10-07):
+# Geography, history (Tocantins was part of Goias until 1989), and other
+# sources of time zone information lead me to believe that AL, SE, and TO were
+# always in BR1, and so the only change was whether or not they observed DST....
+# The earliest issue of the SSIM I have is 2/91.  Each issue from then until
+# 9/95 says that DST is observed only in the ten states I quoted from 9/95,
+# along with Mato Grosso (MT) and Mato Grosso do Sul (MS), which are in BR2
+# (UTC-4)....  The other two time zones given for Brazil are BR3, which is
+# UTC-5, no DST, and applies only in the state of Acre (AC); and BR4, which is
+# UTC-2, and applies to Fernando de Noronha (formerly FN, but I believe it's
+# become part of the state of Pernambuco).  The boundary between BR1 and BR2
+# has never been clearly stated.  They've simply been called East and West.
+# However, some conclusions can be drawn from another IATA manual: the Airline
+# Coding Directory, which lists close to 400 airports in Brazil.  For each
+# airport it gives a time zone which is coded to the SSIM.  From that
+# information, I'm led to conclude that the states of Amapa (AP), Ceara (CE),
+# Maranhao (MA), Paraiba (PR), Pernambuco (PE), Piaui (PI), and Rio Grande do
+# Norte (RN), and the eastern part of Para (PA) are all in BR1 without DST.
+
+# From Marcos Tadeu (1998-09-27):
+# <a href="http://pcdsh01.on.br/verao1.html">
+# Brazilian official page
+# </a>
+
+# From Jesper Norgaard (2000-11-03):
+# [For an official list of which regions in Brazil use which time zones, see:]
+# http://pcdsh01.on.br/Fusbr.htm
+# http://pcdsh01.on.br/Fusbrhv.htm
+
+# From Celso Doria via David Madeo (2002-10-09):
+# The reason for the delay this year has to do with elections in Brazil.
+#
+# Unlike in the United States, elections in Brazil are 100% computerized and
+# the results are known almost immediately.  Yesterday, it was the first
+# round of the elections when 115 million Brazilians voted for President,
+# Governor, Senators, Federal Deputies, and State Deputies.  Nobody is
+# counting (or re-counting) votes anymore and we know there will be a second
+# round for the Presidency and also for some Governors.  The 2nd round will
+# take place on October 27th.
+#
+# The reason why the DST will only begin November 3rd is that the thousands
+# of electoral machines used cannot have their time changed, and since the
+# Constitution says the elections must begin at 8:00 AM and end at 5:00 PM,
+# the Government decided to postpone DST, instead of changing the Constitution
+# (maybe, for the next elections, it will be possible to change the clock)...
+
+# From Rodrigo Severo (2004-10-04):
+# It's just the biannual change made necessary by the much hyped, supposedly
+# modern Brazilian eletronic voting machines which, apparently, can't deal
+# with a time change between the first and the second rounds of the elections.
+
+# From Steffen Thorsen (2007-09-20):
+# Brazil will start DST on 2007-10-14 00:00 and end on 2008-02-17 00:00:
+# http://www.mme.gov.br/site/news/detail.do;jsessionid=BBA06811AFCAAC28F0285210913513DA?newsId=13975
+
+# From Paul Schulze (2008-06-24):
+# ...by law number 11.662 of April 24, 2008 (published in the "Diario
+# Oficial da Uniao"...) in Brazil there are changes in the timezones,
+# effective today (00:00am at June 24, 2008) as follows:
+#
+# a) The timezone UTC+5 is e[x]tinguished, with all the Acre state and the
+# part of the Amazonas state that had this timezone now being put to the
+# timezone UTC+4
+# b) The whole Para state now is put at timezone UTC+3, instead of just
+# part of it, as was before.
+#
+# This change follows a proposal of senator Tiao Viana of Acre state, that
+# proposed it due to concerns about open television channels displaying
+# programs inappropriate to youths in the states that had the timezone
+# UTC+5 too early in the night. In the occasion, some more corrections
+# were proposed, trying to unify the timezones of any given state. This
+# change modifies timezone rules defined in decree 2.784 of 18 June,
+# 1913.
+
+# From Rodrigo Severo (2008-06-24):
+# Just correcting the URL:
+# <a href="https://www.in.gov.br/imprensa/visualiza/index.jsp?jornal=do&secao=1&pagina=1&data=25/04/2008">
+# https://www.in.gov.br/imprensa/visualiza/index.jsp?jornal=do&secao=1&pagina=1&data=25/04/2008
+# </a>
+#
+# As a result of the above Decree I believe the America/Rio_Branco
+# timezone shall be modified from UTC-5 to UTC-4 and a new timezone shall
+# be created to represent the the west side of the Para State. I
+# suggest this new timezone be called Santarem as the most
+# important/populated city in the affected area.
+#
+# This new timezone would be the same as the Rio_Branco timezone up to
+# the 2008/06/24 change which would be to UTC-3 instead of UTC-4.
+
+# From Alex Krivenyshev (2008-06-24):
+# This is a quick reference page for New and Old Brazil Time Zones map.
+# <a href="http://www.worldtimezone.com/brazil-time-new-old.php">
+# http://www.worldtimezone.com/brazil-time-new-old.php
+# </a>
+#
+# - 4 time zones replaced by 3 time zones-eliminating time zone UTC- 05
+# (state Acre and the part of the Amazonas will be UTC/GMT- 04) - western
+# part of Par state is moving to one timezone UTC- 03 (from UTC -04).
+
+# From Paul Eggert (2002-10-10):
+# The official decrees referenced below are mostly taken from
+# <a href="http://pcdsh01.on.br/DecHV.html">
+# Decretos sobre o Horario de Verao no Brasil
+# </a>.
+
+# From Steffen Thorsen (2008-08-29):
+# As announced by the government and many newspapers in Brazil late
+# yesterday, Brazil will start DST on 2008-10-19 (need to change rule) and
+# it will end on 2009-02-15 (current rule for Brazil is fine). Based on
+# past years experience with the elections, there was a good chance that
+# the start was postponed to November, but it did not happen this year.
+#
+# It has not yet been posted to http://pcdsh01.on.br/DecHV.html
+#
+# An official page about it:
+# <a href="http://www.mme.gov.br/site/news/detail.do?newsId=16722">
+# http://www.mme.gov.br/site/news/detail.do?newsId=16722
+# </a>
+# Note that this link does not always work directly, but must be accessed
+# by going to
+# <a href="http://www.mme.gov.br/first">
+# http://www.mme.gov.br/first
+# </a>
+#
+# One example link that works directly:
+# <a href="http://jornale.com.br/index.php?option=com_content&task=view&id=13530&Itemid=54">
+# http://jornale.com.br/index.php?option=com_content&task=view&id=13530&Itemid=54
+# (Portuguese)
+# </a>
+#
+# We have a written a short article about it as well:
+# <a href="http://www.timeanddate.com/news/time/brazil-dst-2008-2009.html">
+# http://www.timeanddate.com/news/time/brazil-dst-2008-2009.html
+# </a>
+
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+# Decree <a href="http://pcdsh01.on.br/HV20466.htm">20,466</a> (1931-10-01)
+# Decree <a href="http://pcdsh01.on.br/HV21896.htm">21,896</a> (1932-01-10)
+Rule	Brazil	1931	only	-	Oct	 3	11:00	1:00	S
+Rule	Brazil	1932	1933	-	Apr	 1	 0:00	0	-
+Rule	Brazil	1932	only	-	Oct	 3	 0:00	1:00	S
+# Decree <a href="http://pcdsh01.on.br/HV23195.htm">23,195</a> (1933-10-10)
+# revoked DST.
+# Decree <a href="http://pcdsh01.on.br/HV27496.htm">27,496</a> (1949-11-24)
+# Decree <a href="http://pcdsh01.on.br/HV27998.htm">27,998</a> (1950-04-13)
+Rule	Brazil	1949	1952	-	Dec	 1	 0:00	1:00	S
+Rule	Brazil	1950	only	-	Apr	16	 1:00	0	-
+Rule	Brazil	1951	1952	-	Apr	 1	 0:00	0	-
+# Decree <a href="http://pcdsh01.on.br/HV32308.htm">32,308</a> (1953-02-24)
+Rule	Brazil	1953	only	-	Mar	 1	 0:00	0	-
+# Decree <a href="http://pcdsh01.on.br/HV34724.htm">34,724</a> (1953-11-30)
+# revoked DST.
+# Decree <a href="http://pcdsh01.on.br/HV52700.htm">52,700</a> (1963-10-18)
+# established DST from 1963-10-23 00:00 to 1964-02-29 00:00
+# in SP, RJ, GB, MG, ES, due to the prolongation of the drought.
+# Decree <a href="http://pcdsh01.on.br/HV53071.htm">53,071</a> (1963-12-03)
+# extended the above decree to all of the national territory on 12-09.
+Rule	Brazil	1963	only	-	Dec	 9	 0:00	1:00	S
+# Decree <a href="http://pcdsh01.on.br/HV53604.htm">53,604</a> (1964-02-25)
+# extended summer time by one day to 1964-03-01 00:00 (start of school).
+Rule	Brazil	1964	only	-	Mar	 1	 0:00	0	-
+# Decree <a href="http://pcdsh01.on.br/HV55639.htm">55,639</a> (1965-01-27)
+Rule	Brazil	1965	only	-	Jan	31	 0:00	1:00	S
+Rule	Brazil	1965	only	-	Mar	31	 0:00	0	-
+# Decree <a href="http://pcdsh01.on.br/HV57303.htm">57,303</a> (1965-11-22)
+Rule	Brazil	1965	only	-	Dec	 1	 0:00	1:00	S
+# Decree <a href="http://pcdsh01.on.br/HV57843.htm">57,843</a> (1966-02-18)
+Rule	Brazil	1966	1968	-	Mar	 1	 0:00	0	-
+Rule	Brazil	1966	1967	-	Nov	 1	 0:00	1:00	S
+# Decree <a href="http://pcdsh01.on.br/HV63429.htm">63,429</a> (1968-10-15)
+# revoked DST.
+# Decree <a href="http://pcdsh01.on.br/HV91698.htm">91,698</a> (1985-09-27)
+Rule	Brazil	1985	only	-	Nov	 2	 0:00	1:00	S
+# Decree 92,310 (1986-01-21)
+# Decree 92,463 (1986-03-13)
+Rule	Brazil	1986	only	-	Mar	15	 0:00	0	-
+# Decree 93,316 (1986-10-01)
+Rule	Brazil	1986	only	-	Oct	25	 0:00	1:00	S
+Rule	Brazil	1987	only	-	Feb	14	 0:00	0	-
+# Decree <a href="http://pcdsh01.on.br/HV94922.htm">94,922</a> (1987-09-22)
+Rule	Brazil	1987	only	-	Oct	25	 0:00	1:00	S
+Rule	Brazil	1988	only	-	Feb	 7	 0:00	0	-
+# Decree <a href="http://pcdsh01.on.br/HV96676.htm">96,676</a> (1988-09-12)
+# except for the states of AC, AM, PA, RR, RO, and AP (then a territory)
+Rule	Brazil	1988	only	-	Oct	16	 0:00	1:00	S
+Rule	Brazil	1989	only	-	Jan	29	 0:00	0	-
+# Decree <a href="http://pcdsh01.on.br/HV98077.htm">98,077</a> (1989-08-21)
+# with the same exceptions
+Rule	Brazil	1989	only	-	Oct	15	 0:00	1:00	S
+Rule	Brazil	1990	only	-	Feb	11	 0:00	0	-
+# Decree <a href="http://pcdsh01.on.br/HV99530.htm">99,530</a> (1990-09-17)
+# adopted by RS, SC, PR, SP, RJ, ES, MG, GO, MS, DF.
+# Decree 99,629 (1990-10-19) adds BA, MT.
+Rule	Brazil	1990	only	-	Oct	21	 0:00	1:00	S
+Rule	Brazil	1991	only	-	Feb	17	 0:00	0	-
+# <a href="http://pcdsh01.on.br/HV1991.htm">Unnumbered decree</a> (1991-09-25)
+# adopted by RS, SC, PR, SP, RJ, ES, MG, BA, GO, MT, MS, DF.
+Rule	Brazil	1991	only	-	Oct	20	 0:00	1:00	S
+Rule	Brazil	1992	only	-	Feb	 9	 0:00	0	-
+# <a href="http://pcdsh01.on.br/HV1992.htm">Unnumbered decree</a> (1992-10-16)
+# adopted by same states.
+Rule	Brazil	1992	only	-	Oct	25	 0:00	1:00	S
+Rule	Brazil	1993	only	-	Jan	31	 0:00	0	-
+# Decree <a href="http://pcdsh01.on.br/HV942.htm">942</a> (1993-09-28)
+# adopted by same states, plus AM.
+# Decree <a href="http://pcdsh01.on.br/HV1252.htm">1,252</a> (1994-09-22;
+# web page corrected 2004-01-07) adopted by same states, minus AM.
+# Decree <a href="http://pcdsh01.on.br/HV1636.htm">1,636</a> (1995-09-14)
+# adopted by same states, plus MT and TO.
+# Decree <a href="http://pcdsh01.on.br/HV1674.htm">1,674</a> (1995-10-13)
+# adds AL, SE.
+Rule	Brazil	1993	1995	-	Oct	Sun>=11	 0:00	1:00	S
+Rule	Brazil	1994	1995	-	Feb	Sun>=15	 0:00	0	-
+Rule	Brazil	1996	only	-	Feb	11	 0:00	0	-
+# Decree <a href="http://pcdsh01.on.br/HV2000.htm">2,000</a> (1996-09-04)
+# adopted by same states, minus AL, SE.
+Rule	Brazil	1996	only	-	Oct	 6	 0:00	1:00	S
+Rule	Brazil	1997	only	-	Feb	16	 0:00	0	-
+# From Daniel C. Sobral (1998-02-12):
+# In 1997, the DS began on October 6. The stated reason was that
+# because international television networks ignored Brazil's policy on DS,
+# they bought the wrong times on satellite for coverage of Pope's visit.
+# This year, the ending date of DS was postponed to March 1
+# to help dealing with the shortages of electric power.
+#
+# Decree 2,317 (1997-09-04), adopted by same states.
+Rule	Brazil	1997	only	-	Oct	 6	 0:00	1:00	S
+# Decree <a href="http://pcdsh01.on.br/figuras/HV2495.JPG">2,495</a>
+# (1998-02-10)
+Rule	Brazil	1998	only	-	Mar	 1	 0:00	0	-
+# Decree <a href="http://pcdsh01.on.br/figuras/Hv98.jpg">2,780</a> (1998-09-11)
+# adopted by the same states as before.
+Rule	Brazil	1998	only	-	Oct	11	 0:00	1:00	S
+Rule	Brazil	1999	only	-	Feb	21	 0:00	0	-
+# Decree <a href="http://pcdsh01.on.br/figuras/HV3150.gif">3,150</a>
+# (1999-08-23) adopted by same states.
+# Decree <a href="http://pcdsh01.on.br/DecHV99.gif">3,188</a> (1999-09-30)
+# adds SE, AL, PB, PE, RN, CE, PI, MA and RR.
+Rule	Brazil	1999	only	-	Oct	 3	 0:00	1:00	S
+Rule	Brazil	2000	only	-	Feb	27	 0:00	0	-
+# Decree <a href="http://pcdsh01.on.br/DEC3592.htm">3,592</a> (2000-09-06)
+# adopted by the same states as before.
+# Decree <a href="http://pcdsh01.on.br/Dec3630.jpg">3,630</a> (2000-10-13)
+# repeals DST in PE and RR, effective 2000-10-15 00:00.
+# Decree <a href="http://pcdsh01.on.br/Dec3632.jpg">3,632</a> (2000-10-17)
+# repeals DST in SE, AL, PB, RN, CE, PI and MA, effective 2000-10-22 00:00.
+# Decree <a href="http://pcdsh01.on.br/figuras/HV3916.gif">3,916</a>
+# (2001-09-13) reestablishes DST in AL, CE, MA, PB, PE, PI, RN, SE.
+Rule	Brazil	2000	2001	-	Oct	Sun>=8	 0:00	1:00	S
+Rule	Brazil	2001	2006	-	Feb	Sun>=15	 0:00	0	-
+# Decree 4,399 (2002-10-01) repeals DST in AL, CE, MA, PB, PE, PI, RN, SE.
+# <a href="http://www.presidencia.gov.br/CCIVIL/decreto/2002/D4399.htm">4,399</a>
+Rule	Brazil	2002	only	-	Nov	 3	 0:00	1:00	S
+# Decree 4,844 (2003-09-24; corrected 2003-09-26) repeals DST in BA, MT, TO.
+# <a href="http://www.presidencia.gov.br/CCIVIL/decreto/2003/D4844.htm">4,844</a>
+Rule	Brazil	2003	only	-	Oct	19	 0:00	1:00	S
+# Decree 5,223 (2004-10-01) reestablishes DST in MT.
+# <a href="http://www.planalto.gov.br/ccivil_03/_Ato2004-2006/2004/Decreto/D5223.htm">5,223</a>
+Rule	Brazil	2004	only	-	Nov	 2	 0:00	1:00	S
+# Decree <a href="http://pcdsh01.on.br/DecHV5539.gif">5,539</a> (2005-09-19),
+# adopted by the same states as before.
+Rule	Brazil	2005	only	-	Oct	16	 0:00	1:00	S
+# Decree <a href="http://pcdsh01.on.br/DecHV5920.gif">5,920</a> (2006-10-03),
+# adopted by the same states as before.
+Rule	Brazil	2006	only	-	Nov	 5	 0:00	1:00	S
+Rule	Brazil	2007	only	-	Feb	25	 0:00	0	-
+# Decree <a href="http://pcdsh01.on.br/DecHV6212.gif">6,212</a> (2007-09-26),
+# adopted by the same states as before.
+Rule	Brazil	2007	only	-	Oct	Sun>=8	 0:00	1:00	S
+# From Frederico A. C. Neves (2008-09-10):
+# Acording to this decree
+# <a href="http://www.planalto.gov.br/ccivil_03/_Ato2007-2010/2008/Decreto/D6558.htm">
+# http://www.planalto.gov.br/ccivil_03/_Ato2007-2010/2008/Decreto/D6558.htm
+# </a>
+# [t]he DST period in Brazil now on will be from the 3rd Oct Sunday to the
+# 3rd Feb Sunday. There is an exception on the return date when this is
+# the Carnival Sunday then the return date will be the next Sunday...
+Rule	Brazil	2008	max	-	Oct	Sun>=15	0:00	1:00	S
+Rule	Brazil	2008	2011	-	Feb	Sun>=15	0:00	0	-
+Rule	Brazil	2012	only	-	Feb	Sun>=22	0:00	0	-
+Rule	Brazil	2013	2014	-	Feb	Sun>=15	0:00	0	-
+Rule	Brazil	2015	only	-	Feb	Sun>=22	0:00	0	-
+Rule	Brazil	2016	2022	-	Feb	Sun>=15	0:00	0	-
+Rule	Brazil	2023	only	-	Feb	Sun>=22	0:00	0	-
+Rule	Brazil	2024	2025	-	Feb	Sun>=15	0:00	0	-
+Rule	Brazil	2026	only	-	Feb	Sun>=22	0:00	0	-
+Rule	Brazil	2027	2033	-	Feb	Sun>=15	0:00	0	-
+Rule	Brazil	2034	only	-	Feb	Sun>=22	0:00	0	-
+Rule	Brazil	2035	2036	-	Feb	Sun>=15	0:00	0	-
+Rule	Brazil	2037	only	-	Feb	Sun>=22	0:00	0	-
+# From Arthur David Olson (2008-09-29):
+# The next is wrong in some years but is better than nothing.
+Rule	Brazil	2038	max	-	Feb	Sun>=15	0:00	0	-
+
+# The latest ruleset listed above says that the following states observe DST:
+# DF, ES, GO, MG, MS, MT, PR, RJ, RS, SC, SP.
+
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+#
+# Fernando de Noronha (administratively part of PE)
+Zone America/Noronha	-2:09:40 -	LMT	1914
+			-2:00	Brazil	FN%sT	1990 Sep 17
+			-2:00	-	FNT	1999 Sep 30
+			-2:00	Brazil	FN%sT	2000 Oct 15
+			-2:00	-	FNT	2001 Sep 13
+			-2:00	Brazil	FN%sT	2002 Oct  1
+			-2:00	-	FNT
+# Other Atlantic islands have no permanent settlement.
+# These include Trindade and Martin Vaz (administratively part of ES),
+# Atol das Rocas (RN), and Penedos de Sao Pedro e Sao Paulo (PE).
+# Fernando de Noronha was a separate territory from 1942-09-02 to 1989-01-01;
+# it also included the Penedos.
+#
+# Amapa (AP), east Para (PA)
+# East Para includes Belem, Maraba, Serra Norte, and Sao Felix do Xingu.
+# The division between east and west Para is the river Xingu.
+# In the north a very small part from the river Javary (now Jari I guess,
+# the border with Amapa) to the Amazon, then to the Xingu.
+Zone America/Belem	-3:13:56 -	LMT	1914
+			-3:00	Brazil	BR%sT	1988 Sep 12
+			-3:00	-	BRT
+#
+# west Para (PA)
+# West Para includes Altamira, Oribidos, Prainha, Oriximina, and Santarem.
+Zone America/Santarem	-3:38:48 -	LMT	1914
+			-4:00	Brazil	AM%sT	1988 Sep 12
+			-4:00	-	AMT	2008 Jun 24 00:00
+			-3:00	-	BRT
+#
+# Maranhao (MA), Piaui (PI), Ceara (CE), Rio Grande do Norte (RN),
+# Paraiba (PB)
+Zone America/Fortaleza	-2:34:00 -	LMT	1914
+			-3:00	Brazil	BR%sT	1990 Sep 17
+			-3:00	-	BRT	1999 Sep 30
+			-3:00	Brazil	BR%sT	2000 Oct 22
+			-3:00	-	BRT	2001 Sep 13
+			-3:00	Brazil	BR%sT	2002 Oct  1
+			-3:00	-	BRT
+#
+# Pernambuco (PE) (except Atlantic islands)
+Zone America/Recife	-2:19:36 -	LMT	1914
+			-3:00	Brazil	BR%sT	1990 Sep 17
+			-3:00	-	BRT	1999 Sep 30
+			-3:00	Brazil	BR%sT	2000 Oct 15
+			-3:00	-	BRT	2001 Sep 13
+			-3:00	Brazil	BR%sT	2002 Oct  1
+			-3:00	-	BRT
+#
+# Tocantins (TO)
+Zone America/Araguaina	-3:12:48 -	LMT	1914
+			-3:00	Brazil	BR%sT	1990 Sep 17
+			-3:00	-	BRT	1995 Sep 14
+			-3:00	Brazil	BR%sT	2003 Sep 24
+			-3:00	-	BRT
+#
+# Alagoas (AL), Sergipe (SE)
+Zone America/Maceio	-2:22:52 -	LMT	1914
+			-3:00	Brazil	BR%sT	1990 Sep 17
+			-3:00	-	BRT	1995 Oct 13
+			-3:00	Brazil	BR%sT	1996 Sep  4
+			-3:00	-	BRT	1999 Sep 30
+			-3:00	Brazil	BR%sT	2000 Oct 22
+			-3:00	-	BRT	2001 Sep 13
+			-3:00	Brazil	BR%sT	2002 Oct  1
+			-3:00	-	BRT
+#
+# Bahia (BA)
+# There are too many Salvadors elsewhere, so use America/Bahia instead
+# of America/Salvador.
+Zone America/Bahia	-2:34:04 -	LMT	1914
+			-3:00	Brazil	BR%sT	2003 Sep 24
+			-3:00	-	BRT
+#
+# Goias (GO), Distrito Federal (DF), Minas Gerais (MG),
+# Espirito Santo (ES), Rio de Janeiro (RJ), Sao Paulo (SP), Parana (PR),
+# Santa Catarina (SC), Rio Grande do Sul (RS)
+Zone America/Sao_Paulo	-3:06:28 -	LMT	1914
+			-3:00	Brazil	BR%sT	1963 Oct 23 00:00
+			-3:00	1:00	BRST	1964
+			-3:00	Brazil	BR%sT
+#
+# Mato Grosso do Sul (MS)
+Zone America/Campo_Grande -3:38:28 -	LMT	1914
+			-4:00	Brazil	AM%sT
+#
+# Mato Grosso (MT)
+Zone America/Cuiaba	-3:44:20 -	LMT	1914
+			-4:00	Brazil	AM%sT	2003 Sep 24
+			-4:00	-	AMT	2004 Oct  1
+			-4:00	Brazil	AM%sT
+#
+# Rondonia (RO)
+Zone America/Porto_Velho -4:15:36 -	LMT	1914
+			-4:00	Brazil	AM%sT	1988 Sep 12
+			-4:00	-	AMT
+#
+# Roraima (RR)
+Zone America/Boa_Vista	-4:02:40 -	LMT	1914
+			-4:00	Brazil	AM%sT	1988 Sep 12
+			-4:00	-	AMT	1999 Sep 30
+			-4:00	Brazil	AM%sT	2000 Oct 15
+			-4:00	-	AMT
+#
+# east Amazonas (AM): Boca do Acre, Jutai, Manaus, Floriano Peixoto
+# The great circle line from Tabatinga to Porto Acre divides
+# east from west Amazonas.
+Zone America/Manaus	-4:00:04 -	LMT	1914
+			-4:00	Brazil	AM%sT	1988 Sep 12
+			-4:00	-	AMT	1993 Sep 28
+			-4:00	Brazil	AM%sT	1994 Sep 22
+			-4:00	-	AMT
+#
+# west Amazonas (AM): Atalaia do Norte, Boca do Maoco, Benjamin Constant,
+#	Eirunepe, Envira, Ipixuna
+Zone America/Eirunepe	-4:39:28 -	LMT	1914
+			-5:00	Brazil	AC%sT	1988 Sep 12
+			-5:00	-	ACT	1993 Sep 28
+			-5:00	Brazil	AC%sT	1994 Sep 22
+			-5:00	-	ACT	2008 Jun 24 00:00
+			-4:00	-	AMT
+#
+# Acre (AC)
+Zone America/Rio_Branco	-4:31:12 -	LMT	1914
+			-5:00	Brazil	AC%sT	1988 Sep 12
+			-5:00	-	ACT	2008 Jun 24 00:00
+			-4:00	-	AMT
+
+# Chile
+
+# From Eduardo Krell (1995-10-19):
+# The law says to switch to DST at midnight [24:00] on the second SATURDAY
+# of October....  The law is the same for March and October.
+# (1998-09-29):
+# Because of the drought this year, the government decided to go into
+# DST earlier (saturday 9/26 at 24:00). This is a one-time change only ...
+# (unless there's another dry season next year, I guess).
+
+# From Julio I. Pacheco Troncoso (1999-03-18):
+# Because of the same drought, the government decided to end DST later,
+# on April 3, (one-time change).
+
+# From Oscar van Vlijmen (2006-10-08):
+# http://www.horaoficial.cl/cambio.htm
+
+# From Jesper Norgaard Welen (2006-10-08):
+# I think that there are some obvious mistakes in the suggested link
+# from Oscar van Vlijmen,... for instance entry 66 says that GMT-4
+# ended 1990-09-12 while entry 67 only begins GMT-3 at 1990-09-15
+# (they should have been 1990-09-15 and 1990-09-16 respectively), but
+# anyhow it clears up some doubts too.
+
+# From Paul Eggert (2006-12-27):
+# The following data for Chile and America/Santiago are from
+# <http://www.horaoficial.cl/horaof.htm> (2006-09-20), transcribed by
+# Jesper Norgaard Welen.  The data for Pacific/Easter are from Shanks
+# & Pottenger, except with DST transitions after 1932 cloned from
+# America/Santiago.  The pre-1980 Pacific/Easter data are dubious,
+# but we have no other source.
+
+# From German Poo-Caaman~o (2008-03-03):
+# Due to drought, Chile extends Daylight Time in three weeks.  This
+# is one-time change (Saturday 3/29 at 24:00 for America/Santiago
+# and Saturday 3/29 at 22:00 for Pacific/Easter)
+# The Supreme Decree is located at 
+# <a href="http://www.shoa.cl/servicios/supremo316.pdf">
+# http://www.shoa.cl/servicios/supremo316.pdf
+# </a>
+# and the instructions for 2008 are located in:
+# <a href="http://www.horaoficial.cl/cambio.htm">
+# http://www.horaoficial.cl/cambio.htm
+# </a>.
+
+# From Jose Miguel Garrido (2008-03-05):
+# ...
+# You could see the announces of the change on 
+# <a href="http://www.shoa.cl/noticias/2008/04hora/hora.htm">
+# http://www.shoa.cl/noticias/2008/04hora/hora.htm
+# </a>.
+
+# From Angel Chiang (2010-03-04):
+# Subject: DST in Chile exceptionally extended to 3 April due to earthquake
+# <a href="http://www.gobiernodechile.cl/viewNoticia.aspx?idArticulo=30098">
+# http://www.gobiernodechile.cl/viewNoticia.aspx?idArticulo=30098
+# </a>
+# (in Spanish, last paragraph).
+#
+# This is breaking news. There should be more information available later.
+
+# From Arthur Daivd Olson (2010-03-06):
+# Angel Chiang's message confirmed by Julio Pacheco; Julio provided a patch.
+
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Chile	1927	1932	-	Sep	 1	0:00	1:00	S
+Rule	Chile	1928	1932	-	Apr	 1	0:00	0	-
+Rule	Chile	1942	only	-	Jun	 1	4:00u	0	-
+Rule	Chile	1942	only	-	Aug	 1	5:00u	1:00	S
+Rule	Chile	1946	only	-	Jul	15	4:00u	1:00	S
+Rule	Chile	1946	only	-	Sep	 1	3:00u	0:00	-
+Rule	Chile	1947	only	-	Apr	 1	4:00u	0	-
+Rule	Chile	1968	only	-	Nov	 3	4:00u	1:00	S
+Rule	Chile	1969	only	-	Mar	30	3:00u	0	-
+Rule	Chile	1969	only	-	Nov	23	4:00u	1:00	S
+Rule	Chile	1970	only	-	Mar	29	3:00u	0	-
+Rule	Chile	1971	only	-	Mar	14	3:00u	0	-
+Rule	Chile	1970	1972	-	Oct	Sun>=9	4:00u	1:00	S
+Rule	Chile	1972	1986	-	Mar	Sun>=9	3:00u	0	-
+Rule	Chile	1973	only	-	Sep	30	4:00u	1:00	S
+Rule	Chile	1974	1987	-	Oct	Sun>=9	4:00u	1:00	S
+Rule	Chile	1987	only	-	Apr	12	3:00u	0	-
+Rule	Chile	1988	1989	-	Mar	Sun>=9	3:00u	0	-
+Rule	Chile	1988	only	-	Oct	Sun>=1	4:00u	1:00	S
+Rule	Chile	1989	only	-	Oct	Sun>=9	4:00u	1:00	S
+Rule	Chile	1990	only	-	Mar	18	3:00u	0	-
+Rule	Chile	1990	only	-	Sep	16	4:00u	1:00	S
+Rule	Chile	1991	1996	-	Mar	Sun>=9	3:00u	0	-
+Rule	Chile	1991	1997	-	Oct	Sun>=9	4:00u	1:00	S
+Rule	Chile	1997	only	-	Mar	30	3:00u	0	-
+Rule	Chile	1998	only	-	Mar	Sun>=9	3:00u	0	-
+Rule	Chile	1998	only	-	Sep	27	4:00u	1:00	S
+Rule	Chile	1999	only	-	Apr	 4	3:00u	0	-
+Rule	Chile	1999	max	-	Oct	Sun>=9	4:00u	1:00	S
+Rule	Chile	2000	2007	-	Mar	Sun>=9	3:00u	0	-
+# N.B.: the end of March 29 in Chile is March 30 in Universal time,
+# which is used below in specifying the transition.
+Rule	Chile	2008	only	-	Mar	30	3:00u	0	-
+Rule	Chile	2009	only	-	Mar	Sun>=9	3:00u	0	-
+Rule	Chile	2010	only	-	Apr	 4	3:00u	0	-
+Rule	Chile	2011	max	-	Mar	Sun>=9	3:00u	0	-
+# IATA SSIM anomalies: (1992-02) says 1992-03-14;
+# (1996-09) says 1998-03-08.  Ignore these.
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone America/Santiago	-4:42:46 -	LMT	1890
+			-4:42:46 -	SMT	1910 	    # Santiago Mean Time
+			-5:00	-	CLT	1916 Jul  1 # Chile Time
+			-4:42:46 -	SMT	1918 Sep  1 # Santiago Mean Time
+			-4:00	-	CLT	1919 Jul  1 # Chile Time
+			-4:42:46 -	SMT	1927 Sep  1 # Santiago Mean Time
+			-5:00	Chile	CL%sT	1947 May 22 # Chile Time
+			-4:00	Chile	CL%sT
+Zone Pacific/Easter	-7:17:44 -	LMT	1890
+			-7:17:28 -	EMT	1932 Sep    # Easter Mean Time
+			-7:00	Chile	EAS%sT	1982 Mar 13 21:00 # Easter I Time
+			-6:00	Chile	EAS%sT
+#
+# Sala y Gomez Island is like Pacific/Easter.
+# Other Chilean locations, including Juan Fernandez Is, San Ambrosio,
+# San Felix, and Antarctic bases, are like America/Santiago.
+
+# Colombia
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	CO	1992	only	-	May	 3	0:00	1:00	S
+Rule	CO	1993	only	-	Apr	 4	0:00	0	-
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	America/Bogota	-4:56:20 -	LMT	1884 Mar 13
+			-4:56:20 -	BMT	1914 Nov 23 # Bogota Mean Time
+			-5:00	CO	CO%sT	# Colombia Time
+# Malpelo, Providencia, San Andres
+# no information; probably like America/Bogota
+
+# Curacao
+#
+# From Paul Eggert (2006-03-22):
+# Shanks & Pottenger say that The Bottom and Philipsburg have been at
+# -4:00 since standard time was introduced on 1912-03-02; and that
+# Kralendijk and Rincon used Kralendijk Mean Time (-4:33:08) from
+# 1912-02-02 to 1965-01-01.  The former is dubious, since S&P also say
+# Saba Island has been like Curacao.
+# This all predates our 1970 cutoff, though.
+#
+# By July 2007 Curacao and St Maarten are planned to become
+# associated states within the Netherlands, much like Aruba;
+# Bonaire, Saba and St Eustatius would become directly part of the
+# Netherlands as Kingdom Islands.  This won't affect their time zones
+# though, as far as we know.
+#
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	America/Curacao	-4:35:44 -	LMT	1912 Feb 12	# Willemstad
+			-4:30	-	ANT	1965 # Netherlands Antilles Time
+			-4:00	-	AST
+
+# Ecuador
+#
+# From Paul Eggert (2007-03-04):
+# Apparently Ecuador had a failed experiment with DST in 1992.
+# <http://midena.gov.ec/content/view/1261/208/> (2007-02-27) and
+# <http://www.hoy.com.ec/NoticiaNue.asp?row_id=249856> (2006-11-06) both
+# talk about "hora Sixto".  Leave this alone for now, as we have no data.
+#
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone America/Guayaquil	-5:19:20 -	LMT	1890
+			-5:14:00 -	QMT	1931 # Quito Mean Time
+			-5:00	-	ECT	     # Ecuador Time
+Zone Pacific/Galapagos	-5:58:24 -	LMT	1931 # Puerto Baquerizo Moreno
+			-5:00	-	ECT	1986
+			-6:00	-	GALT	     # Galapagos Time
+
+# Falklands
+
+# From Paul Eggert (2006-03-22):
+# Between 1990 and 2000 inclusive, Shanks & Pottenger and the IATA agree except
+# the IATA gives 1996-09-08.  Go with Shanks & Pottenger.
+
+# From Falkland Islands Government Office, London (2001-01-22)
+# via Jesper Norgaard:
+# ... the clocks revert back to Local Mean Time at 2 am on Sunday 15
+# April 2001 and advance one hour to summer time at 2 am on Sunday 2
+# September.  It is anticipated that the clocks will revert back at 2
+# am on Sunday 21 April 2002 and advance to summer time at 2 am on
+# Sunday 1 September.
+
+# From Rives McDow (2001-02-13):
+#
+# I have communicated several times with people there, and the last
+# time I had communications that was helpful was in 1998.  Here is
+# what was said then:
+#
+# "The general rule was that Stanley used daylight saving and the Camp
+# did not. However for various reasons many people in the Camp have
+# started to use daylight saving (known locally as 'Stanley Time')
+# There is no rule as to who uses daylight saving - it is a matter of
+# personal choice and so it is impossible to draw a map showing who
+# uses it and who does not. Any list would be out of date as soon as
+# it was produced. This year daylight saving ended on April 18/19th
+# and started again on September 12/13th.  I do not know what the rule
+# is, but can find out if you like.  We do not change at the same time
+# as UK or Chile."
+#
+# I did have in my notes that the rule was "Second Saturday in Sep at
+# 0:00 until third Saturday in Apr at 0:00".  I think that this does
+# not agree in some cases with Shanks; is this true?
+#
+# Also, there is no mention in the list that some areas in the
+# Falklands do not use DST.  I have found in my communications there
+# that these areas are on the western half of East Falkland and all of
+# West Falkland.  Stanley is the only place that consistently observes
+# DST.  Again, as in other places in the world, the farmers don't like
+# it.  West Falkland is almost entirely sheep farmers.
+#
+# I know one lady there that keeps a list of which farm keeps DST and
+# which doesn't each year.  She runs a shop in Stanley, and says that
+# the list changes each year.  She uses it to communicate to her
+# customers, catching them when they are home for lunch or dinner.
+
+# From Paul Eggert (2001-03-05):
+# For now, we'll just record the time in Stanley, since we have no
+# better info.
+
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Falk	1937	1938	-	Sep	lastSun	0:00	1:00	S
+Rule	Falk	1938	1942	-	Mar	Sun>=19	0:00	0	-
+Rule	Falk	1939	only	-	Oct	1	0:00	1:00	S
+Rule	Falk	1940	1942	-	Sep	lastSun	0:00	1:00	S
+Rule	Falk	1943	only	-	Jan	1	0:00	0	-
+Rule	Falk	1983	only	-	Sep	lastSun	0:00	1:00	S
+Rule	Falk	1984	1985	-	Apr	lastSun	0:00	0	-
+Rule	Falk	1984	only	-	Sep	16	0:00	1:00	S
+Rule	Falk	1985	2000	-	Sep	Sun>=9	0:00	1:00	S
+Rule	Falk	1986	2000	-	Apr	Sun>=16	0:00	0	-
+Rule	Falk	2001	max	-	Apr	Sun>=15	2:00	0	-
+Rule	Falk	2001	max	-	Sep	Sun>=1	2:00	1:00	S
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone Atlantic/Stanley	-3:51:24 -	LMT	1890
+			-3:51:24 -	SMT	1912 Mar 12  # Stanley Mean Time
+			-4:00	Falk	FK%sT	1983 May     # Falkland Is Time
+			-3:00	Falk	FK%sT	1985 Sep 15
+			-4:00	Falk	FK%sT
+
+# French Guiana
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone America/Cayenne	-3:29:20 -	LMT	1911 Jul
+			-4:00	-	GFT	1967 Oct # French Guiana Time
+			-3:00	-	GFT
+
+# Guyana
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	America/Guyana	-3:52:40 -	LMT	1915 Mar	# Georgetown
+			-3:45	-	GBGT	1966 May 26 # Br Guiana Time
+			-3:45	-	GYT	1975 Jul 31 # Guyana Time
+			-3:00	-	GYT	1991
+# IATA SSIM (1996-06) says -4:00.  Assume a 1991 switch.
+			-4:00	-	GYT
+
+# Paraguay
+# From Paul Eggert (2006-03-22):
+# Shanks & Pottenger say that spring transitions are from 01:00 -> 02:00,
+# and autumn transitions are from 00:00 -> 23:00.  Go with pre-1999
+# editions of Shanks, and with the IATA, who say transitions occur at 00:00.
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Para	1975	1988	-	Oct	 1	0:00	1:00	S
+Rule	Para	1975	1978	-	Mar	 1	0:00	0	-
+Rule	Para	1979	1991	-	Apr	 1	0:00	0	-
+Rule	Para	1989	only	-	Oct	22	0:00	1:00	S
+Rule	Para	1990	only	-	Oct	 1	0:00	1:00	S
+Rule	Para	1991	only	-	Oct	 6	0:00	1:00	S
+Rule	Para	1992	only	-	Mar	 1	0:00	0	-
+Rule	Para	1992	only	-	Oct	 5	0:00	1:00	S
+Rule	Para	1993	only	-	Mar	31	0:00	0	-
+Rule	Para	1993	1995	-	Oct	 1	0:00	1:00	S
+Rule	Para	1994	1995	-	Feb	lastSun	0:00	0	-
+Rule	Para	1996	only	-	Mar	 1	0:00	0	-
+# IATA SSIM (2000-02) says 1999-10-10; ignore this for now.
+# From Steffen Thorsen (2000-10-02):
+# I have three independent reports that Paraguay changed to DST this Sunday
+# (10-01).
+#
+# Translated by Gwillim Law (2001-02-27) from
+# <a href="http://www.diarionoticias.com.py/011000/nacional/naciona1.htm">
+# Noticias, a daily paper in Asuncion, Paraguay (2000-10-01)
+# </a>:
+# Starting at 0:00 today, the clock will be set forward 60 minutes, in
+# fulfillment of Decree No. 7,273 of the Executive Power....  The time change
+# system has been operating for several years.  Formerly there was a separate
+# decree each year; the new law has the same effect, but permanently.  Every
+# year, the time will change on the first Sunday of October; likewise, the
+# clock will be set back on the first Sunday of March.
+#
+Rule	Para	1996	2001	-	Oct	Sun>=1	0:00	1:00	S
+# IATA SSIM (1997-09) says Mar 1; go with Shanks & Pottenger.
+Rule	Para	1997	only	-	Feb	lastSun	0:00	0	-
+# Shanks & Pottenger say 1999-02-28; IATA SSIM (1999-02) says 1999-02-27, but
+# (1999-09) reports no date; go with above sources and Gerd Knops (2001-02-27).
+Rule	Para	1998	2001	-	Mar	Sun>=1	0:00	0	-
+# From Rives McDow (2002-02-28):
+# A decree was issued in Paraguay (no. 16350) on 2002-02-26 that changed the
+# dst method to be from the first Sunday in September to the first Sunday in
+# April.
+Rule	Para	2002	2004	-	Apr	Sun>=1	0:00	0	-
+Rule	Para	2002	2003	-	Sep	Sun>=1	0:00	1:00	S
+#
+# From Jesper Norgaard Welen (2005-01-02):
+# There are several sources that claim that Paraguay made
+# a timezone rule change in autumn 2004.
+# From Steffen Thorsen (2005-01-05):
+# Decree 1,867 (2004-03-05)
+# From Carlos Raul Perasso via Jesper Norgaard Welen (2006-10-13)
+# <http://www.presidencia.gov.py/decretos/D1867.pdf>
+Rule	Para	2004	2009	-	Oct	Sun>=15	0:00	1:00	S
+Rule	Para	2005	2009	-	Mar	Sun>=8	0:00	0	-
+# From Carlos Raul Perasso (2010-02-18):
+# By decree number 3958 issued yesterday (
+# <a href="http://www.presidencia.gov.py/v1/wp-content/uploads/2010/02/decreto3958.pdf">
+# http://www.presidencia.gov.py/v1/wp-content/uploads/2010/02/decreto3958.pdf
+# </a>
+# )
+# Paraguay changes its DST schedule, postponing the March rule to April and
+# modifying the October date. The decree reads:
+# ...
+# Art. 1. It is hereby established that from the second Sunday of the month of
+# April of this year (2010), the official time is to be set back 60 minutes,
+# and that on the first Sunday of the month of October, it is to be set
+# forward 60 minutes, in all the territory of the Paraguayan Republic.
+# ...
+Rule	Para	2010	max	-	Oct	Sun>=1	0:00	1:00	S
+Rule	Para	2010	max	-	Apr	Sun>=8	0:00	0	-
+
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone America/Asuncion	-3:50:40 -	LMT	1890
+			-3:50:40 -	AMT	1931 Oct 10 # Asuncion Mean Time
+			-4:00	-	PYT	1972 Oct # Paraguay Time
+			-3:00	-	PYT	1974 Apr
+			-4:00	Para	PY%sT
+
+# Peru
+#
+# <a href="news:xrGmb.39935$gA1.13896113@news4.srv.hcvlny.cv.net">
+# From Evelyn C. Leeper via Mark Brader (2003-10-26):</a>
+# When we were in Peru in 1985-1986, they apparently switched over
+# sometime between December 29 and January 3 while we were on the Amazon.
+#
+# From Paul Eggert (2006-03-22):
+# Shanks & Pottenger don't have this transition.  Assume 1986 was like 1987.
+
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Peru	1938	only	-	Jan	 1	0:00	1:00	S
+Rule	Peru	1938	only	-	Apr	 1	0:00	0	-
+Rule	Peru	1938	1939	-	Sep	lastSun	0:00	1:00	S
+Rule	Peru	1939	1940	-	Mar	Sun>=24	0:00	0	-
+Rule	Peru	1986	1987	-	Jan	 1	0:00	1:00	S
+Rule	Peru	1986	1987	-	Apr	 1	0:00	0	-
+Rule	Peru	1990	only	-	Jan	 1	0:00	1:00	S
+Rule	Peru	1990	only	-	Apr	 1	0:00	0	-
+# IATA is ambiguous for 1993/1995; go with Shanks & Pottenger.
+Rule	Peru	1994	only	-	Jan	 1	0:00	1:00	S
+Rule	Peru	1994	only	-	Apr	 1	0:00	0	-
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	America/Lima	-5:08:12 -	LMT	1890
+			-5:08:36 -	LMT	1908 Jul 28 # Lima Mean Time?
+			-5:00	Peru	PE%sT	# Peru Time
+
+# South Georgia
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone Atlantic/South_Georgia -2:26:08 -	LMT	1890		# Grytviken
+			-2:00	-	GST	# South Georgia Time
+
+# South Sandwich Is
+# uninhabited; scientific personnel have wintered
+
+# Suriname
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone America/Paramaribo	-3:40:40 -	LMT	1911
+			-3:40:52 -	PMT	1935     # Paramaribo Mean Time
+			-3:40:36 -	PMT	1945 Oct # The capital moved?
+			-3:30	-	NEGT	1975 Nov 20 # Dutch Guiana Time
+			-3:30	-	SRT	1984 Oct # Suriname Time
+			-3:00	-	SRT
+
+# Trinidad and Tobago
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone America/Port_of_Spain -4:06:04 -	LMT	1912 Mar 2
+			-4:00	-	AST
+
+# Uruguay
+# From Paul Eggert (1993-11-18):
+# Uruguay wins the prize for the strangest peacetime manipulation of the rules.
+# From Shanks & Pottenger:
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+# Whitman gives 1923 Oct 1; go with Shanks & Pottenger.
+Rule	Uruguay	1923	only	-	Oct	 2	 0:00	0:30	HS
+Rule	Uruguay	1924	1926	-	Apr	 1	 0:00	0	-
+Rule	Uruguay	1924	1925	-	Oct	 1	 0:00	0:30	HS
+Rule	Uruguay	1933	1935	-	Oct	lastSun	 0:00	0:30	HS
+# Shanks & Pottenger give 1935 Apr 1 0:00 & 1936 Mar 30 0:00; go with Whitman.
+Rule	Uruguay	1934	1936	-	Mar	Sat>=25	23:30s	0	-
+Rule	Uruguay	1936	only	-	Nov	 1	 0:00	0:30	HS
+Rule	Uruguay	1937	1941	-	Mar	lastSun	 0:00	0	-
+# Whitman gives 1937 Oct 3; go with Shanks & Pottenger.
+Rule	Uruguay	1937	1940	-	Oct	lastSun	 0:00	0:30	HS
+# Whitman gives 1941 Oct 24 - 1942 Mar 27, 1942 Dec 14 - 1943 Apr 13,
+# and 1943 Apr 13 ``to present time''; go with Shanks & Pottenger.
+Rule	Uruguay	1941	only	-	Aug	 1	 0:00	0:30	HS
+Rule	Uruguay	1942	only	-	Jan	 1	 0:00	0	-
+Rule	Uruguay	1942	only	-	Dec	14	 0:00	1:00	S
+Rule	Uruguay	1943	only	-	Mar	14	 0:00	0	-
+Rule	Uruguay	1959	only	-	May	24	 0:00	1:00	S
+Rule	Uruguay	1959	only	-	Nov	15	 0:00	0	-
+Rule	Uruguay	1960	only	-	Jan	17	 0:00	1:00	S
+Rule	Uruguay	1960	only	-	Mar	 6	 0:00	0	-
+Rule	Uruguay	1965	1967	-	Apr	Sun>=1	 0:00	1:00	S
+Rule	Uruguay	1965	only	-	Sep	26	 0:00	0	-
+Rule	Uruguay	1966	1967	-	Oct	31	 0:00	0	-
+Rule	Uruguay	1968	1970	-	May	27	 0:00	0:30	HS
+Rule	Uruguay	1968	1970	-	Dec	 2	 0:00	0	-
+Rule	Uruguay	1972	only	-	Apr	24	 0:00	1:00	S
+Rule	Uruguay	1972	only	-	Aug	15	 0:00	0	-
+Rule	Uruguay	1974	only	-	Mar	10	 0:00	0:30	HS
+Rule	Uruguay	1974	only	-	Dec	22	 0:00	1:00	S
+Rule	Uruguay	1976	only	-	Oct	 1	 0:00	0	-
+Rule	Uruguay	1977	only	-	Dec	 4	 0:00	1:00	S
+Rule	Uruguay	1978	only	-	Apr	 1	 0:00	0	-
+Rule	Uruguay	1979	only	-	Oct	 1	 0:00	1:00	S
+Rule	Uruguay	1980	only	-	May	 1	 0:00	0	-
+Rule	Uruguay	1987	only	-	Dec	14	 0:00	1:00	S
+Rule	Uruguay	1988	only	-	Mar	14	 0:00	0	-
+Rule	Uruguay	1988	only	-	Dec	11	 0:00	1:00	S
+Rule	Uruguay	1989	only	-	Mar	12	 0:00	0	-
+Rule	Uruguay	1989	only	-	Oct	29	 0:00	1:00	S
+# Shanks & Pottenger say no DST was observed in 1990/1 and 1991/2,
+# and that 1992/3's DST was from 10-25 to 03-01.  Go with IATA.
+Rule	Uruguay	1990	1992	-	Mar	Sun>=1	 0:00	0	-
+Rule	Uruguay	1990	1991	-	Oct	Sun>=21	 0:00	1:00	S
+Rule	Uruguay	1992	only	-	Oct	18	 0:00	1:00	S
+Rule	Uruguay	1993	only	-	Feb	28	 0:00	0	-
+# From Eduardo Cota (2004-09-20):
+# The uruguayan government has decreed a change in the local time....
+# http://www.presidencia.gub.uy/decretos/2004091502.htm
+Rule	Uruguay	2004	only	-	Sep	19	 0:00	1:00	S
+# From Steffen Thorsen (2005-03-11):
+# Uruguay's DST was scheduled to end on Sunday, 2005-03-13, but in order to
+# save energy ... it was postponed two weeks....
+# http://www.presidencia.gub.uy/_Web/noticias/2005/03/2005031005.htm
+Rule	Uruguay	2005	only	-	Mar	27	 2:00	0	-
+# From Eduardo Cota (2005-09-27):
+# http://www.presidencia.gub.uy/_Web/decretos/2005/09/CM%20119_09%2009%202005_00001.PDF
+# This means that from 2005-10-09 at 02:00 local time, until 2006-03-12 at
+# 02:00 local time, official time in Uruguay will be at GMT -2.
+Rule	Uruguay	2005	only	-	Oct	 9	 2:00	1:00	S
+Rule	Uruguay	2006	only	-	Mar	12	 2:00	0	-
+# From Jesper Norgaard Welen (2006-09-06):
+# http://www.presidencia.gub.uy/_web/decretos/2006/09/CM%20210_08%2006%202006_00001.PDF
+Rule	Uruguay	2006	max	-	Oct	Sun>=1	 2:00	1:00	S
+Rule	Uruguay	2007	max	-	Mar	Sun>=8	 2:00	0	-
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone America/Montevideo	-3:44:44 -	LMT	1898 Jun 28
+			-3:44:44 -	MMT	1920 May  1	# Montevideo MT
+			-3:30	Uruguay	UY%sT	1942 Dec 14	# Uruguay Time
+			-3:00	Uruguay	UY%sT
+
+# Venezuela
+#
+# From John Stainforth (2007-11-28):
+# ... the change for Venezuela originally expected for 2007-12-31 has
+# been brought forward to 2007-12-09.  The official announcement was
+# published today in the "Gaceta Oficial de la Republica Bolivariana
+# de Venezuela, numero 38.819" (official document for all laws or
+# resolution publication)
+# http://www.globovision.com/news.php?nid=72208
+
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone	America/Caracas	-4:27:44 -	LMT	1890
+			-4:27:40 -	CMT	1912 Feb 12 # Caracas Mean Time?
+			-4:30	-	VET	1965	     # Venezuela Time
+			-4:00	-	VET	2007 Dec  9 03:00
+			-4:30	-	VET
diff --git a/tools/zoneinfo/tzdata2009s/systemv b/tools/zoneinfo/tzdata2010k/systemv
similarity index 100%
rename from tools/zoneinfo/tzdata2009s/systemv
rename to tools/zoneinfo/tzdata2010k/systemv
diff --git a/tools/zoneinfo/tzdata2009s/yearistype.sh b/tools/zoneinfo/tzdata2010k/yearistype.sh
similarity index 100%
rename from tools/zoneinfo/tzdata2009s/yearistype.sh
rename to tools/zoneinfo/tzdata2010k/yearistype.sh
diff --git a/tools/zoneinfo/tzdata2010k/zone.tab b/tools/zoneinfo/tzdata2010k/zone.tab
new file mode 100644
index 0000000..1dc2add
--- /dev/null
+++ b/tools/zoneinfo/tzdata2010k/zone.tab
@@ -0,0 +1,434 @@
+# <pre>
+# @(#)zone.tab	8.37
+# This file is in the public domain, so clarified as of
+# 2009-05-17 by Arthur David Olson.
+#
+# TZ zone descriptions
+#
+# From Paul Eggert (1996-08-05):
+#
+# This file contains a table with the following columns:
+# 1.  ISO 3166 2-character country code.  See the file `iso3166.tab'.
+# 2.  Latitude and longitude of the zone's principal location
+#     in ISO 6709 sign-degrees-minutes-seconds format,
+#     either +-DDMM+-DDDMM or +-DDMMSS+-DDDMMSS,
+#     first latitude (+ is north), then longitude (+ is east).
+# 3.  Zone name used in value of TZ environment variable.
+# 4.  Comments; present if and only if the country has multiple rows.
+#
+# Columns are separated by a single tab.
+# The table is sorted first by country, then an order within the country that
+# (1) makes some geographical sense, and
+# (2) puts the most populous zones first, where that does not contradict (1).
+#
+# Lines beginning with `#' are comments.
+#
+#country-
+#code	coordinates	TZ			comments
+AD	+4230+00131	Europe/Andorra
+AE	+2518+05518	Asia/Dubai
+AF	+3431+06912	Asia/Kabul
+AG	+1703-06148	America/Antigua
+AI	+1812-06304	America/Anguilla
+AL	+4120+01950	Europe/Tirane
+AM	+4011+04430	Asia/Yerevan
+AN	+1211-06900	America/Curacao
+AO	-0848+01314	Africa/Luanda
+AQ	-7750+16636	Antarctica/McMurdo	McMurdo Station, Ross Island
+AQ	-9000+00000	Antarctica/South_Pole	Amundsen-Scott Station, South Pole
+AQ	-6734-06808	Antarctica/Rothera	Rothera Station, Adelaide Island
+AQ	-6448-06406	Antarctica/Palmer	Palmer Station, Anvers Island
+AQ	-6736+06253	Antarctica/Mawson	Mawson Station, Holme Bay
+AQ	-6835+07758	Antarctica/Davis	Davis Station, Vestfold Hills
+AQ	-6617+11031	Antarctica/Casey	Casey Station, Bailey Peninsula
+AQ	-7824+10654	Antarctica/Vostok	Vostok Station, S Magnetic Pole
+AQ	-6640+14001	Antarctica/DumontDUrville	Dumont-d'Urville Station, Terre Adelie
+AQ	-690022+0393524	Antarctica/Syowa	Syowa Station, E Ongul I
+AQ	-5430+15857	Antarctica/Macquarie	Macquarie Island Station, Macquarie Island
+AR	-3436-05827	America/Argentina/Buenos_Aires	Buenos Aires (BA, CF)
+AR	-3124-06411	America/Argentina/Cordoba	most locations (CB, CC, CN, ER, FM, MN, SE, SF)
+AR	-2447-06525	America/Argentina/Salta	(SA, LP, NQ, RN)
+AR	-2411-06518	America/Argentina/Jujuy	Jujuy (JY)
+AR	-2649-06513	America/Argentina/Tucuman	Tucuman (TM)
+AR	-2828-06547	America/Argentina/Catamarca	Catamarca (CT), Chubut (CH)
+AR	-2926-06651	America/Argentina/La_Rioja	La Rioja (LR)
+AR	-3132-06831	America/Argentina/San_Juan	San Juan (SJ)
+AR	-3253-06849	America/Argentina/Mendoza	Mendoza (MZ)
+AR	-3319-06621	America/Argentina/San_Luis	San Luis (SL)
+AR	-5138-06913	America/Argentina/Rio_Gallegos	Santa Cruz (SC)
+AR	-5448-06818	America/Argentina/Ushuaia	Tierra del Fuego (TF)
+AS	-1416-17042	Pacific/Pago_Pago
+AT	+4813+01620	Europe/Vienna
+AU	-3133+15905	Australia/Lord_Howe	Lord Howe Island
+AU	-4253+14719	Australia/Hobart	Tasmania - most locations
+AU	-3956+14352	Australia/Currie	Tasmania - King Island
+AU	-3749+14458	Australia/Melbourne	Victoria
+AU	-3352+15113	Australia/Sydney	New South Wales - most locations
+AU	-3157+14127	Australia/Broken_Hill	New South Wales - Yancowinna
+AU	-2728+15302	Australia/Brisbane	Queensland - most locations
+AU	-2016+14900	Australia/Lindeman	Queensland - Holiday Islands
+AU	-3455+13835	Australia/Adelaide	South Australia
+AU	-1228+13050	Australia/Darwin	Northern Territory
+AU	-3157+11551	Australia/Perth	Western Australia - most locations
+AU	-3143+12852	Australia/Eucla	Western Australia - Eucla area
+AW	+1230-06958	America/Aruba
+AX	+6006+01957	Europe/Mariehamn
+AZ	+4023+04951	Asia/Baku
+BA	+4352+01825	Europe/Sarajevo
+BB	+1306-05937	America/Barbados
+BD	+2343+09025	Asia/Dhaka
+BE	+5050+00420	Europe/Brussels
+BF	+1222-00131	Africa/Ouagadougou
+BG	+4241+02319	Europe/Sofia
+BH	+2623+05035	Asia/Bahrain
+BI	-0323+02922	Africa/Bujumbura
+BJ	+0629+00237	Africa/Porto-Novo
+BL	+1753-06251	America/St_Barthelemy
+BM	+3217-06446	Atlantic/Bermuda
+BN	+0456+11455	Asia/Brunei
+BO	-1630-06809	America/La_Paz
+BR	-0351-03225	America/Noronha	Atlantic islands
+BR	-0127-04829	America/Belem	Amapa, E Para
+BR	-0343-03830	America/Fortaleza	NE Brazil (MA, PI, CE, RN, PB)
+BR	-0803-03454	America/Recife	Pernambuco
+BR	-0712-04812	America/Araguaina	Tocantins
+BR	-0940-03543	America/Maceio	Alagoas, Sergipe
+BR	-1259-03831	America/Bahia	Bahia
+BR	-2332-04637	America/Sao_Paulo	S & SE Brazil (GO, DF, MG, ES, RJ, SP, PR, SC, RS)
+BR	-2027-05437	America/Campo_Grande	Mato Grosso do Sul
+BR	-1535-05605	America/Cuiaba	Mato Grosso
+BR	-0226-05452	America/Santarem	W Para
+BR	-0846-06354	America/Porto_Velho	Rondonia
+BR	+0249-06040	America/Boa_Vista	Roraima
+BR	-0308-06001	America/Manaus	E Amazonas
+BR	-0640-06952	America/Eirunepe	W Amazonas
+BR	-0958-06748	America/Rio_Branco	Acre
+BS	+2505-07721	America/Nassau
+BT	+2728+08939	Asia/Thimphu
+BW	-2439+02555	Africa/Gaborone
+BY	+5354+02734	Europe/Minsk
+BZ	+1730-08812	America/Belize
+CA	+4734-05243	America/St_Johns	Newfoundland Time, including SE Labrador
+CA	+4439-06336	America/Halifax	Atlantic Time - Nova Scotia (most places), PEI
+CA	+4612-05957	America/Glace_Bay	Atlantic Time - Nova Scotia - places that did not observe DST 1966-1971
+CA	+4606-06447	America/Moncton	Atlantic Time - New Brunswick
+CA	+5320-06025	America/Goose_Bay	Atlantic Time - Labrador - most locations
+CA	+5125-05707	America/Blanc-Sablon	Atlantic Standard Time - Quebec - Lower North Shore
+CA	+4531-07334	America/Montreal	Eastern Time - Quebec - most locations
+CA	+4339-07923	America/Toronto	Eastern Time - Ontario - most locations
+CA	+4901-08816	America/Nipigon	Eastern Time - Ontario & Quebec - places that did not observe DST 1967-1973
+CA	+4823-08915	America/Thunder_Bay	Eastern Time - Thunder Bay, Ontario
+CA	+6344-06828	America/Iqaluit	Eastern Time - east Nunavut - most locations
+CA	+6608-06544	America/Pangnirtung	Eastern Time - Pangnirtung, Nunavut
+CA	+744144-0944945	America/Resolute	Eastern Standard Time - Resolute, Nunavut
+CA	+484531-0913718	America/Atikokan	Eastern Standard Time - Atikokan, Ontario and Southampton I, Nunavut
+CA	+624900-0920459	America/Rankin_Inlet	Central Time - central Nunavut
+CA	+4953-09709	America/Winnipeg	Central Time - Manitoba & west Ontario
+CA	+4843-09434	America/Rainy_River	Central Time - Rainy River & Fort Frances, Ontario
+CA	+5024-10439	America/Regina	Central Standard Time - Saskatchewan - most locations
+CA	+5017-10750	America/Swift_Current	Central Standard Time - Saskatchewan - midwest
+CA	+5333-11328	America/Edmonton	Mountain Time - Alberta, east British Columbia & west Saskatchewan
+CA	+690650-1050310	America/Cambridge_Bay	Mountain Time - west Nunavut
+CA	+6227-11421	America/Yellowknife	Mountain Time - central Northwest Territories
+CA	+682059-1334300	America/Inuvik	Mountain Time - west Northwest Territories
+CA	+5946-12014	America/Dawson_Creek	Mountain Standard Time - Dawson Creek & Fort Saint John, British Columbia
+CA	+4916-12307	America/Vancouver	Pacific Time - west British Columbia
+CA	+6043-13503	America/Whitehorse	Pacific Time - south Yukon
+CA	+6404-13925	America/Dawson	Pacific Time - north Yukon
+CC	-1210+09655	Indian/Cocos
+CD	-0418+01518	Africa/Kinshasa	west Dem. Rep. of Congo
+CD	-1140+02728	Africa/Lubumbashi	east Dem. Rep. of Congo
+CF	+0422+01835	Africa/Bangui
+CG	-0416+01517	Africa/Brazzaville
+CH	+4723+00832	Europe/Zurich
+CI	+0519-00402	Africa/Abidjan
+CK	-2114-15946	Pacific/Rarotonga
+CL	-3327-07040	America/Santiago	most locations
+CL	-2709-10926	Pacific/Easter	Easter Island & Sala y Gomez
+CM	+0403+00942	Africa/Douala
+CN	+3114+12128	Asia/Shanghai	east China - Beijing, Guangdong, Shanghai, etc.
+CN	+4545+12641	Asia/Harbin	Heilongjiang (except Mohe), Jilin
+CN	+2934+10635	Asia/Chongqing	central China - Sichuan, Yunnan, Guangxi, Shaanxi, Guizhou, etc.
+CN	+4348+08735	Asia/Urumqi	most of Tibet & Xinjiang
+CN	+3929+07559	Asia/Kashgar	west Tibet & Xinjiang
+CO	+0436-07405	America/Bogota
+CR	+0956-08405	America/Costa_Rica
+CU	+2308-08222	America/Havana
+CV	+1455-02331	Atlantic/Cape_Verde
+CX	-1025+10543	Indian/Christmas
+CY	+3510+03322	Asia/Nicosia
+CZ	+5005+01426	Europe/Prague
+DE	+5230+01322	Europe/Berlin
+DJ	+1136+04309	Africa/Djibouti
+DK	+5540+01235	Europe/Copenhagen
+DM	+1518-06124	America/Dominica
+DO	+1828-06954	America/Santo_Domingo
+DZ	+3647+00303	Africa/Algiers
+EC	-0210-07950	America/Guayaquil	mainland
+EC	-0054-08936	Pacific/Galapagos	Galapagos Islands
+EE	+5925+02445	Europe/Tallinn
+EG	+3003+03115	Africa/Cairo
+EH	+2709-01312	Africa/El_Aaiun
+ER	+1520+03853	Africa/Asmara
+ES	+4024-00341	Europe/Madrid	mainland
+ES	+3553-00519	Africa/Ceuta	Ceuta & Melilla
+ES	+2806-01524	Atlantic/Canary	Canary Islands
+ET	+0902+03842	Africa/Addis_Ababa
+FI	+6010+02458	Europe/Helsinki
+FJ	-1808+17825	Pacific/Fiji
+FK	-5142-05751	Atlantic/Stanley
+FM	+0725+15147	Pacific/Chuuk	Chuuk (Truk) and Yap
+FM	+0658+15813	Pacific/Pohnpei	Pohnpei (Ponape)
+FM	+0519+16259	Pacific/Kosrae	Kosrae
+FO	+6201-00646	Atlantic/Faroe
+FR	+4852+00220	Europe/Paris
+GA	+0023+00927	Africa/Libreville
+GB	+513030-0000731	Europe/London
+GD	+1203-06145	America/Grenada
+GE	+4143+04449	Asia/Tbilisi
+GF	+0456-05220	America/Cayenne
+GG	+4927-00232	Europe/Guernsey
+GH	+0533-00013	Africa/Accra
+GI	+3608-00521	Europe/Gibraltar
+GL	+6411-05144	America/Godthab	most locations
+GL	+7646-01840	America/Danmarkshavn	east coast, north of Scoresbysund
+GL	+7029-02158	America/Scoresbysund	Scoresbysund / Ittoqqortoormiit
+GL	+7634-06847	America/Thule	Thule / Pituffik
+GM	+1328-01639	Africa/Banjul
+GN	+0931-01343	Africa/Conakry
+GP	+1614-06132	America/Guadeloupe
+GQ	+0345+00847	Africa/Malabo
+GR	+3758+02343	Europe/Athens
+GS	-5416-03632	Atlantic/South_Georgia
+GT	+1438-09031	America/Guatemala
+GU	+1328+14445	Pacific/Guam
+GW	+1151-01535	Africa/Bissau
+GY	+0648-05810	America/Guyana
+HK	+2217+11409	Asia/Hong_Kong
+HN	+1406-08713	America/Tegucigalpa
+HR	+4548+01558	Europe/Zagreb
+HT	+1832-07220	America/Port-au-Prince
+HU	+4730+01905	Europe/Budapest
+ID	-0610+10648	Asia/Jakarta	Java & Sumatra
+ID	-0002+10920	Asia/Pontianak	west & central Borneo
+ID	-0507+11924	Asia/Makassar	east & south Borneo, Celebes, Bali, Nusa Tengarra, west Timor
+ID	-0232+14042	Asia/Jayapura	Irian Jaya & the Moluccas
+IE	+5320-00615	Europe/Dublin
+IL	+3146+03514	Asia/Jerusalem
+IM	+5409-00428	Europe/Isle_of_Man
+IN	+2232+08822	Asia/Kolkata
+IO	-0720+07225	Indian/Chagos
+IQ	+3321+04425	Asia/Baghdad
+IR	+3540+05126	Asia/Tehran
+IS	+6409-02151	Atlantic/Reykjavik
+IT	+4154+01229	Europe/Rome
+JE	+4912-00207	Europe/Jersey
+JM	+1800-07648	America/Jamaica
+JO	+3157+03556	Asia/Amman
+JP	+353916+1394441	Asia/Tokyo
+KE	-0117+03649	Africa/Nairobi
+KG	+4254+07436	Asia/Bishkek
+KH	+1133+10455	Asia/Phnom_Penh
+KI	+0125+17300	Pacific/Tarawa	Gilbert Islands
+KI	-0308-17105	Pacific/Enderbury	Phoenix Islands
+KI	+0152-15720	Pacific/Kiritimati	Line Islands
+KM	-1141+04316	Indian/Comoro
+KN	+1718-06243	America/St_Kitts
+KP	+3901+12545	Asia/Pyongyang
+KR	+3733+12658	Asia/Seoul
+KW	+2920+04759	Asia/Kuwait
+KY	+1918-08123	America/Cayman
+KZ	+4315+07657	Asia/Almaty	most locations
+KZ	+4448+06528	Asia/Qyzylorda	Qyzylorda (Kyzylorda, Kzyl-Orda)
+KZ	+5017+05710	Asia/Aqtobe	Aqtobe (Aktobe)
+KZ	+4431+05016	Asia/Aqtau	Atyrau (Atirau, Gur'yev), Mangghystau (Mankistau)
+KZ	+5113+05121	Asia/Oral	West Kazakhstan
+LA	+1758+10236	Asia/Vientiane
+LB	+3353+03530	Asia/Beirut
+LC	+1401-06100	America/St_Lucia
+LI	+4709+00931	Europe/Vaduz
+LK	+0656+07951	Asia/Colombo
+LR	+0618-01047	Africa/Monrovia
+LS	-2928+02730	Africa/Maseru
+LT	+5441+02519	Europe/Vilnius
+LU	+4936+00609	Europe/Luxembourg
+LV	+5657+02406	Europe/Riga
+LY	+3254+01311	Africa/Tripoli
+MA	+3339-00735	Africa/Casablanca
+MC	+4342+00723	Europe/Monaco
+MD	+4700+02850	Europe/Chisinau
+ME	+4226+01916	Europe/Podgorica
+MF	+1804-06305	America/Marigot
+MG	-1855+04731	Indian/Antananarivo
+MH	+0709+17112	Pacific/Majuro	most locations
+MH	+0905+16720	Pacific/Kwajalein	Kwajalein
+MK	+4159+02126	Europe/Skopje
+ML	+1239-00800	Africa/Bamako
+MM	+1647+09610	Asia/Rangoon
+MN	+4755+10653	Asia/Ulaanbaatar	most locations
+MN	+4801+09139	Asia/Hovd	Bayan-Olgiy, Govi-Altai, Hovd, Uvs, Zavkhan
+MN	+4804+11430	Asia/Choibalsan	Dornod, Sukhbaatar
+MO	+2214+11335	Asia/Macau
+MP	+1512+14545	Pacific/Saipan
+MQ	+1436-06105	America/Martinique
+MR	+1806-01557	Africa/Nouakchott
+MS	+1643-06213	America/Montserrat
+MT	+3554+01431	Europe/Malta
+MU	-2010+05730	Indian/Mauritius
+MV	+0410+07330	Indian/Maldives
+MW	-1547+03500	Africa/Blantyre
+MX	+1924-09909	America/Mexico_City	Central Time - most locations
+MX	+2105-08646	America/Cancun	Central Time - Quintana Roo
+MX	+2058-08937	America/Merida	Central Time - Campeche, Yucatan
+MX	+2540-10019	America/Monterrey	Mexican Central Time - Coahuila, Durango, Nuevo Leon, Tamaulipas away from US border
+MX	+2550-09730	America/Matamoros	US Central Time - Coahuila, Durango, Nuevo Leon, Tamaulipas near US border
+MX	+2313-10625	America/Mazatlan	Mountain Time - S Baja, Nayarit, Sinaloa
+MX	+2838-10605	America/Chihuahua	Mexican Mountain Time - Chihuahua away from US border
+MX	+2934-10425	America/Ojinaga	US Mountain Time - Chihuahua near US border
+MX	+2904-11058	America/Hermosillo	Mountain Standard Time - Sonora
+MX	+3232-11701	America/Tijuana	US Pacific Time - Baja California near US border
+MX	+3018-11452	America/Santa_Isabel	Mexican Pacific Time - Baja California away from US border
+MX	+2048-10515	America/Bahia_Banderas	Mexican Central Time - Bahia de Banderas
+MY	+0310+10142	Asia/Kuala_Lumpur	peninsular Malaysia
+MY	+0133+11020	Asia/Kuching	Sabah & Sarawak
+MZ	-2558+03235	Africa/Maputo
+NA	-2234+01706	Africa/Windhoek
+NC	-2216+16627	Pacific/Noumea
+NE	+1331+00207	Africa/Niamey
+NF	-2903+16758	Pacific/Norfolk
+NG	+0627+00324	Africa/Lagos
+NI	+1209-08617	America/Managua
+NL	+5222+00454	Europe/Amsterdam
+NO	+5955+01045	Europe/Oslo
+NP	+2743+08519	Asia/Kathmandu
+NR	-0031+16655	Pacific/Nauru
+NU	-1901-16955	Pacific/Niue
+NZ	-3652+17446	Pacific/Auckland	most locations
+NZ	-4357-17633	Pacific/Chatham	Chatham Islands
+OM	+2336+05835	Asia/Muscat
+PA	+0858-07932	America/Panama
+PE	-1203-07703	America/Lima
+PF	-1732-14934	Pacific/Tahiti	Society Islands
+PF	-0900-13930	Pacific/Marquesas	Marquesas Islands
+PF	-2308-13457	Pacific/Gambier	Gambier Islands
+PG	-0930+14710	Pacific/Port_Moresby
+PH	+1435+12100	Asia/Manila
+PK	+2452+06703	Asia/Karachi
+PL	+5215+02100	Europe/Warsaw
+PM	+4703-05620	America/Miquelon
+PN	-2504-13005	Pacific/Pitcairn
+PR	+182806-0660622	America/Puerto_Rico
+PS	+3130+03428	Asia/Gaza
+PT	+3843-00908	Europe/Lisbon	mainland
+PT	+3238-01654	Atlantic/Madeira	Madeira Islands
+PT	+3744-02540	Atlantic/Azores	Azores
+PW	+0720+13429	Pacific/Palau
+PY	-2516-05740	America/Asuncion
+QA	+2517+05132	Asia/Qatar
+RE	-2052+05528	Indian/Reunion
+RO	+4426+02606	Europe/Bucharest
+RS	+4450+02030	Europe/Belgrade
+RU	+5443+02030	Europe/Kaliningrad	Moscow-01 - Kaliningrad
+RU	+5545+03735	Europe/Moscow	Moscow+00 - west Russia
+RU	+4844+04425	Europe/Volgograd	Moscow+00 - Caspian Sea
+RU	+5312+05009	Europe/Samara	Moscow - Samara, Udmurtia
+RU	+5651+06036	Asia/Yekaterinburg	Moscow+02 - Urals
+RU	+5500+07324	Asia/Omsk	Moscow+03 - west Siberia
+RU	+5502+08255	Asia/Novosibirsk	Moscow+03 - Novosibirsk
+RU	+5345+08707	Asia/Novokuznetsk	Moscow+03 - Novokuznetsk
+RU	+5601+09250	Asia/Krasnoyarsk	Moscow+04 - Yenisei River
+RU	+5216+10420	Asia/Irkutsk	Moscow+05 - Lake Baikal
+RU	+6200+12940	Asia/Yakutsk	Moscow+06 - Lena River
+RU	+4310+13156	Asia/Vladivostok	Moscow+07 - Amur River
+RU	+4658+14242	Asia/Sakhalin	Moscow+07 - Sakhalin Island
+RU	+5934+15048	Asia/Magadan	Moscow+08 - Magadan
+RU	+5301+15839	Asia/Kamchatka	Moscow+08 - Kamchatka
+RU	+6445+17729	Asia/Anadyr	Moscow+08 - Bering Sea
+RW	-0157+03004	Africa/Kigali
+SA	+2438+04643	Asia/Riyadh
+SB	-0932+16012	Pacific/Guadalcanal
+SC	-0440+05528	Indian/Mahe
+SD	+1536+03232	Africa/Khartoum
+SE	+5920+01803	Europe/Stockholm
+SG	+0117+10351	Asia/Singapore
+SH	-1555-00542	Atlantic/St_Helena
+SI	+4603+01431	Europe/Ljubljana
+SJ	+7800+01600	Arctic/Longyearbyen
+SK	+4809+01707	Europe/Bratislava
+SL	+0830-01315	Africa/Freetown
+SM	+4355+01228	Europe/San_Marino
+SN	+1440-01726	Africa/Dakar
+SO	+0204+04522	Africa/Mogadishu
+SR	+0550-05510	America/Paramaribo
+ST	+0020+00644	Africa/Sao_Tome
+SV	+1342-08912	America/El_Salvador
+SY	+3330+03618	Asia/Damascus
+SZ	-2618+03106	Africa/Mbabane
+TC	+2128-07108	America/Grand_Turk
+TD	+1207+01503	Africa/Ndjamena
+TF	-492110+0701303	Indian/Kerguelen
+TG	+0608+00113	Africa/Lome
+TH	+1345+10031	Asia/Bangkok
+TJ	+3835+06848	Asia/Dushanbe
+TK	-0922-17114	Pacific/Fakaofo
+TL	-0833+12535	Asia/Dili
+TM	+3757+05823	Asia/Ashgabat
+TN	+3648+01011	Africa/Tunis
+TO	-2110-17510	Pacific/Tongatapu
+TR	+4101+02858	Europe/Istanbul
+TT	+1039-06131	America/Port_of_Spain
+TV	-0831+17913	Pacific/Funafuti
+TW	+2503+12130	Asia/Taipei
+TZ	-0648+03917	Africa/Dar_es_Salaam
+UA	+5026+03031	Europe/Kiev	most locations
+UA	+4837+02218	Europe/Uzhgorod	Ruthenia
+UA	+4750+03510	Europe/Zaporozhye	Zaporozh'ye, E Lugansk / Zaporizhia, E Luhansk
+UA	+4457+03406	Europe/Simferopol	central Crimea
+UG	+0019+03225	Africa/Kampala
+UM	+1645-16931	Pacific/Johnston	Johnston Atoll
+UM	+2813-17722	Pacific/Midway	Midway Islands
+UM	+1917+16637	Pacific/Wake	Wake Island
+US	+404251-0740023	America/New_York	Eastern Time
+US	+421953-0830245	America/Detroit	Eastern Time - Michigan - most locations
+US	+381515-0854534	America/Kentucky/Louisville	Eastern Time - Kentucky - Louisville area
+US	+364947-0845057	America/Kentucky/Monticello	Eastern Time - Kentucky - Wayne County
+US	+394606-0860929	America/Indiana/Indianapolis	Eastern Time - Indiana - most locations
+US	+384038-0873143	America/Indiana/Vincennes	Eastern Time - Indiana - Daviess, Dubois, Knox & Martin Counties
+US	+410305-0863611	America/Indiana/Winamac	Eastern Time - Indiana - Pulaski County
+US	+382232-0862041	America/Indiana/Marengo	Eastern Time - Indiana - Crawford County
+US	+382931-0871643	America/Indiana/Petersburg	Eastern Time - Indiana - Pike County
+US	+384452-0850402	America/Indiana/Vevay	Eastern Time - Indiana - Switzerland County
+US	+415100-0873900	America/Chicago	Central Time
+US	+375711-0864541	America/Indiana/Tell_City	Central Time - Indiana - Perry County
+US	+411745-0863730	America/Indiana/Knox	Central Time - Indiana - Starke County
+US	+450628-0873651	America/Menominee	Central Time - Michigan - Dickinson, Gogebic, Iron & Menominee Counties
+US	+470659-1011757	America/North_Dakota/Center	Central Time - North Dakota - Oliver County
+US	+465042-1012439	America/North_Dakota/New_Salem	Central Time - North Dakota - Morton County (except Mandan area)
+US	+394421-1045903	America/Denver	Mountain Time
+US	+433649-1161209	America/Boise	Mountain Time - south Idaho & east Oregon
+US	+364708-1084111	America/Shiprock	Mountain Time - Navajo
+US	+332654-1120424	America/Phoenix	Mountain Standard Time - Arizona
+US	+340308-1181434	America/Los_Angeles	Pacific Time
+US	+611305-1495401	America/Anchorage	Alaska Time
+US	+581807-1342511	America/Juneau	Alaska Time - Alaska panhandle
+US	+593249-1394338	America/Yakutat	Alaska Time - Alaska panhandle neck
+US	+643004-1652423	America/Nome	Alaska Time - west Alaska
+US	+515248-1763929	America/Adak	Aleutian Islands
+US	+211825-1575130	Pacific/Honolulu	Hawaii
+UY	-3453-05611	America/Montevideo
+UZ	+3940+06648	Asia/Samarkand	west Uzbekistan
+UZ	+4120+06918	Asia/Tashkent	east Uzbekistan
+VA	+415408+0122711	Europe/Vatican
+VC	+1309-06114	America/St_Vincent
+VE	+1030-06656	America/Caracas
+VG	+1827-06437	America/Tortola
+VI	+1821-06456	America/St_Thomas
+VN	+1045+10640	Asia/Ho_Chi_Minh
+VU	-1740+16825	Pacific/Efate
+WF	-1318-17610	Pacific/Wallis
+WS	-1350-17144	Pacific/Apia
+YE	+1245+04512	Asia/Aden
+YT	-1247+04514	Indian/Mayotte
+ZA	-2615+02800	Africa/Johannesburg
+ZM	-1525+02817	Africa/Lusaka
+ZW	-1750+03103	Africa/Harare
diff --git a/tutorials/NotepadCodeLab/Notepadv2Solution/src/com/android/demo/notepad2/NoteEdit.java b/tutorials/NotepadCodeLab/Notepadv2Solution/src/com/android/demo/notepad2/NoteEdit.java
index 8c9dccc..ff497c5 100755
--- a/tutorials/NotepadCodeLab/Notepadv2Solution/src/com/android/demo/notepad2/NoteEdit.java
+++ b/tutorials/NotepadCodeLab/Notepadv2Solution/src/com/android/demo/notepad2/NoteEdit.java
@@ -33,6 +33,7 @@
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.note_edit);
+        setTitle(R.string.edit_note);
 
         mTitleText = (EditText) findViewById(R.id.title);
         mBodyText = (EditText) findViewById(R.id.body);
diff --git a/tutorials/NotepadCodeLab/Notepadv3/src/com/android/demo/notepad3/NoteEdit.java b/tutorials/NotepadCodeLab/Notepadv3/src/com/android/demo/notepad3/NoteEdit.java
index dee7ff4..4855772 100755
--- a/tutorials/NotepadCodeLab/Notepadv3/src/com/android/demo/notepad3/NoteEdit.java
+++ b/tutorials/NotepadCodeLab/Notepadv3/src/com/android/demo/notepad3/NoteEdit.java
@@ -33,6 +33,7 @@
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.note_edit);
+        setTitle(R.string.edit_note);
 
         mTitleText = (EditText) findViewById(R.id.title);
         mBodyText = (EditText) findViewById(R.id.body);
diff --git a/tutorials/NotepadCodeLab/Notepadv3Solution/src/com/android/demo/notepad3/NoteEdit.java b/tutorials/NotepadCodeLab/Notepadv3Solution/src/com/android/demo/notepad3/NoteEdit.java
index b864784..3e0748f 100755
--- a/tutorials/NotepadCodeLab/Notepadv3Solution/src/com/android/demo/notepad3/NoteEdit.java
+++ b/tutorials/NotepadCodeLab/Notepadv3Solution/src/com/android/demo/notepad3/NoteEdit.java
@@ -37,6 +37,7 @@
         mDbHelper.open();
 
         setContentView(R.layout.note_edit);
+        setTitle(R.string.edit_note);
 
         mTitleText = (EditText) findViewById(R.id.title);
         mBodyText = (EditText) findViewById(R.id.body);