sdfgen 0.16.1__cp311-cp311-macosx_13_0_x86_64.whl → 0.17.0__cp311-cp311-macosx_13_0_x86_64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Binary file
Binary file
libcsdfgen.0.dylib CHANGED
Binary file
libcsdfgen.dylib CHANGED
Binary file
sdfgen/module.py CHANGED
@@ -7,6 +7,7 @@ from ctypes import (
7
7
  from typing import Optional, List, Tuple
8
8
  from enum import IntEnum
9
9
 
10
+
10
11
  class SddfStatus(IntEnum):
11
12
  OK = 0,
12
13
  DUPLICATE_CLIENT = 1,
@@ -14,6 +15,7 @@ class SddfStatus(IntEnum):
14
15
  NET_DUPLICATE_COPIER = 100,
15
16
  NET_DUPLICATE_MAC_ADDR = 101,
16
17
 
18
+
17
19
  # TOOD: double check
18
20
  MapPermsType = c_uint32
19
21
 
@@ -196,15 +198,32 @@ libsdfgen.sdfgen_sddf_gpu_serialise_config.restype = c_bool
196
198
  libsdfgen.sdfgen_sddf_gpu_serialise_config.argtypes = [c_void_p, c_char_p]
197
199
 
198
200
  libsdfgen.sdfgen_vmm.restype = c_void_p
199
- libsdfgen.sdfgen_vmm.argtypes = [c_void_p, c_void_p, c_void_p, c_void_p, c_uint64, c_bool]
201
+ libsdfgen.sdfgen_vmm.argtypes = [
202
+ c_void_p,
203
+ c_void_p,
204
+ c_void_p,
205
+ c_void_p,
206
+ c_uint64,
207
+ c_bool
208
+ ]
200
209
  libsdfgen.sdfgen_vmm_add_passthrough_device.restype = c_bool
201
- libsdfgen.sdfgen_vmm_add_passthrough_device.argtypes = [c_void_p, c_char_p, c_void_p, POINTER(c_uint8), c_uint8]
210
+ libsdfgen.sdfgen_vmm_add_passthrough_device.argtypes = [
211
+ c_void_p,
212
+ c_char_p,
213
+ c_void_p,
214
+ POINTER(c_uint8),
215
+ c_uint8,
216
+ POINTER(c_uint8),
217
+ c_uint8
218
+ ]
202
219
  libsdfgen.sdfgen_vmm_add_passthrough_irq.restype = c_bool
203
220
  libsdfgen.sdfgen_vmm_add_passthrough_irq.argtypes = [c_void_p, c_void_p]
204
221
  libsdfgen.sdfgen_vmm_add_virtio_mmio_console.restype = c_bool
205
222
  libsdfgen.sdfgen_vmm_add_virtio_mmio_console.argtypes = [c_void_p, c_void_p, c_void_p]
206
223
  libsdfgen.sdfgen_vmm_add_virtio_mmio_blk.restype = c_bool
207
224
  libsdfgen.sdfgen_vmm_add_virtio_mmio_blk.argtypes = [c_void_p, c_void_p, c_void_p, c_uint32]
225
+ libsdfgen.sdfgen_vmm_add_virtio_mmio_net.restype = c_bool
226
+ libsdfgen.sdfgen_vmm_add_virtio_mmio_net.argtypes = [c_void_p, c_void_p, c_void_p, c_void_p, c_char_p]
208
227
  libsdfgen.sdfgen_vmm_connect.restype = c_bool
209
228
  libsdfgen.sdfgen_vmm_connect.argtypes = [c_void_p]
210
229
  libsdfgen.sdfgen_vmm_serialise_config.restype = c_bool
@@ -217,7 +236,18 @@ libsdfgen.sdfgen_lionsos_fs_fat_connect.argtypes = [c_void_p]
217
236
  libsdfgen.sdfgen_lionsos_fs_fat_serialise_config.restype = c_bool
218
237
  libsdfgen.sdfgen_lionsos_fs_fat_serialise_config.argtypes = [c_void_p, c_char_p]
219
238
  libsdfgen.sdfgen_lionsos_fs_nfs.restype = c_void_p
220
- libsdfgen.sdfgen_lionsos_fs_nfs.argtypes = [c_void_p, c_void_p, c_void_p, c_void_p, c_void_p, c_char_p, c_void_p, c_void_p, c_char_p, c_char_p]
239
+ libsdfgen.sdfgen_lionsos_fs_nfs.argtypes = [
240
+ c_void_p,
241
+ c_void_p,
242
+ c_void_p,
243
+ c_void_p,
244
+ c_void_p,
245
+ c_char_p,
246
+ c_void_p,
247
+ c_void_p,
248
+ c_char_p,
249
+ c_char_p
250
+ ]
221
251
  libsdfgen.sdfgen_lionsos_fs_nfs_connect.restype = c_bool
222
252
  libsdfgen.sdfgen_lionsos_fs_nfs_connect.argtypes = [c_void_p]
223
253
  libsdfgen.sdfgen_lionsos_fs_nfs_serialise_config.restype = c_bool
@@ -230,6 +260,7 @@ libsdfgen.sdfgen_sddf_lwip_connect.argtypes = [c_void_p]
230
260
  libsdfgen.sdfgen_sddf_lwip_serialise_config.restype = c_bool
231
261
  libsdfgen.sdfgen_sddf_lwip_serialise_config.argtypes = [c_void_p, c_char_p]
232
262
 
263
+
233
264
  class DeviceTree:
234
265
  """
235
266
  This class exists to allow other layers to be generic to boards or architectures
@@ -367,7 +398,7 @@ class SystemDescription:
367
398
  def add_map(self, map: SystemDescription.Map):
368
399
  libsdfgen.sdfgen_pd_add_map(self._obj, map._obj)
369
400
 
370
- def add_irq(self, map: SystemDescription.Irq) -> int:
401
+ def add_irq(self, irq: SystemDescription.Irq) -> int:
371
402
  return libsdfgen.sdfgen_pd_add_irq(self._obj, irq._obj)
372
403
 
373
404
  def set_virtual_machine(self, vm: SystemDescription.VirtualMachine):
@@ -381,8 +412,8 @@ class SystemDescription:
381
412
  def __repr__(self) -> str:
382
413
  return f"ProtectionDomain({self.name})"
383
414
 
384
- # TODO: __del__ is more complicated for virtual machine since it may be owned by a protection domain
385
- # meaning it would result in a double free
415
+ # TODO: __del__ is more complicated for virtual machine since it may be owned
416
+ # by a protection domain meaning it would result in a double free
386
417
  class VirtualMachine:
387
418
  _name: str
388
419
  _obj: c_void_p
@@ -713,7 +744,9 @@ class Sddf:
713
744
  :param mac_addr: must be unique to the Network system.
714
745
  """
715
746
  if mac_addr is not None and len(mac_addr) != 17:
716
- raise Exception(f"invalid MAC address length for client '{client.name}', {mac_addr}")
747
+ raise Exception(
748
+ f"invalid MAC address length for client '{client.name}', {mac_addr}"
749
+ )
717
750
 
718
751
  c_mac_addr = c_char_p(0)
719
752
  if mac_addr is not None:
@@ -818,45 +851,66 @@ class Sddf:
818
851
 
819
852
  def __del__(self):
820
853
  libsdfgen.sdfgen_sddf_gpu_destroy(self._obj)
821
-
854
+
822
855
  class Lwip:
823
856
  _obj: c_void_p
824
857
 
825
858
  def __init__(
826
859
  self,
827
860
  sdf: SystemDescription,
828
- net: Net,
829
- pd: ProtectionDomain
861
+ net: Sddf.Net,
862
+ pd: SystemDescription.ProtectionDomain
830
863
  ) -> None:
831
864
  self._obj = libsdfgen.sdfgen_sddf_lwip(sdf._obj, net._obj, pd._obj)
832
-
865
+
833
866
  def connect(self) -> bool:
834
867
  return libsdfgen.sdfgen_sddf_lwip_connect(self._obj)
835
-
868
+
836
869
  def serialise_config(self, output_dir: str) -> bool:
837
870
  c_output_dir = c_char_p(output_dir.encode("utf-8"))
838
871
  return libsdfgen.sdfgen_sddf_lwip_serialise_config(self._obj, c_output_dir)
839
872
 
873
+
840
874
  class Vmm:
841
875
  _obj: c_void_p
842
876
 
843
877
  def __init__(
844
878
  self,
845
879
  sdf: SystemDescription,
846
- vmm: ProtectionDomain,
847
- vm: VirtualMachine,
880
+ vmm: SystemDescription.ProtectionDomain,
881
+ vm: SystemDescription.VirtualMachine,
848
882
  dtb: DeviceTree,
849
883
  *,
850
- one_to_one_ram: bool=False,
884
+ one_to_one_ram: bool = False,
851
885
  ):
852
886
  self._obj = libsdfgen.sdfgen_vmm(sdf._obj, vmm._obj, vm._obj, dtb._obj, dtb.size, one_to_one_ram)
853
887
 
854
- def add_passthrough_device(self, name: str, device: DeviceTree.Node, *, irqs: List[int]=[]):
888
+ def add_passthrough_device(
889
+ self,
890
+ name: str,
891
+ device: DeviceTree.Node,
892
+ *,
893
+ regions: Optional[List[int]] = None,
894
+ irqs: Optional[List[int]] = None
895
+ ):
855
896
  c_name = c_char_p(name.encode("utf-8"))
856
- c_irqs = (c_uint8 * len(irqs))(*irqs)
857
- return libsdfgen.sdfgen_vmm_add_passthrough_device(self._obj, c_name, device._obj, cast(c_irqs, POINTER(c_uint8)), len(irqs))
858
-
859
- def add_passthrough_irq(self, irq: Irq):
897
+ if regions:
898
+ c_regions = cast((c_uint8 * len(regions))(*regions), POINTER(c_uint8))
899
+ regions_len = len(c_regions)
900
+ else:
901
+ c_regions = None
902
+ regions_len = 0
903
+
904
+ if irqs:
905
+ c_irqs = cast((c_uint8 * len(irqs))(*irqs), POINTER(c_uint8))
906
+ irqs_len = len(c_irqs)
907
+ else:
908
+ c_irqs = None
909
+ irqs_len = 0
910
+
911
+ return libsdfgen.sdfgen_vmm_add_passthrough_device(self._obj, c_name, device._obj, c_regions, regions_len, c_irqs, irqs_len)
912
+
913
+ def add_passthrough_irq(self, irq: SystemDescription.Irq):
860
914
  return libsdfgen.sdfgen_vmm_add_passthrough_irq(self._obj, irq._obj)
861
915
 
862
916
  def add_virtio_mmio_console(self, device: DeviceTree.Node, serial: Sddf.Serial):
@@ -865,8 +919,24 @@ class Vmm:
865
919
  def add_virtio_mmio_blk(self, device: DeviceTree.Node, blk: Sddf.Blk, *, partition: int):
866
920
  return libsdfgen.sdfgen_vmm_add_virtio_mmio_blk(self._obj, device._obj, blk._obj, partition)
867
921
 
868
- # def add_virtio_net(self, device: DeviceTree.Node, net: Sddf.Net, *, copier: ProtectionDomain=None):
869
- # return libsdfgen.sdfgen_vmm_add_virtio_blk(self._obj, device._obj, net._obj, partition)
922
+ def add_virtio_mmio_net(
923
+ self,
924
+ device: DeviceTree.Node,
925
+ net: Sddf.Net,
926
+ copier: SystemDescription.ProtectionDomain,
927
+ *,
928
+ mac_addr: Optional[str] = None
929
+ ):
930
+ if mac_addr is not None and len(mac_addr) != 17:
931
+ raise Exception(
932
+ f"invalid MAC address length for '{mac_addr}'"
933
+ )
934
+
935
+ c_mac_addr = c_char_p(0)
936
+ if mac_addr is not None:
937
+ c_mac_addr = c_char_p(mac_addr.encode("utf-8"))
938
+
939
+ return libsdfgen.sdfgen_vmm_add_virtio_mmio_net(self._obj, device._obj, net._obj, copier._obj, c_mac_addr)
870
940
 
871
941
  def connect(self) -> bool:
872
942
  return libsdfgen.sdfgen_vmm_connect(self._obj)
@@ -918,7 +988,9 @@ class LionsOs:
918
988
  export_path: str,
919
989
  ):
