Mackerel: don't generate rawwr functions for RO registers
@@ -1056,10 +1056,16 @@ register_rawwrite_fn r =
(RT.name r) n)
]
else
+ if RT.is_writeable r then
[
decl,
C.StaticInline C.Void n args [ C.Ex $ loc_write r cv_regval ]
]
+ else
+ [
+ C.Comment $ printf "Register %s is not writeable" (RT.name r)
+ ]
+
--
-- Write to register. Harder than it sounds.
@@ -1175,17 +1181,17 @@ loc_read r =
loc_read_decl :: RT.Rec -> C.TypeSpec -> [ C.Param ] -> C.Unit
loc_read_decl r tpe args =
case RT.spc r of
- s@Space.Defined { Space.t = Space.REGISTERWISE } ->
- C.FunctionDecl tpe (space_cpu_reg_read_fn_name s (RT.size r) (RT.base r)) (tail args)
+-- s@Space.Defined { Space.t = Space.REGISTERWISE } ->
+-- C.FunctionDecl tpe (space_cpu_reg_read_fn_name s (RT.size r) (RT.base r)) (tail args)
_ -> C.NoOp
loc_write_decl :: RT.Rec -> C.TypeSpec -> [ C.Param ] -> C.Unit
loc_write_decl r tpe args =
case RT.spc r of
- s@Space.Defined { Space.t = Space.REGISTERWISE } ->
- C.FunctionDecl C.Void (space_cpu_reg_write_fn_name s (RT.size r) (RT.base r))
- (tail args)
+-- s@Space.Defined { Space.t = Space.REGISTERWISE } ->
+-- C.FunctionDecl C.Void (space_cpu_reg_write_fn_name s (RT.size r) (RT.base r))
+-- (tail args)
_ -> C.NoOp
loc_write :: RT.Rec -> String -> C.Expr
