Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pkg/goid/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ go_library(
"goid_122_arm64.s",
"goid_123_amd64.s",
"goid_123_arm64.s",
"goid_125_amd64.s",
"goid_125_arm64.s",
],
stateify = False,
visibility = ["//visibility:public"],
Expand Down
2 changes: 1 addition & 1 deletion pkg/goid/goid_123_amd64.s
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build go1.23
//go:build go1.23 && !go1.25

#include "textflag.h"

Expand Down
2 changes: 1 addition & 1 deletion pkg/goid/goid_123_arm64.s
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build go1.23
//go:build go1.23 && !go1.25

#include "textflag.h"

Expand Down
26 changes: 26 additions & 0 deletions pkg/goid/goid_125_amd64.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Copyright 2020 The gVisor Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build go1.25

#include "textflag.h"

#define GOID_OFFSET 152 // +checkoffset runtime g.goid

// func goid() int64
TEXT ·goid(SB),NOSPLIT|NOFRAME,$0-8
MOVQ (TLS), R14
MOVQ GOID_OFFSET(R14), R14
MOVQ R14, ret+0(FP)
RET
26 changes: 26 additions & 0 deletions pkg/goid/goid_125_arm64.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Copyright 2020 The gVisor Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build go1.25

#include "textflag.h"

#define GOID_OFFSET 152 // +checkoffset runtime g.goid

// func goid() int64
TEXT ·goid(SB),NOSPLIT,$0-8
MOVD g, R0 // g
MOVD GOID_OFFSET(R0), R0
MOVD R0, ret+0(FP)
RET
6 changes: 4 additions & 2 deletions pkg/hosttid/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ go_library(
name = "hosttid",
srcs = [
"hosttid.go",
"hosttid_amd64.s",
"hosttid_arm64.s",
"hosttid_124_amd64.s",
"hosttid_124_arm64.s",
"hosttid_125_amd64.s",
"hosttid_125_arm64.s",
],
visibility = ["//visibility:public"],
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build amd64
// +build amd64
//go:build !go1.25

#include "textflag.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build arm64
// +build arm64
//go:build !go1.25

#include "textflag.h"

Expand Down
29 changes: 29 additions & 0 deletions pkg/hosttid/hosttid_125_amd64.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Copyright 2018 The gVisor Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build go1.25

#include "textflag.h"

#define M_OFFSET 48 // +checkoffset runtime g.m
#define PROCID_OFFSET 64 // +checkoffset runtime m.procid

TEXT ·Current(SB),NOSPLIT|NOFRAME,$0-8
// procid is in getg().m.procid.
MOVQ TLS, AX
MOVQ 0(AX)(TLS*1), AX
MOVQ M_OFFSET(AX), AX // gp.m
MOVQ PROCID_OFFSET(AX), AX // mp.procid
MOVQ AX, ret+0(FP)
RET
28 changes: 28 additions & 0 deletions pkg/hosttid/hosttid_125_arm64.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Copyright 2018 The gVisor Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build go1.25

#include "textflag.h"

#define M_OFFSET 48 // +checkoffset runtime g.m
#define PROCID_OFFSET 64 // +checkoffset runtime m.procid

TEXT ·Current(SB),NOSPLIT,$0-8
// procid is in getg().m.procid.
MOVD g, R0 // g
MOVD M_OFFSET(R0), R0 // gp.m
MOVD PROCID_OFFSET(R0), R0 // mp.procid
MOVD R0, ret+0(FP)
RET