grlib and users: Fix function cast warnings

grlib has places where a function similar to memcpy() can be
provided by the driver. The signature does not match memcpy()
which led to function cast warnings when memcpy() was sufficient.
Provided a wrapper function to aligned the signatures.
This commit is contained in:
Joel Sherrill
2026-01-08 17:03:18 -06:00
parent a5d3e5e8ef
commit 9a55909e09
3 changed files with 31 additions and 4 deletions

View File

@@ -303,8 +303,18 @@ static int ambapp_scan2(
return 0;
}
static void *ambapp_memcpy(
void *dest,
const void *src,
int n,
struct ambapp_bus *abus RTEMS_UNUSED
)
{
return memcpy(dest, src, n);
}
static const struct ambapp_context default_ctx = {
.copy_from_device = (ambapp_memcpy_t)memcpy,
.copy_from_device = ambapp_memcpy,
.alloc = rtems_malloc
};

View File

@@ -3285,6 +3285,14 @@ int grspw_isr_affinity(void *d, const cpu_set_t *cpus)
}
#endif
static int grspw_msgqisr(void *data, unsigned int *buf, unsigned int n)
{
rtems_status_code sc;
sc = rtems_message_queue_send((rtems_id) data, buf, n);
return sc.
}
static int grspw_common_init(void)
{
if (grspw_initialized == 1)
@@ -3308,8 +3316,7 @@ static int grspw_common_init(void)
(rtems_id *)&grspw_wc_def.msgisr_arg, 0);
if (grspw_work_task == OBJECTS_ID_NONE)
return -2;
grspw_wc_def.msgisr =
(grspw_msgqisr_t) rtems_message_queue_send;
grspw_wc_def.msgisr = grspw_msgqisr;
} else {
grspw_wc_def.msgisr = NULL;
grspw_wc_def.msgisr_arg = NULL;

View File

@@ -64,6 +64,16 @@ static void *ambapp_plb_alloc( size_t size )
return _Memory_Allocate( _Memory_Get(), size, CPU_HEAP_ALIGNMENT );
}
static void *ambapp_memcpy(
void *dest,
const void *src,
int n,
struct ambapp_bus *abus RTEMS_UNUSED
)
{
return memcpy(dest, src, n);
}
struct ambapp_bus *ambapp_plb( void )
{
struct ambapp_bus *plb;
@@ -73,7 +83,7 @@ struct ambapp_bus *ambapp_plb( void )
if ( plb->root == NULL ) {
struct ambapp_context ctx;
ctx.copy_from_device = (ambapp_memcpy_t) memcpy;
ctx.copy_from_device = ambapp_memcpy;
ctx.alloc = ambapp_plb_alloc;
/* Scan AMBA Plug&Play read-only information. The routine builds a PnP