about summary refs log tree commit diff stats
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/USAGE.md28
-rw-r--r--docs/box64.pod31
-rw-r--r--docs/gen/gen.py34
-rw-r--r--docs/gen/usage.json62
4 files changed, 130 insertions, 25 deletions
diff --git a/docs/USAGE.md b/docs/USAGE.md
index c81e9948..7240a773 100644
--- a/docs/USAGE.md
+++ b/docs/USAGE.md
@@ -171,6 +171,14 @@ Add --no-sandbox argument to the guest program.
 
 ## Compatibility
 
+### BOX64_AVX
+
+Expose AVX extension to CPUID and cpuinfo file. Default value is 2 on Arm64 because it's fully implemented in DynaRec, 0 otherwise.
+
+ * 0: Do not expose AVX capabilities. 
+ * 1: Expose AVX, BMI1, F16C and VAES extensions to CPUID and cpuinfo file. 
+ * 2: All in 1, plus AVX2, BMI2, FMA, ADX,VPCLMULQDQ and RDRAND extensions. 
+
 ### BOX64_BASH
 
 Path to the bash executable.
@@ -462,9 +470,9 @@ Set the address where the program is loaded, only active for PIE guest programs.
 
 ### BOX64_LOG
 
-Enable or disable Box64 logs.
+Enable or disable Box64 logs, default value is 0 if stdout is not terminal, 1 otherwise.
 
- * 0: Disable Box64 logs. [Default]
+ * 0: Disable Box64 logs. 
  * 1: Enable minimal Box64 logs. 
  * 2: Enable debug level Box64 logs. 
  * 3: Enable verbose level Box64 logs. 
@@ -473,7 +481,7 @@ Enable or disable Box64 logs.
 
 Disable the Box64 banner.
 
- * 0: Show the Box64 banner. [Default]
+ * 0: Show the Box64 banner. 
  * 1: Do not show the Box64 banner. 
 
 ### BOX64_NOSIGSEGV
@@ -567,6 +575,13 @@ Only available on box64 build with trace. Adds trace of all instructions execute
 
 ## Performance
 
+### BOX64_DYNAREC
+
+Enable/disable the Dynamic Recompiler (a.k.a DynaRec). This option defaults to 1 if it's enabled in the build options for a supported architecture.
+
+ * 0: Disable DynaRec. 
+ * 1: Enable DynaRec. 
+
 ### BOX64_DYNAREC_ALIGNED_ATOMICS
 
 Generate aligned atomics only (only available on Arm64 for now).
@@ -684,6 +699,13 @@ Tweak the memory barriers to reduce the performance impact by strong memory emua
  * 1: Use weak barriers to have more performance boost. [Default]
  * 2: All in 1, plus disabled the last write barriers. 
 
+### BOX64_MMAP32
+
+Force 32-bit compatible memory mappings on 64-bit programs that run 32-bit code (like Wine WOW64), can improve performance.
+
+ * 0: Do not force 32-bit memory mappings. 
+ * 1: Force 32-bit memory mappings. [Default]
+
 ### BOX64_NODYNAREC
 
 Forbid dynablock creation in the address range specified, helpful for debugging behaviour difference between Dynarec and Interpreter.
diff --git a/docs/box64.pod b/docs/box64.pod
index 9453ebb8..444d5702 100644
--- a/docs/box64.pod
+++ b/docs/box64.pod
@@ -73,6 +73,15 @@ Arguments to pass to the guest program, only valid if there is no existing argum
  * XXXX YYYY ZZZZ : Pass arguments XXXX, YYYY and ZZZZ to the guest program. 
 
 
+=item B<BOX64_AVX> =I<0|1|2>
+
+Expose AVX extension to CPUID and cpuinfo file. Default value is 2 on Arm64 because it's fully implemented in DynaRec, 0 otherwise.
+
+ * 0 : Do not expose AVX capabilities. 
+ * 1 : Expose AVX, BMI1, F16C and VAES extensions to CPUID and cpuinfo file. 
+ * 2 : All in 1, plus AVX2, BMI2, FMA, ADX,VPCLMULQDQ and RDRAND extensions. 
+
+
 =item B<BOX64_BASH> =I<XXXX>
 
 Path to the bash executable.
