annotate gsm-fw/gpf/osx/osx.c @ 496:2c16b554d142

osx.c: int_osx_send_prim() done
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Tue, 01 Jul 2014 07:44:05 +0000
parents 34303faf4620
children f11f7cb7c353
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
491
886cd11bc45f OSX reconstruction started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1 /*
886cd11bc45f OSX reconstruction started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
2 * This C module is a reconstruction based on the disassembly of
886cd11bc45f OSX reconstruction started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
3 * osx.obj in osx_na7_db.lib from the Leonardo package.
886cd11bc45f OSX reconstruction started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
4 */
886cd11bc45f OSX reconstruction started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
5
886cd11bc45f OSX reconstruction started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
6 /* reconstructed set of included headers from COFF symtab: */
886cd11bc45f OSX reconstruction started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
7 #include <stdio.h>
886cd11bc45f OSX reconstruction started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
8 #include <stdlib.h>
886cd11bc45f OSX reconstruction started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
9 #include <string.h>
886cd11bc45f OSX reconstruction started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
10 #include "typedefs.h"
886cd11bc45f OSX reconstruction started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
11 #include "vsi.h"
886cd11bc45f OSX reconstruction started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
12 #include "cust_os.h"
886cd11bc45f OSX reconstruction started
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
13
492
517cde3e238e osx.c: global data done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 491
diff changeset
14 int osx_config = 2;
517cde3e238e osx.c: global data done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 491
diff changeset
15 int _caller;
517cde3e238e osx.c: global data done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 491
diff changeset
16 T_OSX_REGISTER _osx_registry[7];
493
4775ba17ba05 osx.c: int_osx_send_sig() done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 492
diff changeset
17
4775ba17ba05 osx.c: int_osx_send_sig() done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 492
diff changeset
18 void
4775ba17ba05 osx.c: int_osx_send_sig() done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 492
diff changeset
19 int_osx_send_sig(int caller, unsigned long opc, void *signal_ptr,
4775ba17ba05 osx.c: int_osx_send_sig() done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 492
diff changeset
20 int queue_handle)
4775ba17ba05 osx.c: int_osx_send_sig() done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 492
diff changeset
21 {
4775ba17ba05 osx.c: int_osx_send_sig() done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 492
diff changeset
22 T_QMSG Message;
4775ba17ba05 osx.c: int_osx_send_sig() done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 492
diff changeset
23 int status;
4775ba17ba05 osx.c: int_osx_send_sig() done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 492
diff changeset
24
4775ba17ba05 osx.c: int_osx_send_sig() done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 492
diff changeset
25 TRACE_ASSERT(queue_handle != 0);
4775ba17ba05 osx.c: int_osx_send_sig() done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 492
diff changeset
26 Message.MsgType = MSG_SIGNAL;
4775ba17ba05 osx.c: int_osx_send_sig() done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 492
diff changeset
27 Message.Msg.Signal.SigOPC = opc;
4775ba17ba05 osx.c: int_osx_send_sig() done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 492
diff changeset
28 Message.Msg.Signal.SigBuffer = signal_ptr;
4775ba17ba05 osx.c: int_osx_send_sig() done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 492
diff changeset
29 Message.Msg.Signal.SigLen = sizeof(xSignalHeaderRec);
4775ba17ba05 osx.c: int_osx_send_sig() done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 492
diff changeset
30 status = vsi_c_send(caller, queue_handle, &Message FILE_LINE_MACRO);
4775ba17ba05 osx.c: int_osx_send_sig() done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 492
diff changeset
31 TRACE_ASSERT(status == VSI_OK);
4775ba17ba05 osx.c: int_osx_send_sig() done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 492
diff changeset
32 }
494
a8799459110c osx.c: osx_send_sig() done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 493
diff changeset
33
a8799459110c osx.c: osx_send_sig() done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 493
diff changeset
34 void
a8799459110c osx.c: osx_send_sig() done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 493
diff changeset
35 osx_send_sig(unsigned long opc, void *signal_ptr, T_ENUM_OS_QUEUE queue_type)
a8799459110c osx.c: osx_send_sig() done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 493
diff changeset
36 {
a8799459110c osx.c: osx_send_sig() done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 493
diff changeset
37 int caller, queue_handle;
a8799459110c osx.c: osx_send_sig() done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 493
diff changeset
38
a8799459110c osx.c: osx_send_sig() done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 493
diff changeset
39 caller = _osx_registry[queue_type].caller;
a8799459110c osx.c: osx_send_sig() done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 493
diff changeset
40 queue_handle = _osx_registry[queue_type].queue_handle;
a8799459110c osx.c: osx_send_sig() done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 493
diff changeset
41 TRACE_ASSERT(queue_handle != 0);
a8799459110c osx.c: osx_send_sig() done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 493
diff changeset
42 int_osx_send_sig(caller, opc, signal_ptr, queue_handle);
a8799459110c osx.c: osx_send_sig() done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 493
diff changeset
43 }
495
34303faf4620 osx.c: int_osx_free_prim() done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 494
diff changeset
44
34303faf4620 osx.c: int_osx_free_prim() done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 494
diff changeset
45 void
34303faf4620 osx.c: int_osx_free_prim() done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 494
diff changeset
46 int_osx_free_prim(int caller, xSignalHeaderRec *prim_ptr)
34303faf4620 osx.c: int_osx_free_prim() done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 494
diff changeset
47 {
34303faf4620 osx.c: int_osx_free_prim() done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 494
diff changeset
48 vsi_c_free(caller, (T_VOID_STRUCT **) &prim_ptr FILE_LINE_MACRO);
34303faf4620 osx.c: int_osx_free_prim() done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 494
diff changeset
49 }
496
2c16b554d142 osx.c: int_osx_send_prim() done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 495
diff changeset
50
2c16b554d142 osx.c: int_osx_send_prim() done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 495
diff changeset
51 void
2c16b554d142 osx.c: int_osx_send_prim() done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 495
diff changeset
52 int_osx_send_prim(int caller, xSignalHeaderRec *prim_ptr, int queue_handle)
2c16b554d142 osx.c: int_osx_send_prim() done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 495
diff changeset
53 {
2c16b554d142 osx.c: int_osx_send_prim() done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 495
diff changeset
54 T_QMSG Message;
2c16b554d142 osx.c: int_osx_send_prim() done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 495
diff changeset
55 int status;
2c16b554d142 osx.c: int_osx_send_prim() done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 495
diff changeset
56
2c16b554d142 osx.c: int_osx_send_prim() done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 495
diff changeset
57 if (osx_config & 1 && prim_ptr->SignalCode == 0x7D) {
2c16b554d142 osx.c: int_osx_send_prim() done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 495
diff changeset
58 vsi_c_free(caller, (T_VOID_STRUCT **) &prim_ptr
2c16b554d142 osx.c: int_osx_send_prim() done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 495
diff changeset
59 FILE_LINE_MACRO);
2c16b554d142 osx.c: int_osx_send_prim() done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 495
diff changeset
60 return;
2c16b554d142 osx.c: int_osx_send_prim() done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 495
diff changeset
61 }
2c16b554d142 osx.c: int_osx_send_prim() done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 495
diff changeset
62 TRACE_ASSERT(queue_handle != 0);
2c16b554d142 osx.c: int_osx_send_prim() done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 495
diff changeset
63 Message.MsgType = MSG_PRIMITIVE;
2c16b554d142 osx.c: int_osx_send_prim() done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 495
diff changeset
64 Message.Msg.Primitive.Prim = (T_VOID_STRUCT *) prim_ptr;
2c16b554d142 osx.c: int_osx_send_prim() done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 495
diff changeset
65 Message.Msg.Primitive.PrimLen = sizeof(xSignalHeaderRec);
2c16b554d142 osx.c: int_osx_send_prim() done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 495
diff changeset
66 status = vsi_c_send(caller, queue_handle, &Message FILE_LINE_MACRO);
2c16b554d142 osx.c: int_osx_send_prim() done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 495
diff changeset
67 TRACE_ASSERT(status == VSI_OK);
2c16b554d142 osx.c: int_osx_send_prim() done
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 495
diff changeset
68 }