Skip to content

Commit cf08fce

Browse files
committed
Adjust runtime schedt.nmspinning offset for go1.26
https://go.dev/cl/714800 changes the size of schedt.midle. PiperOrigin-RevId: 831765475
1 parent 0f83514 commit cf08fce

File tree

3 files changed

+32
-2
lines changed

3 files changed

+32
-2
lines changed

pkg/sync/runtime_spinning_amd64.s

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
// limitations under the License.
1414

1515
// https://go.dev/cl/669235 (1.25) adds a new schedt field prior to nmspinning.
16-
//go:build amd64 && !go1.25
16+
// https://go.dev/cl/714800 (1.26) changes size of the schedt.midle field.
17+
//go:build amd64 && !go1.25 && !go1.26
1718

1819
#include "textflag.h"
1920

pkg/sync/runtime_spinning_go125_amd64.s

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
// limitations under the License.
1414

1515
// https://go.dev/cl/669235 (1.25) adds a new schedt field prior to nmspinning.
16-
//go:build amd64 && go1.25
16+
// https://go.dev/cl/714800 (1.26) changes size of the schedt.midle field.
17+
//go:build amd64 && go1.25 && !go1.26
1718

1819
#include "textflag.h"
1920

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// Copyright 2018 The gVisor Authors.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
// https://go.dev/cl/669235 (1.25) adds a new schedt field prior to nmspinning.
16+
// https://go.dev/cl/714800 (1.26) changes size of the schedt.midle field.
17+
//go:build amd64 && go1.25 && lgo1.26
18+
19+
20+
#include "textflag.h"
21+
22+
#define NMSPINNING_OFFSET 116 // +checkoffset runtime schedt.nmspinning
23+
24+
TEXT ·addrOfSpinning(SB),NOSPLIT|NOFRAME,$0-8
25+
LEAQ runtime·sched(SB), AX
26+
ADDQ $NMSPINNING_OFFSET, AX
27+
MOVQ AX, ret+0(FP)
28+
RET

0 commit comments

Comments
 (0)