Inline assembly in kernel module -


the inline assembly in kernel module code following:

   u64 cade_seg;    __asm__ __volatile__ ("mov %%cs %0": "=r" (code_seg)); 

however, when compiles (as kernel module), error thrown "junk rax after register." there wrong inline assembly code above.?

update: replacing %%cs other register, %%rax, error persists.

in assembly language, registers should separated comma:

__asm__ __volatile__ ("mov %%cs, %0": "=r" (code_seg)); 

also segment selectors 16 bit type.


Comments

Popular posts from this blog

javascript - Google App Script ContentService downloadAsFile not working -

javascript - Function overwritting -

c# - Exception when attempting to modify Dictionary -