text:
The Moral Realism of 'Megamind'
David Breitenbeck - February 01, 2022
As occasionally happens, the year 2010 saw the release of two otherwise unrelated films premised on essentially the same basic idea: in this case it was animated comedies centered around supervillains.
Of the two, Despicable Me became a powerhouse franchise with three films and counting, two spin-offs, and endless cultural exposure through its "minions" becoming practically the new mascots of Universal.
Meanwhile the comparatively obscure cult classic Megamind had to content itself with merely being the superior film.
What Makes Megamind the Superior Film
There's really a lot that could be said about this movie. I wouldn't call it a great film: there are some gaps in the writing and not all the jokes land (though most of them do). But it is a very good film, with strong storytelling, endlessly quotable dialogue ("I'm in a heated existential discussion with this dead-eyed plastic desk toy"), and some really good superpowered action scenes. It's one of that best brand of satire (like the superior Galaxy Quest or the superlative Princess Bride) which provides all the real thrills, joys, and fun of the works it's parodying even as it uses the material for comedy.
But even rarer than that, it's a villain-centric story that doesn't try to undermine the moral premise of its source material. Unlike, say, Wicked (where the Wicked Witch of the West is a persecuted outcast, Glinda is a ditzy collaborator, and the Wizard is a corrupt monster), Megamind takes an unexpected and much more interesting approach to the Superman formula.
The set up: in 'Metro City', the superhero Metro Man (who is Superman in all but name) wages perpetual war against the evil Megamind (who is something of a cross between Lex Luthor and Brainiac, being an evil supergenius alien). The supervillain's plots mostly involve kidnapping Metro Man's ostensible girlfriend, intrepid reporter Roxanne Ritchie (you get the idea).
At the start of the film their battle has been going on for so long and has become so predictable that almost no one takes it seriously anymore. Oh, they mostly all play their roles, but the truth is that they're, as one character later describes it, just going through the motions.
In particular, the damsel in distress is so jaded that she doesn't even flinch at any of the villain's deathtraps and spends most of her hostage time sniping at him ("Can someone stamp my frequent kidnapping card?" "You of all people should know we've discontinued that promotion"). In any case, no one, least of all Megamind himself, actually expects him to win.
But then the unthinkable happens: he does.
Which leads into the central idea of the film: what does a villain – this kind of villain – do without a hero? The first step is pretty predictable: Megamind takes over the city and indulges in a crime wave, able to do whatever he wants with no one to stop him, only to quickly find that he's become bored and existentially depressed. Having defined himself as 'the bad guy', he now realizes that he has no purpose without a 'good guy' to challenge him. This leads to a scene where he and Roxanne end up both standing before a giant statue of Metro Man, wondering what to do in a world without a hero.
Up until now the film has been fun, though fairly standard parody fare. But it's about this point that things start getting very interesting.
Character Based on Action Rather Than Identity
The story diverges into two distinct threads for most of the second act: in one Megamind hits on the idea to create a new hero to take Metro Man's place, and via some cartoon sci-fi nonsense accidentally ends up bestowing the superhero's powers on Roxanne's shiftless cameraman, Hal. Seeing a perfect tale of untapped potential in the dumpy loser, he sets out to train him as a hero (using a previously-established holographic watch to disguise himself into a hilarious caricature of a certain iconic actor).
The other thread has Megamind using that same device to start a relationship with Roxanne in disguise. During this he not only helps to 'battle' himself ("I tried my best, but he's too fantastic!"), but also gets to experience life as a 'normal' person. This leads to some lovely, heartfelt moments, like when he's left stunned at receiving physical affection for perhaps the first time in his life.
More importantly, it gives him a chance to discover that his villainy, petty though it may be, nevertheless has consequences. The city is now littered with trash and debris, the enriching cultural sites are emptied, and the people live in a constant state of anxiety because of him. His lashing out at how hard life has been for him only serves to make life harder for everyone else.
But it isn't just the common people who have to suffer the effects of his actions: Megamind discovers that they have real, negative consequences for himself as well. Not from being punished, but simply because they are what they are.
As in all secret romance plots, there comes a moment where Megamind asks Roxanne if she would still like him if he weren't normal: "Say I had the complexion of a popular primary color, as a non-specific, random example." She responds with the standard answer that you don't judge people by how they look, but on their actions. Only, as he realizes a moment after she says it, that's no comfort to a supervillain.
Then, when his secret is revealed (it's a hardly a spoiler to say that that happens), he tries to plead his case by asking, "what about not judging a book by its cover?" But she throws that right back in his face with a list of his many crimes, concluding, "Do you think I would ever be with you?" To which, of course, there's only one answer. The bad guy doesn't get the girl.
This is really the point that Megamind has to get through his giant blue head: his marginalization and his status as a villain are not simply because he isn't 'normal'. He hasn't been left out in the cold because of privilege or convention or anything of the kind, but because of his own choices. His looking different and having had a rough childhood do not excuse his actions.
How Evil Really Looks
And now we come to the second major thread. As noted, all this time Megamind has been training Hal to become the new hero, Titan ("It was the only name I could trademark"). Still operating on a 'good means privileged' paradigm, Megamind assumes that, when gifted with amazing powers and the right coaching, Hal will naturally behave the same way that Metro Man did.
But it doesn't work like that. Hal isn't a 'mute, inglorious Milton' just waiting his chance to reveal his untapped potential. He's a self-centered, amoral idiot seething with resentment, and whose mediocrity is due only to the fact that he lacked the character or capacity to do anything really bad. Granted superpowers, all he can think about is how to make them benefit himself, which soon devolves into simply enacting revenge on a world he feels has wronged him.
Tighten (sic. Superpowers don't make Hal any smarter) is a surprisingly frightening villain for what is otherwise a lighthearted comedy. He starts out as a dumpy idiot with an underlying creeper vibe and boundary issues. Then when he goes off the rails, he becomes an angry, sadistic, and downright murderous monster. And all with Superman-level powers.
In short, Megamind was playing at being evil. Hal is the real deal.
This leads to a climax where the Superman formula plays out once again, only this time 'Lex Luthor' is the hero and 'Superman' is the villain (though done without subverting the actual 'Superman' of the film). Also, unlike the opening, this time it's played completely straight: the villain is really evil, the girl is really in danger, and the hero is really required to be brave and self-sacrificing.
The result of all this is something like a deconstruction of a deconstruction. We take a protagonist who thinks he lives in a world where good and evil are only matters of privilege and convention and tell the story of him discovering that this isn't the case: past hardships aren't an excuse for causing harm, bad actions carry their own consequences, and real evil isn't at all fun or cool, but crass, small-minded, and ugly. And on the other side, goodness requires self-sacrifice and hard work, but likewise comes with its own, much richer rewards.
The Best Kind of Satire
Topping if off is the fact that, whether by accident or design, the final step in Megamind's redemption comes when he confesses his sins to another character, foregoing any excuses, admitting that he was fully in the wrong, and asking only for the chance to try to make things right.
But the best part, and what truly makes the film stand out, is that even after we've moved from a world of cartoon morality into one of the real thing, the structure that we're presented with remains exactly the same. Again, it's still good versus evil, still the 'eternal trio' of hero, villain, and girl. What has changed is who is in what role, but more importantly the fact that there are now real stakes and no one is just playing a part.
That is why I put this as one of the best type of satire: because here the parody is used, not to undermine the moral premise of the original, but rather to reaffirm it.
Photo Credit- aminoapps. com
Dispicable Me Megamind Galaxy Quest Princess Bride Wicked Metro City Metro Man Lex Luther Brainiac Roxanne Ritchie Hal Titan Missle Titan Parody Satire
David Breitenbeck
David Breitenbeck is a professional writer, Catholic traditionalist, and fiction enthusiast. He is the author of several books, including The Ten Commandments of Murder and The Wisdom of Walt Disney.
The Ghost in the Vaccines- A Religious Objection to the Covid Vaccines
The Long Dark Fortnight of the Soul- Reflections on Surviving Covid.


text:
The Kissing Bug
A True Story of a Family, an Insect, and a Nation's Neglect of a Deadly Disease
by Daisy Hernández
Decrease quantity for The Kissing Bug
Increase quantity for The Kissing Bug
"An absolutely essential perspective on global migration, poverty, and pandemics." —Amy Stewart, author of Wicked Bugs
Who does the United States take care of, and who does it leave behind? A necessary investigation of infectious disease, poverty, racism, and for-profit healthcare—and the harm caused by decades of neglect.
Growing up in a New Jersey factory town in the 1980s, Daisy Hernández believed that her aunt had become deathly ill from eating an apple. No one in her family, in either the United States or Colombia, spoke of infectious diseases. Even into her thirties, she only knew that her aunt had died of Chagas, a rare and devastating illness that affects the heart and digestive system. But as Hernández dug deeper, she discovered that Chagas—or the kissing bug disease—is more prevalent in the United States than the Zika virus.
After her aunt's death, Hernández began searching for answers. Crisscrossing the country, she interviewed patients, doctors, epidemiologists, and even veterinarians with the Department of Defense. She learned that in the United States more than three hundred thousand people in the Latinx community have Chagas, and that outside of Latin America, this is the only country with the native insects—the "kissing bugs"—that carry the Chagas parasite.
Through unsparing, gripping, and humane portraits, Hernández chronicles a story vast in scope and urgent in its implications, exposing how poverty, racism, and public policies have conspired to keep this disease hidden. A riveting and nuanced investigation into racial politics and for-profit healthcare in the United States, The Kissing Bug reveals the intimate history of a marginalized disease and connects us to the lives at the center of it all.
Publisher: Tin House Books

redpajama_set_name: RedPajamaCommonCrawl


Cheap Air Force 1, En 2007, pour ses 25 ans, Nike a fait appel à un manufacturier italien pour réaliser les AF1 Lux Masterpiece en Croco et Anaconda vendues à 1500 $. La AF1 . Cheap Nike Air Force 1 Sneakers for Sale 2017, Authentic Real Nike Air Force 1 Shoes Outlet Online, Air force mid white on feet an up close view of air force all white mid the nike air force white on white how to wear air force ones high tops air force mid white on . Cheapest Air Force 1 Sale for Mens Womens and Mens, Top quality Fake Replica Nike Air Force 1 Wholesale from China, enjoy more 58% discount off here, and get free shipping with Nike originals box. Black nike girl running shoes a classic with character,the nike air force black nike girl . nike air force 1 high,nike air force 1 womens,nike air force 1 wheat .
Nike Air Force 1 Low Pairs "Oreo Flyknit With Silt Red. June 25, 2017 BY Zack Schlemmer / 4.5 / 5 . March 25, 2016 BY Patrick Johnson / 4.59 / 5 .
Results 1 - 25 of 574618 - Nike Air Presto Essential Running Sneakers Mesh Blue White Mens . Nike Air Force 1 Low Retro Men's Shoes Black/White/Varsity Red .
White Air Force 1 07, part of the Mens Nike Trainers range available at schuh with FREE standard delivery*.
6 hours ago - Geeignete Schuhe für den Herbst und den Winter, ungefähr nur 10-Mal angehabt (in einem super guten.,Nike Air Force 1 high top oliv-grün in .
Nike Air Force 1 Low - Boys' Preschool $57.99 $49.99. Ships Free. Nike KD 9 - Boys' Preschool - Kevin Durant - Off-White / Grey Nike KD 9 - Boys' Preschool . Nike LeBron XIV - Boys' Preschool - LeBron James - Black / Red Nike LeBron XIV .
2005 Nike Air Force 1 Low WHITE OBSIDIAN NAVY BLUE ICE CUBE CLEAR 306353-113 13 | Ropa, calzado y accesorios, Calzado para hombres, Artículos .
Oct 9, 2012 - So before compiling this list of The 100 Best Nike Air Force 1s of All Time, . "The Livestrong x Mr Cartoon AF1 is the most prized AF1 in my .
Kolekcja kultowych NIKE AIR FORCE Wysoka Jakość Wykonania, Amortyzowana Podeszwa. Doskonałe Uzupełnienie Miejskich Stylizacji. Darmowa dostawa .
LeBron James Championship Edition Nike Air Force One 25th Anniversary | eBay!
Free shipping. •MEN SIZE 10.5 NIKE AIR FORCE 1 SUPREME HI QS HIGH BURGUNDY BROWN TISCI PREMIUM . Nike-air-force-1-High-Top-Size-10- .
nike air force 1 high retro. Nike air force low men's.Nike air force.Now light retro covers this latest edition of the nike air force high with.Width d medium.
London Shop Nike Air Force 1 High 07 Men's Shoe - Black/White Nike 315121-040 online on boucherperformance.com. Enjoy the savings on clearance New .
Nike air force. Women find women's air force. Shoes at enjoy free shipping nike air force. Women nike air force. Suede and returns in the us with suede nike air .
Product Details. Sneakers by Nike. Smooth matte leather upper; Mid-top design with signature swoosh logo; Adjustable strap and lace-up fastening; Padded .
Rumor to have approx. 500 pairs made. the sneakers are a men's' size 9.50. Release Date 7/22/2017. | eBay!


The Team Managers meeting for the National Road Relays 2017 will be held atthe Lake City Athletic Club rooms at 7pm on Friday 29th September.
Team managers must attend this meeting.
The Lake City Club rooms are situated at Neil Hunt Park, off Tarawera road, Rotorua.
Turn up Tarawera Road from the roundabout on Te Ngae Road, take the first left off Tarawera Road into Neil Hunt Park and travel straight ahead into the carpark in front of the clubrooms.


text:
South Jersey Sports Varsity Living Dining Obituaries eNewspaper Legals
UPDATE: 1 killed, 6 injured in Florence fire
Courier-Post Staff
One person was killed in a fast-moving fire at a Florence condominium complex Friday night, according to township police.
Firefighters and police were dispatched at 9:32 p.m. to 39 Florence Tollgate. Upon arrival, firefighters found flames through the roof of the second-story units. The blaze was brought under control around 11:30 p.m.
The name of the deceased has not been released pending notification of the next of kin. Six other people were transported to area hospitals with non-life-threatening injuries.
The American Red Cross was on location to assist some of the displaced residents.
Stratford man charged with murdering wife
Earlier Friday at approximately 8:55 p.m., a large brush fire was reported in West Deptford outside the Sunoco Logistic Tank Farm. Approximately 25 acres were ablaze at the site at 1250 Crown Point Road, according to police-scanner reports.
© 2023 www.courierpostonline.com. All rights reserved.


Place the cream, milk, icing sugar, vanilla and matcha in a large jug and whisk until the sugar and matcha are dissolved.
Divide the mixture between 2 large zip-lock bags, pressing out as much air as possible, and seal. Lay each bag flat on a baking tray and freeze for 2½ hours or until firm and just frozen.
Remove the bags from the freezer and, using your hands, gently bend each bag to break up the mixture into small pieces.
Place the mixture in a food processor, in 2 batches, and process for 1–2 minutes or until just smooth, breaking up any large pieces with a spoon. Spoon into a 2-litre-capacity loaf tin and freeze for 2 hours or until firm.
While the mixture is freezing, make the pistachio and white chocolate cones. Place the chocolate and pistachio in separate small bowls. Dip the top of 1 of the cones into the chocolate, tapping lightly to remove any excess. Dip into the pistachio to coat and place upright in a glass to set. Repeat with remaining cones.
Scoop the ice-cream into the cones to serve. Makes 1.6 litres and 6 cones.
+ Matcha is a powdered green tea from Asian food stores and tea stores.


Seth Rollins has been dealing with a back injury in recent times and due to it the Architect has been kept away from in-ring competition since his victory at the Royal Rumble PPV.
His status has kept fans worried with many wondering if the company could call his WrestleMania match with Brock Lesnar off, if the former Champion is not cleared to wrestle at the show.
Meltzer provided a similar update on Rollins' condition on Wrestling Observer Radio, claiming he "could wrestle tomorrow" if needed by the company.
With this update, it's clear that Seth Rollins' WrestleMania match with Brock Lesnar is not in jeopardy and it's only a matter of time before he is back into the ring.


text:
Positive Technologies Releases Financial Application Vulnerabilites Report
Two thirds of online banks still have at least one critical vulnerability, even as the numbers decline
Positive Technologies has today announced the findings of its annual report on the state of e-banking security. The Financial Application Vulnerabilities Report, drawn from audits performed by the company, finds that two thirds of online banking systems still contain at least one critical vulnerability. The good news is that the percentage of critical vulnerabilities is falling each year. For example, high-risk vulnerabilities were found on 90 percent of systems in 2015; by 2016, this number dropped to 71 percent; and, in 2017 it dropped further to 56 percent. Despite this encouraging trend, security shortcomings remain a menace for banks and clients.
Each e-banking system analyzed in 2017 contained, on average, seven vulnerabilities; this up from six in 2016. However, high- and medium-risk vulnerabilities made up a smaller portion, yet only a third of online banks were free of critical vulnerabilities in 2017, whereas in 2016 all financial web applications (except one) had at least one.
The most common online bank vulnerabilities in 2017 were Cross-Site Scripting (75% of systems) and poor protection from data interception (69%), allowing attacks such as reading cookie values or stealing customer credentials. Over half of online banks (63%) had "insufficient authorization," a critical vulnerability that enables an attacker to obtain unauthorized access to web application functionality intended for privileged users.
Ultimately, 94 percent of online banks had vulnerabilities that criminals could use to obtain sensitive banking records and personal information.
"While 2017 brings hope that banking applications may actually become secure in the future, they still have a long, long way to go," said Leigh-Anne Galloway, Cyber Security Resilience Lead at Positive Technologies. "We've seen many positive, across-the-board improvements in the security of both online, as well as mobile, banking applications. But, the bottom line is that clients' personal information—not to mention the bank's money—is still at risk."
Galloway added: "In 13 percent of applications, we found Arbitrary Code Execution vulnerabilities, which a hacker can exploit to gain full control over a bank's server, with resulting reputational damage and financial losses for the bank. This is concerning."
Half of mobile banking applications contain critical vulnerabilities
The situation with mobile banking apps is similar. Almost half (48%) of mobile banking apps still contained at least one critical vulnerability. In 52 percent of cases, attackers could exploit vulnerabilities to decrypt, intercept, or bruteforce accounts to access the mobile app or bypass authentication entirely. These actions would effectively give the attacker total control over the account of a legitimate user.
That's the bad news. But, as with e-banking apps, there's good news in that here as well, the proportion of total vulnerabilities fell year over year. This for both high-risk (29% vs. 32% in 2016) and medium-risk vulnerabilities (56% vs. 60% in 2016). Low-risk vulnerabilities became more dominant as a result of companies prioritizing fixes for critical vulnerabilities.
On average but perhaps unsurprisingly, iOS apps are better protected than Android, even when created by the same bank. High-risk vulnerabilities on iOS accounted for only 25 percent of total vulnerabilities, compared to 56 percent on Android. In some cases, the iOS mobile app was free of vulnerabilities that were found present in the corresponding Android app.
Systems developed by vendors have become safer
In 2016, in-house applications contained half the number of vulnerabilities as commercially available platforms. However, in 2017 the situation reversed: out-of-the-box solutions actually contained fewer critical vulnerabilities. Vendors have started to pay more attention to security, whereas banks still lack experienced developers and well-implemented Secure Software Development Lifecycle processes.
In addition to analyzing the security of applications, which almost all banks do regularly, Positive Technologies' experts also recommend auditing application source code. Such audits are necessary, even for vendor-provided systems as vulnerabilities can arise in the process of deployment or simple configurations. Preventive measures, such as a web application firewall, are necessary to provide temporary protections against exploitation of vulnerabilities until they can be fixed. And, banks must conduct ongoing security effectiveness checks as part of their remediation processes.
For companies that write their own financial applications in-house, the key is to pay more attention to security at early stages and continue doing so throughout the process of design, requirements setting, and development.
For additional details, please download the full report at https://www.ptsecurity.com/ww-en/premium/fin-vulnerabilities-2018/


Every artist needs a KUM. The KUM Wood Cutter 2-hole pencil sharpener is an eco-frienly, precision sharpening instrument. It's great for sharpening standard pencils (8 mm) and large pencils (up to 10.5 mm). So toss one in your pocket or pencil bag and you're ready to go!
Tired of your pencil being chewed up and the tip breaking off in the sharpener? KUM's specially designed "Dynamic Torsion Action" blades will give you sharper pencils with less waste. Flexible, high-carbon steel blades are long-lasting, very sharp, and allow for a smoother, cleaner cut.
This wedge-shaped sharpener is made of FSC-certified wood, and contains replaceable blades.
LYRA STOCKMAR Art makes Sense ; LYRA COLOR-GIANT and LYRA Super FERBY .


Hagar wandered in the dry desert of Beersheba with her young son, rejected, alone, despised, homeless, an outcast. Eventually she ran out of water and when all hope was gone, with her son about to die of thirst, she sat down and wept bitterly. God heard the crying and He opened her eyes to see a well of water that was near her.
An interesting part of this story to me is that there was plenty of water near by, but for some reason, Hagar could not see it. Their crying caused God to open her eyes and to be able to see the resources already around her. We can have 20/20 vision and still be blind (Revelation 3:17). God is our ultimate source, not what we are able to see or obtain with our own eyes and strength.
God will hear your cry too, and there may be a well of water right beside you as you walk through your own personal desert. Sometimes He can make a little go a long, long way. Cry out to the Lord and put your trust in Him, for it is He that causes the blind to see.
Amen Lord Jesus, help me to make the right decisions in life and give me the wisdom to discern my options.
Amen,Jesus help us make the right decisions and lead us for your glory.
Lord I am crying out to you, nevertheless, not my will but your will be done during this period of adversity in my Life.
I reflect over 2000years ago when Jesus was going through His test, He wished the Father would take the cup away and he said those very words nevertheless, it is not my will but thy will be done. And He arose triumphantly. Like Him I will arise out of my adversity in Jesus name.
Prayer: Heavenly Father please open my eyes to see the resources around me. Help me put what You have already given me to the best use. Help me make the right decisions and give me wisdom in life management, in the name of Jesus Christ I pray. Amen.
Father, I have a new job. Open my eyes to hear the lessons I need to learn to become proficient in helping those I am there to serve. Help me to help them. Lord, please block the enemy and his negativity as I attempt to serve and help others. Keep me focused on on why I am there and on serving you. In Jesus name I pray, Amen.
Heavenly Father thank You for giving me the opportunity to have You in my life, open my eyes to see what is surrounding me and use it for You .I humbly ask for Your forgiveness, in Jesus name I pray. Amen.
Great devotional, God bless you Pastor.
You are always right on the words. Thank you Pastor.
Amen Amen Amen. Help me find resources to help my grandchildren progress. Hallelujah praise God.
I loved this. It's a concept I think we all forget at one time or another. We get so involved worrying about and trying to solve our problems that we don't see the solution that God has already provided right next to us. I have read this passage many times and never thought about that.
God's blessings are all around us we just need to pray to be able to see them. Lord please Open my eyes to see the resources around me and all you have blessed me with. Help me to use all of the gifts you have given me for your glory. Help me to always see you in everything I have and everything that I see. Help me to make the correct decisions and thank you for always guiding me and opening my eyes to your plans for my Life. I am so blessed and I know that you are my redeemer, my protector and my provider.


Tranquil estate living in the heart of the peninsula. Elegant, open main floor; perfect for entertaining. Heritage features rarely found: plaster cove mouldings, large solid wooden doors and wainscotting, coffered ceiling. Huge finished attic. Contrast this with custom kitchen and bathrooms featuring highest quality fixtures and decor. New furnace, electrical, windows and roof. Private south facing deck with hot tub. Detached double garage with large driveway onto Norwood St. providing easy access to highways or downtown. Side garden lot adds to the potential for this exceptional property. Lovely walk to the Waegwoltic Club, private and public schools, universities and hospitals.


text:
Stories from J 2 Manhattan at Sla307 Art Space, NYC. October 13 - 28, 2017
OPENING RECEPTION: FRIDAY, OCTOBER 13, 6 - 9PM
GALLERY HOURS: WED - SAT, 12PM - 6PM
CLOSED OCTOBER 21
Sla307 Art Space is pleased to present a solo exhibition of new work by Vytenis Jankūnas entitled Stories from J 2 Manhattan. This is Jankūnas' third solo show in New York City and will be on view from October 13 through October 28, 2017. On display are three 5 min length movies on a large-scale video projection and a multi-screen TV display installation, running in a constant loop.
The single-channel HD video projection J 2 Manhattan & Back 24-7-365 Part 1, 2 and 3 is made entirely of photo stills. The artist captured these photographs while traveling through New York City via the "J" train – from Queens to Manhattan via Brooklyn. Jankūnas took these photos on the train every day between the two locations for more then three years. The hundreds of photos are organized and displayed side by side on three vertical interchangeable slides. They display the changing scene on one subway car bench through the duration of a year. Vytenis Jankūnas states, "They tell the story of my everyday travels and reveal the multicultural nature of the New York City metropolis."
J 2 Manhattan - The Eternal Traveler Syndrome in a Circular Motion is an installation of 12 flat TV screens featuring a constant circular motion of arriving and departing trains. It resembles an eternal traveler caught in a never-ending routine journey like the artist himself.
Sla307 Art Space
307 W. 30th St. New York, NY 10001
Email: artspace@sla307.com
Source: http://www.sla307.com/ Tags: exhibition, solo
The latest news and info about Vytenis Jankūnas' shows and other activity.
In Other Places II - 2018.10.30 - 2018.11.17
The exhibitions cycle "In other places" presents Lithuanians artist, who live and create abroad.
KAUNAS IN ART. SO CLOSE. SO FAR. VIII Contemporary Art Festival in Kaunas, October 17 – November 25, 2018.
International Contemporary Art Festival, held for the 8th time, invites to Kaunas city to explore contemporary artists creation gathered from around the globe to the second biggest town in Lithuania.
New art album "Readdressed 2. Lithuanian and Litvak Graphics, Sculpture, Photography, Contemporary Art in the Lithuanian Expatriate Art Foundation"
This second volume titled "Readdressed 2" continues the visual narrative about the art created by Lithuanian artists scattered all over the world in the period from the 1940s until nowadays.
Sla307 Art Space is pleased to present a solo exhibition of new work by Vytenis Jankūnas entitled Stories from J 2 Manhattan. This is Jankūnas' third solo show in New York City and will be on view from October 13 through October 28, 2017.
J 2 Manhattan & Back 24-7-365 in HD Parts 1-3 at Art Vilnius '17. June 8-11
3 video shorts from J 2 Manhattan & Back 24-7-365 in HD series by Vytenis Jankūnas are shown with in Art Vilnius '16 Special Projects program.
Exhibition "From Realism to the Object. Lithuanian World Art in the Collection of the Lithuanian Expatriate Art Foundation" in Vilnius, 2017
The Lithuanian Expatriate Art Foundation has selected works of high artistic value from its large and rich collection that have been exhibited in galleries and museums worldwide.
Vytenis Jankūnas: "Į SITUACIJAS ŽIŪRIU KAIP Į MENO KŪRINIUS"
Dvidešimt metų Niujorke gyvenantis tapytojas ir fotografas Vytenis Jankūnas neseniai surengė fotografijų instaliacijų parodą "Stuck on the Train" Niujorke, Vašingtone, Vilniuje ir Taline. Su menininku kalbėjomės Čelsio rajone, garsėjančiame meno galerijų gausa. Kalbėjosi Žibuoklė Martinaitytė
FestArte Video Art Festival – 15/18 December 2016, ON ART Space in Testaccio, Rome
Vytenis Jankūnas' video "J 2 Manhattan & Back 24-7-365 in HD Vol. 1" was selected for the FestArte Video Art Festival 6th Edition "Global Migration" programme.
THE ESSENTIAL MISSION OF THE PHOTOGRAPHER – TO SEE / A conversation with Vytenis Jankūnas by Julija Fomina
Excerpts from the interview originally published in Artnews.lt, 2015.12.09
"RANDOM RAPID HEARTBEATS" at Tallinn Art Hall, 22 October – 4 December 2016
Participating artists: Nina Beier (DK), Jos de Gruyter & Harald Thys (BE), Pakui Hardware (LT), Vytenis Jankūnas (US), Žilvinas Landzbergas (LT), David Maljkovič (HR), Sebastian Diaz Morales (AR/NL), Emilija Škarnulytė (LT), Curator: Kestutis Kuizinas, Assistant curator: Edgaras Gerasimovičius


The Beach & Country Guild's 48th annual Dia del Sol luncheon, "Moulin Rouge," will be held at the luxurious Fairmont Grand Del Mar on Wednesday, Oct. 18, from 10 a.m. to 1:30 p.m. The day's festivities will include a silent and live auction, children's and adult fashion shows, a gourmet lunch and more.
Moonlight Beach Bash, Encinitas's coolest beach party of the year, hits the sand on Saturday, Oct. 7 from 3-6 p.m. Free. All are welcome. Moonlight Beach Bash brings together art, music, dance, food, fun and beach culture, all the ingredients to have an awesome time at Encinitas' most popular tourist destination, Moonlight Beach.
For more information, visit EncinitasParksandRec.com, call 760-633-2740 or email encinitasparksandrec@encinitasca.gov.
Get ready to discover a treasure trove of arts and crafts by the sea when the Harvest Festival Original Art & Craft Show comes to the Del Mar Fairgrounds Oct. 13-15, featuring 24,000 handmade originals from hundreds of artists.
Don't miss an evening of excitement and thrills on Saturday, Oct. 14 at 5 p.m. at Del Mar Fairgrounds. Put on your jeans and western boots and join in the fun. Friends of San Pasqual Academy is organizing a Team Penning Event to benefit the foster teens of San Pasqual Academy.
The Forum Carlsbad and West Coast Artists present the Third Annual Art Rhythm & Wine Festival to be held at The Forum Carlsbad on Saturday, Oct. 14, 11 a.m.-7 p.m., and Sunday, Oct. 15, 11 a.m.-6 p.m. This free, juried show will feature more than 50 exceptional artists and craftsmen offering high quality original artwork from throughout the Western United States.
Mary Thompson and Martha Cox, well-known League of Women Voters presenters on civil discourse, will discuss Civic Engagement at the October meeting of the American Association of University Women Del Mar-Leucadia branch, on Saturday, Oct. 14 from 10 a.m. to noon. This may be one of the most valuable talks you attend this year as we all strive to discuss issues in a nonpartisan, civil manner with others of differing beliefs. The public is welcome to attend this free discussion held at the Encinitis Community Center, 1140 Oakcrest Park Drive, Encinitis.
Visit northcoastrep.org to purchase tickets.
Many of San Diego's top pastry chefs, caterers and bakeries will donate hundreds of traditional Thanksgiving pies for the 2017 Mama's Pie in the Sky Thanksgiving Bake Sale. The fundraiser, now in its 13th year, benefits Mama's Kitchen, a community-driven organization that provides nutrition services improving the lives of women, men and children vulnerable to hunger due to HIV, cancer or other critical illnesses. In 2016, the fundraiser was the biggest and most successful to date, netting more than $116,500 through pie sales and event sponsorships for the organization. This year, the non-profit hopes to surpass that goal raising $134,000 to fund more than 37,000 meals.
Sales begin Oct. 9 and continue through Nov. 19, 2017. Pie flavors are pumpkin, traditional apple, pecan and Dutch apple, and are available for just $25 each. Pies can be purchased online via www.mamaspies.org or by calling 619-233-6262.
California Native Plant Society-San Diego presents October Native Plant Sale in Balboa Park, Saturday, Oct. 14, 10 a.m.-3 p.m. Open at 9 a.m. to CNPS Members. Memberships available at the door.
The Art Glass Guild will host its 2017 Fall Patio Show and Sale Oct. 14-15 from 10 a.m.-5 p.m. each day at Spanish Village Art Center in Balboa Park. This event features more than 30 juried artists exhibiting their creations as attendees stroll the patio in Spanish Village. There will be entertainment for all, including live music, demonstrations featuring torch-work, and glass cutting as well as an area for children and adults to create their own unique mosaic art piece to take home.
T.E.A.M. (Training and Education about the Middle East) and StandWithUs San Diego will co-host "Real Talk" with Dr. Michael Harris at the Encinitas Public Library, 540 Cornish Drive, on Oct. 15 at 2 p.m.
Real Talk is about Israel, the BDS movement, and what's happening today on college campuses. Harris was one of the founders of the San Francisco Voice for Israel, which became the S.F. StandWithUs chapter, and like T.E.A.M., educates and counters mis-statements about Israel. He is the author of a best-selling book, Winning a Debate with an Israel-Hater. The books will be available for purchase and signing. There is no charge, but RSVP to teamisrael@gmail.com.
Gaslight Steampunk Expo is hosting an all-ages fantasy-themed festival Oct. 6-8 at the Town & Country Resort Hotel in San Diego. Guests of Honor include: Tim Powers, World Fantasy Award-winning author of Last Call and Anubis Gates; LGBT Fine Artist & Illustrator Alex Ferruzca, whose artwork evokes his love of steampunk with classic Disney characters; and local San Diego electrical engineer (retired) and 3D artist Greg Barnhart, who goes by the artist name of Vandegraaff Gearheardt, who uses variety of electronic contraptions to create motion and light activated works of art using Victorian mantle clocks.
The San Dieguito River Valley Conservancy and Sullivan Solar Power will present a free discussion on the importance of alternative energy sources, trends within San Diego County, community-choice energy, and how to navigate the solar industry.
The event will be held Wednesday, Oct. 11 at 6 p.m. at the Powerhouse in Del Mar.
Free parking options in the neighborhood off Coast Blvd. North of 17th Street, paid parking meters under the L'Auberge Hotel, along Coast Blvd., between 15th and 17th Streets.
Questions? Contact Ana Lutz ana@sdrvc.org.
Lecture: Local artist to discuss her work in alternative comics and her new book. Mary Fleener, an alternative comics artist, writer and musician who lives in Encinitas, will discuss her development as an artist, with the focus on her latest work in progress, a graphic novel about the San Elijo Lagoon told from the point of view of its wildlife.
The San Dieguito River Valley Conservancy and Thread Bumpin' are holding a free Halloween Costume Swap on Saturday, Oct. 14, from 10 a.m. to 1 p.m. at the Birdwing Openair Classroom at the San Dieguito Lagoon, 2775 Via de la Valle.
This is a swap-in/swap-out costume swap: however many pieces you bring in that's how many you take out. "Clothing swaps are a great way to connect with your community, live a more sustainable lifestyle and take home an affordable outfit," said Ana Lutz, education manager of the Conservancy. The first 20 families will have the opportunity to decorate and take home a mini pumpkin of their choice, and light refreshments will be provided to everyone. Get directions and all the details at sdrvcohthehorror.eventbrite.
Questions? Ana Lutz, Educator Manager, ana@sdrvc.org, 858-755-6956.
The African savannah is coming to life as JCompany Youth Theatre kicks off its Jubilee Season with Disney's The Lion King at The Lawrence Family Jewish Community Center, Jacobs Family Campus Garfield Theatre, 4126 Executive Drive, La Jolla running Oct. 20 through Nov. 5.
Based on the Disney's 1994 Academy Award winning animated film, the stage adaptation with music by Elton John and lyrics by Tim Rice, took Broadway by storm in 1998 winning six Tony Awards, including Best Musical.
Organizers of the third annual GI Film Festival San Diego (Oct. 18-22) announce a special preview screening of Thank You for Your Service on Thursday, Oct. 19 at 7:30 p.m. at Regal Carlsbad 12 (2501 El Camino Real). The film is rated R and will be officially released nationwide in theatres on Oct. 27. Although the screening is free, advance registration is required. To register and for more information, visit GIFilmFestivalSD.org.
The North Coast Symphony Orchestra, directed by Daniel Swem, will perform "Chills and Thrills" on Sunday, Oct. 22, at 2:30 p.m. at Seacoast Community Church, 1050 Regal Road, Encinitas, 92024. Among other eerie selections, the concert will include: Berlioz' "Dream of a Witches' Sabbath" from the "Symphonie Fantastique," Dukas' "The Sorcerer's Apprentice," and Grieg's "In the Hall of the Mountain King" from 'Peer Gynt Suite No.1." Admission: $10 general, $8 seniors/students/military, $25/family max. For more information, visit www.northcoastsymphony.com. The orchestra is funded in part by the City of Encinitas and the Mizel Family Foundation.
The El Camino Quilt Guild meets at 9:30 a.m. Thursday, Oct. 12 at its new location at Veterans Administration of North County, 1617 Mission Ave. Oceanside, CA 92058. Doors open at 9 a.m.
The October meeting includes the always popular Silent Auction. There will be beautiful fabric and all sorts of treasures for you to bid on. If you are a visitor, there will be no charge for you to join this event. There is no workshop this month.
The Carlsbad Village Association (CVA) presents a night of food, fun and friends at the Taste of Carlsbad Village on Oct. 12 from 5 p.m. to 8:30 p.m. in downtown Carlsbad Village. The event will feature more than 25 local restaurants with either sweet or savory signature dishes, and 10 sip stops serving local craft beer and wines. Non-alcoholic options such as Kombucha, cold-brewed coffee and more will also be available.
Tickets can be purchased, in advance, online at www.carlsbad-village.com or by contacting Christine Davis at (760) 644-2121. Tickets will be available the night of the event at the CVA office at the Carlsbad Visitor Center located at 400 Carlsbad Village Drive, Carlsbad.Tickets might sell out, so advance registration is highly recommended.


text:
Waldschmidt Hall (ursprünglich West Hall) ist ein akademischen Zwecken dienendes Gebäude der University of Portland in Portland im US-Bundesstaat Oregon. Das 1891 erbaute Gebäude war ursprünglich Teil der inzwischen nicht mehr bestehenden Portland University und befindet sich im Norden Portlands oberhalb des Willamette Rivers. Es wurde am 22. September 1977 dem National Register of Historic Places hinzugefügt und 1992 renoviert. Im selben Jahr erhielt es den Namen Waldschmidt Hall. In dem ältesten Gebäude auf dem Campus der Universität sind Verwaltungsbüros der Universität sowie einige Hörsäle untergebracht.

Geschichte
Mitglieder der Bischöflichen Methodistenkirche gründeten in Portland 1891 die Portland University und begannen mit der Sammlung von Geldern für den Betrieb der Schule. In diesem Jahr ließ die Universität zu Baukosten von 32.500 (2009: ) US-Dollar das fünfstöckige Gebäude errichten. Zunächst das einzige Gebäude auf dem Campus, verfügte es über Wohnräume, Hörsäle und eine Kapelle. Die Portland University hatte finanzielle Probleme und musste das Gelände 1896 verlassen, nachdem die Einrichtung Kreditraten nicht bezahlt hatte. Der Campus mit West Hall fiel an die früheren Eigentümer des Geländes zurück.

Erzbischof Alexander Christie erwarb 1901 den Campus mit dem Gebäude im Tausch für zwei Anwesen der Kirche plus einem Dollar, um eine katholische Schule aufzubauen. Im September 1901 wurde die Columbia University mit West Hall als einzigem Gebäude eröffnet. Die Schule änderte 1935 ihren Namen in University of Portland.

West Hall wurde von der Stadt Portland 1970 als historisch bedeutendes Objekt eingestuft und 1977 in das National Register of Historic Places eingetragen. 1990 wurde die Renovierung des Objekts begonnen, um es auf den neuesten Stand der Bauvorschriften zu bringen und den Verfall zu verhindern. Dabei wurden sich senkende Mauern und Zwischendecken erneuert und das Gebäude verstärkt, um es erdbebensicher zu machen. Das 5,5 Millionen Dollar teure Projekt nutzte die ursprünglichen Pläne und alte Fotografien, um das ursprüngliche Aussehen des Gebäudes und die Atmosphäre zu bewahren. Weitere Maßnahmen umfassten die Schaffung eines barrierefreien Zugangs, den Austausch der Fenster und die Restaurierung des Hartholzdielen-Fußbodens. Die Erneuerungsmaßnahmen wurden teilweise durch private Spenden finanziert und im Oktober 1993 beendet.

Im Oktober 1992 gab die Universität dem Gebäude den neuen Namen Waldschmidt Hall, womit der frühere Präsident der Universität, Paul Waldschmidt, geehrt wurde. Seit der Erneuerung des Gebäudes sind darin Büros der Universitätsverwaltung und einige Klassenzimmer untergebracht. Am 1. Mai 2001 widmete der United States Postal Service dem hundertjährigen Jubiläum der Universität eine Postkarte, auf der Waldschmidt Hall dargestellt wurde. Das computererzeugte Bild des Gebäudes ist Teil einer Serie mit historischen Denkmälern und wurde von John Pirman gestaltet.

Einzelheiten
Frederick Manson White, Richard H. Martin, Jr. und William F. McCaw waren die ursprünglichen Architekten des Gebäudes. Das im neuromanischen Stil erbaute Gebäude aus Backsteinen ist an der Außenseite mit Teilen aus Gusseisen verziert. Die Form des Gebäudes lehnt sich an Sever Hall in Harvard an und verfügt über einen breiten mit einer Kuppel versehenen Eingang.

Das Innere des 2790 m² umfassenden Gebäudes ist weitgehend aus Holz – die Wände sind mit Kirschholz vertäfelt, der Fußboden besteht aus Eichendielen, die Treppe ist ebenfalls aus Holz gezimmert. Die Möblierung ist modern.

Literatur

Einzelnachweise

Bauwerk in Portland (Oregon)
Neuromanisches Bauwerk in den Vereinigten Staaten
Schulgebäude in den Vereinigten Staaten
Denkmal im National Register of Historic Places (Oregon)
Erbaut in den 1890er Jahren
Bauwerk im Multnomah County
Schulgebäude in Nordamerika

redpajama_set_name: RedPajamaWikipedia


text:
#include <algorithm>
#include <vector>

#include "xenia/base/atomic.h"
#include "xenia/base/clock.h"
#include "xenia/base/logging.h"
#include "xenia/base/mutex.h"
#include "xenia/cpu/processor.h"
#include "xenia/kernel/kernel_state.h"
#include "xenia/kernel/user_module.h"
#include "xenia/kernel/util/shim_utils.h"
#include "xenia/kernel/xboxkrnl/xboxkrnl_private.h"
#include "xenia/kernel/xboxkrnl/xboxkrnl_threading.h"
#include "xenia/kernel/xevent.h"
#include "xenia/kernel/xmutant.h"
#include "xenia/kernel/xsemaphore.h"
#include "xenia/kernel/xthread.h"
#include "xenia/kernel/xtimer.h"
#include "xenia/xbox.h"

namespace xe {
namespace kernel {
namespace xboxkrnl {

// r13 + 0x100: pointer to thread local state
// Thread local state:
//   0x058: kernel time
//   0x14C: thread id
//   0x150: if >0 then error states don't get set
//   0x160: last error

// GetCurrentThreadId:
// lwz       r11, 0x100(r13)
// lwz       r3, 0x14C(r11)

// RtlGetLastError:
// lwz r11, 0x150(r13)
// if (r11 == 0) {
//   lwz r11, 0x100(r13)
//   stw r3, 0x160(r11)
// }

// RtlSetLastError:
// lwz r11, 0x150(r13)
// if (r11 == 0) {
//   lwz r11, 0x100(r13)
//   stw r3, 0x160(r11)
// }

// RtlSetLastNTError:
// r3 = RtlNtStatusToDosError(r3)
// lwz r11, 0x150(r13)
// if (r11 == 0) {
//   lwz r11, 0x100(r13)
//   stw r3, 0x160(r11)
// }

template <typename T>
object_ref<T> LookupNamedObject(KernelState* kernel_state,
                                uint32_t obj_attributes_ptr) {
  // If the name exists and its type matches, we can return that (ref+1)
  // with a success of NAME_EXISTS.
  // If the name exists and its type doesn't match, we do NAME_COLLISION.
  // Otherwise, we add like normal.
  if (!obj_attributes_ptr) {
    return nullptr;
  }
  auto name = X_ANSI_STRING::to_string_indirect(
      kernel_state->memory()->virtual_membase(), obj_attributes_ptr + 4);
  if (!name.empty()) {
    X_HANDLE handle = X_INVALID_HANDLE_VALUE;
    X_RESULT result =
        kernel_state->object_table()->GetObjectByName(name, &handle);
    if (XSUCCEEDED(result)) {
      // Found something! It's been retained, so return.
      auto obj = kernel_state->object_table()->LookupObject<T>(handle);
      if (obj) {
        // The caller will do as it likes.
        obj->ReleaseHandle();
        return obj;
      }
    }
  }
  return nullptr;
}

SHIM_CALL ExCreateThread_shim(PPCContext* ppc_context,
                              KernelState* kernel_state) {
  uint32_t handle_ptr = SHIM_GET_ARG_32(0);
  uint32_t stack_size = SHIM_GET_ARG_32(1);
  uint32_t thread_id_ptr = SHIM_GET_ARG_32(2);
  uint32_t xapi_thread_startup = SHIM_GET_ARG_32(3);
  uint32_t start_address = SHIM_GET_ARG_32(4);
  uint32_t start_context = SHIM_GET_ARG_32(5);
  uint32_t creation_flags = SHIM_GET_ARG_32(6);

  XELOGD("ExCreateThread(%.8X, %d, %.8X, %.8X, %.8X, %.8X, %.8X)", handle_ptr,
         stack_size, thread_id_ptr, xapi_thread_startup, start_address,
         start_context, creation_flags);

  // http://jafile.com/uploads/scoop/main.cpp.txt
  // DWORD
  // LPHANDLE Handle,
  // DWORD    StackSize,
  // LPDWORD  ThreadId,
  // LPVOID   XapiThreadStartup, ?? often 0
  // LPVOID   StartAddress,
  // LPVOID   StartContext,
  // DWORD    CreationFlags // 0x80?

  // Inherit default stack size
  if (stack_size == 0) {
    stack_size = kernel_state->GetExecutableModule()->stack_size();
  }

  // Stack must be aligned to 16kb pages
  stack_size = std::max((uint32_t)0x4000, ((stack_size + 0xFFF) & 0xFFFFF000));

  auto thread = object_ref<XThread>(
      new XThread(kernel_state, stack_size, xapi_thread_startup, start_address,
                  start_context, creation_flags, true));

  X_STATUS result = thread->Create();
  if (XFAILED(result)) {
    // Failed!
    XELOGE("Thread creation failed: %.8X", result);
    SHIM_SET_RETURN_32(result);
    return;
  }

  if (XSUCCEEDED(result)) {
    if (handle_ptr) {
      if (creation_flags & 0x80) {
        SHIM_SET_MEM_32(handle_ptr, thread->guest_object());
      } else {
        SHIM_SET_MEM_32(handle_ptr, thread->handle());
      }
    }
    if (thread_id_ptr) {
      SHIM_SET_MEM_32(thread_id_ptr, thread->thread_id());
    }
  }
  SHIM_SET_RETURN_32(result);
}

SHIM_CALL ExTerminateThread_shim(PPCContext* ppc_context,
                                 KernelState* kernel_state) {
  uint32_t exit_code = SHIM_GET_ARG_32(0);

  XELOGD("ExTerminateThread(%d)", exit_code);

  XThread* thread = XThread::GetCurrentThread();

  // NOTE: this kills us right now. We won't return from it.
  X_STATUS result = thread->Exit(exit_code);
  SHIM_SET_RETURN_32(result);
}

SHIM_CALL NtResumeThread_shim(PPCContext* ppc_context,
                              KernelState* kernel_state) {
  uint32_t handle = SHIM_GET_ARG_32(0);
  uint32_t suspend_count_ptr = SHIM_GET_ARG_32(1);

  XELOGD("NtResumeThread(%.8X, %.8X)", handle, suspend_count_ptr);

  X_RESULT result = X_STATUS_INVALID_HANDLE;
  uint32_t suspend_count = 0;

  auto thread = kernel_state->object_table()->LookupObject<XThread>(handle);
  if (thread) {
    result = thread->Resume(&suspend_count);
  }
  if (suspend_count_ptr) {
    SHIM_SET_MEM_32(suspend_count_ptr, suspend_count);
  }

  SHIM_SET_RETURN_32(result);
}

SHIM_CALL KeResumeThread_shim(PPCContext* ppc_context,
                              KernelState* kernel_state) {
  uint32_t thread_ptr = SHIM_GET_ARG_32(0);

  XELOGD("KeResumeThread(%.8X)", thread_ptr);

  X_STATUS result = X_STATUS_SUCCESS;
  auto thread = XObject::GetNativeObject<XThread>(kernel_state,
                                                  SHIM_MEM_ADDR(thread_ptr));
  if (thread) {
    result = thread->Resume();
  } else {
    result = X_STATUS_INVALID_HANDLE;
  }

  SHIM_SET_RETURN_32(result);
}

SHIM_CALL NtSuspendThread_shim(PPCContext* ppc_context,
                               KernelState* kernel_state) {
  uint32_t handle = SHIM_GET_ARG_32(0);
  uint32_t suspend_count_ptr = SHIM_GET_ARG_32(1);

  XELOGD("NtSuspendThread(%.8X, %.8X)", handle, suspend_count_ptr);

  X_RESULT result = X_STATUS_SUCCESS;
  uint32_t suspend_count = 0;

  auto thread = kernel_state->object_table()->LookupObject<XThread>(handle);
  if (thread) {
    result = thread->Suspend(&suspend_count);
  } else {
    result = X_STATUS_INVALID_HANDLE;
  }

  if (suspend_count_ptr) {
    SHIM_SET_MEM_32(suspend_count_ptr, suspend_count);
  }

  SHIM_SET_RETURN_32(result);
}

void KeSetCurrentStackPointers(lpvoid_t stack_ptr,
                               pointer_t<X_KTHREAD> cur_thread,
                               lpvoid_t stack_alloc_base, lpvoid_t stack_base,
                               lpvoid_t stack_limit) {
  auto thread = XThread::GetCurrentThread();
  auto context = thread->thread_state()->context();
  context->r[1] = stack_ptr.guest_address();

  auto pcr =
      kernel_memory()->TranslateVirtual<X_KPCR*>((uint32_t)context->r[13]);
  pcr->stack_base_ptr = stack_base.guest_address();
  pcr->stack_end_ptr = stack_limit.guest_address();

  // TODO: Do we need to set the stack info on cur_thread?
}
DECLARE_XBOXKRNL_EXPORT(KeSetCurrentStackPointers,
                        ExportTag::kThreading | ExportTag::kImplemented);

SHIM_CALL KeSetAffinityThread_shim(PPCContext* ppc_context,
                                   KernelState* kernel_state) {
  uint32_t thread_ptr = SHIM_GET_ARG_32(0);
  uint32_t affinity = SHIM_GET_ARG_32(1);

  XELOGD("KeSetAffinityThread(%.8X, %.8X)", thread_ptr, affinity);

  auto thread = XObject::GetNativeObject<XThread>(kernel_state,
                                                  SHIM_MEM_ADDR(thread_ptr));
  if (thread) {
    thread->SetAffinity(affinity);
  }

  SHIM_SET_RETURN_32(affinity);
}

SHIM_CALL KeQueryBasePriorityThread_shim(PPCContext* ppc_context,
                                         KernelState* kernel_state) {
  uint32_t thread_ptr = SHIM_GET_ARG_32(0);

  XELOGD("KeQueryBasePriorityThread(%.8X)", thread_ptr);

  int32_t priority = 0;

  auto thread = XObject::GetNativeObject<XThread>(kernel_state,
                                                  SHIM_MEM_ADDR(thread_ptr));
  if (thread) {
    priority = thread->QueryPriority();
  }

  SHIM_SET_RETURN_32(priority);
}

SHIM_CALL KeSetBasePriorityThread_shim(PPCContext* ppc_context,
                                       KernelState* kernel_state) {
  uint32_t thread_ptr = SHIM_GET_ARG_32(0);
  uint32_t increment = SHIM_GET_ARG_32(1);

  XELOGD("KeSetBasePriorityThread(%.8X, %.8X)", thread_ptr, increment);

  int32_t prev_priority = 0;
  auto thread = XObject::GetNativeObject<XThread>(kernel_state,
                                                  SHIM_MEM_ADDR(thread_ptr));

  if (thread) {
    prev_priority = thread->QueryPriority();
    thread->SetPriority(increment);
  }

  SHIM_SET_RETURN_32(prev_priority);
}

SHIM_CALL KeSetDisableBoostThread_shim(PPCContext* ppc_context,
                                       KernelState* kernel_state) {
  uint32_t thread_ptr = SHIM_GET_ARG_32(0);
  uint32_t disabled = SHIM_GET_ARG_32(1);

  XELOGD("KeSetDisableBoostThread(%.8X, %.8X)", thread_ptr, disabled);

  auto thread = XObject::GetNativeObject<XThread>(kernel_state,
                                                  SHIM_MEM_ADDR(thread_ptr));
  if (thread) {
    // Uhm?
  }

  SHIM_SET_RETURN_32(0);
}

SHIM_CALL KeGetCurrentProcessType_shim(PPCContext* ppc_context,
                                       KernelState* kernel_state) {
  // XELOGD(
  //     "KeGetCurrentProcessType()");

  // DWORD

  SHIM_SET_RETURN_32(kernel_state->process_type());
}

SHIM_CALL KeSetCurrentProcessType_shim(PPCContext* ppc_context,
                                       KernelState* kernel_state) {
  uint32_t type = SHIM_GET_ARG_32(0);
  // One of X_PROCTYPE_?

  XELOGD("KeSetCurrentProcessType(%d)", type);

  assert_true(type <= 2);

  kernel_state->set_process_type(type);
}

SHIM_CALL KeQueryPerformanceFrequency_shim(PPCContext* ppc_context,
                                           KernelState* kernel_state) {
  // XELOGD(
  //     "KeQueryPerformanceFrequency()");

  uint64_t result = Clock::guest_tick_frequency();
  SHIM_SET_RETURN_32(result);
}

dword_result_t KeDelayExecutionThread(dword_t processor_mode, dword_t alertable,
                                      lpqword_t interval_ptr) {
  XThread* thread = XThread::GetCurrentThread();
  X_STATUS result = thread->Delay(processor_mode, alertable, *interval_ptr);

  return result;
}
DECLARE_XBOXKRNL_EXPORT(KeDelayExecutionThread,
                        ExportTag::kImplemented | ExportTag::kThreading |
                            ExportTag::kHighFrequency | ExportTag::kBlocking);

SHIM_CALL NtYieldExecution_shim(PPCContext* ppc_context,
                                KernelState* kernel_state) {
  // XELOGD("NtYieldExecution()");
  auto thread = XThread::GetCurrentThread();
  thread->Delay(0, 0, 0);
  SHIM_SET_RETURN_32(0);
}

SHIM_CALL KeQuerySystemTime_shim(PPCContext* ppc_context,
                                 KernelState* kernel_state) {
  uint32_t time_ptr = SHIM_GET_ARG_32(0);

  XELOGD("KeQuerySystemTime(%.8X)", time_ptr);

  uint64_t time = Clock::QueryGuestSystemTime();
  if (time_ptr) {
    SHIM_SET_MEM_64(time_ptr, time);
  }
}

// http://msdn.microsoft.com/en-us/library/ms686801
dword_result_t KeTlsAlloc() {
  uint32_t slot = kernel_state()->AllocateTLS();
  XThread::GetCurrentThread()->SetTLSValue(slot, 0);

  return slot;
}
DECLARE_XBOXKRNL_EXPORT(KeTlsAlloc, ExportTag::kImplemented);

// http://msdn.microsoft.com/en-us/library/ms686804
dword_result_t KeTlsFree(dword_t tls_index) {
  if (tls_index == X_TLS_OUT_OF_INDEXES) {
    return 0;
  }

  kernel_state()->FreeTLS(tls_index);
  return 1;
}
DECLARE_XBOXKRNL_EXPORT(KeTlsFree, ExportTag::kImplemented);

// http://msdn.microsoft.com/en-us/library/ms686812
dword_result_t KeTlsGetValue(dword_t tls_index) {
  // xboxkrnl doesn't actually have an error branch - it always succeeds, even
  // if it overflows the TLS.
  uint32_t value = 0;
  if (XThread::GetCurrentThread()->GetTLSValue(tls_index, &value)) {
    return value;
  }

  return 0;
}
DECLARE_XBOXKRNL_EXPORT(KeTlsGetValue,
                        ExportTag::kImplemented | ExportTag::kHighFrequency);

// http://msdn.microsoft.com/en-us/library/ms686818
dword_result_t KeTlsSetValue(dword_t tls_index, dword_t tls_value) {
  // xboxkrnl doesn't actually have an error branch - it always succeeds, even
  // if it overflows the TLS.
  if (XThread::GetCurrentThread()->SetTLSValue(tls_index, tls_value)) {
    return 1;
  }

  return 0;
}
DECLARE_XBOXKRNL_EXPORT(KeTlsSetValue, ExportTag::kImplemented);

void KeInitializeEvent(pointer_t<X_KEVENT> event_ptr, dword_t event_type,
                       dword_t initial_state) {
  event_ptr.Zero();
  event_ptr->header.type = event_type;
  event_ptr->header.signal_state = (uint32_t)initial_state;
  auto ev =
      XObject::GetNativeObject<XEvent>(kernel_state(), event_ptr, event_type);
  if (!ev) {
    assert_always();
    return;
  }
}
DECLARE_XBOXKRNL_EXPORT(KeInitializeEvent,
                        ExportTag::kImplemented | ExportTag::kThreading);

dword_result_t KeSetEvent(pointer_t<X_KEVENT> event_ptr, dword_t increment,
                          dword_t wait) {
  auto ev = XObject::GetNativeObject<XEvent>(kernel_state(), event_ptr);
  if (!ev) {
    assert_always();
    return 0;
  }

  return ev->Set(increment, !!wait);
}
DECLARE_XBOXKRNL_EXPORT(KeSetEvent,
                        ExportTag::kImplemented | ExportTag::kThreading);

dword_result_t KePulseEvent(pointer_t<X_KEVENT> event_ptr, dword_t increment,
                            dword_t wait) {
  auto ev = XObject::GetNativeObject<XEvent>(kernel_state(), event_ptr);
  if (!ev) {
    assert_always();
    return 0;
  }

  return ev->Pulse(increment, !!wait);
}
DECLARE_XBOXKRNL_EXPORT(KePulseEvent, ExportTag::kImplemented);

dword_result_t KeResetEvent(pointer_t<X_KEVENT> event_ptr) {
  auto ev = XObject::GetNativeObject<XEvent>(kernel_state(), event_ptr);
  if (!ev) {
    assert_always();
    return 0;
  }

  return ev->Reset();
}
DECLARE_XBOXKRNL_EXPORT(KeResetEvent,
                        ExportTag::kImplemented | ExportTag::kThreading);

dword_result_t NtCreateEvent(lpdword_t handle_ptr,
                             pointer_t<X_OBJECT_ATTRIBUTES> obj_attributes_ptr,
                             dword_t event_type, dword_t initial_state) {
  // Check for an existing timer with the same name.
  auto existing_object =
      LookupNamedObject<XEvent>(kernel_state(), obj_attributes_ptr);
  if (existing_object) {
    if (existing_object->type() == XObject::kTypeEvent) {
      if (handle_ptr) {
        existing_object->RetainHandle();
        *handle_ptr = existing_object->handle();
      }
      return X_STATUS_SUCCESS;
    } else {
      return X_STATUS_INVALID_HANDLE;
    }
  }

  XEvent* ev = new XEvent(kernel_state());
  ev->Initialize(!event_type, !!initial_state);

  // obj_attributes may have a name inside of it, if != NULL.
  if (obj_attributes_ptr) {
    ev->SetAttributes(obj_attributes_ptr);
  }

  if (handle_ptr) {
    *handle_ptr = ev->handle();
  }
  return X_STATUS_SUCCESS;
}
DECLARE_XBOXKRNL_EXPORT(NtCreateEvent,
                        ExportTag::kImplemented | ExportTag::kThreading);

dword_result_t NtSetEvent(dword_t handle, lpdword_t previous_state_ptr) {
  X_STATUS result = X_STATUS_SUCCESS;

  auto ev = kernel_state()->object_table()->LookupObject<XEvent>(handle);
  if (ev) {
    int32_t was_signalled = ev->Set(0, false);
    if (previous_state_ptr) {
      *previous_state_ptr = static_cast<uint32_t>(was_signalled);
    }
  } else {
    result = X_STATUS_INVALID_HANDLE;
  }

  return result;
}
DECLARE_XBOXKRNL_EXPORT(NtSetEvent,
                        ExportTag::kImplemented | ExportTag::kThreading);

dword_result_t NtPulseEvent(dword_t handle, lpdword_t previous_state_ptr) {
  X_STATUS result = X_STATUS_SUCCESS;

  auto ev = kernel_state()->object_table()->LookupObject<XEvent>(handle);
  if (ev) {
    int32_t was_signalled = ev->Pulse(0, false);
    if (previous_state_ptr) {
      *previous_state_ptr = static_cast<uint32_t>(was_signalled);
    }
  } else {
    result = X_STATUS_INVALID_HANDLE;
  }

  return result;
}
DECLARE_XBOXKRNL_EXPORT(NtPulseEvent,
                        ExportTag::kImplemented | ExportTag::kThreading);

dword_result_t NtClearEvent(dword_t handle) {
  X_STATUS result = X_STATUS_SUCCESS;

  auto ev = kernel_state()->object_table()->LookupObject<XEvent>(handle);
  if (ev) {
    ev->Reset();
  } else {
    result = X_STATUS_INVALID_HANDLE;
  }

  return result;
}
DECLARE_XBOXKRNL_EXPORT(NtClearEvent,
                        ExportTag::kImplemented | ExportTag::kThreading);

// https://msdn.microsoft.com/en-us/library/windows/hardware/ff552150(v=vs.85).aspx
void KeInitializeSemaphore(pointer_t<X_KSEMAPHORE> semaphore_ptr, dword_t count,
                           dword_t limit) {
  semaphore_ptr->header.type = 5;  // SemaphoreObject
  semaphore_ptr->header.signal_state = (uint32_t)count;
  semaphore_ptr->limit = (uint32_t)limit;

  auto sem = XObject::GetNativeObject<XSemaphore>(kernel_state(), semaphore_ptr,
                                                  5 /* SemaphoreObject */);
  if (!sem) {
    assert_always();
    return;
  }
}
DECLARE_XBOXKRNL_EXPORT(KeInitializeSemaphore,
                        ExportTag::kImplemented | ExportTag::kThreading);

dword_result_t KeReleaseSemaphore(pointer_t<X_KSEMAPHORE> semaphore_ptr,
                                  dword_t increment, dword_t adjustment,
                                  dword_t wait) {
  auto sem =
      XObject::GetNativeObject<XSemaphore>(kernel_state(), semaphore_ptr);
  if (!sem) {
    assert_always();
    return 0;
  }

  // TODO(benvanik): increment thread priority?
  // TODO(benvanik): wait?

  return sem->ReleaseSemaphore(adjustment);
}
DECLARE_XBOXKRNL_EXPORT(KeReleaseSemaphore,
                        ExportTag::kImplemented | ExportTag::kThreading);

SHIM_CALL NtCreateSemaphore_shim(PPCContext* ppc_context,
                                 KernelState* kernel_state) {
  uint32_t handle_ptr = SHIM_GET_ARG_32(0);
  uint32_t obj_attributes_ptr = SHIM_GET_ARG_32(1);
  int32_t count = SHIM_GET_ARG_32(2);
  int32_t limit = SHIM_GET_ARG_32(3);

  XELOGD("NtCreateSemaphore(%.8X, %.8X, %d, %d)", handle_ptr,
         obj_attributes_ptr, count, limit);

  // Check for an existing timer with the same name.
  auto existing_object =
      LookupNamedObject<XSemaphore>(kernel_state, obj_attributes_ptr);
  if (existing_object) {
    if (existing_object->type() == XObject::kTypeSemaphore) {
      if (handle_ptr) {
        existing_object->RetainHandle();
        SHIM_SET_MEM_32(handle_ptr, existing_object->handle());
      }
      SHIM_SET_RETURN_32(X_STATUS_SUCCESS);
    } else {
      SHIM_SET_RETURN_32(X_STATUS_INVALID_HANDLE);
    }
    return;
  }

  auto sem = object_ref<XSemaphore>(new XSemaphore(kernel_state));
  sem->Initialize(count, limit);

  // obj_attributes may have a name inside of it, if != NULL.
  if (obj_attributes_ptr) {
    sem->SetAttributes(obj_attributes_ptr);
  }

  if (handle_ptr) {
    SHIM_SET_MEM_32(handle_ptr, sem->handle());
  }

  SHIM_SET_RETURN_32(X_STATUS_SUCCESS);
}

SHIM_CALL NtReleaseSemaphore_shim(PPCContext* ppc_context,
                                  KernelState* kernel_state) {
  uint32_t sem_handle = SHIM_GET_ARG_32(0);
  int32_t release_count = SHIM_GET_ARG_32(1);
  int32_t previous_count_ptr = SHIM_GET_ARG_32(2);

  XELOGD("NtReleaseSemaphore(%.8X, %d, %.8X)", sem_handle, release_count,
         previous_count_ptr);

  X_STATUS result = X_STATUS_SUCCESS;
  int32_t previous_count = 0;

  auto sem = kernel_state->object_table()->LookupObject<XSemaphore>(sem_handle);
  if (sem) {
    previous_count = sem->ReleaseSemaphore(release_count);
  } else {
    result = X_STATUS_INVALID_HANDLE;
  }
  if (previous_count_ptr) {
    SHIM_SET_MEM_32(previous_count_ptr, previous_count);
  }

  SHIM_SET_RETURN_32(result);
}

dword_result_t NtCreateMutant(lpdword_t handle_out,
                              pointer_t<X_OBJECT_ATTRIBUTES> obj_attributes,
                              dword_t initial_owner) {
  // Check for an existing timer with the same name.
  auto existing_object = LookupNamedObject<XMutant>(
      kernel_state(), obj_attributes.guest_address());
  if (existing_object) {
    if (existing_object->type() == XObject::kTypeMutant) {
      if (handle_out) {
        existing_object->RetainHandle();
        *handle_out = existing_object->handle();
      }
      return X_STATUS_SUCCESS;
    } else {
      return X_STATUS_INVALID_HANDLE;
    }
  }

  XMutant* mutant = new XMutant(kernel_state());
  mutant->Initialize(initial_owner ? true : false);

  // obj_attributes may have a name inside of it, if != NULL.
  if (obj_attributes) {
    mutant->SetAttributes(obj_attributes);
  }

  if (handle_out) {
    *handle_out = mutant->handle();
  }

  return X_STATUS_SUCCESS;
}
DECLARE_XBOXKRNL_EXPORT(NtCreateMutant, ExportTag::kImplemented);

SHIM_CALL NtReleaseMutant_shim(PPCContext* ppc_context,
                               KernelState* kernel_state) {
  uint32_t mutant_handle = SHIM_GET_ARG_32(0);
  int32_t unknown = SHIM_GET_ARG_32(1);
  // This doesn't seem to be supported.
  // int32_t previous_count_ptr = SHIM_GET_ARG_32(2);

  // Whatever arg 1 is all games seem to set it to 0, so whether it's
  // abandon or wait we just say false. Which is good, cause they are
  // both ignored.
  assert_zero(unknown);
  uint32_t priority_increment = 0;
  bool abandon = false;
  bool wait = false;

  XELOGD("NtReleaseMutant(%.8X, %.8X)", mutant_handle, unknown);

  X_STATUS result = X_STATUS_SUCCESS;

  auto mutant =
      kernel_state->object_table()->LookupObject<XMutant>(mutant_handle);
  if (mutant) {
    result = mutant->ReleaseMutant(priority_increment, abandon, wait);
  } else {
    result = X_STATUS_INVALID_HANDLE;
  }

  SHIM_SET_RETURN_32(result);
}

SHIM_CALL NtCreateTimer_shim(PPCContext* ppc_context,
                             KernelState* kernel_state) {
  uint32_t handle_ptr = SHIM_GET_ARG_32(0);
  uint32_t obj_attributes_ptr = SHIM_GET_ARG_32(1);
  uint32_t timer_type = SHIM_GET_ARG_32(2);

  // timer_type = NotificationTimer (0) or SynchronizationTimer (1)

  XELOGD("NtCreateTimer(%.8X, %.8X, %.1X)", handle_ptr, obj_attributes_ptr,
         timer_type);

  // Check for an existing timer with the same name.
  auto existing_object =
      LookupNamedObject<XTimer>(kernel_state, obj_attributes_ptr);
  if (existing_object) {
    if (existing_object->type() == XObject::kTypeTimer) {
      if (handle_ptr) {
        existing_object->RetainHandle();
        SHIM_SET_MEM_32(handle_ptr, existing_object->handle());
      }
      SHIM_SET_RETURN_32(X_STATUS_SUCCESS);
    } else {
      SHIM_SET_RETURN_32(X_STATUS_INVALID_HANDLE);
    }
    return;
  }

  XTimer* timer = new XTimer(kernel_state);
  timer->Initialize(timer_type);

  // obj_attributes may have a name inside of it, if != NULL.
  if (obj_attributes_ptr) {
    timer->SetAttributes(obj_attributes_ptr);
  }

  if (handle_ptr) {
    SHIM_SET_MEM_32(handle_ptr, timer->handle());
  }

  SHIM_SET_RETURN_32(X_STATUS_SUCCESS);
}

SHIM_CALL NtSetTimerEx_shim(PPCContext* ppc_context,
                            KernelState* kernel_state) {
  uint32_t timer_handle = SHIM_GET_ARG_32(0);
  uint32_t due_time_ptr = SHIM_GET_ARG_32(1);
  uint32_t routine = SHIM_GET_ARG_32(2);  // PTIMERAPCROUTINE
  uint32_t unk_one = SHIM_GET_ARG_32(3);
  uint32_t routine_arg = SHIM_GET_ARG_32(4);
  uint32_t resume = SHIM_GET_ARG_32(5);
  uint32_t period_ms = SHIM_GET_ARG_32(6);
  uint32_t unk_zero = SHIM_GET_ARG_32(7);

  assert_true(unk_one == 1);
  assert_true(unk_zero == 0);

  uint64_t due_time = SHIM_MEM_64(due_time_ptr);

  XELOGD("NtSetTimerEx(%.8X, %.8X(%lld), %.8X, %.8X, %.8X, %.1X, %d, %.8X)",
         timer_handle, due_time_ptr, due_time, routine, unk_one, routine_arg,
         resume, period_ms, unk_zero);

  X_STATUS result = X_STATUS_SUCCESS;

  auto timer = kernel_state->object_table()->LookupObject<XTimer>(timer_handle);
  if (timer) {
    result = timer->SetTimer(due_time, period_ms, routine, routine_arg,
                             resume ? true : false);
  } else {
    result = X_STATUS_INVALID_HANDLE;
  }

  SHIM_SET_RETURN_32(result);
}

SHIM_CALL NtCancelTimer_shim(PPCContext* ppc_context,
                             KernelState* kernel_state) {
  uint32_t timer_handle = SHIM_GET_ARG_32(0);
  uint32_t current_state_ptr = SHIM_GET_ARG_32(1);

  XELOGD("NtCancelTimer(%.8X, %.8X)", timer_handle, current_state_ptr);

  X_STATUS result = X_STATUS_SUCCESS;

  auto timer = kernel_state->object_table()->LookupObject<XTimer>(timer_handle);
  if (timer) {
    result = timer->Cancel();
  } else {
    result = X_STATUS_INVALID_HANDLE;
  }
  if (current_state_ptr) {
    SHIM_SET_MEM_32(current_state_ptr, 0);
  }

  SHIM_SET_RETURN_32(result);
}

dword_result_t KeWaitForSingleObject(lpvoid_t object_ptr, dword_t wait_reason,
                                     dword_t processor_mode, dword_t alertable,
                                     lpqword_t timeout_ptr) {
  auto object = XObject::GetNativeObject<XObject>(kernel_state(), object_ptr);

  if (!object) {
    // The only kind-of failure code (though this should never happen)
    assert_always();
    return X_STATUS_ABANDONED_WAIT_0;
  }

  uint64_t timeout = timeout_ptr ? static_cast<uint64_t>(*timeout_ptr) : 0u;
  X_STATUS result = object->Wait(wait_reason, processor_mode, alertable,
                                 timeout_ptr ? &timeout : nullptr);

  return result;
}
DECLARE_XBOXKRNL_EXPORT(KeWaitForSingleObject, ExportTag::kImplemented |
                                                   ExportTag::kThreading |
                                                   ExportTag::kBlocking);

dword_result_t NtWaitForSingleObjectEx(dword_t object_handle, dword_t wait_mode,
                                       dword_t alertable,
                                       lpqword_t timeout_ptr) {
  X_STATUS result = X_STATUS_SUCCESS;

  auto object =
      kernel_state()->object_table()->LookupObject<XObject>(object_handle);
  if (object) {
    uint64_t timeout = timeout_ptr ? static_cast<uint64_t>(*timeout_ptr) : 0u;
    result =
        object->Wait(3, wait_mode, alertable, timeout_ptr ? &timeout : nullptr);
  } else {
    result = X_STATUS_INVALID_HANDLE;
  }

  return result;
}
DECLARE_XBOXKRNL_EXPORT(NtWaitForSingleObjectEx, ExportTag::kImplemented |
                                                     ExportTag::kThreading |
                                                     ExportTag::kBlocking);

dword_result_t KeWaitForMultipleObjects(dword_t count, lpdword_t objects_ptr,
                                        dword_t wait_type, dword_t wait_reason,
                                        dword_t processor_mode,
                                        dword_t alertable,
                                        lpqword_t timeout_ptr,
                                        lpvoid_t wait_block_array_ptr) {
  assert_true(wait_type <= 1);

  X_STATUS result = X_STATUS_SUCCESS;

  std::vector<object_ref<XObject>> objects;
  for (uint32_t n = 0; n < count; n++) {
    auto object_ptr = kernel_memory()->TranslateVirtual(objects_ptr[n]);
    auto object_ref =
        XObject::GetNativeObject<XObject>(kernel_state(), object_ptr);
    if (!object_ref) {
      return X_STATUS_INVALID_PARAMETER;
    }

    objects.push_back(std::move(object_ref));
  }

  uint64_t timeout = timeout_ptr ? static_cast<uint64_t>(*timeout_ptr) : 0u;
  result = XObject::WaitMultiple(uint32_t(objects.size()),
                                 reinterpret_cast<XObject**>(objects.data()),
                                 wait_type, wait_reason, processor_mode,
                                 alertable, timeout_ptr ? &timeout : nullptr);

  return result;
}
DECLARE_XBOXKRNL_EXPORT(KeWaitForMultipleObjects, ExportTag::kImplemented |
                                                      ExportTag::kThreading |
                                                      ExportTag::kBlocking);

dword_result_t NtWaitForMultipleObjectsEx(dword_t count, lpdword_t handles,
                                          dword_t wait_type, dword_t wait_mode,
                                          dword_t alertable,
                                          lpqword_t timeout_ptr) {
  assert_true(wait_type <= 1);
  X_STATUS result = X_STATUS_SUCCESS;

  std::vector<object_ref<XObject>> objects;
  for (uint32_t n = 0; n < count; n++) {
    uint32_t object_handle = handles[n];
    auto object =
        kernel_state()->object_table()->LookupObject<XObject>(object_handle);
    if (!object) {
      return X_STATUS_INVALID_PARAMETER;
    }
    objects.push_back(std::move(object));
  }

  uint64_t timeout = timeout_ptr ? static_cast<uint64_t>(*timeout_ptr) : 0u;
  result = XObject::WaitMultiple(
      count, reinterpret_cast<XObject**>(objects.data()), wait_type, 6,
      wait_mode, alertable, timeout_ptr ? &timeout : nullptr);

  return result;
}
DECLARE_XBOXKRNL_EXPORT(NtWaitForMultipleObjectsEx, ExportTag::kImplemented |
                                                        ExportTag::kThreading |
                                                        ExportTag::kBlocking);

dword_result_t NtSignalAndWaitForSingleObjectEx(dword_t signal_handle,
                                                dword_t wait_handle,
                                                dword_t alertable, dword_t r6,
                                                lpqword_t timeout_ptr) {
  X_STATUS result = X_STATUS_SUCCESS;

  auto signal_object =
      kernel_state()->object_table()->LookupObject<XObject>(signal_handle);
  auto wait_object =
      kernel_state()->object_table()->LookupObject<XObject>(wait_handle);
  if (signal_object && wait_object) {
    uint64_t timeout = timeout_ptr ? static_cast<uint64_t>(*timeout_ptr) : 0u;
    result =
        XObject::SignalAndWait(signal_object.get(), wait_object.get(), 3, 1,
                               alertable, timeout_ptr ? &timeout : nullptr);
  } else {
    result = X_STATUS_INVALID_HANDLE;
  }

  return result;
}
DECLARE_XBOXKRNL_EXPORT(NtSignalAndWaitForSingleObjectEx,
                        ExportTag::kImplemented | ExportTag::kThreading |
                            ExportTag::kBlocking);

dword_result_t KfAcquireSpinLock(lpdword_t lock_ptr) {
  // XELOGD(
  //     "KfAcquireSpinLock(%.8X)",
  //     lock_ptr);

  // Lock.
  auto lock = reinterpret_cast<uint32_t*>(lock_ptr.host_address());
  while (!xe::atomic_cas(0, 1, lock)) {
    // Spin!
    // TODO(benvanik): error on deadlock?
    xe::threading::MaybeYield();
  }

  // Raise IRQL to DISPATCH.
  XThread* thread = XThread::GetCurrentThread();
  auto old_irql = thread->RaiseIrql(2);

  return old_irql;
}
DECLARE_XBOXKRNL_EXPORT(KfAcquireSpinLock,
                        ExportTag::kImplemented | ExportTag::kThreading |
                            ExportTag::kHighFrequency | ExportTag::kBlocking);

void KfReleaseSpinLock(lpdword_t lock_ptr, dword_t old_irql) {
  // Restore IRQL.
  XThread* thread = XThread::GetCurrentThread();
  thread->LowerIrql(old_irql);

  // Unlock.
  auto lock = reinterpret_cast<uint32_t*>(lock_ptr.host_address());
  xe::atomic_dec(lock);
}
DECLARE_XBOXKRNL_EXPORT(KfReleaseSpinLock, ExportTag::kImplemented |
                                               ExportTag::kThreading |
                                               ExportTag::kHighFrequency);

void KeAcquireSpinLockAtRaisedIrql(lpdword_t lock_ptr) {
  // Lock.
  auto lock = reinterpret_cast<uint32_t*>(lock_ptr.host_address());
  while (!xe::atomic_cas(0, 1, lock)) {
    // Spin!
    // TODO(benvanik): error on deadlock?
  }
}
DECLARE_XBOXKRNL_EXPORT(KeAcquireSpinLockAtRaisedIrql,
                        ExportTag::kImplemented | ExportTag::kThreading |
                            ExportTag::kHighFrequency | ExportTag::kBlocking);

void KeReleaseSpinLockFromRaisedIrql(lpdword_t lock_ptr) {
  // Unlock.
  auto lock = reinterpret_cast<uint32_t*>(lock_ptr.host_address());
  xe::atomic_dec(lock);
}
DECLARE_XBOXKRNL_EXPORT(KeReleaseSpinLockFromRaisedIrql,
                        ExportTag::kImplemented | ExportTag::kThreading |
                            ExportTag::kHighFrequency);

SHIM_CALL KeEnterCriticalRegion_shim(PPCContext* ppc_context,
                                     KernelState* kernel_state) {
  // XELOGD(
  //     "KeEnterCriticalRegion()");
  XThread::EnterCriticalRegion();
}

SHIM_CALL KeLeaveCriticalRegion_shim(PPCContext* ppc_context,
                                     KernelState* kernel_state) {
  // XELOGD(
  //     "KeLeaveCriticalRegion()");
  XThread::LeaveCriticalRegion();

  XThread::GetCurrentThread()->CheckApcs();
}

SHIM_CALL KeRaiseIrqlToDpcLevel_shim(PPCContext* ppc_context,
                                     KernelState* kernel_state) {
  // XELOGD(
  //     "KeRaiseIrqlToDpcLevel()");
  auto old_value = kernel_state->processor()->RaiseIrql(cpu::Irql::DPC);
  SHIM_SET_RETURN_32(old_value);
}

SHIM_CALL KfLowerIrql_shim(PPCContext* ppc_context, KernelState* kernel_state) {
  uint32_t old_value = SHIM_GET_ARG_32(0);
  // XELOGD(
  //     "KfLowerIrql(%d)",
  //     old_value);
  kernel_state->processor()->LowerIrql(static_cast<cpu::Irql>(old_value));

  XThread::GetCurrentThread()->CheckApcs();
}

SHIM_CALL NtQueueApcThread_shim(PPCContext* ppc_context,
                                KernelState* kernel_state) {
  uint32_t thread_handle = SHIM_GET_ARG_32(0);
  uint32_t apc_routine = SHIM_GET_ARG_32(1);
  uint32_t arg1 = SHIM_GET_ARG_32(2);
  uint32_t arg2 = SHIM_GET_ARG_32(3);
  uint32_t arg3 = SHIM_GET_ARG_32(4);  // ?
  XELOGD("NtQueueApcThread(%.8X, %.8X, %.8X, %.8X, %.8X)", thread_handle,
         apc_routine, arg1, arg2, arg3);

  // Alloc APC object (from somewhere) and insert.

  assert_always("not implemented");
}

SHIM_CALL KeInitializeApc_shim(PPCContext* ppc_context,
                               KernelState* kernel_state) {
  uint32_t apc_ptr = SHIM_GET_ARG_32(0);
  uint32_t thread = SHIM_GET_ARG_32(1);
  uint32_t kernel_routine = SHIM_GET_ARG_32(2);
  uint32_t rundown_routine = SHIM_GET_ARG_32(3);
  uint32_t normal_routine = SHIM_GET_ARG_32(4);
  uint32_t processor_mode = SHIM_GET_ARG_32(5);
  uint32_t normal_context = SHIM_GET_ARG_32(6);

  XELOGD("KeInitializeApc(%.8X, %.8X, %.8X, %.8X, %.8X, %.8X, %.8X)", apc_ptr,
         thread, kernel_routine, rundown_routine, normal_routine,
         processor_mode, normal_context);

  auto apc = SHIM_STRUCT(XAPC, apc_ptr);
  apc->Initialize();
  apc->processor_mode = processor_mode;
  apc->thread_ptr = thread;
  apc->kernel_routine = kernel_routine;
  apc->rundown_routine = rundown_routine;
  apc->normal_routine = normal_routine;
  apc->normal_context = normal_routine ? normal_context : 0;
}

SHIM_CALL KeInsertQueueApc_shim(PPCContext* ppc_context,
                                KernelState* kernel_state) {
  uint32_t apc_ptr = SHIM_GET_ARG_32(0);
  uint32_t arg1 = SHIM_GET_ARG_32(1);
  uint32_t arg2 = SHIM_GET_ARG_32(2);
  uint32_t priority_increment = SHIM_GET_ARG_32(3);

  XELOGD("KeInsertQueueApc(%.8X, %.8X, %.8X, %.8X)", apc_ptr, arg1, arg2,
         priority_increment);

  auto apc = SHIM_STRUCT(XAPC, apc_ptr);

  auto thread = XObject::GetNativeObject<XThread>(
      kernel_state, SHIM_MEM_ADDR(apc->thread_ptr));
  if (!thread) {
    SHIM_SET_RETURN_32(0);
    return;
  }

  // Lock thread.
  thread->LockApc();

  // Fail if already inserted.
  if (apc->enqueued) {
    thread->UnlockApc(false);
    SHIM_SET_RETURN_32(0);
    return;
  }

  // Prep APC.
  apc->arg1 = arg1;
  apc->arg2 = arg2;
  apc->enqueued = 1;

  auto apc_list = thread->apc_list();

  uint32_t list_entry_ptr = apc_ptr + 8;
  apc_list->Insert(list_entry_ptr);

  // Unlock thread.
  thread->UnlockApc(true);

  SHIM_SET_RETURN_32(1);
}

SHIM_CALL KeRemoveQueueApc_shim(PPCContext* ppc_context,
                                KernelState* kernel_state) {
  uint32_t apc_ptr = SHIM_GET_ARG_32(0);

  XELOGD("KeRemoveQueueApc(%.8X)", apc_ptr);

  bool result = false;

  auto apc = SHIM_STRUCT(XAPC, apc_ptr);

  auto thread = XObject::GetNativeObject<XThread>(
      kernel_state, SHIM_MEM_ADDR(apc->thread_ptr));
  if (!thread) {
    SHIM_SET_RETURN_32(0);
    return;
  }

  thread->LockApc();

  if (!apc->enqueued) {
    thread->UnlockApc(false);
    SHIM_SET_RETURN_32(0);
    return;
  }

  auto apc_list = thread->apc_list();
  uint32_t list_entry_ptr = apc_ptr + 8;
  if (apc_list->IsQueued(list_entry_ptr)) {
    apc_list->Remove(list_entry_ptr);
    result = true;
  }

  thread->UnlockApc(true);

  SHIM_SET_RETURN_32(result ? 1 : 0);
}

SHIM_CALL KiApcNormalRoutineNop_shim(PPCContext* ppc_context,
                                     KernelState* kernel_state) {
  uint32_t unk0 = SHIM_GET_ARG_32(0);  // output?
  uint32_t unk1 = SHIM_GET_ARG_32(1);  // 0x13

  XELOGD("KiApcNormalRoutineNop(%.8X, %.8X)", unk0, unk1);

  SHIM_SET_RETURN_32(0);
}

SHIM_CALL KeInitializeDpc_shim(PPCContext* ppc_context,
                               KernelState* kernel_state) {
  uint32_t dpc_ptr = SHIM_GET_ARG_32(0);
  uint32_t routine = SHIM_GET_ARG_32(1);
  uint32_t context = SHIM_GET_ARG_32(2);

  XELOGD("KeInitializeDpc(%.8X, %.8X, %.8X)", dpc_ptr, routine, context);

  // KDPC (maybe) 0x18 bytes?
  uint32_t type = 19;  // DpcObject
  uint32_t importance = 0;
  uint32_t number = 0;  // ?
  SHIM_SET_MEM_32(dpc_ptr + 0, (type << 24) | (importance << 16) | (number));
  SHIM_SET_MEM_32(dpc_ptr + 4, 0);  // flink
  SHIM_SET_MEM_32(dpc_ptr + 8, 0);  // blink
  SHIM_SET_MEM_32(dpc_ptr + 12, routine);
  SHIM_SET_MEM_32(dpc_ptr + 16, context);
  SHIM_SET_MEM_32(dpc_ptr + 20, 0);  // arg1
  SHIM_SET_MEM_32(dpc_ptr + 24, 0);  // arg2
}

SHIM_CALL KeInsertQueueDpc_shim(PPCContext* ppc_context,
                                KernelState* kernel_state) {
  uint32_t dpc_ptr = SHIM_GET_ARG_32(0);
  uint32_t arg1 = SHIM_GET_ARG_32(1);
  uint32_t arg2 = SHIM_GET_ARG_32(2);

  assert_always("DPC does not dispatch yet; going to hang!");

  XELOGD("KeInsertQueueDpc(%.8X, %.8X, %.8X)", dpc_ptr, arg1, arg2);

  uint32_t list_entry_ptr = dpc_ptr + 4;

  // Lock dispatcher.
  auto global_lock = xe::global_critical_region::AcquireDirect();
  auto dpc_list = kernel_state->dpc_list();

  // If already in a queue, abort.
  if (dpc_list->IsQueued(list_entry_ptr)) {
    SHIM_SET_RETURN_32(0);
    return;
  }

  // Prep DPC.
  SHIM_SET_MEM_32(dpc_ptr + 20, arg1);
  SHIM_SET_MEM_32(dpc_ptr + 24, arg2);

  dpc_list->Insert(list_entry_ptr);

  SHIM_SET_RETURN_32(1);
}

SHIM_CALL KeRemoveQueueDpc_shim(PPCContext* ppc_context,
                                KernelState* kernel_state) {
  uint32_t dpc_ptr = SHIM_GET_ARG_32(0);

  XELOGD("KeRemoveQueueDpc(%.8X)", dpc_ptr);

  bool result = false;

  uint32_t list_entry_ptr = dpc_ptr + 4;

  auto global_lock = xe::global_critical_region::AcquireDirect();
  auto dpc_list = kernel_state->dpc_list();
  if (dpc_list->IsQueued(list_entry_ptr)) {
    dpc_list->Remove(list_entry_ptr);
    result = true;
  }

  SHIM_SET_RETURN_32(result ? 1 : 0);
}

// NOTE: This function is very commonly inlined, and probably won't be called!
pointer_result_t InterlockedPushEntrySList(
    pointer_t<X_SLIST_HEADER> plist_ptr, pointer_t<X_SINGLE_LIST_ENTRY> entry) {
  assert_not_null(plist_ptr);
  assert_not_null(entry);

  alignas(8) X_SLIST_HEADER old_hdr = *plist_ptr;
  alignas(8) X_SLIST_HEADER new_hdr = {0};
  uint32_t old_head = 0;
  do {
    old_hdr = *plist_ptr;
    new_hdr.depth = old_hdr.depth + 1;
    new_hdr.sequence = old_hdr.sequence + 1;

    uint32_t old_head = old_hdr.next.next;
    entry->next = old_hdr.next.next;
    new_hdr.next.next = entry.guest_address();
  } while (
      !xe::atomic_cas(*(uint64_t*)(&old_hdr), *(uint64_t*)(&new_hdr),
                      reinterpret_cast<uint64_t*>(plist_ptr.host_address())));

  return old_head;
}
DECLARE_XBOXKRNL_EXPORT(InterlockedPushEntrySList,
                        ExportTag::kImplemented | ExportTag::kHighFrequency);

pointer_result_t InterlockedPopEntrySList(pointer_t<X_SLIST_HEADER> plist_ptr) {
  assert_not_null(plist_ptr);

  uint32_t popped = 0;
  alignas(8) X_SLIST_HEADER old_hdr = {0};
  alignas(8) X_SLIST_HEADER new_hdr = {0};
  do {
    old_hdr = *plist_ptr;
    auto next = kernel_memory()->TranslateVirtual<X_SINGLE_LIST_ENTRY*>(
        old_hdr.next.next);
    if (!old_hdr.next.next) {
      return 0;
    }
    popped = old_hdr.next.next;

    new_hdr.depth = old_hdr.depth - 1;
    new_hdr.next.next = next->next;
    new_hdr.sequence = old_hdr.sequence;
  } while (
      !xe::atomic_cas(*(uint64_t*)(&old_hdr), *(uint64_t*)(&new_hdr),
                      reinterpret_cast<uint64_t*>(plist_ptr.host_address())));

  return popped;
}
DECLARE_XBOXKRNL_EXPORT(InterlockedPopEntrySList,
                        ExportTag::kImplemented | ExportTag::kHighFrequency);

pointer_result_t InterlockedFlushSList(pointer_t<X_SLIST_HEADER> plist_ptr) {
  assert_not_null(plist_ptr);

  alignas(8) X_SLIST_HEADER old_hdr = *plist_ptr;
  alignas(8) X_SLIST_HEADER new_hdr = {0};
  uint32_t first = 0;
  do {
    old_hdr = *plist_ptr;
    first = old_hdr.next.next;
    new_hdr.next.next = 0;
    new_hdr.depth = 0;
    new_hdr.sequence = 0;
  } while (
      !xe::atomic_cas(*(uint64_t*)(&old_hdr), *(uint64_t*)(&new_hdr),
                      reinterpret_cast<uint64_t*>(plist_ptr.host_address())));

  return first;
}
DECLARE_XBOXKRNL_EXPORT(InterlockedFlushSList, ExportTag::kImplemented);

void RegisterThreadingExports(xe::cpu::ExportResolver* export_resolver,
                              KernelState* kernel_state) {
  SHIM_SET_MAPPING("xboxkrnl.exe", ExCreateThread, state);
  SHIM_SET_MAPPING("xboxkrnl.exe", ExTerminateThread, state);
  SHIM_SET_MAPPING("xboxkrnl.exe", NtResumeThread, state);
  SHIM_SET_MAPPING("xboxkrnl.exe", KeResumeThread, state);
  SHIM_SET_MAPPING("xboxkrnl.exe", NtSuspendThread, state);
  SHIM_SET_MAPPING("xboxkrnl.exe", KeSetAffinityThread, state);
  SHIM_SET_MAPPING("xboxkrnl.exe", KeQueryBasePriorityThread, state);
  SHIM_SET_MAPPING("xboxkrnl.exe", KeSetBasePriorityThread, state);
  SHIM_SET_MAPPING("xboxkrnl.exe", KeSetDisableBoostThread, state);

  SHIM_SET_MAPPING("xboxkrnl.exe", KeGetCurrentProcessType, state);
  SHIM_SET_MAPPING("xboxkrnl.exe", KeSetCurrentProcessType, state);

  SHIM_SET_MAPPING("xboxkrnl.exe", KeQueryPerformanceFrequency, state);
  SHIM_SET_MAPPING("xboxkrnl.exe", NtYieldExecution, state);
  SHIM_SET_MAPPING("xboxkrnl.exe", KeQuerySystemTime, state);

  SHIM_SET_MAPPING("xboxkrnl.exe", NtCreateSemaphore, state);
  SHIM_SET_MAPPING("xboxkrnl.exe", NtReleaseSemaphore, state);

  SHIM_SET_MAPPING("xboxkrnl.exe", NtReleaseMutant, state);

  SHIM_SET_MAPPING("xboxkrnl.exe", NtCreateTimer, state);
  SHIM_SET_MAPPING("xboxkrnl.exe", NtSetTimerEx, state);
  SHIM_SET_MAPPING("xboxkrnl.exe", NtCancelTimer, state);

  SHIM_SET_MAPPING("xboxkrnl.exe", KeEnterCriticalRegion, state);
  SHIM_SET_MAPPING("xboxkrnl.exe", KeLeaveCriticalRegion, state);

  SHIM_SET_MAPPING("xboxkrnl.exe", KeRaiseIrqlToDpcLevel, state);
  SHIM_SET_MAPPING("xboxkrnl.exe", KfLowerIrql, state);

  // SHIM_SET_MAPPING("xboxkrnl.exe", NtQueueApcThread, state);
  SHIM_SET_MAPPING("xboxkrnl.exe", KeInitializeApc, state);
  SHIM_SET_MAPPING("xboxkrnl.exe", KeInsertQueueApc, state);
  SHIM_SET_MAPPING("xboxkrnl.exe", KeRemoveQueueApc, state);
  SHIM_SET_MAPPING("xboxkrnl.exe", KiApcNormalRoutineNop, state);

  SHIM_SET_MAPPING("xboxkrnl.exe", KeInitializeDpc, state);
  SHIM_SET_MAPPING("xboxkrnl.exe", KeInsertQueueDpc, state);
  SHIM_SET_MAPPING("xboxkrnl.exe", KeRemoveQueueDpc, state);
}

}  // namespace xboxkrnl
}  // namespace kernel
}  // namespace xe

redpajama_set_name: RedPajamaGithub


New and genuine Samsung Instrument Panel Cluster Assy – 1023-00022 (14500607).
This Samsung Instrument Panel Cluster Assy – 1023-00022 is to suit a Samsung Excavator SE130LC.
Heavy Duty Parts Australia can also supply the full range of Samsung parts. We can also offer original, OEM and aftermarket parts at competitive prices.
Furthermore, Heavy Duty Parts Australia can also supply the full range of Hyundai, Doosan and Volvo Construction parts.
Check out this story about Samsung Excavator!


Boost Production:Equipped with 18 LED(6 blue & 12 red),The 18W led grow light blub can provides efficient light wavelength to enhance photosynthesis performance and cultivate plants. Blue led provide peak chlorophyll absorption promoting vegetative growth. While Red led promotes absorption of nutrients encouraging budding and blooming. Plants grow fuller and faster.
High Energy Efficiency:Save up to 80% in energy costs compared high pressure sodium, metal halide lamp.high luminous efficiency and long lifespan.life time up to 50,000 hours.
Good Heat Dissipation:High quality aluminum paired with specially designed heat sinks allows the bulb to run much cooler than traditional light sources.without worrying about heat increased.
Application: Widely used in greenhouse plants, flowers, hydroponic systems and vegetable cultivation.a must-have led grow bulb to promote the growth of your plant or fresh vegetables in your garden.
Universal:LED input voltage AC100V - 240V is suitable for worldwide use. Built-in power supply, no other device configuration, plug in the AC - 100V - 240V voltage can work.
1.The LED Grow Light can be easy to use - no special lamp device needed, this type grow light bulbs input voltage AC100V - 240V is suitable for worldwide use.
2.Save up to 80% of energy than traditional high pressure sodium and metal halide lamps. Higher light efficiency, 90% of light emitted can be absorbed by Hydroponics plants.
3.By using high quality aluminum and unique heat sink design to maximize heat dissipation area.
4.This plant growing light can rapidly improve the health of plants and growing, provides the most suitable light spectrum for plants sprout and growth.


Children from low-income families are more likely than those from higher-income families to have poor social, emotional, cognitive, behavioral, and health outcomes. One approach that has helped parents and their young children is home visiting, which provides information, resources, and support to expectant parents and families with young children. This brief summarizes evidence from existing studies on the impact of early childhood home visiting on children 5 and older for four national models of home visiting.
1 What are the effects of home visiting programs for families as children get older?
2 How do the monetary benefits of home visiting compare with their costs?
Evidence-based home visiting has improved outcomes for parents and children across a wide range of child ages, outcome areas, and national models.
The largest benefits from evidence-based home visiting come through reduced spending on government programs and increased individual earnings.
The brief summarizes prior evidence on the effects of four evidence-based models of home visiting using information from seven studies of families with children from 5 to 21 years old. It also summarizes published benefit-cost analyses of these four models.
Michalopoulos, Charles, Kristen Faucetta, Anne Warren, and Robert Mitchell. Evidence on the Long-Term Effects of Home Visiting Programs: Laying the Groundwork for Long-Term Follow-Up in the Mother and Infant Home Visiting Program Evaluation (MIHOPE). OPRE Report 2017-73. Washington, DC: Office of Planning, Research and Evaluation, Administration for Children and Families, U.S. Department of Health and Human Services.