Home

Renesas REJ10J1822-0101 User's Manual

image

Contents

1. UINT32 ulLastOutputIOVectorSize rpc call info _ info Rev 1 01 Mar 17 2008 Page 115 of 128 RENESAS REJ10J1822 0101 Section 11 Samples ER UINT32 ullInputParamCount OUL IOVEC input 1 int ret info ulMarshallingType OUL __info ulServerID RPCSVR ID SMPL info ulServerVersion RPCSVR VERS SMPL info ulServerProcedureID RPC SMPL ATOI info AckMode RPC ACK info pInputlIOVectorTable input info ulInputIOVectorTableSize sizeof input sizeof IOVEC info pOutputlIOVectorTable NULL info ulOutputIOVectorTableSize OUL __info pulLastOutputIOVectorSize amp ulLastOutputIOVectorSize info pulReturnValue UINT32 amp ret input ulInputParamCount pBaseAddress UINT8 amp nptr input ulInputParamCount 4 ulSize sizeof UINT32 rpc retval adr rpc call amp info return ret ref tsk2 ID tskid T RTSK pk rtsk UINT32 _ ulLastOutputIOVectorSize rpc call info _ info UINT32 ullInputParamCount OUL IOVEC input 1 UINT32 ulOutputParamCount OUL IOVEC output 1 ER ercd Rev 1 01 Mar 17 2008 Page 116 of 128 REJ10J1822 0101 34 NE SAS Section 11 Samples info ulMarshallingType OUL __info ulServerID RPCSVR ID SMPL info ulServerVersion RPCSVR VERS SMPL info ulServerProcedureID RPC SMPL REF TSK2 info AckMode RPC_ACK __info pInputIOVectorTable input info ulInputIOVec
2. 2 seite eet est ena acre E ea dec e a EEN iia 99 8 6 Client Initialization Function esses eene nennen nennen nennen nnne n nnne nennen 100 8 7 Client Shutdown Function c cccccsscccsesscceessnececesneeeessnaeeceseeeecssaaeeessaeeeeseneeeseesseeesseeeees 101 8 8 rpe retval adi EP 102 8 9 lt Config file gt public Mises tees reniras aranse eher e d dd EEE 104 8 10 Local Variables Used in the Source Code Created by RPCGEN ees 104 Secton FIN GIGS esorare eaa CE a e o aA E ENESA a EREE OESE 105 Section TO Error Messages e cis esv irrin a EE rd 107 IN MEE Cir T 107 10 2 Gemeral 108 10 3 Definition Errors other than RPC_FUNC cccccccccsscccessneeeeesneeecseneeeesesseeesseeeeesseeees 108 10 4 Definition Errors RPC_FUNC ccccsccccssssecesssnceecsscecessseeeessseeeecsseeessesseeessseeeeesesneees 108 Section 11 Samples oec t DH iibi i EN IN ra M aE ERS 109 11 1 Config File sample X iu cene rere Ree rebut o e rues CER Re SERRA Reed 110 112 sSample clnth Scornen a E A E E A RR 112 11 3 sample private ERE st ERR Ea eaten 113 LIA Sample CIDt G ueteri ete Gece erroe Pneu aee RR ere p repete c ERE ERE RS 114 ILS sample lud n 120 L1 6 Sample SS VIC este A E A E 122 11 7 sample public his cen iiri eerte a a se D i Unio aaa aii 127 RENESAS vi 13 NC SAS Section 1 Overview Sec
3. 3 Server information e SVR_NAME Server name e SVR_ID Server ID e SVR_VERSION Server version e SVR_NOINIT The server initialization function is not to be created e SVR NOSHUTDOWN The server shutdown function is not to be created e SVR NOSTUBTBL The server stub function table is not to be created e SVR_STATIC Use of a static server e SVR_SECTION Section name to be given to the server stub e SVR AUTH How the server ID and server version will be assigned 4 Client information e CLNT NOINIT The client initialization function is not to be created e CLNT NOSHUTDOWN The client shutdown function is not to be created e CLNT CALLCHK Facilitates saving the return values of RPC calls e CLNT SECTION Section name to be given to the client stub 5 Server functions e RPC_FUNC Server functions Server functions are only defined within the braces of RPC_FUNC multiple server functions can be defined 5 2 Comments Comments in config files should be written in the same way as in the C and C languages The comments that are written before the first valid definition of a keyword will be output to the beginning of all source and header files generated by RPCGEN Rev 1 01 Mar 17 2008 Page 24 of 128 REJ10J1822 0101 34 NE SAS Section 5 Specifications of a Config File 5 3 File Locations Use the statements listed below to define paths to the files generated by RPCGEN If these d
4. 3 When the input output keyword selected for ARY is INOUT In this case a parameter specification that includes ARY must be followed by two definitions of COUNT to indicate the number of elements in the array lt parameter including ARY gt lt definition of first COUNT gt lt definition of second COUNT gt The first COUNT is the COUNT keyword followed by an expression that specifies the number of elements in the array to be passed from the client to the server The second COUNT is the COUNT keyword followed by an expression that specifies the number of elements in the array to be actually output by the server This value must be less than or equal to that specified for the first COUNT RPCGEN creates client stub code that makes an RPC call after setting the size of an input IOVEC structure by using an expression of the kind specified in figure 6 6 RPCGEN also creates server stub code that makes a server function call before setting the size of an output IOVEC structure by using an expression of the kind specified in figure 6 7 This must be taken into account in defining the first and second COUNT For example an expression for the first COUNT must not contain any variables that hold the return value of a function Figures 6 6 and 6 7 show the code for example 8 without SVR_AUTH of the examples introduced following the figures Rev 1 01 Mar 17 2008 Page 77 of 128 RENESAS REJ10J1822 0101 Section 6 Definitions of Server Functio
5. lt Size gt indicates the size of the server parameter area Specify an integer constant that can be represented as UINT32 The specified value is rounded up to the nearest multiple of four Section name gt indicates the section name to be given to the server parameter area Note however that the actual section name will be B followed by the section name given here This section name gt is not affected by definition of SVR SECTION The server parameter area information is output to config file svr c in the following format pragma section section name gt pragma pack 4 static UINT8 ucServerArea server name gt ALIGNUP4 lt size gt pragma unpack pragma section Note Since the SH2A DUAL does not have a facility for the CPU cores to snoop on each other s caches the server parameter area must be allocated in a non cacheable area Specify a section name that can be distinguished from those of sections to be allocated in cacheable areas Example SVR_STATIC 512 D_SVRAREA Rev 1 01 Mar 17 2008 Page 37 of 128 RENESAS REJ10J1822 0101 Section 5 Specifications of a Config File 5 5 8 SVR_AUTH Format SVR_AUTH Description There are two ways to assign the server ID and server version 1 Model 1 Model 1 applies when SVR_AUTH has not been specified In this model the application does not recognize the server ID or server version The server ID and server version are determined within the
6. server function name Server name gt refers to the server name defined with SVR NAME and server function name gt refers to server function names defined between the braces of RPC_FUNC The first and second parameters of the client stub functions are the server ID and server version respectively The names of the parameters are fixed to ulID and __ulVers The third and subsequent parameters are the first and subsequent parameters of the actual server function and their names are those defined in RPC_FUNC Example Contents of a config file SVR NAME EXAMPLE SVR ID 1 SVR VERSION 2 SVR AUTH RPC_FUNC int ret funcl IN DFLT int pari IN DFLT int par2 func2 OUT PTR struct ST ptr E Specification of a client stub function int rpcclnt EXAMPLE funcl UINT32 ulID UINT32 ulVers int parl int par2 void rpcclnt EXAMPLE func2 UINT32 ulID UINT32 ulVers struct ST ptr Rev 1 01 Mar 17 2008 Page 94 of 128 REJ10J1822 0101 34 NE SAS Section 8 Application Interface 8 2 Server Stub Functions Generated by RPCGEN RPCGEN outputs the server stub functions themselves to lt config file gt _svr c and the prototype declarations to lt config file gt _svr h The name of each server stub function takes the form rpcsvr_ lt server name gt _ lt server function name gt lt Server name gt refers to the server name defined with SVR_NAME and lt server function name gt refers to server function
7. In this case RPCGEN creates code to transfer ptr from the client to the server ptr is a pointer to the target int type data but this data ptr will not be transferred 3 Function pointer RPCGEN does not support server functions whose parameters are pointers to functions Rev 1 01 Mar 17 2008 Page 90 of 128 REJ10J1822 0101 34 NE SAS Section 7 Server Functions Not Supported by RPCGEN 7 2 Return Value 1 Pointer If a function returns a pointer type value this return value indicates an address in the server RPCGEN does not create any code to transfer the data indicated by the pointer from the server to the client Example Specification of a server function int func int par The return value is a pointer to int type data Definition of the server function int ret func IN DFLT int par In this case ret is a pointer to int type data returned within the server by the server function Rev 1 01 Mar 17 2008 Page 91 of 128 RENESAS REJ10J1822 0101 Section 7 Server Functions Not Supported by RPCGEN Rev 1 01 Mar 17 2008 Page 92 of 128 REJ10J1822 0101 34 NE SAS Section 8 Application Interface Section 8 Application Interface 8 1 Client Stub Functions Generated by RPCGEN The client stub functions are called by the client application This section gives the specifications for the client stub functions generated by RPCGEN The client stub functions must be called in accord with the definitio
8. The file for downloading has been compressed in the zip format Expanding the zip file generates the files listed in table 2 1 These files must be stored in a suitable folder Table 2 1 Files Provided as RPCGEN Filename Description rpcgen pl Main body of RPCGEN rpcgen clnt pm Package modules for use by the main body of RPCGEN rpcgen svr pm rpcgen info pm rpcgen misc pm Rev 1 01 Mar 17 2008 Page 3 of 128 RENESAS REJ10J1822 0101 Section 2 Installation Rev 1 01 Mar 17 2008 Page 4 of 128 REJ10J1822 0101 7tENESAS Section 3 Functions and Files Generated by RPCGEN Section 3 Functions and Files Generated by RPCGEN 3 1 Functions Generated by RPCGEN Figure 3 1 shows the functions generated by RPCGEN i Sever Client tod Server initialization initialization function A function unctions Server stub functi Figure 3 1 Functions Generated by RPCGEN Rev 1 01 Mar 17 2008 Page 5 of 128 RENESAS REJ10J1822 0101 Section 3 Functions and Files Generated by RPCGEN 3 1 1 Client 1 Client initialization function This function initiates the connection with the server Specifying CLNT NOINIT prevents the creation of the client initialization function 2 Client shutdown function This function ends the connection with the server Specifying CLNT NOSHUTDOWN prevents the creation of the client shutdown function 3 Client stub functions Each of these functions
9. void func int par The function takes par as an input The client makes RPC calls in asynchronous mode Definition of the server function func IN DFLT int par UNACK Rev 1 01 Mar 17 2008 Page 87 of 128 RENESAS REJ10J1822 0101 Section 6 Definitions of Server Functions 6 7 5 CLNTCOPYCBK RPC Call by rpc call copycbk Format CLNTCOPYCBK lt function 1 gt lt function 2 gt Description RPC calls are started by rpc_call_copycbk function 1 gt and function 2 gt are copy callback functions specified in rpc_call_copycbk Specification of the two callback functions is mandatory The prototype for the callback functions must conform with the RPC specifications and has to be declared in a file included by the client stub Example Specification of a server function int func struct ST ptr ptr is an array for output and has 10 elements all of which are output by func copyl is used for transfer from the client to the server while copy2 is used for transfer from the server to the client Definition of the server function int ret func OUT ARY struct ST ptr COUNT 10 COUNT 10 CLNTCOPYCBK copyl copy2 Rev 1 01 Mar 17 2008 Page 88 of 128 REJ10J1822 0101 34 NE SAS Section 7 Server Functions Not Supported by RPCGEN Section 7 Server Functions Not Supported by RPCGEN This section gives the types of functions not supported by RPCGEN If a server function you are using falls under t
10. func e Parameter directive IN DFLT e Parameter specification double inf e Option None For details on each of the descriptions refer to the following sections e Function type directives 6 2 Function Type Directives e Specifying the return value 6 2 Function Type Directives e Function name 6 3 Function Names e Parameter 6 4 Parameters e Option 6 7 Optional Keywords Rev 1 01 Mar 17 2008 Page 51 of 128 RENESAS REJ10J1822 0101 Section 6 Definitions of Server Functions 6 2 Function Type Directives 6 2 1 Function with a Return Value Format lt type of the return value gt A lt variable to hold the return value gt Description lt Variable to hold the return value gt refers to a local variable used to store the return value in both client and server stubs A parameter of the function may be specified as this variable Example Specification of a server function int func int par The function takes par as an input and returns a value of type int Definition of the server function int ret func IN DFLT int par Rev 1 01 Mar 17 2008 Page 52 of 128 REJ10J1822 0101 34 NE SAS Section 6 Definitions of Server Functions 6 2 2 Function without a Return Value Description For a function that doesn t have a return value a return value specification must not be made Example Specification of a server function void func struct ST ptr The function has no input and returns a value in th
11. 000 Browse Figure 4 1 New Custom Placeholder Dialog Box Rev 1 01 Mar 17 2008 Page 12 of 128 REJ10J1822 0101 7tENESAS Section 4 Executing RPCGEN 2 Adding a File Extension To make execution as a custom build phase work the filename extension x for config files must be added as a filename extension to be used in custom build phases Select Project gt File Extensions from the menu bar of the High performance Embedded Workshop This opens the File Extensions dialog box shown in figure 4 2 Extension Group abs Absolute file 8 inc Assembly include file 2 lis Assembly list file E asm Assembly source file E src Assembly source file Rome bin Binary file E h C header file Open with E st C list file g c C source file E hpp G header file 8 Ipp G list file source file Figure 4 2 File Extensions Dialog Box Clicking the Add button opens the Add File Extension dialog box shown in figure 4 3 Add the e v extension x as shown in the figure Rev 1 01 Mar 17 2008 Page 13 of 128 RENESAS REJ10J1822 0101 Section 4 Executing RPCGEN Add File Extension File extension D z E usd Cancel m File group C Extension belongs to an existing group Extension belongs to a new group RPGGEN config file Associated application Open RPCGEN config file Editor Figure 4 3 Add File Ex
12. Page 67 of 128 RENESAS REJ10J1822 0101 Section 6 Definitions of Server Functions UINT32 rpcsvr SMPL func rpc_server_stub_info pinfo inf struct INF _ pInfo gt pucParamArea __ulInputParamOffset ullnputParamOffset ALIGNUP4 sizeof inf if UINT32 inf gt count gt OUL ptr struct ST pInfo pucParamArea ulInputParamOffset ret func inf ptr return UINT32 ret Figure 6 3 Code Output to the Server Stub IN for COUNT Examples Example 1 Specification of a server function int func struct ST ptr Pointer ptr to an array of 10 elements of the structure type ST will be passed Definition of the server function int ret func IN ARY struct ST ptr COUNT 10 Rev 1 01 Mar 17 2008 Page 68 of 128 REJ10J1822 0101 34 NE SAS Section 6 Definitions of Server Functions Example 2 Specification of a server function int func struct ST ptr int count Pointer ptr to an array of count elements of the structure type ST will be passed Definition of the server function int ret func IN ARY struct ST ptr COUNT count IN DFLT int count Example 3 Specification of a server function int func int count struct ST ptr Pointer ptr to an array of count elements of the structure type ST will be passed Definition of the server function int ret func IN DFLT int count IN ARY struct ST ptr COUNT count Examp
13. Section 5 Specifications of a Config File 5 7 Server Functions The following definition statement is available for defining server functions e RPC_FUNC Server functions 5 7 1 RPC_FUNC Format RPC_FUNC definitions of server functions E Description Enter definitions of server functions between the braces of RPC FUNC For information on definition statements for server functions refer to section 6 Definitions of Server Functions Example RPC FUNC int ret funcl IN DFLT int par func2 OUT PTR struct ST ptr Rev 1 01 Mar 17 2008 Page 47 of 128 RENESAS REJ10J1822 0101 Section 5 Specifications of a Config File Rev 1 01 Mar 17 2008 Page 48 of 128 REJ10J1822 0101 34 NE SAS Section 6 Definitions of Server Functions Section 6 Definitions of Server Functions 6 1 Format Server functions must be defined in one of the following formats 1 lt specification of the return value gt lt variable to be returned gt lt function name gt lt parameter gt lt option gt A 2 function name gt lt parameter gt lt optionsA 3 lt directive to extend the return value gt lt specification of the return value variable to be returned function name gt lt parameter gt option A RPCGEN keywords enclosed by are specified in parameter option and directive to extend the return value Example 1 Specificat
14. a Config File 5 4 Controlling the Output of include Directives Use the statements listed below to output include directives for user files to the files generated by RPCGEN Note however that include directives for the following include files will always be output Table 5 1 Default Include Files Filename Description string h Standard include file for the compiler types h Header file of data type definitions comes with Renesas operating systems such as the HI7200 MP rpc_public h RPC header file that comes with Renesas operating systems such as the HI7200 MP The following definitions are available for controlling the output of include directives e GLOBAL_INCFILE Include file common to the client and server stubs e CLNT_INCFILE Include file for the client stub e SVR_INCFILE Include file for the server stub Rev 1 01 Mar 17 2008 Page 28 of 128 REJ10J1822 0101 34 NE SAS Section 5 Specifications of a Config File 5 4 1 Order of Include Directives RPCGEN outputs include directives to files in the following order 1 config file gt _cInt c Default include files in the order given in table 5 1 File s defined with GLOBAL INCFILE in the order of file definition File s defined with CLNT_INCFILE in the order of file definition config file public h generated by RPCGEN only if SVR AUTH has not been defined config file clnt h generated by RPCGEN config file priv
15. be generated in the clnt source directory under the current directory 5 3 3 CLNT_INCPATH Format CLNT INCPATH lt path gt Description This statement defines the path under which config file clnt h and config file gt _private h will be generated When the CLNTI option is used a definition of CLNT INCPATH is ignored Example CLNT_INCPATH C clnt include config file gt _clnt h and config file gt _private h will be generated in the C clnt include directory Rev 1 01 Mar 17 2008 Page 26 of 128 REJ10J1822 0101 34 NE SAS Section 5 Specifications of a Config File 5 3 4 SVR_SOURCEPATH Format SVR_SOURCEPATH lt path gt Description This statement defines the path under which lt config file gt _svr c will be generated When the SVRS option is used a definition of SVR_SOURCEPATH is ignored Example SVR_SOURCEPATH svr source lt config file gt _svr c will be generated in the svr source directory under the current directory 5 3 5 SVR_INCPATH Format SVR_INCPATH lt path gt Description This statement defines the path under which lt config file gt _svr h will be generated When the SVRI option is used a definition of SVR_INCPATH is ignored Example SVR_INCPATH svr include lt config file gt _svr h will be generated in the svr include directory under the current directory Rev 1 01 Mar 17 2008 Page 27 of 128 RENESAS REJ10J1822 0101 Section 5 Specifications of
16. be provided by the user if one is required The specification of the server initialization function generated by RPCGEN is as follows e C language API INT32 rpcsvr server name init rpc svr config config e Return value The return value of rpc start server or rpc start server with paramarea e Parameter config The definition of an rpc svr config structure is given below Each of the members has the same meaning as that of the rpc server info structure typedef struct UINT32 ulRPCServerID UINT32 ulRPCServerVersion UINT32 ServerStubTaskPriority UINT32 ulStubStackSize UINT32 ulMaxParamAreaSize void pUserDefinedData rpec svr config Rev 1 01 Mar 17 2008 Page 96 of 128 REJ10J1822 0101 34 NE SAS Section 8 Application Interface e Specification The server is started up by calling rpc_start_server when SVR_STATIC has not been specified or rpc_start_server_with_paramarea when SVR_STATIC has been specified When SVR_AUTH has not been specified however the definitions of server ID and version in __config UIRPCServerID and __config UIRPCServerVersion are ignored Instead the macros RPCSVR_ID_ lt server name gt and RPCSVR_VERS_ lt server name gt output to lt config file gt _public h are taken as the server ID and version in starting up the server 8 4 Server Stub Function Table The server stub function table is rpc_server_info ServerStubList the table defined by rpc_start_server
17. by a definition of COUNT which indicates the number of elements in the array to be passed between the client and the server 1 When the input output keyword selected for ARY is IN In this case a parameter specification that includes ARY must be followed by a single definition of COUNT to indicate the number of elements in the array lt parameter including ARY gt lt definition of COUNT gt COUNT is an expression that specifies the number of elements in the array to be passed from the client to the server RPCGEN creates client stub code that makes an RPC call after setting the size of an input IOVEC structure by using an expression of the kind specified in figure 6 2 This must be taken into account when COUNT is defined For example the expression for COUNT must not contain any variables that hold the return value of a function Figures 6 2 and 6 3 show the code for example 5 without SVR_AUTH of the examples introduced following the figures int func struct INF inf struct ST ptr IOVEC input 2 input X ulInputParamCount pBaseAddress UINTS8 inf input X ulInputParamCount ulSize gizeof inf if UINT32 inf gt count gt OUL input X ulInputParamCount pBaseAddress UINT8 ptr input X ulInputParamCount ulSize sizeof ptr UINT32 inf count rpc call Figure 6 2 Code Output to the Client Stub IN for COUNT Rev 1 01 Mar 17 2008
18. function which externally refers to the table to lt config file gt _svr c UINT32 const _ rpcsvr server name StubTable l rpc server stub info lt server stub function name gt lt server stub function name gt Server name gt refers to the server name defined with SVR_NAME 4 With SVR_NOSTUBTBL and SVR_NOINIT RPCGEN generates neither a server initialization function nor a server stub function table so they must be provided in the application Rev 1 01 Mar 17 2008 Page 98 of 128 REJ10J1822 0101 34 NE SAS Section 8 Application Interface 8 5 Server Shutdown Function The server shutdown function is called by the server application and stops the server by using rpc_stop_server When SVR_NOSHUTDOWN has not been specified RPCGEN generates a server shutdown function rpcsvr_ lt server name gt _shutdown RPCGEN outputs the server shutdown function itself to lt config file gt _svr c and the prototype declaration to lt config file gt _svr h Server name gt refers to the server name defined with SVR_NAME When SVR_NOSHUTDOWN has been specified RPCGEN does not generate a server shutdown function The server shutdown function must be provided by the user if one is required The specification of the server shutdown function generated by RPCGEN is as follows e C language API INT32 rpcsvr server name shutdown UINT32 ulServerID UINT32 ulServerVersion e Return value The return
19. header file included by config file clnt c only 4 config file svr c server stub source file This file contains the server stub functions server initialization function server shutdown function and server stub function table 5 config file svr h server stub header file This file contains definitions required for use of the server initialization function and server shutdown function The definitions include prototype declarations of the server stub functions server initialization function and server shutdown function 6 config file public h header file for the client and server stubs This is a header file for the client and server applications For details refer to section 8 9 config file public h Rev 1 01 Mar 17 2008 Page 8 of 128 REJ10J1822 0101 32 NE SAS Section 4 Executing RPCGEN Section 4 Executing RPCGEN 4 1 Executing RPCGEN RPCGEN must be executed from the command prompt as follows perlA I rpcgen path A rpcgen path gt rpcgen plA config file gt A lt option gt RET lt rpcgen path gt is a path to the directory where RPCGEN has been installed lt config file gt refers to a file describing the specifications of the client and server stubs to be generated This file must be created by the user The standard filename extension for the config file is x which must not be omitted when the name is entered in a command line After execution of the above command RP
20. input information including a type int member count which indicates the number of elements in the array pointed to by ptr func outputs all inf gt count elements Definition of the server function int ret func IN PTR struct INF inf INOUT ARY struct ST ptr COUNT inf gt count COUNT inf count Rev 1 01 Mar 17 2008 Page 82 of 128 REJ10J1822 0101 34 NE SAS Section 6 Definitions of Server Functions Example 8 Specification of a server function int func struct INF inf struct ST ptr ptr points to an array for input and output and inf indicates other input information including a type int member count which indicates the number of elements in the array pointed to by ptr The return value indicates the number of elements to be output Definition of the server function int ret func IN PTR struct INF inf INOUT ARY struct ST ptr COUNT inf gt count COUNT ret 6 7 Optional Keywords The following optional keywords are available to control output to the client or server stub for the individual server functions e SVRSTUB Server stub e SVRFUNC Server function name e CLNTSTUB Client stub e UNACK Asynchronous call e CLNTCOPYCBK RPC call by rpc call copycbk Two or more optional keywords may be specifiable Note however that the same keyword must not be used more than once When a combination of keywords specified by the user is not valid RPCGEN shows an error message and terminate
21. int par The function takes par as an input and returns a value of type int Definition of the server function int ret func IN DFLT int par Rev 1 01 Mar 17 2008 Page 55 of 128 RENESAS REJ10J1822 0101 Section 6 Definitions of Server Functions 6 4 Parameters Parameters must be defined in the following format parameter directive lt parameter specification gt The parameter directive is a declaration of the following parameter specification and has the form given below lt type of input output gt A lt data type gt lt type of input output gt Specify one of the keywords given in section 6 5 Keywords for Input Output lt data type gt Specify one of the keywords given in section 6 6 Keywords for Data Types lt parameter specification gt Define the specification of the original function Table 6 1 lists the available combinations of keywords although details on input output and data types will be described in later sections Note however that REF and DESC cannot be used at the same time Table 6 1 Input Output and Data Types Input Output Data Type Option DFLT STR PTR ARY IN None Y Y Y Y REF Y Y Y DESC v v v v OUT None Y Y REF DESC INOUT None Y Y REF DESC v Available Not available RPCGEN reports an error and terminates the processing Rev 1 01 Mar 17 2008 Page 56 of 128 R
22. makes an RPC call and has the same API as or an API similar to the server function If SVRAUTH has not been specified the API will be the same as that of the server function Specifying CLNTSTUB prevents the creation of a specific client stub function 3 1 2 Server 1 Server initialization function This function starts up the server Specifying SVR_NOINIT prevents the creation of the server initialization function 2 Server shutdown function This function shuts the server down Specifying SVR NOSHUTDOWN prevents the creation of the server shutdown function 3 Server stub functions Each of these functions is called back from the RPC library and then calls a server function Specifying SVRSTUB prevents the creation of a specific server stub function while specifying SVRFUNC allows the name of the called server function to be replaced Rev 1 01 Mar 17 2008 Page 6 of 128 REJ10J1822 0101 32 NE SAS Section 3 Functions and Files Generated by RPCGEN 3 2 Files Generated by RPCGEN RPCGEN generates the files listed in table 3 1 in accord with the name of the config file Table 3 1 Files Generated by RPCGEN Filename Description Definition of the File Location config file clnt c Client stub source file CLNTS option or CLNT SOURCEPATH in the config file config file clnt h Client stub header file CLNTI option or CLNT_INCPATH in config file private h Internal header file for the the contig file client
23. name of the function as called by the server SVRFUNC cannot be used with SVRSTUB Example Specification of a server function int func int par The function takes par as an input and returns a value of type int func on the server however is named func_main Definition of the server function int ret func IN DFLT int par SVRFUNC func main Rev 1 01 Mar 17 2008 Page 85 of 128 RENESAS REJ10J1822 0101 Section 6 Definitions of Server Functions 6 7 3 CLNTSTUB Client Stub Format CLNTSTUB Description A client stub provided by the user is to be used so RPCGEN does not create a client stub Example Specification of a server function int func int par The function takes par as an input and returns a value of type int RPCGEN will not create a client stub for func because the user will provide this client stub Definition of the server function int ret func IN DFLT int par CLNTSTUB Rev 1 01 Mar 17 2008 Page 86 of 128 REJ10J1822 0101 34 NE SAS Section 6 Definitions of Server Functions 6 7 4 UNACK Asynchronous Call Format UNACK Description The client makes RPC calls in asynchronous mode When UNACK is not used RPC calls are made in synchronous mode UNACK cannot be used with CLNTSTUB Note When UNACK is used the return value of the server function must be of type void and the input output keyword for parameters must be IN Example Specification of a server function
24. names defined between the braces of RPC_FUNC Since the server stub functions are called from within the RPC library the user usually does not need to recognize the APIs of the server stub functions output by RPCGEN If SVRSTUB is used to prevent creation of the server stub functions however the user must implement the server stub functions in accord with the specifications Example Contents of a config file SVR_NAME EXAMPLE RPC_FUNC int ret funcl IN DFLT int par func OUT PTR struct ST ptr IE Specification of a client stub function UINT32 rpcsvr EXAMPLE funcl rpc server stub info const pInfo UINT32 rpcsvr EXAMPLE func2 rpc server stub info const pInfo Rev 1 01 Mar 17 2008 Page 95 of 128 RENESAS REJ10J1822 0101 Section 8 Application Interface 8 3 Server Initialization Function The server initialization function is called by the server application and starts up the server by using rpc_start_server or rpc_start_server_with_paramarea When SVR_NOINIT has not been specified RPCGEN generates a server initialization function rpcsvr server name init RPCGEN outputs the server initialization function itself to config file svr c and the prototype declaration to config file svr h Server name gt refers to the server name defined with SVR NAME When SVR NOINIT has been specified RPCGEN does not generate a server initialization function The server initialization function must
25. not be omitted The lt keyword gt directory doesn t exist The directory lt keyword gt was specified as a path by a definition such as PUB_INCPATH but does not exist Cannot create file File lt filename gt RPCGEN cannot generate the file lt filename gt Cannot create temporary file RPCGEN cannot generate intermediate files in the current directory 10 3 Definition Errors other than RPC FUNC Illegal keyword definition The definition of parameter keyword is illegal Cannot define both keyword 1 and keyword 2 keyword 1 and keyword 2 must not be specified at the same time 10 4 Definition Errors RPC FUNC RPC FUNC Cannot define both keyword 1 and keyword 2 for lt function name gt In the definition of function name keyword 1 and keyword 2 must not be specified at the same time RPC FUNC Illegal keyword definition for lt function name gt In the definition of function name parameter keyword is illegal RPC FUNC Illegal COUNT definition for lt function name gt In the definition of function name COUNT following ARY is illegal Rev 1 01 Mar 17 2008 Page 108 of 128 REJ10J1822 0101 32 NE SAS Section 11 Samples Section 11 Samples This section introduces samples of the code in a config file and the corresponding output files To create these samples we have used the C standard library functions and the HI7200 MP se
26. or rpc_start_server_with_paramarea called by the server initialization function 1 With neither SVR NOSTUBTBL nor SVR_NOINIT RPCGEN generates the server initialization function and server stub function table Only the server initialization function generated by RPCGEN looks up the server stub function table Thus RPCGEN outputs the server stub function table as static data to config file svr c 2 Without SVR NOSTUBTBL and with SVR_NOINIT RPCGEN does not generate the server initialization function but does generate the server stub function table RPCGEN outputs the server stub function table in the form given below to config file svr c The server initialization function provided in the application must look up the server stub function table to call rpc start server orrpc start server with paramarea UINT32 const _ rpcsvr server name gt StubTable l rpc server stub info lt server stub function name gt lt server stub function name gt Server name gt refers to the server name defined with SVR NAME Rev 1 01 Mar 17 2008 Page 97 of 128 RENESAS REJ10J1822 0101 Section 8 Application Interface 3 With SVR_NOSTUBTBL and without SVR_NOINIT RPCGEN does not generate the server stub function table but does generate the server initialization function RPCGEN assumes that the server stub function table shown below is provided in the application and outputs the server initialization
27. path for output of config file svr h If this option is used a definition of SVR INCPATH in the config file is ignored Rev 1 01 Mar 17 2008 Page 11 of 128 RENESAS REJ10J1822 0101 Section 4 Executing RPCGEN 4 3 Executing RPCGEN as a Build Phase in the High performance Embedded Workshop After RPCGEN has been registered as a custom build phase in the workspace it will be automatically executed at the time of building 1 Defining Custom Placeholders The following two custom placeholders must be defined e Path to RPCGEN Placeholder RPCGEN INST Description RPCGEN Base directory Directory Directory under which RPCGEN is stored e Path to Perl exe Placeholder PERL INST Description Perl Base directory Directory Directory under which perl exe is stored To define a custom placeholder follow the procedure below Select Setup Customize from the menu bar of the High performance Embedded Workshop Then select the Placeholders tab of the Customize dialog box Choose either Application wide custom placeholders or Workspace wide custom placeholders and click on the Add button This opens the New Custom Placeholder dialog box shown in figure 4 1 Define the two custom placeholders in this dialog box by filling in the information given above New Custom Placeholder Placeholder RPGGEN_INST Cancel Description RPOGEN Base directory Directory C Program Files Renesas RPCGEN 1
28. stub config file gt _svr c Server stub source file SVRS option or SVR SOURCEPATH in the config file config file svr h Server stub header file SVRI option or SVR_INCPATH in the config file config file public h Header file for the client and PUBI option or PUB INCPATH in the server stubs config file When the config file is sample x for example RPCGEN will generate the following files sample clnt c sample clInt h sample svr c sample svr h sample private h and sample public h To temporarily save information during the process of file generation RPCGEN also generates intermediate files in the current directory The names of these intermediate files consist of two underscores appended before the filenames given in the table above 1 config file cInt c client stub source file This file contains the client stub functions client initialization function and client shutdown function 2 config file cInt h client stub header file This file contains definitions required for use of the client stub functions client initialization function and client shutdown function The definitions include prototype declarations of the client stub functions client initialization function and client shutdown function Rev 1 01 Mar 17 2008 Page 7 of 128 RENESAS REJ10J1822 0101 Section 3 Functions and Files Generated by RPCGEN 3 config file private h internal header file for the client stub This is a
29. 28 585 100 Fax 44 1628 585 900 Renesas Technology Shanghai Co Ltd Unit 204 205 AZIACenter No 1233 Lujiazui Ring Rd Pudong District Shanghai China 200120 Tel 86 21 5877 1818 Fax 86 21 6887 7858 7898 Renesas Technology Hong Kong Ltd 7th Floor North Tower World Finance Centre Harbour City Canton Road Tsimshatsui Kowloon Hong Kong Tel 852 2265 6688 Fax 852 2377 3473 Renesas Technology Taiwan Co Ltd 10th Floor No 99 Fushing North Road Taipei Taiwan Tel 886 2 2715 2888 Fax 886 2 3518 3399 Renesas Technology Singapore Pte Ltd 1 Harbour Front Avenue 406 10 Keppel Bay Tower Singapore 098632 Tel 65 6213 0200 Fax 65 6278 8001 Renesas Technology Korea Co Ltd Kukje Center Bldg 18th FI 191 2 ka Hangang ro Yongsan ku Seoul 140 702 Korea Tel 82 2 796 3115 Fax 82 2 796 2145 Renesas Technology Malaysia Sdn Bhd Unit 906 Block B Menara Amcorp Amcorp Trade Centre No 18 JIn Persiaran Barat 46050 Petaling Jaya Selangor Darul Ehsan Malaysia Tel 603 7955 9390 Fax 603 7955 9510 Colophon 6 2 Stub Generator V 1 00 User s Manual 2 NEC S AS RenesasTechnology Corp 2 6 2 Ote machi Chiyoda ku Tokyo 100 0004 Japan
30. 4 REF Passing by Reference Example Specification of a server function void func struct ST ptr The function has no input and returns the structure of type ST that is indicated by ptr Definition of the server function func OUT PTR struct ST ptr Rev 1 01 Mar 17 2008 Page 65 of 128 RENESAS REJ10J1822 0101 Section 6 Definitions of Server Functions 6 6 4 ARY Array Input Output Keywords Available in Combination with ARY All Description The data of a specified array are transferred between the client and the server ARY is only specifiable when the parameter is of the array type As the parameter specification that follows this keyword define a parameter that expresses the first address of the array When ARY is used it must be followed by a definition of COUNT which indicates the number of elements in the array to be passed between the client and the server For details refer to section 6 6 5 COUNT Number of Elements in an Array When IN has been selected and REF is used with ARY the pointer to the array is transferred instead of the array it indicates For details refer to section 6 5 4 REF Passing by Reference Example Refer to section 6 6 5 COUNT Number of Elements in an Array Rev 1 01 Mar 17 2008 Page 66 of 128 REJ10J1822 0101 34 NE SAS Section 6 Definitions of Server Functions 6 6 5 COUNT Number of Elements in an Array Description When ARY is used it must be followed
31. 7 2008 Page 44 of 128 REJ10J1822 0101 34 NE SAS Section 5 Specifications of a Config File 5 6 3 CLNT_CALLCHK Format CLNT_CALLCHK Description RPCGEN creates the following code in config file gt _clnt c to facilitate saving of the return values of RPC calls rpc_call or rpc call copycbk and outputs the API of rpc_retval_adr in config file clnt h rpc retval adr rpc call rpc_retval_adr must be implemented by the user If this definition is omitted the following code which discards the return value of an RPC call will be created rpc calti For how to implement rpc_retval_adr refer to section 8 8 rpc_retval_adr Example CLNT CALLCHK Rev 1 01 Mar 17 2008 Page 45 of 128 RENESAS REJ10J1822 0101 Section 5 Specifications of a Config File 5 6 4 CLNT SECTION Format CLNT SECTION section name gt Description This statement specifies the section to which the client stubs will be assigned When this definition is omitted one of the section names alphabetical characters listed below will automatically be assigned If CLNT SECTION has been defined the actual section name will be one of the letters listed below followed by the section name e Program section P e Constant section C e Non initialized data section B e Initialized data section D Example CLNT SECTION C EXAMPLE Rev 1 01 Mar 17 2008 Page 46 of 128 REJ10J1822 0101 34 NE SAS
32. CGEN KR RR KK RR RR RR RRR RR k k RR RK RR RR RR KK RR RR RR RK RK KR RR e ke k k ke ke KK BORK KKK KR KK RK RK Sk ke ke KR RK RR KR RK RR RR RR RRR e ke ke RR KK KK Do not edit unless you really know what you are doing this file was automatically generated by rpcgen pl on 2007 11 28 12 54 Be aware that this file may be generated as part of the build and therefore any changes made by hand will possibly be lost ona rebuild KOR KR KR KK RR RR RR KR KR RK RR RR RR RK RRR RR RK k k k RR RR RR RK KR RR e ke ke ke ke ke KK ifndef RPC SMPL CLNT H define RPC SMPL CLNT H ifdef _ cplusplus extern C endif INT32 rpcclnt SMPL init UINT32 ulRPCServerID UINT32 ulRPCServerVersion INT32 rpcclnt SMPL shutdown UINT32 ulRPCServerID UINT32 ulRPCServerVersion double atof const char nptr int atoi const char nptr ER ref tsk2 ID tskid T RTSK pk rtsk ER ref sem2 ID semid T RSEM pk rsem extern INT32 rpc retval adr void ifdef cplusplus Rev 1 01 Mar 17 2008 Page 112 of 128 REJ10J1822 0101 7tENESAS Section 11 Samples endif endif End of RPC SMPL CLNT H 11 3 sample private h BORK KR KKK ke e KR KR RK RRR kk ke e ke RR RR RK ck Sk Sk k k RK RR RK RR Sk k k RR RR RK KK RRR KR ke ke ke ke KK KK File Header Comment Sample Config File for RPCGEN HR KK KK KK KR KR KK KR KKK KK KR RRR RR RRR KR k k KKK BRK RR KK
33. CGEN will generate the C language source files and header files for the client and server stubs in accord with the information contained in the config file If config file and option are omitted the command syntax will be shown Rev 1 01 Mar 17 2008 Page 9 of 128 RENESAS REJ10J1822 0101 Section 4 Executing RPCGEN 4 2 Options 4 2 1 PUBI Format PUBI lt path gt Description This option is used to specify the path for output of lt config file gt _public h If this option is used a definition of PUB_INCPATH in the config file is ignored 4 2 2 CLNTS Format CLNTS lt path gt Description This option is used to specify the path for output of config file clnt c If this option is used a definition of CLNT SOURCEPATH in the config file is ignored 4 2 3 CLNTI Format CLNTI lt path gt Description This option is used to specify the path for output of config file clnt h and config file private h If this option is used a definition of CLNT INCPATH in the config file is ignored Rev 1 01 Mar 17 2008 Page 10 of 128 REJ10J1822 0101 34 NE SAS Section 4 Executing RPCGEN 4 2 4 SVRS Format SVRS lt path gt Description This option is used to specify the path for output of lt config file gt _svr c If this option is used a definition of SVR_SOURCEPATH in the config file is ignored 4 2 5 SVRI Format SVRI path Description This option is used to specify the
34. Config File 5 5 3 SVR VERSION Format SVR VERSION server version Description This statement defines the server version The server version can only be specified as a 4 byte integer constant that can be represented as UINT32 or a C language macro name to be replaced by such a 4 byte integer constant If a C language macro is used this macro must have been defined in a file specified by GLOBAL INCFILE The server version is output to config file public h in the following format define RPCSVR VERS server name server version SVR VERSION cannot be omitted if SVR_AUTH has been omitted Also refer to section 5 5 8 SVR AUTH Example SVR_VERSION 1UL 5 5 4 SVR_NOINIT Format SVR_NOINIT Description If this statement is present RPCGEN will not create the server initialization function Use SVR_NOINIT when the server initialization function is provided as part of the application Also refer to sections 8 3 Server Initialization Function and 8 4 Server Stub Function Table Example SVR_NOINIT Rev 1 01 Mar 17 2008 Page 34 of 128 REJ10J1822 0101 7tENESAS Section 5 Specifications of a Config File 5 5 5 SVR_NOSTUBTBL Format SVR NOSTUBTBL Description The server stub function table is rpc server info ServerStubList the table defined by rpc start server or rpc start server with paramarea called by the server initialization function If this statement is present RPCGEN will no
35. EJ10J1822 0101 32 NE SAS Section 6 Definitions of Server Functions 6 5 Keywords for Input Output The following three keywords are available for setting the input output attributes of parameters e IN Input e OUT Output e INOUT Input and output The following optional keywords can also be attached to the keywords listed above note however that REF and DESC cannot be used at the same time e REF Passing by reference e DESC The parameter is not passed from the client to the server Each of these keywords specified with one of the data type keywords listed in section 6 6 works as a declaration of the subsequent parameter specification 6 5 1 IN Input Description This keyword defines a parameter as an input to the server function The parameter is transferred from the client to the server and is then passed to the server function Example Specification of a server function int func int par The function takes par as an input and returns a value of type int Definition of the server function int ret func IN DFLT int par Rev 1 01 Mar 17 2008 Page 57 of 128 RENESAS REJ10J1822 0101 Section 6 Definitions of Server Functions 6 5 2 OUT Output Description This keyword defines a parameter as an output from the server function The data output by the server function to the area specified by the parameter are returned to the client This keyword can only be used with the data type keywords PTR and A
36. KR RR KR KK RR RK RR KR RR KK RRR e hec RRR RK RR RR RR KR RR KK RRR e ke KK RK KKK Do not edit unless you really know what you are doing this file was automatically generated by rpcgen pl on 2007 11 28 12 54 Be aware that this file may be generated as part of the build and therefore any changes made by hand will possibly be lost ona rebuild HR KKK KR KR RR KK KK RR KK KK KR RR RR RR RRR KR RR ke k x ifndef RPC SMPL PRIVATE H define RPC SMPL PRIVATE H enum RPC SMPL ATOF RPC SMPL ATOI RPC SMPL REF TSK2 RPC SMPL REF SEM2 endif End of RPC SMPL PRIVATE H Rev 1 01 Mar 17 2008 Page 113 of 128 RENESAS REJ10J1822 0101 Section 11 Samples 11 4 sample clInt c BRK KR KK ke ke e KR KR RK KR Sk kk ke RR RR RR RK ck Sk Sk ke RR RR KK RRR RRR RR KK RR RR e ke ke ke ke ke KKK File Header Comment Sample Config File for RPCGEN HR KK KK KK KK RK KR KK RR KK KK KR RRR RR k k k k k k e ke ke ke ke KKK BRK KR KKK RR RR RR KK RRR KK RR RR RR KK RRR RR RR KK RR RR KR RR RR KK RRR KR ke ke KK KK KK Do not edit unless you really know what you are doing this file was automatically generated by rpcgen pl on 2007 11 28 12 54 Be aware that this file may be generated as part of the build and therefore any changes made by hand will possibly be lost ona rebuild HR KKK KK KR KK KR KK KR KK RK KR RR KR RR k k k k k e ke ke RR KKK include
37. L SVR_H define RPC SMPL SVR_H typedef struct UINT32 ulRPCServerID UINT32 ulRPCServerVersion UINT32 ServerStubTaskPriority UINT32 ulStubStackSize UINT32 ulMaxParamAreaSize void pUserDefinedData rpe svr config ifdef _ cplusplus extern C endif UINT32 rpcsvr SMPL atof rpc server stub info _ pInfo UINT32 rpcsvr SMPL atoi rpc server stub info _ pInfo UINT32 rpcsvr SMPL ref tsk2 rpc server stub info pInfo Rev 1 01 Mar 17 2008 Page 120 of 128 REJ10J1822 0101 32 NE SAS Section 11 Samples UINT32 rpcsvr SMPL ref sem2 rpc server stub info pInfo INT32 rpcsvr SMPL init rpc svr config config INT32 rpcsvr SMPL shutdown UINT32 ulServerID UINT32 ulServerVersion ifdef cplusplus endif endif End of RPC SMPL SVR H Rev 1 01 Mar 17 2008 Page 121 of 128 RENESAS REJ10J1822 0101 Section 11 Samples 11 6 sample_svr c BORK KK RK RK RR KR KR RK KR RR RR KR RK KR RR RR RRR e ke ke RR KK KK File Header Comment Sample Config File for RPCGEN KR RR KK RR RR RR RRR RR k k RR RK RR RR RR KK RR RR RR RK RK KR RR e ke k k ke ke KK BORK KKK KR KK RK RK Sk ke ke KR RK RR KR RK RR RR RR RRR e ke ke RR KK KK Do not edit unless you really know what you are doing this file was automatically generated by rpcgen pl on 2007 11 28 12 54 Be aware that this file may be generated as part of the build and therefore any chan
38. N Include files for xxx svr c Include files for xxx clnt c Server name Server ID Server version How to authenticate on enerate server initialize function Don t g t initiali functi Don t generate server stub function table Don t generate server shutdown function SVR STATIC size section Use static server SVR SECTION C SAMPLE CLNT NOINIT CLNT NOSHUTDOWN CLNT CALLCHK CLNT SECTION C SAMPLE RPC FUNC Rev 1 01 Mar 17 2008 Page 110 of 128 REJ10J1822 0101 Section name for server stubs Don t generate client initialize function Don t generate server shutdown function Save return value of RPC call Section name for client stubs Define server functions 32 NE SAS Section 11 Samples stdlib h RETEXT double ret atof IN STR const char nptr nptr does not have to point to non cached area int ret atoi IN REF STR const char nptr nptr must point to non cached area HI7200 MP service calls renamed from original service call name ER ercd ref tsk2 IN DFLT ID tskid OUT PTR T RTSK pk rtsk ER ercd ref sem2 IN DFLT ID semid OUT PTR T RSEM pk rsem Rev 1 01 Mar 17 2008 Page 111 of 128 RENESAS REJ10J1822 0101 Section 11 Samples 11 2 sample clnt h BORK KKK KR KK RR KR RK KK KR KR KR KR RK RR RR RK RR e e ke ke ke ke ke ke KK File Header Comment Sample Config File for RP
39. OUL UINT32 __ulOutputParamCount OUL ER ercd tskid ID pInfo pucParamArea _ulInputParamOffset __ulInputParamOffset ALIGNUP4 sizeof ID pk_rtsk T RTSK _ pInfo pucParamArea __ulInputParamOffset ercd ref tsk2 tskid pk rtsk pInfo pOutputIOVectorTable ulOutputParamCount l pBaseAddress pk rtsk pInfo pOutputIOVectorTable ulOutputParamCount ulSize sizeof pk_rtsk __piInfo gt ulOutputIOVectorTableSize 1UL return UINT32 ercd UINT32 rpcsvr SMPL ref sem2 rpc server stub info _ pInfo ID semid T_RSEM pk_rsem UINT32 ulInputParamOffset OUL UINT32 __ulOutputParamCount OUL ER ercd semid ID pInfo pucParamArea _ulInputParamOffset __ulInputParamOffset ALIGNUP4 sizeof ID Rev 1 01 Mar 17 2008 Page 124 of 128 REJ10J1822 0101 7tENESAS Section 11 Samples pk rsem T RSEM _ pInfo pucParamArea ulInputParamOffset ercd ref sem2 semid pk rsem pInfo pOutputIOVectorTable ulOutputParamCount l pBaseAddress pk rsem pInfo pOutputlIOVectorTable ulOutputParamCount ulSize sizeof pk_rsem pInfo ulOutputIOVectorTableSize 1UL return UINT32 ercd static UINT32 const rpcsvr SMPL StubTable rpc_server_stub_ info rpcsvr SMPL atof rpcsvr SMPL atoi rpcsvr SMPL ref tsk2 rpcsvr SMPL ref sem2 INT32 rpcsvr SMPL init rpc
40. Phases Dialog Box The created RPCGEN custom build phase is shown at the bottom of the Build Phases dialog box Use the Move Up button to move rpcgen so that it is above SH C C Library Generator Build Phases Build Order Build File Order File Mappings Build phase order rpceen Add SH G G Library Generator kaire cfe 2mp SH C C Compiler Remove SH Assembler OptLinker eS Move Down gt Import OK Cancel Figure 4 12 Build Phases Dialog Box Build Order Tab Open the Build File Order tab Select RPCGEN config file under File group and check the box for rpcgen under Phase order Rev 1 01 Mar 17 2008 Page 20 of 128 REJ10J1822 0101 34 NE SAS Section 4 Executing RPCGEN Build Phases Build Order Build File Order File Mappings File group Assembly source file GC source file G source file Kernel config file Linkage symbol file RPOGEN config file Phase order Figure 4 13 Build Phases Dialog Box Build File Order Tab Setting of the RPCGEN build phase is now complete Rev 1 01 Mar 17 2008 Page 21 of 128 RENESAS REJ10J1822 0101 Section 4 Executing RPCGEN Rev 1 01 Mar 17 2008 Page 22 of 128 REJ10J1822 0101 34 NE SAS Section 5 Specifications of a Config File Section 5 Specifications of a Config File A config file contains definitions used for creation of the client and server stubs Sp
41. REJ10J1822 0101 Everywhere you imagine gy 2 E N ESAS Stub Generator V 1 00 User s Manual Renesas Microcomputer Development Environment System Rev 1 01 Renesas Technology Revision Date Mar 17 2008 Www renesas com Notes regarding these materials This document is provided for reference purposes only so that Renesas customers may select the appropriate Renesas products for their use Renesas neither makes warranties or representations with respect to the accuracy or completeness of the information contained in this document nor grants any license to any intellectual property rights or any other rights of Renesas or any third party with respect to the information in this document 2 Renesas shall have no liability for damages or infringement of any intellectual property or other rights arising out of the use of any information in this document including but not limited to product data diagrams charts programs algorithms and application circuit examples 3 You should not use the products or the technology described in this document for the purpose of military applications such as the development of weapons of mass destruction or for the purpose of any other military use When exporting the products or technology described herein you should follow the applicable export control laws and regulations and procedures required by such laws and regulations 4 Allinfor
42. RY Example Specification of a server function void func struct ST ptr The function has no input and returns a value in the ST structure indicated by ptr Definition of the server function func OUT PTR struct ST ptr Rev 1 01 Mar 17 2008 Page 58 of 128 REJ10J1822 0101 34 NE SAS Section 6 Definitions of Server Functions 6 5 3 INOUT Input and Output Description This keyword defines a parameter as an input to and output from the server function The data in the area specified by the parameter are transferred from the client to the server and then passed to the server function After that the data output by the server function to the area specified by the parameter are returned to the client This keyword can only be used with the data type keywords PTR and ARY Example Specification of a server function int func struct ST ptr The function takes ptr a pointer to a structure of type ST as an input and returns a value in the same area Definition of the server function int ret func INOUT PTR struct ST ptr Rev 1 01 Mar 17 2008 Page 59 of 128 RENESAS REJ10J1822 0101 Section 6 Definitions of Server Functions 6 5 4 REF Passing by Reference Description This keyword specifies that only the address of the parameter will be passed between the client and the server REF is useful when the size of the parameter to be passed is large This keyword can be used in conjunction with IN and wi
43. T ptr Rev 1 01 Mar 17 2008 Page 61 of 128 RENESAS REJ10J1822 0101 Section 6 Definitions of Server Functions 6 5 5 DESC Specified Parameter is not Passed from the Client to the Server Description This keyword specifies that the parameter will not be passed from the client to the server This keyword can also be used with IN Example Specification of a server function int func void While the actual server function has no parameter the client application calls an old API function func which does have a parameter int par Definition of the server function int ret func IN DESC PTR int par Rev 1 01 Mar 17 2008 Page 62 of 128 REJ10J1822 0101 34 NE SAS Section 6 Definitions of Server Functions 6 6 Keywords for Data Types Select one of the following four available keywords e DFLT Default e PTR Pointer e STR String e ARY Array When ARY is selected the parameter for COUNT must also be specified 6 6 1 DFLT Default Input Output Keywords Available for Use in Combination with DFLT IN Description The parameter itself is transferred between the client and server DFLT is only specifiable when the parameter has any of the following types e Integer signed short unsigned short signed long unsigned long signed int or unsigned int e Character signed char or unsigned char e Real number float or double e Structure type or union type object that is not an array Example Spec
44. amp semid input ulInputParamCount4 ulSize sizeof ID Ooutput ulOutputParamCount pBaseAddress UINT8 pk rsem output ulOutputParamCount ulSize sizeof pk rsem rpc retval adr rpc call amp info return ercd INT32 rpcclnt SMPL init UINT32 ulRPCServerID UINT32 ulRPCServerVersion return rpc connect RPCSVR ID SMPL RPCSVR VERS SMPL INT32 rpcclnt SMPL shutdown UINT32 ulRPCServerID UINT32 ulRPCServerVersion return rpc disconnect RPCSVR ID SMPL RPCSVR VERS SMPL NULL OUL Rev 1 01 Mar 17 2008 Page 118 of 128 REJ10J1822 0101 32 NE SAS Section 11 Samples Rev 1 01 Mar 17 2008 Page 119 of 128 RENESAS REJ10J1822 0101 Section 11 Samples 11 5 sample svr h BRK KK KK ke KR RR KR RK RK KR RR KR KR RK RR RR RR RRR e ke ke ke ke KK KK File Header Comment Sample Config File for RPCGEN KR RR KK RR RR RR RRR RR k k RR RK RR RR RR KK RR RR RR RK RK KR RR e ke k k ke ke KK BORK KKK KR KK RK RK Sk ke ke KR RK RR KR RK RR RR RR RRR e ke ke RR KK KK Do not edit unless you really know what you are doing this file was automatically generated by rpcgen pl on 2007 11 28 12 54 Be aware that this file may be generated as part of the build and therefore any changes made by hand will possibly be lost ona rebuild KOR RR KK RK RR RR RK RR RR RRR RR RK RRR RR RR RK RR RR RR k k RR RK RR KR ke ke ke ke ke KK ifndef RPC SMP
45. araa M MEI M 38 5 5 9 SVR SECTION idt Hie REI Ud ive edicti eie 42 5 6 Client Information 3 m eei tee beet ele asa aden v Rd eic E e EUR ERU dea 43 5 6 1 CENT NOIN rientro rere eR OE e heaton 43 5 6 2 CLNI NOSHUTDOWN duse stereo veco ero eue reo EUL ES HORE L be eoe SE Sos Ei e 44 5 6 3 CENT CALE CHK 7c ettet e etg codi ot Eti en een 45 5 6 4 CENT SECTION iiit i ta ie vh eet air cip rd ie Obes Mae 46 5 7 Server FUNCH Sacsan rie ert oa xe ce capo diee coo Eos t o rre eba Fee espe aee E cee 47 5 7 1 REPEC FUNC 2 EE wen UE MEN UT dd 47 Section 6 Definitions of Server Functions sesssssseeeeeeeeeneeennes 49 6 1 Issnpibt m CLEMENS 49 6 2 Function Type Direct Ves ss secet s e eh ii EE E pe o E Ro a 52 6 2 1 Function with a Return Valises 52 6 2 2 Function without a Return Value nennen 53 6 2 3 When the Return Value is not Representable as a 4 Byte Integer 54 6 3 Function Names eee tete aoro E eroe RR E ES CURE ah Ya ce ee vy es satay Cod epe rae dE ER 55 6 4 Parameters noni ied Ho ERU E extinct vi ERE SERES RR Gece TE HR RE RR ESS 56 6 5 Keywords for Input Output sees rennen nnn erinnerte nne 57 6 5 1 IN p t m EERS 57 6 5 2 OUT Output zc ase tee e Do aie tert e ea dene 58 6 5 3 INOUT Input and Output 2 riter ntt etra eric 59 6 5 4 REF Passing by Reference tees tne aisiki 60 6 5 5 DESC Specified Parameter is not Passed from the Cl
46. ate h generated by RPCGEN QNUM ODE Re ES 2 config file svr c Default include files in the order given in table 5 1 File s defined with GLOBAL INCFILE in the order of file definition File s defined with SVR INCFILE in the order of file definition config file public h generated by RPCGEN only if SVR_AUTH has not been defined config file svr h generated by RPCGEN Um ec Rev 1 01 Mar 17 2008 Page 29 of 128 RENESAS REJ10J1822 0101 Section 5 Specifications of a Config File 5 4 2 GLOBAL_INCFILE Format GLOBAL _INCFILE lt file gt A lt file gt Description This statement is for the output of include directives for the specified files to lt config file gt _clnt c and lt config file gt _svr c File s must be specified in the form filename or lt filename gt The difference between these two formats is as defined in the specification of the include directive When two or more files are to be specified they must be separated by a space Example GLOBAL INCFILE math h import include user public h 5 4 3 CLNT_INCFILE Format CLNT_INCFILE lt file gt A lt file gt Description This statement is for the output of include directives for the specified files to config file clnt c File s must be specified in the form filename or filename The difference between these two formats is as defined in the specification of the include directive When two or more files are
47. client and server stubs generated by RPCGEN Each of the client stub functions has the same API as the original server function Server IDs and server version information passed to the following functions will be ignored e Server initialization function e Server shutdown function e Client initialization function e Client shutdown function RPCGEN outputs the definitions of the server ID and server version to lt config file gt _public h Since the client stub functions and server and client initialization and shutdown functions generated by RPCGEN have include statements for lt config file gt _public h the server ID and server version information is passed to the RPC library If RPCGEN generated files for the client and server are from different generations the RPC library treats any RPC call as an error Rev 1 01 Mar 17 2008 Page 38 of 128 REJ10J1822 0101 34 NE SAS Section 5 Specifications of a Config File T Any server IDs and server versionsin astheorignal server versions in parameters areignored parameters are ignored lt config file gt _public h ciet kg Server ID initialization lt function Server version Figure 5 1 Model 1 Rev 1 01 Mar 17 2008 Page 39 of 128 RENESAS REJ10J1822 0101 Section 5 Specifications of a Config File 2 Model 2 Model 2 applies when SVR_AUTH has been specified In this model the application assigns the server ID and server version RPCGEN
48. e ST structure indicated by ptr Definition of the server function func OUT PTR struct ST ptr Rev 1 01 Mar 17 2008 Page 53 of 128 RENESAS REJ10J1822 0101 Section 6 Definitions of Server Functions 6 2 3 When the Return Value is not Representable as a 4 Byte Integer Format RETEXT A type of the return value gt A variable to hold the return value Description By default the return value is cast into UINT32 in the server stub and then transferred to the client This value is cast back into the original type in the client stub and is then returned When the return value is of the following types however the definition must have an RETEXT directive because the default behavior above is not applicable in these cases e 64 bit integer e Floating point e Structure type object e Union type object When a definition has an RETEXT directive code will be generated such that a value is returned from the server to the client by using the structure IOVEC Example Specification of a server function double func int par The function takes par as an input and returns a value of type double Definition of the server function RETEXT double ret func IN DFLT int par Rev 1 01 Mar 17 2008 Page 54 of 128 REJ10J1822 0101 34 NE SAS Section 6 Definitions of Server Functions 6 3 Function Names Description Type the name of the function you wish to use Example Specification of a server function int func
49. ecifically such definitions are made by appending keywords for passing to RPCGEN to the API of the server functions as described in section 6 Definitions of Server Functions Read this section carefully before creating your own config file The extension for config files is x One config file corresponds to the definition of one server Do not attempt to define multiple servers within a single config file 5 1 Definition Definitions must be written in either of the following formats lt keyword gt keyword For certain definitions two or more items can be entered between the braces Example GLOBAL INCFILE types h rpc public h A config file can include the following definitions 1 Locations where the files created by RPCGEN will be stored e PUB INCPATH Path to config file public h e CLNT_SOURCEPATH Path to config file clnt c e CLNT INCPATH Path to config file clnt h and config file private h e SVR SOURCEPATH Path to config file svr c e SVR INCPATH Path to config file svr h 2 Controlling output of the include directive to the files created by RPCGEN e GLOBAL INCFILE Include file common to the client and server stubs e CLNT_INCFILE Include file for the client stub e SVR_INCFILE Include file for the server stub Rev 1 01 Mar 17 2008 Page 23 of 128 RENESAS REJ10J1822 0101 Section 5 Specifications of a Config File
50. ee IR Ut PARERE NERS 11 4 2 5 NAUES Rees 11 4 3 Executing RPCGEN as a Build Phase in the High performance Embedded Workshop 12 Section 5 Specifications of a Config File rrt tenerte te tnens 23 5 1 Definitions aiU og OO MEER GOD PEARCE eR EEUU R 23 5 2 Mond c 24 5 3 Fil CO CATIONS ee netter e P ote eti aio in OE opi e aed 25 5 3 1 PUBSINCPATIE diss E M LI eS 25 5 32 CLNT SOURCEPATH 3 5 00 8 Iro ER POUR Pete 26 5 3 3 CLINT INCPA TH 3 entente EIS HIURI GEI U IUE RER 26 5 3 4 SVR SOURCBPATL eite epo Ut rm pete ee PU CE RE Set pepe aet eeann 27 5 3 5 SVR INCPATH 5 5 eet MR m dte det yet eU tlh E ENDE Len 27 5 4 Controlling the Output of include Directives 28 5 4 1 Order of Incltide Directives ies ener nnne rna eta ego edes 29 5 4 2 GLOBAL INGEILE 3 1 x petet irt ph Eee Re ele E AEE 30 iii 5 4 3 CENT INGCEIEE Enter c tunes vec bate stacks tah svev vee tig NS 30 5 4 4 SVR INCF E M does 31 5 5 Server InfOrmatlOn ire rre in tee ER EERE E E EEE 32 5 5 1 SVR NAME eit ue WE OUR UE NR ER THUS 32 5 5 2 HIP as 33 5 5 3 SVR VERSION iouis EHE FER LEEREN RE CEPR toed 34 5 5 4 SVRCNOINETE S udi HG HAIR URN MINE EI E 34 5 5 5 SVR NOSTUBITBL 5 3 e rre rot ee oi tie i ree retinens 35 5 5 6 SVR NOSHUTDONMW JN 4 ieeecet een ette Giese ee eet ae ee 36 5 5 7 SVRSSDATIC hano tmutiu E E ET 37 5 5 8 SVR AUTH s
51. efinitions are omitted RPCGEN will generate the source or header files in the current directory If a definition is otherwise correct but the defined path does not exist or the directory already contains read only files RPCGEN displays an error message and terminates the processing The following definitions of file locations are available e PUB_INCPATH Path to lt config file gt _public h e CLNT_SOURCEPATH Path to config file clnt c e CLNT INCPATH Path to config file clnt h and config file private h e SVR_SOURCEPATH Path to config file svr c e SVR INCPATH Path to config file svr h 5 3 1 PUB INCPATH Format PUB_INCPATH lt path gt Description This statement defines the path under which lt config file gt _public h will be generated When the PUBI option is used a definition of PUB_INCPATH is ignored Example PUB_INCPATH public_include lt config file gt _public h will be generated in the public_include directory under the current directory Rev 1 01 Mar 17 2008 Page 25 of 128 RENESAS REJ10J1822 0101 Section 5 Specifications of a Config File 5 3 2 CLNT_SOURCEPATH Format CLNT_SOURCEPATH lt path gt Description This statement defines the path under which lt config file gt _clnt c will be generated When the CLNTS option is used a definition of CLNT_SOURCEPATH is ignored Example CLNT_SOURCEPATH clnt source config file clnt c will
52. er function int func struct ST ptr int p count ptr points to an array for input and output that has p count elements func outputs the return parameter p count as the number of elements Definition of the server function int ret func INOUT ARY struct ST ptr COUNT p count COUNT p count INOUT PTR int p count Example 5 Specification of a server function int func struct ST ptr int count ptr points to an array for input and output that has count elements func outputs all count elements Definition of the server function int ret func INOUT ARY struct ST ptr COUNT count COUNT count IN DFLT int count Rev 1 01 Mar 17 2008 Page 81 of 128 RENESAS REJ10J1822 0101 Section 6 Definitions of Server Functions Example 6 Specification of a server function int func struct INF inf struct ST ptr int p count ptr points to an array for input and output and inf indicates other input information including a type int member count which indicates the number of elements in the array pointed to by ptr func outputs the return parameter p count as the number of elements Definition of the server function int ret func IN PTR struct INF inf INOUT ARY struct ST ptr COUNT inf gt count COUNT p count OUT PTR int p count Example 7 Specification of a server function int func struct INF inf struct ST ptr ptr points to an array for input and output and inf indicates other
53. f the client and server stubs the names of local variables start with two underscores In the client and server stubs on the other hand RPCGEN uses the parameter names specified in the definitions of server functions For this reason the parameter names specified in the definitions of server functions must not start with two underscores Rev 1 01 Mar 17 2008 Page 104 of 128 REJ10J1822 0101 34 N SAS Section 9 Notes Section 9 Notes 1 Check that the source program generated by RPCGEN works as intended We do not guarantee the operation of the program generated by RPCGEN Be sure to check that the program works as you intended RPCGEN does not report errors except in cases where a fatal error has been detected i e when continuing with current processing is impossible 2 Do not modify the contents of the files generated by RPCGEN Even if the contents of the source files generated by RPCGEN are not as you expected do not modify the files manually This is because files that have been manually modified by the user may be overwritten when RPCGEN is re executed Instead of manually correcting the generated files check and correct the contents of config files Rev 1 01 Mar 17 2008 Page 105 of 128 RENESAS REJ10J1822 0101 Section 9 Notes Rev 1 01 Mar 17 2008 Page 106 of 128 REJ10J1822 0101 32 NE SAS Section 10 Error Messages Section 10 Error Messages RPCGEN shows an error message and termina
54. ges made by hand will possibly be lost ona rebuild KR RR KR RR KR RK RRR RR RR RK RR RR KR RK RR RR RR RR RK KR RR k k k ke ke ke ke KKK include lt string h gt include types h include rpc public h include lt stdlib h gt include kernel h include sample public h include sample svr h Hpragma section C SAMPLE UINT32 rpcsvr SMPL atof rpc server stub info X pInfo const char nptr UINT32 ulInputParamOffset OUL H UINT32 __ulOutputParamCount OUL double ret Rev 1 01 Mar 17 2008 Page 122 of 128 REJ10J1822 0101 7tENESAS Section 11 Samples nptr const char pinfo gt pucParamArea __ulInputParamOffset ret atof nptr double pInfo gt pOutputIOVectorTable ulOutputParamCount l pBaseAddress ret pInfo pOutputIOVectorTable ulOutputParamCount ulSize sizeof double pIinfo ulOutputIOVectorTableSize 1UL return UINT32 NULL UINT32 rpcsvr SMPL atoi rpc server stub info pInfo const char nptr UINT32 __ulInputParamOffset OUL int ret nptr const char pInfo pucParamArea ulInputParamOffset ret atoi nptr pInfo ulOutputIOVectorTableSize OUL return UINT32 ret UINT32 rpcsvr SMPL ref tsk2 rpc server stub info pInfo ID tskid Rev 1 01 Mar 17 2008 Page 123 of 128 RENESAS REJ10J1822 0101 Section 11 Samples T RTSK pk rtsk UINT32 ulInputParamOffset
55. hases dialog box shown in figure 4 4 select rpcgen and click on the Modify button The Modify rpcgen dialog box opens Select the Output Syntax tab and type in the syntax for errors shown in figure 4 9 Add Output Syntax pe Error m Syntax FULLFILE E T3 Figure 4 9 Add Output Syntax Dialog Box Rev 1 01 Mar 17 2008 Page 18 of 128 REJ10J1822 0101 RENESAS Section 4 Executing RPCGEN Now settings must be made so that the files output by RPCGEN will be deleted by Build gt Clean Current Project or Build gt Clean All Projects from the High performance Embedded Workshop Select Build gt rpcgen to open the rpcgen Options dialog box figure 4 10 Select the Output Files tab check that the RPCGEN config file folder icon is active and click on the Add button This opens the Add Output File dialog box in which the names of the files output by RPCGEN should be entered For the filenames refer to section 3 2 Files Generated by RPCGEN rpceen Options Debue Options Output Files Dependent Files Qutput files ll prj cpuidl mE RPCGEN confie file rpc sample x Modify Default Options Remove Figure 4 10 rpcgen Options Dialog Box Add Output File File I gt Browse Cancel Figure 4 11 Add Output File Dialog Box Rev 1 01 Mar 17 2008 Page 19 of 128 RENESAS REJ10J1822 0101 Section 4 Executing RPCGEN 4 Settings in the Build
56. hat specifies the number of elements in the array to be actually output by the server This value must be less than or equal to that specified for the first COUNT RPCGEN creates client stub code that makes an RPC call after setting the size of an input IOVEC structure by using an expression of the kind specified in figure 6 4 RPCGEN also creates server stub code that makes a server function call before setting the size of an output IOVEC structure by using an expression of the kind specified in figure 6 5 This must be taken into account in defining the first and second COUNT For example an expression for the first COUNT must not contain any variables that hold the return value of a function Figures 6 4 and 6 5 show the code for example 8 without SVR_AUTH of the examples introduced following the figures Rev 1 01 Mar 17 2008 Page 71 of 128 RENESAS REJ10J1822 0101 Section 6 Definitions of Server Functions int func struct INF inf struct ST ptr IOVEC _ input 1 IOVEC _ output 1 input ulInputParamCount pBaseAddress UINT8 inf input ulInputParamCount 4 ulSize sizeof inf if UINT32 inf gt count gt OUL output X ulOutputParamCount pBaseAddress UINT8 ptr output ulOutputParamCount ulSize sizeof ptr UINT32 inf count rpce calli Figure 6 4 Code Output to the Client Stub OUT for First COUNT Rev 1 01 Mar 17 2008 Page 72
57. he definitions in this section use SVRSTUB or CLNTSTUB so that RPCGEN will not create a server or client stub for the server function A substitute server or client stub must be implemented by the user 7 1 Parameter RPCGEN is not capable of correctly creating a client or server stub for server functions that have parameters of the following types 1 Parameters with data types of undefined size RPCGEN cannot handle parameters with data types that have undefined size When such a parameter is a pointer however using REF allows the creation of stub code for passing of the pointer itself Example Specification of a server function int func void par The function takes ptr a pointer to data of undefined size as an input and returns an int type value Definition of the server function int ret func IN PTR void par In this case an error will occur in compilation of the client stub int ret func IN REF PTR void par In this case code to pass the value of par to the server will be created Rev 1 01 Mar 17 2008 Page 89 of 128 RENESAS REJ10J1822 0101 Section 7 Server Functions Not Supported by RPCGEN 2 Multiple level pointers RPCGEN only recognizes the first level of multiple level pointers Example Specification of a server function int func int ptr The function takes ptr a pointer to a pointer to int type data as an input Definition of the server function int ret func IN PTR int ptr
58. ient to the Server 62 6 6 Keywords for Data Types cisions tice rere t Let aser deer e Pea eed vage EEVEE EEES 63 6 6 1 DELT Default eintritt eI oe Prae pr reser re seeds cea vere deese v 63 6 6 2 STR KU 64 6 6 3 PTR Pointer neon iini pto dien rop rte PR 65 6 6 4 ARY Arta PT 66 6 6 5 COUNT Number of Elements in an Array 67 iv 13 NEC SAS 6 7 Optional oom 83 6 7 1 SVRSTUB Server Stub RO ERES ERRARE SER 84 6 7 2 SVRFUNC Server Function Name cccccccsssseceesseeeeeeseeeessneeeessseeeeesseeeesees 85 6 7 3 CENTSTUB Client Stub 5 eicit pr e RHET RR E PRINS 86 6 7 4 UNACK Asynchronous Call eese 87 6 7 5 CLNTCOPYCBK RPC Call by rpc call copycbk esses 88 Section 7 Server Functions Not Supported by RPCGEN eee 89 7 1 Parameter eet a a tesi eles et eee 89 7 2 Return Valle ir rer C e tuer N Maced dette eats 91 Section 8 Application nterface iiie rte itt reri pe teme Eae sU neben pA usua dS 93 8 1 Client Stub Functions Generated by RPCGEN seen 93 8 2 Server Stub Functions Generated by RPCGEN eene 95 8 3 Server Initialization Function teet treaties iere aana EXE r eiiiai 96 8 4 Server St b Function Table c00 cseescecseeseeesscescessacseeseaccsaesesceeensscntaasecsceesssedenssanecageaee 97 8 5 Server Shutdown Function
59. ification of a server function int func int par The function takes par as an input and returns a value of type int Definition of the server function int ret func IN DFLT int par Rev 1 01 Mar 17 2008 Page 63 of 128 RENESAS REJ10J1822 0101 Section 6 Definitions of Server Functions 6 6 2 STR String Input Output Keywords Available in Combination with STR IN Description The string specified as the parameter is transferred from the client to the server STR is only specifiable when the parameter is of the character type When STR is used with REF the pointer to the string is transferred instead of the string itself For details refer to section 6 5 4 REF Passing by Reference Example Specification of a server function int func const char s The function takes string s as an input and returns a value of type int Definition of the server function int ret func IN STR const char s Rev 1 01 Mar 17 2008 Page 64 of 128 REJ10J1822 0101 34 NE SAS Section 6 Definitions of Server Functions 6 6 3 PTR Pointer Input Output Keywords Available in Combination with PTR All Description The data pointed to by a specified pointer are transferred between the client and the server PTR is only specifiable when the parameter is of the pointer type When IN has been selected and REF is used with PTR the pointer value is transferred instead of the data it indicates For details refer to section 6 5
60. include include include include include include include lt string h gt types h ypc public h lt stdlib h gt kernel h sample public h sample clnt h sample private h pragma section C SAMPLE double atof const char nptr UINT32 ulLastOutputIOVectorSize rpc call info info UINT32 ullInputParamCount OUL IOVEC input 1 Rev 1 01 Mar 17 2008 Page 114 of 128 REJ10J1822 0101 34 NE SAS Section 11 Samples UINT32 ulOutputParamCount OUL IOVEC __output 1 double ret UINT32 ulReturn __info ulMarshallingType OUL __info ulServerID RPCSVR_ID_SMPL info ulServerVersion RPCSVR VERS SMPL info ulServerProcedureID RPC SMPL ATOF info AckMode RPC_ACK __info pInputIOVectorTable input info ulInputIOVectorTableSize sizeof input sizeof IOVEC info pOutputlIOVectorTable output info ulOutputlIOVectorTableSize sizeof output sizeof IOVEC info pulLastOutputIOVectorSize amp ulLastOutputlIOVectorSize info pulReturnValue UINT32 amp ulReturn input ulInputParamCount pBaseAddress UINTS8 nptr _ input ulInputParamCount ulSize strlen const char nptr 1UL output ulOutputParamCount pBaseAddress amp ret _ output ulOutputParamCount ulSize sizeof double rpc_retval_adr rpc call amp info return ret int atoi const char nptr
61. ion of a server function int func int par The function takes par as an input and returns a value of type int Definition of the server function int ret func IN DFLT int par Description e Directive to extend the return value None e Specification of the return value int ret e Function name func e Parameter directive IN DFLT e Parameter specification int par e Option None Rev 1 01 Mar 17 2008 Page 49 of 128 RENESAS REJ10J1822 0101 Section 6 Definitions of Server Functions Example 2 Specification of a server function void func struct ST ptr The function takes ptr a pointer to a structure of type ST as an input and does not return a value Definition of the server function func IN PTR struct ST ptr UNACK Description e Directive to extend the return value None e Specification of the return value None e Function name func e Parameter directive IN PTR e Parameter specification struct ST ptr e Option UNACK Rev 1 01 Mar 17 2008 Page 50 of 128 REJ10J1822 0101 34 NE SAS Section 6 Definitions of Server Functions Example 3 Specification of a server function double func double inf The input is inf and a value of type double will be returned Definition of the server function RETEXT double dret func IN DFLT double inf Description e Directive to extend the return value RETEXT e Specification of the return value double dret e Function name
62. le 4 Specification of a server function int func struct ST ptr int p count Pointer ptr to an array of p count elements of the structure type ST will be passed Definition of the server function int ret func IN ARY struct ST ptr COUNT p count IN PTR int p count Rev 1 01 Mar 17 2008 Page 69 of 128 RENESAS REJ10J1822 0101 Section 6 Definitions of Server Functions Example 5 Specification of a server function int func struct INF inf struct ST ptr ptr points to an array to be given to the server function and inf indicates other input information It has a type int member count which indicates the number of elements in the array pointed to by ptr Definition of the server function int ret func IN PTR struct INF inf IN ARY struct ST ptr COUNT inf gt count Rev 1 01 Mar 17 2008 Page 70 of 128 REJ10J1822 0101 34 NE SAS Section 6 Definitions of Server Functions 2 When the input output keyword selected for ARY is OUT In this case a parameter specification that includes ARY must be followed by two definitions of COUNT to indicate the number of elements in the array parameter including ARY gt lt definition of first COUNT gt lt definition of second COUNT gt The first COUNT is the COUNT keyword followed by an expression that specifies the number of elements in the array for storage of output by the client The second COUNT is the COUNT keyword followed by an expression t
63. lect RPCGEN config file for Select input file group Click on Next to go to step 3 Phase name RPOGEN Command excluding parameters SPERL_INST perlexe gt Browse Default options AINSD RPOGEN INS Drpceen pl CF ULLFILE gt Initial directory KFILEDI gt Browse Figure 4 7 New Build Phase Step 3 of 4 Dialog Box Phase name Any name defined by the user rpcgen in this example Command PERL INST Wperl exe Default options I RPCGEN INST RPCGEN_INST rpegen pl FULLFILE Initial directory FILEDIR Click on Next to go to step 4 Rev 1 01 Mar 17 2008 Page 17 of 128 RENESAS REJ10J1822 0101 Section 4 Executing RPCGEN New Build Phas tep 4 of 4 Does the command require any environment variables to be set If so enter them into the list below Add Moadity Remove Read Output On Fly Figure 4 8 New Build Phase Step 4 of 4 Dialog Box Although no environment variables need to be added for RPCGEN you can add environment variables for the Perl environment as required Creation of the RPCGEN custom build phase is now complete Next the syntax for messages about RPCGEN must be defined After the syntax has been defined the corresponding config file x will be opened in response to double clicking on an RPCGEN error message output in the Build window of the High performance Embedded Workshop In the Build P
64. ltage range heat radiation characteristics installation and other product characteristics Renesas shall have no liability for malfunctions or damages arising out of the use of Renesas products beyond such specified ranges 10 Although Renesas endeavors to improve the quality and reliability of its products IC products have specific characteristics such as the occurrence of failure at a certain rate and malfunctions under certain use conditions Please be sure to implement safety measures to guard against the possibility of physical injury and injury or damage caused by fire in the event of the failure of a Renesas product such as safety design for hardware and software including but not limited to redundancy fire control and malfunction prevention appropriate treatment for aging degradation or any other applicable measures Among others since the evaluation of microcomputer software alone is very difficult please evaluate the safety of the final products or System manufactured by you 11 In case Renesas products listed in this document are detached from the products to which the Renesas products are attached or affixed the risk of accident such as swallowing by infants and small children is very high You should implement safety measures so that Renesas products may not be easily detached from your products Renesas shall have no liability for damages arising out of such detachment 12 This document may not be reproduced or duplicated in any f
65. mation included in this document such as product data diagrams charts programs algorithms and application circuit examples is current as of the date this document is issued Such information however is subject to change without any prior notice Before purchasing or using any Renesas products listed in this document please confirm the latest product information with a Renesas sales office Also please pay regular and careful attention to additional and different information to be disclosed by Renesas such as that disclosed through our website http www renesas com 5 Renesas has used reasonable care in compiling the information included in this document but Renesas assumes no liability whatsoever for any damages incurred as a result of errors or omissions in the information included in this document 6 When using or otherwise relying on the information in this document you should evaluate the information in light of the total system before deciding about the applicability of such information to the intended application Renesas makes no representations warranties or guaranties regarding the suitability of its products for any particular application and specifically disclaims any liability arising out of the application and use of the information in this document or Renesas products 7 With the exception of products specified by Renesas as suitable for automobile applications Renesas products are not designed manufactured or tested for a
66. may be generated as part of the build and therefore any changes made by hand will possibly be lost on a rebuild KR RR KR RR eek RR RR RR RR RR RR KK RR Sk k k ke ec RK RK KR RRR RR RR RK KR RR RR ke ke ke ke ke k x ifndef RPC SMPL PUBLIC H define RPC SMPL PUBLIC H define RPCSVR ID SMPL 1 define RPCSVR VERS SMPL 2 endif End of _RPC SMPL PUBLIC H Rev 1 01 Mar 17 2008 Page 127 of 128 RENESAS REJ10J1822 0101 Section 11 Samples Rev 1 01 Mar 17 2008 Page 128 of 128 REJ10J1822 0101 32 NE SAS Renesas Microcomputer Development Environment System User s Manual Stub Generator V 1 00 Publication Date Rev 1 01 March 17 2008 Published by Sales Strategic Planning Div Renesas Technology Corp Edited by Customer Support Department Global Strategic Communication Div Renesas Solutions Corp 2008 Renesas Technology Corp All rights reserved Printed in Japan Renesas Technology Corp Sales Strategic Planning Div Nippon Bldg 2 6 2 Ohte machi Chiyoda ku Tokyo 100 0004 Japan 2CENESAS RENESAS SALES OFFICES http www renesas com Refer to http www renesas com en network for the latest and detailed information Renesas Technology America Inc 450 Holger Way San Jose CA 95134 1368 U S A Tel 1 408 382 7500 Fax 1 408 382 7501 Renesas Technology Europe Limited Dukes Meadow Millboard Road Bourne End Buckinghamshire SL8 5FH U K Tel 44 16
67. nfo pOutputIOVectorTable ulOutputParamCount ulSize OUL pInfo ulOutputIOVectorTableSize 1UL return UINT32 ret Figure 6 7 Code Output to the Server Stub INOUT for Second COUNT Rev 1 01 Mar 17 2008 Page 79 of 128 RENESAS REJ10J1822 0101 Section 6 Definitions of Server Functions Examples Example 1 Specification of a server function int func struct ST ptr ptr points to an array for input and output that has 10 elements func outputs all 10 elements Definition of the server function int ret func INOUT ARY struct ST ptr COUNT 10 COUNT 10 Example 2 Specification of a server function int func struct ST ptr int p count ptr points to an array for input and output that has 10 elements p_count which is the return parameter of func indicates the number of elements to be output Definition of the server function int ret func INOUT ARY struct ST ptr COUNT 10 COUNT p count OUT PTR int p count Example 3 Specification of a server function int func struct ST ptr ptr points to an array for input and output that has 10 elements The return value from func indicates the number of elements to be output Definition of the server function int ret func INOUT ARY struct ST ptr COUNT 10 COUNT ret Rev 1 01 Mar 17 2008 Page 80 of 128 REJ10J1822 0101 32 NE SAS Section 6 Definitions of Server Functions Example 4 Specification of a serv
68. ns int func struct INF inf struct ST ptr IOVEC input 2 IOVEC __ output 1 input ulInputParamCount pBaseAddress UINTS8 inf input ulInputParamCount 4 ulSize sizeof inf if UINT32 inf gt count gt OUL input ulInputParamCount pBaseAddress UINT8 ptr input ulInputParamCount ulSize sizeof ptr UINT32 inf count if UINT32 inf gt count gt OUL output ulOutputParamCount pBaseAddress UINT8 ptr output ulOutputParamCount ulSize sizeof ptr UINT32 inf count rpe cali Figure 6 6 Code Output to the Client Stub INOUT for First COUNT Rev 1 01 Mar 17 2008 Page 78 of 128 REJ10J1822 0101 34 NE SAS Section 6 Definitions of Server Functions UINT32 rpcsvr SMPL func rpc server stub info pInfo inf struct INF pInfo pucParamArea X ulInputParamOffset __ulInputParamOffset ALIGNUP4 sizeof inf if UINT32 inf gt count gt OUL ptr struct ST pInfo pucParamArea _ ulInputParamOffset __ulInputParamOffset ALIGNUP4 sizeof ptr UINT32 inf count ret func inf ptr pInfo pOutputlIOVectorTable ulOutputParamCount l pBaseAddress ptr if UINT32 ret gt OUL pInfo pOutputIOVectorTable ulOutputParamCount ulSize sizeof ptr UINT32 ret else pI
69. ns in these specifications If CLNTSTUB is used to prevent creation of client stub functions the user must implement client stub functions in accord with the specifications For details on SVR_AUTH refer to section 5 5 8 SVR_AUTH 1 When SVR AUTH has not been specified Each of the client stub functions has the same API as the actual server function RPCGEN outputs the client stub functions themselves to config file clnt c but does not output prototype declarations Prepare a header file with the required prototype declarations and specify this header file in the definition of CLNT INCFILE or GLOBAL INCFILE Example Contents of a config file SVR NAME EXAMPLE SVR ID 1 SVR VERSION 2 SVR AUTH RPC_FUNC int ret funcl IN DFLT int parl IN DFLT int par2 func2 OUT PTR struct ST ptr bi Specification of a client stub function int funcl int parl int par2 void func2 struct ST ptr Rev 1 01 Mar 17 2008 Page 93 of 128 RENESAS REJ10J1822 0101 Section 8 Application Interface 2 When SVR_AUTH has been specified Each of the client stub functions has a different API from the corresponding actual server function and the server ID and server version information are added as parameters RPCGEN outputs the client stub functions themselves to config file clnt c and the prototype declarations to config file clnt h The name of each client stub function takes the form rpcclnt server name
70. nts to an array for output and inf indicates other input information It has a type int member count which indicates the number of elements in the array pointed to by ptr func outputs the return parameter p count as the number of elements Definition of the server function int ret func IN PTR struct INF inf OUT ARY struct ST ptr COUNT inf gt count COUNT p count OUT PTR int p count Example 7 Specification of a server function int func struct INF inf struct ST ptr ptr points to an array for output and inf indicates other input information It has a type int member count which indicates the number of elements in the array pointed to by ptr func outputs all inf gt count elements Definition of the server function int ret func IN PTR struct INF inf OUT ARY struct ST ptr COUNT inf gt count COUNT inf gt count Rev 1 01 Mar 17 2008 Page 76 of 128 REJ10J1822 0101 34 NE SAS Section 6 Definitions of Server Functions Example 8 Specification of a server function int func struct INF inf struct ST ptr ptr points to an array for output and inf indicates other input information including a type int member count which indicates the number of elements in the array pointed to by ptr The return value indicates the number of elements to be output Definition of the server function int ret func IN PTR struct INF inf OUT ARY struct ST ptr COUNT inf gt count COUNT ret
71. of 128 REJ10J1822 0101 34 NE SAS Section 6 Definitions of Server Functions UINT32 rpcsvr SMPL func rpc server stub info pInfo inf struct INF pInfo pucParamArea X ulInputParamOffset __ulInputParamOffset ALIGNUP4 sizeof inf if UINT32 inf gt count gt OUL ptr struct ST pInfo pucParamArea _ ulInputParamOffset ret func inf ptr pInfo pOutputlIOVectorTable ulOutputParamCount l pBaseAddress ptr if UINT32 ret gt OUL pInfo pOutputlIOVectorTable X ulOutputParamCount ulSize sizeof ptr UINT32 ret else pInfo pOutputlIOVectorTable X ulOutputParamCount ulSize OUL pInfo ulOutputIOVectorTableSize 1UL return UINT32 ret Figure 6 5 Code Output to the Server Stub OUT for Second COUNT Rev 1 01 Mar 17 2008 Page 73 of 128 RENESAS REJ10J1822 0101 Section 6 Definitions of Server Functions Examples Example 1 Specification of a server function int func struct ST ptr ptr points to an array for output that has 10 elements func outputs all 10 elements Definition of the server function int ret func OUT ARY struct ST ptr COUNT 10 COUNT 10 Example 2 Specification of a server function int func struct ST ptr int p count ptr points to an array for output that has 10 elements p count which is the return parameter of func indicates the number of elements
72. of 128 RENESAS REJ10J1822 0101 Section 5 Specifications of a Config File 5 5 9 SVR_SECTION Format SVR_SECTION lt section name gt Description This statement specifies the section to which the server stubs will be assigned When this definition is omitted one of the section names alphabetical characters listed below will automatically be assigned If SVR_SECTION has been defined the actual section name will be one of the letters listed below followed by lt section name gt e Program section P e Constant section C e Non initialized data section B e Initialized data section D Example SVR_SECTION C_EXAMPLE Rev 1 01 Mar 17 2008 Page 42 of 128 REJ10J1822 0101 34 NE SAS Section 5 Specifications of a Config File 5 6 Client Information The following definitions of client information are available e CLNT_NOINIT The client initialization function is not to be created e CLNT NOSHUTDOWN The client shutdown function is not to be created e CLNT CALLCHK Facilitates saving the return value in RPC calls e CLNT SECTION Section name to be given to the client stub 5 6 1 CLNT NOINIT Format CLNT NOINIT Description RPCGEN creates the following client initialization function in config file clnt c as the standard INT32 rpcclnt server name init UINT32 ulRPCServerID UINT32 ulRPCServerVersion If the CLNT NOINIT statement is present RPCGEN will not create the client ini
73. orm in whole or in part without prior written approval from Renesas 13 Please contact a Renesas sales office if you have any questions regarding the information contained in this document Renesas semiconductor products or if you have any other inquiries Preface This manual describes how to use the stub generator Read this manual and understand it well before using the stub generator Notes on Descriptions RPCGEN Abbreviation for the stub generator Prefix Prefix Ox indicates a hexadecimal number Numbers with no prefix are decimal i is the directory delimiter Menu gt Menu item gt leads to the menu item e g File gt Save xxxx Custom placeholder in the High performance Embedded Workshop RENESAS Trademarks All trademarks and registered trademarks belong to their respective owners 1 TRON is an acronym formed from The Real Time Operating system Nucleus ITRON is short for Industrial TRON and uITRON is short for Micro Industrial TRON TRON ITRON and uITRON are the names of computer specifications and do not indicate specific products or groups of products The uITRONA O specification is an open realtime kernel specification defined by the TRON Association The uITRON4 0 specification can be downloaded from the TRON Association homepage http www assoc tron org The copyright of the uITRON specification belongs to the TRON Association 2 Microsoft and Windows are
74. outputs definitions of the server ID and server version in config file public h so that the application is able to acquire this information Each of the client stub functions is in the form of rpccInt server name server function name gt and its first and second parameters are the server ID and server version respectively The third and subsequent parameters are the parameters of the actual server function In other words all of the client stub functions have APIs that differ from the server functions To make the client stub functions have the same APIs as the original server functions the user must implement wrapper functions for the client stub functions RPCGEN outputs definitions of the server ID and server version to config file public h Applications that call client stub functions and the server initialization function must thus include config file public h so that the server ID and version are specified If config file public h for the client and server are from different generations the RPC library treats any RPC call as an error Rev 1 01 Mar 17 2008 Page 40 of 128 REJ10J1822 0101 34 NE SAS Section 5 Specifications of a Config File config file public h mum Server ID NA em Client application Server application Client Client Server initialization shutdown initialization function function function Figure 5 2 Model 2 Example SVR AUTH Rev 1 01 Mar 17 2008 Page 41
75. pplications or otherwise in systems the failure or malfunction of which may cause a direct threat to human life or create a risk of human injury or which require especially high quality and reliability such as safety systems or equipment or systems for transportation and traffic healthcare combustion control aerospace and aeronautics nuclear power or undersea communication transmission If you are considering the use of our products for such purposes please contact a Renesas sales office beforehand Renesas shall have no liability for damages arising out of the uses set forth above 8 Notwithstanding the preceding paragraph you should not use Renesas products for the purposes listed below 1 artificial life support devices or systems 2 surgical implantations 3 healthcare intervention e g excision administration of medication etc 4 any other purposes that pose a direct threat to human life Renesas shall have no liability for damages arising out of the uses set forth in the above and purchasers who elect to use Renesas products in any of the foregoing applications shall indemnify and hold harmless Renesas Technology Corp its affiliated companies and their officers directors and employees against any and all damages arising out of such applications 9 You should use the products described herein within the range specified by Renesas especially with respect to the maximum rating operating supply voltage range movement power vo
76. quired The specification of the client initialization function generated by RPCGEN is as follows C language API INT32 rpcclnt server name init UINT32 ulRPCServerID UINT32 ulRPCServerVersion e Return value The return value of rpc_connect e Parameter uIRPCServerID and __ulRPCServerVersion These parameters indicate the server ID and server version respectively When SVR_AUTH has not been specified however the server ID and server version are ignored Instead the macros RPCSVR ID server name gt and RPCSVR VERS server name gt output to config file public h are taken as the server ID and version in initiating connection to the server e Specification Connection to the server is initiated by using rpc_connect Rev 1 01 Mar 17 2008 Page 100 of 128 REJ10J1822 0101 32 NE SAS Section 8 Application Interface 8 7 Client Shutdown Function The client shutdown function is called by the client application and terminates the connection to the server by using rpc_disconnect When CLNT_NOSHUTDOWN has not been specified RPCGEN generates a client shutdown function rpcclnt server name shutdown RPCGEN outputs the client shutdown function itself to config file clnt c and the prototype declaration to config file clnt h Server name gt refers to the server name defined with SVR NAME When CLNT NOSHUTDOWN has been specified RPCGEN does not generate a client shutdown function The client sh
77. r version will be assigned SVR NAME server name gt Description This statement defines the server name The defined server name will be applied to the names of stub functions etc generated by RPCGEN This definition cannot be omitted if it is omitted RPCGEN reports the error and terminates processing Example SVR_NAME EXAMPLE Rev 1 01 Mar 17 2008 Page 32 of 128 REJ10J1822 0101 34 NE SAS Section 5 Specifications of a Config File 5 5 2 SVR_ID Format SVR_ID lt ID number gt Description This statement defines the server ID The ID number can only be specified as a 4 byte integer constant that can be represented as UINT32 or a C language macro name to be replaced by such a 4 byte integer constant If a C language macro is used this macro must have been defined in a file specified by GLOBAL_INCFILE The server ID must of course be consistent across the entire system due to the specifications of the HI7200 MP RPCGEN does not detect duplication of server IDs The ID number is output to lt config file gt _public h in the following format define RPCSVR_ID lt server name gt lt ID number gt Server name gt refers to the server name defined with SVR NAME SVR ID cannot be omitted if a definition of SVR_AUTH has been omitted Also refer to section 5 5 8 SVR AUTH Example SVR_ID 1UL Rev 1 01 Mar 17 2008 Page 33 of 128 RENESAS REJ10J1822 0101 Section 5 Specifications of a
78. registered trademarks of Microsoft Corporation in the United States and or other countries The formal name of Windows is Microsoft Windows Operating System 3 Allother product names are trademarks or registered trademarks of the respective holders Renesas Technology Homepage Various support information are available on the following Renesas Technology homepage http www renesas com en tools 7tENESAS Contents Section Bibi c g i vse citer oa ley thoes 1 1 1 OVERVIEW mm 1 1 2 Operating FDVirOnMent 0 0625 S 2 Section 2 Install alque ta enel reloaded e in epa ec bed ase a aa aS 3 2 1 Downlo dimp iecit en pr eye i clea Geren EE 3 2 2 Wnstaling RPCGEN ndr P e rode rye Ee NE iets tibet eee 3 Section 3 Functions and Files Generated by RPCGEN eese 5 3 1 Functions Generated by RPCGEN sesseseeseeeseeeseeeenen asi irnia 5 3 1 1 Gil ni aa eaea a i AA e aiaa EEEE OaE 6 3 1 2 SEVE 6 3 2 Fil s Generated by RPCGEN eee i aE AE 7 section Executing RPCGEN a idees etie tees E E E Ec epe Edd 9 4 1 Executing RPCGEN eroe i eret eam etre id rbd vv verter iyd rueda 9 4 2 p 10 4 2 1 PUBIT e E 10 4 2 2 SE MM INE EEES 10 4 2 3 e Eu 10 4 2 4 SVRS uicti ded p dM ERES EET cyst nes Fepe E e
79. rn value that depends on the context task or non task in which rpc retval adr was called is returned Rev 1 01 Mar 17 2008 Page 10201128 UW lt lt XO REJ10J1822 0101 34 N SAS Section 8 Application Interface Example of implementation for the HI7200 MP define MAXTSKID 10 Maximum task ID static INT32 retval MAXTSKID 1 Array to hold the return value in the context 0 Non task context 1 to MAXTSKID Task ID INT32 rpc_retval_adr void INT32 retval adr ID myid if sns ctx TRUE In a non task context retval adr retval else In a task context get tid myid retval adr amp retval GET LOCALID myid return retval adr Rev 1 01 Mar 17 2008 Page 103 of 128 RENESAS REJ10J1822 0101 Section 8 Application Interface 8 9 lt Config file gt _public h The following macro definitions are output to lt config file gt _public h define RPCSVR ID server name server ID define RPCSVR VERS server name server version Server name server ID and server version refer to the server name server ID and server version defined with SVR NAME SVR ID and SVR VERSION respectively The position of config file public h depends on whether SVR_AUTH has been specified or not For details refer to section 5 5 8 SVR AUTH 8 10 Local Variables Used in the Source Code Created by RPCGEN In the source code o
80. rvice calls listed in table 11 1 This is simply because we have assumed that most users will understand these functions not because the functions should necessarily be distributed by the RPC facility Table 11 1 Files Provided for Illustration Server Function Description double atof const char nptr C standard library function stdlib h int atoi const char nptr C standard library function stdlib h with REF ER ref tsk2 ID tskid T RTSK pk rtsk Service call ref tsk ER ref sem2 ID semid T RSEM pk rsem Service call ref sem Rev 1 01 Mar 17 2008 Page 109 of 128 RENESAS REJ10J1822 0101 Section 11 Samples 11 1 Config File sample x BOR KK KR KR KK KK RR Sk ke ke e e ke KR RR KR KR RK RR RR RRR e ke ke ke ke KK KK File Header Comment Sample Config File for RPCGEN KR RR KK RR RR RR RK RRR KK RR RR RK RR RR KR KR RR RR RR RR RK KR RR ke ke ke ke KK PUB_INCPATH include SVR SOURCEPATH server SVR INCPATH server CLNT SOURCEPATH client CLNT INCPATH client XXX private h Output path for xxx public h Output path xxx_svr c Output path xxx svr h Output path xxx clnt c Output path xxx clnt h and GLOBAL INCFILE lt stdlib h gt kernel h Include files for xxx svr c and xxx clnt c SVR INCFILE CLNT INCFILE SVR NAME SMPL SVR_ID 1 SVR_VERSION 2 SVR_AUTH SVR_NOINIT SVR_NOSTUBTBL SVR NOSHUTDOW
81. s processing Multiple keywords must be delimited by commas Rev 1 01 Mar 17 2008 Page 83 of 128 RENESAS REJ10J1822 0101 Section 6 Definitions of Server Functions Table 6 2 shows the available combinations of optional keywords Table 6 2 Combinations of Optional Keywords SVRSTUB SVRFUNC CLNTSTUB UNACK CLNTCOPYCBK SVRSTUB Y Y Y SVRFUNC Y Y Y CLNTSTUB UNACK Y CLNTCOPYCBK v Available Not available RPCGEN reports an error and terminates processing 6 7 1 SVRSTUB Server Stub Format SVRSTUB server stub function name Description A server stub provided by the user is to be used so RPCGEN does not create a server stub Example Specification of a server function int func int par The function takes par as an input and returns a value of type int RPCGEN will not create a server stub for func i e will not create func svrstub because the user will provide this server stub Definition of the server function int ret func IN DFLT int par SVRSTUB func svrstub Rev 1 01 Mar 17 2008 Page 84 of 128 REJ10J1822 0101 7tENESAS Section 6 Definitions of Server Functions 6 7 2 SVRFUNC Server Function Name Format SVRFUNC lt replacement server function name gt Description RPCGEN replaces the name of the server function to be called by the server stub with a specific name Use SVRFUNC when the name of a function as called by the client does not match the
82. svr config config rpc server info server info if config NULL return 1L Server info ulRPCServerID RPCSVR ID SMPL Rev 1 01 Mar 17 2008 Page 125 of 128 7tENESAS REJ10J1822 0101 Section 11 Samples Server info ulRPCServerVersion RPCSVR VERS SMPL Server info ServerStubTaskPriority _ config gt ServerStubTaskPriority __server_info ServerStubList rpcsvr SMPL StubTable Server info ulNumFunctions AUL Server info ulStubStackSize config gt ulStubStackSize __server_info pUserDefinedData config gt pUserDefinedData __server_info ulMaxParamAreaSize config gt ulMaxParamAreaSize return rpc start server amp server info INT32 rpcsvr SMPL shutdown UINT32 ulServerID UINT32 ulServerVersion return rpc stop server RPCSVR ID SMPL RPCSVR VERS SMPL NULL OUL Rev 1 01 Mar 17 2008 Page 126 of 128 REJ10J1822 0101 32 NE SAS Section 11 Samples 11 7 sample public h BOR KK KR KR ke ke e hec KR RK KR RR KK RR RK KK RK RR RR RRR e ke ke ke ke KK KK File Header Comment Sample Config File for RPCGEN KR RR KR RR RR RR KK RRR RK RR KR RRR RK RR KK RRR RK RR RR KR RR RK ke ke KKK BR KK KR KR RK RR KR RK KK KR RK KR KR RK RR RRR RR RRR e ke ke RR KK KK Do not edit unless you really know what you are doing this file was automatically generated by rpcgen pl on 2007 11 28 12 54 Be aware that this file
83. t create the server stub function table Use SVR_NOSTUBTBL when the server initialization function is provided as part of the application Also refer to section 8 4 Server Stub Function Table Example SVR NOSTUBTBL Rev 1 01 Mar 17 2008 Page 35 of 128 RENESAS REJ10J1822 0101 Section 5 Specifications of a Config File 5 5 6 SVR_NOSHUTDOWN Format SVR NOSHUTDOWN Description If this statement is present RPCGEN will not create the server shutdown function Use SVR NOSHUTDOWN when the server shutdown function is provided as part of the application The server shutdown function generated by RPCGEN calls rpc stop server to stop the server Although rpc stop server generally allows specification of a callback function to be executed at the time the server is stopped no callback function is specifiable for the server shutdown function generated by RPCGEN If you wish to use a callback function specify SVR NOSHUTDOWN and implement the server shutdown function on the user side Also refer to section 8 5 Server Shutdown Function Example SVR NOSHUTDOWN Rev 1 01 Mar 17 2008 Page 36 of 128 REJ10J1822 0101 34 NE SAS Section 5 Specifications of a Config File 5 5 7 SVR_STATIC Format SVR_STATIC lt size gt A lt section name gt Description This statement defines the server as static If this definition is omitted the server will be dynamic Note that SVR_STATIC cannot be used in conjunction with SVR_NOINIT
84. tension Dialog Box Rev 1 01 Mar 17 2008 Page 14 of 128 REJ10J1822 0101 34 NE SAS Section 4 Executing RPCGEN 3 Creating the RPCGEN Custom Build Phase Select Build gt Build Phases from the menu bar of the High performance Embedded Workshop This opens the Build Phases dialog box shown in figure 4 4 Build PF Build Order Build File Order File Mappines Build phase order SH G G Library Generator icfe 2mp SH G O Compiler SH Assembler Remove OptLinker Ia d iy 3 Moye Wp Maye Down gt Import OK Cancel Figure 4 4 Build Phases Dialog Box Clicking on the Add button invokes the New Build Phase wizard figure 4 5 Rev 1 01 Mar 17 2008 Page 15 of 128 RENESAS REJ10J1822 0101 Section 4 Executing RPCGEN What type of phase would you like to add Figure 4 5 New Build Phase Step 1 of 4 Dialog Box Click on Next to go to step 2 What type of phase would you like to create Multiple phase The command is applied to each file in a file group An example of this type of tool is a compiler or assembler Select input file group absolute file c Relocatable file ERPCGEN contie tile lt Back Next gt Cancel Figure 4 6 New Build Phase Step 2 of 4 Dialog Box Rev 1 01 Mar 17 2008 Page 16 of 128 REJ10J1822 0101 7tENESAS Section 4 Executing RPCGEN At step 2 select Multiple phase Then se
85. tes processing only when it has detected a fatal error i e when continuing with the current processing is impossible In other words RPCGEN behaves as if it has successfully completed code generation in many cases where it has not in fact done so Cases in which no errors will be detected Note gt in the list below indicates a behavior in the current implementation The behavior may be changed in a future implementation e A specific keyword is used multiple times gt The first instance of the keyword to be found is valid e Aserver function with a specific name is declared multiple times An error will be reported on compilation of the generated stub e Aninvalid keyword is specified gt This is simply ignored e SVR ID server ID is a value with size exceeding 4 bytes An error will be reported on compilation of the file to include rpc_public h e A parameter for which PTR has been specified is not of the pointer type gt RPC calls will lead to abnormal operation such as CPU exceptions 10 1 Format Error messages are output in the format shown below The following sections list the error messages and their meanings Config file E Error message Rev 1 01 Mar 17 2008 Page 107 of 128 RENESAS REJ10J1822 0101 Section 10 Error Messages 10 2 General Cannot open configuration file RPCGEN cannot access the specified config file No lt keyword gt definition lt keyword gt must
86. th the data type keywords PTR STR and ARY Figure 6 1 illustrates the difference between cases with and without REF IN PTR struct ST ptr Server parameter area Parameter specified in the client nanortcacheable area Parameter to be passed to the server function Server parameter area in a non cacheable area Note When the device in use does not provide a facility for cache snooping between the CPU cores as is the case for the SH2A DUAL etc the server parameter area must be allocated in a non cacheable area Figure 6 1 REF Rev 1 01 Mar 17 2008 Page 60 of 128 REJ10J1822 0101 7tENESAS Section 6 Definitions of Server Functions Without the REF specification the data indicated by the pointer variable specified with PTR STR or ARY are transferred The transferred pointer points to a different area from that before the transfer With the REF specification the pointer variable is transferred In this case the pointer points to the same area even after the transfer Note When the device in use does not provide a facility for cache snooping between the CPU cores as is the case for the SH2A DUAL etc the server parameter area must be allocated in a non cacheable area Example Specification of a server function int func struct ST ptr ptr is passed to func as the input ptr is sure to keep pointing to a non cacheable area Definition of the server function int ret func IN REF PTR struct S
87. tialization function Use CLNT NOINIT when the client initialization function is provided as part of the application Also refer to section 8 6 Client Initialization Function Example CLNT NOINIT Rev 1 01 Mar 17 2008 Page 43 of 128 RENESAS REJ10J1822 0101 Section 5 Specifications of a Config File 5 6 2 CLNT NOSHUTDOWN Format CLNT NOSHUTDOWN Description RPCGEN creates the following client shutdown function in config file clnt c as the standard INT32 rpcclnt server name shutdown UINT32 ulRPCServerID UINT32 ulRPCServerVersion If the CLNT NOSHUTDOWN statement is present RPCGEN will not create the client shutdown function Use CLNT NOSHUTDOWN when the client shutdown function is provided as part of the application The client shutdown function generated by RPCGEN calls rpc disconnect to disconnect the client from the server Although rpc disconnect generally allows specification of a callback function to be executed at the time the client is disconnected from the server no callback function is specifiable for the client shutdown function generated by RPCGEN If you wish to use a callback function specify CLNT NOSHUTDOWN and implement the client shutdown function on the user side In the current HI7200 MP specification a callback function is ignored even if one has been specified for rpc_disconnect Also refer to section 8 7 Client Shutdown Function Example CLNT NOSHUTDOWN Rev 1 01 Mar 1
88. tion 1 Overview 1 1 Overview The stub generator hereafter referred to as RPCGEN is a tool used to generate the source code of the client and server stubs that are required whenever the remote procedure call RPC facility of the HI7200 MP realtime operating system is to be used A config file is created by using a text editor and then input to RPCGEN which creates the source code of the client and server stubs Config file Source code of the client and server stubs Figure 1 1 Overview of RPCGEN Rev 1 01 Mar 17 2008 Page 1 of 128 RENESAS REJ10J1822 0101 Section 1 Overview 1 2 Operating Environment RPCGEN is provided as a Perl script file Table 1 1 shows the operating environment Table 1 1 Operating Environment Item Operating Environment Realtime OS HI7200 MP V 1 00 Release 00 or later Perl environment We have confirmed correct execution of RPCGEN by ActivePerl 5 8 8 820 for Windows x86 produced by ActiveState Software Inc ActivePerl is available for free download from the following Web site http www activestate com Products activeperl Host machine Any machine with Windows XP 32 bits or Windows 2000 as the operating system Rev 1 01 Mar 17 2008 Page 2 of 128 REJ10J1822 0101 7tENESAS Section 2 Installation Section 2 Installation 2 1 Downloading RPCGEN can be downloaded for free from the Renesas Web site at the following URL http www renesas com 2 2 Installing RPCGEN
89. to be output Definition of the server function int ret func OUT ARY struct ST ptr COUNT 10 COUNT p count OUT PTR int p count Example 3 Specification of a server function int func struct ST ptr ptr points to an array for output that has 10 elements The return value from func indicates the number of elements to be output Definition of the server function int ret func OUT ARY struct ST ptr COUNT 10 COUNT ret Rev 1 01 Mar 17 2008 Page 74 of 128 REJ10J1822 0101 32 NE SAS Section 6 Definitions of Server Functions Example 4 Specification of a server function int func struct ST ptr int p count ptr points to an array for output that has p count elements func outputs the return parameter p count as the number of elements Definition of the server function int ret func OUT ARY struct ST ptr COUNT p count COUNT p count INOUT PTR int p count Example 5 Specification of a server function int func struct ST ptr int count ptr points to an array for output that has count elements func outputs all count elements Definition of the server function int ret func OUT ARY struct ST ptr COUNT count COUNT count IN DFLT int count Rev 1 01 Mar 17 2008 Page 75 of 128 RENESAS REJ10J1822 0101 Section 6 Definitions of Server Functions Example 6 Specification of a server function int func struct INF inf struct ST ptr int p count ptr poi
90. to be specified they must be separated by a space Example CLNT_INCFILE lt math h gt import include user_clnt h Rev 1 01 Mar 17 2008 Page 30 of 128 REJ10J1822 0101 34 NE SAS Section 5 Specifications of a Config File 5 4 4 SVR_INCFILE Format SVR_INCFILE lt file gt A lt file gt Description This statement is for the output of include directives for the specified files to lt config file gt _svr c File s must be specified in the form filename or lt filename gt The difference between these two formats is as defined in the specification of the include directive When two or more files are to be specified they must be separated by a space Example SVR_INCFILE lt math h gt import include user_svr h Rev 1 01 Mar 17 2008 Page 31 of 128 RENESAS REJ10J1822 0101 Section 5 Specifications of a Config File 5 5 Server Information The following types of definitions are available for defining server information e SVR_NAMEl e SVR_ID e SVR_VERSION e SVR_NOINIT e SVR_NOSHUTDOWN e SVR NOSTUBTBL e SVR STATIC e SVR_SECTION e SVR AUTH 5 5 1 SVR NAME Format Server name Server ID Server version The server initialization function is not to be created The server shutdown function is not to be created The server stub function table is not to be created Use of a static server Section name to be given to the server stub How the server ID and serve
91. torTableSize sizeof input sizeof IOVEC info pOutputlIOVectorTable output info ulOutputIOVectorTableSize sizeof output sizeof IOVEC info pulLastOutputIOVectorSize amp ulLastOutputIOVectorSize ER info pulReturnValue UINT32 amp ercd input ulInputParamCount pBaseAddress amp tskid input ulInputParamCount 4 ulSize sizeof ID Ooutput ulOutputParamCount pBaseAddress UINT8 pk_rtsk output ulOutputParamCount ulSize sizeof pk rtsk rpc retval adr rpc call amp info return ercd ref sem2 ID semid T RSEM pk rsem UINT32 ulLastOutputIOVectorSize rpc call info info UINT32 ullInputParamCount OUL IOVEC input 1 UINT32 ulOutputParamCount OUL IOVEC __ output 1 ER ercd Rev 1 01 Mar 17 2008 Page 117 of 128 RENESAS REJ10J1822 0101 Section 11 Samples info ulMarshallingType OUL __info ulServerID RPCSVR_ID_SMPL info ulServerVersion RPCSVR VERS SMPL info ulServerProcedureID RPC SMPL REF SEM2 info AckMode RPC_ACK __info pInputIOVectorTable input info ulInputIOVectorTableSize sizeof input sizeof IOVEC info pOutputlIOVectorTable output info ulOutputIOVectorTableSize sizeof output sizeof IOVEC info pulLastOutputIOVectorSize amp ulLastOutputIOVectorSize info pulReturnValue UINT32 amp ercd input ulInputParamCount pBaseAddress
92. utdown function must be provided by the user if one is required The specification of the client shutdown function generated by RPCGEN is as follows e C language API INT32 rpcclnt server name shutdown UINT32 _ _ulRPCServerID UINT32 ulRPCServerVersion e Return value The return value of rpc_disconnect e Parameter ulRPCServerID and __ulRPCServerVersion These parameters indicate the server ID and server version respectively When SVR_AUTH has not been specified however the server ID and server version are ignored Instead the macros RPCSVR ID server name gt and RPCSVR VERS server name output to config file public h are taken as the server ID and server version in terminating a connection to the server e Specification Connection to the server is terminated by using rpc disconnect and no callback function is specifiable for the client shutdown function In the current HI7200 MP specification rpc disconnect handles no processing other than terminating the connection to the server Rev 1 01 Mar 17 2008 Page 101 of 128 RENESAS REJ10J1822 0101 Section 8 Application Interface 8 8 rpc retval adr rpc retval adr is a client function to be provided by the user when CLNT CALLCHK refer to section 5 6 3 CLNT_CALLCHK is specified rpc retval adr must be created according to the specification given below e C language API INT32 rpc retval adr void e Specification The address to hold the retu
93. value of rpc stop server e Parameter ulServerID and __ulServerVersion These parameters indicate the server ID and server version respectively When SVR_AUTH has not been specified however the server ID and server version are ignored Instead the macros RPCSVR ID server name and RPCSVR VERS server name gt output to config file public h are taken as the server ID and server version in stopping the server e Specification The server is stopped by calling rpc stop server and no callback function is specifiable for the server shutdown function If you wish to use a callback function specify SVR NOSHUTDOWN and implement the server shutdown function on the user side Rev 1 01 Mar 17 2008 Page 99 of 128 RENESAS REJ10J1822 0101 Section 8 Application Interface 8 6 Client Initialization Function The client initialization function is called by the client application and initiates connection to the server by using rpc_connect When CLNT_NOINIT has not been specified RPCGEN generates a client initialization function rpeclnt_ lt server name init RPCGEN outputs the client initialization function itself to config file clInt c and the prototype declaration to config file clnt h Server name gt refers to the server name defined with SVR NAME When CLNT NOINIT has been specified RPCGEN does not generate a client initialization function The client initialization function must be provided by the user if one is re

Download Pdf Manuals

image

Related Search

Related Contents

BLUETOOTH® HEADSET  RBV 130  立位撮影台SA−63D - 放射線防護グローブ X線 立位撮影台 平面撮影  Graco Lubrification Buyers` Guide  Kabelloser Hi-Speed DSL/Kabel-Router  V501 1-741 -00 - Schneider Electric  Installationsarbeiten - Bosy  Tutorial en pdf  Qualitätssicherung für objektorientierte Software  Génie des Systèmes Interactifs Plan du cours  

Copyright © All rights reserved.
Failed to retrieve file