Skip to content

Commit 4bb13de

Browse files
committed
bump toolchain
1 parent 96c980f commit 4bb13de

File tree

7 files changed

+14
-15
lines changed

7 files changed

+14
-15
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ Current release level
4545
[![GitHub release](https://img.shields.io/github/v/release/usbarmory/tamago-go)](https://github.com/usbarmory/tamago-go/tree/latest) [![Build Status](https://github.com/usbarmory/tamago-go/workflows/Build%20Go%20compiler/badge.svg)](https://github.com/usbarmory/tamago-go/actions)
4646

4747
The current release for the [TamaGo modified Go distribution](https://github.com/usbarmory/tamago-go) is
48-
[tamago1.24.6](https://github.com/usbarmory/tamago-go/tree/tamago1.24.6),
49-
which [adds](https://github.com/golang/go/compare/go1.24.6...usbarmory:tamago1.24.6)
50-
`GOOS=tamago` support to go1.24.6.
48+
[tamago1.25.0](https://github.com/usbarmory/tamago-go/tree/tamago1.25.0),
49+
which [adds](https://github.com/golang/go/compare/go1.25.0...usbarmory:tamago1.25.0)
50+
`GOOS=tamago` support to go1.25.0.
5151

5252
Binary releases for amd64 and armv7l Linux hosts [are available](https://github.com/usbarmory/tamago-go/releases/latest).
5353

amd64/smp.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ func (t *task) Write(addr uint) {
6868
// (see [CPU.InitSMP]).
6969
//
7070
// On `GOOS=tamago` Go scheduler M's are never dropped, therefore the function
71-
// is invoked only once per AP.
71+
// is invoked only once per AP (i.e. GOMAXPROCS-1).
7272
func (cpu *CPU) Task(sp, mp, gp, fn unsafe.Pointer) {
7373
t := &task{
7474
sp: uint64(uintptr(sp)),
@@ -77,7 +77,7 @@ func (cpu *CPU) Task(sp, mp, gp, fn unsafe.Pointer) {
7777
pc: uint64(uintptr(fn)),
7878
}
7979

80-
if cpu.init+1 >= runtime.NumCPU() {
80+
if cpu.init+1 >= runtime.GOMAXPROCS(-1) {
8181
panic("Task exceeds available resources")
8282
}
8383

@@ -113,7 +113,6 @@ func (cpu *CPU) procresize() {
113113
runtime.ProcID = cpu.ID
114114
runtime.Task = cpu.Task
115115

116-
runtime.SetNumCPU(n)
117116
runtime.GOMAXPROCS(n)
118117
}
119118

doc/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ var SocketFunc func(ctx context.Context, net string, family, sotype int, laddr,
101101

102102
<a name="Task"></a>Task describes the optional [runtime.Task](<https://pkg.go.dev/runtime/#Task>) function, which can be set to provide an implementation for HW/OS threading \(see \`runtime.newosproc\`\).
103103

104-
The call takes effect only when [runtime.NumCPU](<https://pkg.go.dev/runtime/#NumCPU>) is greater than 1 \(see [runtime.SetNumCPU](<https://pkg.go.dev/runtime/#SetNumCPU>)\) and it is invoked at most ncpu-1 times.
104+
The call takes effect only when [runtime.GOMAXPROCS](<https://pkg.go.dev/runtime/#GOMAXPROCS>) is greater than 1 and it is invoked at most GOMAXPROCS\-1 times.
105105

106106
For an example see package [amd64 SMP initialization](<https://github.com/usbarmory/tamago/blob/master/amd64/smp.go>).
107107

doc/api_doc_stub.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,8 @@ var SocketFunc func(ctx context.Context, net string, family, sotype int, laddr,
210210
// Task describes the optional [runtime.Task] function, which can be set to
211211
// provide an implementation for HW/OS threading (see `runtime.newosproc`).
212212
//
213-
// The call takes effect only when [runtime.NumCPU] is greater than 1 (see
214-
// [runtime.SetNumCPU]) and it is invoked at most ncpu-1 times.
213+
// The call takes effect only when [runtime.GOMAXPROCS] is greater than 1 and
214+
// it is invoked at most GOMAXPROCS-1 times.
215215
//
216216
// For an example see package [amd64 SMP initialization].
217217
//

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module github.com/usbarmory/tamago
22

3-
go 1.24.6
3+
go 1.25.0

internal/reg/reg16.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ func Or16(addr uint32, val uint16) {
7373
// cannot be used before runtime initialization with `GOOS=tamago`.
7474
func Wait16(addr uint32, pos int, mask int, val uint16) {
7575
for Get16(addr, pos, mask) != val {
76-
if runtime.NumCPU() == 1 {
76+
if runtime.GOMAXPROCS(-1) == 1 {
7777
runtime.Gosched()
7878
}
7979
}
@@ -87,7 +87,7 @@ func WaitFor16(timeout time.Duration, addr uint32, pos int, mask int, val uint16
8787
start := time.Now()
8888

8989
for Get16(addr, pos, mask) != val {
90-
if runtime.NumCPU() == 1 {
90+
if runtime.GOMAXPROCS(-1) == 1 {
9191
runtime.Gosched()
9292
}
9393

internal/reg/reg32.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ func Or(addr uint32, val uint32) {
114114
// cannot be used before runtime initialization with `GOOS=tamago`.
115115
func Wait(addr uint32, pos int, mask int, val uint32) {
116116
for Get(addr, pos, mask) != val {
117-
if runtime.NumCPU() == 1 {
117+
if runtime.GOMAXPROCS(-1) == 1 {
118118
runtime.Gosched()
119119
}
120120
}
@@ -128,7 +128,7 @@ func WaitFor(timeout time.Duration, addr uint32, pos int, mask int, val uint32)
128128
start := time.Now()
129129

130130
for Get(addr, pos, mask) != val {
131-
if runtime.NumCPU() == 1 {
131+
if runtime.GOMAXPROCS(-1) == 1 {
132132
runtime.Gosched()
133133
}
134134

@@ -146,7 +146,7 @@ func WaitFor(timeout time.Duration, addr uint32, pos int, mask int, val uint32)
146146
// runtime initialization.
147147
func WaitSignal(exit chan struct{}, addr uint32, pos int, mask int, val uint32) bool {
148148
for Get(addr, pos, mask) != val {
149-
if runtime.NumCPU() == 1 {
149+
if runtime.GOMAXPROCS(-1) == 1 {
150150
runtime.Gosched()
151151
}
152152

0 commit comments

Comments
 (0)