Commit 5ec7a413 by Ian Lance Taylor

re PR other/29842 ([meta-bug] outstanding patches / issues from STMicroelectronics)

	PR go/29842
    runtime: update HURD support for mOS now being embedded
    
    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/210285

From-SVN: r279062
parent 1a880ef2
e32651d37e0c43bb7595ac94363b079610bed746 f04751699e1a1ce98fe8bdbcce5a00f1be6a7d15
The first line of this file holds the git revision number of the last The first line of this file holds the git revision number of the last
merge done from the gofrontend repository. merge done from the gofrontend repository.
...@@ -39,7 +39,7 @@ func sem_timedwait(sem *_sem_t, timeout *timespec) int32 ...@@ -39,7 +39,7 @@ func sem_timedwait(sem *_sem_t, timeout *timespec) int32
//go:nosplit //go:nosplit
func semacreate(mp *m) { func semacreate(mp *m) {
if mp.mos.waitsema != 0 { if mp.waitsema != 0 {
return return
} }
...@@ -52,7 +52,7 @@ func semacreate(mp *m) { ...@@ -52,7 +52,7 @@ func semacreate(mp *m) {
if sem_init(sem, 0, 0) != 0 { if sem_init(sem, 0, 0) != 0 {
throw("sem_init") throw("sem_init")
} }
mp.mos.waitsema = uintptr(unsafe.Pointer(sem)) mp.waitsema = uintptr(unsafe.Pointer(sem))
} }
//go:nosplit //go:nosplit
...@@ -62,7 +62,7 @@ func semasleep(ns int64) int32 { ...@@ -62,7 +62,7 @@ func semasleep(ns int64) int32 {
var ts timespec var ts timespec
ts.setNsec(ns) ts.setNsec(ns)
if sem_timedwait((*_sem_t)(unsafe.Pointer(_m_.mos.waitsema)), &ts) != 0 { if sem_timedwait((*_sem_t)(unsafe.Pointer(_m_.waitsema)), &ts) != 0 {
err := errno() err := errno()
if err == _ETIMEDOUT || err == _EAGAIN || err == _EINTR { if err == _ETIMEDOUT || err == _EAGAIN || err == _EINTR {
return -1 return -1
...@@ -72,7 +72,7 @@ func semasleep(ns int64) int32 { ...@@ -72,7 +72,7 @@ func semasleep(ns int64) int32 {
return 0 return 0
} }
for { for {
r1 := sem_wait((*_sem_t)(unsafe.Pointer(_m_.mos.waitsema))) r1 := sem_wait((*_sem_t)(unsafe.Pointer(_m_.waitsema)))
if r1 == 0 { if r1 == 0 {
break break
} }
...@@ -86,7 +86,7 @@ func semasleep(ns int64) int32 { ...@@ -86,7 +86,7 @@ func semasleep(ns int64) int32 {
//go:nosplit //go:nosplit
func semawakeup(mp *m) { func semawakeup(mp *m) {
if sem_post((*_sem_t)(unsafe.Pointer(mp.mos.waitsema))) != 0 { if sem_post((*_sem_t)(unsafe.Pointer(mp.waitsema))) != 0 {
throw("sem_post") throw("sem_post")
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment