MINI2440: start.S removed MINI2440 specific speed
[u-boot-openmoko/mini2440.git] / tools / gdb / gdbcont.c
blob300545d8e11e9057f1cd55ee5d2844dc0b4b356d
1 /*
2 * (C) Copyright 2000
3 * Murray Jensen <Murray.Jensen@csiro.au>
5 * See file CREDITS for list of people who contributed to this
6 * project.
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of
11 * the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
21 * MA 02111-1307 USA
24 #include <stdio.h>
25 #include <stdlib.h>
26 #include <string.h>
27 #include <unistd.h>
28 #include "serial.h"
29 #include "error.h"
30 #include "remote.h"
32 char *serialdev = "/dev/term/b";
33 speed_t speed = B230400;
34 int verbose = 0;
36 int
37 main(int ac, char **av)
39 int c, sfd;
41 if ((pname = strrchr(av[0], '/')) == NULL)
42 pname = av[0];
43 else
44 pname++;
46 while ((c = getopt(ac, av, "b:p:v")) != EOF)
47 switch (c) {
49 case 'b':
50 if ((speed = cvtspeed(optarg)) == B0)
51 Error("can't decode baud rate specified in -b option");
52 break;
54 case 'p':
55 serialdev = optarg;
56 break;
58 case 'v':
59 verbose = 1;
60 break;
62 default:
63 usage:
64 fprintf(stderr, "Usage: %s [-b bps] [-p dev] [-v]\n", pname);
65 exit(1);
67 if (optind != ac)
68 goto usage;
70 if (verbose)
71 fprintf(stderr, "Opening serial port and sending continue...\n");
73 if ((sfd = serialopen(serialdev, speed)) < 0)
74 Perror("open of serial device '%s' failed", serialdev);
76 remote_desc = sfd;
77 remote_reset();
78 remote_continue();
80 if (serialclose(sfd) < 0)
81 Perror("close of serial device '%s' failed", serialdev);
83 if (verbose)
84 fprintf(stderr, "Done.\n");
86 return (0);