Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Oct 2000 17:55:03 -0700 (PDT)
From:      Jim.Pirzyk@disney.com
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   alpha/22263: Additions to OSF1 emulation module
Message-ID:  <200010240055.RAA03772@beta.fan.fa.disney.com>

next in thread | raw e-mail | index | archive | help

>Number:         22263
>Category:       alpha
>Synopsis:       OSF1 Module needed some more getsysinfo op codes implemented
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-alpha
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Oct 23 18:00:01 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Jim Pirzyk
>Release:        FreeBSD 4.1-RELEASE alpha
>Organization:
>Environment:

	FreeBSD 4.1-RELEASE on a Alpha DS20

>Description:

	shake uses the following osf1_getsysinfo op codes  (19, 30, 55, 59, 103)

	from /var/log/messages:

	Oct 20 20:30:15 <kern.crit> beta /kernel: osf1_getsysinfo called with unknown op=103
	Oct 20 20:30:15 <kern.crit> beta /kernel: osf1_getsysinfo called with unknown op=59
	Oct 20 20:30:15 <kern.crit> beta /kernel: osf1_getsysinfo called with unknown op=30
	Oct 20 20:30:15 <kern.crit> beta /kernel: osf1_getsysinfo called with unknown op=55
	Oct 20 20:30:15 <kern.crit> beta /kernel: osf1_getsysinfo called with unknown op=19
	Oct 21 10:34:34 <kern.crit> beta /kernel: osf1_getsysinfo called with unknown op=59


>How-To-Repeat:

	run shake on a freebsd alpha system

>Fix:

*** osf1.h.orig	Wed Jan  5 18:37:45 2000
--- osf1.h	Sat Oct 21 10:39:06 2000
***************
*** 45,54 ****
  #define	OSF1_IOCCMD(x)		((x) & 0xff)
  
  /* for get sysinfo */
! #define OSF_GET_MAX_UPROCS	  2
! #define	OSF_GET_IEEE_FP_CONTROL  45
! #define	OSF_GET_PROC_TYPE	 60
  #define	OSF_GET_HWRPB		101
  
  /* for set sysinfo */
  #define	OSF_SET_IEEE_FP_CONTROL  14
--- 45,59 ----
  #define	OSF1_IOCCMD(x)		((x) & 0xff)
  
  /* for get sysinfo */
! #define	OSF_GET_MAX_UPROCS	2
! #define	OSF_GET_PHYSMEM		19
! #define	OSF_GET_MAX_CPU		30
! #define	OSF_GET_IEEE_FP_CONTROL 45
! #define	OSF_GET_CPUS_IN_BOX	55
! #define	OSF_GET_CPU_INFO	59
! #define	OSF_GET_PROC_TYPE	60
  #define	OSF_GET_HWRPB		101
+ #define	OSF_GET_PLATFORM_NAME	103
  
  /* for set sysinfo */
  #define	OSF_SET_IEEE_FP_CONTROL  14
*** osf1_misc.c.orig	Fri Jan 28 22:31:27 2000
--- osf1_misc.c	Sat Oct 21 11:06:18 2000
***************
*** 268,273 ****
--- 268,278 ----
  	struct osf1_getsysinfo_args *uap;
  {
  	int error, retval;
+ 	extern char cpu_model[128];
+ 	extern int ncpus;
+ 	int unit;
+ 	long percpu;
+ 	long proctype;
  
  	error = retval = 0;
  
***************
*** 277,292 ****
  		    sizeof(maxprocperuid));
  		retval = 1;
  		break;
  	case OSF_GET_IEEE_FP_CONTROL:
  		error = copyout(&p->p_addr->u_pcb.pcb_fp_control,uap->buffer,
  		    sizeof(p->p_addr->u_pcb.pcb_fp_control));
  		retval = 1;
  		break;
! 	case OSF_GET_PROC_TYPE:	{
! 		int unit;
! 		long percpu;
! 		long proctype;
  
  		if(uap->nbytes < sizeof(proctype))
  			error = EINVAL;
  		else {
--- 282,328 ----
  		    sizeof(maxprocperuid));
  		retval = 1;
  		break;
+ 	case OSF_GET_PHYSMEM:
+ 		error = copyout(&physmem, uap->buffer,
+ 		    sizeof(physmem));
+ 		retval = 1;
+ 		break;
+ 	case OSF_GET_MAX_CPU:
+ 	case OSF_GET_CPUS_IN_BOX:
+ 		error = copyout(&ncpus, uap->buffer,
+ 		    sizeof(ncpus));
+ 		retval = 1;
+ 		break;
  	case OSF_GET_IEEE_FP_CONTROL:
  		error = copyout(&p->p_addr->u_pcb.pcb_fp_control,uap->buffer,
  		    sizeof(p->p_addr->u_pcb.pcb_fp_control));
  		retval = 1;
  		break;
! 	case OSF_GET_CPU_INFO: {
! 		struct osf1_cpu_info cpuinfo;
! 
! 		cpuinfo.current_cpu = 0;
! 		cpuinfo.cpus_in_box = ncpus;
! 
! 		if(uap->nbytes < sizeof(proctype))
! 			error = EINVAL;
! 		else {
! 			unit = alpha_pal_whami();
! 			cpuinfo.cpu_type = LOCATE_PCS(hwrpb, unit)->pcs_proc_type;
! 		}
  
+ 		cpuinfo.ncpus = ncpus;
+ 		cpuinfo.cpus_present = ncpus;
+ 		cpuinfo.cpus_running = ncpus;
+ 		cpuinfo.cpu_binding = 1;
+ 		cpuinfo.cpu_ex_binding = 0;
+ 		cpuinfo.mhz = hwrpb->rpb_cc_freq / 1000000;
+ 		error = copyout(&cpuinfo, uap->buffer,
+ 		    sizeof(cpuinfo));
+ 		retval = 1;
+ 	}
+ 		break;
+ 	case OSF_GET_PROC_TYPE:	{
  		if(uap->nbytes < sizeof(proctype))
  			error = EINVAL;
  		else {
***************
*** 312,317 ****
--- 348,357 ----
  			retval = 1;
  		}
  	}
+ 		break;
+ 	case OSF_GET_PLATFORM_NAME:
+ 		error = copyout(cpu_model, uap->buffer, sizeof(cpu_model));
+ 		retval = 1;
  		break;
  	default:
  		printf("osf1_getsysinfo called with unknown op=%ld\n", uap->op);
*** osf1_proto.h.orig	Tue Dec 14 14:37:08 1999
--- osf1_proto.h	Sat Oct 21 10:44:53 2000
***************
*** 277,282 ****
--- 277,296 ----
  	caddr_t	arg;	char arg_[PAD_(caddr_t)];
  	u_long	flag;	char flag_[PAD_(u_long)];
  };
+ 
+ struct	osf1_cpu_info {
+ 	int     current_cpu;
+ 	int     cpus_in_box;
+ 	int     cpu_type;
+ 	int     ncpus;
+ 	u_long cpus_present;
+ 	u_long cpus_running;
+ 	u_long cpu_binding;
+ 	u_long cpu_ex_binding;
+ 	int  mhz;
+ 	int  unused[3];     /* future expansion */
+ };
+ 
  struct	osf1_setsysinfo_args {
  	u_long	op;	char op_[PAD_(u_long)];
  	caddr_t	buffer;	char buffer_[PAD_(caddr_t)];

>Release-Note:
>Audit-Trail:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-alpha" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200010240055.RAA03772>