aboutsummaryrefslogtreecommitdiff
path: root/hal.h
diff options
context:
space:
mode:
authorPaul Selkirk <paul@psgd.org>2018-01-04 13:15:30 -0500
committerPaul Selkirk <paul@psgd.org>2018-01-04 13:46:44 -0500
commit894181009ad3002d84d2ce6ea74bbd5aea068999 (patch)
tree0c46b96872195194051b6afd03fd6fbc2fe89af1 /hal.h
parentbc167c214e97ed35f39d088a7dee3f1a9511340e (diff)
Add hal_core_alloc2() to fix a dining philosophers problem in hal_modexp2().
Uncoordinated attempts to allocate two modexpa7 cores leads to deadlock if multiple clients try to do concurrent RSA signing operations. The simplest solution (back off and retry) could theoretically lead to resource starvation, but we haven't seen it in actual testing.
Diffstat (limited to 'hal.h')
-rw-r--r--hal.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/hal.h b/hal.h
index 0030f3d..a614335 100644
--- a/hal.h
+++ b/hal.h
@@ -226,6 +226,8 @@ extern hal_addr_t hal_core_base(const hal_core_t *core);
extern hal_core_t * hal_core_iterate(hal_core_t *core);
extern void hal_core_reset_table(void);
extern hal_error_t hal_core_alloc(const char *name, hal_core_t **core);
+extern hal_error_t hal_core_alloc2(const char *name1, hal_core_t **pcore1,
+ const char *name2, hal_core_t **pcore2);
extern void hal_core_free(hal_core_t *core);
extern void hal_critical_section_start(void);
extern void hal_critical_section_end(void);