bitkeeper revision 1.1718.1.6 (42b5a5f3otSuOxDZ6KTFKrxR1U1m4Q)

Extend the xen_version hypercall to return extraversion and compile 
info.
Signed-off-by: Nguyen Anh Quynh <aquynh@gmail.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
This commit is contained in:
kaf24@firebug.cl.cam.ac.uk committed 2005-06-19 17:05:55 +00:00
1 parent 6c25db681a
commit 6b76d296bb
4 files changed
+69 -8

No files matched your search

+1
View File
@@ -1504,6 +1504,7 @@
4051db79512nOCGweabrFWO2M2h5ng xen/include/public/physdev.h
40589968wmhPmV5-ENbBYmMjnedgKw xen/include/public/sched_ctl.h
404f3d2eR2Owk-ZcGOx9ULGHg3nrww xen/include/public/trace.h
42b5a5f2QC1IxeuwCwwsOEhvcJ2BJg xen/include/public/version.h
4266bd01Ul-pC01ZVvBkhBnv5eqzvw xen/include/public/vmx_assist.h
3ddb79c25UE59iu4JJcbRalx95mvcg xen/include/public/xen.h
3e397e66m2tO3s-J8Jnr7Ws_tGoPTg xen/include/xen/ac_timer.h
+33 -8
View File
@@ -1,10 +1,7 @@
/******************************************************************************
* kernel.c
*
* This file should contain architecture-independent bootstrap and low-level
* help routines. It's a bit x86/PC specific right now!
*
* Copyright (c) 2002-2003 K A Fraser
* Copyright (c) 2002-2005 K A Fraser
*/
#include <xen/config.h>
@@ -14,6 +11,7 @@
#include <xen/compile.h>
#include <xen/sched.h>
#include <asm/current.h>
#include <public/version.h>
void cmdline_parse(char *cmdline)
{
@@ -83,11 +81,38 @@ void cmdline_parse(char *cmdline)
* Simple hypercalls.
*/
long do_xen_version(int cmd)
long do_xen_version(int cmd, void *arg)
{
if ( cmd != 0 )
return -ENOSYS;
return (XEN_VERSION<<16) | (XEN_SUBVERSION);
switch ( cmd )
{
case XENVER_version:
{
return (XEN_VERSION<<16) | (XEN_SUBVERSION);
}
case XENVER_extraversion:
{
char extraversion[16];
safe_strcpy(extraversion, XEN_EXTRAVERSION);
if ( copy_to_user(arg, extraversion, sizeof(extraversion)) )
return -EFAULT;
return 0;
}
case XENVER_compile_info:
{
struct xen_compile_info info;
safe_strcpy(info.compiler, XEN_COMPILER);
safe_strcpy(info.compile_by, XEN_COMPILE_BY);
safe_strcpy(info.compile_domain, XEN_COMPILE_DOMAIN);
safe_strcpy(info.compile_date, XEN_COMPILE_DATE);
if ( copy_to_user(arg, &info, sizeof(info)) )
return -EFAULT;
return 0;
}
}
return -ENOSYS;
}
long do_vm_assist(unsigned int cmd, unsigned int type)
+30
View File
@@ -0,0 +1,30 @@
/******************************************************************************
* version.h
*
* Xen version, type, and compile information.
*
* Copyright (c) 2005, Nguyen Anh Quynh <aquynh@gmail.com>
* Copyright (c) 2005, Keir Fraser <keir@xensource.com>
*/
#ifndef __XEN_PUBLIC_VERSION_H__
#define __XEN_PUBLIC_VERSION_H__
/* NB. All ops return zero on success, except XENVER_version. */
/* arg == NULL; returns major:minor (16:16). */
#define XENVER_version 0
/* arg == 16-char string buffer. */
#define XENVER_extraversion 1
/* arg == xenversion_compile_info_t. */
#define XENVER_compile_info 2
typedef struct xen_compile_info {
char compiler[64];
char compile_by[16];
char compile_domain[32];
char compile_date[32];
} xen_compile_info_t;
#endif /* __XEN_PUBLIC_VERSION_H__ */
+5
View File
@@ -81,4 +81,9 @@ extern void * memchr(const void *,int,__kernel_size_t);
}
#endif
#define safe_strcpy(d,s) \
do { strncpy((d),(s),sizeof((d))); \
(d)[sizeof((d))-1] = '\0'; \
} while (0)
#endif /* _LINUX_STRING_H_ */
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.