Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 31 for getncpu (0.11 sec)

  1. src/runtime/os_openbsd_arm.go

    // license that can be found in the LICENSE file.
    
    package runtime
    
    func checkgoarm() {
    	// TODO(minux): FP checks like in os_linux_arm.go.
    
    	// osinit not called yet, so ncpu not set: must use getncpu directly.
    	if getncpu() > 1 && goarm < 7 {
    		print("runtime: this system has multiple CPUs and must use\n")
    		print("atomic synchronization instructions. Recompile using GOARM=7.\n")
    		exit(1)
    	}
    }
    
    //go:nosplit
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Dec 05 20:34:30 UTC 2023
    - 662 bytes
    - Viewed (0)
  2. src/runtime/os_netbsd_arm.go

    	mc.__gregs[_REG_R2] = uint32(fn)
    }
    
    func checkgoarm() {
    	// TODO(minux): FP checks like in os_linux_arm.go.
    
    	// osinit not called yet, so ncpu not set: must use getncpu directly.
    	if getncpu() > 1 && goarm < 7 {
    		print("runtime: this system has multiple CPUs and must use\n")
    		print("atomic synchronization instructions. Recompile using GOARM=7.\n")
    		exit(1)
    	}
    }
    
    //go:nosplit
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Dec 05 20:34:30 UTC 2023
    - 1.1K bytes
    - Viewed (0)
  3. src/runtime/os_freebsd_arm.go

    		print("a binary compiled for VFPv3 hard floating point. Recompile adding ,softfloat\n")
    		print("to GOARM or changing GOARM to 6.\n")
    		exit(1)
    	}
    
    	// osinit not called yet, so ncpu not set: must use getncpu directly.
    	if getncpu() > 1 && goarm < 7 {
    		print("runtime: this system has multiple CPUs and must use\n")
    		print("atomic synchronization instructions. Recompile using GOARM=7.\n")
    		exit(1)
    	}
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Dec 05 20:34:30 UTC 2023
    - 1.4K bytes
    - Viewed (0)
  4. src/runtime/os_openbsd.go

    		return 0, false
    	}
    	return out, true
    }
    
    //go:linkname internal_cpu_sysctlUint64 internal/cpu.sysctlUint64
    func internal_cpu_sysctlUint64(mib []uint32) (uint64, bool) {
    	return sysctlUint64(mib)
    }
    
    func getncpu() int32 {
    	// Try hw.ncpuonline first because hw.ncpu would report a number twice as
    	// high as the actual CPUs running on OpenBSD 6.4 with hyperthreading
    	// disabled (hw.smt=0). See https://golang.org/issue/30127
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 25 19:53:03 UTC 2024
    - 6.2K bytes
    - Viewed (0)
  5. src/runtime/os_dragonfly.go

    // From DragonFly's <sys/sysctl.h>
    const (
    	_CTL_HW      = 6
    	_HW_NCPU     = 3
    	_HW_PAGESIZE = 7
    )
    
    var sigset_all = sigset{[4]uint32{^uint32(0), ^uint32(0), ^uint32(0), ^uint32(0)}}
    
    func getncpu() int32 {
    	mib := [2]uint32{_CTL_HW, _HW_NCPU}
    	out := uint32(0)
    	nout := unsafe.Sizeof(out)
    	ret := sysctl(&mib[0], 2, (*byte)(unsafe.Pointer(&out)), &nout, nil, 0)
    	if ret >= 0 {
    		return int32(out)
    	}
    	return 1
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Dec 05 20:34:30 UTC 2023
    - 7.1K bytes
    - Viewed (0)
  6. src/runtime/os_netbsd.go

    	var out int32
    	nout := unsafe.Sizeof(out)
    	ret := sysctl(&mib[0], uint32(len(mib)), (*byte)(unsafe.Pointer(&out)), &nout, nil, 0)
    	if ret < 0 {
    		return 0, false
    	}
    	return out, true
    }
    
    func getncpu() int32 {
    	if n, ok := sysctlInt([]uint32{_CTL_HW, _HW_NCPUONLINE}); ok {
    		return int32(n)
    	}
    	if n, ok := sysctlInt([]uint32{_CTL_HW, _HW_NCPU}); ok {
    		return int32(n)
    	}
    	return 1
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 25 19:53:03 UTC 2024
    - 10.1K bytes
    - Viewed (0)
  7. src/runtime/os_darwin.go

    			return
    		}
    	}
    }
    
    // BSD interface for threading.
    func osinit() {
    	// pthread_create delayed until end of goenvs so that we
    	// can look at the environment first.
    
    	ncpu = getncpu()
    	physPageSize = getPageSize()
    
    	osinit_hack()
    }
    
    func sysctlbynameInt32(name []byte) (int32, int32) {
    	out := int32(0)
    	nout := unsafe.Sizeof(out)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Dec 05 20:34:30 UTC 2023
    - 11.9K bytes
    - Viewed (0)
  8. src/runtime/os_freebsd.go

    }
    
    const (
    	_CPU_CURRENT_PID = -1 // Current process ID.
    )
    
    //go:noescape
    func cpuset_getaffinity(level int, which int, id int64, size int, mask *byte) int32
    
    //go:systemstack
    func getncpu() int32 {
    	// Use a large buffer for the CPU mask. We're on the system
    	// stack, so this is fine, and we can't allocate memory for a
    	// dynamically-sized buffer at this point.
    	const maxCPUs = 64 * 1024
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Dec 05 20:34:30 UTC 2023
    - 11.6K bytes
    - Viewed (0)
  9. src/runtime/os3_solaris.go

    }
    
    func osinit() {
    	// Call miniterrno so that we can safely make system calls
    	// before calling minit on m0.
    	asmcgocall(unsafe.Pointer(abi.FuncPCABI0(miniterrno)), unsafe.Pointer(&libc____errno))
    
    	ncpu = getncpu()
    	if physPageSize == 0 {
    		physPageSize = getPageSize()
    	}
    }
    
    func tstart_sysvicall(newm *m) uint32
    
    // May run with m.p==nil, so write barriers are not allowed.
    //
    //go:nowritebarrier
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 25 19:53:03 UTC 2024
    - 17.6K bytes
    - Viewed (0)
  10. pkg/kubelet/apis/podresources/testing/provider_mock.go

    }
    
    // GetCPUs mocks base method.
    func (m *MockCPUsProvider) GetCPUs(podUID, containerName string) []int64 {
    	m.ctrl.T.Helper()
    	ret := m.ctrl.Call(m, "GetCPUs", podUID, containerName)
    	ret0, _ := ret[0].([]int64)
    	return ret0
    }
    
    // GetCPUs indicates an expected call of GetCPUs.
    func (mr *MockCPUsProviderMockRecorder) GetCPUs(podUID, containerName any) *gomock.Call {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Mar 07 08:12:16 UTC 2024
    - 10.1K bytes
    - Viewed (0)
Back to top