/* 
 * This is an automatically-generated file.
 * Source file  : test/input/simple.idl4
 * Output file  : -
 * Platform     : V4 Generic
 * Mapping      : CORBA C
 *
 * Generated by Magpie VERSION_REMOVED
*/

#define IDL4_OMIT_FRAME_POINTER 0 /* Unimplemented */
#define IDL4_USE_FASTCALL 0 /* Unimplemented */
#define IDL4_NEED_MALLOC 0 /* Unimplemented */
#define IDL4_API v4
#define IDL4_ARCH generic


#define MAGPIE_BYTES_PER_WORD (sizeof(L4_Word_t))

#ifdef __cplusplus
extern "C" {
#endif
#include "idl4/idl4.h"
#ifdef __cplusplus
}
#endif





#if !defined(__-__)
#define __-__




/* Interface iguana_pd */
#if !defined(_objdef___iguana_pd)
#define _objdef___iguana_pd
typedef CORBA_Object iguana_pd;
#endif // !defined(_objdef___iguana_pd)




#if !defined(_funcdef___iguana_pd_create_memsection)
#define _funcdef___iguana_pd_create_memsection
/* the *_CALL_ID is defined as 64 * the interface ID, plus the function number.
 * This restricts us to 64 functions per interface.
*/
#define _MAGPIE_IGUANA_PD_CREATE_MEMSECTION_CALL_ID (64 * (22) + 0u)

static inline int iguana_pd_create_memsection (iguana_pd _service, int inputarg, int *result, CORBA_Environment *_env)
{



	long _exception;
	L4_MsgTag_t _result;
	L4_Word_t _asynch_mask;

	/* NB: This union is declared volatile to work around a bug in gcc 3.3.3 */
#ifdef __cplusplus
	union _buf {
#else
	volatile union _buf {
#endif
		struct {
			long _msgtag;
			int inputarg;
			
		} _in;
		struct {
			long _msgtag;
			int result;
			int __retval;
			
		} _out;
	} _pack;
	/* marshal */
	
		
		
		
		_pack._in.inputarg = (int)inputarg;
	

	/* invoke IPC: NB we subtract the size of _msgtag. */
	_pack._in._msgtag = ((sizeof(_pack._in) - sizeof(long)) / MAGPIE_BYTES_PER_WORD) + ((_MAGPIE_IGUANA_PD_CREATE_MEMSECTION_CALL_ID) << 16);
	L4_MsgLoad((L4_Msg_t *)((void *)&_pack._in));
	
		_asynch_mask = L4_Get_NotifyMask();
	L4_Set_NotifyMask(0);

	_result = L4_Call(_service);
		L4_Set_NotifyMask(_asynch_mask);

	L4_MsgStore(_result, (L4_Msg_t *)((void *)&_pack));
	

	_exception = L4_Label(_result);

	if (IDL4_EXPECT_TRUE((L4_IpcSucceeded(_result)) && !_exception)) {
		/* unmarshal */
		
			*result = _pack._out.result;
		
	}
	
	if (_env != 0) {
		if (!L4_IpcSucceeded(_result)) {
			*(L4_Word_t *)_env = CORBA_SYSTEM_EXCEPTION + (L4_ErrorCode() << 8);
		} else {
			*(L4_Word_t *)_env = _exception;
		}
	}

	/* Return normally. */
	return _pack._out.__retval;
	

}
#endif // !defined(_funcdef___iguana_pd_create_memsection)





#endif //__-__
