??????????????????????????????????????????У?????????δ???д???????е???????????
????const sys_call_ptr_t sys_call_table[__NR_syscall_max+1] = {
????/*
????* Smells like a compiler bug -- it doesn't work
????* when the & below is removed.
????*/
????[0 ... __NR_syscall_max] = &sys_ni_syscall??
????#include
????};
?????????????????????????????????? C ?????????????????????????????????????????δ???
????????????
????C ?????????????????????????????????????????????????????????????????磺
????int my_array[5] = {0?? 1?? 2?? 3?? 4};
?????????????????????????????е????????磬??????????????????????????????????????????0??
????int my_array[5] = {0?? 1?? 2};
?????? C89 ????У?????????????????????????????????г??????????? ISO C99 ?У?????????????????????????????????????????????????????????????? GNU ?????? GCC ?? C89 ??????????????????????????????????????????????????????????? [index] =???磺
????int my_array[6] = { [4] = 29?? [2] = 15 };
????????д???
????int my_array[6] = { [4] 29?? [2] 15 };     //???????????????=??GCC 2.5 ?????÷???????????? GCC ??????
???????????????
????int my_array[6] = {0?? 0?? 15?? 0?? 29?? 0};
????GNU ????????????????????????Χ???????????????????????? [first ... last] = value ??????????
????int my_array[100] = { [0 ... 9] = 1?? [10 ... 98] = 2?? 3 };
?????????my_array??????0~9??????????1?? ??10~98??????????2?? ??99??????????3??????????????д??[99] = 3)??** ??? **????????... ???????????п?????
???????????
??????????????????г?????????????????????????? C ??????????????????????????????????ú???????????????????????????????????????????????????????????????????壺
????const sys_call_ptr_t sys_call_table[__NR_syscall_max+1] = {
????[0 ... __NR_syscall_max] = &sys_ni_syscall??
????#include
????};
?????????????? __NR_syscall_max+1 ?????????? sys_ni_syscall ????????ú???????? -ENOSYS?????????????δ?????????????????????#include ????????????????????????????
????__SYSCALL_I386(0?? sys_restart_syscall?? sys_restart_syscall)
????__SYSCALL_I386(1?? sys_exit?? sys_exit)
????__SYSCALL_I386(2?? sys_fork?? stub32_fork)
????__SYSCALL_I386(3?? sys_read?? sys_read)
????__SYSCALL_I386(4?? sys_write?? sys_write)
????__SYSCALL_I386(5?? sys_open?? compat_sys_open)
????...
????__SYSCALL_I386 ????????壺
????#define __SYSCALL_I386(nr?? sym?? compat) [nr] = sym??
????1
????#define __SYSCALL_I386(nr?? sym?? compat) [nr] = sym??
?????????????????????????????
????const sys_call_ptr_t sys_call_table[__NR_syscall_max+1] = {
????[0 ... __NR_syscall_max] = &sys_ni_syscall??
????[0] = sys_restart_syscall??
????[1] = sys_exit??
????[2] = sys_fork??
????[3] = sys_read??
????//...
????};
?????????????????????????????ж? int 0x80 ???? sysenter ????????????????????????????????????ú????????????????????????????ú???????У?
????ENTRY(system_call)
????pushl_cfi %eax          # ?????? eax
????SAVE_ALL                # ?????????
????GET_THREAD_INFO(%ebp)
????testl $_TIF_WORK_SYSCALL_ENTRY??TI_flags(%ebp)    # ?????????????????
????jnz syscall_trace_entry
????cmpl $(NR_syscalls)?? %eax    # ????????ú??????
????jae syscall_badsys
????syscall_call:
????call *sys_call_table(??%eax??4)   # ?????????????????? call sys_call_table[%eax*4]
???????????????????????????????????????????????????????????? sys_call_table ???????
??????????
????????л????????????????????????????????
????/* There are machines which are known to not boot with the GDT
????being 8-byte unaligned.  Intel recommends 16 byte alignment. */
????static const u64 boot_gdt[] __attribute__((aligned(16))) = {
????/* CS: code?? read/execute?? 4 GB?? base 0 */
????[GDT_ENTRY_BOOT_CS] = GDT_ENTRY(0xc09b?? 0?? 0xfffff)??
????/* DS: data?? read/write?? 4 GB?? base 0 */
????[GDT_ENTRY_BOOT_DS] = GDT_ENTRY(0xc093?? 0?? 0xfffff)??
????/* TSS: 32-bit tss?? 104 bytes?? base 4096 */
????/* We only have a TSS here to keep Intel VT happy;
????we don't actually use it for anything. */
????[GDT_ENTRY_BOOT_TSS] = GDT_ENTRY(0x0089?? 4096?? 103)??
????};
????????????????????????GDT????????