From: Michael Buesch Date: Thu, 22 May 2008 18:03:08 +0000 (+0200) Subject: b43-asm: Allow complex immediates in initvals. X-Git-Tag: b43-fwcutter-013~51 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=244653f03d1ba8fda31b0a467cc9c15e56ab9029;p=b43-tools.git b43-asm: Allow complex immediates in initvals. Signed-off-by: Michael Buesch --- diff --git a/assembler/parser.y b/assembler/parser.y index 4bdb9ec..84a5c24 100644 --- a/assembler/parser.y +++ b/assembler/parser.y @@ -102,35 +102,35 @@ section_switch : SECTION_TEXT { } ; -ivals_write : IVAL_MMIO16 hexnum_decnum COMMA hexnum_decnum { +ivals_write : IVAL_MMIO16 imm_value COMMA imm_value { struct initval_op *iop = xmalloc(sizeof(struct initval_op)); iop->type = IVAL_W_MMIO16; iop->args[0] = (unsigned int)(unsigned long)$2; iop->args[1] = (unsigned int)(unsigned long)$4; $$ = iop; } - | IVAL_MMIO32 hexnum_decnum COMMA hexnum_decnum { + | IVAL_MMIO32 imm_value COMMA imm_value { struct initval_op *iop = xmalloc(sizeof(struct initval_op)); iop->type = IVAL_W_MMIO32; iop->args[0] = (unsigned int)(unsigned long)$2; iop->args[1] = (unsigned int)(unsigned long)$4; $$ = iop; } - | IVAL_PHY hexnum_decnum COMMA hexnum_decnum { + | IVAL_PHY imm_value COMMA imm_value { struct initval_op *iop = xmalloc(sizeof(struct initval_op)); iop->type = IVAL_W_PHY; iop->args[0] = (unsigned int)(unsigned long)$2; iop->args[1] = (unsigned int)(unsigned long)$4; $$ = iop; } - | IVAL_RADIO hexnum_decnum COMMA hexnum_decnum { + | IVAL_RADIO imm_value COMMA imm_value { struct initval_op *iop = xmalloc(sizeof(struct initval_op)); iop->type = IVAL_W_RADIO; iop->args[0] = (unsigned int)(unsigned long)$2; iop->args[1] = (unsigned int)(unsigned long)$4; $$ = iop; } - | IVAL_SHM16 hexnum_decnum COMMA hexnum_decnum COMMA hexnum_decnum { + | IVAL_SHM16 imm_value COMMA imm_value COMMA imm_value { struct initval_op *iop = xmalloc(sizeof(struct initval_op)); iop->type = IVAL_W_SHM16; iop->args[0] = (unsigned int)(unsigned long)$2; @@ -138,7 +138,7 @@ ivals_write : IVAL_MMIO16 hexnum_decnum COMMA hexnum_decnum { iop->args[2] = (unsigned int)(unsigned long)$6; $$ = iop; } - | IVAL_SHM32 hexnum_decnum COMMA hexnum_decnum COMMA hexnum_decnum { + | IVAL_SHM32 imm_value COMMA imm_value COMMA imm_value { struct initval_op *iop = xmalloc(sizeof(struct initval_op)); iop->type = IVAL_W_SHM32; iop->args[0] = (unsigned int)(unsigned long)$2; @@ -1101,15 +1101,18 @@ mem : BRACK_OPEN imm BRACK_CLOSE { } ; -imm : hexnum_decnum { +imm : imm_value { struct immediate *imm = xmalloc(sizeof(struct immediate)); imm->imm = (unsigned long)$1; $$ = imm; } + ; + +imm_value : hexnum_decnum { + $$ = $1; + } | complex_imm { - struct immediate *imm = xmalloc(sizeof(struct immediate)); - imm->imm = (unsigned long)$1; - $$ = imm; + $$ = $1; } ;