/* Simulator for Analog Devices Blackfin processors.
- Copyright (C) 2005-2016 Free Software Foundation, Inc.
+ Copyright (C) 2005-2021 Free Software Foundation, Inc.
Contributed by Analog Devices, Inc.
This file is part of simulators.
bfin_syscall (SIM_CPU *cpu)
{
SIM_DESC sd = CPU_STATE (cpu);
- const char * const *argv = (void *)STATE_PROG_ARGV (sd);
+ char * const *argv = (void *)STATE_PROG_ARGV (sd);
host_callback *cb = STATE_CALLBACK (sd);
bu32 args[6];
CB_SYSCALL sc;
sc.result = heap;
heap += sc.arg2;
/* Keep it page aligned. */
- heap = ALIGN (heap, 4096);
+ heap = align_up (heap, 4096);
break;
}
SIM_DESC
sim_open (SIM_OPEN_KIND kind, host_callback *callback,
- struct bfd *abfd, char **argv)
+ struct bfd *abfd, char * const *argv)
{
char c;
int i;
return 0;
}
- {
- /* XXX: Only first core gets profiled ? */
- SIM_CPU *cpu = STATE_CPU (sd, 0);
- STATE_WATCHPOINTS (sd)->pc = &PCREG;
- STATE_WATCHPOINTS (sd)->sizeof_pc = sizeof (PCREG);
- }
-
if (sim_pre_argv_init (sd, argv[0]) != SIM_RC_OK)
{
free_state (sd);
}
/* Some utils don't like having a NULL environ. */
-static const char * const simple_env[] = { "HOME=/", "PATH=/bin", NULL };
+static char * const simple_env[] = { "HOME=/", "PATH=/bin", NULL };
static bu32 fdpic_load_offset;
}
/* Update the load offset with a few extra pages. */
- fdpic_load_offset = ALIGN (max (max_load_addr, fdpic_load_offset), 0x10000);
+ fdpic_load_offset = align_up (max (max_load_addr, fdpic_load_offset),
+ 0x10000);
fdpic_load_offset += 0x10000;
/* Push the summary loadmap info onto the stack last. */
static void
bfin_user_init (SIM_DESC sd, SIM_CPU *cpu, struct bfd *abfd,
- const char * const *argv, const char * const *env)
+ char * const *argv, char * const *env)
{
/* XXX: Missing host -> target endian ... */
/* Linux starts the user app with the stack:
env_flat += strlen (env[i]);
/* Push the Auxiliary Vector Table between argv/env and actual strings. */
- sp_flat = sp = ALIGN (SPREG - argv_flat - env_flat - 4, 4);
+ sp_flat = sp = align_up (SPREG - argv_flat - env_flat - 4, 4);
if (auxvt)
{
# define AT_PUSH(at, val) \
}
static void
-bfin_os_init (SIM_DESC sd, SIM_CPU *cpu, const char * const *argv)
+bfin_os_init (SIM_DESC sd, SIM_CPU *cpu, char * const *argv)
{
/* Pass the command line via a string in R0 like Linux expects. */
int i;
SIM_RC
sim_create_inferior (SIM_DESC sd, struct bfd *abfd,
- char **argv, char **env)
+ char * const *argv, char * const *env)
{
SIM_CPU *cpu = STATE_CPU (sd, 0);
SIM_ADDR addr;
switch (STATE_ENVIRONMENT (sd))
{
case USER_ENVIRONMENT:
- bfin_user_init (sd, cpu, abfd, (void *)argv, (void *)env);
+ bfin_user_init (sd, cpu, abfd, argv, env);
break;
case OPERATING_ENVIRONMENT:
- bfin_os_init (sd, cpu, (void *)argv);
+ bfin_os_init (sd, cpu, argv);
break;
default:
bfin_virtual_init (sd, cpu);