mirror of
https://github.com/mainflux/mainflux.git
synced 2025-04-29 13:49:28 +08:00
![dependabot[bot]](/assets/img/avatar_default.png)
Bumps [github.com/lestrrat-go/jwx/v2](https://github.com/lestrrat-go/jwx) from 2.0.8 to 2.0.11. - [Release notes](https://github.com/lestrrat-go/jwx/releases) - [Changelog](https://github.com/lestrrat-go/jwx/blob/develop/v2/Changes) - [Commits](https://github.com/lestrrat-go/jwx/compare/v2.0.8...v2.0.11) --- updated-dependencies: - dependency-name: github.com/lestrrat-go/jwx/v2 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
33 lines
911 B
Go
33 lines
911 B
Go
// Package cpuid provides generic types used to represent CPU features supported
|
|
// by the architecture.
|
|
package cpuid
|
|
|
|
// CPU is a bitset of feature flags representing the capabilities of various CPU
|
|
// architeectures that this package provides optimized assembly routines for.
|
|
//
|
|
// The intent is to provide a stable ABI between the Go code that generate the
|
|
// assembly, and the program that uses the library functions.
|
|
type CPU uint64
|
|
|
|
// Feature represents a single CPU feature.
|
|
type Feature uint64
|
|
|
|
const (
|
|
// None is a Feature value that has no CPU features enabled.
|
|
None Feature = 0
|
|
// All is a Feature value that has all CPU features enabled.
|
|
All Feature = 0xFFFFFFFFFFFFFFFF
|
|
)
|
|
|
|
func (cpu CPU) Has(feature Feature) bool {
|
|
return (Feature(cpu) & feature) == feature
|
|
}
|
|
|
|
func (cpu *CPU) Set(feature Feature, enabled bool) {
|
|
if enabled {
|
|
*cpu |= CPU(feature)
|
|
} else {
|
|
*cpu &= ^CPU(feature)
|
|
}
|
|
}
|