Welcome to mirror list, hosted at ThFree Co, Russian Federation.

bdm-system.c « m68k « libgloss - cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: cc472cd5209b3ffc727baf9e431f99a743268545 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include "bdm-semihost.h"
#include "bdm-gdb.h"
#include <stdlib.h>
#include <string.h>
#include <errno.h>

/*
 * system: execute command on (remote) host
 * input parameters:
 *   0 : command ptr
 *   1 : command length
 * output parameters:
 *   0 : result
 *   1 : errno
 */

int _system (const char *command)
{
  gdb_parambuf_t parameters;
  parameters[0] = (uint32_t) command;
  parameters[1] = (uint32_t) strlen (command) + 1;
  BDM_TRAP (BDM_SYSTEM, (uint32_t)parameters);
  errno = convert_from_gdb_errno (parameters[1]);
  return parameters[0];
}