@@ -128,6 +137,14 @@ Dump elfloader debug information.
  * 1 : Dump elfloader debug information. 
 
 
+=item B<BOX64_DYNAREC> =I<0|1>
+
+Enable/disable the Dynamic Recompiler (a.k.a DynaRec). This option defaults to 1 if it's enabled in the build options for a supported architecture.
+
+ * 0 : Disable DynaRec. 
+ * 1 : Enable DynaRec. 
+
+
 =item B<BOX64_DYNAREC_ALIGNED_ATOMICS> =I<0|1>
 
 Generate aligned atomics only (only available on Arm64 for now).
@@ -484,9 +501,9 @@ Set the address where the program is loaded, only active for PIE guest programs.
 
 =item B<BOX64_LOG> =I<0|1|2|3>
 
-Enable or disable Box64 logs.
+Enable or disable Box64 logs, default value is 0 if stdout is not terminal, 1 otherwise.
 
- * 0 : Disable Box64 logs. [Default]
+ * 0 : Disable Box64 logs. 
  * 1 : Enable minimal Box64 logs. 
  * 2 : Enable debug level Box64 logs. 
  * 3 : Enable verbose level Box64 logs. 
@@ -509,11 +526,19 @@ Maximum CPU cores exposed.
  * XXXX : Use XXXX CPU cores. 
 
 
+=item B<BOX64_MMAP32> =I<0|1>
+
+Force 32-bit compatible memory mappings on 64-bit programs that run 32-bit code (like Wine WOW64), can improve performance.
+
+ * 0 : Do not force 32-bit memory mappings. 
+ * 1 : Force 32-bit memory mappings. [Default]
+
+
 =item B<BOX64_NOBANNER> =I<0|1>
 
 Disable the Box64 banner.
 
- * 0 : Show the Box64 banner. [Default]
+ * 0 : Show the Box64 banner. 
  * 1 : Do not show the Box64 banner. 
 
 
diff --git a/docs/gen/gen.py b/docs/gen/gen.py
index a21dc57d..710e973b 100644
--- a/docs/gen/gen.py
+++ b/docs/gen/gen.py
@@ -186,19 +186,21 @@ with open(env_file, "r") as file:
 
                 if t not in matches:
                     matches[t] = {}
-                matches[t][m.group("define")] = m
-                break
+                if (m.group("define") in matches[t]):
+                    # multiple definitions, no default
+                    matches[t][m.group("define")]['no_default'] = True
+                    break
+                matches[t][m.group("define")] = m.groupdict()
+                matches[t][m.group("define")]['no_default'] = False
 
 for define, m in matches["INTEGER"].items():
-    name = m.group("name")
-    default = (
-        0 if m.group("default") == "DEFAULT_LOG_LEVEL" else int(m.group("default"))
-    )
-    min = int(m.group("min"))
-    max = int(m.group("max"))
+    name = m["name"]
+    default = None if m["no_default"] or not m["default"].isdigit() else int(m["default"])
+    min = int(m["min"])
+    max = int(m["max"])
 
     # Check default in valid range
-    if default < min or default > max:
+    if default and (default < min or default > max):
         print(f"{define:<{PADDING}}: default lays outside of min/max range")
 
     # Check consistency with usage.json
@@ -231,15 +233,15 @@ for define, m in matches["INTEGER"].items():
                 print(
                     f"{define:<{PADDING}}: max value mismatch: env.h={max}, usage.json={max2}{(' (possible false positive)' if blank else '')}"
                 )
-        if default2 and default2 != default:
+        if default2 != default:
             print(
                 f"{define:<{PADDING}}: default value mismatch: env.h={default}, usage.json={default2}"
             )
 
 for define, m in matches["INTEGER64"].items():
     # similar to INTEGER but without min/max
-    name = m.group("name")
-    default = int(m.group("default"))
+    name = m["name"]
+    default = None if m["no_default"] or not m["default"].isdigit() else int(m["default"])
 
     # Check consistency with usage.json
     if e := get_usage_entry(data, define):
