"shared memory" sample code on VxWorks - VxWorks

This is a discussion on "shared memory" sample code on VxWorks - VxWorks ; Hello experts. Have to experience on shared memory implementation? I used vxworks v5.4 and need shared memory sample code. anticipate your reply.. thanks...

+ Reply to Thread
Results 1 to 3 of 3

Thread: "shared memory" sample code on VxWorks

  1. "shared memory" sample code on VxWorks

    Hello experts.
    Have to experience on shared memory implementation?
    I used vxworks v5.4 and need shared memory sample code.
    anticipate your reply..

    thanks

  2. Re: "shared memory" sample code on VxWorks

    On Sep 25, 8:57*am, kevin wrote:
    > Hello experts.
    > Have to experience on shared memory implementation?
    > I used vxworks v5.4 and need shared memory sample code.
    > anticipate your reply..
    >
    > thanks


    Dear You !

    I'm using 6.5 but I think this part of code is the same (or very
    close).

    In a kernel module I create the object (1Kbyte) with :
    char *Buff;

    {

    /* Create the R/W shared buffer */
    if ((sd = sdOpen("/SdObjetName", 0, OM_CREATE, 1024, 0, SD_ATTR_RW |
    SD_CACHE_OFF, (void **)&Buff)) == NULL)
    {
    LOG_MSG(("Error creating shared data region\n"));
    driver_cleanup();
    return (ERROR);
    }
    }

    In another module I use :
    char *Buff2;

    {

    if (sdOpen("/SdObjetName", 0, 0, 1024, 0, SD_ATTR_RW | SD_CACHE_OFF,
    (void **)&buff2) == 0)
    {
    LOG_MSG(("Error opening shared data region\n"));
    return (ERROR);
    }
    }

    After that you can work with buff and buff2 depending on where you
    are.

    You can forget sdCreate API.

    Regards

  3. Re: "shared memory" sample code on VxWorks

    On 9월25일, 오후5시12분, sybe wrote:
    > On Sep 25, 8:57 am, kevin wrote:
    >
    > > Hello experts.
    > > Have to experience on shared memory implementation?
    > > I used vxworks v5.4 and need shared memory sample code.
    > > anticipate your reply..

    >
    > > thanks

    >
    > Dear You !
    >
    > I'm using 6.5 but I think this part of code is the same (or very
    > close).
    >
    > In a kernel module I create the object (1Kbyte) with :
    > char *Buff;
    >
    > {
    >
    > /* Create the R/W shared buffer */
    > if ((sd = sdOpen("/SdObjetName", 0, OM_CREATE, 1024, 0, SD_ATTR_RW |
    > SD_CACHE_OFF, (void **)&Buff)) == NULL)
    > {
    > LOG_MSG(("Error creating shared data region\n"));
    > driver_cleanup();
    > return (ERROR);
    > }
    >
    > }
    >
    > In another module I use :
    > char *Buff2;
    >
    > {
    >
    > if (sdOpen("/SdObjetName", 0, 0, 1024, 0, SD_ATTR_RW | SD_CACHE_OFF,
    > (void **)&buff2) == 0)
    > {
    > LOG_MSG(("Error opening shared data region\n"));
    > return (ERROR);
    > }
    >
    > }
    >
    > After that you can work with buff and buff2 depending on where you
    > are.
    >
    > You can forget sdCreate API.
    >
    > Regards



    Vxworks 5.x doesn't support shared memory API unless using vxMP..
    etc..

    There is no sdLib such as sdOpen, sdDelete, sdMap etc in vxworks 5.x

    The sdLib is in Vxworks 6.x.




+ Reply to Thread