920
990
  if mac_addr is not None and len(mac_addr) != 17:
921
- raise Exception(f"invalid MAC address length for client '{client.name}', {mac_addr}")
991
+ raise Exception(
992
+ f"invalid MAC address length for client '{client.name}', {mac_addr}"
993
+ )
922
994
 
923
995
  c_mac_addr = c_char_p(0)
924
996
  if mac_addr is not None:
@@ -928,7 +1000,18 @@ class LionsOs:
928
1000
  c_server = c_char_p(server.encode("utf-8"))
929
1001
  c_export_path = c_char_p(export_path.encode("utf-8"))
930
1002
 
931
- self._obj = libsdfgen.sdfgen_lionsos_fs_nfs(sdf._obj, fs._obj, client._obj, net._obj, net_copier._obj, c_mac_addr, serial._obj, timer._obj, c_server, c_export_path)
1003
+ self._obj = libsdfgen.sdfgen_lionsos_fs_nfs(
1004
+ sdf._obj,
1005
+ fs._obj,
1006
+ client._obj,
1007
+ net._obj,
1008
+ net_copier._obj,
1009
+ c_mac_addr,
1010
+ serial._obj,
1011
+ timer._obj,
1012
+ c_server,
1013
+ c_export_path
1014
+ )
932
1015
 
