Archana | fdbbcba | 2022-02-27 05:38:55 +0530 | [diff] [blame] | 1 | {# One Shot function's dispatch code for opaque drivers. |
| 2 | Expected inputs: |
| 3 | * drivers: the list of driver descriptions. |
| 4 | * entry_point: the name of the entry point that this function dispatches to. |
| 5 | * entry_point_param(driver): the parameters to pass to the entry point. |
| 6 | * nest_indent: number of extra spaces to indent the code to. |
| 7 | -#} |
Archana | e829cd6 | 2021-12-24 12:50:36 +0530 | [diff] [blame] | 8 | {% for driver in drivers if driver.type == "opaque" -%} |
| 9 | {% for capability in driver.capabilities if entry_point in capability.entry_points -%} |
Archana | a2cac32 | 2022-04-14 09:31:28 +0530 | [diff] [blame] | 10 | #if ({% if capability['mbedtls/c_condition'] is defined -%}{{ capability['mbedtls/c_condition'] }} {% else -%} {{ 1 }} {% endif %}) |
Archana | e829cd6 | 2021-12-24 12:50:36 +0530 | [diff] [blame] | 11 | {%- filter indent(width = nest_indent) %} |
| 12 | case {{ driver.location }}: |
Archana | fdbbcba | 2022-02-27 05:38:55 +0530 | [diff] [blame] | 13 | return( {{ entry_point_name(capability, entry_point, driver) }}({{entry_point_param(driver) | indent(20)}})); |
Archana | e829cd6 | 2021-12-24 12:50:36 +0530 | [diff] [blame] | 14 | {% endfilter -%} |
| 15 | #endif |
| 16 | {% endfor %} |
| 17 | {% endfor %} |