idt_table的大小

dayancn 2017-01-11 06:49:17
struct Xgt_desc_struct {
unsigned short size;
unsigned long address __attribute__((packed));
unsigned short pad;
} __attribute__ ((packed));

extern struct Xgt_desc_struct idt_descr, cpu_gdt_descr[NR_CPUS];

struct desc_struct {
unsigned long a,b;
};

struct desc_struct idt_table[256] __attribute__((__section__(".data.idt"))) = { {0, 0}, };

idt_descr:
.word IDT_ENTRIES*8-1 # idt contains 256 entries
.long idt_table

请问为什么最后汇编初始化 idt_descr的size是“ .word IDT_ENTRIES*8-1”, 这里为什么要减去1呢?
...全文
329 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

4,436

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 内核源代码研究区
社区管理员
  • 内核源代码研究区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