StateMachine.py (10121:64545628f5a7) StateMachine.py (10228:1a85c4fc805c)
1# Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
2# Copyright (c) 2009 The Hewlett-Packard Development Company
3# All rights reserved.
4#
5# Redistribution and use in source and binary forms, with or without
6# modification, are permitted provided that the following conditions are
7# met: redistributions of source code must retain the above copyright
8# notice, this list of conditions and the following disclaimer;

--- 1239 unchanged lines hidden (view full) ---

1248
1249 actions = trans.actions
1250 request_types = trans.request_types
1251
1252 # Check for resources
1253 case_sorter = []
1254 res = trans.resources
1255 for key,val in res.iteritems():
1# Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
2# Copyright (c) 2009 The Hewlett-Packard Development Company
3# All rights reserved.
4#
5# Redistribution and use in source and binary forms, with or without
6# modification, are permitted provided that the following conditions are
7# met: redistributions of source code must retain the above copyright
8# notice, this list of conditions and the following disclaimer;

--- 1239 unchanged lines hidden (view full) ---

1248
1249 actions = trans.actions
1250 request_types = trans.request_types
1251
1252 # Check for resources
1253 case_sorter = []
1254 res = trans.resources
1255 for key,val in res.iteritems():
1256 if key.type.ident != "DNUCAStopTable":
1257 val = '''
1256 val = '''
1258if (!%s.areNSlotsAvailable(%s))
1259 return TransitionResult_ResourceStall;
1260''' % (key.code, val)
1261 case_sorter.append(val)
1262
1263 # Check all of the request_types for resource constraints
1264 for request_type in request_types:
1265 val = '''

--- 249 unchanged lines hidden ---
1257if (!%s.areNSlotsAvailable(%s))
1258 return TransitionResult_ResourceStall;
1259''' % (key.code, val)
1260 case_sorter.append(val)
1261
1262 # Check all of the request_types for resource constraints
1263 for request_type in request_types:
1264 val = '''

--- 249 unchanged lines hidden ---