I was clearly too brief ;).
Somewhat less briefly: there needs to be a clear distinction between the hardware resources owned by the top level, and those owned by interrupts. Reasonably often a single port has pins that are serviced by interrupts, and others that are not. In such cases one has to be sure that an interrupt doesn't come along and change the state of the port (or its DDR) while the top level is doing something with it, hence my reference to read-modify-writes being atomic. Again, reasonably often one needs to maintain a copy of the state of the entire port in software - the same cautions apply.
As a general rule, unless the hardware support is time-critical (as is the case with serial comms or SPI), it's better to set a flag in software under interrupt control and allow the top level to maintain the hardware. YMMV.
Steve
--