I'm not very familiar with vxWorks, but you may not need to explicitly set BAR0 and BAR1. The values assigned by the OS may be fine. If this is the case, you can eliminate your first, second, and fourth writes. Of course, your fifth write would need to be modified based on the value of BAR1 assigned by the OS.
Regarding your second write, you should read the value of the command register, or-in the memory access enable, and then write the resulting value rather than blasting the command register with only the memory access enable set.
Hope this helps,
geoff
--
Geoff Schmit
Huskie Robotics, FIRST Team 3061 Lead Mentor
http://team3061.org/
@team3061