@@ -253,14 +255,14 @@ for define, m in matches["INTEGER64"].items():
             if o["default"]:
                 default2 = val
 
-        if default2 and default2 != default:
+        if default2 != default:
             print(
                 f"{define:<{PADDING}}: default value mismatch: env.h={default}, usage.json={default2}"
             )
 
 for define, m in matches["BOOLEAN"].items():
-    name = m.group("name")
-    default = bool(m.group("default"))
+    name = m["name"]
+    default = None if m["no_default"] or m["default"] not in ["0", "1"] else bool(m["default"])
 
     # Check consistency with usage.json
     if e := get_usage_entry(data, define):
@@ -274,7 +276,7 @@ for define, m in matches["BOOLEAN"].items():
             if o["default"]:
                 default2 = val
 
-        if default2 and default2 != default:
+        if default2 != default:
             print(
                 f"{define:<{PADDING}}: default value mismatch: env.h={default}, usage.json={default2}"
             )
diff --git a/docs/gen/usage.json b/docs/gen/usage.json
index 4702a2e9..9dc1a30a 100644
--- a/docs/gen/usage.json
+++ b/docs/gen/usage.json
@@ -51,6 +51,28 @@
     ]
   },
   {
+    "name": "BOX64_AVX",
+    "description": "Expose AVX extension to CPUID and cpuinfo file. Default value is 2 on Arm64 because it's fully implemented in DynaRec, 0 otherwise.",
+    "category": "Compatibility",
+    "options": [
+      {
+        "key": "0",
+        "description": "Do not expose AVX capabilities.",
+        "default": false
+      },
+      {
+        "key": "1",
+        "description": "Expose AVX, BMI1, F16C and VAES extensions to CPUID and cpuinfo file.",
+        "default": false
+      },
+      {
+        "key": "2",
+        "description": "All in 1, plus AVX2, BMI2, FMA, ADX,VPCLMULQDQ and RDRAND extensions.",
+        "default": false
+      }
+    ]
+  },
+  {
     "name": "BOX64_BASH",
     "description": "Path to the bash executable.",
     "category": "Compatibility",
@@ -165,6 +187,23 @@
     ]
   },
   {
+    "name": "BOX64_DYNAREC",
+    "description": "Enable/disable the Dynamic Recompiler (a.k.a DynaRec). This option defaults to 1 if it's enabled in the build options for a supported architecture.",
+    "category": "Performance",
+    "options": [
+      {
+        "key": "0",
+        "description": "Disable DynaRec.",
+        "default": false
+      },
+      {
+        "key": "1",
+        "description": "Enable DynaRec.",
+        "default": false
+      }
+    ]
+  },
+  {
     "name": "BOX64_DYNAREC_ALIGNED_ATOMICS",
     "description": "Generate aligned atomics only (only available on Arm64 for now).",
     "category": "Performance",
@@ -970,13 +1009,13 @@
   },
   {
     "name": "BOX64_LOG",
-    "description": "Enable or disable Box64 logs.",
+    "description": "Enable or disable Box64 logs, default value is 0 if stdout is not terminal, 1 otherwise.",
     "category": "Debugging",
     "options": [
       {
         "key": "0",
         "description": "Disable Box64 logs.",
-        "default": true
+        "default": false
       },
       {
         "key": "1",
@@ -1035,6 +1074,23 @@
     ]
   },
   {
+    "name": "BOX64_MMAP32",
+    "description": "Force 32-bit compatible memory mappings on 64-bit programs that run 32-bit code (like Wine WOW64), can improve performance.",
+    "category": "Performance",
+    "options": [
+      {
+        "key": "0",
+        "description": "Do not force 32-bit memory mappings.",
+        "default": false
+      },
+      {
+        "key": "1",
+        "description": "Force 32-bit memory mappings.",
+        "default": true
+      }
+    ]
+  },
+  {
     "name": "BOX64_NOBANNER",
     "description": "Disable the Box64 banner.",
     "category": "Debugging",
@@ -1042,7 +1098,7 @@
       {
         "key": "0",
         "description": "Show the Box64 banner.",
-        "default": true
+        "default": false
       },
       {
         "key": "1",