![]() |
![]() |
![]() |
![]() |
![]() |
Annex 3: Integration for Win32
This annex briefly describes integration with Win32. The presentation is focused on the differences from the general model described earlier in this chapter.
Principles
This integration has been developed using the Microsoft 32-bit C/C++ Compiler Version 11.00.7022 on Windows NT.
The main differences between integration with Win32 and the general model are:
- Threads are created with the Win32 primitive CreateThread(). The thread is then automatically given an input queue the first time it calls a USER or GDI function
- xAlloc is implemented with Win32 function HeapAlloc().
- xFree is implemented with Win32 function HeapFree().
- The timer implementation uses the Win32 GetTickCount() function.
Running the Test Example: Simple
The source file and examples for RTOS Integrations are not included in the standard delivery. They are available as free downloads from the IBM Rational Support web site.
Prerequisites
This test example is developed as a Win32 console application on a PC. The makefiles and compilation switches are set up for the application to compile using the Microsoft compiler listed above.
Light Integration
Limitations for the Light Integration
Building a Light Integration
Please see the Building and Running a Light Integration for instructions.
Tight Integration
Limitations for the Tight Integration
Please read the Release Guide for details about limitations that apply to all systems using Tight Integration.
Building a Tight Integration
Please see the Building and Running a Tight Integration for instructions.
The command line length limitation for the Borland compiler can sometimes be exceeded. If this happens, you should define the DEFINE MACROS at the beginning of the sctwin32.h file.
Compiler Flags
The following defines (#ifdef) are used in this integration:
- WIN32_INTEGRATION: Ensures that the sctwin32.h file is included in each C file. Must be set in all cases.
- XOS_TRACE: Gives a textual trace for most of the SDL events by using printf to some device. This flag should not be used together with XMSC_TRACE.
- XMSC_TRACE: Will give a textual trace in the format of MSC/PR Z.120 by using printf. This trace is possible to view in the MSC Editor. This flag should not be used together with XOS_TRACE.
- XMSC_EDITOR: Used together with the XMSC_TRACE flag, the MSC trace is automatically displayed in the MSC Editor. Note that you must have the Organizer open on your machine.
- X_ONE_TASK_PER_INSTANCE_SET: States that the Instance Set Model is used. The Standard Model is otherwise chosen by default.
- XERR: When this flag is defined, the return status of all Win32 function calls will be printed.
- XINCLUDE_HS_FILE: Includes the system signal header file which is required for tight integrations. This file maps signal names to integers.
- XRTOSTIME: Should always be set for all tight integrations.
- XUSING_SCCD: This should be set when using the preprocessor SCCD to ensure that the windows header files are not included on the preprocessor pass. The files are included though on the compiler pass and this ensures that the preprocessed C files only contain the expanded the SDL Suite macros. It also helps greatly to speed up the process. Note that this flag only works with the Microsoft compiler and should not be used with any other compiler.
- XWINCE: This flag allows you to compile the integration for Microsoft WinCE target systems. This flag should not be used together with the MSC trace flags.
http://www.ibm.com/rational |
![]() |
![]() |
![]() |
![]() |