The short answer is no.
The UNO and the MEGA both use atmel microprocessors, and there is no OS running on them (bare-metal), apart from the 'OS' you write yourself in the Arduino IDE. You can directly manipulate low-level registers, if you want to.
Galileo uses a full x86 system-on-a-chip, which runs Linux. Your arduino sketch runs as a userspace program on top of Linux, and from userspace you don't have direct access to anything as low-level as setting individual bits in hardware control registers.
So, the solution is not an easy search-and-replace job. However if you know what this code is doing then you should be able to replicate its functionality without all of the AVR-specific parts.
For example, _BV() is an AVR macro so that will have to go.
google search reveals that _BV(x) is equivalent to 1<<x.