mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-08-18 16:39:20 +08:00
mp misc: Address build failures and warnings
Changes required to build with RTEMS_MULTIPROCESSING and associated tests without warnings.
This commit is contained in:
committed by
Gedare Bloom
parent
cecbf340e9
commit
3a61921132
@@ -75,6 +75,8 @@ static rtems_status_code spi_memdrv_minor2param_ptr
|
||||
rtems_status_code rc = RTEMS_SUCCESSFUL;
|
||||
spi_memdrv_t *drv_ptr;
|
||||
|
||||
*param_ptr = NULL;
|
||||
|
||||
if (rc == RTEMS_SUCCESSFUL) {
|
||||
rc = -rtems_libi2c_ioctl(minor,
|
||||
RTEMS_LIBI2C_IOCTL_GET_DRV_T,
|
||||
@@ -140,7 +142,7 @@ rtems_status_code spi_memdrv_write
|
||||
rtems_status_code rc = RTEMS_SUCCESSFUL;
|
||||
rtems_libio_rw_args_t *rwargs = arg;
|
||||
off_t off = rwargs->offset;
|
||||
int cnt = rwargs->count;
|
||||
uint32_t cnt = rwargs->count;
|
||||
unsigned char *buf = (unsigned char *)rwargs->buffer;
|
||||
int bytes_sent = 0;
|
||||
int curr_cnt;
|
||||
@@ -159,9 +161,7 @@ rtems_status_code spi_memdrv_write
|
||||
/*
|
||||
* get mem parameters
|
||||
*/
|
||||
if (rc == RTEMS_SUCCESSFUL) {
|
||||
rc = spi_memdrv_minor2param_ptr(minor,&mem_param_ptr);
|
||||
}
|
||||
rc = spi_memdrv_minor2param_ptr(minor,&mem_param_ptr);
|
||||
/*
|
||||
* check arguments
|
||||
*/
|
||||
@@ -176,7 +176,7 @@ rtems_status_code spi_memdrv_write
|
||||
}
|
||||
}
|
||||
while ((rc == RTEMS_SUCCESSFUL) &&
|
||||
(cnt > bytes_sent)) {
|
||||
((int) cnt > bytes_sent)) {
|
||||
curr_cnt = cnt - bytes_sent;
|
||||
if ((mem_param_ptr->page_size > 0) &&
|
||||
(off / mem_param_ptr->page_size) !=
|
||||
@@ -328,7 +328,7 @@ rtems_status_code spi_memdrv_read
|
||||
rtems_status_code rc = RTEMS_SUCCESSFUL;
|
||||
rtems_libio_rw_args_t *rwargs = arg;
|
||||
off_t off = rwargs->offset;
|
||||
int cnt = rwargs->count;
|
||||
uint32_t cnt = rwargs->count;
|
||||
unsigned char *buf = (unsigned char *)rwargs->buffer;
|
||||
unsigned char cmdbuf[4];
|
||||
int ret_cnt = 0;
|
||||
|
||||
@@ -392,7 +392,7 @@ ssize_t utf8proc_decompose(
|
||||
if (decomp_result < 0) return decomp_result;
|
||||
wpos += decomp_result;
|
||||
/* prohibiting integer overflows due to too long strings: */
|
||||
if (wpos < 0 || wpos > SSIZE_MAX/sizeof(int32_t)/2)
|
||||
if (wpos < 0 || wpos > (ssize_t) (SSIZE_MAX/sizeof(int32_t)/2))
|
||||
return UTF8PROC_ERROR_OVERFLOW;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -162,7 +162,7 @@ extern const rtems_driver_address_table rtems_libi2c_io_ops;
|
||||
typedef struct rtems_libi2c_bus_t_
|
||||
{
|
||||
const struct rtems_libi2c_bus_ops_ *ops;
|
||||
int size; /* size of whole structure */
|
||||
size_t size; /* size of whole structure */
|
||||
} rtems_libi2c_bus_t;
|
||||
|
||||
/* Access functions a low level driver must provide;
|
||||
@@ -296,7 +296,7 @@ extern rtems_device_major_number rtems_libi2c_major;
|
||||
typedef struct rtems_libi2c_drv_t_
|
||||
{
|
||||
const rtems_driver_address_table *ops; /* the driver ops */
|
||||
int size; /* size of whole structure (including appended private data) */
|
||||
size_t size; /* size of whole structure (including appended private data) */
|
||||
} rtems_libi2c_drv_t;
|
||||
|
||||
/*
|
||||
|
||||
@@ -782,7 +782,7 @@ rtems_rtl_archives_load (rtems_rtl_archives* archives)
|
||||
bool
|
||||
rtems_rtl_archives_refresh (rtems_rtl_archives* archives)
|
||||
{
|
||||
size_t config_path = 0;
|
||||
ssize_t config_path = 0;
|
||||
uint32_t flags = RTEMS_RTL_ARCHIVE_REMOVE;
|
||||
|
||||
/*
|
||||
|
||||
@@ -802,7 +802,7 @@ rtems_capture_cli_trigger_worker (int set, int argc, char** argv)
|
||||
if (!trigger_set)
|
||||
{
|
||||
bool found = false;
|
||||
int t;
|
||||
size_t t;
|
||||
|
||||
for (t = 0; t < RTEMS_CAPTURE_CLI_TRIGGERS_NUM; t++)
|
||||
if (strcmp (argv[arg], rtems_capture_cli_trigger[t].name) == 0)
|
||||
|
||||
@@ -82,9 +82,9 @@ typedef struct
|
||||
Timestamp_Control uptime;
|
||||
Timestamp_Control last_uptime;
|
||||
Timestamp_Control period;
|
||||
int task_count; /* Number of tasks. */
|
||||
int last_task_count; /* Number of tasks in the previous sample. */
|
||||
int task_size; /* The size of the arrays */
|
||||
uint32_t task_count; /* Number of tasks. */
|
||||
uint32_t last_task_count; /* Number of tasks in the previous sample. */
|
||||
uint32_t task_size; /* The size of the arrays */
|
||||
Thread_Control** tasks; /* List of tasks in this sample. */
|
||||
Thread_Control** last_tasks; /* List of tasks in the last sample. */
|
||||
Timestamp_Control* usage; /* Usage of task's in this sample. */
|
||||
@@ -195,7 +195,7 @@ task_usage(Thread_Control* thread, void* arg)
|
||||
rtems_cpu_usage_data* data = (rtems_cpu_usage_data*) arg;
|
||||
Timestamp_Control usage;
|
||||
Timestamp_Control current = data->zero;
|
||||
int j;
|
||||
uint32_t j;
|
||||
|
||||
data->stack_size += thread->Start.Initial_stack.size;
|
||||
|
||||
@@ -231,7 +231,7 @@ task_usage(Thread_Control* thread, void* arg)
|
||||
{
|
||||
if (data->tasks[j])
|
||||
{
|
||||
int k;
|
||||
uint32_t k;
|
||||
|
||||
/*
|
||||
* Sort on the current load.
|
||||
@@ -295,10 +295,10 @@ rtems_cpuusage_top_thread (rtems_task_argument arg)
|
||||
{
|
||||
rtems_cpu_usage_data* data = (rtems_cpu_usage_data*) arg;
|
||||
char name[13];
|
||||
int i;
|
||||
uint32_t i;
|
||||
Heap_Information_block wksp;
|
||||
uint32_t ival, fval;
|
||||
int task_count;
|
||||
uint32_t task_count;
|
||||
rtems_event_set out;
|
||||
rtems_status_code sc;
|
||||
bool first_time = true;
|
||||
|
||||
@@ -512,12 +512,6 @@ rtems_monitor_command_read(char *command,
|
||||
/*
|
||||
* put node number in the prompt if we are multiprocessing
|
||||
*/
|
||||
#if defined(RTEMS_MULTIPROCESSING)
|
||||
if (!rtems_configuration_get_user_multiprocessing_table ())
|
||||
snprintf (monitor_prompt, sizeof(monitor_prompt), "%s",
|
||||
(env_prompt == NULL) ? MONITOR_PROMPT: env_prompt);
|
||||
else /* .... */
|
||||
#endif
|
||||
if (rtems_monitor_default_node != rtems_monitor_node)
|
||||
snprintf (monitor_prompt, sizeof(monitor_prompt),
|
||||
"%" PRId32 "-%s-%" PRId32 "", rtems_monitor_node,
|
||||
|
||||
@@ -1097,7 +1097,7 @@ rtems_fdt_prop_map(const char* const path,
|
||||
return length;
|
||||
}
|
||||
|
||||
if (length > sizeof (uintptr_t))
|
||||
if ((size_t) length > sizeof (uintptr_t))
|
||||
{
|
||||
rtems_fdt_release_handle (&fdt);
|
||||
return -RTEMS_FDT_ERR_BADPATH;
|
||||
@@ -1115,7 +1115,7 @@ rtems_fdt_get_offset_len_uintptr (const void* prop, int offset, int len)
|
||||
const uint8_t* p = prop;
|
||||
uintptr_t value = 0;
|
||||
int b;
|
||||
if (len <= sizeof(uintptr_t)) {
|
||||
if ((size_t) len <= sizeof(uintptr_t)) {
|
||||
for (b = 0; b < len; ++b) {
|
||||
value = (value << 8) | (uintptr_t) p[offset++];
|
||||
}
|
||||
@@ -1304,14 +1304,14 @@ int rtems_fdt_getprop_address_map(rtems_fdt_handle* handle,
|
||||
switch (addr_map->address_cells)
|
||||
{
|
||||
case 1:
|
||||
if (plen < sizeof(uint32_t))
|
||||
if ((size_t) plen < sizeof(uint32_t))
|
||||
return -RTEMS_FDT_ERR_BADLENGTH;
|
||||
addr_map->address = rtems_fdt_get_offset_uint32(prop, poff);
|
||||
poff += 1;
|
||||
plen -= sizeof(uint32_t);
|
||||
break;
|
||||
case 2:
|
||||
if (plen < sizeof(uint64_t))
|
||||
if ((size_t) plen < sizeof(uint64_t))
|
||||
return -RTEMS_FDT_ERR_BADLENGTH;
|
||||
addr_map->address = rtems_fdt_get_offset_uint64(prop, poff);
|
||||
poff += 2;
|
||||
@@ -1327,14 +1327,14 @@ int rtems_fdt_getprop_address_map(rtems_fdt_handle* handle,
|
||||
addr_map->size = sizeof(uint32_t);
|
||||
break;
|
||||
case 1:
|
||||
if (plen < sizeof(uint32_t))
|
||||
if ((size_t) plen < sizeof(uint32_t))
|
||||
return -RTEMS_FDT_ERR_BADLENGTH;
|
||||
addr_map->size = rtems_fdt_get_offset_uint32(prop, poff);
|
||||
poff += 1;
|
||||
plen -= sizeof(uint32_t);
|
||||
break;
|
||||
case 2:
|
||||
if (plen < sizeof(uint64_t))
|
||||
if ((size_t) plen < sizeof(uint64_t))
|
||||
return -RTEMS_FDT_ERR_BADLENGTH;
|
||||
addr_map->size = rtems_fdt_get_offset_uint64(prop, poff);
|
||||
poff += 2;
|
||||
|
||||
@@ -297,12 +297,10 @@ void rtems_stack_checker_reporter_print_details(
|
||||
}
|
||||
|
||||
#if defined(RTEMS_MULTIPROCESSING)
|
||||
if (rtems_configuration_get_user_multiprocessing_table()) {
|
||||
printk(
|
||||
"node: 0x%08" PRIxPTR "\n",
|
||||
(intptr_t) rtems_configuration_get_user_multiprocessing_table()->node
|
||||
);
|
||||
}
|
||||
printk(
|
||||
"node: 0x%08" PRIxPTR "\n",
|
||||
(intptr_t) rtems_configuration_get_user_multiprocessing_table()->node
|
||||
);
|
||||
#endif
|
||||
|
||||
rtems_fatal(
|
||||
|
||||
@@ -54,7 +54,8 @@ int _Scheduler_CBS_Destroy_server (
|
||||
if ( !_Scheduler_CBS_Server_list[server_id].initialized )
|
||||
return SCHEDULER_CBS_ERROR_NOSERVER;
|
||||
|
||||
if ( (tid = _Scheduler_CBS_Server_list[server_id].task_id) != -1 )
|
||||
tid = _Scheduler_CBS_Server_list[server_id].task_id;
|
||||
if ( tid != (rtems_id)-1 )
|
||||
ret = _Scheduler_CBS_Detach_thread ( server_id, tid );
|
||||
|
||||
_Scheduler_CBS_Server_list[server_id].initialized = false;
|
||||
|
||||
@@ -61,7 +61,7 @@ int _Scheduler_CBS_Get_remaining_budget (
|
||||
return SCHEDULER_CBS_ERROR_NOSERVER;
|
||||
}
|
||||
|
||||
if ( server->task_id == -1 ) {
|
||||
if ( server->task_id == (rtems_id) -1 ) {
|
||||
*remaining_budget = server->parameters.budget;
|
||||
return SCHEDULER_CBS_OK;
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ void _Scheduler_CBS_Unblock(
|
||||
uint32_t deadline_left = the_thread->CPU_budget.available;
|
||||
Priority_Control budget_left = priority - _Watchdog_Ticks_since_boot;
|
||||
|
||||
if ( deadline * budget_left > budget * deadline_left ) {
|
||||
if ( (time_t) (deadline * budget_left) > budget * deadline_left ) {
|
||||
Thread_queue_Context queue_context;
|
||||
|
||||
/* Put late unblocked task to background until the end of period. */
|
||||
|
||||
@@ -40,8 +40,7 @@
|
||||
|
||||
#include "system.h"
|
||||
|
||||
rtems_task Test_task3( restart )
|
||||
rtems_task_argument restart;
|
||||
rtems_task Test_task3(rtems_task_argument restart)
|
||||
{
|
||||
rtems_status_code status;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user