From: Gerd Hoffmann Subject: Re: 32-on-64: pvfb issue Date: Fri, 19 Jan 2007 16:31:13 +0100 Message-ID: <45B0E441.2060903@suse.de> References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------040002020004020902020101" Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: Xen devel list , Markus Armbruster List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --------------040002020004020902020101 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Keir Fraser wrote: > You missed out the patch. Oops, attached. > I'm sure however that I'll argue you should make > the enumeration local to the backend. It will always support his native > architecture. Where it supports cross-architecture (i386-on-x64) he can > *privately* have a numeric assignment for that situation which it uses on > data paths. Then we don't have redundant info in xenstore and we don't get > tied to particular magic numbers. I don't want to put numbers into xenstore. But there are multiple backends affected (pvfb, blktab, blkback, tpm, maybe more) and thus it would be useful to share the infrastructure IMHO ... cheers, Gerd -- Gerd Hoffmann --------------040002020004020902020101 Content-Type: text/x-patch; name="protocol-bimodal.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="protocol-bimodal.diff" --- linux-2.6-xen-sparse/include/xen/protocols.h | 57 +++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) Index: build-32-unstable-13495/linux-2.6-xen-sparse/include/xen/protocols.h =================================================================== --- /dev/null +++ build-32-unstable-13495/linux-2.6-xen-sparse/include/xen/protocols.h @@ -0,0 +1,57 @@ +#ifndef __XEN_PROTOCOLS_H__ +#define __XEN_PROTOCOLS_H__ + +enum xen_io_proto_id { + /* For all front/backends */ + XEN_IO_PROTO_ABI_X86_32 = 1, + XEN_IO_PROTO_ABI_X86_64 = 2, + XEN_IO_PROTO_ABI_IA64 = 3, + XEN_IO_PROTO_ABI_POWERPC64 = 4, + + /* framebuffer via grant tables on little endian machines */ + XEN_IO_PROTO_FB_LE_GRANT = 5, +}; + +static const char *xen_io_proto_names[] = { + [ XEN_IO_PROTO_ABI_X86_32 ] = "x86_32-abi", + [ XEN_IO_PROTO_ABI_X86_64 ] = "x86_64-abi", + [ XEN_IO_PROTO_ABI_IA64 ] = "ia64-abi", + [ XEN_IO_PROTO_ABI_POWERPC64 ] = "powerpc64-abi", + + [ XEN_IO_PROTO_FB_LE_GRANT ] = "fb-le-grant", +}; +#define XEN_IO_PROTO_COUNT (sizeof(xen_io_proto_names)/sizeof(xen_io_proto_names[0])) + +static enum xen_io_proto_id xen_io_proto_name2id(const char *name) +{ + int id; + + for (id = 0; id < XEN_IO_PROTO_COUNT; id++) { + if (!xen_io_proto_names[id]) + continue; + if (0 != strcmp(name, xen_io_proto_names[id])) + continue; + return i; + } +} + +static const char *xen_io_proto_id2name(enum xen_io_proto_id id) +{ + if (id >= XEN_IO_PROTO_COUNT) + return NULL; + return xen_io_proto_names[id]; +} + +#if defined(__i386__) +# define XEN_IO_PROTO_ABI_NATIVE XEN_IO_PROTO_ABI_X86_32 +#elif defined(__x86_64__) +# define XEN_IO_PROTO_ABI_NATIVE XEN_IO_PROTO_ABI_X86_64 +#elif defined(__ia64__) +# define XEN_IO_PROTO_ABI_NATIVE XEN_IO_PROTO_ABI_IA64 +#elif defined(__powerpc64__) +# define XEN_IO_PROTO_ABI_NATIVE XEN_IO_PROTO_ABI_POWERPC64 +#else +# error arch fixup needed here +#endif + +#endif --------------040002020004020902020101 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --------------040002020004020902020101--