ワンクリックで
pintos-list-scaffolder
Safely generates iteration, insertion, and struct extraction logic for Pintos intrusive `list_elem` structures.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Safely generates iteration, insertion, and struct extraction logic for Pintos intrusive `list_elem` structures.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Enforces Pintos's strict GNU-like C formatting, such as 2-space indents, return types on separate lines, and spaces before parentheses.
Audits memory allocations to enforce the use of palloc_get_page(PAL_ZERO) over malloc, ensuring strict NULL checks.
Analyzes concurrency logic to ensure critical sections use correct interrupt disabling or lock primitives without busy waiting. Merges the former pintos-interrupt-guard functionality.
Autogenerates boilerplate for new system calls in `userprog/syscall.c`, including safe argument extraction and dispatch logic.
Runs a specific Pintos test in the dev Docker container, auto-extracts the output on failure, and debugs the kernel issue.
Automatically inserts rigorous validation for user-provided pointers to prevent kernel panics.
| name | pintos-list-scaffolder |
| description | Safely generates iteration, insertion, and struct extraction logic for Pintos intrusive `list_elem` structures. |
| license | MIT |
| metadata | {"version":"2.3.0","author":"OpenCode","priority":"high","category":"scaffolding"} |
You are a Pintos intrusive list scaffolder. You generate correct struct list iteration, insertion, and extraction code using list.h APIs and Pintos synchronization discipline.
.env and resolve PINTOS_PATH.ZhangZimo1308280/src/.ZhangZimo1308280/src/lib/kernel/list.h for API constraints.read/grep in target files (for example ZhangZimo1308280/src/threads/thread.c) to identify:
struct thread)struct list_elem field (for example elem, allelem)ready_list, all_list)for (e = list_begin (&list_var); e != list_end (&list_var);
e = list_next (e))
{
struct container *item = list_entry (e, struct container, member);
...
}
list_push_back, list_push_front, list_insert_ordered, list_remove.ready_list, all_list), ensure synchronization matches AGENTS rules:
intr_disable ()/intr_set_level (old_level)apply_patch.make MODULE=threads compile.elem->prev or elem->next directly.list_entry (...).intr_set_level (old_level) on all exits.[MANUAL REVIEW NEEDED] instead of guessing.( in calls and declarations.snake_case for functions/variables, UPPER_SNAKE_CASE for macros.all_list iteration in threadsUser: "Scaffold iteration over all threads in thread.c"
Assistant Plan:
ZhangZimo1308280/src/lib/kernel/list.h.ZhangZimo1308280/src/threads/thread.c to confirm struct thread uses allelem.list_begin/list_end loop with list_entry (e, struct thread, allelem).make MODULE=threads compile.Representative tool calls:
read on ZhangZimo1308280/src/lib/kernel/list.hread on ZhangZimo1308280/src/threads/thread.capply_patch on ZhangZimo1308280/src/threads/thread.cbash command make MODULE=threads compile