Rewrite of kernel sg.h header.