From 43563c78b859b26a888ff191b3fb96cac64f509a Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 22 Sep 2014 14:53:56 -0600 Subject: Add the build framework and skeleton files for the shared memory feature (no logic yet provided) --- nuttx/Documentation/NuttxUserGuide.html | 344 ++++++++++++++++++++++++++++++-- 1 file changed, 323 insertions(+), 21 deletions(-) (limited to 'nuttx/Documentation') diff --git a/nuttx/Documentation/NuttxUserGuide.html b/nuttx/Documentation/NuttxUserGuide.html index 07246ff7e..480c7daf7 100644 --- a/nuttx/Documentation/NuttxUserGuide.html +++ b/nuttx/Documentation/NuttxUserGuide.html @@ -13,7 +13,7 @@

NuttX Operating System

User's Manual

by

Gregory Nutt

-

Last Updated: August 21, 2014

+

Last Updated: September 22, 2014

@@ -63,6 +63,7 @@
  • Paragraph 2.9 Environment Variables
  • Paragraph 2.10 File System Interfaces
  • Paragraph 2.11 Network Interfaces
  • +
  • Paragraph 2.12 Shared Memory Interfaces
  • @@ -8419,25 +8420,24 @@ FAR void *mmap(FAR void *start, size_t length, int prot, int flags, int fd, off_ -

    NuttX includes a simple interface layer based on uIP (see http://www.sics.se). -NuttX supports subset of a standard socket interface to uIP. -These network feature can be enabled by settings in the architecture -configuration file. -Those socket APIs are discussed in the following paragraphs.

    +

    + NuttX includes a simple interface layer based on uIP (see http://www.sics.se). + NuttX supports subset of a standard socket interface to uIP. + These network feature can be enabled by settings in the architecture configuration file. + Those socket APIs are discussed in the following paragraphs. +

    2.11.1 socket

    @@ -8983,8 +8983,7 @@ int setsockopt(int sockfd, int level, int option,

    Description: @@ -9032,6 +9031,309 @@ int getsockopt(int sockfd, int level, int option, Insufficient resources are available in the system to complete the call.

  • + + + + +
    +

    2.12 Shared Memory Interfaces

    +
    +

    + Shared memory interfaces are only available with the NuttX kernel build (CONFIG_BUILD_KERNEL=y). + These interfaces support user memory regions that can be shared between multiple user processes. + Shared memory interfaces: +

    + +

    + NOTE: This is advance documentation. These interfaces are not yet available as of this writing. If you are reading this note, then double check; since these interfaces are under development now, I may have simply failed to remove it. +

    + +

    2.12.1 shmget

    +

    + Function Prototype: +

    + +

    + Description: + The shmget() function will return the shared memory identifier associated with key. +

    +

    + A shared memory identifier, associated data structure, and shared memory segment of at least size bytes is created for key if one of the following is true: +

    + +

    + Upon creation, the data structure associated with the new shared memory identifier will be initialized as follows: +

    + +

    + When the shared memory segment is created, it will be initialized with all zero values. +

    +

    + Input Parameters: +

    + +

    + Returned Value: + Upon successful completion, shmget() will return a non-negative integer, namely a shared memory identifier; otherwise, it will return -1 and set errno to indicate the error. +

    + + +

    2.12.2 shmat

    +

    + Function Prototype: +

    + +

    + Description: + The shmat() function attaches the shared memory segment associated with the shared memory identifier specified by shmid to the address space of the calling process. The segment is attached at the address specified by one of the following criteria: +

    + +

    + Input Parameters: +

    + +

    + Returned Value: + Upon successful completion, shmat() will increment the value of shm_nattch in the data structure associated with the shared memory ID of the attached shared memory segment and return the segment's start address. + + Otherwise, the shared memory segment will not be attached, shmat() will return -1, and errno will be set to indicate the error. +

    + + +

    2.12.3 shmctl

    +

    + Function Prototype: +

    + +

    + Description: + The shmctl() function provides a variety of shared memory control operations as specified by cmd. The following values for cmd are available: +

    + +

    + Input Parameters: +

    + +

    + Returned Value: + Upon successful completion, shmctl() will return 0; otherwise, it will return -1 and set errno to indicate the error. +

    + + +

    2.12.4 shmdt

    +

    + Function Prototype: +

    + +

    + Description: + The shmdt() function detaches the shared memory segment located at the address specified by shmaddr from the address space of the calling process. +

    +

    + Input Parameters: +

    + +

    + Returned Value: + Upon successful completion, shmdt() will decrement the value of shm_nattch in the data structure associated with the shared memory ID of the attached shared memory segment and return 0. +

    +

    + Otherwise, the shared memory segment will not be detached, shmdt() will return -1, and errno will be set to indicate the error. +

    + +
    -- cgit v1.2.3