summaryrefslogtreecommitdiffstats
path: root/scripts/cleanpatch
diff options
context:
space:
mode:
authorNobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>2014-12-03 17:57:01 +0900
committerNobuhiro Iwamatsu <iwamatsu@nigauri.org>2014-12-05 11:15:52 +0900
commit7a7eb983a4cd7531843de875572bf5a1c96297ca (patch)
treeb4a74e7b876fafdf8941de8683421ddea8f84f6d /scripts/cleanpatch
parent21ea350385149e0e96c51b2cac5e91cd4fd143bc (diff)
mmc: sh_mmcif: Change maximum and minimum value of MMC clock
Maximum value and the minimum value of clock for sh_mmcif instead by base of MMC clock. This removes fixed clock, make the changes to be calculated according to environment. Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com> Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Diffstat (limited to 'scripts/cleanpatch')
0 files changed, 0 insertions, 0 deletions
>102 103 104 105 106 107 108 109 110 111 112 113 114 115
# example:
#  DLTYPE[INT][:rb2c]["arg0"] => "NUM2INT(arg0)"
#  DLTYPE[DOUBLE][:c2rb]["r"] => "rb_float_new(r)"

DLTYPE = {
  VOID  = 0x00 => {
    :name => 'VOID',
    :rb2c => nil,
    :c2rb => nil,
    :ctype => "void",
    :stmem => "v",
    :sym => true,
    :cb => true,
  },
  CHAR  = 0x01 => {
    :name => 'CHAR',
    :rb2c => proc{|x| "NUM2CHR(#{x})"},
    :c2rb => proc{|x| "CHR2FIX(#{x})"},
    :ctype => "char",
    :stmem => "c",
    :sym => false,
    :cb => false,
  },
  SHORT = 0x02 => {
    :name => 'SHORT',
    :rb2c => proc{|x| "FIX2INT(#{x})"},
    :c2rb => proc{|x| "INT2FIX(#{x})"},
    :ctype => "short",
    :stmem => "h",
    :sym => false,
    :cb => false,
  },
  INT   = 0x03 => {
    :name => 'INT',
    :rb2c => proc{|x| "NUM2INT(#{x})"},
    :c2rb => proc{|x| "INT2NUM(#{x})"},
    :ctype => "int",
    :stmem => "i",
    :sym => true,
    :cb => false,
  },
  LONG  = 0x04 => {
    :name => 'LONG',
    :rb2c => proc{|x| "NUM2INT(#{x})"},
    :c2rb => proc{|x| "INT2NUM(#{x})"},
    :ctype => "long",
    :stmem => "l",
    :sym => true,
    :cb => true,
  },
  FLOAT = 0x05 => {
    :name => 'FLOAT',
    :rb2c => proc{|x| "(float)(RFLOAT(#{x})->value)"},
    :c2rb => proc{|x| "rb_float_new((double)#{x})"},
    :ctype => "float",
    :stmem => "f",
    :sym => false,
    :cb => false,
  },
  DOUBLE = 0x06 => {
    :name => 'DOUBLE',
    :rb2c => proc{|x| "RFLOAT(#{x})->value"},
    :c2rb => proc{|x| "rb_float_new(#{x})"},
    :ctype => "double",
    :stmem => "d",
    :sym => true,
    :cb => true,
  },
  VOIDP = 0x07 => {
    :name => 'VOIDP',
    :rb2c => proc{|x| "rb_dlptr2cptr(#{x})"},
    :c2rb => proc{|x| "rb_dlptr_new(#{x},sizeof(void*),0)"},
    :ctype => "void *",
    :stmem => "p",
    :sym => true,
    :cb => true,
  },
}

def tpush(t, x)
  (t << 3)|x
end

def tget(t, i)
  (t & (0x07 << (i * 3))) >> (i * 3)
end

def types2num(types)
  res = 0x00
  r = types.reverse
  r.each{|t|
    res = tpush(res,t)
  }