Added all three UARTs as capability

This commit is contained in:
Amit Mahajan
2009-11-24 11:07:23 +05:30
parent 452406ddeb
commit 1f939a1786
3 changed files with 122 additions and 2 deletions

View File

@@ -139,6 +139,18 @@ cap_strings = { 'ipc' : \
\t\t\t\t.size = ${size},
\t\t\t},
'''
, 'uart' : \
'''
\t\t\t[${idx}] = {
\t\t\t\t/* For device selection. */
\t\t\t\t.target = ${cid},
\t\t\t\t.devid = ${devid},
\t\t\t\t.type = CAP_DEVTYPE_UART | CAP_TYPE_MAP_PHYSMEM | CAP_RTYPE_CONTAINER,
\t\t\t\t.access = CAP_MAP_READ | CAP_MAP_WRITE | CAP_MAP_EXEC |
\t\t\t\t\tCAP_MAP_CACHED | CAP_MAP_UNCACHED | CAP_MAP_UNMAP | CAP_MAP_UTCB,
\t\t\t\t.start = 0, .end = 0, .size = 0,
\t\t\t},
'''
}
@@ -187,7 +199,17 @@ def prepare_typed_capability(cont, param, val):
# USE makes us assign the initial cap string with blank fields
if 'USE' in params:
cont.caps[captype] = cap_strings[captype]
# Special case for device
if 'DEVICE' in params:
# Extract device name and number
devnum = captype[-1:]
devname = captype[: -1]
cont.caps[captype] = cap_strings[devname]
else:
cont.caps[captype] = cap_strings[captype]
# Prepare string template from capability type
templ = Template(cont.caps[captype])
@@ -196,6 +218,10 @@ def prepare_typed_capability(cont, param, val):
if captype[-len('pool'):] == 'pool':
cont.caps[captype] = templ.safe_substitute(cid = cont.id)
# If device, amend current container id and devnum as default
if 'DEVICE' in params:
cont.caps[captype] = templ.safe_substitute(cid = cont.id, devid = devnum)
# Fill in the blank size field
elif 'SIZE' in params:
# Get reference to capability string template