[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Freeipmi-devel] Re: libfreipmi: Locking and Synchronization
From: |
Anand Babu |
Subject: |
[Freeipmi-devel] Re: libfreipmi: Locking and Synchronization |
Date: |
Wed, 31 Mar 2004 16:29:21 -0800 |
User-agent: |
Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux) |
,----
| address@hidden fish-0.0.0]$ /usr/sbin/fish
| ipmi-semaphores.c: 36: ipmi_mutex_init: errno (2): expression failed
| ipmi-kcs-interface.c: 64: ipmi_kcs_io_init: errno (2): expression failed
| ipmi_kcs_io_init: No such file or directory
|
| Perhaps fish should create the lockfile for you if it doesn't exist?
|
| Al
`----
There are no lock files.
#define IPMI_IPCKEY "/var/lock/libfreeipmi/ipckey"
is used by ftok along with PROJ_ID to create a unique key.
IPMI_IPCKEY is installed during libfreeipmi installation.
Goal is to have locking and synchronization hidden within libfreeipmi
and should work even the app has no clue about it.
-ab
----- Original Message -----
From: Anand Babu <address@hidden>
Date: Wednesday, March 31, 2004 9:14 am
Subject: libfreipmi: Locking and Synchronization
>
> Implements mutex based on Sys V Semaphores.
>
> IPMI_IPCKEY
>
> PATH: "/var/lock/libfreeipmi/ipckey"
> Uses ftok () and PROJ_ID to generate KEYS.
>
>
> IPCKEY APIs:
>
> IPMI_LAN_IPCKEY ()
> IPMI_KCS_IPCKEY ()
> IPMI_SMIC_IPCKEY ()
> IPMI_BT_IPCKEY ()
> Returns 'key'.
>
>
> Initialization API:
>
> int ipmi_mutex_init (key_t key);
> Returns 'semid'.
>
>
> Locking APIs:
>
> IPMI_MUTEX_LOCK(semid)
> IPMI_MUTEX_UNLOCK(semid)
> IPMI_MUTEX_DOWN (semid)
> IPMI_MUTEX_UP (semid)
> Returns 'void'
>
> IPMI_MUTEX_LOCK_INTERRUPTIBLE (semid)
> IPMI_MUTEX_LOCK_ASYNC (semid)
> IPMI_MUTEX_DOWN_INTERRUPTIBLE (semid)
> IPMI_MUTEX_DOWN_ASYNC (semid)
> Return '0' on success, otherwise it returns '-1' with errno
> indicating the error. Should restart when errno is 'EAGAIN'.
>
> KCS Driver:
>
> int ipmi_kcs_get_mutex_semid (void);
>
> int ipmi_kcs_io_init (u_int16_t sms_io_base, unsigned long
> sleep_usecs);
> Initialized locking internally.
>
> int8_t ipmi_kcs_cmd (u_int16_t sms_io_base, u_int8_t lun, u_int8_t
> fn, fiid_obj_t obj_cmd_rq, fiid_template_t
> tmpl_cmd_rq, fiid_obj_t obj_cmd_rs, fiid_template_t
> tmpl_cmd_rs);
> Locking handled internally. Handles BMC transaction - write and
> read.
>
> int8_t ipmi_kcs_cmd_interruptible (u_int16_t sms_io_base, u_int8_t
> lun, u_int8_t fn, fiid_obj_t obj_cmd_rq, fiid_template_t
> tmpl_cmd_rq, fiid_obj_t obj_cmd_rs, fiid_template_t
> tmpl_cmd_rs);
> Interruptible Locking. Should retry when errno is EAGAIN.
> Handles BMC transaction - write and read.
>
>
> Notes:
> * Unlocking on exit or crash is handled automatically.
> * You can use "ipcs" and "ipcrm" utilities to view and manipulate
> these mutexes.
>
> --
> _.|_
> (_||_)
> Free as in Freedom <www.gnu.org>
>
--
_.|_
(_||_)
Free as in Freedom <www.gnu.org>