teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

2

修正

2020/04/15 10:31

投稿

asm
asm

スコア15149

answer CHANGED
@@ -17,8 +17,8 @@
17
17
 
18
18
 
19
19
  ```s
20
- -> TI_TASK 0 offsetof(struct thread_info, task)
20
+ -> TI_TASK $0 offsetof(struct thread_info, task)
21
- -> TI_FLAGS 16 offsetof(struct thread_info, flags)
21
+ -> TI_FLAGS $16 offsetof(struct thread_info, flags)
22
22
  ```
23
23
 
24
24
 

1

追記

2020/04/15 10:31

投稿

asm
asm

スコア15149

answer CHANGED
@@ -4,4 +4,26 @@
4
4
  最終的に作りたいのは`asm-offsets.h`なのです。
5
5
 
6
6
  そのために、インラインアセンブラの`.s`生成機能を文書生成機として用い
7
- `sed`によって置換を行っています。
7
+ `sed`によって置換を行っています。
8
+
9
+
10
+ ---
11
+
12
+ ```c
13
+ DEFINE(TI_TASK, offsetof(struct thread_info, task));
14
+ DEFINE(TI_FLAGS, offsetof(struct thread_info, flags));
15
+ ```
16
+
17
+
18
+
19
+ ```s
20
+ -> TI_TASK 0 offsetof(struct thread_info, task)
21
+ -> TI_FLAGS 16 offsetof(struct thread_info, flags)
22
+ ```
23
+
24
+
25
+
26
+ ```c
27
+ #define TI_TASK 0 /* offsetof(struct thread_info, task) */
28
+ #define TI_FLAGS 16 /* offsetof(struct thread_info, flags) */
29
+ ```