With the gnu tools, positioning code or data at particular addresses is done during link, rather than during compile.
You can use separate sections for "special" segments, combined either with a mysterious custom linker map, or a link command with mysterious --section-start options.
Macros are recommended (IMO) in the C code, for portability's sake:
uint8 RAM2VAR(dframe[VGA_Y_BYTES][VGA_X_BYTES]);
rather than
uint8 dframe[VGA_Y_BYTES][VGA_X_BYTES] __attribute__ ((aligned(),section(".ram2")));
This will never be portable, the PSoC5LP has two separate 32KB buffers, one at the end of the code space and the other at the beginning of the sram space.
The buffer in question is accessible by a DMA channel that sends the bytes to be displayed in the screen, if it was on the same section as the buffer where the CPU writes the buffer then there would be memory contention and that would be displayed in the screen. Actually just accessing any variable in the code space will stall that DMA transfer.
While that DMA channel accesses the separate upper 32KB buffer the CPU is free to fill the lower 32KB buffer and/or use variables that reside in the code memory space.
At the end of the DMA buffer to screen and during the vertical sync, a 2nd DMA is used to copy the CPU buffer to the DMA buffer.
As for a macro, well I would have to define it then, but since that's a tutorial for that specific hardware and not portable at all, then I rather leave it explicitly coded for clarity on where that buffer resides.
If I was to actually polish it, I would use the mysterious custom linker scripts and reducing the .ram section to 32KB
Not sure why they are so mysterious but to each their own
Edit: Plus I was answering the OP question on how to place a variable at a given absolute address in memory (with GCC)
Edit: If he was using keil I would have said to use _at_ but he already knew that.
Edit: BTW my .map reports the following:
.ram2 0x20000000 0x7530
.ram2 0x20000000 0x7530 .\CortexM3\ARM_GCC_493\Debug\main.o
0x20000000 dframe
for the 30,000 byte DMA buffer.