From: Richard W.M. Jones <"Richard W.M. Jones "> Date: Wed, 6 Aug 2008 19:05:07 +0000 (+0100) Subject: Make the modules more accessible to be 'open'ed. X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=6029405541d12dedfce7998deefa0e6b0d04f3d5;p=virt-mem.git Make the modules more accessible to be 'open'ed. --- diff --git a/extract/codegen/kerneldb_to_parser.ml b/extract/codegen/kerneldb_to_parser.ml index 2bddb90..6414ce4 100644 --- a/extract/codegen/kerneldb_to_parser.ml +++ b/extract/codegen/kerneldb_to_parser.ml @@ -32,7 +32,7 @@ let what = [ "task_struct", ( "struct task_struct {", "};", true, [ "state"; "prio"; "normal_prio"; "static_prio"; - "tasks'prev"; "tasks'next"; "mm"; "active_mm"; "comm"] + "tasks'prev"; "tasks'next"; "mm"; "active_mm"; "comm"; "pid" ] ); (* "mm_struct", ( @@ -286,9 +286,9 @@ Example (from toplevel of virt-mem source tree): match struct_name with | None -> nested_fields | Some prefix -> - List.map ( - fun (name, details) -> (prefix ^ "'" ^ name, details) - ) nested_fields in + List.map ( + fun (name, details) -> (prefix ^ "'" ^ name, details) + ) nested_fields in (* Parse the rest. *) nested_fields @ parse basename rest @@ -315,7 +315,8 @@ Example (from toplevel of virt-mem source tree): let subs = Pcre.exec ~rex:re_offsetsize line in let offset = int_of_string (Pcre.get_substring subs 1) in let size = int_of_string (Pcre.get_substring subs 2) in - (name, (`Ptr struct_name, offset, size)) :: parse basename lines + (name, (`Ptr struct_name, offset, size)) + :: parse basename lines with Not_found -> parse basename lines ); @@ -329,7 +330,8 @@ Example (from toplevel of virt-mem source tree): let subs = Pcre.exec ~rex:re_offsetsize line in let offset = int_of_string (Pcre.get_substring subs 1) in let size = int_of_string (Pcre.get_substring subs 2) in - (name, (`Str width, offset, size)) :: parse basename lines + (name, (`Str width, offset, size)) + :: parse basename lines with Not_found -> parse basename lines ); @@ -343,9 +345,10 @@ Example (from toplevel of virt-mem source tree): let datas = List.map ( fun (basename, version, arch, bodies) -> let structures = List.filter_map ( - fun (name, (_, _, _, wanted_fields)) -> + fun (struct_name, (_, _, _, wanted_fields)) -> let body = - try Some (Hashtbl.find bodies name) with Not_found -> None in + try Some (Hashtbl.find bodies struct_name) + with Not_found -> None in match body with | None -> None | Some body -> @@ -370,10 +373,15 @@ Example (from toplevel of virt-mem source tree): List.iter ( fun wanted_field -> if not (List.mem_assoc wanted_field fields) then - failwith (sprintf "%s: structure %s is missing required field %s" basename name wanted_field) + failwith (sprintf "%s: structure %s is missing required field %s" basename struct_name wanted_field) ) wanted_fields; - Some (name, (fields, total_size)) + (* Prefix all the field names with the structure name. *) + let fields = + List.map (fun (name, details) -> + struct_name ^ "_" ^ name, details) fields in + + Some (struct_name, (fields, total_size)) ) what in (basename, version, arch, structures) @@ -516,12 +524,8 @@ Example (from toplevel of virt-mem source tree): function | (name, `Int) -> <:ctyp< $lid:name$ : int64 >> - | (name, `Ptr "list_head") -> - <:ctyp< $lid:name$ : - [ `$lid:struct_name$ ] Virt_mem_mmap.typed_addr >> - | (name, `Ptr struct_name) -> - <:ctyp< $lid:name$ : - [ `$lid:struct_name$ ] Virt_mem_mmap.typed_addr >> + | (name, `Ptr _) -> + <:ctyp< $lid:name$ : Virt_mem_mmap.addr >> | (name, `Str _) -> <:ctyp< $lid:name$ : string >> ) field_types in @@ -593,9 +597,7 @@ Example (from toplevel of virt-mem source tree): List.map ( function | (field_name, (`Ptr "list_head", offset, size)) -> - sprintf "%s = (Virt_mem_mmap.unsafe_typed_addr_of_addr (Int64.sub %s %dL) : [ `%s ] Virt_mem_mmap.typed_addr)" field_name field_name offset struct_name - | (field_name, (`Ptr struct_name, offset, size)) -> - sprintf "%s = (Virt_mem_mmap.unsafe_typed_addr_of_addr %s : [ `%s ] Virt_mem_mmap.typed_addr)" field_name field_name struct_name + sprintf "%s = Int64.sub %s %dL" field_name field_name offset | (field_name, _) -> sprintf "%s = %s" field_name field_name ) fields @@ -640,16 +642,15 @@ Example (from toplevel of virt-mem source tree): $version_map$ type kernel_version = string - let known version = StringMap.mem version map - let size version = + let $lid:struct_name^"_known"$ version = StringMap.mem version map + let $lid:struct_name^"_size"$ version = let _, size = StringMap.find version map in size - let of_bits version bits = + let $lid:struct_name^"_of_bits"$ version bits = let parsefn, _ = StringMap.find version map in parsefn bits - let get version mem addr = + let $lid:"get_"^struct_name$ version mem addr = let parsefn, size = StringMap.find version map in - let addr = Virt_mem_mmap.unsafe_addr_of_typed_addr addr in let bytes = Virt_mem_mmap.get_bytes mem addr size in let bits = Bitstring.bitstring_of_string bytes in parsefn bits @@ -661,13 +662,12 @@ Example (from toplevel of virt-mem source tree): $struct_sig$ type kernel_version = string - val known : kernel_version -> bool - val size : kernel_version -> int - val of_bits : kernel_version -> Bitstring.bitstring -> t - val get : kernel_version -> - ('a, 'b, [`HasMapping]) Virt_mem_mmap.t -> - [ `$lid:struct_name$ ] Virt_mem_mmap.typed_addr -> - t + val $lid:struct_name^"_known"$ : kernel_version -> bool + val $lid:struct_name^"_size"$ : kernel_version -> int + val $lid:struct_name^"_of_bits"$ : + kernel_version -> Bitstring.bitstring -> t + val $lid:"get_"^struct_name$ : kernel_version -> + ('a, 'b, [`HasMapping]) Virt_mem_mmap.t -> Virt_mem_mmap.addr -> t >> in (struct_name, code, interface, parser_subs) diff --git a/lib/kernel_net_device.ml b/lib/kernel_net_device.ml index 7d258f9..917a120 100644 --- a/lib/kernel_net_device.ml +++ b/lib/kernel_net_device.ml @@ -2,91 +2,91 @@ let warning = "This code is automatically generated from the kernel database by kerneldb-to-parser program. Any edits you make will be lost.";; let zero = 0;; exception ParseError of string * string * string;; -type t = { dev_addr : string; name : string };; +type t = { net_device_dev_addr : string; net_device_name : string };; let parser_1 bits = bitmatch bits with - | { name : 128 : offset(0), string; - dev_addr : 256 : offset(2240), string } -> { name = name; - dev_addr = dev_addr } + | { net_device_name : 128 : offset(0), string; + net_device_dev_addr : 256 : offset(2240), string } -> { net_device_name = net_device_name; + net_device_dev_addr = net_device_dev_addr } | { _ } -> raise (ParseError ("net_device", "parser_1", "failed to match kernel structure"));; let parser_2 bits = bitmatch bits with - | { name : 128 : offset(0), string; - dev_addr : 256 : offset(2496), string } -> { name = name; - dev_addr = dev_addr } + | { net_device_name : 128 : offset(0), string; + net_device_dev_addr : 256 : offset(2496), string } -> { net_device_name = net_device_name; + net_device_dev_addr = net_device_dev_addr } | { _ } -> raise (ParseError ("net_device", "parser_2", "failed to match kernel structure"));; let parser_3 bits = bitmatch bits with - | { name : 128 : offset(0), string; - dev_addr : 256 : offset(2688), string } -> { name = name; - dev_addr = dev_addr } + | { net_device_name : 128 : offset(0), string; + net_device_dev_addr : 256 : offset(2688), string } -> { net_device_name = net_device_name; + net_device_dev_addr = net_device_dev_addr } | { _ } -> raise (ParseError ("net_device", "parser_3", "failed to match kernel structure"));; let parser_4 bits = bitmatch bits with - | { name : 128 : offset(0), string; - dev_addr : 256 : offset(4416), string } -> { name = name; - dev_addr = dev_addr } + | { net_device_name : 128 : offset(0), string; + net_device_dev_addr : 256 : offset(4416), string } -> { net_device_name = net_device_name; + net_device_dev_addr = net_device_dev_addr } | { _ } -> raise (ParseError ("net_device", "parser_4", "failed to match kernel structure"));; let parser_5 bits = bitmatch bits with - | { name : 128 : offset(0), string; - dev_addr : 256 : offset(3392), string } -> { name = name; - dev_addr = dev_addr } + | { net_device_name : 128 : offset(0), string; + net_device_dev_addr : 256 : offset(3392), string } -> { net_device_name = net_device_name; + net_device_dev_addr = net_device_dev_addr } | { _ } -> raise (ParseError ("net_device", "parser_5", "failed to match kernel structure"));; let parser_6 bits = bitmatch bits with - | { name : 128 : offset(0), string; - dev_addr : 256 : offset(4416), string } -> { name = name; - dev_addr = dev_addr } + | { net_device_name : 128 : offset(0), string; + net_device_dev_addr : 256 : offset(4416), string } -> { net_device_name = net_device_name; + net_device_dev_addr = net_device_dev_addr } | { _ } -> raise (ParseError ("net_device", "parser_6", "failed to match kernel structure"));; let parser_7 bits = bitmatch bits with - | { name : 128 : offset(0), string; - dev_addr : 256 : offset(3264), string } -> { name = name; - dev_addr = dev_addr } + | { net_device_name : 128 : offset(0), string; + net_device_dev_addr : 256 : offset(3264), string } -> { net_device_name = net_device_name; + net_device_dev_addr = net_device_dev_addr } | { _ } -> raise (ParseError ("net_device", "parser_7", "failed to match kernel structure"));; let parser_8 bits = bitmatch bits with - | { name : 128 : offset(0), string; - dev_addr : 256 : offset(4288), string } -> { name = name; - dev_addr = dev_addr } + | { net_device_name : 128 : offset(0), string; + net_device_dev_addr : 256 : offset(4288), string } -> { net_device_name = net_device_name; + net_device_dev_addr = net_device_dev_addr } | { _ } -> raise (ParseError ("net_device", "parser_8", "failed to match kernel structure"));; let parser_9 bits = bitmatch bits with - | { name : 128 : offset(0), string; - dev_addr : 256 : offset(1728), string } -> { name = name; - dev_addr = dev_addr } + | { net_device_name : 128 : offset(0), string; + net_device_dev_addr : 256 : offset(1728), string } -> { net_device_name = net_device_name; + net_device_dev_addr = net_device_dev_addr } | { _ } -> raise (ParseError ("net_device", "parser_9", "failed to match kernel structure"));; let parser_10 bits = bitmatch bits with - | { name : 128 : offset(0), string; - dev_addr : 256 : offset(1728), string } -> { name = name; - dev_addr = dev_addr } + | { net_device_name : 128 : offset(0), string; + net_device_dev_addr : 256 : offset(1728), string } -> { net_device_name = net_device_name; + net_device_dev_addr = net_device_dev_addr } | { _ } -> raise (ParseError ("net_device", "parser_10", "failed to match kernel structure"));; let parser_11 bits = bitmatch bits with - | { name : 128 : offset(0), string; - dev_addr : 256 : offset(2528), string } -> { name = name; - dev_addr = dev_addr } + | { net_device_name : 128 : offset(0), string; + net_device_dev_addr : 256 : offset(2528), string } -> { net_device_name = net_device_name; + net_device_dev_addr = net_device_dev_addr } | { _ } -> raise (ParseError ("net_device", "parser_11", "failed to match kernel structure"));; let parser_12 bits = bitmatch bits with - | { name : 128 : offset(0), string; - dev_addr : 256 : offset(3392), string } -> { name = name; - dev_addr = dev_addr } + | { net_device_name : 128 : offset(0), string; + net_device_dev_addr : 256 : offset(3392), string } -> { net_device_name = net_device_name; + net_device_dev_addr = net_device_dev_addr } | { _ } -> raise (ParseError ("net_device", "parser_12", "failed to match kernel structure"));; let parser_13 bits = bitmatch bits with - | { name : 128 : offset(0), string; - dev_addr : 256 : offset(2528), string } -> { name = name; - dev_addr = dev_addr } + | { net_device_name : 128 : offset(0), string; + net_device_dev_addr : 256 : offset(2528), string } -> { net_device_name = net_device_name; + net_device_dev_addr = net_device_dev_addr } | { _ } -> raise (ParseError ("net_device", "parser_13", "failed to match kernel structure"));; let parser_14 bits = bitmatch bits with - | { name : 128 : offset(0), string; - dev_addr : 256 : offset(4288), string } -> { name = name; - dev_addr = dev_addr } + | { net_device_name : 128 : offset(0), string; + net_device_dev_addr : 256 : offset(4288), string } -> { net_device_name = net_device_name; + net_device_dev_addr = net_device_dev_addr } | { _ } -> raise (ParseError ("net_device", "parser_14", "failed to match kernel structure"));; let parser_15 bits = bitmatch bits with - | { name : 128 : offset(0), string; - dev_addr : 256 : offset(1696), string } -> { name = name; - dev_addr = dev_addr } + | { net_device_name : 128 : offset(0), string; + net_device_dev_addr : 256 : offset(1696), string } -> { net_device_name = net_device_name; + net_device_dev_addr = net_device_dev_addr } | { _ } -> raise (ParseError ("net_device", "parser_15", "failed to match kernel structure"));; let parser_16 bits = bitmatch bits with - | { name : 128 : offset(0), string; - dev_addr : 256 : offset(2624), string } -> { name = name; - dev_addr = dev_addr } + | { net_device_name : 128 : offset(0), string; + net_device_dev_addr : 256 : offset(2624), string } -> { net_device_name = net_device_name; + net_device_dev_addr = net_device_dev_addr } | { _ } -> raise (ParseError ("net_device", "parser_16", "failed to match kernel structure"));; let parser_17 bits = bitmatch bits with - | { name : 128 : offset(0), string; - dev_addr : 256 : offset(1696), string } -> { name = name; - dev_addr = dev_addr } + | { net_device_name : 128 : offset(0), string; + net_device_dev_addr : 256 : offset(1696), string } -> { net_device_name = net_device_name; + net_device_dev_addr = net_device_dev_addr } | { _ } -> raise (ParseError ("net_device", "parser_17", "failed to match kernel structure"));; module StringMap = Map.Make(String);; let map = StringMap.empty;; @@ -196,6 +196,8 @@ let v = (parser_5, 1260);; let map = StringMap.add "2.6.20-1.2933.fc6.ppc64" v map;; let v = (parser_2, 1116);; let map = StringMap.add "2.6.22-0.23.rc7.git6.fc8.ppc" v map;; +let v = (parser_13, 1048);; +let map = StringMap.add "2.6.24-7.fc9.ppc" v map;; let v = (parser_2, 1092);; let map = StringMap.add "2.6.21-1.3209.fc8.ppc" v map;; let v = (parser_12, 1260);; @@ -286,13 +288,15 @@ let v = (parser_1, 924);; let map = StringMap.add "2.6.20-1.2933.fc6.i686" v map;; let v = (parser_6, 2044);; let map = StringMap.add "2.6.21-1.3209.fc8.ppc64" v map;; +let v = (parser_1, 1284);; +let map = StringMap.add "2.6.21-1.3132.fc7.i686" v map;; type kernel_version = string;; -let known version = StringMap.mem version map;; -let size version = let (_, size) = StringMap.find version map in size;; -let of_bits version bits = +let net_device_known version = StringMap.mem version map;; +let net_device_size version = + let (_, size) = StringMap.find version map in size;; +let net_device_of_bits version bits = let (parsefn, _) = StringMap.find version map in parsefn bits;; -let get version mem addr = +let get_net_device version mem addr = let (parsefn, size) = StringMap.find version map in - let addr = Virt_mem_mmap.unsafe_addr_of_typed_addr addr in let bytes = Virt_mem_mmap.get_bytes mem addr size in let bits = Bitstring.bitstring_of_string bytes in parsefn bits;; diff --git a/lib/kernel_net_device.mli b/lib/kernel_net_device.mli index 646b835..a9600d5 100644 --- a/lib/kernel_net_device.mli +++ b/lib/kernel_net_device.mli @@ -1,10 +1,9 @@ exception ParseError of string * string * string;; -type t = { dev_addr : string; name : string };; +type t = { net_device_dev_addr : string; net_device_name : string };; type kernel_version = string;; -val known : kernel_version -> bool;; -val size : kernel_version -> int;; -val of_bits : kernel_version -> Bitstring.bitstring -> t;; -val get : +val net_device_known : kernel_version -> bool;; +val net_device_size : kernel_version -> int;; +val net_device_of_bits : kernel_version -> Bitstring.bitstring -> t;; +val get_net_device : kernel_version -> - ('a, 'b, [ | `HasMapping ]) Virt_mem_mmap.t -> - [ | `net_device ] Virt_mem_mmap.typed_addr -> t;; + ('a, 'b, [ | `HasMapping ]) Virt_mem_mmap.t -> Virt_mem_mmap.addr -> t;; diff --git a/lib/kernel_task_struct.ml b/lib/kernel_task_struct.ml index aac64ab..8b66e6e 100644 --- a/lib/kernel_task_struct.ml +++ b/lib/kernel_task_struct.ml @@ -3,429 +3,474 @@ let warning = let zero = 0;; exception ParseError of string * string * string;; type t = - { active_mm : [ | `mm_struct ] Virt_mem_mmap.typed_addr; comm : string; - mm : [ | `mm_struct ] Virt_mem_mmap.typed_addr; normal_prio : int64; - prio : int64; state : int64; static_prio : int64; - tasks'next : [ | `task_struct ] Virt_mem_mmap.typed_addr; - tasks'prev : [ | `task_struct ] Virt_mem_mmap.typed_addr + { task_struct_active_mm : Virt_mem_mmap.addr; task_struct_comm : string; + task_struct_mm : Virt_mem_mmap.addr; task_struct_normal_prio : int64; + task_struct_pid : int64; task_struct_prio : int64; + task_struct_state : int64; task_struct_static_prio : int64; + task_struct_tasks'next : Virt_mem_mmap.addr; + task_struct_tasks'prev : Virt_mem_mmap.addr };; let parser_1 bits = bitmatch bits with - | { state : zero+32 : offset(0), littleendian; - prio : zero+32 : offset(192), littleendian; - static_prio : zero+32 : offset(224), littleendian; - normal_prio : zero+32 : offset(256), littleendian; - tasks'next : zero+32 : offset(992), littleendian; - tasks'prev : zero+32 : offset(1024), littleendian; - mm : zero+32 : offset(1056), littleendian; - active_mm : zero+32 : offset(1088), littleendian; - comm : 128 : offset(3232), string } -> { state = state; - prio = prio; - static_prio = static_prio; - normal_prio = normal_prio; - tasks'next = (Virt_mem_mmap.unsafe_typed_addr_of_addr (Int64.sub tasks'next 124L) : [ `task_struct ] Virt_mem_mmap.typed_addr); - tasks'prev = (Virt_mem_mmap.unsafe_typed_addr_of_addr (Int64.sub tasks'prev 128L) : [ `task_struct ] Virt_mem_mmap.typed_addr); - mm = (Virt_mem_mmap.unsafe_typed_addr_of_addr mm : [ `mm_struct ] Virt_mem_mmap.typed_addr); - active_mm = (Virt_mem_mmap.unsafe_typed_addr_of_addr active_mm : [ `mm_struct ] Virt_mem_mmap.typed_addr); - comm = comm } + | { task_struct_state : zero+32 : offset(0), littleendian; + task_struct_prio : zero+32 : offset(192), littleendian; + task_struct_static_prio : zero+32 : offset(224), littleendian; + task_struct_normal_prio : zero+32 : offset(256), littleendian; + task_struct_tasks'next : zero+32 : offset(992), littleendian; + task_struct_tasks'prev : zero+32 : offset(1024), littleendian; + task_struct_mm : zero+32 : offset(1056), littleendian; + task_struct_active_mm : zero+32 : offset(1088), littleendian; + task_struct_pid : zero+32 : offset(1344), littleendian; + task_struct_comm : 128 : offset(3232), string } -> { task_struct_state = task_struct_state; + task_struct_prio = task_struct_prio; + task_struct_static_prio = task_struct_static_prio; + task_struct_normal_prio = task_struct_normal_prio; + task_struct_tasks'next = Int64.sub task_struct_tasks'next 124L; + task_struct_tasks'prev = Int64.sub task_struct_tasks'prev 128L; + task_struct_mm = task_struct_mm; + task_struct_active_mm = task_struct_active_mm; + task_struct_pid = task_struct_pid; + task_struct_comm = task_struct_comm } | { _ } -> raise (ParseError ("task_struct", "parser_1", "failed to match kernel structure"));; let parser_2 bits = bitmatch bits with - | { state : zero+32 : offset(0), bigendian; - prio : zero+32 : offset(160), bigendian; - static_prio : zero+32 : offset(192), bigendian; - normal_prio : zero+32 : offset(224), bigendian; - tasks'next : zero+32 : offset(2176), bigendian; - tasks'prev : zero+32 : offset(2208), bigendian; - mm : zero+32 : offset(2240), bigendian; - active_mm : zero+32 : offset(2272), bigendian; - comm : 128 : offset(4416), string } -> { state = state; - prio = prio; - static_prio = static_prio; - normal_prio = normal_prio; - tasks'next = (Virt_mem_mmap.unsafe_typed_addr_of_addr (Int64.sub tasks'next 272L) : [ `task_struct ] Virt_mem_mmap.typed_addr); - tasks'prev = (Virt_mem_mmap.unsafe_typed_addr_of_addr (Int64.sub tasks'prev 276L) : [ `task_struct ] Virt_mem_mmap.typed_addr); - mm = (Virt_mem_mmap.unsafe_typed_addr_of_addr mm : [ `mm_struct ] Virt_mem_mmap.typed_addr); - active_mm = (Virt_mem_mmap.unsafe_typed_addr_of_addr active_mm : [ `mm_struct ] Virt_mem_mmap.typed_addr); - comm = comm } + | { task_struct_state : zero+32 : offset(0), bigendian; + task_struct_prio : zero+32 : offset(160), bigendian; + task_struct_static_prio : zero+32 : offset(192), bigendian; + task_struct_normal_prio : zero+32 : offset(224), bigendian; + task_struct_tasks'next : zero+32 : offset(2176), bigendian; + task_struct_tasks'prev : zero+32 : offset(2208), bigendian; + task_struct_mm : zero+32 : offset(2240), bigendian; + task_struct_active_mm : zero+32 : offset(2272), bigendian; + task_struct_pid : zero+32 : offset(2528), bigendian; + task_struct_comm : 128 : offset(4416), string } -> { task_struct_state = task_struct_state; + task_struct_prio = task_struct_prio; + task_struct_static_prio = task_struct_static_prio; + task_struct_normal_prio = task_struct_normal_prio; + task_struct_tasks'next = Int64.sub task_struct_tasks'next 272L; + task_struct_tasks'prev = Int64.sub task_struct_tasks'prev 276L; + task_struct_mm = task_struct_mm; + task_struct_active_mm = task_struct_active_mm; + task_struct_pid = task_struct_pid; + task_struct_comm = task_struct_comm } | { _ } -> raise (ParseError ("task_struct", "parser_2", "failed to match kernel structure"));; let parser_3 bits = bitmatch bits with - | { state : zero+32 : offset(0), bigendian; - prio : zero+32 : offset(192), bigendian; - static_prio : zero+32 : offset(224), bigendian; - normal_prio : zero+32 : offset(256), bigendian; - tasks'next : zero+32 : offset(2304), bigendian; - tasks'prev : zero+32 : offset(2336), bigendian; - mm : zero+32 : offset(2496), bigendian; - active_mm : zero+32 : offset(2528), bigendian; - comm : 128 : offset(4736), string } -> { state = state; - prio = prio; - static_prio = static_prio; - normal_prio = normal_prio; - tasks'next = (Virt_mem_mmap.unsafe_typed_addr_of_addr (Int64.sub tasks'next 288L) : [ `task_struct ] Virt_mem_mmap.typed_addr); - tasks'prev = (Virt_mem_mmap.unsafe_typed_addr_of_addr (Int64.sub tasks'prev 292L) : [ `task_struct ] Virt_mem_mmap.typed_addr); - mm = (Virt_mem_mmap.unsafe_typed_addr_of_addr mm : [ `mm_struct ] Virt_mem_mmap.typed_addr); - active_mm = (Virt_mem_mmap.unsafe_typed_addr_of_addr active_mm : [ `mm_struct ] Virt_mem_mmap.typed_addr); - comm = comm } + | { task_struct_state : zero+32 : offset(0), bigendian; + task_struct_prio : zero+32 : offset(192), bigendian; + task_struct_static_prio : zero+32 : offset(224), bigendian; + task_struct_normal_prio : zero+32 : offset(256), bigendian; + task_struct_tasks'next : zero+32 : offset(2304), bigendian; + task_struct_tasks'prev : zero+32 : offset(2336), bigendian; + task_struct_mm : zero+32 : offset(2496), bigendian; + task_struct_active_mm : zero+32 : offset(2528), bigendian; + task_struct_pid : zero+32 : offset(2784), bigendian; + task_struct_comm : 128 : offset(4736), string } -> { task_struct_state = task_struct_state; + task_struct_prio = task_struct_prio; + task_struct_static_prio = task_struct_static_prio; + task_struct_normal_prio = task_struct_normal_prio; + task_struct_tasks'next = Int64.sub task_struct_tasks'next 288L; + task_struct_tasks'prev = Int64.sub task_struct_tasks'prev 292L; + task_struct_mm = task_struct_mm; + task_struct_active_mm = task_struct_active_mm; + task_struct_pid = task_struct_pid; + task_struct_comm = task_struct_comm } | { _ } -> raise (ParseError ("task_struct", "parser_3", "failed to match kernel structure"));; let parser_4 bits = bitmatch bits with - | { state : zero+64 : offset(0), littleendian; - prio : zero+32 : offset(320), littleendian; - static_prio : zero+32 : offset(352), littleendian; - normal_prio : zero+32 : offset(384), littleendian; - tasks'next : zero+64 : offset(1536), littleendian; - tasks'prev : zero+64 : offset(1600), littleendian; - mm : zero+64 : offset(1664), littleendian; - active_mm : zero+64 : offset(1728), littleendian; - comm : 128 : offset(5376), string } -> { state = state; - prio = prio; - static_prio = static_prio; - normal_prio = normal_prio; - tasks'next = (Virt_mem_mmap.unsafe_typed_addr_of_addr (Int64.sub tasks'next 192L) : [ `task_struct ] Virt_mem_mmap.typed_addr); - tasks'prev = (Virt_mem_mmap.unsafe_typed_addr_of_addr (Int64.sub tasks'prev 200L) : [ `task_struct ] Virt_mem_mmap.typed_addr); - mm = (Virt_mem_mmap.unsafe_typed_addr_of_addr mm : [ `mm_struct ] Virt_mem_mmap.typed_addr); - active_mm = (Virt_mem_mmap.unsafe_typed_addr_of_addr active_mm : [ `mm_struct ] Virt_mem_mmap.typed_addr); - comm = comm } + | { task_struct_state : zero+64 : offset(0), littleendian; + task_struct_prio : zero+32 : offset(320), littleendian; + task_struct_static_prio : zero+32 : offset(352), littleendian; + task_struct_normal_prio : zero+32 : offset(384), littleendian; + task_struct_tasks'next : zero+64 : offset(1536), littleendian; + task_struct_tasks'prev : zero+64 : offset(1600), littleendian; + task_struct_mm : zero+64 : offset(1664), littleendian; + task_struct_active_mm : zero+64 : offset(1728), littleendian; + task_struct_pid : zero+32 : offset(2144), littleendian; + task_struct_comm : 128 : offset(5376), string } -> { task_struct_state = task_struct_state; + task_struct_prio = task_struct_prio; + task_struct_static_prio = task_struct_static_prio; + task_struct_normal_prio = task_struct_normal_prio; + task_struct_tasks'next = Int64.sub task_struct_tasks'next 192L; + task_struct_tasks'prev = Int64.sub task_struct_tasks'prev 200L; + task_struct_mm = task_struct_mm; + task_struct_active_mm = task_struct_active_mm; + task_struct_pid = task_struct_pid; + task_struct_comm = task_struct_comm } | { _ } -> raise (ParseError ("task_struct", "parser_4", "failed to match kernel structure"));; let parser_5 bits = bitmatch bits with - | { state : zero+64 : offset(0), littleendian; - prio : zero+32 : offset(256), littleendian; - static_prio : zero+32 : offset(288), littleendian; - normal_prio : zero+32 : offset(320), littleendian; - tasks'next : zero+64 : offset(2816), littleendian; - tasks'prev : zero+64 : offset(2880), littleendian; - mm : zero+64 : offset(3200), littleendian; - active_mm : zero+64 : offset(3264), littleendian; - comm : 128 : offset(6912), string } -> { state = state; - prio = prio; - static_prio = static_prio; - normal_prio = normal_prio; - tasks'next = (Virt_mem_mmap.unsafe_typed_addr_of_addr (Int64.sub tasks'next 352L) : [ `task_struct ] Virt_mem_mmap.typed_addr); - tasks'prev = (Virt_mem_mmap.unsafe_typed_addr_of_addr (Int64.sub tasks'prev 360L) : [ `task_struct ] Virt_mem_mmap.typed_addr); - mm = (Virt_mem_mmap.unsafe_typed_addr_of_addr mm : [ `mm_struct ] Virt_mem_mmap.typed_addr); - active_mm = (Virt_mem_mmap.unsafe_typed_addr_of_addr active_mm : [ `mm_struct ] Virt_mem_mmap.typed_addr); - comm = comm } + | { task_struct_state : zero+64 : offset(0), littleendian; + task_struct_prio : zero+32 : offset(256), littleendian; + task_struct_static_prio : zero+32 : offset(288), littleendian; + task_struct_normal_prio : zero+32 : offset(320), littleendian; + task_struct_tasks'next : zero+64 : offset(2816), littleendian; + task_struct_tasks'prev : zero+64 : offset(2880), littleendian; + task_struct_mm : zero+64 : offset(3200), littleendian; + task_struct_active_mm : zero+64 : offset(3264), littleendian; + task_struct_pid : zero+32 : offset(3584), littleendian; + task_struct_comm : 128 : offset(6912), string } -> { task_struct_state = task_struct_state; + task_struct_prio = task_struct_prio; + task_struct_static_prio = task_struct_static_prio; + task_struct_normal_prio = task_struct_normal_prio; + task_struct_tasks'next = Int64.sub task_struct_tasks'next 352L; + task_struct_tasks'prev = Int64.sub task_struct_tasks'prev 360L; + task_struct_mm = task_struct_mm; + task_struct_active_mm = task_struct_active_mm; + task_struct_pid = task_struct_pid; + task_struct_comm = task_struct_comm } | { _ } -> raise (ParseError ("task_struct", "parser_5", "failed to match kernel structure"));; let parser_6 bits = bitmatch bits with - | { state : zero+64 : offset(0), bigendian; - prio : zero+32 : offset(320), bigendian; - static_prio : zero+32 : offset(352), bigendian; - normal_prio : zero+32 : offset(384), bigendian; - tasks'next : zero+64 : offset(1600), bigendian; - tasks'prev : zero+64 : offset(1664), bigendian; - mm : zero+64 : offset(1728), bigendian; - active_mm : zero+64 : offset(1792), bigendian; - comm : 128 : offset(5440), string } -> { state = state; - prio = prio; - static_prio = static_prio; - normal_prio = normal_prio; - tasks'next = (Virt_mem_mmap.unsafe_typed_addr_of_addr (Int64.sub tasks'next 200L) : [ `task_struct ] Virt_mem_mmap.typed_addr); - tasks'prev = (Virt_mem_mmap.unsafe_typed_addr_of_addr (Int64.sub tasks'prev 208L) : [ `task_struct ] Virt_mem_mmap.typed_addr); - mm = (Virt_mem_mmap.unsafe_typed_addr_of_addr mm : [ `mm_struct ] Virt_mem_mmap.typed_addr); - active_mm = (Virt_mem_mmap.unsafe_typed_addr_of_addr active_mm : [ `mm_struct ] Virt_mem_mmap.typed_addr); - comm = comm } + | { task_struct_state : zero+64 : offset(0), bigendian; + task_struct_prio : zero+32 : offset(320), bigendian; + task_struct_static_prio : zero+32 : offset(352), bigendian; + task_struct_normal_prio : zero+32 : offset(384), bigendian; + task_struct_tasks'next : zero+64 : offset(1600), bigendian; + task_struct_tasks'prev : zero+64 : offset(1664), bigendian; + task_struct_mm : zero+64 : offset(1728), bigendian; + task_struct_active_mm : zero+64 : offset(1792), bigendian; + task_struct_pid : zero+32 : offset(2208), bigendian; + task_struct_comm : 128 : offset(5440), string } -> { task_struct_state = task_struct_state; + task_struct_prio = task_struct_prio; + task_struct_static_prio = task_struct_static_prio; + task_struct_normal_prio = task_struct_normal_prio; + task_struct_tasks'next = Int64.sub task_struct_tasks'next 200L; + task_struct_tasks'prev = Int64.sub task_struct_tasks'prev 208L; + task_struct_mm = task_struct_mm; + task_struct_active_mm = task_struct_active_mm; + task_struct_pid = task_struct_pid; + task_struct_comm = task_struct_comm } | { _ } -> raise (ParseError ("task_struct", "parser_6", "failed to match kernel structure"));; let parser_7 bits = bitmatch bits with - | { state : zero+64 : offset(0), littleendian; - prio : zero+32 : offset(320), littleendian; - static_prio : zero+32 : offset(352), littleendian; - normal_prio : zero+32 : offset(384), littleendian; - tasks'next : zero+64 : offset(1536), littleendian; - tasks'prev : zero+64 : offset(1600), littleendian; - mm : zero+64 : offset(1664), littleendian; - active_mm : zero+64 : offset(1728), littleendian; - comm : 128 : offset(5440), string } -> { state = state; - prio = prio; - static_prio = static_prio; - normal_prio = normal_prio; - tasks'next = (Virt_mem_mmap.unsafe_typed_addr_of_addr (Int64.sub tasks'next 192L) : [ `task_struct ] Virt_mem_mmap.typed_addr); - tasks'prev = (Virt_mem_mmap.unsafe_typed_addr_of_addr (Int64.sub tasks'prev 200L) : [ `task_struct ] Virt_mem_mmap.typed_addr); - mm = (Virt_mem_mmap.unsafe_typed_addr_of_addr mm : [ `mm_struct ] Virt_mem_mmap.typed_addr); - active_mm = (Virt_mem_mmap.unsafe_typed_addr_of_addr active_mm : [ `mm_struct ] Virt_mem_mmap.typed_addr); - comm = comm } + | { task_struct_state : zero+64 : offset(0), littleendian; + task_struct_prio : zero+32 : offset(320), littleendian; + task_struct_static_prio : zero+32 : offset(352), littleendian; + task_struct_normal_prio : zero+32 : offset(384), littleendian; + task_struct_tasks'next : zero+64 : offset(1536), littleendian; + task_struct_tasks'prev : zero+64 : offset(1600), littleendian; + task_struct_mm : zero+64 : offset(1664), littleendian; + task_struct_active_mm : zero+64 : offset(1728), littleendian; + task_struct_pid : zero+32 : offset(2144), littleendian; + task_struct_comm : 128 : offset(5440), string } -> { task_struct_state = task_struct_state; + task_struct_prio = task_struct_prio; + task_struct_static_prio = task_struct_static_prio; + task_struct_normal_prio = task_struct_normal_prio; + task_struct_tasks'next = Int64.sub task_struct_tasks'next 192L; + task_struct_tasks'prev = Int64.sub task_struct_tasks'prev 200L; + task_struct_mm = task_struct_mm; + task_struct_active_mm = task_struct_active_mm; + task_struct_pid = task_struct_pid; + task_struct_comm = task_struct_comm } | { _ } -> raise (ParseError ("task_struct", "parser_7", "failed to match kernel structure"));; let parser_8 bits = bitmatch bits with - | { state : zero+64 : offset(0), littleendian; - prio : zero+32 : offset(224), littleendian; - static_prio : zero+32 : offset(256), littleendian; - normal_prio : zero+32 : offset(288), littleendian; - tasks'next : zero+64 : offset(2816), littleendian; - tasks'prev : zero+64 : offset(2880), littleendian; - mm : zero+64 : offset(2944), littleendian; - active_mm : zero+64 : offset(3008), littleendian; - comm : 128 : offset(6592), string } -> { state = state; - prio = prio; - static_prio = static_prio; - normal_prio = normal_prio; - tasks'next = (Virt_mem_mmap.unsafe_typed_addr_of_addr (Int64.sub tasks'next 352L) : [ `task_struct ] Virt_mem_mmap.typed_addr); - tasks'prev = (Virt_mem_mmap.unsafe_typed_addr_of_addr (Int64.sub tasks'prev 360L) : [ `task_struct ] Virt_mem_mmap.typed_addr); - mm = (Virt_mem_mmap.unsafe_typed_addr_of_addr mm : [ `mm_struct ] Virt_mem_mmap.typed_addr); - active_mm = (Virt_mem_mmap.unsafe_typed_addr_of_addr active_mm : [ `mm_struct ] Virt_mem_mmap.typed_addr); - comm = comm } + | { task_struct_state : zero+64 : offset(0), littleendian; + task_struct_prio : zero+32 : offset(224), littleendian; + task_struct_static_prio : zero+32 : offset(256), littleendian; + task_struct_normal_prio : zero+32 : offset(288), littleendian; + task_struct_tasks'next : zero+64 : offset(2816), littleendian; + task_struct_tasks'prev : zero+64 : offset(2880), littleendian; + task_struct_mm : zero+64 : offset(2944), littleendian; + task_struct_active_mm : zero+64 : offset(3008), littleendian; + task_struct_pid : zero+32 : offset(3328), littleendian; + task_struct_comm : 128 : offset(6592), string } -> { task_struct_state = task_struct_state; + task_struct_prio = task_struct_prio; + task_struct_static_prio = task_struct_static_prio; + task_struct_normal_prio = task_struct_normal_prio; + task_struct_tasks'next = Int64.sub task_struct_tasks'next 352L; + task_struct_tasks'prev = Int64.sub task_struct_tasks'prev 360L; + task_struct_mm = task_struct_mm; + task_struct_active_mm = task_struct_active_mm; + task_struct_pid = task_struct_pid; + task_struct_comm = task_struct_comm } | { _ } -> raise (ParseError ("task_struct", "parser_8", "failed to match kernel structure"));; let parser_9 bits = bitmatch bits with - | { state : zero+64 : offset(0), bigendian; - prio : zero+32 : offset(224), bigendian; - static_prio : zero+32 : offset(256), bigendian; - normal_prio : zero+32 : offset(288), bigendian; - tasks'next : zero+64 : offset(2880), bigendian; - tasks'prev : zero+64 : offset(2944), bigendian; - mm : zero+64 : offset(3008), bigendian; - active_mm : zero+64 : offset(3072), bigendian; - comm : 128 : offset(6592), string } -> { state = state; - prio = prio; - static_prio = static_prio; - normal_prio = normal_prio; - tasks'next = (Virt_mem_mmap.unsafe_typed_addr_of_addr (Int64.sub tasks'next 360L) : [ `task_struct ] Virt_mem_mmap.typed_addr); - tasks'prev = (Virt_mem_mmap.unsafe_typed_addr_of_addr (Int64.sub tasks'prev 368L) : [ `task_struct ] Virt_mem_mmap.typed_addr); - mm = (Virt_mem_mmap.unsafe_typed_addr_of_addr mm : [ `mm_struct ] Virt_mem_mmap.typed_addr); - active_mm = (Virt_mem_mmap.unsafe_typed_addr_of_addr active_mm : [ `mm_struct ] Virt_mem_mmap.typed_addr); - comm = comm } + | { task_struct_state : zero+64 : offset(0), bigendian; + task_struct_prio : zero+32 : offset(224), bigendian; + task_struct_static_prio : zero+32 : offset(256), bigendian; + task_struct_normal_prio : zero+32 : offset(288), bigendian; + task_struct_tasks'next : zero+64 : offset(2880), bigendian; + task_struct_tasks'prev : zero+64 : offset(2944), bigendian; + task_struct_mm : zero+64 : offset(3008), bigendian; + task_struct_active_mm : zero+64 : offset(3072), bigendian; + task_struct_pid : zero+32 : offset(3392), bigendian; + task_struct_comm : 128 : offset(6592), string } -> { task_struct_state = task_struct_state; + task_struct_prio = task_struct_prio; + task_struct_static_prio = task_struct_static_prio; + task_struct_normal_prio = task_struct_normal_prio; + task_struct_tasks'next = Int64.sub task_struct_tasks'next 360L; + task_struct_tasks'prev = Int64.sub task_struct_tasks'prev 368L; + task_struct_mm = task_struct_mm; + task_struct_active_mm = task_struct_active_mm; + task_struct_pid = task_struct_pid; + task_struct_comm = task_struct_comm } | { _ } -> raise (ParseError ("task_struct", "parser_9", "failed to match kernel structure"));; let parser_10 bits = bitmatch bits with - | { state : zero+32 : offset(0), littleendian; - prio : zero+32 : offset(192), littleendian; - static_prio : zero+32 : offset(224), littleendian; - normal_prio : zero+32 : offset(256), littleendian; - tasks'next : zero+32 : offset(2208), littleendian; - tasks'prev : zero+32 : offset(2240), littleendian; - mm : zero+32 : offset(2400), littleendian; - active_mm : zero+32 : offset(2432), littleendian; - comm : 128 : offset(4608), string } -> { state = state; - prio = prio; - static_prio = static_prio; - normal_prio = normal_prio; - tasks'next = (Virt_mem_mmap.unsafe_typed_addr_of_addr (Int64.sub tasks'next 276L) : [ `task_struct ] Virt_mem_mmap.typed_addr); - tasks'prev = (Virt_mem_mmap.unsafe_typed_addr_of_addr (Int64.sub tasks'prev 280L) : [ `task_struct ] Virt_mem_mmap.typed_addr); - mm = (Virt_mem_mmap.unsafe_typed_addr_of_addr mm : [ `mm_struct ] Virt_mem_mmap.typed_addr); - active_mm = (Virt_mem_mmap.unsafe_typed_addr_of_addr active_mm : [ `mm_struct ] Virt_mem_mmap.typed_addr); - comm = comm } + | { task_struct_state : zero+32 : offset(0), littleendian; + task_struct_prio : zero+32 : offset(192), littleendian; + task_struct_static_prio : zero+32 : offset(224), littleendian; + task_struct_normal_prio : zero+32 : offset(256), littleendian; + task_struct_tasks'next : zero+32 : offset(2208), littleendian; + task_struct_tasks'prev : zero+32 : offset(2240), littleendian; + task_struct_mm : zero+32 : offset(2400), littleendian; + task_struct_active_mm : zero+32 : offset(2432), littleendian; + task_struct_pid : zero+32 : offset(2688), littleendian; + task_struct_comm : 128 : offset(4608), string } -> { task_struct_state = task_struct_state; + task_struct_prio = task_struct_prio; + task_struct_static_prio = task_struct_static_prio; + task_struct_normal_prio = task_struct_normal_prio; + task_struct_tasks'next = Int64.sub task_struct_tasks'next 276L; + task_struct_tasks'prev = Int64.sub task_struct_tasks'prev 280L; + task_struct_mm = task_struct_mm; + task_struct_active_mm = task_struct_active_mm; + task_struct_pid = task_struct_pid; + task_struct_comm = task_struct_comm } | { _ } -> raise (ParseError ("task_struct", "parser_10", "failed to match kernel structure"));; let parser_11 bits = bitmatch bits with - | { state : zero+64 : offset(0), littleendian; - prio : zero+32 : offset(224), littleendian; - static_prio : zero+32 : offset(256), littleendian; - normal_prio : zero+32 : offset(288), littleendian; - tasks'next : zero+64 : offset(3648), littleendian; - tasks'prev : zero+64 : offset(3712), littleendian; - mm : zero+64 : offset(3776), littleendian; - active_mm : zero+64 : offset(3840), littleendian; - comm : 128 : offset(7816), string } -> { state = state; - prio = prio; - static_prio = static_prio; - normal_prio = normal_prio; - tasks'next = (Virt_mem_mmap.unsafe_typed_addr_of_addr (Int64.sub tasks'next 456L) : [ `task_struct ] Virt_mem_mmap.typed_addr); - tasks'prev = (Virt_mem_mmap.unsafe_typed_addr_of_addr (Int64.sub tasks'prev 464L) : [ `task_struct ] Virt_mem_mmap.typed_addr); - mm = (Virt_mem_mmap.unsafe_typed_addr_of_addr mm : [ `mm_struct ] Virt_mem_mmap.typed_addr); - active_mm = (Virt_mem_mmap.unsafe_typed_addr_of_addr active_mm : [ `mm_struct ] Virt_mem_mmap.typed_addr); - comm = comm } + | { task_struct_state : zero+64 : offset(0), littleendian; + task_struct_prio : zero+32 : offset(224), littleendian; + task_struct_static_prio : zero+32 : offset(256), littleendian; + task_struct_normal_prio : zero+32 : offset(288), littleendian; + task_struct_tasks'next : zero+64 : offset(3648), littleendian; + task_struct_tasks'prev : zero+64 : offset(3712), littleendian; + task_struct_mm : zero+64 : offset(3776), littleendian; + task_struct_active_mm : zero+64 : offset(3840), littleendian; + task_struct_pid : zero+32 : offset(4160), littleendian; + task_struct_comm : 128 : offset(7816), string } -> { task_struct_state = task_struct_state; + task_struct_prio = task_struct_prio; + task_struct_static_prio = task_struct_static_prio; + task_struct_normal_prio = task_struct_normal_prio; + task_struct_tasks'next = Int64.sub task_struct_tasks'next 456L; + task_struct_tasks'prev = Int64.sub task_struct_tasks'prev 464L; + task_struct_mm = task_struct_mm; + task_struct_active_mm = task_struct_active_mm; + task_struct_pid = task_struct_pid; + task_struct_comm = task_struct_comm } | { _ } -> raise (ParseError ("task_struct", "parser_11", "failed to match kernel structure"));; let parser_12 bits = bitmatch bits with - | { state : zero+32 : offset(0), bigendian; - prio : zero+32 : offset(192), bigendian; - static_prio : zero+32 : offset(224), bigendian; - normal_prio : zero+32 : offset(256), bigendian; - tasks'next : zero+32 : offset(1024), bigendian; - tasks'prev : zero+32 : offset(1056), bigendian; - mm : zero+32 : offset(1088), bigendian; - active_mm : zero+32 : offset(1120), bigendian; - comm : 128 : offset(3264), string } -> { state = state; - prio = prio; - static_prio = static_prio; - normal_prio = normal_prio; - tasks'next = (Virt_mem_mmap.unsafe_typed_addr_of_addr (Int64.sub tasks'next 128L) : [ `task_struct ] Virt_mem_mmap.typed_addr); - tasks'prev = (Virt_mem_mmap.unsafe_typed_addr_of_addr (Int64.sub tasks'prev 132L) : [ `task_struct ] Virt_mem_mmap.typed_addr); - mm = (Virt_mem_mmap.unsafe_typed_addr_of_addr mm : [ `mm_struct ] Virt_mem_mmap.typed_addr); - active_mm = (Virt_mem_mmap.unsafe_typed_addr_of_addr active_mm : [ `mm_struct ] Virt_mem_mmap.typed_addr); - comm = comm } + | { task_struct_state : zero+32 : offset(0), bigendian; + task_struct_prio : zero+32 : offset(192), bigendian; + task_struct_static_prio : zero+32 : offset(224), bigendian; + task_struct_normal_prio : zero+32 : offset(256), bigendian; + task_struct_tasks'next : zero+32 : offset(1024), bigendian; + task_struct_tasks'prev : zero+32 : offset(1056), bigendian; + task_struct_mm : zero+32 : offset(1088), bigendian; + task_struct_active_mm : zero+32 : offset(1120), bigendian; + task_struct_pid : zero+32 : offset(1376), bigendian; + task_struct_comm : 128 : offset(3264), string } -> { task_struct_state = task_struct_state; + task_struct_prio = task_struct_prio; + task_struct_static_prio = task_struct_static_prio; + task_struct_normal_prio = task_struct_normal_prio; + task_struct_tasks'next = Int64.sub task_struct_tasks'next 128L; + task_struct_tasks'prev = Int64.sub task_struct_tasks'prev 132L; + task_struct_mm = task_struct_mm; + task_struct_active_mm = task_struct_active_mm; + task_struct_pid = task_struct_pid; + task_struct_comm = task_struct_comm } | { _ } -> raise (ParseError ("task_struct", "parser_12", "failed to match kernel structure"));; let parser_13 bits = bitmatch bits with - | { state : zero+64 : offset(0), littleendian; - prio : zero+32 : offset(224), littleendian; - static_prio : zero+32 : offset(256), littleendian; - normal_prio : zero+32 : offset(288), littleendian; - tasks'next : zero+64 : offset(3840), littleendian; - tasks'prev : zero+64 : offset(3904), littleendian; - mm : zero+64 : offset(3968), littleendian; - active_mm : zero+64 : offset(4032), littleendian; - comm : 128 : offset(8392), string } -> { state = state; - prio = prio; - static_prio = static_prio; - normal_prio = normal_prio; - tasks'next = (Virt_mem_mmap.unsafe_typed_addr_of_addr (Int64.sub tasks'next 480L) : [ `task_struct ] Virt_mem_mmap.typed_addr); - tasks'prev = (Virt_mem_mmap.unsafe_typed_addr_of_addr (Int64.sub tasks'prev 488L) : [ `task_struct ] Virt_mem_mmap.typed_addr); - mm = (Virt_mem_mmap.unsafe_typed_addr_of_addr mm : [ `mm_struct ] Virt_mem_mmap.typed_addr); - active_mm = (Virt_mem_mmap.unsafe_typed_addr_of_addr active_mm : [ `mm_struct ] Virt_mem_mmap.typed_addr); - comm = comm } + | { task_struct_state : zero+64 : offset(0), littleendian; + task_struct_prio : zero+32 : offset(224), littleendian; + task_struct_static_prio : zero+32 : offset(256), littleendian; + task_struct_normal_prio : zero+32 : offset(288), littleendian; + task_struct_tasks'next : zero+64 : offset(3840), littleendian; + task_struct_tasks'prev : zero+64 : offset(3904), littleendian; + task_struct_mm : zero+64 : offset(3968), littleendian; + task_struct_active_mm : zero+64 : offset(4032), littleendian; + task_struct_pid : zero+32 : offset(4352), littleendian; + task_struct_comm : 128 : offset(8392), string } -> { task_struct_state = task_struct_state; + task_struct_prio = task_struct_prio; + task_struct_static_prio = task_struct_static_prio; + task_struct_normal_prio = task_struct_normal_prio; + task_struct_tasks'next = Int64.sub task_struct_tasks'next 480L; + task_struct_tasks'prev = Int64.sub task_struct_tasks'prev 488L; + task_struct_mm = task_struct_mm; + task_struct_active_mm = task_struct_active_mm; + task_struct_pid = task_struct_pid; + task_struct_comm = task_struct_comm } | { _ } -> raise (ParseError ("task_struct", "parser_13", "failed to match kernel structure"));; let parser_14 bits = bitmatch bits with - | { state : zero+32 : offset(0), littleendian; - prio : zero+32 : offset(160), littleendian; - static_prio : zero+32 : offset(192), littleendian; - normal_prio : zero+32 : offset(224), littleendian; - tasks'next : zero+32 : offset(3008), littleendian; - tasks'prev : zero+32 : offset(3040), littleendian; - mm : zero+32 : offset(3072), littleendian; - active_mm : zero+32 : offset(3104), littleendian; - comm : 128 : offset(5416), string } -> { state = state; - prio = prio; - static_prio = static_prio; - normal_prio = normal_prio; - tasks'next = (Virt_mem_mmap.unsafe_typed_addr_of_addr (Int64.sub tasks'next 376L) : [ `task_struct ] Virt_mem_mmap.typed_addr); - tasks'prev = (Virt_mem_mmap.unsafe_typed_addr_of_addr (Int64.sub tasks'prev 380L) : [ `task_struct ] Virt_mem_mmap.typed_addr); - mm = (Virt_mem_mmap.unsafe_typed_addr_of_addr mm : [ `mm_struct ] Virt_mem_mmap.typed_addr); - active_mm = (Virt_mem_mmap.unsafe_typed_addr_of_addr active_mm : [ `mm_struct ] Virt_mem_mmap.typed_addr); - comm = comm } + | { task_struct_state : zero+32 : offset(0), littleendian; + task_struct_prio : zero+32 : offset(160), littleendian; + task_struct_static_prio : zero+32 : offset(192), littleendian; + task_struct_normal_prio : zero+32 : offset(224), littleendian; + task_struct_tasks'next : zero+32 : offset(3008), littleendian; + task_struct_tasks'prev : zero+32 : offset(3040), littleendian; + task_struct_mm : zero+32 : offset(3072), littleendian; + task_struct_active_mm : zero+32 : offset(3104), littleendian; + task_struct_pid : zero+32 : offset(3360), littleendian; + task_struct_comm : 128 : offset(5416), string } -> { task_struct_state = task_struct_state; + task_struct_prio = task_struct_prio; + task_struct_static_prio = task_struct_static_prio; + task_struct_normal_prio = task_struct_normal_prio; + task_struct_tasks'next = Int64.sub task_struct_tasks'next 376L; + task_struct_tasks'prev = Int64.sub task_struct_tasks'prev 380L; + task_struct_mm = task_struct_mm; + task_struct_active_mm = task_struct_active_mm; + task_struct_pid = task_struct_pid; + task_struct_comm = task_struct_comm } | { _ } -> raise (ParseError ("task_struct", "parser_14", "failed to match kernel structure"));; let parser_15 bits = bitmatch bits with - | { state : zero+32 : offset(0), littleendian; - prio : zero+32 : offset(160), littleendian; - static_prio : zero+32 : offset(192), littleendian; - normal_prio : zero+32 : offset(224), littleendian; - tasks'next : zero+32 : offset(2144), littleendian; - tasks'prev : zero+32 : offset(2176), littleendian; - mm : zero+32 : offset(2208), littleendian; - active_mm : zero+32 : offset(2240), littleendian; - comm : 128 : offset(4384), string } -> { state = state; - prio = prio; - static_prio = static_prio; - normal_prio = normal_prio; - tasks'next = (Virt_mem_mmap.unsafe_typed_addr_of_addr (Int64.sub tasks'next 268L) : [ `task_struct ] Virt_mem_mmap.typed_addr); - tasks'prev = (Virt_mem_mmap.unsafe_typed_addr_of_addr (Int64.sub tasks'prev 272L) : [ `task_struct ] Virt_mem_mmap.typed_addr); - mm = (Virt_mem_mmap.unsafe_typed_addr_of_addr mm : [ `mm_struct ] Virt_mem_mmap.typed_addr); - active_mm = (Virt_mem_mmap.unsafe_typed_addr_of_addr active_mm : [ `mm_struct ] Virt_mem_mmap.typed_addr); - comm = comm } + | { task_struct_state : zero+32 : offset(0), littleendian; + task_struct_prio : zero+32 : offset(160), littleendian; + task_struct_static_prio : zero+32 : offset(192), littleendian; + task_struct_normal_prio : zero+32 : offset(224), littleendian; + task_struct_tasks'next : zero+32 : offset(2144), littleendian; + task_struct_tasks'prev : zero+32 : offset(2176), littleendian; + task_struct_mm : zero+32 : offset(2208), littleendian; + task_struct_active_mm : zero+32 : offset(2240), littleendian; + task_struct_pid : zero+32 : offset(2496), littleendian; + task_struct_comm : 128 : offset(4384), string } -> { task_struct_state = task_struct_state; + task_struct_prio = task_struct_prio; + task_struct_static_prio = task_struct_static_prio; + task_struct_normal_prio = task_struct_normal_prio; + task_struct_tasks'next = Int64.sub task_struct_tasks'next 268L; + task_struct_tasks'prev = Int64.sub task_struct_tasks'prev 272L; + task_struct_mm = task_struct_mm; + task_struct_active_mm = task_struct_active_mm; + task_struct_pid = task_struct_pid; + task_struct_comm = task_struct_comm } | { _ } -> raise (ParseError ("task_struct", "parser_15", "failed to match kernel structure"));; let parser_16 bits = bitmatch bits with - | { state : zero+64 : offset(0), bigendian; - prio : zero+32 : offset(256), bigendian; - static_prio : zero+32 : offset(288), bigendian; - normal_prio : zero+32 : offset(320), bigendian; - tasks'next : zero+64 : offset(2880), bigendian; - tasks'prev : zero+64 : offset(2944), bigendian; - mm : zero+64 : offset(3264), bigendian; - active_mm : zero+64 : offset(3328), bigendian; - comm : 128 : offset(6912), string } -> { state = state; - prio = prio; - static_prio = static_prio; - normal_prio = normal_prio; - tasks'next = (Virt_mem_mmap.unsafe_typed_addr_of_addr (Int64.sub tasks'next 360L) : [ `task_struct ] Virt_mem_mmap.typed_addr); - tasks'prev = (Virt_mem_mmap.unsafe_typed_addr_of_addr (Int64.sub tasks'prev 368L) : [ `task_struct ] Virt_mem_mmap.typed_addr); - mm = (Virt_mem_mmap.unsafe_typed_addr_of_addr mm : [ `mm_struct ] Virt_mem_mmap.typed_addr); - active_mm = (Virt_mem_mmap.unsafe_typed_addr_of_addr active_mm : [ `mm_struct ] Virt_mem_mmap.typed_addr); - comm = comm } + | { task_struct_state : zero+64 : offset(0), bigendian; + task_struct_prio : zero+32 : offset(256), bigendian; + task_struct_static_prio : zero+32 : offset(288), bigendian; + task_struct_normal_prio : zero+32 : offset(320), bigendian; + task_struct_tasks'next : zero+64 : offset(2880), bigendian; + task_struct_tasks'prev : zero+64 : offset(2944), bigendian; + task_struct_mm : zero+64 : offset(3264), bigendian; + task_struct_active_mm : zero+64 : offset(3328), bigendian; + task_struct_pid : zero+32 : offset(3648), bigendian; + task_struct_comm : 128 : offset(6912), string } -> { task_struct_state = task_struct_state; + task_struct_prio = task_struct_prio; + task_struct_static_prio = task_struct_static_prio; + task_struct_normal_prio = task_struct_normal_prio; + task_struct_tasks'next = Int64.sub task_struct_tasks'next 360L; + task_struct_tasks'prev = Int64.sub task_struct_tasks'prev 368L; + task_struct_mm = task_struct_mm; + task_struct_active_mm = task_struct_active_mm; + task_struct_pid = task_struct_pid; + task_struct_comm = task_struct_comm } | { _ } -> raise (ParseError ("task_struct", "parser_16", "failed to match kernel structure"));; let parser_17 bits = bitmatch bits with - | { state : zero+32 : offset(0), bigendian; - prio : zero+32 : offset(160), bigendian; - static_prio : zero+32 : offset(192), bigendian; - normal_prio : zero+32 : offset(224), bigendian; - tasks'next : zero+32 : offset(3136), bigendian; - tasks'prev : zero+32 : offset(3168), bigendian; - mm : zero+32 : offset(3200), bigendian; - active_mm : zero+32 : offset(3232), bigendian; - comm : 128 : offset(5576), string } -> { state = state; - prio = prio; - static_prio = static_prio; - normal_prio = normal_prio; - tasks'next = (Virt_mem_mmap.unsafe_typed_addr_of_addr (Int64.sub tasks'next 392L) : [ `task_struct ] Virt_mem_mmap.typed_addr); - tasks'prev = (Virt_mem_mmap.unsafe_typed_addr_of_addr (Int64.sub tasks'prev 396L) : [ `task_struct ] Virt_mem_mmap.typed_addr); - mm = (Virt_mem_mmap.unsafe_typed_addr_of_addr mm : [ `mm_struct ] Virt_mem_mmap.typed_addr); - active_mm = (Virt_mem_mmap.unsafe_typed_addr_of_addr active_mm : [ `mm_struct ] Virt_mem_mmap.typed_addr); - comm = comm } + | { task_struct_state : zero+32 : offset(0), bigendian; + task_struct_prio : zero+32 : offset(160), bigendian; + task_struct_static_prio : zero+32 : offset(192), bigendian; + task_struct_normal_prio : zero+32 : offset(224), bigendian; + task_struct_tasks'next : zero+32 : offset(3136), bigendian; + task_struct_tasks'prev : zero+32 : offset(3168), bigendian; + task_struct_mm : zero+32 : offset(3200), bigendian; + task_struct_active_mm : zero+32 : offset(3232), bigendian; + task_struct_pid : zero+32 : offset(3488), bigendian; + task_struct_comm : 128 : offset(5576), string } -> { task_struct_state = task_struct_state; + task_struct_prio = task_struct_prio; + task_struct_static_prio = task_struct_static_prio; + task_struct_normal_prio = task_struct_normal_prio; + task_struct_tasks'next = Int64.sub task_struct_tasks'next 392L; + task_struct_tasks'prev = Int64.sub task_struct_tasks'prev 396L; + task_struct_mm = task_struct_mm; + task_struct_active_mm = task_struct_active_mm; + task_struct_pid = task_struct_pid; + task_struct_comm = task_struct_comm } | { _ } -> raise (ParseError ("task_struct", "parser_17", "failed to match kernel structure"));; let parser_18 bits = bitmatch bits with - | { state : zero+64 : offset(0), bigendian; - prio : zero+32 : offset(224), bigendian; - static_prio : zero+32 : offset(256), bigendian; - normal_prio : zero+32 : offset(288), bigendian; - tasks'next : zero+64 : offset(3648), bigendian; - tasks'prev : zero+64 : offset(3712), bigendian; - mm : zero+64 : offset(3776), bigendian; - active_mm : zero+64 : offset(3840), bigendian; - comm : 128 : offset(7752), string } -> { state = state; - prio = prio; - static_prio = static_prio; - normal_prio = normal_prio; - tasks'next = (Virt_mem_mmap.unsafe_typed_addr_of_addr (Int64.sub tasks'next 456L) : [ `task_struct ] Virt_mem_mmap.typed_addr); - tasks'prev = (Virt_mem_mmap.unsafe_typed_addr_of_addr (Int64.sub tasks'prev 464L) : [ `task_struct ] Virt_mem_mmap.typed_addr); - mm = (Virt_mem_mmap.unsafe_typed_addr_of_addr mm : [ `mm_struct ] Virt_mem_mmap.typed_addr); - active_mm = (Virt_mem_mmap.unsafe_typed_addr_of_addr active_mm : [ `mm_struct ] Virt_mem_mmap.typed_addr); - comm = comm } + | { task_struct_state : zero+64 : offset(0), bigendian; + task_struct_prio : zero+32 : offset(224), bigendian; + task_struct_static_prio : zero+32 : offset(256), bigendian; + task_struct_normal_prio : zero+32 : offset(288), bigendian; + task_struct_tasks'next : zero+64 : offset(3648), bigendian; + task_struct_tasks'prev : zero+64 : offset(3712), bigendian; + task_struct_mm : zero+64 : offset(3776), bigendian; + task_struct_active_mm : zero+64 : offset(3840), bigendian; + task_struct_pid : zero+32 : offset(4160), bigendian; + task_struct_comm : 128 : offset(7752), string } -> { task_struct_state = task_struct_state; + task_struct_prio = task_struct_prio; + task_struct_static_prio = task_struct_static_prio; + task_struct_normal_prio = task_struct_normal_prio; + task_struct_tasks'next = Int64.sub task_struct_tasks'next 456L; + task_struct_tasks'prev = Int64.sub task_struct_tasks'prev 464L; + task_struct_mm = task_struct_mm; + task_struct_active_mm = task_struct_active_mm; + task_struct_pid = task_struct_pid; + task_struct_comm = task_struct_comm } | { _ } -> raise (ParseError ("task_struct", "parser_18", "failed to match kernel structure"));; let parser_19 bits = bitmatch bits with - | { state : zero+64 : offset(0), littleendian; - prio : zero+32 : offset(320), littleendian; - static_prio : zero+32 : offset(352), littleendian; - normal_prio : zero+32 : offset(384), littleendian; - tasks'next : zero+64 : offset(1728), littleendian; - tasks'prev : zero+64 : offset(1792), littleendian; - mm : zero+64 : offset(1856), littleendian; - active_mm : zero+64 : offset(1920), littleendian; - comm : 128 : offset(5568), string } -> { state = state; - prio = prio; - static_prio = static_prio; - normal_prio = normal_prio; - tasks'next = (Virt_mem_mmap.unsafe_typed_addr_of_addr (Int64.sub tasks'next 216L) : [ `task_struct ] Virt_mem_mmap.typed_addr); - tasks'prev = (Virt_mem_mmap.unsafe_typed_addr_of_addr (Int64.sub tasks'prev 224L) : [ `task_struct ] Virt_mem_mmap.typed_addr); - mm = (Virt_mem_mmap.unsafe_typed_addr_of_addr mm : [ `mm_struct ] Virt_mem_mmap.typed_addr); - active_mm = (Virt_mem_mmap.unsafe_typed_addr_of_addr active_mm : [ `mm_struct ] Virt_mem_mmap.typed_addr); - comm = comm } + | { task_struct_state : zero+64 : offset(0), littleendian; + task_struct_prio : zero+32 : offset(320), littleendian; + task_struct_static_prio : zero+32 : offset(352), littleendian; + task_struct_normal_prio : zero+32 : offset(384), littleendian; + task_struct_tasks'next : zero+64 : offset(1728), littleendian; + task_struct_tasks'prev : zero+64 : offset(1792), littleendian; + task_struct_mm : zero+64 : offset(1856), littleendian; + task_struct_active_mm : zero+64 : offset(1920), littleendian; + task_struct_pid : zero+32 : offset(2336), littleendian; + task_struct_comm : 128 : offset(5568), string } -> { task_struct_state = task_struct_state; + task_struct_prio = task_struct_prio; + task_struct_static_prio = task_struct_static_prio; + task_struct_normal_prio = task_struct_normal_prio; + task_struct_tasks'next = Int64.sub task_struct_tasks'next 216L; + task_struct_tasks'prev = Int64.sub task_struct_tasks'prev 224L; + task_struct_mm = task_struct_mm; + task_struct_active_mm = task_struct_active_mm; + task_struct_pid = task_struct_pid; + task_struct_comm = task_struct_comm } | { _ } -> raise (ParseError ("task_struct", "parser_19", "failed to match kernel structure"));; let parser_20 bits = bitmatch bits with - | { state : zero+32 : offset(0), littleendian; - prio : zero+32 : offset(160), littleendian; - static_prio : zero+32 : offset(192), littleendian; - normal_prio : zero+32 : offset(224), littleendian; - tasks'next : zero+32 : offset(3232), littleendian; - tasks'prev : zero+32 : offset(3264), littleendian; - mm : zero+32 : offset(3296), littleendian; - active_mm : zero+32 : offset(3328), littleendian; - comm : 128 : offset(5928), string } -> { state = state; - prio = prio; - static_prio = static_prio; - normal_prio = normal_prio; - tasks'next = (Virt_mem_mmap.unsafe_typed_addr_of_addr (Int64.sub tasks'next 404L) : [ `task_struct ] Virt_mem_mmap.typed_addr); - tasks'prev = (Virt_mem_mmap.unsafe_typed_addr_of_addr (Int64.sub tasks'prev 408L) : [ `task_struct ] Virt_mem_mmap.typed_addr); - mm = (Virt_mem_mmap.unsafe_typed_addr_of_addr mm : [ `mm_struct ] Virt_mem_mmap.typed_addr); - active_mm = (Virt_mem_mmap.unsafe_typed_addr_of_addr active_mm : [ `mm_struct ] Virt_mem_mmap.typed_addr); - comm = comm } + | { task_struct_state : zero+32 : offset(0), littleendian; + task_struct_prio : zero+32 : offset(160), littleendian; + task_struct_static_prio : zero+32 : offset(192), littleendian; + task_struct_normal_prio : zero+32 : offset(224), littleendian; + task_struct_tasks'next : zero+32 : offset(3232), littleendian; + task_struct_tasks'prev : zero+32 : offset(3264), littleendian; + task_struct_mm : zero+32 : offset(3296), littleendian; + task_struct_active_mm : zero+32 : offset(3328), littleendian; + task_struct_pid : zero+32 : offset(3584), littleendian; + task_struct_comm : 128 : offset(5928), string } -> { task_struct_state = task_struct_state; + task_struct_prio = task_struct_prio; + task_struct_static_prio = task_struct_static_prio; + task_struct_normal_prio = task_struct_normal_prio; + task_struct_tasks'next = Int64.sub task_struct_tasks'next 404L; + task_struct_tasks'prev = Int64.sub task_struct_tasks'prev 408L; + task_struct_mm = task_struct_mm; + task_struct_active_mm = task_struct_active_mm; + task_struct_pid = task_struct_pid; + task_struct_comm = task_struct_comm } | { _ } -> raise (ParseError ("task_struct", "parser_20", "failed to match kernel structure"));; let parser_21 bits = bitmatch bits with - | { state : zero+64 : offset(0), littleendian; - prio : zero+32 : offset(256), littleendian; - static_prio : zero+32 : offset(288), littleendian; - normal_prio : zero+32 : offset(320), littleendian; - tasks'next : zero+64 : offset(1408), littleendian; - tasks'prev : zero+64 : offset(1472), littleendian; - mm : zero+64 : offset(1536), littleendian; - active_mm : zero+64 : offset(1600), littleendian; - comm : 128 : offset(5184), string } -> { state = state; - prio = prio; - static_prio = static_prio; - normal_prio = normal_prio; - tasks'next = (Virt_mem_mmap.unsafe_typed_addr_of_addr (Int64.sub tasks'next 176L) : [ `task_struct ] Virt_mem_mmap.typed_addr); - tasks'prev = (Virt_mem_mmap.unsafe_typed_addr_of_addr (Int64.sub tasks'prev 184L) : [ `task_struct ] Virt_mem_mmap.typed_addr); - mm = (Virt_mem_mmap.unsafe_typed_addr_of_addr mm : [ `mm_struct ] Virt_mem_mmap.typed_addr); - active_mm = (Virt_mem_mmap.unsafe_typed_addr_of_addr active_mm : [ `mm_struct ] Virt_mem_mmap.typed_addr); - comm = comm } + | { task_struct_state : zero+64 : offset(0), littleendian; + task_struct_prio : zero+32 : offset(256), littleendian; + task_struct_static_prio : zero+32 : offset(288), littleendian; + task_struct_normal_prio : zero+32 : offset(320), littleendian; + task_struct_tasks'next : zero+64 : offset(1408), littleendian; + task_struct_tasks'prev : zero+64 : offset(1472), littleendian; + task_struct_mm : zero+64 : offset(1536), littleendian; + task_struct_active_mm : zero+64 : offset(1600), littleendian; + task_struct_pid : zero+32 : offset(1920), littleendian; + task_struct_comm : 128 : offset(5184), string } -> { task_struct_state = task_struct_state; + task_struct_prio = task_struct_prio; + task_struct_static_prio = task_struct_static_prio; + task_struct_normal_prio = task_struct_normal_prio; + task_struct_tasks'next = Int64.sub task_struct_tasks'next 176L; + task_struct_tasks'prev = Int64.sub task_struct_tasks'prev 184L; + task_struct_mm = task_struct_mm; + task_struct_active_mm = task_struct_active_mm; + task_struct_pid = task_struct_pid; + task_struct_comm = task_struct_comm } | { _ } -> raise (ParseError ("task_struct", "parser_21", "failed to match kernel structure"));; let parser_22 bits = bitmatch bits with - | { state : zero+64 : offset(0), bigendian; - prio : zero+32 : offset(256), bigendian; - static_prio : zero+32 : offset(288), bigendian; - normal_prio : zero+32 : offset(320), bigendian; - tasks'next : zero+64 : offset(1472), bigendian; - tasks'prev : zero+64 : offset(1536), bigendian; - mm : zero+64 : offset(1600), bigendian; - active_mm : zero+64 : offset(1664), bigendian; - comm : 128 : offset(5184), string } -> { state = state; - prio = prio; - static_prio = static_prio; - normal_prio = normal_prio; - tasks'next = (Virt_mem_mmap.unsafe_typed_addr_of_addr (Int64.sub tasks'next 184L) : [ `task_struct ] Virt_mem_mmap.typed_addr); - tasks'prev = (Virt_mem_mmap.unsafe_typed_addr_of_addr (Int64.sub tasks'prev 192L) : [ `task_struct ] Virt_mem_mmap.typed_addr); - mm = (Virt_mem_mmap.unsafe_typed_addr_of_addr mm : [ `mm_struct ] Virt_mem_mmap.typed_addr); - active_mm = (Virt_mem_mmap.unsafe_typed_addr_of_addr active_mm : [ `mm_struct ] Virt_mem_mmap.typed_addr); - comm = comm } + | { task_struct_state : zero+64 : offset(0), bigendian; + task_struct_prio : zero+32 : offset(256), bigendian; + task_struct_static_prio : zero+32 : offset(288), bigendian; + task_struct_normal_prio : zero+32 : offset(320), bigendian; + task_struct_tasks'next : zero+64 : offset(1472), bigendian; + task_struct_tasks'prev : zero+64 : offset(1536), bigendian; + task_struct_mm : zero+64 : offset(1600), bigendian; + task_struct_active_mm : zero+64 : offset(1664), bigendian; + task_struct_pid : zero+32 : offset(1984), bigendian; + task_struct_comm : 128 : offset(5184), string } -> { task_struct_state = task_struct_state; + task_struct_prio = task_struct_prio; + task_struct_static_prio = task_struct_static_prio; + task_struct_normal_prio = task_struct_normal_prio; + task_struct_tasks'next = Int64.sub task_struct_tasks'next 184L; + task_struct_tasks'prev = Int64.sub task_struct_tasks'prev 192L; + task_struct_mm = task_struct_mm; + task_struct_active_mm = task_struct_active_mm; + task_struct_pid = task_struct_pid; + task_struct_comm = task_struct_comm } | { _ } -> raise (ParseError ("task_struct", "parser_22", "failed to match kernel structure"));; module StringMap = Map.Make(String);; let map = StringMap.empty;; @@ -535,6 +580,8 @@ let v = (parser_6, 2112);; let map = StringMap.add "2.6.20-1.2933.fc6.ppc64" v map;; let v = (parser_2, 1772);; let map = StringMap.add "2.6.22-0.23.rc7.git6.fc8.ppc" v map;; +let v = (parser_17, 1936);; +let map = StringMap.add "2.6.24-7.fc9.ppc" v map;; let v = (parser_12, 1612);; let map = StringMap.add "2.6.21-1.3209.fc8.ppc" v map;; let v = (parser_7, 1920);; @@ -625,13 +672,15 @@ let v = (parser_1, 2704);; let map = StringMap.add "2.6.20-1.2933.fc6.i686" v map;; let v = (parser_22, 2116);; let map = StringMap.add "2.6.21-1.3209.fc8.ppc64" v map;; +let v = (parser_1, 2704);; +let map = StringMap.add "2.6.21-1.3132.fc7.i686" v map;; type kernel_version = string;; -let known version = StringMap.mem version map;; -let size version = let (_, size) = StringMap.find version map in size;; -let of_bits version bits = +let task_struct_known version = StringMap.mem version map;; +let task_struct_size version = + let (_, size) = StringMap.find version map in size;; +let task_struct_of_bits version bits = let (parsefn, _) = StringMap.find version map in parsefn bits;; -let get version mem addr = +let get_task_struct version mem addr = let (parsefn, size) = StringMap.find version map in - let addr = Virt_mem_mmap.unsafe_addr_of_typed_addr addr in let bytes = Virt_mem_mmap.get_bytes mem addr size in let bits = Bitstring.bitstring_of_string bytes in parsefn bits;; diff --git a/lib/kernel_task_struct.mli b/lib/kernel_task_struct.mli index 2247c6f..8cbdae4 100644 --- a/lib/kernel_task_struct.mli +++ b/lib/kernel_task_struct.mli @@ -1,16 +1,16 @@ exception ParseError of string * string * string;; type t = - { active_mm : [ | `mm_struct ] Virt_mem_mmap.typed_addr; comm : string; - mm : [ | `mm_struct ] Virt_mem_mmap.typed_addr; normal_prio : int64; - prio : int64; state : int64; static_prio : int64; - tasks'next : [ | `task_struct ] Virt_mem_mmap.typed_addr; - tasks'prev : [ | `task_struct ] Virt_mem_mmap.typed_addr + { task_struct_active_mm : Virt_mem_mmap.addr; task_struct_comm : string; + task_struct_mm : Virt_mem_mmap.addr; task_struct_normal_prio : int64; + task_struct_pid : int64; task_struct_prio : int64; + task_struct_state : int64; task_struct_static_prio : int64; + task_struct_tasks'next : Virt_mem_mmap.addr; + task_struct_tasks'prev : Virt_mem_mmap.addr };; type kernel_version = string;; -val known : kernel_version -> bool;; -val size : kernel_version -> int;; -val of_bits : kernel_version -> Bitstring.bitstring -> t;; -val get : +val task_struct_known : kernel_version -> bool;; +val task_struct_size : kernel_version -> int;; +val task_struct_of_bits : kernel_version -> Bitstring.bitstring -> t;; +val get_task_struct : kernel_version -> - ('a, 'b, [ | `HasMapping ]) Virt_mem_mmap.t -> - [ | `task_struct ] Virt_mem_mmap.typed_addr -> t;; + ('a, 'b, [ | `HasMapping ]) Virt_mem_mmap.t -> Virt_mem_mmap.addr -> t;;