FreeCalypso > hg > freecalypso-tools
annotate libpwon/forkoff.c @ 1014:961efadd530a default tip
fc-shell TCH DL handler: add support for CSD modes
TCH DL capture mechanism in FC Tourmaline firmware has been extended
to support CSD modes in addition to speech - add the necessary support
on the host tools side.
It needs to be noted that this mechanism in its present state does NOT
provide the debug utility value that was sought: as we learned only
after the code was implemented, TI's DSP has a misfeature in that the
buffer we are reading (a_dd_0[]) is zeroed out when the IDS block
is enabled, i.e., we are reading all zeros and not the real DL bits
we were after. But since the code has already been written, we are
keeping it - perhaps we can do some tests with IDS disabled.
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Tue, 26 Nov 2024 06:27:43 +0000 |
parents | ab54957dbe35 |
children |
rev | line source |
---|---|
571
41b3e010808d
libpwon started, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 #include <sys/types.h> |
575
cef70d53fc5e
loadtools: new -P boot control mechanism implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
571
diff
changeset
|
2 #include <signal.h> |
571
41b3e010808d
libpwon started, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 #include <stdio.h> |
41b3e010808d
libpwon started, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 #include <stdlib.h> |
41b3e010808d
libpwon started, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 #include <unistd.h> |
41b3e010808d
libpwon started, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 |
41b3e010808d
libpwon started, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 extern char bootctrl_pwon_cmd[]; |
953
ab54957dbe35
libpwon: implement -Petmoff mode
Mychaela Falconia <falcon@freecalypso.org>
parents:
736
diff
changeset
|
8 extern int bootctrl_duart28c_mode, bootctrl_etmoff_mode; |
571
41b3e010808d
libpwon started, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 |
41b3e010808d
libpwon started, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 static char shell_pathname[] = "/bin/sh"; |
41b3e010808d
libpwon started, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 |
41b3e010808d
libpwon started, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 void |
41b3e010808d
libpwon started, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 fork_exec_pwon_cmd() |
41b3e010808d
libpwon started, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 { |
41b3e010808d
libpwon started, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 int i; |
41b3e010808d
libpwon started, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16 |
41b3e010808d
libpwon started, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 i = vfork(); |
41b3e010808d
libpwon started, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 if (i < 0) { |
41b3e010808d
libpwon started, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 perror("vfork"); |
41b3e010808d
libpwon started, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 exit(1); |
41b3e010808d
libpwon started, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 } |
41b3e010808d
libpwon started, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
22 if (i) |
41b3e010808d
libpwon started, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23 return; |
41b3e010808d
libpwon started, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
24 execl(shell_pathname, "sh", "-c", bootctrl_pwon_cmd, (char *) 0); |
41b3e010808d
libpwon started, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
25 perror(shell_pathname); |
41b3e010808d
libpwon started, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
26 _exit(1); |
41b3e010808d
libpwon started, compiles
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
27 } |
575
cef70d53fc5e
loadtools: new -P boot control mechanism implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
571
diff
changeset
|
28 |
cef70d53fc5e
loadtools: new -P boot control mechanism implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
571
diff
changeset
|
29 pwon_if_needed() |
cef70d53fc5e
loadtools: new -P boot control mechanism implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
571
diff
changeset
|
30 { |
736
7d1df6d831e4
libpwon: added -Pdtr and -Prts support for DUART28C
Mychaela Falconia <falcon@freecalypso.org>
parents:
575
diff
changeset
|
31 if (bootctrl_duart28c_mode) { |
7d1df6d831e4
libpwon: added -Pdtr and -Prts support for DUART28C
Mychaela Falconia <falcon@freecalypso.org>
parents:
575
diff
changeset
|
32 signal(SIGCHLD, SIG_IGN); |
7d1df6d831e4
libpwon: added -Pdtr and -Prts support for DUART28C
Mychaela Falconia <falcon@freecalypso.org>
parents:
575
diff
changeset
|
33 fork_duart28c_pulse(); |
7d1df6d831e4
libpwon: added -Pdtr and -Prts support for DUART28C
Mychaela Falconia <falcon@freecalypso.org>
parents:
575
diff
changeset
|
34 return(1); |
7d1df6d831e4
libpwon: added -Pdtr and -Prts support for DUART28C
Mychaela Falconia <falcon@freecalypso.org>
parents:
575
diff
changeset
|
35 } |
7d1df6d831e4
libpwon: added -Pdtr and -Prts support for DUART28C
Mychaela Falconia <falcon@freecalypso.org>
parents:
575
diff
changeset
|
36 if (bootctrl_pwon_cmd[0]) { |
7d1df6d831e4
libpwon: added -Pdtr and -Prts support for DUART28C
Mychaela Falconia <falcon@freecalypso.org>
parents:
575
diff
changeset
|
37 signal(SIGCHLD, SIG_IGN); |
7d1df6d831e4
libpwon: added -Pdtr and -Prts support for DUART28C
Mychaela Falconia <falcon@freecalypso.org>
parents:
575
diff
changeset
|
38 fork_exec_pwon_cmd(); |
7d1df6d831e4
libpwon: added -Pdtr and -Prts support for DUART28C
Mychaela Falconia <falcon@freecalypso.org>
parents:
575
diff
changeset
|
39 return(1); |
7d1df6d831e4
libpwon: added -Pdtr and -Prts support for DUART28C
Mychaela Falconia <falcon@freecalypso.org>
parents:
575
diff
changeset
|
40 } |
953
ab54957dbe35
libpwon: implement -Petmoff mode
Mychaela Falconia <falcon@freecalypso.org>
parents:
736
diff
changeset
|
41 if (bootctrl_etmoff_mode) { |
ab54957dbe35
libpwon: implement -Petmoff mode
Mychaela Falconia <falcon@freecalypso.org>
parents:
736
diff
changeset
|
42 bootctrl_do_etmoff(); |
ab54957dbe35
libpwon: implement -Petmoff mode
Mychaela Falconia <falcon@freecalypso.org>
parents:
736
diff
changeset
|
43 return(2); |
ab54957dbe35
libpwon: implement -Petmoff mode
Mychaela Falconia <falcon@freecalypso.org>
parents:
736
diff
changeset
|
44 } |
736
7d1df6d831e4
libpwon: added -Pdtr and -Prts support for DUART28C
Mychaela Falconia <falcon@freecalypso.org>
parents:
575
diff
changeset
|
45 return(0); |
575
cef70d53fc5e
loadtools: new -P boot control mechanism implemented
Mychaela Falconia <falcon@freecalypso.org>
parents:
571
diff
changeset
|
46 } |