MAP1(MAP2, CONV_DEF) MAP1(MAP2, CLCV_DEF) MAP1(MAP2, CCRD_DEF) /* ** Initialize the converter arrays. ** ** Each definition generates one incredibly long line of text, which ** hopefully will not break a poor compiler with limitations on ** line-length... */ CF _nrrdConv[NRRD_TYPE_MAX+1][NRRD_TYPE_MAX+1] = { {NULL}, MAP1(CONVTO_LIST, _dummy_) {NULL} }; CF _nrrdClampConv[NRRD_TYPE_MAX+1][NRRD_TYPE_MAX+1] = { {NULL}, MAP1(CLCVTO_LIST, _dummy_) {NULL} }; CN _nrrdCastClampRound[NRRD_TYPE_MAX+1][NRRD_TYPE_MAX+1] = { {NULL}, MAP1(CCRDTO_LIST, _dummy_) {NULL}
#define S3C_DMA0_GPS 24 #define S3C_DMA0_PWM 29 #define S3C_DMA0_EXTERNAL 31 /* DMA request sources */ #define S3C_DMA1_I2S0_RX 9 #define S3C_DMA1_I2S0_TX 10 #define S3C_DMA1_SPI0_RX 16 #define S3C_DMA1_SPI0_TX 17 #define S3C_DMA_M2M 0 static struct s3c_dma_map __initdata s5p6442_dma_mappings[] = { [DMACH_PCM0_RX] = { .name = "pcm0-in", .channels = MAP1(S3C_DMA1_PCM0_RX), .hw_addr.from = S3C_DMA1_PCM0_RX, }, [DMACH_PCM0_TX] = { .name = "pcm0-out", .channels = MAP1(S3C_DMA1_PCM0_TX), .hw_addr.to = S3C_DMA1_PCM0_TX, }, [DMACH_PCM1_RX] = { .name = "pcm1-in", .channels = MAP1(S3C_DMA1_PCM1_RX), .hw_addr.from = S3C_DMA1_PCM1_RX, }, [DMACH_PCM1_TX] = { .name = "pcm1-out", .channels = MAP1(S3C_DMA1_PCM1_TX),
[DMACH_I2S_IN] = { .name = "i2s0-in", .channels = MAP0(S3C_DMA0_I2S0_RX), .hw_addr.from = S3C_DMA0_I2S0_RX, .sdma_sel = 1 << S3C_DMA0_I2S0_RX, }, [DMACH_I2S_OUT] = { .name = "i2s0-out", .channels = MAP0(S3C_DMA0_I2S0_TX), .hw_addr.to = S3C_DMA0_I2S0_TX, .sdma_sel = 1 << S3C_DMA0_I2S0_TX, }, [DMACH_I2S1_IN] = { .name = "i2s1-in", .channels = MAP1(S3C_DMA1_I2S1_RX), .hw_addr.from = S3C_DMA1_I2S1_RX, .sdma_sel = 1 << (S3C_DMA1_I2S1_RX+S3C_DMA1), }, [DMACH_I2S1_OUT] = { .name = "i2s1-out", .channels = MAP1(S3C_DMA1_I2S1_TX), .hw_addr.to = S3C_DMA1_I2S1_TX, .sdma_sel = 1 << (S3C_DMA1_I2S1_TX+S3C_DMA1), }, [DMACH_SPI0_IN] = { .name = "spi0-in", .channels = MAP0(S3C_DMA0_SPI0_RX), .hw_addr.from = S3C_DMA0_SPI0_RX, .sdma_sel = 1 << S3C_DMA0_SPI0_RX, },
#define S3C_PDMA0_HSI_RX 29 #define S3C_PDMA0_Reserved_1 30 #define S3C_PDMA0_Reserved 31 /* DMA request sources of M2M-DMAC */ #define S3C_DMA_SEC_TX 0 #define S3C_DMA_SEC_RX 1 #define S3C_DMA_M2M 2 static struct s3c_dma_map __initdata s5pc100_dma_mappings[] = { [DMACH_UART0] = { .name = "s5p-uart-dma", .channels = MAP1(S3C_PDMA0_UART0CH0), .hw_addr.to = S3C_PDMA0_UART0CH0, }, [DMACH_UART0_SRC2] = { .name = "s5p-uart-dma-rx", .channels = MAP2(S3C_PDMA1_UART0CH1), .hw_addr.from = S3C_PDMA1_UART0CH1, }, [DMACH_UART1] = { .name = "uart-dma-tx", .channels = MAP1(S3C_PDMA0_UART1CH0), .hw_addr.to = S3C_PDMA0_UART1CH0, }, [DMACH_UART1_SRC2] = { .name = "uart-dma-rx", .channels = MAP2(S3C_PDMA1_UART1CH1),
static key_id_t sdl_key_to_quake_key(SDLKey in) { key_id_t out; // Some characters map directly. if ((in < KEY_COUNT) && isprint(in)) { out = static_cast<key_id_t>(in); } else { // Handle the rest. switch (in) { #define MAP2(sdl, quake) case sdl: out = quake; break #define MAP1(key) MAP2(SDLK_##key, K_##key) MAP1(BACKSPACE); MAP1(TAB); MAP2(SDLK_RETURN, K_ENTER); MAP1(PAUSE); MAP1(ESCAPE); MAP2(SDLK_DELETE, K_DEL); MAP2(SDLK_KP0, static_cast<key_id_t>('0')); MAP2(SDLK_KP1, static_cast<key_id_t>('1')); MAP2(SDLK_KP2, static_cast<key_id_t>('2')); MAP2(SDLK_KP3, static_cast<key_id_t>('3')); MAP2(SDLK_KP4, static_cast<key_id_t>('4')); MAP2(SDLK_KP5, static_cast<key_id_t>('5')); MAP2(SDLK_KP6, static_cast<key_id_t>('6')); MAP2(SDLK_KP7, static_cast<key_id_t>('7')); MAP2(SDLK_KP8, static_cast<key_id_t>('8')); MAP2(SDLK_KP9, static_cast<key_id_t>('9')); MAP2(SDLK_KP_PERIOD, static_cast<key_id_t>('.')); MAP2(SDLK_KP_DIVIDE, static_cast<key_id_t>('/')); MAP2(SDLK_KP_MULTIPLY, static_cast<key_id_t>('*')); MAP2(SDLK_KP_MINUS, static_cast<key_id_t>('0')); MAP2(SDLK_KP_PLUS, static_cast<key_id_t>('+')); MAP2(SDLK_KP_ENTER, K_ENTER); MAP2(SDLK_KP_EQUALS, static_cast<key_id_t>('-')); MAP2(SDLK_UP, K_UPARROW); MAP2(SDLK_DOWN, K_DOWNARROW); MAP2(SDLK_RIGHT, K_RIGHTARROW); MAP2(SDLK_LEFT, K_LEFTARROW); MAP2(SDLK_INSERT, K_INS); MAP1(HOME); MAP1(END); MAP2(SDLK_PAGEUP, K_PGUP); MAP2(SDLK_PAGEDOWN, K_PGDN); MAP1(F1); MAP1(F2); MAP1(F3); MAP1(F4); MAP1(F5); MAP1(F6); MAP1(F7); MAP1(F8); MAP1(F9); MAP1(F10); MAP1(F11); MAP1(F12); MAP2(SDLK_RSHIFT, K_SHIFT); MAP2(SDLK_LSHIFT, K_SHIFT); MAP2(SDLK_RCTRL, K_CTRL); MAP2(SDLK_LCTRL, K_CTRL); MAP2(SDLK_RALT, K_ALT); MAP2(SDLK_LALT, K_ALT); #undef MAP1 #undef MAP2 default: out = static_cast<key_id_t>(0); } } assert(out >= 0); assert(out < KEY_COUNT); return out; }