search for: usiz

Displaying 20 results from an estimated 53 matches for "usiz".

Did you mean: usit
2018 Jun 27
2
can debug info for coroutines be improved?
...ee that it has full debug info and @llvm.dbg.declare just like in the "normal function" case. ; Function Attrs: nobuiltin noinline nounwind optnone define internal fastcc i8* @testAsyncSeq(%StackTrace* nonnull, %Allocator*, i16*) unnamed_addr #5 !dbg !1163 { Entry: %3 = alloca %"[]usize", align 8 %4 = alloca i8*, align 8 %5 = alloca %"[]u8", align 8 %_anon = alloca %"AsyncFramePromise(void)", align 8 %_anon1 = alloca i8*, align 8 %_anon2 = alloca i64, align 8 %_anon3 = alloca %Allocator*, align 8 %blah = alloca %Point, align 4 %bar = alloc...
2012 Apr 22
1
[PATCH 1/5] drm: add optional per device rwsem for all ioctls
...+ 3 files changed, 12 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c index 6116e3b..c54e9f8 100644 --- a/drivers/gpu/drm/drm_drv.c +++ b/drivers/gpu/drm/drm_drv.c @@ -464,6 +464,9 @@ long drm_ioctl(struct file *filp, } else memset(kdata, 0, usize); + if (dev->driver->ioctls_need_rwsem) + down_read(&dev->ioctls_rwsem); + if (ioctl->flags & DRM_UNLOCKED) retcode = func(dev, kdata, file_priv); else { @@ -472,6 +475,9 @@ long drm_ioctl(struct file *filp, mutex_unlock(&drm_global_mutex); } + if (...
2019 Jul 30
0
Re: [PATCH] Rust bindings: Implement Event features
...estfs; >+use std::ffi; >+use std::os::raw::{c_char, c_void}; >+use std::slice; >+use std::sync; >+ >+type GuestfsEventCallback = extern "C" fn( >+ *const base::guestfs_h, >+ *const c_void, >+ u64, >+ i32, >+ i32, >+ *const i8, >+ usize, >+ *const u64, >+ usize, >+); >+ >+#[link(name = "guestfs")] >+extern "C" { >+ fn guestfs_set_event_callback( >+ g: *const base::guestfs_h, >+ cb: GuestfsEventCallback, >+ event_bitmask: u64, >+ flags: i32,...
2017 Mar 14
0
[bug report] drm/nouveau/fb/gf100-: rework ram detection
...u32 rsvd_head = ( 256 * 1024); /* vga memory */ 579 const u32 rsvd_tail = (1024 * 1024); /* vbios etc */ 580 enum nvkm_ram_type type = nvkm_fb_bios_memtype(bios); 581 u32 fbps = nvkm_rd32(device, 0x022438); 582 u64 total = 0, lcomm = ~0, lower, ubase, usize; ^^^^^^^^^^^^^ It's a u64. 583 int ret, fbp, ltcs, ltcn = 0; 584 585 nvkm_debug(subdev, "%d FBP(s)\n", fbps); 586 for (fbp = 0; fbp < fbps; fbp++) { 587 u32 size = func->probe_fbp(func, device, fbp, &...
2018 May 11
2
best way to represent function call with new stack in LLVM IR?
..., %rsi\0A addq $$0x8, %r11\0A jmp 1\0A2:", "~{r11},~{r12}"() ; function body goes here call void asm sideeffect " movq (%rbp), %rsp", ""() ret void } To make the assembly more readable, I'll include the source that generated this: var new_sp: usize = 0xdeadbeef; export fn entry() void { const sp = asm ("" : [ret] "={sp}" (-> usize)); cycleEntry(sp, new_sp); } extern fn cycleEntry( old_sp: usize, // %rdi new_sp_arg: usize, // %rsi ) void { asm volatile ( \\ # set the new base pointer...
2018 Nov 23
2
is this a bug in an optimization pass?
...generated IR: ; ModuleID = 'test' source_filename = "test" target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu" %Bar = type { i32, i32 } %"[]u8" = type { i8*, i64 } %StackTrace = type { i64, %"[]usize" } %"[]usize" = type { i64*, i64 } @0 = internal unnamed_addr constant %Bar { i32 3, i32 4 }, align 4 ; Function Attrs: nounwind readnone speculatable declare void @llvm.dbg.declare(metadata, metadata, metadata) #1 ; Function Attrs: nobuiltin nounwind define void @entry() #2 !dbg...
2019 Jun 11
3
[nbdkit PATCH 0/2] Few rust plugin fixups/nitpicks
There are few more things that could be cleaned up related to the coding style and other things, like explicitly specifying the abi style after "extern" (i.e. `extern "C" fn` instead of `extern fn`), but since those are configurable in rustfmt config, I'm not sure whether the config needs to be added or complying with the defaults should be the priority. But this was just
2019 Jul 30
4
[PATCH] Rust bindings: Implement Event features
...+use crate::base; +use crate::error; +use crate::guestfs; +use std::ffi; +use std::os::raw::{c_char, c_void}; +use std::slice; +use std::sync; + +type GuestfsEventCallback = extern "C" fn( + *const base::guestfs_h, + *const c_void, + u64, + i32, + i32, + *const i8, + usize, + *const u64, + usize, +); + +#[link(name = "guestfs")] +extern "C" { + fn guestfs_set_event_callback( + g: *const base::guestfs_h, + cb: GuestfsEventCallback, + event_bitmask: u64, + flags: i32, + opaque: *const c_void, + ) ->...
2019 Aug 31
1
[PATCH libnbd] Add bindings for Rust language
Still not working, but I took the latest patch and: - rebased it against libnbd 1.0 - fixed it so it handles new args and cbargs The generator now runs without warnings. This patch doesn't handle optargs at all. In C these are converted to non-optional parameter. Rust doesn't (AFAIK) have optional or labelled arguments unfortunately. Rich.
2019 Jul 30
1
Re: [PATCH] Rust bindings: Implement Event features
...r, c_void}; > >+use std::slice; > >+use std::sync; > >+ > >+type GuestfsEventCallback = extern "C" fn( > >+ *const base::guestfs_h, > >+ *const c_void, > >+ u64, > >+ i32, > >+ i32, > >+ *const i8, > >+ usize, > >+ *const u64, > >+ usize, > >+); > >+ > >+#[link(name = "guestfs")] > >+extern "C" { > >+ fn guestfs_set_event_callback( > >+ g: *const base::guestfs_h, > >+ cb: GuestfsEventCallback, > >+...
2018 Mar 29
0
workaround for CoroSplit not spilling alloca?
...align 8 %4 = alloca %"[]u8", align 8 %5 = getelementptr inbounds %StackTrace, %StackTrace* %error_return_trace, i32 0, i32 0 store i64 0, i64* %5, align 8 %6 = getelementptr inbounds %StackTrace, %StackTrace* %error_return_trace, i32 0, i32 1 %7 = getelementptr inbounds %"[]usize", %"[]usize"* %6, i32 0, i32 0 %8 = getelementptr inbounds [1 x i64], [1 x i64]* %error_return_trace_addresses, i64 0, i64 0 store i64* %8, i64** %7, align 8 however CoroSplit does not spill it. we write through the pointer, which writes to the fn stack data. then there is a...
2019 Jul 07
2
[libnbd PATCH] RFC: Add bindings for Rust language
...ndent + 1) in + pr "(\n"; + if handle then ( + pri (); pr "h: *mut nbd_handle,\n"; + ); + List.iter ( + fun arg -> + (match arg with + | ArrayAndLen (UInt32 n, len) -> + pri (); pr "%s: *mut u32,\n" n; + pri (); pr "%s: usize,\n" len + | ArrayAndLen _ -> assert false + | Bool n -> pri (); pr "%s: bool,\n" n + | BytesIn (n, len) + | BytesPersistIn (n, len) -> + pri (); pr "%s: *const c_void,\n" n; + pri (); pr "%s: usize,\n" len +...
2019 Aug 05
2
[PATCH 2/2] Rust bindings: Implement callback handlers
...1 USA + */ + +use crate::base; +use crate::error; +use crate::guestfs; +use crate::utils; +use std::os::raw::{c_char, c_void}; +use std::slice; + +type GuestfsEventCallback = extern "C" fn( + *const base::guestfs_h, + *const c_void, + u64, + i32, + i32, + *const i8, + usize, + *const u64, + usize, +); + +#[link(name = "guestfs")] +extern "C" { + fn guestfs_set_event_callback( + g: *const base::guestfs_h, + cb: GuestfsEventCallback, + event_bitmask: u64, + flags: i32, + opaque: *const c_void, + ) ->...
2019 Jun 27
0
[PATCH 6/9] Rust bindings: Add generator of function signatures
..., n) -> pr "%s: String" n + | OptString n -> pr "%s: Option<String>" n + | StringList (_, n) -> pr "%s: Vec<String>" n + | BufferIn n -> pr "%s: Vec<u8>" n + | Pointer (_, n) -> pr "%s: usize" n + ) args; + if optargs <> [] then ( + if !comma then pr ", "; + comma := true; + pr "optargs: OptArgs%s" cname + ); + pr ")"; + + (* generate return type *) + pr " -> Result<"; + (ma...
2019 Jun 27
0
[PATCH 7/9] Rust bindings: Complete actions
...; pr "%s: c_int" n + | Int64 n -> pr "%s: i64" n + | Pointer (_, n) -> pr "%s: *const ffi::c_void" n + | StringList (_, n) -> pr "%s: *const *const c_char" n + | BufferIn n -> pr "%s: *const c_char, %s_len: usize" n n + ) args; + (match ret with + | RBufferOut _ -> pr ", size: *const usize" + | _ -> () + ); + if optargs <> [] then + pr ", optarg: *const RawOptArgs%s" cname; + + pr ") -> "; + + (match ret with...
2019 Feb 08
0
[PATCH nbdkit] Add support for writing plugins in Rust.
...rn fn ramdisk_get_size (_h: *mut c_void) -> int64_t { + return DISK.lock().unwrap().capacity() as int64_t; +} + +extern fn ramdisk_pread (_h: *mut c_void, buf: *mut c_char, count: uint32_t, + offset: uint64_t, _flags: uint32_t) -> c_int { + let offset = offset as usize; + let count = count as usize; + let disk = DISK.lock().unwrap(); + unsafe { + ptr::copy_nonoverlapping (&disk[offset], buf as *mut u8, count); + } + return 0; +} + +extern fn ramdisk_pwrite (_h: *mut c_void, buf: *const c_char, count: uint32_t, +...
2017 Dec 21
2
Pass ordering - GVN vs. loop optimizations
...rge loads across basic blocks. This means that if a loop index only appears behind a pointer, LLVM will not be able to optimize out bounds checks depending on it. The "canonical" example is this Rust function (or the similar C code): #![crate_type="rlib"] pub fn f(length: &usize) -> u64 { let mut sum = 0; let len_1 = *length; let mut i = 0; while i < len_1 { let len_2 = *length; assert!(i < len_2); i += 1; } sum } One would expect the assertion (which in a real example is a bounds check) to be optimized out. However, IndVarSimplify is the...
2018 Apr 26
2
windows ABI problem with i128?
...======================================== ; ModuleID = 'test' source_filename = "test" target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-windows-msvc" %"[]u8" = type { i8*, i64 } %StackTrace = type { i64, %"[]usize" } %"[]usize" = type { i64*, i64 } ; Function Attrs: nounwind readnone speculatable declare void @llvm.dbg.declare(metadata, metadata, metadata) #1 ; Function Attrs: nobuiltin noinline noreturn nounwind uwtable alignstack(16) define void @WinMainCRTStartup() #2 !dbg !41 { Entry:...
2019 Feb 08
3
[PATCH nbdkit] Add support for writing plugins in Rust.
This adds very rough support for writing nbdkit plugins in Rust. This is not very idiomatic -- essentially we're handling the direct C calls from nbdkit in Rust. We have to use ‘unsafe’ in a few places because there's no way to tell the Rust code that nbdkit satisfies guarantees (eg. around thread safety, always returning leaked pointers back to the close function, always doing bounds
2019 Aug 05
3
Re: [PATCH] Rust bindings: Implement Event features
I fixed based on comments. I'll send these two patches to this mailing list. - Fix Handle -> Handle<'a> - Add events Regards, Hiroyuki 2019年8月1日(木) 0:01 Pino Toscano <ptoscano@redhat.com>: > Hi Hiroyuki, > > On Tuesday, 30 July 2019 07:51:37 CEST Hiroyuki Katsura wrote: > > This patch includes: > > > > - Event callback handlers > > -