- Unison Kernel
- Pthread Cancellation
- Message Queues
- Conditional Variables
- Memory Allocation
- Directory Services
- Unison I/O Library
- Unison STDIO Library
- STDIO Library Calls
- Do-nothing Stubs
- STDIO Library Calls
- Unison LIBC Library
- Unison I/O Servers
- Graphics, Camera, Video, Audio
- Network Protocols
- TCP and UDP Server - tcpd
- DHCP Client Service - dhcp client
- DHCP Server - dhcpd
- Telnet Server - telnetd
- Tiny FTP Server - tftpd
- Point to Point - pppd
- Network Translation - NAT with PAT
- Tiny HTTP Server - thttpd
- Tiny HTTP Server with TLS
- POP3 Server
- Simple Mail Transfer Protocol Services (SMTP)
- Bootp Protocol
- File Transfer Protocol Server (FTP)
- File Transfer Client Services
- RPC / XDR
- DNS Client
- HTTP/HTTPS Client
- REST Client
- AutoIP Service - autoip client
- mDNS server - mdnsd
- SNTP Client
- SNMP Agent - Snmpd server
- SSL/TLS library
- SSH server
- IP security
- Power Control
- Serial I/O
- System Services
- Universal Serial Bus (USB)
- Remedy Tools for Unison
pool_create, pool_destroy, pool_alloc, pool_free – memory allocation
- int pool_create( int poolno,
- unsigned long startaddr , unsigned long endaddr );
- int pool_destroy( int poolno );
- void *pool_alloc( int poolno , size_t size );
- int pool_free( int poolno , void *buf );
pool_alloc() and pool_free() are callable from an ISR.
Memory pools are used to perform allocation of dynamic byte sized chunks of memory from specific memory regions. The pool calls to allocate and free memory, map onto the calls generally used at the application level – malloc() and free().
Microcontrollers and microprocessors often have memory ranges that provide different levels of performance. The combination of the use of the kalloc() and malloc() functions and their mappings onto the pool routines can ensure that certain high performance regions are used for high performance operations. For example, an internal fast memory region could be used for OS allocation (ie kalloc() ) and an external memory could be used for a graphics frame buffer.
Memory pools are used for dynamic allocation of variable size buffers. Up to 8 memory pools may be created. Valid poolno values are 0 through 7 inclusive.
A memory pool is created with a call to pool_create(). startaddr and endaddr indicated the pool limits. It is up to the caller to provide a contiguous block of memory for the memory pool. poolno is a handle which will be used to access the pool. Memory pool poolno can be destroyed with a call to pool_destroy. pool_alloc returns a pointer to a dynamically allocated block of size bytes from memory pool poolno. pool_free returns the block of memory, allocated with a call to pool_alloc, to memory pool poolno.
pool_create() and pool_destroy() return 0 if sucessfull. If they fail, they set errno and return -1.
pool_alloc() returns 0 on failure and a pointer to the allocated buffer if successfull.
pool_create() will set the following errors:
- poolno is not in the range 0 to 7 or is already in use.
pool_destroy() will set the following errors:
- poolno is not in the range 0 to 7 or has outstanding memory allocated.