933
1016
  def connect(self) -> bool:
934
1017
  return libsdfgen.sdfgen_lionsos_fs_nfs_connect(self._obj)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: sdfgen
3
- Version: 0.16.1
3
+ Version: 0.17.0
4
4
  Summary: Automating the creation of Microkit System Description Files (SDF)
5
5
  Home-page: https://github.com/au-ts/microkit_sdf_gen
6
6
  Description-Content-Type: text/markdown
@@ -24,11 +24,13 @@ Microkit-based systems.
24
24
 
25
25
  The sdfgen tooling (name temporary) contains libraries for programmatically
26
26
  creating:
27
+
27
28
  * Microkit System Description Files (SDF)
28
29
  * systems using the seL4 Device Driver Framework (sDDF)
29
30
  * systems using LionsOS
30
31
 
31
32
  It has first-class support for use in the following languages:
33
+
32
34
  * C
33
35
  * Python
34
36
  * Zig
@@ -47,7 +49,7 @@ Pre-built archives of the C library are available in each
47
49
 
48
50
  ### Dependencies
49
51
 
50
- * Zig (`0.14.0-dev.2079+ba2d00663` or higher)
52
+ * Zig (`0.14.0-dev.3050+d72f3d353` or higher)
51
53
  * See https://ziglang.org/download/, until 0.14.0 is released we rely on a
