Code: Select all
void cli()
{
asm("cli");
}
Code: Select all
#define cli() { asm("cli"); }
Code: Select all
#define cli() { asm("cli") }
Code: Select all
void cli()
{
asm("cli");
}
Code: Select all
#define cli() { asm("cli"); }
Code: Select all
#define cli() { asm("cli") }
Code: Select all
#define cli() __asm volatile("cli\n")
Code: Select all
cli();
Code: Select all
inline unsigned char inport(unsigned short port)
{
unsigned char result;
asm volatile("inb %1, %0" : "=a" (result) : "dN" (port));
return result;
}
inline void outport(unsigned short port, unsigned char data)
{
asm volatile("outb %1, %0" : : "dN" (port), "a" (data));
}
inline unsigned short inportw(unsigned short port)
{
unsigned short result;
asm volatile("inw %1, %0" : "=a" (result) : "dN" (port));
return result;
}
inline void outportw(unsigned short port, unsigned short data)
{
asm volatile("outw %1, %0" : : "dN" (port), "a" (data));
}
Code: Select all
#define cli() { asm("cli") }
Code: Select all
int main()
{
foo();
cli();
bar();
}
Code: Select all
int main()
{
foo();
{ asm("cli"); };
bar();
}
Code: Select all
#define cli() do { asm("cli"); } while (0)
Read GCC manual on "inline" functions.GLneo wrote: ok, thx, so i put those functions in the syslib.h file but now every file that include that file and uses those functions gets multiple definition errors, is there a way to inline functions with out errors???, thx