Applied, thanks! Flavio Cruz, le lun. 24 avril 2023 23:53:52 -0400, a ecrit: > This brings us a bit closer to having all types' msgt_size representable > with a single byte. We will be able to avoid mach_msg_type_long_t > entirely for x86_64 since mach_msg_type_t can represent long types using > a separate field. > --- > hurd/default_pager.defs | 30 ++++++++++++++++++++++-------- > mach-defpager/setup.c | 10 ++++++++++ > sutils/swapon.c | 9 +++++++-- > trans/proxy-defpager.c | 11 +++++++++++ > 4 files changed, 50 insertions(+), 10 deletions(-) > > diff --git a/hurd/default_pager.defs b/hurd/default_pager.defs > index 6b834584..3ca34fc4 100644 > --- a/hurd/default_pager.defs > +++ b/hurd/default_pager.defs > @@ -69,14 +69,10 @@ skip; /* > default_pager_paging_file */ > > skip; /* default_pager_register_fileserver */ > > -/* Add or remove an area of paging storage, which is a subset of the > - Mach device for which device_open returned DEVICE_PORT. The area > - consists of the concatenation of contiguous regions described by > - RUNS. Each even-numbered element of RUNS gives the starting record > - number of a region whose length is given by the next odd-numbered > - element. NAME is used in any diagnostics the default pager prints > - about device errors when paging. When removing a paging area, NAME > - and RUNS must match exactly. */ > +/* Deprecated RPC to add or remove an area of paging storage. > + * Was superseded in favor of default_pager_paging_storage_new which > + * uses the correct type for default_pager_filename_t using c_string. > + */ > routine default_pager_paging_storage( > default_pager : mach_port_t; > device_port : mach_port_t; > @@ -101,3 +97,21 @@ routine default_pager_storage_info( > array[] of vm_size_t, dealloc; > out name : data_t); > > +type new_default_pager_filename_t = c_string[256] > + ctype: default_pager_filename_t; > + > +/* Add or remove an area of paging storage, which is a subset of the > + Mach device for which device_open returned DEVICE_PORT. The area > + consists of the concatenation of contiguous regions described by > + RUNS. Each even-numbered element of RUNS gives the starting record > + number of a region whose length is given by the next odd-numbered > + element. NAME is used in any diagnostics the default pager prints > + about device errors when paging. When removing a paging area, NAME > + and RUNS must match exactly. */ > +routine default_pager_paging_storage_new( > + default_pager : mach_port_t; > + device_port : mach_port_t; > + runs : recnum_array_t = > + array[] of recnum_t; > + name : new_default_pager_filename_t; > + add : boolean_t); > diff --git a/mach-defpager/setup.c b/mach-defpager/setup.c > index 8cd1fed2..087ede71 100644 > --- a/mach-defpager/setup.c > +++ b/mach-defpager/setup.c > @@ -100,6 +100,16 @@ S_default_pager_paging_storage (mach_port_t pager, > return 0; > } > > +kern_return_t > +S_default_pager_paging_storage_new (mach_port_t pager, > + mach_port_t device, > + const recnum_t *runs, mach_msg_type_number_t > nrun, > + const_default_pager_filename_t name, > + boolean_t add) > +{ > + return S_default_pager_paging_storage (pager, > + device, runs, nrun, name, add); > +} > > /* Called to read a page from backing store. */ > int > diff --git a/sutils/swapon.c b/sutils/swapon.c > index 2ee3cd7f..c965d8e2 100644 > --- a/sutils/swapon.c > +++ b/sutils/swapon.c > @@ -409,8 +409,13 @@ swaponoff (const char *file, int add, int > skipnotexisting) > runs[j++] = store->runs[i].start; > runs[j++] = store->runs[i].length; > } > - err = default_pager_paging_storage (def_pager, store->port, > - runs, j, file, add); > + err = default_pager_paging_storage_new (def_pager, store->port, > + runs, j, file, add); > + if (err == MIG_BAD_ID || err == EOPNOTSUPP) > + { > + err = default_pager_paging_storage (def_pager, store->port, > + runs, j, file, add); > + } > > store_free (store); > > diff --git a/trans/proxy-defpager.c b/trans/proxy-defpager.c > index 878beffe..5d952546 100644 > --- a/trans/proxy-defpager.c > +++ b/trans/proxy-defpager.c > @@ -112,6 +112,17 @@ S_default_pager_paging_storage (mach_port_t > default_pager, > ?: mach_port_deallocate (mach_task_self (), device); > } > > +kern_return_t > +S_default_pager_paging_storage_new (mach_port_t default_pager, > + mach_port_t device, > + const recnum_t *runs, mach_msg_type_number_t > nruns, > + const_default_pager_filename_t name, > + boolean_t add) > +{ > + return S_default_pager_paging_storage (default_pager, > + device, runs, nruns, name, add); > +} > + > kern_return_t > S_default_pager_object_set_size (mach_port_t memory_object, > mach_port_seqno_t seqno, > -- > 2.39.2 > >
-- Samuel --- Pour une évaluation indépendante, transparente et rigoureuse ! Je soutiens la Commission d'Évaluation de l'Inria.