Skip to contentSkip to conversation

suggested event channel cleanups

DISCUSSION King, Steven R 2 participants 2 messages Oct 10, 2005 – Oct 11, 2005

lore
Share & tools
lore
#0 lore raw

Hello All,
This patch standardizes the type of "port" to "int" for event channel functions and structures. Internally, Xen is using "int" for ports, but userland code has a mix of "int" and "u32". Type "int" is preferred in userland, since some functions want to return a positive port value or a negative error code.

Also,

xenctrl.h: Added extern "C" to allow linking with C++ programs. xenctrl.h: Added function prototype for event channel close. xenctrl.h: Added function prototype for interdomain event channel.

I've never offered up a patch before, so apologies if I'm abusing conventions.

-steve

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw
Quoted 5 lines · Steven R

This patch standardizes the type of "port" to "int" for event channel functions and structures. Internally, Xen is using "int" for ports, but userland code has a mix of "int" and "u32". Type "int" is preferred in userland, since some functions want to return a positive port value or a negative error code.

Userspace may do this, but Xen doesn't. It makes sense to give those fields an unsigned type because Xen will never return a negative value. If higher-level interfaces outside Xen return a signed type, with -ve indicating error, there's no reason for Xen to do the same.

Quoted 1 line

xenctrl.h: Added extern "C" to allow linking with C++ programs.

Isn't it quite normal to put the ''extern "C"' in the C++ program itself when including C header files?

Quoted 2 lines

xenctrl.h: Added function prototype for event channel close. xenctrl.h: Added function prototype for interdomain event channel.

These were removed last week.; The correct interface for user-space programs is now ioctls via /dev/xen/evtchn. See examples of its use in console/daemon/io.c, for example.

Quoted 2 lines

I've never offered up a patch before, so apologies if I'm abusing conventions.

There's nothing wrong with the format of the patch. :-)

-- Keir