summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Hellstrom <daniel@gaisler.com>2021-08-26 12:25:00 +0200
committerDaniel Hellstrom <daniel@gaisler.com>2021-08-26 12:25:00 +0200
commitabb6e9cc2a353b7b8432b8e6b66aa519a4ae65c9 (patch)
tree5ebf521bf7b7266b7010e62ac129b4da8bbb3bfd
parent375b26928fc2df6297c2eba2523f084680112a5a (diff)
grlib,gr1553bc: set table size by default when allocating list tablercc-v1.3.1
Unless it is set by the user the ISR will not process the list.
-rw-r--r--bsps/shared/grlib/1553/gr1553bc.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/bsps/shared/grlib/1553/gr1553bc.c b/bsps/shared/grlib/1553/gr1553bc.c
index cf18db0ad9..2cb86e93f3 100644
--- a/bsps/shared/grlib/1553/gr1553bc.c
+++ b/bsps/shared/grlib/1553/gr1553bc.c
@@ -281,7 +281,7 @@ int gr1553bc_list_table_alloc
)
{
struct gr1553bc_major *major;
- int i, j, minor_cnt, size;
+ int i, j, minor_cnt;
unsigned int table;
struct gr1553bc_priv *bcpriv = list->bc;
int retval = 0;
@@ -293,7 +293,7 @@ int gr1553bc_list_table_alloc
list->_table_custom = bdtab_custom;
/* Get Size required for descriptors */
- size = gr1553bc_list_table_size(list);
+ list->table_size = gr1553bc_list_table_size(list);
if ((unsigned int)bdtab_custom & 0x1) {
/* Address given in Hardware accessible address, we
@@ -306,11 +306,12 @@ int gr1553bc_list_table_alloc
DMAMEM_TO_CPU,
(void *)list->table_hw,
(void **)&list->table_cpu,
- size);
+ list->table_size);
} else {
if (bdtab_custom == NULL) {
/* Allocate descriptors */
- list->_table = grlib_malloc(size + (GR1553BC_BD_ALIGN-1));
+ list->_table = grlib_malloc(list->table_size +
+ (GR1553BC_BD_ALIGN-1));
if ( list->_table == NULL ) {
retval = -1;
goto err;
@@ -335,7 +336,7 @@ int gr1553bc_list_table_alloc
CPUMEM_TO_DMA,
(void *)list->table_cpu,
(void **)&list->table_hw,
- size
+ list->table_size
);
} else {
list->table_hw = list->table_cpu;
@@ -377,6 +378,7 @@ err:
list->table_hw = 0;
list->table_cpu = 0;
list->_table = NULL;
+ list->table_size = 0;
}
return retval;
}