Permalink
Browse files

For sysctl(), return the correct target hw.machine and hw.machine_arch.

  • Loading branch information...
staceyson committed Mar 29, 2013
1 parent 0f6cf6c commit 5b26fc7276662d29506dfbe020c1c73892325cd3
@@ -1,6 +1,9 @@
#ifndef _TARGET_VMPARAM_H_
#define _TARGET_VMPARAM_H_
+#define TARGET_HW_MACHINE "arm"
+#define TARGET_HW_MACHINE_ARCH "armv6"
+
#if defined(__FreeBSD__)
/* KERNBASE - 512 MB */
#define TARGET_VM_MAXUSER_ADDRESS (0xc0000000 - (512 * 1024 * 1024))
@@ -1,6 +1,9 @@
#ifndef _TARGET_VMPARAM_H_
#define _TARGET_VMPARAM_H_
+#define TARGET_HW_MACHINE "i386"
+#define TARGET_HW_MACHINE_ARCH "i386"
+
#if defined(__FreeBSD__)
#define TARGET_USRSTACK (0xbfc00000)
@@ -1,6 +1,9 @@
#ifndef _TARGET_VMPARAM_H_
#define _TARGET_VMPARAM_H_
+#define TARGET_HW_MACHINE "mips"
+#define TARGET_HW_MACHINE_ARCH "mips"
+
#if defined(__FreeBSD__)
#define TARGET_VM_MINUSER_ADDRESS (0x00000000)
#define TARGET_VM_MAXUSER_ADDRESS (0x80000000)
@@ -1,6 +1,9 @@
#ifndef _TARGET_VMPARAM_H_
#define _TARGET_VMPARAM_H_
+#define TARGET_HW_MACHINE "mips"
+#define TARGET_HW_MACHINE_ARCH "mips64"
+
#if defined(__FreeBSD__)
#define TARGET_VM_MINUSER_ADDRESS (0x0000000000000000UL)
@@ -1,6 +1,9 @@
#ifndef _TARGET_VMPARAM_H_
#define _TARGET_VMPARAM_H_
+#define TARGET_HW_MACHINE "sparc"
+#define TARGET_HW_MACHINE_ARCH "sparc"
+
#ifdef __FreeBSD__
struct target_ps_strings {
abi_ulong ps_argvstr;
@@ -1,6 +1,9 @@
#ifndef _TARGET_VMPARAM_H_
#define _TARGET_VMPARAM_H_
+#define TARGET_HW_MACHINE "sparc"
+#define TARGET_HW_MACHINE_ARCH "sparc64"
+
#if defined(__FreeBSD__)
#define TARGET_VM_MINUSER_ADDRESS (0x0000000000000000UL)
#define TARGET_VM_MAXUSER_ADDRESS (0x000007fe00000000UL)
@@ -568,6 +568,22 @@ static abi_long do_freebsd_sysctl(abi_ulong namep, int32_t namelen, abi_ulong ol
}
break;
+ case CTL_HW:
+ switch(snamep[1]) {
+ case HW_MACHINE:
+ strlcpy(holdp, TARGET_HW_MACHINE, oldlen);
+ ret = 0;
+ goto out;
+
+ case HW_MACHINE_ARCH:
+ strlcpy(holdp, TARGET_HW_MACHINE_ARCH, oldlen);
+ ret = 0;
+ goto out;
+
+ default:
+ break;
+ }
+
default:
break;
}
@@ -1,6 +1,9 @@
#ifndef _TARGET_VMPARAM_H_
#define _TARGET_VMPARAM_H_
+#define TARGET_HW_MACHINE "amd64"
+#define TARGET_HW_MACHINE_ARCH "amd64"
+
#if defined(__FreeBSD__)
#define TARGET_VM_MAXUSER_ADDRESS (0x0000800000000000UL)

0 comments on commit 5b26fc7

Please sign in to comment.