prov/psm: document the assumption on the "event_in" parameter.

This parameter was added to the event creation routine to allow
the event being written to the user buffer directly, bypassing
the steps of allocating/enqueuing/dequeuing a new event. The user
buffer only has space for the CQ entry of the current CQ format.
Any provider provate information should not be written to it.

Signed-off-by: Jianxin Xiong <jianxin.xiong@intel.com>
prov/psm: implement cq_writeerr

Also allow writing multiple events with cq_write.

Signed-off-by: Jianxin Xiong <jianxin.xiong@intel.com>
prov/psm: finish 'len' to 'count' conversion of CQ read functions

Signed-off-by: Jianxin Xiong <jianxin.xiong@intel.com>
prov/psm: add count to event queue to support read threadhold

Signed-off-by: Jianxin Xiong <jianxin.xiong@intel.com>
prov/psm: allow returning multiple events in a single CQ read call

Signed-off-by: Jianxin Xiong <jianxin.xiong@intel.com>
prov/psm: use socketpair() instead of pipe() to create fd wait obj

Signed-off-by: Jianxin Xiong <jianxin.xiong@intel.com>
prov/psm: implement wait obj

Signed-off-by: Jianxin Xiong <jianxin.xiong@intel.com>
prov/psm: partial implementation of pollset

The actual polling part is missing. And there are missing links
between and poll_add/poll_del calls and the API definition.

Signed-off-by: Jianxin Xiong <jianxin.xiong@intel.com>
prov/psm: implement cntr.readerr()

Signed-off-by: Jianxin Xiong <jianxin.xiong@intel.com>
prov/psm: create a utility routine to get the wait object

Signed-off-by: Jianxin Xiong <jianxin.xiong@intel.com>
prov/psm: use the new wait object mechanism in counter

Signed-off-by: Jianxin Xiong <jianxin.xiong@intel.com>
prov/psm: signal wait object when events are added to cq

Signed-off-by: Jianxin Xiong <jianxin.xiong@intel.com>
porv/psm: remove unused union member name

Signed-off-by: Jianxin Xiong <jianxin.xiong@intel.com>
prov/psm: implement blocking cq read

Signed-off-by: Jianxin Xiong <jianxin.xiong@intel.com>
prov/psm: replace empty av bind function with fi_no_bind

Signed-off-by: Jianxin Xiong <jianxin.xiong@intel.com>
Merge branch 'master' of ssh://github.com/ofiwg/libfabric
Merge pull request #263 from jsquyres/pr/fix-makefile-typo

distscript.pl: fix typo
Merge pull request #261 from j-xiong/master

prov/psm: waitset, pollset, blocking cq read, etc
fabric: Clean up mutex abstraction and atomic getter-setters in fi.h

The snippet in configure.ac which checked for intrinsics was
always failing so the atomic gcc intrinsics have never been
compiled. Additionally this set is deprecated as of GCC 4.7
which introduced a new set of intrinsics. Replace them
with test for the new c11 intrinsics + implementation,
tested on gcc 4.9.1.

Replaced the semaphore implementation of a mutex with a plain
old pthread mutex.  semaphore.h is part of posix/libc, just
like pthreads which we require explicitly-- so just use that.

Allow the mutex to be compile-time selected as either a mutex or a spinlock.

Signed-off-by: pmmccorm <patrick.m.mccormick@intel.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
usnic provider: suppress unused var warning

Fixes #265

Signed-off-by: Reese Faucette <rfaucett@cisco.com>