MCPcopy Create free account
hub / github.com/apache/nuttx / up_stack_frame

Function up_stack_frame

arch/hc/src/common/hc_stackframe.c:74–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72 ****************************************************************************/
73
74FAR void *up_stack_frame(FAR struct tcb_s *tcb, size_t frame_size)
75{
76 FAR void *ret;
77
78 /* Align the frame_size */
79
80 frame_size = STACKFRAME_ALIGN_UP(frame_size);
81
82 /* Is there already a stack allocated? Is it big enough? */
83
84 if (!tcb->stack_alloc_ptr || tcb->adj_stack_size <= frame_size)
85 {
86 return NULL;
87 }
88
89 ret = tcb->stack_base_ptr;
90 memset(ret, 0, frame_size);
91
92 /* Save the adjusted stack values in the struct tcb_s */
93
94 tcb->stack_base_ptr = (FAR uint8_t *)tcb->stack_base_ptr + frame_size;
95 tcb->adj_stack_size -= frame_size;
96
97 /* And return the pointer to the allocated region */
98
99 return ret;
100}

Callers

nothing calls this directly

Calls 1

memsetFunction · 0.50

Tested by

no test coverage detected