debuggers.hg

view tools/xm-test/lib/XmTestReport/arch.py @ 0:7d21f7218375

Exact replica of unstable on 051908 + README-this
author Mukesh Rathor
date Mon May 19 15:34:57 2008 -0700 (2008-05-19)
parents
children
line source
1 #!/usr/bin/python
2 """
3 arch.py - Encapsulate all logic regarding what type of hardware xen
4 is running on to make adding new platforms easier.
6 Copyright (C) 2006 Tony Breeds IBM Corporation
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; under version 2 of the License.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 """
23 import os
25 """Convert from uname specification to a more general platform."""
26 _uname_to_arch_map = {
27 "i386" : "x86",
28 "i486" : "x86",
29 "i586" : "x86",
30 "i686" : "x86",
31 "x86_64": "x86_64",
32 "ia64" : "ia64",
33 }
35 _arch = _uname_to_arch_map.get(os.uname()[4], "Unknown")
36 if _arch == "x86":
37 cpuValues = {"model_name" : "Unknown",
38 "flags" : "Unknown"}
39 elif _arch == "x86_64":
40 cpuValues = {"model_name" : "Unknown",
41 "flags" : "Unknown"}
42 elif _arch == "ia64":
43 cpuValues = {"arch" : "Unknown",
44 "features" : "Unknown"}
45 else:
46 raise ValueError, "Unknown architecture!"