Skip to content

Commit

Permalink
For sysctl(), return the correct target hw.machine and hw.machine_arch.
Browse files Browse the repository at this point in the history
  • Loading branch information
staceyson committed Mar 29, 2013
1 parent 0f6cf6c commit 5b26fc7
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 0 deletions.
3 changes: 3 additions & 0 deletions work/qemu-1.4.0/bsd-user/arm/target_vmparam.h
@@ -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))
Expand Down
3 changes: 3 additions & 0 deletions work/qemu-1.4.0/bsd-user/i386/target_vmparam.h
@@ -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)
Expand Down
3 changes: 3 additions & 0 deletions work/qemu-1.4.0/bsd-user/mips/target_vmparam.h
@@ -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)
Expand Down
3 changes: 3 additions & 0 deletions work/qemu-1.4.0/bsd-user/mips64/target_vmparam.h
@@ -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)
Expand Down
3 changes: 3 additions & 0 deletions work/qemu-1.4.0/bsd-user/sparc/target_vmparam.h
@@ -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;
Expand Down
3 changes: 3 additions & 0 deletions work/qemu-1.4.0/bsd-user/sparc64/target_vmparam.h
@@ -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)
Expand Down
16 changes: 16 additions & 0 deletions work/qemu-1.4.0/bsd-user/syscall.c
Expand Up @@ -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;
}
Expand Down
3 changes: 3 additions & 0 deletions work/qemu-1.4.0/bsd-user/x86_64/target_vmparam.h
@@ -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)

Expand Down

0 comments on commit 5b26fc7

Please sign in to comment.