52
54
  master version of Zig. Once 0.14.0 is released (most likely Feb'25) we can
53
55
  pin to that release.
@@ -0,0 +1,11 @@
1
+ csdfgen.cpython-311-darwin.so,sha256=0TGnLKreuSQowk7ECX0v33eSyj0rekDOxZ2JZrTBNYE,758684
2
+ libcsdfgen.0.17.0.dylib,sha256=0TGnLKreuSQowk7ECX0v33eSyj0rekDOxZ2JZrTBNYE,758684
3
+ libcsdfgen.0.dylib,sha256=0TGnLKreuSQowk7ECX0v33eSyj0rekDOxZ2JZrTBNYE,758684
4
+ libcsdfgen.dylib,sha256=0TGnLKreuSQowk7ECX0v33eSyj0rekDOxZ2JZrTBNYE,758684
5
+ sdfgen/__init__.py,sha256=_d7GGV8GhadIAEYP8uiJlez0yKtXnHMHdRkRzVMKS3c,143
6
+ sdfgen/module.py,sha256=43JZjSFFzMDoYd0r_O26HFVsfFyzgh1r51bkbzkVA20,37296
7
+ sdfgen/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
+ sdfgen-0.17.0.dist-info/METADATA,sha256=pofeKoD0ElzkpumR1NqPDjFJsAjP9WZmmPfhX3QdGeQ,4654
9
+ sdfgen-0.17.0.dist-info/WHEEL,sha256=38gKh4ciura0Qr0EhFttwRGApTkeI2HunUgfZoFA5_0,110
10
+ sdfgen-0.17.0.dist-info/top_level.txt,sha256=M3gUW9vTMij10peQKgv1Qs0jZkdsk_PG0REFxuv6jNY,15
11
+ sdfgen-0.17.0.dist-info/RECORD,,
libcsdfgen.0.16.1.dylib DELETED
Binary file
@@ -1,11 +0,0 @@
1
- csdfgen.cpython-311-darwin.so,sha256=gJEoFKxSGhQYdhotcliAgJ3x3zS3AyvFW8HftZNFAns,784068
2
- libcsdfgen.0.16.1.dylib,sha256=gJEoFKxSGhQYdhotcliAgJ3x3zS3AyvFW8HftZNFAns,784068
3
- libcsdfgen.0.dylib,sha256=gJEoFKxSGhQYdhotcliAgJ3x3zS3AyvFW8HftZNFAns,784068
4
- libcsdfgen.dylib,sha256=gJEoFKxSGhQYdhotcliAgJ3x3zS3AyvFW8HftZNFAns,784068
5
- sdfgen/__init__.py,sha256=_d7GGV8GhadIAEYP8uiJlez0yKtXnHMHdRkRzVMKS3c,143
6
- sdfgen/module.py,sha256=cIv7e3k3RUn4JY9oLzK2VJowjp29dwp9bevvOiwnOu4,35769
7
- sdfgen/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
- sdfgen-0.16.1.dist-info/METADATA,sha256=8dDOff9zrETLBN9nMKnXf4fYVtUZQ04YQ4l0lNMxWoI,4652
9
- sdfgen-0.16.1.dist-info/WHEEL,sha256=38gKh4ciura0Qr0EhFttwRGApTkeI2HunUgfZoFA5_0,110
10
- sdfgen-0.16.1.dist-info/top_level.txt,sha256=M3gUW9vTMij10peQKgv1Qs0jZkdsk_PG0REFxuv6jNY,15
11
- sdfgen-0.16.1.dist-info/RECORD,,