# nxp-auto-linux/ipc-shm architecture

> Architecture diagram of the GitHub repository nxp-auto-linux/ipc-shm, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nxp-auto-linux/ipc-shm
- Repository: https://github.com/nxp-auto-linux/ipc-shm

## Overview

IPCF is a Linux shared-memory IPC driver for communication between Linux and an RTOS on different cores of the same processor. Its main workflow configures an instance and channels, exchanges messages through shared-memory buffers and queues, and notifies or polls for reception. The graph includes kernel and user-space OS support, hardware interrupt implementations, and the documented sample variants. Edges are limited to relationships shown in excerpts, the source index, or the README; unsampled platform and sample internals are not inferred.

Main entry points: [`ipc-shm.c`](https://github.com/nxp-auto-linux/ipc-shm/blob/release/SW32G_IPCF_4.11.0/ipc-shm.c) (IPC shared-memory API), [`hw/ipc-hw.h`](https://github.com/nxp-auto-linux/ipc-shm/blob/release/SW32G_IPCF_4.11.0/hw/ipc-hw.h) (Hardware interface), [`os_kernel/ipc-uio.c`](https://github.com/nxp-auto-linux/ipc-shm/blob/release/SW32G_IPCF_4.11.0/os_kernel/ipc-uio.c) (Kernel UIO and device bridge), [`os_kernel/ipc-os.c`](https://github.com/nxp-auto-linux/ipc-shm/blob/release/SW32G_IPCF_4.11.0/os_kernel/ipc-os.c) (Kernel OS services)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_driver["Shared-memory driver"]
  node_api["IPC shared-memory API<br/>[ipc-shm.c]"]
  node_api_types["API configuration and types<br/>[ipc-types.h]"]
  node_queues["Channel ring queues<br/>[ipc-queue.c]"]
end

subgraph group_os["OS integration"]
  node_kernel_os["Kernel OS services<br/>[ipc-os.c]"]
  node_kernel_uio["Kernel UIO and device bridge<br/>[ipc-uio.c]"]
  node_kernel_xen["Xen kernel support<br/>[ipc-xen.c]"]
  node_user_os["User-space OS services<br/>[ipc-os.c]"]
end

subgraph group_hardware["Hardware interrupts"]
  node_hw_common["Hardware interface<br/>[ipc-hw.h]"]
  node_hw_s32g3["S32G3 interrupt control<br/>[ipc-hw-s32g3xx.c]"]
  node_hw_s32gen1["S32 Gen1 interrupt control<br/>[ipc-hw-s32gen1.c]"]
  node_hw_s32r47["S32R47 interrupt control<br/>[ipc-hw-s32r47.c]"]
  node_hw_s32v234["S32V234 interrupt control<br/>[ipc-hw-s32v234.c]"]
end

subgraph group_samples["Sample applications"]
  node_sample_kernel["Kernel ping-pong sample<br/>[sample.c]"]
  node_sample_multi_kernel["Kernel multi-instance sample"]
  node_sample_user["User-space ping-pong sample<br/>[sample.c]"]
  node_sample_multi_user["User-space multi-instance sample"]
  node_sample_xen_dom0["Xen dom0 sample<br/>[sample.c]"]
  node_sample_xen_dom0less["Xen dom0less sample<br/>[sample.c]"]
end

node_linux_user(("Linux application"))
node_rtos_peer(("RTOS peer"))

node_linux_user -->|"calls API"| node_api
node_api -->|"exchanges messages"| node_rtos_peer
node_api -->|"uses queues"| node_queues
node_api -->|"uses OS services"| node_kernel_os
node_api -->|"uses OS services"| node_user_os
node_kernel_os -->|"uses hardware API"| node_hw_common
node_kernel_uio -->|"controls interrupts"| node_hw_common
node_kernel_uio -->|"uses OS services"| node_kernel_os
node_kernel_xen -->|"uses hardware API"| node_hw_common
node_user_os -->|"configures device"| node_kernel_uio
node_hw_s32g3 -->|"implements interface"| node_hw_common
node_hw_s32gen1 -->|"implements interface"| node_hw_common
node_hw_s32r47 -->|"implements interface"| node_hw_common
node_hw_s32v234 -->|"implements interface"| node_hw_common
node_sample_kernel -->|"calls API"| node_api
node_sample_multi_kernel -->|"calls API"| node_api
node_sample_user -->|"calls API"| node_api
node_sample_multi_user -->|"calls API"| node_api
node_sample_xen_dom0 -->|"calls API"| node_api
node_sample_xen_dom0less -->|"calls API"| node_api

click node_api "https://github.com/nxp-auto-linux/ipc-shm/blob/release/SW32G_IPCF_4.11.0/ipc-shm.c"
click node_api_types "https://github.com/nxp-auto-linux/ipc-shm/blob/release/SW32G_IPCF_4.11.0/ipc-types.h"
click node_queues "https://github.com/nxp-auto-linux/ipc-shm/blob/release/SW32G_IPCF_4.11.0/ipc-queue.c"
click node_kernel_os "https://github.com/nxp-auto-linux/ipc-shm/blob/release/SW32G_IPCF_4.11.0/os_kernel/ipc-os.c"
click node_kernel_uio "https://github.com/nxp-auto-linux/ipc-shm/blob/release/SW32G_IPCF_4.11.0/os_kernel/ipc-uio.c"
click node_kernel_xen "https://github.com/nxp-auto-linux/ipc-shm/blob/release/SW32G_IPCF_4.11.0/os_kernel/ipc-xen.c"
click node_user_os "https://github.com/nxp-auto-linux/ipc-shm/blob/release/SW32G_IPCF_4.11.0/os_uio/ipc-os.c"
click node_hw_common "https://github.com/nxp-auto-linux/ipc-shm/blob/release/SW32G_IPCF_4.11.0/hw/ipc-hw.h"
click node_hw_s32g3 "https://github.com/nxp-auto-linux/ipc-shm/blob/release/SW32G_IPCF_4.11.0/hw/s32g3xx/ipc-hw-s32g3xx.c"
click node_hw_s32gen1 "https://github.com/nxp-auto-linux/ipc-shm/blob/release/SW32G_IPCF_4.11.0/hw/s32gen1/ipc-hw-s32gen1.c"
click node_hw_s32r47 "https://github.com/nxp-auto-linux/ipc-shm/blob/release/SW32G_IPCF_4.11.0/hw/s32r47/ipc-hw-s32r47.c"
click node_hw_s32v234 "https://github.com/nxp-auto-linux/ipc-shm/blob/release/SW32G_IPCF_4.11.0/hw/s32v234/ipc-hw-s32v234.c"
click node_sample_kernel "https://github.com/nxp-auto-linux/ipc-shm/blob/release/SW32G_IPCF_4.11.0/sample_user/sample.c"
click node_sample_multi_kernel "https://github.com/nxp-auto-linux/ipc-shm/blob/release/SW32G_IPCF_4.11.0/sample_multi_instance/sample_multi_instance.c"
click node_sample_user "https://github.com/nxp-auto-linux/ipc-shm/blob/release/SW32G_IPCF_4.11.0/sample_user/sample.c"
click node_sample_multi_user "https://github.com/nxp-auto-linux/ipc-shm/blob/release/SW32G_IPCF_4.11.0/sample_multi_instance_user/sample_multi_instance.c"
click node_sample_xen_dom0 "https://github.com/nxp-auto-linux/ipc-shm/blob/release/SW32G_IPCF_4.11.0/sample_xen/dom0/sample.c"
click node_sample_xen_dom0less "https://github.com/nxp-auto-linux/ipc-shm/blob/release/SW32G_IPCF_4.11.0/sample_xen/dom0less/sample.c"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_api,node_api_types,node_queues toneBlue
class node_kernel_os,node_kernel_uio,node_kernel_xen,node_user_os toneAmber
class node_hw_common,node_hw_s32g3,node_hw_s32gen1,node_hw_s32r47,node_hw_s32v234 toneMint
class node_sample_kernel,node_sample_multi_kernel,node_sample_user,node_sample_multi_user,node_sample_xen_dom0,node_sample_xen_dom0less toneRose
class node_linux_user,node_rtos_peer toneIndigo
```

## Components

### Shared-memory driver

- [IPC shared-memory API](https://github.com/nxp-auto-linux/ipc-shm/blob/release/SW32G_IPCF_4.11.0/ipc-shm.c): `ipc-shm.c`
- [API configuration and types](https://github.com/nxp-auto-linux/ipc-shm/blob/release/SW32G_IPCF_4.11.0/ipc-types.h): `ipc-types.h`
- [Channel ring queues](https://github.com/nxp-auto-linux/ipc-shm/blob/release/SW32G_IPCF_4.11.0/ipc-queue.c): `ipc-queue.c`

### OS integration

- [Kernel OS services](https://github.com/nxp-auto-linux/ipc-shm/blob/release/SW32G_IPCF_4.11.0/os_kernel/ipc-os.c): `os_kernel/ipc-os.c`
- [Kernel UIO and device bridge](https://github.com/nxp-auto-linux/ipc-shm/blob/release/SW32G_IPCF_4.11.0/os_kernel/ipc-uio.c): `os_kernel/ipc-uio.c`
- [Xen kernel support](https://github.com/nxp-auto-linux/ipc-shm/blob/release/SW32G_IPCF_4.11.0/os_kernel/ipc-xen.c): `os_kernel/ipc-xen.c`
- [User-space OS services](https://github.com/nxp-auto-linux/ipc-shm/blob/release/SW32G_IPCF_4.11.0/os_uio/ipc-os.c): `os_uio/ipc-os.c`

### Hardware interrupts

- [Hardware interface](https://github.com/nxp-auto-linux/ipc-shm/blob/release/SW32G_IPCF_4.11.0/hw/ipc-hw.h): `hw/ipc-hw.h`
- [S32G3 interrupt control](https://github.com/nxp-auto-linux/ipc-shm/blob/release/SW32G_IPCF_4.11.0/hw/s32g3xx/ipc-hw-s32g3xx.c): `hw/s32g3xx/ipc-hw-s32g3xx.c`
- [S32 Gen1 interrupt control](https://github.com/nxp-auto-linux/ipc-shm/blob/release/SW32G_IPCF_4.11.0/hw/s32gen1/ipc-hw-s32gen1.c): `hw/s32gen1/ipc-hw-s32gen1.c`
- [S32R47 interrupt control](https://github.com/nxp-auto-linux/ipc-shm/blob/release/SW32G_IPCF_4.11.0/hw/s32r47/ipc-hw-s32r47.c): `hw/s32r47/ipc-hw-s32r47.c`
- [S32V234 interrupt control](https://github.com/nxp-auto-linux/ipc-shm/blob/release/SW32G_IPCF_4.11.0/hw/s32v234/ipc-hw-s32v234.c): `hw/s32v234/ipc-hw-s32v234.c`

### Sample applications

- [Kernel ping-pong sample](https://github.com/nxp-auto-linux/ipc-shm/blob/release/SW32G_IPCF_4.11.0/sample_user/sample.c): `sample_user/sample.c`
- [Kernel multi-instance sample](https://github.com/nxp-auto-linux/ipc-shm/blob/release/SW32G_IPCF_4.11.0/sample_multi_instance/sample_multi_instance.c): `sample_multi_instance/sample_multi_instance.c`
- [User-space ping-pong sample](https://github.com/nxp-auto-linux/ipc-shm/blob/release/SW32G_IPCF_4.11.0/sample_user/sample.c): `sample_user/sample.c`
- [User-space multi-instance sample](https://github.com/nxp-auto-linux/ipc-shm/blob/release/SW32G_IPCF_4.11.0/sample_multi_instance_user/sample_multi_instance.c): `sample_multi_instance_user/sample_multi_instance.c`
- [Xen dom0 sample](https://github.com/nxp-auto-linux/ipc-shm/blob/release/SW32G_IPCF_4.11.0/sample_xen/dom0/sample.c): `sample_xen/dom0/sample.c`
- [Xen dom0less sample](https://github.com/nxp-auto-linux/ipc-shm/blob/release/SW32G_IPCF_4.11.0/sample_xen/dom0less/sample.c): `sample_xen/dom0less/sample.c`

### Other components

- **Linux application**
- **RTOS peer**

## Connections

- Linux application → IPC shared-memory API: calls API
- IPC shared-memory API → RTOS peer: exchanges messages
- IPC shared-memory API → Channel ring queues: uses queues (evidence: `ipc-shm.c`)
- IPC shared-memory API → Kernel OS services: uses OS services (evidence: `ipc-shm.c`)
- IPC shared-memory API → User-space OS services: uses OS services (evidence: `ipc-shm.c`)
- Kernel OS services → Hardware interface: uses hardware API (evidence: `os_kernel/ipc-os.c`)
- Kernel UIO and device bridge → Hardware interface: controls interrupts (evidence: `os_kernel/ipc-uio.c`)
- Kernel UIO and device bridge → Kernel OS services: uses OS services (evidence: `os_kernel/ipc-uio.c`)
- Xen kernel support → Hardware interface: uses hardware API (evidence: `os_kernel/ipc-xen.c`)
- User-space OS services → Kernel UIO and device bridge: configures device (evidence: `os_uio/ipc-os.c`)
- S32G3 interrupt control → Hardware interface: implements interface (evidence: `hw/s32g3xx/ipc-hw-s32g3xx.c`)
- S32 Gen1 interrupt control → Hardware interface: implements interface (evidence: `hw/s32gen1/ipc-hw-s32gen1.c`)
- S32R47 interrupt control → Hardware interface: implements interface (evidence: `hw/s32r47/ipc-hw-s32r47.c`)
- S32V234 interrupt control → Hardware interface: implements interface (evidence: `hw/s32v234/ipc-hw-s32v234.c`)
- Kernel ping-pong sample → IPC shared-memory API: calls API (evidence: `sample_user/sample.c`)
- Kernel multi-instance sample → IPC shared-memory API: calls API (evidence: `sample_multi_instance/sample_multi_instance.c`)
- User-space ping-pong sample → IPC shared-memory API: calls API (evidence: `sample_user/sample.c`)
- User-space multi-instance sample → IPC shared-memory API: calls API (evidence: `sample_multi_instance_user/sample_multi_instance.c`)
- Xen dom0 sample → IPC shared-memory API: calls API (evidence: `sample_xen/dom0/sample.c`)
- Xen dom0less sample → IPC shared-memory API: calls API (evidence: `sample_xen/dom0less/sample.c`)
