Unison Help

- Unison Kernel
- Pthreads
- pthread_create()
- pthread_exit()
- pthread_self()
- pthread_equal()
- pthread_join()
- pthread_detach()
- pthread_setschedparam()
- pthread_getschedparam()
- pthread_attr_init()
- pthread_attr_destroy()
- pthread_attr_setstackaddr()
- pthread_attr_getstackaddr()
- pthread_attr_setstacksize()
- pthread_attr_getstacksize()
- pthread_attr_setschedparam()
- pthread_attr_getschedparam()
- pthread_attr_setdetachstate()
- pthread_attr_getdetachstate()
- pthread_stackinfo()
- pthread_setprio()
- pthread_getprio()
- sched_get_priority_max()
- sched_get_priority_min()
- sched_yield()
- Pthread Cancellation
- Mutex
- Semaphores
- Message Queues
- Conditional Variables
- Barriers
- Timers
- Clocks
- Memory Allocation
- Rendezvous
- Interrupts
- Directory Services
- Miscellaneous
- Pthreads
- Unison I/O Library
- Unison STDIO Library
- STDIO Library Calls
- clearerr()
- dprintf()
- fclose()
- fdopen()
- feof()
- ferror()
- fileno()
- fflush()
- fgetc()
- fgetpos()
- fgets()
- fopen()
- fprintf()
- fputc()
- fputs()
- fread()
- freopen()
- fscanf()
- fseek()
- fseeko()
- fsetpos()
- ftell()
- ftello()
- fwrite()
- getc()
- getc_unlocked()
- getchar()
- getchar_unlocked()
- getdelim()
- getline()
- gets()
- get_stderr_ptr()
- get_stdin_ptr()
- get_stdout_ptr()
- noperprintf()
- perprintf()
- perror()
- posix_compat()
- printf()
- putc()
- putc_unlocked()
- putchar()
- putchar_unlocked()
- puts()
- remove()
- rewind()
- scanf()
- setbuf()
- setvbuf()
- snprintf()
- sprintf()
- sscanf()
- stderr_init()
- stderr_close()
- stdin_init()
- stdin_close()
- stdout_init()
- stdout_close()
- vdprintf()
- vscanf()
- vsscanf()
- vfscanf()
- vprintf()
- vsnprintf()
- vsprintf()
- vfprintf()
- ungetc()
- 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
- Firewall
- 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)
- Wireless
- Remedy Tools for Unison
1.14.3._isrStackFill #
NAME
checkIstack – Thread and interrupt stack information
SYNOPSIS
#include <pthread.h> – or –
#include <sys.h>
- int pthreadStackFill;
- int _isrStackFill;
- extern void checkIStack(void);
DESCRIPTION
The checkIStack() function is used to print high-water mark information on the thread and interrupt stacks to the debug channel.
To utilize checkIstack(), both the thread and interrupt stacks must be initalized to known values through the use of the pthreadStackFill and _isrStackFill initialization variables.
These variables are assigned a non-zero value before kernel initialization to enable stack monitoring.
EXAMPLE
During the initial startup (typically within setup.c), the control flags to fill the thread and interrupt stacks may be set to a non-zero value to enable monitoring.
Enabling a flag causes that particular stack area to be filled with a known value (“S” for the thread stack and “I” for the interrupt stack) when they are created subsequently by the kernel.
After the kernel has started and the initial user thresd is established a call can be made to checkIstack() to send the stacks high-water mark information through the debug channel. The checkIstack() function utilizes the xprintf() debug function to send the information.
Additionally, the RTOS Viewer can be used to visualize either stack fills and is aware of the convention.
#include /* the inital startup function. */ int main() { /*disable all interrupt in interrupt controller */ __disable_irq(); /* 1 - fill the task stack with 'S' during initialization for debugging. */ pthreadStackFill = 1; /* 2 - fill the isr stack with 'I' during initialization for debugging. */ _isrStackFill = 1; /* ... the rest of the initialization code ... */ }
After the kernel has been established, any arbitrary thread may then call checkIstack() to send stack information to the debug channel.
/* some arbitarty thread. */ THREAD threadx () { extern void checkIstack (); /* call checkIstack to send information to the debug channel. */ checkIstack (); /* ... other code... */ }
The checkIstack() function will format result similar to:
ISRSTACK size:200 unused:200 Thread:20000564 base:20000604 size:512 unused:340
RETURN VALUES
None.
ERRORS
There are no errors defined.