svn:keywords
[bootmanager.git] / source / ModelOptions.py
1 #!/usr/bin/python
2 #
3 # $Id$
4 # $URL$
5 #
6 # Copyright (c) 2003 Intel Corporation
7 # All rights reserved.
8 #
9 # Copyright (c) 2004-2006 The Trustees of Princeton University
10 # All rights reserved.
11
12
13 import string
14
15 MINHW   = 0x001
16 SMP     = 0x002
17 X86_64  = 0x004
18 INTEL   = 0x008
19 AMD     = 0x010
20 NUMA    = 0x020
21 GEODE   = 0x040
22 BADHD   = 0x080
23 LAST    = 0x100
24 RAWDISK = 0x200
25
26 modeloptions = {'smp':SMP,
27                 'x64':X86_64,
28                 'i64':X86_64|INTEL,
29                 'a64':X86_64|AMD,
30                 'i32':INTEL,
31                 'a32':AMD,
32                 'numa':NUMA,
33                 'geode':GEODE,
34                 'badhd':BADHD,
35                 'minhw':MINHW,
36                 'rawdisk':RAWDISK}
37
38 def Get(model):
39     modelinfo = string.split(model,'/')
40     options= 0
41     for mi in modelinfo:
42         info = string.strip(mi)
43         info = info.lower()
44         options = options | modeloptions.get(info,0)
45
46     return options
47